wgts-report 0.1.13 → 0.1.15
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.
- package/dist/assets/wgts-report.css +1 -1
- package/dist/assets/wgts-report.js +85 -60
- package/dist/index.html +2 -2
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var
|
|
1
|
+
var Xx=n=>{throw TypeError(n)};var Uf=(n,a,l)=>a.has(n)||Xx("Cannot "+l);var B=(n,a,l)=>(Uf(n,a,"read from private field"),l?l.call(n):a.get(n)),Ne=(n,a,l)=>a.has(n)?Xx("Cannot add the same private member more than once"):a instanceof WeakSet?a.add(n):a.set(n,l),pe=(n,a,l,i)=>(Uf(n,a,"write to private field"),i?i.call(n,l):a.set(n,l),l),He=(n,a,l)=>(Uf(n,a,"access private method"),l);var _u=(n,a,l,i)=>({set _(c){pe(n,a,c,l)},get _(){return B(n,a,i)}});function lw(n,a){for(var l=0;l<a.length;l++){const i=a[l];if(typeof i!="string"&&!Array.isArray(i)){for(const c in i)if(c!=="default"&&!(c in n)){const d=Object.getOwnPropertyDescriptor(i,c);d&&Object.defineProperty(n,c,d.get?d:{enumerable:!0,get:()=>i[c]})}}}return Object.freeze(Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}))}(function(){const a=document.createElement("link").relList;if(a&&a.supports&&a.supports("modulepreload"))return;for(const c of document.querySelectorAll('link[rel="modulepreload"]'))i(c);new MutationObserver(c=>{for(const d of c)if(d.type==="childList")for(const f of d.addedNodes)f.tagName==="LINK"&&f.rel==="modulepreload"&&i(f)}).observe(document,{childList:!0,subtree:!0});function l(c){const d={};return c.integrity&&(d.integrity=c.integrity),c.referrerPolicy&&(d.referrerPolicy=c.referrerPolicy),c.crossOrigin==="use-credentials"?d.credentials="include":c.crossOrigin==="anonymous"?d.credentials="omit":d.credentials="same-origin",d}function i(c){if(c.ep)return;c.ep=!0;const d=l(c);fetch(c.href,d)}})();function iw(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Bf={exports:{}},Sr={};/**
|
|
2
2
|
* @license React
|
|
3
3
|
* react-jsx-runtime.production.js
|
|
4
4
|
*
|
|
@@ -6,7 +6,7 @@ var Lv=n=>{throw TypeError(n)};var jh=(n,l,a)=>l.has(n)||Lv("Cannot "+a);var F=(
|
|
|
6
6
|
*
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var
|
|
9
|
+
*/var Kx;function ow(){if(Kx)return Sr;Kx=1;var n=Symbol.for("react.transitional.element"),a=Symbol.for("react.fragment");function l(i,c,d){var f=null;if(d!==void 0&&(f=""+d),c.key!==void 0&&(f=""+c.key),"key"in c){d={};for(var m in c)m!=="key"&&(d[m]=c[m])}else d=c;return c=d.ref,{$$typeof:n,type:i,key:f,ref:c!==void 0?c:null,props:d}}return Sr.Fragment=a,Sr.jsx=l,Sr.jsxs=l,Sr}var Zx;function rw(){return Zx||(Zx=1,Bf.exports=ow()),Bf.exports}var r=rw(),Ff={exports:{}},Te={};/**
|
|
10
10
|
* @license React
|
|
11
11
|
* react.production.js
|
|
12
12
|
*
|
|
@@ -14,7 +14,7 @@ var Lv=n=>{throw TypeError(n)};var jh=(n,l,a)=>l.has(n)||Lv("Cannot "+a);var F=(
|
|
|
14
14
|
*
|
|
15
15
|
* This source code is licensed under the MIT license found in the
|
|
16
16
|
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var
|
|
17
|
+
*/var Jx;function cw(){if(Jx)return Te;Jx=1;var n=Symbol.for("react.transitional.element"),a=Symbol.for("react.portal"),l=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),c=Symbol.for("react.profiler"),d=Symbol.for("react.consumer"),f=Symbol.for("react.context"),m=Symbol.for("react.forward_ref"),g=Symbol.for("react.suspense"),v=Symbol.for("react.memo"),x=Symbol.for("react.lazy"),p=Symbol.for("react.activity"),b=Symbol.for("react.view_transition"),S=Symbol.iterator;function j(k){return k===null||typeof k!="object"?null:(k=S&&k[S]||k["@@iterator"],typeof k=="function"?k:null)}var N={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},R=Object.assign,A={};function T(k,U,V){this.props=k,this.context=U,this.refs=A,this.updater=V||N}T.prototype.isReactComponent={},T.prototype.setState=function(k,U){if(typeof k!="object"&&typeof k!="function"&&k!=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,k,U,"setState")},T.prototype.forceUpdate=function(k){this.updater.enqueueForceUpdate(this,k,"forceUpdate")};function O(){}O.prototype=T.prototype;function M(k,U,V){this.props=k,this.context=U,this.refs=A,this.updater=V||N}var E=M.prototype=new O;E.constructor=M,R(E,T.prototype),E.isPureReactComponent=!0;var _=Array.isArray;function D(){}var P={H:null,A:null,T:null,S:null},Z=Object.prototype.hasOwnProperty;function z(k,U,V){var oe=V.ref;return{$$typeof:n,type:k,key:U,ref:oe!==void 0?oe:null,props:V}}function te(k,U){return z(k.type,U,k.props)}function ie(k){return typeof k=="object"&&k!==null&&k.$$typeof===n}function J(k){var U={"=":"=0",":":"=2"};return"$"+k.replace(/[=:]/g,function(V){return U[V]})}var se=/\/+/g;function re(k,U){return typeof k=="object"&&k!==null&&k.key!=null?J(""+k.key):U.toString(36)}function $(k){switch(k.status){case"fulfilled":return k.value;case"rejected":throw k.reason;default:switch(typeof k.status=="string"?k.then(D,D):(k.status="pending",k.then(function(U){k.status==="pending"&&(k.status="fulfilled",k.value=U)},function(U){k.status==="pending"&&(k.status="rejected",k.reason=U)})),k.status){case"fulfilled":return k.value;case"rejected":throw k.reason}}throw k}function G(k,U,V,oe,de){var be=typeof k;(be==="undefined"||be==="boolean")&&(k=null);var Me=!1;if(k===null)Me=!0;else switch(be){case"bigint":case"string":case"number":Me=!0;break;case"object":switch(k.$$typeof){case n:case a:Me=!0;break;case x:return Me=k._init,G(Me(k._payload),U,V,oe,de)}}if(Me)return de=de(k),Me=oe===""?"."+re(k,0):oe,_(de)?(V="",Me!=null&&(V=Me.replace(se,"$&/")+"/"),G(de,U,V,"",function(ut){return ut})):de!=null&&(ie(de)&&(de=te(de,V+(de.key==null||k&&k.key===de.key?"":(""+de.key).replace(se,"$&/")+"/")+Me)),U.push(de)),1;Me=0;var ge=oe===""?".":oe+":";if(_(k))for(var ve=0;ve<k.length;ve++)oe=k[ve],be=ge+re(oe,ve),Me+=G(oe,U,V,be,de);else if(ve=j(k),typeof ve=="function")for(k=ve.call(k),ve=0;!(oe=k.next()).done;)oe=oe.value,be=ge+re(oe,ve++),Me+=G(oe,U,V,be,de);else if(be==="object"){if(typeof k.then=="function")return G($(k),U,V,oe,de);throw U=String(k),Error("Objects are not valid as a React child (found: "+(U==="[object Object]"?"object with keys {"+Object.keys(k).join(", ")+"}":U)+"). If you meant to render a collection of children, use an array instead.")}return Me}function X(k,U,V){if(k==null)return k;var oe=[],de=0;return G(k,oe,"","",function(be){return U.call(V,be,de++)}),oe}function le(k){if(k._status===-1){var U=k._result,V=U();V.then(function(oe){(k._status===0||k._status===-1)&&(k._status=1,k._result=oe,V.status===void 0&&(V.status="fulfilled",V.value=oe))},function(oe){(k._status===0||k._status===-1)&&(k._status=2,k._result=oe,V.status===void 0&&(V.status="rejected",V.reason=oe))}),k._status===-1&&(k._status=0,k._result=V)}if(k._status===1)return k._result.default;throw k._result}var ae=typeof reportError=="function"?reportError:function(k){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var U=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof k=="object"&&k!==null&&typeof k.message=="string"?String(k.message):String(k),error:k});if(!window.dispatchEvent(U))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",k);return}console.error(k)};function me(k){var U=P.T,V={};V.types=U!==null?U.types:null,P.T=V;try{var oe=k(),de=P.S;de!==null&&de(V,oe),typeof oe=="object"&&oe!==null&&typeof oe.then=="function"&&oe.then(D,ae)}catch(be){ae(be)}finally{U!==null&&V.types!==null&&(U.types=V.types),P.T=U}}function Se(k){var U=P.T;if(U!==null){var V=U.types;V===null?U.types=[k]:V.indexOf(k)===-1&&V.push(k)}else me(Se.bind(null,k))}var ce={map:X,forEach:function(k,U,V){X(k,function(){U.apply(this,arguments)},V)},count:function(k){var U=0;return X(k,function(){U++}),U},toArray:function(k){return X(k,function(U){return U})||[]},only:function(k){if(!ie(k))throw Error("React.Children.only expected to receive a single React element child.");return k}};return Te.Activity=p,Te.Children=ce,Te.Component=T,Te.Fragment=l,Te.Profiler=c,Te.PureComponent=M,Te.StrictMode=i,Te.Suspense=g,Te.ViewTransition=b,Te.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=P,Te.__COMPILER_RUNTIME={__proto__:null,c:function(k){return P.H.useMemoCache(k)}},Te.addTransitionType=Se,Te.cache=function(k){return function(){return k.apply(null,arguments)}},Te.cacheSignal=function(){return null},Te.cloneElement=function(k,U,V){if(k==null)throw Error("The argument must be a React element, but you passed "+k+".");var oe=R({},k.props),de=k.key;if(U!=null)for(be in U.key!==void 0&&(de=""+U.key),U)!Z.call(U,be)||be==="key"||be==="__self"||be==="__source"||be==="ref"&&U.ref===void 0||(oe[be]=U[be]);var be=arguments.length-2;if(be===1)oe.children=V;else if(1<be){for(var Me=Array(be),ge=0;ge<be;ge++)Me[ge]=arguments[ge+2];oe.children=Me}return z(k.type,de,oe)},Te.createContext=function(k){return k={$$typeof:f,_currentValue:k,_currentValue2:k,_threadCount:0,Provider:null,Consumer:null},k.Provider=k,k.Consumer={$$typeof:d,_context:k},k},Te.createElement=function(k,U,V){var oe,de={},be=null;if(U!=null)for(oe in U.key!==void 0&&(be=""+U.key),U)Z.call(U,oe)&&oe!=="key"&&oe!=="__self"&&oe!=="__source"&&(de[oe]=U[oe]);var Me=arguments.length-2;if(Me===1)de.children=V;else if(1<Me){for(var ge=Array(Me),ve=0;ve<Me;ve++)ge[ve]=arguments[ve+2];de.children=ge}if(k&&k.defaultProps)for(oe in Me=k.defaultProps,Me)de[oe]===void 0&&(de[oe]=Me[oe]);return z(k,be,de)},Te.createRef=function(){return{current:null}},Te.forwardRef=function(k){return{$$typeof:m,render:k}},Te.isValidElement=ie,Te.lazy=function(k){return{$$typeof:x,_payload:{_status:-1,_result:k},_init:le}},Te.memo=function(k,U){return{$$typeof:v,type:k,compare:U===void 0?null:U}},Te.startTransition=me,Te.unstable_useCacheRefresh=function(){return P.H.useCacheRefresh()},Te.use=function(k){return P.H.use(k)},Te.useActionState=function(k,U,V){return P.H.useActionState(k,U,V)},Te.useCallback=function(k,U){return P.H.useCallback(k,U)},Te.useContext=function(k){return P.H.useContext(k)},Te.useDebugValue=function(){},Te.useDeferredValue=function(k,U){return P.H.useDeferredValue(k,U)},Te.useEffect=function(k,U){return P.H.useEffect(k,U)},Te.useEffectEvent=function(k){return P.H.useEffectEvent(k)},Te.useId=function(){return P.H.useId()},Te.useImperativeHandle=function(k,U,V){return P.H.useImperativeHandle(k,U,V)},Te.useInsertionEffect=function(k,U){return P.H.useInsertionEffect(k,U)},Te.useLayoutEffect=function(k,U){return P.H.useLayoutEffect(k,U)},Te.useMemo=function(k,U){return P.H.useMemo(k,U)},Te.useOptimistic=function(k,U){return P.H.useOptimistic(k,U)},Te.useReducer=function(k,U,V){return P.H.useReducer(k,U,V)},Te.useRef=function(k){return P.H.useRef(k)},Te.useState=function(k){return P.H.useState(k)},Te.useSyncExternalStore=function(k,U,V){return P.H.useSyncExternalStore(k,U,V)},Te.useTransition=function(){return P.H.useTransition()},Te.version="19.3.1",Te}var Wx;function wg(){return Wx||(Wx=1,Ff.exports=cw()),Ff.exports}var C=wg();const uw=iw(C),dw=lw({__proto__:null,default:uw},[C]);var Vf={exports:{}},jr={},Gf={exports:{}},qf={};/**
|
|
18
18
|
* @license React
|
|
19
19
|
* scheduler.production.js
|
|
20
20
|
*
|
|
@@ -22,7 +22,7 @@ var Lv=n=>{throw TypeError(n)};var jh=(n,l,a)=>l.has(n)||Lv("Cannot "+a);var F=(
|
|
|
22
22
|
*
|
|
23
23
|
* This source code is licensed under the MIT license found in the
|
|
24
24
|
* LICENSE file in the root directory of this source tree.
|
|
25
|
-
*/var
|
|
25
|
+
*/var ev;function hw(){return ev||(ev=1,(function(n){function a($,G){var X=$.length;$.push(G);e:for(;0<X;){var le=X-1>>>1,ae=$[le];if(0<c(ae,G))$[le]=G,$[X]=ae,X=le;else break e}}function l($){return $.length===0?null:$[0]}function i($){if($.length===0)return null;var G=$[0],X=$.pop();if(X!==G){$[0]=X;e:for(var le=0,ae=$.length,me=ae>>>1;le<me;){var Se=2*(le+1)-1,ce=$[Se],k=Se+1,U=$[k];if(0>c(ce,X))k<ae&&0>c(U,ce)?($[le]=U,$[k]=X,le=k):($[le]=ce,$[Se]=X,le=Se);else if(k<ae&&0>c(U,X))$[le]=U,$[k]=X,le=k;else break e}}return G}function c($,G){var X=$.sortIndex-G.sortIndex;return X!==0?X:$.id-G.id}if(n.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var d=performance;n.unstable_now=function(){return d.now()}}else{var f=Date,m=f.now();n.unstable_now=function(){return f.now()-m}}var g=[],v=[],x=1,p=null,b=3,S=!1,j=!1,N=!1,R=!1,A=typeof setTimeout=="function"?setTimeout:null,T=typeof clearTimeout=="function"?clearTimeout:null,O=typeof setImmediate<"u"?setImmediate:null;function M($){for(var G=l(v);G!==null;){if(G.callback===null)i(v);else if(G.startTime<=$)i(v),G.sortIndex=G.expirationTime,a(g,G);else break;G=l(v)}}function E($){if(N=!1,M($),!j)if(l(g)!==null)j=!0,_||(_=!0,ie());else{var G=l(v);G!==null&&re(E,G.startTime-$)}}var _=!1,D=-1,P=5,Z=-1;function z(){return R?!0:!(n.unstable_now()-Z<P)}function te(){if(R=!1,_){var $=n.unstable_now();Z=$;var G=!0;try{e:{j=!1,N&&(N=!1,T(D),D=-1),S=!0;var X=b;try{t:{for(M($),p=l(g);p!==null&&!(p.expirationTime>$&&z());){var le=p.callback;if(typeof le=="function"){p.callback=null,b=p.priorityLevel;var ae=le(p.expirationTime<=$);if($=n.unstable_now(),typeof ae=="function"){p.callback=ae,M($),G=!0;break t}p===l(g)&&i(g),M($)}else i(g);p=l(g)}if(p!==null)G=!0;else{var me=l(v);me!==null&&re(E,me.startTime-$),G=!1}}break e}finally{p=null,b=X,S=!1}G=void 0}}finally{G?ie():_=!1}}}var ie;if(typeof O=="function")ie=function(){O(te)};else if(typeof MessageChannel<"u"){var J=new MessageChannel,se=J.port2;J.port1.onmessage=te,ie=function(){se.postMessage(null)}}else ie=function(){A(te,0)};function re($,G){D=A(function(){$(n.unstable_now())},G)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function($){$.callback=null},n.unstable_forceFrameRate=function($){0>$||125<$?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):P=0<$?Math.floor(1e3/$):5},n.unstable_getCurrentPriorityLevel=function(){return b},n.unstable_next=function($){switch(b){case 1:case 2:case 3:var G=3;break;default:G=b}var X=b;b=G;try{return $()}finally{b=X}},n.unstable_requestPaint=function(){R=!0},n.unstable_runWithPriority=function($,G){switch($){case 1:case 2:case 3:case 4:case 5:break;default:$=3}var X=b;b=$;try{return G()}finally{b=X}},n.unstable_scheduleCallback=function($,G,X){var le=n.unstable_now();switch(typeof X=="object"&&X!==null?(X=X.delay,X=typeof X=="number"&&0<X?le+X:le):X=le,$){case 1:var ae=-1;break;case 2:ae=250;break;case 5:ae=1073741823;break;case 4:ae=1e4;break;default:ae=5e3}return ae=X+ae,$={id:x++,callback:G,priorityLevel:$,startTime:X,expirationTime:ae,sortIndex:-1},X>le?($.sortIndex=X,a(v,$),l(g)===null&&$===l(v)&&(N?(T(D),D=-1):N=!0,re(E,X-le))):($.sortIndex=ae,a(g,$),j||S||(j=!0,_||(_=!0,ie()))),$},n.unstable_shouldYield=z,n.unstable_wrapCallback=function($){var G=b;return function(){var X=b;b=G;try{return $.apply(this,arguments)}finally{b=X}}}})(qf)),qf}var tv;function fw(){return tv||(tv=1,Gf.exports=hw()),Gf.exports}var If={exports:{}},Yt={};/**
|
|
26
26
|
* @license React
|
|
27
27
|
* react-dom.production.js
|
|
28
28
|
*
|
|
@@ -30,7 +30,7 @@ var Lv=n=>{throw TypeError(n)};var jh=(n,l,a)=>l.has(n)||Lv("Cannot "+a);var F=(
|
|
|
30
30
|
*
|
|
31
31
|
* This source code is licensed under the MIT license found in the
|
|
32
32
|
* LICENSE file in the root directory of this source tree.
|
|
33
|
-
*/var
|
|
33
|
+
*/var nv;function mw(){if(nv)return Yt;nv=1;var n=wg();function a(x){var p="https://react.dev/errors/"+x;if(1<arguments.length){p+="?args[]="+encodeURIComponent(arguments[1]);for(var b=2;b<arguments.length;b++)p+="&args[]="+encodeURIComponent(arguments[b])}return"Minified React error #"+x+"; visit "+p+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function l(){}var i={d:{f:l,r:function(){throw Error(a(522))},D:l,C:l,L:l,m:l,X:l,S:l,M:l},p:0,findDOMNode:null},c=Symbol.for("react.portal"),d=Symbol.for("react.recoverable"),f=Symbol.for("react.optimistic_key");function m(x,p,b){var S=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:c,key:S==null?null:S===f?f:""+S,children:x,containerInfo:p,implementation:b}}var g=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function v(x,p){if(x==="font")return"";if(typeof p=="string")return p==="use-credentials"?p:""}return Yt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,Yt.browser=function(x){return{$$typeof:d,_reason:x}},Yt.createPortal=function(x,p){var b=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!p||p.nodeType!==1&&p.nodeType!==9&&p.nodeType!==11)throw Error(a(299));return m(x,p,null,b)},Yt.flushSync=function(x){var p=g.T,b=i.p;try{if(g.T=null,i.p=2,x)return x()}finally{g.T=p,i.p=b,i.d.f()}},Yt.preconnect=function(x,p){typeof x=="string"&&(p?(p=p.crossOrigin,p=typeof p=="string"?p==="use-credentials"?p:"":void 0):p=null,i.d.C(x,p))},Yt.prefetchDNS=function(x){typeof x=="string"&&i.d.D(x)},Yt.preinit=function(x,p){if(typeof x=="string"&&p&&typeof p.as=="string"){var b=p.as,S=v(b,p.crossOrigin),j=typeof p.integrity=="string"?p.integrity:void 0,N=typeof p.fetchPriority=="string"?p.fetchPriority:void 0;b==="style"?i.d.S(x,typeof p.precedence=="string"?p.precedence:void 0,{crossOrigin:S,integrity:j,fetchPriority:N}):b==="script"&&i.d.X(x,{crossOrigin:S,integrity:j,fetchPriority:N,nonce:typeof p.nonce=="string"?p.nonce:void 0})}},Yt.preinitModule=function(x,p){if(typeof x=="string")if(typeof p=="object"&&p!==null){if(p.as==null||p.as==="script"){var b=v(p.as,p.crossOrigin);i.d.M(x,{crossOrigin:b,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0,fetchPriority:typeof p.fetchPriority=="string"?p.fetchPriority:void 0})}}else p==null&&i.d.M(x)},Yt.preload=function(x,p){if(typeof x=="string"&&typeof p=="object"&&p!==null&&typeof p.as=="string"){var b=p.as,S=v(b,p.crossOrigin);i.d.L(x,b,{crossOrigin:S,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0,type:typeof p.type=="string"?p.type:void 0,fetchPriority:typeof p.fetchPriority=="string"?p.fetchPriority:void 0,referrerPolicy:typeof p.referrerPolicy=="string"?p.referrerPolicy:void 0,imageSrcSet:typeof p.imageSrcSet=="string"?p.imageSrcSet:void 0,imageSizes:typeof p.imageSizes=="string"?p.imageSizes:void 0,media:typeof p.media=="string"?p.media:void 0})}},Yt.preloadModule=function(x,p){if(typeof x=="string")if(p){var b=v(p.as,p.crossOrigin);i.d.m(x,{as:typeof p.as=="string"&&p.as!=="script"?p.as:void 0,crossOrigin:b,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0,fetchPriority:typeof p.fetchPriority=="string"?p.fetchPriority:void 0})}else i.d.m(x)},Yt.requestFormReset=function(x){i.d.r(x)},Yt.unstable_batchedUpdates=function(x,p){return x(p)},Yt.useFormState=function(x,p,b){return g.H.useFormState(x,p,b)},Yt.useFormStatus=function(){return g.H.useHostTransitionStatus()},Yt.version="19.3.1",Yt}var sv;function k2(){if(sv)return If.exports;sv=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(a){console.error(a)}}return n(),If.exports=mw(),If.exports}/**
|
|
34
34
|
* @license React
|
|
35
35
|
* react-dom-client.production.js
|
|
36
36
|
*
|
|
@@ -38,15 +38,15 @@ var Lv=n=>{throw TypeError(n)};var jh=(n,l,a)=>l.has(n)||Lv("Cannot "+a);var F=(
|
|
|
38
38
|
*
|
|
39
39
|
* This source code is licensed under the MIT license found in the
|
|
40
40
|
* LICENSE file in the root directory of this source tree.
|
|
41
|
-
*/var
|
|
41
|
+
*/var av;function gw(){if(av)return jr;av=1;var n=fw(),a=wg(),l=k2();function i(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var s=2;s<arguments.length;s++)t+="&args[]="+encodeURIComponent(arguments[s])}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 c(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function d(e){for(var t=e,s=t;s&&!s.alternate;)t=s,(t.flags&4098)!==0&&(e=t.return),s=t.return;for(;t.return;)t=t.return;return t.tag===3?e:null}function f(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 m(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function g(e){if(d(e)!==e)throw Error(i(188))}function v(e){var t=e.alternate;if(!t){if(t=d(e),t===null)throw Error(i(188));return t!==e?null:e}for(var s=e,o=t;;){var u=s.return;if(u===null)break;var h=u.alternate;if(h===null){if(o=u.return,o!==null){s=o;continue}break}if(u.child===h.child){for(h=u.child;h;){if(h===s)return g(u),e;if(h===o)return g(u),t;h=h.sibling}throw Error(i(188))}if(s.return!==o.return)s=u,o=h;else{for(var y=!1,w=u.child;w;){if(w===s){y=!0,s=u,o=h;break}if(w===o){y=!0,o=u,s=h;break}w=w.sibling}if(!y){for(w=h.child;w;){if(w===s){y=!0,s=h,o=u;break}if(w===o){y=!0,o=h,s=u;break}w=w.sibling}if(!y)throw Error(i(189))}}if(s.alternate!==o)throw Error(i(190))}if(s.tag!==3)throw Error(i(188));return s.stateNode.current===s?e:t}function x(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=x(e),t!==null)return t;e=e.sibling}return null}function p(e,t,s,o,u,h){for(;e!==null;){if((e.tag===5||e.tag===27||e.tag===6)&&s(e,o,u,h)||(e.tag!==22||e.memoizedState===null)&&(t||e.tag!==5&&e.tag!==27)&&p(e.child,t,s,o,u,h))return!0;e=e.sibling}return!1}function b(e){for(e=e.return;e!==null;){if(e.tag===3||e.tag===5||e.tag===27)return e;e=e.return}return null}function S(e){var t=!1;for(e=e.return;e!==null&&(e.tag===4&&(t=!0),!(e.tag===3||e.tag===5||e.tag===27));)e=e.return;return t}function j(e){var t=[null,null],s=b(e);return s===null||N(t,e,s.child,{foundSelf:!1}),t}function N(e,t,s,o){for(;s!==null;){if(s===t)o.foundSelf=!0;else if(s.tag===5||s.tag===27||s.tag===6){if(o.foundSelf)return e[1]=s,!0;e[0]=s}else if((s.tag!==22||s.memoizedState===null)&&N(e,t,s.child,o))return!0;s=s.sibling}return!1}function R(e){switch(e.tag){case 5:case 27:case 6:return e.stateNode;case 3:return e.stateNode.containerInfo;default:throw Error(i(559))}}var A=null,T=null;function O(e,t,s){return e===s?!0:e===t?(A=e,!0):!1}function M(e,t,s){return e===s?(T=e,!1):e===t?(T!==null&&(A=e),!0):!1}function E(e){if(e===null)return null;do e=e===null?null:e.return;while(e&&e.tag!==5&&e.tag!==27&&e.tag!==3);return e||null}function _(e,t,s){for(var o=0,u=e;u;u=s(u))o++;u=0;for(var h=t;h;h=s(h))u++;for(;0<o-u;)e=s(e),o--;for(;0<u-o;)t=s(t),u--;for(;o--;){if(e===t||t!==null&&e===t.alternate)return e;e=s(e),t=s(t)}return null}var D=Object.assign,P=Symbol.for("react.element"),Z=Symbol.for("react.transitional.element"),z=Symbol.for("react.portal"),te=Symbol.for("react.fragment"),ie=Symbol.for("react.strict_mode"),J=Symbol.for("react.profiler"),se=Symbol.for("react.consumer"),re=Symbol.for("react.context"),$=Symbol.for("react.forward_ref"),G=Symbol.for("react.suspense"),X=Symbol.for("react.suspense_list"),le=Symbol.for("react.memo"),ae=Symbol.for("react.lazy"),me=Symbol.for("react.activity"),Se=Symbol.for("react.legacy_hidden"),ce=Symbol.for("react.memo_cache_sentinel"),k=Symbol.for("react.view_transition"),U=Symbol.for("react.recoverable"),V=Symbol.iterator;function oe(e){return e===null||typeof e!="object"?null:(e=V&&e[V]||e["@@iterator"],typeof e=="function"?e:null)}var de=Symbol.for("react.client.reference");function be(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===de?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case te:return"Fragment";case J:return"Profiler";case ie:return"StrictMode";case G:return"Suspense";case X:return"SuspenseList";case me:return"Activity";case k:return"ViewTransition"}if(typeof e=="object")switch(e.$$typeof){case z:return"Portal";case re:return e.displayName||"Context";case se:return(e._context.displayName||"Context")+".Consumer";case $:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case le:return t=e.displayName||null,t!==null?t:be(e.type)||"Memo";case ae:t=e._payload,e=e._init;try{return be(e(t))}catch{}}return null}var Me=Array.isArray,ge=a.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ve=l.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ut={pending:!1,data:null,method:null,action:null},Zt=[],Bn=-1;function mn(e){return{current:e}}function ot(e){0>Bn||(e.current=Zt[Bn],Zt[Bn]=null,Bn--)}function Ve(e,t){Bn++,Zt[Bn]=e.current,e.current=t}var Bt=mn(null),Fn=mn(null),Jt=mn(null),Wt=mn(null);function Ls(e,t){switch(Ve(Jt,t),Ve(Fn,e),Ve(Bt,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?ax(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=ax(t),e=lx(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}ot(Bt),Ve(Bt,e)}function xt(){ot(Bt),ot(Fn),ot(Jt)}function fs(e){var t=e.memoizedState;t!==null&&(ki._currentValue=t.memoizedState,Ve(Wt,e)),t=Bt.current;var s=lx(t,e.type);t!==s&&(Ve(Fn,e),Ve(Bt,s))}function an(e){Fn.current===e&&(ot(Bt),ot(Fn)),Wt.current===e&&(ot(Wt),ki._currentValue=ut)}var gn,oa;function Ot(e){if(gn===void 0)try{throw Error()}catch(s){var t=s.stack.trim().match(/\n( *(at )?)/);gn=t&&t[1]||"",oa=-1<s.stack.indexOf(`
|
|
42
42
|
at`)?" (<anonymous>)":-1<s.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
43
|
-
`+
|
|
44
|
-
`),
|
|
45
|
-
`);for(u=
|
|
46
|
-
`+
|
|
47
|
-
Error generating stack: `+
|
|
48
|
-
`+i.stack}}var we=Object.prototype.hasOwnProperty,Ue=n.unstable_scheduleCallback,Pe=n.unstable_cancelCallback,vt=n.unstable_shouldYield,pt=n.unstable_requestPaint,et=n.unstable_now,hn=n.unstable_getCurrentPriorityLevel,Nn=n.unstable_ImmediatePriority,ql=n.unstable_UserBlockingPriority,ka=n.unstable_NormalPriority,fo=n.unstable_LowPriority,tn=n.unstable_IdlePriority,Fr=n.log,Vr=n.unstable_setDisableYieldValue,Zs=null,Qt=null;function Xn(e){if(typeof Fr=="function"&&Vr(e),Qt&&typeof Qt.setStrictMode=="function")try{Qt.setStrictMode(Zs,e)}catch{}}var Yt=Math.clz32?Math.clz32:qr,Br=Math.log,Gr=Math.LN2;function qr(e){return e>>>=0,e===0?32:31-(Br(e)/Gr|0)|0}var Il=256,Ql=262144,Yl=4194304;function cs(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:return e&-e;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;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 Pl(e,t,s){var i=e.pendingLanes;if(i===0)return 0;var u=0,f=e.suspendedLanes,p=e.pingedLanes;e=e.warmLanes;var w=i&134217727;return w!==0?(i=w&~f,i!==0?u=cs(i):(p&=w,p!==0?u=cs(p):s||(s=w&~e,s!==0&&(u=cs(s))))):(w=i&~f,w!==0?u=cs(w):p!==0?u=cs(p):s||(s=i&~e,s!==0&&(u=cs(s)))),u===0?0:t!==0&&t!==u&&(t&f)===0&&(f=u&-u,s=t&-t,f>=s||f===32&&(s&4194048)!==0)?t:u}function Js(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function ho(e,t){(t&8)!==0&&(t|=t&32);var s=e.entangledLanes;if(s!==0)for(e=e.entanglements,s&=t;0<s;){var i=31-Yt(s),u=1<<i;t|=e[i],s&=~u}return t}function Ir(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 mo(){var e=Yl;return Yl<<=1,(Yl&62914560)===0&&(Yl=4194304),e}function Ha(e){for(var t=[],s=0;31>s;s++)t.push(e);return t}function Ws(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function ge(e,t,s,i,u,f){var p=e.pendingLanes;e.pendingLanes=s,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=s,e.entangledLanes&=s,e.errorRecoveryDisabledLanes&=s,e.shellSuspendCounter=0;var w=e.entanglements,z=e.expirationTimes,q=e.hiddenUpdates;for(s=p&~s;0<s;){var X=31-Yt(s),ne=1<<X;w[X]=0,z[X]=-1;var V=q[X];if(V!==null)for(q[X]=null,X=0;X<V.length;X++){var Y=V[X];Y!==null&&(Y.lane&=-536870913)}s&=~ne}i!==0&&at(e,i,0),f!==0&&u===0&&e.tag!==0&&(e.suspendedLanes|=f&~(p&~t))}function at(e,t,s){e.pendingLanes|=t,e.suspendedLanes&=~t;var i=31-Yt(t);e.entangledLanes|=t,e.entanglements[i]=e.entanglements[i]|1073741824|s&261930}function nn(e,t){var s=e.entangledLanes|=t;for(e=e.entanglements;s;){var i=31-Yt(s),u=1<<i;u&t|e[i]&t&&(e[i]|=t),s&=~u}}function Ua(e,t){var s=t&-t;return s=(s&42)!==0?1:go(s),(s&(e.suspendedLanes|t))!==0?0:s}function go(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 po(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Fa(){var e=Se.p;return e!==0?e:(e=window.event,e===void 0?32:Tv(e.type))}function Kn(e,t){var s=Se.p;try{return Se.p=e,t()}finally{Se.p=s}}var $n=Math.random().toString(36).slice(2),xt="__reactFiber$"+$n,Lt="__reactProps$"+$n,el="__reactContainer$"+$n,yo="__reactEvents$"+$n,Qr="__reactListeners$"+$n,IS="__reactHandles$"+$n,Ng="__reactResources$"+$n,vo="__reactMarker$"+$n,Yr="__reactLoad$"+$n;function Pr(e){delete e[xt],delete e[Lt],delete e[Qr],delete e[IS]}function Xl(e){var t;if(t=e[xt])return t;for(var s=e.parentNode;s;){if(t=s[el]||s[xt]){if(s=t.alternate,t.child!==null||s!==null&&s.child!==null)for(e=rv(e);e!==null;){if(s=e[xt])return s;e=rv(e)}return t}e=s,s=e.parentNode}return null}function Va(e){if(e=e[xt]||e[el]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function xo(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(o(33))}function Ba(e){var t=e[Ng];return t||(t=e[Ng]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function Tt(e){e[vo]=!0}function Cg(e){e[Yr]=void 0}var Mg=new Set,Eg={};function Kl(e,t){Ga(e,t),Ga(e+"Capture",t)}function Ga(e,t){for(Eg[e]=t,e=0;e<t.length;e++)Mg.add(t[e])}var QS=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]*$"),Tg={},_g={};function YS(e){return we.call(_g,e)?!0:we.call(Tg,e)?!1:QS.test(e)?_g[e]=!0:(Tg[e]=!0,!1)}var qe=!1;function Rg(){var e=qe;return qe=!1,e}function Xr(e,t,s){if(YS(t))if(s===null)e.removeAttribute(t);else{switch(typeof s){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var i=t.toLowerCase().slice(0,5);if(i!=="data-"&&i!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,s)}}function Kr(e,t,s){if(s===null)e.removeAttribute(t);else{switch(typeof s){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,s)}}function _s(e,t,s,i){if(i===null)e.removeAttribute(s);else{switch(typeof i){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(s);return}e.setAttributeNS(t,s,i)}}function Cn(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Ag(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function PS(e,t,s){var i=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof i<"u"&&typeof i.get=="function"&&typeof i.set=="function"){var u=i.get,f=i.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return u.call(this)},set:function(p){s=""+p,f.call(this,p)}}),Object.defineProperty(e,t,{enumerable:i.enumerable}),{getValue:function(){return s},setValue:function(p){s=""+p},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Zu(e){if(!e._valueTracker){var t=Ag(e)?"checked":"value";e._valueTracker=PS(e,t,""+e[t])}}function Og(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var s=t.getValue(),i="";return e&&(i=Ag(e)?e.checked?"true":"false":e.value),e=i,e!==s?(t.setValue(e),!0):!1}var XS=/[\n"\\]/g;function kn(e){return e.replace(XS,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Ju(e,t,s,i,u,f,p,w){e.name="",p!=null&&typeof p!="function"&&typeof p!="symbol"&&typeof p!="boolean"?e.type=p:e.removeAttribute("type"),t!=null?p==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+Cn(t)):e.value!==""+Cn(t)&&(e.value=""+Cn(t)):p!=="submit"&&p!=="reset"||e.removeAttribute("value"),t!=null?p==="number"&&e.value==t?Wu(e,Cn(e.value)):Wu(e,Cn(t)):s!=null?Wu(e,Cn(s)):i!=null&&e.removeAttribute("value"),u==null&&f!=null&&(e.defaultChecked=!!f),u!=null&&(e.checked=u&&typeof u!="function"&&typeof u!="symbol"),w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"?e.name=""+Cn(w):e.removeAttribute("name")}function zg(e,t,s,i,u,f,p,w){if(f!=null&&typeof f!="function"&&typeof f!="symbol"&&typeof f!="boolean"&&(e.type=f),t!=null||s!=null){if(!(f!=="submit"&&f!=="reset"||t!=null)){Zu(e);return}s=s!=null?""+Cn(s):"",t=t!=null?""+Cn(t):s,w||t===e.value||(e.value=t),e.defaultValue=t}i=i??u,i=typeof i!="function"&&typeof i!="symbol"&&!!i,e.checked=w?e.checked:!!i,e.defaultChecked=!!i,p!=null&&typeof p!="function"&&typeof p!="symbol"&&typeof p!="boolean"&&(e.name=p),Zu(e)}function Wu(e,t){e.defaultValue!==""+t&&(e.defaultValue=""+t)}function qa(e,t,s,i){if(e=e.options,t){t={};for(var u=0;u<s.length;u++)t["$"+s[u]]=!0;for(s=0;s<e.length;s++)u=t.hasOwnProperty("$"+e[s].value),e[s].selected!==u&&(e[s].selected=u),u&&i&&(e[s].defaultSelected=!0)}else{for(s=""+Cn(s),t=null,u=0;u<e.length;u++){if(e[u].value===s){e[u].selected=!0,i&&(e[u].defaultSelected=!0);return}t!==null||e[u].disabled||(t=e[u])}t!==null&&(t.selected=!0)}}function Dg(e,t,s){if(t!=null&&(t=""+Cn(t),t!==e.value&&(e.value=t),s==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=s!=null?""+Cn(s):""}function Lg(e,t,s,i){if(t==null){if(i!=null){if(s!=null)throw Error(o(92));if(Te(i)){if(1<i.length)throw Error(o(93));i=i[0]}s=i}s==null&&(s=""),t=s}s=Cn(t),e.defaultValue=s,i=e.textContent,i===s&&i!==""&&i!==null&&(e.value=i),Zu(e)}function Ia(e,t){if(t){var s=e.firstChild;if(s&&s===e.lastChild&&s.nodeType===3){s.nodeValue=t;return}}e.textContent=t}var KS=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 $g(e,t,s){var i=t.indexOf("--")===0;s==null||typeof s=="boolean"||s===""?i?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":i?e.setProperty(t,s):typeof s!="number"||s===0||KS.has(t)?t==="float"?e.cssFloat=s:e[t]=(""+s).trim():e[t]=s+"px"}function kg(e,t,s){if(t!=null&&typeof t!="object")throw Error(o(62));if(e=e.style,s!=null){for(var i in s)!s.hasOwnProperty(i)||t!=null&&t.hasOwnProperty(i)||(i.indexOf("--")===0?e.setProperty(i,""):i==="float"?e.cssFloat="":e[i]="",qe=!0);for(var u in t)i=t[u],t.hasOwnProperty(u)&&s[u]!==i&&($g(e,u,i),qe=!0)}else for(var f in t)t.hasOwnProperty(f)&&$g(e,f,t[f])}function ef(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 ZS=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"],["maskType","mask-type"],["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"]]),JS=/^[\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 Zr(e){return JS.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function us(){}var tf=null;function nf(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Qa=null,Ya=null;function Hg(e){var t=Va(e);if(t&&(e=t.stateNode)){var s=e[Lt]||null;e:switch(e=t.stateNode,t.type){case"input":if(Ju(e,s.value,s.defaultValue,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name),t=s.name,s.type==="radio"&&t!=null){for(s=e;s.parentNode;)s=s.parentNode;for(s=s.querySelectorAll('input[name="'+kn(""+t)+'"][type="radio"]'),t=0;t<s.length;t++){var i=s[t];if(i!==e&&i.form===e.form){var u=i[Lt]||null;if(!u)throw Error(o(90));Ju(i,u.value,u.defaultValue,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name)}}for(t=0;t<s.length;t++)i=s[t],i.form===e.form&&Og(i)}break e;case"textarea":Dg(e,s.value,s.defaultValue);break e;case"select":t=s.value,t!=null&&qa(e,!!s.multiple,t,!1)}}}var sf=!1;function Ug(e,t,s){if(sf)return e(t,s);sf=!0;try{var i=e(t);return i}finally{if(sf=!1,(Qa!==null||Ya!==null)&&(Zc(),Qa&&(t=Qa,e=Ya,Ya=Qa=null,Hg(t),e)))for(t=0;t<e.length;t++)Hg(e[t])}}function So(e,t){var s=e.stateNode;if(s===null)return null;var i=s[Lt]||null;if(i===null)return null;s=i[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":(i=!i.disabled)||(e=e.type,i=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!i;break e;default:e=!1}if(e)return null;if(s&&typeof s!="function")throw Error(o(231,t,typeof s));return s}var Rs=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),lf=!1;if(Rs)try{var bo={};Object.defineProperty(bo,"passive",{get:function(){lf=!0}}),window.addEventListener("test",bo,bo),window.removeEventListener("test",bo,bo)}catch{lf=!1}var tl=null,af=null,Jr=null;function Fg(){if(Jr)return Jr;var e,t=af,s=t.length,i,u="value"in tl?tl.value:tl.textContent,f=u.length;for(e=0;e<s&&t[e]===u[e];e++);var p=s-e;for(i=1;i<=p&&t[s-i]===u[f-i];i++);return Jr=u.slice(e,1<i?1-i:void 0)}function Wr(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 ec(){return!0}function Vg(){return!1}function sn(e){function t(s,i,u,f,p){this._reactName=s,this._targetInst=u,this.type=i,this.nativeEvent=f,this.target=p,this.currentTarget=null;for(var w in e)e.hasOwnProperty(w)&&(s=e[w],this[w]=s?s(f):f[w]);return this.isDefaultPrevented=(f.defaultPrevented!=null?f.defaultPrevented:f.returnValue===!1)?ec:Vg,this.isPropagationStopped=Vg,this}return A(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var s=this.nativeEvent;s&&(s.preventDefault?s.preventDefault():typeof s.returnValue!="unknown"&&(s.returnValue=!1),this.isDefaultPrevented=ec)},stopPropagation:function(){var s=this.nativeEvent;s&&(s.stopPropagation?s.stopPropagation():typeof s.cancelBubble!="unknown"&&(s.cancelBubble=!0),this.isPropagationStopped=ec)},persist:function(){},isPersistent:ec}),t}var nl={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},tc=sn(nl),jo=A({},nl,{view:0,detail:0}),WS=sn(jo),of,rf,wo,nc=A({},jo,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:uf,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!==wo&&(wo&&e.type==="mousemove"?(of=e.screenX-wo.screenX,rf=e.screenY-wo.screenY):rf=of=0,wo=e),of)},movementY:function(e){return"movementY"in e?e.movementY:rf}}),Bg=sn(nc),eb=A({},nc,{dataTransfer:0}),tb=sn(eb),nb=A({},jo,{relatedTarget:0}),cf=sn(nb),sb=A({},nl,{animationName:0,elapsedTime:0,pseudoElement:0}),lb=sn(sb),ab=A({},nl,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),ib=sn(ab),ob=A({},nl,{data:0}),Gg=sn(ob),rb={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},cb={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"},ub={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function fb(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=ub[e])?!!t[e]:!1}function uf(){return fb}var db=A({},jo,{key:function(e){if(e.key){var t=rb[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Wr(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?cb[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:uf,charCode:function(e){return e.type==="keypress"?Wr(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Wr(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),hb=sn(db),mb=A({},nc,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),qg=sn(mb),gb=A({},nl,{submitter:0}),pb=sn(gb),yb=A({},jo,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:uf}),vb=sn(yb),xb=A({},nl,{propertyName:0,elapsedTime:0,pseudoElement:0}),Sb=sn(xb),bb=A({},nc,{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}),jb=sn(bb),wb=A({},nl,{newState:0,oldState:0,source:0}),Nb=sn(wb),Cb=[9,13,27,32],ff=Rs&&"CompositionEvent"in window,No=null;Rs&&"documentMode"in document&&(No=document.documentMode);var Mb=Rs&&"TextEvent"in window&&!No,Ig=Rs&&(!ff||No&&8<No&&11>=No),Qg=" ",Yg=!1;function Pg(e,t){switch(e){case"keyup":return Cb.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Xg(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Pa=!1;function Eb(e,t){switch(e){case"compositionend":return Xg(t);case"keypress":return t.which!==32?null:(Yg=!0,Qg);case"textInput":return e=t.data,e===Qg&&Yg?null:e;default:return null}}function Tb(e,t){if(Pa)return e==="compositionend"||!ff&&Pg(e,t)?(e=Fg(),Jr=af=tl=null,Pa=!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 Ig&&t.locale!=="ko"?null:t.data;default:return null}}var _b={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 Kg(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!_b[e.type]:t==="textarea"}function Zg(e,t,s,i){Qa?Ya?Ya.push(i):Ya=[i]:Qa=i,t=su(t,"onChange"),0<t.length&&(s=new tc("onChange","change",null,s,i),e.push({event:s,listeners:t}))}var Co=null,Mo=null;function Rb(e){Hy(e,0)}function sc(e){var t=xo(e);if(Og(t))return e}function Jg(e,t){if(e==="change")return t}var Wg=!1;if(Rs){var df;if(Rs){var hf="oninput"in document;if(!hf){var ep=document.createElement("div");ep.setAttribute("oninput","return;"),hf=typeof ep.oninput=="function"}df=hf}else df=!1;Wg=df&&(!document.documentMode||9<document.documentMode)}function tp(){Co&&(Co.detachEvent("onpropertychange",np),Mo=Co=null)}function np(e){if(e.propertyName==="value"&&sc(Mo)){var t=[];Zg(t,Mo,e,nf(e)),Ug(Rb,t)}}function Ab(e,t,s){e==="focusin"?(tp(),Co=t,Mo=s,Co.attachEvent("onpropertychange",np)):e==="focusout"&&tp()}function Ob(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return sc(Mo)}function zb(e,t){if(e==="click")return sc(t)}function Db(e,t){if(e==="input"||e==="change")return sc(t)}function Lb(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Mn=typeof Object.is=="function"?Object.is:Lb;function Eo(e,t){if(Mn(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var s=Object.keys(e),i=Object.keys(t);if(s.length!==i.length)return!1;for(i=0;i<s.length;i++){var u=s[i];if(!we.call(t,u)||!Mn(e[u],t[u]))return!1}return!0}function mf(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}}function sp(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function lp(e,t){var s=sp(e);e=0;for(var i;s;){if(s.nodeType===3){if(i=e+s.textContent.length,e<=t&&i>=t)return{node:s,offset:t-e};e=i}e:{for(;s;){if(s.nextSibling){s=s.nextSibling;break e}s=s.parentNode}s=void 0}s=sp(s)}}function ap(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?ap(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function ip(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=mf(e.document);t instanceof e.HTMLIFrameElement;){try{var s=typeof t.contentWindow.location.href=="string"}catch{s=!1}if(s)e=t.contentWindow;else break;t=mf(e.document)}return t}function gf(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 $b=Rs&&"documentMode"in document&&11>=document.documentMode,Xa=null,pf=null,To=null,yf=!1;function op(e,t,s){var i=s.window===s?s.document:s.nodeType===9?s:s.ownerDocument;yf||Xa==null||Xa!==mf(i)||(i=Xa,"selectionStart"in i&&gf(i)?i={start:i.selectionStart,end:i.selectionEnd}:(i=(i.ownerDocument&&i.ownerDocument.defaultView||window).getSelection(),i={anchorNode:i.anchorNode,anchorOffset:i.anchorOffset,focusNode:i.focusNode,focusOffset:i.focusOffset}),To&&Eo(To,i)||(To=i,i=su(pf,"onSelect"),0<i.length&&(t=new tc("onSelect","select",null,t,s),e.push({event:t,listeners:i}),t.target=Xa)))}function Zl(e,t){var s={};return s[e.toLowerCase()]=t.toLowerCase(),s["Webkit"+e]="webkit"+t,s["Moz"+e]="moz"+t,s}var Ka={animationend:Zl("Animation","AnimationEnd"),animationiteration:Zl("Animation","AnimationIteration"),animationstart:Zl("Animation","AnimationStart"),transitionrun:Zl("Transition","TransitionRun"),transitionstart:Zl("Transition","TransitionStart"),transitioncancel:Zl("Transition","TransitionCancel"),transitionend:Zl("Transition","TransitionEnd")},vf={},rp={};Rs&&(rp=document.createElement("div").style,"AnimationEvent"in window||(delete Ka.animationend.animation,delete Ka.animationiteration.animation,delete Ka.animationstart.animation),"TransitionEvent"in window||delete Ka.transitionend.transition);function Jl(e){if(vf[e])return vf[e];if(!Ka[e])return e;var t=Ka[e],s;for(s in t)if(t.hasOwnProperty(s)&&s in rp)return vf[e]=t[s];return e}var cp=Jl("animationend"),up=Jl("animationiteration"),fp=Jl("animationstart"),kb=Jl("transitionrun"),Hb=Jl("transitionstart"),Ub=Jl("transitioncancel"),dp=Jl("transitionend"),hp=new Map,xf="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error fullscreenChange fullscreenError 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(" ");xf.push("scrollEnd");function Zn(e,t){hp.set(e,t),Kl(t,[e])}var Fb=0;function As(e,t){if(e.name!=null&&e.name!=="auto")return e.name;if(t.autoName!==null)return t.autoName;e=ts.identifierPrefix;var s=Fb++;return e="_"+e+"t_"+s.toString(32)+"_",t.autoName=e}function mp(e){if(e==null||typeof e=="string")return e;var t=null,s=pi;if(s!==null)for(var i=0;i<s.length;i++){var u=e[s[i]];if(u!=null){if(u==="none")return"none";t=t==null?u:t+(" "+u)}}return t??e.default}function Os(e,t){return e=mp(e),t=mp(t),t==null?e==="auto"?null:e:t==="auto"?null:t}var lc=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)},Hn=[],Za=0,Sf=0;function ac(){for(var e=Za,t=Sf=Za=0;t<e;){var s=Hn[t];Hn[t++]=null;var i=Hn[t];Hn[t++]=null;var u=Hn[t];Hn[t++]=null;var f=Hn[t];if(Hn[t++]=null,i!==null&&u!==null){var p=i.pending;p===null?u.next=u:(u.next=p.next,p.next=u),i.pending=u}f!==0&&gp(s,u,f)}}function ic(e,t,s,i){Hn[Za++]=e,Hn[Za++]=t,Hn[Za++]=s,Hn[Za++]=i,Sf|=i,e.lanes|=i,e=e.alternate,e!==null&&(e.lanes|=i)}function bf(e,t,s,i){return ic(e,t,s,i),oc(e)}function Wl(e,t){return ic(e,null,null,t),oc(e)}function gp(e,t,s){e.lanes|=s;var i=e.alternate;i!==null&&(i.lanes|=s);for(var u=!1,f=e.return;f!==null;)f.childLanes|=s,i=f.alternate,i!==null&&(i.childLanes|=s),f.tag===22&&(e=f.stateNode,e===null||e._visibility&1||(u=!0)),e=f,f=f.return;return e.tag===3?(f=e.stateNode,u&&t!==null&&(u=31-Yt(s),e=f.hiddenUpdates,i=e[u],i===null?e[u]=[t]:i.push(t),t.lane=s|536870912),f):null}function oc(e){if(50<Ko)throw Ko=0,Kc=null,Error(o(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Ja={};function Vb(e,t,s,i){this.tag=e,this.key=s,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=i,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function mn(e,t,s,i){return new Vb(e,t,s,i)}function jf(e){return e=e.prototype,!(!e||!e.isReactComponent)}function zs(e,t){var s=e.alternate;return s===null?(s=mn(e.tag,t,e.key,e.mode),s.elementType=e.elementType,s.type=e.type,s.stateNode=e.stateNode,s.alternate=e,e.alternate=s):(s.pendingProps=t,s.type=e.type,s.flags=0,s.subtreeFlags=0,s.deletions=null),s.flags=e.flags&1206910976,s.childLanes=e.childLanes,s.lanes=e.lanes,s.child=e.child,s.memoizedProps=e.memoizedProps,s.memoizedState=e.memoizedState,s.updateQueue=e.updateQueue,t=e.dependencies,s.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},s.sibling=e.sibling,s.index=e.index,s.ref=e.ref,s.refCleanup=e.refCleanup,s}function pp(e,t){e.flags&=1206910978;var s=e.alternate;return s===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=s.childLanes,e.lanes=s.lanes,e.child=s.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=s.memoizedProps,e.memoizedState=s.memoizedState,e.updateQueue=s.updateQueue,e.type=s.type,t=s.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function rc(e,t,s,i,u,f){var p=0;if(i=e,typeof i=="function")jf(i)&&(p=1);else if(typeof i=="string")p=g2(e,s,Wt.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(i){case de:return e=mn(31,s,t,u),e.elementType=de,e.lanes=f,e;case ie:return ea(s.children,u,f,t);case oe:p=8,u|=24;break;case se:return e=mn(12,s,t,u|2),e.elementType=se,e.lanes=f,e;case J:return e=mn(13,s,t,u),e.elementType=J,e.lanes=f,e;case Z:return e=mn(19,s,t,u),e.elementType=Z,e.lanes=f,e;case ve:case L:return e=u|32,e=mn(30,s,t,e),e.elementType=L,e.lanes=f,e.stateNode={autoName:null,paired:null,clones:null,ref:null},e;default:if(typeof i=="object"&&i!==null)switch(i.$$typeof){case le:p=10;break e;case P:p=9;break e;case $:p=11;break e;case W:p=14;break e;case ae:p=16,i=null;break e}p=29,s=Error(o(130,e===null?"null":typeof e,"")),i=null}return t=mn(p,s,t,u),t.elementType=e,t.type=i,t.lanes=f,t}function ea(e,t,s,i){return e=mn(7,e,i,t),e.lanes=s,e}function wf(e,t,s){return e=mn(6,e,null,t),e.lanes=s,e}function yp(e){var t=mn(18,null,null,0);return t.stateNode=e,t}function Nf(e,t,s){return t=mn(4,e.children!==null?e.children:[],e.key,t),t.lanes=s,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var vp=new WeakMap;function Un(e,t){if(typeof e=="object"&&e!==null){var s=vp.get(e);return s!==void 0?s:(t={value:e,source:t,stack:ue(t)},vp.set(e,t),t)}return{value:e,source:t,stack:ue(t)}}var Wa=[],ei=0,cc=null,_o=0,Fn=[],Vn=0,sl=null,fs=1,ds="";function Ds(e,t){Wa[ei++]=_o,Wa[ei++]=cc,cc=e,_o=t}function xp(e,t,s){Fn[Vn++]=fs,Fn[Vn++]=ds,Fn[Vn++]=sl,sl=e;var i=fs;e=ds;var u=32-Yt(i)-1;i&=~(1<<u),s+=1;var f=32-Yt(t)+u;if(30<f){var p=u-u%5;f=(i&(1<<p)-1).toString(32),i>>=p,u-=p,fs=1<<32-Yt(t)+u|s<<u|i,ds=f+e}else fs=1<<f|s<<u|i,ds=e}function uc(e){e.return!==null&&(Ds(e,1),xp(e,1,0))}function Cf(e){for(;e===cc;)cc=Wa[--ei],Wa[ei]=null,_o=Wa[--ei],Wa[ei]=null;for(;e===sl;)sl=Fn[--Vn],Fn[Vn]=null,ds=Fn[--Vn],Fn[Vn]=null,fs=Fn[--Vn],Fn[Vn]=null}function Sp(e,t){Fn[Vn++]=fs,Fn[Vn++]=ds,Fn[Vn++]=sl,fs=t.id,ds=t.overflow,sl=e}var _t=null,st=null,Oe=!1,ll=null,Bn=!1,Mf=Error(o(519));function al(e){var t=Error(o(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Ro(Un(t,e)),Mf}function bp(e){var t=e.stateNode,s=e.type,i=e.memoizedProps;switch(t[xt]=e,t[Lt]=i,s){case"dialog":De("cancel",t),De("close",t);break;case"iframe":case"object":case"embed":De("load",t);break;case"video":case"audio":for(s=0;s<Jo.length;s++)De(Jo[s],t);break;case"source":De("error",t);break;case"img":case"image":case"link":De("error",t),De("load",t);break;case"details":De("toggle",t);break;case"input":De("invalid",t),zg(t,i.value,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name,!0);break;case"select":De("invalid",t);break;case"textarea":De("invalid",t),Lg(t,i.value,i.defaultValue,i.children)}s=i.children,typeof s!="string"&&typeof s!="number"&&typeof s!="bigint"||t.textContent===""+s||i.suppressHydrationWarning===!0||By(t.textContent,s)?(i.popover!=null&&(De("beforetoggle",t),De("toggle",t)),i.onScroll!=null&&De("scroll",t),i.onScrollEnd!=null&&De("scrollend",t),i.onClick!=null&&(t.onclick=us),t=!0):t=!1,t||al(e,!0)}function fc(e){for(_t=e.return;_t;)switch(_t.tag){case 5:case 31:case 13:Bn=!1;return;case 27:case 3:Bn=!0;return;default:_t=_t.return}}function ti(e){if(e!==_t)return!1;if(!Oe)return fc(e),Oe=!0,!1;var t=e.tag,s;if((s=t!==3&&t!==27)&&((s=t===5)&&(s=e.type,s=!(s!=="form"&&s!=="button")||nh(e.type,e.memoizedProps)),s=!s),s&&st&&al(e),fc(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));st=ov(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));st=ov(e)}else t===27?(t=st,bl(e.type)?(e=fh,fh=null,st=e):st=t):st=_t?qn(e.stateNode.nextSibling):null;return!0}function ta(){st=_t=null,Oe=!1}function Ef(){var e=ll;return e!==null&&(yn===null?yn=e:yn.push.apply(yn,e),ll=null),e}function Ro(e){ll===null?ll=[e]:ll.push(e)}var Tf=zt(null),na=null,Ls=null;function il(e,t,s){Ge(Tf,t._currentValue),t._currentValue=s}function $s(e){e._currentValue=Tf.current,ut(Tf)}function dc(e,t,s){for(;e!==null;){var i=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,i!==null&&(i.childLanes|=t)):i!==null&&(i.childLanes&t)!==t&&(i.childLanes|=t),e===s)break;e=e.return}}function _f(e,t,s,i){var u=e.child;for(u!==null&&(u.return=e);u!==null;){var f=u.dependencies;if(f!==null){var p=u.child;f=f.firstContext;e:for(;f!==null;){var w=f;f=u;for(var z=0;z<t.length;z++)if(w.context===t[z]){f.lanes|=s,w=f.alternate,w!==null&&(w.lanes|=s),dc(f.return,s,e),i||(p=null);break e}f=w.next}}else if(u.tag===18){if(p=u.return,p===null)throw Error(o(341));p.lanes|=s,f=p.alternate,f!==null&&(f.lanes|=s),dc(p,s,e),p=null}else u.tag===13&&u.memoizedState!==null&&u.memoizedState.dehydrated===null?(u.lanes|=s,p=u.alternate,p!==null&&(p.lanes|=s),dc(u.return,s,e),p=u.child,p=p!==null?p.sibling:null):p=u.child;if(p!==null)p.return=u;else for(p=u;p!==null;){if(p===e){p=null;break}if(u=p.sibling,u!==null){u.return=p.return,p=u;break}p=p.return}u=p}}function sa(e,t,s,i){e=null;for(var u=t,f=!1;u!==null;){if(!f){if((u.flags&524288)!==0)f=!0;else if((u.flags&262144)!==0)break}if(u.tag===10){var p=u.alternate;if(p===null)throw Error(o(387));if(p=p.memoizedProps,p!==null){var w=u.type;Mn(u.pendingProps.value,p.value)||(e!==null?e.push(w):e=[w])}}else if(u===wn.current){if(p=u.alternate,p===null)throw Error(o(387));p.memoizedState.memoizedState!==u.memoizedState.memoizedState&&(e!==null?e.push(Mi):e=[Mi])}u=u.return}return e!==null&&_f(t,e,s,i),t.flags|=262144,e!==null}function hc(e){for(e=e.firstContext;e!==null;){if(!Mn(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function la(e){na=e,Ls=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function $t(e){return jp(na,e)}function mc(e,t){return na===null&&la(e),jp(e,t)}function jp(e,t){var s=t._currentValue;if(t={context:t,memoizedValue:s,next:null},Ls===null){if(e===null)throw Error(o(308));Ls=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Ls=Ls.next=t;return s}var Bb=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(s,i){e.push(i)}};this.abort=function(){t.aborted=!0,e.forEach(function(s){return s()})}},Gb=n.unstable_scheduleCallback,qb=n.unstable_NormalPriority,St={$$typeof:le,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Rf(){return{controller:new Bb,data:new Map,refCount:0}}function Ao(e){e.refCount--,e.refCount===0&&Gb(qb,function(){e.controller.abort()})}function wp(e,t){if((e.pendingLanes&4194048)!==0){var s=e.transitionTypes;for(s===null&&(s=e.transitionTypes=[]),e=0;e<t.length;e++){var i=t[e];s.indexOf(i)===-1&&s.push(i)}}}var Oo=null;function Ib(e){var t=e.transitionTypes;return e.transitionTypes=null,t}var zo=null,Af=0,aa=0,ni=null;function Qb(e,t){if(zo===null){var s=zo=[];Af=0,aa=Yd(),ni={status:"pending",value:void 0,then:function(i){s.push(i)}}}return Af++,t.then(Np,Np),t}function Np(){if(--Af===0&&(Oo=null,zo!==null)){ni!==null&&(ni.status="fulfilled");var e=zo;zo=null,aa=0,ni=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Yb(e,t){var s=[],i={status:"pending",value:null,reason:null,then:function(u){s.push(u)}};return e.then(function(){i.status="fulfilled",i.value=t;for(var u=0;u<s.length;u++)(0,s[u])(t)},function(u){for(i.status="rejected",i.reason=u,u=0;u<s.length;u++)(0,s[u])(void 0)}),i}var Cp=me.S;me.S=function(e,t){if(yy=et(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&Qb(e,t),Oo!==null)for(var s=Si;s!==null;)wp(s,Oo),s=s.next;if(s=e.types,s!==null){for(var i=Si;i!==null;)wp(i,s),i=i.next;if(aa!==0){i=Oo,i===null&&(i=Oo=[]);for(var u=0;u<s.length;u++){var f=s[u];i.indexOf(f)===-1&&i.push(f)}}}Cp!==null&&Cp(e,t)};var ia=zt(null);function Of(){var e=ia.current;return e!==null?e:nt.pooledCache}function gc(e,t){t===null?Ge(ia,ia.current):Ge(ia,t.pool)}function Mp(){var e=Of();return e===null?null:{parent:St._currentValue,pool:e}}var si=Error(o(460)),zf=Error(o(474)),pc=Error(o(542)),yc={then:function(){}};function Ep(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Tp(e,t,s){switch(s=e[s],s===void 0?e.push(t):s!==t&&(t.then(us,us),t=s),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Rp(e),e===void 0&&!("reason"in t)?Error(o(600)):e;default:if(typeof t.status=="string")t.then(us,us);else{if(e=nt,e!==null&&100<e.shellSuspendCounter)throw Error(o(482));e=t,e.status="pending",e.then(function(i){if(t.status==="pending"){var u=t;u.status="fulfilled",u.value=i}},function(i){if(t.status==="pending"){var u=t;u.status="rejected",u.reason=i}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Rp(e),e}throw ra=t,si}}function oa(e){try{var t=e._init;return t(e._payload)}catch(s){throw s!==null&&typeof s=="object"&&typeof s.then=="function"?(ra=s,si):s}}var ra=null;function _p(){if(ra===null)throw Error(o(459));var e=ra;return ra=null,e}function Rp(e){if(e===si||e===pc)throw Error(o(483))}var li=null,Do=0;function vc(e){var t=Do;return Do+=1,li===null&&(li=[]),Tp(li,e,t)}function ol(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function xc(e,t){throw t.$$typeof===B?Error(o(525)):(e=Object.prototype.toString.call(t),Error(o(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function Ap(e){function t(G,H){if(e){var Q=G.deletions;Q===null?(G.deletions=[H],G.flags|=16):Q.push(H)}}function s(G,H){if(!e)return null;for(;H!==null;)t(G,H),H=H.sibling;return null}function i(G){for(var H=new Map;G!==null;)G.key===null?H.set(G.index,G):H.set(G.key,G),G=G.sibling;return H}function u(G,H){return G=zs(G,H),G.index=0,G.sibling=null,G}function f(G,H,Q){return G.index=Q,e?(Q=G.alternate,Q!==null?(Q=Q.index,Q<H?(G.flags|=2,H):Q):(G.flags|=134217730,H)):(G.flags|=1048576,H)}function p(G){return e&&G.alternate===null&&(G.flags|=134217730),G}function w(G,H,Q,ee){return H===null||H.tag!==6?(H=wf(Q,G.mode,ee),H.return=G,H):(H=u(H,Q),H.return=G,H)}function z(G,H,Q,ee){var pe=Q.type;return pe===ie?(G=X(G,H,Q.props.children,ee,Q.key),ol(G,Q),G):H!==null&&(H.elementType===pe||typeof pe=="object"&&pe!==null&&pe.$$typeof===ae&&oa(pe)===H.type)?(H=u(H,Q.props),ol(H,Q),H.return=G,H):(H=rc(Q.type,Q.key,Q.props,null,G.mode,ee),ol(H,Q),H.return=G,H)}function q(G,H,Q,ee){return H===null||H.tag!==4||H.stateNode.containerInfo!==Q.containerInfo||H.stateNode.implementation!==Q.implementation?(H=Nf(Q,G.mode,ee),H.return=G,H):(H=u(H,Q.children||[]),H.return=G,H)}function X(G,H,Q,ee,pe){return H===null||H.tag!==7?(H=ea(Q,G.mode,ee,pe),H.return=G,H):(H=u(H,Q),H.return=G,H)}function ne(G,H,Q){if(typeof H=="string"&&H!==""||typeof H=="number"||typeof H=="bigint")return H=wf(""+H,G.mode,Q),H.return=G,H;if(typeof H=="object"&&H!==null){switch(H.$$typeof){case K:return Q=rc(H.type,H.key,H.props,null,G.mode,Q),ol(Q,H),Q.return=G,Q;case k:return H=Nf(H,G.mode,Q),H.return=G,H;case ae:return H=oa(H),ne(G,H,Q)}if(Te(H)||re(H))return H=ea(H,G.mode,Q,null),H.return=G,H;if(typeof H.then=="function")return ne(G,vc(H),Q);if(H.$$typeof===le)return ne(G,mc(G,H),Q);xc(G,H)}return null}function V(G,H,Q,ee){var pe=H!==null?H.key:null;if(typeof Q=="string"&&Q!==""||typeof Q=="number"||typeof Q=="bigint")return pe!==null?null:w(G,H,""+Q,ee);if(typeof Q=="object"&&Q!==null){switch(Q.$$typeof){case K:return Q.key===pe?z(G,H,Q,ee):null;case k:return Q.key===pe?q(G,H,Q,ee):null;case ae:return Q=oa(Q),V(G,H,Q,ee)}if(Te(Q)||re(Q))return pe!==null?null:X(G,H,Q,ee,null);if(typeof Q.then=="function")return V(G,H,vc(Q),ee);if(Q.$$typeof===le)return V(G,H,mc(G,Q),ee);xc(G,Q)}return null}function Y(G,H,Q,ee,pe){if(typeof ee=="string"&&ee!==""||typeof ee=="number"||typeof ee=="bigint")return G=G.get(Q)||null,w(H,G,""+ee,pe);if(typeof ee=="object"&&ee!==null){switch(ee.$$typeof){case K:return G=G.get(ee.key===null?Q:ee.key)||null,z(H,G,ee,pe);case k:return G=G.get(ee.key===null?Q:ee.key)||null,q(H,G,ee,pe);case ae:return ee=oa(ee),Y(G,H,Q,ee,pe)}if(Te(ee)||re(ee))return G=G.get(Q)||null,X(H,G,ee,pe,null);if(typeof ee.then=="function")return Y(G,H,Q,vc(ee),pe);if(ee.$$typeof===le)return Y(G,H,Q,mc(H,ee),pe);xc(H,ee)}return null}function fe(G,H,Q,ee){for(var pe=null,$e=null,be=H,Ce=H=0,wt=null;be!==null&&Ce<Q.length;Ce++){be.index>Ce?(wt=be,be=null):wt=be.sibling;var Be=V(G,be,Q[Ce],ee);if(Be===null){be===null&&(be=wt);break}e&&be&&Be.alternate===null&&t(G,be),H=f(Be,H,Ce),$e===null?pe=Be:$e.sibling=Be,$e=Be,be=wt}if(Ce===Q.length)return s(G,be),Oe&&Ds(G,Ce),pe;if(be===null){for(;Ce<Q.length;Ce++)be=ne(G,Q[Ce],ee),be!==null&&(H=f(be,H,Ce),$e===null?pe=be:$e.sibling=be,$e=be);return Oe&&Ds(G,Ce),pe}for(be=i(be);Ce<Q.length;Ce++)wt=Y(be,G,Ce,Q[Ce],ee),wt!==null&&(e&&(Be=wt.alternate,Be!==null&&be.delete(Be.key===null?Ce:Be.key)),H=f(wt,H,Ce),$e===null?pe=wt:$e.sibling=wt,$e=wt);return e&&be.forEach(function(Ml){return t(G,Ml)}),Oe&&Ds(G,Ce),pe}function ye(G,H,Q,ee){if(Q==null)throw Error(o(151));for(var pe=null,$e=null,be=H,Ce=H=0,wt=null,Be=Q.next();be!==null&&!Be.done;Ce++,Be=Q.next()){be.index>Ce?(wt=be,be=null):wt=be.sibling;var Ml=V(G,be,Be.value,ee);if(Ml===null){be===null&&(be=wt);break}e&&be&&Ml.alternate===null&&t(G,be),H=f(Ml,H,Ce),$e===null?pe=Ml:$e.sibling=Ml,$e=Ml,be=wt}if(Be.done)return s(G,be),Oe&&Ds(G,Ce),pe;if(be===null){for(;!Be.done;Ce++,Be=Q.next())Be=ne(G,Be.value,ee),Be!==null&&(H=f(Be,H,Ce),$e===null?pe=Be:$e.sibling=Be,$e=Be);return Oe&&Ds(G,Ce),pe}for(be=i(be);!Be.done;Ce++,Be=Q.next())Be=Y(be,G,Ce,Be.value,ee),Be!==null&&(e&&(wt=Be.alternate,wt!==null&&be.delete(wt.key===null?Ce:wt.key)),H=f(Be,H,Ce),$e===null?pe=Be:$e.sibling=Be,$e=Be);return e&&be.forEach(function(E2){return t(G,E2)}),Oe&&Ds(G,Ce),pe}function Ae(G,H,Q,ee){if(typeof Q=="object"&&Q!==null&&Q.type===ie&&Q.key===null&&Q.props.ref===void 0&&(Q=Q.props.children),typeof Q=="object"&&Q!==null){switch(Q.$$typeof){case K:e:{for(var pe=Q.key;H!==null;){if(H.key===pe){if(pe=Q.type,pe===ie){if(H.tag===7){s(G,H.sibling),ee=u(H,Q.props.children),ol(ee,Q),ee.return=G,G=ee;break e}}else if(H.elementType===pe||typeof pe=="object"&&pe!==null&&pe.$$typeof===ae&&oa(pe)===H.type){s(G,H.sibling),ee=u(H,Q.props),ol(ee,Q),ee.return=G,G=ee;break e}s(G,H);break}else t(G,H);H=H.sibling}Q.type===ie?(ee=ea(Q.props.children,G.mode,ee,Q.key),ol(ee,Q),ee.return=G,G=ee):(ee=rc(Q.type,Q.key,Q.props,null,G.mode,ee),ol(ee,Q),ee.return=G,G=ee)}return p(G);case k:e:{for(pe=Q.key;H!==null;){if(H.key===pe)if(H.tag===4&&H.stateNode.containerInfo===Q.containerInfo&&H.stateNode.implementation===Q.implementation){s(G,H.sibling),ee=u(H,Q.children||[]),ee.return=G,G=ee;break e}else{s(G,H);break}else t(G,H);H=H.sibling}ee=Nf(Q,G.mode,ee),ee.return=G,G=ee}return p(G);case ae:return Q=oa(Q),Ae(G,H,Q,ee)}if(Te(Q))return fe(G,H,Q,ee);if(re(Q)){if(pe=re(Q),typeof pe!="function")throw Error(o(150));return Q=pe.call(Q),ye(G,H,Q,ee)}if(typeof Q.then=="function")return Ae(G,H,vc(Q),ee);if(Q.$$typeof===le)return Ae(G,H,mc(G,Q),ee);xc(G,Q)}return typeof Q=="string"&&Q!==""||typeof Q=="number"||typeof Q=="bigint"?(Q=""+Q,H!==null&&H.tag===6?(s(G,H.sibling),ee=u(H,Q),ee.return=G,G=ee):(s(G,H),ee=wf(Q,G.mode,ee),ee.return=G,G=ee),p(G)):s(G,H)}return function(G,H,Q,ee){try{Do=0;var pe=Ae(G,H,Q,ee);return li=null,pe}catch(be){if(be===si||be===pc)throw be;var $e=mn(29,be,null,G.mode);return $e.lanes=ee,$e.return=G,$e}finally{}}}var ca=Ap(!0),Op=Ap(!1),rl=!1;function Df(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Lf(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 cl(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function ul(e,t,s){var i=e.updateQueue;if(i===null)return null;if(i=i.shared,(Qe&2)!==0){var u=i.pending;return u===null?t.next=t:(t.next=u.next,u.next=t),i.pending=t,t=oc(e),gp(e,null,s),t}return ic(e,i,t,s),oc(e)}function Lo(e,t,s){if(t=t.updateQueue,t!==null&&(t=t.shared,(s&4194048)!==0)){var i=t.lanes;i&=e.pendingLanes,s|=i,t.lanes=s,nn(e,s)}}function $f(e,t){var s=e.updateQueue,i=e.alternate;if(i!==null&&(i=i.updateQueue,s===i)){var u=null,f=null;if(s=s.firstBaseUpdate,s!==null){do{var p={lane:s.lane,tag:s.tag,payload:s.payload,callback:null,next:null};f===null?u=f=p:f=f.next=p,s=s.next}while(s!==null);f===null?u=f=t:f=f.next=t}else u=f=t;s={baseState:i.baseState,firstBaseUpdate:u,lastBaseUpdate:f,shared:i.shared,callbacks:i.callbacks},e.updateQueue=s;return}e=s.lastBaseUpdate,e===null?s.firstBaseUpdate=t:e.next=t,s.lastBaseUpdate=t}var kf=!1;function $o(){if(kf){var e=ni;if(e!==null)throw e}}function ko(e,t,s,i){kf=!1;var u=e.updateQueue;rl=!1;var f=u.firstBaseUpdate,p=u.lastBaseUpdate,w=u.shared.pending;if(w!==null){u.shared.pending=null;var z=w,q=z.next;z.next=null,p===null?f=q:p.next=q,p=z;var X=e.alternate;X!==null&&(X=X.updateQueue,w=X.lastBaseUpdate,w!==p&&(w===null?X.firstBaseUpdate=q:w.next=q,X.lastBaseUpdate=z))}if(f!==null){var ne=u.baseState;p=0,X=q=z=null,w=f;do{var V=w.lane&-536870913,Y=V!==w.lane;if(Y?(Le&V)===V:(i&V)===V){V!==0&&V===aa&&(kf=!0),X!==null&&(X=X.next={lane:0,tag:w.tag,payload:w.payload,callback:null,next:null});e:{var fe=e,ye=w;V=t;var Ae=s;switch(ye.tag){case 1:if(fe=ye.payload,typeof fe=="function"){ne=fe.call(Ae,ne,V);break e}ne=fe;break e;case 3:fe.flags=fe.flags&-65537|128;case 0:if(fe=ye.payload,V=typeof fe=="function"?fe.call(Ae,ne,V):fe,V==null)break e;ne=A({},ne,V);break e;case 2:rl=!0}}V=w.callback,V!==null&&(e.flags|=64,Y&&(e.flags|=8192),Y=u.callbacks,Y===null?u.callbacks=[V]:Y.push(V))}else Y={lane:V,tag:w.tag,payload:w.payload,callback:w.callback,next:null},X===null?(q=X=Y,z=ne):X=X.next=Y,p|=V;if(w=w.next,w===null){if(w=u.shared.pending,w===null)break;Y=w,w=Y.next,Y.next=null,u.lastBaseUpdate=Y,u.shared.pending=null}}while(!0);X===null&&(z=ne),u.baseState=z,u.firstBaseUpdate=q,u.lastBaseUpdate=X,f===null&&(u.shared.lanes=0),yl|=p,e.lanes=p,e.memoizedState=ne}}function zp(e,t){if(typeof e!="function")throw Error(o(191,e));e.call(t)}function Dp(e,t){var s=e.callbacks;if(s!==null)for(e.callbacks=null,e=0;e<s.length;e++)zp(s[e],t)}var fl=zt(null),Sc=zt(0);function Lp(e,t){e=Vs,Ge(Sc,e),Ge(fl,t),Vs=e|t.baseLanes}function Hf(){Ge(Sc,Vs),Ge(fl,fl.current)}function Uf(){Vs=Sc.current,ut(fl),ut(Sc)}var kt=zt(null),Pt=null;function dl(e){var t=e.alternate;Ge(Ht,Ht.current&1),Ge(kt,e),Pt===null&&(t===null||fl.current!==null||t.memoizedState!==null)&&(Pt=e)}function Ff(e){Ge(Ht,Ht.current),Ge(kt,e),Pt===null&&(Pt=e)}function $p(e){e.tag===22?(Ge(Ht,Ht.current),Ge(kt,e),Pt===null&&(Pt=e)):hl()}function hl(){Ge(Ht,Ht.current),Ge(kt,kt.current)}function En(e){ut(kt),Pt===e&&(Pt=null),ut(Ht)}var Ht=zt(0);function Ho(e,t){Ge(kt,kt.current),Ge(Ht,t)}function Vf(e){ut(Ht),ut(kt),Pt===e&&(Pt=null)}function bc(e){for(var t=e;t!==null;){if(t.tag===13){var s=t.memoizedState;if(s!==null&&(s=s.dehydrated,s===null||ch(s)||uh(s)))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!=="independent"){if((t.flags&128)!==0)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}var ks=0,Re=null,tt=null,bt=null,jc=!1,ai=!1,ua=!1,wc=0,Uo=0,ii=null,Pb=0;function ht(){throw Error(o(321))}function Bf(e,t){if(t===null)return!1;for(var s=0;s<t.length&&s<e.length;s++)if(!Mn(e[s],t[s]))return!1;return!0}function Gf(e,t,s,i,u,f){return ks=f,Re=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,me.H=e===null||e.memoizedState===null?x0:S0,ua=!1,f=s(i,u),ua=!1,ai&&(f=Hp(t,s,i,u)),kp(e),f}function kp(e){me.H=Rc;var t=tt!==null&&tt.next!==null;if(ks=0,bt=tt=Re=null,jc=!1,Uo=0,ii=null,t)throw Error(o(300));e===null||jt||(e=e.dependencies,e!==null&&hc(e)&&(jt=!0))}function Hp(e,t,s,i){Re=e;var u=0;do{if(ai&&(ii=null),Uo=0,ai=!1,25<=u)throw Error(o(301));if(u+=1,bt=tt=null,e.updateQueue!=null){var f=e.updateQueue;f.lastEffect=null,f.events=null,f.stores=null,f.memoCache!=null&&(f.memoCache.index=0)}me.H=nj,f=t(s,i)}while(ai);return f}function Xb(){var e=me.H,t=e.useState()[0];return t=typeof t.then=="function"?Fo(t):t,e=e.useState()[0],(tt!==null?tt.memoizedState:null)!==e&&(Re.flags|=1024),t}function qf(){var e=wc!==0;return wc=0,e}function If(e,t,s){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s}function Qf(e){if(jc){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}jc=!1}ks=0,bt=tt=Re=null,ai=!1,Uo=wc=0,ii=null}function ln(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return bt===null?Re.memoizedState=bt=e:bt=bt.next=e,bt}function yt(){if(tt===null){var e=Re.alternate;e=e!==null?e.memoizedState:null}else e=tt.next;var t=bt===null?Re.memoizedState:bt.next;if(t!==null)bt=t,tt=e;else{if(e===null)throw Re.alternate===null?Error(o(467)):Error(o(310));tt=e,e={memoizedState:tt.memoizedState,baseState:tt.baseState,baseQueue:tt.baseQueue,queue:tt.queue,next:null},bt===null?Re.memoizedState=bt=e:bt=bt.next=e}return bt}function Nc(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Fo(e){var t=Uo;return Uo+=1,ii===null&&(ii=[]),e=Tp(ii,e,t),t=Re,(bt===null?t.memoizedState:bt.next)===null&&(t=t.alternate,me.H=t===null||t.memoizedState===null?x0:S0),e}function Cc(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Fo(e);if(e.$$typeof===U)return;if(e.$$typeof===le)return $t(e)}throw Error(o(438,String(e)))}function Yf(e){var t=null,s=Re.updateQueue;if(s!==null&&(t=s.memoCache),t==null){var i=Re.alternate;i!==null&&(i=i.updateQueue,i!==null&&(i=i.memoCache,i!=null&&(t={data:i.data.map(function(u){return u.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),s===null&&(s=Nc(),Re.updateQueue=s),s.memoCache=t,s=t.data[t.index],s===void 0)for(s=t.data[t.index]=Array(e),i=0;i<e;i++)s[i]=je;return t.index++,s}function Hs(e,t){return typeof t=="function"?t(e):t}function Mc(e){var t=yt();return Pf(t,tt,e)}function Pf(e,t,s){var i=e.queue;if(i===null)throw Error(o(311));i.lastRenderedReducer=s;var u=e.baseQueue,f=i.pending;if(f!==null){if(u!==null){var p=u.next;u.next=f.next,f.next=p}t.baseQueue=u=f,i.pending=null}if(f=e.baseState,u===null)e.memoizedState=f;else{t=u.next;var w=p=null,z=null,q=t,X=!1;do{var ne=q.lane&-536870913;if(ne!==q.lane?(Le&ne)===ne:(ks&ne)===ne){var V=q.revertLane;if(V===0)z!==null&&(z=z.next={lane:0,revertLane:0,gesture:null,action:q.action,hasEagerState:q.hasEagerState,eagerState:q.eagerState,next:null}),ne===aa&&(X=!0);else if((ks&V)===V){q=q.next,V===aa&&(X=!0);continue}else ne={lane:0,revertLane:q.revertLane,gesture:null,action:q.action,hasEagerState:q.hasEagerState,eagerState:q.eagerState,next:null},z===null?(w=z=ne,p=f):z=z.next=ne,Re.lanes|=V,yl|=V;ne=q.action,ua&&s(f,ne),f=q.hasEagerState?q.eagerState:s(f,ne)}else V={lane:ne,revertLane:q.revertLane,gesture:q.gesture,action:q.action,hasEagerState:q.hasEagerState,eagerState:q.eagerState,next:null},z===null?(w=z=V,p=f):z=z.next=V,Re.lanes|=ne,yl|=ne;q=q.next}while(q!==null&&q!==t);if(z===null?p=f:z.next=w,!Mn(f,e.memoizedState)&&(jt=!0,X&&(s=ni,s!==null)))throw s;e.memoizedState=f,e.baseState=p,e.baseQueue=z,i.lastRenderedState=f}return u===null&&(i.lanes=0),[e.memoizedState,i.dispatch]}function Xf(e){var t=yt(),s=t.queue;if(s===null)throw Error(o(311));s.lastRenderedReducer=e;var i=s.dispatch,u=s.pending,f=t.memoizedState;if(u!==null){s.pending=null;var p=u=u.next;do f=e(f,p.action),p=p.next;while(p!==u);Mn(f,t.memoizedState)||(jt=!0),t.memoizedState=f,t.baseQueue===null&&(t.baseState=f),s.lastRenderedState=f}return[f,i]}function Up(e,t,s){var i=Re,u=yt(),f=Oe;if(f){if(s===void 0)throw Error(o(407));s=s()}else s=t();var p=!Mn((tt||u).memoizedState,s);if(p&&(u.memoizedState=s,jt=!0),u=u.queue,Jf(Bp.bind(null,i,u,e),[e]),e=u.getSnapshot!==t||p||bt!==null&&(bt.memoizedState.tag&1)!==0,oi(e?9:8,{destroy:void 0},Vp.bind(null,i,u,s,t),null),e){if(i.flags|=2048,nt===null)throw Error(o(349));f||(ks&127)!==0||Fp(i,t,s)}return s}function Fp(e,t,s){e.flags|=16384,e={getSnapshot:t,value:s},t=Re.updateQueue,t===null?(t=Nc(),Re.updateQueue=t,t.stores=[e]):(s=t.stores,s===null?t.stores=[e]:s.push(e))}function Vp(e,t,s,i){t.value=s,t.getSnapshot=i,Gp(t)&&qp(e)}function Bp(e,t,s){return s(function(){Gp(t)&&qp(e)})}function Gp(e){var t=e.getSnapshot;e=e.value;try{var s=t();return!Mn(e,s)}catch{return!0}}function qp(e){var t=Wl(e,2);t!==null&&vn(t,e,2)}function Kf(e){var t=ln();if(typeof e=="function"){var s=e;if(e=s(),ua){Xn(!0);try{s()}finally{Xn(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Hs,lastRenderedState:e},t}function Ip(e,t,s,i){return e.baseState=s,Pf(e,tt,typeof i=="function"?i:Hs)}function Kb(e,t,s,i,u){if(_c(e))throw Error(o(485));if(e=t.action,e!==null){var f={payload:u,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(p){f.listeners.push(p)}};me.T!==null?s(!0):f.isTransition=!1,i(f),s=t.pending,s===null?(f.next=t.pending=f,Qp(t,f)):(f.next=s.next,t.pending=s.next=f)}}function Qp(e,t){var s=t.action,i=t.payload,u=e.state;if(t.isTransition){var f=me.T,p={};p.types=f!==null?f.types:null,me.T=p;try{var w=s(u,i),z=me.S;z!==null&&z(p,w),Yp(e,t,w)}catch(q){Zf(e,t,q)}finally{f!==null&&p.types!==null&&(f.types=p.types),me.T=f}}else try{f=s(u,i),Yp(e,t,f)}catch(q){Zf(e,t,q)}}function Yp(e,t,s){s!==null&&typeof s=="object"&&typeof s.then=="function"?s.then(function(i){Pp(e,t,i)},function(i){return Zf(e,t,i)}):Pp(e,t,s)}function Pp(e,t,s){t.status="fulfilled",t.value=s,Xp(t),e.state=s,t=e.pending,t!==null&&(s=t.next,s===t?e.pending=null:(s=s.next,t.next=s,Qp(e,s)))}function Zf(e,t,s){var i=e.pending;if(e.pending=null,i!==null){i=i.next;do t.status="rejected",t.reason=s,Xp(t),t=t.next;while(t!==i)}e.action=null}function Xp(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Kp(e,t){return t}function Zp(e,t){if(Oe){var s=nt.formState;if(s!==null){e:{var i=Re;if(Oe){if(st){t:{for(var u=st,f=Bn;u.nodeType!==8;){if(!f){u=null;break t}if(u=qn(u.nextSibling),u===null){u=null;break t}}f=u.data,u=f==="F!"||f==="F"?u:null}if(u){st=qn(u.nextSibling),i=u.data==="F!";break e}}al(i)}i=!1}i&&(t=s[0])}}return s=ln(),s.memoizedState=s.baseState=t,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Kp,lastRenderedState:t},s.queue=i,s=p0.bind(null,Re,i),i.dispatch=s,i=Kf(!1),f=sd.bind(null,Re,!1,i.queue),i=ln(),u={state:t,dispatch:null,action:e,pending:null},i.queue=u,s=Kb.bind(null,Re,u,f,s),u.dispatch=s,i.memoizedState=e,[t,s,!1]}function Jp(e){var t=yt();return Wp(t,tt,e)}function Wp(e,t,s){if(t=Pf(e,t,Kp)[0],e=Mc(Hs)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var i=Fo(t)}catch(p){throw p===si?pc:p}else i=t;t=yt();var u=t.queue,f=u.dispatch;return s!==t.memoizedState&&(Re.flags|=2048,oi(9,{destroy:void 0},Zb.bind(null,u,s),null)),[i,f,e]}function Zb(e,t){e.action=t}function e0(e){var t=yt(),s=tt;if(s!==null)return Wp(t,s,e);yt(),t=t.memoizedState,s=yt();var i=s.queue.dispatch;return s.memoizedState=e,[t,i,!1]}function oi(e,t,s,i){return e={tag:e,create:s,deps:i,inst:t,next:null},t=Re.updateQueue,t===null&&(t=Nc(),Re.updateQueue=t),s=t.lastEffect,s===null?t.lastEffect=e.next=e:(i=s.next,s.next=e,e.next=i,t.lastEffect=e),e}function t0(){return yt().memoizedState}function Ec(e,t,s,i){var u=ln();Re.flags|=e,u.memoizedState=oi(1|t,{destroy:void 0},s,i===void 0?null:i)}function Tc(e,t,s,i){var u=yt();i=i===void 0?null:i;var f=u.memoizedState.inst;tt!==null&&i!==null&&Bf(i,tt.memoizedState.deps)?u.memoizedState=oi(t,f,s,i):(Re.flags|=e,u.memoizedState=oi(1|t,f,s,i))}function n0(e,t){Ec(8390656,8,e,t)}function Jf(e,t){Tc(2048,8,e,t)}function Jb(e){Re.flags|=4;var t=Re.updateQueue;if(t===null)t=Nc(),Re.updateQueue=t,t.events=[e];else{var s=t.events;s===null?t.events=[e]:s.push(e)}}function s0(e){var t=yt().memoizedState;return Jb({ref:t,nextImpl:e}),function(){if((Qe&2)!==0)throw Error(o(440));return t.impl.apply(void 0,arguments)}}function l0(e,t){return Tc(4,2,e,t)}function a0(e,t){return Tc(4,4,e,t)}function i0(e,t){if(typeof t=="function"){e=e();var s=t(e);return function(){typeof s=="function"?s():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function o0(e,t,s){s=s!=null?s.concat([e]):null,Tc(4,4,i0.bind(null,t,e),s)}function Wf(){}function r0(e,t){var s=yt();t=t===void 0?null:t;var i=s.memoizedState;return t!==null&&Bf(t,i[1])?i[0]:(s.memoizedState=[e,t],e)}function c0(e,t){var s=yt();t=t===void 0?null:t;var i=s.memoizedState;if(t!==null&&Bf(t,i[1]))return i[0];if(i=e(),ua){Xn(!0);try{e()}finally{Xn(!1)}}return s.memoizedState=[i,t],i}function ed(e,t,s){return s===void 0||(ks&1073741824)!==0&&(Le&261930)===0?e.memoizedState=t:(e.memoizedState=s,e=xy(),Re.lanes|=e,yl|=e,s)}function u0(e,t,s,i){return Mn(s,t)?s:fl.current!==null?(e=ed(e,s,i),Mn(e,t)||(jt=!0),e):(ks&106)===0||(ks&1073741824)!==0&&(Le&261930)===0?(jt=!0,e.memoizedState=s):(e=xy(),Re.lanes|=e,yl|=e,t)}function f0(e,t,s,i,u){var f=Se.p;Se.p=f!==0&&8>f?f:8;var p=me.T,w={};w.types=p!==null?p.types:null,me.T=w,sd(e,!1,t,s);try{var z=u(),q=me.S;if(q!==null&&q(w,z),z!==null&&typeof z=="object"&&typeof z.then=="function"){var X=Yb(z,i);Vo(e,t,X,An(e))}else Vo(e,t,i,An(e))}catch(ne){Vo(e,t,{then:function(){},status:"rejected",reason:ne},An())}finally{Se.p=f,p!==null&&w.types!==null&&(p.types=w.types),me.T=p}}function Wb(){}function td(e,t,s,i){if(e.tag!==5)throw Error(o(476));var u=d0(e).queue;f0(e,u,t,ct,s===null?Wb:function(){return h0(e),s(i)})}function d0(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ct,baseState:ct,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Hs,lastRenderedState:ct},next:null};var s={};return t.next={memoizedState:s,baseState:s,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Hs,lastRenderedState:s},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function h0(e){var t=d0(e);t.next===null&&(t=e.alternate.memoizedState),Vo(e,t.next.queue,{},An())}function nd(){return $t(Mi)}function m0(){return yt().memoizedState}function g0(){return yt().memoizedState}function ej(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var s=An();e=cl(s);var i=ul(t,e,s);i!==null&&(vn(i,t,s),Lo(i,t,s)),t={cache:Rf()},e.payload=t;return}t=t.return}}function tj(e,t,s){var i=An();s={lane:i,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},_c(e)?y0(t,s):(s=bf(e,t,s,i),s!==null&&(vn(s,e,i),v0(s,t,i)))}function p0(e,t,s){var i=An();Vo(e,t,s,i)}function Vo(e,t,s,i){var u={lane:i,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null};if(_c(e))y0(t,u);else{var f=e.alternate;if(e.lanes===0&&(f===null||f.lanes===0)&&(f=t.lastRenderedReducer,f!==null))try{var p=t.lastRenderedState,w=f(p,s);if(u.hasEagerState=!0,u.eagerState=w,Mn(w,p))return ic(e,t,u,0),nt===null&&ac(),!1}catch{}finally{}if(s=bf(e,t,u,i),s!==null)return vn(s,e,i),v0(s,t,i),!0}return!1}function sd(e,t,s,i){if(i={lane:2,revertLane:Yd(),gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},_c(e)){if(t)throw Error(o(479))}else t=bf(e,s,i,2),t!==null&&vn(t,e,2)}function _c(e){var t=e.alternate;return e===Re||t!==null&&t===Re}function y0(e,t){ai=jc=!0;var s=e.pending;s===null?t.next=t:(t.next=s.next,s.next=t),e.pending=t}function v0(e,t,s){if((s&4194048)!==0){var i=t.lanes;i&=e.pendingLanes,s|=i,t.lanes=s,nn(e,s)}}var Rc={readContext:$t,use:Cc,useCallback:ht,useContext:ht,useEffect:ht,useImperativeHandle:ht,useLayoutEffect:ht,useInsertionEffect:ht,useMemo:ht,useReducer:ht,useRef:ht,useState:ht,useDebugValue:ht,useDeferredValue:ht,useTransition:ht,useSyncExternalStore:ht,useId:ht,useHostTransitionStatus:ht,useFormState:ht,useActionState:ht,useOptimistic:ht,useMemoCache:ht,useCacheRefresh:ht,useEffectEvent:ht},x0={readContext:$t,use:Cc,useCallback:function(e,t){return ln().memoizedState=[e,t===void 0?null:t],e},useContext:$t,useEffect:n0,useImperativeHandle:function(e,t,s){s=s!=null?s.concat([e]):null,Ec(4194308,4,i0.bind(null,t,e),s)},useLayoutEffect:function(e,t){return Ec(4194308,4,e,t)},useInsertionEffect:function(e,t){Ec(4,2,e,t)},useMemo:function(e,t){var s=ln();t=t===void 0?null:t;var i=e();if(ua){Xn(!0);try{e()}finally{Xn(!1)}}return s.memoizedState=[i,t],i},useReducer:function(e,t,s){var i=ln();if(s!==void 0){var u=s(t);if(ua){Xn(!0);try{s(t)}finally{Xn(!1)}}}else u=t;return i.memoizedState=i.baseState=u,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:u},i.queue=e,e=e.dispatch=tj.bind(null,Re,e),[i.memoizedState,e]},useRef:function(e){var t=ln();return e={current:e},t.memoizedState=e},useState:function(e){e=Kf(e);var t=e.queue,s=p0.bind(null,Re,t);return t.dispatch=s,[e.memoizedState,s]},useDebugValue:Wf,useDeferredValue:function(e,t){var s=ln();return ed(s,e,t)},useTransition:function(){var e=Kf(!1);return e=f0.bind(null,Re,e.queue,!0,!1),ln().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,s){var i=Re,u=ln();if(Oe){if(s===void 0)throw Error(o(407));s=s()}else{if(s=t(),nt===null)throw Error(o(349));(Le&127)!==0||Fp(i,t,s)}u.memoizedState=s;var f={value:s,getSnapshot:t};return u.queue=f,n0(Bp.bind(null,i,f,e),[e]),i.flags|=2048,oi(9,{destroy:void 0},Vp.bind(null,i,f,s,t),null),s},useId:function(){var e=ln(),t=nt.identifierPrefix;if(Oe){var s=ds,i=fs;s=(i&~(1<<32-Yt(i)-1)).toString(32)+s,t="_"+t+"R_"+s,s=wc++,0<s&&(t+="H"+s.toString(32)),t+="_"}else s=Pb++,t="_"+t+"r_"+s.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:nd,useFormState:Zp,useActionState:Zp,useOptimistic:function(e){var t=ln();t.memoizedState=t.baseState=e;var s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=s,t=sd.bind(null,Re,!0,s),s.dispatch=t,[e,t]},useMemoCache:Yf,useCacheRefresh:function(){return ln().memoizedState=ej.bind(null,Re)},useEffectEvent:function(e){var t=ln(),s={impl:e};return t.memoizedState=s,function(){if((Qe&2)!==0)throw Error(o(440));return s.impl.apply(void 0,arguments)}}},S0={readContext:$t,use:Cc,useCallback:r0,useContext:$t,useEffect:Jf,useImperativeHandle:o0,useInsertionEffect:l0,useLayoutEffect:a0,useMemo:c0,useReducer:Mc,useRef:t0,useState:function(){return Mc(Hs)},useDebugValue:Wf,useDeferredValue:function(e,t){var s=yt();return u0(s,tt.memoizedState,e,t)},useTransition:function(){var e=Mc(Hs)[0],t=yt().memoizedState;return[typeof e=="boolean"?e:Fo(e),t]},useSyncExternalStore:Up,useId:m0,useHostTransitionStatus:nd,useFormState:Jp,useActionState:Jp,useOptimistic:function(e,t){var s=yt();return Ip(s,tt,e,t)},useMemoCache:Yf,useCacheRefresh:g0,useEffectEvent:s0},nj={readContext:$t,use:Cc,useCallback:r0,useContext:$t,useEffect:Jf,useImperativeHandle:o0,useInsertionEffect:l0,useLayoutEffect:a0,useMemo:c0,useReducer:Xf,useRef:t0,useState:function(){return Xf(Hs)},useDebugValue:Wf,useDeferredValue:function(e,t){var s=yt();return tt===null?ed(s,e,t):u0(s,tt.memoizedState,e,t)},useTransition:function(){var e=Xf(Hs)[0],t=yt().memoizedState;return[typeof e=="boolean"?e:Fo(e),t]},useSyncExternalStore:Up,useId:m0,useHostTransitionStatus:nd,useFormState:e0,useActionState:e0,useOptimistic:function(e,t){var s=yt();return tt!==null?Ip(s,tt,e,t):(s.baseState=e,[e,s.queue.dispatch])},useMemoCache:Yf,useCacheRefresh:g0,useEffectEvent:s0};function ld(e,t,s,i){t=e.memoizedState,s=s(i,t),s=s==null?t:A({},t,s),e.memoizedState=s,e.lanes===0&&(e.updateQueue.baseState=s)}var ad={enqueueSetState:function(e,t,s){e=e._reactInternals;var i=An(),u=cl(i);u.payload=t,s!=null&&(u.callback=s),t=ul(e,u,i),t!==null&&(vn(t,e,i),Lo(t,e,i))},enqueueReplaceState:function(e,t,s){e=e._reactInternals;var i=An(),u=cl(i);u.tag=1,u.payload=t,s!=null&&(u.callback=s),t=ul(e,u,i),t!==null&&(vn(t,e,i),Lo(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var s=An(),i=cl(s);i.tag=2,t!=null&&(i.callback=t),t=ul(e,i,s),t!==null&&(vn(t,e,s),Lo(t,e,s))}};function b0(e,t,s,i,u,f,p){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(i,f,p):t.prototype&&t.prototype.isPureReactComponent?!Eo(s,i)||!Eo(u,f):!0}function j0(e,t,s,i){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(s,i),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(s,i),t.state!==e&&ad.enqueueReplaceState(t,t.state,null)}function fa(e,t){var s=t;if("ref"in t){s={};for(var i in t)i!=="ref"&&(s[i]=t[i])}if(e=e.defaultProps){s===t&&(s=A({},s));for(var u in e)s[u]===void 0&&(s[u]=e[u])}return s}function w0(e){lc(e)}function N0(e){console.error(e)}function C0(e){lc(e)}function Ac(e,t){try{var s=e.onUncaughtError;s(t.value,{componentStack:t.stack})}catch(i){setTimeout(function(){throw i})}}function M0(e,t,s){try{var i=e.onCaughtError;i(s.value,{componentStack:s.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(u){setTimeout(function(){throw u})}}function id(e,t,s){return s=cl(s),s.tag=3,s.payload={element:null},s.callback=function(){Ac(e,t)},s}function E0(e){return e=cl(e),e.tag=3,e}function T0(e,t,s,i){var u=s.type.getDerivedStateFromError;if(typeof u=="function"){var f=i.value;e.payload=function(){return u(f)},e.callback=function(){M0(t,s,i)}}var p=s.stateNode;p!==null&&typeof p.componentDidCatch=="function"&&(e.callback=function(){M0(t,s,i),typeof u!="function"&&(vl===null?vl=new Set([this]):vl.add(this));var w=i.stack;this.componentDidCatch(i.value,{componentStack:w!==null?w:""})})}function sj(e,t,s,i,u){if(s.flags|=32768,i!==null&&typeof i=="object"&&typeof i.then=="function"){if(t=s.alternate,t!==null&&sa(t,s,u,!0),s=kt.current,s!==null){switch(s.tag){case 31:case 13:case 19:return Pt===null?Jc():s.alternate===null&&mt===0&&(mt=3),s.flags&=-257,s.flags|=65536,s.lanes=u,i===yc?s.flags|=16384:(t=s.updateQueue,t===null?s.updateQueue=new Set([i]):t.add(i),qd(e,i,u)),!1;case 22:return s.flags|=65536,i===yc?s.flags|=16384:(t=s.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([i])},s.updateQueue=t):(s=t.retryQueue,s===null?t.retryQueue=new Set([i]):s.add(i)),qd(e,i,u)),!1}throw Error(o(435,s.tag))}return qd(e,i,u),Jc(),!1}if(Oe)return t=kt.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=u,i!==Mf&&(e=Error(o(422),{cause:i}),Ro(Un(e,s)))):(i!==Mf&&(t=Error(o(423),{cause:i}),Ro(Un(t,s))),e=e.current.alternate,e.flags|=65536,u&=-u,e.lanes|=u,i=Un(i,s),u=id(e.stateNode,i,u),$f(e,u),mt!==4&&(mt=2)),!1;var f=Error(o(520),{cause:i});if(f=Un(f,s),Xo===null?Xo=[f]:Xo.push(f),mt!==4&&(mt=2),t===null)return!0;i=Un(i,s),s=t;do{switch(s.tag){case 3:return s.flags|=65536,e=u&-u,s.lanes|=e,e=id(s.stateNode,i,e),$f(s,e),!1;case 1:if(t=s.type,f=s.stateNode,(s.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||f!==null&&typeof f.componentDidCatch=="function"&&(vl===null||!vl.has(f))))return s.flags|=65536,u&=-u,s.lanes|=u,u=E0(u),T0(u,e,s,i),$f(s,u),!1;break;case 22:if(s.memoizedState!==null)return s.flags|=65536,!1}s=s.return}while(s!==null);return!1}var od=Error(o(461)),jt=!1;function Mt(e,t,s,i){t.child=e===null?Op(t,null,s,i):ca(t,e.child,s,i)}function _0(e,t,s,i,u){s=s.render;var f=t.ref;if("ref"in i){var p={};for(var w in i)w!=="ref"&&(p[w]=i[w])}else p=i;return la(t),i=Gf(e,t,s,p,f,u),w=qf(),e!==null&&!jt?(If(e,t,u),Us(e,t,u)):(Oe&&w&&uc(t),t.flags|=1,Mt(e,t,i,u),t.child)}function R0(e,t,s,i,u){if(e===null){var f=s.type;return typeof f=="function"&&!jf(f)&&f.defaultProps===void 0&&s.compare===null?(t.tag=15,t.type=f,A0(e,t,f,i,u)):(e=rc(s.type,null,i,t,t.mode,u),e.ref=t.ref,e.return=t,t.child=e)}if(f=e.child,!gd(e,u)){var p=f.memoizedProps;if(s=s.compare,s=s!==null?s:Eo,s(p,i)&&e.ref===t.ref)return Us(e,t,u)}return t.flags|=1,e=zs(f,i),e.ref=t.ref,e.return=t,t.child=e}function A0(e,t,s,i,u){if(e!==null){var f=e.memoizedProps;if(Eo(f,i)&&e.ref===t.ref)if(jt=!1,t.pendingProps=i=f,gd(e,u))(e.flags&131072)!==0&&(jt=!0);else return t.lanes=e.lanes,Us(e,t,u)}return rd(e,t,s,i,u)}function O0(e,t,s,i){var u=i.children,f=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),i.mode==="hidden"){if((t.flags&128)!==0){if(f=f!==null?f.baseLanes|s:s,e!==null){for(i=t.child=e.child,u=0;i!==null;)u=u|i.lanes|i.childLanes,i=i.sibling;i=u&~f}else i=0,t.child=null;return z0(e,t,f,s,i)}if((s&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&gc(t,f!==null?f.cachePool:null),f!==null?Lp(t,f):Hf(),$p(t);else return i=t.lanes=536870912,z0(e,t,f!==null?f.baseLanes|s:s,s,i)}else f!==null?(gc(t,f.cachePool),Lp(t,f),hl(),t.memoizedState=null):(e!==null&&gc(t,null),Hf(),hl());return Mt(e,t,u,s),t.child}function Bo(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function z0(e,t,s,i,u){var f=Of();return f=f===null?null:{parent:St._currentValue,pool:f},t.memoizedState={baseLanes:s,cachePool:f},e!==null&&gc(t,null),Hf(),$p(t),e!==null&&sa(e,t,i,!0),t.childLanes=u,null}function Oc(e,t){return t=zc({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function D0(e,t,s){return ca(t,e.child,null,s),e=Oc(t,t.pendingProps),e.flags|=2,En(t),t.memoizedState=null,e}function lj(e,t,s){var i=t.pendingProps,u=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Oe){if(i.mode==="hidden")return e=Oc(t,i),t.lanes=536870912,e.memoizedState={baseLanes:0,cachePool:null},Bo(null,e);if(Ff(t),(e=st)?(e=iv(e,Bn),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:sl!==null?{id:fs,overflow:ds}:null,retryLane:536870912,hydrationErrors:null},s=yp(e),s.return=t,t.child=s,_t=t,st=null)):e=null,e===null)throw al(t);return t.lanes=536870912,null}return Oc(t,i)}var f=e.memoizedState;if(f!==null){var p=f.dehydrated;if(Ff(t),u)if(t.flags&256)t.flags&=-257,t=D0(e,t,s);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(o(558));else if(jt||sa(e,t,s,!1),u=(s&e.childLanes)!==0,jt||u){if(fl.current===null){if(i=nt,i!==null&&(p=Ua(i,s),p!==0&&p!==f.retryLane))throw f.retryLane=p,Wl(e,p),vn(i,e,p),od;Jc()}t=D0(e,t,s)}else e=f.treeContext,st=qn(p.nextSibling),_t=t,Oe=!0,ll=null,Bn=!1,e!==null&&Sp(t,e),t=Oc(t,i),t.flags|=134221824;return t}return e=zs(e.child,{mode:i.mode,children:i.children}),e.ref=t.ref,t.child=e,e.return=t,e}function ri(e,t){var s=t.ref;if(s===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof s!="function"&&typeof s!="object")throw Error(o(284));(e===null||e.ref!==s)&&(t.flags|=4194816)}}function rd(e,t,s,i,u){return la(t),s=Gf(e,t,s,i,void 0,u),i=qf(),e!==null&&!jt?(If(e,t,u),Us(e,t,u)):(Oe&&i&&uc(t),t.flags|=1,Mt(e,t,s,u),t.child)}function L0(e,t,s,i,u,f){return la(t),t.updateQueue=null,s=Hp(t,i,s,u),kp(e),i=qf(),e!==null&&!jt?(If(e,t,f),Us(e,t,f)):(Oe&&i&&uc(t),t.flags|=1,Mt(e,t,s,f),t.child)}function $0(e,t,s,i,u){if(la(t),t.stateNode===null){var f=Ja,p=s.contextType;typeof p=="object"&&p!==null&&(f=$t(p)),f=new s(i,f),t.memoizedState=f.state!==null&&f.state!==void 0?f.state:null,f.updater=ad,t.stateNode=f,f._reactInternals=t,f=t.stateNode,f.props=i,f.state=t.memoizedState,f.refs={},Df(t),p=s.contextType,f.context=typeof p=="object"&&p!==null?$t(p):Ja,f.state=t.memoizedState,p=s.getDerivedStateFromProps,typeof p=="function"&&(ld(t,s,p,i),f.state=t.memoizedState),typeof s.getDerivedStateFromProps=="function"||typeof f.getSnapshotBeforeUpdate=="function"||typeof f.UNSAFE_componentWillMount!="function"&&typeof f.componentWillMount!="function"||(p=f.state,typeof f.componentWillMount=="function"&&f.componentWillMount(),typeof f.UNSAFE_componentWillMount=="function"&&f.UNSAFE_componentWillMount(),p!==f.state&&ad.enqueueReplaceState(f,f.state,null),ko(t,i,f,u),$o(),f.state=t.memoizedState),typeof f.componentDidMount=="function"&&(t.flags|=4194308),i=!0}else if(e===null){f=t.stateNode;var w=t.memoizedProps,z=fa(s,w);f.props=z;var q=f.context,X=s.contextType;p=Ja,typeof X=="object"&&X!==null&&(p=$t(X));var ne=s.getDerivedStateFromProps;X=typeof ne=="function"||typeof f.getSnapshotBeforeUpdate=="function",w=t.pendingProps!==w,X||typeof f.UNSAFE_componentWillReceiveProps!="function"&&typeof f.componentWillReceiveProps!="function"||(w||q!==p)&&j0(t,f,i,p),rl=!1;var V=t.memoizedState;f.state=V,ko(t,i,f,u),$o(),q=t.memoizedState,w||V!==q||rl?(typeof ne=="function"&&(ld(t,s,ne,i),q=t.memoizedState),(z=rl||b0(t,s,z,i,V,q,p))?(X||typeof f.UNSAFE_componentWillMount!="function"&&typeof f.componentWillMount!="function"||(typeof f.componentWillMount=="function"&&f.componentWillMount(),typeof f.UNSAFE_componentWillMount=="function"&&f.UNSAFE_componentWillMount()),typeof f.componentDidMount=="function"&&(t.flags|=4194308)):(typeof f.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=i,t.memoizedState=q),f.props=i,f.state=q,f.context=p,i=z):(typeof f.componentDidMount=="function"&&(t.flags|=4194308),i=!1)}else{f=t.stateNode,Lf(e,t),p=t.memoizedProps,X=fa(s,p),f.props=X,ne=t.pendingProps,V=f.context,q=s.contextType,z=Ja,typeof q=="object"&&q!==null&&(z=$t(q)),w=s.getDerivedStateFromProps,(q=typeof w=="function"||typeof f.getSnapshotBeforeUpdate=="function")||typeof f.UNSAFE_componentWillReceiveProps!="function"&&typeof f.componentWillReceiveProps!="function"||(p!==ne||V!==z)&&j0(t,f,i,z),rl=!1,V=t.memoizedState,f.state=V,ko(t,i,f,u),$o();var Y=t.memoizedState;p!==ne||V!==Y||rl||e!==null&&e.dependencies!==null&&hc(e.dependencies)?(typeof w=="function"&&(ld(t,s,w,i),Y=t.memoizedState),(X=rl||b0(t,s,X,i,V,Y,z)||e!==null&&e.dependencies!==null&&hc(e.dependencies))?(q||typeof f.UNSAFE_componentWillUpdate!="function"&&typeof f.componentWillUpdate!="function"||(typeof f.componentWillUpdate=="function"&&f.componentWillUpdate(i,Y,z),typeof f.UNSAFE_componentWillUpdate=="function"&&f.UNSAFE_componentWillUpdate(i,Y,z)),typeof f.componentDidUpdate=="function"&&(t.flags|=4),typeof f.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof f.componentDidUpdate!="function"||p===e.memoizedProps&&V===e.memoizedState||(t.flags|=4),typeof f.getSnapshotBeforeUpdate!="function"||p===e.memoizedProps&&V===e.memoizedState||(t.flags|=1024),t.memoizedProps=i,t.memoizedState=Y),f.props=i,f.state=Y,f.context=z,i=X):(typeof f.componentDidUpdate!="function"||p===e.memoizedProps&&V===e.memoizedState||(t.flags|=4),typeof f.getSnapshotBeforeUpdate!="function"||p===e.memoizedProps&&V===e.memoizedState||(t.flags|=1024),i=!1)}return f=i,ri(e,t),i=(t.flags&128)!==0,f||i?(f=t.stateNode,s=i&&typeof s.getDerivedStateFromError!="function"?null:f.render(),t.flags|=1,e!==null&&i?(t.child=ca(t,e.child,null,u),t.child=ca(t,null,s,u)):Mt(e,t,s,u),t.memoizedState=f.state,e=t.child):e=Us(e,t,u),e}function k0(e,t,s,i){return ta(),t.flags|=256,Mt(e,t,s,i),t.child}var cd={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function ud(e){return{baseLanes:e,cachePool:Mp()}}function fd(e,t,s){return e=e!==null?e.childLanes&~s:0,t&&(e|=Rn),e}function H0(e,t,s){var i=t.pendingProps,u=!1,f=(t.flags&128)!==0,p;if((p=f)||(p=e!==null&&e.memoizedState===null?!1:(Ht.current&2)!==0),p&&(u=!0,t.flags&=-129),p=(t.flags&32)!==0,t.flags&=-33,e===null){if(Oe){if(u?dl(t):hl(),(e=st)?(e=iv(e,Bn),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:sl!==null?{id:fs,overflow:ds}:null,retryLane:536870912,hydrationErrors:null},s=yp(e),s.return=t,t.child=s,_t=t,st=null)):e=null,e===null)throw al(t);return uh(e)?t.lanes=32:t.lanes=536870912,null}return f=i.children,i=i.fallback,u?(hl(),u=t.mode,f=zc({mode:"hidden",children:f},u),i=ea(i,u,s,null),f.return=t,i.return=t,f.sibling=i,t.child=f,i=t.child,i.memoizedState=ud(s),i.childLanes=fd(e,p,s),t.memoizedState=cd,Bo(null,i)):(dl(t),dd(t,f))}var w=e.memoizedState;if(w!==null){var z=w.dehydrated;if(z!==null)return aj(e,t,f,p,i,z,w,s)}return u?(hl(),u=i.fallback,f=t.mode,w=e.child,z=w.sibling,i=zs(w,{mode:"hidden",children:i.children}),i.subtreeFlags=w.subtreeFlags&1206910976,z!==null?u=zs(z,u):(u=ea(u,f,s,null),u.flags|=2),u.return=t,i.return=t,i.sibling=u,t.child=i,Bo(null,i),i=t.child,u=e.child.memoizedState,u===null?u=ud(s):(f=u.cachePool,f!==null?(w=St._currentValue,f=f.parent!==w?{parent:w,pool:w}:f):f=Mp(),u={baseLanes:u.baseLanes|s,cachePool:f}),i.memoizedState=u,i.childLanes=fd(e,p,s),t.memoizedState=cd,Bo(e.child,i)):(dl(t),s=e.child,e=s.sibling,s=zs(s,{mode:"visible",children:i.children}),s.return=t,s.sibling=null,e!==null&&(p=t.deletions,p===null?(t.deletions=[e],t.flags|=16):p.push(e)),t.child=s,t.memoizedState=null,s)}function dd(e,t){return t=zc({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function zc(e,t){return e=mn(22,e,null,t),e.lanes=0,e}function Dc(e,t,s){return ca(t,e.child,null,s),e=dd(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function aj(e,t,s,i,u,f,p,w){if(s)return t.flags&256?(dl(t),t.flags&=-257,Dc(e,t,w)):t.memoizedState!==null?(hl(),t.child=e.child,t.flags|=128,null):(hl(),f=u.fallback,p=t.mode,u=zc({mode:"visible",children:u.children},p),f=ea(f,p,w,null),f.flags|=2,u.return=t,f.return=t,u.sibling=f,t.child=u,ca(t,e.child,null,w),u=t.child,u.memoizedState=ud(w),u.childLanes=fd(e,i,w),t.memoizedState=cd,Bo(null,u));if(dl(t),uh(f)){if(i=f.nextSibling&&f.nextSibling.dataset,i)var z=i.dgst;return i=z,i!==""&&(u=Error(o(419)),u.stack="",u.digest=i,Ro({value:u,source:null,stack:null})),Dc(e,t,w)}if(jt||sa(e,t,w,!1),i=(w&e.childLanes)!==0,jt||i){if(fl.current!==null)return Dc(e,t,w);if(i=nt,i!==null&&(u=Ua(i,w),u!==0&&u!==p.retryLane))throw p.retryLane=u,Wl(e,u),vn(i,e,u),od;return ch(f)||Jc(),Dc(e,t,w)}return ch(f)?(t.flags|=192,t.child=e.child,null):(e=p.treeContext,st=qn(f.nextSibling),_t=t,Oe=!0,ll=null,Bn=!1,e!==null&&Sp(t,e),t=dd(t,u.children),t.flags|=134221824,t)}function U0(e,t,s){e.lanes|=t;var i=e.alternate;i!==null&&(i.lanes|=t),dc(e.return,t,s)}function F0(e){for(var t=null;e!==null;){var s=e.alternate;s!==null&&bc(s)===null&&(t=e),e=e.sibling}return t}function Lc(e,t,s,i,u,f){var p=e.memoizedState;p===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:i,tail:s,tailMode:u,treeForkCount:f}:(p.isBackwards=t,p.rendering=null,p.renderingStartTime=0,p.last=i,p.tail=s,p.tailMode=u,p.treeForkCount=f)}function hd(e){var t=e.child;for(e.child=null;t!==null;){var s=t.sibling;t.sibling=e.child,e.child=t,t=s}}function md(e,t,s){var i=t.pendingProps,u=i.revealOrder,f=i.tail;i=i.children;var p=Ht.current;if(t.flags&128)return Ho(t,p),null;var w=(p&2)!==0;if(w?(p=p&1|2,t.flags|=128):p&=1,Ho(t,p),u==="backwards"&&e!==null?(hd(e),Mt(e,t,i,s),hd(e)):Mt(e,t,i,s),i=Oe?_o:0,!w&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&U0(e,s,t);else if(e.tag===19)U0(e,s,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}switch(u){case"backwards":s=F0(t.child),s===null?(u=t.child,t.child=null):(u=s.sibling,s.sibling=null,hd(t)),Lc(t,!0,u,null,f,i);break;case"unstable_legacy-backwards":for(s=null,u=t.child,t.child=null;u!==null;){if(e=u.alternate,e!==null&&bc(e)===null){t.child=u;break}e=u.sibling,u.sibling=s,s=u,u=e}Lc(t,!0,s,null,f,i);break;case"together":Lc(t,!1,null,null,void 0,i);break;case"independent":t.memoizedState=null;break;default:s=F0(t.child),s===null?(u=t.child,t.child=null):(u=s.sibling,s.sibling=null),Lc(t,!1,u,s,f,i)}return t.child}function V0(e,t,s){var i=t.pendingProps;return il(t,t.type,i.value),Mt(e,t,i.children,s),t.child}function Us(e,t,s){if(e!==null&&(t.dependencies=e.dependencies),yl|=t.lanes,(s&t.childLanes)===0)if(e!==null){if(sa(e,t,s,!1),(s&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(o(153));if(t.child!==null){for(e=t.child,s=zs(e,e.pendingProps),t.child=s,s.return=t;e.sibling!==null;)e=e.sibling,s=s.sibling=zs(e,e.pendingProps),s.return=t;s.sibling=null}return t.child}function gd(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&hc(e)))}function ij(e,t,s){switch(t.tag){case 3:Ts(t,t.stateNode.containerInfo),il(t,St,e.memoizedState.cache),ta();break;case 27:case 5:Yn(t);break;case 4:Ts(t,t.stateNode.containerInfo);break;case 10:il(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Ff(t),null;break;case 13:var i=t.memoizedState;if(i!==null){if(i.dehydrated!==null)return dl(t),t.flags|=128,null;i=sa(e,t,s,!1);var u=t.child.childLanes;return i||(s&u)!==0?H0(e,t,s):(dl(t),e=Us(e,t,s),e!==null?e.sibling:null)}dl(t);break;case 19:if(t.flags&128)return md(e,t,s);if(u=(e.flags&128)!==0,i=(s&t.childLanes)!==0,i||(sa(e,t,s,!1),i=(s&t.childLanes)!==0),u){if(i)return md(e,t,s);t.flags|=128}if(u=t.memoizedState,u!==null&&(u.rendering=null,u.tail=null,u.lastEffect=null),Ho(t,Ht.current),i)break;return null;case 22:return t.lanes=0,O0(e,t,s,t.pendingProps);case 24:il(t,St,e.memoizedState.cache)}return Us(e,t,s)}function B0(e,t,s){if(e!==null)if(e.memoizedProps!==t.pendingProps)jt=!0;else{if(!gd(e,s)&&(t.flags&128)===0)return jt=!1,ij(e,t,s);jt=(e.flags&131072)!==0}else jt=!1,Oe&&(t.flags&1048576)!==0&&xp(t,_o,t.index);switch(t.lanes=0,t.tag){case 16:e:{var i=t.pendingProps;if(e=oa(t.elementType),t.type=e,typeof e=="function")jf(e)?(i=fa(e,i),t.tag=1,t=$0(null,t,e,i,s)):(t.tag=0,t=rd(null,t,e,i,s));else{if(e!=null){var u=e.$$typeof;if(u===$){t.tag=11,t=_0(null,t,e,i,s);break e}else if(u===W){t.tag=14,t=R0(null,t,e,i,s);break e}else if(u===le){t.tag=10,t.type=e,t=V0(null,t,s);break e}}throw t=xe(e)||e,Error(o(306,t,""))}}return t;case 0:return rd(e,t,t.type,t.pendingProps,s);case 1:return i=t.type,u=fa(i,t.pendingProps),$0(e,t,i,u,s);case 3:e:{if(Ts(t,t.stateNode.containerInfo),e===null)throw Error(o(387));i=t.pendingProps;var f=t.memoizedState;u=f.element,Lf(e,t),ko(t,i,null,s);var p=t.memoizedState;if(i=p.cache,il(t,St,i),i!==f.cache&&_f(t,[St],s,!0),$o(),i=p.element,f.isDehydrated)if(f={element:i,isDehydrated:!1,cache:p.cache},t.updateQueue.baseState=f,t.memoizedState=f,t.flags&256){t=k0(e,t,i,s);break e}else if(i!==u){u=Un(Error(o(424)),t),Ro(u),t=k0(e,t,i,s);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(st=qn(e.firstChild),_t=t,Oe=!0,ll=null,Bn=!0,s=Op(t,null,i,s),t.child=s;s;)s.flags=s.flags&-3|134221824,s=s.sibling}else{if(ta(),i===u){t=Us(e,t,s);break e}Mt(e,t,i,s)}t=t.child}return t;case 26:return ri(e,t),e===null?(s=hv(t.type,null,t.pendingProps,null))?t.memoizedState=s:Oe||(t.stateNode=Qy(t.type,t.pendingProps,en.current,t)):t.memoizedState=hv(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Yn(t),e===null&&Oe&&(i=t.stateNode=cv(t.type,t.pendingProps,en.current),_t=t,Bn=!0,u=st,bl(t.type)?(fh=u,st=qn(i.firstChild)):st=u),Mt(e,t,t.pendingProps.children,s),ri(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Oe&&((u=i=st)&&(i=e2(i,t.type,t.pendingProps,Bn),i!==null?(t.stateNode=i,_t=t,st=qn(i.firstChild),Bn=!1,u=!0):u=!1),u||al(t)),Yn(t),u=t.type,f=t.pendingProps,p=e!==null?e.memoizedProps:null,i=f.children,nh(u,f)?i=null:p!==null&&nh(u,p)&&(t.flags|=32),t.memoizedState!==null&&(u=Gf(e,t,Xb,null,null,s),Mi._currentValue=u),ri(e,t),Mt(e,t,i,s),t.child;case 6:return e===null&&Oe&&((e=s=st)&&(s=t2(s,t.pendingProps,Bn),s!==null?(t.stateNode=s,_t=t,st=null,e=!0):e=!1),e||al(t)),null;case 13:return H0(e,t,s);case 4:return Ts(t,t.stateNode.containerInfo),i=t.pendingProps,e===null?t.child=ca(t,null,i,s):Mt(e,t,i,s),t.child;case 11:return _0(e,t,t.type,t.pendingProps,s);case 7:return i=t.pendingProps,ri(e,t),Mt(e,t,i,s),t.child;case 8:return Mt(e,t,t.pendingProps.children,s),t.child;case 12:return Mt(e,t,t.pendingProps.children,s),t.child;case 10:return V0(e,t,s);case 9:return u=t.type._context,i=t.pendingProps.children,la(t),u=$t(u),i=i(u),t.flags|=1,Mt(e,t,i,s),t.child;case 14:return R0(e,t,t.type,t.pendingProps,s);case 15:return A0(e,t,t.type,t.pendingProps,s);case 19:return md(e,t,s);case 31:return lj(e,t,s);case 22:return O0(e,t,s,t.pendingProps);case 24:return la(t),i=$t(St),e===null?(u=Of(),u===null&&(u=nt,f=Rf(),u.pooledCache=f,f.refCount++,f!==null&&(u.pooledCacheLanes|=s),u=f),t.memoizedState={parent:i,cache:u},Df(t),il(t,St,u)):((e.lanes&s)!==0&&(Lf(e,t),ko(t,null,null,s),$o()),u=e.memoizedState,f=t.memoizedState,u.parent!==i?(u={parent:i,cache:i},t.memoizedState=u,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=u),il(t,St,i)):(i=f.cache,il(t,St,i),i!==u.cache&&_f(t,[St],s,!0))),Mt(e,t,t.pendingProps.children,s),t.child;case 30:return t.stateNode===null&&(t.stateNode={autoName:null,paired:null,clones:null,ref:null}),i=t.pendingProps,i.name!=null&&i.name!=="auto"?t.flags|=e===null?18882560:18874368:Oe&&uc(t),e!==null&&e.memoizedProps.name!==i.name?t.flags|=4194816:ri(e,t),Mt(e,t,i.children,s),t.child;case 29:throw t.pendingProps}throw Error(o(156,t.tag))}function Fs(e){e.flags|=4}function pd(e,t,s,i,u){var f;if((f=(e.mode&32)!==0)&&(f=s===null?yv(t,i):yv(t,i)&&(i.src!==s.src||i.srcSet!==s.srcSet)),f){if(e.flags|=16777216,(u&335544128)===u)if(e.stateNode.complete)e.flags|=8192;else if(wy())e.flags|=8192;else throw ra=yc,zf}else e.flags&=-16777217}function G0(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!vv(t))if(wy())e.flags|=8192;else throw ra=yc,zf}function $c(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?mo():536870912,e.lanes|=t,hi|=t)}function Go(e,t){if(!Oe)switch(e.tailMode){case"visible":break;case"collapsed":for(var s=e.tail,i=null;s!==null;)s.alternate!==null&&(i=s),s=s.sibling;i===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:i.sibling=null;break;default:for(t=e.tail,s=null;t!==null;)t.alternate!==null&&(s=t),t=t.sibling;s===null?e.tail=null:s.sibling=null}}function lt(e){var t=e.alternate!==null&&e.alternate.child===e.child,s=0,i=0;if(t)for(var u=e.child;u!==null;)s|=u.lanes|u.childLanes,i|=u.subtreeFlags&1206910976,i|=u.flags&1206910976,u.return=e,u=u.sibling;else for(u=e.child;u!==null;)s|=u.lanes|u.childLanes,i|=u.subtreeFlags,i|=u.flags,u.return=e,u=u.sibling;return e.subtreeFlags|=i,e.childLanes=s,t}function oj(e,t,s){var i=t.pendingProps;switch(Cf(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return lt(t),null;case 1:return lt(t),null;case 3:return s=t.stateNode,i=null,e!==null&&(i=e.memoizedState.cache),t.memoizedState.cache!==i&&(t.flags|=2048),$s(St),gt(),s.pendingContext&&(s.context=s.pendingContext,s.pendingContext=null),(e===null||e.child===null)&&(ti(t)?Fs(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Ef())),lt(t),null;case 26:var u=t.type,f=t.memoizedState;return e===null?(Fs(t),f!==null?(lt(t),G0(t,f)):(lt(t),pd(t,u,null,i,s))):f?f!==e.memoizedState?(Fs(t),lt(t),G0(t,f)):(lt(t),t.flags&=-16777217):(e=e.memoizedProps,e!==i&&Fs(t),lt(t),pd(t,u,e,i,s)),null;case 27:if(qt(t),s=en.current,u=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==i&&Fs(t);else{if(!i){if(t.stateNode===null)throw Error(o(166));return lt(t),t.subtreeFlags&=-33554433,null}e=Wt.current,ti(t)?bp(t):(e=cv(u,i,s),t.stateNode=e,Fs(t))}return lt(t),t.subtreeFlags&=-33554433,null;case 5:if(qt(t),u=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==i&&Fs(t);else{if(!i){if(t.stateNode===null)throw Error(o(166));return lt(t),t.subtreeFlags&=-33554433,null}if(f=Wt.current,ti(t))bp(t);else{var p=er(en.current);switch(f){case 1:f=p.createElementNS("http://www.w3.org/2000/svg",u);break;case 2:f=p.createElementNS("http://www.w3.org/1998/Math/MathML",u);break;default:switch(u){case"svg":f=p.createElementNS("http://www.w3.org/2000/svg",u);break;case"math":f=p.createElementNS("http://www.w3.org/1998/Math/MathML",u);break;case"script":f=p.createElement("div"),f.innerHTML="<script><\/script>",f=f.removeChild(f.firstChild);break;case"select":f=typeof i.is=="string"?p.createElement("select",{is:i.is}):p.createElement("select"),i.multiple?f.multiple=!0:i.size&&(f.size=i.size);break;default:f=typeof i.is=="string"?p.createElement(u,{is:i.is}):p.createElement(u)}}f[xt]=t,f[Lt]=i;e:for(p=t.child;p!==null;){if(p.tag===5||p.tag===6)f.appendChild(p.stateNode);else if(p.tag!==4&&p.tag!==27&&p.child!==null){p.child.return=p,p=p.child;continue}if(p===t)break e;for(;p.sibling===null;){if(p.return===null||p.return===t)break e;p=p.return}p.sibling.return=p.return,p=p.sibling}t.stateNode=f;e:switch(Ft(f,u,i),u){case"button":case"input":case"select":case"textarea":i=!!i.autoFocus;break e;case"img":i=!0;break e;default:i=!1}i&&Fs(t)}}return lt(t),t.subtreeFlags&=-33554433,pd(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,s),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==i&&Fs(t);else{if(typeof i!="string"&&t.stateNode===null)throw Error(o(166));if(e=en.current,ti(t)){if(e=t.stateNode,s=t.memoizedProps,i=null,u=_t,u!==null)switch(u.tag){case 27:case 5:i=u.memoizedProps}e[xt]=t,e=!!(e.nodeValue===s||i!==null&&i.suppressHydrationWarning===!0||By(e.nodeValue,s)),e||al(t,!0)}else e=er(e).createTextNode(i),e[xt]=t,t.stateNode=e}return lt(t),null;case 31:if(s=t.memoizedState,e===null||e.memoizedState!==null){if(i=ti(t),s!==null){if(e===null){if(!i)throw Error(o(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(557));e[xt]=t}else ta(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;lt(t),e=!1}else s=Ef(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=s),e=!0;if(!e)return t.flags&256?(En(t),t):(En(t),null);if((t.flags&128)!==0)throw Error(o(558))}return lt(t),null;case 13:if(i=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(u=ti(t),i!==null&&i.dehydrated!==null){if(e===null){if(!u)throw Error(o(318));if(u=t.memoizedState,u=u!==null?u.dehydrated:null,!u)throw Error(o(317));u[xt]=t}else ta(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;lt(t),u=!1}else u=Ef(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=u),u=!0;if(!u)return t.flags&256?(En(t),t):(En(t),null)}return En(t),(t.flags&128)!==0?(t.lanes=s,t):(s=i!==null,e=e!==null&&e.memoizedState!==null,s&&(i=t.child,u=null,i.alternate!==null&&i.alternate.memoizedState!==null&&i.alternate.memoizedState.cachePool!==null&&(u=i.alternate.memoizedState.cachePool.pool),f=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(f=i.memoizedState.cachePool.pool),f!==u&&(i.flags|=2048)),s!==e&&s&&(t.child.flags|=8192),$c(t,t.updateQueue),lt(t),null);case 4:return gt(),e===null&&Zd(t.stateNode.containerInfo),t.flags|=67108864,lt(t),null;case 10:return $s(t.type),lt(t),null;case 19:if(Vf(t),i=t.memoizedState,i===null)return lt(t),null;if(u=(t.flags&128)!==0,f=i.rendering,f===null)if(u)Go(i,!1);else{if(mt!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(f=bc(e),f!==null){for(t.flags|=128,Go(i,!1),e=f.updateQueue,t.updateQueue=e,$c(t,e),t.subtreeFlags=0,e=s,s=t.child;s!==null;)pp(s,e),s=s.sibling;return Ho(t,Ht.current&1|2),Oe&&Ds(t,i.treeForkCount),t.child}e=e.sibling}i.tail!==null&&et()>Pc&&(t.flags|=128,u=!0,Go(i,!1),t.lanes=4194304)}else{if(!u)if(e=bc(f),e!==null){if(t.flags|=128,u=!0,e=e.updateQueue,t.updateQueue=e,$c(t,e),Go(i,!0),i.tail===null&&i.tailMode!=="collapsed"&&i.tailMode!=="visible"&&!f.alternate&&!Oe)return lt(t),null}else 2*et()-i.renderingStartTime>Pc&&s!==536870912&&(t.flags|=128,u=!0,Go(i,!1),t.lanes=4194304);i.isBackwards?(f.sibling=t.child,t.child=f):(e=i.last,e!==null?e.sibling=f:t.child=f,i.last=f)}if(i.tail!==null){e=i.tail;e:{for(s=e;s!==null;){if(s.alternate!==null){s=!1;break e}s=s.sibling}s=!0}return i.rendering=e,i.tail=e.sibling,i.renderingStartTime=et(),e.sibling=null,f=Ht.current,f=u?f&1|2:f&1,i.tailMode==="visible"||i.tailMode==="collapsed"||!s||Oe?Ho(t,f):(s=f,Ge(kt,t),Ge(Ht,s),Pt===null&&(Pt=t)),Oe&&Ds(t,i.treeForkCount),e}return lt(t),null;case 22:case 23:return En(t),Uf(),i=t.memoizedState!==null,e!==null?e.memoizedState!==null!==i&&(t.flags|=8192):i&&(t.flags|=8192),i?(s&536870912)!==0&&(t.flags&128)===0&&(lt(t),t.subtreeFlags&6&&(t.flags|=8192)):lt(t),s=t.updateQueue,s!==null&&$c(t,s.retryQueue),s=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(s=e.memoizedState.cachePool.pool),i=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(i=t.memoizedState.cachePool.pool),i!==s&&(t.flags|=2048),e!==null&&ut(ia),null;case 24:return s=null,e!==null&&(s=e.memoizedState.cache),t.memoizedState.cache!==s&&(t.flags|=2048),$s(St),lt(t),null;case 25:return null;case 30:return t.flags|=33554432,lt(t),null}throw Error(o(156,t.tag))}function rj(e,t){switch(Cf(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return $s(St),gt(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return qt(t),null;case 31:if(t.memoizedState!==null){if(En(t),t.alternate===null)throw Error(o(340));ta()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(En(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(o(340));ta()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Vf(t),e=t.flags,e&65536?(t.flags=e&-65537|128,e=t.memoizedState,e!==null&&(e.rendering=null,e.tail=null),t.flags|=4,t):null;case 4:return gt(),null;case 10:return $s(t.type),null;case 22:case 23:return En(t),Uf(),e!==null&&ut(ia),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return $s(St),null;case 25:return null;default:return null}}function q0(e,t){switch(Cf(t),t.tag){case 3:$s(St),gt();break;case 26:case 27:case 5:qt(t);break;case 4:gt();break;case 31:t.memoizedState!==null&&En(t);break;case 13:En(t);break;case 19:Vf(t);break;case 10:$s(t.type);break;case 22:case 23:En(t),Uf(),e!==null&&ut(ia);break;case 24:$s(St)}}function qo(e,t){try{var s=t.updateQueue,i=s!==null?s.lastEffect:null;if(i!==null){var u=i.next;s=u;do{if((s.tag&e)===e){i=void 0;var f=s.create,p=s.inst;i=f(),p.destroy=i}s=s.next}while(s!==u)}}catch(w){Ze(t,t.return,w)}}function ml(e,t,s){try{var i=t.updateQueue,u=i!==null?i.lastEffect:null;if(u!==null){var f=u.next;i=f;do{if((i.tag&e)===e){var p=i.inst,w=p.destroy;if(w!==void 0){p.destroy=void 0,u=t;var z=s,q=w;try{q()}catch(X){Ze(u,z,X)}}}i=i.next}while(i!==f)}}catch(X){Ze(t,t.return,X)}}function I0(e){var t=e.updateQueue;if(t!==null){var s=e.stateNode;try{Dp(t,s)}catch(i){Ze(e,e.return,i)}}}function Q0(e,t,s){s.props=fa(e.type,e.memoizedProps),s.state=e.memoizedState;try{s.componentWillUnmount()}catch(i){Ze(e,t,i)}}function hs(e,t){try{var s=e.ref;if(s!==null){switch(e.tag){case 26:case 27:case 5:var i=e.stateNode;break;case 30:var u=e.stateNode,f=As(e.memoizedProps,u);(u.ref===null||u.ref.name!==f)&&(u.ref=Wy(f)),i=u.ref;break;case 7:if(e.stateNode===null){var p=new On(e);y(e.child,!1,Jj,p,void 0,void 0),e.stateNode=p}i=e.stateNode;break;default:i=e.stateNode}typeof s=="function"?e.refCleanup=s(i):s.current=i}}catch(w){Ze(e,t,w)}}function Ut(e,t){var s=e.ref,i=e.refCleanup;if(s!==null)if(typeof i=="function")try{i()}catch(u){Ze(e,t,u)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof s=="function")try{s(null)}catch(u){Ze(e,t,u)}else s.current=null}function kc(e,t){if((e.tag===5||e.tag===27||e.tag===6)&&e.alternate===null&&t!==null)for(var s=0;s<t.length;s++)av(e.stateNode,t[s])}function Y0(e){for(var t=e.return;t!==null&&(vd(t)&&av(e.stateNode,t.stateNode),!yd(t));)t=t.return}function Io(e){for(var t=e.return;t!==null&&(vd(t)&&Wj(e.stateNode,t.stateNode),!yd(t));)t=t.return}function yd(e){return e.tag===5||e.tag===3||e.tag===27}function vd(e){return e&&e.tag===7&&e.stateNode!==null}function xd(e){var t=e.type,s=e.memoizedProps,i=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":s.autoFocus&&i.focus();break e;case"img":s.src?i.src=s.src:s.srcSet&&(i.srcset=s.srcSet)}}catch(u){Ze(e,e.return,u)}}function Sd(e,t,s){try{var i=e.stateNode;Dj(i,e.type,s,t),i[Lt]=t}catch(u){Ze(e,e.return,u)}}function P0(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&bl(e.type)||e.tag===4}function bd(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||P0(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&&bl(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 jd(e,t,s,i){var u=e.tag;if(u===5||u===6)u=e.stateNode,t?(s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s).insertBefore(u,t):(t=s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s,t.appendChild(u),s=s._reactRootContainer,s!=null||t.onclick!==null||(t.onclick=us)),kc(e,i),qe=!0;else if(u!==4&&(u===27&&(kc(e,i),i=null,bl(e.type)&&(s=e.stateNode,t=null)),e=e.child,e!==null))for(jd(e,t,s,i),e=e.sibling;e!==null;)jd(e,t,s,i),e=e.sibling}function Hc(e,t,s,i){var u=e.tag;if(u===5||u===6)u=e.stateNode,t?s.insertBefore(u,t):s.appendChild(u),kc(e,i),qe=!0;else if(u!==4&&(u===27&&(kc(e,i),i=null,bl(e.type)&&(s=e.stateNode)),e=e.child,e!==null))for(Hc(e,t,s,i),e=e.sibling;e!==null;)Hc(e,t,s,i),e=e.sibling}function X0(e){var t=e.stateNode,s=e.memoizedProps;try{for(var i=e.type,u=t.attributes;u.length;)t.removeAttributeNode(u[0]);Ft(t,i,s),t[xt]=e,t[Lt]=s}catch(f){Ze(e,e.return,f)}}var Uc=!1,Tn=null;function K0(e){(e.tag===30||(e.subtreeFlags&33554432)!==0)&&(Uc=!0)}var ms=null;function Z0(){var e=ms;return ms=null,e}var gn=0;function ci(e,t,s,i,u){return gn=0,J0(e.child,t,s,i,u)}function J0(e,t,s,i,u){for(var f=!1;e!==null;){if(e.tag===5){var p=e.stateNode;if(i!==null){var w=ah(p);i.push(w),w.view&&(f=!0)}else f||ah(p).view&&(f=!0);Uc=!0,Zy(p,gn===0?t:t+"_"+gn,s),gn++}else(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&u||J0(e.child,t,s,i,u)&&(f=!0));e=e.sibling}return f}function gs(e,t){for(;e!==null;)e.tag===5?Jy(e.stateNode,e.memoizedProps):(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&t||gs(e.child,t)),e=e.sibling}function Fc(e){if((e.subtreeFlags&18874368)!==0)for(e=e.child;e!==null;){if((e.tag!==22||e.memoizedState===null)&&(Fc(e),e.tag===30&&(e.flags&18874368)!==0&&e.stateNode.paired)){var t=e.memoizedProps;if(t.name==null||t.name==="auto")throw Error(o(544));var s=t.name;t=Os(t.default,t.share),t!=="none"&&(ci(e,s,t,null,!1)||gs(e.child,!1))}e=e.sibling}}function wd(e,t){if(e.tag===30){var s=e.stateNode,i=e.memoizedProps,u=As(i,s),f=Os(i.default,s.paired?i.share:i.enter);f!=="none"?ci(e,u,f,null,!1)?(Fc(e),s.paired||t||yi(e,i.onEnter)):gs(e.child,!1):Fc(e)}else if((e.subtreeFlags&33554432)!==0)for(e=e.child;e!==null;)wd(e,t),e=e.sibling;else Fc(e)}function Nd(e){if(Tn!==null&&Tn.size!==0){var t=Tn;if((e.subtreeFlags&18874368)!==0)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&(e.flags&18874368)!==0){var s=e.memoizedProps,i=s.name;if(i!=null&&i!=="auto"){var u=t.get(i);if(u!==void 0){var f=Os(s.default,s.share);if(f!=="none"&&(ci(e,i,f,null,!1)?(f=e.stateNode,u.paired=f,f.paired=u,yi(e,s.onShare)):gs(e.child,!1)),t.delete(i),t.size===0)break}}}Nd(e)}e=e.sibling}}}function Cd(e){if(e.tag===30){var t=e.memoizedProps,s=As(t,e.stateNode),i=Tn!==null?Tn.get(s):void 0,u=Os(t.default,i!==void 0?t.share:t.exit);u!=="none"&&(ci(e,s,u,null,!1)?i!==void 0?(u=e.stateNode,i.paired=u,u.paired=i,Tn.delete(s),yi(e,t.onShare)):yi(e,t.onExit):gs(e.child,!1)),Tn!==null&&Nd(e)}else if((e.subtreeFlags&33554432)!==0)for(e=e.child;e!==null;)Cd(e),e=e.sibling;else Tn!==null&&Nd(e)}function W0(e){for(e=e.child;e!==null;){if(e.tag===30){var t=e.memoizedProps,s=As(t,e.stateNode);t=Os(t.default,t.update),e.flags&=-5,t!=="none"&&ci(e,s,t,e.memoizedState=[],!1)}else(e.subtreeFlags&33554432)!==0&&W0(e);e=e.sibling}}function Md(e){if((e.subtreeFlags&18874368)!==0)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&(e.flags&18874368)!==0){var t=e.stateNode;t.paired!==null&&(t.paired=null,gs(e.child,!1))}Md(e)}e=e.sibling}}function Vc(e){if(e.tag===30)e.stateNode.paired=null,gs(e.child,!1),Md(e);else if((e.subtreeFlags&33554432)!==0)for(e=e.child;e!==null;)Vc(e),e=e.sibling;else Md(e)}function ey(e){for(e=e.child;e!==null;)e.tag===30?gs(e.child,!1):(e.subtreeFlags&33554432)!==0&&ey(e),e=e.sibling}function Ed(e,t,s,i,u,f,p){for(var w=!1;t!==null;){if(t.tag===5){var z=t.stateNode;if(f!==null&&gn<f.length){var q=f[gn],X=ah(z);(q.view||X.view)&&(w=!0);var ne;if(ne=(e.flags&4)===0)if(X.clip)ne=!0;else{ne=q.rect;var V=X.rect;ne=ne.y!==V.y||ne.x!==V.x||ne.height!==V.height||ne.width!==V.width}ne&&(e.flags|=4),X.abs?X=!q.abs:(q=q.rect,X=X.rect,X=q.height!==X.height||q.width!==X.width),X&&(e.flags|=32)}else e.flags|=32;(e.flags&4)!==0&&Zy(z,gn===0?s:s+"_"+gn,u),w&&(e.flags&4)!==0||(ms===null&&(ms=[]),ms.push(z,gn===0?i:i+"_"+gn,t.memoizedProps)),gn++}else(t.tag!==22||t.memoizedState===null)&&(t.tag===30&&p?e.flags|=t.flags&32:Ed(e,t.child,s,i,u,f,p)&&(w=!0));t=t.sibling}return w}function ty(e,t){for(e=e.child;e!==null;){if(e.tag===30){var s=e.memoizedProps,i=e.stateNode,u=As(s,i),f=Os(s.default,s.update),p;p=e.memoizedState,e.memoizedState=null,i=e;var w=e.child;gn=0,u=Ed(i,w,u,u,f,p,!1),(e.flags&4)!==0&&u&&yi(e,s.onUpdate)}else(e.subtreeFlags&33554432)!==0&&ty(e);e=e.sibling}}var Rt=!1,Xe=!1,ps=!1,Td=!1,ny=typeof WeakSet=="function"?WeakSet:Set,At=null,ys=!1,Qo=!1,Bc=!1,_d=!1;function cj(e,t,s){if(e=e.containerInfo,eh=Ei,e=ip(e),gf(e)){if("selectionStart"in e)var i={start:e.selectionStart,end:e.selectionEnd};else e:{i=(i=e.ownerDocument)&&i.defaultView||window;var u=i.getSelection&&i.getSelection();if(u&&u.rangeCount!==0){i=u.anchorNode;var f=u.anchorOffset,p=u.focusNode;u=u.focusOffset;try{i.nodeType,p.nodeType}catch{i=null;break e}var w=0,z=-1,q=-1,X=0,ne=0,V=e,Y=null;t:for(;;){for(var fe;V!==i||f!==0&&V.nodeType!==3||(z=w+f),V!==p||u!==0&&V.nodeType!==3||(q=w+u),V.nodeType===3&&(w+=V.nodeValue.length),(fe=V.firstChild)!==null;)Y=V,V=fe;for(;;){if(V===e)break t;if(Y===i&&++X===f&&(z=w),Y===p&&++ne===u&&(q=w),(fe=V.nextSibling)!==null)break;V=Y,Y=V.parentNode}V=fe}i=z===-1||q===-1?null:{start:z,end:q}}else i=null}i=i||{start:0,end:0}}else i=null;for(th={focusedElem:e,selectionRange:i},Ei=!1,s=(s&335544064)===s,At=t,t=s?9270:1024;At!==null;){if(e=At,s&&(i=e.deletions,i!==null))for(f=0;f<i.length;f++)s&&Cd(i[f]);if(e.alternate===null&&(e.flags&2)!==0)s&&K0(e),Gc(s);else{if(e.tag===22){if(i=e.alternate,e.memoizedState!==null){i!==null&&i.memoizedState===null&&s&&Cd(i),Gc(s);continue}else if(i!==null&&i.memoizedState!==null){s&&K0(e),Gc(s);continue}}i=e.child,(e.subtreeFlags&t)!==0&&i!==null?(i.return=e,At=i):(s&&W0(e),Gc(s))}}Tn=null}function Gc(e){for(;At!==null;){var t=At,s=e,i=t.alternate,u=t.flags;switch(t.tag){case 0:case 11:case 15:break;case 1:if((u&1024)!==0&&i!==null){s=void 0,u=i.memoizedProps,i=i.memoizedState;var f=t.stateNode;try{var p=fa(t.type,u);s=f.getSnapshotBeforeUpdate(p,i),f.__reactInternalSnapshotBeforeUpdate=s}catch(w){Ze(t,t.return,w)}}break;case 3:if((u&1024)!==0){if(i=t.stateNode.containerInfo,s=i.nodeType,s===9)rh(i);else if(s===1)switch(i.nodeName){case"HEAD":case"HTML":case"BODY":rh(i);break;default:i.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;case 30:s&&i!==null&&(s=As(i.memoizedProps,i.stateNode),u=t.memoizedProps,u=Os(u.default,u.update),u!=="none"&&ci(i,s,u,i.memoizedState=[],!0));break;default:if((u&1024)!==0)throw Error(o(163))}if(i=t.sibling,i!==null){i.return=t.return,At=i;break}At=t.return}}function sy(e,t,s){var i=s.flags;switch(s.tag){case 0:case 11:case 15:vs(e,s),i&4&&qo(5,s);break;case 1:if(vs(e,s),i&4)if(e=s.stateNode,t===null)try{e.componentDidMount()}catch(p){Ze(s,s.return,p)}else{var u=fa(s.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(u,t,e.__reactInternalSnapshotBeforeUpdate)}catch(p){Ze(s,s.return,p)}}i&64&&I0(s),i&512&&hs(s,s.return);break;case 3:if(vs(e,s),i&64&&(e=s.updateQueue,e!==null)){if(t=null,s.child!==null)switch(s.child.tag){case 27:case 5:t=s.child.stateNode;break;case 1:t=s.child.stateNode}try{Dp(e,t)}catch(p){Ze(s,s.return,p)}}break;case 27:t===null&&i&4&&X0(s);case 26:case 5:vs(e,s),t===null&&i&4&&xd(s),i&512&&hs(s,s.return);break;case 12:vs(e,s);break;case 31:vs(e,s),i&4&&oy(e,s);break;case 13:vs(e,s),i&4&&ry(e,s),i&64&&(e=s.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(s=bj.bind(null,s),n2(e,s))));break;case 22:if(i=s.memoizedState!==null||Rt,!i){var f=t!==null&&t.memoizedState!==null||Xe;t=Rt,u=Xe,Rt=i,(Xe=f)&&!u?(i=2,(s.subtreeFlags&8772)!==0&&(i|=1),es(e,s,i)):vs(e,s),Rt=t,Xe=u}break;case 30:vs(e,s),i&512&&hs(s,s.return);break;case 7:i&512&&hs(s,s.return);default:vs(e,s)}}function Rd(e,t){for(e=e.child;e!==null;)ly(e,t),e=e.sibling}function ly(e,t){switch(e.tag){case 5:case 26:try{var s=e.stateNode;if(t){var i=s.style;typeof i.setProperty=="function"?i.setProperty("display","none","important"):i.display="none"}else{var u=e.stateNode,f=e.memoizedProps.style,p=f!=null&&f.hasOwnProperty("display")?f.display:null;u.style.display=p==null||typeof p=="boolean"?"":(""+p).trim()}}catch(z){Ze(e,e.return,z)}Ad(e,t);break;case 6:try{e.stateNode.nodeValue=t?"":e.memoizedProps,qe=!0}catch(z){Ze(e,e.return,z)}break;case 18:try{var w=e.stateNode;t?Ky(w,!0):Ky(e.stateNode,!1)}catch(z){Ze(e,e.return,z)}break;case 22:case 23:e.memoizedState===null&&Rd(e,t);break;default:Rd(e,t)}}function Ad(e,t){if(e.subtreeFlags&67108864)for(e=e.child;e!==null;){e:{var s=e,i=t;switch(s.tag){case 4:ly(s,i);break e;case 22:s.memoizedState===null&&Ad(s,i);break e;default:Ad(s,i)}}e=e.sibling}}function ay(e){var t=e.alternate;t!==null&&(e.alternate=null,ay(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Pr(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 ot=null,pn=!1;function Jn(e,t,s){for(s=s.child;s!==null;)iy(e,t,s),s=s.sibling}function iy(e,t,s){if(Qt&&typeof Qt.onCommitFiberUnmount=="function")try{Qt.onCommitFiberUnmount(Zs,s)}catch{}switch(s.tag){case 26:Xe||Ut(s,t),Jn(e,t,s),s.memoizedState?s.memoizedState.count--:s.stateNode&&!Xe&&(s=s.stateNode,s.parentNode.removeChild(s));break;case 27:Xe||Ut(s,t),Io(s);var i=ot,u=pn;bl(s.type)&&(ot=s.stateNode,pn=!1),Jn(e,t,s),uv(s.stateNode,s.type,s.memoizedProps),ot=i,pn=u;break;case 5:Xe||Ut(s,t),Io(s);case 6:if(s.tag===6&&Io(s),i=ot,u=pn,ot=null,Jn(e,t,s),ot=i,pn=u,ot!==null)if(pn)try{(ot.nodeType===9?ot.body:ot.nodeName==="HTML"?ot.ownerDocument.body:ot).removeChild(s.stateNode),qe=!0}catch(f){Ze(s,t,f)}else try{ot.removeChild(s.stateNode),qe=!0}catch(f){Ze(s,t,f)}break;case 18:ot!==null&&(pn?(e=ot,Xy(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,s.stateNode),Ti(e)):Xy(ot,s.stateNode));break;case 4:i=ot,u=pn,ot=s.stateNode.containerInfo,pn=!0,Jn(e,t,s),ot=i,pn=u;break;case 0:case 11:case 14:case 15:ml(2,s,t),Xe||ml(4,s,t),Jn(e,t,s);break;case 1:Xe||(Ut(s,t),i=s.stateNode,typeof i.componentWillUnmount=="function"&&Q0(s,t,i)),Jn(e,t,s);break;case 21:Jn(e,t,s);break;case 22:Xe=(i=Xe)||s.memoizedState!==null,Jn(e,t,s),Xe=i;break;case 30:Ut(s,t),Jn(e,t,s);break;case 7:Xe||Ut(s,t),Jn(e,t,s);break;default:Jn(e,t,s)}}function oy(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Ti(e)}catch(s){Ze(t,t.return,s)}}}function ry(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Ti(e)}catch(s){Ze(t,t.return,s)}}function uj(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new ny),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new ny),t;default:throw Error(o(435,e.tag))}}function qc(e,t){var s=uj(e);t.forEach(function(i){if(!s.has(i)){s.add(i);var u=jj.bind(null,e,i);i.then(u,u)}})}function an(e,t,s){var i=t.deletions;if(i!==null)for(var u=0;u<i.length;u++){var f=i[u],p=e,w=t,z=w;e:for(;z!==null;){switch(z.tag){case 27:if(bl(z.type)){ot=z.stateNode,pn=!1;break e}break;case 5:ot=z.stateNode,pn=!1;break e;case 3:case 4:ot=z.stateNode.containerInfo,pn=!0;break e}z=z.return}if(ot===null)throw Error(o(160));iy(p,w,f),ot=null,pn=!1,p=f.alternate,p!==null&&(p.return=null),f.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)cy(t,e,s),t=t.sibling}var Wn=null;function cy(e,t,s){var i=e.alternate,u=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(u&4&&(i=e.updateQueue,i=i!==null?i.events:null,i!==null))for(var f=0;f<i.length;f++){var p=i[f];p.ref.impl=p.nextImpl}an(t,e,s),on(e),u&4&&(ml(3,e,e.return),qo(3,e),ml(5,e,e.return));break;case 1:an(t,e,s),on(e),u&512&&(Xe||i===null||Ut(i,i.return)),u&64&&Rt&&(e=e.updateQueue,e!==null&&(t=e.callbacks,t!==null&&(s=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=s===null?t:s.concat(t))));break;case 26:if(f=Wn,an(t,e,s),on(e),u&512&&(Xe||i===null||Ut(i,i.return)),u&4)if(u=i!==null?i.memoizedState:null,s=e.memoizedState,i===null)if(s===null)if(e.stateNode===null)if(Rt)e.stateNode=Qy(e.type,e.memoizedProps,t.containerInfo,e);else{e:{t=e.type,s=e.memoizedProps,u=f.ownerDocument||f;t:switch(t){case"title":i=u.getElementsByTagName("title")[0],(!i||i[vo]||i[xt]||i.namespaceURI==="http://www.w3.org/2000/svg"||i.hasAttribute("itemprop"))&&(i=u.createElement(t),u.head.insertBefore(i,u.querySelector("head > title"))),Ft(i,t,s),i[xt]=e,Tt(i),t=i;break e;case"link":if(f=pv("link","href",u).get(t+(s.href||""))){for(p=0;p<f.length;p++)if(i=f[p],i.getAttribute("href")===(s.href==null||s.href===""?null:s.href)&&i.getAttribute("rel")===(s.rel==null?null:s.rel)&&i.getAttribute("title")===(s.title==null?null:s.title)&&i.getAttribute("crossorigin")===(s.crossOrigin==null?null:s.crossOrigin)){f.splice(p,1);break t}}i=u.createElement(t),Ft(i,t,s),u.head.appendChild(i);break;case"meta":if(f=pv("meta","content",u).get(t+(s.content||""))){for(p=0;p<f.length;p++)if(i=f[p],i.getAttribute("content")===(s.content==null?null:""+s.content)&&i.getAttribute("name")===(s.name==null?null:s.name)&&i.getAttribute("property")===(s.property==null?null:s.property)&&i.getAttribute("http-equiv")===(s.httpEquiv==null?null:s.httpEquiv)&&i.getAttribute("charset")===(s.charSet==null?null:s.charSet)){f.splice(p,1);break t}}i=u.createElement(t),Ft(i,t,s),u.head.appendChild(i);break;default:throw Error(o(468,t))}i[xt]=e,Tt(i),t=i}e.stateNode=t}else Rt||gh(f,e.type,e.stateNode);else e.stateNode=gv(f,s,e.memoizedProps);else u!==s?(u===null?(t=i.stateNode,t===null||Xe||t.parentNode.removeChild(t)):u.count--,s===null?Rt||gh(f,e.type,e.stateNode):gv(f,s,e.memoizedProps)):s===null&&e.stateNode!==null&&Sd(e,e.memoizedProps,i.memoizedProps);break;case 27:an(t,e,s),on(e),u&512&&(Xe||i===null||Ut(i,i.return)),i!==null&&u&4&&Sd(e,e.memoizedProps,i.memoizedProps);break;case 5:if(f=ps,ps=!1,an(t,e,s),ps=f,on(e),u&512&&(Xe||i===null||Ut(i,i.return)),e.flags&32){t=e.stateNode;try{Ia(t,""),qe=!0}catch(X){Ze(e,e.return,X)}}u&4&&e.stateNode!=null&&(t=e.memoizedProps,Sd(e,t,i!==null?i.memoizedProps:t)),u&1024&&(Td=!0);break;case 6:if(an(t,e,s),on(e),u&4){if(e.stateNode===null)throw Error(o(162));t=e.memoizedProps,s=e.stateNode;try{s.nodeValue=t,qe=!0}catch(X){Ze(e,e.return,X)}}break;case 3:if(qe=!1,au=null,f=Wn,Wn=tr(t.containerInfo),an(t,e,s),Wn=f,on(e),u&4&&i!==null&&i.memoizedState.isDehydrated)try{Ti(t.containerInfo)}catch(X){Ze(e,e.return,X)}Td&&(Td=!1,uy(e)),qe=!1;break;case 4:u=ps,ps=Rt,i=Rg(),f=Wn,Wn=tr(e.stateNode.containerInfo),an(t,e,s),on(e),Wn=f,qe&&Qo&&(Bc=!0),qe=i,ps=u;break;case 12:an(t,e,s),on(e);break;case 31:an(t,e,s),on(e),u&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,qc(e,t)));break;case 13:an(t,e,s),on(e),e.child.flags&8192&&e.memoizedState!==null!=(i!==null&&i.memoizedState!==null)&&(Yc=et()),u&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,qc(e,t)));break;case 22:f=e.memoizedState!==null,p=i!==null&&i.memoizedState!==null;var w=Rt,z=Xe,q=ps;Rt=w||f,ps=q||f,Xe=z||p,an(t,e,s),Xe=z,ps=q,Rt=w,on(e),u&8192&&(t=e.stateNode,t._visibility=f?t._visibility&-2:t._visibility|1,!f||i===null||p||Rt||Xe||(t=p||Xe,s=Rt,i=Xe,Rt=f||Rt,Xe=t,gl(e,2),Rt=s,Xe=i),!f&&ps||Rd(e,f)),u&4&&(t=e.updateQueue,t!==null&&(s=t.retryQueue,s!==null&&(t.retryQueue=null,qc(e,s))));break;case 19:an(t,e,s),on(e),u&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,qc(e,t)));break;case 30:u&512&&(Xe||i===null||Ut(i,i.return)),u=Rg(),f=Qo,p=(s&335544064)===s,w=e.memoizedProps,Qo=p&&Os(w.default,w.update)!=="none",an(t,e,s),on(e),p&&i!==null&&qe&&(e.flags|=4),Qo=f,qe=u;break;case 21:break;case 7:u&512&&(Xe||i===null||Ut(i,i.return)),i&&i.stateNode!==null&&(i.stateNode._fragmentFiber=e);default:an(t,e,s),on(e)}}function on(e){var t=e.flags;if(t&2){try{for(var s,i=e.return;i!==null;){if(P0(i)){s=i;break}i=i.return}i=null;for(var u=e.return;u!==null;){if(vd(u)){var f=u.stateNode;i===null?i=[f]:i.push(f)}if(yd(u))break;u=u.return}var p=i;if(s==null)throw Error(o(160));switch(s.tag){case 27:var w=s.stateNode,z=bd(e);Hc(e,z,w,p);break;case 5:var q=s.stateNode;s.flags&32&&(Ia(q,""),s.flags&=-33);var X=bd(e);Hc(e,X,q,p);break;case 3:case 4:var ne=s.stateNode.containerInfo,V=bd(e);jd(e,V,ne,p);break;default:throw Error(o(161))}}catch(Y){Ze(e,e.return,Y)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function uy(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;uy(t),t.tag===5&&t.flags&1024&&(t=t.stateNode,Ei=!0,t.reset(),Ei=!1),e=e.sibling}}function ui(e,t){if(t.subtreeFlags&9270)for(t=t.child;t!==null;)fy(t,e),t=t.sibling;else ty(t)}function fy(e,t){var s=e.alternate;if(s===null)wd(e,!1);else switch(e.tag){case 3:if(_d=ys=!1,Z0(),ui(t,e),!ys&&!Bc){if(e=ms,e!==null)for(var i=0;i<e.length;i+=3){s=e[i];var u=e[i+1];Jy(s,e[i+2]),s=s.ownerDocument.documentElement,s!==null&&s.animate({opacity:[0,0],pointerEvents:["none","none"]},{duration:0,fill:"forwards",pseudoElement:"::view-transition-group("+u+")"})}e=t.containerInfo,e=e.nodeType===9?e.documentElement:e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName===""&&(e.style.viewTransitionName="none",e.animate({opacity:[0,0],pointerEvents:["none","none"]},{duration:0,fill:"forwards",pseudoElement:"::view-transition-group(root)"}),e.animate({width:[0,0],height:[0,0]},{duration:0,fill:"forwards",pseudoElement:"::view-transition"})),_d=!0}ms=null;break;case 5:ui(t,e);break;case 4:i=ys,ys=!1,ui(t,e),ys&&(Bc=!0),ys=i;break;case 22:e.memoizedState===null&&(s.memoizedState!==null?wd(e,!1):ui(t,e));break;case 30:i=ys,u=Z0(),ys=!1,ui(t,e),ys&&(e.flags|=4);var f=e.memoizedProps,p=e.stateNode;t=As(f,p),p=As(s.memoizedProps,p);var w=Os(f.default,f.update);w==="none"?t=!1:(f=s.memoizedState,s.memoizedState=null,s=e.child,gn=0,t=Ed(e,s,t,p,w,f,!0),gn!==(f===null?0:f.length)&&(e.flags|=32)),(e.flags&4)!==0&&t?(yi(e,e.memoizedProps.onUpdate),ms=u):u!==null&&(u.push.apply(u,ms),ms=u),ys=(e.flags&32)!==0?!0:i;break;default:ui(t,e)}}function vs(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)sy(e,t.alternate,t),t=t.sibling}function gl(e,t){for(e=e.child;e!==null;){var s=e,i=t;switch(s.tag){case 0:case 11:case 14:case 15:ml(4,s,s.return),gl(s,i);break;case 1:Ut(s,s.return);var u=s.stateNode;typeof u.componentWillUnmount=="function"&&Q0(s,s.return,u),gl(s,i);break;case 27:(i&2)!==0&&uv(s.stateNode,s.type,s.memoizedProps);case 5:Ut(s,s.return),s.tag!==5&&s.tag!==27||Io(s),gl(s,i);break;case 6:Io(s);break;case 26:Ut(s,s.return),u=s.stateNode,s.memoizedState!==null||u===null||Xe||u.parentNode.removeChild(u),gl(s,i);break;case 22:s.memoizedState===null&&gl(s,i);break;case 30:Ut(s,s.return),gl(s,i);break;case 7:Ut(s,s.return);default:gl(s,i)}e=e.sibling}}function es(e,t,s){for(s=(t.subtreeFlags&8772)!==0?s:s&-2,t=t.child;t!==null;){var i=t.alternate,u=e,f=t,p=f.flags,w=(s&1)!==0;switch(f.tag){case 0:case 11:case 15:es(u,f,s),qo(4,f);break;case 1:if(es(u,f,s),i=f,u=i.stateNode,typeof u.componentDidMount=="function")try{u.componentDidMount()}catch(X){Ze(i,i.return,X)}if(i=f,u=i.updateQueue,u!==null){var z=i.stateNode;try{var q=u.shared.hiddenCallbacks;if(q!==null)for(u.shared.hiddenCallbacks=null,u=0;u<q.length;u++)zp(q[u],z)}catch(X){Ze(i,i.return,X)}}w&&p&64&&I0(f),hs(f,f.return);break;case 27:(s&2)!==0&&X0(f);case 5:f.tag!==5&&f.tag!==27||Y0(f),es(u,f,s),w&&i===null&&p&4&&xd(f),hs(f,f.return);break;case 6:Y0(f);break;case 26:z=f.stateNode,f.memoizedState!==null||z===null||Rt||gh(tr(z.ownerDocument),f.type,z),es(u,f,s),w&&i===null&&p&4&&xd(f),hs(f,f.return);break;case 12:es(u,f,s);break;case 31:es(u,f,s),w&&p&4&&oy(u,f);break;case 13:es(u,f,s),w&&p&4&&ry(u,f);break;case 22:f.memoizedState===null&&es(u,f,s),hs(f,f.return);break;case 30:es(u,f,s),hs(f,f.return);break;case 7:hs(f,f.return);default:es(u,f,s)}t=t.sibling}}function Od(e,t){var s=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(s=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==s&&(e!=null&&e.refCount++,s!=null&&Ao(s))}function zd(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Ao(e))}function Gn(e,t,s,i){var u=(s&335544064)===s;if(t.subtreeFlags&(u?10262:10256))for(t=t.child;t!==null;)dy(e,t,s,i),t=t.sibling;else u&&ey(t)}function dy(e,t,s,i){var u=(s&335544064)===s;u&&t.alternate===null&&t.return!==null&&t.return.alternate!==null&&Vc(t);var f=t.flags;switch(t.tag){case 0:case 11:case 15:Gn(e,t,s,i),f&2048&&qo(9,t);break;case 1:Gn(e,t,s,i);break;case 3:Gn(e,t,s,i),u&&_d&&(e=e.containerInfo,e=e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,e.style.viewTransitionName==="root"&&(e.style.viewTransitionName=""),e=e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName==="none"&&(e.style.viewTransitionName="")),f&2048&&(f=null,t.alternate!==null&&(f=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==f&&(t.refCount++,f!=null&&Ao(f)));break;case 12:if(f&2048){Gn(e,t,s,i),f=t.stateNode;try{var p=t.memoizedProps,w=p.id,z=p.onPostCommit;typeof z=="function"&&z(w,t.alternate===null?"mount":"update",f.passiveEffectDuration,-0)}catch(q){Ze(t,t.return,q)}}else Gn(e,t,s,i);break;case 31:Gn(e,t,s,i);break;case 13:Gn(e,t,s,i);break;case 23:break;case 22:p=t.stateNode,w=t.alternate,t.memoizedState!==null?(u&&w!==null&&w.memoizedState===null&&Vc(w),p._visibility&2?Gn(e,t,s,i):Yo(e,t)):(u&&w!==null&&w.memoizedState!==null&&Vc(t),p._visibility&2?Gn(e,t,s,i):(p._visibility|=2,fi(e,t,s,i,(t.subtreeFlags&10256)!==0||!1))),f&2048&&Od(w,t);break;case 24:Gn(e,t,s,i),f&2048&&zd(t.alternate,t);break;case 30:u&&(f=t.alternate,f!==null&&(gs(f.child,!0),gs(t.child,!0))),Gn(e,t,s,i);break;default:Gn(e,t,s,i)}}function fi(e,t,s,i,u){for(u=u&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var f=e,p=t,w=s,z=i,q=p.flags;switch(p.tag){case 0:case 11:case 15:fi(f,p,w,z,u),qo(8,p);break;case 23:break;case 22:var X=p.stateNode;p.memoizedState!==null?X._visibility&2?fi(f,p,w,z,u):Yo(f,p):(X._visibility|=2,fi(f,p,w,z,u)),u&&q&2048&&Od(p.alternate,p);break;case 24:fi(f,p,w,z,u),u&&q&2048&&zd(p.alternate,p);break;default:fi(f,p,w,z,u)}t=t.sibling}}function Yo(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var s=e,i=t,u=i.flags;switch(i.tag){case 22:Yo(s,i),u&2048&&Od(i.alternate,i);break;case 24:Yo(s,i),u&2048&&zd(i.alternate,i);break;default:Yo(s,i)}t=t.sibling}}var da=8192;function ha(e,t,s){if(e.subtreeFlags&da)for(e=e.child;e!==null;)hy(e,t,s),e=e.sibling}function hy(e,t,s){switch(e.tag){case 26:ha(e,t,s),e.flags&da&&(e.memoizedState!==null?p2(s,Wn,e.memoizedState,e.memoizedProps):(e=e.stateNode,(t&335544128)===t&&Sv(s,e)));break;case 5:ha(e,t,s),e.flags&da&&(e=e.stateNode,(t&335544128)===t&&Sv(s,e));break;case 3:case 4:var i=Wn;Wn=tr(e.stateNode.containerInfo),ha(e,t,s),Wn=i;break;case 22:e.memoizedState===null&&(i=e.alternate,i!==null&&i.memoizedState!==null?(i=da,da=16777216,ha(e,t,s),da=i):ha(e,t,s));break;case 30:if((e.flags&da)!==0&&(i=e.memoizedProps.name,i!=null&&i!=="auto")){var u=e.stateNode;u.paired=null,Tn===null&&(Tn=new Map),Tn.set(i,u)}ha(e,t,s);break;default:ha(e,t,s)}}function my(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 Po(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var s=0;s<t.length;s++){var i=t[s];At=i,py(i,e)}my(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)gy(e),e=e.sibling}function gy(e){switch(e.tag){case 0:case 11:case 15:Po(e),e.flags&2048&&ml(9,e,e.return);break;case 3:Po(e);break;case 12:Po(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Ic(e)):Po(e);break;default:Po(e)}}function Ic(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var s=0;s<t.length;s++){var i=t[s];At=i,py(i,e)}my(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:ml(8,t,t.return),Ic(t);break;case 22:s=t.stateNode,s._visibility&2&&(s._visibility&=-3,Ic(t));break;default:Ic(t)}e=e.sibling}}function py(e,t){for(;At!==null;){var s=At;switch(s.tag){case 0:case 11:case 15:ml(8,s,t);break;case 23:case 22:if(s.memoizedState!==null&&s.memoizedState.cachePool!==null){var i=s.memoizedState.cachePool.pool;i!=null&&i.refCount++}break;case 24:Ao(s.memoizedState.cache)}if(i=s.child,i!==null)i.return=s,At=i;else e:for(s=e;At!==null;){i=At;var u=i.sibling,f=i.return;if(ay(i),i===s){At=null;break e}if(u!==null){u.return=f,At=u;break e}At=f}}}var fj={getCacheForType:function(e){var t=$t(St),s=t.data.get(e);return s===void 0&&(s=e(),t.data.set(e,s)),s},cacheSignal:function(){return $t(St).controller.signal}},dj=typeof WeakMap=="function"?WeakMap:Map,Qe=0,nt=null,ze=null,Le=0,Ke=0,_n=null,pl=!1,di=!1,Dd=!1,Vs=0,mt=0,yl=0,ma=0,Qc=0,Rn=0,hi=0,Xo=null,yn=null,Ld=!1,Yc=0,yy=0,Pc=1/0,Xc=null,vl=null,ft=0,ts=null,ga=null,xs=0,$d=0,kd=null,vy=null,mi=null,gi=null,pi=null,Ko=0,Kc=null;function An(){return(Qe&2)!==0&&Le!==0?Le&-Le:me.T!==null?Yd():Fa()}function xy(){if(Rn===0)if((Le&536870912)===0||Oe){var e=Ql;Ql<<=1,(Ql&3932160)===0&&(Ql=262144),Rn=e}else Rn=536870912;return e=kt.current,e!==null&&(e.flags|=32),Rn}function yi(e,t){if(t!=null){var s=e.stateNode,i=s.ref;i===null&&(i=s.ref=Wy(As(e.memoizedProps,s))),gi===null&&(gi=[]),gi.push(t.bind(null,i))}}function vn(e,t,s){(e===nt&&(Ke===2||Ke===9)||e.cancelPendingCommit!==null)&&(vi(e,0),xl(e,Le,Rn,!1)),Ws(e,s),((Qe&2)===0||e!==nt)&&(e===nt&&((Qe&2)===0&&(ma|=s),mt===4&&xl(e,Le,Rn,!1)),Ss(e))}function Sy(e,t,s){if((Qe&6)!==0)throw Error(o(327));var i=!s&&(t&127)===0&&(t&e.expiredLanes)===0||Js(e,t),u=i?gj(e,t):Ud(e,t,!0),f=i;do{if(u===0){di&&!i&&xl(e,t,0,!1);break}else{if(s=e.current.alternate,f&&!hj(s)){u=Ud(e,t,!1),f=!1;continue}if(u===2){if(f=t,e.errorRecoveryDisabledLanes&f)var p=0;else p=e.pendingLanes&-536870913,p=p!==0?p:p&536870912?536870912:0;if(p!==0){t=p;e:{var w=e;u=Xo;var z=w.current.memoizedState.isDehydrated;if(z&&(vi(w,p).flags|=256),p=Ud(w,p,!1),p!==2&&p!==6){if(Dd&&!z){w.errorRecoveryDisabledLanes|=f,ma|=f,u=4;break e}f=yn,yn=u,f!==null&&(yn===null?yn=f:yn.push.apply(yn,f))}u=p}if(f=!1,u!==2)continue}}if(u===1){vi(e,0),xl(e,t,0,!0);break}e:{switch(i=e,f=u,f){case 0:case 1:throw Error(o(345));case 4:if((t&4194048)!==t&&(t&62914560)!==t)break;case 6:xl(i,t,Rn,!pl);break e;case 2:yn=null;break;case 3:case 5:break;default:throw Error(o(329))}if((t&62914560)===t&&(u=Yc+300-et(),10<u)){if(xl(i,t,Rn,!pl),Pl(i,0,!0)!==0)break e;xs=t,i.timeoutHandle=lh(by.bind(null,i,s,yn,Xc,Ld,t,Rn,ma,hi,pl,f,"Throttled",-0,0),u);break e}by(i,s,yn,Xc,Ld,t,Rn,ma,hi,pl,f,null,-0,0)}}break}while(!0);Ss(e)}function by(e,t,s,i,u,f,p,w,z,q,X,ne,V,Y){e.timeoutHandle=-1;var fe=t.subtreeFlags,ye=(f&335544064)===f;if(ne=null,(ye||fe&8192||(fe&16785408)===16785408)&&(ne={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:us},Tn=null,hy(t,f,ne),ye&&(fe=ne,ye=e.containerInfo,ye=(ye.nodeType===9?ye:ye.ownerDocument).__reactViewTransition,ye!=null&&(fe.count++,fe.waitingForViewTransition=!0,fe=lr.bind(fe),ye.finished.then(fe,fe))),fe=(f&62914560)===f?Yc-et():(f&4194048)===f?yy-et():0,fe=y2(ne,fe),fe!==null)){xs=f,e.cancelPendingCommit=fe(_y.bind(null,e,t,f,s,i,u,p,w,z,q,X,ne,null,V,Y)),xl(e,f,p,!q);return}_y(e,t,f,s,i,u,p,w,z,q,X,ne)}function hj(e){for(var t=e;;){var s=t.tag;if((s===0||s===11||s===15)&&t.flags&16384&&(s=t.updateQueue,s!==null&&(s=s.stores,s!==null)))for(var i=0;i<s.length;i++){var u=s[i],f=u.getSnapshot;u=u.value;try{if(!Mn(f(),u))return!1}catch{return!1}}if(s=t.child,t.subtreeFlags&16384&&s!==null)s.return=t,t=s;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 xl(e,t,s,i){t=ho(e,t),t&=~Qc,t&=~ma,e.suspendedLanes|=t,e.pingedLanes&=~t,i&&(e.warmLanes|=t),i=e.expirationTimes;for(var u=t;0<u;){var f=31-Yt(u),p=1<<f;i[f]=-1,u&=~p}s!==0&&at(e,s,t)}function Zc(){return(Qe&6)===0?(Zo(0),!1):!0}function Hd(){if(ze!==null){if(Ke===0)var e=ze.return;else e=ze,Ls=na=null,Qf(e),li=null,Do=0,e=ze;for(;e!==null;)q0(e.alternate,e),e=e.return;ze=null}}function vi(e,t){var s=e.timeoutHandle;return s!==-1&&(e.timeoutHandle=-1,kj(s)),s=e.cancelPendingCommit,s!==null&&(e.cancelPendingCommit=null,s()),xs=0,Hd(),nt=e,ze=s=zs(e.current,null),Le=t,Ke=0,_n=null,pl=!1,di=Js(e,t),Dd=!1,hi=Rn=Qc=ma=yl=mt=0,yn=Xo=null,Ld=!1,Vs=ho(e,t),ac(),s}function jy(e,t){Re=null,me.H=Rc,t===si||t===pc?(t=_p(),Ke=3):t===zf?(t=_p(),Ke=4):Ke=t===od?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,_n=t,ze===null&&(mt=1,Ac(e,Un(t,e.current)))}function wy(){var e=kt.current;return e===null?!0:(Le&4194048)===Le?Pt===null:(Le&62914560)===Le||(Le&536870912)!==0?e===Pt:!1}function Ny(){var e=me.H;return me.H=Rc,e===null?Rc:e}function Cy(){var e=me.A;return me.A=fj,e}function Jc(){mt=4,pl||(Le&4194048)!==Le&&kt.current!==null||(di=!0),(yl&134217727)===0&&(ma&134217727)===0||nt===null||xl(nt,Le,Rn,!1)}function Ud(e,t,s){var i=Qe;Qe|=2;var u=Ny(),f=Cy();(nt!==e||Le!==t)&&(Xc=null,vi(e,t)),t=!1;var p=mt;e:do try{if(Ke!==0&&ze!==null){var w=ze,z=_n;switch(Ke){case 8:Hd(),p=6;break e;case 3:case 2:case 9:case 6:kt.current===null&&(t=!0);var q=Ke;if(Ke=0,_n=null,xi(e,w,z,q),s&&di){p=0;break e}break;default:q=Ke,Ke=0,_n=null,xi(e,w,z,q)}}mj(),p=mt;break}catch(X){jy(e,X)}while(!0);return t&&e.shellSuspendCounter++,Ls=na=null,Qe=i,me.H=u,me.A=f,ze===null&&(nt=null,Le=0,ac()),p}function mj(){for(;ze!==null;)My(ze)}function gj(e,t){var s=Qe;Qe|=2;var i=Ny(),u=Cy();nt!==e||Le!==t?(Xc=null,Pc=et()+500,vi(e,t)):di=Js(e,t);e:do try{if(Ke!==0&&ze!==null){t=ze;var f=_n;t:switch(Ke){case 1:Ke=0,_n=null,xi(e,t,f,1);break;case 2:case 9:if(Ep(f)){Ke=0,_n=null,Ey(t);break}t=function(){Ke!==2&&Ke!==9||nt!==e||(Ke=7),Ss(e)},f.then(t,t);break e;case 3:Ke=7;break e;case 4:Ke=5;break e;case 7:Ep(f)?(Ke=0,_n=null,Ey(t)):(Ke=0,_n=null,xi(e,t,f,7));break;case 5:var p=null;switch(ze.tag){case 26:p=ze.memoizedState;case 5:case 27:var w=ze;if(p?vv(p):w.stateNode.complete){Ke=0,_n=null;var z=w.sibling;if(z!==null)ze=z;else{var q=w.return;q!==null?(ze=q,Wc(q)):ze=null}break t}}Ke=0,_n=null,xi(e,t,f,5);break;case 6:Ke=0,_n=null,xi(e,t,f,6);break;case 8:Hd(),mt=6;break e;default:throw Error(o(462))}}pj();break}catch(X){jy(e,X)}while(!0);return Ls=na=null,me.H=i,me.A=u,Qe=s,ze!==null?0:(nt=null,Le=0,ac(),mt)}function pj(){for(;ze!==null&&!vt();)My(ze)}function My(e){var t=B0(e.alternate,e,Vs);e.memoizedProps=e.pendingProps,t===null?Wc(e):ze=t}function Ey(e){var t=e,s=t.alternate;switch(t.tag){case 15:case 0:t=L0(s,t,t.pendingProps,t.type,void 0,Le);break;case 11:t=L0(s,t,t.pendingProps,t.type.render,t.ref,Le);break;case 5:Qf(t);var i=t;i===_t&&(Oe?(fc(i),i.tag===5&&i.stateNode!=null&&(st=i.stateNode)):(fc(i),Oe=!0));default:q0(s,t),t=ze=pp(t,Vs),t=B0(s,t,Vs)}e.memoizedProps=e.pendingProps,t===null?Wc(e):ze=t}function xi(e,t,s,i){Ls=na=null,Qf(t),li=null,Do=0;var u=t.return;try{if(sj(e,u,t,s,Le)){mt=1,Ac(e,Un(s,e.current)),ze=null;return}}catch(f){if(u!==null)throw ze=u,f;mt=1,Ac(e,Un(s,e.current)),ze=null;return}t.flags&32768?(Oe||i===1?e=!0:di||(Le&536870912)!==0?e=!1:(pl=e=!0,(i===2||i===9||i===3||i===6)&&(i=kt.current,i!==null&&i.tag===13&&(i.flags|=16384))),Ty(t,e)):Wc(t)}function Wc(e){var t=e;do{if((t.flags&32768)!==0){Ty(t,pl);return}e=t.return;var s=oj(t.alternate,t,Vs);if(s!==null){ze=s;return}if(t=t.sibling,t!==null){ze=t;return}ze=t=e}while(t!==null);mt===0&&(mt=5)}function Ty(e,t){do{var s=rj(e.alternate,e);if(s!==null){s.flags&=32767,ze=s;return}if(s=e.return,s!==null&&(s.flags|=32768,s.subtreeFlags=0,s.deletions=null),!t&&(e=e.sibling,e!==null)){ze=e;return}ze=e=s}while(e!==null);mt=6,ze=null}function _y(e,t,s,i,u,f,p,w,z,q,X,ne){e.cancelPendingCommit=null;do eu();while(ft!==0);if((Qe&6)!==0)throw Error(o(327));if(t!==null){if(t===e.current)throw Error(o(177));e===nt&&(ze=nt=null,Le=0),ga=t,ts=e,xs=s,kd=u,vy=i,yj(e,t,s,p,w,z,ne)}}function yj(e,t,s,i,u,f,p){var w=t.lanes|t.childLanes;if($d=w,w|=Sf,ge(e,s,w,i,u,f),gi=null,(s&335544064)===s?(pi=Ib(e),i=10262):(pi=null,i=10256),(t.subtreeFlags&i)!==0||(t.flags&i)!==0?(e.callbackNode=null,e.callbackPriority=0,wj(ka,function(){return Gd(),null})):(e.callbackNode=null,e.callbackPriority=0),Uc=!1,i=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||i){i=me.T,me.T=null,u=Se.p,Se.p=2,f=Qe,Qe|=4;try{cj(e,t,s)}finally{Qe=f,Se.p=u,me.T=i}}ft=1,Uc?mi=Gj(p,e.containerInfo,pi,Fd,Vd,xj,Bd,Gd,vj):(Fd(),Vd(),Bd())}function vj(e){if(ft!==0){var t=ts.onRecoverableError;t(e,{componentStack:null})}}function xj(){ft===3&&(ft=0,fy(ga,ts),ft=4)}function Fd(){if(ft===1){ft=0;var e=ts,t=ga,s=xs,i=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||i){i=me.T,me.T=null;var u=Se.p;Se.p=2;var f=Qe;Qe|=4;try{Qo=Bc=!1,cy(t,e,s),s=th;var p=ip(e.containerInfo),w=s.focusedElem,z=s.selectionRange;if(p!==w&&w&&w.ownerDocument&&ap(w.ownerDocument.documentElement,w)){if(z!==null&&gf(w)){var q=z.start,X=z.end;if(X===void 0&&(X=q),"selectionStart"in w)w.selectionStart=q,w.selectionEnd=Math.min(X,w.value.length);else{var ne=w.ownerDocument||document,V=ne&&ne.defaultView||window;if(V.getSelection){var Y=V.getSelection(),fe=w.textContent.length,ye=Math.min(z.start,fe),Ae=z.end===void 0?ye:Math.min(z.end,fe);!Y.extend&&ye>Ae&&(p=Ae,Ae=ye,ye=p);var G=lp(w,ye),H=lp(w,Ae);if(G&&H&&(Y.rangeCount!==1||Y.anchorNode!==G.node||Y.anchorOffset!==G.offset||Y.focusNode!==H.node||Y.focusOffset!==H.offset)){var Q=ne.createRange();Q.setStart(G.node,G.offset),Y.removeAllRanges(),ye>Ae?(Y.addRange(Q),Y.extend(H.node,H.offset)):(Q.setEnd(H.node,H.offset),Y.addRange(Q))}}}}for(ne=[],Y=w;Y=Y.parentNode;)Y.nodeType===1&&ne.push({element:Y,left:Y.scrollLeft,top:Y.scrollTop});for(typeof w.focus=="function"&&w.focus(),w=0;w<ne.length;w++){var ee=ne[w];ee.element.scrollLeft=ee.left,ee.element.scrollTop=ee.top}}Ei=!!eh,th=eh=null}finally{Qe=f,Se.p=u,me.T=i}}e.current=t,ft=2}}function Vd(){if(ft===2){ft=0;var e=ts,t=ga,s=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||s){s=me.T,me.T=null;var i=Se.p;Se.p=2;var u=Qe;Qe|=4;try{sy(e,t.alternate,t)}finally{Qe=u,Se.p=i,me.T=s}}ft=3}}function Bd(){if(ft===4||ft===3){ft=0;var e=mi;mi=null,pt();var t=ts,s=ga,i=xs,u=vy,f=(i&335544064)===i?10262:10256;if((s.subtreeFlags&f)!==0||(s.flags&f)!==0?ft=5:(ft=0,ga=ts=null,Ry(t,t.pendingLanes)),f=t.pendingLanes,f===0&&(vl=null),po(i),s=s.stateNode,Qt&&typeof Qt.onCommitFiberRoot=="function")try{Qt.onCommitFiberRoot(Zs,s,void 0,(s.current.flags&128)===128)}catch{}if(u!==null){s=me.T,f=Se.p,Se.p=2,me.T=null;try{for(var p=t.onRecoverableError,w=0;w<u.length;w++){var z=u[w];p(z.value,{componentStack:z.stack})}}finally{me.T=s,Se.p=f}}if(u=gi,p=pi,pi=null,u!==null&&(gi=null,p===null&&(p=[]),e!==null))for(z=0;z<u.length;z++)s=(0,u[z])(p),s!==void 0&&e.finished.finally(s);(xs&3)!==0&&eu(),Ss(t),f=t.pendingLanes,(i&261930)!==0&&(f&42)!==0?t===Kc?Ko++:(Ko=0,Kc=t):(Ko=0,Kc=null),Zo(0)}}function Ry(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Ao(t)))}function eu(){return mi!==null&&(mi.skipTransition(),mi=null),Fd(),Vd(),Bd(),Gd()}function Gd(){if(ft!==5)return!1;var e=ts,t=$d;$d=0;var s=po(xs),i=me.T,u=Se.p;try{Se.p=32>s?32:s,me.T=null,s=kd,kd=null;var f=ts,p=xs;if(ft=0,ga=ts=null,xs=0,(Qe&6)!==0)throw Error(o(331));var w=Qe;if(Qe|=4,gy(f.current),dy(f,f.current,p,s),Qe=w,Zo(0,!1),Qt&&typeof Qt.onPostCommitFiberRoot=="function")try{Qt.onPostCommitFiberRoot(Zs,f)}catch{}return!0}finally{Se.p=u,me.T=i,Ry(e,t)}}function Ay(e,t,s){t=Un(s,t),t=id(e.stateNode,t,2),e=ul(e,t,2),e!==null&&(Ws(e,2),Ss(e))}function Ze(e,t,s){if(e.tag===3)Ay(e,e,s);else for(;t!==null;){if(t.tag===3){Ay(t,e,s);break}else if(t.tag===1){var i=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof i.componentDidCatch=="function"&&(vl===null||!vl.has(i))){e=Un(s,e),s=E0(2),i=ul(t,s,2),i!==null&&(T0(s,i,t,e),Ws(i,2),Ss(i));break}}t=t.return}}function qd(e,t,s){var i=e.pingCache;if(i===null){i=e.pingCache=new dj;var u=new Set;i.set(t,u)}else u=i.get(t),u===void 0&&(u=new Set,i.set(t,u));u.has(s)||(Dd=!0,u.add(s),e=Sj.bind(null,e,t,s),t.then(e,e))}function Sj(e,t,s){var i=e.pingCache;i!==null&&i.delete(t),e.pingedLanes|=e.suspendedLanes&s,e.warmLanes&=~s,nt===e&&(Le&s)===s&&((mt===4||mt===3&&(Le&62914560)===Le&&300>et()-Yc)&&(Qe&2)===0?vi(e,0):Qc|=s,hi===Le&&(hi=0)),Ss(e)}function Oy(e,t){t===0&&(t=mo()),e=Wl(e,t),e!==null&&(Ws(e,t),Ss(e))}function bj(e){var t=e.memoizedState,s=0;t!==null&&(s=t.retryLane),Oy(e,s)}function jj(e,t){var s=0;switch(e.tag){case 31:case 13:var i=e.stateNode,u=e.memoizedState;u!==null&&(s=u.retryLane);break;case 19:i=e.stateNode;break;case 22:i=e.stateNode._retryCache;break;default:throw Error(o(314))}i!==null&&i.delete(t),Oy(e,s)}function wj(e,t){return Ue(e,t)}var Si=null,bi=null,Id=!1,tu=!1,Qd=!1,Sl=0;function Ss(e){e!==bi&&e.next===null&&(bi===null?Si=bi=e:bi=bi.next=e),tu=!0,Id||(Id=!0,Cj())}function Zo(e,t){if(!Qd&&tu){Qd=!0;do for(var s=!1,i=Si;i!==null;){if(e!==0){var u=i.pendingLanes;if(u===0)var f=0;else{var p=i.suspendedLanes,w=i.pingedLanes;f=(1<<31-Yt(42|e)+1)-1,f&=u&~(p&~w),f=f&201326741?f&201326741|1:f?f|2:0}f!==0&&(s=!0,$y(i,f))}else f=Le,f=Pl(i,i===nt?f:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),(f&3)===0||Js(i,f)||(s=!0,$y(i,f));i=i.next}while(s);Qd=!1}}function Nj(){zy()}function zy(){tu=Id=!1;var e=0;Sl!==0&&$j()&&(e=Sl);for(var t=et(),s=null,i=Si;i!==null;){var u=i.next,f=Dy(i,t);f===0?(i.next=null,s===null?Si=u:s.next=u,u===null&&(bi=s)):(s=i,(e!==0||(f&3)!==0)&&(tu=!0)),i=u}ft!==0&&ft!==5||Zo(e),Sl!==0&&(Sl=0)}function Dy(e,t){for(var s=e.suspendedLanes,i=e.pingedLanes,u=e.expirationTimes,f=e.pendingLanes&-62914561;0<f;){var p=31-Yt(f),w=1<<p,z=u[p];z===-1?((w&s)===0||(w&i)!==0)&&(u[p]=Ir(w,t)):z<=t&&(e.expiredLanes|=w),f&=~w}if(t=nt,s=Le,s=Pl(e,e===t?s:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),i=e.callbackNode,s===0||e===t&&(Ke===2||Ke===9)||e.cancelPendingCommit!==null)return i!==null&&i!==null&&Pe(i),e.callbackNode=null,e.callbackPriority=0;if((s&3)===0||Js(e,s)){if(t=s&-s,t===e.callbackPriority)return t;switch(i!==null&&Pe(i),po(s)){case 2:case 8:s=ql;break;case 32:s=ka;break;case 268435456:s=tn;break;default:s=ka}return i=Ly.bind(null,e),s=Ue(s,i),e.callbackPriority=t,e.callbackNode=s,t}return i!==null&&i!==null&&Pe(i),e.callbackPriority=2,e.callbackNode=null,2}function Ly(e,t){if(ft!==0&&ft!==5)return e.callbackNode=null,e.callbackPriority=0,null;var s=e.callbackNode;if(eu()&&e.callbackNode!==s)return null;var i=Le;return i=Pl(e,e===nt?i:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),i===0?null:(Sy(e,i,t),Dy(e,et()),e.callbackNode!=null&&e.callbackNode===s?Ly.bind(null,e):null)}function $y(e,t){if(eu())return null;Sy(e,t,!0)}function Cj(){Hj(function(){(Qe&6)!==0?Ue(Nn,Nj):zy()})}function Yd(){if(Sl===0){var e=aa;e===0&&(e=Il,Il<<=1,(Il&261888)===0&&(Il=256)),Sl=e}return Sl}function ky(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Zr(e)}function Mj(e,t,s,i,u){if(t==="submit"&&s&&s.stateNode===u){var f=ky((u[Lt]||null).action),p=i.submitter;p&&(t=(t=p[Lt]||null)?ky(t.formAction):p.getAttribute("formAction"),t!==null&&(f=t,p=null));var w=new tc("action","action",null,i,u);e.push({event:w,listeners:[{instance:null,listener:function(){if(i.defaultPrevented){if(Sl!==0){var z=new FormData(u,p);td(s,{pending:!0,data:z,method:u.method,action:f},null,z)}}else typeof f=="function"&&(w.preventDefault(),z=new FormData(u,p),td(s,{pending:!0,data:z,method:u.method,action:f},f,z))},currentTarget:u}]})}}for(var Pd=0;Pd<xf.length;Pd++){var Xd=xf[Pd],Ej=Xd.toLowerCase(),Tj=Xd[0].toUpperCase()+Xd.slice(1);Zn(Ej,"on"+Tj)}Zn(cp,"onAnimationEnd"),Zn(up,"onAnimationIteration"),Zn(fp,"onAnimationStart"),Zn("dblclick","onDoubleClick"),Zn("focusin","onFocus"),Zn("focusout","onBlur"),Zn(kb,"onTransitionRun"),Zn(Hb,"onTransitionStart"),Zn(Ub,"onTransitionCancel"),Zn(dp,"onTransitionEnd"),Ga("onMouseEnter",["mouseout","mouseover"]),Ga("onMouseLeave",["mouseout","mouseover"]),Ga("onPointerEnter",["pointerout","pointerover"]),Ga("onPointerLeave",["pointerout","pointerover"]),Kl("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Kl("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Kl("onBeforeInput",["compositionend","keypress","textInput","paste"]),Kl("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Kl("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Kl("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Jo="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(" "),_j=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Jo));function Hy(e,t){t=(t&4)!==0;for(var s=0;s<e.length;s++){var i=e[s],u=i.event;i=i.listeners;e:{var f=void 0;if(t)for(var p=i.length-1;0<=p;p--){var w=i[p],z=w.instance,q=w.currentTarget;if(w=w.listener,z!==f&&u.isPropagationStopped())break e;f=w,u.currentTarget=q;try{f(u)}catch(X){lc(X)}u.currentTarget=null,f=z}else for(p=0;p<i.length;p++){if(w=i[p],z=w.instance,q=w.currentTarget,w=w.listener,z!==f&&u.isPropagationStopped())break e;f=w,u.currentTarget=q;try{f(u)}catch(X){lc(X)}u.currentTarget=null,f=z}}}}function De(e,t){var s=t[yo];s===void 0&&(s=t[yo]=new Set);var i=e+"__bubble";s.has(i)||(Uy(t,e,2,!1),s.add(i))}function Kd(e,t,s){var i=0;t&&(i|=4),Uy(s,e,i,t)}var nu="_reactListening"+Math.random().toString(36).slice(2);function Zd(e){if(!e[nu]){e[nu]=!0,Mg.forEach(function(s){s!=="selectionchange"&&(_j.has(s)||Kd(s,!1,e),Kd(s,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[nu]||(t[nu]=!0,Kd("selectionchange",!1,t))}}function Uy(e,t,s,i){switch(Tv(t)){case 2:var u=b2;break;case 8:u=j2;break;default:u=yh}s=u.bind(null,t,s,e),u=void 0,!lf||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(u=!0),i?u!==void 0?e.addEventListener(t,s,{capture:!0,passive:u}):e.addEventListener(t,s,!0):u!==void 0?e.addEventListener(t,s,{passive:u}):e.addEventListener(t,s,!1)}function Jd(e,t,s,i,u){var f=i;if((t&1)===0&&(t&2)===0&&i!==null)e:for(;;){if(i===null)return;var p=i.tag;if(p===3||p===4){var w=i.stateNode.containerInfo;if(w===u)break;if(p===4)for(p=i.return;p!==null;){var z=p.tag;if((z===3||z===4)&&p.stateNode.containerInfo===u)return;p=p.return}for(;w!==null;){if(p=Xl(w),p===null)return;if(z=p.tag,z===5||z===6||z===26||z===27){i=f=p;continue e}w=w.parentNode}}i=i.return}Ug(function(){var q=f,X=nf(s),ne=[];e:{var V=hp.get(e);if(V!==void 0){var Y=tc,fe=e;switch(e){case"keypress":if(Wr(s)===0)break e;case"keydown":case"keyup":Y=hb;break;case"focusin":fe="focus",Y=cf;break;case"focusout":fe="blur",Y=cf;break;case"beforeblur":case"afterblur":Y=cf;break;case"click":if(s.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Y=Bg;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Y=tb;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Y=vb;break;case cp:case up:case fp:Y=lb;break;case dp:Y=Sb;break;case"scroll":case"scrollend":Y=WS;break;case"wheel":Y=jb;break;case"copy":case"cut":case"paste":Y=ib;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Y=qg;break;case"submit":Y=pb;break;case"toggle":case"beforetoggle":Y=Nb}var ye=(t&4)!==0,Ae=!ye&&(e==="scroll"||e==="scrollend"),G=ye?V!==null?V+"Capture":null:V;ye=[];for(var H=q,Q;H!==null;){var ee=H;if(Q=ee.stateNode,ee=ee.tag,ee!==5&&ee!==26&&ee!==27||Q===null||G===null||(ee=So(H,G),ee!=null&&ye.push(Wo(H,ee,Q))),Ae)break;H=H.return}0<ye.length&&(V=new Y(V,fe,null,s,X),ne.push({event:V,listeners:ye}))}}if((t&7)===0){e:{if(Y=e==="mouseover"||e==="pointerover",V=e==="mouseout"||e==="pointerout",Y&&s!==tf&&(fe=s.relatedTarget||s.fromElement)&&(Xl(fe)||fe[el]))break e;(V||Y)&&(fe=X.window===X?X:(Y=X.ownerDocument)?Y.defaultView||Y.parentWindow:window,V?(Y=s.relatedTarget||s.toElement,V=q,Y=Y?Xl(Y):null,Y!==null&&(Ae=d(Y),ye=Y.tag,Y!==Ae||ye!==5&&ye!==27&&ye!==6)&&(Y=null)):(V=null,Y=q),V!==Y&&(ye=Bg,ee="onMouseLeave",G="onMouseEnter",H="mouse",(e==="pointerout"||e==="pointerover")&&(ye=qg,ee="onPointerLeave",G="onPointerEnter",H="pointer"),Ae=V==null?fe:xo(V),Q=Y==null?fe:xo(Y),fe=new ye(ee,H+"leave",V,s,X),fe.target=Ae,fe.relatedTarget=Q,ee=null,Xl(X)===q&&(ye=new ye(G,H+"enter",Y,s,X),ye.target=Q,ye.relatedTarget=Ae,ee=ye),Ae=ee,ye=V&&Y?R(V,Y,Rj):null,V!==null&&Fy(ne,fe,V,ye,!1),Y!==null&&Ae!==null&&Fy(ne,Ae,Y,ye,!0)))}e:{if(V=q?xo(q):window,Y=V.nodeName&&V.nodeName.toLowerCase(),Y==="select"||Y==="input"&&V.type==="file")var pe=Jg;else if(Kg(V))if(Wg)pe=Db;else{pe=Ob;var $e=Ab}else Y=V.nodeName,!Y||Y.toLowerCase()!=="input"||V.type!=="checkbox"&&V.type!=="radio"?q&&ef(q.elementType)&&(pe=Jg):pe=zb;if(pe&&(pe=pe(e,q))){Zg(ne,pe,s,X);break e}$e&&$e(e,V,q)}switch($e=q?xo(q):window,e){case"focusin":(Kg($e)||$e.contentEditable==="true")&&(Xa=$e,pf=q,To=null);break;case"focusout":To=pf=Xa=null;break;case"mousedown":yf=!0;break;case"contextmenu":case"mouseup":case"dragend":yf=!1,op(ne,s,X);break;case"selectionchange":if($b)break;case"keydown":case"keyup":op(ne,s,X)}var be;if(ff)e:{switch(e){case"compositionstart":var Ce="onCompositionStart";break e;case"compositionend":Ce="onCompositionEnd";break e;case"compositionupdate":Ce="onCompositionUpdate";break e}Ce=void 0}else Pa?Pg(e,s)&&(Ce="onCompositionEnd"):e==="keydown"&&s.keyCode===229&&(Ce="onCompositionStart");Ce&&(Ig&&s.locale!=="ko"&&(Pa||Ce!=="onCompositionStart"?Ce==="onCompositionEnd"&&Pa&&(be=Fg()):(tl=X,af="value"in tl?tl.value:tl.textContent,Pa=!0)),$e=su(q,Ce),0<$e.length&&(Ce=new Gg(Ce,e,null,s,X),ne.push({event:Ce,listeners:$e}),be?Ce.data=be:(be=Xg(s),be!==null&&(Ce.data=be)))),(be=Mb?Eb(e,s):Tb(e,s))&&(Ce=su(q,"onBeforeInput"),0<Ce.length&&($e=new Gg("onBeforeInput","beforeinput",null,s,X),ne.push({event:$e,listeners:Ce}),$e.data=be)),Mj(ne,e,q,s,X)}Hy(ne,t)})}function Wo(e,t,s){return{instance:e,listener:t,currentTarget:s}}function su(e,t){for(var s=t+"Capture",i=[];e!==null;){var u=e,f=u.stateNode;if(u=u.tag,u!==5&&u!==26&&u!==27||f===null||(u=So(e,s),u!=null&&i.unshift(Wo(e,u,f)),u=So(e,t),u!=null&&i.push(Wo(e,u,f))),e.tag===3)return i;e=e.return}return[]}function Rj(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Fy(e,t,s,i,u){for(var f=t._reactName,p=[];s!==null&&s!==i;){var w=s,z=w.alternate,q=w.stateNode;if(w=w.tag,z!==null&&z===i)break;w!==5&&w!==26&&w!==27||q===null||(z=q,u?(q=So(s,f),q!=null&&p.unshift(Wo(s,q,z))):u||(q=So(s,f),q!=null&&p.push(Wo(s,q,z)))),s=s.return}p.length!==0&&e.push({event:t,listeners:p})}var Aj=/\r\n?/g,Oj=/\u0000|\uFFFD/g;function Vy(e){return(typeof e=="string"?e:""+e).replace(Aj,`
|
|
49
|
-
`).replace(Oj,"")}function By(e,t){return t=Vy(t),Vy(e)===t}function Je(e,t,s,i,u,f){switch(s){case"children":if(typeof i=="string")t==="body"||t==="textarea"&&i===""||Ia(e,i);else if(typeof i=="number"||typeof i=="bigint")t!=="body"&&Ia(e,""+i);else return;break;case"className":Kr(e,"class",i);break;case"tabIndex":Kr(e,"tabindex",i);break;case"dir":case"role":case"viewBox":case"width":case"height":Kr(e,s,i);break;case"style":kg(e,i,f);return;case"data":if(t!=="object"){Kr(e,"data",i);break}case"src":case"href":if(i===""&&(t!=="a"||s!=="href")){e.removeAttribute(s);break}if(i==null||typeof i=="function"||typeof i=="symbol"||typeof i=="boolean"){e.removeAttribute(s);break}i=Zr(i),e.setAttribute(s,i);break;case"action":case"formAction":if(typeof i=="function"){e.setAttribute(s,"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 f=="function"&&(s==="formAction"?(t!=="input"&&Je(e,t,"name",u.name,u,null),Je(e,t,"formEncType",u.formEncType,u,null),Je(e,t,"formMethod",u.formMethod,u,null),Je(e,t,"formTarget",u.formTarget,u,null)):(Je(e,t,"encType",u.encType,u,null),Je(e,t,"method",u.method,u,null),Je(e,t,"target",u.target,u,null)));if(i==null||typeof i=="symbol"||typeof i=="boolean"){e.removeAttribute(s);break}i=Zr(i),e.setAttribute(s,i);break;case"onClick":i!=null&&(e.onclick=us);return;case"onScroll":i!=null&&De("scroll",e);return;case"onScrollEnd":i!=null&&De("scrollend",e);return;case"dangerouslySetInnerHTML":if(i!=null){if(typeof i!="object"||!("__html"in i))throw Error(o(61));if(s=i.__html,s!=null){if(u.children!=null)throw Error(o(60));(f!=null?f.__html:void 0)!==s&&(e.innerHTML=s)}}break;case"multiple":e.multiple=i&&typeof i!="function"&&typeof i!="symbol";break;case"muted":e.muted=i&&typeof i!="function"&&typeof i!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(i==null||typeof i=="function"||typeof i=="boolean"||typeof i=="symbol"){e.removeAttribute("xlink:href");break}s=Zr(i),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",s);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":i!=null&&typeof i!="function"&&typeof i!="symbol"?e.setAttribute(s,i):e.removeAttribute(s);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"credentialless":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":i&&typeof i!="function"&&typeof i!="symbol"?e.setAttribute(s,""):e.removeAttribute(s);break;case"capture":case"download":i===!0?e.setAttribute(s,""):i!==!1&&i!=null&&typeof i!="function"&&typeof i!="symbol"?e.setAttribute(s,i):e.removeAttribute(s);break;case"cols":case"rows":case"size":case"span":i!=null&&typeof i!="function"&&typeof i!="symbol"&&!isNaN(i)&&1<=i?e.setAttribute(s,i):e.removeAttribute(s);break;case"rowSpan":case"start":i==null||typeof i=="function"||typeof i=="symbol"||isNaN(i)?e.removeAttribute(s):e.setAttribute(s,i);break;case"popover":De("beforetoggle",e),De("toggle",e),Xr(e,"popover",i);break;case"xlinkActuate":_s(e,"http://www.w3.org/1999/xlink","xlink:actuate",i);break;case"xlinkArcrole":_s(e,"http://www.w3.org/1999/xlink","xlink:arcrole",i);break;case"xlinkRole":_s(e,"http://www.w3.org/1999/xlink","xlink:role",i);break;case"xlinkShow":_s(e,"http://www.w3.org/1999/xlink","xlink:show",i);break;case"xlinkTitle":_s(e,"http://www.w3.org/1999/xlink","xlink:title",i);break;case"xlinkType":_s(e,"http://www.w3.org/1999/xlink","xlink:type",i);break;case"xmlBase":_s(e,"http://www.w3.org/XML/1998/namespace","xml:base",i);break;case"xmlLang":_s(e,"http://www.w3.org/XML/1998/namespace","xml:lang",i);break;case"xmlSpace":_s(e,"http://www.w3.org/XML/1998/namespace","xml:space",i);break;case"is":Xr(e,"is",i);break;case"innerText":case"textContent":return;default:if(!(2<s.length)||s[0]!=="o"&&s[0]!=="O"||s[1]!=="n"&&s[1]!=="N")s=ZS.get(s)||s,Xr(e,s,i);else return}qe=!0}function Wd(e,t,s,i,u,f){switch(s){case"style":kg(e,i,f);return;case"dangerouslySetInnerHTML":if(i!=null){if(typeof i!="object"||!("__html"in i))throw Error(o(61));if(s=i.__html,s!=null){if(u.children!=null)throw Error(o(60));(f!=null?f.__html:void 0)!==s&&(e.innerHTML=s)}}break;case"children":if(typeof i=="string")Ia(e,i);else if(typeof i=="number"||typeof i=="bigint")Ia(e,""+i);else return;break;case"onScroll":i!=null&&De("scroll",e);return;case"onScrollEnd":i!=null&&De("scrollend",e);return;case"onClick":i!=null&&(e.onclick=us);return;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":return;case"innerText":case"textContent":return;default:if(!Eg.hasOwnProperty(s))e:{if(s[0]==="o"&&s[1]==="n"&&(u=s.endsWith("Capture"),f=s.slice(2,u?s.length-7:void 0),t=e[Lt]||null,t=t!=null?t[s]:null,typeof t=="function"&&e.removeEventListener(f,t,u),typeof i=="function")){typeof t!="function"&&t!==null&&(s in e?e[s]=null:e.hasAttribute(s)&&e.removeAttribute(s)),e.addEventListener(f,i,u);break e}qe=!0,s in e?e[s]=i:i===!0?e.setAttribute(s,""):Xr(e,s,i)}return}qe=!0}function Ft(e,t,s){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":De("error",e),De("load",e);var i=!1,u=!1,f;for(f in s)if(s.hasOwnProperty(f)){var p=s[f];if(p!=null)switch(f){case"src":i=!0;break;case"srcSet":u=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(o(137,t));default:Je(e,t,f,p,s,null)}}u&&Je(e,t,"srcSet",s.srcSet,s,null),i&&Je(e,t,"src",s.src,s,null);return;case"input":De("invalid",e);var w=f=p=u=null,z=null,q=null;for(i in s)if(s.hasOwnProperty(i)){var X=s[i];if(X!=null)switch(i){case"name":u=X;break;case"type":p=X;break;case"checked":z=X;break;case"defaultChecked":q=X;break;case"value":f=X;break;case"defaultValue":w=X;break;case"children":case"dangerouslySetInnerHTML":if(X!=null)throw Error(o(137,t));break;default:Je(e,t,i,X,s,null)}}zg(e,f,w,z,q,p,u,!1);return;case"select":De("invalid",e),i=p=f=null;for(u in s)if(s.hasOwnProperty(u)&&(w=s[u],w!=null))switch(u){case"value":f=w;break;case"defaultValue":p=w;break;case"multiple":i=w;default:Je(e,t,u,w,s,null)}t=f,s=p,e.multiple=!!i,t!=null?qa(e,!!i,t,!1):s!=null&&qa(e,!!i,s,!0);return;case"textarea":De("invalid",e),f=u=i=null;for(p in s)if(s.hasOwnProperty(p)&&(w=s[p],w!=null))switch(p){case"value":i=w;break;case"defaultValue":u=w;break;case"children":f=w;break;case"dangerouslySetInnerHTML":if(w!=null)throw Error(o(91));break;default:Je(e,t,p,w,s,null)}Lg(e,i,u,f);return;case"option":for(z in s)if(s.hasOwnProperty(z)&&(i=s[z],i!=null))switch(z){case"selected":e.selected=i&&typeof i!="function"&&typeof i!="symbol";break;default:Je(e,t,z,i,s,null)}return;case"dialog":De("beforetoggle",e),De("toggle",e),De("cancel",e),De("close",e);break;case"iframe":case"object":De("load",e);break;case"video":case"audio":for(i=0;i<Jo.length;i++)De(Jo[i],e);break;case"image":De("error",e),De("load",e);break;case"details":De("toggle",e);break;case"embed":case"source":case"link":De("error",e),De("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(q in s)if(s.hasOwnProperty(q)&&(i=s[q],i!=null))switch(q){case"children":case"dangerouslySetInnerHTML":throw Error(o(137,t));default:Je(e,t,q,i,s,null)}return;default:if(ef(t)){for(X in s)s.hasOwnProperty(X)&&(i=s[X],i!==void 0&&Wd(e,t,X,i,s,void 0));return}}for(w in s)s.hasOwnProperty(w)&&(i=s[w],i!=null&&Je(e,t,w,i,s,null))}var zj={};function Dj(e,t,s,i){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var u=null,f=null,p=null,w=null,z=null,q=null,X=null;for(Y in s){var ne=s[Y];if(s.hasOwnProperty(Y)&&ne!=null)switch(Y){case"checked":break;case"value":break;case"defaultValue":z=ne;default:i.hasOwnProperty(Y)||Je(e,t,Y,null,i,ne)}}for(var V in i){var Y=i[V];if(ne=s[V],i.hasOwnProperty(V)&&(Y!=null||ne!=null))switch(V){case"type":Y!==ne&&(qe=!0),f=Y;break;case"name":Y!==ne&&(qe=!0),u=Y;break;case"checked":Y!==ne&&(qe=!0),q=Y;break;case"defaultChecked":Y!==ne&&(qe=!0),X=Y;break;case"value":Y!==ne&&(qe=!0),p=Y;break;case"defaultValue":Y!==ne&&(qe=!0),w=Y;break;case"children":case"dangerouslySetInnerHTML":if(Y!=null)throw Error(o(137,t));break;default:Y!==ne&&Je(e,t,V,Y,i,ne)}}Ju(e,p,w,z,q,X,f,u);return;case"select":Y=p=w=V=null;for(f in s)if(z=s[f],s.hasOwnProperty(f)&&z!=null)switch(f){case"value":break;case"multiple":Y=z;default:i.hasOwnProperty(f)||Je(e,t,f,null,i,z)}for(u in i)if(f=i[u],z=s[u],i.hasOwnProperty(u)&&(f!=null||z!=null))switch(u){case"value":f!==z&&(qe=!0),V=f;break;case"defaultValue":f!==z&&(qe=!0),w=f;break;case"multiple":f!==z&&(qe=!0),p=f;default:f!==z&&Je(e,t,u,f,i,z)}t=w,s=p,i=Y,V!=null?qa(e,!!s,V,!1):!!i!=!!s&&(t!=null?qa(e,!!s,t,!0):qa(e,!!s,s?[]:"",!1));return;case"textarea":Y=V=null;for(w in s)if(u=s[w],s.hasOwnProperty(w)&&u!=null&&!i.hasOwnProperty(w))switch(w){case"value":break;case"children":break;default:Je(e,t,w,null,i,u)}for(p in i)if(u=i[p],f=s[p],i.hasOwnProperty(p)&&(u!=null||f!=null))switch(p){case"value":u!==f&&(qe=!0),V=u;break;case"defaultValue":u!==f&&(qe=!0),Y=u;break;case"children":break;case"dangerouslySetInnerHTML":if(u!=null)throw Error(o(91));break;default:u!==f&&Je(e,t,p,u,i,f)}Dg(e,V,Y);return;case"option":for(var fe in s)if(V=s[fe],s.hasOwnProperty(fe)&&V!=null&&!i.hasOwnProperty(fe))switch(fe){case"selected":e.selected=!1;break;default:Je(e,t,fe,null,i,V)}for(z in i)if(V=i[z],Y=s[z],i.hasOwnProperty(z)&&V!==Y&&(V!=null||Y!=null))switch(z){case"selected":V!==Y&&(qe=!0),e.selected=V&&typeof V!="function"&&typeof V!="symbol";break;default:Je(e,t,z,V,i,Y)}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 ye in s)V=s[ye],s.hasOwnProperty(ye)&&V!=null&&!i.hasOwnProperty(ye)&&Je(e,t,ye,null,i,V);for(q in i)if(V=i[q],Y=s[q],i.hasOwnProperty(q)&&V!==Y&&(V!=null||Y!=null))switch(q){case"children":case"dangerouslySetInnerHTML":if(V!=null)throw Error(o(137,t));break;default:Je(e,t,q,V,i,Y)}return;default:if(ef(t)){for(var Ae in s)V=s[Ae],s.hasOwnProperty(Ae)&&V!==void 0&&!i.hasOwnProperty(Ae)&&Wd(e,t,Ae,void 0,i,V);for(X in i)V=i[X],Y=s[X],!i.hasOwnProperty(X)||V===Y||V===void 0&&Y===void 0||Wd(e,t,X,V,i,Y);return}}for(var G in s)V=s[G],s.hasOwnProperty(G)&&V!=null&&!i.hasOwnProperty(G)&&Je(e,t,G,null,i,V);for(ne in i)V=i[ne],Y=s[ne],!i.hasOwnProperty(ne)||V===Y||V==null&&Y==null||Je(e,t,ne,V,i,Y)}function Gy(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Lj(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,s=performance.getEntriesByType("resource"),i=0;i<s.length;i++){var u=s[i],f=u.transferSize,p=u.initiatorType,w=u.duration;if(f&&w&&Gy(p)){for(p=0,w=u.responseEnd,i+=1;i<s.length;i++){var z=s[i],q=z.startTime;if(q>w)break;var X=z.transferSize,ne=z.initiatorType;X&&Gy(ne)&&(z=z.responseEnd,p+=X*(z<w?1:(w-q)/(z-q)))}if(--i,t+=8*(f+p)/(u.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var eh=null,th=null;function er(e){return e.nodeType===9?e:e.ownerDocument}function qy(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 Iy(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 Qy(e,t,s,i){return s=er(s).createElement(e),s[xt]=i,s[Lt]=t,Ft(s,e,t),Tt(s),s}function nh(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 sh=null;function $j(){var e=window.event;return e&&e.type==="popstate"?e===sh?!1:(sh=e,!0):(sh=null,!1)}var lh=typeof setTimeout=="function"?setTimeout:void 0,kj=typeof clearTimeout=="function"?clearTimeout:void 0,Yy=typeof Promise=="function"?Promise:void 0,Py=typeof requestAnimationFrame=="function"?requestAnimationFrame:lh,Hj=typeof queueMicrotask=="function"?queueMicrotask:typeof Yy<"u"?function(e){return Yy.resolve(null).then(e).catch(Uj)}:lh;function Uj(e){setTimeout(function(){throw e})}function bl(e){return e==="head"}function Xy(e,t){var s=t,i=0;do{var u=s.nextSibling;if(e.removeChild(s),u&&u.nodeType===8)if(s=u.data,s==="/$"||s==="/&"){if(i===0){e.removeChild(u),Ti(t);return}i--}else if(s==="$"||s==="$?"||s==="$~"||s==="$!"||s==="&")i++;else if(s==="html")dh(e.ownerDocument.documentElement);else if(s==="head"){s=e.ownerDocument.head,dh(s);for(var f=s.firstChild;f;){var p=f.nextSibling,w=f.nodeName;f[vo]||w==="SCRIPT"||w==="STYLE"||w==="LINK"&&f.rel.toLowerCase()==="stylesheet"||s.removeChild(f),f=p}}else s==="body"&&dh(e.ownerDocument.body);s=u}while(s);Ti(t)}function Ky(e,t){var s=e;e=0;do{var i=s.nextSibling;if(s.nodeType===1?t?(s._stashedDisplay=s.style.display,s.style.display="none"):(s.style.display=s._stashedDisplay||"",s.getAttribute("style")===""&&s.removeAttribute("style")):s.nodeType===3&&(t?(s._stashedText=s.nodeValue,s.nodeValue=""):s.nodeValue=s._stashedText||""),i&&i.nodeType===8)if(s=i.data,s==="/$"){if(e===0)break;e--}else s!=="$"&&s!=="$?"&&s!=="$~"&&s!=="$!"||e++;s=i}while(s)}function Zy(e,t,s){if(t=CSS.escape(t)!==t?"r-"+btoa(t).replace(/=/g,""):t,e.style.viewTransitionName=t,s!=null&&(e.style.viewTransitionClass=s),s=getComputedStyle(e),s.display==="inline"){if(t=e.getClientRects(),t.length===1)var i=1;else for(var u=i=0;u<t.length;u++){var f=t[u];0<f.width&&0<f.height&&i++}i===1&&(e=e.style,e.display=t.length===1?"inline-block":"block",e.marginTop="-"+s.paddingTop,e.marginBottom="-"+s.paddingBottom)}}function Jy(e,t){e=e.style,t=t.style;var s=t!=null?t.hasOwnProperty("viewTransitionName")?t.viewTransitionName:t.hasOwnProperty("view-transition-name")?t["view-transition-name"]:null:null;e.viewTransitionName=s==null||typeof s=="boolean"?"":(""+s).trim(),s=t!=null?t.hasOwnProperty("viewTransitionClass")?t.viewTransitionClass:t.hasOwnProperty("view-transition-class")?t["view-transition-class"]:null:null,e.viewTransitionClass=s==null||typeof s=="boolean"?"":(""+s).trim(),e.display==="inline-block"&&(t==null?e.display=e.margin="":(s=t.display,e.display=s==null||typeof s=="boolean"?"":s,s=t.margin,s!=null?e.margin=s:(s=t.hasOwnProperty("marginTop")?t.marginTop:t["margin-top"],e.marginTop=s==null||typeof s=="boolean"?"":s,t=t.hasOwnProperty("marginBottom")?t.marginBottom:t["margin-bottom"],e.marginBottom=t==null||typeof t=="boolean"?"":t)))}function Fj(e,t,s){return s=s.ownerDocument.defaultView,{rect:e,abs:t.position==="absolute"||t.position==="fixed",clip:t.clipPath!=="none"||t.overflow!=="visible"||t.filter!=="none"||t.mask!=="none"||t.mask!=="none"||t.borderRadius!=="0px",view:0<=e.bottom&&0<=e.right&&e.top<=s.innerHeight&&e.left<=s.innerWidth}}function ah(e){var t=e.getBoundingClientRect(),s=getComputedStyle(e);return Fj(t,s,e)}function Vj(e){return e.documentElement.clientHeight}function Bj(e){this.addEventListener("load",e),this.addEventListener("error",e)}function Gj(e,t,s,i,u,f,p,w,z){var q=t.nodeType===9?t:t.ownerDocument;try{var X=q.startViewTransition({update:function(){var V=q.defaultView,Y=V.navigation&&V.navigation.transition,fe=q.fonts.status;i();var ye=[];if(fe==="loaded"&&(Vj(q),q.fonts.status==="loading"&&ye.push(q.fonts.ready)),fe=ye.length,e!==null)for(var Ae=e.suspenseyImages,G=0,H=0;H<Ae.length;H++){var Q=Ae[H];if(!Q.complete){var ee=Q.getBoundingClientRect();if(0<ee.bottom&&0<ee.right&&ee.top<V.innerHeight&&ee.left<V.innerWidth){if(G+=xv(Q),G>iu){ye.length=fe;break}Q=new Promise(Bj.bind(Q)),ye.push(Q)}}}if(0<ye.length)return V=Promise.race([Promise.all(ye),new Promise(function(pe){return setTimeout(pe,500)})]).then(u,u),(Y?Promise.allSettled([Y.finished,V]):V).then(f,f);if(u(),Y)return Y.finished.then(f,f);f()},types:s});q.__reactViewTransition=X;var ne=[];return X.ready.then(function(){for(var V=q.documentElement.getAnimations({subtree:!0}),Y=0;Y<V.length;Y++){var fe=V[Y],ye=fe.effect,Ae=ye.pseudoElement;if(Ae!=null&&Ae.startsWith("::view-transition")){ne.push(fe),fe=ye.getKeyframes();for(var G=Ae=void 0,H=!0,Q=0;Q<fe.length;Q++){var ee=fe[Q],pe=ee.width;if(Ae===void 0)Ae=pe;else if(Ae!==pe){H=!1;break}if(pe=ee.height,G===void 0)G=pe;else if(G!==pe){H=!1;break}delete ee.width,delete ee.height,ee.transform==="none"&&delete ee.transform}H&&Ae!==void 0&&G!==void 0&&(ye.setKeyframes(fe),H=getComputedStyle(ye.target,ye.pseudoElement),H.width!==Ae||H.height!==G)&&(H=fe[0],H.width=Ae,H.height=G,H=fe[fe.length-1],H.width=Ae,H.height=G,ye.setKeyframes(fe))}}p()},function(V){q.__reactViewTransition===X&&(q.__reactViewTransition=null);try{if(typeof V=="object"&&V!==null)switch(V.name){case"InvalidStateError":(V.message==="View transition was skipped because document visibility state is hidden."||V.message==="Skipping view transition because document visibility state has become hidden."||V.message==="Skipping view transition because viewport size changed."||V.message==="Transition was aborted because of invalid state")&&(V=null)}V!==null&&z(V)}finally{i(),u(),p()}}),X.finished.finally(function(){for(var V=0;V<ne.length;V++)ne[V].cancel();q.__reactViewTransition===X&&(q.__reactViewTransition=null),w()}),X}catch{return i(),u(),p(),null}}function pa(e,t){this._scope=document.documentElement,this._selector="::view-transition-"+e+"("+t+")"}pa.prototype.animate=function(e,t){return t=typeof t=="number"?{duration:t}:A({},t),t.pseudoElement=this._selector,this._scope.animate(e,t)},pa.prototype.getAnimations=function(){for(var e=this._scope,t=this._selector,s=e.getAnimations({subtree:!0}),i=[],u=0;u<s.length;u++){var f=s[u].effect;f!==null&&f.target===e&&f.pseudoElement===t&&i.push(s[u])}return i},pa.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function Wy(e){return{name:e,group:new pa("group",e),imagePair:new pa("image-pair",e),old:new pa("old",e),new:new pa("new",e)}}function On(e){this._fragmentFiber=e,this._observers=this._eventListeners=null}On.prototype.addEventListener=function(e,t,s){var i=null,u=null;if(!(s!=null&&typeof s!="boolean"&&(i=s.signal||null,i!==null&&i.aborted))){this._eventListeners===null&&(this._eventListeners=[]);var f=this._eventListeners;if(tv(f,e,t,s)===-1){var p=this,w=t;s!=null&&typeof s!="boolean"&&s.once===!0&&(w=function(z){p.removeEventListener(e,t,s),typeof t=="function"?t.call(this,z):t.handleEvent(z)}),i!==null&&(u=p.removeEventListener.bind(p,e,t,s),i.addEventListener("abort",u,{once:!0}),u=i.removeEventListener.bind(i,"abort",u)),i=ji(s),f.push({type:e,listener:t,optionsOrUseCapture:s,attachedListener:w,cleanup:u}),y(this._fragmentFiber.child,!1,qj,e,w,i)}this._eventListeners=f}};function qj(e,t,s,i){return T(e).addEventListener(t,s,i),!1}On.prototype.removeEventListener=function(e,t,s){var i=this._eventListeners;if(i!==null&&(t=tv(i,e,t,s),t!==-1)){var u=i[t];s=u.attachedListener;var f=u.cleanup;u=ji(u.optionsOrUseCapture),y(this._fragmentFiber.child,!1,Ij,e,s,u),i.splice(t,1),f!==null&&f()}};function Ij(e,t,s,i){return T(e).removeEventListener(t,s,i),!1}function ji(e){return e!=null&&typeof e!="boolean"&&(e.once===!0||e.signal instanceof AbortSignal)?{capture:e.capture,passive:e.passive}:e}function ev(e){return e==null?"c=0":typeof e=="boolean"?"c="+(e?"1":"0"):"c="+(e.capture?"1":"0")}function tv(e,t,s,i){if(e.length===0)return-1;i=ev(i);for(var u=0;u<e.length;u++){var f=e[u];if(f.type===t&&f.listener===s&&ev(f.optionsOrUseCapture)===i)return u}return-1}On.prototype.dispatchEvent=function(e){var t=S(this._fragmentFiber);if(t===null)return!0;t=T(t);var s=this._eventListeners;if(s!==null&&0<s.length||!e.bubbles){var i=t.nodeType===9?t.createComment(""):document.createTextNode("");if(s)for(var u=0;u<s.length;u++){var f=s[u];i.addEventListener(f.type,f.attachedListener,ji(f.optionsOrUseCapture))}if(t.appendChild(i),e=i.dispatchEvent(e),s)for(u=0;u<s.length;u++)f=s[u],i.removeEventListener(f.type,f.attachedListener,ji(f.optionsOrUseCapture));return t.removeChild(i),e}return t.dispatchEvent(e)},On.prototype.focus=function(e){y(this._fragmentFiber.child,!0,nv,e,void 0,void 0)};function nv(e,t){return e.tag===6?!1:(e=T(e),s2(e,t))}On.prototype.focusLast=function(e){var t=[];y(this._fragmentFiber.child,!0,ih,t,void 0,void 0);for(var s=t.length-1;0<=s&&!nv(t[s],e);s--);};function ih(e,t){return t.push(e),!1}On.prototype.blur=function(){var e=S(this._fragmentFiber);e!==null&&(e=T(e),e=er(e).activeElement,e!==null&&y(this._fragmentFiber.child,!1,Qj,e,void 0,void 0))};function Qj(e,t){return e.tag===6?!1:(e=T(e),e===t||e.contains(t)?(t.blur(),!0):!1)}On.prototype.observeUsing=function(e){this._observers===null&&(this._observers=new Set),this._observers.add(e),y(this._fragmentFiber.child,!1,Yj,e,void 0,void 0)};function Yj(e,t){return e.tag===6||(e=T(e),t.observe(e)),!1}On.prototype.unobserveUsing=function(e){var t=this._observers;if(t!==null&&t.has(e)){t.delete(e),y(this._fragmentFiber.child,!1,Pj,e,void 0,void 0);for(var s=t=0;s<ns.length;s++){var i=ns[s];i.fragmentInstance===this&&i.observer===e?e.unobserve(i.instance):ns[t++]=i}ns.length=t}};function Pj(e,t){return e.tag===6||(e=T(e),t.unobserve(e)),!1}var ns=[],oh=!1;function Xj(e,t,s){ns.push({fragmentInstance:e,observer:t,instance:s}),oh||(oh=!0,l2(function(){oh=!1;var i=ns;ns=[];for(var u=0;u<i.length;u++){var f=i[u];f.observer.unobserve(f.instance)}}))}On.prototype.getClientRects=function(){var e=[];return y(this._fragmentFiber.child,!1,Kj,e,void 0,void 0),e};function Kj(e,t){if(e.tag===6){e=e.stateNode;var s=e.ownerDocument.createRange();s.selectNodeContents(e),t.push.apply(t,s.getClientRects())}else e=T(e),t.push.apply(t,e.getClientRects());return!1}On.prototype.getRootNode=function(e){var t=S(this._fragmentFiber);return t===null?this:T(t).getRootNode(e)},On.prototype.compareDocumentPosition=function(e){var t=S(this._fragmentFiber);if(t===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var s=[];y(this._fragmentFiber.child,!1,ih,s,void 0,void 0);var i=T(t);if(s.length===0){if(s=i,j(this._fragmentFiber)){e:{for(t=this._fragmentFiber.return;t!==null;){if(t.tag===4){t=t.stateNode.containerInfo;break e}if(t.tag===3||t.tag===5||t.tag===27)break;t=t.return}t=null}t!=null&&(s=t)}t=this._fragmentFiber;var u=i=s.compareDocumentPosition(e);return s===e?u=Node.DOCUMENT_POSITION_CONTAINS:i&Node.DOCUMENT_POSITION_CONTAINED_BY&&(s=b(t)[1],s===null?u=Node.DOCUMENT_POSITION_PRECEDING:(e=T(s).compareDocumentPosition(e),u=e===0||e&Node.DOCUMENT_POSITION_FOLLOWING?Node.DOCUMENT_POSITION_FOLLOWING:Node.DOCUMENT_POSITION_PRECEDING)),u|=Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC}t=T(s[0]),u=T(s[s.length-1]);var f=j(this._fragmentFiber)?t.parentElement:i;if(f==null)return Node.DOCUMENT_POSITION_DISCONNECTED;i=f.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY,f=f.compareDocumentPosition(u)&Node.DOCUMENT_POSITION_CONTAINED_BY;var p=t.compareDocumentPosition(e),w=u.compareDocumentPosition(e),z=p&Node.DOCUMENT_POSITION_CONTAINED_BY||w&Node.DOCUMENT_POSITION_CONTAINED_BY;return w=i&&f&&p&Node.DOCUMENT_POSITION_FOLLOWING&&w&Node.DOCUMENT_POSITION_PRECEDING,t=i&&t===e||f&&u===e||z||w?Node.DOCUMENT_POSITION_CONTAINED_BY:!i&&t===e||!f&&u===e?Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:p,t&Node.DOCUMENT_POSITION_DISCONNECTED||t&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC||Zj(t,this._fragmentFiber,s[0],s[s.length-1],e)?t:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function Zj(e,t,s,i,u){var f=Xl(u);if(e&Node.DOCUMENT_POSITION_CONTAINED_BY){if(s=!!f)e:{for(;f!==null;){if(f.tag===7&&(f===t||f.alternate===t)){s=!0;break e}f=f.return}s=!1}return s}if(e&Node.DOCUMENT_POSITION_CONTAINS){if(f===null)return f=u.ownerDocument,u===f||u===f.documentElement||u===f.body;e:{for(f=t,t=S(t);f!==null;){if(!(f.tag!==5&&f.tag!==3&&f.tag!==27||f!==t&&f.alternate!==t)){f=!0;break e}f=f.return}f=!1}return f}return e&Node.DOCUMENT_POSITION_PRECEDING?((t=!!f)&&!(t=f===s)&&(t=R(s,f,E),t===null?t=!1:(y(t,!0,D,f,s),f=O,O=null,t=f!==null)),t):e&Node.DOCUMENT_POSITION_FOLLOWING?((t=!!f)&&!(t=f===i)&&(t=R(i,f,E),t===null?t=!1:(y(t,!0,C,f,i),f=O,_=O=null,t=f!==null)),t):!1}function sv(e,t){var s=e.ownerDocument.createRange();s.selectNodeContents(e),e=s.getBoundingClientRect(),window.scrollTo(window.scrollX+e.left,t?window.scrollY+e.top:window.scrollY+e.bottom-window.innerHeight)}On.prototype.scrollIntoView=function(e){if(typeof e=="object")throw Error(o(566));var t=[];y(this._fragmentFiber.child,!1,ih,t,void 0,void 0);var s=e!==!1;if(t.length===0){var i=b(this._fragmentFiber);if(i=s?i[1]||i[0]||S(this._fragmentFiber):i[0]||i[1],i===null)return;if(i.tag===6){e=T(i),sv(e,s);return}if(i=T(i),i.nodeType!==9){if(i.nodeType===11){s="host"in i?i.host:null,s!==null&&s.scrollIntoView(e);return}i.scrollIntoView(e)}}for(i=s?t.length-1:0;i!==(s?-1:t.length);){var u=t[i];u.tag===6?(u=T(u),sv(u,s)):T(u).scrollIntoView(e),i+=s?-1:1}};function Jj(e,t){return e=T(e),lv(e,t),!1}function lv(e,t){e.reactFragments==null&&(e.reactFragments=new Set),e.reactFragments.add(t)}function av(e,t){var s=t._eventListeners;if(s!==null)for(var i=0;i<s.length;i++){var u=s[i];e.addEventListener(u.type,u.attachedListener,ji(u.optionsOrUseCapture))}e.nodeType!==3&&(s=t._observers,s!==null&&s.forEach(function(f){for(var p=0,w=0;w<ns.length;w++){var z=ns[w];(z.fragmentInstance!==t||z.observer!==f||z.instance!==e)&&(ns[p++]=z)}ns.length=p,f.observe(e)}),lv(e,t))}function Wj(e,t){var s=t._eventListeners;if(s!==null)for(var i=0;i<s.length;i++){var u=s[i];e.removeEventListener(u.type,u.attachedListener,ji(u.optionsOrUseCapture))}e.nodeType!==3&&(s=t._observers,s!==null&&s.forEach(function(f){typeof f.rootMargin=="string"?Xj(t,f,e):f.unobserve(e)}),e.reactFragments!=null&&e.reactFragments.delete(t))}function rh(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var s=t;switch(t=t.nextSibling,s.nodeName){case"HTML":case"HEAD":case"BODY":rh(s),Pr(s);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(s.rel.toLowerCase()==="stylesheet")continue}e.removeChild(s)}}function e2(e,t,s,i){for(;e.nodeType===1;){var u=s;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!i&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(i){if(!e[vo])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(f=e.getAttribute("rel"),f==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(f!==u.rel||e.getAttribute("href")!==(u.href==null||u.href===""?null:u.href)||e.getAttribute("crossorigin")!==(u.crossOrigin==null?null:u.crossOrigin)||e.getAttribute("title")!==(u.title==null?null:u.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(f=e.getAttribute("src"),(f!==(u.src==null?null:u.src)||e.getAttribute("type")!==(u.type==null?null:u.type)||e.getAttribute("crossorigin")!==(u.crossOrigin==null?null:u.crossOrigin))&&f&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var f=u.name==null?null:""+u.name;if(u.type==="hidden"&&e.getAttribute("name")===f)return e}else return e;if(e=qn(e.nextSibling),e===null)break}return null}function t2(e,t,s){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!s||(e=qn(e.nextSibling),e===null))return null;return e}function iv(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=qn(e.nextSibling),e===null))return null;return e}function ch(e){return e.data==="$?"||e.data==="$~"}function uh(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function n2(e,t){var s=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||s.readyState!=="loading")t();else{var i=function(){t(),s.removeEventListener("DOMContentLoaded",i)};s.addEventListener("DOMContentLoaded",i),e._reactRetry=i}}function qn(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==="$~"||t==="&"||t==="F!"||t==="F")break;if(t==="/$"||t==="/&")return null}}return e}var fh=null;function ov(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var s=e.data;if(s==="/$"||s==="/&"){if(t===0)return qn(e.nextSibling);t--}else s!=="$"&&s!=="$!"&&s!=="$?"&&s!=="$~"&&s!=="&"||t++}e=e.nextSibling}return null}function rv(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var s=e.data;if(s==="$"||s==="$!"||s==="$?"||s==="$~"||s==="&"){if(t===0)return e;t--}else s!=="/$"&&s!=="/&"||t++}e=e.previousSibling}return null}function s2(e,t){function s(){i=!0}if(e.ownerDocument.activeElement===e)return!0;var i=!1;try{e.ownerDocument.addEventListener("focus",s,!0),(e.focus||HTMLElement.prototype.focus).call(e,t)}finally{e.ownerDocument.removeEventListener("focus",s,!0)}return i}function l2(e){Py(function(){Py(function(t){return e(t)})})}function cv(e,t,s){switch(t=er(s),e){case"html":if(e=t.documentElement,!e)throw Error(o(452));return e;case"head":if(e=t.head,!e)throw Error(o(453));return e;case"body":if(e=t.body,!e)throw Error(o(454));return e;default:throw Error(o(451))}}function uv(e,t,s){for(var i in s){var u=s[i];s.hasOwnProperty(i)&&u!=null&&Je(e,t,i,null,zj,u)}s.dangerouslySetInnerHTML!=null&&(e.textContent=""),e.onclick===us&&(e.onclick=null),Pr(e)}function dh(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Pr(e)}var In=new Map,fv=new Set;function tr(e){if(typeof e.getRootNode=="function"){var t=e.getRootNode();if(t.nodeType===9||t.nodeType===11)return t}return e.nodeType===9?e:e.ownerDocument}var Bs=Se.d;Se.d={f:a2,r:i2,D:o2,C:r2,L:c2,m:u2,X:d2,S:f2,M:h2};function a2(){var e=Bs.f(),t=Zc();return e||t}function i2(e){var t=Va(e);t!==null&&t.tag===5&&t.type==="form"?h0(t):Bs.r(e)}var wi=typeof document>"u"?null:document;function dv(e,t,s){var i=wi;if(i&&typeof t=="string"&&t){var u=kn(t);u='link[rel="'+e+'"][href="'+u+'"]',typeof s=="string"&&(u+='[crossorigin="'+s+'"]'),fv.has(u)||(fv.add(u),e={rel:e,crossOrigin:s,href:t},i.querySelector(u)===null&&(t=i.createElement("link"),Ft(t,"link",e),Tt(t),i.head.appendChild(t)))}}function o2(e){Bs.D(e),dv("dns-prefetch",e,null)}function r2(e,t){Bs.C(e,t),dv("preconnect",e,t)}function c2(e,t,s){Bs.L(e,t,s);var i=wi;if(i&&e&&t){var u='link[rel="preload"][as="'+kn(t)+'"]';t==="image"&&s&&s.imageSrcSet?(u+='[imagesrcset="'+kn(s.imageSrcSet)+'"]',typeof s.imageSizes=="string"&&(u+='[imagesizes="'+kn(s.imageSizes)+'"]')):u+='[href="'+kn(e)+'"]';var f=u;switch(t){case"style":f=Ni(e);break;case"script":f=Ci(e)}if(!(In.has(f)||(e=A({rel:"preload",href:t==="image"&&s&&s.imageSrcSet?void 0:e,as:t},s),In.set(f,e),i.querySelector(u)!==null||t==="style"&&i.querySelector(nr(f))||t==="script"&&i.querySelector(sr(f))))){var p=i.createElement("link");Ft(p,"link",e),t==="style"&&(p[Yr]=!0,p.onload=p.onerror=function(){Cg(p)}),Tt(p),i.head.appendChild(p)}}}function u2(e,t){Bs.m(e,t);var s=wi;if(s&&e){var i=t&&typeof t.as=="string"?t.as:"script",u='link[rel="modulepreload"][as="'+kn(i)+'"][href="'+kn(e)+'"]',f=u;switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":f=Ci(e)}if(!In.has(f)&&(e=A({rel:"modulepreload",href:e},t),In.set(f,e),s.querySelector(u)===null)){switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(s.querySelector(sr(f)))return}i=s.createElement("link"),Ft(i,"link",e),Tt(i),s.head.appendChild(i)}}}function f2(e,t,s){Bs.S(e,t,s);var i=wi;if(i&&e){var u=Ba(i).hoistableStyles,f=Ni(e);t=t||"default";var p=u.get(f);if(!p){var w={loading:0,preload:null};if(p=i.querySelector(nr(f)))w.loading=5;else{e=A({rel:"stylesheet",href:e,"data-precedence":t},s),(s=In.get(f))&&hh(e,s);var z=p=i.createElement("link");Tt(z),Ft(z,"link",e),z._p=new Promise(function(q,X){z.onload=q,z.onerror=X}),z.addEventListener("load",function(){w.loading|=1}),z.addEventListener("error",function(){w.loading|=2}),w.loading|=4,lu(p,t,i)}p={type:"stylesheet",instance:p,count:1,state:w},u.set(f,p)}}}function d2(e,t){Bs.X(e,t);var s=wi;if(s&&e){var i=Ba(s).hoistableScripts,u=Ci(e),f=i.get(u);f||(f=s.querySelector(sr(u)),f||(e=A({src:e,async:!0},t),(t=In.get(u))&&mh(e,t),f=s.createElement("script"),Tt(f),Ft(f,"link",e),s.head.appendChild(f)),f={type:"script",instance:f,count:1,state:null},i.set(u,f))}}function h2(e,t){Bs.M(e,t);var s=wi;if(s&&e){var i=Ba(s).hoistableScripts,u=Ci(e),f=i.get(u);f||(f=s.querySelector(sr(u)),f||(e=A({src:e,async:!0,type:"module"},t),(t=In.get(u))&&mh(e,t),f=s.createElement("script"),Tt(f),Ft(f,"link",e),s.head.appendChild(f)),f={type:"script",instance:f,count:1,state:null},i.set(u,f))}}function hv(e,t,s,i){var u=(u=en.current)?tr(u):null;if(!u)throw Error(o(446));switch(e){case"meta":case"title":return null;case"style":return typeof s.precedence=="string"&&typeof s.href=="string"?(s=Ni(s.href),t=Ba(u).hoistableStyles,i=t.get(s),i||(i={type:"style",instance:null,count:0,state:null},t.set(s,i)),i):{type:"void",instance:null,count:0,state:null};case"link":if(s.rel==="stylesheet"&&typeof s.href=="string"&&typeof s.precedence=="string"){e=Ni(s.href);var f=Ba(u).hoistableStyles,p=f.get(e);if(p||(u=u.ownerDocument||u,p={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},f.set(e,p),(f=u.querySelector(nr(e)))?f._p||(p.instance=f,p.state.loading=5):(f=In.get(e),f||(f={rel:"preload",as:"style",href:s.href,crossOrigin:s.crossOrigin,integrity:s.integrity,media:s.media,hrefLang:s.hrefLang,referrerPolicy:s.referrerPolicy},In.set(e,f)),m2(u,e,f,p.state))),t&&i===null)throw Error(o(528,""));return p}if(t&&i!==null)throw Error(o(529,""));return null;case"script":return t=s.async,s=s.src,typeof s=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(s=Ci(s),t=Ba(u).hoistableScripts,i=t.get(s),i||(i={type:"script",instance:null,count:0,state:null},t.set(s,i)),i):{type:"void",instance:null,count:0,state:null};default:throw Error(o(444,e))}}function Ni(e){return'href="'+kn(e)+'"'}function nr(e){return'link[rel="stylesheet"]['+e+"]"}function mv(e){return A({},e,{"data-precedence":e.precedence,precedence:null})}function m2(e,t,s,i){if(t=e.querySelector('link[rel="preload"][as="style"]['+t+"]")){if(t[Yr]!==!0){i.loading=1;return}}else t=e.createElement("link"),t[Yr]=!0,t.onload=t.onerror=Cg.bind(null,t),Ft(t,"link",s),Tt(t),e.head.appendChild(t);i.preload=t,t.addEventListener("load",function(){return i.loading|=1}),t.addEventListener("error",function(){return i.loading|=2})}function Ci(e){return'[src="'+kn(e)+'"]'}function sr(e){return"script[async]"+e}function gv(e,t,s){if(t.count++,t.instance===null)switch(t.type){case"style":var i=e.querySelector('style[data-href~="'+kn(s.href)+'"]');if(i)return t.instance=i,Tt(i),i;var u=A({},s,{"data-href":s.href,"data-precedence":s.precedence,href:null,precedence:null});return i=(e.ownerDocument||e).createElement("style"),Tt(i),Ft(i,"style",u),lu(i,s.precedence,e),t.instance=i;case"stylesheet":u=Ni(s.href);var f=e.querySelector(nr(u));if(f)return t.state.loading|=4,t.instance=f,Tt(f),f;i=mv(s),(u=In.get(u))&&hh(i,u),f=(e.ownerDocument||e).createElement("link"),Tt(f);var p=f;return p._p=new Promise(function(w,z){p.onload=w,p.onerror=z}),Ft(f,"link",i),t.state.loading|=4,lu(f,s.precedence,e),t.instance=f;case"script":return f=Ci(s.src),(u=e.querySelector(sr(f)))?(t.instance=u,Tt(u),u):(i=s,(u=In.get(f))&&(i=A({},s),mh(i,u)),e=e.ownerDocument||e,u=e.createElement("script"),Tt(u),Ft(u,"link",i),e.head.appendChild(u),t.instance=u);case"void":return null;default:throw Error(o(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(i=t.instance,t.state.loading|=4,lu(i,s.precedence,e));return t.instance}function lu(e,t,s){for(var i=s.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),u=i.length?i[i.length-1]:null,f=u,p=0;p<i.length;p++){var w=i[p];if(w.dataset.precedence===t)f=w;else if(f!==u)break}f?f.parentNode.insertBefore(e,f.nextSibling):(t=s.nodeType===9?s.head:s,t.insertBefore(e,t.firstChild))}function hh(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function mh(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var au=null;function pv(e,t,s){if(au===null){var i=new Map,u=au=new Map;u.set(s,i)}else u=au,i=u.get(s),i||(i=new Map,u.set(s,i));if(i.has(e))return i;for(i.set(e,null),s=s.getElementsByTagName(e),u=0;u<s.length;u++){var f=s[u];if(!(f[vo]||f[xt]||e==="link"&&f.getAttribute("rel")==="stylesheet")&&f.namespaceURI!=="http://www.w3.org/2000/svg"){var p=f.getAttribute(t)||"";p=e+p;var w=i.get(p);w?w.push(f):i.set(p,[f])}}return i}function gh(e,t,s){e=e.ownerDocument||e,e.head.insertBefore(s,t==="title"?e.querySelector("head > title"):null)}function g2(e,t,s){if(s===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 yv(e,t){return e==="img"&&t.src!=null&&t.src!==""&&t.onLoad==null&&t.loading!=="lazy"}function vv(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function xv(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio=="number"?devicePixelRatio:1)*.25}function Sv(e,t){typeof t.decode=="function"&&(e.imgCount++,t.complete||(e.imgBytes+=xv(t),e.suspenseyImages.push(t)),e=v2.bind(e),t.decode().then(e,e))}function p2(e,t,s,i){if(s.type==="stylesheet"&&(typeof i.media!="string"||matchMedia(i.media).matches!==!1)&&(s.state.loading&4)===0){if(s.instance===null){var u=Ni(i.href),f=t.querySelector(nr(u));if(f){t=f._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=lr.bind(e),t.then(e,e)),s.state.loading|=4,s.instance=f,Tt(f);return}f=t.ownerDocument||t,i=mv(i),(u=In.get(u))&&hh(i,u),f=f.createElement("link"),Tt(f);var p=f;p._p=new Promise(function(w,z){p.onload=w,p.onerror=z}),Ft(f,"link",i),s.instance=f}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(s,t),(t=s.state.preload)&&(s.state.loading&3)===0&&(e.count++,s=lr.bind(e),t.addEventListener("load",s),t.addEventListener("error",s))}}var iu=0;function y2(e,t){return e.stylesheets&&e.count===0&&ru(e,e.stylesheets),0<e.count||0<e.imgCount?function(s){var i=setTimeout(function(){if(e.stylesheets&&ru(e,e.stylesheets),e.unsuspend){var f=e.unsuspend;e.unsuspend=null,f()}},6e4+t);0<e.imgBytes&&iu===0&&(iu=62500*Lj());var u=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&ru(e,e.stylesheets),e.unsuspend)){var f=e.unsuspend;e.unsuspend=null,f()}},(e.imgBytes>iu?50:800)+t);return e.unsuspend=s,function(){e.unsuspend=null,clearTimeout(i),clearTimeout(u)}}:null}function bv(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)ru(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}}function lr(){this.count--,bv(this)}function v2(){this.imgCount--,bv(this)}var ou=null;function ru(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,ou=new Map,t.forEach(x2,e),ou=null,lr.call(e))}function x2(e,t){if(!(t.state.loading&4)){var s=ou.get(e);if(s)var i=s.get(null);else{s=new Map,ou.set(e,s);for(var u=e.querySelectorAll("link[data-precedence],style[data-precedence]"),f=0;f<u.length;f++){var p=u[f];(p.nodeName==="LINK"||p.getAttribute("media")!=="not all")&&(s.set(p.dataset.precedence,p),i=p)}i&&s.set(null,i)}u=t.instance,p=u.getAttribute("data-precedence"),f=s.get(p)||i,f===i&&s.set(null,u),s.set(p,u),this.count++,i=lr.bind(this),u.addEventListener("load",i),u.addEventListener("error",i),f?f.parentNode.insertBefore(u,f.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(u,e.firstChild)),t.state.loading|=4}}var Mi={$$typeof:le,Provider:null,Consumer:null,_currentValue:ct,_currentValue2:ct,_threadCount:0};function S2(e,t,s,i,u,f,p,w,z){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=Ha(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ha(0),this.hiddenUpdates=Ha(null),this.identifierPrefix=i,this.onUncaughtError=u,this.onCaughtError=f,this.onRecoverableError=p,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=z,this.transitionTypes=null,this.incompleteTransitions=new Map}function jv(e,t,s,i,u,f,p,w,z,q,X,ne){return e=new S2(e,t,s,p,z,q,X,ne,w),t=1,f===!0&&(t|=24),f=mn(3,null,null,t),e.current=f,f.stateNode=e,t=Rf(),t.refCount++,e.pooledCache=t,t.refCount++,f.memoizedState={element:i,isDehydrated:s,cache:t},Df(f),e}function wv(e){return e?(e=Ja,e):Ja}function Nv(e,t,s,i,u,f){u=wv(u),i.context===null?i.context=u:i.pendingContext=u,i=cl(t),i.payload={element:s},f=f===void 0?null:f,f!==null&&(i.callback=f),s=ul(e,i,t),s!==null&&(vn(s,e,t),Lo(s,e,t))}function Cv(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var s=e.retryLane;e.retryLane=s!==0&&s<t?s:t}}function ph(e,t){Cv(e,t),(e=e.alternate)&&Cv(e,t)}function Mv(e){if(e.tag===13||e.tag===31){var t=Wl(e,67108864);t!==null&&vn(t,e,67108864),ph(e,67108864)}}function Ev(e){if(e.tag===13||e.tag===31){var t=An();t=go(t);var s=Wl(e,t);s!==null&&vn(s,e,t),ph(e,t)}}var Ei=!0;function b2(e,t,s,i){var u=me.T;me.T=null;var f=Se.p;try{Se.p=2,yh(e,t,s,i)}finally{Se.p=f,me.T=u}}function j2(e,t,s,i){var u=me.T;me.T=null;var f=Se.p;try{Se.p=8,yh(e,t,s,i)}finally{Se.p=f,me.T=u}}function yh(e,t,s,i){if(Ei){var u=vh(i);if(u===null)Jd(e,t,i,cu,s),_v(e,i);else if(N2(u,e,t,s,i))i.stopPropagation();else if(_v(e,i),t&4&&-1<w2.indexOf(e)){for(;u!==null;){var f=Va(u);if(f!==null)switch(f.tag){case 3:if(f=f.stateNode,f.current.memoizedState.isDehydrated){var p=cs(f.pendingLanes);if(p!==0){var w=f;for(w.pendingLanes|=2,w.entangledLanes|=2;p;){var z=1<<31-Yt(p);w.entanglements[1]|=z,p&=~z}Ss(f),(Qe&6)===0&&(Pc=et()+500,Zo(0))}}break;case 31:case 13:w=Wl(f,2),w!==null&&vn(w,f,2),Zc(),ph(f,2)}if(f=vh(i),f===null&&Jd(e,t,i,cu,s),f===u)break;u=f}u!==null&&i.stopPropagation()}else Jd(e,t,i,null,s)}}function vh(e){return e=nf(e),xh(e)}var cu=null;function xh(e){if(cu=null,e=Xl(e),e!==null){var t=d(e);if(t===null)e=null;else{var s=t.tag;if(s===13){if(e=h(t),e!==null)return e;e=null}else if(s===31){if(e=m(t),e!==null)return e;e=null}else if(s===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return cu=e,null}function Tv(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"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"fullscreenerror":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"resize":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(hn()){case Nn:return 2;case ql:return 8;case ka:case fo:return 32;case tn:return 268435456;default:return 32}default:return 32}}var Sh=!1,jl=null,wl=null,Nl=null,ar=new Map,ir=new Map,Cl=[],w2="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 _v(e,t){switch(e){case"focusin":case"focusout":jl=null;break;case"dragenter":case"dragleave":wl=null;break;case"mouseover":case"mouseout":Nl=null;break;case"pointerover":case"pointerout":ar.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":ir.delete(t.pointerId)}}function or(e,t,s,i,u,f){return e===null||e.nativeEvent!==f?(e={blockedOn:t,domEventName:s,eventSystemFlags:i,nativeEvent:f,targetContainers:[u]},t!==null&&(t=Va(t),t!==null&&Mv(t)),e):(e.eventSystemFlags|=i,t=e.targetContainers,u!==null&&t.indexOf(u)===-1&&t.push(u),e)}function N2(e,t,s,i,u){switch(t){case"focusin":return jl=or(jl,e,t,s,i,u),!0;case"dragenter":return wl=or(wl,e,t,s,i,u),!0;case"mouseover":return Nl=or(Nl,e,t,s,i,u),!0;case"pointerover":var f=u.pointerId;return ar.set(f,or(ar.get(f)||null,e,t,s,i,u)),!0;case"gotpointercapture":return f=u.pointerId,ir.set(f,or(ir.get(f)||null,e,t,s,i,u)),!0}return!1}function Rv(e){var t=Xl(e.target);if(t!==null){var s=d(t);if(s!==null){if(t=s.tag,t===13){if(t=h(s),t!==null){e.blockedOn=t,Kn(e.priority,function(){Ev(s)});return}}else if(t===31){if(t=m(s),t!==null){e.blockedOn=t,Kn(e.priority,function(){Ev(s)});return}}else if(t===3&&s.stateNode.current.memoizedState.isDehydrated){e.blockedOn=s.tag===3?s.stateNode.containerInfo:null;return}}}e.blockedOn=null}function uu(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var s=vh(e.nativeEvent);if(s===null){s=e.nativeEvent;var i=new s.constructor(s.type,s);tf=i,s.target.dispatchEvent(i),tf=null}else return t=Va(s),t!==null&&Mv(t),e.blockedOn=s,!1;t.shift()}return!0}function Av(e,t,s){uu(e)&&s.delete(t)}function C2(){Sh=!1,jl!==null&&uu(jl)&&(jl=null),wl!==null&&uu(wl)&&(wl=null),Nl!==null&&uu(Nl)&&(Nl=null),ar.forEach(Av),ir.forEach(Av)}function fu(e,t){e.blockedOn===t&&(e.blockedOn=null,Sh||(Sh=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,C2)))}var du=null;function Ov(e){du!==e&&(du=e,n.unstable_scheduleCallback(n.unstable_NormalPriority,function(){du===e&&(du=null);for(var t=0;t<e.length;t+=3){var s=e[t],i=e[t+1],u=e[t+2];if(typeof i!="function"){if(xh(i||s)===null)continue;break}var f=Va(s);f!==null&&(e.splice(t,3),t-=3,td(f,{pending:!0,data:u,method:s.method,action:i},i,u))}}))}function Ti(e){function t(z){return fu(z,e)}jl!==null&&fu(jl,e),wl!==null&&fu(wl,e),Nl!==null&&fu(Nl,e),ar.forEach(t),ir.forEach(t);for(var s=0;s<Cl.length;s++){var i=Cl[s];i.blockedOn===e&&(i.blockedOn=null)}for(;0<Cl.length&&(s=Cl[0],s.blockedOn===null);)Rv(s),s.blockedOn===null&&Cl.shift();if(s=(e.ownerDocument||e).$$reactFormReplay,s!=null)for(i=0;i<s.length;i+=3){var u=s[i],f=s[i+1],p=u[Lt]||null;if(typeof f=="function")p||Ov(s);else if(p){var w=null;if(f&&f.hasAttribute("formAction")){if(u=f,p=f[Lt]||null)w=p.formAction;else if(xh(u)!==null)continue}else w=p.action;typeof w=="function"?s[i+1]=w:(s.splice(i,3),i-=3),Ov(s)}}}function zv(){function e(f){f.canIntercept&&f.info==="react-transition"&&f.intercept({handler:function(){return new Promise(function(p){return u=p})},focusReset:"manual",scroll:"manual"})}function t(){u!==null&&(u(),u=null),i||setTimeout(s,20)}function s(){if(!i&&!navigation.transition){var f=navigation.currentEntry;f&&f.url!=null&&navigation.navigate(f.url,{state:f.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var i=!1,u=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(s,100),function(){i=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),u!==null&&(u(),u=null)}}}function bh(e){this._internalRoot=e}hu.prototype.render=bh.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(o(409));var s=t.current,i=An();Nv(s,i,e,t,null,null)},hu.prototype.unmount=bh.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Nv(e.current,2,null,e,null,null),Zc(),t[el]=null}};function hu(e){this._internalRoot=e}hu.prototype.unstable_scheduleHydration=function(e){if(e){var t=Fa();e={blockedOn:null,target:e,priority:t};for(var s=0;s<Cl.length&&t!==0&&t<Cl[s].priority;s++);Cl.splice(s,0,e),s===0&&Rv(e)}};var Dv=l.version;if(Dv!=="19.3.1")throw Error(o(527,Dv,"19.3.1"));Se.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(o(188)):(e=Object.keys(e).join(","),Error(o(268,e)));return e=x(t),e=e!==null?v(e):null,e=e===null?null:e.stateNode,e};var M2={bundleType:0,version:"19.3.1",rendererPackageName:"react-dom",currentDispatcherRef:me,reconcilerVersion:"19.3.1"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var mu=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!mu.isDisabled&&mu.supportsFiber)try{Zs=mu.inject(M2),Qt=mu}catch{}}return cr.createRoot=function(e,t){if(!c(e))throw Error(o(299));var s=!1,i="",u=w0,f=N0,p=C0;return t!=null&&(t.unstable_strictMode===!0&&(s=!0),t.identifierPrefix!==void 0&&(i=t.identifierPrefix),t.onUncaughtError!==void 0&&(u=t.onUncaughtError),t.onCaughtError!==void 0&&(f=t.onCaughtError),t.onRecoverableError!==void 0&&(p=t.onRecoverableError)),t=jv(e,1,!1,null,null,s,i,null,u,f,p,zv),e[el]=t.current,Zd(e),new bh(t)},cr.hydrateRoot=function(e,t,s){if(!c(e))throw Error(o(299));var i=!1,u="",f=w0,p=N0,w=C0,z=null;return s!=null&&(s.unstable_strictMode===!0&&(i=!0),s.identifierPrefix!==void 0&&(u=s.identifierPrefix),s.onUncaughtError!==void 0&&(f=s.onUncaughtError),s.onCaughtError!==void 0&&(p=s.onCaughtError),s.onRecoverableError!==void 0&&(w=s.onRecoverableError),s.formState!==void 0&&(z=s.formState)),t=jv(e,1,!0,t,s??null,i,u,z,f,p,w,zv),t.context=wv(null),s=t.current,i=An(),i=go(i),u=cl(i),u.callback=null,ul(s,u,i),s=i,t.current.lanes=s,Ws(t,s),Ss(t),e[el]=t.current,Zd(e),new hu(t)},cr.version="19.3.1",cr}var Iv;function U2(){if(Iv)return Ch.exports;Iv=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(l){console.error(l)}}return n(),Ch.exports=H2(),Ch.exports}var F2=U2();const h1=M.createContext(void 0),m1=n=>{const l=M.useContext(h1);if(!l)throw new Error("No QueryClient set, use QueryClientProvider to set one");return l},V2=({client:n,children:l})=>(M.useEffect(()=>(n.mount(),()=>{n.unmount()}),[n]),r.jsx(h1.Provider,{value:n,children:l})),B2={setTimeout:(n,l)=>setTimeout(n,l),clearTimeout:n=>clearTimeout(n),setInterval:(n,l)=>setInterval(n,l),clearInterval:n=>clearInterval(n)};var Al,tg,n1,G2=(n1=class{constructor(){Ne(this,Al,B2);Ne(this,tg,!1)}setTimeoutProvider(n){he(this,Al,n)}setTimeout(n,l){return F(this,Al).setTimeout(n,l)}clearTimeout(n){F(this,Al).clearTimeout(n)}setInterval(n,l){return F(this,Al).setInterval(n,l)}clearInterval(n){F(this,Al).clearInterval(n)}},Al=new WeakMap,tg=new WeakMap,n1);const ja=new G2;function q2(n){setTimeout(n,0)}const I2=typeof window>"u"||"Deno"in globalThis;function Sn(){}function Q2(n,l){return typeof n=="function"?n(l):n}function g1(n){return typeof n=="number"&&n>=0&&n!==1/0}function p1(n,l){return Math.max(n+(l||0)-Date.now(),0)}function rt(n,l){return typeof n=="function"?n(l):n}function Qv(n,l){const{type:a="all",exact:o,fetchStatus:c,predicate:d,queryKey:h,stale:m}=n;if(h){if(o){if(l.queryHash!==sg(h,l.options))return!1}else if(!oo(l.queryKey,h))return!1}if(a!=="all"){const g=l.isActive();if(a==="active"&&!g||a==="inactive"&&g)return!1}return!(typeof m=="boolean"&&l.isStale()!==m||c&&c!==l.state.fetchStatus||d&&!d(l))}function Yv(n,l){const{exact:a,status:o,predicate:c,mutationKey:d}=n;if(d){if(!l.options.mutationKey)return!1;if(a){if(Er(l.options.mutationKey)!==Er(d))return!1}else if(!oo(l.options.mutationKey,d))return!1}return!(o&&l.state.status!==o||c&&!c(l))}function sg(n,l){return((l==null?void 0:l.queryKeyHashFn)||Er)(n)}function Er(n){return JSON.stringify(n,(l,a)=>vm(a)?Object.keys(a).sort().reduce((o,c)=>(o[c]=a[c],o),{}):a)}function oo(n,l){if(n===l)return!0;if(typeof n!=typeof l)return!1;if(n&&l&&typeof n=="object"&&typeof l=="object"){if(Array.isArray(n)&&Array.isArray(l)){if(l.length>n.length)return!1;for(let o=0;o<l.length;o++)if(!oo(n[o],l[o]))return!1;return!0}const a=Object.keys(l);for(const o of a)if(!oo(n[o],l[o]))return!1;return!0}return!1}const Y2=Object.prototype.hasOwnProperty;function y1(n,l,a=0){if(n===l)return n;if(a>500)return l;const o=Pv(n)&&Pv(l);if(!o&&!(vm(n)&&vm(l)))return l;const c=(o?n:Object.keys(n)).length,d=o?l:Object.keys(l),h=d.length,m=o?new Array(h):{};let g=0;for(let x=0;x<h;x++){const v=o?x:d[x],y=n[v],S=l[v];if(y===S){m[v]=y,(o?x<c:Y2.call(n,v))&&g++;continue}if(y===null||S===null||typeof y!="object"||typeof S!="object"){m[v]=S;continue}const j=y1(y,S,a+1);m[v]=j,j===y&&g++}return c===h&&g===c?n:m}function _h(n,l){if(!l||Object.keys(n).length!==Object.keys(l).length)return!1;for(const a in n)if(n[a]!==l[a])return!1;return!0}function Pv(n){return Array.isArray(n)&&n.length===Object.keys(n).length}function vm(n){if(!Xv(n))return!1;const l=Object.getPrototypeOf(n),a=l==null?void 0:l.constructor;if(a===void 0)return!0;if(typeof a!="function")return!1;const o=a.prototype;return!(!Xv(o)||!o.hasOwnProperty("isPrototypeOf")||l!==Object.prototype)}function Xv(n){return Object.prototype.toString.call(n)==="[object Object]"}function P2(n){return new Promise(l=>{ja.setTimeout(l,n)})}function xm(n,l,a){return typeof a.structuralSharing=="function"?a.structuralSharing(n,l):a.structuralSharing!==!1?y1(n,l):l}function lg(n){return n}function X2(n,l,a=0){const o=[...n,l];return a&&o.length>a?o.slice(1):o}function K2(n,l,a=0){const o=[l,...n];return a&&o.length>a?o.slice(0,-1):o}const ag=Symbol();function v1(n,l){return!n.queryFn&&(l!=null&&l.initialPromise)?()=>l.initialPromise:!n.queryFn||n.queryFn===ag?()=>Promise.reject(new Error(`Missing queryFn: '${n.queryHash}'`)):n.queryFn}function x1(n,l){return typeof n=="function"?n(...l):!!n}function Z2(n,l,a){let o=!1,c;return Object.defineProperty(n,"signal",{enumerable:!0,get:()=>(c??(c=l()),o||(o=!0,c.aborted?a():c.addEventListener("abort",a,{once:!0})),c)}),n}let J2=()=>I2;const ig=()=>J2();var Hr=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(n){return this.listeners.add(n),this.onSubscribe(),()=>{this.listeners.delete(n),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Na,Ol,Pi,s1,W2=(s1=class extends Hr{constructor(){super();Ne(this,Na);Ne(this,Ol);Ne(this,Pi);he(this,Pi,l=>{if(typeof window<"u"&&window.addEventListener){const a=()=>l();return window.addEventListener("visibilitychange",a,!1),()=>{window.removeEventListener("visibilitychange",a)}}})}onSubscribe(){F(this,Ol)||this.setEventListener(F(this,Pi))}onUnsubscribe(){var l;this.hasListeners()||((l=F(this,Ol))==null||l.call(this),he(this,Ol,void 0))}setEventListener(l){var a;he(this,Pi,l),(a=F(this,Ol))==null||a.call(this),he(this,Ol,l(o=>{typeof o=="boolean"?this.setFocused(o):this.onFocus()}))}setFocused(l){F(this,Na)!==l&&(he(this,Na,l),this.onFocus())}onFocus(){const l=this.isFocused();this.listeners.forEach(a=>{a(l)})}isFocused(){var l;return typeof F(this,Na)=="boolean"?F(this,Na):((l=globalThis.document)==null?void 0:l.visibilityState)!=="hidden"}},Na=new WeakMap,Ol=new WeakMap,Pi=new WeakMap,s1);const og=new W2,ew=q2;function tw(){let n=[],l=0,a=m=>{m()},o=m=>{m()},c=ew;const d=m=>{l?n.push(m):c(()=>{a(m)})},h=()=>{const m=n;n=[],m.length&&c(()=>{o(()=>{m.forEach(g=>{a(g)})})})};return{batch:m=>{let g;l++;try{g=m()}finally{l--,l||h()}return g},batchCalls:m=>(...g)=>{d(()=>{m(...g)})},schedule:d,setNotifyFunction:m=>{a=m},setBatchNotifyFunction:m=>{o=m},setScheduler:m=>{c=m}}}const Bt=tw();var Xi,zl,Ki,l1,nw=(l1=class extends Hr{constructor(){super();Ne(this,Xi,!0);Ne(this,zl);Ne(this,Ki);he(this,Ki,l=>{if(typeof window<"u"&&window.addEventListener){const a=()=>l(!0),o=()=>l(!1);return window.addEventListener("online",a,!1),window.addEventListener("offline",o,!1),()=>{window.removeEventListener("online",a),window.removeEventListener("offline",o)}}})}onSubscribe(){F(this,zl)||this.setEventListener(F(this,Ki))}onUnsubscribe(){var l;this.hasListeners()||((l=F(this,zl))==null||l.call(this),he(this,zl,void 0))}setEventListener(l){var a;he(this,Ki,l),(a=F(this,zl))==null||a.call(this),he(this,zl,l(this.setOnline.bind(this)))}setOnline(l){F(this,Xi)!==l&&(he(this,Xi,l),this.listeners.forEach(a=>{a(l)}))}isOnline(){return F(this,Xi)}},Xi=new WeakMap,zl=new WeakMap,Ki=new WeakMap,l1);const Eu=new nw;function sw(n){return Math.min(1e3*2**n,3e4)}function S1(n){return(n??"online")==="online"?Eu.isOnline():!0}var Sm=class extends Error{constructor(n){super("CancelledError"),this.revert=n==null?void 0:n.revert,this.silent=n==null?void 0:n.silent}};function b1(n){let l=!1,a=0,o,c="pending",d,h;const m=new Promise((_,D)=>{d=_,h=D});m.catch(Sn);const g=()=>c!=="pending",x=_=>{var D;if(!g()){const C=new Sm(_);N(C),(D=n.onCancel)==null||D.call(n,C)}},v=()=>{l=!0},y=()=>{l=!1},S=()=>og.isFocused()&&(n.networkMode==="always"||Eu.isOnline())&&n.canRun(),j=()=>S1(n.networkMode)&&n.canRun(),b=_=>{g()||(o==null||o(),c="resolved",d(_))},N=_=>{g()||(o==null||o(),c="rejected",h(_))},T=_=>new Promise(D=>{var C;o=E=>{(g()||_())&&D(E)},(C=n.onPause)==null||C.call(n)}).then(()=>{var D;o=void 0,g()||(D=n.onContinue)==null||D.call(n)}),O=()=>{if(g())return;let _;const D=a===0?n.initialPromise:void 0;try{_=D??n.fn()}catch(C){_=Promise.reject(C)}Promise.resolve(_).then(b).catch(C=>{var K;if(g())return;const E=n.retry??(ig()?0:3),R=n.retryDelay??sw,A=typeof R=="function"?R(a,C):R,B=E===!0||typeof E=="number"&&a<E||typeof E=="function"&&E(a,C);if(l||!B){N(C);return}a++,(K=n.onFail)==null||K.call(n,a,C),P2(A).then(()=>S()?void 0:T(S)).then(()=>{l?N(C):O()})})};return{promise:m,status:()=>c,cancel:x,continue:()=>(o==null||o(),m),cancelRetry:v,continueRetry:y,canStart:j,start:()=>(j()?O():T(j).then(O),m)}}var Ca,a1,j1=(a1=class{constructor(){Ne(this,Ca)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),g1(this.gcTime)&&he(this,Ca,ja.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(n){this.gcTime=Math.max(this.gcTime||0,n??(ig()?1/0:3e5))}clearGcTimeout(){F(this,Ca)!==void 0&&(ja.clearTimeout(F(this,Ca)),he(this,Ca,void 0))}},Ca=new WeakMap,a1);function lw(n){return{onFetch:(l,a)=>{var v,y,S,j,b;const o=l.options,c=(S=(y=(v=l.fetchOptions)==null?void 0:v.meta)==null?void 0:y.fetchMore)==null?void 0:S.direction,d=((j=l.state.data)==null?void 0:j.pages)||[],h=((b=l.state.data)==null?void 0:b.pageParams)||[];let m={pages:[],pageParams:[]},g=0;const x=async()=>{let N=!1;const T=D=>{Z2(D,()=>l.signal,()=>N=!0)},O=v1(l.options,l.fetchOptions),_=async(D,C,E)=>{if(N)return Promise.reject(l.signal.reason);if(C==null&&D.pages.length)return Promise.resolve(D);const A=(()=>{const ie={client:l.client,queryKey:l.queryKey,pageParam:C,direction:E?"backward":"forward",meta:l.options.meta};return T(ie),ie})(),B=await O(A),{maxPages:K}=l.options,k=E?K2:X2;return{pages:k(D.pages,B,K),pageParams:k(D.pageParams,C,K)}};if(c&&d.length){const D=c==="backward",C=D?w1:bm,E={pages:d,pageParams:h};m=await _(E,C(o,E),D)}else{const D=n??d.length;do{const C=g===0?h[0]===void 0?o.initialPageParam:h[0]:bm(o,m);if(g>0&&C==null)break;m=await _(m,C),g++}while(g<D)}return m};l.options.persister?l.fetchFn=()=>{var N,T;return(T=(N=l.options).persister)==null?void 0:T.call(N,x,{client:l.client,queryKey:l.queryKey,meta:l.options.meta,signal:l.signal},a)}:l.fetchFn=x}}}function bm(n,{pages:l,pageParams:a}){const o=l.length-1;return l.length>0?n.getNextPageParam(l[o],l,a[o],a):void 0}function w1(n,{pages:l,pageParams:a}){var o;return l.length>0?(o=n.getPreviousPageParam)==null?void 0:o.call(n,l[0],l,a[0],a):void 0}function aw(n,l){return l?bm(n,l)!=null:!1}function iw(n,l){return!l||!n.getPreviousPageParam?!1:w1(n,l)!=null}var Zi,Ma,Ji,Qn,Ea,Et,zr,Ta,ss,Qs,i1,ow=(i1=class extends j1{constructor(l){super();Ne(this,ss);Ne(this,Zi);Ne(this,Ma);Ne(this,Ji);Ne(this,Qn);Ne(this,Ea);Ne(this,Et);Ne(this,zr);Ne(this,Ta);he(this,Ta,!1),he(this,zr,l.defaultOptions),this.setOptions(l.options),this.observers=[],he(this,Ea,l.client),he(this,Qn,F(this,Ea).getQueryCache()),this.queryKey=l.queryKey,this.queryHash=l.queryHash,he(this,Ma,Zv(this.options)),this.state=l.state??F(this,Ma),this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return F(this,Zi)}get promise(){var l;return(l=F(this,Et))==null?void 0:l.promise}setOptions(l){if(this.options={...F(this,zr),...l},l!=null&&l._type&&he(this,Zi,l._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const a=Zv(this.options);a.data!==void 0&&(this.setState(Kv(a.data,a.dataUpdatedAt)),he(this,Ma,a))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&F(this,Qn).remove(this)}setData(l,a){const o=xm(this.state.data,l,this.options);return ke(this,ss,Qs).call(this,{data:o,type:"success",dataUpdatedAt:a==null?void 0:a.updatedAt,manual:a==null?void 0:a.manual}),o}setState(l){ke(this,ss,Qs).call(this,{type:"setState",state:l})}cancel(l){var o,c;const a=(o=F(this,Et))==null?void 0:o.promise;return(c=F(this,Et))==null||c.cancel(l),a?a.then(Sn).catch(Sn):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return F(this,Ma)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(l=>rt(l.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===ag||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(l=>rt(l.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(l=>l.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(l=0){return this.state.data===void 0?!0:l==="static"?!1:this.state.isInvalidated?!0:!p1(this.state.dataUpdatedAt,l)}onFocus(){var l,a;(l=this.observers.find(o=>o.shouldFetchOnWindowFocus()))==null||l.refetch({cancelRefetch:!1}),(a=F(this,Et))==null||a.continue()}onOnline(){var l,a;(l=this.observers.find(o=>o.shouldFetchOnReconnect()))==null||l.refetch({cancelRefetch:!1}),(a=F(this,Et))==null||a.continue()}addObserver(l){this.observers.includes(l)||(this.observers.push(l),this.clearGcTimeout(),F(this,Qn).notify({type:"observerAdded",query:this,observer:l}))}removeObserver(l){const a=this.observers.indexOf(l);a!==-1&&(this.observers.splice(a,1),this.observers.length||(F(this,Et)&&(F(this,Ta)||this.state.fetchStatus==="paused"&&this.state.status==="pending"?F(this,Et).cancel({revert:!0}):F(this,Et).cancelRetry()),this.scheduleGc()),F(this,Qn).notify({type:"observerRemoved",query:this,observer:l}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||ke(this,ss,Qs).call(this,{type:"invalidate"})}async fetch(l,a){var x,v,y,S,j,b,N,T,O,_,D,C;if(this.state.fetchStatus!=="idle"&&((x=F(this,Et))==null?void 0:x.status())!=="rejected"){if(this.state.data!==void 0&&(a!=null&&a.cancelRefetch))this.cancel({silent:!0});else if(F(this,Et))return F(this,Et).continueRetry(),F(this,Et).promise}if(l&&this.setOptions(l),!this.options.queryFn){const E=this.observers.find(R=>R.options.queryFn);E&&this.setOptions(E.options)}const o=new AbortController,c=E=>{Object.defineProperty(E,"signal",{enumerable:!0,get:()=>(he(this,Ta,!0),o.signal)})},d=()=>{const E=v1(this.options,a),A=(()=>{const B={client:F(this,Ea),queryKey:this.queryKey,meta:this.meta};return c(B),B})();return he(this,Ta,!1),this.options.persister?this.options.persister(E,A,this):E(A)},m=(()=>{const E={fetchOptions:a,options:this.options,queryKey:this.queryKey,client:F(this,Ea),state:this.state,fetchFn:d};return c(E),E})();(v=F(this,Zi)==="infinite"?lw(this.options.pages):this.options.behavior)==null||v.onFetch(m,this),he(this,Ji,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((y=m.fetchOptions)==null?void 0:y.meta))&&ke(this,ss,Qs).call(this,{type:"fetch",meta:(S=m.fetchOptions)==null?void 0:S.meta});const g=he(this,Et,b1({initialPromise:a==null?void 0:a.initialPromise,fn:m.fetchFn,onCancel:E=>{E instanceof Sm&&E.revert&&this.setState({...F(this,Ji),fetchStatus:"idle"}),o.abort()},onFail:(E,R)=>{ke(this,ss,Qs).call(this,{type:"failed",failureCount:E,error:R})},onPause:()=>{ke(this,ss,Qs).call(this,{type:"pause"})},onContinue:()=>{ke(this,ss,Qs).call(this,{type:"continue"})},retry:m.options.retry,retryDelay:m.options.retryDelay,networkMode:m.options.networkMode,canRun:()=>!0}));try{const E=await g.start();if(E===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(E),(b=(j=F(this,Qn).config).onSuccess)==null||b.call(j,E,this),(T=(N=F(this,Qn).config).onSettled)==null||T.call(N,E,this.state.error,this),E}catch(E){if(E instanceof Sm){if(E.silent)return F(this,Et).promise;if(E.revert){if(this.state.data===void 0)throw E;return this.state.data}}throw ke(this,ss,Qs).call(this,{type:"error",error:E}),(_=(O=F(this,Qn).config).onError)==null||_.call(O,E,this),(C=(D=F(this,Qn).config).onSettled)==null||C.call(D,this.state.data,E,this),E}finally{F(this,Et)===g&&he(this,Et,void 0),this.scheduleGc()}}},Zi=new WeakMap,Ma=new WeakMap,Ji=new WeakMap,Qn=new WeakMap,Ea=new WeakMap,Et=new WeakMap,zr=new WeakMap,Ta=new WeakMap,ss=new WeakSet,Qs=function(l){const a=o=>{switch(l.type){case"failed":return{...o,fetchFailureCount:l.failureCount,fetchFailureReason:l.error};case"pause":return{...o,fetchStatus:"paused"};case"continue":return{...o,fetchStatus:"fetching"};case"fetch":return{...o,...N1(o.data,this.options),fetchMeta:l.meta??null};case"success":const c={...o,...Kv(l.data,l.dataUpdatedAt),dataUpdateCount:o.dataUpdateCount+1,...!l.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return he(this,Ji,l.manual?c:void 0),c;case"error":const d=l.error;return{...o,error:d,errorUpdateCount:o.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:o.fetchFailureCount+1,fetchFailureReason:d,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...o,isInvalidated:!0};case"setState":return{...o,...l.state}}};this.state=a(this.state),Bt.batch(()=>{this.observers.slice().forEach(o=>{o.onQueryUpdate()}),F(this,Qn).notify({query:this,type:"updated",action:l})})},i1);function N1(n,l){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:S1(l.networkMode)?"fetching":"paused",...n===void 0&&{error:null,status:"pending"}}}function Kv(n,l){return{data:n,dataUpdatedAt:l??Date.now(),error:null,isInvalidated:!1,status:"success"}}function Zv(n){const l=typeof n.initialData=="function"?n.initialData():n.initialData,a=l!==void 0,o=a?typeof n.initialDataUpdatedAt=="function"?n.initialDataUpdatedAt():n.initialDataUpdatedAt:0;return{data:l,dataUpdateCount:0,dataUpdatedAt:a?o??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:a?"success":"pending",fetchStatus:"idle"}}var cn,Fe,Dr,un,_a,Wi,Xs,Lr,eo,to,Ra,Aa,Dl,no,Ye,br,jm,wm,Nm,Cm,Mm,Em,Tm,_m,o1,C1=(o1=class extends Hr{constructor(l,a){super();Ne(this,Ye);Ne(this,cn);Ne(this,Fe);Ne(this,Dr);Ne(this,un);Ne(this,_a);Ne(this,Wi);Ne(this,Xs);Ne(this,Lr);Ne(this,eo);Ne(this,to);Ne(this,Ra);Ne(this,Aa);Ne(this,Dl);Ne(this,no,new Set);this.options=a,he(this,cn,l),he(this,Xs,null),this.bindMethods(),this.setOptions(a)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(F(this,Fe).addObserver(this),Jv(F(this,Fe),this.options)?ke(this,Ye,br).call(this):this.updateResult(),ke(this,Ye,Mm).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Rm(F(this,Fe),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Rm(F(this,Fe),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,ke(this,Ye,Em).call(this),ke(this,Ye,Tm).call(this),F(this,Fe).removeObserver(this)}setOptions(l){const a=this.options,o=F(this,Fe);if(this.options=F(this,cn).defaultQueryOptions(l),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof rt(this.options.enabled,F(this,Fe))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");ke(this,Ye,_m).call(this),F(this,Fe).setOptions(this.options),a._defaulted&&!_h(this.options,a)&&F(this,cn).getQueryCache().notify({type:"observerOptionsUpdated",query:F(this,Fe),observer:this});const c=this.hasListeners();c&&Wv(F(this,Fe),o,this.options,a)&&ke(this,Ye,br).call(this),this.updateResult(),c&&(F(this,Fe)!==o||rt(this.options.enabled,F(this,Fe))!==rt(a.enabled,F(this,Fe))||rt(this.options.staleTime,F(this,Fe))!==rt(a.staleTime,F(this,Fe)))&&ke(this,Ye,wm).call(this);const d=ke(this,Ye,Nm).call(this);c&&(F(this,Fe)!==o||rt(this.options.enabled,F(this,Fe))!==rt(a.enabled,F(this,Fe))||d!==F(this,Dl))&&ke(this,Ye,Cm).call(this,d)}getOptimisticResult(l){const a=F(this,cn).getQueryCache().build(F(this,cn),l),o=this.createResult(a,l);return _h(this.getCurrentResult(),o)||(he(this,un,o),he(this,Wi,this.options),he(this,_a,F(this,Fe).state)),o}getCurrentResult(){return F(this,un)}trackResult(l,a){return new Proxy(l,{get:(o,c)=>(this.trackProp(c),a==null||a(c),Reflect.get(o,c))})}trackProp(l){F(this,no).add(l)}getCurrentQuery(){return F(this,Fe)}refetch({...l}={}){return this.fetch({...l})}fetchOptimistic(l){const a=F(this,cn).defaultQueryOptions(l),o=F(this,cn).getQueryCache().build(F(this,cn),a);let c=()=>{},d;const h=new Promise(m=>{d=m,c=F(this,cn).getQueryCache().subscribe(g=>{g.type==="updated"&&g.query.queryHash===o.queryHash&&o.state.data!==void 0&&(c(),m(this.createResult(o,a)))})});return Promise.race([o.fetch(a).then(()=>{const m=this.createResult(o,a);return d==null||d(m),m}).finally(()=>{c()}),h])}fetch(l){return ke(this,Ye,br).call(this,{...l,cancelRefetch:l.cancelRefetch??!0}).then(()=>(this.updateResult(),F(this,un)))}createResult(l,a){var R;const o=F(this,Fe),c=this.options,d=F(this,un),h=F(this,_a),m=F(this,Wi),g=l!==o?l.state:F(this,Dr),{state:x}=l;let v={...x},y=!1,S;if(a._optimisticResults){const A=this.hasListeners(),B=!A&&Jv(l,a),K=A&&Wv(l,o,a,c);(B||K)&&(v={...v,...N1(x.data,l.options)}),a._optimisticResults==="isRestoring"&&(v.fetchStatus="idle")}let{error:j,errorUpdatedAt:b,status:N}=v;S=v.data;let T=!1;if(a.placeholderData!==void 0&&S===void 0&&N==="pending"){let A;d!=null&&d.isPlaceholderData&&a.placeholderData===(m==null?void 0:m.placeholderData)?(A=d.data,T=!0):A=typeof a.placeholderData=="function"?a.placeholderData((R=F(this,to))==null?void 0:R.state.data,F(this,to)):a.placeholderData,A!==void 0&&(N="success",S=xm(d==null?void 0:d.data,A,a),y=!0)}if(a.select&&S!==void 0&&!T)if(d&&S===(h==null?void 0:h.data)&&a.select===F(this,Lr))S=F(this,eo);else try{he(this,Lr,a.select),S=a.select(S),S=xm(d==null?void 0:d.data,S,a),he(this,eo,S),he(this,Xs,null)}catch(A){he(this,Xs,A)}else S===void 0&&he(this,Xs,null);F(this,Xs)&&(j=F(this,Xs),S=F(this,eo),b=Date.now(),N="error",y=!1);const O=v.fetchStatus==="fetching",_=N==="pending",D=N==="error",C=_&&O,E=S!==void 0;return{status:N,fetchStatus:v.fetchStatus,isPending:_,isSuccess:N==="success",isError:D,isInitialLoading:C,isLoading:C,data:S,dataUpdatedAt:v.dataUpdatedAt,error:j,errorUpdatedAt:b,failureCount:v.fetchFailureCount,failureReason:v.fetchFailureReason,errorUpdateCount:v.errorUpdateCount,isFetched:l.isFetched(),isFetchedAfterMount:v.dataUpdateCount>g.dataUpdateCount||v.errorUpdateCount>g.errorUpdateCount,isFetching:O,isRefetching:O&&!_,isLoadingError:D&&!E,isPaused:v.fetchStatus==="paused",isPlaceholderData:y,isRefetchError:D&&E,isStale:rg(l,a),refetch:this.refetch,isEnabled:rt(a.enabled,l)!==!1}}updateResult(){const l=F(this,un),a=this.createResult(F(this,Fe),this.options);if(he(this,_a,F(this,Fe).state),he(this,Wi,this.options),F(this,_a).data!==void 0&&he(this,to,F(this,Fe)),_h(a,l))return;he(this,un,a);const c=(()=>{if(!l)return!0;const{notifyOnChangeProps:d}=this.options,h=typeof d=="function"?d():d;if(h==="all"||!h&&!F(this,no).size)return!0;const m=new Set(h??F(this,no));return this.options.throwOnError&&m.add("error"),Object.keys(F(this,un)).some(g=>{const x=g;return F(this,un)[x]!==l[x]&&m.has(x)})})();Bt.batch(()=>{c&&this.listeners.forEach(d=>{d(F(this,un))}),F(this,cn).getQueryCache().notify({query:F(this,Fe),type:"observerResultsUpdated"})})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&ke(this,Ye,Mm).call(this)}},cn=new WeakMap,Fe=new WeakMap,Dr=new WeakMap,un=new WeakMap,_a=new WeakMap,Wi=new WeakMap,Xs=new WeakMap,Lr=new WeakMap,eo=new WeakMap,to=new WeakMap,Ra=new WeakMap,Aa=new WeakMap,Dl=new WeakMap,no=new WeakMap,Ye=new WeakSet,br=function(l){ke(this,Ye,_m).call(this);let a=F(this,Fe).fetch(this.options,l);return l!=null&&l.throwOnError||(a=a.catch(Sn)),a},jm=function(l){return!ig()&&rt(this.options.enabled,F(this,Fe))!==!1&&g1(l)},wm=function(){ke(this,Ye,Em).call(this);const l=rt(this.options.staleTime,F(this,Fe));if(F(this,un).isStale||!ke(this,Ye,jm).call(this,l))return;const a=p1(F(this,un).dataUpdatedAt,l)+1;he(this,Ra,ja.setTimeout(()=>{F(this,un).isStale||this.updateResult()},a))},Nm=function(){return rt(this.options.refetchInterval,F(this,Fe))??!1},Cm=function(l){ke(this,Ye,Tm).call(this),he(this,Dl,l),!(F(this,Dl)===0||!ke(this,Ye,jm).call(this,F(this,Dl)))&&he(this,Aa,ja.setInterval(()=>{(this.options.refetchIntervalInBackground||og.isFocused())&&ke(this,Ye,br).call(this)},F(this,Dl)))},Mm=function(){ke(this,Ye,wm).call(this),ke(this,Ye,Cm).call(this,ke(this,Ye,Nm).call(this))},Em=function(){F(this,Ra)!==void 0&&(ja.clearTimeout(F(this,Ra)),he(this,Ra,void 0))},Tm=function(){F(this,Aa)!==void 0&&(ja.clearInterval(F(this,Aa)),he(this,Aa,void 0))},_m=function(){const l=F(this,cn).getQueryCache().build(F(this,cn),this.options);if(l===F(this,Fe))return;const a=F(this,Fe);he(this,Fe,l),he(this,Dr,l.state),this.hasListeners()&&(a==null||a.removeObserver(this),l.addObserver(this))},o1);function rw(n,l){return rt(l.enabled,n)!==!1&&n.state.data===void 0&&!(n.state.status==="error"&&rt(l.retryOnMount,n)===!1)}function Jv(n,l){return rw(n,l)||n.state.data!==void 0&&Rm(n,l,l.refetchOnMount)}function Rm(n,l,a){if(rt(l.enabled,n)!==!1&&rt(l.staleTime,n)!=="static"){const o=rt(a,n);return o==="always"||o!==!1&&rg(n,l)}return!1}function Wv(n,l,a,o){return(n!==l||rt(o.enabled,n)===!1)&&(!a.suspense||n.state.status!=="error")&&rg(n,a)}function rg(n,l){return rt(l.enabled,n)!==!1&&n.isStaleByTime(rt(l.staleTime,n))}var cw=class extends C1{constructor(n,l){super(n,l)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(n){n._type="infinite",super.setOptions(n)}getOptimisticResult(n){return n._type="infinite",super.getOptimisticResult(n)}fetchNextPage(n){return this.fetch({...n,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(n){return this.fetch({...n,meta:{fetchMore:{direction:"backward"}}})}createResult(n,l){var j,b;const{state:a}=n,o=super.createResult(n,l),{isFetching:c,isRefetching:d,isError:h,isRefetchError:m}=o,g=(b=(j=a.fetchMeta)==null?void 0:j.fetchMore)==null?void 0:b.direction,x=h&&g==="forward",v=c&&g==="forward",y=h&&g==="backward",S=c&&g==="backward";return{...o,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:aw(l,a.data),hasPreviousPage:iw(l,a.data),isFetchNextPageError:x,isFetchingNextPage:v,isFetchPreviousPageError:y,isFetchingPreviousPage:S,isRefetchError:m&&!x&&!y,isRefetching:d&&!v&&!S}}},$r,bs,Kt,Oa,js,Tl,r1,uw=(r1=class extends j1{constructor(l){super();Ne(this,js);Ne(this,$r);Ne(this,bs);Ne(this,Kt);Ne(this,Oa);he(this,$r,l.client),this.mutationId=l.mutationId,he(this,Kt,l.mutationCache),he(this,bs,[]),this.state=l.state||fw(),this.setOptions(l.options),this.scheduleGc()}setOptions(l){this.options=l,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(l){F(this,bs).includes(l)||(F(this,bs).push(l),this.clearGcTimeout(),F(this,Kt).notify({type:"observerAdded",mutation:this,observer:l}))}removeObserver(l){he(this,bs,F(this,bs).filter(a=>a!==l)),this.scheduleGc(),F(this,Kt).notify({type:"observerRemoved",mutation:this,observer:l})}optionalRemove(){F(this,bs).length||(this.state.status==="pending"?this.scheduleGc():F(this,Kt).remove(this))}continue(){var l;return((l=F(this,Oa))==null?void 0:l.continue())??(this.state.status==="pending"?this.execute(this.state.variables):Promise.resolve())}async execute(l){var m,g,x,v,y,S,j,b,N,T,O,_,D,C,E,R,A,B;const a=()=>{ke(this,js,Tl).call(this,{type:"continue"})},o={client:F(this,$r),meta:this.options.meta,mutationKey:this.options.mutationKey},c=he(this,Oa,b1({fn:()=>this.options.mutationFn?this.options.mutationFn(l,o):Promise.reject(new Error("No mutationFn found")),onFail:(K,k)=>{ke(this,js,Tl).call(this,{type:"failed",failureCount:K,error:k})},onPause:()=>{ke(this,js,Tl).call(this,{type:"pause"})},onContinue:a,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>F(this,Kt).canRun(this)})),d=this.state.status==="pending",h=!c.canStart();try{if(d)a();else{ke(this,js,Tl).call(this,{type:"pending",variables:l,isPaused:h}),F(this,Kt).config.onMutate&&await F(this,Kt).config.onMutate(l,this,o);const k=await((g=(m=this.options).onMutate)==null?void 0:g.call(m,l,o));k!==this.state.context&&ke(this,js,Tl).call(this,{type:"pending",context:k,variables:l,isPaused:h})}const K=await c.start();return await((v=(x=F(this,Kt).config).onSuccess)==null?void 0:v.call(x,K,l,this.state.context,this,o)),await((S=(y=this.options).onSuccess)==null?void 0:S.call(y,K,l,this.state.context,o)),await((b=(j=F(this,Kt).config).onSettled)==null?void 0:b.call(j,K,null,this.state.variables,this.state.context,this,o)),await((T=(N=this.options).onSettled)==null?void 0:T.call(N,K,null,l,this.state.context,o)),ke(this,js,Tl).call(this,{type:"success",data:K}),K}catch(K){try{await((_=(O=F(this,Kt).config).onError)==null?void 0:_.call(O,K,l,this.state.context,this,o))}catch(k){Promise.reject(k)}try{await((C=(D=this.options).onError)==null?void 0:C.call(D,K,l,this.state.context,o))}catch(k){Promise.reject(k)}try{await((R=(E=F(this,Kt).config).onSettled)==null?void 0:R.call(E,void 0,K,this.state.variables,this.state.context,this,o))}catch(k){Promise.reject(k)}try{await((B=(A=this.options).onSettled)==null?void 0:B.call(A,void 0,K,l,this.state.context,o))}catch(k){Promise.reject(k)}throw ke(this,js,Tl).call(this,{type:"error",error:K}),K}finally{F(this,Oa)===c&&he(this,Oa,void 0),F(this,Kt).runNext(this)}}},$r=new WeakMap,bs=new WeakMap,Kt=new WeakMap,Oa=new WeakMap,js=new WeakSet,Tl=function(l){const a=o=>{switch(l.type){case"failed":return{...o,failureCount:l.failureCount,failureReason:l.error};case"pause":return{...o,isPaused:!0};case"continue":return{...o,isPaused:!1};case"pending":return{...o,context:l.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:l.isPaused,status:"pending",variables:l.variables,submittedAt:Date.now()};case"success":return{...o,data:l.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...o,data:void 0,error:l.error,failureCount:o.failureCount+1,failureReason:l.error,isPaused:!1,status:"error"}}};this.state=a(this.state),Bt.batch(()=>{F(this,bs).forEach(o=>{o.onMutationUpdate(l)}),F(this,Kt).notify({mutation:this,type:"updated",action:l})})},r1);function fw(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Ll,ls,kr,c1,dw=(c1=class extends Hr{constructor(l={}){super();Ne(this,Ll);Ne(this,ls);Ne(this,kr);this.config=l,he(this,Ll,new Set),he(this,ls,new Map),he(this,kr,0)}build(l,a,o){const c=new uw({client:l,mutationCache:this,mutationId:++gu(this,kr)._,options:l.defaultMutationOptions(a),state:o});return this.add(c),c}add(l){F(this,Ll).add(l);const a=pu(l);if(typeof a=="string"){const o=F(this,ls).get(a);o?o.push(l):F(this,ls).set(a,[l])}this.notify({type:"added",mutation:l})}remove(l){if(F(this,Ll).delete(l)){const a=pu(l);if(typeof a=="string"){const o=F(this,ls).get(a);if(o)if(o.length>1){const c=o.indexOf(l);c!==-1&&o.splice(c,1)}else o[0]===l&&F(this,ls).delete(a)}}this.notify({type:"removed",mutation:l})}canRun(l){var o;const a=pu(l);if(typeof a=="string"){const c=(o=F(this,ls).get(a))==null?void 0:o.find(d=>d.state.status==="pending");return!c||c===l}else return!0}runNext(l){var o,c;const a=pu(l);return typeof a=="string"?((c=(o=F(this,ls).get(a))==null?void 0:o.find(d=>d!==l&&d.state.isPaused))==null?void 0:c.continue())??Promise.resolve():Promise.resolve()}clear(){Bt.batch(()=>{const l=this.getAll();F(this,Ll).clear(),F(this,ls).clear(),l.forEach(a=>{this.notify({type:"removed",mutation:a})})})}getAll(){return Array.from(F(this,Ll))}find(l){const a={exact:!0,...l};return this.getAll().find(o=>Yv(a,o))}findAll(l={}){return this.getAll().filter(a=>Yv(l,a))}notify(l){Bt.batch(()=>{this.listeners.forEach(a=>{a(l)})})}resumePausedMutations(){const l=this.getAll().filter(a=>a.state.isPaused);return Bt.batch(()=>Promise.all(l.map(a=>a.continue().catch(Sn))))}},Ll=new WeakMap,ls=new WeakMap,kr=new WeakMap,c1);function pu(n){var l;return(l=n.options.scope)==null?void 0:l.id}var ws,u1,hw=(u1=class extends Hr{constructor(l={}){super();Ne(this,ws);this.config=l,he(this,ws,new Map)}build(l,a,o){const c=a.queryKey,d=a.queryHash??sg(c,a);let h=this.get(d);return h||(h=new ow({client:l,queryKey:c,queryHash:d,options:l.defaultQueryOptions(a),state:o,defaultOptions:l.getQueryDefaults(c)}),this.add(h)),h}add(l){F(this,ws).has(l.queryHash)||(F(this,ws).set(l.queryHash,l),this.notify({type:"added",query:l}))}remove(l){F(this,ws).get(l.queryHash)===l&&(l.destroy(),F(this,ws).delete(l.queryHash),this.notify({type:"removed",query:l}))}clear(){Bt.batch(()=>{this.getAll().forEach(l=>{this.remove(l)})})}get(l){return F(this,ws).get(l)}getAll(){return[...F(this,ws).values()]}find(l){const a={exact:!0,...l};return this.getAll().find(o=>Qv(a,o))}findAll(l={}){const a=this.getAll();return Object.keys(l).length>0?a.filter(o=>Qv(l,o)):a}notify(l){Bt.batch(()=>{this.listeners.forEach(a=>{a(l)})})}onFocus(){Bt.batch(()=>{this.getAll().forEach(l=>{l.onFocus()})})}onOnline(){Bt.batch(()=>{this.getAll().forEach(l=>{l.onOnline()})})}},ws=new WeakMap,u1),dt,$l,kl,so,lo,Hl,ao,io,f1,mw=(f1=class{constructor(n={}){Ne(this,dt);Ne(this,$l);Ne(this,kl);Ne(this,so);Ne(this,lo);Ne(this,Hl);Ne(this,ao);Ne(this,io);he(this,dt,n.queryCache||new hw),he(this,$l,n.mutationCache||new dw),he(this,kl,n.defaultOptions||{}),he(this,so,new Map),he(this,lo,new Map),he(this,Hl,0)}mount(){gu(this,Hl)._++,F(this,Hl)===1&&(he(this,ao,og.subscribe(async n=>{n&&(await this.resumePausedMutations(),F(this,dt).onFocus())})),he(this,io,Eu.subscribe(async n=>{n&&(await this.resumePausedMutations(),F(this,dt).onOnline())})))}unmount(){var n,l;gu(this,Hl)._--,F(this,Hl)===0&&((n=F(this,ao))==null||n.call(this),he(this,ao,void 0),(l=F(this,io))==null||l.call(this),he(this,io,void 0))}isFetching(n){return F(this,dt).findAll({...n,fetchStatus:"fetching"}).length}isMutating(n){return F(this,$l).findAll({...n,status:"pending"}).length}getQueryData(n){var a;const l=this.defaultQueryOptions({queryKey:n});return(a=F(this,dt).get(l.queryHash))==null?void 0:a.state.data}ensureQueryData(n){const l=this.defaultQueryOptions(n),a=F(this,dt).build(this,l),o=a.state.data;return o===void 0?this.fetchQuery(n):(n.revalidateIfStale&&a.isStaleByTime(rt(l.staleTime,a))&&this.prefetchQuery(l),Promise.resolve(o))}getQueriesData(n){return F(this,dt).findAll(n).map(({queryKey:l,state:a})=>[l,a.data])}setQueryData(n,l,a){var h;const o=this.defaultQueryOptions({queryKey:n}),c=(h=F(this,dt).get(o.queryHash))==null?void 0:h.state.data,d=Q2(l,c);if(d!==void 0)return F(this,dt).build(this,o).setData(d,{...a,manual:!0})}setQueriesData(n,l,a){return Bt.batch(()=>F(this,dt).findAll(n).map(({queryKey:o})=>[o,this.setQueryData(o,l,a)]))}getQueryState(n){var a;const l=this.defaultQueryOptions({queryKey:n});return(a=F(this,dt).get(l.queryHash))==null?void 0:a.state}removeQueries(n){const l=F(this,dt);Bt.batch(()=>{l.findAll(n).forEach(a=>{l.remove(a)})})}resetQueries(n,l){const a=F(this,dt);return Bt.batch(()=>{const o=a.findAll(n),c=new Set(o);return o.forEach(d=>{d.reset()}),this.refetchQueries({type:"active",predicate:d=>c.has(d)},l)})}cancelQueries(n,l={}){const a={revert:!0,...l},o=Bt.batch(()=>F(this,dt).findAll(n).map(c=>c.cancel(a)));return Promise.all(o).then(Sn).catch(Sn)}invalidateQueries(n,l={}){return Bt.batch(()=>(F(this,dt).findAll(n).forEach(a=>{a.invalidate()}),(n==null?void 0:n.refetchType)==="none"?Promise.resolve():this.refetchQueries({...n,type:(n==null?void 0:n.refetchType)??(n==null?void 0:n.type)??"active"},l)))}refetchQueries(n,l={}){const a={...l,cancelRefetch:l.cancelRefetch??!0},o=Bt.batch(()=>F(this,dt).findAll(n).filter(c=>!c.isDisabled()&&!c.isStatic()).map(c=>{let d=c.fetch(void 0,a);return a.throwOnError||(d=d.catch(Sn)),c.state.fetchStatus==="paused"?Promise.resolve():d}));return Promise.all(o).then(Sn)}async query(n){const l=this.defaultQueryOptions(n);l.retry===void 0&&(l.retry=!1);const a=F(this,dt).build(this,l),o=a.isStaleByTime(rt(l.staleTime,a))?await a.fetch(l):a.state.data,c=l.select;return c?c(o):o}fetchQuery(n){const l=this.defaultQueryOptions(n);l.retry===void 0&&(l.retry=!1);const a=F(this,dt).build(this,l);return a.isStaleByTime(rt(l.staleTime,a))?a.fetch(l):Promise.resolve(a.state.data)}prefetchQuery(n){return this.fetchQuery(n).then(Sn).catch(Sn)}infiniteQuery(n){return n._type="infinite",this.query(n)}fetchInfiniteQuery(n){return n._type="infinite",this.fetchQuery(n)}prefetchInfiniteQuery(n){return this.fetchInfiniteQuery(n).then(Sn).catch(Sn)}ensureInfiniteQueryData(n){return n._type="infinite",this.ensureQueryData(n)}resumePausedMutations(){return Eu.isOnline()?F(this,$l).resumePausedMutations():Promise.resolve()}getQueryCache(){return F(this,dt)}getMutationCache(){return F(this,$l)}getDefaultOptions(){return F(this,kl)}setDefaultOptions(n){he(this,kl,n)}setQueryDefaults(n,l){F(this,so).set(Er(n),{queryKey:n,defaultOptions:l})}getQueryDefaults(n){const l=[...F(this,so).values()],a={};return l.forEach(o=>{oo(n,o.queryKey)&&Object.assign(a,o.defaultOptions)}),a}setMutationDefaults(n,l){F(this,lo).set(Er(n),{mutationKey:n,defaultOptions:l})}getMutationDefaults(n){const l=[...F(this,lo).values()],a={};return l.forEach(o=>{oo(n,o.mutationKey)&&Object.assign(a,o.defaultOptions)}),a}defaultQueryOptions(n){if(n._defaulted)return n;const l={...F(this,kl).queries,...this.getQueryDefaults(n.queryKey),...n,_defaulted:!0};return l.queryHash||(l.queryHash=sg(l.queryKey,l)),l.refetchOnReconnect===void 0&&(l.refetchOnReconnect=l.networkMode!=="always"),l.throwOnError===void 0&&(l.throwOnError=!!l.suspense),!l.networkMode&&l.persister&&(l.networkMode="offlineFirst"),l.queryFn===ag&&(l.enabled=!1),l}defaultMutationOptions(n){return n!=null&&n._defaulted?n:{...F(this,kl).mutations,...(n==null?void 0:n.mutationKey)&&this.getMutationDefaults(n.mutationKey),...n,_defaulted:!0}}clear(){F(this,dt).clear(),F(this,$l).clear()}},dt=new WeakMap,$l=new WeakMap,kl=new WeakMap,so=new WeakMap,lo=new WeakMap,Hl=new WeakMap,ao=new WeakMap,io=new WeakMap,f1);const M1=M.createContext(!1),gw=()=>M.useContext(M1);M1.Provider;function pw(){let n=!1;return{clearReset:()=>{n=!1},reset:()=>{n=!0},isReset:()=>n}}const yw=M.createContext(pw()),vw=()=>M.useContext(yw),xw=(n,l,a)=>{const o=(a==null?void 0:a.state.status)==="error"&&typeof n.throwOnError=="function"?x1(n.throwOnError,[a.state.error,a]):n.throwOnError;(n.suspense||o)&&(l.isReset()||(n.retryOnMount=!1))},Sw=n=>{M.useEffect(()=>{n.clearReset()},[n])},bw=({result:n,errorResetBoundary:l,throwOnError:a,query:o,suspense:c})=>n.isError&&!l.isReset()&&!n.isFetching&&o&&(c&&n.data===void 0||x1(a,[n.error,o])),jw=n=>{if(n.suspense){const a=c=>c==="static"?c:Math.max(c??1e3,1e3),o=n.staleTime;n.staleTime=typeof o=="function"?(...c)=>a(o(...c)):a(o),typeof n.gcTime=="number"&&(n.gcTime=Math.max(n.gcTime,1e3))}},ww=(n,l)=>(n==null?void 0:n.suspense)&&l.isPending,Nw=(n,l,a)=>l.fetchOptimistic(n).catch(()=>{a.clearReset()});function E1(n,l,a){const o=gw(),c=vw(),d=m1(),h=d.defaultQueryOptions(n),m=d.getQueryCache().get(h.queryHash),g=n.subscribed!==!1;h._optimisticResults=o?"isRestoring":g?"optimistic":void 0,jw(h),xw(h,c,m),Sw(c);const[x]=M.useState(()=>new l(d,h)),v=x.getOptimisticResult(h),y=!o&&g;if(M.useSyncExternalStore(M.useCallback(S=>{const j=y?x.subscribe(Bt.batchCalls(S)):Sn;return x.updateResult(),j},[x,y]),()=>x.getCurrentResult(),()=>x.getCurrentResult()),M.useEffect(()=>{x.setOptions(h)},[h,x]),ww(h,v))throw Nw(h,x,c);if(bw({result:v,errorResetBoundary:c,throwOnError:h.throwOnError,query:m,suspense:h.suspense}))throw v.error;return h.notifyOnChangeProps?v:x.trackResult(v)}function fn(n,l){return E1(n,C1)}function Cw(n,l){return E1(n,cw)}var cg=d1();/**
|
|
43
|
+
`+gn+e+oa}var $s=!1;function ms(e,t){if(!e||$s)return"";$s=!0;var s=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var o={DetermineComponentFrameRoot:function(){try{if(t){var ne=function(){throw Error()};if(Object.defineProperty(ne.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ne,[])}catch(fe){var F=fe}Reflect.construct(e,[],ne)}else{try{ne.call()}catch(fe){F=fe}ne=!1;try{var Y=Object.getOwnPropertyDescriptor(e.prototype,"props");Object.defineProperty(e.prototype,"props",{configurable:!0,set:function(){throw Error()}}),ne=!0,new e}finally{ne&&(Y!==void 0?Object.defineProperty(e.prototype,"props",Y):delete e.prototype.props)}}}else{try{throw Error()}catch(fe){F=fe}(ne=e())&&typeof ne.catch=="function"&&ne.catch(function(){})}}catch(fe){if(fe&&F&&typeof fe.stack=="string")return[fe.stack,F.stack]}return[null,null]}};o.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var u=Object.getOwnPropertyDescriptor(o.DetermineComponentFrameRoot,"name");u&&u.configurable&&Object.defineProperty(o.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var h=o.DetermineComponentFrameRoot(),y=h[0],w=h[1];if(y&&w){var L=y.split(`
|
|
44
|
+
`),I=w.split(`
|
|
45
|
+
`);for(u=o=0;o<L.length&&!L[o].includes("DetermineComponentFrameRoot");)o++;for(;u<I.length&&!I[u].includes("DetermineComponentFrameRoot");)u++;if(o===L.length||u===I.length)for(o=L.length-1,u=I.length-1;1<=o&&0<=u&&L[o]!==I[u];)u--;for(;1<=o&&0<=u;o--,u--)if(L[o]!==I[u]){if(o!==1||u!==1)do if(o--,u--,0>u||L[o]!==I[u]){var K=`
|
|
46
|
+
`+L[o].replace(" at new "," at ");return e.displayName&&K.includes("<anonymous>")&&(K=K.replace("<anonymous>",e.displayName)),K}while(1<=o&&0<=u);break}}}finally{$s=!1,Error.prepareStackTrace=s}return(s=e?e.displayName||e.name:"")?Ot(s):""}function W(e,t){switch(e.tag){case 26:case 27:case 5:return Ot(e.type);case 16:return Ot("Lazy");case 13:return e.child!==t&&t!==null?Ot("Suspense Fallback"):Ot("Suspense");case 19:return Ot("SuspenseList");case 0:case 15:return ms(e.type,!1);case 11:return ms(e.type.render,!1);case 1:return ms(e.type,!0);case 31:return Ot("Activity");case 30:return Ot("ViewTransition");default:return""}}function he(e){try{var t="",s=null;do t+=W(e,s),s=e,e=e.return;while(e);return t}catch(o){return`
|
|
47
|
+
Error generating stack: `+o.message+`
|
|
48
|
+
`+o.stack}}var we=Object.prototype.hasOwnProperty,Ge=n.unstable_scheduleCallback,Ke=n.unstable_cancelCallback,ft=n.unstable_shouldYield,zt=n.unstable_requestPaint,tt=n.unstable_now,Dt=n.unstable_getCurrentPriorityLevel,Cn=n.unstable_ImmediatePriority,sl=n.unstable_UserBlockingPriority,Mn=n.unstable_NormalPriority,fd=n.unstable_LowPriority,ra=n.unstable_IdlePriority,nc=n.log,bo=n.unstable_setDisableYieldValue,En=null,Ft=null;function ts(e){if(typeof nc=="function"&&bo(e),Ft&&typeof Ft.setStrictMode=="function")try{Ft.setStrictMode(En,e)}catch{}}var ln=Math.clz32?Math.clz32:ac,sc=Math.log,Yl=Math.LN2;function ac(e){return e>>>=0,e===0?32:31-(sc(e)/Yl|0)|0}var Xl=256,ca=262144,bt=4194304;function gs(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:return e&-e;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;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 al(e,t,s){var o=e.pendingLanes;if(o===0)return 0;var u=0,h=e.suspendedLanes,y=e.pingedLanes;e=e.warmLanes;var w=o&134217727;return w!==0?(o=w&~h,o!==0?u=gs(o):(y&=w,y!==0?u=gs(y):s||(s=w&~e,s!==0&&(u=gs(s))))):(w=o&~h,w!==0?u=gs(w):y!==0?u=gs(y):s||(s=o&~e,s!==0&&(u=gs(s)))),u===0?0:t!==0&&t!==u&&(t&h)===0&&(h=u&-u,s=t&-t,h>=s||h===32&&(s&4194048)!==0)?t:u}function ua(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function So(e,t){(t&8)!==0&&(t|=t&32);var s=e.entangledLanes;if(s!==0)for(e=e.entanglements,s&=t;0<s;){var o=31-ln(s),u=1<<o;t|=e[o],s&=~u}return t}function lc(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 jo(){var e=bt;return bt<<=1,(bt&62914560)===0&&(bt=4194304),e}function Kl(e){for(var t=[],s=0;31>s;s++)t.push(e);return t}function da(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function ic(e,t,s,o,u,h){var y=e.pendingLanes;e.pendingLanes=s,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=s,e.entangledLanes&=s,e.errorRecoveryDisabledLanes&=s,e.shellSuspendCounter=0;var w=e.entanglements,L=e.expirationTimes,I=e.hiddenUpdates;for(s=y&~s;0<s;){var K=31-ln(s),ne=1<<K;w[K]=0,L[K]=-1;var F=I[K];if(F!==null)for(I[K]=null,K=0;K<F.length;K++){var Y=F[K];Y!==null&&(Y.lane&=-536870913)}s&=~ne}o!==0&&wo(e,o,0),h!==0&&u===0&&e.tag!==0&&(e.suspendedLanes|=h&~(y&~t))}function wo(e,t,s){e.pendingLanes|=t,e.suspendedLanes&=~t;var o=31-ln(t);e.entangledLanes|=t,e.entanglements[o]=e.entanglements[o]|1073741824|s&261930}function No(e,t){var s=e.entangledLanes|=t;for(e=e.entanglements;s;){var o=31-ln(s),u=1<<o;u&t|e[o]&t&&(e[o]|=t),s&=~u}}function Co(e,t){var s=t&-t;return s=(s&42)!==0?1:Zl(s),(s&(e.suspendedLanes|t))!==0?0:s}function Zl(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 Jl(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Mo(){var e=ve.p;return e!==0?e:(e=window.event,e===void 0?32:Vx(e.type))}function Eo(e,t){var s=ve.p;try{return ve.p=e,t()}finally{ve.p=s}}var Vn=Math.random().toString(36).slice(2),St="__reactFiber$"+Vn,Vt="__reactProps$"+Vn,Hs="__reactContainer$"+Vn,Ro="__reactEvents$"+Vn,oc="__reactListeners$"+Vn,rc="__reactHandles$"+Vn,To="__reactResources$"+Vn,ha="__reactMarker$"+Vn,ue="__reactLoad$"+Vn;function Ye(e){delete e[St],delete e[Vt],delete e[oc],delete e[rc]}function jt(e){var t;if(t=e[St])return t;for(var s=e.parentNode;s;){if(t=s[Hs]||s[St]){if(s=t.alternate,t.child!==null||s!==null&&s.child!==null)for(e=jx(e);e!==null;){if(s=e[St])return s;e=jx(e)}return t}e=s,s=e.parentNode}return null}function ps(e){if(e=e[St]||e[Hs]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function ll(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function fa(e){var t=e[To];return t||(t=e[To]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function mt(e){e[ha]=!0}function ns(e){e[ue]=void 0}var _o=new Set,Ao={};function xs(e,t){ma(e,t),ma(e+"Capture",t)}function ma(e,t){for(Ao[e]=t,e=0;e<t.length;e++)_o.add(t[e])}var cc=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]*$"),Oo={},Gg={};function Nb(e){return we.call(Gg,e)?!0:we.call(Oo,e)?!1:cc.test(e)?Gg[e]=!0:(Oo[e]=!0,!1)}var qe=!1;function qg(){var e=qe;return qe=!1,e}function uc(e,t,s){if(Nb(t))if(s===null)e.removeAttribute(t);else{switch(typeof s){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var o=t.toLowerCase().slice(0,5);if(o!=="data-"&&o!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,s)}}function dc(e,t,s){if(s===null)e.removeAttribute(t);else{switch(typeof s){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,s)}}function Us(e,t,s,o){if(o===null)e.removeAttribute(s);else{switch(typeof o){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(s);return}e.setAttributeNS(t,s,o)}}function Rn(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Ig(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Cb(e,t,s){var o=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof o<"u"&&typeof o.get=="function"&&typeof o.set=="function"){var u=o.get,h=o.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return u.call(this)},set:function(y){s=""+y,h.call(this,y)}}),Object.defineProperty(e,t,{enumerable:o.enumerable}),{getValue:function(){return s},setValue:function(y){s=""+y},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function md(e){if(!e._valueTracker){var t=Ig(e)?"checked":"value";e._valueTracker=Cb(e,t,""+e[t])}}function Pg(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var s=t.getValue(),o="";return e&&(o=Ig(e)?e.checked?"true":"false":e.value),e=o,e!==s?(t.setValue(e),!0):!1}var Mb=/[\n"\\]/g;function Gn(e){return e.replace(Mb,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function gd(e,t,s,o,u,h,y,w){e.name="",y!=null&&typeof y!="function"&&typeof y!="symbol"&&typeof y!="boolean"?e.type=y:e.removeAttribute("type"),t!=null?y==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+Rn(t)):e.value!==""+Rn(t)&&(e.value=""+Rn(t)):y!=="submit"&&y!=="reset"||e.removeAttribute("value"),t!=null?y==="number"&&e.value==t?pd(e,Rn(e.value)):pd(e,Rn(t)):s!=null?pd(e,Rn(s)):o!=null&&e.removeAttribute("value"),u==null&&h!=null&&(e.defaultChecked=!!h),u!=null&&(e.checked=u&&typeof u!="function"&&typeof u!="symbol"),w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"?e.name=""+Rn(w):e.removeAttribute("name")}function Qg(e,t,s,o,u,h,y,w){if(h!=null&&typeof h!="function"&&typeof h!="symbol"&&typeof h!="boolean"&&(e.type=h),t!=null||s!=null){if(!(h!=="submit"&&h!=="reset"||t!=null)){md(e);return}s=s!=null?""+Rn(s):"",t=t!=null?""+Rn(t):s,w||t===e.value||(e.value=t),e.defaultValue=t}o=o??u,o=typeof o!="function"&&typeof o!="symbol"&&!!o,e.checked=w?e.checked:!!o,e.defaultChecked=!!o,y!=null&&typeof y!="function"&&typeof y!="symbol"&&typeof y!="boolean"&&(e.name=y),md(e)}function pd(e,t){e.defaultValue!==""+t&&(e.defaultValue=""+t)}function Wl(e,t,s,o){if(e=e.options,t){t={};for(var u=0;u<s.length;u++)t["$"+s[u]]=!0;for(s=0;s<e.length;s++)u=t.hasOwnProperty("$"+e[s].value),e[s].selected!==u&&(e[s].selected=u),u&&o&&(e[s].defaultSelected=!0)}else{for(s=""+Rn(s),t=null,u=0;u<e.length;u++){if(e[u].value===s){e[u].selected=!0,o&&(e[u].defaultSelected=!0);return}t!==null||e[u].disabled||(t=e[u])}t!==null&&(t.selected=!0)}}function Yg(e,t,s){if(t!=null&&(t=""+Rn(t),t!==e.value&&(e.value=t),s==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=s!=null?""+Rn(s):""}function Xg(e,t,s,o){if(t==null){if(o!=null){if(s!=null)throw Error(i(92));if(Me(o)){if(1<o.length)throw Error(i(93));o=o[0]}s=o}s==null&&(s=""),t=s}s=Rn(t),e.defaultValue=s,o=e.textContent,o===s&&o!==""&&o!==null&&(e.value=o),md(e)}function ei(e,t){if(t){var s=e.firstChild;if(s&&s===e.lastChild&&s.nodeType===3){s.nodeValue=t;return}}e.textContent=t}var Eb=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 Kg(e,t,s){var o=t.indexOf("--")===0;s==null||typeof s=="boolean"||s===""?o?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":o?e.setProperty(t,s):typeof s!="number"||s===0||Eb.has(t)?t==="float"?e.cssFloat=s:e[t]=(""+s).trim():e[t]=s+"px"}function Zg(e,t,s){if(t!=null&&typeof t!="object")throw Error(i(62));if(e=e.style,s!=null){for(var o in s)!s.hasOwnProperty(o)||t!=null&&t.hasOwnProperty(o)||(o.indexOf("--")===0?e.setProperty(o,""):o==="float"?e.cssFloat="":e[o]="",qe=!0);for(var u in t)o=t[u],t.hasOwnProperty(u)&&s[u]!==o&&(Kg(e,u,o),qe=!0)}else for(var h in t)t.hasOwnProperty(h)&&Kg(e,h,t[h])}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 Rb=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"],["maskType","mask-type"],["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"]]),Tb=/^[\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 hc(e){return Tb.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function vs(){}var vd=null;function yd(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var ti=null,ni=null;function Jg(e){var t=ps(e);if(t&&(e=t.stateNode)){var s=e[Vt]||null;e:switch(e=t.stateNode,t.type){case"input":if(gd(e,s.value,s.defaultValue,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name),t=s.name,s.type==="radio"&&t!=null){for(s=e;s.parentNode;)s=s.parentNode;for(s=s.querySelectorAll('input[name="'+Gn(""+t)+'"][type="radio"]'),t=0;t<s.length;t++){var o=s[t];if(o!==e&&o.form===e.form){var u=o[Vt]||null;if(!u)throw Error(i(90));gd(o,u.value,u.defaultValue,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name)}}for(t=0;t<s.length;t++)o=s[t],o.form===e.form&&Pg(o)}break e;case"textarea":Yg(e,s.value,s.defaultValue);break e;case"select":t=s.value,t!=null&&Wl(e,!!s.multiple,t,!1)}}}var bd=!1;function Wg(e,t,s){if(bd)return e(t,s);bd=!0;try{var o=e(t);return o}finally{if(bd=!1,(ti!==null||ni!==null)&&(hu(),ti&&(t=ti,e=ni,ni=ti=null,Jg(t),e)))for(t=0;t<e.length;t++)Jg(e[t])}}function zo(e,t){var s=e.stateNode;if(s===null)return null;var o=s[Vt]||null;if(o===null)return null;s=o[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":(o=!o.disabled)||(e=e.type,o=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!o;break e;default:e=!1}if(e)return null;if(s&&typeof s!="function")throw Error(i(231,t,typeof s));return s}var Bs=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Sd=!1;if(Bs)try{var Do={};Object.defineProperty(Do,"passive",{get:function(){Sd=!0}}),window.addEventListener("test",Do,Do),window.removeEventListener("test",Do,Do)}catch{Sd=!1}var ga=null,jd=null,fc=null;function e0(){if(fc)return fc;var e,t=jd,s=t.length,o,u="value"in ga?ga.value:ga.textContent,h=u.length;for(e=0;e<s&&t[e]===u[e];e++);var y=s-e;for(o=1;o<=y&&t[s-o]===u[h-o];o++);return fc=u.slice(e,1<o?1-o:void 0)}function mc(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 gc(){return!0}function t0(){return!1}function on(e){function t(s,o,u,h,y){this._reactName=s,this._targetInst=u,this.type=o,this.nativeEvent=h,this.target=y,this.currentTarget=null;for(var w in e)e.hasOwnProperty(w)&&(s=e[w],this[w]=s?s(h):h[w]);return this.isDefaultPrevented=(h.defaultPrevented!=null?h.defaultPrevented:h.returnValue===!1)?gc:t0,this.isPropagationStopped=t0,this}return D(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var s=this.nativeEvent;s&&(s.preventDefault?s.preventDefault():typeof s.returnValue!="unknown"&&(s.returnValue=!1),this.isDefaultPrevented=gc)},stopPropagation:function(){var s=this.nativeEvent;s&&(s.stopPropagation?s.stopPropagation():typeof s.cancelBubble!="unknown"&&(s.cancelBubble=!0),this.isPropagationStopped=gc)},persist:function(){},isPersistent:gc}),t}var pa={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},pc=on(pa),ko=D({},pa,{view:0,detail:0}),_b=on(ko),wd,Nd,Lo,xc=D({},ko,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Md,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!==Lo&&(Lo&&e.type==="mousemove"?(wd=e.screenX-Lo.screenX,Nd=e.screenY-Lo.screenY):Nd=wd=0,Lo=e),wd)},movementY:function(e){return"movementY"in e?e.movementY:Nd}}),n0=on(xc),Ab=D({},xc,{dataTransfer:0}),Ob=on(Ab),zb=D({},ko,{relatedTarget:0}),Cd=on(zb),Db=D({},pa,{animationName:0,elapsedTime:0,pseudoElement:0}),kb=on(Db),Lb=D({},pa,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),$b=on(Lb),Hb=D({},pa,{data:0}),s0=on(Hb),Ub={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Bb={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"},Fb={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Vb(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Fb[e])?!!t[e]:!1}function Md(){return Vb}var Gb=D({},ko,{key:function(e){if(e.key){var t=Ub[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=mc(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Bb[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Md,charCode:function(e){return e.type==="keypress"?mc(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?mc(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),qb=on(Gb),Ib=D({},xc,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),a0=on(Ib),Pb=D({},pa,{submitter:0}),Qb=on(Pb),Yb=D({},ko,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Md}),Xb=on(Yb),Kb=D({},pa,{propertyName:0,elapsedTime:0,pseudoElement:0}),Zb=on(Kb),Jb=D({},xc,{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}),Wb=on(Jb),eS=D({},pa,{newState:0,oldState:0,source:0}),tS=on(eS),nS=[9,13,27,32],Ed=Bs&&"CompositionEvent"in window,$o=null;Bs&&"documentMode"in document&&($o=document.documentMode);var sS=Bs&&"TextEvent"in window&&!$o,l0=Bs&&(!Ed||$o&&8<$o&&11>=$o),i0=" ",o0=!1;function r0(e,t){switch(e){case"keyup":return nS.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function c0(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var si=!1;function aS(e,t){switch(e){case"compositionend":return c0(t);case"keypress":return t.which!==32?null:(o0=!0,i0);case"textInput":return e=t.data,e===i0&&o0?null:e;default:return null}}function lS(e,t){if(si)return e==="compositionend"||!Ed&&r0(e,t)?(e=e0(),fc=jd=ga=null,si=!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 l0&&t.locale!=="ko"?null:t.data;default:return null}}var iS={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 u0(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!iS[e.type]:t==="textarea"}function d0(e,t,s,o){ti?ni?ni.push(o):ni=[o]:ti=o,t=vu(t,"onChange"),0<t.length&&(s=new pc("onChange","change",null,s,o),e.push({event:s,listeners:t}))}var Ho=null,Uo=null;function oS(e){J1(e,0)}function vc(e){var t=ll(e);if(Pg(t))return e}function h0(e,t){if(e==="change")return t}var f0=!1;if(Bs){var Rd;if(Bs){var Td="oninput"in document;if(!Td){var m0=document.createElement("div");m0.setAttribute("oninput","return;"),Td=typeof m0.oninput=="function"}Rd=Td}else Rd=!1;f0=Rd&&(!document.documentMode||9<document.documentMode)}function g0(){Ho&&(Ho.detachEvent("onpropertychange",p0),Uo=Ho=null)}function p0(e){if(e.propertyName==="value"&&vc(Uo)){var t=[];d0(t,Uo,e,yd(e)),Wg(oS,t)}}function rS(e,t,s){e==="focusin"?(g0(),Ho=t,Uo=s,Ho.attachEvent("onpropertychange",p0)):e==="focusout"&&g0()}function cS(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return vc(Uo)}function uS(e,t){if(e==="click")return vc(t)}function dS(e,t){if(e==="input"||e==="change")return vc(t)}function hS(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Tn=typeof Object.is=="function"?Object.is:hS;function Bo(e,t){if(Tn(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var s=Object.keys(e),o=Object.keys(t);if(s.length!==o.length)return!1;for(o=0;o<s.length;o++){var u=s[o];if(!we.call(t,u)||!Tn(e[u],t[u]))return!1}return!0}function _d(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}}function x0(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function v0(e,t){var s=x0(e);e=0;for(var o;s;){if(s.nodeType===3){if(o=e+s.textContent.length,e<=t&&o>=t)return{node:s,offset:t-e};e=o}e:{for(;s;){if(s.nextSibling){s=s.nextSibling;break e}s=s.parentNode}s=void 0}s=x0(s)}}function y0(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?y0(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function b0(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=_d(e.document);t instanceof e.HTMLIFrameElement;){try{var s=typeof t.contentWindow.location.href=="string"}catch{s=!1}if(s)e=t.contentWindow;else break;t=_d(e.document)}return t}function Ad(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 fS=Bs&&"documentMode"in document&&11>=document.documentMode,ai=null,Od=null,Fo=null,zd=!1;function S0(e,t,s){var o=s.window===s?s.document:s.nodeType===9?s:s.ownerDocument;zd||ai==null||ai!==_d(o)||(o=ai,"selectionStart"in o&&Ad(o)?o={start:o.selectionStart,end:o.selectionEnd}:(o=(o.ownerDocument&&o.ownerDocument.defaultView||window).getSelection(),o={anchorNode:o.anchorNode,anchorOffset:o.anchorOffset,focusNode:o.focusNode,focusOffset:o.focusOffset}),Fo&&Bo(Fo,o)||(Fo=o,o=vu(Od,"onSelect"),0<o.length&&(t=new pc("onSelect","select",null,t,s),e.push({event:t,listeners:o}),t.target=ai)))}function il(e,t){var s={};return s[e.toLowerCase()]=t.toLowerCase(),s["Webkit"+e]="webkit"+t,s["Moz"+e]="moz"+t,s}var li={animationend:il("Animation","AnimationEnd"),animationiteration:il("Animation","AnimationIteration"),animationstart:il("Animation","AnimationStart"),transitionrun:il("Transition","TransitionRun"),transitionstart:il("Transition","TransitionStart"),transitioncancel:il("Transition","TransitionCancel"),transitionend:il("Transition","TransitionEnd")},Dd={},j0={};Bs&&(j0=document.createElement("div").style,"AnimationEvent"in window||(delete li.animationend.animation,delete li.animationiteration.animation,delete li.animationstart.animation),"TransitionEvent"in window||delete li.transitionend.transition);function ol(e){if(Dd[e])return Dd[e];if(!li[e])return e;var t=li[e],s;for(s in t)if(t.hasOwnProperty(s)&&s in j0)return Dd[e]=t[s];return e}var w0=ol("animationend"),N0=ol("animationiteration"),C0=ol("animationstart"),mS=ol("transitionrun"),gS=ol("transitionstart"),pS=ol("transitioncancel"),M0=ol("transitionend"),E0=new Map,kd="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error fullscreenChange fullscreenError 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(" ");kd.push("scrollEnd");function ss(e,t){E0.set(e,t),xs(t,[e])}var xS=0;function Fs(e,t){if(e.name!=null&&e.name!=="auto")return e.name;if(t.autoName!==null)return t.autoName;e=os.identifierPrefix;var s=xS++;return e="_"+e+"t_"+s.toString(32)+"_",t.autoName=e}function R0(e){if(e==null||typeof e=="string")return e;var t=null,s=Ci;if(s!==null)for(var o=0;o<s.length;o++){var u=e[s[o]];if(u!=null){if(u==="none")return"none";t=t==null?u:t+(" "+u)}}return t??e.default}function Vs(e,t){return e=R0(e),t=R0(t),t==null?e==="auto"?null:e:t==="auto"?null:t}var yc=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)},qn=[],ii=0,Ld=0;function bc(){for(var e=ii,t=Ld=ii=0;t<e;){var s=qn[t];qn[t++]=null;var o=qn[t];qn[t++]=null;var u=qn[t];qn[t++]=null;var h=qn[t];if(qn[t++]=null,o!==null&&u!==null){var y=o.pending;y===null?u.next=u:(u.next=y.next,y.next=u),o.pending=u}h!==0&&T0(s,u,h)}}function Sc(e,t,s,o){qn[ii++]=e,qn[ii++]=t,qn[ii++]=s,qn[ii++]=o,Ld|=o,e.lanes|=o,e=e.alternate,e!==null&&(e.lanes|=o)}function $d(e,t,s,o){return Sc(e,t,s,o),jc(e)}function rl(e,t){return Sc(e,null,null,t),jc(e)}function T0(e,t,s){e.lanes|=s;var o=e.alternate;o!==null&&(o.lanes|=s);for(var u=!1,h=e.return;h!==null;)h.childLanes|=s,o=h.alternate,o!==null&&(o.childLanes|=s),h.tag===22&&(e=h.stateNode,e===null||e._visibility&1||(u=!0)),e=h,h=h.return;return e.tag===3?(h=e.stateNode,u&&t!==null&&(u=31-ln(s),e=h.hiddenUpdates,o=e[u],o===null?e[u]=[t]:o.push(t),t.lane=s|536870912),h):null}function jc(e){if(50<cr)throw cr=0,du=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var oi={};function vS(e,t,s,o){this.tag=e,this.key=s,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=o,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function pn(e,t,s,o){return new vS(e,t,s,o)}function Hd(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Gs(e,t){var s=e.alternate;return s===null?(s=pn(e.tag,t,e.key,e.mode),s.elementType=e.elementType,s.type=e.type,s.stateNode=e.stateNode,s.alternate=e,e.alternate=s):(s.pendingProps=t,s.type=e.type,s.flags=0,s.subtreeFlags=0,s.deletions=null),s.flags=e.flags&1206910976,s.childLanes=e.childLanes,s.lanes=e.lanes,s.child=e.child,s.memoizedProps=e.memoizedProps,s.memoizedState=e.memoizedState,s.updateQueue=e.updateQueue,t=e.dependencies,s.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},s.sibling=e.sibling,s.index=e.index,s.ref=e.ref,s.refCleanup=e.refCleanup,s}function _0(e,t){e.flags&=1206910978;var s=e.alternate;return s===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=s.childLanes,e.lanes=s.lanes,e.child=s.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=s.memoizedProps,e.memoizedState=s.memoizedState,e.updateQueue=s.updateQueue,e.type=s.type,t=s.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function wc(e,t,s,o,u,h){var y=0;if(o=e,typeof o=="function")Hd(o)&&(y=1);else if(typeof o=="string")y=Pj(e,s,Bt.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(o){case me:return e=pn(31,s,t,u),e.elementType=me,e.lanes=h,e;case te:return cl(s.children,u,h,t);case ie:y=8,u|=24;break;case J:return e=pn(12,s,t,u|2),e.elementType=J,e.lanes=h,e;case G:return e=pn(13,s,t,u),e.elementType=G,e.lanes=h,e;case X:return e=pn(19,s,t,u),e.elementType=X,e.lanes=h,e;case Se:case k:return e=u|32,e=pn(30,s,t,e),e.elementType=k,e.lanes=h,e.stateNode={autoName:null,paired:null,clones:null,ref:null},e;default:if(typeof o=="object"&&o!==null)switch(o.$$typeof){case re:y=10;break e;case se:y=9;break e;case $:y=11;break e;case le:y=14;break e;case ae:y=16,o=null;break e}y=29,s=Error(i(130,e===null?"null":typeof e,"")),o=null}return t=pn(y,s,t,u),t.elementType=e,t.type=o,t.lanes=h,t}function cl(e,t,s,o){return e=pn(7,e,o,t),e.lanes=s,e}function Ud(e,t,s){return e=pn(6,e,null,t),e.lanes=s,e}function A0(e){var t=pn(18,null,null,0);return t.stateNode=e,t}function Bd(e,t,s){return t=pn(4,e.children!==null?e.children:[],e.key,t),t.lanes=s,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var O0=new WeakMap;function In(e,t){if(typeof e=="object"&&e!==null){var s=O0.get(e);return s!==void 0?s:(t={value:e,source:t,stack:he(t)},O0.set(e,t),t)}return{value:e,source:t,stack:he(t)}}var ri=[],ci=0,Nc=null,Vo=0,Pn=[],Qn=0,xa=null,ys=1,bs="";function qs(e,t){ri[ci++]=Vo,ri[ci++]=Nc,Nc=e,Vo=t}function z0(e,t,s){Pn[Qn++]=ys,Pn[Qn++]=bs,Pn[Qn++]=xa,xa=e;var o=ys;e=bs;var u=32-ln(o)-1;o&=~(1<<u),s+=1;var h=32-ln(t)+u;if(30<h){var y=u-u%5;h=(o&(1<<y)-1).toString(32),o>>=y,u-=y,ys=1<<32-ln(t)+u|s<<u|o,bs=h+e}else ys=1<<h|s<<u|o,bs=e}function Cc(e){e.return!==null&&(qs(e,1),z0(e,1,0))}function Fd(e){for(;e===Nc;)Nc=ri[--ci],ri[ci]=null,Vo=ri[--ci],ri[ci]=null;for(;e===xa;)xa=Pn[--Qn],Pn[Qn]=null,bs=Pn[--Qn],Pn[Qn]=null,ys=Pn[--Qn],Pn[Qn]=null}function D0(e,t){Pn[Qn++]=ys,Pn[Qn++]=bs,Pn[Qn++]=xa,ys=t.id,bs=t.overflow,xa=e}var kt=null,at=null,ze=!1,va=null,Yn=!1,Vd=Error(i(519));function ya(e){var t=Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Go(In(t,e)),Vd}function k0(e){var t=e.stateNode,s=e.type,o=e.memoizedProps;switch(t[St]=e,t[Vt]=o,s){case"dialog":ke("cancel",t),ke("close",t);break;case"iframe":case"object":case"embed":ke("load",t);break;case"video":case"audio":for(s=0;s<dr.length;s++)ke(dr[s],t);break;case"source":ke("error",t);break;case"img":case"image":case"link":ke("error",t),ke("load",t);break;case"details":ke("toggle",t);break;case"input":ke("invalid",t),Qg(t,o.value,o.defaultValue,o.checked,o.defaultChecked,o.type,o.name,!0);break;case"select":ke("invalid",t);break;case"textarea":ke("invalid",t),Xg(t,o.value,o.defaultValue,o.children)}s=o.children,typeof s!="string"&&typeof s!="number"&&typeof s!="bigint"||t.textContent===""+s||o.suppressHydrationWarning===!0||nx(t.textContent,s)?(o.popover!=null&&(ke("beforetoggle",t),ke("toggle",t)),o.onScroll!=null&&ke("scroll",t),o.onScrollEnd!=null&&ke("scrollend",t),o.onClick!=null&&(t.onclick=vs),t=!0):t=!1,t||ya(e,!0)}function Mc(e){for(kt=e.return;kt;)switch(kt.tag){case 5:case 31:case 13:Yn=!1;return;case 27:case 3:Yn=!0;return;default:kt=kt.return}}function ui(e){if(e!==kt)return!1;if(!ze)return Mc(e),ze=!0,!1;var t=e.tag,s;if((s=t!==3&&t!==27)&&((s=t===5)&&(s=e.type,s=!(s!=="form"&&s!=="button")||yf(e.type,e.memoizedProps)),s=!s),s&&at&&ya(e),Mc(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(i(317));at=Sx(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(i(317));at=Sx(e)}else t===27?(t=at,ka(e.type)?(e=Rf,Rf=null,at=e):at=t):at=kt?Kn(e.stateNode.nextSibling):null;return!0}function ul(){at=kt=null,ze=!1}function Gd(){var e=va;return e!==null&&(yn===null?yn=e:yn.push.apply(yn,e),va=null),e}function Go(e){va===null?va=[e]:va.push(e)}var qd=mn(null),dl=null,Is=null;function ba(e,t,s){Ve(qd,t._currentValue),t._currentValue=s}function Ps(e){e._currentValue=qd.current,ot(qd)}function Ec(e,t,s){for(;e!==null;){var o=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,o!==null&&(o.childLanes|=t)):o!==null&&(o.childLanes&t)!==t&&(o.childLanes|=t),e===s)break;e=e.return}}function Id(e,t,s,o){var u=e.child;for(u!==null&&(u.return=e);u!==null;){var h=u.dependencies;if(h!==null){var y=u.child;h=h.firstContext;e:for(;h!==null;){var w=h;h=u;for(var L=0;L<t.length;L++)if(w.context===t[L]){h.lanes|=s,w=h.alternate,w!==null&&(w.lanes|=s),Ec(h.return,s,e),o||(y=null);break e}h=w.next}}else if(u.tag===18){if(y=u.return,y===null)throw Error(i(341));y.lanes|=s,h=y.alternate,h!==null&&(h.lanes|=s),Ec(y,s,e),y=null}else u.tag===13&&u.memoizedState!==null&&u.memoizedState.dehydrated===null?(u.lanes|=s,y=u.alternate,y!==null&&(y.lanes|=s),Ec(u.return,s,e),y=u.child,y=y!==null?y.sibling:null):y=u.child;if(y!==null)y.return=u;else for(y=u;y!==null;){if(y===e){y=null;break}if(u=y.sibling,u!==null){u.return=y.return,y=u;break}y=y.return}u=y}}function hl(e,t,s,o){e=null;for(var u=t,h=!1;u!==null;){if(!h){if((u.flags&524288)!==0)h=!0;else if((u.flags&262144)!==0)break}if(u.tag===10){var y=u.alternate;if(y===null)throw Error(i(387));if(y=y.memoizedProps,y!==null){var w=u.type;Tn(u.pendingProps.value,y.value)||(e!==null?e.push(w):e=[w])}}else if(u===Wt.current){if(y=u.alternate,y===null)throw Error(i(387));y.memoizedState.memoizedState!==u.memoizedState.memoizedState&&(e!==null?e.push(ki):e=[ki])}u=u.return}return e!==null&&Id(t,e,s,o),t.flags|=262144,e!==null}function Rc(e){for(e=e.firstContext;e!==null;){if(!Tn(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function fl(e){dl=e,Is=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Gt(e){return L0(dl,e)}function Tc(e,t){return dl===null&&fl(e),L0(e,t)}function L0(e,t){var s=t._currentValue;if(t={context:t,memoizedValue:s,next:null},Is===null){if(e===null)throw Error(i(308));Is=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Is=Is.next=t;return s}var yS=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(s,o){e.push(o)}};this.abort=function(){t.aborted=!0,e.forEach(function(s){return s()})}},bS=n.unstable_scheduleCallback,SS=n.unstable_NormalPriority,wt={$$typeof:re,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Pd(){return{controller:new yS,data:new Map,refCount:0}}function qo(e){e.refCount--,e.refCount===0&&bS(SS,function(){e.controller.abort()})}function $0(e,t){if((e.pendingLanes&4194048)!==0){var s=e.transitionTypes;for(s===null&&(s=e.transitionTypes=[]),e=0;e<t.length;e++){var o=t[e];s.indexOf(o)===-1&&s.push(o)}}}var Io=null;function jS(e){var t=e.transitionTypes;return e.transitionTypes=null,t}var Po=null,Qd=0,ml=0,di=null;function wS(e,t){if(Po===null){var s=Po=[];Qd=0,ml=uf(),di={status:"pending",value:void 0,then:function(o){s.push(o)}}}return Qd++,t.then(H0,H0),t}function H0(){if(--Qd===0&&(Io=null,Po!==null)){di!==null&&(di.status="fulfilled");var e=Po;Po=null,ml=0,di=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function NS(e,t){var s=[],o={status:"pending",value:null,reason:null,then:function(u){s.push(u)}};return e.then(function(){o.status="fulfilled",o.value=t;for(var u=0;u<s.length;u++)(0,s[u])(t)},function(u){for(o.status="rejected",o.reason=u,u=0;u<s.length;u++)(0,s[u])(void 0)}),o}var U0=ge.S;ge.S=function(e,t){if(A1=tt(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&wS(e,t),Io!==null)for(var s=Ti;s!==null;)$0(s,Io),s=s.next;if(s=e.types,s!==null){for(var o=Ti;o!==null;)$0(o,s),o=o.next;if(ml!==0){o=Io,o===null&&(o=Io=[]);for(var u=0;u<s.length;u++){var h=s[u];o.indexOf(h)===-1&&o.push(h)}}}U0!==null&&U0(e,t)};var gl=mn(null);function Yd(){var e=gl.current;return e!==null?e:st.pooledCache}function _c(e,t){t===null?Ve(gl,gl.current):Ve(gl,t.pool)}function B0(){var e=Yd();return e===null?null:{parent:wt._currentValue,pool:e}}var hi=Error(i(460)),Xd=Error(i(474)),Ac=Error(i(542)),Oc={then:function(){}};function F0(e){return e=e.status,e==="fulfilled"||e==="rejected"}function V0(e,t,s){switch(s=e[s],s===void 0?e.push(t):s!==t&&(t.then(vs,vs),t=s),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,q0(e),e===void 0&&!("reason"in t)?Error(i(600)):e;default:if(typeof t.status=="string")t.then(vs,vs);else{if(e=st,e!==null&&100<e.shellSuspendCounter)throw Error(i(482));e=t,e.status="pending",e.then(function(o){if(t.status==="pending"){var u=t;u.status="fulfilled",u.value=o}},function(o){if(t.status==="pending"){var u=t;u.status="rejected",u.reason=o}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,q0(e),e}throw xl=t,hi}}function pl(e){try{var t=e._init;return t(e._payload)}catch(s){throw s!==null&&typeof s=="object"&&typeof s.then=="function"?(xl=s,hi):s}}var xl=null;function G0(){if(xl===null)throw Error(i(459));var e=xl;return xl=null,e}function q0(e){if(e===hi||e===Ac)throw Error(i(483))}var fi=null,Qo=0;function zc(e){var t=Qo;return Qo+=1,fi===null&&(fi=[]),V0(fi,e,t)}function Sa(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function Dc(e,t){throw t.$$typeof===P?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function I0(e){function t(q,H){if(e){var Q=q.deletions;Q===null?(q.deletions=[H],q.flags|=16):Q.push(H)}}function s(q,H){if(!e)return null;for(;H!==null;)t(q,H),H=H.sibling;return null}function o(q){for(var H=new Map;q!==null;)q.key===null?H.set(q.index,q):H.set(q.key,q),q=q.sibling;return H}function u(q,H){return q=Gs(q,H),q.index=0,q.sibling=null,q}function h(q,H,Q){return q.index=Q,e?(Q=q.alternate,Q!==null?(Q=Q.index,Q<H?(q.flags|=2,H):Q):(q.flags|=134217730,H)):(q.flags|=1048576,H)}function y(q){return e&&q.alternate===null&&(q.flags|=134217730),q}function w(q,H,Q,ee){return H===null||H.tag!==6?(H=Ud(Q,q.mode,ee),H.return=q,H):(H=u(H,Q),H.return=q,H)}function L(q,H,Q,ee){var xe=Q.type;return xe===te?(q=K(q,H,Q.props.children,ee,Q.key),Sa(q,Q),q):H!==null&&(H.elementType===xe||typeof xe=="object"&&xe!==null&&xe.$$typeof===ae&&pl(xe)===H.type)?(H=u(H,Q.props),Sa(H,Q),H.return=q,H):(H=wc(Q.type,Q.key,Q.props,null,q.mode,ee),Sa(H,Q),H.return=q,H)}function I(q,H,Q,ee){return H===null||H.tag!==4||H.stateNode.containerInfo!==Q.containerInfo||H.stateNode.implementation!==Q.implementation?(H=Bd(Q,q.mode,ee),H.return=q,H):(H=u(H,Q.children||[]),H.return=q,H)}function K(q,H,Q,ee,xe){return H===null||H.tag!==7?(H=cl(Q,q.mode,ee,xe),H.return=q,H):(H=u(H,Q),H.return=q,H)}function ne(q,H,Q){if(typeof H=="string"&&H!==""||typeof H=="number"||typeof H=="bigint")return H=Ud(""+H,q.mode,Q),H.return=q,H;if(typeof H=="object"&&H!==null){switch(H.$$typeof){case Z:return Q=wc(H.type,H.key,H.props,null,q.mode,Q),Sa(Q,H),Q.return=q,Q;case z:return H=Bd(H,q.mode,Q),H.return=q,H;case ae:return H=pl(H),ne(q,H,Q)}if(Me(H)||oe(H))return H=cl(H,q.mode,Q,null),H.return=q,H;if(typeof H.then=="function")return ne(q,zc(H),Q);if(H.$$typeof===re)return ne(q,Tc(q,H),Q);Dc(q,H)}return null}function F(q,H,Q,ee){var xe=H!==null?H.key:null;if(typeof Q=="string"&&Q!==""||typeof Q=="number"||typeof Q=="bigint")return xe!==null?null:w(q,H,""+Q,ee);if(typeof Q=="object"&&Q!==null){switch(Q.$$typeof){case Z:return Q.key===xe?L(q,H,Q,ee):null;case z:return Q.key===xe?I(q,H,Q,ee):null;case ae:return Q=pl(Q),F(q,H,Q,ee)}if(Me(Q)||oe(Q))return xe!==null?null:K(q,H,Q,ee,null);if(typeof Q.then=="function")return F(q,H,zc(Q),ee);if(Q.$$typeof===re)return F(q,H,Tc(q,Q),ee);Dc(q,Q)}return null}function Y(q,H,Q,ee,xe){if(typeof ee=="string"&&ee!==""||typeof ee=="number"||typeof ee=="bigint")return q=q.get(Q)||null,w(H,q,""+ee,xe);if(typeof ee=="object"&&ee!==null){switch(ee.$$typeof){case Z:return q=q.get(ee.key===null?Q:ee.key)||null,L(H,q,ee,xe);case z:return q=q.get(ee.key===null?Q:ee.key)||null,I(H,q,ee,xe);case ae:return ee=pl(ee),Y(q,H,Q,ee,xe)}if(Me(ee)||oe(ee))return q=q.get(Q)||null,K(H,q,ee,xe,null);if(typeof ee.then=="function")return Y(q,H,Q,zc(ee),xe);if(ee.$$typeof===re)return Y(q,H,Q,Tc(H,ee),xe);Dc(H,ee)}return null}function fe(q,H,Q,ee){for(var xe=null,$e=null,je=H,Ce=H=0,Mt=null;je!==null&&Ce<Q.length;Ce++){je.index>Ce?(Mt=je,je=null):Mt=je.sibling;var Fe=F(q,je,Q[Ce],ee);if(Fe===null){je===null&&(je=Mt);break}e&&je&&Fe.alternate===null&&t(q,je),H=h(Fe,H,Ce),$e===null?xe=Fe:$e.sibling=Fe,$e=Fe,je=Mt}if(Ce===Q.length)return s(q,je),ze&&qs(q,Ce),xe;if(je===null){for(;Ce<Q.length;Ce++)je=ne(q,Q[Ce],ee),je!==null&&(H=h(je,H,Ce),$e===null?xe=je:$e.sibling=je,$e=je);return ze&&qs(q,Ce),xe}for(je=o(je);Ce<Q.length;Ce++)Mt=Y(je,q,Ce,Q[Ce],ee),Mt!==null&&(e&&(Fe=Mt.alternate,Fe!==null&&je.delete(Fe.key===null?Ce:Fe.key)),H=h(Mt,H,Ce),$e===null?xe=Mt:$e.sibling=Mt,$e=Mt);return e&&je.forEach(function(Ba){return t(q,Ba)}),ze&&qs(q,Ce),xe}function ye(q,H,Q,ee){if(Q==null)throw Error(i(151));for(var xe=null,$e=null,je=H,Ce=H=0,Mt=null,Fe=Q.next();je!==null&&!Fe.done;Ce++,Fe=Q.next()){je.index>Ce?(Mt=je,je=null):Mt=je.sibling;var Ba=F(q,je,Fe.value,ee);if(Ba===null){je===null&&(je=Mt);break}e&&je&&Ba.alternate===null&&t(q,je),H=h(Ba,H,Ce),$e===null?xe=Ba:$e.sibling=Ba,$e=Ba,je=Mt}if(Fe.done)return s(q,je),ze&&qs(q,Ce),xe;if(je===null){for(;!Fe.done;Ce++,Fe=Q.next())Fe=ne(q,Fe.value,ee),Fe!==null&&(H=h(Fe,H,Ce),$e===null?xe=Fe:$e.sibling=Fe,$e=Fe);return ze&&qs(q,Ce),xe}for(je=o(je);!Fe.done;Ce++,Fe=Q.next())Fe=Y(je,q,Ce,Fe.value,ee),Fe!==null&&(e&&(Mt=Fe.alternate,Mt!==null&&je.delete(Mt.key===null?Ce:Mt.key)),H=h(Fe,H,Ce),$e===null?xe=Fe:$e.sibling=Fe,$e=Fe);return e&&je.forEach(function(aw){return t(q,aw)}),ze&&qs(q,Ce),xe}function Ae(q,H,Q,ee){if(typeof Q=="object"&&Q!==null&&Q.type===te&&Q.key===null&&Q.props.ref===void 0&&(Q=Q.props.children),typeof Q=="object"&&Q!==null){switch(Q.$$typeof){case Z:e:{for(var xe=Q.key;H!==null;){if(H.key===xe){if(xe=Q.type,xe===te){if(H.tag===7){s(q,H.sibling),ee=u(H,Q.props.children),Sa(ee,Q),ee.return=q,q=ee;break e}}else if(H.elementType===xe||typeof xe=="object"&&xe!==null&&xe.$$typeof===ae&&pl(xe)===H.type){s(q,H.sibling),ee=u(H,Q.props),Sa(ee,Q),ee.return=q,q=ee;break e}s(q,H);break}else t(q,H);H=H.sibling}Q.type===te?(ee=cl(Q.props.children,q.mode,ee,Q.key),Sa(ee,Q),ee.return=q,q=ee):(ee=wc(Q.type,Q.key,Q.props,null,q.mode,ee),Sa(ee,Q),ee.return=q,q=ee)}return y(q);case z:e:{for(xe=Q.key;H!==null;){if(H.key===xe)if(H.tag===4&&H.stateNode.containerInfo===Q.containerInfo&&H.stateNode.implementation===Q.implementation){s(q,H.sibling),ee=u(H,Q.children||[]),ee.return=q,q=ee;break e}else{s(q,H);break}else t(q,H);H=H.sibling}ee=Bd(Q,q.mode,ee),ee.return=q,q=ee}return y(q);case ae:return Q=pl(Q),Ae(q,H,Q,ee)}if(Me(Q))return fe(q,H,Q,ee);if(oe(Q)){if(xe=oe(Q),typeof xe!="function")throw Error(i(150));return Q=xe.call(Q),ye(q,H,Q,ee)}if(typeof Q.then=="function")return Ae(q,H,zc(Q),ee);if(Q.$$typeof===re)return Ae(q,H,Tc(q,Q),ee);Dc(q,Q)}return typeof Q=="string"&&Q!==""||typeof Q=="number"||typeof Q=="bigint"?(Q=""+Q,H!==null&&H.tag===6?(s(q,H.sibling),ee=u(H,Q),ee.return=q,q=ee):(s(q,H),ee=Ud(Q,q.mode,ee),ee.return=q,q=ee),y(q)):s(q,H)}return function(q,H,Q,ee){try{Qo=0;var xe=Ae(q,H,Q,ee);return fi=null,xe}catch(je){if(je===hi||je===Ac)throw je;var $e=pn(29,je,null,q.mode);return $e.lanes=ee,$e.return=q,$e}finally{}}}var vl=I0(!0),P0=I0(!1),ja=!1;function Kd(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Zd(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 wa(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Na(e,t,s){var o=e.updateQueue;if(o===null)return null;if(o=o.shared,(Pe&2)!==0){var u=o.pending;return u===null?t.next=t:(t.next=u.next,u.next=t),o.pending=t,t=jc(e),T0(e,null,s),t}return Sc(e,o,t,s),jc(e)}function Yo(e,t,s){if(t=t.updateQueue,t!==null&&(t=t.shared,(s&4194048)!==0)){var o=t.lanes;o&=e.pendingLanes,s|=o,t.lanes=s,No(e,s)}}function Jd(e,t){var s=e.updateQueue,o=e.alternate;if(o!==null&&(o=o.updateQueue,s===o)){var u=null,h=null;if(s=s.firstBaseUpdate,s!==null){do{var y={lane:s.lane,tag:s.tag,payload:s.payload,callback:null,next:null};h===null?u=h=y:h=h.next=y,s=s.next}while(s!==null);h===null?u=h=t:h=h.next=t}else u=h=t;s={baseState:o.baseState,firstBaseUpdate:u,lastBaseUpdate:h,shared:o.shared,callbacks:o.callbacks},e.updateQueue=s;return}e=s.lastBaseUpdate,e===null?s.firstBaseUpdate=t:e.next=t,s.lastBaseUpdate=t}var Wd=!1;function Xo(){if(Wd){var e=di;if(e!==null)throw e}}function Ko(e,t,s,o){Wd=!1;var u=e.updateQueue;ja=!1;var h=u.firstBaseUpdate,y=u.lastBaseUpdate,w=u.shared.pending;if(w!==null){u.shared.pending=null;var L=w,I=L.next;L.next=null,y===null?h=I:y.next=I,y=L;var K=e.alternate;K!==null&&(K=K.updateQueue,w=K.lastBaseUpdate,w!==y&&(w===null?K.firstBaseUpdate=I:w.next=I,K.lastBaseUpdate=L))}if(h!==null){var ne=u.baseState;y=0,K=I=L=null,w=h;do{var F=w.lane&-536870913,Y=F!==w.lane;if(Y?(Le&F)===F:(o&F)===F){F!==0&&F===ml&&(Wd=!0),K!==null&&(K=K.next={lane:0,tag:w.tag,payload:w.payload,callback:null,next:null});e:{var fe=e,ye=w;F=t;var Ae=s;switch(ye.tag){case 1:if(fe=ye.payload,typeof fe=="function"){ne=fe.call(Ae,ne,F);break e}ne=fe;break e;case 3:fe.flags=fe.flags&-65537|128;case 0:if(fe=ye.payload,F=typeof fe=="function"?fe.call(Ae,ne,F):fe,F==null)break e;ne=D({},ne,F);break e;case 2:ja=!0}}F=w.callback,F!==null&&(e.flags|=64,Y&&(e.flags|=8192),Y=u.callbacks,Y===null?u.callbacks=[F]:Y.push(F))}else Y={lane:F,tag:w.tag,payload:w.payload,callback:w.callback,next:null},K===null?(I=K=Y,L=ne):K=K.next=Y,y|=F;if(w=w.next,w===null){if(w=u.shared.pending,w===null)break;Y=w,w=Y.next,Y.next=null,u.lastBaseUpdate=Y,u.shared.pending=null}}while(!0);K===null&&(L=ne),u.baseState=L,u.firstBaseUpdate=I,u.lastBaseUpdate=K,h===null&&(u.shared.lanes=0),Aa|=y,e.lanes=y,e.memoizedState=ne}}function Q0(e,t){if(typeof e!="function")throw Error(i(191,e));e.call(t)}function Y0(e,t){var s=e.callbacks;if(s!==null)for(e.callbacks=null,e=0;e<s.length;e++)Q0(s[e],t)}var Ca=mn(null),kc=mn(0);function X0(e,t){e=Zs,Ve(kc,e),Ve(Ca,t),Zs=e|t.baseLanes}function eh(){Ve(kc,Zs),Ve(Ca,Ca.current)}function th(){Zs=kc.current,ot(Ca),ot(kc)}var qt=mn(null),en=null;function Ma(e){var t=e.alternate;Ve(It,It.current&1),Ve(qt,e),en===null&&(t===null||Ca.current!==null||t.memoizedState!==null)&&(en=e)}function nh(e){Ve(It,It.current),Ve(qt,e),en===null&&(en=e)}function K0(e){e.tag===22?(Ve(It,It.current),Ve(qt,e),en===null&&(en=e)):Ea()}function Ea(){Ve(It,It.current),Ve(qt,qt.current)}function _n(e){ot(qt),en===e&&(en=null),ot(It)}var It=mn(0);function Zo(e,t){Ve(qt,qt.current),Ve(It,t)}function sh(e){ot(It),ot(qt),en===e&&(en=null)}function Lc(e){for(var t=e;t!==null;){if(t.tag===13){var s=t.memoizedState;if(s!==null&&(s=s.dehydrated,s===null||Mf(s)||Ef(s)))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!=="independent"){if((t.flags&128)!==0)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}var Qs=0,_e=null,nt=null,Nt=null,$c=!1,mi=!1,yl=!1,Hc=0,Jo=0,gi=null,CS=0;function gt(){throw Error(i(321))}function ah(e,t){if(t===null)return!1;for(var s=0;s<t.length&&s<e.length;s++)if(!Tn(e[s],t[s]))return!1;return!0}function lh(e,t,s,o,u,h){return Qs=h,_e=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,ge.H=e===null||e.memoizedState===null?zp:Dp,yl=!1,h=s(o,u),yl=!1,mi&&(h=J0(t,s,o,u)),Z0(e),h}function Z0(e){ge.H=Ic;var t=nt!==null&&nt.next!==null;if(Qs=0,Nt=nt=_e=null,$c=!1,Jo=0,gi=null,t)throw Error(i(300));e===null||Ct||(e=e.dependencies,e!==null&&Rc(e)&&(Ct=!0))}function J0(e,t,s,o){_e=e;var u=0;do{if(mi&&(gi=null),Jo=0,mi=!1,25<=u)throw Error(i(301));if(u+=1,Nt=nt=null,e.updateQueue!=null){var h=e.updateQueue;h.lastEffect=null,h.events=null,h.stores=null,h.memoCache!=null&&(h.memoCache.index=0)}ge.H=zS,h=t(s,o)}while(mi);return h}function MS(){var e=ge.H,t=e.useState()[0];return t=typeof t.then=="function"?Wo(t):t,e=e.useState()[0],(nt!==null?nt.memoizedState:null)!==e&&(_e.flags|=1024),t}function ih(){var e=Hc!==0;return Hc=0,e}function oh(e,t,s){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s}function rh(e){if($c){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}$c=!1}Qs=0,Nt=nt=_e=null,mi=!1,Jo=Hc=0,gi=null}function rn(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Nt===null?_e.memoizedState=Nt=e:Nt=Nt.next=e,Nt}function vt(){if(nt===null){var e=_e.alternate;e=e!==null?e.memoizedState:null}else e=nt.next;var t=Nt===null?_e.memoizedState:Nt.next;if(t!==null)Nt=t,nt=e;else{if(e===null)throw _e.alternate===null?Error(i(467)):Error(i(310));nt=e,e={memoizedState:nt.memoizedState,baseState:nt.baseState,baseQueue:nt.baseQueue,queue:nt.queue,next:null},Nt===null?_e.memoizedState=Nt=e:Nt=Nt.next=e}return Nt}function Uc(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Wo(e){var t=Jo;return Jo+=1,gi===null&&(gi=[]),e=V0(gi,e,t),t=_e,(Nt===null?t.memoizedState:Nt.next)===null&&(t=t.alternate,ge.H=t===null||t.memoizedState===null?zp:Dp),e}function Bc(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Wo(e);if(e.$$typeof===U)return;if(e.$$typeof===re)return Gt(e)}throw Error(i(438,String(e)))}function ch(e){var t=null,s=_e.updateQueue;if(s!==null&&(t=s.memoCache),t==null){var o=_e.alternate;o!==null&&(o=o.updateQueue,o!==null&&(o=o.memoCache,o!=null&&(t={data:o.data.map(function(u){return u.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),s===null&&(s=Uc(),_e.updateQueue=s),s.memoCache=t,s=t.data[t.index],s===void 0)for(s=t.data[t.index]=Array(e),o=0;o<e;o++)s[o]=ce;return t.index++,s}function Ys(e,t){return typeof t=="function"?t(e):t}function Fc(e){var t=vt();return uh(t,nt,e)}function uh(e,t,s){var o=e.queue;if(o===null)throw Error(i(311));o.lastRenderedReducer=s;var u=e.baseQueue,h=o.pending;if(h!==null){if(u!==null){var y=u.next;u.next=h.next,h.next=y}t.baseQueue=u=h,o.pending=null}if(h=e.baseState,u===null)e.memoizedState=h;else{t=u.next;var w=y=null,L=null,I=t,K=!1;do{var ne=I.lane&-536870913;if(ne!==I.lane?(Le&ne)===ne:(Qs&ne)===ne){var F=I.revertLane;if(F===0)L!==null&&(L=L.next={lane:0,revertLane:0,gesture:null,action:I.action,hasEagerState:I.hasEagerState,eagerState:I.eagerState,next:null}),ne===ml&&(K=!0);else if((Qs&F)===F){I=I.next,F===ml&&(K=!0);continue}else ne={lane:0,revertLane:I.revertLane,gesture:null,action:I.action,hasEagerState:I.hasEagerState,eagerState:I.eagerState,next:null},L===null?(w=L=ne,y=h):L=L.next=ne,_e.lanes|=F,Aa|=F;ne=I.action,yl&&s(h,ne),h=I.hasEagerState?I.eagerState:s(h,ne)}else F={lane:ne,revertLane:I.revertLane,gesture:I.gesture,action:I.action,hasEagerState:I.hasEagerState,eagerState:I.eagerState,next:null},L===null?(w=L=F,y=h):L=L.next=F,_e.lanes|=ne,Aa|=ne;I=I.next}while(I!==null&&I!==t);if(L===null?y=h:L.next=w,!Tn(h,e.memoizedState)&&(Ct=!0,K&&(s=di,s!==null)))throw s;e.memoizedState=h,e.baseState=y,e.baseQueue=L,o.lastRenderedState=h}return u===null&&(o.lanes=0),[e.memoizedState,o.dispatch]}function dh(e){var t=vt(),s=t.queue;if(s===null)throw Error(i(311));s.lastRenderedReducer=e;var o=s.dispatch,u=s.pending,h=t.memoizedState;if(u!==null){s.pending=null;var y=u=u.next;do h=e(h,y.action),y=y.next;while(y!==u);Tn(h,t.memoizedState)||(Ct=!0),t.memoizedState=h,t.baseQueue===null&&(t.baseState=h),s.lastRenderedState=h}return[h,o]}function W0(e,t,s){var o=_e,u=vt(),h=ze;if(h){if(s===void 0)throw Error(i(407));s=s()}else s=t();var y=!Tn((nt||u).memoizedState,s);if(y&&(u.memoizedState=s,Ct=!0),u=u.queue,mh(np.bind(null,o,u,e),[e]),e=u.getSnapshot!==t||y||Nt!==null&&(Nt.memoizedState.tag&1)!==0,pi(e?9:8,{destroy:void 0},tp.bind(null,o,u,s,t),null),e){if(o.flags|=2048,st===null)throw Error(i(349));h||(Qs&127)!==0||ep(o,t,s)}return s}function ep(e,t,s){e.flags|=16384,e={getSnapshot:t,value:s},t=_e.updateQueue,t===null?(t=Uc(),_e.updateQueue=t,t.stores=[e]):(s=t.stores,s===null?t.stores=[e]:s.push(e))}function tp(e,t,s,o){t.value=s,t.getSnapshot=o,sp(t)&&ap(e)}function np(e,t,s){return s(function(){sp(t)&&ap(e)})}function sp(e){var t=e.getSnapshot;e=e.value;try{var s=t();return!Tn(e,s)}catch{return!0}}function ap(e){var t=rl(e,2);t!==null&&bn(t,e,2)}function hh(e){var t=rn();if(typeof e=="function"){var s=e;if(e=s(),yl){ts(!0);try{s()}finally{ts(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ys,lastRenderedState:e},t}function lp(e,t,s,o){return e.baseState=s,uh(e,nt,typeof o=="function"?o:Ys)}function ES(e,t,s,o,u){if(qc(e))throw Error(i(485));if(e=t.action,e!==null){var h={payload:u,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(y){h.listeners.push(y)}};ge.T!==null?s(!0):h.isTransition=!1,o(h),s=t.pending,s===null?(h.next=t.pending=h,ip(t,h)):(h.next=s.next,t.pending=s.next=h)}}function ip(e,t){var s=t.action,o=t.payload,u=e.state;if(t.isTransition){var h=ge.T,y={};y.types=h!==null?h.types:null,ge.T=y;try{var w=s(u,o),L=ge.S;L!==null&&L(y,w),op(e,t,w)}catch(I){fh(e,t,I)}finally{h!==null&&y.types!==null&&(h.types=y.types),ge.T=h}}else try{h=s(u,o),op(e,t,h)}catch(I){fh(e,t,I)}}function op(e,t,s){s!==null&&typeof s=="object"&&typeof s.then=="function"?s.then(function(o){rp(e,t,o)},function(o){return fh(e,t,o)}):rp(e,t,s)}function rp(e,t,s){t.status="fulfilled",t.value=s,cp(t),e.state=s,t=e.pending,t!==null&&(s=t.next,s===t?e.pending=null:(s=s.next,t.next=s,ip(e,s)))}function fh(e,t,s){var o=e.pending;if(e.pending=null,o!==null){o=o.next;do t.status="rejected",t.reason=s,cp(t),t=t.next;while(t!==o)}e.action=null}function cp(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function up(e,t){return t}function dp(e,t){if(ze){var s=st.formState;if(s!==null){e:{var o=_e;if(ze){if(at){t:{for(var u=at,h=Yn;u.nodeType!==8;){if(!h){u=null;break t}if(u=Kn(u.nextSibling),u===null){u=null;break t}}h=u.data,u=h==="F!"||h==="F"?u:null}if(u){at=Kn(u.nextSibling),o=u.data==="F!";break e}}ya(o)}o=!1}o&&(t=s[0])}}return s=rn(),s.memoizedState=s.baseState=t,o={pending:null,lanes:0,dispatch:null,lastRenderedReducer:up,lastRenderedState:t},s.queue=o,s=_p.bind(null,_e,o),o.dispatch=s,o=hh(!1),h=yh.bind(null,_e,!1,o.queue),o=rn(),u={state:t,dispatch:null,action:e,pending:null},o.queue=u,s=ES.bind(null,_e,u,h,s),u.dispatch=s,o.memoizedState=e,[t,s,!1]}function hp(e){var t=vt();return fp(t,nt,e)}function fp(e,t,s){if(t=uh(e,t,up)[0],e=Fc(Ys)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var o=Wo(t)}catch(y){throw y===hi?Ac:y}else o=t;t=vt();var u=t.queue,h=u.dispatch;return s!==t.memoizedState&&(_e.flags|=2048,pi(9,{destroy:void 0},RS.bind(null,u,s),null)),[o,h,e]}function RS(e,t){e.action=t}function mp(e){var t=vt(),s=nt;if(s!==null)return fp(t,s,e);vt(),t=t.memoizedState,s=vt();var o=s.queue.dispatch;return s.memoizedState=e,[t,o,!1]}function pi(e,t,s,o){return e={tag:e,create:s,deps:o,inst:t,next:null},t=_e.updateQueue,t===null&&(t=Uc(),_e.updateQueue=t),s=t.lastEffect,s===null?t.lastEffect=e.next=e:(o=s.next,s.next=e,e.next=o,t.lastEffect=e),e}function gp(){return vt().memoizedState}function Vc(e,t,s,o){var u=rn();_e.flags|=e,u.memoizedState=pi(1|t,{destroy:void 0},s,o===void 0?null:o)}function Gc(e,t,s,o){var u=vt();o=o===void 0?null:o;var h=u.memoizedState.inst;nt!==null&&o!==null&&ah(o,nt.memoizedState.deps)?u.memoizedState=pi(t,h,s,o):(_e.flags|=e,u.memoizedState=pi(1|t,h,s,o))}function pp(e,t){Vc(8390656,8,e,t)}function mh(e,t){Gc(2048,8,e,t)}function TS(e){_e.flags|=4;var t=_e.updateQueue;if(t===null)t=Uc(),_e.updateQueue=t,t.events=[e];else{var s=t.events;s===null?t.events=[e]:s.push(e)}}function xp(e){var t=vt().memoizedState;return TS({ref:t,nextImpl:e}),function(){if((Pe&2)!==0)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function vp(e,t){return Gc(4,2,e,t)}function yp(e,t){return Gc(4,4,e,t)}function bp(e,t){if(typeof t=="function"){e=e();var s=t(e);return function(){typeof s=="function"?s():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Sp(e,t,s){s=s!=null?s.concat([e]):null,Gc(4,4,bp.bind(null,t,e),s)}function gh(){}function jp(e,t){var s=vt();t=t===void 0?null:t;var o=s.memoizedState;return t!==null&&ah(t,o[1])?o[0]:(s.memoizedState=[e,t],e)}function wp(e,t){var s=vt();t=t===void 0?null:t;var o=s.memoizedState;if(t!==null&&ah(t,o[1]))return o[0];if(o=e(),yl){ts(!0);try{e()}finally{ts(!1)}}return s.memoizedState=[o,t],o}function ph(e,t,s){return s===void 0||(Qs&1073741824)!==0&&(Le&261930)===0?e.memoizedState=t:(e.memoizedState=s,e=z1(),_e.lanes|=e,Aa|=e,s)}function Np(e,t,s,o){return Tn(s,t)?s:Ca.current!==null?(e=ph(e,s,o),Tn(e,t)||(Ct=!0),e):(Qs&106)===0||(Qs&1073741824)!==0&&(Le&261930)===0?(Ct=!0,e.memoizedState=s):(e=z1(),_e.lanes|=e,Aa|=e,t)}function Cp(e,t,s,o,u){var h=ve.p;ve.p=h!==0&&8>h?h:8;var y=ge.T,w={};w.types=y!==null?y.types:null,ge.T=w,yh(e,!1,t,s);try{var L=u(),I=ge.S;if(I!==null&&I(w,L),L!==null&&typeof L=="object"&&typeof L.then=="function"){var K=NS(L,o);er(e,t,K,Dn(e))}else er(e,t,o,Dn(e))}catch(ne){er(e,t,{then:function(){},status:"rejected",reason:ne},Dn())}finally{ve.p=h,y!==null&&w.types!==null&&(y.types=w.types),ge.T=y}}function _S(){}function xh(e,t,s,o){if(e.tag!==5)throw Error(i(476));var u=Mp(e).queue;Cp(e,u,t,ut,s===null?_S:function(){return Ep(e),s(o)})}function Mp(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ut,baseState:ut,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ys,lastRenderedState:ut},next:null};var s={};return t.next={memoizedState:s,baseState:s,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ys,lastRenderedState:s},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Ep(e){var t=Mp(e);t.next===null&&(t=e.alternate.memoizedState),er(e,t.next.queue,{},Dn())}function vh(){return Gt(ki)}function Rp(){return vt().memoizedState}function Tp(){return vt().memoizedState}function AS(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var s=Dn();e=wa(s);var o=Na(t,e,s);o!==null&&(bn(o,t,s),Yo(o,t,s)),t={cache:Pd()},e.payload=t;return}t=t.return}}function OS(e,t,s){var o=Dn();s={lane:o,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},qc(e)?Ap(t,s):(s=$d(e,t,s,o),s!==null&&(bn(s,e,o),Op(s,t,o)))}function _p(e,t,s){var o=Dn();er(e,t,s,o)}function er(e,t,s,o){var u={lane:o,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null};if(qc(e))Ap(t,u);else{var h=e.alternate;if(e.lanes===0&&(h===null||h.lanes===0)&&(h=t.lastRenderedReducer,h!==null))try{var y=t.lastRenderedState,w=h(y,s);if(u.hasEagerState=!0,u.eagerState=w,Tn(w,y))return Sc(e,t,u,0),st===null&&bc(),!1}catch{}finally{}if(s=$d(e,t,u,o),s!==null)return bn(s,e,o),Op(s,t,o),!0}return!1}function yh(e,t,s,o){if(o={lane:2,revertLane:uf(),gesture:null,action:o,hasEagerState:!1,eagerState:null,next:null},qc(e)){if(t)throw Error(i(479))}else t=$d(e,s,o,2),t!==null&&bn(t,e,2)}function qc(e){var t=e.alternate;return e===_e||t!==null&&t===_e}function Ap(e,t){mi=$c=!0;var s=e.pending;s===null?t.next=t:(t.next=s.next,s.next=t),e.pending=t}function Op(e,t,s){if((s&4194048)!==0){var o=t.lanes;o&=e.pendingLanes,s|=o,t.lanes=s,No(e,s)}}var Ic={readContext:Gt,use:Bc,useCallback:gt,useContext:gt,useEffect:gt,useImperativeHandle:gt,useLayoutEffect:gt,useInsertionEffect:gt,useMemo:gt,useReducer:gt,useRef:gt,useState:gt,useDebugValue:gt,useDeferredValue:gt,useTransition:gt,useSyncExternalStore:gt,useId:gt,useHostTransitionStatus:gt,useFormState:gt,useActionState:gt,useOptimistic:gt,useMemoCache:gt,useCacheRefresh:gt,useEffectEvent:gt},zp={readContext:Gt,use:Bc,useCallback:function(e,t){return rn().memoizedState=[e,t===void 0?null:t],e},useContext:Gt,useEffect:pp,useImperativeHandle:function(e,t,s){s=s!=null?s.concat([e]):null,Vc(4194308,4,bp.bind(null,t,e),s)},useLayoutEffect:function(e,t){return Vc(4194308,4,e,t)},useInsertionEffect:function(e,t){Vc(4,2,e,t)},useMemo:function(e,t){var s=rn();t=t===void 0?null:t;var o=e();if(yl){ts(!0);try{e()}finally{ts(!1)}}return s.memoizedState=[o,t],o},useReducer:function(e,t,s){var o=rn();if(s!==void 0){var u=s(t);if(yl){ts(!0);try{s(t)}finally{ts(!1)}}}else u=t;return o.memoizedState=o.baseState=u,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:u},o.queue=e,e=e.dispatch=OS.bind(null,_e,e),[o.memoizedState,e]},useRef:function(e){var t=rn();return e={current:e},t.memoizedState=e},useState:function(e){e=hh(e);var t=e.queue,s=_p.bind(null,_e,t);return t.dispatch=s,[e.memoizedState,s]},useDebugValue:gh,useDeferredValue:function(e,t){var s=rn();return ph(s,e,t)},useTransition:function(){var e=hh(!1);return e=Cp.bind(null,_e,e.queue,!0,!1),rn().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,s){var o=_e,u=rn();if(ze){if(s===void 0)throw Error(i(407));s=s()}else{if(s=t(),st===null)throw Error(i(349));(Le&127)!==0||ep(o,t,s)}u.memoizedState=s;var h={value:s,getSnapshot:t};return u.queue=h,pp(np.bind(null,o,h,e),[e]),o.flags|=2048,pi(9,{destroy:void 0},tp.bind(null,o,h,s,t),null),s},useId:function(){var e=rn(),t=st.identifierPrefix;if(ze){var s=bs,o=ys;s=(o&~(1<<32-ln(o)-1)).toString(32)+s,t="_"+t+"R_"+s,s=Hc++,0<s&&(t+="H"+s.toString(32)),t+="_"}else s=CS++,t="_"+t+"r_"+s.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:vh,useFormState:dp,useActionState:dp,useOptimistic:function(e){var t=rn();t.memoizedState=t.baseState=e;var s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=s,t=yh.bind(null,_e,!0,s),s.dispatch=t,[e,t]},useMemoCache:ch,useCacheRefresh:function(){return rn().memoizedState=AS.bind(null,_e)},useEffectEvent:function(e){var t=rn(),s={impl:e};return t.memoizedState=s,function(){if((Pe&2)!==0)throw Error(i(440));return s.impl.apply(void 0,arguments)}}},Dp={readContext:Gt,use:Bc,useCallback:jp,useContext:Gt,useEffect:mh,useImperativeHandle:Sp,useInsertionEffect:vp,useLayoutEffect:yp,useMemo:wp,useReducer:Fc,useRef:gp,useState:function(){return Fc(Ys)},useDebugValue:gh,useDeferredValue:function(e,t){var s=vt();return Np(s,nt.memoizedState,e,t)},useTransition:function(){var e=Fc(Ys)[0],t=vt().memoizedState;return[typeof e=="boolean"?e:Wo(e),t]},useSyncExternalStore:W0,useId:Rp,useHostTransitionStatus:vh,useFormState:hp,useActionState:hp,useOptimistic:function(e,t){var s=vt();return lp(s,nt,e,t)},useMemoCache:ch,useCacheRefresh:Tp,useEffectEvent:xp},zS={readContext:Gt,use:Bc,useCallback:jp,useContext:Gt,useEffect:mh,useImperativeHandle:Sp,useInsertionEffect:vp,useLayoutEffect:yp,useMemo:wp,useReducer:dh,useRef:gp,useState:function(){return dh(Ys)},useDebugValue:gh,useDeferredValue:function(e,t){var s=vt();return nt===null?ph(s,e,t):Np(s,nt.memoizedState,e,t)},useTransition:function(){var e=dh(Ys)[0],t=vt().memoizedState;return[typeof e=="boolean"?e:Wo(e),t]},useSyncExternalStore:W0,useId:Rp,useHostTransitionStatus:vh,useFormState:mp,useActionState:mp,useOptimistic:function(e,t){var s=vt();return nt!==null?lp(s,nt,e,t):(s.baseState=e,[e,s.queue.dispatch])},useMemoCache:ch,useCacheRefresh:Tp,useEffectEvent:xp};function bh(e,t,s,o){t=e.memoizedState,s=s(o,t),s=s==null?t:D({},t,s),e.memoizedState=s,e.lanes===0&&(e.updateQueue.baseState=s)}var Sh={enqueueSetState:function(e,t,s){e=e._reactInternals;var o=Dn(),u=wa(o);u.payload=t,s!=null&&(u.callback=s),t=Na(e,u,o),t!==null&&(bn(t,e,o),Yo(t,e,o))},enqueueReplaceState:function(e,t,s){e=e._reactInternals;var o=Dn(),u=wa(o);u.tag=1,u.payload=t,s!=null&&(u.callback=s),t=Na(e,u,o),t!==null&&(bn(t,e,o),Yo(t,e,o))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var s=Dn(),o=wa(s);o.tag=2,t!=null&&(o.callback=t),t=Na(e,o,s),t!==null&&(bn(t,e,s),Yo(t,e,s))}};function kp(e,t,s,o,u,h,y){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(o,h,y):t.prototype&&t.prototype.isPureReactComponent?!Bo(s,o)||!Bo(u,h):!0}function Lp(e,t,s,o){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(s,o),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(s,o),t.state!==e&&Sh.enqueueReplaceState(t,t.state,null)}function bl(e,t){var s=t;if("ref"in t){s={};for(var o in t)o!=="ref"&&(s[o]=t[o])}if(e=e.defaultProps){s===t&&(s=D({},s));for(var u in e)s[u]===void 0&&(s[u]=e[u])}return s}function $p(e){yc(e)}function Hp(e){console.error(e)}function Up(e){yc(e)}function Pc(e,t){try{var s=e.onUncaughtError;s(t.value,{componentStack:t.stack})}catch(o){setTimeout(function(){throw o})}}function Bp(e,t,s){try{var o=e.onCaughtError;o(s.value,{componentStack:s.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(u){setTimeout(function(){throw u})}}function jh(e,t,s){return s=wa(s),s.tag=3,s.payload={element:null},s.callback=function(){Pc(e,t)},s}function Fp(e){return e=wa(e),e.tag=3,e}function Vp(e,t,s,o){var u=s.type.getDerivedStateFromError;if(typeof u=="function"){var h=o.value;e.payload=function(){return u(h)},e.callback=function(){Bp(t,s,o)}}var y=s.stateNode;y!==null&&typeof y.componentDidCatch=="function"&&(e.callback=function(){Bp(t,s,o),typeof u!="function"&&(Oa===null?Oa=new Set([this]):Oa.add(this));var w=o.stack;this.componentDidCatch(o.value,{componentStack:w!==null?w:""})})}function DS(e,t,s,o,u){if(s.flags|=32768,o!==null&&typeof o=="object"&&typeof o.then=="function"){if(t=s.alternate,t!==null&&hl(t,s,u,!0),s=qt.current,s!==null){switch(s.tag){case 31:case 13:case 19:return en===null?fu():s.alternate===null&&pt===0&&(pt=3),s.flags&=-257,s.flags|=65536,s.lanes=u,o===Oc?s.flags|=16384:(t=s.updateQueue,t===null?s.updateQueue=new Set([o]):t.add(o),of(e,o,u)),!1;case 22:return s.flags|=65536,o===Oc?s.flags|=16384:(t=s.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([o])},s.updateQueue=t):(s=t.retryQueue,s===null?t.retryQueue=new Set([o]):s.add(o)),of(e,o,u)),!1}throw Error(i(435,s.tag))}return of(e,o,u),fu(),!1}if(ze)return t=qt.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=u,o!==Vd&&(e=Error(i(422),{cause:o}),Go(In(e,s)))):(o!==Vd&&(t=Error(i(423),{cause:o}),Go(In(t,s))),e=e.current.alternate,e.flags|=65536,u&=-u,e.lanes|=u,o=In(o,s),u=jh(e.stateNode,o,u),Jd(e,u),pt!==4&&(pt=2)),!1;var h=Error(i(520),{cause:o});if(h=In(h,s),rr===null?rr=[h]:rr.push(h),pt!==4&&(pt=2),t===null)return!0;o=In(o,s),s=t;do{switch(s.tag){case 3:return s.flags|=65536,e=u&-u,s.lanes|=e,e=jh(s.stateNode,o,e),Jd(s,e),!1;case 1:if(t=s.type,h=s.stateNode,(s.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||h!==null&&typeof h.componentDidCatch=="function"&&(Oa===null||!Oa.has(h))))return s.flags|=65536,u&=-u,s.lanes|=u,u=Fp(u),Vp(u,e,s,o),Jd(s,u),!1;break;case 22:if(s.memoizedState!==null)return s.flags|=65536,!1}s=s.return}while(s!==null);return!1}var wh=Error(i(461)),Ct=!1;function Tt(e,t,s,o){t.child=e===null?P0(t,null,s,o):vl(t,e.child,s,o)}function Gp(e,t,s,o,u){s=s.render;var h=t.ref;if("ref"in o){var y={};for(var w in o)w!=="ref"&&(y[w]=o[w])}else y=o;return fl(t),o=lh(e,t,s,y,h,u),w=ih(),e!==null&&!Ct?(oh(e,t,u),Xs(e,t,u)):(ze&&w&&Cc(t),t.flags|=1,Tt(e,t,o,u),t.child)}function qp(e,t,s,o,u){if(e===null){var h=s.type;return typeof h=="function"&&!Hd(h)&&h.defaultProps===void 0&&s.compare===null?(t.tag=15,t.type=h,Ip(e,t,h,o,u)):(e=wc(s.type,null,o,t,t.mode,u),e.ref=t.ref,e.return=t,t.child=e)}if(h=e.child,!Ah(e,u)){var y=h.memoizedProps;if(s=s.compare,s=s!==null?s:Bo,s(y,o)&&e.ref===t.ref)return Xs(e,t,u)}return t.flags|=1,e=Gs(h,o),e.ref=t.ref,e.return=t,t.child=e}function Ip(e,t,s,o,u){if(e!==null){var h=e.memoizedProps;if(Bo(h,o)&&e.ref===t.ref)if(Ct=!1,t.pendingProps=o=h,Ah(e,u))(e.flags&131072)!==0&&(Ct=!0);else return t.lanes=e.lanes,Xs(e,t,u)}return Nh(e,t,s,o,u)}function Pp(e,t,s,o){var u=o.children,h=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),o.mode==="hidden"){if((t.flags&128)!==0){if(h=h!==null?h.baseLanes|s:s,e!==null){for(o=t.child=e.child,u=0;o!==null;)u=u|o.lanes|o.childLanes,o=o.sibling;o=u&~h}else o=0,t.child=null;return Qp(e,t,h,s,o)}if((s&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&_c(t,h!==null?h.cachePool:null),h!==null?X0(t,h):eh(),K0(t);else return o=t.lanes=536870912,Qp(e,t,h!==null?h.baseLanes|s:s,s,o)}else h!==null?(_c(t,h.cachePool),X0(t,h),Ea(),t.memoizedState=null):(e!==null&&_c(t,null),eh(),Ea());return Tt(e,t,u,s),t.child}function tr(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Qp(e,t,s,o,u){var h=Yd();return h=h===null?null:{parent:wt._currentValue,pool:h},t.memoizedState={baseLanes:s,cachePool:h},e!==null&&_c(t,null),eh(),K0(t),e!==null&&hl(e,t,o,!0),t.childLanes=u,null}function Qc(e,t){return t=Yc({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Yp(e,t,s){return vl(t,e.child,null,s),e=Qc(t,t.pendingProps),e.flags|=2,_n(t),t.memoizedState=null,e}function kS(e,t,s){var o=t.pendingProps,u=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(ze){if(o.mode==="hidden")return e=Qc(t,o),t.lanes=536870912,e.memoizedState={baseLanes:0,cachePool:null},tr(null,e);if(nh(t),(e=at)?(e=bx(e,Yn),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:xa!==null?{id:ys,overflow:bs}:null,retryLane:536870912,hydrationErrors:null},s=A0(e),s.return=t,t.child=s,kt=t,at=null)):e=null,e===null)throw ya(t);return t.lanes=536870912,null}return Qc(t,o)}var h=e.memoizedState;if(h!==null){var y=h.dehydrated;if(nh(t),u)if(t.flags&256)t.flags&=-257,t=Yp(e,t,s);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558));else if(Ct||hl(e,t,s,!1),u=(s&e.childLanes)!==0,Ct||u){if(Ca.current===null){if(o=st,o!==null&&(y=Co(o,s),y!==0&&y!==h.retryLane))throw h.retryLane=y,rl(e,y),bn(o,e,y),wh;fu()}t=Yp(e,t,s)}else e=h.treeContext,at=Kn(y.nextSibling),kt=t,ze=!0,va=null,Yn=!1,e!==null&&D0(t,e),t=Qc(t,o),t.flags|=134221824;return t}return e=Gs(e.child,{mode:o.mode,children:o.children}),e.ref=t.ref,t.child=e,e.return=t,e}function xi(e,t){var s=t.ref;if(s===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof s!="function"&&typeof s!="object")throw Error(i(284));(e===null||e.ref!==s)&&(t.flags|=4194816)}}function Nh(e,t,s,o,u){return fl(t),s=lh(e,t,s,o,void 0,u),o=ih(),e!==null&&!Ct?(oh(e,t,u),Xs(e,t,u)):(ze&&o&&Cc(t),t.flags|=1,Tt(e,t,s,u),t.child)}function Xp(e,t,s,o,u,h){return fl(t),t.updateQueue=null,s=J0(t,o,s,u),Z0(e),o=ih(),e!==null&&!Ct?(oh(e,t,h),Xs(e,t,h)):(ze&&o&&Cc(t),t.flags|=1,Tt(e,t,s,h),t.child)}function Kp(e,t,s,o,u){if(fl(t),t.stateNode===null){var h=oi,y=s.contextType;typeof y=="object"&&y!==null&&(h=Gt(y)),h=new s(o,h),t.memoizedState=h.state!==null&&h.state!==void 0?h.state:null,h.updater=Sh,t.stateNode=h,h._reactInternals=t,h=t.stateNode,h.props=o,h.state=t.memoizedState,h.refs={},Kd(t),y=s.contextType,h.context=typeof y=="object"&&y!==null?Gt(y):oi,h.state=t.memoizedState,y=s.getDerivedStateFromProps,typeof y=="function"&&(bh(t,s,y,o),h.state=t.memoizedState),typeof s.getDerivedStateFromProps=="function"||typeof h.getSnapshotBeforeUpdate=="function"||typeof h.UNSAFE_componentWillMount!="function"&&typeof h.componentWillMount!="function"||(y=h.state,typeof h.componentWillMount=="function"&&h.componentWillMount(),typeof h.UNSAFE_componentWillMount=="function"&&h.UNSAFE_componentWillMount(),y!==h.state&&Sh.enqueueReplaceState(h,h.state,null),Ko(t,o,h,u),Xo(),h.state=t.memoizedState),typeof h.componentDidMount=="function"&&(t.flags|=4194308),o=!0}else if(e===null){h=t.stateNode;var w=t.memoizedProps,L=bl(s,w);h.props=L;var I=h.context,K=s.contextType;y=oi,typeof K=="object"&&K!==null&&(y=Gt(K));var ne=s.getDerivedStateFromProps;K=typeof ne=="function"||typeof h.getSnapshotBeforeUpdate=="function",w=t.pendingProps!==w,K||typeof h.UNSAFE_componentWillReceiveProps!="function"&&typeof h.componentWillReceiveProps!="function"||(w||I!==y)&&Lp(t,h,o,y),ja=!1;var F=t.memoizedState;h.state=F,Ko(t,o,h,u),Xo(),I=t.memoizedState,w||F!==I||ja?(typeof ne=="function"&&(bh(t,s,ne,o),I=t.memoizedState),(L=ja||kp(t,s,L,o,F,I,y))?(K||typeof h.UNSAFE_componentWillMount!="function"&&typeof h.componentWillMount!="function"||(typeof h.componentWillMount=="function"&&h.componentWillMount(),typeof h.UNSAFE_componentWillMount=="function"&&h.UNSAFE_componentWillMount()),typeof h.componentDidMount=="function"&&(t.flags|=4194308)):(typeof h.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=o,t.memoizedState=I),h.props=o,h.state=I,h.context=y,o=L):(typeof h.componentDidMount=="function"&&(t.flags|=4194308),o=!1)}else{h=t.stateNode,Zd(e,t),y=t.memoizedProps,K=bl(s,y),h.props=K,ne=t.pendingProps,F=h.context,I=s.contextType,L=oi,typeof I=="object"&&I!==null&&(L=Gt(I)),w=s.getDerivedStateFromProps,(I=typeof w=="function"||typeof h.getSnapshotBeforeUpdate=="function")||typeof h.UNSAFE_componentWillReceiveProps!="function"&&typeof h.componentWillReceiveProps!="function"||(y!==ne||F!==L)&&Lp(t,h,o,L),ja=!1,F=t.memoizedState,h.state=F,Ko(t,o,h,u),Xo();var Y=t.memoizedState;y!==ne||F!==Y||ja||e!==null&&e.dependencies!==null&&Rc(e.dependencies)?(typeof w=="function"&&(bh(t,s,w,o),Y=t.memoizedState),(K=ja||kp(t,s,K,o,F,Y,L)||e!==null&&e.dependencies!==null&&Rc(e.dependencies))?(I||typeof h.UNSAFE_componentWillUpdate!="function"&&typeof h.componentWillUpdate!="function"||(typeof h.componentWillUpdate=="function"&&h.componentWillUpdate(o,Y,L),typeof h.UNSAFE_componentWillUpdate=="function"&&h.UNSAFE_componentWillUpdate(o,Y,L)),typeof h.componentDidUpdate=="function"&&(t.flags|=4),typeof h.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof h.componentDidUpdate!="function"||y===e.memoizedProps&&F===e.memoizedState||(t.flags|=4),typeof h.getSnapshotBeforeUpdate!="function"||y===e.memoizedProps&&F===e.memoizedState||(t.flags|=1024),t.memoizedProps=o,t.memoizedState=Y),h.props=o,h.state=Y,h.context=L,o=K):(typeof h.componentDidUpdate!="function"||y===e.memoizedProps&&F===e.memoizedState||(t.flags|=4),typeof h.getSnapshotBeforeUpdate!="function"||y===e.memoizedProps&&F===e.memoizedState||(t.flags|=1024),o=!1)}return h=o,xi(e,t),o=(t.flags&128)!==0,h||o?(h=t.stateNode,s=o&&typeof s.getDerivedStateFromError!="function"?null:h.render(),t.flags|=1,e!==null&&o?(t.child=vl(t,e.child,null,u),t.child=vl(t,null,s,u)):Tt(e,t,s,u),t.memoizedState=h.state,e=t.child):e=Xs(e,t,u),e}function Zp(e,t,s,o){return ul(),t.flags|=256,Tt(e,t,s,o),t.child}var Ch={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Mh(e){return{baseLanes:e,cachePool:B0()}}function Eh(e,t,s){return e=e!==null?e.childLanes&~s:0,t&&(e|=zn),e}function Jp(e,t,s){var o=t.pendingProps,u=!1,h=(t.flags&128)!==0,y;if((y=h)||(y=e!==null&&e.memoizedState===null?!1:(It.current&2)!==0),y&&(u=!0,t.flags&=-129),y=(t.flags&32)!==0,t.flags&=-33,e===null){if(ze){if(u?Ma(t):Ea(),(e=at)?(e=bx(e,Yn),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:xa!==null?{id:ys,overflow:bs}:null,retryLane:536870912,hydrationErrors:null},s=A0(e),s.return=t,t.child=s,kt=t,at=null)):e=null,e===null)throw ya(t);return Ef(e)?t.lanes=32:t.lanes=536870912,null}return h=o.children,o=o.fallback,u?(Ea(),u=t.mode,h=Yc({mode:"hidden",children:h},u),o=cl(o,u,s,null),h.return=t,o.return=t,h.sibling=o,t.child=h,o=t.child,o.memoizedState=Mh(s),o.childLanes=Eh(e,y,s),t.memoizedState=Ch,tr(null,o)):(Ma(t),Rh(t,h))}var w=e.memoizedState;if(w!==null){var L=w.dehydrated;if(L!==null)return LS(e,t,h,y,o,L,w,s)}return u?(Ea(),u=o.fallback,h=t.mode,w=e.child,L=w.sibling,o=Gs(w,{mode:"hidden",children:o.children}),o.subtreeFlags=w.subtreeFlags&1206910976,L!==null?u=Gs(L,u):(u=cl(u,h,s,null),u.flags|=2),u.return=t,o.return=t,o.sibling=u,t.child=o,tr(null,o),o=t.child,u=e.child.memoizedState,u===null?u=Mh(s):(h=u.cachePool,h!==null?(w=wt._currentValue,h=h.parent!==w?{parent:w,pool:w}:h):h=B0(),u={baseLanes:u.baseLanes|s,cachePool:h}),o.memoizedState=u,o.childLanes=Eh(e,y,s),t.memoizedState=Ch,tr(e.child,o)):(Ma(t),s=e.child,e=s.sibling,s=Gs(s,{mode:"visible",children:o.children}),s.return=t,s.sibling=null,e!==null&&(y=t.deletions,y===null?(t.deletions=[e],t.flags|=16):y.push(e)),t.child=s,t.memoizedState=null,s)}function Rh(e,t){return t=Yc({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function Yc(e,t){return e=pn(22,e,null,t),e.lanes=0,e}function Xc(e,t,s){return vl(t,e.child,null,s),e=Rh(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function LS(e,t,s,o,u,h,y,w){if(s)return t.flags&256?(Ma(t),t.flags&=-257,Xc(e,t,w)):t.memoizedState!==null?(Ea(),t.child=e.child,t.flags|=128,null):(Ea(),h=u.fallback,y=t.mode,u=Yc({mode:"visible",children:u.children},y),h=cl(h,y,w,null),h.flags|=2,u.return=t,h.return=t,u.sibling=h,t.child=u,vl(t,e.child,null,w),u=t.child,u.memoizedState=Mh(w),u.childLanes=Eh(e,o,w),t.memoizedState=Ch,tr(null,u));if(Ma(t),Ef(h)){if(o=h.nextSibling&&h.nextSibling.dataset,o)var L=o.dgst;return o=L,o!==""&&(u=Error(i(419)),u.stack="",u.digest=o,Go({value:u,source:null,stack:null})),Xc(e,t,w)}if(Ct||hl(e,t,w,!1),o=(w&e.childLanes)!==0,Ct||o){if(Ca.current!==null)return Xc(e,t,w);if(o=st,o!==null&&(u=Co(o,w),u!==0&&u!==y.retryLane))throw y.retryLane=u,rl(e,u),bn(o,e,u),wh;return Mf(h)||fu(),Xc(e,t,w)}return Mf(h)?(t.flags|=192,t.child=e.child,null):(e=y.treeContext,at=Kn(h.nextSibling),kt=t,ze=!0,va=null,Yn=!1,e!==null&&D0(t,e),t=Rh(t,u.children),t.flags|=134221824,t)}function Wp(e,t,s){e.lanes|=t;var o=e.alternate;o!==null&&(o.lanes|=t),Ec(e.return,t,s)}function e1(e){for(var t=null;e!==null;){var s=e.alternate;s!==null&&Lc(s)===null&&(t=e),e=e.sibling}return t}function Kc(e,t,s,o,u,h){var y=e.memoizedState;y===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:o,tail:s,tailMode:u,treeForkCount:h}:(y.isBackwards=t,y.rendering=null,y.renderingStartTime=0,y.last=o,y.tail=s,y.tailMode=u,y.treeForkCount=h)}function Th(e){var t=e.child;for(e.child=null;t!==null;){var s=t.sibling;t.sibling=e.child,e.child=t,t=s}}function _h(e,t,s){var o=t.pendingProps,u=o.revealOrder,h=o.tail;o=o.children;var y=It.current;if(t.flags&128)return Zo(t,y),null;var w=(y&2)!==0;if(w?(y=y&1|2,t.flags|=128):y&=1,Zo(t,y),u==="backwards"&&e!==null?(Th(e),Tt(e,t,o,s),Th(e)):Tt(e,t,o,s),o=ze?Vo:0,!w&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Wp(e,s,t);else if(e.tag===19)Wp(e,s,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}switch(u){case"backwards":s=e1(t.child),s===null?(u=t.child,t.child=null):(u=s.sibling,s.sibling=null,Th(t)),Kc(t,!0,u,null,h,o);break;case"unstable_legacy-backwards":for(s=null,u=t.child,t.child=null;u!==null;){if(e=u.alternate,e!==null&&Lc(e)===null){t.child=u;break}e=u.sibling,u.sibling=s,s=u,u=e}Kc(t,!0,s,null,h,o);break;case"together":Kc(t,!1,null,null,void 0,o);break;case"independent":t.memoizedState=null;break;default:s=e1(t.child),s===null?(u=t.child,t.child=null):(u=s.sibling,s.sibling=null),Kc(t,!1,u,s,h,o)}return t.child}function t1(e,t,s){var o=t.pendingProps;return ba(t,t.type,o.value),Tt(e,t,o.children,s),t.child}function Xs(e,t,s){if(e!==null&&(t.dependencies=e.dependencies),Aa|=t.lanes,(s&t.childLanes)===0)if(e!==null){if(hl(e,t,s,!1),(s&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(i(153));if(t.child!==null){for(e=t.child,s=Gs(e,e.pendingProps),t.child=s,s.return=t;e.sibling!==null;)e=e.sibling,s=s.sibling=Gs(e,e.pendingProps),s.return=t;s.sibling=null}return t.child}function Ah(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&Rc(e)))}function $S(e,t,s){switch(t.tag){case 3:Ls(t,t.stateNode.containerInfo),ba(t,wt,e.memoizedState.cache),ul();break;case 27:case 5:fs(t);break;case 4:Ls(t,t.stateNode.containerInfo);break;case 10:ba(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,nh(t),null;break;case 13:var o=t.memoizedState;if(o!==null){if(o.dehydrated!==null)return Ma(t),t.flags|=128,null;o=hl(e,t,s,!1);var u=t.child.childLanes;return o||(s&u)!==0?Jp(e,t,s):(Ma(t),e=Xs(e,t,s),e!==null?e.sibling:null)}Ma(t);break;case 19:if(t.flags&128)return _h(e,t,s);if(u=(e.flags&128)!==0,o=(s&t.childLanes)!==0,o||(hl(e,t,s,!1),o=(s&t.childLanes)!==0),u){if(o)return _h(e,t,s);t.flags|=128}if(u=t.memoizedState,u!==null&&(u.rendering=null,u.tail=null,u.lastEffect=null),Zo(t,It.current),o)break;return null;case 22:return t.lanes=0,Pp(e,t,s,t.pendingProps);case 24:ba(t,wt,e.memoizedState.cache)}return Xs(e,t,s)}function n1(e,t,s){if(e!==null)if(e.memoizedProps!==t.pendingProps)Ct=!0;else{if(!Ah(e,s)&&(t.flags&128)===0)return Ct=!1,$S(e,t,s);Ct=(e.flags&131072)!==0}else Ct=!1,ze&&(t.flags&1048576)!==0&&z0(t,Vo,t.index);switch(t.lanes=0,t.tag){case 16:e:{var o=t.pendingProps;if(e=pl(t.elementType),t.type=e,typeof e=="function")Hd(e)?(o=bl(e,o),t.tag=1,t=Kp(null,t,e,o,s)):(t.tag=0,t=Nh(null,t,e,o,s));else{if(e!=null){var u=e.$$typeof;if(u===$){t.tag=11,t=Gp(null,t,e,o,s);break e}else if(u===le){t.tag=14,t=qp(null,t,e,o,s);break e}else if(u===re){t.tag=10,t.type=e,t=t1(null,t,s);break e}}throw t=be(e)||e,Error(i(306,t,""))}}return t;case 0:return Nh(e,t,t.type,t.pendingProps,s);case 1:return o=t.type,u=bl(o,t.pendingProps),Kp(e,t,o,u,s);case 3:e:{if(Ls(t,t.stateNode.containerInfo),e===null)throw Error(i(387));o=t.pendingProps;var h=t.memoizedState;u=h.element,Zd(e,t),Ko(t,o,null,s);var y=t.memoizedState;if(o=y.cache,ba(t,wt,o),o!==h.cache&&Id(t,[wt],s,!0),Xo(),o=y.element,h.isDehydrated)if(h={element:o,isDehydrated:!1,cache:y.cache},t.updateQueue.baseState=h,t.memoizedState=h,t.flags&256){t=Zp(e,t,o,s);break e}else if(o!==u){u=In(Error(i(424)),t),Go(u),t=Zp(e,t,o,s);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(at=Kn(e.firstChild),kt=t,ze=!0,va=null,Yn=!0,s=P0(t,null,o,s),t.child=s;s;)s.flags=s.flags&-3|134221824,s=s.sibling}else{if(ul(),o===u){t=Xs(e,t,s);break e}Tt(e,t,o,s)}t=t.child}return t;case 26:return xi(e,t),e===null?(s=Ex(t.type,null,t.pendingProps,null))?t.memoizedState=s:ze||(t.stateNode=ix(t.type,t.pendingProps,Jt.current,t)):t.memoizedState=Ex(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return fs(t),e===null&&ze&&(o=t.stateNode=wx(t.type,t.pendingProps,Jt.current),kt=t,Yn=!0,u=at,ka(t.type)?(Rf=u,at=Kn(o.firstChild)):at=u),Tt(e,t,t.pendingProps.children,s),xi(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&ze&&((u=o=at)&&(o=Aj(o,t.type,t.pendingProps,Yn),o!==null?(t.stateNode=o,kt=t,at=Kn(o.firstChild),Yn=!1,u=!0):u=!1),u||ya(t)),fs(t),u=t.type,h=t.pendingProps,y=e!==null?e.memoizedProps:null,o=h.children,yf(u,h)?o=null:y!==null&&yf(u,y)&&(t.flags|=32),t.memoizedState!==null&&(u=lh(e,t,MS,null,null,s),ki._currentValue=u),xi(e,t),Tt(e,t,o,s),t.child;case 6:return e===null&&ze&&((e=s=at)&&(s=Oj(s,t.pendingProps,Yn),s!==null?(t.stateNode=s,kt=t,at=null,e=!0):e=!1),e||ya(t)),null;case 13:return Jp(e,t,s);case 4:return Ls(t,t.stateNode.containerInfo),o=t.pendingProps,e===null?t.child=vl(t,null,o,s):Tt(e,t,o,s),t.child;case 11:return Gp(e,t,t.type,t.pendingProps,s);case 7:return o=t.pendingProps,xi(e,t),Tt(e,t,o,s),t.child;case 8:return Tt(e,t,t.pendingProps.children,s),t.child;case 12:return Tt(e,t,t.pendingProps.children,s),t.child;case 10:return t1(e,t,s);case 9:return u=t.type._context,o=t.pendingProps.children,fl(t),u=Gt(u),o=o(u),t.flags|=1,Tt(e,t,o,s),t.child;case 14:return qp(e,t,t.type,t.pendingProps,s);case 15:return Ip(e,t,t.type,t.pendingProps,s);case 19:return _h(e,t,s);case 31:return kS(e,t,s);case 22:return Pp(e,t,s,t.pendingProps);case 24:return fl(t),o=Gt(wt),e===null?(u=Yd(),u===null&&(u=st,h=Pd(),u.pooledCache=h,h.refCount++,h!==null&&(u.pooledCacheLanes|=s),u=h),t.memoizedState={parent:o,cache:u},Kd(t),ba(t,wt,u)):((e.lanes&s)!==0&&(Zd(e,t),Ko(t,null,null,s),Xo()),u=e.memoizedState,h=t.memoizedState,u.parent!==o?(u={parent:o,cache:o},t.memoizedState=u,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=u),ba(t,wt,o)):(o=h.cache,ba(t,wt,o),o!==u.cache&&Id(t,[wt],s,!0))),Tt(e,t,t.pendingProps.children,s),t.child;case 30:return t.stateNode===null&&(t.stateNode={autoName:null,paired:null,clones:null,ref:null}),o=t.pendingProps,o.name!=null&&o.name!=="auto"?t.flags|=e===null?18882560:18874368:ze&&Cc(t),e!==null&&e.memoizedProps.name!==o.name?t.flags|=4194816:xi(e,t),Tt(e,t,o.children,s),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function Ks(e){e.flags|=4}function Oh(e,t,s,o,u){var h;if((h=(e.mode&32)!==0)&&(h=s===null?Ax(t,o):Ax(t,o)&&(o.src!==s.src||o.srcSet!==s.srcSet)),h){if(e.flags|=16777216,(u&335544128)===u)if(e.stateNode.complete)e.flags|=8192;else if($1())e.flags|=8192;else throw xl=Oc,Xd}else e.flags&=-16777217}function s1(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!Ox(t))if($1())e.flags|=8192;else throw xl=Oc,Xd}function Zc(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?jo():536870912,e.lanes|=t,ji|=t)}function nr(e,t){if(!ze)switch(e.tailMode){case"visible":break;case"collapsed":for(var s=e.tail,o=null;s!==null;)s.alternate!==null&&(o=s),s=s.sibling;o===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:o.sibling=null;break;default:for(t=e.tail,s=null;t!==null;)t.alternate!==null&&(s=t),t=t.sibling;s===null?e.tail=null:s.sibling=null}}function lt(e){var t=e.alternate!==null&&e.alternate.child===e.child,s=0,o=0;if(t)for(var u=e.child;u!==null;)s|=u.lanes|u.childLanes,o|=u.subtreeFlags&1206910976,o|=u.flags&1206910976,u.return=e,u=u.sibling;else for(u=e.child;u!==null;)s|=u.lanes|u.childLanes,o|=u.subtreeFlags,o|=u.flags,u.return=e,u=u.sibling;return e.subtreeFlags|=o,e.childLanes=s,t}function HS(e,t,s){var o=t.pendingProps;switch(Fd(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return lt(t),null;case 1:return lt(t),null;case 3:return s=t.stateNode,o=null,e!==null&&(o=e.memoizedState.cache),t.memoizedState.cache!==o&&(t.flags|=2048),Ps(wt),xt(),s.pendingContext&&(s.context=s.pendingContext,s.pendingContext=null),(e===null||e.child===null)&&(ui(t)?Ks(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Gd())),lt(t),null;case 26:var u=t.type,h=t.memoizedState;return e===null?(Ks(t),h!==null?(lt(t),s1(t,h)):(lt(t),Oh(t,u,null,o,s))):h?h!==e.memoizedState?(Ks(t),lt(t),s1(t,h)):(lt(t),t.flags&=-16777217):(e=e.memoizedProps,e!==o&&Ks(t),lt(t),Oh(t,u,e,o,s)),null;case 27:if(an(t),s=Jt.current,u=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==o&&Ks(t);else{if(!o){if(t.stateNode===null)throw Error(i(166));return lt(t),t.subtreeFlags&=-33554433,null}e=Bt.current,ui(t)?k0(t):(e=wx(u,o,s),t.stateNode=e,Ks(t))}return lt(t),t.subtreeFlags&=-33554433,null;case 5:if(an(t),u=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==o&&Ks(t);else{if(!o){if(t.stateNode===null)throw Error(i(166));return lt(t),t.subtreeFlags&=-33554433,null}if(h=Bt.current,ui(t))k0(t);else{var y=fr(Jt.current);switch(h){case 1:h=y.createElementNS("http://www.w3.org/2000/svg",u);break;case 2:h=y.createElementNS("http://www.w3.org/1998/Math/MathML",u);break;default:switch(u){case"svg":h=y.createElementNS("http://www.w3.org/2000/svg",u);break;case"math":h=y.createElementNS("http://www.w3.org/1998/Math/MathML",u);break;case"script":h=y.createElement("div"),h.innerHTML="<script><\/script>",h=h.removeChild(h.firstChild);break;case"select":h=typeof o.is=="string"?y.createElement("select",{is:o.is}):y.createElement("select"),o.multiple?h.multiple=!0:o.size&&(h.size=o.size);break;default:h=typeof o.is=="string"?y.createElement(u,{is:o.is}):y.createElement(u)}}h[St]=t,h[Vt]=o;e:for(y=t.child;y!==null;){if(y.tag===5||y.tag===6)h.appendChild(y.stateNode);else if(y.tag!==4&&y.tag!==27&&y.child!==null){y.child.return=y,y=y.child;continue}if(y===t)break e;for(;y.sibling===null;){if(y.return===null||y.return===t)break e;y=y.return}y.sibling.return=y.return,y=y.sibling}t.stateNode=h;e:switch(Qt(h,u,o),u){case"button":case"input":case"select":case"textarea":o=!!o.autoFocus;break e;case"img":o=!0;break e;default:o=!1}o&&Ks(t)}}return lt(t),t.subtreeFlags&=-33554433,Oh(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,s),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==o&&Ks(t);else{if(typeof o!="string"&&t.stateNode===null)throw Error(i(166));if(e=Jt.current,ui(t)){if(e=t.stateNode,s=t.memoizedProps,o=null,u=kt,u!==null)switch(u.tag){case 27:case 5:o=u.memoizedProps}e[St]=t,e=!!(e.nodeValue===s||o!==null&&o.suppressHydrationWarning===!0||nx(e.nodeValue,s)),e||ya(t,!0)}else e=fr(e).createTextNode(o),e[St]=t,t.stateNode=e}return lt(t),null;case 31:if(s=t.memoizedState,e===null||e.memoizedState!==null){if(o=ui(t),s!==null){if(e===null){if(!o)throw Error(i(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(i(557));e[St]=t}else ul(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;lt(t),e=!1}else s=Gd(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=s),e=!0;if(!e)return t.flags&256?(_n(t),t):(_n(t),null);if((t.flags&128)!==0)throw Error(i(558))}return lt(t),null;case 13:if(o=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(u=ui(t),o!==null&&o.dehydrated!==null){if(e===null){if(!u)throw Error(i(318));if(u=t.memoizedState,u=u!==null?u.dehydrated:null,!u)throw Error(i(317));u[St]=t}else ul(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;lt(t),u=!1}else u=Gd(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=u),u=!0;if(!u)return t.flags&256?(_n(t),t):(_n(t),null)}return _n(t),(t.flags&128)!==0?(t.lanes=s,t):(s=o!==null,e=e!==null&&e.memoizedState!==null,s&&(o=t.child,u=null,o.alternate!==null&&o.alternate.memoizedState!==null&&o.alternate.memoizedState.cachePool!==null&&(u=o.alternate.memoizedState.cachePool.pool),h=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(h=o.memoizedState.cachePool.pool),h!==u&&(o.flags|=2048)),s!==e&&s&&(t.child.flags|=8192),Zc(t,t.updateQueue),lt(t),null);case 4:return xt(),e===null&&mf(t.stateNode.containerInfo),t.flags|=67108864,lt(t),null;case 10:return Ps(t.type),lt(t),null;case 19:if(sh(t),o=t.memoizedState,o===null)return lt(t),null;if(u=(t.flags&128)!==0,h=o.rendering,h===null)if(u)nr(o,!1);else{if(pt!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(h=Lc(e),h!==null){for(t.flags|=128,nr(o,!1),e=h.updateQueue,t.updateQueue=e,Zc(t,e),t.subtreeFlags=0,e=s,s=t.child;s!==null;)_0(s,e),s=s.sibling;return Zo(t,It.current&1|2),ze&&qs(t,o.treeForkCount),t.child}e=e.sibling}o.tail!==null&&tt()>cu&&(t.flags|=128,u=!0,nr(o,!1),t.lanes=4194304)}else{if(!u)if(e=Lc(h),e!==null){if(t.flags|=128,u=!0,e=e.updateQueue,t.updateQueue=e,Zc(t,e),nr(o,!0),o.tail===null&&o.tailMode!=="collapsed"&&o.tailMode!=="visible"&&!h.alternate&&!ze)return lt(t),null}else 2*tt()-o.renderingStartTime>cu&&s!==536870912&&(t.flags|=128,u=!0,nr(o,!1),t.lanes=4194304);o.isBackwards?(h.sibling=t.child,t.child=h):(e=o.last,e!==null?e.sibling=h:t.child=h,o.last=h)}if(o.tail!==null){e=o.tail;e:{for(s=e;s!==null;){if(s.alternate!==null){s=!1;break e}s=s.sibling}s=!0}return o.rendering=e,o.tail=e.sibling,o.renderingStartTime=tt(),e.sibling=null,h=It.current,h=u?h&1|2:h&1,o.tailMode==="visible"||o.tailMode==="collapsed"||!s||ze?Zo(t,h):(s=h,Ve(qt,t),Ve(It,s),en===null&&(en=t)),ze&&qs(t,o.treeForkCount),e}return lt(t),null;case 22:case 23:return _n(t),th(),o=t.memoizedState!==null,e!==null?e.memoizedState!==null!==o&&(t.flags|=8192):o&&(t.flags|=8192),o?(s&536870912)!==0&&(t.flags&128)===0&&(lt(t),t.subtreeFlags&6&&(t.flags|=8192)):lt(t),s=t.updateQueue,s!==null&&Zc(t,s.retryQueue),s=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(s=e.memoizedState.cachePool.pool),o=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(o=t.memoizedState.cachePool.pool),o!==s&&(t.flags|=2048),e!==null&&ot(gl),null;case 24:return s=null,e!==null&&(s=e.memoizedState.cache),t.memoizedState.cache!==s&&(t.flags|=2048),Ps(wt),lt(t),null;case 25:return null;case 30:return t.flags|=33554432,lt(t),null}throw Error(i(156,t.tag))}function US(e,t){switch(Fd(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Ps(wt),xt(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return an(t),null;case 31:if(t.memoizedState!==null){if(_n(t),t.alternate===null)throw Error(i(340));ul()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(_n(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));ul()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return sh(t),e=t.flags,e&65536?(t.flags=e&-65537|128,e=t.memoizedState,e!==null&&(e.rendering=null,e.tail=null),t.flags|=4,t):null;case 4:return xt(),null;case 10:return Ps(t.type),null;case 22:case 23:return _n(t),th(),e!==null&&ot(gl),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Ps(wt),null;case 25:return null;default:return null}}function a1(e,t){switch(Fd(t),t.tag){case 3:Ps(wt),xt();break;case 26:case 27:case 5:an(t);break;case 4:xt();break;case 31:t.memoizedState!==null&&_n(t);break;case 13:_n(t);break;case 19:sh(t);break;case 10:Ps(t.type);break;case 22:case 23:_n(t),th(),e!==null&&ot(gl);break;case 24:Ps(wt)}}function sr(e,t){try{var s=t.updateQueue,o=s!==null?s.lastEffect:null;if(o!==null){var u=o.next;s=u;do{if((s.tag&e)===e){o=void 0;var h=s.create,y=s.inst;o=h(),y.destroy=o}s=s.next}while(s!==u)}}catch(w){Je(t,t.return,w)}}function Ra(e,t,s){try{var o=t.updateQueue,u=o!==null?o.lastEffect:null;if(u!==null){var h=u.next;o=h;do{if((o.tag&e)===e){var y=o.inst,w=y.destroy;if(w!==void 0){y.destroy=void 0,u=t;var L=s,I=w;try{I()}catch(K){Je(u,L,K)}}}o=o.next}while(o!==h)}}catch(K){Je(t,t.return,K)}}function l1(e){var t=e.updateQueue;if(t!==null){var s=e.stateNode;try{Y0(t,s)}catch(o){Je(e,e.return,o)}}}function i1(e,t,s){s.props=bl(e.type,e.memoizedProps),s.state=e.memoizedState;try{s.componentWillUnmount()}catch(o){Je(e,t,o)}}function Ss(e,t){try{var s=e.ref;if(s!==null){switch(e.tag){case 26:case 27:case 5:var o=e.stateNode;break;case 30:var u=e.stateNode,h=Fs(e.memoizedProps,u);(u.ref===null||u.ref.name!==h)&&(u.ref=fx(h)),o=u.ref;break;case 7:if(e.stateNode===null){var y=new kn(e);p(e.child,!1,Tj,y,void 0,void 0),e.stateNode=y}o=e.stateNode;break;default:o=e.stateNode}typeof s=="function"?e.refCleanup=s(o):s.current=o}}catch(w){Je(e,t,w)}}function Pt(e,t){var s=e.ref,o=e.refCleanup;if(s!==null)if(typeof o=="function")try{o()}catch(u){Je(e,t,u)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof s=="function")try{s(null)}catch(u){Je(e,t,u)}else s.current=null}function Jc(e,t){if((e.tag===5||e.tag===27||e.tag===6)&&e.alternate===null&&t!==null)for(var s=0;s<t.length;s++)yx(e.stateNode,t[s])}function o1(e){for(var t=e.return;t!==null&&(Dh(t)&&yx(e.stateNode,t.stateNode),!zh(t));)t=t.return}function ar(e){for(var t=e.return;t!==null&&(Dh(t)&&_j(e.stateNode,t.stateNode),!zh(t));)t=t.return}function zh(e){return e.tag===5||e.tag===3||e.tag===27}function Dh(e){return e&&e.tag===7&&e.stateNode!==null}function kh(e){var t=e.type,s=e.memoizedProps,o=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":s.autoFocus&&o.focus();break e;case"img":s.src?o.src=s.src:s.srcSet&&(o.srcset=s.srcSet)}}catch(u){Je(e,e.return,u)}}function Lh(e,t,s){try{var o=e.stateNode;dj(o,e.type,s,t),o[Vt]=t}catch(u){Je(e,e.return,u)}}function r1(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&ka(e.type)||e.tag===4}function $h(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||r1(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&&ka(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 Hh(e,t,s,o){var u=e.tag;if(u===5||u===6)u=e.stateNode,t?(s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s).insertBefore(u,t):(t=s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s,t.appendChild(u),s=s._reactRootContainer,s!=null||t.onclick!==null||(t.onclick=vs)),Jc(e,o),qe=!0;else if(u!==4&&(u===27&&(Jc(e,o),o=null,ka(e.type)&&(s=e.stateNode,t=null)),e=e.child,e!==null))for(Hh(e,t,s,o),e=e.sibling;e!==null;)Hh(e,t,s,o),e=e.sibling}function Wc(e,t,s,o){var u=e.tag;if(u===5||u===6)u=e.stateNode,t?s.insertBefore(u,t):s.appendChild(u),Jc(e,o),qe=!0;else if(u!==4&&(u===27&&(Jc(e,o),o=null,ka(e.type)&&(s=e.stateNode)),e=e.child,e!==null))for(Wc(e,t,s,o),e=e.sibling;e!==null;)Wc(e,t,s,o),e=e.sibling}function c1(e){var t=e.stateNode,s=e.memoizedProps;try{for(var o=e.type,u=t.attributes;u.length;)t.removeAttributeNode(u[0]);Qt(t,o,s),t[St]=e,t[Vt]=s}catch(h){Je(e,e.return,h)}}var eu=!1,An=null;function u1(e){(e.tag===30||(e.subtreeFlags&33554432)!==0)&&(eu=!0)}var js=null;function d1(){var e=js;return js=null,e}var xn=0;function vi(e,t,s,o,u){return xn=0,h1(e.child,t,s,o,u)}function h1(e,t,s,o,u){for(var h=!1;e!==null;){if(e.tag===5){var y=e.stateNode;if(o!==null){var w=jf(y);o.push(w),w.view&&(h=!0)}else h||jf(y).view&&(h=!0);eu=!0,dx(y,xn===0?t:t+"_"+xn,s),xn++}else(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&u||h1(e.child,t,s,o,u)&&(h=!0));e=e.sibling}return h}function ws(e,t){for(;e!==null;)e.tag===5?hx(e.stateNode,e.memoizedProps):(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&t||ws(e.child,t)),e=e.sibling}function tu(e){if((e.subtreeFlags&18874368)!==0)for(e=e.child;e!==null;){if((e.tag!==22||e.memoizedState===null)&&(tu(e),e.tag===30&&(e.flags&18874368)!==0&&e.stateNode.paired)){var t=e.memoizedProps;if(t.name==null||t.name==="auto")throw Error(i(544));var s=t.name;t=Vs(t.default,t.share),t!=="none"&&(vi(e,s,t,null,!1)||ws(e.child,!1))}e=e.sibling}}function Uh(e,t){if(e.tag===30){var s=e.stateNode,o=e.memoizedProps,u=Fs(o,s),h=Vs(o.default,s.paired?o.share:o.enter);h!=="none"?vi(e,u,h,null,!1)?(tu(e),s.paired||t||Mi(e,o.onEnter)):ws(e.child,!1):tu(e)}else if((e.subtreeFlags&33554432)!==0)for(e=e.child;e!==null;)Uh(e,t),e=e.sibling;else tu(e)}function Bh(e){if(An!==null&&An.size!==0){var t=An;if((e.subtreeFlags&18874368)!==0)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&(e.flags&18874368)!==0){var s=e.memoizedProps,o=s.name;if(o!=null&&o!=="auto"){var u=t.get(o);if(u!==void 0){var h=Vs(s.default,s.share);if(h!=="none"&&(vi(e,o,h,null,!1)?(h=e.stateNode,u.paired=h,h.paired=u,Mi(e,s.onShare)):ws(e.child,!1)),t.delete(o),t.size===0)break}}}Bh(e)}e=e.sibling}}}function Fh(e){if(e.tag===30){var t=e.memoizedProps,s=Fs(t,e.stateNode),o=An!==null?An.get(s):void 0,u=Vs(t.default,o!==void 0?t.share:t.exit);u!=="none"&&(vi(e,s,u,null,!1)?o!==void 0?(u=e.stateNode,o.paired=u,u.paired=o,An.delete(s),Mi(e,t.onShare)):Mi(e,t.onExit):ws(e.child,!1)),An!==null&&Bh(e)}else if((e.subtreeFlags&33554432)!==0)for(e=e.child;e!==null;)Fh(e),e=e.sibling;else An!==null&&Bh(e)}function f1(e){for(e=e.child;e!==null;){if(e.tag===30){var t=e.memoizedProps,s=Fs(t,e.stateNode);t=Vs(t.default,t.update),e.flags&=-5,t!=="none"&&vi(e,s,t,e.memoizedState=[],!1)}else(e.subtreeFlags&33554432)!==0&&f1(e);e=e.sibling}}function Vh(e){if((e.subtreeFlags&18874368)!==0)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&(e.flags&18874368)!==0){var t=e.stateNode;t.paired!==null&&(t.paired=null,ws(e.child,!1))}Vh(e)}e=e.sibling}}function nu(e){if(e.tag===30)e.stateNode.paired=null,ws(e.child,!1),Vh(e);else if((e.subtreeFlags&33554432)!==0)for(e=e.child;e!==null;)nu(e),e=e.sibling;else Vh(e)}function m1(e){for(e=e.child;e!==null;)e.tag===30?ws(e.child,!1):(e.subtreeFlags&33554432)!==0&&m1(e),e=e.sibling}function Gh(e,t,s,o,u,h,y){for(var w=!1;t!==null;){if(t.tag===5){var L=t.stateNode;if(h!==null&&xn<h.length){var I=h[xn],K=jf(L);(I.view||K.view)&&(w=!0);var ne;if(ne=(e.flags&4)===0)if(K.clip)ne=!0;else{ne=I.rect;var F=K.rect;ne=ne.y!==F.y||ne.x!==F.x||ne.height!==F.height||ne.width!==F.width}ne&&(e.flags|=4),K.abs?K=!I.abs:(I=I.rect,K=K.rect,K=I.height!==K.height||I.width!==K.width),K&&(e.flags|=32)}else e.flags|=32;(e.flags&4)!==0&&dx(L,xn===0?s:s+"_"+xn,u),w&&(e.flags&4)!==0||(js===null&&(js=[]),js.push(L,xn===0?o:o+"_"+xn,t.memoizedProps)),xn++}else(t.tag!==22||t.memoizedState===null)&&(t.tag===30&&y?e.flags|=t.flags&32:Gh(e,t.child,s,o,u,h,y)&&(w=!0));t=t.sibling}return w}function g1(e,t){for(e=e.child;e!==null;){if(e.tag===30){var s=e.memoizedProps,o=e.stateNode,u=Fs(s,o),h=Vs(s.default,s.update),y;y=e.memoizedState,e.memoizedState=null,o=e;var w=e.child;xn=0,u=Gh(o,w,u,u,h,y,!1),(e.flags&4)!==0&&u&&Mi(e,s.onUpdate)}else(e.subtreeFlags&33554432)!==0&&g1(e);e=e.sibling}}var Lt=!1,Xe=!1,Ns=!1,qh=!1,p1=typeof WeakSet=="function"?WeakSet:Set,$t=null,Cs=!1,lr=!1,su=!1,Ih=!1;function BS(e,t,s){if(e=e.containerInfo,xf=Li,e=b0(e),Ad(e)){if("selectionStart"in e)var o={start:e.selectionStart,end:e.selectionEnd};else e:{o=(o=e.ownerDocument)&&o.defaultView||window;var u=o.getSelection&&o.getSelection();if(u&&u.rangeCount!==0){o=u.anchorNode;var h=u.anchorOffset,y=u.focusNode;u=u.focusOffset;try{o.nodeType,y.nodeType}catch{o=null;break e}var w=0,L=-1,I=-1,K=0,ne=0,F=e,Y=null;t:for(;;){for(var fe;F!==o||h!==0&&F.nodeType!==3||(L=w+h),F!==y||u!==0&&F.nodeType!==3||(I=w+u),F.nodeType===3&&(w+=F.nodeValue.length),(fe=F.firstChild)!==null;)Y=F,F=fe;for(;;){if(F===e)break t;if(Y===o&&++K===h&&(L=w),Y===y&&++ne===u&&(I=w),(fe=F.nextSibling)!==null)break;F=Y,Y=F.parentNode}F=fe}o=L===-1||I===-1?null:{start:L,end:I}}else o=null}o=o||{start:0,end:0}}else o=null;for(vf={focusedElem:e,selectionRange:o},Li=!1,s=(s&335544064)===s,$t=t,t=s?9270:1024;$t!==null;){if(e=$t,s&&(o=e.deletions,o!==null))for(h=0;h<o.length;h++)s&&Fh(o[h]);if(e.alternate===null&&(e.flags&2)!==0)s&&u1(e),au(s);else{if(e.tag===22){if(o=e.alternate,e.memoizedState!==null){o!==null&&o.memoizedState===null&&s&&Fh(o),au(s);continue}else if(o!==null&&o.memoizedState!==null){s&&u1(e),au(s);continue}}o=e.child,(e.subtreeFlags&t)!==0&&o!==null?(o.return=e,$t=o):(s&&f1(e),au(s))}}An=null}function au(e){for(;$t!==null;){var t=$t,s=e,o=t.alternate,u=t.flags;switch(t.tag){case 0:case 11:case 15:break;case 1:if((u&1024)!==0&&o!==null){s=void 0,u=o.memoizedProps,o=o.memoizedState;var h=t.stateNode;try{var y=bl(t.type,u);s=h.getSnapshotBeforeUpdate(y,o),h.__reactInternalSnapshotBeforeUpdate=s}catch(w){Je(t,t.return,w)}}break;case 3:if((u&1024)!==0){if(o=t.stateNode.containerInfo,s=o.nodeType,s===9)Cf(o);else if(s===1)switch(o.nodeName){case"HEAD":case"HTML":case"BODY":Cf(o);break;default:o.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;case 30:s&&o!==null&&(s=Fs(o.memoizedProps,o.stateNode),u=t.memoizedProps,u=Vs(u.default,u.update),u!=="none"&&vi(o,s,u,o.memoizedState=[],!0));break;default:if((u&1024)!==0)throw Error(i(163))}if(o=t.sibling,o!==null){o.return=t.return,$t=o;break}$t=t.return}}function x1(e,t,s){var o=s.flags;switch(s.tag){case 0:case 11:case 15:Ms(e,s),o&4&&sr(5,s);break;case 1:if(Ms(e,s),o&4)if(e=s.stateNode,t===null)try{e.componentDidMount()}catch(y){Je(s,s.return,y)}else{var u=bl(s.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(u,t,e.__reactInternalSnapshotBeforeUpdate)}catch(y){Je(s,s.return,y)}}o&64&&l1(s),o&512&&Ss(s,s.return);break;case 3:if(Ms(e,s),o&64&&(e=s.updateQueue,e!==null)){if(t=null,s.child!==null)switch(s.child.tag){case 27:case 5:t=s.child.stateNode;break;case 1:t=s.child.stateNode}try{Y0(e,t)}catch(y){Je(s,s.return,y)}}break;case 27:t===null&&o&4&&c1(s);case 26:case 5:Ms(e,s),t===null&&o&4&&kh(s),o&512&&Ss(s,s.return);break;case 12:Ms(e,s);break;case 31:Ms(e,s),o&4&&S1(e,s);break;case 13:Ms(e,s),o&4&&j1(e,s),o&64&&(e=s.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(s=JS.bind(null,s),zj(e,s))));break;case 22:if(o=s.memoizedState!==null||Lt,!o){var h=t!==null&&t.memoizedState!==null||Xe;t=Lt,u=Xe,Lt=o,(Xe=h)&&!u?(o=2,(s.subtreeFlags&8772)!==0&&(o|=1),is(e,s,o)):Ms(e,s),Lt=t,Xe=u}break;case 30:Ms(e,s),o&512&&Ss(s,s.return);break;case 7:o&512&&Ss(s,s.return);default:Ms(e,s)}}function Ph(e,t){for(e=e.child;e!==null;)v1(e,t),e=e.sibling}function v1(e,t){switch(e.tag){case 5:case 26:try{var s=e.stateNode;if(t){var o=s.style;typeof o.setProperty=="function"?o.setProperty("display","none","important"):o.display="none"}else{var u=e.stateNode,h=e.memoizedProps.style,y=h!=null&&h.hasOwnProperty("display")?h.display:null;u.style.display=y==null||typeof y=="boolean"?"":(""+y).trim()}}catch(L){Je(e,e.return,L)}Qh(e,t);break;case 6:try{e.stateNode.nodeValue=t?"":e.memoizedProps,qe=!0}catch(L){Je(e,e.return,L)}break;case 18:try{var w=e.stateNode;t?ux(w,!0):ux(e.stateNode,!1)}catch(L){Je(e,e.return,L)}break;case 22:case 23:e.memoizedState===null&&Ph(e,t);break;default:Ph(e,t)}}function Qh(e,t){if(e.subtreeFlags&67108864)for(e=e.child;e!==null;){e:{var s=e,o=t;switch(s.tag){case 4:v1(s,o);break e;case 22:s.memoizedState===null&&Qh(s,o);break e;default:Qh(s,o)}}e=e.sibling}}function y1(e){var t=e.alternate;t!==null&&(e.alternate=null,y1(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Ye(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 rt=null,vn=!1;function as(e,t,s){for(s=s.child;s!==null;)b1(e,t,s),s=s.sibling}function b1(e,t,s){if(Ft&&typeof Ft.onCommitFiberUnmount=="function")try{Ft.onCommitFiberUnmount(En,s)}catch{}switch(s.tag){case 26:Xe||Pt(s,t),as(e,t,s),s.memoizedState?s.memoizedState.count--:s.stateNode&&!Xe&&(s=s.stateNode,s.parentNode.removeChild(s));break;case 27:Xe||Pt(s,t),ar(s);var o=rt,u=vn;ka(s.type)&&(rt=s.stateNode,vn=!1),as(e,t,s),Nx(s.stateNode,s.type,s.memoizedProps),rt=o,vn=u;break;case 5:Xe||Pt(s,t),ar(s);case 6:if(s.tag===6&&ar(s),o=rt,u=vn,rt=null,as(e,t,s),rt=o,vn=u,rt!==null)if(vn)try{(rt.nodeType===9?rt.body:rt.nodeName==="HTML"?rt.ownerDocument.body:rt).removeChild(s.stateNode),qe=!0}catch(h){Je(s,t,h)}else try{rt.removeChild(s.stateNode),qe=!0}catch(h){Je(s,t,h)}break;case 18:rt!==null&&(vn?(e=rt,cx(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,s.stateNode),$i(e)):cx(rt,s.stateNode));break;case 4:o=rt,u=vn,rt=s.stateNode.containerInfo,vn=!0,as(e,t,s),rt=o,vn=u;break;case 0:case 11:case 14:case 15:Ra(2,s,t),Xe||Ra(4,s,t),as(e,t,s);break;case 1:Xe||(Pt(s,t),o=s.stateNode,typeof o.componentWillUnmount=="function"&&i1(s,t,o)),as(e,t,s);break;case 21:as(e,t,s);break;case 22:Xe=(o=Xe)||s.memoizedState!==null,as(e,t,s),Xe=o;break;case 30:Pt(s,t),as(e,t,s);break;case 7:Xe||Pt(s,t),as(e,t,s);break;default:as(e,t,s)}}function S1(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{$i(e)}catch(s){Je(t,t.return,s)}}}function j1(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{$i(e)}catch(s){Je(t,t.return,s)}}function FS(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new p1),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new p1),t;default:throw Error(i(435,e.tag))}}function lu(e,t){var s=FS(e);t.forEach(function(o){if(!s.has(o)){s.add(o);var u=WS.bind(null,e,o);o.then(u,u)}})}function cn(e,t,s){var o=t.deletions;if(o!==null)for(var u=0;u<o.length;u++){var h=o[u],y=e,w=t,L=w;e:for(;L!==null;){switch(L.tag){case 27:if(ka(L.type)){rt=L.stateNode,vn=!1;break e}break;case 5:rt=L.stateNode,vn=!1;break e;case 3:case 4:rt=L.stateNode.containerInfo,vn=!0;break e}L=L.return}if(rt===null)throw Error(i(160));b1(y,w,h),rt=null,vn=!1,y=h.alternate,y!==null&&(y.return=null),h.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)w1(t,e,s),t=t.sibling}var ls=null;function w1(e,t,s){var o=e.alternate,u=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(u&4&&(o=e.updateQueue,o=o!==null?o.events:null,o!==null))for(var h=0;h<o.length;h++){var y=o[h];y.ref.impl=y.nextImpl}cn(t,e,s),un(e),u&4&&(Ra(3,e,e.return),sr(3,e),Ra(5,e,e.return));break;case 1:cn(t,e,s),un(e),u&512&&(Xe||o===null||Pt(o,o.return)),u&64&&Lt&&(e=e.updateQueue,e!==null&&(t=e.callbacks,t!==null&&(s=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=s===null?t:s.concat(t))));break;case 26:if(h=ls,cn(t,e,s),un(e),u&512&&(Xe||o===null||Pt(o,o.return)),u&4)if(u=o!==null?o.memoizedState:null,s=e.memoizedState,o===null)if(s===null)if(e.stateNode===null)if(Lt)e.stateNode=ix(e.type,e.memoizedProps,t.containerInfo,e);else{e:{t=e.type,s=e.memoizedProps,u=h.ownerDocument||h;t:switch(t){case"title":o=u.getElementsByTagName("title")[0],(!o||o[ha]||o[St]||o.namespaceURI==="http://www.w3.org/2000/svg"||o.hasAttribute("itemprop"))&&(o=u.createElement(t),u.head.insertBefore(o,u.querySelector("head > title"))),Qt(o,t,s),o[St]=e,mt(o),t=o;break e;case"link":if(h=_x("link","href",u).get(t+(s.href||""))){for(y=0;y<h.length;y++)if(o=h[y],o.getAttribute("href")===(s.href==null||s.href===""?null:s.href)&&o.getAttribute("rel")===(s.rel==null?null:s.rel)&&o.getAttribute("title")===(s.title==null?null:s.title)&&o.getAttribute("crossorigin")===(s.crossOrigin==null?null:s.crossOrigin)){h.splice(y,1);break t}}o=u.createElement(t),Qt(o,t,s),u.head.appendChild(o);break;case"meta":if(h=_x("meta","content",u).get(t+(s.content||""))){for(y=0;y<h.length;y++)if(o=h[y],o.getAttribute("content")===(s.content==null?null:""+s.content)&&o.getAttribute("name")===(s.name==null?null:s.name)&&o.getAttribute("property")===(s.property==null?null:s.property)&&o.getAttribute("http-equiv")===(s.httpEquiv==null?null:s.httpEquiv)&&o.getAttribute("charset")===(s.charSet==null?null:s.charSet)){h.splice(y,1);break t}}o=u.createElement(t),Qt(o,t,s),u.head.appendChild(o);break;default:throw Error(i(468,t))}o[St]=e,mt(o),t=o}e.stateNode=t}else Lt||Of(h,e.type,e.stateNode);else e.stateNode=Tx(h,s,e.memoizedProps);else u!==s?(u===null?(t=o.stateNode,t===null||Xe||t.parentNode.removeChild(t)):u.count--,s===null?Lt||Of(h,e.type,e.stateNode):Tx(h,s,e.memoizedProps)):s===null&&e.stateNode!==null&&Lh(e,e.memoizedProps,o.memoizedProps);break;case 27:cn(t,e,s),un(e),u&512&&(Xe||o===null||Pt(o,o.return)),o!==null&&u&4&&Lh(e,e.memoizedProps,o.memoizedProps);break;case 5:if(h=Ns,Ns=!1,cn(t,e,s),Ns=h,un(e),u&512&&(Xe||o===null||Pt(o,o.return)),e.flags&32){t=e.stateNode;try{ei(t,""),qe=!0}catch(K){Je(e,e.return,K)}}u&4&&e.stateNode!=null&&(t=e.memoizedProps,Lh(e,t,o!==null?o.memoizedProps:t)),u&1024&&(qh=!0);break;case 6:if(cn(t,e,s),un(e),u&4){if(e.stateNode===null)throw Error(i(162));t=e.memoizedProps,s=e.stateNode;try{s.nodeValue=t,qe=!0}catch(K){Je(e,e.return,K)}}break;case 3:if(qe=!1,bu=null,h=ls,ls=mr(t.containerInfo),cn(t,e,s),ls=h,un(e),u&4&&o!==null&&o.memoizedState.isDehydrated)try{$i(t.containerInfo)}catch(K){Je(e,e.return,K)}qh&&(qh=!1,N1(e)),qe=!1;break;case 4:u=Ns,Ns=Lt,o=qg(),h=ls,ls=mr(e.stateNode.containerInfo),cn(t,e,s),un(e),ls=h,qe&&lr&&(su=!0),qe=o,Ns=u;break;case 12:cn(t,e,s),un(e);break;case 31:cn(t,e,s),un(e),u&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,lu(e,t)));break;case 13:cn(t,e,s),un(e),e.child.flags&8192&&e.memoizedState!==null!=(o!==null&&o.memoizedState!==null)&&(ru=tt()),u&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,lu(e,t)));break;case 22:h=e.memoizedState!==null,y=o!==null&&o.memoizedState!==null;var w=Lt,L=Xe,I=Ns;Lt=w||h,Ns=I||h,Xe=L||y,cn(t,e,s),Xe=L,Ns=I,Lt=w,un(e),u&8192&&(t=e.stateNode,t._visibility=h?t._visibility&-2:t._visibility|1,!h||o===null||y||Lt||Xe||(t=y||Xe,s=Lt,o=Xe,Lt=h||Lt,Xe=t,Ta(e,2),Lt=s,Xe=o),!h&&Ns||Ph(e,h)),u&4&&(t=e.updateQueue,t!==null&&(s=t.retryQueue,s!==null&&(t.retryQueue=null,lu(e,s))));break;case 19:cn(t,e,s),un(e),u&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,lu(e,t)));break;case 30:u&512&&(Xe||o===null||Pt(o,o.return)),u=qg(),h=lr,y=(s&335544064)===s,w=e.memoizedProps,lr=y&&Vs(w.default,w.update)!=="none",cn(t,e,s),un(e),y&&o!==null&&qe&&(e.flags|=4),lr=h,qe=u;break;case 21:break;case 7:u&512&&(Xe||o===null||Pt(o,o.return)),o&&o.stateNode!==null&&(o.stateNode._fragmentFiber=e);default:cn(t,e,s),un(e)}}function un(e){var t=e.flags;if(t&2){try{for(var s,o=e.return;o!==null;){if(r1(o)){s=o;break}o=o.return}o=null;for(var u=e.return;u!==null;){if(Dh(u)){var h=u.stateNode;o===null?o=[h]:o.push(h)}if(zh(u))break;u=u.return}var y=o;if(s==null)throw Error(i(160));switch(s.tag){case 27:var w=s.stateNode,L=$h(e);Wc(e,L,w,y);break;case 5:var I=s.stateNode;s.flags&32&&(ei(I,""),s.flags&=-33);var K=$h(e);Wc(e,K,I,y);break;case 3:case 4:var ne=s.stateNode.containerInfo,F=$h(e);Hh(e,F,ne,y);break;default:throw Error(i(161))}}catch(Y){Je(e,e.return,Y)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function N1(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;N1(t),t.tag===5&&t.flags&1024&&(t=t.stateNode,Li=!0,t.reset(),Li=!1),e=e.sibling}}function yi(e,t){if(t.subtreeFlags&9270)for(t=t.child;t!==null;)C1(t,e),t=t.sibling;else g1(t)}function C1(e,t){var s=e.alternate;if(s===null)Uh(e,!1);else switch(e.tag){case 3:if(Ih=Cs=!1,d1(),yi(t,e),!Cs&&!su){if(e=js,e!==null)for(var o=0;o<e.length;o+=3){s=e[o];var u=e[o+1];hx(s,e[o+2]),s=s.ownerDocument.documentElement,s!==null&&s.animate({opacity:[0,0],pointerEvents:["none","none"]},{duration:0,fill:"forwards",pseudoElement:"::view-transition-group("+u+")"})}e=t.containerInfo,e=e.nodeType===9?e.documentElement:e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName===""&&(e.style.viewTransitionName="none",e.animate({opacity:[0,0],pointerEvents:["none","none"]},{duration:0,fill:"forwards",pseudoElement:"::view-transition-group(root)"}),e.animate({width:[0,0],height:[0,0]},{duration:0,fill:"forwards",pseudoElement:"::view-transition"})),Ih=!0}js=null;break;case 5:yi(t,e);break;case 4:o=Cs,Cs=!1,yi(t,e),Cs&&(su=!0),Cs=o;break;case 22:e.memoizedState===null&&(s.memoizedState!==null?Uh(e,!1):yi(t,e));break;case 30:o=Cs,u=d1(),Cs=!1,yi(t,e),Cs&&(e.flags|=4);var h=e.memoizedProps,y=e.stateNode;t=Fs(h,y),y=Fs(s.memoizedProps,y);var w=Vs(h.default,h.update);w==="none"?t=!1:(h=s.memoizedState,s.memoizedState=null,s=e.child,xn=0,t=Gh(e,s,t,y,w,h,!0),xn!==(h===null?0:h.length)&&(e.flags|=32)),(e.flags&4)!==0&&t?(Mi(e,e.memoizedProps.onUpdate),js=u):u!==null&&(u.push.apply(u,js),js=u),Cs=(e.flags&32)!==0?!0:o;break;default:yi(t,e)}}function Ms(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)x1(e,t.alternate,t),t=t.sibling}function Ta(e,t){for(e=e.child;e!==null;){var s=e,o=t;switch(s.tag){case 0:case 11:case 14:case 15:Ra(4,s,s.return),Ta(s,o);break;case 1:Pt(s,s.return);var u=s.stateNode;typeof u.componentWillUnmount=="function"&&i1(s,s.return,u),Ta(s,o);break;case 27:(o&2)!==0&&Nx(s.stateNode,s.type,s.memoizedProps);case 5:Pt(s,s.return),s.tag!==5&&s.tag!==27||ar(s),Ta(s,o);break;case 6:ar(s);break;case 26:Pt(s,s.return),u=s.stateNode,s.memoizedState!==null||u===null||Xe||u.parentNode.removeChild(u),Ta(s,o);break;case 22:s.memoizedState===null&&Ta(s,o);break;case 30:Pt(s,s.return),Ta(s,o);break;case 7:Pt(s,s.return);default:Ta(s,o)}e=e.sibling}}function is(e,t,s){for(s=(t.subtreeFlags&8772)!==0?s:s&-2,t=t.child;t!==null;){var o=t.alternate,u=e,h=t,y=h.flags,w=(s&1)!==0;switch(h.tag){case 0:case 11:case 15:is(u,h,s),sr(4,h);break;case 1:if(is(u,h,s),o=h,u=o.stateNode,typeof u.componentDidMount=="function")try{u.componentDidMount()}catch(K){Je(o,o.return,K)}if(o=h,u=o.updateQueue,u!==null){var L=o.stateNode;try{var I=u.shared.hiddenCallbacks;if(I!==null)for(u.shared.hiddenCallbacks=null,u=0;u<I.length;u++)Q0(I[u],L)}catch(K){Je(o,o.return,K)}}w&&y&64&&l1(h),Ss(h,h.return);break;case 27:(s&2)!==0&&c1(h);case 5:h.tag!==5&&h.tag!==27||o1(h),is(u,h,s),w&&o===null&&y&4&&kh(h),Ss(h,h.return);break;case 6:o1(h);break;case 26:L=h.stateNode,h.memoizedState!==null||L===null||Lt||Of(mr(L.ownerDocument),h.type,L),is(u,h,s),w&&o===null&&y&4&&kh(h),Ss(h,h.return);break;case 12:is(u,h,s);break;case 31:is(u,h,s),w&&y&4&&S1(u,h);break;case 13:is(u,h,s),w&&y&4&&j1(u,h);break;case 22:h.memoizedState===null&&is(u,h,s),Ss(h,h.return);break;case 30:is(u,h,s),Ss(h,h.return);break;case 7:Ss(h,h.return);default:is(u,h,s)}t=t.sibling}}function Yh(e,t){var s=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(s=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==s&&(e!=null&&e.refCount++,s!=null&&qo(s))}function Xh(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&qo(e))}function Xn(e,t,s,o){var u=(s&335544064)===s;if(t.subtreeFlags&(u?10262:10256))for(t=t.child;t!==null;)M1(e,t,s,o),t=t.sibling;else u&&m1(t)}function M1(e,t,s,o){var u=(s&335544064)===s;u&&t.alternate===null&&t.return!==null&&t.return.alternate!==null&&nu(t);var h=t.flags;switch(t.tag){case 0:case 11:case 15:Xn(e,t,s,o),h&2048&&sr(9,t);break;case 1:Xn(e,t,s,o);break;case 3:Xn(e,t,s,o),u&&Ih&&(e=e.containerInfo,e=e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,e.style.viewTransitionName==="root"&&(e.style.viewTransitionName=""),e=e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName==="none"&&(e.style.viewTransitionName="")),h&2048&&(h=null,t.alternate!==null&&(h=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==h&&(t.refCount++,h!=null&&qo(h)));break;case 12:if(h&2048){Xn(e,t,s,o),h=t.stateNode;try{var y=t.memoizedProps,w=y.id,L=y.onPostCommit;typeof L=="function"&&L(w,t.alternate===null?"mount":"update",h.passiveEffectDuration,-0)}catch(I){Je(t,t.return,I)}}else Xn(e,t,s,o);break;case 31:Xn(e,t,s,o);break;case 13:Xn(e,t,s,o);break;case 23:break;case 22:y=t.stateNode,w=t.alternate,t.memoizedState!==null?(u&&w!==null&&w.memoizedState===null&&nu(w),y._visibility&2?Xn(e,t,s,o):ir(e,t)):(u&&w!==null&&w.memoizedState!==null&&nu(t),y._visibility&2?Xn(e,t,s,o):(y._visibility|=2,bi(e,t,s,o,(t.subtreeFlags&10256)!==0||!1))),h&2048&&Yh(w,t);break;case 24:Xn(e,t,s,o),h&2048&&Xh(t.alternate,t);break;case 30:u&&(h=t.alternate,h!==null&&(ws(h.child,!0),ws(t.child,!0))),Xn(e,t,s,o);break;default:Xn(e,t,s,o)}}function bi(e,t,s,o,u){for(u=u&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var h=e,y=t,w=s,L=o,I=y.flags;switch(y.tag){case 0:case 11:case 15:bi(h,y,w,L,u),sr(8,y);break;case 23:break;case 22:var K=y.stateNode;y.memoizedState!==null?K._visibility&2?bi(h,y,w,L,u):ir(h,y):(K._visibility|=2,bi(h,y,w,L,u)),u&&I&2048&&Yh(y.alternate,y);break;case 24:bi(h,y,w,L,u),u&&I&2048&&Xh(y.alternate,y);break;default:bi(h,y,w,L,u)}t=t.sibling}}function ir(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var s=e,o=t,u=o.flags;switch(o.tag){case 22:ir(s,o),u&2048&&Yh(o.alternate,o);break;case 24:ir(s,o),u&2048&&Xh(o.alternate,o);break;default:ir(s,o)}t=t.sibling}}var Sl=8192;function jl(e,t,s){if(e.subtreeFlags&Sl)for(e=e.child;e!==null;)E1(e,t,s),e=e.sibling}function E1(e,t,s){switch(e.tag){case 26:jl(e,t,s),e.flags&Sl&&(e.memoizedState!==null?Qj(s,ls,e.memoizedState,e.memoizedProps):(e=e.stateNode,(t&335544128)===t&&Dx(s,e)));break;case 5:jl(e,t,s),e.flags&Sl&&(e=e.stateNode,(t&335544128)===t&&Dx(s,e));break;case 3:case 4:var o=ls;ls=mr(e.stateNode.containerInfo),jl(e,t,s),ls=o;break;case 22:e.memoizedState===null&&(o=e.alternate,o!==null&&o.memoizedState!==null?(o=Sl,Sl=16777216,jl(e,t,s),Sl=o):jl(e,t,s));break;case 30:if((e.flags&Sl)!==0&&(o=e.memoizedProps.name,o!=null&&o!=="auto")){var u=e.stateNode;u.paired=null,An===null&&(An=new Map),An.set(o,u)}jl(e,t,s);break;default:jl(e,t,s)}}function R1(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 or(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var s=0;s<t.length;s++){var o=t[s];$t=o,_1(o,e)}R1(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)T1(e),e=e.sibling}function T1(e){switch(e.tag){case 0:case 11:case 15:or(e),e.flags&2048&&Ra(9,e,e.return);break;case 3:or(e);break;case 12:or(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,iu(e)):or(e);break;default:or(e)}}function iu(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var s=0;s<t.length;s++){var o=t[s];$t=o,_1(o,e)}R1(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Ra(8,t,t.return),iu(t);break;case 22:s=t.stateNode,s._visibility&2&&(s._visibility&=-3,iu(t));break;default:iu(t)}e=e.sibling}}function _1(e,t){for(;$t!==null;){var s=$t;switch(s.tag){case 0:case 11:case 15:Ra(8,s,t);break;case 23:case 22:if(s.memoizedState!==null&&s.memoizedState.cachePool!==null){var o=s.memoizedState.cachePool.pool;o!=null&&o.refCount++}break;case 24:qo(s.memoizedState.cache)}if(o=s.child,o!==null)o.return=s,$t=o;else e:for(s=e;$t!==null;){o=$t;var u=o.sibling,h=o.return;if(y1(o),o===s){$t=null;break e}if(u!==null){u.return=h,$t=u;break e}$t=h}}}var VS={getCacheForType:function(e){var t=Gt(wt),s=t.data.get(e);return s===void 0&&(s=e(),t.data.set(e,s)),s},cacheSignal:function(){return Gt(wt).controller.signal}},GS=typeof WeakMap=="function"?WeakMap:Map,Pe=0,st=null,De=null,Le=0,Ze=0,On=null,_a=!1,Si=!1,Kh=!1,Zs=0,pt=0,Aa=0,wl=0,ou=0,zn=0,ji=0,rr=null,yn=null,Zh=!1,ru=0,A1=0,cu=1/0,uu=null,Oa=null,dt=0,os=null,Nl=null,Es=0,Jh=0,Wh=null,O1=null,wi=null,Ni=null,Ci=null,cr=0,du=null;function Dn(){return(Pe&2)!==0&&Le!==0?Le&-Le:ge.T!==null?uf():Mo()}function z1(){if(zn===0)if((Le&536870912)===0||ze){var e=ca;ca<<=1,(ca&3932160)===0&&(ca=262144),zn=e}else zn=536870912;return e=qt.current,e!==null&&(e.flags|=32),zn}function Mi(e,t){if(t!=null){var s=e.stateNode,o=s.ref;o===null&&(o=s.ref=fx(Fs(e.memoizedProps,s))),Ni===null&&(Ni=[]),Ni.push(t.bind(null,o))}}function bn(e,t,s){(e===st&&(Ze===2||Ze===9)||e.cancelPendingCommit!==null)&&(Ei(e,0),za(e,Le,zn,!1)),da(e,s),((Pe&2)===0||e!==st)&&(e===st&&((Pe&2)===0&&(wl|=s),pt===4&&za(e,Le,zn,!1)),Rs(e))}function D1(e,t,s){if((Pe&6)!==0)throw Error(i(327));var o=!s&&(t&127)===0&&(t&e.expiredLanes)===0||ua(e,t),u=o?PS(e,t):tf(e,t,!0),h=o;do{if(u===0){Si&&!o&&za(e,t,0,!1);break}else{if(s=e.current.alternate,h&&!qS(s)){u=tf(e,t,!1),h=!1;continue}if(u===2){if(h=t,e.errorRecoveryDisabledLanes&h)var y=0;else y=e.pendingLanes&-536870913,y=y!==0?y:y&536870912?536870912:0;if(y!==0){t=y;e:{var w=e;u=rr;var L=w.current.memoizedState.isDehydrated;if(L&&(Ei(w,y).flags|=256),y=tf(w,y,!1),y!==2&&y!==6){if(Kh&&!L){w.errorRecoveryDisabledLanes|=h,wl|=h,u=4;break e}h=yn,yn=u,h!==null&&(yn===null?yn=h:yn.push.apply(yn,h))}u=y}if(h=!1,u!==2)continue}}if(u===1){Ei(e,0),za(e,t,0,!0);break}e:{switch(o=e,h=u,h){case 0:case 1:throw Error(i(345));case 4:if((t&4194048)!==t&&(t&62914560)!==t)break;case 6:za(o,t,zn,!_a);break e;case 2:yn=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(u=ru+300-tt(),10<u)){if(za(o,t,zn,!_a),al(o,0,!0)!==0)break e;Es=t,o.timeoutHandle=Sf(k1.bind(null,o,s,yn,uu,Zh,t,zn,wl,ji,_a,h,"Throttled",-0,0),u);break e}k1(o,s,yn,uu,Zh,t,zn,wl,ji,_a,h,null,-0,0)}}break}while(!0);Rs(e)}function k1(e,t,s,o,u,h,y,w,L,I,K,ne,F,Y){e.timeoutHandle=-1;var fe=t.subtreeFlags,ye=(h&335544064)===h;if(ne=null,(ye||fe&8192||(fe&16785408)===16785408)&&(ne={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:vs},An=null,E1(t,h,ne),ye&&(fe=ne,ye=e.containerInfo,ye=(ye.nodeType===9?ye:ye.ownerDocument).__reactViewTransition,ye!=null&&(fe.count++,fe.waitingForViewTransition=!0,fe=xr.bind(fe),ye.finished.then(fe,fe))),fe=(h&62914560)===h?ru-tt():(h&4194048)===h?A1-tt():0,fe=Yj(ne,fe),fe!==null)){Es=h,e.cancelPendingCommit=fe(G1.bind(null,e,t,h,s,o,u,y,w,L,I,K,ne,null,F,Y)),za(e,h,y,!I);return}G1(e,t,h,s,o,u,y,w,L,I,K,ne)}function qS(e){for(var t=e;;){var s=t.tag;if((s===0||s===11||s===15)&&t.flags&16384&&(s=t.updateQueue,s!==null&&(s=s.stores,s!==null)))for(var o=0;o<s.length;o++){var u=s[o],h=u.getSnapshot;u=u.value;try{if(!Tn(h(),u))return!1}catch{return!1}}if(s=t.child,t.subtreeFlags&16384&&s!==null)s.return=t,t=s;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 za(e,t,s,o){t=So(e,t),t&=~ou,t&=~wl,e.suspendedLanes|=t,e.pingedLanes&=~t,o&&(e.warmLanes|=t),o=e.expirationTimes;for(var u=t;0<u;){var h=31-ln(u),y=1<<h;o[h]=-1,u&=~y}s!==0&&wo(e,s,t)}function hu(){return(Pe&6)===0?(ur(0),!1):!0}function ef(){if(De!==null){if(Ze===0)var e=De.return;else e=De,Is=dl=null,rh(e),fi=null,Qo=0,e=De;for(;e!==null;)a1(e.alternate,e),e=e.return;De=null}}function Ei(e,t){var s=e.timeoutHandle;return s!==-1&&(e.timeoutHandle=-1,mj(s)),s=e.cancelPendingCommit,s!==null&&(e.cancelPendingCommit=null,s()),Es=0,ef(),st=e,De=s=Gs(e.current,null),Le=t,Ze=0,On=null,_a=!1,Si=ua(e,t),Kh=!1,ji=zn=ou=wl=Aa=pt=0,yn=rr=null,Zh=!1,Zs=So(e,t),bc(),s}function L1(e,t){_e=null,ge.H=Ic,t===hi||t===Ac?(t=G0(),Ze=3):t===Xd?(t=G0(),Ze=4):Ze=t===wh?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,On=t,De===null&&(pt=1,Pc(e,In(t,e.current)))}function $1(){var e=qt.current;return e===null?!0:(Le&4194048)===Le?en===null:(Le&62914560)===Le||(Le&536870912)!==0?e===en:!1}function H1(){var e=ge.H;return ge.H=Ic,e===null?Ic:e}function U1(){var e=ge.A;return ge.A=VS,e}function fu(){pt=4,_a||(Le&4194048)!==Le&&qt.current!==null||(Si=!0),(Aa&134217727)===0&&(wl&134217727)===0||st===null||za(st,Le,zn,!1)}function tf(e,t,s){var o=Pe;Pe|=2;var u=H1(),h=U1();(st!==e||Le!==t)&&(uu=null,Ei(e,t)),t=!1;var y=pt;e:do try{if(Ze!==0&&De!==null){var w=De,L=On;switch(Ze){case 8:ef(),y=6;break e;case 3:case 2:case 9:case 6:qt.current===null&&(t=!0);var I=Ze;if(Ze=0,On=null,Ri(e,w,L,I),s&&Si){y=0;break e}break;default:I=Ze,Ze=0,On=null,Ri(e,w,L,I)}}IS(),y=pt;break}catch(K){L1(e,K)}while(!0);return t&&e.shellSuspendCounter++,Is=dl=null,Pe=o,ge.H=u,ge.A=h,De===null&&(st=null,Le=0,bc()),y}function IS(){for(;De!==null;)B1(De)}function PS(e,t){var s=Pe;Pe|=2;var o=H1(),u=U1();st!==e||Le!==t?(uu=null,cu=tt()+500,Ei(e,t)):Si=ua(e,t);e:do try{if(Ze!==0&&De!==null){t=De;var h=On;t:switch(Ze){case 1:Ze=0,On=null,Ri(e,t,h,1);break;case 2:case 9:if(F0(h)){Ze=0,On=null,F1(t);break}t=function(){Ze!==2&&Ze!==9||st!==e||(Ze=7),Rs(e)},h.then(t,t);break e;case 3:Ze=7;break e;case 4:Ze=5;break e;case 7:F0(h)?(Ze=0,On=null,F1(t)):(Ze=0,On=null,Ri(e,t,h,7));break;case 5:var y=null;switch(De.tag){case 26:y=De.memoizedState;case 5:case 27:var w=De;if(y?Ox(y):w.stateNode.complete){Ze=0,On=null;var L=w.sibling;if(L!==null)De=L;else{var I=w.return;I!==null?(De=I,mu(I)):De=null}break t}}Ze=0,On=null,Ri(e,t,h,5);break;case 6:Ze=0,On=null,Ri(e,t,h,6);break;case 8:ef(),pt=6;break e;default:throw Error(i(462))}}QS();break}catch(K){L1(e,K)}while(!0);return Is=dl=null,ge.H=o,ge.A=u,Pe=s,De!==null?0:(st=null,Le=0,bc(),pt)}function QS(){for(;De!==null&&!ft();)B1(De)}function B1(e){var t=n1(e.alternate,e,Zs);e.memoizedProps=e.pendingProps,t===null?mu(e):De=t}function F1(e){var t=e,s=t.alternate;switch(t.tag){case 15:case 0:t=Xp(s,t,t.pendingProps,t.type,void 0,Le);break;case 11:t=Xp(s,t,t.pendingProps,t.type.render,t.ref,Le);break;case 5:rh(t);var o=t;o===kt&&(ze?(Mc(o),o.tag===5&&o.stateNode!=null&&(at=o.stateNode)):(Mc(o),ze=!0));default:a1(s,t),t=De=_0(t,Zs),t=n1(s,t,Zs)}e.memoizedProps=e.pendingProps,t===null?mu(e):De=t}function Ri(e,t,s,o){Is=dl=null,rh(t),fi=null,Qo=0;var u=t.return;try{if(DS(e,u,t,s,Le)){pt=1,Pc(e,In(s,e.current)),De=null;return}}catch(h){if(u!==null)throw De=u,h;pt=1,Pc(e,In(s,e.current)),De=null;return}t.flags&32768?(ze||o===1?e=!0:Si||(Le&536870912)!==0?e=!1:(_a=e=!0,(o===2||o===9||o===3||o===6)&&(o=qt.current,o!==null&&o.tag===13&&(o.flags|=16384))),V1(t,e)):mu(t)}function mu(e){var t=e;do{if((t.flags&32768)!==0){V1(t,_a);return}e=t.return;var s=HS(t.alternate,t,Zs);if(s!==null){De=s;return}if(t=t.sibling,t!==null){De=t;return}De=t=e}while(t!==null);pt===0&&(pt=5)}function V1(e,t){do{var s=US(e.alternate,e);if(s!==null){s.flags&=32767,De=s;return}if(s=e.return,s!==null&&(s.flags|=32768,s.subtreeFlags=0,s.deletions=null),!t&&(e=e.sibling,e!==null)){De=e;return}De=e=s}while(e!==null);pt=6,De=null}function G1(e,t,s,o,u,h,y,w,L,I,K,ne){e.cancelPendingCommit=null;do gu();while(dt!==0);if((Pe&6)!==0)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));e===st&&(De=st=null,Le=0),Nl=t,os=e,Es=s,Wh=u,O1=o,YS(e,t,s,y,w,L,ne)}}function YS(e,t,s,o,u,h,y){var w=t.lanes|t.childLanes;if(Jh=w,w|=Ld,ic(e,s,w,o,u,h),Ni=null,(s&335544064)===s?(Ci=jS(e),o=10262):(Ci=null,o=10256),(t.subtreeFlags&o)!==0||(t.flags&o)!==0?(e.callbackNode=null,e.callbackPriority=0,ej(Mn,function(){return lf(),null})):(e.callbackNode=null,e.callbackPriority=0),eu=!1,o=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||o){o=ge.T,ge.T=null,u=ve.p,ve.p=2,h=Pe,Pe|=4;try{BS(e,t,s)}finally{Pe=h,ve.p=u,ge.T=o}}dt=1,eu?wi=bj(y,e.containerInfo,Ci,nf,sf,KS,af,lf,XS):(nf(),sf(),af())}function XS(e){if(dt!==0){var t=os.onRecoverableError;t(e,{componentStack:null})}}function KS(){dt===3&&(dt=0,C1(Nl,os),dt=4)}function nf(){if(dt===1){dt=0;var e=os,t=Nl,s=Es,o=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||o){o=ge.T,ge.T=null;var u=ve.p;ve.p=2;var h=Pe;Pe|=4;try{lr=su=!1,w1(t,e,s),s=vf;var y=b0(e.containerInfo),w=s.focusedElem,L=s.selectionRange;if(y!==w&&w&&w.ownerDocument&&y0(w.ownerDocument.documentElement,w)){if(L!==null&&Ad(w)){var I=L.start,K=L.end;if(K===void 0&&(K=I),"selectionStart"in w)w.selectionStart=I,w.selectionEnd=Math.min(K,w.value.length);else{var ne=w.ownerDocument||document,F=ne&&ne.defaultView||window;if(F.getSelection){var Y=F.getSelection(),fe=w.textContent.length,ye=Math.min(L.start,fe),Ae=L.end===void 0?ye:Math.min(L.end,fe);!Y.extend&&ye>Ae&&(y=Ae,Ae=ye,ye=y);var q=v0(w,ye),H=v0(w,Ae);if(q&&H&&(Y.rangeCount!==1||Y.anchorNode!==q.node||Y.anchorOffset!==q.offset||Y.focusNode!==H.node||Y.focusOffset!==H.offset)){var Q=ne.createRange();Q.setStart(q.node,q.offset),Y.removeAllRanges(),ye>Ae?(Y.addRange(Q),Y.extend(H.node,H.offset)):(Q.setEnd(H.node,H.offset),Y.addRange(Q))}}}}for(ne=[],Y=w;Y=Y.parentNode;)Y.nodeType===1&&ne.push({element:Y,left:Y.scrollLeft,top:Y.scrollTop});for(typeof w.focus=="function"&&w.focus(),w=0;w<ne.length;w++){var ee=ne[w];ee.element.scrollLeft=ee.left,ee.element.scrollTop=ee.top}}Li=!!xf,vf=xf=null}finally{Pe=h,ve.p=u,ge.T=o}}e.current=t,dt=2}}function sf(){if(dt===2){dt=0;var e=os,t=Nl,s=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||s){s=ge.T,ge.T=null;var o=ve.p;ve.p=2;var u=Pe;Pe|=4;try{x1(e,t.alternate,t)}finally{Pe=u,ve.p=o,ge.T=s}}dt=3}}function af(){if(dt===4||dt===3){dt=0;var e=wi;wi=null,zt();var t=os,s=Nl,o=Es,u=O1,h=(o&335544064)===o?10262:10256;if((s.subtreeFlags&h)!==0||(s.flags&h)!==0?dt=5:(dt=0,Nl=os=null,q1(t,t.pendingLanes)),h=t.pendingLanes,h===0&&(Oa=null),Jl(o),s=s.stateNode,Ft&&typeof Ft.onCommitFiberRoot=="function")try{Ft.onCommitFiberRoot(En,s,void 0,(s.current.flags&128)===128)}catch{}if(u!==null){s=ge.T,h=ve.p,ve.p=2,ge.T=null;try{for(var y=t.onRecoverableError,w=0;w<u.length;w++){var L=u[w];y(L.value,{componentStack:L.stack})}}finally{ge.T=s,ve.p=h}}if(u=Ni,y=Ci,Ci=null,u!==null&&(Ni=null,y===null&&(y=[]),e!==null))for(L=0;L<u.length;L++)s=(0,u[L])(y),s!==void 0&&e.finished.finally(s);(Es&3)!==0&&gu(),Rs(t),h=t.pendingLanes,(o&261930)!==0&&(h&42)!==0?t===du?cr++:(cr=0,du=t):(cr=0,du=null),ur(0)}}function q1(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,qo(t)))}function gu(){return wi!==null&&(wi.skipTransition(),wi=null),nf(),sf(),af(),lf()}function lf(){if(dt!==5)return!1;var e=os,t=Jh;Jh=0;var s=Jl(Es),o=ge.T,u=ve.p;try{ve.p=32>s?32:s,ge.T=null,s=Wh,Wh=null;var h=os,y=Es;if(dt=0,Nl=os=null,Es=0,(Pe&6)!==0)throw Error(i(331));var w=Pe;if(Pe|=4,T1(h.current),M1(h,h.current,y,s),Pe=w,ur(0,!1),Ft&&typeof Ft.onPostCommitFiberRoot=="function")try{Ft.onPostCommitFiberRoot(En,h)}catch{}return!0}finally{ve.p=u,ge.T=o,q1(e,t)}}function I1(e,t,s){t=In(s,t),t=jh(e.stateNode,t,2),e=Na(e,t,2),e!==null&&(da(e,2),Rs(e))}function Je(e,t,s){if(e.tag===3)I1(e,e,s);else for(;t!==null;){if(t.tag===3){I1(t,e,s);break}else if(t.tag===1){var o=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof o.componentDidCatch=="function"&&(Oa===null||!Oa.has(o))){e=In(s,e),s=Fp(2),o=Na(t,s,2),o!==null&&(Vp(s,o,t,e),da(o,2),Rs(o));break}}t=t.return}}function of(e,t,s){var o=e.pingCache;if(o===null){o=e.pingCache=new GS;var u=new Set;o.set(t,u)}else u=o.get(t),u===void 0&&(u=new Set,o.set(t,u));u.has(s)||(Kh=!0,u.add(s),e=ZS.bind(null,e,t,s),t.then(e,e))}function ZS(e,t,s){var o=e.pingCache;o!==null&&o.delete(t),e.pingedLanes|=e.suspendedLanes&s,e.warmLanes&=~s,st===e&&(Le&s)===s&&((pt===4||pt===3&&(Le&62914560)===Le&&300>tt()-ru)&&(Pe&2)===0?Ei(e,0):ou|=s,ji===Le&&(ji=0)),Rs(e)}function P1(e,t){t===0&&(t=jo()),e=rl(e,t),e!==null&&(da(e,t),Rs(e))}function JS(e){var t=e.memoizedState,s=0;t!==null&&(s=t.retryLane),P1(e,s)}function WS(e,t){var s=0;switch(e.tag){case 31:case 13:var o=e.stateNode,u=e.memoizedState;u!==null&&(s=u.retryLane);break;case 19:o=e.stateNode;break;case 22:o=e.stateNode._retryCache;break;default:throw Error(i(314))}o!==null&&o.delete(t),P1(e,s)}function ej(e,t){return Ge(e,t)}var Ti=null,_i=null,rf=!1,pu=!1,cf=!1,Da=0;function Rs(e){e!==_i&&e.next===null&&(_i===null?Ti=_i=e:_i=_i.next=e),pu=!0,rf||(rf=!0,nj())}function ur(e,t){if(!cf&&pu){cf=!0;do for(var s=!1,o=Ti;o!==null;){if(e!==0){var u=o.pendingLanes;if(u===0)var h=0;else{var y=o.suspendedLanes,w=o.pingedLanes;h=(1<<31-ln(42|e)+1)-1,h&=u&~(y&~w),h=h&201326741?h&201326741|1:h?h|2:0}h!==0&&(s=!0,K1(o,h))}else h=Le,h=al(o,o===st?h:0,o.cancelPendingCommit!==null||o.timeoutHandle!==-1),(h&3)===0||ua(o,h)||(s=!0,K1(o,h));o=o.next}while(s);cf=!1}}function tj(){Q1()}function Q1(){pu=rf=!1;var e=0;Da!==0&&fj()&&(e=Da);for(var t=tt(),s=null,o=Ti;o!==null;){var u=o.next,h=Y1(o,t);h===0?(o.next=null,s===null?Ti=u:s.next=u,u===null&&(_i=s)):(s=o,(e!==0||(h&3)!==0)&&(pu=!0)),o=u}dt!==0&&dt!==5||ur(e),Da!==0&&(Da=0)}function Y1(e,t){for(var s=e.suspendedLanes,o=e.pingedLanes,u=e.expirationTimes,h=e.pendingLanes&-62914561;0<h;){var y=31-ln(h),w=1<<y,L=u[y];L===-1?((w&s)===0||(w&o)!==0)&&(u[y]=lc(w,t)):L<=t&&(e.expiredLanes|=w),h&=~w}if(t=st,s=Le,s=al(e,e===t?s:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),o=e.callbackNode,s===0||e===t&&(Ze===2||Ze===9)||e.cancelPendingCommit!==null)return o!==null&&o!==null&&Ke(o),e.callbackNode=null,e.callbackPriority=0;if((s&3)===0||ua(e,s)){if(t=s&-s,t===e.callbackPriority)return t;switch(o!==null&&Ke(o),Jl(s)){case 2:case 8:s=sl;break;case 32:s=Mn;break;case 268435456:s=ra;break;default:s=Mn}return o=X1.bind(null,e),s=Ge(s,o),e.callbackPriority=t,e.callbackNode=s,t}return o!==null&&o!==null&&Ke(o),e.callbackPriority=2,e.callbackNode=null,2}function X1(e,t){if(dt!==0&&dt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var s=e.callbackNode;if(gu()&&e.callbackNode!==s)return null;var o=Le;return o=al(e,e===st?o:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),o===0?null:(D1(e,o,t),Y1(e,tt()),e.callbackNode!=null&&e.callbackNode===s?X1.bind(null,e):null)}function K1(e,t){if(gu())return null;D1(e,t,!0)}function nj(){gj(function(){(Pe&6)!==0?Ge(Cn,tj):Q1()})}function uf(){if(Da===0){var e=ml;e===0&&(e=Xl,Xl<<=1,(Xl&261888)===0&&(Xl=256)),Da=e}return Da}function Z1(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:hc(e)}function sj(e,t,s,o,u){if(t==="submit"&&s&&s.stateNode===u){var h=Z1((u[Vt]||null).action),y=o.submitter;y&&(t=(t=y[Vt]||null)?Z1(t.formAction):y.getAttribute("formAction"),t!==null&&(h=t,y=null));var w=new pc("action","action",null,o,u);e.push({event:w,listeners:[{instance:null,listener:function(){if(o.defaultPrevented){if(Da!==0){var L=new FormData(u,y);xh(s,{pending:!0,data:L,method:u.method,action:h},null,L)}}else typeof h=="function"&&(w.preventDefault(),L=new FormData(u,y),xh(s,{pending:!0,data:L,method:u.method,action:h},h,L))},currentTarget:u}]})}}for(var df=0;df<kd.length;df++){var hf=kd[df],aj=hf.toLowerCase(),lj=hf[0].toUpperCase()+hf.slice(1);ss(aj,"on"+lj)}ss(w0,"onAnimationEnd"),ss(N0,"onAnimationIteration"),ss(C0,"onAnimationStart"),ss("dblclick","onDoubleClick"),ss("focusin","onFocus"),ss("focusout","onBlur"),ss(mS,"onTransitionRun"),ss(gS,"onTransitionStart"),ss(pS,"onTransitionCancel"),ss(M0,"onTransitionEnd"),ma("onMouseEnter",["mouseout","mouseover"]),ma("onMouseLeave",["mouseout","mouseover"]),ma("onPointerEnter",["pointerout","pointerover"]),ma("onPointerLeave",["pointerout","pointerover"]),xs("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),xs("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),xs("onBeforeInput",["compositionend","keypress","textInput","paste"]),xs("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),xs("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),xs("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var dr="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(" "),ij=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(dr));function J1(e,t){t=(t&4)!==0;for(var s=0;s<e.length;s++){var o=e[s],u=o.event;o=o.listeners;e:{var h=void 0;if(t)for(var y=o.length-1;0<=y;y--){var w=o[y],L=w.instance,I=w.currentTarget;if(w=w.listener,L!==h&&u.isPropagationStopped())break e;h=w,u.currentTarget=I;try{h(u)}catch(K){yc(K)}u.currentTarget=null,h=L}else for(y=0;y<o.length;y++){if(w=o[y],L=w.instance,I=w.currentTarget,w=w.listener,L!==h&&u.isPropagationStopped())break e;h=w,u.currentTarget=I;try{h(u)}catch(K){yc(K)}u.currentTarget=null,h=L}}}}function ke(e,t){var s=t[Ro];s===void 0&&(s=t[Ro]=new Set);var o=e+"__bubble";s.has(o)||(W1(t,e,2,!1),s.add(o))}function ff(e,t,s){var o=0;t&&(o|=4),W1(s,e,o,t)}var xu="_reactListening"+Math.random().toString(36).slice(2);function mf(e){if(!e[xu]){e[xu]=!0,_o.forEach(function(s){s!=="selectionchange"&&(ij.has(s)||ff(s,!1,e),ff(s,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[xu]||(t[xu]=!0,ff("selectionchange",!1,t))}}function W1(e,t,s,o){switch(Vx(t)){case 2:var u=Jj;break;case 8:u=Wj;break;default:u=Df}s=u.bind(null,t,s,e),u=void 0,!Sd||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(u=!0),o?u!==void 0?e.addEventListener(t,s,{capture:!0,passive:u}):e.addEventListener(t,s,!0):u!==void 0?e.addEventListener(t,s,{passive:u}):e.addEventListener(t,s,!1)}function gf(e,t,s,o,u){var h=o;if((t&1)===0&&(t&2)===0&&o!==null)e:for(;;){if(o===null)return;var y=o.tag;if(y===3||y===4){var w=o.stateNode.containerInfo;if(w===u)break;if(y===4)for(y=o.return;y!==null;){var L=y.tag;if((L===3||L===4)&&y.stateNode.containerInfo===u)return;y=y.return}for(;w!==null;){if(y=jt(w),y===null)return;if(L=y.tag,L===5||L===6||L===26||L===27){o=h=y;continue e}w=w.parentNode}}o=o.return}Wg(function(){var I=h,K=yd(s),ne=[];e:{var F=E0.get(e);if(F!==void 0){var Y=pc,fe=e;switch(e){case"keypress":if(mc(s)===0)break e;case"keydown":case"keyup":Y=qb;break;case"focusin":fe="focus",Y=Cd;break;case"focusout":fe="blur",Y=Cd;break;case"beforeblur":case"afterblur":Y=Cd;break;case"click":if(s.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Y=n0;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Y=Ob;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Y=Xb;break;case w0:case N0:case C0:Y=kb;break;case M0:Y=Zb;break;case"scroll":case"scrollend":Y=_b;break;case"wheel":Y=Wb;break;case"copy":case"cut":case"paste":Y=$b;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Y=a0;break;case"submit":Y=Qb;break;case"toggle":case"beforetoggle":Y=tS}var ye=(t&4)!==0,Ae=!ye&&(e==="scroll"||e==="scrollend"),q=ye?F!==null?F+"Capture":null:F;ye=[];for(var H=I,Q;H!==null;){var ee=H;if(Q=ee.stateNode,ee=ee.tag,ee!==5&&ee!==26&&ee!==27||Q===null||q===null||(ee=zo(H,q),ee!=null&&ye.push(hr(H,ee,Q))),Ae)break;H=H.return}0<ye.length&&(F=new Y(F,fe,null,s,K),ne.push({event:F,listeners:ye}))}}if((t&7)===0){e:{if(Y=e==="mouseover"||e==="pointerover",F=e==="mouseout"||e==="pointerout",Y&&s!==vd&&(fe=s.relatedTarget||s.fromElement)&&(jt(fe)||fe[Hs]))break e;(F||Y)&&(fe=K.window===K?K:(Y=K.ownerDocument)?Y.defaultView||Y.parentWindow:window,F?(Y=s.relatedTarget||s.toElement,F=I,Y=Y?jt(Y):null,Y!==null&&(Ae=d(Y),ye=Y.tag,Y!==Ae||ye!==5&&ye!==27&&ye!==6)&&(Y=null)):(F=null,Y=I),F!==Y&&(ye=n0,ee="onMouseLeave",q="onMouseEnter",H="mouse",(e==="pointerout"||e==="pointerover")&&(ye=a0,ee="onPointerLeave",q="onPointerEnter",H="pointer"),Ae=F==null?fe:ll(F),Q=Y==null?fe:ll(Y),fe=new ye(ee,H+"leave",F,s,K),fe.target=Ae,fe.relatedTarget=Q,ee=null,jt(K)===I&&(ye=new ye(q,H+"enter",Y,s,K),ye.target=Q,ye.relatedTarget=Ae,ee=ye),Ae=ee,ye=F&&Y?_(F,Y,oj):null,F!==null&&ex(ne,fe,F,ye,!1),Y!==null&&Ae!==null&&ex(ne,Ae,Y,ye,!0)))}e:{if(F=I?ll(I):window,Y=F.nodeName&&F.nodeName.toLowerCase(),Y==="select"||Y==="input"&&F.type==="file")var xe=h0;else if(u0(F))if(f0)xe=dS;else{xe=cS;var $e=rS}else Y=F.nodeName,!Y||Y.toLowerCase()!=="input"||F.type!=="checkbox"&&F.type!=="radio"?I&&xd(I.elementType)&&(xe=h0):xe=uS;if(xe&&(xe=xe(e,I))){d0(ne,xe,s,K);break e}$e&&$e(e,F,I)}switch($e=I?ll(I):window,e){case"focusin":(u0($e)||$e.contentEditable==="true")&&(ai=$e,Od=I,Fo=null);break;case"focusout":Fo=Od=ai=null;break;case"mousedown":zd=!0;break;case"contextmenu":case"mouseup":case"dragend":zd=!1,S0(ne,s,K);break;case"selectionchange":if(fS)break;case"keydown":case"keyup":S0(ne,s,K)}var je;if(Ed)e:{switch(e){case"compositionstart":var Ce="onCompositionStart";break e;case"compositionend":Ce="onCompositionEnd";break e;case"compositionupdate":Ce="onCompositionUpdate";break e}Ce=void 0}else si?r0(e,s)&&(Ce="onCompositionEnd"):e==="keydown"&&s.keyCode===229&&(Ce="onCompositionStart");Ce&&(l0&&s.locale!=="ko"&&(si||Ce!=="onCompositionStart"?Ce==="onCompositionEnd"&&si&&(je=e0()):(ga=K,jd="value"in ga?ga.value:ga.textContent,si=!0)),$e=vu(I,Ce),0<$e.length&&(Ce=new s0(Ce,e,null,s,K),ne.push({event:Ce,listeners:$e}),je?Ce.data=je:(je=c0(s),je!==null&&(Ce.data=je)))),(je=sS?aS(e,s):lS(e,s))&&(Ce=vu(I,"onBeforeInput"),0<Ce.length&&($e=new s0("onBeforeInput","beforeinput",null,s,K),ne.push({event:$e,listeners:Ce}),$e.data=je)),sj(ne,e,I,s,K)}J1(ne,t)})}function hr(e,t,s){return{instance:e,listener:t,currentTarget:s}}function vu(e,t){for(var s=t+"Capture",o=[];e!==null;){var u=e,h=u.stateNode;if(u=u.tag,u!==5&&u!==26&&u!==27||h===null||(u=zo(e,s),u!=null&&o.unshift(hr(e,u,h)),u=zo(e,t),u!=null&&o.push(hr(e,u,h))),e.tag===3)return o;e=e.return}return[]}function oj(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function ex(e,t,s,o,u){for(var h=t._reactName,y=[];s!==null&&s!==o;){var w=s,L=w.alternate,I=w.stateNode;if(w=w.tag,L!==null&&L===o)break;w!==5&&w!==26&&w!==27||I===null||(L=I,u?(I=zo(s,h),I!=null&&y.unshift(hr(s,I,L))):u||(I=zo(s,h),I!=null&&y.push(hr(s,I,L)))),s=s.return}y.length!==0&&e.push({event:t,listeners:y})}var rj=/\r\n?/g,cj=/\u0000|\uFFFD/g;function tx(e){return(typeof e=="string"?e:""+e).replace(rj,`
|
|
49
|
+
`).replace(cj,"")}function nx(e,t){return t=tx(t),tx(e)===t}function We(e,t,s,o,u,h){switch(s){case"children":if(typeof o=="string")t==="body"||t==="textarea"&&o===""||ei(e,o);else if(typeof o=="number"||typeof o=="bigint")t!=="body"&&ei(e,""+o);else return;break;case"className":dc(e,"class",o);break;case"tabIndex":dc(e,"tabindex",o);break;case"dir":case"role":case"viewBox":case"width":case"height":dc(e,s,o);break;case"style":Zg(e,o,h);return;case"data":if(t!=="object"){dc(e,"data",o);break}case"src":case"href":if(o===""&&(t!=="a"||s!=="href")){e.removeAttribute(s);break}if(o==null||typeof o=="function"||typeof o=="symbol"||typeof o=="boolean"){e.removeAttribute(s);break}o=hc(o),e.setAttribute(s,o);break;case"action":case"formAction":if(typeof o=="function"){e.setAttribute(s,"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 h=="function"&&(s==="formAction"?(t!=="input"&&We(e,t,"name",u.name,u,null),We(e,t,"formEncType",u.formEncType,u,null),We(e,t,"formMethod",u.formMethod,u,null),We(e,t,"formTarget",u.formTarget,u,null)):(We(e,t,"encType",u.encType,u,null),We(e,t,"method",u.method,u,null),We(e,t,"target",u.target,u,null)));if(o==null||typeof o=="symbol"||typeof o=="boolean"){e.removeAttribute(s);break}o=hc(o),e.setAttribute(s,o);break;case"onClick":o!=null&&(e.onclick=vs);return;case"onScroll":o!=null&&ke("scroll",e);return;case"onScrollEnd":o!=null&&ke("scrollend",e);return;case"dangerouslySetInnerHTML":if(o!=null){if(typeof o!="object"||!("__html"in o))throw Error(i(61));if(s=o.__html,s!=null){if(u.children!=null)throw Error(i(60));(h!=null?h.__html:void 0)!==s&&(e.innerHTML=s)}}break;case"multiple":e.multiple=o&&typeof o!="function"&&typeof o!="symbol";break;case"muted":e.muted=o&&typeof o!="function"&&typeof o!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(o==null||typeof o=="function"||typeof o=="boolean"||typeof o=="symbol"){e.removeAttribute("xlink:href");break}s=hc(o),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",s);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":o!=null&&typeof o!="function"&&typeof o!="symbol"?e.setAttribute(s,o):e.removeAttribute(s);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"credentialless":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":o&&typeof o!="function"&&typeof o!="symbol"?e.setAttribute(s,""):e.removeAttribute(s);break;case"capture":case"download":o===!0?e.setAttribute(s,""):o!==!1&&o!=null&&typeof o!="function"&&typeof o!="symbol"?e.setAttribute(s,o):e.removeAttribute(s);break;case"cols":case"rows":case"size":case"span":o!=null&&typeof o!="function"&&typeof o!="symbol"&&!isNaN(o)&&1<=o?e.setAttribute(s,o):e.removeAttribute(s);break;case"rowSpan":case"start":o==null||typeof o=="function"||typeof o=="symbol"||isNaN(o)?e.removeAttribute(s):e.setAttribute(s,o);break;case"popover":ke("beforetoggle",e),ke("toggle",e),uc(e,"popover",o);break;case"xlinkActuate":Us(e,"http://www.w3.org/1999/xlink","xlink:actuate",o);break;case"xlinkArcrole":Us(e,"http://www.w3.org/1999/xlink","xlink:arcrole",o);break;case"xlinkRole":Us(e,"http://www.w3.org/1999/xlink","xlink:role",o);break;case"xlinkShow":Us(e,"http://www.w3.org/1999/xlink","xlink:show",o);break;case"xlinkTitle":Us(e,"http://www.w3.org/1999/xlink","xlink:title",o);break;case"xlinkType":Us(e,"http://www.w3.org/1999/xlink","xlink:type",o);break;case"xmlBase":Us(e,"http://www.w3.org/XML/1998/namespace","xml:base",o);break;case"xmlLang":Us(e,"http://www.w3.org/XML/1998/namespace","xml:lang",o);break;case"xmlSpace":Us(e,"http://www.w3.org/XML/1998/namespace","xml:space",o);break;case"is":uc(e,"is",o);break;case"innerText":case"textContent":return;default:if(!(2<s.length)||s[0]!=="o"&&s[0]!=="O"||s[1]!=="n"&&s[1]!=="N")s=Rb.get(s)||s,uc(e,s,o);else return}qe=!0}function pf(e,t,s,o,u,h){switch(s){case"style":Zg(e,o,h);return;case"dangerouslySetInnerHTML":if(o!=null){if(typeof o!="object"||!("__html"in o))throw Error(i(61));if(s=o.__html,s!=null){if(u.children!=null)throw Error(i(60));(h!=null?h.__html:void 0)!==s&&(e.innerHTML=s)}}break;case"children":if(typeof o=="string")ei(e,o);else if(typeof o=="number"||typeof o=="bigint")ei(e,""+o);else return;break;case"onScroll":o!=null&&ke("scroll",e);return;case"onScrollEnd":o!=null&&ke("scrollend",e);return;case"onClick":o!=null&&(e.onclick=vs);return;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":return;case"innerText":case"textContent":return;default:if(!Ao.hasOwnProperty(s))e:{if(s[0]==="o"&&s[1]==="n"&&(u=s.endsWith("Capture"),h=s.slice(2,u?s.length-7:void 0),t=e[Vt]||null,t=t!=null?t[s]:null,typeof t=="function"&&e.removeEventListener(h,t,u),typeof o=="function")){typeof t!="function"&&t!==null&&(s in e?e[s]=null:e.hasAttribute(s)&&e.removeAttribute(s)),e.addEventListener(h,o,u);break e}qe=!0,s in e?e[s]=o:o===!0?e.setAttribute(s,""):uc(e,s,o)}return}qe=!0}function Qt(e,t,s){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":ke("error",e),ke("load",e);var o=!1,u=!1,h;for(h in s)if(s.hasOwnProperty(h)){var y=s[h];if(y!=null)switch(h){case"src":o=!0;break;case"srcSet":u=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(i(137,t));default:We(e,t,h,y,s,null)}}u&&We(e,t,"srcSet",s.srcSet,s,null),o&&We(e,t,"src",s.src,s,null);return;case"input":ke("invalid",e);var w=h=y=u=null,L=null,I=null;for(o in s)if(s.hasOwnProperty(o)){var K=s[o];if(K!=null)switch(o){case"name":u=K;break;case"type":y=K;break;case"checked":L=K;break;case"defaultChecked":I=K;break;case"value":h=K;break;case"defaultValue":w=K;break;case"children":case"dangerouslySetInnerHTML":if(K!=null)throw Error(i(137,t));break;default:We(e,t,o,K,s,null)}}Qg(e,h,w,L,I,y,u,!1);return;case"select":ke("invalid",e),o=y=h=null;for(u in s)if(s.hasOwnProperty(u)&&(w=s[u],w!=null))switch(u){case"value":h=w;break;case"defaultValue":y=w;break;case"multiple":o=w;default:We(e,t,u,w,s,null)}t=h,s=y,e.multiple=!!o,t!=null?Wl(e,!!o,t,!1):s!=null&&Wl(e,!!o,s,!0);return;case"textarea":ke("invalid",e),h=u=o=null;for(y in s)if(s.hasOwnProperty(y)&&(w=s[y],w!=null))switch(y){case"value":o=w;break;case"defaultValue":u=w;break;case"children":h=w;break;case"dangerouslySetInnerHTML":if(w!=null)throw Error(i(91));break;default:We(e,t,y,w,s,null)}Xg(e,o,u,h);return;case"option":for(L in s)if(s.hasOwnProperty(L)&&(o=s[L],o!=null))switch(L){case"selected":e.selected=o&&typeof o!="function"&&typeof o!="symbol";break;default:We(e,t,L,o,s,null)}return;case"dialog":ke("beforetoggle",e),ke("toggle",e),ke("cancel",e),ke("close",e);break;case"iframe":case"object":ke("load",e);break;case"video":case"audio":for(o=0;o<dr.length;o++)ke(dr[o],e);break;case"image":ke("error",e),ke("load",e);break;case"details":ke("toggle",e);break;case"embed":case"source":case"link":ke("error",e),ke("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(I in s)if(s.hasOwnProperty(I)&&(o=s[I],o!=null))switch(I){case"children":case"dangerouslySetInnerHTML":throw Error(i(137,t));default:We(e,t,I,o,s,null)}return;default:if(xd(t)){for(K in s)s.hasOwnProperty(K)&&(o=s[K],o!==void 0&&pf(e,t,K,o,s,void 0));return}}for(w in s)s.hasOwnProperty(w)&&(o=s[w],o!=null&&We(e,t,w,o,s,null))}var uj={};function dj(e,t,s,o){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var u=null,h=null,y=null,w=null,L=null,I=null,K=null;for(Y in s){var ne=s[Y];if(s.hasOwnProperty(Y)&&ne!=null)switch(Y){case"checked":break;case"value":break;case"defaultValue":L=ne;default:o.hasOwnProperty(Y)||We(e,t,Y,null,o,ne)}}for(var F in o){var Y=o[F];if(ne=s[F],o.hasOwnProperty(F)&&(Y!=null||ne!=null))switch(F){case"type":Y!==ne&&(qe=!0),h=Y;break;case"name":Y!==ne&&(qe=!0),u=Y;break;case"checked":Y!==ne&&(qe=!0),I=Y;break;case"defaultChecked":Y!==ne&&(qe=!0),K=Y;break;case"value":Y!==ne&&(qe=!0),y=Y;break;case"defaultValue":Y!==ne&&(qe=!0),w=Y;break;case"children":case"dangerouslySetInnerHTML":if(Y!=null)throw Error(i(137,t));break;default:Y!==ne&&We(e,t,F,Y,o,ne)}}gd(e,y,w,L,I,K,h,u);return;case"select":Y=y=w=F=null;for(h in s)if(L=s[h],s.hasOwnProperty(h)&&L!=null)switch(h){case"value":break;case"multiple":Y=L;default:o.hasOwnProperty(h)||We(e,t,h,null,o,L)}for(u in o)if(h=o[u],L=s[u],o.hasOwnProperty(u)&&(h!=null||L!=null))switch(u){case"value":h!==L&&(qe=!0),F=h;break;case"defaultValue":h!==L&&(qe=!0),w=h;break;case"multiple":h!==L&&(qe=!0),y=h;default:h!==L&&We(e,t,u,h,o,L)}t=w,s=y,o=Y,F!=null?Wl(e,!!s,F,!1):!!o!=!!s&&(t!=null?Wl(e,!!s,t,!0):Wl(e,!!s,s?[]:"",!1));return;case"textarea":Y=F=null;for(w in s)if(u=s[w],s.hasOwnProperty(w)&&u!=null&&!o.hasOwnProperty(w))switch(w){case"value":break;case"children":break;default:We(e,t,w,null,o,u)}for(y in o)if(u=o[y],h=s[y],o.hasOwnProperty(y)&&(u!=null||h!=null))switch(y){case"value":u!==h&&(qe=!0),F=u;break;case"defaultValue":u!==h&&(qe=!0),Y=u;break;case"children":break;case"dangerouslySetInnerHTML":if(u!=null)throw Error(i(91));break;default:u!==h&&We(e,t,y,u,o,h)}Yg(e,F,Y);return;case"option":for(var fe in s)if(F=s[fe],s.hasOwnProperty(fe)&&F!=null&&!o.hasOwnProperty(fe))switch(fe){case"selected":e.selected=!1;break;default:We(e,t,fe,null,o,F)}for(L in o)if(F=o[L],Y=s[L],o.hasOwnProperty(L)&&F!==Y&&(F!=null||Y!=null))switch(L){case"selected":F!==Y&&(qe=!0),e.selected=F&&typeof F!="function"&&typeof F!="symbol";break;default:We(e,t,L,F,o,Y)}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 ye in s)F=s[ye],s.hasOwnProperty(ye)&&F!=null&&!o.hasOwnProperty(ye)&&We(e,t,ye,null,o,F);for(I in o)if(F=o[I],Y=s[I],o.hasOwnProperty(I)&&F!==Y&&(F!=null||Y!=null))switch(I){case"children":case"dangerouslySetInnerHTML":if(F!=null)throw Error(i(137,t));break;default:We(e,t,I,F,o,Y)}return;default:if(xd(t)){for(var Ae in s)F=s[Ae],s.hasOwnProperty(Ae)&&F!==void 0&&!o.hasOwnProperty(Ae)&&pf(e,t,Ae,void 0,o,F);for(K in o)F=o[K],Y=s[K],!o.hasOwnProperty(K)||F===Y||F===void 0&&Y===void 0||pf(e,t,K,F,o,Y);return}}for(var q in s)F=s[q],s.hasOwnProperty(q)&&F!=null&&!o.hasOwnProperty(q)&&We(e,t,q,null,o,F);for(ne in o)F=o[ne],Y=s[ne],!o.hasOwnProperty(ne)||F===Y||F==null&&Y==null||We(e,t,ne,F,o,Y)}function sx(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function hj(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,s=performance.getEntriesByType("resource"),o=0;o<s.length;o++){var u=s[o],h=u.transferSize,y=u.initiatorType,w=u.duration;if(h&&w&&sx(y)){for(y=0,w=u.responseEnd,o+=1;o<s.length;o++){var L=s[o],I=L.startTime;if(I>w)break;var K=L.transferSize,ne=L.initiatorType;K&&sx(ne)&&(L=L.responseEnd,y+=K*(L<w?1:(w-I)/(L-I)))}if(--o,t+=8*(h+y)/(u.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var xf=null,vf=null;function fr(e){return e.nodeType===9?e:e.ownerDocument}function ax(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 lx(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 ix(e,t,s,o){return s=fr(s).createElement(e),s[St]=o,s[Vt]=t,Qt(s,e,t),mt(s),s}function yf(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 bf=null;function fj(){var e=window.event;return e&&e.type==="popstate"?e===bf?!1:(bf=e,!0):(bf=null,!1)}var Sf=typeof setTimeout=="function"?setTimeout:void 0,mj=typeof clearTimeout=="function"?clearTimeout:void 0,ox=typeof Promise=="function"?Promise:void 0,rx=typeof requestAnimationFrame=="function"?requestAnimationFrame:Sf,gj=typeof queueMicrotask=="function"?queueMicrotask:typeof ox<"u"?function(e){return ox.resolve(null).then(e).catch(pj)}:Sf;function pj(e){setTimeout(function(){throw e})}function ka(e){return e==="head"}function cx(e,t){var s=t,o=0;do{var u=s.nextSibling;if(e.removeChild(s),u&&u.nodeType===8)if(s=u.data,s==="/$"||s==="/&"){if(o===0){e.removeChild(u),$i(t);return}o--}else if(s==="$"||s==="$?"||s==="$~"||s==="$!"||s==="&")o++;else if(s==="html")Tf(e.ownerDocument.documentElement);else if(s==="head"){s=e.ownerDocument.head,Tf(s);for(var h=s.firstChild;h;){var y=h.nextSibling,w=h.nodeName;h[ha]||w==="SCRIPT"||w==="STYLE"||w==="LINK"&&h.rel.toLowerCase()==="stylesheet"||s.removeChild(h),h=y}}else s==="body"&&Tf(e.ownerDocument.body);s=u}while(s);$i(t)}function ux(e,t){var s=e;e=0;do{var o=s.nextSibling;if(s.nodeType===1?t?(s._stashedDisplay=s.style.display,s.style.display="none"):(s.style.display=s._stashedDisplay||"",s.getAttribute("style")===""&&s.removeAttribute("style")):s.nodeType===3&&(t?(s._stashedText=s.nodeValue,s.nodeValue=""):s.nodeValue=s._stashedText||""),o&&o.nodeType===8)if(s=o.data,s==="/$"){if(e===0)break;e--}else s!=="$"&&s!=="$?"&&s!=="$~"&&s!=="$!"||e++;s=o}while(s)}function dx(e,t,s){if(t=CSS.escape(t)!==t?"r-"+btoa(t).replace(/=/g,""):t,e.style.viewTransitionName=t,s!=null&&(e.style.viewTransitionClass=s),s=getComputedStyle(e),s.display==="inline"){if(t=e.getClientRects(),t.length===1)var o=1;else for(var u=o=0;u<t.length;u++){var h=t[u];0<h.width&&0<h.height&&o++}o===1&&(e=e.style,e.display=t.length===1?"inline-block":"block",e.marginTop="-"+s.paddingTop,e.marginBottom="-"+s.paddingBottom)}}function hx(e,t){e=e.style,t=t.style;var s=t!=null?t.hasOwnProperty("viewTransitionName")?t.viewTransitionName:t.hasOwnProperty("view-transition-name")?t["view-transition-name"]:null:null;e.viewTransitionName=s==null||typeof s=="boolean"?"":(""+s).trim(),s=t!=null?t.hasOwnProperty("viewTransitionClass")?t.viewTransitionClass:t.hasOwnProperty("view-transition-class")?t["view-transition-class"]:null:null,e.viewTransitionClass=s==null||typeof s=="boolean"?"":(""+s).trim(),e.display==="inline-block"&&(t==null?e.display=e.margin="":(s=t.display,e.display=s==null||typeof s=="boolean"?"":s,s=t.margin,s!=null?e.margin=s:(s=t.hasOwnProperty("marginTop")?t.marginTop:t["margin-top"],e.marginTop=s==null||typeof s=="boolean"?"":s,t=t.hasOwnProperty("marginBottom")?t.marginBottom:t["margin-bottom"],e.marginBottom=t==null||typeof t=="boolean"?"":t)))}function xj(e,t,s){return s=s.ownerDocument.defaultView,{rect:e,abs:t.position==="absolute"||t.position==="fixed",clip:t.clipPath!=="none"||t.overflow!=="visible"||t.filter!=="none"||t.mask!=="none"||t.mask!=="none"||t.borderRadius!=="0px",view:0<=e.bottom&&0<=e.right&&e.top<=s.innerHeight&&e.left<=s.innerWidth}}function jf(e){var t=e.getBoundingClientRect(),s=getComputedStyle(e);return xj(t,s,e)}function vj(e){return e.documentElement.clientHeight}function yj(e){this.addEventListener("load",e),this.addEventListener("error",e)}function bj(e,t,s,o,u,h,y,w,L){var I=t.nodeType===9?t:t.ownerDocument;try{var K=I.startViewTransition({update:function(){var F=I.defaultView,Y=F.navigation&&F.navigation.transition,fe=I.fonts.status;o();var ye=[];if(fe==="loaded"&&(vj(I),I.fonts.status==="loading"&&ye.push(I.fonts.ready)),fe=ye.length,e!==null)for(var Ae=e.suspenseyImages,q=0,H=0;H<Ae.length;H++){var Q=Ae[H];if(!Q.complete){var ee=Q.getBoundingClientRect();if(0<ee.bottom&&0<ee.right&&ee.top<F.innerHeight&&ee.left<F.innerWidth){if(q+=zx(Q),q>Su){ye.length=fe;break}Q=new Promise(yj.bind(Q)),ye.push(Q)}}}if(0<ye.length)return F=Promise.race([Promise.all(ye),new Promise(function(xe){return setTimeout(xe,500)})]).then(u,u),(Y?Promise.allSettled([Y.finished,F]):F).then(h,h);if(u(),Y)return Y.finished.then(h,h);h()},types:s});I.__reactViewTransition=K;var ne=[];return K.ready.then(function(){for(var F=I.documentElement.getAnimations({subtree:!0}),Y=0;Y<F.length;Y++){var fe=F[Y],ye=fe.effect,Ae=ye.pseudoElement;if(Ae!=null&&Ae.startsWith("::view-transition")){ne.push(fe),fe=ye.getKeyframes();for(var q=Ae=void 0,H=!0,Q=0;Q<fe.length;Q++){var ee=fe[Q],xe=ee.width;if(Ae===void 0)Ae=xe;else if(Ae!==xe){H=!1;break}if(xe=ee.height,q===void 0)q=xe;else if(q!==xe){H=!1;break}delete ee.width,delete ee.height,ee.transform==="none"&&delete ee.transform}H&&Ae!==void 0&&q!==void 0&&(ye.setKeyframes(fe),H=getComputedStyle(ye.target,ye.pseudoElement),H.width!==Ae||H.height!==q)&&(H=fe[0],H.width=Ae,H.height=q,H=fe[fe.length-1],H.width=Ae,H.height=q,ye.setKeyframes(fe))}}y()},function(F){I.__reactViewTransition===K&&(I.__reactViewTransition=null);try{if(typeof F=="object"&&F!==null)switch(F.name){case"InvalidStateError":(F.message==="View transition was skipped because document visibility state is hidden."||F.message==="Skipping view transition because document visibility state has become hidden."||F.message==="Skipping view transition because viewport size changed."||F.message==="Transition was aborted because of invalid state")&&(F=null)}F!==null&&L(F)}finally{o(),u(),y()}}),K.finished.finally(function(){for(var F=0;F<ne.length;F++)ne[F].cancel();I.__reactViewTransition===K&&(I.__reactViewTransition=null),w()}),K}catch{return o(),u(),y(),null}}function Cl(e,t){this._scope=document.documentElement,this._selector="::view-transition-"+e+"("+t+")"}Cl.prototype.animate=function(e,t){return t=typeof t=="number"?{duration:t}:D({},t),t.pseudoElement=this._selector,this._scope.animate(e,t)},Cl.prototype.getAnimations=function(){for(var e=this._scope,t=this._selector,s=e.getAnimations({subtree:!0}),o=[],u=0;u<s.length;u++){var h=s[u].effect;h!==null&&h.target===e&&h.pseudoElement===t&&o.push(s[u])}return o},Cl.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function fx(e){return{name:e,group:new Cl("group",e),imagePair:new Cl("image-pair",e),old:new Cl("old",e),new:new Cl("new",e)}}function kn(e){this._fragmentFiber=e,this._observers=this._eventListeners=null}kn.prototype.addEventListener=function(e,t,s){var o=null,u=null;if(!(s!=null&&typeof s!="boolean"&&(o=s.signal||null,o!==null&&o.aborted))){this._eventListeners===null&&(this._eventListeners=[]);var h=this._eventListeners;if(gx(h,e,t,s)===-1){var y=this,w=t;s!=null&&typeof s!="boolean"&&s.once===!0&&(w=function(L){y.removeEventListener(e,t,s),typeof t=="function"?t.call(this,L):t.handleEvent(L)}),o!==null&&(u=y.removeEventListener.bind(y,e,t,s),o.addEventListener("abort",u,{once:!0}),u=o.removeEventListener.bind(o,"abort",u)),o=Ai(s),h.push({type:e,listener:t,optionsOrUseCapture:s,attachedListener:w,cleanup:u}),p(this._fragmentFiber.child,!1,Sj,e,w,o)}this._eventListeners=h}};function Sj(e,t,s,o){return R(e).addEventListener(t,s,o),!1}kn.prototype.removeEventListener=function(e,t,s){var o=this._eventListeners;if(o!==null&&(t=gx(o,e,t,s),t!==-1)){var u=o[t];s=u.attachedListener;var h=u.cleanup;u=Ai(u.optionsOrUseCapture),p(this._fragmentFiber.child,!1,jj,e,s,u),o.splice(t,1),h!==null&&h()}};function jj(e,t,s,o){return R(e).removeEventListener(t,s,o),!1}function Ai(e){return e!=null&&typeof e!="boolean"&&(e.once===!0||e.signal instanceof AbortSignal)?{capture:e.capture,passive:e.passive}:e}function mx(e){return e==null?"c=0":typeof e=="boolean"?"c="+(e?"1":"0"):"c="+(e.capture?"1":"0")}function gx(e,t,s,o){if(e.length===0)return-1;o=mx(o);for(var u=0;u<e.length;u++){var h=e[u];if(h.type===t&&h.listener===s&&mx(h.optionsOrUseCapture)===o)return u}return-1}kn.prototype.dispatchEvent=function(e){var t=b(this._fragmentFiber);if(t===null)return!0;t=R(t);var s=this._eventListeners;if(s!==null&&0<s.length||!e.bubbles){var o=t.nodeType===9?t.createComment(""):document.createTextNode("");if(s)for(var u=0;u<s.length;u++){var h=s[u];o.addEventListener(h.type,h.attachedListener,Ai(h.optionsOrUseCapture))}if(t.appendChild(o),e=o.dispatchEvent(e),s)for(u=0;u<s.length;u++)h=s[u],o.removeEventListener(h.type,h.attachedListener,Ai(h.optionsOrUseCapture));return t.removeChild(o),e}return t.dispatchEvent(e)},kn.prototype.focus=function(e){p(this._fragmentFiber.child,!0,px,e,void 0,void 0)};function px(e,t){return e.tag===6?!1:(e=R(e),Dj(e,t))}kn.prototype.focusLast=function(e){var t=[];p(this._fragmentFiber.child,!0,wf,t,void 0,void 0);for(var s=t.length-1;0<=s&&!px(t[s],e);s--);};function wf(e,t){return t.push(e),!1}kn.prototype.blur=function(){var e=b(this._fragmentFiber);e!==null&&(e=R(e),e=fr(e).activeElement,e!==null&&p(this._fragmentFiber.child,!1,wj,e,void 0,void 0))};function wj(e,t){return e.tag===6?!1:(e=R(e),e===t||e.contains(t)?(t.blur(),!0):!1)}kn.prototype.observeUsing=function(e){this._observers===null&&(this._observers=new Set),this._observers.add(e),p(this._fragmentFiber.child,!1,Nj,e,void 0,void 0)};function Nj(e,t){return e.tag===6||(e=R(e),t.observe(e)),!1}kn.prototype.unobserveUsing=function(e){var t=this._observers;if(t!==null&&t.has(e)){t.delete(e),p(this._fragmentFiber.child,!1,Cj,e,void 0,void 0);for(var s=t=0;s<rs.length;s++){var o=rs[s];o.fragmentInstance===this&&o.observer===e?e.unobserve(o.instance):rs[t++]=o}rs.length=t}};function Cj(e,t){return e.tag===6||(e=R(e),t.unobserve(e)),!1}var rs=[],Nf=!1;function Mj(e,t,s){rs.push({fragmentInstance:e,observer:t,instance:s}),Nf||(Nf=!0,kj(function(){Nf=!1;var o=rs;rs=[];for(var u=0;u<o.length;u++){var h=o[u];h.observer.unobserve(h.instance)}}))}kn.prototype.getClientRects=function(){var e=[];return p(this._fragmentFiber.child,!1,Ej,e,void 0,void 0),e};function Ej(e,t){if(e.tag===6){e=e.stateNode;var s=e.ownerDocument.createRange();s.selectNodeContents(e),t.push.apply(t,s.getClientRects())}else e=R(e),t.push.apply(t,e.getClientRects());return!1}kn.prototype.getRootNode=function(e){var t=b(this._fragmentFiber);return t===null?this:R(t).getRootNode(e)},kn.prototype.compareDocumentPosition=function(e){var t=b(this._fragmentFiber);if(t===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var s=[];p(this._fragmentFiber.child,!1,wf,s,void 0,void 0);var o=R(t);if(s.length===0){if(s=o,S(this._fragmentFiber)){e:{for(t=this._fragmentFiber.return;t!==null;){if(t.tag===4){t=t.stateNode.containerInfo;break e}if(t.tag===3||t.tag===5||t.tag===27)break;t=t.return}t=null}t!=null&&(s=t)}t=this._fragmentFiber;var u=o=s.compareDocumentPosition(e);return s===e?u=Node.DOCUMENT_POSITION_CONTAINS:o&Node.DOCUMENT_POSITION_CONTAINED_BY&&(s=j(t)[1],s===null?u=Node.DOCUMENT_POSITION_PRECEDING:(e=R(s).compareDocumentPosition(e),u=e===0||e&Node.DOCUMENT_POSITION_FOLLOWING?Node.DOCUMENT_POSITION_FOLLOWING:Node.DOCUMENT_POSITION_PRECEDING)),u|=Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC}t=R(s[0]),u=R(s[s.length-1]);var h=S(this._fragmentFiber)?t.parentElement:o;if(h==null)return Node.DOCUMENT_POSITION_DISCONNECTED;o=h.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY,h=h.compareDocumentPosition(u)&Node.DOCUMENT_POSITION_CONTAINED_BY;var y=t.compareDocumentPosition(e),w=u.compareDocumentPosition(e),L=y&Node.DOCUMENT_POSITION_CONTAINED_BY||w&Node.DOCUMENT_POSITION_CONTAINED_BY;return w=o&&h&&y&Node.DOCUMENT_POSITION_FOLLOWING&&w&Node.DOCUMENT_POSITION_PRECEDING,t=o&&t===e||h&&u===e||L||w?Node.DOCUMENT_POSITION_CONTAINED_BY:!o&&t===e||!h&&u===e?Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:y,t&Node.DOCUMENT_POSITION_DISCONNECTED||t&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC||Rj(t,this._fragmentFiber,s[0],s[s.length-1],e)?t:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function Rj(e,t,s,o,u){var h=jt(u);if(e&Node.DOCUMENT_POSITION_CONTAINED_BY){if(s=!!h)e:{for(;h!==null;){if(h.tag===7&&(h===t||h.alternate===t)){s=!0;break e}h=h.return}s=!1}return s}if(e&Node.DOCUMENT_POSITION_CONTAINS){if(h===null)return h=u.ownerDocument,u===h||u===h.documentElement||u===h.body;e:{for(h=t,t=b(t);h!==null;){if(!(h.tag!==5&&h.tag!==3&&h.tag!==27||h!==t&&h.alternate!==t)){h=!0;break e}h=h.return}h=!1}return h}return e&Node.DOCUMENT_POSITION_PRECEDING?((t=!!h)&&!(t=h===s)&&(t=_(s,h,E),t===null?t=!1:(p(t,!0,O,h,s),h=A,A=null,t=h!==null)),t):e&Node.DOCUMENT_POSITION_FOLLOWING?((t=!!h)&&!(t=h===o)&&(t=_(o,h,E),t===null?t=!1:(p(t,!0,M,h,o),h=A,T=A=null,t=h!==null)),t):!1}function xx(e,t){var s=e.ownerDocument.createRange();s.selectNodeContents(e),e=s.getBoundingClientRect(),window.scrollTo(window.scrollX+e.left,t?window.scrollY+e.top:window.scrollY+e.bottom-window.innerHeight)}kn.prototype.scrollIntoView=function(e){if(typeof e=="object")throw Error(i(566));var t=[];p(this._fragmentFiber.child,!1,wf,t,void 0,void 0);var s=e!==!1;if(t.length===0){var o=j(this._fragmentFiber);if(o=s?o[1]||o[0]||b(this._fragmentFiber):o[0]||o[1],o===null)return;if(o.tag===6){e=R(o),xx(e,s);return}if(o=R(o),o.nodeType!==9){if(o.nodeType===11){s="host"in o?o.host:null,s!==null&&s.scrollIntoView(e);return}o.scrollIntoView(e)}}for(o=s?t.length-1:0;o!==(s?-1:t.length);){var u=t[o];u.tag===6?(u=R(u),xx(u,s)):R(u).scrollIntoView(e),o+=s?-1:1}};function Tj(e,t){return e=R(e),vx(e,t),!1}function vx(e,t){e.reactFragments==null&&(e.reactFragments=new Set),e.reactFragments.add(t)}function yx(e,t){var s=t._eventListeners;if(s!==null)for(var o=0;o<s.length;o++){var u=s[o];e.addEventListener(u.type,u.attachedListener,Ai(u.optionsOrUseCapture))}e.nodeType!==3&&(s=t._observers,s!==null&&s.forEach(function(h){for(var y=0,w=0;w<rs.length;w++){var L=rs[w];(L.fragmentInstance!==t||L.observer!==h||L.instance!==e)&&(rs[y++]=L)}rs.length=y,h.observe(e)}),vx(e,t))}function _j(e,t){var s=t._eventListeners;if(s!==null)for(var o=0;o<s.length;o++){var u=s[o];e.removeEventListener(u.type,u.attachedListener,Ai(u.optionsOrUseCapture))}e.nodeType!==3&&(s=t._observers,s!==null&&s.forEach(function(h){typeof h.rootMargin=="string"?Mj(t,h,e):h.unobserve(e)}),e.reactFragments!=null&&e.reactFragments.delete(t))}function Cf(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var s=t;switch(t=t.nextSibling,s.nodeName){case"HTML":case"HEAD":case"BODY":Cf(s),Ye(s);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(s.rel.toLowerCase()==="stylesheet")continue}e.removeChild(s)}}function Aj(e,t,s,o){for(;e.nodeType===1;){var u=s;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!o&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(o){if(!e[ha])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(h=e.getAttribute("rel"),h==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(h!==u.rel||e.getAttribute("href")!==(u.href==null||u.href===""?null:u.href)||e.getAttribute("crossorigin")!==(u.crossOrigin==null?null:u.crossOrigin)||e.getAttribute("title")!==(u.title==null?null:u.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(h=e.getAttribute("src"),(h!==(u.src==null?null:u.src)||e.getAttribute("type")!==(u.type==null?null:u.type)||e.getAttribute("crossorigin")!==(u.crossOrigin==null?null:u.crossOrigin))&&h&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var h=u.name==null?null:""+u.name;if(u.type==="hidden"&&e.getAttribute("name")===h)return e}else return e;if(e=Kn(e.nextSibling),e===null)break}return null}function Oj(e,t,s){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!s||(e=Kn(e.nextSibling),e===null))return null;return e}function bx(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=Kn(e.nextSibling),e===null))return null;return e}function Mf(e){return e.data==="$?"||e.data==="$~"}function Ef(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function zj(e,t){var s=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||s.readyState!=="loading")t();else{var o=function(){t(),s.removeEventListener("DOMContentLoaded",o)};s.addEventListener("DOMContentLoaded",o),e._reactRetry=o}}function Kn(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==="$~"||t==="&"||t==="F!"||t==="F")break;if(t==="/$"||t==="/&")return null}}return e}var Rf=null;function Sx(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var s=e.data;if(s==="/$"||s==="/&"){if(t===0)return Kn(e.nextSibling);t--}else s!=="$"&&s!=="$!"&&s!=="$?"&&s!=="$~"&&s!=="&"||t++}e=e.nextSibling}return null}function jx(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var s=e.data;if(s==="$"||s==="$!"||s==="$?"||s==="$~"||s==="&"){if(t===0)return e;t--}else s!=="/$"&&s!=="/&"||t++}e=e.previousSibling}return null}function Dj(e,t){function s(){o=!0}if(e.ownerDocument.activeElement===e)return!0;var o=!1;try{e.ownerDocument.addEventListener("focus",s,!0),(e.focus||HTMLElement.prototype.focus).call(e,t)}finally{e.ownerDocument.removeEventListener("focus",s,!0)}return o}function kj(e){rx(function(){rx(function(t){return e(t)})})}function wx(e,t,s){switch(t=fr(s),e){case"html":if(e=t.documentElement,!e)throw Error(i(452));return e;case"head":if(e=t.head,!e)throw Error(i(453));return e;case"body":if(e=t.body,!e)throw Error(i(454));return e;default:throw Error(i(451))}}function Nx(e,t,s){for(var o in s){var u=s[o];s.hasOwnProperty(o)&&u!=null&&We(e,t,o,null,uj,u)}s.dangerouslySetInnerHTML!=null&&(e.textContent=""),e.onclick===vs&&(e.onclick=null),Ye(e)}function Tf(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Ye(e)}var Zn=new Map,Cx=new Set;function mr(e){if(typeof e.getRootNode=="function"){var t=e.getRootNode();if(t.nodeType===9||t.nodeType===11)return t}return e.nodeType===9?e:e.ownerDocument}var Js=ve.d;ve.d={f:Lj,r:$j,D:Hj,C:Uj,L:Bj,m:Fj,X:Gj,S:Vj,M:qj};function Lj(){var e=Js.f(),t=hu();return e||t}function $j(e){var t=ps(e);t!==null&&t.tag===5&&t.type==="form"?Ep(t):Js.r(e)}var Oi=typeof document>"u"?null:document;function Mx(e,t,s){var o=Oi;if(o&&typeof t=="string"&&t){var u=Gn(t);u='link[rel="'+e+'"][href="'+u+'"]',typeof s=="string"&&(u+='[crossorigin="'+s+'"]'),Cx.has(u)||(Cx.add(u),e={rel:e,crossOrigin:s,href:t},o.querySelector(u)===null&&(t=o.createElement("link"),Qt(t,"link",e),mt(t),o.head.appendChild(t)))}}function Hj(e){Js.D(e),Mx("dns-prefetch",e,null)}function Uj(e,t){Js.C(e,t),Mx("preconnect",e,t)}function Bj(e,t,s){Js.L(e,t,s);var o=Oi;if(o&&e&&t){var u='link[rel="preload"][as="'+Gn(t)+'"]';t==="image"&&s&&s.imageSrcSet?(u+='[imagesrcset="'+Gn(s.imageSrcSet)+'"]',typeof s.imageSizes=="string"&&(u+='[imagesizes="'+Gn(s.imageSizes)+'"]')):u+='[href="'+Gn(e)+'"]';var h=u;switch(t){case"style":h=zi(e);break;case"script":h=Di(e)}if(!(Zn.has(h)||(e=D({rel:"preload",href:t==="image"&&s&&s.imageSrcSet?void 0:e,as:t},s),Zn.set(h,e),o.querySelector(u)!==null||t==="style"&&o.querySelector(gr(h))||t==="script"&&o.querySelector(pr(h))))){var y=o.createElement("link");Qt(y,"link",e),t==="style"&&(y[ue]=!0,y.onload=y.onerror=function(){ns(y)}),mt(y),o.head.appendChild(y)}}}function Fj(e,t){Js.m(e,t);var s=Oi;if(s&&e){var o=t&&typeof t.as=="string"?t.as:"script",u='link[rel="modulepreload"][as="'+Gn(o)+'"][href="'+Gn(e)+'"]',h=u;switch(o){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":h=Di(e)}if(!Zn.has(h)&&(e=D({rel:"modulepreload",href:e},t),Zn.set(h,e),s.querySelector(u)===null)){switch(o){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(s.querySelector(pr(h)))return}o=s.createElement("link"),Qt(o,"link",e),mt(o),s.head.appendChild(o)}}}function Vj(e,t,s){Js.S(e,t,s);var o=Oi;if(o&&e){var u=fa(o).hoistableStyles,h=zi(e);t=t||"default";var y=u.get(h);if(!y){var w={loading:0,preload:null};if(y=o.querySelector(gr(h)))w.loading=5;else{e=D({rel:"stylesheet",href:e,"data-precedence":t},s),(s=Zn.get(h))&&_f(e,s);var L=y=o.createElement("link");mt(L),Qt(L,"link",e),L._p=new Promise(function(I,K){L.onload=I,L.onerror=K}),L.addEventListener("load",function(){w.loading|=1}),L.addEventListener("error",function(){w.loading|=2}),w.loading|=4,yu(y,t,o)}y={type:"stylesheet",instance:y,count:1,state:w},u.set(h,y)}}}function Gj(e,t){Js.X(e,t);var s=Oi;if(s&&e){var o=fa(s).hoistableScripts,u=Di(e),h=o.get(u);h||(h=s.querySelector(pr(u)),h||(e=D({src:e,async:!0},t),(t=Zn.get(u))&&Af(e,t),h=s.createElement("script"),mt(h),Qt(h,"link",e),s.head.appendChild(h)),h={type:"script",instance:h,count:1,state:null},o.set(u,h))}}function qj(e,t){Js.M(e,t);var s=Oi;if(s&&e){var o=fa(s).hoistableScripts,u=Di(e),h=o.get(u);h||(h=s.querySelector(pr(u)),h||(e=D({src:e,async:!0,type:"module"},t),(t=Zn.get(u))&&Af(e,t),h=s.createElement("script"),mt(h),Qt(h,"link",e),s.head.appendChild(h)),h={type:"script",instance:h,count:1,state:null},o.set(u,h))}}function Ex(e,t,s,o){var u=(u=Jt.current)?mr(u):null;if(!u)throw Error(i(446));switch(e){case"meta":case"title":return null;case"style":return typeof s.precedence=="string"&&typeof s.href=="string"?(s=zi(s.href),t=fa(u).hoistableStyles,o=t.get(s),o||(o={type:"style",instance:null,count:0,state:null},t.set(s,o)),o):{type:"void",instance:null,count:0,state:null};case"link":if(s.rel==="stylesheet"&&typeof s.href=="string"&&typeof s.precedence=="string"){e=zi(s.href);var h=fa(u).hoistableStyles,y=h.get(e);if(y||(u=u.ownerDocument||u,y={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},h.set(e,y),(h=u.querySelector(gr(e)))?h._p||(y.instance=h,y.state.loading=5):(h=Zn.get(e),h||(h={rel:"preload",as:"style",href:s.href,crossOrigin:s.crossOrigin,integrity:s.integrity,media:s.media,hrefLang:s.hrefLang,referrerPolicy:s.referrerPolicy},Zn.set(e,h)),Ij(u,e,h,y.state))),t&&o===null)throw Error(i(528,""));return y}if(t&&o!==null)throw Error(i(529,""));return null;case"script":return t=s.async,s=s.src,typeof s=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(s=Di(s),t=fa(u).hoistableScripts,o=t.get(s),o||(o={type:"script",instance:null,count:0,state:null},t.set(s,o)),o):{type:"void",instance:null,count:0,state:null};default:throw Error(i(444,e))}}function zi(e){return'href="'+Gn(e)+'"'}function gr(e){return'link[rel="stylesheet"]['+e+"]"}function Rx(e){return D({},e,{"data-precedence":e.precedence,precedence:null})}function Ij(e,t,s,o){if(t=e.querySelector('link[rel="preload"][as="style"]['+t+"]")){if(t[ue]!==!0){o.loading=1;return}}else t=e.createElement("link"),t[ue]=!0,t.onload=t.onerror=ns.bind(null,t),Qt(t,"link",s),mt(t),e.head.appendChild(t);o.preload=t,t.addEventListener("load",function(){return o.loading|=1}),t.addEventListener("error",function(){return o.loading|=2})}function Di(e){return'[src="'+Gn(e)+'"]'}function pr(e){return"script[async]"+e}function Tx(e,t,s){if(t.count++,t.instance===null)switch(t.type){case"style":var o=e.querySelector('style[data-href~="'+Gn(s.href)+'"]');if(o)return t.instance=o,mt(o),o;var u=D({},s,{"data-href":s.href,"data-precedence":s.precedence,href:null,precedence:null});return o=(e.ownerDocument||e).createElement("style"),mt(o),Qt(o,"style",u),yu(o,s.precedence,e),t.instance=o;case"stylesheet":u=zi(s.href);var h=e.querySelector(gr(u));if(h)return t.state.loading|=4,t.instance=h,mt(h),h;o=Rx(s),(u=Zn.get(u))&&_f(o,u),h=(e.ownerDocument||e).createElement("link"),mt(h);var y=h;return y._p=new Promise(function(w,L){y.onload=w,y.onerror=L}),Qt(h,"link",o),t.state.loading|=4,yu(h,s.precedence,e),t.instance=h;case"script":return h=Di(s.src),(u=e.querySelector(pr(h)))?(t.instance=u,mt(u),u):(o=s,(u=Zn.get(h))&&(o=D({},s),Af(o,u)),e=e.ownerDocument||e,u=e.createElement("script"),mt(u),Qt(u,"link",o),e.head.appendChild(u),t.instance=u);case"void":return null;default:throw Error(i(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(o=t.instance,t.state.loading|=4,yu(o,s.precedence,e));return t.instance}function yu(e,t,s){for(var o=s.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),u=o.length?o[o.length-1]:null,h=u,y=0;y<o.length;y++){var w=o[y];if(w.dataset.precedence===t)h=w;else if(h!==u)break}h?h.parentNode.insertBefore(e,h.nextSibling):(t=s.nodeType===9?s.head:s,t.insertBefore(e,t.firstChild))}function _f(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function Af(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var bu=null;function _x(e,t,s){if(bu===null){var o=new Map,u=bu=new Map;u.set(s,o)}else u=bu,o=u.get(s),o||(o=new Map,u.set(s,o));if(o.has(e))return o;for(o.set(e,null),s=s.getElementsByTagName(e),u=0;u<s.length;u++){var h=s[u];if(!(h[ha]||h[St]||e==="link"&&h.getAttribute("rel")==="stylesheet")&&h.namespaceURI!=="http://www.w3.org/2000/svg"){var y=h.getAttribute(t)||"";y=e+y;var w=o.get(y);w?w.push(h):o.set(y,[h])}}return o}function Of(e,t,s){e=e.ownerDocument||e,e.head.insertBefore(s,t==="title"?e.querySelector("head > title"):null)}function Pj(e,t,s){if(s===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 Ax(e,t){return e==="img"&&t.src!=null&&t.src!==""&&t.onLoad==null&&t.loading!=="lazy"}function Ox(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function zx(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio=="number"?devicePixelRatio:1)*.25}function Dx(e,t){typeof t.decode=="function"&&(e.imgCount++,t.complete||(e.imgBytes+=zx(t),e.suspenseyImages.push(t)),e=Xj.bind(e),t.decode().then(e,e))}function Qj(e,t,s,o){if(s.type==="stylesheet"&&(typeof o.media!="string"||matchMedia(o.media).matches!==!1)&&(s.state.loading&4)===0){if(s.instance===null){var u=zi(o.href),h=t.querySelector(gr(u));if(h){t=h._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=xr.bind(e),t.then(e,e)),s.state.loading|=4,s.instance=h,mt(h);return}h=t.ownerDocument||t,o=Rx(o),(u=Zn.get(u))&&_f(o,u),h=h.createElement("link"),mt(h);var y=h;y._p=new Promise(function(w,L){y.onload=w,y.onerror=L}),Qt(h,"link",o),s.instance=h}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(s,t),(t=s.state.preload)&&(s.state.loading&3)===0&&(e.count++,s=xr.bind(e),t.addEventListener("load",s),t.addEventListener("error",s))}}var Su=0;function Yj(e,t){return e.stylesheets&&e.count===0&&wu(e,e.stylesheets),0<e.count||0<e.imgCount?function(s){var o=setTimeout(function(){if(e.stylesheets&&wu(e,e.stylesheets),e.unsuspend){var h=e.unsuspend;e.unsuspend=null,h()}},6e4+t);0<e.imgBytes&&Su===0&&(Su=62500*hj());var u=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&wu(e,e.stylesheets),e.unsuspend)){var h=e.unsuspend;e.unsuspend=null,h()}},(e.imgBytes>Su?50:800)+t);return e.unsuspend=s,function(){e.unsuspend=null,clearTimeout(o),clearTimeout(u)}}:null}function kx(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)wu(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}}function xr(){this.count--,kx(this)}function Xj(){this.imgCount--,kx(this)}var ju=null;function wu(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,ju=new Map,t.forEach(Kj,e),ju=null,xr.call(e))}function Kj(e,t){if(!(t.state.loading&4)){var s=ju.get(e);if(s)var o=s.get(null);else{s=new Map,ju.set(e,s);for(var u=e.querySelectorAll("link[data-precedence],style[data-precedence]"),h=0;h<u.length;h++){var y=u[h];(y.nodeName==="LINK"||y.getAttribute("media")!=="not all")&&(s.set(y.dataset.precedence,y),o=y)}o&&s.set(null,o)}u=t.instance,y=u.getAttribute("data-precedence"),h=s.get(y)||o,h===o&&s.set(null,u),s.set(y,u),this.count++,o=xr.bind(this),u.addEventListener("load",o),u.addEventListener("error",o),h?h.parentNode.insertBefore(u,h.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(u,e.firstChild)),t.state.loading|=4}}var ki={$$typeof:re,Provider:null,Consumer:null,_currentValue:ut,_currentValue2:ut,_threadCount:0};function Zj(e,t,s,o,u,h,y,w,L){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=Kl(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Kl(0),this.hiddenUpdates=Kl(null),this.identifierPrefix=o,this.onUncaughtError=u,this.onCaughtError=h,this.onRecoverableError=y,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=L,this.transitionTypes=null,this.incompleteTransitions=new Map}function Lx(e,t,s,o,u,h,y,w,L,I,K,ne){return e=new Zj(e,t,s,y,L,I,K,ne,w),t=1,h===!0&&(t|=24),h=pn(3,null,null,t),e.current=h,h.stateNode=e,t=Pd(),t.refCount++,e.pooledCache=t,t.refCount++,h.memoizedState={element:o,isDehydrated:s,cache:t},Kd(h),e}function $x(e){return e?(e=oi,e):oi}function Hx(e,t,s,o,u,h){u=$x(u),o.context===null?o.context=u:o.pendingContext=u,o=wa(t),o.payload={element:s},h=h===void 0?null:h,h!==null&&(o.callback=h),s=Na(e,o,t),s!==null&&(bn(s,e,t),Yo(s,e,t))}function Ux(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var s=e.retryLane;e.retryLane=s!==0&&s<t?s:t}}function zf(e,t){Ux(e,t),(e=e.alternate)&&Ux(e,t)}function Bx(e){if(e.tag===13||e.tag===31){var t=rl(e,67108864);t!==null&&bn(t,e,67108864),zf(e,67108864)}}function Fx(e){if(e.tag===13||e.tag===31){var t=Dn();t=Zl(t);var s=rl(e,t);s!==null&&bn(s,e,t),zf(e,t)}}var Li=!0;function Jj(e,t,s,o){var u=ge.T;ge.T=null;var h=ve.p;try{ve.p=2,Df(e,t,s,o)}finally{ve.p=h,ge.T=u}}function Wj(e,t,s,o){var u=ge.T;ge.T=null;var h=ve.p;try{ve.p=8,Df(e,t,s,o)}finally{ve.p=h,ge.T=u}}function Df(e,t,s,o){if(Li){var u=kf(o);if(u===null)gf(e,t,o,Nu,s),Gx(e,o);else if(tw(u,e,t,s,o))o.stopPropagation();else if(Gx(e,o),t&4&&-1<ew.indexOf(e)){for(;u!==null;){var h=ps(u);if(h!==null)switch(h.tag){case 3:if(h=h.stateNode,h.current.memoizedState.isDehydrated){var y=gs(h.pendingLanes);if(y!==0){var w=h;for(w.pendingLanes|=2,w.entangledLanes|=2;y;){var L=1<<31-ln(y);w.entanglements[1]|=L,y&=~L}Rs(h),(Pe&6)===0&&(cu=tt()+500,ur(0))}}break;case 31:case 13:w=rl(h,2),w!==null&&bn(w,h,2),hu(),zf(h,2)}if(h=kf(o),h===null&&gf(e,t,o,Nu,s),h===u)break;u=h}u!==null&&o.stopPropagation()}else gf(e,t,o,null,s)}}function kf(e){return e=yd(e),Lf(e)}var Nu=null;function Lf(e){if(Nu=null,e=jt(e),e!==null){var t=d(e);if(t===null)e=null;else{var s=t.tag;if(s===13){if(e=f(t),e!==null)return e;e=null}else if(s===31){if(e=m(t),e!==null)return e;e=null}else if(s===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Nu=e,null}function Vx(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"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"fullscreenerror":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"resize":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(Dt()){case Cn:return 2;case sl:return 8;case Mn:case fd:return 32;case ra:return 268435456;default:return 32}default:return 32}}var $f=!1,La=null,$a=null,Ha=null,vr=new Map,yr=new Map,Ua=[],ew="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 Gx(e,t){switch(e){case"focusin":case"focusout":La=null;break;case"dragenter":case"dragleave":$a=null;break;case"mouseover":case"mouseout":Ha=null;break;case"pointerover":case"pointerout":vr.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":yr.delete(t.pointerId)}}function br(e,t,s,o,u,h){return e===null||e.nativeEvent!==h?(e={blockedOn:t,domEventName:s,eventSystemFlags:o,nativeEvent:h,targetContainers:[u]},t!==null&&(t=ps(t),t!==null&&Bx(t)),e):(e.eventSystemFlags|=o,t=e.targetContainers,u!==null&&t.indexOf(u)===-1&&t.push(u),e)}function tw(e,t,s,o,u){switch(t){case"focusin":return La=br(La,e,t,s,o,u),!0;case"dragenter":return $a=br($a,e,t,s,o,u),!0;case"mouseover":return Ha=br(Ha,e,t,s,o,u),!0;case"pointerover":var h=u.pointerId;return vr.set(h,br(vr.get(h)||null,e,t,s,o,u)),!0;case"gotpointercapture":return h=u.pointerId,yr.set(h,br(yr.get(h)||null,e,t,s,o,u)),!0}return!1}function qx(e){var t=jt(e.target);if(t!==null){var s=d(t);if(s!==null){if(t=s.tag,t===13){if(t=f(s),t!==null){e.blockedOn=t,Eo(e.priority,function(){Fx(s)});return}}else if(t===31){if(t=m(s),t!==null){e.blockedOn=t,Eo(e.priority,function(){Fx(s)});return}}else if(t===3&&s.stateNode.current.memoizedState.isDehydrated){e.blockedOn=s.tag===3?s.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Cu(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var s=kf(e.nativeEvent);if(s===null){s=e.nativeEvent;var o=new s.constructor(s.type,s);vd=o,s.target.dispatchEvent(o),vd=null}else return t=ps(s),t!==null&&Bx(t),e.blockedOn=s,!1;t.shift()}return!0}function Ix(e,t,s){Cu(e)&&s.delete(t)}function nw(){$f=!1,La!==null&&Cu(La)&&(La=null),$a!==null&&Cu($a)&&($a=null),Ha!==null&&Cu(Ha)&&(Ha=null),vr.forEach(Ix),yr.forEach(Ix)}function Mu(e,t){e.blockedOn===t&&(e.blockedOn=null,$f||($f=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,nw)))}var Eu=null;function Px(e){Eu!==e&&(Eu=e,n.unstable_scheduleCallback(n.unstable_NormalPriority,function(){Eu===e&&(Eu=null);for(var t=0;t<e.length;t+=3){var s=e[t],o=e[t+1],u=e[t+2];if(typeof o!="function"){if(Lf(o||s)===null)continue;break}var h=ps(s);h!==null&&(e.splice(t,3),t-=3,xh(h,{pending:!0,data:u,method:s.method,action:o},o,u))}}))}function $i(e){function t(L){return Mu(L,e)}La!==null&&Mu(La,e),$a!==null&&Mu($a,e),Ha!==null&&Mu(Ha,e),vr.forEach(t),yr.forEach(t);for(var s=0;s<Ua.length;s++){var o=Ua[s];o.blockedOn===e&&(o.blockedOn=null)}for(;0<Ua.length&&(s=Ua[0],s.blockedOn===null);)qx(s),s.blockedOn===null&&Ua.shift();if(s=(e.ownerDocument||e).$$reactFormReplay,s!=null)for(o=0;o<s.length;o+=3){var u=s[o],h=s[o+1],y=u[Vt]||null;if(typeof h=="function")y||Px(s);else if(y){var w=null;if(h&&h.hasAttribute("formAction")){if(u=h,y=h[Vt]||null)w=y.formAction;else if(Lf(u)!==null)continue}else w=y.action;typeof w=="function"?s[o+1]=w:(s.splice(o,3),o-=3),Px(s)}}}function Qx(){function e(h){h.canIntercept&&h.info==="react-transition"&&h.intercept({handler:function(){return new Promise(function(y){return u=y})},focusReset:"manual",scroll:"manual"})}function t(){u!==null&&(u(),u=null),o||setTimeout(s,20)}function s(){if(!o&&!navigation.transition){var h=navigation.currentEntry;h&&h.url!=null&&navigation.navigate(h.url,{state:h.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var o=!1,u=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(s,100),function(){o=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),u!==null&&(u(),u=null)}}}function Hf(e){this._internalRoot=e}Ru.prototype.render=Hf.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var s=t.current,o=Dn();Hx(s,o,e,t,null,null)},Ru.prototype.unmount=Hf.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Hx(e.current,2,null,e,null,null),hu(),t[Hs]=null}};function Ru(e){this._internalRoot=e}Ru.prototype.unstable_scheduleHydration=function(e){if(e){var t=Mo();e={blockedOn:null,target:e,priority:t};for(var s=0;s<Ua.length&&t!==0&&t<Ua[s].priority;s++);Ua.splice(s,0,e),s===0&&qx(e)}};var Yx=a.version;if(Yx!=="19.3.1")throw Error(i(527,Yx,"19.3.1"));ve.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(i(188)):(e=Object.keys(e).join(","),Error(i(268,e)));return e=v(t),e=e!==null?x(e):null,e=e===null?null:e.stateNode,e};var sw={bundleType:0,version:"19.3.1",rendererPackageName:"react-dom",currentDispatcherRef:ge,reconcilerVersion:"19.3.1"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Tu=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Tu.isDisabled&&Tu.supportsFiber)try{En=Tu.inject(sw),Ft=Tu}catch{}}return jr.createRoot=function(e,t){if(!c(e))throw Error(i(299));var s=!1,o="",u=$p,h=Hp,y=Up;return t!=null&&(t.unstable_strictMode===!0&&(s=!0),t.identifierPrefix!==void 0&&(o=t.identifierPrefix),t.onUncaughtError!==void 0&&(u=t.onUncaughtError),t.onCaughtError!==void 0&&(h=t.onCaughtError),t.onRecoverableError!==void 0&&(y=t.onRecoverableError)),t=Lx(e,1,!1,null,null,s,o,null,u,h,y,Qx),e[Hs]=t.current,mf(e),new Hf(t)},jr.hydrateRoot=function(e,t,s){if(!c(e))throw Error(i(299));var o=!1,u="",h=$p,y=Hp,w=Up,L=null;return s!=null&&(s.unstable_strictMode===!0&&(o=!0),s.identifierPrefix!==void 0&&(u=s.identifierPrefix),s.onUncaughtError!==void 0&&(h=s.onUncaughtError),s.onCaughtError!==void 0&&(y=s.onCaughtError),s.onRecoverableError!==void 0&&(w=s.onRecoverableError),s.formState!==void 0&&(L=s.formState)),t=Lx(e,1,!0,t,s??null,o,u,L,h,y,w,Qx),t.context=$x(null),s=t.current,o=Dn(),o=Zl(o),u=wa(o),u.callback=null,Na(s,u,o),s=o,t.current.lanes=s,da(t,s),Rs(t),e[Hs]=t.current,mf(e),new Ru(t)},jr.version="19.3.1",jr}var lv;function pw(){if(lv)return Vf.exports;lv=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(a){console.error(a)}}return n(),Vf.exports=gw(),Vf.exports}var xw=pw();const L2=C.createContext(void 0),$2=n=>{const a=C.useContext(L2);if(!a)throw new Error("No QueryClient set, use QueryClientProvider to set one");return a},vw=({client:n,children:a})=>(C.useEffect(()=>(n.mount(),()=>{n.unmount()}),[n]),r.jsx(L2.Provider,{value:n,children:a})),yw={setTimeout:(n,a)=>setTimeout(n,a),clearTimeout:n=>clearTimeout(n),setInterval:(n,a)=>setInterval(n,a),clearInterval:n=>clearInterval(n)};var Pa,jg,C2,bw=(C2=class{constructor(){Ne(this,Pa,yw);Ne(this,jg,!1)}setTimeoutProvider(n){pe(this,Pa,n)}setTimeout(n,a){return B(this,Pa).setTimeout(n,a)}clearTimeout(n){B(this,Pa).clearTimeout(n)}setInterval(n,a){return B(this,Pa).setInterval(n,a)}clearInterval(n){B(this,Pa).clearInterval(n)}},Pa=new WeakMap,jg=new WeakMap,C2);const Ol=new bw;function Sw(n){setTimeout(n,0)}const jw=typeof window>"u"||"Deno"in globalThis;function wn(){}function ww(n,a){return typeof n=="function"?n(a):n}function H2(n){return typeof n=="number"&&n>=0&&n!==1/0}function U2(n,a){return Math.max(n+(a||0)-Date.now(),0)}function ct(n,a){return typeof n=="function"?n(a):n}function iv(n,a){const{type:l="all",exact:i,fetchStatus:c,predicate:d,queryKey:f,stale:m}=n;if(f){if(i){if(a.queryHash!==Ng(f,a.options))return!1}else if(!xo(a.queryKey,f))return!1}if(l!=="all"){const g=a.isActive();if(l==="active"&&!g||l==="inactive"&&g)return!1}return!(typeof m=="boolean"&&a.isStale()!==m||c&&c!==a.state.fetchStatus||d&&!d(a))}function ov(n,a){const{exact:l,status:i,predicate:c,mutationKey:d}=n;if(d){if(!a.options.mutationKey)return!1;if(l){if(Br(a.options.mutationKey)!==Br(d))return!1}else if(!xo(a.options.mutationKey,d))return!1}return!(i&&a.state.status!==i||c&&!c(a))}function Ng(n,a){return((a==null?void 0:a.queryKeyHashFn)||Br)(n)}function Br(n){return JSON.stringify(n,(a,l)=>$m(l)?Object.keys(l).sort().reduce((i,c)=>(i[c]=l[c],i),{}):l)}function xo(n,a){if(n===a)return!0;if(typeof n!=typeof a)return!1;if(n&&a&&typeof n=="object"&&typeof a=="object"){if(Array.isArray(n)&&Array.isArray(a)){if(a.length>n.length)return!1;for(let i=0;i<a.length;i++)if(!xo(n[i],a[i]))return!1;return!0}const l=Object.keys(a);for(const i of l)if(!xo(n[i],a[i]))return!1;return!0}return!1}const Nw=Object.prototype.hasOwnProperty;function B2(n,a,l=0){if(n===a)return n;if(l>500)return a;const i=rv(n)&&rv(a);if(!i&&!($m(n)&&$m(a)))return a;const c=(i?n:Object.keys(n)).length,d=i?a:Object.keys(a),f=d.length,m=i?new Array(f):{};let g=0;for(let v=0;v<f;v++){const x=i?v:d[v],p=n[x],b=a[x];if(p===b){m[x]=p,(i?v<c:Nw.call(n,x))&&g++;continue}if(p===null||b===null||typeof p!="object"||typeof b!="object"){m[x]=b;continue}const S=B2(p,b,l+1);m[x]=S,S===p&&g++}return c===f&&g===c?n:m}function Pf(n,a){if(!a||Object.keys(n).length!==Object.keys(a).length)return!1;for(const l in n)if(n[l]!==a[l])return!1;return!0}function rv(n){return Array.isArray(n)&&n.length===Object.keys(n).length}function $m(n){if(!cv(n))return!1;const a=Object.getPrototypeOf(n),l=a==null?void 0:a.constructor;if(l===void 0)return!0;if(typeof l!="function")return!1;const i=l.prototype;return!(!cv(i)||!i.hasOwnProperty("isPrototypeOf")||a!==Object.prototype)}function cv(n){return Object.prototype.toString.call(n)==="[object Object]"}function Cw(n){return new Promise(a=>{Ol.setTimeout(a,n)})}function Hm(n,a,l){return typeof l.structuralSharing=="function"?l.structuralSharing(n,a):l.structuralSharing!==!1?B2(n,a):a}function ed(n){return n}function Mw(n,a,l=0){const i=[...n,a];return l&&i.length>l?i.slice(1):i}function Ew(n,a,l=0){const i=[a,...n];return l&&i.length>l?i.slice(0,-1):i}const Cg=Symbol();function F2(n,a){return!n.queryFn&&(a!=null&&a.initialPromise)?()=>a.initialPromise:!n.queryFn||n.queryFn===Cg?()=>Promise.reject(new Error(`Missing queryFn: '${n.queryHash}'`)):n.queryFn}function V2(n,a){return typeof n=="function"?n(...a):!!n}function Rw(n,a,l){let i=!1,c;return Object.defineProperty(n,"signal",{enumerable:!0,get:()=>(c??(c=a()),i||(i=!0,c.aborted?l():c.addEventListener("abort",l,{once:!0})),c)}),n}let Tw=()=>jw;const Mg=()=>Tw();var Zr=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(n){return this.listeners.add(n),this.onSubscribe(),()=>{this.listeners.delete(n),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Dl,Qa,so,M2,_w=(M2=class extends Zr{constructor(){super();Ne(this,Dl);Ne(this,Qa);Ne(this,so);pe(this,so,a=>{if(typeof window<"u"&&window.addEventListener){const l=()=>a();return window.addEventListener("visibilitychange",l,!1),()=>{window.removeEventListener("visibilitychange",l)}}})}onSubscribe(){B(this,Qa)||this.setEventListener(B(this,so))}onUnsubscribe(){var a;this.hasListeners()||((a=B(this,Qa))==null||a.call(this),pe(this,Qa,void 0))}setEventListener(a){var l;pe(this,so,a),(l=B(this,Qa))==null||l.call(this),pe(this,Qa,a(i=>{typeof i=="boolean"?this.setFocused(i):this.onFocus()}))}setFocused(a){B(this,Dl)!==a&&(pe(this,Dl,a),this.onFocus())}onFocus(){const a=this.isFocused();this.listeners.forEach(l=>{l(a)})}isFocused(){var a;return typeof B(this,Dl)=="boolean"?B(this,Dl):((a=globalThis.document)==null?void 0:a.visibilityState)!=="hidden"}},Dl=new WeakMap,Qa=new WeakMap,so=new WeakMap,M2);const Eg=new _w,Aw=Sw;function Ow(){let n=[],a=0,l=m=>{m()},i=m=>{m()},c=Aw;const d=m=>{a?n.push(m):c(()=>{l(m)})},f=()=>{const m=n;n=[],m.length&&c(()=>{i(()=>{m.forEach(g=>{l(g)})})})};return{batch:m=>{let g;a++;try{g=m()}finally{a--,a||f()}return g},batchCalls:m=>(...g)=>{d(()=>{m(...g)})},schedule:d,setNotifyFunction:m=>{l=m},setBatchNotifyFunction:m=>{i=m},setScheduler:m=>{c=m}}}const Xt=Ow();var ao,Ya,lo,E2,zw=(E2=class extends Zr{constructor(){super();Ne(this,ao,!0);Ne(this,Ya);Ne(this,lo);pe(this,lo,a=>{if(typeof window<"u"&&window.addEventListener){const l=()=>a(!0),i=()=>a(!1);return window.addEventListener("online",l,!1),window.addEventListener("offline",i,!1),()=>{window.removeEventListener("online",l),window.removeEventListener("offline",i)}}})}onSubscribe(){B(this,Ya)||this.setEventListener(B(this,lo))}onUnsubscribe(){var a;this.hasListeners()||((a=B(this,Ya))==null||a.call(this),pe(this,Ya,void 0))}setEventListener(a){var l;pe(this,lo,a),(l=B(this,Ya))==null||l.call(this),pe(this,Ya,a(this.setOnline.bind(this)))}setOnline(a){B(this,ao)!==a&&(pe(this,ao,a),this.listeners.forEach(l=>{l(a)}))}isOnline(){return B(this,ao)}},ao=new WeakMap,Ya=new WeakMap,lo=new WeakMap,E2);const Gu=new zw;function Dw(n){return Math.min(1e3*2**n,3e4)}function G2(n){return(n??"online")==="online"?Gu.isOnline():!0}var Um=class extends Error{constructor(n){super("CancelledError"),this.revert=n==null?void 0:n.revert,this.silent=n==null?void 0:n.silent}};function q2(n){let a=!1,l=0,i,c="pending",d,f;const m=new Promise((T,O)=>{d=T,f=O});m.catch(wn);const g=()=>c!=="pending",v=T=>{var O;if(!g()){const M=new Um(T);N(M),(O=n.onCancel)==null||O.call(n,M)}},x=()=>{a=!0},p=()=>{a=!1},b=()=>Eg.isFocused()&&(n.networkMode==="always"||Gu.isOnline())&&n.canRun(),S=()=>G2(n.networkMode)&&n.canRun(),j=T=>{g()||(i==null||i(),c="resolved",d(T))},N=T=>{g()||(i==null||i(),c="rejected",f(T))},R=T=>new Promise(O=>{var M;i=E=>{(g()||T())&&O(E)},(M=n.onPause)==null||M.call(n)}).then(()=>{var O;i=void 0,g()||(O=n.onContinue)==null||O.call(n)}),A=()=>{if(g())return;let T;const O=l===0?n.initialPromise:void 0;try{T=O??n.fn()}catch(M){T=Promise.reject(M)}Promise.resolve(T).then(j).catch(M=>{var Z;if(g())return;const E=n.retry??(Mg()?0:3),_=n.retryDelay??Dw,D=typeof _=="function"?_(l,M):_,P=E===!0||typeof E=="number"&&l<E||typeof E=="function"&&E(l,M);if(a||!P){N(M);return}l++,(Z=n.onFail)==null||Z.call(n,l,M),Cw(D).then(()=>b()?void 0:R(b)).then(()=>{a?N(M):A()})})};return{promise:m,status:()=>c,cancel:v,continue:()=>(i==null||i(),m),cancelRetry:x,continueRetry:p,canStart:S,start:()=>(S()?A():R(S).then(A),m)}}var kl,R2,I2=(R2=class{constructor(){Ne(this,kl)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),H2(this.gcTime)&&pe(this,kl,Ol.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(n){this.gcTime=Math.max(this.gcTime||0,n??(Mg()?1/0:3e5))}clearGcTimeout(){B(this,kl)!==void 0&&(Ol.clearTimeout(B(this,kl)),pe(this,kl,void 0))}},kl=new WeakMap,R2);function kw(n){return{onFetch:(a,l)=>{var x,p,b,S,j;const i=a.options,c=(b=(p=(x=a.fetchOptions)==null?void 0:x.meta)==null?void 0:p.fetchMore)==null?void 0:b.direction,d=((S=a.state.data)==null?void 0:S.pages)||[],f=((j=a.state.data)==null?void 0:j.pageParams)||[];let m={pages:[],pageParams:[]},g=0;const v=async()=>{let N=!1;const R=O=>{Rw(O,()=>a.signal,()=>N=!0)},A=F2(a.options,a.fetchOptions),T=async(O,M,E)=>{if(N)return Promise.reject(a.signal.reason);if(M==null&&O.pages.length)return Promise.resolve(O);const D=(()=>{const te={client:a.client,queryKey:a.queryKey,pageParam:M,direction:E?"backward":"forward",meta:a.options.meta};return R(te),te})(),P=await A(D),{maxPages:Z}=a.options,z=E?Ew:Mw;return{pages:z(O.pages,P,Z),pageParams:z(O.pageParams,M,Z)}};if(c&&d.length){const O=c==="backward",M=O?P2:Bm,E={pages:d,pageParams:f};m=await T(E,M(i,E),O)}else{const O=n??d.length;do{const M=g===0?f[0]===void 0?i.initialPageParam:f[0]:Bm(i,m);if(g>0&&M==null)break;m=await T(m,M),g++}while(g<O)}return m};a.options.persister?a.fetchFn=()=>{var N,R;return(R=(N=a.options).persister)==null?void 0:R.call(N,v,{client:a.client,queryKey:a.queryKey,meta:a.options.meta,signal:a.signal},l)}:a.fetchFn=v}}}function Bm(n,{pages:a,pageParams:l}){const i=a.length-1;return a.length>0?n.getNextPageParam(a[i],a,l[i],l):void 0}function P2(n,{pages:a,pageParams:l}){var i;return a.length>0?(i=n.getPreviousPageParam)==null?void 0:i.call(n,a[0],a,l[0],l):void 0}function Lw(n,a){return a?Bm(n,a)!=null:!1}function $w(n,a){return!a||!n.getPreviousPageParam?!1:P2(n,a)!=null}var io,Ll,oo,Jn,$l,_t,Pr,Hl,cs,na,T2,Hw=(T2=class extends I2{constructor(a){super();Ne(this,cs);Ne(this,io);Ne(this,Ll);Ne(this,oo);Ne(this,Jn);Ne(this,$l);Ne(this,_t);Ne(this,Pr);Ne(this,Hl);pe(this,Hl,!1),pe(this,Pr,a.defaultOptions),this.setOptions(a.options),this.observers=[],pe(this,$l,a.client),pe(this,Jn,B(this,$l).getQueryCache()),this.queryKey=a.queryKey,this.queryHash=a.queryHash,pe(this,Ll,dv(this.options)),this.state=a.state??B(this,Ll),this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return B(this,io)}get promise(){var a;return(a=B(this,_t))==null?void 0:a.promise}setOptions(a){if(this.options={...B(this,Pr),...a},a!=null&&a._type&&pe(this,io,a._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const l=dv(this.options);l.data!==void 0&&(this.setState(uv(l.data,l.dataUpdatedAt)),pe(this,Ll,l))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&B(this,Jn).remove(this)}setData(a,l){const i=Hm(this.state.data,a,this.options);return He(this,cs,na).call(this,{data:i,type:"success",dataUpdatedAt:l==null?void 0:l.updatedAt,manual:l==null?void 0:l.manual}),i}setState(a){He(this,cs,na).call(this,{type:"setState",state:a})}cancel(a){var i,c;const l=(i=B(this,_t))==null?void 0:i.promise;return(c=B(this,_t))==null||c.cancel(a),l?l.then(wn).catch(wn):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return B(this,Ll)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(a=>ct(a.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Cg||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(a=>ct(a.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(a=>a.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(a=0){return this.state.data===void 0?!0:a==="static"?!1:this.state.isInvalidated?!0:!U2(this.state.dataUpdatedAt,a)}onFocus(){var a,l;(a=this.observers.find(i=>i.shouldFetchOnWindowFocus()))==null||a.refetch({cancelRefetch:!1}),(l=B(this,_t))==null||l.continue()}onOnline(){var a,l;(a=this.observers.find(i=>i.shouldFetchOnReconnect()))==null||a.refetch({cancelRefetch:!1}),(l=B(this,_t))==null||l.continue()}addObserver(a){this.observers.includes(a)||(this.observers.push(a),this.clearGcTimeout(),B(this,Jn).notify({type:"observerAdded",query:this,observer:a}))}removeObserver(a){const l=this.observers.indexOf(a);l!==-1&&(this.observers.splice(l,1),this.observers.length||(B(this,_t)&&(B(this,Hl)||this.state.fetchStatus==="paused"&&this.state.status==="pending"?B(this,_t).cancel({revert:!0}):B(this,_t).cancelRetry()),this.scheduleGc()),B(this,Jn).notify({type:"observerRemoved",query:this,observer:a}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||He(this,cs,na).call(this,{type:"invalidate"})}async fetch(a,l){var v,x,p,b,S,j,N,R,A,T,O,M;if(this.state.fetchStatus!=="idle"&&((v=B(this,_t))==null?void 0:v.status())!=="rejected"){if(this.state.data!==void 0&&(l!=null&&l.cancelRefetch))this.cancel({silent:!0});else if(B(this,_t))return B(this,_t).continueRetry(),B(this,_t).promise}if(a&&this.setOptions(a),!this.options.queryFn){const E=this.observers.find(_=>_.options.queryFn);E&&this.setOptions(E.options)}const i=new AbortController,c=E=>{Object.defineProperty(E,"signal",{enumerable:!0,get:()=>(pe(this,Hl,!0),i.signal)})},d=()=>{const E=F2(this.options,l),D=(()=>{const P={client:B(this,$l),queryKey:this.queryKey,meta:this.meta};return c(P),P})();return pe(this,Hl,!1),this.options.persister?this.options.persister(E,D,this):E(D)},m=(()=>{const E={fetchOptions:l,options:this.options,queryKey:this.queryKey,client:B(this,$l),state:this.state,fetchFn:d};return c(E),E})();(x=B(this,io)==="infinite"?kw(this.options.pages):this.options.behavior)==null||x.onFetch(m,this),pe(this,oo,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((p=m.fetchOptions)==null?void 0:p.meta))&&He(this,cs,na).call(this,{type:"fetch",meta:(b=m.fetchOptions)==null?void 0:b.meta});const g=pe(this,_t,q2({initialPromise:l==null?void 0:l.initialPromise,fn:m.fetchFn,onCancel:E=>{E instanceof Um&&E.revert&&this.setState({...B(this,oo),fetchStatus:"idle"}),i.abort()},onFail:(E,_)=>{He(this,cs,na).call(this,{type:"failed",failureCount:E,error:_})},onPause:()=>{He(this,cs,na).call(this,{type:"pause"})},onContinue:()=>{He(this,cs,na).call(this,{type:"continue"})},retry:m.options.retry,retryDelay:m.options.retryDelay,networkMode:m.options.networkMode,canRun:()=>!0}));try{const E=await g.start();if(E===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(E),(j=(S=B(this,Jn).config).onSuccess)==null||j.call(S,E,this),(R=(N=B(this,Jn).config).onSettled)==null||R.call(N,E,this.state.error,this),E}catch(E){if(E instanceof Um){if(E.silent)return B(this,_t).promise;if(E.revert){if(this.state.data===void 0)throw E;return this.state.data}}throw He(this,cs,na).call(this,{type:"error",error:E}),(T=(A=B(this,Jn).config).onError)==null||T.call(A,E,this),(M=(O=B(this,Jn).config).onSettled)==null||M.call(O,this.state.data,E,this),E}finally{B(this,_t)===g&&pe(this,_t,void 0),this.scheduleGc()}}},io=new WeakMap,Ll=new WeakMap,oo=new WeakMap,Jn=new WeakMap,$l=new WeakMap,_t=new WeakMap,Pr=new WeakMap,Hl=new WeakMap,cs=new WeakSet,na=function(a){const l=i=>{switch(a.type){case"failed":return{...i,fetchFailureCount:a.failureCount,fetchFailureReason:a.error};case"pause":return{...i,fetchStatus:"paused"};case"continue":return{...i,fetchStatus:"fetching"};case"fetch":return{...i,...Q2(i.data,this.options),fetchMeta:a.meta??null};case"success":const c={...i,...uv(a.data,a.dataUpdatedAt),dataUpdateCount:i.dataUpdateCount+1,...!a.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return pe(this,oo,a.manual?c:void 0),c;case"error":const d=a.error;return{...i,error:d,errorUpdateCount:i.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:i.fetchFailureCount+1,fetchFailureReason:d,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...i,isInvalidated:!0};case"setState":return{...i,...a.state}}};this.state=l(this.state),Xt.batch(()=>{this.observers.slice().forEach(i=>{i.onQueryUpdate()}),B(this,Jn).notify({query:this,type:"updated",action:a})})},T2);function Q2(n,a){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:G2(a.networkMode)?"fetching":"paused",...n===void 0&&{error:null,status:"pending"}}}function uv(n,a){return{data:n,dataUpdatedAt:a??Date.now(),error:null,isInvalidated:!1,status:"success"}}function dv(n){const a=typeof n.initialData=="function"?n.initialData():n.initialData,l=a!==void 0,i=l?typeof n.initialDataUpdatedAt=="function"?n.initialDataUpdatedAt():n.initialDataUpdatedAt:0;return{data:a,dataUpdateCount:0,dataUpdatedAt:l?i??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:l?"success":"pending",fetchStatus:"idle"}}var hn,Ue,Qr,fn,Ul,ro,la,Yr,co,uo,Bl,Fl,Xa,ho,Qe,kr,Fm,Vm,Gm,qm,Im,Pm,Qm,Ym,_2,Y2=(_2=class extends Zr{constructor(a,l){super();Ne(this,Qe);Ne(this,hn);Ne(this,Ue);Ne(this,Qr);Ne(this,fn);Ne(this,Ul);Ne(this,ro);Ne(this,la);Ne(this,Yr);Ne(this,co);Ne(this,uo);Ne(this,Bl);Ne(this,Fl);Ne(this,Xa);Ne(this,ho,new Set);this.options=l,pe(this,hn,a),pe(this,la,null),this.bindMethods(),this.setOptions(l)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(B(this,Ue).addObserver(this),hv(B(this,Ue),this.options)?He(this,Qe,kr).call(this):this.updateResult(),He(this,Qe,Im).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Xm(B(this,Ue),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Xm(B(this,Ue),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,He(this,Qe,Pm).call(this),He(this,Qe,Qm).call(this),B(this,Ue).removeObserver(this)}setOptions(a){const l=this.options,i=B(this,Ue);if(this.options=B(this,hn).defaultQueryOptions(a),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof ct(this.options.enabled,B(this,Ue))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");He(this,Qe,Ym).call(this),B(this,Ue).setOptions(this.options),l._defaulted&&!Pf(this.options,l)&&B(this,hn).getQueryCache().notify({type:"observerOptionsUpdated",query:B(this,Ue),observer:this});const c=this.hasListeners();c&&fv(B(this,Ue),i,this.options,l)&&He(this,Qe,kr).call(this),this.updateResult(),c&&(B(this,Ue)!==i||ct(this.options.enabled,B(this,Ue))!==ct(l.enabled,B(this,Ue))||ct(this.options.staleTime,B(this,Ue))!==ct(l.staleTime,B(this,Ue)))&&He(this,Qe,Vm).call(this);const d=He(this,Qe,Gm).call(this);c&&(B(this,Ue)!==i||ct(this.options.enabled,B(this,Ue))!==ct(l.enabled,B(this,Ue))||d!==B(this,Xa))&&He(this,Qe,qm).call(this,d)}getOptimisticResult(a){const l=B(this,hn).getQueryCache().build(B(this,hn),a),i=this.createResult(l,a);return Pf(this.getCurrentResult(),i)||(pe(this,fn,i),pe(this,ro,this.options),pe(this,Ul,B(this,Ue).state)),i}getCurrentResult(){return B(this,fn)}trackResult(a,l){return new Proxy(a,{get:(i,c)=>(this.trackProp(c),l==null||l(c),Reflect.get(i,c))})}trackProp(a){B(this,ho).add(a)}getCurrentQuery(){return B(this,Ue)}refetch({...a}={}){return this.fetch({...a})}fetchOptimistic(a){const l=B(this,hn).defaultQueryOptions(a),i=B(this,hn).getQueryCache().build(B(this,hn),l);let c=()=>{},d;const f=new Promise(m=>{d=m,c=B(this,hn).getQueryCache().subscribe(g=>{g.type==="updated"&&g.query.queryHash===i.queryHash&&i.state.data!==void 0&&(c(),m(this.createResult(i,l)))})});return Promise.race([i.fetch(l).then(()=>{const m=this.createResult(i,l);return d==null||d(m),m}).finally(()=>{c()}),f])}fetch(a){return He(this,Qe,kr).call(this,{...a,cancelRefetch:a.cancelRefetch??!0}).then(()=>(this.updateResult(),B(this,fn)))}createResult(a,l){var _;const i=B(this,Ue),c=this.options,d=B(this,fn),f=B(this,Ul),m=B(this,ro),g=a!==i?a.state:B(this,Qr),{state:v}=a;let x={...v},p=!1,b;if(l._optimisticResults){const D=this.hasListeners(),P=!D&&hv(a,l),Z=D&&fv(a,i,l,c);(P||Z)&&(x={...x,...Q2(v.data,a.options)}),l._optimisticResults==="isRestoring"&&(x.fetchStatus="idle")}let{error:S,errorUpdatedAt:j,status:N}=x;b=x.data;let R=!1;if(l.placeholderData!==void 0&&b===void 0&&N==="pending"){let D;d!=null&&d.isPlaceholderData&&l.placeholderData===(m==null?void 0:m.placeholderData)?(D=d.data,R=!0):D=typeof l.placeholderData=="function"?l.placeholderData((_=B(this,uo))==null?void 0:_.state.data,B(this,uo)):l.placeholderData,D!==void 0&&(N="success",b=Hm(d==null?void 0:d.data,D,l),p=!0)}if(l.select&&b!==void 0&&!R)if(d&&b===(f==null?void 0:f.data)&&l.select===B(this,Yr))b=B(this,co);else try{pe(this,Yr,l.select),b=l.select(b),b=Hm(d==null?void 0:d.data,b,l),pe(this,co,b),pe(this,la,null)}catch(D){pe(this,la,D)}else b===void 0&&pe(this,la,null);B(this,la)&&(S=B(this,la),b=B(this,co),j=Date.now(),N="error",p=!1);const A=x.fetchStatus==="fetching",T=N==="pending",O=N==="error",M=T&&A,E=b!==void 0;return{status:N,fetchStatus:x.fetchStatus,isPending:T,isSuccess:N==="success",isError:O,isInitialLoading:M,isLoading:M,data:b,dataUpdatedAt:x.dataUpdatedAt,error:S,errorUpdatedAt:j,failureCount:x.fetchFailureCount,failureReason:x.fetchFailureReason,errorUpdateCount:x.errorUpdateCount,isFetched:a.isFetched(),isFetchedAfterMount:x.dataUpdateCount>g.dataUpdateCount||x.errorUpdateCount>g.errorUpdateCount,isFetching:A,isRefetching:A&&!T,isLoadingError:O&&!E,isPaused:x.fetchStatus==="paused",isPlaceholderData:p,isRefetchError:O&&E,isStale:Rg(a,l),refetch:this.refetch,isEnabled:ct(l.enabled,a)!==!1}}updateResult(){const a=B(this,fn),l=this.createResult(B(this,Ue),this.options);if(pe(this,Ul,B(this,Ue).state),pe(this,ro,this.options),B(this,Ul).data!==void 0&&pe(this,uo,B(this,Ue)),Pf(l,a))return;pe(this,fn,l);const c=(()=>{if(!a)return!0;const{notifyOnChangeProps:d}=this.options,f=typeof d=="function"?d():d;if(f==="all"||!f&&!B(this,ho).size)return!0;const m=new Set(f??B(this,ho));return this.options.throwOnError&&m.add("error"),Object.keys(B(this,fn)).some(g=>{const v=g;return B(this,fn)[v]!==a[v]&&m.has(v)})})();Xt.batch(()=>{c&&this.listeners.forEach(d=>{d(B(this,fn))}),B(this,hn).getQueryCache().notify({query:B(this,Ue),type:"observerResultsUpdated"})})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&He(this,Qe,Im).call(this)}},hn=new WeakMap,Ue=new WeakMap,Qr=new WeakMap,fn=new WeakMap,Ul=new WeakMap,ro=new WeakMap,la=new WeakMap,Yr=new WeakMap,co=new WeakMap,uo=new WeakMap,Bl=new WeakMap,Fl=new WeakMap,Xa=new WeakMap,ho=new WeakMap,Qe=new WeakSet,kr=function(a){He(this,Qe,Ym).call(this);let l=B(this,Ue).fetch(this.options,a);return a!=null&&a.throwOnError||(l=l.catch(wn)),l},Fm=function(a){return!Mg()&&ct(this.options.enabled,B(this,Ue))!==!1&&H2(a)},Vm=function(){He(this,Qe,Pm).call(this);const a=ct(this.options.staleTime,B(this,Ue));if(B(this,fn).isStale||!He(this,Qe,Fm).call(this,a))return;const l=U2(B(this,fn).dataUpdatedAt,a)+1;pe(this,Bl,Ol.setTimeout(()=>{B(this,fn).isStale||this.updateResult()},l))},Gm=function(){return ct(this.options.refetchInterval,B(this,Ue))??!1},qm=function(a){He(this,Qe,Qm).call(this),pe(this,Xa,a),!(B(this,Xa)===0||!He(this,Qe,Fm).call(this,B(this,Xa)))&&pe(this,Fl,Ol.setInterval(()=>{(this.options.refetchIntervalInBackground||Eg.isFocused())&&He(this,Qe,kr).call(this)},B(this,Xa)))},Im=function(){He(this,Qe,Vm).call(this),He(this,Qe,qm).call(this,He(this,Qe,Gm).call(this))},Pm=function(){B(this,Bl)!==void 0&&(Ol.clearTimeout(B(this,Bl)),pe(this,Bl,void 0))},Qm=function(){B(this,Fl)!==void 0&&(Ol.clearInterval(B(this,Fl)),pe(this,Fl,void 0))},Ym=function(){const a=B(this,hn).getQueryCache().build(B(this,hn),this.options);if(a===B(this,Ue))return;const l=B(this,Ue);pe(this,Ue,a),pe(this,Qr,a.state),this.hasListeners()&&(l==null||l.removeObserver(this),a.addObserver(this))},_2);function Uw(n,a){return ct(a.enabled,n)!==!1&&n.state.data===void 0&&!(n.state.status==="error"&&ct(a.retryOnMount,n)===!1)}function hv(n,a){return Uw(n,a)||n.state.data!==void 0&&Xm(n,a,a.refetchOnMount)}function Xm(n,a,l){if(ct(a.enabled,n)!==!1&&ct(a.staleTime,n)!=="static"){const i=ct(l,n);return i==="always"||i!==!1&&Rg(n,a)}return!1}function fv(n,a,l,i){return(n!==a||ct(i.enabled,n)===!1)&&(!l.suspense||n.state.status!=="error")&&Rg(n,l)}function Rg(n,a){return ct(a.enabled,n)!==!1&&n.isStaleByTime(ct(a.staleTime,n))}var Bw=class extends Y2{constructor(n,a){super(n,a)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(n){n._type="infinite",super.setOptions(n)}getOptimisticResult(n){return n._type="infinite",super.getOptimisticResult(n)}fetchNextPage(n){return this.fetch({...n,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(n){return this.fetch({...n,meta:{fetchMore:{direction:"backward"}}})}createResult(n,a){var S,j;const{state:l}=n,i=super.createResult(n,a),{isFetching:c,isRefetching:d,isError:f,isRefetchError:m}=i,g=(j=(S=l.fetchMeta)==null?void 0:S.fetchMore)==null?void 0:j.direction,v=f&&g==="forward",x=c&&g==="forward",p=f&&g==="backward",b=c&&g==="backward";return{...i,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:Lw(a,l.data),hasPreviousPage:$w(a,l.data),isFetchNextPageError:v,isFetchingNextPage:x,isFetchPreviousPageError:p,isFetchingPreviousPage:b,isRefetchError:m&&!v&&!p,isRefetching:d&&!x&&!b}}},Xr,Ts,nn,Vl,_s,Ga,A2,Fw=(A2=class extends I2{constructor(a){super();Ne(this,_s);Ne(this,Xr);Ne(this,Ts);Ne(this,nn);Ne(this,Vl);pe(this,Xr,a.client),this.mutationId=a.mutationId,pe(this,nn,a.mutationCache),pe(this,Ts,[]),this.state=a.state||Vw(),this.setOptions(a.options),this.scheduleGc()}setOptions(a){this.options=a,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(a){B(this,Ts).includes(a)||(B(this,Ts).push(a),this.clearGcTimeout(),B(this,nn).notify({type:"observerAdded",mutation:this,observer:a}))}removeObserver(a){pe(this,Ts,B(this,Ts).filter(l=>l!==a)),this.scheduleGc(),B(this,nn).notify({type:"observerRemoved",mutation:this,observer:a})}optionalRemove(){B(this,Ts).length||(this.state.status==="pending"?this.scheduleGc():B(this,nn).remove(this))}continue(){var a;return((a=B(this,Vl))==null?void 0:a.continue())??(this.state.status==="pending"?this.execute(this.state.variables):Promise.resolve())}async execute(a){var m,g,v,x,p,b,S,j,N,R,A,T,O,M,E,_,D,P;const l=()=>{He(this,_s,Ga).call(this,{type:"continue"})},i={client:B(this,Xr),meta:this.options.meta,mutationKey:this.options.mutationKey},c=pe(this,Vl,q2({fn:()=>this.options.mutationFn?this.options.mutationFn(a,i):Promise.reject(new Error("No mutationFn found")),onFail:(Z,z)=>{He(this,_s,Ga).call(this,{type:"failed",failureCount:Z,error:z})},onPause:()=>{He(this,_s,Ga).call(this,{type:"pause"})},onContinue:l,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>B(this,nn).canRun(this)})),d=this.state.status==="pending",f=!c.canStart();try{if(d)l();else{He(this,_s,Ga).call(this,{type:"pending",variables:a,isPaused:f}),B(this,nn).config.onMutate&&await B(this,nn).config.onMutate(a,this,i);const z=await((g=(m=this.options).onMutate)==null?void 0:g.call(m,a,i));z!==this.state.context&&He(this,_s,Ga).call(this,{type:"pending",context:z,variables:a,isPaused:f})}const Z=await c.start();return await((x=(v=B(this,nn).config).onSuccess)==null?void 0:x.call(v,Z,a,this.state.context,this,i)),await((b=(p=this.options).onSuccess)==null?void 0:b.call(p,Z,a,this.state.context,i)),await((j=(S=B(this,nn).config).onSettled)==null?void 0:j.call(S,Z,null,this.state.variables,this.state.context,this,i)),await((R=(N=this.options).onSettled)==null?void 0:R.call(N,Z,null,a,this.state.context,i)),He(this,_s,Ga).call(this,{type:"success",data:Z}),Z}catch(Z){try{await((T=(A=B(this,nn).config).onError)==null?void 0:T.call(A,Z,a,this.state.context,this,i))}catch(z){Promise.reject(z)}try{await((M=(O=this.options).onError)==null?void 0:M.call(O,Z,a,this.state.context,i))}catch(z){Promise.reject(z)}try{await((_=(E=B(this,nn).config).onSettled)==null?void 0:_.call(E,void 0,Z,this.state.variables,this.state.context,this,i))}catch(z){Promise.reject(z)}try{await((P=(D=this.options).onSettled)==null?void 0:P.call(D,void 0,Z,a,this.state.context,i))}catch(z){Promise.reject(z)}throw He(this,_s,Ga).call(this,{type:"error",error:Z}),Z}finally{B(this,Vl)===c&&pe(this,Vl,void 0),B(this,nn).runNext(this)}}},Xr=new WeakMap,Ts=new WeakMap,nn=new WeakMap,Vl=new WeakMap,_s=new WeakSet,Ga=function(a){const l=i=>{switch(a.type){case"failed":return{...i,failureCount:a.failureCount,failureReason:a.error};case"pause":return{...i,isPaused:!0};case"continue":return{...i,isPaused:!1};case"pending":return{...i,context:a.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:a.isPaused,status:"pending",variables:a.variables,submittedAt:Date.now()};case"success":return{...i,data:a.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...i,data:void 0,error:a.error,failureCount:i.failureCount+1,failureReason:a.error,isPaused:!1,status:"error"}}};this.state=l(this.state),Xt.batch(()=>{B(this,Ts).forEach(i=>{i.onMutationUpdate(a)}),B(this,nn).notify({mutation:this,type:"updated",action:a})})},A2);function Vw(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Ka,us,Kr,O2,Gw=(O2=class extends Zr{constructor(a={}){super();Ne(this,Ka);Ne(this,us);Ne(this,Kr);this.config=a,pe(this,Ka,new Set),pe(this,us,new Map),pe(this,Kr,0)}build(a,l,i){const c=new Fw({client:a,mutationCache:this,mutationId:++_u(this,Kr)._,options:a.defaultMutationOptions(l),state:i});return this.add(c),c}add(a){B(this,Ka).add(a);const l=Au(a);if(typeof l=="string"){const i=B(this,us).get(l);i?i.push(a):B(this,us).set(l,[a])}this.notify({type:"added",mutation:a})}remove(a){if(B(this,Ka).delete(a)){const l=Au(a);if(typeof l=="string"){const i=B(this,us).get(l);if(i)if(i.length>1){const c=i.indexOf(a);c!==-1&&i.splice(c,1)}else i[0]===a&&B(this,us).delete(l)}}this.notify({type:"removed",mutation:a})}canRun(a){var i;const l=Au(a);if(typeof l=="string"){const c=(i=B(this,us).get(l))==null?void 0:i.find(d=>d.state.status==="pending");return!c||c===a}else return!0}runNext(a){var i,c;const l=Au(a);return typeof l=="string"?((c=(i=B(this,us).get(l))==null?void 0:i.find(d=>d!==a&&d.state.isPaused))==null?void 0:c.continue())??Promise.resolve():Promise.resolve()}clear(){Xt.batch(()=>{const a=this.getAll();B(this,Ka).clear(),B(this,us).clear(),a.forEach(l=>{this.notify({type:"removed",mutation:l})})})}getAll(){return Array.from(B(this,Ka))}find(a){const l={exact:!0,...a};return this.getAll().find(i=>ov(l,i))}findAll(a={}){return this.getAll().filter(l=>ov(a,l))}notify(a){Xt.batch(()=>{this.listeners.forEach(l=>{l(a)})})}resumePausedMutations(){const a=this.getAll().filter(l=>l.state.isPaused);return Xt.batch(()=>Promise.all(a.map(l=>l.continue().catch(wn))))}},Ka=new WeakMap,us=new WeakMap,Kr=new WeakMap,O2);function Au(n){var a;return(a=n.options.scope)==null?void 0:a.id}var As,z2,qw=(z2=class extends Zr{constructor(a={}){super();Ne(this,As);this.config=a,pe(this,As,new Map)}build(a,l,i){const c=l.queryKey,d=l.queryHash??Ng(c,l);let f=this.get(d);return f||(f=new Hw({client:a,queryKey:c,queryHash:d,options:a.defaultQueryOptions(l),state:i,defaultOptions:a.getQueryDefaults(c)}),this.add(f)),f}add(a){B(this,As).has(a.queryHash)||(B(this,As).set(a.queryHash,a),this.notify({type:"added",query:a}))}remove(a){B(this,As).get(a.queryHash)===a&&(a.destroy(),B(this,As).delete(a.queryHash),this.notify({type:"removed",query:a}))}clear(){Xt.batch(()=>{this.getAll().forEach(a=>{this.remove(a)})})}get(a){return B(this,As).get(a)}getAll(){return[...B(this,As).values()]}find(a){const l={exact:!0,...a};return this.getAll().find(i=>iv(l,i))}findAll(a={}){const l=this.getAll();return Object.keys(a).length>0?l.filter(i=>iv(a,i)):l}notify(a){Xt.batch(()=>{this.listeners.forEach(l=>{l(a)})})}onFocus(){Xt.batch(()=>{this.getAll().forEach(a=>{a.onFocus()})})}onOnline(){Xt.batch(()=>{this.getAll().forEach(a=>{a.onOnline()})})}},As=new WeakMap,z2),ht,Za,Ja,fo,mo,Wa,go,po,D2,Iw=(D2=class{constructor(n={}){Ne(this,ht);Ne(this,Za);Ne(this,Ja);Ne(this,fo);Ne(this,mo);Ne(this,Wa);Ne(this,go);Ne(this,po);pe(this,ht,n.queryCache||new qw),pe(this,Za,n.mutationCache||new Gw),pe(this,Ja,n.defaultOptions||{}),pe(this,fo,new Map),pe(this,mo,new Map),pe(this,Wa,0)}mount(){_u(this,Wa)._++,B(this,Wa)===1&&(pe(this,go,Eg.subscribe(async n=>{n&&(await this.resumePausedMutations(),B(this,ht).onFocus())})),pe(this,po,Gu.subscribe(async n=>{n&&(await this.resumePausedMutations(),B(this,ht).onOnline())})))}unmount(){var n,a;_u(this,Wa)._--,B(this,Wa)===0&&((n=B(this,go))==null||n.call(this),pe(this,go,void 0),(a=B(this,po))==null||a.call(this),pe(this,po,void 0))}isFetching(n){return B(this,ht).findAll({...n,fetchStatus:"fetching"}).length}isMutating(n){return B(this,Za).findAll({...n,status:"pending"}).length}getQueryData(n){var l;const a=this.defaultQueryOptions({queryKey:n});return(l=B(this,ht).get(a.queryHash))==null?void 0:l.state.data}ensureQueryData(n){const a=this.defaultQueryOptions(n),l=B(this,ht).build(this,a),i=l.state.data;return i===void 0?this.fetchQuery(n):(n.revalidateIfStale&&l.isStaleByTime(ct(a.staleTime,l))&&this.prefetchQuery(a),Promise.resolve(i))}getQueriesData(n){return B(this,ht).findAll(n).map(({queryKey:a,state:l})=>[a,l.data])}setQueryData(n,a,l){var f;const i=this.defaultQueryOptions({queryKey:n}),c=(f=B(this,ht).get(i.queryHash))==null?void 0:f.state.data,d=ww(a,c);if(d!==void 0)return B(this,ht).build(this,i).setData(d,{...l,manual:!0})}setQueriesData(n,a,l){return Xt.batch(()=>B(this,ht).findAll(n).map(({queryKey:i})=>[i,this.setQueryData(i,a,l)]))}getQueryState(n){var l;const a=this.defaultQueryOptions({queryKey:n});return(l=B(this,ht).get(a.queryHash))==null?void 0:l.state}removeQueries(n){const a=B(this,ht);Xt.batch(()=>{a.findAll(n).forEach(l=>{a.remove(l)})})}resetQueries(n,a){const l=B(this,ht);return Xt.batch(()=>{const i=l.findAll(n),c=new Set(i);return i.forEach(d=>{d.reset()}),this.refetchQueries({type:"active",predicate:d=>c.has(d)},a)})}cancelQueries(n,a={}){const l={revert:!0,...a},i=Xt.batch(()=>B(this,ht).findAll(n).map(c=>c.cancel(l)));return Promise.all(i).then(wn).catch(wn)}invalidateQueries(n,a={}){return Xt.batch(()=>(B(this,ht).findAll(n).forEach(l=>{l.invalidate()}),(n==null?void 0:n.refetchType)==="none"?Promise.resolve():this.refetchQueries({...n,type:(n==null?void 0:n.refetchType)??(n==null?void 0:n.type)??"active"},a)))}refetchQueries(n,a={}){const l={...a,cancelRefetch:a.cancelRefetch??!0},i=Xt.batch(()=>B(this,ht).findAll(n).filter(c=>!c.isDisabled()&&!c.isStatic()).map(c=>{let d=c.fetch(void 0,l);return l.throwOnError||(d=d.catch(wn)),c.state.fetchStatus==="paused"?Promise.resolve():d}));return Promise.all(i).then(wn)}async query(n){const a=this.defaultQueryOptions(n);a.retry===void 0&&(a.retry=!1);const l=B(this,ht).build(this,a),i=l.isStaleByTime(ct(a.staleTime,l))?await l.fetch(a):l.state.data,c=a.select;return c?c(i):i}fetchQuery(n){const a=this.defaultQueryOptions(n);a.retry===void 0&&(a.retry=!1);const l=B(this,ht).build(this,a);return l.isStaleByTime(ct(a.staleTime,l))?l.fetch(a):Promise.resolve(l.state.data)}prefetchQuery(n){return this.fetchQuery(n).then(wn).catch(wn)}infiniteQuery(n){return n._type="infinite",this.query(n)}fetchInfiniteQuery(n){return n._type="infinite",this.fetchQuery(n)}prefetchInfiniteQuery(n){return this.fetchInfiniteQuery(n).then(wn).catch(wn)}ensureInfiniteQueryData(n){return n._type="infinite",this.ensureQueryData(n)}resumePausedMutations(){return Gu.isOnline()?B(this,Za).resumePausedMutations():Promise.resolve()}getQueryCache(){return B(this,ht)}getMutationCache(){return B(this,Za)}getDefaultOptions(){return B(this,Ja)}setDefaultOptions(n){pe(this,Ja,n)}setQueryDefaults(n,a){B(this,fo).set(Br(n),{queryKey:n,defaultOptions:a})}getQueryDefaults(n){const a=[...B(this,fo).values()],l={};return a.forEach(i=>{xo(n,i.queryKey)&&Object.assign(l,i.defaultOptions)}),l}setMutationDefaults(n,a){B(this,mo).set(Br(n),{mutationKey:n,defaultOptions:a})}getMutationDefaults(n){const a=[...B(this,mo).values()],l={};return a.forEach(i=>{xo(n,i.mutationKey)&&Object.assign(l,i.defaultOptions)}),l}defaultQueryOptions(n){if(n._defaulted)return n;const a={...B(this,Ja).queries,...this.getQueryDefaults(n.queryKey),...n,_defaulted:!0};return a.queryHash||(a.queryHash=Ng(a.queryKey,a)),a.refetchOnReconnect===void 0&&(a.refetchOnReconnect=a.networkMode!=="always"),a.throwOnError===void 0&&(a.throwOnError=!!a.suspense),!a.networkMode&&a.persister&&(a.networkMode="offlineFirst"),a.queryFn===Cg&&(a.enabled=!1),a}defaultMutationOptions(n){return n!=null&&n._defaulted?n:{...B(this,Ja).mutations,...(n==null?void 0:n.mutationKey)&&this.getMutationDefaults(n.mutationKey),...n,_defaulted:!0}}clear(){B(this,ht).clear(),B(this,Za).clear()}},ht=new WeakMap,Za=new WeakMap,Ja=new WeakMap,fo=new WeakMap,mo=new WeakMap,Wa=new WeakMap,go=new WeakMap,po=new WeakMap,D2);const X2=C.createContext(!1),Pw=()=>C.useContext(X2);X2.Provider;function Qw(){let n=!1;return{clearReset:()=>{n=!1},reset:()=>{n=!0},isReset:()=>n}}const Yw=C.createContext(Qw()),Xw=()=>C.useContext(Yw),Kw=(n,a,l)=>{const i=(l==null?void 0:l.state.status)==="error"&&typeof n.throwOnError=="function"?V2(n.throwOnError,[l.state.error,l]):n.throwOnError;(n.suspense||i)&&(a.isReset()||(n.retryOnMount=!1))},Zw=n=>{C.useEffect(()=>{n.clearReset()},[n])},Jw=({result:n,errorResetBoundary:a,throwOnError:l,query:i,suspense:c})=>n.isError&&!a.isReset()&&!n.isFetching&&i&&(c&&n.data===void 0||V2(l,[n.error,i])),Ww=n=>{if(n.suspense){const l=c=>c==="static"?c:Math.max(c??1e3,1e3),i=n.staleTime;n.staleTime=typeof i=="function"?(...c)=>l(i(...c)):l(i),typeof n.gcTime=="number"&&(n.gcTime=Math.max(n.gcTime,1e3))}},eN=(n,a)=>(n==null?void 0:n.suspense)&&a.isPending,tN=(n,a,l)=>a.fetchOptimistic(n).catch(()=>{l.clearReset()});function K2(n,a,l){const i=Pw(),c=Xw(),d=$2(),f=d.defaultQueryOptions(n),m=d.getQueryCache().get(f.queryHash),g=n.subscribed!==!1;f._optimisticResults=i?"isRestoring":g?"optimistic":void 0,Ww(f),Kw(f,c,m),Zw(c);const[v]=C.useState(()=>new a(d,f)),x=v.getOptimisticResult(f),p=!i&&g;if(C.useSyncExternalStore(C.useCallback(b=>{const S=p?v.subscribe(Xt.batchCalls(b)):wn;return v.updateResult(),S},[v,p]),()=>v.getCurrentResult(),()=>v.getCurrentResult()),C.useEffect(()=>{v.setOptions(f)},[f,v]),eN(f,x))throw tN(f,v,c);if(Jw({result:x,errorResetBoundary:c,throwOnError:f.throwOnError,query:m,suspense:f.suspense}))throw x.error;return f.notifyOnChangeProps?x:v.trackResult(x)}function Rt(n,a){return K2(n,Y2)}function nN(n,a){return K2(n,Bw)}var Jr=k2();/**
|
|
50
50
|
* @remix-run/router v1.23.4
|
|
51
51
|
*
|
|
52
52
|
* Copyright (c) Remix Software Inc.
|
|
@@ -55,7 +55,7 @@ Error generating stack: `+i.message+`
|
|
|
55
55
|
* LICENSE.md file in the root directory of this source tree.
|
|
56
56
|
*
|
|
57
57
|
* @license MIT
|
|
58
|
-
*/function
|
|
58
|
+
*/function Fr(){return Fr=Object.assign?Object.assign.bind():function(n){for(var a=1;a<arguments.length;a++){var l=arguments[a];for(var i in l)({}).hasOwnProperty.call(l,i)&&(n[i]=l[i])}return n},Fr.apply(null,arguments)}var el;(function(n){n.Pop="POP",n.Push="PUSH",n.Replace="REPLACE"})(el||(el={}));const mv="popstate";function sN(n){n===void 0&&(n={});function a(i,c){let{pathname:d,search:f,hash:m}=i.location;return Km("",{pathname:d,search:f,hash:m},c.state&&c.state.usr||null,c.state&&c.state.key||"default")}function l(i,c){return typeof c=="string"?c:J2(c)}return lN(a,l,null,n)}function Et(n,a){if(n===!1||n===null||typeof n>"u")throw new Error(a)}function Z2(n,a){if(!n){typeof console<"u"&&console.warn(a);try{throw new Error(a)}catch{}}}function aN(){return Math.random().toString(36).substr(2,8)}function gv(n,a){return{usr:n.state,key:n.key,idx:a}}function Km(n,a,l,i){return l===void 0&&(l=null),Fr({pathname:typeof n=="string"?n:n.pathname,search:"",hash:""},typeof a=="string"?yo(a):a,{state:l,key:a&&a.key||i||aN()})}function J2(n){let{pathname:a="/",search:l="",hash:i=""}=n;return l&&l!=="?"&&(a+=l.charAt(0)==="?"?l:"?"+l),i&&i!=="#"&&(a+=i.charAt(0)==="#"?i:"#"+i),a}function yo(n){let a={};if(n){let l=n.indexOf("#");l>=0&&(a.hash=n.substr(l),n=n.substr(0,l));let i=n.indexOf("?");i>=0&&(a.search=n.substr(i),n=n.substr(0,i)),n&&(a.pathname=n)}return a}function lN(n,a,l,i){i===void 0&&(i={});let{window:c=document.defaultView,v5Compat:d=!1}=i,f=c.history,m=el.Pop,g=null,v=x();v==null&&(v=0,f.replaceState(Fr({},f.state,{idx:v}),""));function x(){return(f.state||{idx:null}).idx}function p(){m=el.Pop;let R=x(),A=R==null?null:R-v;v=R,g&&g({action:m,location:N.location,delta:A})}function b(R,A){m=el.Push;let T=Km(N.location,R,A);v=x()+1;let O=gv(T,v),M=N.createHref(T);try{f.pushState(O,"",M)}catch(E){if(E instanceof DOMException&&E.name==="DataCloneError")throw E;c.location.assign(M)}d&&g&&g({action:m,location:N.location,delta:1})}function S(R,A){m=el.Replace;let T=Km(N.location,R,A);v=x();let O=gv(T,v),M=N.createHref(T);f.replaceState(O,"",M),d&&g&&g({action:m,location:N.location,delta:0})}function j(R){let A=c.location.origin!=="null"?c.location.origin:c.location.href,T=typeof R=="string"?R:J2(R);return T=T.replace(/ $/,"%20"),Et(A,"No window.location.(origin|href) available to create URL for href: "+T),new URL(T,A)}let N={get action(){return m},get location(){return n(c,f)},listen(R){if(g)throw new Error("A history only accepts one active listener");return c.addEventListener(mv,p),g=R,()=>{c.removeEventListener(mv,p),g=null}},createHref(R){return a(c,R)},createURL:j,encodeLocation(R){let A=j(R);return{pathname:A.pathname,search:A.search,hash:A.hash}},push:b,replace:S,go(R){return f.go(R)}};return N}var pv;(function(n){n.data="data",n.deferred="deferred",n.redirect="redirect",n.error="error"})(pv||(pv={}));function iN(n,a,l){return l===void 0&&(l="/"),oN(n,a,l)}function oN(n,a,l,i){let c=typeof a=="string"?yo(a):a,d=sy(c.pathname||"/",l);if(d==null)return null;let f=W2(n);rN(f);let m=null,g=ny(d);for(let v=0;m==null&&v<f.length;++v)m=xN(f[v],g);return m}function W2(n,a,l,i){a===void 0&&(a=[]),l===void 0&&(l=[]),i===void 0&&(i="");let c=(d,f,m)=>{let g={relativePath:m===void 0?d.path||"":m,caseSensitive:d.caseSensitive===!0,childrenIndex:f,route:d};g.relativePath.startsWith("/")&&(Et(g.relativePath.startsWith(i),'Absolute route path "'+g.relativePath+'" nested under path '+('"'+i+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),g.relativePath=g.relativePath.slice(i.length));let v=Gl([i,g.relativePath]),x=l.concat(g);d.children&&d.children.length>0&&(Et(d.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+v+'".')),W2(d.children,a,x,v)),!(d.path==null&&!d.index)&&a.push({path:v,score:gN(v,d.index),routesMeta:x})};return n.forEach((d,f)=>{var m;if(d.path===""||!((m=d.path)!=null&&m.includes("?")))c(d,f);else for(let g of ey(d.path))c(d,f,g)}),a}function ey(n){let a=n.split("/");if(a.length===0)return[];let[l,...i]=a,c=l.endsWith("?"),d=l.replace(/\?$/,"");if(i.length===0)return c?[d,""]:[d];let f=ey(i.join("/")),m=[];return m.push(...f.map(g=>g===""?d:[d,g].join("/"))),c&&m.push(...f),m.map(g=>n.startsWith("/")&&g===""?"/":g)}function rN(n){n.sort((a,l)=>a.score!==l.score?l.score-a.score:pN(a.routesMeta.map(i=>i.childrenIndex),l.routesMeta.map(i=>i.childrenIndex)))}const cN=/^:[\w-]+$/,uN=3,dN=2,hN=1,fN=10,mN=-2,xv=n=>n==="*";function gN(n,a){let l=n.split("/"),i=l.length;return l.some(xv)&&(i+=mN),a&&(i+=dN),l.filter(c=>!xv(c)).reduce((c,d)=>c+(cN.test(d)?uN:d===""?hN:fN),i)}function pN(n,a){return n.length===a.length&&n.slice(0,-1).every((i,c)=>i===a[c])?n[n.length-1]-a[a.length-1]:0}function xN(n,a,l){let{routesMeta:i}=n,c={},d="/",f=[];for(let m=0;m<i.length;++m){let g=i[m],v=m===i.length-1,x=d==="/"?a:a.slice(d.length)||"/",p=ty({path:g.relativePath,caseSensitive:g.caseSensitive,end:v},x),b=g.route;if(!p)return null;Object.assign(c,p.params),f.push({params:c,pathname:Gl([d,p.pathname]),pathnameBase:wN(Gl([d,p.pathnameBase])),route:b}),p.pathnameBase!=="/"&&(d=Gl([d,p.pathnameBase]))}return f}function ty(n,a){typeof n=="string"&&(n={path:n,caseSensitive:!1,end:!0});let[l,i]=vN(n.path,n.caseSensitive,n.end),c=a.match(l);if(!c)return null;let d=c[0],f=d.replace(/(.)\/+$/,"$1"),m=c.slice(1);return{params:i.reduce((v,x,p)=>{let{paramName:b,isOptional:S}=x;if(b==="*"){let N=m[p]||"";f=d.slice(0,d.length-N.length).replace(/(.)\/+$/,"$1")}const j=m[p];return S&&!j?v[b]=void 0:v[b]=(j||"").replace(/%2F/g,"/"),v},{}),pathname:d,pathnameBase:f,pattern:n}}function vN(n,a,l){a===void 0&&(a=!1),l===void 0&&(l=!0),Z2(n==="*"||!n.endsWith("*")||n.endsWith("/*"),'Route path "'+n+'" will be treated as if it were '+('"'+n.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+n.replace(/\*$/,"/*")+'".'));let i=[],c="^"+n.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(f,m,g)=>(i.push({paramName:m,isOptional:g!=null}),g?"/?([^\\/]+)?":"/([^\\/]+)"));return n.endsWith("*")?(i.push({paramName:"*"}),c+=n==="*"||n==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):l?c+="\\/*$":n!==""&&n!=="/"&&(c+="(?:(?=\\/|$))"),[new RegExp(c,a?void 0:"i"),i]}function ny(n){try{return n.split("/").map(a=>decodeURIComponent(a).replace(/\//g,"%2F")).join("/")}catch(a){return Z2(!1,'The URL path "'+n+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+a+").")),n}}function sy(n,a){if(a==="/")return n;if(!n.toLowerCase().startsWith(a.toLowerCase()))return null;let l=a.endsWith("/")?a.length-1:a.length,i=n.charAt(l);return i&&i!=="/"?null:n.slice(l)||"/"}function yN(n,a){a===void 0&&(a="/");let{pathname:l,search:i="",hash:c=""}=typeof n=="string"?yo(n):n,d;return l?(l=ay(l),l.startsWith("/")?d=vv(l.substring(1),"/"):d=vv(l,a)):d=a,{pathname:d,search:NN(i),hash:CN(c)}}function vv(n,a){let l=a.replace(/\/+$/,"").split("/");return n.split("/").forEach(c=>{c===".."?l.length>1&&l.pop():c!=="."&&l.push(c)}),l.length>1?l.join("/"):"/"}function Qf(n,a,l,i){return"Cannot include a '"+n+"' character in a manually specified "+("`to."+a+"` field ["+JSON.stringify(i)+"]. Please separate it out to the ")+("`to."+l+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function bN(n){return n.filter((a,l)=>l===0||a.route.path&&a.route.path.length>0)}function SN(n,a){let l=bN(n);return a?l.map((i,c)=>c===l.length-1?i.pathname:i.pathnameBase):l.map(i=>i.pathnameBase)}function jN(n,a,l,i){i===void 0&&(i=!1);let c;typeof n=="string"?c=yo(n):(c=Fr({},n),Et(!c.pathname||!c.pathname.includes("?"),Qf("?","pathname","search",c)),Et(!c.pathname||!c.pathname.includes("#"),Qf("#","pathname","hash",c)),Et(!c.search||!c.search.includes("#"),Qf("#","search","hash",c)));let d=n===""||c.pathname==="",f=d?"/":c.pathname,m;if(f==null)m=l;else{let p=a.length-1;if(!i&&f.startsWith("..")){let b=f.split("/");for(;b[0]==="..";)b.shift(),p-=1;c.pathname=b.join("/")}m=p>=0?a[p]:"/"}let g=yN(c,m),v=f&&f!=="/"&&f.endsWith("/"),x=(d||f===".")&&l.endsWith("/");return!g.pathname.endsWith("/")&&(v||x)&&(g.pathname+="/"),g}const ay=n=>n.replace(/\/\/+/g,"/"),Gl=n=>ay(n.join("/")),wN=n=>n.replace(/\/+$/,"").replace(/^\/*/,"/"),NN=n=>!n||n==="?"?"":n.startsWith("?")?n:"?"+n,CN=n=>!n||n==="#"?"":n.startsWith("#")?n:"#"+n;function MN(n){return n!=null&&typeof n.status=="number"&&typeof n.statusText=="string"&&typeof n.internal=="boolean"&&"data"in n}const ly=["post","put","patch","delete"];new Set(ly);const EN=["get",...ly];new Set(EN);/**
|
|
59
59
|
* React Router v6.30.6
|
|
60
60
|
*
|
|
61
61
|
* Copyright (c) Remix Software Inc.
|
|
@@ -64,7 +64,7 @@ Error generating stack: `+i.message+`
|
|
|
64
64
|
* LICENSE.md file in the root directory of this source tree.
|
|
65
65
|
*
|
|
66
66
|
* @license MIT
|
|
67
|
-
*/function
|
|
67
|
+
*/function Vr(){return Vr=Object.assign?Object.assign.bind():function(n){for(var a=1;a<arguments.length;a++){var l=arguments[a];for(var i in l)({}).hasOwnProperty.call(l,i)&&(n[i]=l[i])}return n},Vr.apply(null,arguments)}const Tg=C.createContext(null),RN=C.createContext(null),td=C.createContext(null),nd=C.createContext(null),Pl=C.createContext({outlet:null,matches:[],isDataRoute:!1}),iy=C.createContext(null);function Wr(){return C.useContext(nd)!=null}function sd(){return Wr()||Et(!1),C.useContext(nd).location}function TN(n){Wr()||Et(!1);let{pathname:a}=sd();return C.useMemo(()=>ty(n,ny(a)),[a,n])}function oy(n){C.useContext(td).static||C.useLayoutEffect(n)}function _g(){let{isDataRoute:n}=C.useContext(Pl);return n?GN():_N()}function _N(){Wr()||Et(!1);let n=C.useContext(Tg),{basename:a,future:l,navigator:i}=C.useContext(td),{matches:c}=C.useContext(Pl),{pathname:d}=sd(),f=JSON.stringify(SN(c,l.v7_relativeSplatPath)),m=C.useRef(!1);return oy(()=>{m.current=!0}),C.useCallback(function(v,x){if(x===void 0&&(x={}),!m.current)return;if(typeof v=="number"){i.go(v);return}let p=jN(v,JSON.parse(f),d,x.relative==="path");n==null&&a!=="/"&&(p.pathname=p.pathname==="/"?a:Gl([a,p.pathname])),(x.replace?i.replace:i.push)(p,x.state,x)},[a,i,f,d,n])}function AN(){let{matches:n}=C.useContext(Pl),a=n[n.length-1];return a?a.params:{}}function ON(n,a){return zN(n,a)}function zN(n,a,l,i){Wr()||Et(!1);let{navigator:c}=C.useContext(td),{matches:d}=C.useContext(Pl),f=d[d.length-1],m=f?f.params:{};f&&f.pathname;let g=f?f.pathnameBase:"/";f&&f.route;let v=sd(),x;if(a){var p;let R=typeof a=="string"?yo(a):a;g==="/"||(p=R.pathname)!=null&&p.startsWith(g)||Et(!1),x=R}else x=v;let b=x.pathname||"/",S=b;if(g!=="/"){let R=g.replace(/^\//,"").split("/");S="/"+b.replace(/^\//,"").split("/").slice(R.length).join("/")}let j=iN(n,{pathname:S}),N=HN(j&&j.map(R=>Object.assign({},R,{params:Object.assign({},m,R.params),pathname:Gl([g,c.encodeLocation?c.encodeLocation(R.pathname).pathname:R.pathname]),pathnameBase:R.pathnameBase==="/"?g:Gl([g,c.encodeLocation?c.encodeLocation(R.pathnameBase).pathname:R.pathnameBase])})),d,l,i);return a&&N?C.createElement(nd.Provider,{value:{location:Vr({pathname:"/",search:"",hash:"",state:null,key:"default"},x),navigationType:el.Pop}},N):N}function DN(){let n=VN(),a=MN(n)?n.status+" "+n.statusText:n instanceof Error?n.message:JSON.stringify(n),l=n instanceof Error?n.stack:null,c={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return C.createElement(C.Fragment,null,C.createElement("h2",null,"Unexpected Application Error!"),C.createElement("h3",{style:{fontStyle:"italic"}},a),l?C.createElement("pre",{style:c},l):null,null)}const kN=C.createElement(DN,null);class LN extends C.Component{constructor(a){super(a),this.state={location:a.location,revalidation:a.revalidation,error:a.error}}static getDerivedStateFromError(a){return{error:a}}static getDerivedStateFromProps(a,l){return l.location!==a.location||l.revalidation!=="idle"&&a.revalidation==="idle"?{error:a.error,location:a.location,revalidation:a.revalidation}:{error:a.error!==void 0?a.error:l.error,location:l.location,revalidation:a.revalidation||l.revalidation}}componentDidCatch(a,l){console.error("React Router caught the following error during render",a,l)}render(){return this.state.error!==void 0?C.createElement(Pl.Provider,{value:this.props.routeContext},C.createElement(iy.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function $N(n){let{routeContext:a,match:l,children:i}=n,c=C.useContext(Tg);return c&&c.static&&c.staticContext&&(l.route.errorElement||l.route.ErrorBoundary)&&(c.staticContext._deepestRenderedBoundaryId=l.route.id),C.createElement(Pl.Provider,{value:a},i)}function HN(n,a,l,i){var c;if(a===void 0&&(a=[]),l===void 0&&(l=null),i===void 0&&(i=null),n==null){var d;if(!l)return null;if(l.errors)n=l.matches;else if((d=i)!=null&&d.v7_partialHydration&&a.length===0&&!l.initialized&&l.matches.length>0)n=l.matches;else return null}let f=n,m=(c=l)==null?void 0:c.errors;if(m!=null){let x=f.findIndex(p=>p.route.id&&(m==null?void 0:m[p.route.id])!==void 0);x>=0||Et(!1),f=f.slice(0,Math.min(f.length,x+1))}let g=!1,v=-1;if(l&&i&&i.v7_partialHydration)for(let x=0;x<f.length;x++){let p=f[x];if((p.route.HydrateFallback||p.route.hydrateFallbackElement)&&(v=x),p.route.id){let{loaderData:b,errors:S}=l,j=p.route.loader&&b[p.route.id]===void 0&&(!S||S[p.route.id]===void 0);if(p.route.lazy||j){g=!0,v>=0?f=f.slice(0,v+1):f=[f[0]];break}}}return f.reduceRight((x,p,b)=>{let S,j=!1,N=null,R=null;l&&(S=m&&p.route.id?m[p.route.id]:void 0,N=p.route.errorElement||kN,g&&(v<0&&b===0?(qN("route-fallback"),j=!0,R=null):v===b&&(j=!0,R=p.route.hydrateFallbackElement||null)));let A=a.concat(f.slice(0,b+1)),T=()=>{let O;return S?O=N:j?O=R:p.route.Component?O=C.createElement(p.route.Component,null):p.route.element?O=p.route.element:O=x,C.createElement($N,{match:p,routeContext:{outlet:x,matches:A,isDataRoute:l!=null},children:O})};return l&&(p.route.ErrorBoundary||p.route.errorElement||b===0)?C.createElement(LN,{location:l.location,revalidation:l.revalidation,component:N,error:S,children:T(),routeContext:{outlet:null,matches:A,isDataRoute:!0}}):T()},null)}var ry=(function(n){return n.UseBlocker="useBlocker",n.UseRevalidator="useRevalidator",n.UseNavigateStable="useNavigate",n})(ry||{}),cy=(function(n){return n.UseBlocker="useBlocker",n.UseLoaderData="useLoaderData",n.UseActionData="useActionData",n.UseRouteError="useRouteError",n.UseNavigation="useNavigation",n.UseRouteLoaderData="useRouteLoaderData",n.UseMatches="useMatches",n.UseRevalidator="useRevalidator",n.UseNavigateStable="useNavigate",n.UseRouteId="useRouteId",n})(cy||{});function UN(n){let a=C.useContext(Tg);return a||Et(!1),a}function BN(n){let a=C.useContext(RN);return a||Et(!1),a}function FN(n){let a=C.useContext(Pl);return a||Et(!1),a}function uy(n){let a=FN(),l=a.matches[a.matches.length-1];return l.route.id||Et(!1),l.route.id}function VN(){var n;let a=C.useContext(iy),l=BN(),i=uy();return a!==void 0?a:(n=l.errors)==null?void 0:n[i]}function GN(){let{router:n}=UN(ry.UseNavigateStable),a=uy(cy.UseNavigateStable),l=C.useRef(!1);return oy(()=>{l.current=!0}),C.useCallback(function(c,d){d===void 0&&(d={}),l.current&&(typeof c=="number"?n.navigate(c):n.navigate(c,Vr({fromRouteId:a},d)))},[n,a])}const yv={};function qN(n,a,l){yv[n]||(yv[n]=!0)}function IN(n,a){n==null||n.v7_startTransition,n==null||n.v7_relativeSplatPath}function Zm(n){Et(!1)}function PN(n){let{basename:a="/",children:l=null,location:i,navigationType:c=el.Pop,navigator:d,static:f=!1,future:m}=n;Wr()&&Et(!1);let g=a.replace(/^\/*/,"/"),v=C.useMemo(()=>({basename:g,navigator:d,static:f,future:Vr({v7_relativeSplatPath:!1},m)}),[g,m,d,f]);typeof i=="string"&&(i=yo(i));let{pathname:x="/",search:p="",hash:b="",state:S=null,key:j="default"}=i,N=C.useMemo(()=>{let R=sy(x,g);return R==null?null:{location:{pathname:R,search:p,hash:b,state:S,key:j},navigationType:c}},[g,x,p,b,S,j,c]);return N==null?null:C.createElement(td.Provider,{value:v},C.createElement(nd.Provider,{children:l,value:N}))}function QN(n){let{children:a,location:l}=n;return ON(Jm(a),l)}new Promise(()=>{});function Jm(n,a){a===void 0&&(a=[]);let l=[];return C.Children.forEach(n,(i,c)=>{if(!C.isValidElement(i))return;let d=[...a,c];if(i.type===C.Fragment){l.push.apply(l,Jm(i.props.children,d));return}i.type!==Zm&&Et(!1),!i.props.index||!i.props.children||Et(!1);let f={id:i.props.id||d.join("-"),caseSensitive:i.props.caseSensitive,element:i.props.element,Component:i.props.Component,index:i.props.index,path:i.props.path,loader:i.props.loader,action:i.props.action,errorElement:i.props.errorElement,ErrorBoundary:i.props.ErrorBoundary,hasErrorBoundary:i.props.ErrorBoundary!=null||i.props.errorElement!=null,shouldRevalidate:i.props.shouldRevalidate,handle:i.props.handle,lazy:i.props.lazy};i.props.children&&(f.children=Jm(i.props.children,d)),l.push(f)}),l}/**
|
|
68
68
|
* React Router DOM v6.30.6
|
|
69
69
|
*
|
|
70
70
|
* Copyright (c) Remix Software Inc.
|
|
@@ -73,208 +73,233 @@ Error generating stack: `+i.message+`
|
|
|
73
73
|
* LICENSE.md file in the root directory of this source tree.
|
|
74
74
|
*
|
|
75
75
|
* @license MIT
|
|
76
|
-
*/function
|
|
76
|
+
*/function Wm(n){return n===void 0&&(n=""),new URLSearchParams(typeof n=="string"||Array.isArray(n)||n instanceof URLSearchParams?n:Object.keys(n).reduce((a,l)=>{let i=n[l];return a.concat(Array.isArray(i)?i.map(c=>[l,c]):[[l,i]])},[]))}function YN(n,a){let l=Wm(n);return a&&a.forEach((i,c)=>{l.has(c)||a.getAll(c).forEach(d=>{l.append(c,d)})}),l}const XN="6";try{window.__reactRouterVersion=XN}catch{}const KN="startTransition",bv=dw[KN];function ZN(n){let{basename:a,children:l,future:i,window:c}=n,d=C.useRef();d.current==null&&(d.current=sN({window:c,v5Compat:!0}));let f=d.current,[m,g]=C.useState({action:f.action,location:f.location}),{v7_startTransition:v}=i||{},x=C.useCallback(p=>{v&&bv?bv(()=>g(p)):g(p)},[g,v]);return C.useLayoutEffect(()=>f.listen(x),[f,x]),C.useEffect(()=>IN(i),[i]),C.createElement(PN,{basename:a,children:l,location:m.location,navigationType:m.action,navigator:f,future:i})}var Sv;(function(n){n.UseScrollRestoration="useScrollRestoration",n.UseSubmit="useSubmit",n.UseSubmitFetcher="useSubmitFetcher",n.UseFetcher="useFetcher",n.useViewTransitionState="useViewTransitionState"})(Sv||(Sv={}));var jv;(function(n){n.UseFetcher="useFetcher",n.UseFetchers="useFetchers",n.UseScrollRestoration="useScrollRestoration"})(jv||(jv={}));function JN(n){let a=C.useRef(Wm(n)),l=C.useRef(!1),i=sd(),c=C.useMemo(()=>YN(i.search,l.current?null:a.current),[i.search]),d=_g(),f=C.useCallback((m,g)=>{const v=Wm(typeof m=="function"?m(c):m);l.current=!0,d("?"+v,g)},[d,c]);return[c,f]}function WN(n){const a=n.replace(/^\/+/,"").replace(/\/+$/,"");return a?`/${a}`:""}const dn=typeof window>"u"?void 0:window.$isabl,Wn={apiHost:((dn==null?void 0:dn.apiHost)??"").replace(/\/$/,""),basePath:WN((dn==null?void 0:dn.basePath)??"/wgts"),theme:(dn==null?void 0:dn.theme)==="sand"?"th-sand":(dn==null?void 0:dn.theme)==="msk"?"th-msk":"th-clean",isablUiUrl:((dn==null?void 0:dn.isablUiUrl)??"/beta").replace(/\/+$/,"")};function eC(n){return`${Wn.isablUiUrl}/explorer?r=analyses:${n}`}const eg="user-token";/**
|
|
77
77
|
* @license lucide-react v0.468.0 - ISC
|
|
78
78
|
*
|
|
79
79
|
* This source code is licensed under the ISC license.
|
|
80
80
|
* See the LICENSE file in the root directory of this source tree.
|
|
81
|
-
*/const
|
|
81
|
+
*/const tC=n=>n.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),dy=(...n)=>n.filter((a,l,i)=>!!a&&a.trim()!==""&&i.indexOf(a)===l).join(" ").trim();/**
|
|
82
82
|
* @license lucide-react v0.468.0 - ISC
|
|
83
83
|
*
|
|
84
84
|
* This source code is licensed under the ISC license.
|
|
85
85
|
* See the LICENSE file in the root directory of this source tree.
|
|
86
|
-
*/var
|
|
86
|
+
*/var nC={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
|
|
87
87
|
* @license lucide-react v0.468.0 - ISC
|
|
88
88
|
*
|
|
89
89
|
* This source code is licensed under the ISC license.
|
|
90
90
|
* See the LICENSE file in the root directory of this source tree.
|
|
91
|
-
*/const
|
|
91
|
+
*/const sC=C.forwardRef(({color:n="currentColor",size:a=24,strokeWidth:l=2,absoluteStrokeWidth:i,className:c="",children:d,iconNode:f,...m},g)=>C.createElement("svg",{ref:g,...nC,width:a,height:a,stroke:n,strokeWidth:i?Number(l)*24/Number(a):l,className:dy("lucide",c),...m},[...f.map(([v,x])=>C.createElement(v,x)),...Array.isArray(d)?d:[d]]));/**
|
|
92
92
|
* @license lucide-react v0.468.0 - ISC
|
|
93
93
|
*
|
|
94
94
|
* This source code is licensed under the ISC license.
|
|
95
95
|
* See the LICENSE file in the root directory of this source tree.
|
|
96
|
-
*/const
|
|
96
|
+
*/const Oe=(n,a)=>{const l=C.forwardRef(({className:i,...c},d)=>C.createElement(sC,{ref:d,iconNode:a,className:dy(`lucide-${tC(n)}`,i),...c}));return l.displayName=`${n}`,l};/**
|
|
97
97
|
* @license lucide-react v0.468.0 - ISC
|
|
98
98
|
*
|
|
99
99
|
* This source code is licensed under the ISC license.
|
|
100
100
|
* See the LICENSE file in the root directory of this source tree.
|
|
101
|
-
*/const
|
|
101
|
+
*/const aC=Oe("Activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]);/**
|
|
102
102
|
* @license lucide-react v0.468.0 - ISC
|
|
103
103
|
*
|
|
104
104
|
* This source code is licensed under the ISC license.
|
|
105
105
|
* See the LICENSE file in the root directory of this source tree.
|
|
106
|
-
*/const
|
|
106
|
+
*/const qu=Oe("ArrowDown",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);/**
|
|
107
107
|
* @license lucide-react v0.468.0 - ISC
|
|
108
108
|
*
|
|
109
109
|
* This source code is licensed under the ISC license.
|
|
110
110
|
* See the LICENSE file in the root directory of this source tree.
|
|
111
|
-
*/const
|
|
111
|
+
*/const hy=Oe("ArrowUpRight",[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]]);/**
|
|
112
112
|
* @license lucide-react v0.468.0 - ISC
|
|
113
113
|
*
|
|
114
114
|
* This source code is licensed under the ISC license.
|
|
115
115
|
* See the LICENSE file in the root directory of this source tree.
|
|
116
|
-
*/const
|
|
116
|
+
*/const fy=Oe("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);/**
|
|
117
117
|
* @license lucide-react v0.468.0 - ISC
|
|
118
118
|
*
|
|
119
119
|
* This source code is licensed under the ISC license.
|
|
120
120
|
* See the LICENSE file in the root directory of this source tree.
|
|
121
|
-
*/const
|
|
121
|
+
*/const lC=Oe("AudioWaveform",[["path",{d:"M2 13a2 2 0 0 0 2-2V7a2 2 0 0 1 4 0v13a2 2 0 0 0 4 0V4a2 2 0 0 1 4 0v13a2 2 0 0 0 4 0v-4a2 2 0 0 1 2-2",key:"57tc96"}]]);/**
|
|
122
122
|
* @license lucide-react v0.468.0 - ISC
|
|
123
123
|
*
|
|
124
124
|
* This source code is licensed under the ISC license.
|
|
125
125
|
* See the LICENSE file in the root directory of this source tree.
|
|
126
|
-
*/const
|
|
126
|
+
*/const iC=Oe("ChartPie",[["path",{d:"M21 12c.552 0 1.005-.449.95-.998a10 10 0 0 0-8.953-8.951c-.55-.055-.998.398-.998.95v8a1 1 0 0 0 1 1z",key:"pzmjnu"}],["path",{d:"M21.21 15.89A10 10 0 1 1 8 2.83",key:"k2fpak"}]]);/**
|
|
127
127
|
* @license lucide-react v0.468.0 - ISC
|
|
128
128
|
*
|
|
129
129
|
* This source code is licensed under the ISC license.
|
|
130
130
|
* See the LICENSE file in the root directory of this source tree.
|
|
131
|
-
*/const
|
|
131
|
+
*/const my=Oe("ChartScatter",[["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}],["circle",{cx:"18.5",cy:"5.5",r:".5",fill:"currentColor",key:"lysivs"}],["circle",{cx:"11.5",cy:"11.5",r:".5",fill:"currentColor",key:"byv1b8"}],["circle",{cx:"7.5",cy:"16.5",r:".5",fill:"currentColor",key:"nkw3mc"}],["circle",{cx:"17.5",cy:"14.5",r:".5",fill:"currentColor",key:"1gjh6j"}],["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}]]);/**
|
|
132
132
|
* @license lucide-react v0.468.0 - ISC
|
|
133
133
|
*
|
|
134
134
|
* This source code is licensed under the ISC license.
|
|
135
135
|
* See the LICENSE file in the root directory of this source tree.
|
|
136
|
-
*/const
|
|
136
|
+
*/const gy=Oe("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
|
|
137
137
|
* @license lucide-react v0.468.0 - ISC
|
|
138
138
|
*
|
|
139
139
|
* This source code is licensed under the ISC license.
|
|
140
140
|
* See the LICENSE file in the root directory of this source tree.
|
|
141
|
-
*/const
|
|
141
|
+
*/const py=Oe("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
|
|
142
142
|
* @license lucide-react v0.468.0 - ISC
|
|
143
143
|
*
|
|
144
144
|
* This source code is licensed under the ISC license.
|
|
145
145
|
* See the LICENSE file in the root directory of this source tree.
|
|
146
|
-
*/const
|
|
146
|
+
*/const ad=Oe("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
|
|
147
147
|
* @license lucide-react v0.468.0 - ISC
|
|
148
148
|
*
|
|
149
149
|
* This source code is licensed under the ISC license.
|
|
150
150
|
* See the LICENSE file in the root directory of this source tree.
|
|
151
|
-
*/const
|
|
151
|
+
*/const oC=Oe("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/**
|
|
152
152
|
* @license lucide-react v0.468.0 - ISC
|
|
153
153
|
*
|
|
154
154
|
* This source code is licensed under the ISC license.
|
|
155
155
|
* See the LICENSE file in the root directory of this source tree.
|
|
156
|
-
*/const
|
|
156
|
+
*/const xy=Oe("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
|
|
157
157
|
* @license lucide-react v0.468.0 - ISC
|
|
158
158
|
*
|
|
159
159
|
* This source code is licensed under the ISC license.
|
|
160
160
|
* See the LICENSE file in the root directory of this source tree.
|
|
161
|
-
*/const
|
|
161
|
+
*/const rC=Oe("CircleDashed",[["path",{d:"M10.1 2.182a10 10 0 0 1 3.8 0",key:"5ilxe3"}],["path",{d:"M13.9 21.818a10 10 0 0 1-3.8 0",key:"11zvb9"}],["path",{d:"M17.609 3.721a10 10 0 0 1 2.69 2.7",key:"1iw5b2"}],["path",{d:"M2.182 13.9a10 10 0 0 1 0-3.8",key:"c0bmvh"}],["path",{d:"M20.279 17.609a10 10 0 0 1-2.7 2.69",key:"1ruxm7"}],["path",{d:"M21.818 10.1a10 10 0 0 1 0 3.8",key:"qkgqxc"}],["path",{d:"M3.721 6.391a10 10 0 0 1 2.7-2.69",key:"1mcia2"}],["path",{d:"M6.391 20.279a10 10 0 0 1-2.69-2.7",key:"1fvljs"}]]);/**
|
|
162
162
|
* @license lucide-react v0.468.0 - ISC
|
|
163
163
|
*
|
|
164
164
|
* This source code is licensed under the ISC license.
|
|
165
165
|
* See the LICENSE file in the root directory of this source tree.
|
|
166
|
-
*/const
|
|
166
|
+
*/const vy=Oe("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/**
|
|
167
167
|
* @license lucide-react v0.468.0 - ISC
|
|
168
168
|
*
|
|
169
169
|
* This source code is licensed under the ISC license.
|
|
170
170
|
* See the LICENSE file in the root directory of this source tree.
|
|
171
|
-
*/const
|
|
171
|
+
*/const tg=Oe("Crosshair",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"22",x2:"18",y1:"12",y2:"12",key:"l9bcsi"}],["line",{x1:"6",x2:"2",y1:"12",y2:"12",key:"13hhkx"}],["line",{x1:"12",x2:"12",y1:"6",y2:"2",key:"10w3f3"}],["line",{x1:"12",x2:"12",y1:"22",y2:"18",key:"15g9kq"}]]);/**
|
|
172
172
|
* @license lucide-react v0.468.0 - ISC
|
|
173
173
|
*
|
|
174
174
|
* This source code is licensed under the ISC license.
|
|
175
175
|
* See the LICENSE file in the root directory of this source tree.
|
|
176
|
-
*/const
|
|
176
|
+
*/const ld=Oe("Dna",[["path",{d:"m10 16 1.5 1.5",key:"11lckj"}],["path",{d:"m14 8-1.5-1.5",key:"1ohn8i"}],["path",{d:"M15 2c-1.798 1.998-2.518 3.995-2.807 5.993",key:"80uv8i"}],["path",{d:"m16.5 10.5 1 1",key:"696xn5"}],["path",{d:"m17 6-2.891-2.891",key:"xu6p2f"}],["path",{d:"M2 15c6.667-6 13.333 0 20-6",key:"1pyr53"}],["path",{d:"m20 9 .891.891",key:"3xwk7g"}],["path",{d:"M3.109 14.109 4 15",key:"q76aoh"}],["path",{d:"m6.5 12.5 1 1",key:"cs35ky"}],["path",{d:"m7 18 2.891 2.891",key:"1sisit"}],["path",{d:"M9 22c1.798-1.998 2.518-3.995 2.807-5.993",key:"q3hbxp"}]]);/**
|
|
177
177
|
* @license lucide-react v0.468.0 - ISC
|
|
178
178
|
*
|
|
179
179
|
* This source code is licensed under the ISC license.
|
|
180
180
|
* See the LICENSE file in the root directory of this source tree.
|
|
181
|
-
*/const
|
|
181
|
+
*/const yy=Oe("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);/**
|
|
182
182
|
* @license lucide-react v0.468.0 - ISC
|
|
183
183
|
*
|
|
184
184
|
* This source code is licensed under the ISC license.
|
|
185
185
|
* See the LICENSE file in the root directory of this source tree.
|
|
186
|
-
*/const
|
|
186
|
+
*/const by=Oe("FlaskConical",[["path",{d:"M14 2v6a2 2 0 0 0 .245.96l5.51 10.08A2 2 0 0 1 18 22H6a2 2 0 0 1-1.755-2.96l5.51-10.08A2 2 0 0 0 10 8V2",key:"18mbvz"}],["path",{d:"M6.453 15h11.094",key:"3shlmq"}],["path",{d:"M8.5 2h7",key:"csnxdl"}]]);/**
|
|
187
187
|
* @license lucide-react v0.468.0 - ISC
|
|
188
188
|
*
|
|
189
189
|
* This source code is licensed under the ISC license.
|
|
190
190
|
* See the LICENSE file in the root directory of this source tree.
|
|
191
|
-
*/const
|
|
191
|
+
*/const cC=Oe("FolderOpen",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]);/**
|
|
192
192
|
* @license lucide-react v0.468.0 - ISC
|
|
193
193
|
*
|
|
194
194
|
* This source code is licensed under the ISC license.
|
|
195
195
|
* See the LICENSE file in the root directory of this source tree.
|
|
196
|
-
*/const
|
|
196
|
+
*/const uC=Oe("IdCard",[["path",{d:"M16 10h2",key:"8sgtl7"}],["path",{d:"M16 14h2",key:"epxaof"}],["path",{d:"M6.17 15a3 3 0 0 1 5.66 0",key:"n6f512"}],["circle",{cx:"9",cy:"11",r:"2",key:"yxgjnd"}],["rect",{x:"2",y:"5",width:"20",height:"14",rx:"2",key:"qneu4z"}]]);/**
|
|
197
197
|
* @license lucide-react v0.468.0 - ISC
|
|
198
198
|
*
|
|
199
199
|
* This source code is licensed under the ISC license.
|
|
200
200
|
* See the LICENSE file in the root directory of this source tree.
|
|
201
|
-
*/const
|
|
201
|
+
*/const dC=Oe("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/**
|
|
202
202
|
* @license lucide-react v0.468.0 - ISC
|
|
203
203
|
*
|
|
204
204
|
* This source code is licensed under the ISC license.
|
|
205
205
|
* See the LICENSE file in the root directory of this source tree.
|
|
206
|
-
*/const
|
|
206
|
+
*/const hC=Oe("LayoutGrid",[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]]);/**
|
|
207
207
|
* @license lucide-react v0.468.0 - ISC
|
|
208
208
|
*
|
|
209
209
|
* This source code is licensed under the ISC license.
|
|
210
210
|
* See the LICENSE file in the root directory of this source tree.
|
|
211
|
-
*/const
|
|
211
|
+
*/const fC=Oe("Link2",[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]]);/**
|
|
212
212
|
* @license lucide-react v0.468.0 - ISC
|
|
213
213
|
*
|
|
214
214
|
* This source code is licensed under the ISC license.
|
|
215
215
|
* See the LICENSE file in the root directory of this source tree.
|
|
216
|
-
*/const
|
|
216
|
+
*/const mC=Oe("MapPin",[["path",{d:"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0",key:"1r0f0z"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]]);/**
|
|
217
217
|
* @license lucide-react v0.468.0 - ISC
|
|
218
218
|
*
|
|
219
219
|
* This source code is licensed under the ISC license.
|
|
220
220
|
* See the LICENSE file in the root directory of this source tree.
|
|
221
|
-
*/const
|
|
221
|
+
*/const gC=Oe("Maximize2",[["polyline",{points:"15 3 21 3 21 9",key:"mznyad"}],["polyline",{points:"9 21 3 21 3 15",key:"1avn1i"}],["line",{x1:"21",x2:"14",y1:"3",y2:"10",key:"ota7mn"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]]);/**
|
|
222
222
|
* @license lucide-react v0.468.0 - ISC
|
|
223
223
|
*
|
|
224
224
|
* This source code is licensed under the ISC license.
|
|
225
225
|
* See the LICENSE file in the root directory of this source tree.
|
|
226
|
-
*/const
|
|
226
|
+
*/const pC=Oe("Microscope",[["path",{d:"M6 18h8",key:"1borvv"}],["path",{d:"M3 22h18",key:"8prr45"}],["path",{d:"M14 22a7 7 0 1 0 0-14h-1",key:"1jwaiy"}],["path",{d:"M9 14h2",key:"197e7h"}],["path",{d:"M9 12a2 2 0 0 1-2-2V6h6v4a2 2 0 0 1-2 2Z",key:"1bmzmy"}],["path",{d:"M12 6V3a1 1 0 0 0-1-1H9a1 1 0 0 0-1 1v3",key:"1drr47"}]]);/**
|
|
227
227
|
* @license lucide-react v0.468.0 - ISC
|
|
228
228
|
*
|
|
229
229
|
* This source code is licensed under the ISC license.
|
|
230
230
|
* See the LICENSE file in the root directory of this source tree.
|
|
231
|
-
*/const
|
|
231
|
+
*/const xC=Oe("Minimize2",[["polyline",{points:"4 14 10 14 10 20",key:"11kfnr"}],["polyline",{points:"20 10 14 10 14 4",key:"rlmsce"}],["line",{x1:"14",x2:"21",y1:"10",y2:"3",key:"o5lafz"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]]);/**
|
|
232
232
|
* @license lucide-react v0.468.0 - ISC
|
|
233
233
|
*
|
|
234
234
|
* This source code is licensed under the ISC license.
|
|
235
235
|
* See the LICENSE file in the root directory of this source tree.
|
|
236
|
-
*/const
|
|
236
|
+
*/const vC=Oe("Orbit",[["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}],["circle",{cx:"19",cy:"5",r:"2",key:"mhkx31"}],["circle",{cx:"5",cy:"19",r:"2",key:"v8kfzx"}],["path",{d:"M10.4 21.9a10 10 0 0 0 9.941-15.416",key:"eohfx2"}],["path",{d:"M13.5 2.1a10 10 0 0 0-9.841 15.416",key:"19pvbm"}]]);/**
|
|
237
237
|
* @license lucide-react v0.468.0 - ISC
|
|
238
238
|
*
|
|
239
239
|
* This source code is licensed under the ISC license.
|
|
240
240
|
* See the LICENSE file in the root directory of this source tree.
|
|
241
|
-
*/const
|
|
241
|
+
*/const yC=Oe("PanelLeftClose",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m16 15-3-3 3-3",key:"14y99z"}]]);/**
|
|
242
242
|
* @license lucide-react v0.468.0 - ISC
|
|
243
243
|
*
|
|
244
244
|
* This source code is licensed under the ISC license.
|
|
245
245
|
* See the LICENSE file in the root directory of this source tree.
|
|
246
|
-
*/const
|
|
246
|
+
*/const bC=Oe("PanelLeftOpen",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m14 9 3 3-3 3",key:"8010ee"}]]);/**
|
|
247
247
|
* @license lucide-react v0.468.0 - ISC
|
|
248
248
|
*
|
|
249
249
|
* This source code is licensed under the ISC license.
|
|
250
250
|
* See the LICENSE file in the root directory of this source tree.
|
|
251
|
-
*/const
|
|
251
|
+
*/const SC=Oe("Pill",[["path",{d:"m10.5 20.5 10-10a4.95 4.95 0 1 0-7-7l-10 10a4.95 4.95 0 1 0 7 7Z",key:"wa1lgi"}],["path",{d:"m8.5 8.5 7 7",key:"rvfmvr"}]]);/**
|
|
252
252
|
* @license lucide-react v0.468.0 - ISC
|
|
253
253
|
*
|
|
254
254
|
* This source code is licensed under the ISC license.
|
|
255
255
|
* See the LICENSE file in the root directory of this source tree.
|
|
256
|
-
*/const
|
|
256
|
+
*/const Iu=Oe("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
|
|
257
257
|
* @license lucide-react v0.468.0 - ISC
|
|
258
258
|
*
|
|
259
259
|
* This source code is licensed under the ISC license.
|
|
260
260
|
* See the LICENSE file in the root directory of this source tree.
|
|
261
|
-
*/const
|
|
261
|
+
*/const jC=Oe("Shield",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]]);/**
|
|
262
262
|
* @license lucide-react v0.468.0 - ISC
|
|
263
263
|
*
|
|
264
264
|
* This source code is licensed under the ISC license.
|
|
265
265
|
* See the LICENSE file in the root directory of this source tree.
|
|
266
|
-
*/const
|
|
266
|
+
*/const wC=Oe("Shuffle",[["path",{d:"m18 14 4 4-4 4",key:"10pe0f"}],["path",{d:"m18 2 4 4-4 4",key:"pucp1d"}],["path",{d:"M2 18h1.973a4 4 0 0 0 3.3-1.7l5.454-8.6a4 4 0 0 1 3.3-1.7H22",key:"1ailkh"}],["path",{d:"M2 6h1.972a4 4 0 0 1 3.6 2.2",key:"km57vx"}],["path",{d:"M22 18h-6.041a4 4 0 0 1-3.3-1.8l-.359-.45",key:"os18l9"}]]);/**
|
|
267
267
|
* @license lucide-react v0.468.0 - ISC
|
|
268
268
|
*
|
|
269
269
|
* This source code is licensed under the ISC license.
|
|
270
270
|
* See the LICENSE file in the root directory of this source tree.
|
|
271
|
-
*/const
|
|
271
|
+
*/const NC=Oe("Stethoscope",[["path",{d:"M11 2v2",key:"1539x4"}],["path",{d:"M5 2v2",key:"1yf1q8"}],["path",{d:"M5 3H4a2 2 0 0 0-2 2v4a6 6 0 0 0 12 0V5a2 2 0 0 0-2-2h-1",key:"rb5t3r"}],["path",{d:"M8 15a6 6 0 0 0 12 0v-3",key:"x18d4x"}],["circle",{cx:"20",cy:"10",r:"2",key:"ts1r5v"}]]);/**
|
|
272
272
|
* @license lucide-react v0.468.0 - ISC
|
|
273
273
|
*
|
|
274
274
|
* This source code is licensed under the ISC license.
|
|
275
275
|
* See the LICENSE file in the root directory of this source tree.
|
|
276
|
-
*/const Z1=He("ZoomOut",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]]);function PN(n){if(n.value===null)return n.text??"";switch(n.key){case"coverage":return`${Math.round(n.value)}×`;case"tmb":return n.value<.01?n.value.toPrecision(2):n.value.toFixed(2);default:return n.value.toFixed(2)}}function XN(n){return n.status==="failed"?"Failed":n.status==="skipped"?"Not in this mode":"Not run"}const KN=new Intl.DateTimeFormat("en-GB",{day:"numeric",month:"short",year:"numeric"});function J1(n){if(!n)return"";const l=new Date(n);return Number.isNaN(l.getTime())?"":KN.format(l)}function hg(n,l){return n.startsWith(`${l}_`)?n.slice(l.length+1):n}function km(n){return n==null?"–":n.toFixed(2)}const cx={missense_variant:"Missense",stop_gained:"Nonsense",stop_lost:"Stop lost",start_lost:"Start lost",frameshift_variant:"Frameshift",inframe_deletion:"In-frame deletion",inframe_insertion:"In-frame insertion",splice_acceptor_variant:"Splice acceptor",splice_donor_variant:"Splice donor",splice_region_variant:"Splice region",synonymous_variant:"Synonymous",intron_variant:"Intronic",upstream_gene_variant:"Upstream",downstream_gene_variant:"Downstream","5_prime_UTR_variant":"5′ UTR","3_prime_UTR_variant":"3′ UTR"};function ZN(n,l){const a=(n??l??"").split("&")[0];if(!a)return"–";if(cx[a])return cx[a];const o=a.replace(/_/g," ");return o.charAt(0).toUpperCase()+o.slice(1)}function Rr(n,l){return`chr${n}:${l.toLocaleString("en-US")}`}const bn=[["1",249250621],["2",243199373],["3",198022430],["4",191154276],["5",180915260],["6",171115067],["7",159138663],["8",146364022],["9",141213431],["10",135534747],["11",135006516],["12",133851895],["13",115169878],["14",107349540],["15",102531392],["16",90354753],["17",81195210],["18",78077248],["19",59128983],["20",63025520],["21",48129895],["22",51304566],["X",155270560]],Hm=.0025,JN=bn.reduce((n,[,l])=>n+l,0),WN=1-Hm*bn.length,Gu=(()=>{const n={};let l=Hm/2;for(const[a,o]of bn){const c=o/JN*WN;n[a]=[l,l+c],l+=c+Hm}return n})(),ux=Object.fromEntries(bn);function Ru(n,l){const a=n.replace(/^chr/,""),o=Gu[a];if(!o)return null;const c=Math.min(Math.max(l,0),ux[a]);return o[0]+c/ux[a]*(o[1]-o[0])}function fx(n,l,a,o){const c=o*2*Math.PI-Math.PI/2;return[n+a*Math.cos(c),l+a*Math.sin(c)]}function Ah(n,l,a,o,c){const[d,h]=fx(n,l,a,o),[m,g]=fx(n,l,a,c),x=c-o>.5?1:0;return`M${d.toFixed(2)},${h.toFixed(2)} A${a},${a} 0 ${x} 1 ${m.toFixed(2)},${g.toFixed(2)}`}function Um(n,l="start"){let a=null;for(const d of bn){const[h,m]=d,[g,x]=Gu[h];if(n<g&&l==="end"&&a)return{chrom:a[0],pos:a[1]};if(n<=x)return{chrom:h,pos:Math.round(Math.max(0,(n-g)/(x-g))*m)};a=d}const[o,c]=bn[bn.length-1];return{chrom:o,pos:c}}function jr(n,l){const a=l>=1e6?0:l>=1e5?1:2;return`${(n/1e6).toFixed(a)} Mb`}const eC={hero:{box:220,ring:78,ringW:10,gain:93,gainW:7,amp:94,ampW:13,loss:63,lossW:7,drv:50,drvW:9},switcher:{box:48,ring:16,ringW:4.5,gain:21,gainW:3,amp:21,ampW:4.5,loss:11,lossW:3,drv:0,drvW:0},mini:{box:20,ring:7,ringW:2.6,gain:7,gainW:2.6,amp:7,ampW:2.6,loss:7,lossW:2.6,drv:0,drvW:0}},dx=.004,hx=.003;function tC(n,l,a){const o=Ru(n,l),c=Ru(n,a);return o===null||c===null?null:c-o<dx?[o,o+dx]:[o,c]}function Oh(n){return n.length<=1?n[0]??"":`${n.slice(0,-1).join(", ")} and ${n[n.length-1]}`}function nC(n,l,a){return n===1?`one ${l}`:`${n} ${a}`}function W1(n){const a=[["amp","amplification","amplifications"],["gain","gain","gains"],["loss","loss","losses"]].flatMap(([h,m,g])=>{const x=n.events.filter(b=>b.kind===h);if(x.length===0)return[];const v=[...new Set(x.map(b=>b.chrom))],y=v.length>6?[...v.slice(0,6),`${v.length-6} more`]:v,S=v.length===1?`chromosome ${v[0]}`:`chromosomes ${Oh(y)}`,j=h==="amp"&&x.length===1&&x[0].total_cn!==null?` (${Math.round(x[0].total_cn)} copies)`:"";return[`${nC(x.length,m,g)} on ${S}${j}`]}),o=a.length?Oh(a):`no copy-number changes against ${n.baseline} copies`,c=[...new Set(n.drivers.map(h=>h.gene).filter(h=>!!h))].sort(),d=c.length?`Drivers in ${Oh(c)}.`:"No drivers.";return`${o.charAt(0).toUpperCase()}${o.slice(1)}. ${d}`}function mg({fingerprint:n,size:l,title:a,subtitle:o,className:c}){const d=eC[l],h=d.box/2,m=(n==null?void 0:n.events)??[],g=(n==null?void 0:n.drivers)??[],x=n?`Genome fingerprint: ${W1(n)}`:"No copy-number data";return r.jsxs("svg",{viewBox:`0 0 ${d.box} ${d.box}`,role:l==="mini"?void 0:"img","aria-label":l==="mini"?void 0:x,"aria-hidden":l==="mini"?!0:void 0,className:c,children:[r.jsxs("g",{fill:"none",strokeLinecap:"butt",children:[Object.entries(Gu).map(([v,[y,S]])=>r.jsx("path",{className:"r-neu",strokeWidth:d.ringW,d:Ah(h,h,d.ring,y,S)},v)),m.map((v,y)=>{const S=tC(v.chrom,v.start,v.end);if(!S)return null;const j=v.kind==="loss"?d.loss:v.kind==="amp"?d.amp:d.gain,b=v.kind==="loss"?d.lossW:v.kind==="amp"?d.ampW:d.gainW;return r.jsx("path",{className:`r-${v.kind}`,strokeWidth:b,d:Ah(h,h,j,S[0],S[1])},`${v.chrom}-${v.start}-${y}`)}),d.drvW>0&&g.map((v,y)=>{const S=Ru(v.chrom,v.pos);return S===null?null:r.jsx("path",{className:"r-drv",strokeWidth:d.drvW,d:Ah(h,h,d.drv,S-hx/2,S+hx/2)},`${v.gene}-${v.pos}-${y}`)})]}),l==="hero"&&a&&r.jsxs(r.Fragment,{children:[r.jsx("text",{className:"t-ink",x:h,y:h-2,textAnchor:"middle",fontSize:"24",fontWeight:"800",children:a}),o&&r.jsx("text",{className:"t-faint",x:h,y:h+18,textAnchor:"middle",fontSize:"12",fontWeight:"600",children:o})]})]})}const sC={"DNA|WG":{label:"WGS",icon:Vu},"RNA|WT":{label:"RNA",icon:TN}};function mx({children:n}){return r.jsx("svg",{width:"17",height:"17",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:n})}function lC({sex:n}){const l=n==null?void 0:n.toUpperCase();return l==="MALE"?r.jsxs(mx,{children:[r.jsx("circle",{cx:"12",cy:"9",r:"4.5"}),r.jsx("path",{d:"M7.6 8.2c.5-2.9 2.4-4.7 4.6-4.7 2.6 0 4.4 1.7 4.4 4.3-2.2.1-4.2-.6-5.6-2.1"}),r.jsx("path",{d:"M3.5 21a8.5 7.5 0 0 1 17 0"}),r.jsx("path",{d:"m10 15.6 2 2.2 2-2.2"})]}):l==="FEMALE"?r.jsxs(mx,{children:[r.jsx("circle",{cx:"12",cy:"9.2",r:"3.4"}),r.jsx("path",{d:"M6.3 14.2C4.6 9 6.6 2.8 12 2.8s7.4 6.2 5.7 11.4"}),r.jsx("path",{d:"M5 21.2a7 6.3 0 0 1 14 0"})]}):r.jsx(IN,{size:16,"aria-hidden":!0})}const eS="wgts-patient-root";function aC(n,l){const a=n.getBoundingClientRect(),o=n.closest(".topbar"),c=o==null?void 0:o.parentElement,d=o&&c?c.getBoundingClientRect().top-o.getBoundingClientRect().top:0;return{x:a.left-l.left+a.width/2,y:a.top+d-l.top+a.height/2}}const tS=8;function zh(n,l,a,o){const c=a>=n.x?1:-1,d=Math.min(tS,Math.abs(a-n.x)/2,(l-n.y-14)/2);return[`M${n.x},${n.y+14}`,`V${l-d}`,`Q${n.x},${l} ${n.x+c*d},${l}`,`H${a-c*d}`,`Q${a},${l} ${a},${l+d}`,`V${o}`].join(" ")}function iC(n,l,a){const o=a.x>l.x?1:-1,c=Math.min(tS,Math.abs(a.x-l.x)/2,(l.top-n)/2);return[`M${l.x},${l.top}`,`V${n+c}`,`Q${l.x},${n} ${l.x+o*c},${n}`,`H${a.x-o*c}`,`Q${a.x},${n} ${a.x},${n+c}`,`V${a.top}`].join(" ")}function oC(n,l,a){const o=l.left+l.width/2,c=a.left+a.width/2,d=n-7,m=(n-25-.25*d)/.75;return`M${o},${d} C${o},${m} ${c},${m} ${c},${d}`}function rC(n,l){var o,c;const a=n.samples.find(d=>d.id===l);for(const d of(a==null?void 0:a.experiments)??[]){const h=(o=n.experiments[d])==null?void 0:o.normal,m=h?(c=n.experiments[h])==null?void 0:c.sample:void 0;if(m&&m!==l)return m}return null}function cC({data:n,sampleId:l,fingerprint:a,onSample:o}){const c=M.useRef(null),[d,h]=M.useState(null),[m,g]=M.useState(!1);M.useEffect(()=>{if(!d||m)return;const O=requestAnimationFrame(()=>g(!0));return()=>cancelAnimationFrame(O)},[d,m]);const x=new Set(n.failures.map(O=>O.sample)),v=M.useRef(l),[y,S]=M.useState(null);M.useEffect(()=>{if(v.current===l)return;const O=v.current;v.current=l,S(_=>({from:O,to:l,n:((_==null?void 0:_.n)??0)+1}))},[l]);const j=rC(n,l);M.useLayoutEffect(()=>{const O=c.current;if(!O)return;const _=()=>{const C=O.getBoundingClientRect(),E=document.getElementById(eS);if(!E)return;const R=Array.from(O.querySelectorAll("[data-sample]")).map(K=>{const k=K.getBoundingClientRect();return{id:K.dataset.sample,x:k.left-C.left+22,left:k.left-C.left,width:k.width,top:k.top-C.top,bottom:k.bottom-C.top}}),A=aC(E,C),B=Math.min(...R.map(K=>K.top));h({root:A,trunk:B-12,tabs:R})};if(_(),typeof ResizeObserver>"u")return;const D=new ResizeObserver(_);return D.observe(O),()=>D.disconnect()},[n,l]);const b=d==null?void 0:d.tabs.find(O=>O.id===l),N=j?d==null?void 0:d.tabs.find(O=>O.id===j):void 0,T=y?d==null?void 0:d.tabs.find(O=>O.id===y.from):void 0;return r.jsxs("div",{ref:c,className:"ltabs",children:[d&&r.jsxs("svg",{className:"ltabs-links","aria-hidden":!0,children:[d.tabs.map(O=>r.jsx("path",{d:zh(d.root,d.trunk,O.x,O.top)},O.id)),b&&r.jsxs(r.Fragment,{children:[r.jsx("path",{className:"ltabs-haze","data-moving":m,style:{d:`path("${zh(d.root,d.trunk,b.x,b.top)}")`}}),r.jsx("path",{className:"ltabs-on","data-moving":m,style:{d:`path("${zh(d.root,d.trunk,b.x,b.top)}")`}}),T&&y&&y.to===b.id&&r.jsx("path",{className:"ltabs-bead",pathLength:1,d:iC(d.trunk,T,b)},`bead-${y.n}`)]}),b&&N&&r.jsxs("g",{className:"ltabs-match",children:[r.jsx("path",{d:oC(d.trunk,b,N)}),r.jsx("text",{x:(b.left+b.width/2+N.left+N.width/2)/2,y:d.trunk-27,children:"matched normal"})]})]}),b&&r.jsx("span",{className:"ltabs-thumb","data-moving":m,"aria-hidden":!0,style:{width:b.width,height:b.bottom-b.top,transform:`translate(${b.left}px, ${b.top}px)`}}),r.jsx("div",{className:"ltabs-row",role:"tablist","aria-label":"Samples",children:n.samples.map(O=>{const _=O.id===l,D=a==null?void 0:a.samples.find(E=>E.sample===O.id),C=O.experiments.map(E=>({id:E,...n.experiments[E]})).filter(E=>E.technique);return r.jsxs("button",{type:"button",role:"tab","data-sample":O.id,"aria-selected":_,className:"ltab",onClick:()=>o(O.id),children:[r.jsxs("span",{className:"ltab-name",children:[O.category==="TUMOR"?r.jsx(mg,{fingerprint:D,size:"mini",className:"h-[18px] w-[18px] flex-none"}):r.jsx(X1,{size:15,"aria-hidden":!0,className:"flex-none"}),hg(O.id,n.individual.id)," ",O.category==="TUMOR"?"tumour":"normal",x.has(O.id)&&r.jsx("span",{className:"ltab-warn",title:"A module failed for this sample","aria-label":"A module failed"})]}),r.jsxs("span",{className:"ltab-exps",children:[C.length===0&&r.jsx("span",{children:"No experiments"}),C.map(E=>{const R=sC[E.technique],A=(R==null?void 0:R.icon)??Vu;return r.jsxs("span",{title:E.id,children:[r.jsx(A,{size:12,"aria-hidden":!0}),(R==null?void 0:R.label)??E.technique]},E.id)})]})]},O.id)})})]})}function uC({data:n,sampleId:l,fingerprint:a,onSample:o}){return r.jsx("div",{className:"ctabs",role:"tablist","aria-label":"Samples",children:n.samples.map(c=>{const d=a==null?void 0:a.samples.find(h=>h.sample===c.id);return r.jsxs("button",{type:"button",role:"tab","aria-selected":c.id===l,className:"ctab",onClick:()=>o(c.id),children:[c.category==="TUMOR"?r.jsx(mg,{fingerprint:d,size:"mini",className:"h-[16px] w-[16px] flex-none"}):r.jsx(X1,{size:14,"aria-hidden":!0,className:"flex-none"}),hg(c.id,n.individual.id)," ",c.category==="TUMOR"?"tumour":"normal"]},c.id)})})}function Cr(n){let l=n;const a=new Set;return{get:()=>l,set:o=>{Object.is(o,l)||(l=o,a.forEach(c=>c()))},subscribe:o=>(a.add(o),()=>a.delete(o))}}function qu(n){return M.useSyncExternalStore(n.subscribe,n.get,n.get)}const gg=Cr(!1),Ar=()=>gg.set(!0),yu=()=>gg.set(!1),fC=Cr(!0);function nS({individualId:n,subtitle:l,patientIcon:a,report:o,compact:c,headerInView:d=fC}){const h=!qu(d),[m,g]=M.useState(!1),[x,v]=M.useState(!1);M.useEffect(()=>{const S=()=>v(window.scrollY>4);return S(),window.addEventListener("scroll",S,{passive:!0}),()=>window.removeEventListener("scroll",S)},[]);async function y(){try{await navigator.clipboard.writeText(window.location.href),g(!0),window.setTimeout(()=>g(!1),1600)}catch{window.prompt("Copy this link",window.location.href)}}return r.jsxs("div",{className:"topbar flex flex-wrap items-center justify-between gap-x-4 gap-y-3 px-8 pt-3 pb-2","data-scrolled":x,children:[r.jsxs("nav",{"aria-label":"Breadcrumb",className:"flex min-w-0 items-center gap-2 text-[13.5px]",children:[r.jsx("button",{type:"button",className:"crumb",onClick:Ar,title:"Browse projects and patients",children:"Patients"}),n&&r.jsxs(r.Fragment,{children:[r.jsx(dg,{size:14,"aria-hidden":!0,style:{color:"var(--chev)"}}),a&&r.jsx("span",{id:eS,className:"ltabs-icon",children:a}),r.jsx("h1",{className:"m-0 text-[20px] font-semibold tracking-tight",style:{color:"var(--ink)"},children:n}),l&&r.jsx("span",{className:"ml-1.5 truncate text-[13.5px]",style:{color:"var(--muted)"},children:l})]})]}),r.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[o,r.jsx("button",{type:"button",className:"sc-ib","aria-label":"Copy a link to this view",onClick:y,children:r.jsx($N,{size:16,"aria-hidden":!0})}),r.jsx("span",{"aria-live":"polite",className:"text-xs",style:{color:"var(--muted)"},children:m?"Link copied":""})]}),c&&r.jsx("div",{className:"topbar-compact","data-open":h,inert:!h,"aria-hidden":!h,children:r.jsx("div",{children:c})})]})}function dC(){const n=fg(),[l,a]=M.useState("");return r.jsxs("div",{className:`wgts ${is.theme}`,children:[r.jsx("aside",{className:"side","aria-label":"Navigation",children:r.jsxs("div",{className:"side-brand",children:[r.jsx("span",{className:"side-badge","aria-hidden":!0,children:r.jsx(Vu,{size:17,strokeWidth:2})}),r.jsx("span",{className:"side-text side-title",children:"WGTS Reports"}),r.jsx("button",{type:"button",className:"side-search-icon","aria-label":"Browse projects and patients",title:"Browse projects and patients",onClick:Ar,children:r.jsx(_u,{size:17,"aria-hidden":!0})})]})}),r.jsxs("div",{className:"page",children:[r.jsx(nS,{}),r.jsxs("main",{className:"flex flex-col gap-4 px-8 pt-8 pb-10",children:[r.jsx("h1",{className:"m-0 text-[28px] font-semibold tracking-tight",children:"Open a patient"}),r.jsx("p",{className:"m-0 max-w-[60ch] text-[14.5px]",style:{color:"var(--ink-2)"},children:"Browse the projects that have a dashboard and pick a patient, or enter an individual's system id to see its WGTS report as live charts and tables."}),r.jsx("div",{children:r.jsxs("button",{type:"button",className:"sc-btn sc-b1 gap-2",onClick:Ar,children:[r.jsx(zN,{size:16,"aria-hidden":!0}),"Browse projects and patients"]})}),r.jsxs("form",{className:"flex flex-wrap gap-2",onSubmit:o=>{o.preventDefault(),l.trim()&&n(`/${l.trim()}`)},children:[r.jsxs("div",{className:"field w-[340px] max-w-full",children:[r.jsx(_u,{size:16,"aria-hidden":!0,style:{color:"var(--chev)"}}),r.jsx("label",{className:"sr-only",htmlFor:"open-id",children:"Individual id"}),r.jsx("input",{id:"open-id",placeholder:"IID_H000001",value:l,onChange:o=>a(o.target.value)})]}),r.jsx("button",{type:"submit",className:"sc-btn sc-b1",disabled:!l.trim(),children:"Open"})]})]})]})]})}class Iu extends Error{}class sS extends Error{}function hC(){try{return localStorage.getItem(Lm)}catch{return null}}function lS(n){try{n?localStorage.setItem(Lm,n):localStorage.removeItem(Lm)}catch{}}function aS(){const n=hC();return{Accept:"application/json",...n?{Authorization:`Token ${n}`}:{}}}async function jn(n,l={}){const a=new URLSearchParams;for(const[d,h]of Object.entries(l))h&&a.set(d,h);const o=a.toString(),c=await fetch(`${is.apiHost}/wgts/api/${n}${o?`?${o}`:""}`,{headers:aS()});if(c.status===401)throw new Iu;if(c.status===403){const d=await c.json().catch(()=>({}));throw new sS(d.detail??"You may not see this patient's results.")}if(!c.ok)throw new Error(`The dashboard API answered ${c.status}.`);return await c.json()}async function mC(n){if(!(await fetch(`${is.apiHost}/api/v1/auth/`,{headers:{Accept:"application/json",Authorization:`Token ${n}`}})).ok)throw new Error("Isabl did not accept that token.");lS(n)}async function gC(n,l){const a=await fetch(`${is.apiHost}/api/v1/rest-auth/login/`,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({username:n,password:l})});if(!a.ok)throw new Error("Isabl did not accept that username and password.");const o=await a.json();lS(o.key)}async function iS(n){const l=await fetch(`${is.apiHost}/wgts/api/${n}`,{headers:aS()});if(l.status===401)throw new Iu;if(!l.ok)throw new Error(`The dashboard API answered ${l.status}.`);return await l.json()}const pC=()=>iS("projects/"),yC=n=>iS(`projects/${n}/individuals/`);function Fm(n){const l=n.toUpperCase();return l.startsWith("BATTENBERG")||l.startsWith("CNV_")?"cn":l.startsWith("ANNOT_SNVS")||l.startsWith("ANNOT_INDELS")||l.startsWith("FFPERASE")?"mut":l.startsWith("MSISENSOR")?"msi":"other"}function ro(n){return`fam-${Fm(n)}`}function oS(n){return n.pk?`${n.app} #${n.pk}`:n.app}function Gt(n){return`${n.app}#${n.pk??""}`}const rS={drivers:"gene",coding:"position",all:"position"},vC=100;function gx(){return{scope:"drivers",sort:rS.drivers,q:"",effects:[],flags:[],range:null,ffpe:!1}}function cS(n){return(n.q.trim()?1:0)+n.effects.length+n.flags.length+(n.range?1:0)}function xC(n){const l={scope:n.scope,sort:n.sort,q:n.q.trim()||void 0,effects:n.effects.join(",")||void 0,flags:n.flags.join(",")||void 0,ffpe:n.ffpe?"all":void 0};return n.range&&(l[`${n.range.measure}_min`]=String(n.range.low),l[`${n.range.measure}_max`]=String(n.range.high)),l}const uS={missense:"Missense",truncating:"Truncating",splice:"Splice",inframe:"In-frame",synonymous:"Synonymous",other:"Other"},fS={hotspot:"Hotspot",in_dmp:"In DMP",oncogene:"Oncogene",tsg:"Tumour suppressor"};function SC(n){return`${n.chrom}:${n.pos}:${n.ref}>${n.alt}`}const dS=/^(?:chr)?([0-9]{1,2}|[XYxy]):([0-9,]+)(?:-([0-9,]+))?$/;function bC(n){return dS.test(n.trim())}function jC(n,l,a){return`chr${n}:${l.toLocaleString("en-US")}-${a.toLocaleString("en-US")}`}const wC={GENOMIC_EXACT:"exact match",GENOMIC_POS:"same position",CODON:"same codon",GENE:"same gene"};function NC(n){var d;if(!n)return null;const l=n.split(";"),a=(d=n.match(/SOM=(\d+)/))==null?void 0:d[1],o=wC[l[0]];return!a&&!o?n:[a?`${Number(a).toLocaleString("en-US")} somatic ${a==="1"?"sample":"samples"}`:"",o].filter(Boolean).join(", ")}function CC(n){const l=n==null?void 0:n.match(/^(\d+)\/(\d+)$/);return l?`${l[1]} of ${l[2]} ${l[2]==="1"?"copy":"copies"}`:n}function MC(n){return n.oncogene&&n.tsg?"Oncogene and TSG":n.oncogene?"Oncogene":n.tsg?"TSG":null}const Jt=(n,l)=>!(l instanceof Iu)&&n<2;function EC(n,l){return fn({queryKey:["individual",n,l??null],queryFn:()=>jn(`individuals/${encodeURIComponent(n)}/`,{version:l}),retry:Jt})}function TC(n,l,a){return fn({queryKey:["metrics",n,l,a??null],queryFn:()=>jn(`individuals/${encodeURIComponent(n)}/metrics/`,{sample:l,version:a}),enabled:!!l,retry:Jt})}function _C(n,l){return fn({queryKey:["fingerprint",n,l??null],queryFn:()=>jn(`individuals/${encodeURIComponent(n)}/fingerprint/`,{version:l}),retry:Jt})}const os=(n,l)=>`individuals/${encodeURIComponent(n)}/${l}/`;function RC(n,l,a){return fn({queryKey:["cn",n,l,a??null],queryFn:()=>jn(os(n,"cn"),{sample:l,version:a}),enabled:!!l,retry:Jt})}function AC(n,l,a,o,c){return fn({queryKey:["ccf",n,l,a,o,c??null],queryFn:()=>jn(os(n,"ccf"),{sample:l,measure:a,version:c,ffpe:o?"all":void 0}),enabled:!!l,retry:Jt})}function OC(n,l,a){return fn({queryKey:["signatures",n,l,a??null],queryFn:()=>jn(os(n,"signatures"),{sample:l,version:a}),enabled:!!l,retry:Jt})}function zC(n,l,a){return fn({queryKey:["context",n,l,a??null],queryFn:()=>jn(os(n,"context"),{sample:l,version:a}),enabled:!!l,retry:Jt})}function DC(n,l,a){return fn({queryKey:["fga",n,l,a??null],queryFn:()=>jn(os(n,"fga"),{sample:l,version:a}),enabled:!!l,retry:Jt})}function LC(n,l,a){return fn({queryKey:["tmb",n,l,a??null],queryFn:()=>jn(os(n,"tmb"),{sample:l,version:a}),enabled:!!l,retry:Jt})}function $C(n,l,a){return fn({queryKey:["circos",n,l,a??null],queryFn:()=>jn(os(n,"circos"),{sample:l,version:a}),enabled:!!l,retry:Jt})}function kC(n,l,a,o){return fn({queryKey:["cnsv",n,l,a,o??null],queryFn:()=>jn(os(n,"cnsv"),{sample:l,chrom:a,version:o}),enabled:!!l,placeholderData:lg,retry:Jt})}function HC(n,l,a,o){return fn({queryKey:["raw-cn",n,l,o??null],queryFn:()=>jn(os(n,"raw-cn"),{sample:l,version:o}),enabled:!!l&&a,retry:Jt})}function UC(n,l,a){return fn({queryKey:["svs",n,l,a??null],queryFn:()=>jn(os(n,"svs"),{sample:l,version:a}),enabled:!!l,retry:Jt})}function FC(n,l,a,o){return Cw({queryKey:["variants",n,l,a,o??null],queryFn:({pageParam:c})=>jn(os(n,"variants"),{sample:l,version:o,...xC(a),page:String(c),page_size:String(vC)}),initialPageParam:1,getNextPageParam:(c,d,h)=>c.status!=="ok"||!c.data?void 0:d.reduce((g,x)=>g+(x.status==="ok"&&x.data?x.data.rows.length:0),0)<c.data.total?h+1:void 0,enabled:!!l,placeholderData:lg,retry:Jt})}function VC(){return fn({queryKey:["picker","projects"],queryFn:pC,staleTime:6e4,retry:Jt})}function BC(n){return fn({queryKey:["picker","patients",n],queryFn:()=>yC(n),staleTime:6e4,placeholderData:lg,retry:Jt})}const Qi=6,GC=16,hS=7,Au=6;function Dh(n){const l=Math.min(hS,(n-Au)/2);return`M${Qi},${Au} V${n-l}`}function Lh(n){const l=Math.min(hS,(n-Au)/2);return`M${Qi},${n-l} Q${Qi},${n} ${Qi+l},${n} H${GC}`}function qC(n,l){return`M${Qi},${n} V${l}`}function IC(n,l,a,o){const[c,d]=M.useState(null),[h,m]=M.useState([]),[g,x]=M.useState(!1),[v,y]=M.useState(null),[S,j]=M.useState(280),b=n.map(R=>`${R.key}:${R.available}`).join();M.useLayoutEffect(()=>{if(!c)return;const R=()=>{const B=Array.from(c.querySelectorAll(a));m(n.flatMap((K,k)=>{const ie=B[k];if(!ie)return[];const oe=ie.offsetTop,se=ie.offsetHeight;return[{key:K.key,cy:oe+se/2,top:oe,height:se,available:K.available}]}))};if(R(),typeof ResizeObserver>"u")return;const A=new ResizeObserver(R);return A.observe(c),()=>A.disconnect()},[c,b,a,o]);const N=h.find(R=>R.key===l&&R.available),T=N?{top:N.top,height:N.height}:null;M.useEffect(()=>{if(!N||g)return;const R=requestAnimationFrame(()=>x(!0));return()=>cancelAnimationFrame(R)},[N,g]);const[O,_]=M.useState(l);M.useEffect(()=>{if(O===l)return;const R=O;_(l),R&&l&&y(A=>({from:R,to:l,n:((A==null?void 0:A.n)??0)+1}))},[l,O]);const D=v?h.find(R=>R.key===v.from):void 0,[C,E]=M.useState(null);return M.useLayoutEffect(()=>{if(N&&C!==null&&C!==N.cy){const R=Math.abs(N.cy-C)/38;j(Math.round(Math.min(620,240+80*R)))}E(N?N.cy:null)},[N==null?void 0:N.key,N==null?void 0:N.cy]),{setBox:d,tree:h,on:N,light:T,glides:g,hop:v,leaving:D,duration:S}}function QC({tree:n,on:l,light:a,glides:o,hop:c,leaving:d}){return r.jsxs(r.Fragment,{children:[n.length>0&&r.jsxs("svg",{className:"ltabs-links side-tree","aria-hidden":!0,children:[r.jsx("circle",{cx:Qi,cy:Au,r:"2.5",className:"side-root"}),r.jsx("path",{d:Dh(n[n.length-1].cy)}),n.map(h=>r.jsx("path",{d:Lh(h.cy),"data-off":h.available?void 0:"true"},h.key)),l&&r.jsxs(r.Fragment,{children:[r.jsx("path",{className:"ltabs-haze","data-moving":o,style:{d:`path("${Dh(l.cy)}")`}}),r.jsx("path",{className:"ltabs-on","data-moving":o,style:{d:`path("${Dh(l.cy)}")`}})]}),n.map(h=>r.jsxs("g",{className:"side-stub","data-active":h.key===(l==null?void 0:l.key)||void 0,children:[r.jsx("path",{className:"ltabs-haze",d:Lh(h.cy)}),r.jsx("path",{className:"ltabs-on",d:Lh(h.cy)})]},h.key)),l&&d&&c&&c.to===l.key&&r.jsx("path",{className:"ltabs-bead",pathLength:1,d:qC(d.cy,l.cy)},`bead-${c.n}`)]}),r.jsx("span",{className:"side-light","aria-hidden":!0,"data-on":a?"true":void 0,"data-glides":o||void 0,style:a?{transform:`translateY(${a.top}px)`,height:a.height}:void 0})]})}const $h=[{key:"overview",label:"Overview",icon:LN},{key:"copyNumber",label:"Copy number",icon:MN},{key:"mutations",label:"Mutations",icon:HN},{key:"structuralVariants",label:"Structural variants",icon:qN},{key:"circos",label:"Circos",icon:FN},{key:"cnsv",label:"CN/SV by chromosome",icon:I1},{key:"signatures",label:"Signatures and HRD",icon:_N},{key:"rna",label:"RNA",icon:YN,soon:!0},{key:"germline",label:"Germline",icon:GN,soon:!0},{key:"quality",label:"Quality",icon:AN,soon:!0}],px="wgts-side-collapsed";function YC(){const[n,l]=M.useState(()=>{try{return localStorage.getItem(px)==="1"}catch{return!1}});return[n,o=>{l(o);try{localStorage.setItem(px,o?"1":"0")}catch{}}]}function PC({analyses:n,onPage:l,sampleLabel:a,picked:o,onPick:c,sections:d,activeStore:h,onSection:m}){const g=qu(h),[x,v]=YC(),{setBox:y,...S}=IC($h.map(({key:A})=>({key:A,available:d.has(A)})),g,".sc-nav",x),[j,b]=M.useState(!1),[N,T]=M.useState(!1),O=["cn","mut","msi","other"],_=(A,B)=>O.indexOf(Fm(A.app))-O.indexOf(Fm(B.app))||A.app.localeCompare(B.app),D=N||o!==null;M.useEffect(()=>{const A=B=>{B.key.toLowerCase()==="k"&&(B.metaKey||B.ctrlKey)&&(B.preventDefault(),Ar())};return document.addEventListener("keydown",A),()=>document.removeEventListener("keydown",A)},[]);const C=n.filter(A=>A.role==="input"),E=C.filter(A=>l.has(Gt(A))).sort(_),R=[...C.filter(A=>!l.has(Gt(A))).sort(_),...n.filter(A=>A.role==="cohort")];return r.jsxs("aside",{className:"side","aria-label":"Patient navigation","data-collapsed":x||void 0,children:[r.jsxs("div",{className:"side-brand",children:[r.jsx("span",{className:"side-badge","aria-hidden":!0,children:r.jsx(Vu,{size:17,strokeWidth:2})}),r.jsx("span",{className:"side-text side-title",children:"WGTS Reports"}),r.jsx("button",{type:"button",className:"side-search-icon","aria-label":"Browse projects and patients",title:"Browse projects and patients (Ctrl or ⌘ K)",onClick:Ar,children:r.jsx(_u,{size:17,"aria-hidden":!0})}),r.jsx("button",{type:"button",className:"side-toggle","aria-label":x?"Expand the menu":"Collapse the menu","aria-expanded":!x,title:x?"Expand the menu":"Collapse the menu",onClick:()=>v(!x),children:x?r.jsx(BN,{size:17,"aria-hidden":!0}):r.jsx(VN,{size:17,"aria-hidden":!0})})]}),r.jsxs("nav",{ref:y,"aria-label":"Patient sections",className:"side-nav",style:{"--duration":`${S.duration}ms`},children:[r.jsx(QC,{...S}),$h.map(({key:A,label:B,icon:K,soon:k},ie)=>{const oe=d.has(A);return r.jsxs("div",{className:"contents",children:[k&&!$h[ie-1].soon&&r.jsx("span",{className:"side-group",children:"Coming soon"}),r.jsxs("button",{type:"button",className:"sc-nav","aria-current":oe&&g===A?"location":void 0,"aria-label":B,disabled:!oe,title:x?B:oe?void 0:"Not available for this sample yet",onClick:()=>m(A),children:[r.jsx(K,{size:17,strokeWidth:1.7,"aria-hidden":!0}),r.jsx("span",{className:"side-text",children:B})]})]},A)})]}),r.jsx("div",{className:"flex-auto"}),r.jsxs("section",{"aria-label":"Analyses on this page",className:"side-sources",children:[r.jsxs("button",{type:"button",className:"side-fold","aria-expanded":D,onClick:()=>T(A=>!A),children:["Analyses on this page",r.jsx("span",{className:"side-count",children:E.length}),r.jsx(Y1,{size:14,"aria-hidden":!0,"data-open":D})]}),D&&E.length===0&&r.jsxs("span",{className:"px-3 text-xs",style:{color:"var(--menu-muted)"},children:["Nothing on this page reads an analysis for ",a||"this sample","."]}),D&&E.map(A=>{const B=Gt(A),K=A.state==="failed",k=A.modules.filter(ie=>ie.status==="failed");return r.jsxs("button",{type:"button",className:`tb-src${K?" fail":""}`,"aria-pressed":o===B,title:K?k.map(ie=>`${ie.label} failed`).join("; "):"Show what it feeds",onClick:()=>c(o===B?null:B),children:[K?r.jsx(K1,{size:12,strokeWidth:2.6,"aria-hidden":!0,style:{color:"var(--fail-d)",margin:"0 -2px"}}):r.jsx("span",{className:`tb-dot ${ro(A.app)}`,"aria-hidden":!0}),r.jsxs("span",{className:"truncate",children:[A.app," ",A.version??""]}),K&&r.jsx("span",{className:"sr-only",children:", failed"}),r.jsx("span",{className:"tb-n",children:A.pk?`#${A.pk}`:""})]},B)}),D&&R.length>0&&r.jsxs(r.Fragment,{children:[r.jsxs("button",{type:"button",className:"tb-src","aria-expanded":j,onClick:()=>b(A=>!A),children:[r.jsx("span",{className:"tb-dot fam-other","aria-hidden":!0}),j?"Hide":"Show"," ",R.length," more for ",a||"this sample"]}),j&&R.map(A=>r.jsxs("span",{className:"tb-src",style:{cursor:"default"},children:[r.jsx("span",{className:`tb-dot ${ro(A.app)}`,"aria-hidden":!0}),r.jsx("span",{className:"truncate",children:A.role==="cohort"?`${A.app}${A.project?`, project ${A.project}`:""}`:`${A.app} ${A.version??""}`}),r.jsx("span",{className:"tb-n",children:A.pk?`#${A.pk}`:""})]},Gt(A)))]}),D&&r.jsx("span",{className:"px-3 pt-2 text-xs leading-normal",style:{color:"var(--menu-muted)"},children:"Pick one to see what it feeds."})]})]})}function ba({envelope:n}){const l=n.status==="error",a=l?RN:ON;return r.jsxs("div",{className:"flex items-start gap-2.5 text-sm",style:{color:"var(--ink-2)"},children:[r.jsx(a,{size:18,"aria-hidden":!0,style:{color:l?"var(--warn-ink)":"var(--chev)",flex:"none"}}),r.jsxs("div",{className:"flex flex-col gap-1",children:[r.jsx("span",{className:"font-semibold",style:{color:"var(--ink)"},children:l?"This panel could not be read":"Nothing to show here"}),n.warnings.map(o=>r.jsx("span",{children:o},o))]})]})}const Vm={summary:{title:"Genome fingerprint and summary",intro:"A one-glance portrait of the selected tumour: its copy-number changes and driver mutations drawn as a ring, a sentence describing them, and the headline measurements of the sample.",sections:[{heading:"The fingerprint ring",paragraphs:["The ring is the whole genome. Chromosome 1 starts at the top and the ring runs clockwise through chromosome 22 to X, each chromosome's arc in proportion to its length (GRCh37).","Copy-number changes are called against the tumour's baseline, its ploidy rounded to whole copies. Very short changes are drawn at a minimum length so they stay visible."],terms:[["Gains (outer track, orange)","Regions with at least one copy more than the baseline."],["Amplifications (outer track, darker and thicker)","Regions with three or more copies above the baseline."],["Losses (inner track, blue)","Regions with at least one copy fewer than the baseline."],["Drivers (black ticks)","Where the tumour's likely driver mutations sit (see the Mutations card for how they are flagged)."]]},{heading:"The sentence",paragraphs:["Written from the same data as the ring: how many amplifications, gains and losses there are and on which chromosomes, and which genes carry driver mutations."]},{heading:"The measurements",paragraphs:["Each tile shows a value, a small picture of where it sits on its scale when it has a natural one, and the analysis it came from. A tile with no value says why: the analysis was not run, it failed, or it does not apply to this kind of report (tumour-only reports have no matched normal)."],terms:[["Purity","The estimated fraction of cells in the sample that are tumour cells, from 0 to 1. The ring fills to the value."],["Ploidy","The tumour's average number of copies across the genome. The scale runs from 1 to 6 copies; the tall tick marks 2, a diploid genome."],["Coverage","The median sequencing depth of the tumour across the genome, in reads (×)."],["TMB per Mb","Tumour mutational burden: somatic SNVs and indels per megabase of genome. The report computes it from the counts of the SNV and indel calls. The scale is logarithmic, 0.01 to 100."],["MSI score","The MSIsensor score: the percentage of microsatellite sites that look unstable in the tumour."],["FGA","Fraction of the genome altered: the share of the genome whose copy number differs from the baseline, from 0 to 1. It is read from the project-wide Battenberg tables."]]},{heading:"Linking back to the analyses",paragraphs:[`Every value names its analysis, with version and Isabl id. Picking an analysis in the side menu's "Analyses on this page" highlights the tiles and cards it feeds.`]}]},copyNumber:{title:"Copy number",intro:"How many copies of each part of the genome the tumour carries, segment by segment, from chromosome 1 to X.",sections:[{heading:"What is drawn",paragraphs:['Each horizontal stroke is one segment: a stretch of the genome with a constant copy number. Its height is the number of copies, from 0 up to 8; anything higher is drawn at the top and the axis reads "8+". A gain or amplification rises as a column from the baseline to its stroke, and a loss falls to it, so the changes read as a landscape. Alternating grey bands mark the chromosomes, named in a strip along the bottom.',`The line across the plot is the baseline: the tumour's ploidy rounded to whole copies (labelled, for example, "2 copies"). Segments are coloured by how they compare with it.`],terms:[["Grey","Neutral: the same number of copies as the baseline."],["Orange","Gain: at least one copy more than the baseline."],["Dark orange","Amplification: three or more copies above the baseline."],["Blue","Loss: at least one copy fewer than the baseline."]]},{heading:"Total or allele-specific",paragraphs:["Total shows all copies together. Allele-specific, when the analysis provides it, splits each segment into its major allele (the more common parental copy, dark) and minor allele (light). Where the two are equal they are drawn slightly apart so both stay visible. A minor allele of 0 means one parent's copy is lost there (loss of heterozygosity)."]},{heading:"Driver genes",paragraphs:["A label along the top names each gene with likely driver mutations, one per gene, joined by a line to a dot on the segment the gene sits on, so its copy number can be read off at once. Hover one for its protein changes and the copies there."]},{heading:"Amplified and lost genes",paragraphs:["The oncogenes the report calls amplified and the tumour suppressors it calls homozygously lost, from the copy number over each gene, in chromosome order. The row of cells shows the copy number (all eight filled means eight copies or more). When the sample has RNA, each gene also shows its expression against each expression cohort: the log2 of this sample's level over the cohort's mean, so +1 is twice the cohort's level. Point at a gene to mark it on the plot; click it to glide to its chromosome."]},{heading:"Fraction of genome altered against the cohort",paragraphs:["The tumour's FGA (the share of the genome whose copy number differs from the baseline) set against every tumour in the project's FGA table, by disease, as the report draws it: only diseases with at least five tumours, plus this tumour's own, highest median first, with some disease labels merged (OSOS and CHOS as OS, MFH as US, LIHB as HBL). Each box spans the middle half of a disease's tumours, the line in it is the median, the whiskers reach the furthest tumours within one and a half box-lengths, and each dot is one tumour. The pin is this tumour; hover a disease for its numbers and, in the tumour's own disease, where it ranks.","The cohort is the one the report compared with when it ran. It does not grow as the project does; rerun the report to compare with the cohort as it is now."]},{heading:"Reading and moving around",terms:[["Hover a segment","Its call, copies (major + minor), coordinates and, when available, log2 ratio. A readout at the foot of the plot gives the pointer's place on the genome."],["Click a segment","Lists the mutations inside it in the Mutations card."],["Click a driver","Finds that gene in the Mutations card."],["Scroll up or down over the plot","Zooms around the pointer: up zooms in, down zooms out (two fingers on a trackpad, or a mouse wheel). A pinch zooms too. A scroll that starts outside the plot keeps scrolling the page, and once the whole genome is in view, scrolling down scrolls the page again."],["Scroll sideways, or drag","Pans a zoomed view (two fingers sideways on a trackpad, or Shift and a mouse wheel)."],["Arrow keys, plus and minus, 0","With the plot focused: pan, zoom in and out, and show the whole genome."],["Double-click a chromosome, or click its name","Glides to fill the view with it; the strip then counts megabases."],["The overview","The whole genome in miniature under the strip. Its window shows where the plot is: drag the window to move, its ends to resize, or click elsewhere to centre it there. The button by the title returns to the whole genome."],["Hover a mutation in the table","Marks it here, with a ring on the segment it sits on and its copy number."]]},{heading:"Tumour-only reports",paragraphs:["Without a matched normal there is no ploidy estimate, so segments come from CNVkit and are called against two copies. Allele-specific copy numbers are not available."]}]},mutations:{title:"Mutations",intro:"The tumour's somatic SNVs and indels that passed the callers' filters: how they are distributed across cancer cells, and a searchable, filterable table of every call.",sections:[{heading:"Which mutations",terms:[["Drivers","Likely drivers flagged by the report: coding mutations that match OncoKB or COSMIC driver annotations (the exact protein change, or a damaging consequence in a known cancer gene), plus known hotspots the callers missed and the report recovered from the tumour's reads."],["Coding","Mutations whose effect changes a protein, by the report's list of coding effects."],["All","Every PASS SNV and indel."]],paragraphs:["The counts beside each choice follow the search and filters, so they always say what you would see."]},{heading:"FFPE samples",paragraphs:["Formalin-fixed (FFPE) tissue damages DNA in ways that look like mutations, mostly C>T changes at low allele fractions. For an FFPE sample, FFPERASE scores each SNV and indel for how likely it is to be such an artifact, and the report counts only the calls scored at or below its threshold (quoted beside the table). Its SNV, indel and coding totals and the TMB leave the rest out.",`The report marks each call it leaves out, and the dashboard follows that mark: the Coding and All counts, the table and the curve leave those calls out, and the card's subtitle says so. Drivers are all listed, as in the report, and any the filter would remove carry an "FFPE filtered" tag. "Show filtered calls", under FFPE filter beside the table, brings the removed calls back, tagged the same way.`]},{heading:"Cancer cell fraction and variant allele fraction",paragraphs:["The curve across the top is a smoothed histogram of every PASS mutation; driver mutations sit on it as labelled dots, and the diamond on the axis is the median. Switch between the two measures:"],terms:[["CCF",'Cancer cell fraction: the estimated share of cancer cells carrying the mutation, corrected for purity and copy number. Around 1 (the "clonal" mark) means nearly every cancer cell has it, which suggests it arose early; clearly below 1 means a subclone. Estimates can land somewhat above 1. Shown from 0 to 2.'],["VAF","Variant allele fraction: the share of sequencing reads at the position that carry the mutation, from 0 to 1. Raw, not corrected for purity or copy number. Tumour-only reports open on VAF, since CCF needs a matched normal."]]},{heading:"Filtering by the curve",paragraphs:["Drag across the curve to keep only mutations in that CCF or VAF range: the curve stays lit inside the range and fades outside it, and the range is read out at its foot. Drag the edges to resize it, or its body to move it. The range appears with the other filters and can be removed there, or by clicking the curve."]},{heading:"Coding mutations against reference cohorts",paragraphs:["At the foot of the card, the tumour's coding SNVs and indels set against reference tumours of the same disease, as the report's TMB figure draws them: Grobner and colleagues' published pan-cancer cohort, where the disease has a match there, and MSK's TMB reference project. Each cohort is a violin cut at its smallest and largest tumour; two cohorts share one violin, one on each side. The bar inside marks the middle half and the circle the median. The line across is this tumour; hover a cohort for its numbers and where the tumour ranks.","Counts are coding mutations as the report counts them (after the FFPE filter for FFPE samples), the same numbers as the Coding tab. The MSK cohort leaves out tumours far above its 99th percentile, as the report does. The cohorts are the ones the report compared with when it ran; rerun the report to compare with them as they are now."]},{heading:"The table",terms:[["Gene and position","The gene, and the mutation's chromosome and position (GRCh37)."],["Change","The protein change, with the cDNA change beneath."],["Effect","What the mutation does to the gene, from the VEP consequence (or the report's effect). Truncating effects are in bold."],["VAF and CCF bars","The value with a bar for quick comparison; the CCF bar's tick marks 1, clonal."],["Driver","Flagged as a likely driver (shown when the table is not already limited to drivers)."],["Hotspot","The exact protein change is a known recurrent cancer hotspot."],["In DMP","The same mutation was also found by the patient's clinical MSK-IMPACT (DMP) sequencing."],["FFPE filtered","FFPE samples only: the report's FFPE artifact filter leaves this call out of its counts (see FFPE samples)."]]},{heading:"Opening a row",terms:[["Variant","SNV or indel, with the reference and alternate bases."],["Reads","Reads supporting the mutation out of all reads at the position. Only hotspots the report recovered from the tumour's reads have them; the callers' tables give no single count."],["Normal VAF","The mutation's allele fraction in the matched normal; near 0 for a somatic mutation."],["Mutant copies","How many copies of that part of the genome carry the mutation, out of all copies there."],["Consequence","The full VEP consequence."],["COSMIC","How many samples in COSMIC carry it, and how closely they match (exact change, same position, codon or gene)."],["Expression","The gene's expression in the tumour's RNA, in transcripts per million, when RNA was sequenced."],["Gene role","Whether the gene is a known oncogene or tumour suppressor gene (TSG)."],["Show on copy number","Zooms the Copy number card to the mutation's chromosome and marks it."]]},{heading:"Searching and filtering",paragraphs:["Search takes a gene, a protein or cDNA change, a COSMIC term, or a locus such as chr12:25,398,284 or a range such as chr8:1-50,000,000. Press / anywhere on the page to jump to it. Each filter's count is how many rows you would get by ticking it, given everything else."],terms:[["Missense","One amino acid replaced by another."],["Truncating","Stop gained or lost, start lost, or a frameshift."],["Splice","Changes a splice site or splice region."],["In-frame","Inserts or deletes amino acids without shifting the reading frame."],["Synonymous","Changes the DNA but not the amino acid."],["Other","Everything else, such as intronic, UTR or upstream changes."]]}]},structuralVariants:{title:"Structural variants",intro:"The tumour's rearrangements as the report shows them: those with a breakpoint in an oncogene or tumour suppressor, those that take in a whole gene, and how all of them group into rearrangement signatures.",sections:[{heading:"Which rearrangements",paragraphs:["The report works from the high-confidence structural variants of ANNOT_SVS, which keeps calls made by two or more callers (SvABA, BRASS and GRIDSS) and annotates the genes they touch with AnnotSV. The count beside the title is how many of these the report counts, its rearrangements total.",`The tables keep the rearrangements whose genes include an oncogene or tumour suppressor, by the report's gene lists. It also searches the callers' raw calls for known rearrangements the high-confidence set can miss, such as CIC fusions, and adds them; a rescued event that is not a two-caller PASS says so in its callers, as in "gridss (CIC rescued)".`]},{heading:"The two tables",terms:[["Rearranged oncogenes and tumour suppressors",'One row per rearrangement and gene it hits, with the gene and breakpoint on each side. A gene near a breakpoint rather than in it is named as the report names it, such as "TERT +/- 100Kb".'],["Whole-gene rearrangements","Rearrangements that take in a whole oncogene or tumour suppressor, from start to end: a deletion of the whole gene, for example."],["Role","Whether the row's genes include an oncogene, a tumour suppressor or both, as the report colours its rows. Click a role above the tables to show only its rows."],["Left and right","Each breakpoint's gene, position (GRCh37) and where it falls in the gene, as AnnotSV writes it (intron5, exon2-exon5). Breakpoints are ordered by chromosome, then position."],["Callers and support","The callers that made the call, and the most reads any of them gives in support."],["Pileups","Supporting reads over all reads at each breakpoint in the tumour's alignments, left then right."],["Expression","For tumours with RNA: whether each gene's expression is high or low against each expression cohort (p63 is cohort project 63): at or above its 90th percentile, at or below its 10th, or neither (None). N/A means the cohort has no value for the gene."]],paragraphs:["Open a row to see both breakpoints, show them on the copy-number card, or copy their IGV loci."]},{heading:"Rearrangement signatures",paragraphs:["WGSPOST groups the tumour's rearrangements the way rearrangement signatures are described: clustered (rearrangements that sit unusually close together, as in chromothripsis) or dispersed, then by class and, except for translocations, by size from under 1 kb to over 1 Mb. Each bar is how many rearrangements fall in a group, grouped under its class; lighter bars are the clustered ones, in the shaded zone. A group with none shows a short stub on the baseline. Hover a bar for its name and its share of all rearrangements, or a class in the key to light its bars.","WGSPOST counts from its own copy of the calls, so its total can differ slightly from the report's rearrangements count."],terms:[["Deletion","A stretch of the genome lost between two breakpoints."],["Tandem duplication","A stretch copied next to itself."],["Inversion","A stretch turned around in place."],["Translocation","A join between two chromosomes."]]}]},circos:{title:"Integrated circos",intro:"The tumour's whole genome on one circle, as WGSPOST's integrated circos draws it: every SNV, indel, copy-number change and rearrangement, from the outside in, with the counts beside it.",sections:[{heading:"The rings, from the outside in",terms:[["Drivers","Genes with likely driver mutations, outside the circle, as the Mutations card flags them."],["Chromosomes","1 to 22 and X, clockwise from the top, each in proportion to its length (GRCh37). Y is left out, as in WGSPOST's figure."],["SNV rainfall","One dot per SNV the report counts, coloured by its substitution (in the pyrimidine context). Its distance from the centre is the distance to the SNV before it on the chromosome, on a log scale: the rings mark 100 bp, 10 kb and 1 Mb. Mutations far apart sit near the outside; clusters, such as kataegis, fall inwards."],["Insertions and deletions","Two thin rings of ticks: insertions, then deletions, coloured by the mechanism WGSPOST's microhomology and repeat callers assign (complex indels are grey)."],["Copy number","Gains of the major allele, darker for more copies (2 to 3, 4 to 7, 8 or more), then loss of heterozygosity, where the minor allele has no copies. From Battenberg (CNVkit for tumour-only reports)."],["Rearrangements","Links across the middle, coloured by class as in the Structural variants card: deletions, tandem duplications, inversions and translocations."]]},{heading:"Reading it",paragraphs:["Click a chromosome to open it out to a large share of the circle, with its megabases counted inside the ring; click it again to close it. Hover a dot, a tick or a link for its details, and a chromosome for its counts. Hover a bar beside the circle to light its calls on it: a substitution, an indel kind or a rearrangement class. The buttons above the circle hide and show each track.","The circle is drawn from the same calls as the rest of the report (WGSPOST builds its figure from them too), so its counts match the Mutations and Structural variants cards. The indel kinds are WGSPOST's own classification of its indels."]}]},cnsv:{title:"Copy number and rearrangements by chromosome",intro:"One chromosome at a time, the evidence behind the copy-number calls set against the rearrangements, as WGSPOST's CN/SV integration figures show it; and Battenberg's raw data for the tumour and its normal.",sections:[{heading:"The CN/SV view, from the top",terms:[["BAF","The B-allele frequency of each heterozygous SNP in the tumour, after Battenberg's phasing (its corrected phased BAF). Balanced copies sit at 0.5; a gain or a loss pulls the SNPs of a segment away from it."],["Segments","Battenberg's copy-number segments, drawn at their BAF and labelled with their allele copies and the share of cells that carry them (“2+1: 64%” means two copies of one allele and one of the other, in 64% of cells). Green when every cell carries the state; red when it is subclonal, with the second state below."],["Rearrangements","Arcs join the two ends of a rearrangement within the chromosome: deletions and tandem duplications on the upper lane, inversions on the lower, coloured by class as in the Structural variants card. An arrow marks an end whose partner is on another chromosome, labelled with that chromosome. Faint lines drop from each end to the copy number below it, where a breakpoint often meets a step."],["Copy number","BRASS's read-depth copy number, averaged in 100 kb windows as the report's figure does, over alternating whole-copy bands. The dashed line is Battenberg's total copy number for the same stretch, green or red as its segment."]]},{heading:"Battenberg raw",paragraphs:["Battenberg's input data, as its Tumor and Germline figures show it: the LogR (read depth against the normal, on a log scale) and BAF of the tumour, then of the normal, at SNP loci across the chromosome or the whole genome. Homozygous loci sit at 0 and 1 in the BAF; the normal's heterozygous SNPs gather at 0.5."]},{heading:"Reading it",paragraphs:["Pick a chromosome above the plot; chromosomes with data stand out. Scroll up or down over the plot to zoom around the pointer (up zooms in), sideways or drag to pan, double-click to zoom in, and click a rearrangement to fit it in view; the arrow keys, plus, minus and 0 work too. Hover anywhere for the segment, its state and the read depth at that point, or a rearrangement for its ends.","Points are thinned to evenly spaced SNPs, at most 10,000 per chromosome (1,500 across the genome), so the shape of the data is kept while the page stays fast. The report shows the same figures as images, so there is nothing here to compare against it number by number."]}]},signaturesHrd:{title:"Signatures and HRD",intro:"Which mutational processes left their mark on the tumour, set against tumours of the same disease, and whether it shows homologous recombination deficiency (HRD), as the report shows them.",sections:[{heading:"Mutational signatures",paragraphs:["WGSPOST fits known COSMIC substitution signatures to the tumour's somatic SNVs and estimates how many mutations each one accounts for. The left column is this tumour: each band is a signature's share of its mutations, the largest first.","The right column is the average of tumours of the same disease in the cohort (n is how many), each tumour's shares averaged and scaled to the cohort's average mutation count. A ribbon joins each signature's two bands, widening or narrowing with its share, so a signature can be followed from the tumour to its cohort; a label on the ribbon says how many percentage points the tumour leads or trails the cohort by, where the difference is at least 5. Hover a band, a ribbon or a row of the table for the numbers.","Seven signatures get colours of their own (eight when there are no more than eight); any beyond that are drawn together as Other. A tumour without a cohort to compare shows its own shares as one column."],terms:[["Signature","A pattern of substitutions, by the base change and its neighbours, that a mutational process leaves (SBS1, SBS5)."],["Aetiology","The process the report links a signature to, when it names one."]]},{heading:"96 mutational contexts",paragraphs:["Every substitution is one of six kinds (C>A, C>G, C>T, T>A, T>C, T>G, naming the pyrimidine base of the pair) and sits between two neighbouring bases, which gives 96 contexts. The top panel counts the tumour's SNVs in each, as WGSPOST's MutationalPatterns step does. The middle panel is what the fitted signatures rebuild: each signature's probabilities for the 96 contexts, weighted by its contribution above and added up. The bottom panel is the first minus the second, so a bar above the line is a context with more SNVs than the signatures explain.","Share draws each profile as percentages of its own total, which is how the report's figure compares the two; Count draws SNVs. Both profiles share one scale, and the difference its own. Click a class in the header to open it and name its sixteen contexts, written as the base before, the mutated base in colour, and the base after. Hover a column to read all three panels at once.","Cosine similarity and RSS are the report's own measures of the fit: the closer to 1 (cosine) and to 0 (RSS), the better the signatures explain the tumour. They are computed by the report from the relative profiles, as MutationalPatterns does. For an FFPE sample, switch between the run the report uses (its FFPE-filtered calls) and the unfiltered one. When the report did not include the signature matrix its fit used, only the observed profile is drawn."]},{heading:"HRD scores",paragraphs:["Two classifiers estimate whether the tumour has lost homologous recombination repair, as BRCA1 or BRCA2 loss does: HRDetect, from the substitution, indel and rearrangement patterns below, and CHORD, from its own set of mutation features. The report rates each HIGH at or above its threshold and LOW below it; the line on each gauge is the threshold."]},{heading:"HRDetect features",paragraphs:["The six features HRDetect weighs, for every tumour in the cohort and this one, each scaled from 0 (the cohort's lowest) to 1 (its highest). Each row is one feature: the pin is this tumour, the dots beneath are the cohort's samples, the shaded band is the middle half of the cohort and the line in it the median. With eight or more cohort samples a smoothed outline of how the samples are spread is drawn above the dots; with fewer it is left out, because it would suggest more than the data says. The words at the right say how many of the other cohort samples the tumour is above. Hover a row for the unscaled value. For FFPE samples the tumour's values come from its FFPE-filtered analysis."],terms:[["Del. MH","The share of deletions with microhomology at their ends, a sign of repair by end joining."],["SBS3 and SBS8","Substitution signatures 3 and 8."],["RS3 and RS5","Rearrangement signatures 3 (small tandem duplications) and 5 (deletions)."],["HRD index","Loss of heterozygosity, telomeric allelic imbalance and large-scale state transitions, combined."]]}]}},XC={summary:{BATTENBERG:"Tumour purity and ploidy, and the copy-number segments the ring's gains and losses are called from.","BATTENBERG cohort":"Project-wide Battenberg tables, which hold the FGA value and the cohort it is compared with.",CNV_UNMATCHED:"Copy-number segments of a tumour-only report (CNVkit), which the ring's gains and losses are called from.",MOSDEPTH:"The median sequencing coverage.",MSISENSOR:"The MSI score.",MSISENSOR_UNMATCHED:"The MSI score of a tumour-only report.",ANNOT_SNVS:"Somatic SNV calls: their count goes into TMB, and driver SNVs are marked on the ring.",ANNOT_INDELS:"Somatic indel calls: their count goes into TMB, and driver indels are marked on the ring.",ANNOT_SNVS_UNMATCHED:"Tumour-only SNV calls: their count goes into TMB, and driver SNVs are marked on the ring.",ANNOT_INDELS_UNMATCHED:"Tumour-only indel calls: their count goes into TMB, and driver indels are marked on the ring.",WGSPOST:"Cancer cell fractions of the mutations, read together with the driver calls marked on the ring."},copyNumber:{BATTENBERG:"Every segment drawn: total copies, major and minor allele copies, and the ploidy the baseline is rounded from.","BATTENBERG cohort":"Project-wide Battenberg tables of FGA: the tumour's own FGA, and the cohort the FGA figure compares it with, as it was when the report ran.",CNV_UNMATCHED:"The segments of a tumour-only report (CNVkit), drawn against two copies."},mutations:{ANNOT_SNVS:"The tumour's PASS somatic SNVs and their annotation: gene, protein and cDNA change, effect, VAF, read counts, normal VAF and COSMIC.","ANNOT_SNVS cohort":"The TMB reference project's coding SNVs: MSK's reference tumours for the disease, counted for the TMB figure, as they were when the report ran.","ANNOT_INDELS cohort":"The TMB reference project's coding indels, counted for the TMB figure like its SNVs.",ANNOT_INDELS:"The tumour's PASS somatic indels and their annotation, as for SNVs.",ANNOT_SNVS_UNMATCHED:"Tumour-only SNV calls and their annotation.",ANNOT_INDELS_UNMATCHED:"Tumour-only indel calls and their annotation.",WGSPOST:"Each mutation's cancer cell fraction (CCF) and how many copies carry it.",BATTENBERG:"Ploidy, which fills in the copy count where WGSPOST has none, and purity, which gives a CCF to hotspots recovered from the tumour's reads.",FFPERASE_SNVS:"FFPE samples: each SNV's artifact score. Calls scoring above the report's threshold are left out of the counts.",FFPERASE_INDELS:"FFPE samples: each indel's artifact score. Calls scoring above the report's threshold are left out of the counts."},structuralVariants:{ANNOT_SVS:"The high-confidence structural variants and their AnnotSV gene annotation: the rearrangements the report counts and the rows of its tables.",ANNOT_SVS_UNMATCHED:"Tumour-only structural variants and their annotation, kept when rare in the population.",SVABA:"Raw SvABA calls, searched for known rearrangements the high-confidence set missed (rescued events).",GRIDSS:"Raw GRIDSS calls, searched for rescued events like SvABA's.",SVABA_UNMATCHED:"Raw tumour-only SvABA calls, searched for rescued events.",GRIDSS_UNMATCHED:"Raw tumour-only GRIDSS calls, searched for rescued events.",WGSPOST:"The rearrangement-signature counts.",WGSPOST_UNMATCHED:"The rearrangement-signature counts of a tumour-only report."},circos:{ANNOT_SNVS:"The SNVs of the rainfall, with their positions and substitutions.",ANNOT_SNVS_UNMATCHED:"The tumour-only SNVs of the rainfall.",WGSPOST:"The indel classification behind the indel rings (microhomology, repeat or other), and the signature contributions beside the circle.",WGSPOST_UNMATCHED:"The indel classification of a tumour-only report.",BATTENBERG:"The copy-number rings: major and minor allele copies of each segment, and the purity and ploidy beside the circle.",CNV_UNMATCHED:"The copy number of a tumour-only report (CNVkit).",ANNOT_SVS:"The rearrangements drawn across the middle.",ANNOT_SVS_UNMATCHED:"The tumour-only rearrangements drawn across the middle."},cnsv:{BATTENBERG:"The BAF per SNP, the segments with their allele states, and the raw tumour and normal LogR and BAF.",BRASS:"The read-depth copy number in 100 kb windows.",ANNOT_SVS:"The rearrangements drawn as arcs and arrows."},signaturesHrd:{WGSPOST:"The tumour's signature contributions, its SNV counts in the 96 mutational contexts, its HRDetect and CHORD scores, and its HRDetect features.",WGSPOST_FFPE:"For an FFPE sample, the same from the FFPE-filtered calls.","WGSPOST cohort":"The cohort's signature contributions and HRDetect features, which the tumour is compared with."}};function KC(n,l){const a=l.role==="cohort"||l.app.endsWith("Project Application"),o=l.app.replace(/ Project Application$/,""),c=XC[n];return(a?c[`${o} cohort`]:c[o])??(a?"A project-wide run the report reads for comparison with the cohort.":"An analysis the report reads to build this card.")}function ZC({topic:n,lineage:l,subject:a,onClose:o}){const c=Vm[n],d=M.useId(),h=M.useRef(null),m=l.filter(C=>C.role!=="cohort"&&!C.app.endsWith("Project Application")),g=l.filter(C=>!m.includes(C)),x=M.useRef(o);x.current=o,M.useEffect(()=>{var B;const C=document.activeElement;(B=h.current)==null||B.focus();const E=document.documentElement,R=E.style.overflow;E.style.overflow="hidden";const A=K=>{K.key==="Escape"&&x.current()};return document.addEventListener("keydown",A),()=>{document.removeEventListener("keydown",A),E.style.overflow=R,C==null||C.focus()}},[]);const v=[...c.sections.map(C=>C.heading),"Sources"],y=v.map((C,E)=>`${d}-s${E}`),[S,j]=M.useState(0),b=M.useRef(null),N=M.useRef(!1),T=M.useRef(null),O=M.useRef(0);M.useEffect(()=>{const C=b.current;if(!C)return;const E=24,R=()=>{const K=C.getBoundingClientRect().top,k=Math.max(0,C.scrollHeight-C.clientHeight),ie=y.map(le=>{const $=document.getElementById(le);return $?$.getBoundingClientRect().top-K:1/0}),oe=Math.max(0,...ie.map(le=>Number.isFinite(le)?le+C.scrollTop-k-E:0)),se=E+(k>0?oe*Math.min(1,C.scrollTop/k):0);let P=0;ie.forEach((le,$)=>{le<=se&&(P=$)}),j(P)},A=()=>{if(N.current){T.current===null?(window.clearTimeout(O.current),O.current=window.setTimeout(()=>T.current=C.scrollTop,160)):Math.abs(C.scrollTop-T.current)>4&&(N.current=!1,T.current=null,R());return}R()},B=()=>{N.current&&T.current===null&&(window.clearTimeout(O.current),N.current=!1,R())};return R(),C.addEventListener("scroll",A,{passive:!0}),C.addEventListener("wheel",B,{passive:!0}),C.addEventListener("touchstart",B,{passive:!0}),()=>{window.clearTimeout(O.current),C.removeEventListener("scroll",A),C.removeEventListener("wheel",B),C.removeEventListener("touchstart",B)}},[]);const _=C=>{var R;const E=typeof matchMedia<"u"&&matchMedia("(prefers-reduced-motion: reduce)").matches;N.current=!0,T.current=null,j(C),window.clearTimeout(O.current),O.current=window.setTimeout(()=>{var A;return T.current=((A=b.current)==null?void 0:A.scrollTop)??0},160),(R=document.getElementById(y[C]))==null||R.scrollIntoView({behavior:E?"auto":"smooth",block:"start"})},D=C=>r.jsxs("li",{className:"info-source",children:[r.jsx("span",{className:`tb-dot ${ro(C.app)}`,"aria-hidden":!0}),r.jsxs("span",{className:"info-source-text",children:[C.pk?r.jsxs("a",{className:"info-source-name info-source-link",href:B1(C.pk),target:"_blank",rel:"noopener noreferrer",title:"Open this analysis in Isabl",children:[r.jsxs("span",{className:"mono",children:[C.app,C.version?` ${C.version}`:""]}),r.jsxs("span",{className:"mono info-source-pk",children:["#",C.pk]}),r.jsx(EN,{size:13,"aria-hidden":!0,className:"info-source-arrow"})]}):r.jsxs("span",{className:"info-source-name",children:[r.jsxs("span",{className:"mono",children:[C.app,C.version?` ${C.version}`:""]}),C.project?r.jsxs("span",{className:"info-source-pk",children:["project ",C.project]}):null]}),r.jsx("span",{className:"info-source-role",children:KC(n,C)})]})]},Gt(C));return cg.createPortal(r.jsx("div",{className:`info-backdrop ${is.theme}`,onMouseDown:C=>C.target===C.currentTarget&&o(),children:r.jsxs("div",{className:"info-dialog",role:"dialog","aria-modal":"true","aria-labelledby":d,children:[r.jsx("button",{ref:h,type:"button",className:"info-close","aria-label":"Close",onClick:o,children:r.jsx(Bu,{size:18,"aria-hidden":!0})}),r.jsxs("nav",{className:"info-rail","aria-label":"Contents",children:[r.jsx("span",{className:"info-kicker",children:a??"About"}),r.jsx("h2",{id:d,children:c.title}),r.jsx("ol",{children:v.map((C,E)=>r.jsx("li",{children:r.jsx("button",{type:"button","aria-current":E===S?"true":void 0,onClick:()=>_(E),children:C})},C))})]}),r.jsxs("div",{ref:b,className:"info-main",children:[r.jsx("p",{className:"info-intro",children:c.intro}),c.sections.map((C,E)=>{var R;return r.jsxs("section",{id:y[E],className:"info-section",children:[r.jsx("h3",{children:C.heading}),(R=C.paragraphs)==null?void 0:R.map(A=>r.jsx("p",{children:A},A)),C.terms&&r.jsx("dl",{children:C.terms.map(([A,B])=>r.jsxs("div",{children:[r.jsx("dt",{children:A}),r.jsx("dd",{children:B})]},A))})]},C.heading)}),r.jsxs("section",{id:y[y.length-1],className:"info-section","aria-label":"Sources",children:[r.jsx("h3",{children:"Sources"}),r.jsx("p",{children:"The analyses this card reads, with their version and Isabl id, and what each one is responsible for."}),l.length===0&&r.jsx("p",{children:"No analyses recorded for this card."}),r.jsx("ul",{className:"info-sources",children:m.map(D)}),g.length>0&&r.jsxs(r.Fragment,{children:[r.jsx("h4",{children:"Cohort runs"}),r.jsx("ul",{className:"info-sources",children:g.map(D)})]})]})]})]})}),document.body)}function yx(n){return n.split(" ").map(l=>/^[A-Z0-9]{2,}$/.test(l)?l:l.toLowerCase()).join(" ")}function mS({topic:n,lineage:l,subject:a}){const[o,c]=M.useState(!1);return r.jsxs(r.Fragment,{children:[r.jsx("button",{type:"button",className:"sc-ib sm info-trigger","aria-label":`About ${yx(Vm[n].title)}`,title:`About ${yx(Vm[n].title)}`,"aria-haspopup":"dialog",onClick:()=>c(!0),children:r.jsx(DN,{size:15,"aria-hidden":!0})}),o&&r.jsx(ZC,{topic:n,lineage:l,subject:a,onClose:()=>c(!1)})]})}function JC({lineage:n,children:l}){const[a,o]=M.useState(!1),c=n.filter(h=>h.role!=="cohort"),d=n.filter(h=>h.role==="cohort");return r.jsxs("div",{className:"sc-cf",children:[l,l&&r.jsx("span",{className:"flex-auto"}),n.length>0&&r.jsx("span",{className:"text-xs",style:{color:"var(--muted)"},children:"Sources"}),c.map(h=>h.pk?r.jsxs("a",{className:"sc-src sc-src-link",href:B1(h.pk),target:"_blank",rel:"noopener noreferrer",title:"Open this analysis in Isabl",children:[r.jsx("span",{className:`tb-dot ${ro(h.app)}`,"aria-hidden":!0}),h.app," ",h.version??""," #",h.pk]},Gt(h)):r.jsxs("span",{className:"sc-src",children:[r.jsx("span",{className:`tb-dot ${ro(h.app)}`,"aria-hidden":!0}),h.app," ",h.version??""]},Gt(h))),d.length>0&&r.jsxs("button",{type:"button",className:"sc-src",style:{border:0,cursor:"pointer"},"aria-expanded":a,onClick:()=>o(h=>!h),children:[a?"Hide":"+"," ",d.length," cohort ",d.length===1?"run":"runs"]}),a&&d.map(h=>r.jsxs("span",{className:"sc-src",children:[r.jsx("span",{className:"tb-dot fam-other","aria-hidden":!0}),h.app,h.project?`, project ${h.project}`:""," ",h.pk?`#${h.pk}`:""]},Gt(h)))]})}function Qu(...n){const l=new Map;for(const a of n.flat())a&&!l.has(Gt(a))&&l.set(Gt(a),a);return[...l.values()]}const uo=M.forwardRef(function({title:l,subtitle:a,controls:o,lineage:c,picked:d,footer:h,className:m="",info:g,expandable:x,children:v},y){const S=!!d&&c.some(N=>Gt(N)===d),[j,b]=WC();return r.jsxs(r.Fragment,{children:[j&&r.jsx("div",{className:"sc-full-backdrop","aria-hidden":!0,onClick:()=>b(!1)}),r.jsxs("section",{ref:y,className:`sc-card flex flex-col ${m}`,"data-picked":S,"data-full":j||void 0,"aria-label":l,children:[r.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-x-4 gap-y-2.5 px-5 pt-5 pb-4",children:[r.jsxs("div",{className:"flex min-w-0 flex-col gap-0.5",children:[r.jsx("h2",{className:"m-0 text-[19px] font-semibold tracking-tight",children:l}),a&&r.jsx("span",{className:"text-[13px]",style:{color:"var(--muted)"},children:a})]}),(o||g||x)&&r.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[o,x&&r.jsx("button",{type:"button",className:"sc-ib","aria-label":j?"Exit full screen":`Expand ${l.toLowerCase()} to full screen`,title:j?"Exit full screen (Esc)":"Expand to full screen","aria-pressed":j,onClick:()=>b(!j),children:j?r.jsx(UN,{size:16,"aria-hidden":!0}):r.jsx(kN,{size:16,"aria-hidden":!0})}),g&&r.jsx(mS,{topic:g,lineage:c,subject:typeof a=="string"?a:void 0})]})]}),r.jsx("div",{className:"min-w-0 flex-auto",children:v}),(c.length>0||h)&&r.jsx(JC,{lineage:c,children:h})]})]})});function WC(){const[n,l]=M.useState(!1);return M.useEffect(()=>{if(!n)return;const a=document.documentElement,o=a.style.overflow;a.style.overflow="hidden";const c=d=>{var h,m;d.key==="Escape"&&((m=(h=d.target)==null?void 0:h.closest)!=null&&m.call(h,"input, textarea, select")||document.querySelector(".info-backdrop")||l(!1))};return document.addEventListener("keydown",c),()=>{document.removeEventListener("keydown",c),a.style.overflow=o}},[n]),[n,l]}function Vl({label:n,envelope:l,loading:a,skeletonHeight:o=160,children:c}){return r.jsxs(r.Fragment,{children:[a&&!l&&r.jsx("div",{className:"px-5 py-3",children:r.jsx("div",{className:"skeleton",style:{height:o},"aria-label":`Loading ${n}`})}),l&&l.status!=="ok"&&r.jsx("div",{className:"px-5 py-4",children:r.jsx(ba,{envelope:l})}),(l==null?void 0:l.status)==="ok"&&l.data!==null&&c(l.data),(l==null?void 0:l.status)==="ok"&&l.warnings.length>0&&r.jsx("div",{className:"px-5 pb-1 text-xs",style:{color:"var(--warn-ink)"},children:l.warnings.join(" ")})]})}function eM({title:n,subtitle:l,controls:a,envelope:o,loading:c,picked:d,skeletonHeight:h=160,footer:m,className:g="",info:x,moreLineage:v,children:y}){return r.jsx(uo,{title:n,subtitle:l,controls:a,lineage:Qu(o==null?void 0:o.lineage,v),picked:d,footer:m,className:g,info:x,children:r.jsx(Vl,{label:n,envelope:o,loading:c,skeletonHeight:h,children:y})})}function tM(n,l){const[a,o]=M.useState(null),[c,d]=M.useState(!1);return M.useLayoutEffect(()=>{const h=n.current;if(!h)return;const m=()=>{const x=h.querySelector('[aria-pressed="true"]');o(x?{x:x.offsetLeft,y:x.offsetTop,width:x.offsetWidth,height:x.offsetHeight}:null)};if(m(),typeof ResizeObserver>"u")return;const g=new ResizeObserver(m);g.observe(h);for(const x of Array.from(h.children))g.observe(x);return()=>g.disconnect()},[n,l]),M.useEffect(()=>{if(a&&!c){const h=requestAnimationFrame(()=>d(!0));return()=>cancelAnimationFrame(h)}},[a,c]),{thumb:a,moving:c}}function Bl({label:n,options:l,value:a,onChange:o,className:c=""}){const d=M.useRef(null),{thumb:h,moving:m}=tM(d,a);return r.jsxs("div",{ref:d,className:`sc-track ${c}`,role:"group","aria-label":n,children:[h&&r.jsx("span",{className:"sc-thumb","data-moving":m,"aria-hidden":!0,style:{width:h.width,height:h.height,transform:`translate(${h.x}px, ${h.y}px)`}}),l.map(g=>r.jsx("button",{type:"button",className:"sc-seg","aria-pressed":g.value===a,disabled:g.disabled,title:g.title,onClick:()=>o(g.value),children:g.label},g.value))]})}function nM(n){var a;const l=[];return n.mode==="unmatched"&&l.push("Tumour only"),n.individual.germline_consent&&l.push("Germline consented"),(a=n.individual.dmp_id)!=null&&a.startsWith("P-")&&l.push("DMP linked"),l}function sM({data:n,onVersion:l}){const a=n.report,[o,c]=M.useState(!1),d=M.useRef(null);M.useEffect(()=>{if(!o)return;const m=x=>{var v;(v=d.current)!=null&&v.contains(x.target)||c(!1)},g=x=>{x.key==="Escape"&&c(!1)};return document.addEventListener("mousedown",m),document.addEventListener("keydown",g),()=>{document.removeEventListener("mousedown",m),document.removeEventListener("keydown",g)}},[o]);const h=nM(n);return r.jsxs("div",{ref:d,className:"report-menu",children:[r.jsxs("button",{type:"button",className:"sc-btn sc-b2","aria-expanded":o,"aria-haspopup":"dialog",onClick:()=>c(m=>!m),children:["Report ",a.version,r.jsx(Y1,{size:14,"aria-hidden":!0})]}),o&&r.jsxs("div",{className:"report-pop",role:"dialog","aria-label":"Report",children:[r.jsxs("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1.5",children:[r.jsx("span",{className:"text-[13px] font-medium",style:{color:"var(--muted)"},children:"Report version"}),r.jsx(Bl,{label:"Report version",value:a.version,onChange:m=>{l(m),c(!1)},options:n.versions.map(m=>({value:m.version,label:m.version}))})]}),r.jsxs("span",{className:"mono text-[11.5px]",style:{color:"var(--muted)"},children:["WGTS_REPORT ",a.analysis?`run #${a.analysis}`:"run indexed by hand",a.built?`, built ${J1(a.built)}`:""]}),h.length>0&&r.jsx("div",{className:"flex flex-wrap gap-2",children:h.map(m=>r.jsx("span",{className:"sc-chip",children:m},m))})]})]})}const Bm=["purity","ploidy","coverage","tmb","msi","fga"];function lM({value:n}){const a=2*Math.PI*13,o=Math.min(Math.max(n,0),1);return r.jsxs("svg",{viewBox:"0 0 34 34",className:"kpi-glyph h-[34px] w-[34px]","aria-hidden":!0,children:[r.jsx("circle",{cx:"17",cy:"17",r:13,fill:"none",strokeWidth:"4",className:"kpi-track"}),r.jsx("circle",{cx:"17",cy:"17",r:13,fill:"none",strokeWidth:"4",strokeLinecap:"round",className:"kpi-fill",strokeDasharray:`${o*a} ${a}`,transform:"rotate(-90 17 17)"})]})}function vx({value:n,min:l,max:a,ticks:o,reference:c}){const d=h=>4+(Math.min(Math.max(h,l),a)-l)/(a-l)*64;return r.jsxs("svg",{viewBox:"0 0 72 20",className:"kpi-glyph h-[18px] w-[60px]","aria-hidden":!0,children:[r.jsx("line",{x1:"4",x2:"68",y1:"12",y2:"12",className:"kpi-track",strokeWidth:"2",strokeLinecap:"round"}),o.map(h=>r.jsx("line",{x1:d(h),x2:d(h),y1:h===c?5:9,y2:"15",className:"kpi-tick",strokeWidth:h===c?1.5:1},h)),r.jsx("circle",{cx:d(n),cy:"12",r:"4.5",className:"kpi-dot",strokeWidth:"2"})]})}function aM({metric:n}){const l=n.value;if(l===null)return null;switch(n.key){case"purity":case"fga":return r.jsx(lM,{value:l});case"ploidy":return r.jsx(vx,{value:l,min:1,max:6,ticks:[1,2,3,4,5,6],reference:2});case"tmb":return r.jsx(vx,{value:Math.log10(Math.max(l,.01)),min:-2,max:2,ticks:[-2,-1,0,1,2]});default:return null}}const iM={purity:"Share of tumour cells, 0 to 1",fga:"Share of the genome altered, 0 to 1",ploidy:"On a scale of 1 to 6 copies; the tall tick marks 2",tmb:"On a log scale from 0.01 to 100 mutations per Mb"};function oM({metric:n,picked:l}){const a=n.value===null&&!n.text,o=!!l&&n.sources.some(c=>Gt(c)===l);return r.jsxs("div",{className:"kpi","data-picked":o,title:iM[n.key],children:[r.jsxs("span",{className:"kpi-top",children:[r.jsx("span",{className:"kpi-label",children:n.label}),r.jsx(aM,{metric:n})]}),r.jsx("span",{className:"kpi-value","data-empty":a,children:a?XN(n):PN(n)}),n.sources.length>0?r.jsx("span",{className:"flex flex-col gap-0.5",children:n.sources.map(c=>r.jsxs("span",{className:"kpi-src",children:[r.jsx("span",{className:`tb-dot ${ro(c.app)}`,"aria-hidden":!0}),r.jsx("span",{className:"min-w-0",children:oS(c)})]},Gt(c)))}):r.jsx("span",{className:"kpi-src",children:n.etl?`from ${n.etl}`:"no source"})]})}function rM({sampleLabel:n,fingerprint:l,metrics:a,picked:o,lineage:c=[]}){var h;const d=(((h=a==null?void 0:a.data)==null?void 0:h.metrics)??[]).filter(m=>Bm.includes(m.key));return r.jsxs("section",{className:"sc-card relative flex flex-wrap items-center gap-x-8 gap-y-5 px-6 py-5","aria-label":`Genome fingerprint and summary of ${n}`,children:[r.jsx("span",{className:"absolute top-3 right-3",children:r.jsx(mS,{topic:"summary",lineage:c,subject:n})}),r.jsx(mg,{fingerprint:l,size:"hero",title:n.split(" ")[0],subtitle:"tumour",className:"h-[210px] w-[210px] max-w-full flex-none"}),r.jsxs("div",{className:"flex min-w-0 flex-[1_1_230px] flex-col gap-3",children:[r.jsxs("h2",{className:"m-0 text-lg font-semibold tracking-tight",children:["Genome fingerprint of ",n]}),r.jsx("p",{className:"m-0 max-w-[46ch] text-[14.5px] leading-relaxed",style:{color:"var(--ink-2)"},children:l?W1(l):"No copy-number data for this sample."}),r.jsxs("div",{className:"flex flex-wrap gap-x-4 gap-y-1.5 text-[12.5px]",style:{color:"var(--ink-2)"},children:[r.jsxs("span",{className:"flex items-center gap-1.5",children:[r.jsx("span",{className:"h-[5px] w-3.5 rounded-[3px]",style:{background:"var(--gain)"}}),"Gains, outer track"]}),r.jsxs("span",{className:"flex items-center gap-1.5",children:[r.jsx("span",{className:"h-[5px] w-3.5 rounded-[3px]",style:{background:"var(--loss)"}}),"Losses, inner track"]}),r.jsxs("span",{className:"flex items-center gap-1.5",children:[r.jsx("span",{className:"h-3 w-[5px] rounded-sm",style:{background:"var(--ink)"}}),"Drivers"]})]}),r.jsx("span",{className:"text-[12.5px]",style:{color:"var(--muted)"},children:"Chromosome 1 starts at the top and the ring runs clockwise to X."})]}),r.jsxs("div",{className:"kpi-grid min-w-0 flex-[1.4_1_420px]",children:[a===void 0&&Bm.map(m=>r.jsx("div",{className:"kpi","aria-hidden":!0,children:r.jsx("div",{className:"skeleton h-[70px]"})},m)),a&&a.status!=="ok"&&r.jsx("div",{className:"col-span-full",children:r.jsx(ba,{envelope:a})}),d.map(m=>r.jsx(oM,{metric:m,picked:o},m.key))]})]})}function cM({sampleLabel:n,failures:l,analyses:a}){return l.length===0?null:r.jsx("div",{className:"flex flex-col gap-2.5",children:l.map(o=>{const c=a.filter(d=>d.modules.some(h=>h.etl===o.etl&&h.status==="failed"));return r.jsxs("div",{className:"sc-card flex flex-wrap items-center gap-x-4 gap-y-3 px-[18px] py-3.5",role:"status",children:[r.jsx("span",{className:"grid h-9 w-9 flex-none place-items-center rounded-[10px]",style:{background:"var(--warn-soft)",color:"var(--warn-ink)"},children:r.jsx(K1,{size:18,"aria-hidden":!0})}),r.jsxs("div",{className:"flex min-w-0 flex-[1_1_360px] flex-col gap-0.5",children:[r.jsxs("span",{className:"text-[14.5px] font-semibold",children:[o.label," failed for ",n]}),r.jsx("span",{className:"text-[13.5px]",style:{color:"var(--ink-2)"},children:o.message.split(`
|
|
277
|
-
`)[0]}),c.length>0&&r.jsxs("span",{className:"mono text-[11.5px]",style:{color:"var(--muted)"},children:["Reading ",c.map(oS).join(", ")]})]})]},`${o.etl}-${o.node}`)})})}function uM({onSignedIn:n}){const[l,a]=M.useState("password"),[o,c]=M.useState(""),[d,h]=M.useState(""),[m,g]=M.useState(""),[x,v]=M.useState(null),[y,S]=M.useState(!1),j=l==="password"?!!o&&!!d:!!m.trim();return r.jsxs("form",{className:"sc-card mx-auto mt-16 flex w-[380px] max-w-full flex-col gap-3 p-6",onSubmit:async b=>{b.preventDefault(),S(!0),v(null);try{l==="password"?await gC(o,d):await mC(m.trim()),n()}catch(N){v(N.message)}finally{S(!1)}},children:[r.jsx("h1",{className:"m-0 text-lg font-semibold",children:"Sign in to Isabl"}),r.jsx("p",{className:"m-0 text-sm",style:{color:"var(--ink-2)"},children:"The WGTS dashboard uses your Isabl account."}),l==="password"?r.jsxs(r.Fragment,{children:[r.jsxs("label",{className:"flex flex-col gap-1 text-[13px] font-semibold",htmlFor:"username",children:["Username",r.jsx("span",{className:"field",children:r.jsx("input",{id:"username",autoComplete:"username",value:o,onChange:b=>c(b.target.value)})})]}),r.jsxs("label",{className:"flex flex-col gap-1 text-[13px] font-semibold",htmlFor:"password",children:["Password",r.jsx("span",{className:"field",children:r.jsx("input",{id:"password",type:"password",autoComplete:"current-password",value:d,onChange:b=>h(b.target.value)})})]})]}):r.jsxs("label",{className:"flex flex-col gap-1 text-[13px] font-semibold",htmlFor:"token",children:["API token",r.jsx("span",{className:"field",children:r.jsx("input",{id:"token",type:"password",autoComplete:"off",spellCheck:!1,value:m,onChange:b=>g(b.target.value)})}),r.jsx("span",{className:"text-xs font-normal",style:{color:"var(--muted)"},children:"The token the Isabl CLI uses. Admins find it under Auth Token in Django admin."})]}),x&&r.jsx("p",{className:"m-0 text-sm",style:{color:"var(--warn-ink)"},role:"alert",children:x}),r.jsx("button",{type:"submit",className:"sc-btn sc-b1",disabled:y||!j,children:y?"Signing in":"Sign in"}),r.jsx("button",{type:"button",className:"self-start border-0 bg-transparent p-0 text-[13px] font-semibold",style:{color:"var(--link)",cursor:"pointer"},onClick:()=>{a(l==="password"?"token":"password"),v(null)},children:l==="password"?"Use an API token instead":"Use a username and password instead"})]})}const it=1e3,Gm=.35,fM=8,Ou=.1;function Mu(n,l){return(Ru(n,l)??0)*it}function Ns(n){const[l,a]=Gu[n.replace(/^chr/,"")];return[l*it,a*it]}function kh(n,l,a){const[o,c]=n,d=Math.min(it,Math.max(Gm,(c-o)*a)),h=Math.min(Math.max(l-(l-o)/(c-o)*d,0),it-d);return[h,h+d]}function ur(n,l){const a=n[1]-n[0],o=Math.min(Math.max(n[0]+l,0),it-a);return[o,o+a]}function dM(n,l,a){const o=Math.min(Math.max(a,0),it);return l===0?[Math.min(o,n[1]-Gm),n[1]]:[n[0],Math.max(o,n[0]+Gm)]}function hM(n,l,a){const o=(n[0]+n[1])/2+((l[0]+l[1])/2-(n[0]+n[1])/2)*a,[c,d]=[n[1]-n[0],l[1]-l[0]],h=Math.exp(Math.log(c)+(Math.log(d)-Math.log(c))*a),m=Math.min(Math.max(o-h/2,0),it-h);return[m,m+h]}function xx(n){return n[1]-n[0]<it-.5}function qm(n){for(const[l]of bn){const[a,o]=Ns(l);if(n>=a&&n<=o)return l}return null}function mM(n,l){const a=n.segments.flatMap(c=>l==="total"?[c.total_cn]:[c.major_cn,c.minor_cn]),o=Math.max(...a.map(c=>c??0));return Math.min(fM,Math.max(n.baseline+2,Math.ceil(o)))}function gM(n){const l=10**Math.floor(Math.log10(n)),a=n/l;return(a<1.5?1:a<3.5?2:a<7.5?5:10)*l}function pM(n,l,a=5){const o=bn.filter(([S])=>{const[j,b]=Ns(S);return b>n&&j<l});if(o.length!==1)return o.map(([S])=>{const[j,b]=Ns(S);return{value:(j+b)/2,label:S}});const[c,d]=o[0],[h,m]=Ns(c),g=(Math.max(n,h)-h)/(m-h)*d,x=(Math.min(l,m)-h)/(m-h)*d,v=gM(Math.max(x-g,1)/a),y=[];for(let S=Math.ceil(g/v)*v;S<=x;S+=v)y.push({value:h+S/d*(m-h),label:jr(S,v)});return y}function yM(n,l){if(n<=.5&&l>=it-.5)return null;const a=Um(n/it,"start"),o=Um(l/it,"end");if(a.chrom===o.chrom){const c=(o.pos-a.pos)/10;return`chr${a.chrom}: ${jr(a.pos,c).replace(" Mb","")}–${jr(o.pos,c)}`}return`chr${a.chrom}:${jr(a.pos,1e6)} – chr${o.chrom}:${jr(o.pos,1e6)}`}function vM(n){const{chrom:l,pos:a}=Um(Math.min(Math.max(n,0),it)/it,"start");return`chr${l} · ${(a/1e6).toFixed(1)} Mb`}const Yu=n=>n.call??"neutral",xM={neutral:"Neutral",gain:"Gain",amp:"Amplification",loss:"Loss"},gS={neutral:"var(--chev)",gain:"var(--gain)",amp:"var(--gain-strong)",loss:"var(--loss)"};function SM(n){return{call:xM[Yu(n)],copies:n.total_cn===null?"? copies":`${n.total_cn} ${n.total_cn===1?"copy":"copies"}`,alleles:n.major_cn!==null&&n.minor_cn!==null?`${n.major_cn} + ${n.minor_cn}`:"",span:`chr${n.chrom}:${n.start.toLocaleString("en-US")}–${n.end.toLocaleString("en-US")}`,log2:n.log2!==null?n.log2.toFixed(2):""}}function bM(n){const l=new Map;for(const a of n){const o=a.gene??"?",c=l.get(o)??{gene:o,x:Mu(a.chrom,a.pos),chrom:a.chrom,pos:a.pos,changes:"",list:[]};a.protein_change&&c.list.push(a.protein_change),l.set(o,c)}return[...l.values()].map(({list:a,...o})=>({...o,changes:a.join(", ")})).sort((a,o)=>a.x-o.x)}function Hh(n,l,a){const o=l.replace(/^chr/,"");return n.segments.find(c=>c.chrom===o&&c.start<=a&&a<=c.end)}function Uh(n,l){return n?l==="total"?n.total_cn:n.major_cn:null}function jM(n){const l=n.length;if(l===0)return"";const a=m=>m.toFixed(2);if(l===1)return`M${a(n[0][0])},${a(n[0][1])}`;const o=n.slice(1).map((m,g)=>m[0]-n[g][0]),c=n.slice(1).map((m,g)=>o[g]===0?0:(m[1]-n[g][1])/o[g]),d=n.map((m,g)=>g===0?c[0]:g===l-1?c[l-2]:c[g-1]*c[g]<=0?0:(c[g-1]+c[g])/2);for(let m=0;m<l-1;m++){if(c[m]===0){d[m]=0,d[m+1]=0;continue}const g=d[m]/c[m],x=d[m+1]/c[m],v=Math.hypot(g,x);v>3&&(d[m]=3*g*c[m]/v,d[m+1]=3*x*c[m]/v)}let h=`M${a(n[0][0])},${a(n[0][1])}`;for(let m=0;m<l-1;m++){const[g,x]=n[m],[v,y]=n[m+1];h+=` C${a(g+o[m]/3)},${a(x+d[m]*o[m]/3)} ${a(v-o[m]/3)},${a(y-d[m+1]*o[m]/3)} ${a(v)},${a(y)}`}return h}function zu(n,l){const a=[],o=new Array(n.length).fill(0);return[...n.keys()].sort((c,d)=>n[c].left-n[d].left).forEach(c=>{let d=a.findIndex(h=>h+l<=n[c].left);d===-1&&(d=a.push(0)-1),a[d]=n[c].left+n[c].width,o[c]=d}),o}function Pu(n,l=4){const a=Math.max(n,1)/l,o=10**Math.floor(Math.log10(a)),c=a/o,d=Math.max(1,(c<=1?1:c<=2?2:c<=5?5:10)*o),h=[];for(let m=0;m<Math.max(n,1)+d&&(h.push(m),!(m>=n&&h.length>1));m+=d);return h}const pg=n=>1-(1-n)**3;function Cs(n,l,a=500){return n.length*l*(a>=600?.6:.56)}function Zt({x:n,y:l,width:a,above:o=!1,children:c}){const d=n>a-320,h=o?Math.min(Math.max(n,110),a-110):n,m=o?"translate(-50%, calc(-100% - 6px))":`translate(${d?"calc(-100% - 14px)":"14px"}, -50%)`;return r.jsx("div",{className:"ctip",style:{left:h,top:l,transform:m},role:"presentation",children:c})}function Du(n,l,a){const o=n.clientX;let c=!1;const d=m=>{const g=m.clientX-o;Math.abs(g)>3&&(c=!0),l(g,m)},h=()=>{window.removeEventListener("pointermove",d),window.removeEventListener("pointerup",h),window.removeEventListener("pointercancel",h),a==null||a(c)};window.addEventListener("pointermove",d),window.addEventListener("pointerup",h),window.addEventListener("pointercancel",h)}const wM=.01,NM=16,CM=160;function pS(n,l){const a=S=>{const j=n.getBoundingClientRect();return[S.clientX-j.left,S.clientY-j.top]};let o="page",c=-1/0;const d=S=>{n.contains(S.target)||(o="page",c=S.timeStamp)},h=S=>{const[j,b]=a(S),N=l(),T=S.ctrlKey||S.metaKey;if(!T&&(S.timeStamp-c>CM&&(o="plot"),c=S.timeStamp,o==="page")||!N.inside(j,b))return;const O=S.deltaMode===1?NM:S.deltaMode===2?n.clientWidth:1,_=(S.deltaX||(S.shiftKey?S.deltaY:0))*O;if(!T&&_!==0&&(S.shiftKey||Math.abs(S.deltaX)>Math.abs(S.deltaY))){S.preventDefault(),N.pan(_);return}if(S.deltaY===0)return;const C=Math.max(-50,Math.min(50,S.deltaY*O));N.zoom(Math.exp(C*wM),j)||T?S.preventDefault():o="page"};let m=1,g=null;const x=S=>{const j=S,[b,N]=a(j);l().inside(b,N)&&(S.preventDefault(),m=1,g=b)},v=S=>{if(g===null)return;S.preventDefault();const j=S.scale;j>0&&j!==m&&l().zoom(m/j,g),m=j},y=S=>{g!==null&&(S.preventDefault(),g=null)};return window.addEventListener("wheel",d,{capture:!0,passive:!0}),n.addEventListener("wheel",h,{passive:!1}),n.addEventListener("gesturestart",x),n.addEventListener("gesturechange",v),n.addEventListener("gestureend",y),()=>{window.removeEventListener("wheel",d,{capture:!0}),n.removeEventListener("wheel",h),n.removeEventListener("gesturestart",x),n.removeEventListener("gesturechange",v),n.removeEventListener("gestureend",y)}}function Es(n=640){const l=M.useRef(null),[a,o]=M.useState(n);return M.useLayoutEffect(()=>{const c=l.current;if(!c)return;const d=()=>o(Math.round(c.clientWidth)||n);if(d(),typeof ResizeObserver>"u")return;const h=new ResizeObserver(d);return h.observe(c),()=>h.disconnect()},[n]),[l,a]}const Sx=36,MM=14,wr=232,bx=22,Gi=28,jx=19,EM=480,TM=M.memo(function({segments:l,spans:a,mode:o,shown:c,geo:d,hover:h,grad:m,onHover:g,onClick:x}){const v=c[1]-c[0],y=b=>d.plotL+(b-c[0])/v*d.plotW,S=b=>d.plotTop+(1-Math.min(Math.max(b,0),d.top)/d.top)*wr,j=S(d.baseline);return r.jsx("g",{children:l.map((b,N)=>{const[T,O]=a[N];if(O<c[0]-1||T>c[1]+1)return null;const _=Yu(b),D=y(T),C=Math.max(y(O)-D,_==="neutral"?2:7),E=h===N;if(o==="total"){if(b.total_cn===null)return null;const B=S(b.total_cn);return r.jsxs("g",{className:"cn-seg","data-call":_,"data-on":E||void 0,children:[_!=="neutral"&&r.jsx("rect",{x:D,y:Math.min(B,j),width:C,height:Math.abs(B-j),fill:`url(#${m[_]})`,className:"cn-col"}),r.jsx("line",{x1:D,x2:D+C,y1:B,y2:B,style:{stroke:gS[_]},className:"cn-line"}),r.jsx("rect",{x:D-2,y:Math.min(B,j)-9,width:C+4,height:Math.abs(B-j)+18,fill:"transparent",className:"cn-hit",onMouseEnter:()=>g({index:N,x:D+C/2,y:B}),onMouseLeave:()=>g(null),onClick:()=>x(b)})]},N)}if(b.major_cn===null||b.minor_cn===null)return null;const R=S(b.major_cn+Ou),A=S(b.minor_cn-Ou);return r.jsxs("g",{className:"cn-seg","data-on":E||void 0,children:[r.jsx("line",{x1:D,x2:D+C,y1:A,y2:A,className:"cn-line cn-minor"}),r.jsx("line",{x1:D,x2:D+C,y1:R,y2:R,className:"cn-line cn-major"}),r.jsx("rect",{x:D-2,y:Math.min(R,A)-9,width:C+4,height:Math.abs(R-A)+18,fill:"transparent",className:"cn-hit",onMouseEnter:()=>g({index:N,x:D+C/2,y:R}),onMouseLeave:()=>g(null),onClick:()=>x(b)})]},N)})})}),_M=M.memo(function({segments:l,spans:a,mode:o,top:c,baseline:d,plotL:h,plotW:m,y0:g}){const x=v=>g+3+(1-Math.min(v,c)/c)*(Gi-6);return r.jsxs("g",{pointerEvents:"none",children:[bn.map(([v],y)=>{const[S,j]=Ns(v);return y%2===0?r.jsx("rect",{x:h+S/it*m,y:g,width:(j-S)/it*m,height:Gi,className:"cn-mini-band"},v):null}),r.jsx("line",{x1:h,x2:h+m,y1:x(d),y2:x(d),className:"cn-mini-base"}),l.map((v,y)=>{const S=o==="total"?v.total_cn:v.major_cn;if(S===null)return null;const j=Yu(v),b=h+a[y][0]/it*m,N=Math.max((a[y][1]-a[y][0])/it*m,j==="neutral"?1:2);return r.jsx("line",{x1:b,x2:b+N,y1:x(S),y2:x(S),className:"cn-mini-line",style:{stroke:o==="total"?gS[j]:"var(--ink-2)"}},y)})]})});function RM({data:n,mode:l,drivers:a,focus:o,locate:c,view:d,onView:h,onSegment:m,onGene:g}){const[x,v]=Es(900),y=M.useRef(null),S=M.useId(),j={gain:`${S}-gain`,amp:`${S}-amp`,loss:`${S}-loss`},[b,N]=M.useState(d.window),T=M.useRef(b);T.current=b,M.useLayoutEffect(()=>{const te=d.window,ue=typeof matchMedia<"u"&&matchMedia("(prefers-reduced-motion: reduce)").matches;if(!d.smooth||ue){N(te);return}const we=T.current,Ue=performance.now();let Pe=0;const vt=pt=>{const et=Math.min(1,(pt-Ue)/EM);N(hM(we,te,pg(et))),et<1&&(Pe=requestAnimationFrame(vt))};return Pe=requestAnimationFrame(vt),()=>cancelAnimationFrame(Pe)},[d]);const[O,_]=M.useState(null),[D,C]=M.useState(null),[E,R]=M.useState(null),[A,B]=M.useState(!1),K=M.useRef(!1),k=M.useMemo(()=>mM(n,l),[n,l]),ie=M.useMemo(()=>n.segments.some(te=>Math.max(te.total_cn??0,te.major_cn??0)>k),[n,k]),oe=M.useMemo(()=>n.segments.map(te=>[Mu(te.chrom,te.start),Mu(te.chrom,te.end)]),[n]),se=M.useMemo(()=>bM(a),[a]),P=Sx,le=Math.max(v-Sx-MM,200),$=b[1]-b[0],J=te=>P+(te-b[0])/$*le,Z=te=>b[0]+(te-P)/le*$,W=te=>Cs(te,11.5,600)+14,ae=M.useMemo(()=>{const te=se.map(ue=>({left:P+ue.x/it*le-W(ue.gene)/2,width:W(ue.gene)}));return se.length?Math.max(...zu(te,4))+1:0},[se,P,le]),ve=(ae?ae*jx+8:4)+4,je=ve+wr,L=je+10,U=L+bx+12,I=U+Gi+6,re={plotL:P,plotW:le,plotTop:ve,top:k,baseline:n.baseline},ce=te=>ve+(1-Math.min(Math.max(te,0),k)/k)*wr,xe=se.map((te,ue)=>({m:te,index:ue,x:J(te.x)})).filter(({x:te})=>te>=P-4&&te<=P+le+4),Te=zu(xe.map(({m:te,x:ue})=>({left:ue-W(te.gene)/2,width:W(te.gene)})),4),me=(te,ue)=>te>=P&&te<=P+le&&ue>=ve&&ue<=je,Se=te=>{const ue=y.current.getBoundingClientRect();return[te.clientX-ue.left,te.clientY-ue.top]},ct=M.useCallback(te=>h({window:te,smooth:!1}),[h]),Ct=M.useCallback(te=>h({window:te,smooth:!0}),[h]),dn=M.useRef({shown:b,plotL:P,plotW:le,plotTop:ve,plotBottom:je,move:ct});dn.current={shown:b,plotL:P,plotW:le,plotTop:ve,plotBottom:je,move:ct},M.useEffect(()=>{const te=x.current;if(!te||!y.current)return;const ue=()=>y.current.getBoundingClientRect();return pS(te,()=>{const we=dn.current,Ue=()=>ue().left-te.getBoundingClientRect().left,Pe=()=>ue().top-te.getBoundingClientRect().top,vt=we.shown[1]-we.shown[0];return{inside:(pt,et)=>{const hn=pt-Ue(),Nn=et-Pe();return hn>=we.plotL&&hn<=we.plotL+we.plotW&&Nn>=we.plotTop&&Nn<=we.plotBottom},zoom:(pt,et)=>{const hn=kh(we.shown,we.shown[0]+(et-Ue()-we.plotL)/we.plotW*vt,pt);return Math.abs(hn[0]-we.shown[0])<1e-6&&Math.abs(hn[1]-we.shown[1])<1e-6?!1:(we.move(hn),!0)},pan:pt=>we.move(ur(we.shown,pt/we.plotW*vt))}})},[x]),M.useEffect(()=>{c&&/^(\d+|X)$/.test(c.chrom.replace(/^chr/,""))&&Ct(Ns(c.chrom))},[c,Ct]);const zt=te=>{if(te.button!==0)return;const[ue,we]=Se(te);if(!me(ue,we)||!xx(b))return;te.preventDefault();const Ue=b;B(!0),Du(te,Pe=>ct(ur(Ue,-(Pe/le)*(Ue[1]-Ue[0]))),Pe=>{B(!1),Pe&&(K.current=!0,setTimeout(()=>K.current=!1,0))})},ut=te=>{const[ue,we]=Se(te);R(me(ue,we)?ue:null)},Ge=te=>{const[ue,we]=Se(te);if(!me(ue,we))return;const Ue=qm(Z(ue));Ue&&Ct(Ns(Ue))},Wt=te=>{const ue=(b[0]+b[1])/2;if(te.key==="ArrowLeft"||te.key==="ArrowRight")te.preventDefault(),ct(ur(b,(te.key==="ArrowLeft"?-.15:.15)*$));else if(te.key==="+"||te.key==="=")Ct(kh(b,ue,.6));else if(te.key==="-")Ct(kh(b,ue,1/.6));else if(te.key==="0"||te.key==="Home")Ct([0,it]);else return;te.key!=="ArrowLeft"&&te.key!=="ArrowRight"&&te.preventDefault()},rs=M.useCallback(te=>{K.current||m(te)},[m]),en=bn.map(([te],ue)=>{const[we,Ue]=Ns(te);return{chrom:te,i:ue,x0:J(we),x1:J(Ue)}}).filter(({x0:te,x1:ue})=>ue>P&&te<P+le),wn=en.length===1?en[0]:null,Ts=wn?pM(b[0],b[1],Math.max(2,Math.round(le/120))):[],gt=(()=>{if(!o)return null;const te=Mu(o.chrom,o.pos);if(te<b[0]||te>b[1])return null;const ue=Hh(n,o.chrom,o.pos),we=Uh(ue,l),Ue=l==="allele"&&we!==null?Ou:0;return{x:J(te),y:ce((we??n.baseline)+Ue),copies:(ue==null?void 0:ue.total_cn)??null}})(),Yn=O?n.segments[O.index]:null,qt=Yn?SM(Yn):null,Dt=D!==null?se[D]:null,Ks=te=>P+te/it*le,It={x0:Ks(b[0]),x1:Ks(b[1])},Ln=xx(b),Pn=(te,ue)=>{te.stopPropagation(),te.preventDefault();const we=b;B(!0),Du(te,Ue=>{const Pe=Ue/le*it;ct(ue==="move"?ur(we,Pe):dM(we,ue,we[ue]+Pe))},()=>B(!1))};return r.jsxs("div",{ref:x,className:"cn","data-dragging":A||void 0,"data-zoomed":Ln||void 0,tabIndex:0,role:"group","aria-label":`Copy number of ${n.sample} across the genome, against ${n.baseline} copies.`,"aria-keyshortcuts":"ArrowLeft ArrowRight + - 0",onKeyDown:Wt,children:[r.jsxs("svg",{ref:y,width:v,height:I,"aria-hidden":!0,onPointerDown:zt,onPointerMove:ut,onPointerLeave:()=>R(null),onDoubleClick:Ge,children:[r.jsxs("defs",{children:[r.jsxs("linearGradient",{id:j.gain,x1:"0",y1:"0",x2:"0",y2:"1",children:[r.jsx("stop",{offset:"0",style:{stopColor:"var(--gain)"},stopOpacity:.46}),r.jsx("stop",{offset:"1",style:{stopColor:"var(--gain)"},stopOpacity:.04})]}),r.jsxs("linearGradient",{id:j.amp,x1:"0",y1:"0",x2:"0",y2:"1",children:[r.jsx("stop",{offset:"0",style:{stopColor:"var(--gain-strong)"},stopOpacity:.62}),r.jsx("stop",{offset:"1",style:{stopColor:"var(--gain-strong)"},stopOpacity:.05})]}),r.jsxs("linearGradient",{id:j.loss,x1:"0",y1:"0",x2:"0",y2:"1",children:[r.jsx("stop",{offset:"0",style:{stopColor:"var(--loss)"},stopOpacity:.04}),r.jsx("stop",{offset:"1",style:{stopColor:"var(--loss)"},stopOpacity:.46})]}),r.jsx("clipPath",{id:`${S}-plot`,children:r.jsx("rect",{x:P-4,y:ve-2,width:le+8,height:wr+4})})]}),r.jsx("g",{clipPath:`url(#${S}-plot)`,children:bn.map(([te],ue)=>{const[we,Ue]=Ns(te),Pe=J(we),vt=J(Ue);return ue%2===0&&vt>P&&Pe<P+le?r.jsx("rect",{x:Pe,y:ve,width:vt-Pe,height:wr,className:"cn-band"},te):null})}),Array.from({length:k+1},(te,ue)=>r.jsxs("g",{children:[r.jsx("line",{x1:P,x2:P+le,y1:ce(ue),y2:ce(ue),className:"cn-grid"}),r.jsx("text",{x:P-10,y:ce(ue)+4,textAnchor:"end",className:"cn-tick",children:ue===k&&ie?`${ue}+`:ue})]},ue)),r.jsx("line",{x1:P,x2:P+le,y1:ce(n.baseline),y2:ce(n.baseline),className:"cn-baseline"}),r.jsxs("text",{x:P+8,y:ce(n.baseline)-7,className:"cn-baseline-label",children:[n.baseline," copies"]}),r.jsx("g",{className:"cn-reveal",children:r.jsx("g",{clipPath:`url(#${S}-plot)`,children:r.jsx(TM,{segments:n.segments,spans:oe,mode:l,shown:b,geo:re,hover:O?O.index:null,grad:j,onHover:_,onClick:rs})})}),E!==null&&!A&&!O&&D===null&&r.jsxs("g",{pointerEvents:"none",children:[r.jsx("line",{x1:E,x2:E,y1:ve,y2:je,className:"cn-guide"}),r.jsxs("g",{transform:`translate(${Math.min(Math.max(E,P+52),P+le-52)} ${je-24})`,children:[r.jsx("rect",{x:-50,width:100,height:18,rx:9,className:"cn-readout"}),r.jsx("text",{y:12.5,textAnchor:"middle",className:"cn-readout-text",children:vM(Z(E))})]})]}),xe.map(({m:te,x:ue,index:we},Ue)=>{const Pe=Hh(n,te.chrom,te.pos),vt=Uh(Pe,l),pt=ce((vt??n.baseline)+(l==="allele"&&vt!==null?Ou:0)),et=W(te.gene),hn=4+Te[Ue]*jx,Nn=D===we;return r.jsxs("g",{className:"cn-driver","data-on":Nn||void 0,onPointerDown:ql=>ql.stopPropagation(),onMouseEnter:()=>C(we),onMouseLeave:()=>C(null),onClick:()=>g(te.gene),children:[r.jsx("line",{x1:ue,x2:ue,y1:hn+16,y2:pt,className:"cn-leader"}),r.jsx("rect",{x:ue-et/2,y:hn,width:et,height:16,rx:8,className:"cn-chip"}),r.jsx("text",{x:ue,y:hn+11.5,textAnchor:"middle",className:"cn-gene",children:te.gene}),r.jsx("circle",{cx:ue,cy:pt,r:Nn?6.5:5,className:"cn-dot"})]},te.gene)}),gt&&o&&r.jsxs("g",{pointerEvents:"none",children:[r.jsx("line",{x1:gt.x,x2:gt.x,y1:ve,y2:je,className:"cn-focus-line"}),r.jsx("circle",{cx:gt.x,cy:gt.y,r:6.5,className:"cn-focus-dot"}),(()=>{const te=`${o.gene??"?"}${gt.copies!==null?` ${gt.copies} copies`:""}`,ue=Cs(te,11.5,600)+14,we=gt.x+12+ue>P+le;return r.jsxs("g",{transform:`translate(${we?gt.x-12-ue:gt.x+12} ${gt.y-12})`,children:[r.jsx("rect",{width:ue,height:22,rx:7,className:"cn-focus-chip"}),r.jsx("text",{x:7,y:15,className:"cn-focus-text",children:te})]})})()]}),r.jsxs("g",{className:"cn-strip",children:[en.map(({chrom:te,i:ue,x0:we,x1:Ue})=>{const Pe=Math.max(we,P),vt=Math.min(Ue,P+le),pt=vt-Pe,et=wn?`chr${te}`:te;return r.jsxs("g",{className:"cn-pill",onClick:()=>Ct(Ns(te)),role:"presentation",children:[r.jsx("title",{children:`Zoom to chromosome ${te}`}),r.jsx("rect",{x:Pe+.5,y:L,width:Math.max(pt-1,1),height:bx,rx:7,"data-odd":ue%2?"":void 0}),pt>=Cs(et,11,600)+3&&r.jsx("text",{x:wn?Pe+10:(Pe+vt)/2,y:L+15,textAnchor:wn?"start":"middle",children:et})]},te)}),wn&&Ts.map(te=>{const ue=J(te.value);return ue>Math.max(wn.x0,P)+70&&ue<P+le-20?r.jsxs("g",{pointerEvents:"none",children:[r.jsx("line",{x1:ue,x2:ue,y1:L+3,y2:L+9,className:"cn-mb-tick"}),r.jsx("text",{x:ue,y:L+18,textAnchor:"middle",className:"cn-mb",children:te.label})]},te.value):null})]}),r.jsx(_M,{segments:n.segments,spans:oe,mode:l,top:k,baseline:n.baseline,plotL:P,plotW:le,y0:U}),r.jsx("rect",{x:P,y:U,width:le,height:Gi,fill:"transparent",className:"cn-mini-track",onPointerDown:te=>{const[ue]=Se(te),we=b[1]-b[0],Ue=(ue-P)/le*it;Ct(ur([Ue-we/2,Ue+we/2],0))}}),Ln&&r.jsxs("g",{className:"cn-mini-window",children:[r.jsx("rect",{x:It.x0,y:U-1,width:Math.max(It.x1-It.x0,4),height:Gi+2,rx:6,onPointerDown:te=>Pn(te,"move"),className:"cn-mini-win"}),[0,1].map(te=>r.jsx("rect",{x:(te===0?It.x0:It.x1)-4,y:U+Gi/2-9,width:8,height:18,rx:4,className:"cn-mini-handle",onPointerDown:ue=>Pn(ue,te)},te))]})]}),qt&&O&&r.jsxs(Zt,{x:O.x+0,y:O.y+0,width:v,children:[r.jsxs("span",{className:"ctip-title",children:[r.jsx("span",{className:"cn-call-dot","data-call":Yu(Yn),"aria-hidden":!0}),qt.call,r.jsx("span",{className:"ctip-sub",children:qt.copies})]}),qt.alleles&&r.jsxs("span",{className:"ctip-row",children:[r.jsx("span",{children:"Alleles"}),r.jsx("b",{children:qt.alleles})]}),r.jsxs("span",{className:"ctip-row",children:[r.jsx("span",{children:"Region"}),r.jsx("b",{className:"mono",children:qt.span})]}),qt.log2&&r.jsxs("span",{className:"ctip-row",children:[r.jsx("span",{children:"log2 ratio"}),r.jsx("b",{children:qt.log2})]}),r.jsx("span",{className:"ctip-note",children:"Click to list the mutations in this segment"})]}),Dt&&D!==null&&r.jsxs(Zt,{x:J(Dt.x),y:ve+10,width:v,children:[r.jsxs("span",{className:"ctip-title",children:[r.jsx("i",{children:Dt.gene}),Dt.changes&&r.jsx("span",{className:"ctip-sub",children:Dt.changes})]}),(()=>{const te=Uh(Hh(n,Dt.chrom,Dt.pos),l);return te!==null?r.jsxs("span",{className:"ctip-row",children:[r.jsx("span",{children:"Copy number here"}),r.jsx("b",{children:te})]}):null})(),r.jsx("span",{className:"ctip-note",children:"Driver. Click to find it in the table"})]})]})}const AM={"del.mh.prop":{short:"Del. MH",long:"Deletions with microhomology (share of deletions)"},SNV3:{short:"SBS3",long:"Substitution signature 3"},SV3:{short:"RS3",long:"Rearrangement signature 3"},SV5:{short:"RS5",long:"Rearrangement signature 5"},hrd:{short:"HRD index",long:"HRD index (loss of heterozygosity, telomeric imbalance, large-scale transitions)"},SNV8:{short:"SBS8",long:"Substitution signature 8"}};function wx(n,l="short"){var a;return((a=AM[n])==null?void 0:a[l])??n}const Fh=8;function OM(n){const l=n.find(c=>c.group==="sample")??n[0],a=[...(l==null?void 0:l.signatures)??[]].sort((c,d)=>(d.proportion??0)-(c.proportion??0)).map(c=>c.signature),o=a.length>Fh?Fh-1:Fh;return{shown:a.slice(0,o),other:a.slice(o)}}function Nx(n){return n.group==="sample"?"This tumour":`${n.label.replace(/\(\d+\)$/,"")} cohort${n.cohort_n?`, n = ${n.cohort_n}`:""}`}const Cx=["#2a78d6","#eb6834","#1baf7a","#eda100","#e87ba4","#008300","#6250d6","#e34948"],zM="#a3a3ab";function DM(n){const{shown:l,other:a}=OM(n),o=n.find(g=>g.group==="sample")??n[0],c=n.find(g=>g.group==="cohort")??null,d=(g,x,v)=>g?g.signatures.filter(y=>x.includes(y.signature)).reduce((y,S)=>y+(S[v]??0),0):null,h=(g,x,v)=>{var y,S;return{name:g,members:x,colour:v,share:d(o,x,"proportion")??0,cohortShare:d(c,x,"proportion"),count:d(o,x,"count")??0,cohortCount:d(c,x,"count"),aetiology:x.length===1?((y=o==null?void 0:o.signatures.find(j=>j.signature===g))==null?void 0:y.aetiology)??((S=c==null?void 0:c.signatures.find(j=>j.signature===g))==null?void 0:S.aetiology)??null:`${x.length} smaller signatures`}},m=l.map((g,x)=>h(g,[g],Cx[x%Cx.length]));return a.length&&m.push(h("Other",a,zM)),m}function Rl(n){return n.cohortShare===null?null:(n.share-n.cohortShare)*100}function Mx(n,l,a){const o=Math.max(l-a*Math.max(n.length-1,0),0),c=n.reduce((h,m)=>h+m,0)||1;let d=0;return n.map(h=>{const m=h/c*o,g={y0:d,y1:d+m};return d+=m+a,g})}function LM(n,l,a,o){const c=(n+a)/2,d=h=>h.toFixed(2);return`M${d(n)},${d(l.y0)} C${d(c)},${d(l.y0)} ${d(c)},${d(o.y0)} ${d(a)},${d(o.y0)} L${d(a)},${d(o.y1)} C${d(c)},${d(o.y1)} ${d(c)},${d(l.y1)} ${d(n)},${d(l.y1)} Z`}function Ms(n,l){const a=(n.length-1)*l,o=Math.floor(a),c=Math.ceil(a);return n[o]+(n[c]-n[o])*(a-o)}function yS(n){var c;const l=n.cohort.filter(d=>d!==null&&Number.isFinite(d)).sort((d,h)=>d-h);if(l.length===0)return null;const a=((c=n.sample)==null?void 0:c.value)??null,o=[...l];if(a!==null){const d=o.indexOf(a);d>=0&&o.splice(d,1)}return{values:l,q1:Ms(l,.25),median:Ms(l,.5),q3:Ms(l,.75),tumour:a,above:a===null?null:o.filter(d=>d<a).length,others:o.length}}function $M(n,l=64){const a=n.length,o=n.reduce((x,v)=>x+v,0)/a,c=Math.sqrt(n.reduce((x,v)=>x+(v-o)**2,0)/Math.max(a-1,1)),d=Math.min(c,(Ms(n,.75)-Ms(n,.25))/1.34)||c||.1,h=Math.max(.9*d*a**-.2,.02),m=Array.from({length:l+1},(x,v)=>{const y=v/l;return{x:y,y:n.reduce((S,j)=>S+Math.exp(-.5*((y-j)/h)**2),0)}}),g=Math.max(...m.map(x=>x.y))||1;return m.map(x=>({x:x.x,y:x.y/g}))}function kM(n,l){const a=[],o=new Array(n.length).fill(0);return[...n.keys()].sort((c,d)=>n[c]-n[d]).forEach(c=>{let d=0;for(;a.some(h=>h.level===d&&Math.abs(h.x-n[c])<l);)d+=1;a.push({x:n[c],level:d}),o[c]=d}),o}function Vh(n){return n.above===null||n.others===0?"":n.above===n.others?n.others===1?"Above the other sample":"Highest in the cohort":n.above===0?"Lowest in the cohort":`Above ${n.above} of ${n.others} others`}function qi(n,l,a,o){const c=Math.PI*(1-Math.min(Math.max(o,0),1));return{x:n+a*Math.cos(c),y:l-a*Math.sin(c)}}function HM(n){const{value:l,exact:a}=n;return l===null?"–":l===0&&a!=null&&a>0?a<1e-4?"<0.0001":String(Number(a.toPrecision(2))):l.toFixed(2)}function UM(n){const l=n.threshold;if(l===null)return null;const a=n.exact??n.value;return a===null||!n.rating?`High at ${l} and above`:n.rating==="HIGH"?`At or above the ${l} threshold`:a<l/2?`Well below the ${l} threshold`:`Below the ${l} threshold`}function Im(n){const l=n.filter(h=>h!==null&&Number.isFinite(h)).sort((h,m)=>h-m);if(!l.length)return null;const a=Ms(l,.25),o=Ms(l,.75),c=1.5*(o-a),d=l.filter(h=>h>=a-c&&h<=o+c);return{n:l.length,min:l[0],max:l[l.length-1],q1:a,median:Ms(l,.5),q3:o,low:d[0]??a,high:d[d.length-1]??o}}function FM(n,l=48){const a=n.filter(b=>b!==null&&Number.isFinite(b));if(a.length<2)return[];const o=Math.min(...a),c=Math.max(...a);if(c===o)return[];const d=a.length,h=a.reduce((b,N)=>b+N,0)/d,m=Math.sqrt(a.reduce((b,N)=>b+(N-h)**2,0)/(d-1)),g=[...a].sort((b,N)=>b-N),x=Ms(g,.75)-Ms(g,.25),v=Math.min(m,x/1.34)||m||(c-o)/4,y=Math.max(.9*v*d**-.2,(c-o)/200),S=Array.from({length:l+1},(b,N)=>{const T=o+(c-o)*N/l;return{v:T,d:a.reduce((O,_)=>O+Math.exp(-.5*((T-_)/y)**2),0)}}),j=Math.max(...S.map(b=>b.d))||1;return S.map(b=>({v:b.v,d:b.d/j}))}function vS(n,l,a){if(n===null)return"";const o=l.filter(d=>d!==null&&Number.isFinite(d));if(!o.length)return"";const c=o.filter(d=>d<n).length;return c===o.length?`Higher than every ${a}`:c===0?`Lower than every ${a}`:`Higher than ${c} of ${o.length} ${a}s`}function VM(n,l){const a=[],o=new Array(n.length).fill(0),c=[...n.keys()].sort((d,h)=>n[d]-n[h]);for(const d of c){let h=0;const m=g=>g===0?0:g%2?-Math.ceil(g/2):g/2;for(;a.some(g=>g.slot===m(h)&&Math.abs(g.y-n[d])<l);)h+=1;a.push({y:n[d],slot:m(h)}),o[d]=m(h)}return o}const _i=46,Ri=30,Ai=210,Ex=30,BM=58,GM=132,Tx=6,Oi=n=>`${Math.round(n*100)}%`;function qM({data:n}){var C,E;const[l,a]=Es(760),[o,c]=M.useState(((C=n.projects[0])==null?void 0:C.project)??null),[d,h]=M.useState(null),m=n.projects.find(R=>R.project===o)??n.projects[0],g=m.diseases,x=a-_i-8,v=Math.min(GM,Math.max(BM,x/Math.max(g.length,1))),y=v*g.length,S=Math.max(a,_i+y+8),j=_i+Math.max(0,(x-y)/2),b=Math.max(x,y),N=R=>Ri+Ai*(1-Math.min(Math.max(R,0),1)),T=m.tumour?g.findIndex(R=>{var A;return R.disease===((A=m.tumour)==null?void 0:A.disease)}):-1,O=M.useMemo(()=>g.map(R=>{const A=R.values.filter(K=>K!==null),B=A.map(K=>N(K));return{disease:R,stats:Im(A),values:A,py:B,slots:VM(B,Tx)}}),[g]),_=d===null?null:O[d],D=((E=m.tumour)==null?void 0:E.fga)??null;return r.jsxs("section",{className:"fga sig-section","aria-label":"Fraction of genome altered against the cohort",children:[r.jsxs("div",{className:"ctx-head",children:[r.jsxs("h3",{className:"sv-h",children:["Fraction of genome altered against the cohort",r.jsxs("span",{className:"sv-h-n",children:["project ",m.project,", n = ",m.n]})]}),r.jsxs("div",{className:"ctx-controls",children:[r.jsx("span",{className:"snap",title:"Cohorts show the samples the report compared with when it ran. Rerun the report to compare with the cohort as it is now.",children:"Cohort as of the report run"}),n.projects.length>1&&r.jsx(Bl,{label:"Project",value:m.project??"",onChange:R=>c(R),options:n.projects.map(R=>({value:R.project??"",label:`Project ${R.project}`}))})]})]}),r.jsx("div",{className:"fga-wrap",children:r.jsxs("div",{ref:l,className:"fga-plot",onMouseLeave:()=>h(null),children:[r.jsx("div",{className:"fga-scroll",children:r.jsxs("svg",{width:S,height:Ri+Ai+Ex,role:"img","aria-label":`FGA by disease in project ${m.project}`,children:[[0,.25,.5,.75,1].map(R=>r.jsxs("g",{children:[r.jsx("line",{x1:_i,x2:_i+b,y1:N(R),y2:N(R),className:R===0?"ctx-base":"ctx-grid"}),r.jsx("text",{x:_i-8,y:N(R)+4,textAnchor:"end",className:"ctx-tick",children:Oi(R)})]},R)),O.map(({disease:R,stats:A,values:B,py:K,slots:k},ie)=>{const oe=j+v*ie+v/2,se=Math.min(30,v*.46),P=ie===T;return r.jsxs("g",{className:"fga-col","data-on":d===ie||void 0,"data-mine":P||void 0,children:[r.jsx("rect",{x:j+v*ie+2,y:Ri-6,width:v-4,height:Ai+12,rx:10,className:"fga-band"}),A&&r.jsxs(r.Fragment,{children:[r.jsx("line",{x1:oe,x2:oe,y1:N(A.high),y2:N(A.low),className:"fga-whisker"}),r.jsx("rect",{x:oe-se/2,y:N(A.q3),width:se,height:Math.max(N(A.q1)-N(A.q3),1.5),rx:5,className:"fga-box"}),r.jsx("line",{x1:oe-se/2,x2:oe+se/2,y1:N(A.median),y2:N(A.median),className:"fga-median"})]}),B.map((le,$)=>r.jsx("circle",{cx:oe+k[$]*(Tx+1),cy:K[$],r:2.8,className:"fga-dot"},$)),r.jsx("text",{x:oe,y:Ri+Ai+20,textAnchor:"middle",className:"fga-label",children:R.disease}),r.jsx("rect",{x:j+v*ie,y:Ri-8,width:v,height:Ai+Ex+8,fill:"transparent",tabIndex:0,"aria-label":`${R.name??R.disease}: ${B.length} samples`,onMouseEnter:()=>h(ie),onFocus:()=>h(ie),onBlur:()=>h(null)})]},R.disease)}),T>=0&&D!==null&&r.jsxs("g",{className:"fga-pin",pointerEvents:"none",transform:`translate(${j+v*T+v/2} ${N(D)})`,children:[r.jsx("circle",{r:8,className:"fga-pin-dot"}),r.jsxs("g",{transform:"translate(0 -18)",children:[r.jsx("rect",{x:-44,y:-11,width:88,height:20,rx:10,className:"fga-pin-chip"}),r.jsxs("text",{y:3.5,textAnchor:"middle",className:"fga-pin-text",children:["This tumour ",Oi(D)]})]})]})]})}),_&&d!==null&&r.jsxs(Zt,{x:Math.min(j+v*d+v/2,a-10),y:Ri+Ai/2,width:a,children:[r.jsx("span",{className:"ctip-title",children:_.disease.name??_.disease.disease}),_.stats&&r.jsxs(r.Fragment,{children:[r.jsxs("span",{className:"ctip-row",children:[r.jsx("span",{children:"Samples"}),r.jsx("b",{children:_.stats.n})]}),r.jsxs("span",{className:"ctip-row",children:[r.jsx("span",{children:"Median"}),r.jsx("b",{children:Oi(_.stats.median)})]}),r.jsxs("span",{className:"ctip-row",children:[r.jsx("span",{children:"Middle half"}),r.jsxs("b",{children:[Oi(_.stats.q1),"–",Oi(_.stats.q3)]})]})]}),d===T&&D!==null&&r.jsxs("span",{className:"ctip-note",children:["This tumour ",Oi(D),"."," ",vS(D,IM(_.values,D),`${_.disease.disease} sample`)]})]})]})})]})}function IM(n,l){const a=n.indexOf(l);return a<0?n:[...n.slice(0,a),...n.slice(a+1)]}const _x=8,Rx=n=>`chr${n.chrom} · ${(n.start/1e6).toFixed(1)} Mb`;function QM({gene:n}){const l=n.copy_number??0,a=Math.min(Math.round(l),_x);return r.jsx("span",{className:"cng-meter","data-alteration":n.alteration,"aria-hidden":!0,children:Array.from({length:_x},(o,c)=>r.jsx("span",{"data-on":c<a||void 0},c))})}function YM({project:n,value:l}){if(l===null)return null;const a=l>=0;return r.jsxs("span",{className:"cng-expr","data-up":a||void 0,title:`RNA expression against the project ${n} cohort: log2 of this sample's level over the cohort mean`,children:[r.jsx("span",{className:"cng-arrow","aria-hidden":!0,children:a?"▲":"▼"}),a?"+":"−",Math.abs(l).toFixed(1),r.jsxs("i",{children:["p",n]})]})}function PM({genes:n,onHover:l,onLocate:a}){const o=n.filter(d=>d.alteration==="amplification").length,c=n.length-o;return r.jsxs("section",{className:"cng sig-section","aria-label":"Amplified and lost genes",children:[r.jsxs("h3",{className:"sv-h",children:["Amplified and lost genes",r.jsx("span",{className:"sv-h-n",children:n.length?`${o} amplified oncogene${o===1?"":"s"}, ${c} lost tumour suppressor${c===1?"":"s"}`:"none"})]}),n.length===0?r.jsx("p",{className:"sv-empty",children:"The report calls no amplified oncogenes or homozygously lost tumour suppressors."}):r.jsx("ul",{className:"cng-list",onMouseLeave:()=>l(null),children:n.map(d=>r.jsx("li",{children:r.jsxs("button",{type:"button",className:"cng-row","data-alteration":d.alteration,onMouseEnter:()=>l(d),onFocus:()=>l(d),onBlur:()=>l(null),onClick:()=>a(d),"aria-label":`${d.gene}, ${d.alteration}, ${d.copy_number??"unknown"} copies, ${Rx(d)}: show on the plot`,children:[r.jsx("span",{className:"cng-gene",children:d.gene}),r.jsx("span",{className:"cng-where mono",children:Rx(d)}),r.jsxs("span",{className:"cng-copies",children:[r.jsx(QM,{gene:d}),r.jsxs("span",{className:"cng-n",children:[d.copy_number===null?"?":d.copy_number,r.jsx("small",{children:d.copy_number===1?" copy":" copies"})]})]}),r.jsx("span",{className:"cng-call",children:d.alteration==="amplification"?"Amplified":"Lost"}),r.jsx("span",{className:"cng-exprs",children:d.expression.map(h=>r.jsx(YM,{project:h.project,value:h.log2_fold},h.project))})]})},d.gene))})]})}function fr({color:n,label:l}){return r.jsxs("span",{className:"flex items-center gap-1.5",children:[r.jsx("span",{className:"h-1 w-3.5 rounded-sm",style:{background:n}}),l]})}function XM({envelope:n,loading:l}){return(n==null?void 0:n.status)==="ok"&&n.data?r.jsx(qM,{data:n.data}):(n==null?void 0:n.status)==="missing"&&n.warnings.some(a=>a.includes("Rerun"))?r.jsxs("section",{className:"sig-section","aria-label":"Fraction of genome altered against the cohort",children:[r.jsx("h3",{className:"sv-h",children:"Fraction of genome altered against the cohort"}),r.jsx("p",{className:"sv-empty",children:n.warnings.join(" ")})]}):l&&!n?r.jsx("div",{className:"px-5 py-3",children:r.jsx("div",{className:"skeleton",style:{height:200},"aria-label":"Loading the FGA cohort figure"})}):null}function KM({envelope:n,loading:l,picked:a,sampleLabel:o,drivers:c,focus:d,locate:h,onSegment:m,onGene:g,fga:x,fgaLoading:v=!1,onOpenChromosome:y}){var ie;const[S,j]=M.useState("total"),[b,N]=M.useState(null),[T,O]=M.useState(null),_=oe=>({chrom:oe.chrom,pos:Math.round((oe.start+oe.end)/2),gene:oe.gene}),D=M.useMemo(()=>T&&(!h||T.nonce>h.nonce)?T:h,[h,T]),[C,E]=M.useState({window:[0,it],smooth:!1}),R=((ie=n==null?void 0:n.data)==null?void 0:ie.allele_specific)??!1,A=yM(...C.window),B=M.useCallback(()=>E({window:[0,it],smooth:!0}),[]),K=A?qm(C.window[0]+1e-6):null,k=K&&K===qm(C.window[1]-1e-6)?K:null;return r.jsx(eM,{title:"Copy number",subtitle:`Copy number across the genome, ${o}`,info:"copyNumber",envelope:n,loading:l,picked:a,skeletonHeight:250,moreLineage:x==null?void 0:x.lineage,controls:r.jsxs(r.Fragment,{children:[A&&r.jsxs(r.Fragment,{children:[r.jsx("span",{className:"mono text-xs",style:{color:"var(--ink-2)"},"aria-live":"polite",children:A}),r.jsx("button",{type:"button",className:"sc-ib sm","aria-label":"Show the whole genome",title:"Show the whole genome",onClick:B,children:r.jsx(Z1,{size:15,"aria-hidden":!0})}),k&&y&&r.jsx("button",{type:"button",className:"sc-ib sm","aria-label":`Open chromosome ${k} in the CN/SV view`,title:`Open chromosome ${k} in the CN/SV view`,onClick:()=>y(k),children:r.jsx(I1,{size:15,"aria-hidden":!0})})]}),r.jsx(Bl,{label:"Copy number view",value:R?S:"total",onChange:j,options:[{value:"total",label:"Total"},{value:"allele",label:"Allele-specific",disabled:!R}]})]}),footer:r.jsxs("span",{className:"flex flex-wrap items-center gap-x-4 gap-y-1 text-[12.5px]",style:{color:"var(--ink-2)"},children:[S==="total"||!R?r.jsxs(r.Fragment,{children:[r.jsx(fr,{color:"var(--gain)",label:"Gain"}),r.jsx(fr,{color:"var(--gain-strong)",label:"Amplification"}),r.jsx(fr,{color:"var(--loss)",label:"Loss"})]}):r.jsxs(r.Fragment,{children:[r.jsx(fr,{color:"var(--ink-2)",label:"Major allele"}),r.jsx(fr,{color:"var(--chev)",label:"Minor allele"})]}),r.jsx("span",{style:{color:"var(--faint)"},children:"Scroll up or down over the plot to zoom, sideways (or drag) to pan, or move the window in the overview. Double-click a chromosome, or click its name, to fill the view."})]}),children:oe=>r.jsxs(r.Fragment,{children:[r.jsx(RM,{data:oe,mode:R?S:"total",drivers:c,focus:b??d,locate:D,view:C,onView:E,onSegment:m,onGene:g}),oe.genes&&r.jsx(PM,{genes:oe.genes,onHover:se=>N(se?_(se):null),onLocate:se=>O({..._(se),nonce:Date.now()})}),r.jsx(XM,{envelope:x,loading:v})]})})}function ZM(n){const[l,a]=n.range;return[[l,0],...n.bins.map(o=>[(o.x0+o.x1)/2,o.n]),[a,0]]}function Bh(n,l){for(let a=1;a<n.length;a++){const[o,c]=n[a-1],[d,h]=n[a];if(l<=d)return d===o?h:c+(l-o)/(d-o)*(h-c)}return n[n.length-1][1]}function JM(n){return n==="ccf"?"CCF":"VAF"}function Gs(n,l){return Math.min(Math.max(l,n.range[0]),n.range[1])}function WM(n){const l=n.measure==="ccf"?.25:.1,a=[];for(let o=n.range[0];o<=n.range[1]+1e-9;o+=l)a.push(Math.round(o*100)/100);return a}function eE(n,l){return n.measure==="ccf"?l===1?"1.0":l.toFixed(2).replace(/0$/,""):l.toFixed(1)}const ya=14,tE=22,dr=118,nE=40,zi=19,Ax=n=>Math.round(n*100)/100;function sE({data:n,range:l,focus:a,onRange:o,onGene:c}){const[d,h]=Es(),m=M.useId(),g=M.useRef(null),[x,v]=M.useState(null),[y,S]=M.useState(null),[j,b]=n.range,N=h-tE,T=U=>ya+(U-j)/(b-j)*(N-ya),O=U=>j+(U-ya)/(N-ya)*(b-j),_=M.useMemo(()=>ZM(n),[n]),D=Math.max(1,..._.map(U=>U[1])),C=U=>U*zi+8+dr,E=(U,I)=>C(U)-I/(D*1.1)*dr,R=M.useMemo(()=>[...n.drivers].sort((U,I)=>U.value-I.value),[n.drivers]),A=R.map(U=>({left:T(Gs(n,U.value))-Cs(U.gene??"?",11.5,600)/2-6,width:Cs(U.gene??"?",11.5,600)+12})),B=zu(A,4),K=R.length?Math.max(...B)+1:0,k=C(K),ie=k+nE,oe=_.map(([U,I])=>[T(U),E(K,I)]),se=jM(oe),P=`${se} L${T(b).toFixed(2)},${k} L${T(j).toFixed(2)},${k} Z`,le=U=>U.kind==="new"?[Math.min(U.from,U.to),Math.max(U.from,U.to)]:U.kind==="edge"?[Math.min(U.fixed,U.to),Math.max(U.fixed,U.to)]:U.range,$=x?le(x):l,J=U=>{const I=g.current.getBoundingClientRect();return O(Math.min(Math.max(U-I.left,ya),N))},Z=(U,I,re)=>{U.preventDefault(),U.stopPropagation();let ce=I(J(U.clientX));v(ce),Du(U,(xe,Te)=>{ce=re(ce,J(Te.clientX)),v(ce)},()=>{const[xe,Te]=le(ce);if(v(null),T(Te)-T(xe)<4)return o(null);o([Ax(Gs(n,xe)),Ax(Gs(n,Te))])})},W=(U,I)=>U.kind==="move"?U:{...U,to:I},ae=(U,I)=>{if(U.kind!=="move")return U;const re=U.range[1]-U.range[0],ce=Math.min(Math.max(U.range[0]+(I-U.grab),j),b-re);return{...U,grab:I,range:[ce,ce+re]}},de=$?[T(Gs(n,$[0])),T(Gs(n,$[1]))]:null,ve=JM(n.measure),je=a?n.measure==="ccf"?a.ccf:a.vaf:null,L=y!==null?R[y]:null;return r.jsxs("div",{ref:d,className:"dens","data-brushing":x?"":void 0,children:[r.jsxs("svg",{ref:g,width:h,height:ie,role:"img","aria-label":`${ve} of ${n.total} variants in ${n.sample}${n.drivers.length?`, with ${n.drivers.map(U=>`${U.gene} at ${U.value.toFixed(2)}`).join(", ")}`:""}.`,onPointerDown:U=>{U.button===0&&Z(U,I=>({kind:"new",from:I,to:I}),W)},children:[r.jsxs("defs",{children:[r.jsxs("linearGradient",{id:`${m}-fill`,x1:"0",y1:"0",x2:"0",y2:"1",children:[r.jsx("stop",{offset:"0",style:{stopColor:"var(--ccf-fill)"},stopOpacity:.42}),r.jsx("stop",{offset:"1",style:{stopColor:"var(--ccf-fill)"},stopOpacity:.03})]}),r.jsx("clipPath",{id:`${m}-spot`,children:de&&r.jsx("rect",{x:de[0],y:0,width:Math.max(de[1]-de[0],0),height:ie})})]}),WM(n).map(U=>r.jsxs("g",{children:[r.jsx("line",{x1:T(U),x2:T(U),y1:K*zi+8,y2:k,className:"dens-grid","data-clonal":n.measure==="ccf"&&U===1?"":void 0}),r.jsx("text",{x:T(U),y:k+18,textAnchor:"middle",className:"dens-tick",children:eE(n,U)})]},U)),n.measure==="ccf"&&j<=1&&b>=1&&r.jsx("text",{x:T(1),y:k+31,textAnchor:"middle",className:"dens-clonal",children:"clonal"}),r.jsxs("g",{className:"dens-curve","data-dim":de?"":void 0,children:[r.jsx("path",{d:P,fill:`url(#${m}-fill)`}),r.jsx("path",{d:se,className:"dens-line"})]}),de&&r.jsx("g",{className:"dens-curve dens-lit",children:r.jsxs("g",{clipPath:`url(#${m}-spot)`,children:[r.jsx("path",{d:P,fill:`url(#${m}-fill)`}),r.jsx("path",{d:se,className:"dens-line"})]})}),r.jsx("line",{x1:ya,x2:N,y1:k,y2:k,className:"dens-axis"}),n.median!==null&&r.jsx("path",{d:`M${T(n.median)},${k+1} l4.5,-6 l-4.5,-6 l-4.5,6 z`,className:"dens-median",children:r.jsx("title",{children:`Median ${n.median.toFixed(2)}`})}),R.map((U,I)=>{const re=Gs(n,U.value),ce=T(re),xe=E(K,Bh(_,re)),Te=U.gene??"?",me=Cs(Te,11.5,600)+12,Se=8+B[I]*zi,ct=y===I;return r.jsxs("g",{className:"dens-driver","data-on":ct||void 0,onPointerDown:Ct=>Ct.stopPropagation(),onMouseEnter:()=>S(I),onMouseLeave:()=>S(null),onClick:()=>U.gene&&c(U.gene),children:[r.jsx("line",{x1:ce,x2:ce,y1:Se+15,y2:xe,className:"dens-leader"}),r.jsx("rect",{x:ce-me/2,y:Se,width:me,height:16,rx:8,className:"dens-chip"}),r.jsx("text",{x:ce,y:Se+11.5,textAnchor:"middle",className:"dens-gene",children:Te}),r.jsx("circle",{cx:ce,cy:xe,r:ct?7:5.5,className:"dens-dot"})]},`${Te}-${I}`)}),je!=null&&r.jsx("g",{className:"dens-focus",pointerEvents:"none",children:(()=>{const U=Gs(n,je),I=T(U),re=E(K,Bh(_,U)),ce=`${(a==null?void 0:a.gene)??"?"} ${je.toFixed(2)}`,xe=Cs(ce,11,600)+14,Te=I+12+xe>h;return r.jsxs(r.Fragment,{children:[r.jsx("line",{x1:I,x2:I,y1:re,y2:k,className:"dens-focus-line"}),r.jsx("circle",{cx:I,cy:re,r:6.5,className:"dens-focus-dot"}),r.jsxs("g",{transform:`translate(${Te?I-12-xe:I+12} ${re-11})`,children:[r.jsx("rect",{width:xe,height:22,rx:7,className:"dens-focus-chip"}),r.jsx("text",{x:7,y:15,className:"dens-focus-text",children:ce})]})]})})()}),$&&de&&r.jsxs("g",{className:"dens-brush",children:[r.jsx("rect",{x:de[0],y:K*zi+4,width:Math.max(de[1]-de[0],0),height:dr+8,className:"dens-sel",onPointerDown:U=>Z(U,I=>({kind:"move",grab:I,range:$}),ae)}),[0,1].map(U=>r.jsxs("g",{children:[r.jsx("line",{x1:de[U],x2:de[U],y1:K*zi+4,y2:k,className:"dens-sel-edge"}),r.jsx("rect",{x:de[U]-5,y:K*zi+4,width:10,height:dr+8,className:"dens-edge",onPointerDown:I=>Z(I,()=>({kind:"edge",fixed:$[1-U],to:$[U]}),W)}),r.jsx("rect",{x:de[U]-3,y:k-dr/2-10,width:6,height:20,rx:3,className:"dens-grip",pointerEvents:"none"})]},U)),r.jsxs("g",{transform:`translate(${Math.min(Math.max((de[0]+de[1])/2,ya+48),N-48)} ${k-30})`,pointerEvents:"none",children:[r.jsx("rect",{x:-48,y:0,width:96,height:20,rx:10,className:"dens-readout"}),r.jsxs("text",{y:14,textAnchor:"middle",className:"dens-readout-text",children:[$[0].toFixed(2)," – ",$[1].toFixed(2)]})]})]})]}),L&&y!==null&&r.jsxs(Zt,{x:T(Gs(n,L.value)),y:E(K,Bh(_,Gs(n,L.value)))-22,width:h,above:!0,children:[r.jsxs("span",{className:"ctip-title",children:[r.jsx("i",{children:L.gene??"?"}),L.protein_change&&r.jsxs("span",{className:"ctip-sub",children:[" ",L.protein_change]})]}),r.jsxs("span",{className:"ctip-row",children:[r.jsx("span",{children:ve}),r.jsx("b",{children:L.value.toFixed(2)})]}),r.jsx("span",{className:"ctip-note",children:"Driver. Click to find it in the table"})]})]})}function lE({envelope:n,loading:l,measure:a,onMeasure:o,range:c,focus:d,onRange:h,onGene:m}){const g=a==="ccf"?"Cancer cell fraction":"Variant allele fraction",x=(n==null?void 0:n.status)==="ok"?n.data:null;return r.jsxs("div",{className:"strip",children:[r.jsxs("div",{className:"strip-head",children:[r.jsx("span",{className:"text-[13px] font-semibold",children:g}),x&&r.jsxs("span",{className:"text-[12.5px]",style:{color:"var(--muted)"},children:[x.median!==null?`Median ${x.median.toFixed(2)}. `:"","Drag across the plot to filter the table."]}),r.jsx("span",{className:"flex-auto"}),r.jsx(Bl,{label:"Measure",value:a,onChange:o,options:[{value:"ccf",label:"CCF"},{value:"vaf",label:"VAF"}]})]}),r.jsx(Vl,{label:g,envelope:n,loading:l,skeletonHeight:180,children:v=>r.jsx(sE,{data:v,range:c,focus:d,onRange:h,onGene:m})})]})}const aE=Object.keys(uS),iE=Object.keys(fS);function Ox(n,l){return n.includes(l)?n.filter(a=>a!==l):[...n,l]}function Gh({label:n,count:l,active:a,onClick:o}){return r.jsxs("button",{type:"button",className:"facet","aria-pressed":a,"data-empty":!a&&l===0,onClick:o,children:[r.jsx("span",{className:"facet-check","aria-hidden":!0,children:a&&r.jsx(Q1,{size:11,strokeWidth:3})}),r.jsx("span",{className:"truncate",children:n}),r.jsx("span",{className:"facet-n",children:l===void 0?"":l.toLocaleString("en-US")})]})}function oE({table:n,data:l,onChange:a}){const o=l==null?void 0:l.facets.effects,c=l==null?void 0:l.facets.flags,d=n.range;return r.jsxs("aside",{className:"facets","aria-label":"Filters",children:[r.jsxs("div",{className:"facet-group",role:"group","aria-label":"Effect",children:[r.jsx("span",{className:"facet-title",children:"Effect"}),aE.map(h=>r.jsx(Gh,{label:uS[h],count:o==null?void 0:o[h],active:n.effects.includes(h),onClick:()=>a({effects:Ox(n.effects,h)})},h))]}),r.jsxs("div",{className:"facet-group",role:"group","aria-label":"Flags",children:[r.jsx("span",{className:"facet-title",children:"Flags"}),iE.map(h=>r.jsx(Gh,{label:fS[h],count:c==null?void 0:c[h],active:n.flags.includes(h),onClick:()=>a({flags:Ox(n.flags,h)})},h))]}),(l==null?void 0:l.ffpe)&&r.jsxs("div",{className:"facet-group",role:"group","aria-label":"FFPE filter",children:[r.jsx("span",{className:"facet-title",children:"FFPE filter"}),r.jsx(Gh,{label:"Show filtered calls",count:l.ffpe.removed,active:n.ffpe,onClick:()=>a({ffpe:!n.ffpe})}),r.jsx("span",{className:"facet-note",children:l.ffpe.threshold!==null?`As in the report, calls FFPERASE scores above ${l.ffpe.threshold} are left out of the counts.`:"As in the report, calls its FFPE filter removes are left out of the counts."})]}),d&&r.jsxs("div",{className:"facet-group",role:"group","aria-label":"Range",children:[r.jsxs("span",{className:"facet-title",children:[d.measure==="ccf"?"CCF":"VAF"," range"]}),r.jsxs("span",{className:"facet-range",children:[r.jsxs("span",{className:"mono",children:[d.low.toFixed(2)," – ",d.high.toFixed(2)]}),r.jsx("button",{type:"button",className:"sc-ib xs","aria-label":"Remove the range",title:"Remove the range",onClick:()=>a({range:null}),children:r.jsx(Bu,{size:13,"aria-hidden":!0})})]})]}),cS(n)>0&&r.jsx("button",{type:"button",className:"facet-clear",onClick:()=>a({q:"",effects:[],flags:[],range:null}),children:"Clear all filters"})]})}const qh=48,hr=16,mr=200,rE=26,Di=["#1baf7a","#eda100"],Ih=[{key:"snvs",label:"SNVs"},{key:"indels",label:"Indels"}];function cE({data:n}){const[l,a]=Es(760),[o,c]=M.useState(null),d=n.cohorts,h=d.length>1,m=(a-qh-8)/Ih.length,g=Math.min(m*.34,90),x=b=>{const N=[...d.flatMap(O=>O[b]),n.tumour[b]].filter(O=>O!==null),T=Pu(Math.max(...N,1),4);return{ticks:T,top:T[T.length-1]}},v=o?d[o.cohort]:null,y=o&&v?v[o.event]:[],S=Im(y),j=o?n.tumour[o.event]:null;return r.jsxs("section",{className:"tmbc sig-section","aria-label":"Coding mutations against reference cohorts",children:[r.jsxs("div",{className:"ctx-head",children:[r.jsxs("h3",{className:"sv-h",children:["Coding mutations against reference cohorts",n.disease&&r.jsx("span",{className:"sv-h-n",children:n.disease})]}),r.jsxs("div",{className:"ctx-controls",children:[r.jsxs("ul",{className:"sv-sigs-key","aria-label":"Key",children:[d.map((b,N)=>r.jsxs("li",{children:[r.jsx("span",{className:"sv-swatch",style:{background:Di[N%Di.length]},"aria-hidden":!0}),b.cohort,b.n!==null&&r.jsx("span",{className:"sv-key-n",children:b.n})]},b.cohort??N)),r.jsxs("li",{children:[r.jsx("span",{className:"hrd-key-pin","aria-hidden":!0}),"This tumour"]})]}),r.jsx("span",{className:"snap",title:"Cohorts show the samples the report compared with when it ran. Rerun the report to compare with the cohort as it is now.",children:"Cohort as of the report run"})]})]}),r.jsx("div",{className:"fga-wrap",children:r.jsxs("div",{ref:l,className:"fga-plot",onMouseLeave:()=>c(null),children:[r.jsx("svg",{width:a,height:hr+mr+rE,role:"img","aria-label":`Coding SNVs and indels against ${d.map(b=>b.cohort).join(" and ")}`,children:Ih.map(({key:b,label:N},T)=>{const{ticks:O,top:_}=x(b),D=qh+m*T,C=D+m/2,E=A=>hr+mr*(1-A/_),R=n.tumour[b];return r.jsxs("g",{children:[O.map(A=>r.jsxs("g",{children:[r.jsx("line",{x1:D+6,x2:D+m-6,y1:E(A),y2:E(A),className:A===0?"ctx-base":"ctx-grid"}),r.jsx("text",{x:D,y:E(A)+4,textAnchor:"end",className:"ctx-tick",children:A.toLocaleString("en-US")})]},A)),d.map((A,B)=>{const K=FM(A[b]),k=h?B===0?-1:1:0,ie=Di[B%Di.length],oe=K.length?k===0?[...K.map($=>`${C+$.d*g},${E($.v)}`),...[...K].reverse().map($=>`${C-$.d*g},${E($.v)}`)]:[`${C},${E(K[0].v)}`,...K.map($=>`${C+k*$.d*g},${E($.v)}`),`${C},${E(K[K.length-1].v)}`]:[],se=Im(A[b]),P=(o==null?void 0:o.event)===b&&o.cohort===B,le=k===0?C:C+k*6;return r.jsxs("g",{className:"tmb-violin","data-on":P||void 0,onMouseEnter:()=>c({event:b,cohort:B}),children:[oe.length>0&&r.jsx("polygon",{points:oe.join(" "),style:{fill:ie,stroke:ie},className:"tmb-shape"}),se&&r.jsxs(r.Fragment,{children:[r.jsx("line",{x1:le,x2:le,y1:E(se.q1),y2:E(se.q3),className:"tmb-iqr"}),r.jsx("circle",{cx:le,cy:E(se.median),r:3,className:"tmb-median"})]}),!oe.length&&A[b].map(($,J)=>$===null?null:r.jsx("circle",{cx:C+k*10,cy:E($),r:3,style:{fill:ie}},J)),r.jsx("rect",{x:k===1?C:C-g-4,y:hr,width:k===0?g*2+8:g+4,height:mr,fill:"transparent"})]},A.cohort??B)}),R!==null&&r.jsxs("g",{pointerEvents:"none",className:"tmb-tumour",children:[r.jsx("line",{x1:C-g-10,x2:C+g+10,y1:E(R),y2:E(R),className:"tmb-tumour-line"}),r.jsx("circle",{cx:C,cy:E(R),r:7,className:"fga-pin-dot"}),r.jsx("text",{x:C+12,y:E(R)-9,className:"tmb-tumour-text",children:R.toLocaleString("en-US")})]}),r.jsx("text",{x:C,y:hr+mr+19,textAnchor:"middle",className:"fga-label",children:N})]},b)})}),o&&v&&r.jsxs(Zt,{x:qh+m*Ih.findIndex(b=>b.key===o.event)+m/2+(h?o.cohort===0?-g/2:g/2:0),y:hr+mr/2,width:a,children:[r.jsxs("span",{className:"ctip-title",children:[r.jsx("span",{className:"sv-swatch",style:{background:Di[o.cohort%Di.length]},"aria-hidden":!0}),v.cohort,", coding ",o.event==="snvs"?"SNVs":"indels"]}),S&&r.jsxs(r.Fragment,{children:[r.jsxs("span",{className:"ctip-row",children:[r.jsx("span",{children:"Tumours"}),r.jsx("b",{children:S.n})]}),r.jsxs("span",{className:"ctip-row",children:[r.jsx("span",{children:"Median"}),r.jsx("b",{children:Math.round(S.median).toLocaleString("en-US")})]}),r.jsxs("span",{className:"ctip-row",children:[r.jsx("span",{children:"Middle half"}),r.jsxs("b",{children:[Math.round(S.q1).toLocaleString("en-US"),"–",Math.round(S.q3).toLocaleString("en-US")]})]})]}),j!==null&&r.jsxs("span",{className:"ctip-note",children:["This tumour ",j.toLocaleString("en-US"),". ",vS(j,y,`${v.cohort} tumour`)]})]})]})})]})}/**
|
|
276
|
+
*/const Ag=Oe("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
|
|
277
|
+
* @license lucide-react v0.468.0 - ISC
|
|
278
|
+
*
|
|
279
|
+
* This source code is licensed under the ISC license.
|
|
280
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
281
|
+
*/const CC=Oe("UserRound",[["circle",{cx:"12",cy:"8",r:"5",key:"1hypcn"}],["path",{d:"M20 21a8 8 0 0 0-16 0",key:"rfgkzh"}]]);/**
|
|
282
|
+
* @license lucide-react v0.468.0 - ISC
|
|
283
|
+
*
|
|
284
|
+
* This source code is licensed under the ISC license.
|
|
285
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
286
|
+
*/const MC=Oe("Users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]]);/**
|
|
287
|
+
* @license lucide-react v0.468.0 - ISC
|
|
288
|
+
*
|
|
289
|
+
* This source code is licensed under the ISC license.
|
|
290
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
291
|
+
*/const EC=Oe("Waves",[["path",{d:"M2 6c.6.5 1.2 1 2.5 1C7 7 7 5 9.5 5c2.6 0 2.4 2 5 2 2.5 0 2.5-2 5-2 1.3 0 1.9.5 2.5 1",key:"knzxuh"}],["path",{d:"M2 12c.6.5 1.2 1 2.5 1 2.5 0 2.5-2 5-2 2.6 0 2.4 2 5 2 2.5 0 2.5-2 5-2 1.3 0 1.9.5 2.5 1",key:"2jd2cc"}],["path",{d:"M2 18c.6.5 1.2 1 2.5 1 2.5 0 2.5-2 5-2 2.6 0 2.4 2 5 2 2.5 0 2.5-2 5-2 1.3 0 1.9.5 2.5 1",key:"rd2r6e"}]]);/**
|
|
292
|
+
* @license lucide-react v0.468.0 - ISC
|
|
293
|
+
*
|
|
294
|
+
* This source code is licensed under the ISC license.
|
|
295
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
296
|
+
*/const ec=Oe("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/**
|
|
297
|
+
* @license lucide-react v0.468.0 - ISC
|
|
298
|
+
*
|
|
299
|
+
* This source code is licensed under the ISC license.
|
|
300
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
301
|
+
*/const Sy=Oe("ZoomOut",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]]);function RC(n){if(n.value===null)return n.text??"";switch(n.key){case"coverage":return`${Math.round(n.value)}×`;case"tmb":return n.value<.01?n.value.toPrecision(2):n.value.toFixed(2);default:return n.value.toFixed(2)}}function TC(n){return n.status==="failed"?"Failed":n.status==="skipped"?"Not in this mode":"Not run"}const _C=new Intl.DateTimeFormat("en-GB",{day:"numeric",month:"short",year:"numeric"});function jy(n){if(!n)return"";const a=new Date(n);return Number.isNaN(a.getTime())?"":_C.format(a)}function eo(n,a){return n.startsWith(`${a}_`)?n.slice(a.length+1):n}function ng(n){return n==null?"–":n.toFixed(2)}const wv={missense_variant:"Missense",stop_gained:"Nonsense",stop_lost:"Stop lost",start_lost:"Start lost",frameshift_variant:"Frameshift",inframe_deletion:"In-frame deletion",inframe_insertion:"In-frame insertion",splice_acceptor_variant:"Splice acceptor",splice_donor_variant:"Splice donor",splice_region_variant:"Splice region",synonymous_variant:"Synonymous",intron_variant:"Intronic",upstream_gene_variant:"Upstream",downstream_gene_variant:"Downstream","5_prime_UTR_variant":"5′ UTR","3_prime_UTR_variant":"3′ UTR"};function AC(n,a){const l=(n??a??"").split("&")[0];if(!l)return"–";if(wv[l])return wv[l];const i=l.replace(/_/g," ");return i.charAt(0).toUpperCase()+i.slice(1)}function Gr(n,a){return`chr${n}:${a.toLocaleString("en-US")}`}const Nn=[["1",249250621],["2",243199373],["3",198022430],["4",191154276],["5",180915260],["6",171115067],["7",159138663],["8",146364022],["9",141213431],["10",135534747],["11",135006516],["12",133851895],["13",115169878],["14",107349540],["15",102531392],["16",90354753],["17",81195210],["18",78077248],["19",59128983],["20",63025520],["21",48129895],["22",51304566],["X",155270560]],sg=.0025,OC=Nn.reduce((n,[,a])=>n+a,0),zC=1-sg*Nn.length,id=(()=>{const n={};let a=sg/2;for(const[l,i]of Nn){const c=i/OC*zC;n[l]=[a,a+c],a+=c+sg}return n})(),Nv=Object.fromEntries(Nn);function Pu(n,a){const l=n.replace(/^chr/,""),i=id[l];if(!i)return null;const c=Math.min(Math.max(a,0),Nv[l]);return i[0]+c/Nv[l]*(i[1]-i[0])}function Cv(n,a,l,i){const c=i*2*Math.PI-Math.PI/2;return[n+l*Math.cos(c),a+l*Math.sin(c)]}function Yf(n,a,l,i,c){const[d,f]=Cv(n,a,l,i),[m,g]=Cv(n,a,l,c),v=c-i>.5?1:0;return`M${d.toFixed(2)},${f.toFixed(2)} A${l},${l} 0 ${v} 1 ${m.toFixed(2)},${g.toFixed(2)}`}function ag(n,a="start"){let l=null;for(const d of Nn){const[f,m]=d,[g,v]=id[f];if(n<g&&a==="end"&&l)return{chrom:l[0],pos:l[1]};if(n<=v)return{chrom:f,pos:Math.round(Math.max(0,(n-g)/(v-g))*m)};l=d}const[i,c]=Nn[Nn.length-1];return{chrom:i,pos:c}}function Lr(n,a){const l=a>=1e6?0:a>=1e5?1:2;return`${(n/1e6).toFixed(l)} Mb`}const DC={hero:{box:220,ring:78,ringW:10,gain:93,gainW:7,amp:94,ampW:13,loss:63,lossW:7,drv:50,drvW:9},switcher:{box:48,ring:16,ringW:4.5,gain:21,gainW:3,amp:21,ampW:4.5,loss:11,lossW:3,drv:0,drvW:0},mini:{box:20,ring:7,ringW:2.6,gain:7,gainW:2.6,amp:7,ampW:2.6,loss:7,lossW:2.6,drv:0,drvW:0}},Mv=.004,Ev=.003;function kC(n,a,l){const i=Pu(n,a),c=Pu(n,l);return i===null||c===null?null:c-i<Mv?[i,i+Mv]:[i,c]}function Xf(n){return n.length<=1?n[0]??"":`${n.slice(0,-1).join(", ")} and ${n[n.length-1]}`}function LC(n,a,l){return n===1?`one ${a}`:`${n} ${l}`}function wy(n){const l=[["amp","amplification","amplifications"],["gain","gain","gains"],["loss","loss","losses"]].flatMap(([f,m,g])=>{const v=n.events.filter(j=>j.kind===f);if(v.length===0)return[];const x=[...new Set(v.map(j=>j.chrom))],p=x.length>6?[...x.slice(0,6),`${x.length-6} more`]:x,b=x.length===1?`chromosome ${x[0]}`:`chromosomes ${Xf(p)}`,S=f==="amp"&&v.length===1&&v[0].total_cn!==null?` (${Math.round(v[0].total_cn)} copies)`:"";return[`${LC(v.length,m,g)} on ${b}${S}`]}),i=l.length?Xf(l):`no copy-number changes against ${n.baseline} copies`,c=[...new Set(n.drivers.map(f=>f.gene).filter(f=>!!f))].sort(),d=c.length?`Drivers in ${Xf(c)}.`:"No drivers.";return`${i.charAt(0).toUpperCase()}${i.slice(1)}. ${d}`}function Og({fingerprint:n,size:a,title:l,subtitle:i,className:c}){const d=DC[a],f=d.box/2,m=(n==null?void 0:n.events)??[],g=(n==null?void 0:n.drivers)??[],v=n?`Genome fingerprint: ${wy(n)}`:"No copy-number data";return r.jsxs("svg",{viewBox:`0 0 ${d.box} ${d.box}`,role:a==="mini"?void 0:"img","aria-label":a==="mini"?void 0:v,"aria-hidden":a==="mini"?!0:void 0,className:c,children:[r.jsxs("g",{fill:"none",strokeLinecap:"butt",children:[Object.entries(id).map(([x,[p,b]])=>r.jsx("path",{className:"r-neu",strokeWidth:d.ringW,d:Yf(f,f,d.ring,p,b)},x)),m.map((x,p)=>{const b=kC(x.chrom,x.start,x.end);if(!b)return null;const S=x.kind==="loss"?d.loss:x.kind==="amp"?d.amp:d.gain,j=x.kind==="loss"?d.lossW:x.kind==="amp"?d.ampW:d.gainW;return r.jsx("path",{className:`r-${x.kind}`,strokeWidth:j,d:Yf(f,f,S,b[0],b[1])},`${x.chrom}-${x.start}-${p}`)}),d.drvW>0&&g.map((x,p)=>{const b=Pu(x.chrom,x.pos);return b===null?null:r.jsx("path",{className:"r-drv",strokeWidth:d.drvW,d:Yf(f,f,d.drv,b-Ev/2,b+Ev/2)},`${x.gene}-${x.pos}-${p}`)})]}),a==="hero"&&l&&r.jsxs(r.Fragment,{children:[r.jsx("text",{className:"t-ink",x:f,y:f-2,textAnchor:"middle",fontSize:"24",fontWeight:"800",children:l}),i&&r.jsx("text",{className:"t-faint",x:f,y:f+18,textAnchor:"middle",fontSize:"12",fontWeight:"600",children:i})]})]})}const $C={"DNA|WG":{label:"WGS",icon:ld},"RNA|WT":{label:"RNA",icon:lC}};function Rv({children:n}){return r.jsx("svg",{width:"17",height:"17",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:n})}function HC({sex:n}){const a=n==null?void 0:n.toUpperCase();return a==="MALE"?r.jsxs(Rv,{children:[r.jsx("circle",{cx:"12",cy:"9",r:"4.5"}),r.jsx("path",{d:"M7.6 8.2c.5-2.9 2.4-4.7 4.6-4.7 2.6 0 4.4 1.7 4.4 4.3-2.2.1-4.2-.6-5.6-2.1"}),r.jsx("path",{d:"M3.5 21a8.5 7.5 0 0 1 17 0"}),r.jsx("path",{d:"m10 15.6 2 2.2 2-2.2"})]}):a==="FEMALE"?r.jsxs(Rv,{children:[r.jsx("circle",{cx:"12",cy:"9.2",r:"3.4"}),r.jsx("path",{d:"M6.3 14.2C4.6 9 6.6 2.8 12 2.8s7.4 6.2 5.7 11.4"}),r.jsx("path",{d:"M5 21.2a7 6.3 0 0 1 14 0"})]}):r.jsx(CC,{size:16,"aria-hidden":!0})}const Ny="wgts-patient-root";function UC(n,a){const l=n.getBoundingClientRect(),i=n.closest(".topbar"),c=i==null?void 0:i.parentElement,d=i&&c?c.getBoundingClientRect().top-i.getBoundingClientRect().top:0;return{x:l.left-a.left+l.width/2,y:l.top+d-a.top+l.height/2}}const Cy=8,My=12;function BC(n){const a=Array.from(n.querySelectorAll("[data-sample]")).map(l=>l.getBoundingClientRect()).filter(l=>l.height>0).map(l=>l.top);return a.length?Math.min(...a)-My:null}function Kf(n,a,l,i){const c=l>=n.x?1:-1,d=Math.min(Cy,Math.abs(l-n.x)/2,(a-n.y-14)/2);return[`M${n.x},${n.y+14}`,`V${a-d}`,`Q${n.x},${a} ${n.x+c*d},${a}`,`H${l-c*d}`,`Q${l},${a} ${l},${a+d}`,`V${i}`].join(" ")}function FC(n,a,l){const i=l.x>a.x?1:-1,c=Math.min(Cy,Math.abs(l.x-a.x)/2,(a.top-n)/2);return[`M${a.x},${a.top}`,`V${n+c}`,`Q${a.x},${n} ${a.x+i*c},${n}`,`H${l.x-i*c}`,`Q${l.x},${n} ${l.x},${n+c}`,`V${l.top}`].join(" ")}function VC(n,a,l){const i=a.left+a.width/2,c=l.left+l.width/2,d=n-7,m=(n-25-.25*d)/.75;return`M${i},${d} C${i},${m} ${c},${m} ${c},${d}`}function GC(n,a){var i,c;const l=n.samples.find(d=>d.id===a);for(const d of(l==null?void 0:l.experiments)??[]){const f=(i=n.experiments[d])==null?void 0:i.normal,m=f?(c=n.experiments[f])==null?void 0:c.sample:void 0;if(m&&m!==a)return m}return null}function qC({data:n,sampleId:a,fingerprint:l,onSample:i}){const c=C.useRef(null),[d,f]=C.useState(null),[m,g]=C.useState(!1);C.useEffect(()=>{if(!d||m)return;const A=requestAnimationFrame(()=>g(!0));return()=>cancelAnimationFrame(A)},[d,m]);const v=new Set(n.failures.map(A=>A.sample)),x=C.useRef(a),[p,b]=C.useState(null);C.useEffect(()=>{if(x.current===a)return;const A=x.current;x.current=a,b(T=>({from:A,to:a,n:((T==null?void 0:T.n)??0)+1}))},[a]);const S=GC(n,a);C.useLayoutEffect(()=>{const A=c.current;if(!A)return;const T=()=>{const M=A.getBoundingClientRect(),E=document.getElementById(Ny);if(!E)return;const _=Array.from(A.querySelectorAll("[data-sample]")).map(Z=>{const z=Z.getBoundingClientRect();return{id:Z.dataset.sample,x:z.left-M.left+22,left:z.left-M.left,width:z.width,top:z.top-M.top,bottom:z.bottom-M.top}}),D=UC(E,M),P=Math.min(..._.map(Z=>Z.top));f({root:D,trunk:P-My,tabs:_})};if(T(),typeof ResizeObserver>"u")return;const O=new ResizeObserver(T);return O.observe(A),()=>O.disconnect()},[n,a]);const j=d==null?void 0:d.tabs.find(A=>A.id===a),N=S?d==null?void 0:d.tabs.find(A=>A.id===S):void 0,R=p?d==null?void 0:d.tabs.find(A=>A.id===p.from):void 0;return r.jsxs("div",{ref:c,className:"ltabs",children:[d&&r.jsxs("svg",{className:"ltabs-links","aria-hidden":!0,children:[d.tabs.map(A=>r.jsx("path",{d:Kf(d.root,d.trunk,A.x,A.top)},A.id)),j&&r.jsxs(r.Fragment,{children:[r.jsx("path",{className:"ltabs-haze","data-moving":m,style:{d:`path("${Kf(d.root,d.trunk,j.x,j.top)}")`}}),r.jsx("path",{className:"ltabs-on","data-moving":m,style:{d:`path("${Kf(d.root,d.trunk,j.x,j.top)}")`}}),R&&p&&p.to===j.id&&r.jsx("path",{className:"ltabs-bead",pathLength:1,d:FC(d.trunk,R,j)},`bead-${p.n}`)]}),j&&N&&r.jsxs("g",{className:"ltabs-match",children:[r.jsx("path",{d:VC(d.trunk,j,N)}),r.jsx("text",{x:(j.left+j.width/2+N.left+N.width/2)/2,y:d.trunk-27,children:"matched normal"})]})]}),j&&r.jsx("span",{className:"ltabs-thumb","data-moving":m,"aria-hidden":!0,style:{width:j.width,height:j.bottom-j.top,transform:`translate(${j.left}px, ${j.top}px)`}}),r.jsx("div",{className:"ltabs-row",role:"tablist","aria-label":"Samples",children:n.samples.map(A=>{const T=A.id===a,O=l==null?void 0:l.samples.find(E=>E.sample===A.id),M=A.experiments.map(E=>({id:E,...n.experiments[E]})).filter(E=>E.technique);return r.jsxs("button",{type:"button",role:"tab","data-sample":A.id,"aria-selected":T,className:"ltab",onClick:()=>i(A.id),children:[r.jsxs("span",{className:"ltab-name",children:[A.category==="TUMOR"?r.jsx(Og,{fingerprint:O,size:"mini",className:"h-[18px] w-[18px] flex-none"}):r.jsx(by,{size:15,"aria-hidden":!0,className:"flex-none"}),eo(A.id,n.individual.id)," ",A.category==="TUMOR"?"tumour":"normal",v.has(A.id)&&r.jsx("span",{className:"ltab-warn",title:"A module failed for this sample","aria-label":"A module failed"})]}),r.jsxs("span",{className:"ltab-exps",children:[M.length===0&&r.jsx("span",{children:"No experiments"}),M.map(E=>{const _=$C[E.technique],D=(_==null?void 0:_.icon)??ld;return r.jsxs("span",{title:E.id,children:[r.jsx(D,{size:12,"aria-hidden":!0}),(_==null?void 0:_.label)??E.technique]},E.id)})]})]},A.id)})})]})}function IC({data:n,sampleId:a,fingerprint:l,onSample:i}){return r.jsx("div",{className:"ctabs",role:"tablist","aria-label":"Samples",children:n.samples.map(c=>{const d=l==null?void 0:l.samples.find(f=>f.sample===c.id);return r.jsxs("button",{type:"button",role:"tab","aria-selected":c.id===a,className:"ctab",onClick:()=>i(c.id),children:[c.category==="TUMOR"?r.jsx(Og,{fingerprint:d,size:"mini",className:"h-[16px] w-[16px] flex-none"}):r.jsx(by,{size:14,"aria-hidden":!0,className:"flex-none"}),eo(c.id,n.individual.id)," ",c.category==="TUMOR"?"tumour":"normal"]},c.id)})})}function to(n){let a=n;const l=new Set;return{get:()=>a,set:i=>{Object.is(i,a)||(a=i,l.forEach(c=>c()))},subscribe:i=>(l.add(i),()=>l.delete(i))}}function tc(n){return C.useSyncExternalStore(n.subscribe,n.get,n.get)}const zg=to(!1),qr=()=>zg.set(!0),Ou=()=>zg.set(!1),PC=to(!0);function Ey({individualId:n,subtitle:a,details:l,patientIcon:i,report:c,compact:d,headerInView:f=PC}){const m=!tc(f),[g,v]=C.useState(!1),[x,p]=C.useState(!1);C.useEffect(()=>{const S=()=>p(window.scrollY>4);return S(),window.addEventListener("scroll",S,{passive:!0}),()=>window.removeEventListener("scroll",S)},[]);async function b(){try{await navigator.clipboard.writeText(window.location.href),v(!0),window.setTimeout(()=>v(!1),1600)}catch{window.prompt("Copy this link",window.location.href)}}return r.jsxs("div",{className:"topbar flex flex-wrap items-center justify-between gap-x-4 gap-y-3 px-8 pt-3 pb-2","data-scrolled":x,children:[r.jsxs("nav",{"aria-label":"Breadcrumb",className:"flex min-w-0 flex-1 items-center gap-2 text-[13.5px]",children:[r.jsx("button",{type:"button",className:"crumb",onClick:qr,title:"Browse projects and patients",children:"Patients"}),n&&r.jsxs(r.Fragment,{children:[r.jsx(ad,{size:14,"aria-hidden":!0,style:{color:"var(--chev)"}}),i&&r.jsx("span",{id:Ny,className:"ltabs-icon",children:i}),r.jsx("h1",{className:"m-0 flex-none text-[20px] font-semibold tracking-tight",style:{color:"var(--ink)"},children:n}),a&&r.jsx("span",{className:"ml-1.5 truncate text-[13.5px]",style:{color:"var(--muted)"},children:a}),l]})]}),r.jsxs("div",{className:"flex flex-none flex-wrap items-center gap-2",children:[r.jsx("button",{type:"button",className:"sc-ib","aria-label":"Browse projects and patients",title:"Browse projects and patients (Ctrl or ⌘ K)",onClick:qr,children:r.jsx(Iu,{size:16,"aria-hidden":!0})}),c,r.jsx("button",{type:"button",className:"sc-ib","aria-label":"Copy a link to this view",onClick:b,children:r.jsx(fC,{size:16,"aria-hidden":!0})}),r.jsx("span",{"aria-live":"polite",className:"text-xs",style:{color:"var(--muted)"},children:g?"Link copied":""})]}),d&&r.jsx("div",{className:"topbar-compact","data-open":m,inert:!m,"aria-hidden":!m,children:r.jsx("div",{children:d})})]})}function QC(){const n=_g(),[a,l]=C.useState("");return r.jsxs("div",{className:`wgts ${Wn.theme}`,children:[r.jsx("aside",{className:"side","aria-label":"Navigation",children:r.jsxs("div",{className:"side-brand",children:[r.jsx("span",{className:"side-badge","aria-hidden":!0,children:r.jsx(ld,{size:17,strokeWidth:2})}),r.jsx("span",{className:"side-text side-title",children:"WGTS Reports"}),r.jsx("button",{type:"button",className:"side-search-icon","aria-label":"Browse projects and patients",title:"Browse projects and patients",onClick:qr,children:r.jsx(Iu,{size:17,"aria-hidden":!0})})]})}),r.jsxs("div",{className:"page",children:[r.jsx(Ey,{}),r.jsxs("main",{className:"flex flex-col gap-4 px-8 pt-8 pb-10",children:[r.jsx("h1",{className:"m-0 text-[28px] font-semibold tracking-tight",children:"Open a patient"}),r.jsx("p",{className:"m-0 max-w-[60ch] text-[14.5px]",style:{color:"var(--ink-2)"},children:"Browse the projects that have a dashboard and pick a patient, or enter an individual's system id to see its WGTS report as live charts and tables."}),r.jsx("div",{children:r.jsxs("button",{type:"button",className:"sc-btn sc-b1 gap-2",onClick:qr,children:[r.jsx(cC,{size:16,"aria-hidden":!0}),"Browse projects and patients"]})}),r.jsxs("form",{className:"flex flex-wrap gap-2",onSubmit:i=>{i.preventDefault(),a.trim()&&n(`/${a.trim()}`)},children:[r.jsxs("div",{className:"field w-[340px] max-w-full",children:[r.jsx(Iu,{size:16,"aria-hidden":!0,style:{color:"var(--chev)"}}),r.jsx("label",{className:"sr-only",htmlFor:"open-id",children:"Individual id"}),r.jsx("input",{id:"open-id",placeholder:"IID_H000001",value:a,onChange:i=>l(i.target.value)})]}),r.jsx("button",{type:"submit",className:"sc-btn sc-b1",disabled:!a.trim(),children:"Open"})]})]})]})]})}class od extends Error{}class Ry extends Error{}function YC(){try{return localStorage.getItem(eg)}catch{return null}}function Ty(n){try{n?localStorage.setItem(eg,n):localStorage.removeItem(eg)}catch{}}function _y(){const n=YC();return{Accept:"application/json",...n?{Authorization:`Token ${n}`}:{}}}async function At(n,a={}){const l=new URLSearchParams;for(const[d,f]of Object.entries(a))f&&l.set(d,f);const i=l.toString(),c=await fetch(`${Wn.apiHost}/wgts/api/${n}${i?`?${i}`:""}`,{headers:_y()});if(c.status===401)throw new od;if(c.status===403){const d=await c.json().catch(()=>({}));throw new Ry(d.detail??"You may not see this patient's results.")}if(!c.ok)throw new Error(`The dashboard API answered ${c.status}.`);return await c.json()}async function XC(n){if(!(await fetch(`${Wn.apiHost}/api/v1/auth/`,{headers:{Accept:"application/json",Authorization:`Token ${n}`}})).ok)throw new Error("Isabl did not accept that token.");Ty(n)}async function KC(n,a){const l=await fetch(`${Wn.apiHost}/api/v1/rest-auth/login/`,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({username:n,password:a})});if(!l.ok)throw new Error("Isabl did not accept that username and password.");const i=await l.json();Ty(i.key)}async function Ay(n){const a=await fetch(`${Wn.apiHost}/wgts/api/${n}`,{headers:_y()});if(a.status===401)throw new od;if(!a.ok)throw new Error(`The dashboard API answered ${a.status}.`);return await a.json()}const ZC=()=>Ay("projects/"),JC=n=>Ay(`projects/${n}/individuals/`);function lg(n){const a=n.toUpperCase();return a.startsWith("BATTENBERG")||a.startsWith("CNV_")?"cn":a.startsWith("ANNOT_SNVS")||a.startsWith("ANNOT_INDELS")||a.startsWith("FFPERASE")?"mut":a.startsWith("MSISENSOR")?"msi":"other"}function ig(n){return`fam-${lg(n)}`}function WC(n){return n.pk?`${n.app} #${n.pk}`:n.app}function $n(n){return`${n.app}#${n.pk??""}`}function Oy(n,a){const l=a?`${a}-`:null;return l&&n.startsWith(l)?n.slice(l.length):n}function zy(n){if(!n)return null;const a=n.replace(/_/g," ").trim();return a.charAt(0).toUpperCase()+a.slice(1).toLowerCase()}function eM(n,a){const l=n.samples.filter(d=>typeof d.vaf=="number"),c=l.find(d=>d.dmp_sample===a)??l.reduce((d,f)=>!d||f.vaf>d.vaf?f:d,null);return c?{vaf:c.vaf,sample:c.dmp_sample}:null}function tM(n){return n?n.startsWith("DNA|WG")?"WGS":n.startsWith("DNA|WE")?"WES":n.startsWith("RNA")?"RNA":n:null}function Dy(n){return n.pairs.filter(a=>!a.concordant)}function nM(n,a){const l=n.map(c=>c.concordance).filter(c=>typeof c=="number"),i=Math.min(a??100,...l);return[Math.max(0,Math.floor((i-3)/5)*5),100]}const ky={drivers:"gene",coding:"position",all:"position"},sM=100;function Tv(){return{scope:"drivers",sort:ky.drivers,q:"",effects:[],flags:[],range:null,ffpe:!1}}function Ly(n){return(n.q.trim()?1:0)+n.effects.length+n.flags.length+(n.range?1:0)}function aM(n){const a={scope:n.scope,sort:n.sort,q:n.q.trim()||void 0,effects:n.effects.join(",")||void 0,flags:n.flags.join(",")||void 0,ffpe:n.ffpe?"all":void 0};return n.range&&(a[`${n.range.measure}_min`]=String(n.range.low),a[`${n.range.measure}_max`]=String(n.range.high)),a}const $y={missense:"Missense",truncating:"Truncating",splice:"Splice",inframe:"In-frame",synonymous:"Synonymous",other:"Other"},Hy={hotspot:"Hotspot",in_dmp:"In DMP",oncogene:"Oncogene",tsg:"Tumour suppressor"};function lM(n){return`${n.chrom}:${n.pos}:${n.ref}>${n.alt}`}const Uy=/^(?:chr)?([0-9]{1,2}|[XYxy]):([0-9,]+)(?:-([0-9,]+))?$/;function iM(n){return Uy.test(n.trim())}function _v(n,a,l){return`chr${n}:${a.toLocaleString("en-US")}-${l.toLocaleString("en-US")}`}const oM={GENOMIC_EXACT:"exact match",GENOMIC_POS:"same position",CODON:"same codon",GENE:"same gene"};function rM(n){var d;if(!n)return null;const a=n.split(";"),l=(d=n.match(/SOM=(\d+)/))==null?void 0:d[1],i=oM[a[0]];return!l&&!i?n:[l?`${Number(l).toLocaleString("en-US")} somatic ${l==="1"?"sample":"samples"}`:"",i].filter(Boolean).join(", ")}function cM(n){const a=n==null?void 0:n.match(/^(\d+)\/(\d+)$/);return a?`${a[1]} of ${a[2]} ${a[2]==="1"?"copy":"copies"}`:n}function uM(n){return n.oncogene&&n.tsg?"Oncogene and TSG":n.oncogene?"Oncogene":n.tsg?"TSG":null}const yt=(n,a)=>!(a instanceof od)&&n<2;function dM(n,a){return Rt({queryKey:["individual",n,a??null],queryFn:()=>At(`individuals/${encodeURIComponent(n)}/`,{version:a}),retry:yt})}function hM(n,a,l){return Rt({queryKey:["metrics",n,a,l??null],queryFn:()=>At(`individuals/${encodeURIComponent(n)}/metrics/`,{sample:a,version:l}),enabled:!!a,retry:yt})}function fM(n,a){return Rt({queryKey:["fingerprint",n,a??null],queryFn:()=>At(`individuals/${encodeURIComponent(n)}/fingerprint/`,{version:a}),retry:yt})}const sn=(n,a)=>`individuals/${encodeURIComponent(n)}/${a}/`;function mM(n,a,l){return Rt({queryKey:["cn",n,a,l??null],queryFn:()=>At(sn(n,"cn"),{sample:a,version:l}),enabled:!!a,retry:yt})}function gM(n,a,l,i,c){return Rt({queryKey:["ccf",n,a,l,i,c??null],queryFn:()=>At(sn(n,"ccf"),{sample:a,measure:l,version:c,ffpe:i?"all":void 0}),enabled:!!a,retry:yt})}function pM(n,a,l){return Rt({queryKey:["signatures",n,a,l??null],queryFn:()=>At(sn(n,"signatures"),{sample:a,version:l}),enabled:!!a,retry:yt})}function xM(n,a,l){return Rt({queryKey:["context",n,a,l??null],queryFn:()=>At(sn(n,"context"),{sample:a,version:l}),enabled:!!a,retry:yt})}function vM(n,a,l){return Rt({queryKey:["fga",n,a,l??null],queryFn:()=>At(sn(n,"fga"),{sample:a,version:l}),enabled:!!a,retry:yt})}function yM(n,a,l){return Rt({queryKey:["tmb",n,a,l??null],queryFn:()=>At(sn(n,"tmb"),{sample:a,version:l}),enabled:!!a,retry:yt})}function bM(n,a,l){return Rt({queryKey:["circos",n,a,l??null],queryFn:()=>At(sn(n,"circos"),{sample:a,version:l}),enabled:!!a,retry:yt})}function SM(n,a,l,i){return Rt({queryKey:["cnsv",n,a,l,i??null],queryFn:()=>At(sn(n,"cnsv"),{sample:a,chrom:l,version:i}),enabled:!!a,placeholderData:ed,retry:yt})}function jM(n,a,l,i){return Rt({queryKey:["raw-cn",n,a,i??null],queryFn:()=>At(sn(n,"raw-cn"),{sample:a,version:i}),enabled:!!a&&l,retry:yt})}function wM(n,a,l){return Rt({queryKey:["rna",n,a,l??null],queryFn:()=>At(sn(n,"rna"),{sample:a,version:l}),enabled:!!a,retry:yt})}function NM(n,a,l){return Rt({queryKey:["dmp",n,a,l??null],queryFn:()=>At(sn(n,"dmp"),{sample:a,version:l}),enabled:!!a,placeholderData:ed,retry:yt})}function CM(n,a,l){return Rt({queryKey:["quality",n,l??null],queryFn:()=>At(sn(n,"quality"),{version:l}),enabled:a,retry:yt})}function MM(n,a,l){return Rt({queryKey:["results",n,l??null],queryFn:()=>At(sn(n,"results"),{version:l}),enabled:a,retry:yt})}function EM(n,a,l){return Rt({queryKey:["treatments",n,a,l??null],queryFn:()=>At(sn(n,"treatments"),{sample:a,version:l}),enabled:!!a,retry:yt})}function RM(n,a,l){return Rt({queryKey:["svs",n,a,l??null],queryFn:()=>At(sn(n,"svs"),{sample:a,version:l}),enabled:!!a,retry:yt})}function TM(n,a,l,i){return nN({queryKey:["variants",n,a,l,i??null],queryFn:({pageParam:c})=>At(sn(n,"variants"),{sample:a,version:i,...aM(l),page:String(c),page_size:String(sM)}),initialPageParam:1,getNextPageParam:(c,d,f)=>c.status!=="ok"||!c.data?void 0:d.reduce((g,v)=>g+(v.status==="ok"&&v.data?v.data.rows.length:0),0)<c.data.total?f+1:void 0,enabled:!!a,placeholderData:ed,retry:yt})}function _M(){return Rt({queryKey:["picker","projects"],queryFn:ZC,staleTime:6e4,retry:yt})}function AM(n){return Rt({queryKey:["picker","patients",n],queryFn:()=>JC(n),staleTime:6e4,placeholderData:ed,retry:yt})}const ql=6,OM=16,By=7,vo=6;function Zf(n){const a=Math.min(By,(n-vo)/2);return`M${ql},${vo} V${n-a}`}function Jf(n){const a=Math.min(By,(n-vo)/2);return`M${ql},${n-a} Q${ql},${n} ${ql+a},${n} H${OM}`}function zM(n,a){return`M${ql},${n} V${a}`}function DM(n,a,l,i){const[c,d]=C.useState(null),[f,m]=C.useState([]),[g,v]=C.useState(!1),[x,p]=C.useState(null),[b,S]=C.useState(280),j=n.map(_=>`${_.key}:${_.available}`).join();C.useLayoutEffect(()=>{if(!c)return;const _=()=>{const P=Array.from(c.querySelectorAll(l));m(n.flatMap((Z,z)=>{const te=P[z];if(!te)return[];const ie=te.offsetTop,J=te.offsetHeight;return[{key:Z.key,cy:ie+J/2,top:ie,height:J,available:Z.available}]}))};if(_(),typeof ResizeObserver>"u")return;const D=new ResizeObserver(_);return D.observe(c),()=>D.disconnect()},[c,j,l,i]);const N=f.find(_=>_.key===a&&_.available),R=N?{top:N.top,height:N.height}:null;C.useEffect(()=>{if(!N||g)return;const _=requestAnimationFrame(()=>v(!0));return()=>cancelAnimationFrame(_)},[N,g]);const[A,T]=C.useState(a);C.useEffect(()=>{if(A===a)return;const _=A;T(a),_&&a&&p(D=>({from:_,to:a,n:((D==null?void 0:D.n)??0)+1}))},[a,A]);const O=x?f.find(_=>_.key===x.from):void 0,[M,E]=C.useState(null);return C.useLayoutEffect(()=>{if(N&&M!==null&&M!==N.cy){const _=Math.abs(N.cy-M)/38;S(Math.round(Math.min(620,240+80*_)))}E(N?N.cy:null)},[N==null?void 0:N.key,N==null?void 0:N.cy]),{setBox:d,tree:f,on:N,light:R,glides:g,hop:x,leaving:O,duration:b}}function kM({tree:n,on:a,light:l,glides:i,hop:c,leaving:d}){return r.jsxs(r.Fragment,{children:[n.length>0&&r.jsxs("svg",{className:"ltabs-links side-tree","aria-hidden":!0,children:[r.jsx("circle",{cx:ql,cy:vo,r:"2.5",className:"side-root"}),r.jsx("path",{d:Zf(n[n.length-1].cy)}),n.map(f=>r.jsx("path",{d:Jf(f.cy),"data-off":f.available?void 0:"true"},f.key)),a&&r.jsxs(r.Fragment,{children:[r.jsx("path",{className:"ltabs-haze","data-moving":i,style:{d:`path("${Zf(a.cy)}")`}}),r.jsx("path",{className:"ltabs-on","data-moving":i,style:{d:`path("${Zf(a.cy)}")`}})]}),n.map(f=>r.jsxs("g",{className:"side-stub","data-active":f.key===(a==null?void 0:a.key)||void 0,children:[r.jsx("path",{className:"ltabs-haze",d:Jf(f.cy)}),r.jsx("path",{className:"ltabs-on",d:Jf(f.cy)})]},f.key)),a&&d&&c&&c.to===a.key&&r.jsx("path",{className:"ltabs-bead",pathLength:1,d:zM(d.cy,a.cy)},`bead-${c.n}`)]}),r.jsx("span",{className:"side-light","aria-hidden":!0,"data-on":l?"true":void 0,"data-glides":i||void 0,style:l?{transform:`translateY(${l.top}px)`,height:l.height}:void 0})]})}const Fy=13,Ht=6,LM=8,$M=140;function HM(n){if(typeof matchMedia<"u"&&!matchMedia("(min-width: 900px)").matches)return null;const a=n.parentElement,l=a==null?void 0:a.querySelector(".ltabs"),i=l?BC(l):null;return a&&i!==null?i-a.getBoundingClientRect().top:null}const Vy=n=>n.x+2*Ht+4-Ht;function Gy(n,a,l){const i=Math.max(l??n.base+Fy,n.base+2*Ht);return[`q${Ht},0 ${Ht},${Ht}`,`V${i-Ht}`,`q0,${Ht} ${-Ht},${Ht}`,`H${a.x+Ht}`,`q${-Ht},0 ${-Ht},${Ht}`,`V${a.root}`]}function UM(n,a,l){return[`M${n.barLeft},${n.bar} H${n.barRight}`,`M${n.x},${n.top} V${n.base-Ht}`,`q0,${Ht} ${Ht},${Ht}`,`H${Vy(n)}`,...Gy(n,a,l)].join(" ")}function BM(n,a,l){return[`M${Vy(n)},${n.base}`,...Gy(n,a,l)].join(" ")}function Av(n,a){const l=a.firstChild,i=document.createElement("canvas").getContext("2d");if(!l||!(i!=null&&i.measureText))return null;const c=getComputedStyle(n);i.font=`${c.fontWeight} ${c.fontSize} ${c.fontFamily}`;const d=i.measureText("t"),f=i.measureText("x"),m=i.measureText(n.textContent??"");if(!d||!f||!Number.isFinite(d.actualBoundingBoxRight)||!Number.isFinite(m==null?void 0:m.fontBoundingBoxAscent))return null;const g=a.getBoundingClientRect();if(!g.width)return null;const v=parseFloat(c.lineHeight)||n.getBoundingClientRect().height,x=n.getBoundingClientRect().top+(v-m.fontBoundingBoxAscent-m.fontBoundingBoxDescent)/2+m.fontBoundingBoxAscent,p=g.left-d.actualBoundingBoxLeft,b=g.left+d.actualBoundingBoxRight;return{x:p+(b-p)*.42,top:x-d.actualBoundingBoxAscent+1,bar:x-f.actualBoundingBoxAscent+1,base:x-1.2,barLeft:p+.6,barRight:b-.6}}function FM({watch:n}){const a=C.useRef(null),l=C.useRef(null),[i,c]=C.useState(null);return C.useLayoutEffect(()=>{var x,p;const d=a.current,f=l.current,m=d==null?void 0:d.closest(".side");if(!m||!d||!f)return;const g=()=>{const b=m.querySelector(".side-nav");if(!b)return;m.style.setProperty("--neon-drop","0px");let S=Av(d,f);if(!S)return;const j=HM(m),N=j===null?null:j-(S.base+m.scrollTop-m.getBoundingClientRect().top+Fy+LM),R=j!==null&&N!==null&&N>=0&&N<$M;R&&(m.style.setProperty("--neon-drop",`${Math.round(N)}px`),S=Av(d,f)??S);const A=m.getBoundingClientRect(),T=m.scrollLeft-A.left,O=m.scrollTop-A.top,M=b.getBoundingClientRect(),E={x:S.x+T,top:S.top+O,bar:S.bar+O,base:S.base+O,barLeft:S.barLeft+T,barRight:S.barRight+T},_={x:M.left+T+ql,root:M.top+O+vo},D=R&&j!==null?j:void 0;c({d:UM(E,_,D),line:BM(E,_,D),width:m.scrollWidth,height:M.top+O+vo+2})};if(g(),(x=document.fonts)==null||x.ready.then(g),typeof ResizeObserver>"u")return;const v=new ResizeObserver(g);v.observe(m);for(const b of Array.from(m.children))v.observe(b);for(const b of[".ltabs",".topbar"]){const S=(p=m.parentElement)==null?void 0:p.querySelector(b);S&&v.observe(S)}return()=>{v.disconnect(),m.style.removeProperty("--neon-drop")}},[n]),r.jsxs(r.Fragment,{children:[r.jsxs("span",{ref:a,className:"neon-word","data-drawn":i?"true":void 0,children:["WGTS Repor",r.jsx("span",{ref:l,className:"neon-t",children:"t"})]}),i&&r.jsxs("svg",{className:"ltabs-links neon-flow",width:i.width,height:i.height,"aria-hidden":!0,children:[r.jsx("path",{className:"ltabs-haze",d:i.line}),r.jsx("path",{className:"ltabs-on",d:i.d})]})]})}function VM({logo:n,onClose:a}){const l=C.useId(),i=C.useRef(null),c=C.useRef(a);return c.current=a,C.useEffect(()=>{var v;const d=document.activeElement;(v=i.current)==null||v.focus();const f=document.documentElement,m=f.style.overflow;f.style.overflow="hidden";const g=x=>{x.key==="Escape"&&c.current()};return document.addEventListener("keydown",g),()=>{document.removeEventListener("keydown",g),f.style.overflow=m,d==null||d.focus()}},[]),Jr.createPortal(r.jsx("div",{className:`info-backdrop ${Wn.theme}`,onMouseDown:d=>d.target===d.currentTarget&&a(),children:r.jsxs("div",{className:"about-dialog",role:"dialog","aria-modal":"true","aria-labelledby":l,children:[r.jsx("button",{ref:i,type:"button",className:"info-close","aria-label":"Close",onClick:a,children:r.jsx(ec,{size:18,"aria-hidden":!0})}),r.jsx("span",{className:"about-logo",role:"img","aria-label":"Memorial Sloan Kettering Cancer Center",style:{"--logo":`url("${n}")`}}),r.jsx("h2",{id:l,className:"sr-only",children:"About this report"}),r.jsxs("p",{className:"about-text",children:["This report is developed and maintained by the ",r.jsx("strong",{className:"about-lab",children:"Andrew McPherson"})," Lab. If you have any questions or concerns, please feel free to reach out."]})]})}),document.body)}const Ov="data:image/svg+xml,%3csvg%20role='img'%20width='230'%20height='46'%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20332.4%2069.1'%3e%3ctitle%3eMemorial%20Sloan%20Kettering%20Cancer%20Center%3c/title%3e%3cdesc%3eMemorial%20Sloan%20Kettering%20Cancer%20Center%20logo.%3c/desc%3e%3cpath%20fill='%23000'%20d='M75.5%2029.4c2.1-.4%202.5-.9%202.5-3.2v-9.4c0-.9-.4-1.3-2.5-1.4v-1h5.7l4.4%2012.1h.2l4.4-12.1h5.7v1c-2%20.1-2.5.3-2.5%201v11.7c0%20.7.5%201%202.5%201v1h-7.1v-1c1.9-.1%202.1-.2%202.1-1V16.4h-.2l-5.2%2013.9h-1l-5.2-13.9h-.2v9.8c0%202.2.2%202.8%202.3%203.2v.9h-6.1v-.9zm23.4-4.7c0%202.5%201.2%204.5%203.6%204.5%201.4%200%202.5-.8%203.4-2l.6.6c-.9%201.5-2.3%202.8-4.7%202.8-3.4%200-5.2-2.4-5.2-5.6%200-3.3%202.1-5.8%205.2-5.8%203.4%200%204.7%202.8%204.5%205.5h-7.4zm5.1-1.1c.1-2-.7-3.6-2.4-3.6-1.5%200-2.5%201-2.7%203.7l5.1-.1zm18.2-4.5c1.7%200%202.7%201.2%202.7%203.4v6c0%20.6.4.8%201.8.8v1h-5.3v-1c1.2%200%201.4-.3%201.4-.8v-5.1c0-2-.7-2.6-2.1-2.6-.8%200-1.7.4-2.6%201.1v6.5c0%20.6.2.8%201.6.8v1h-5.2v-1c1.2%200%201.4-.3%201.4-.8v-5.1c0-2-.8-2.6-2.2-2.6-1.1%200-1.8.5-2.5.9v6.8c0%20.6.2.8%201.4.8v1h-5.3v-1c1.4%200%201.8-.3%201.8-.8v-7c0-.7-.4-1.2-1.8-1.2v-1l3.9-.1v1.7c1.3-.9%202.5-1.7%204.1-1.7%201.2%200%202.2.7%202.6%202%201.4-1.2%202.8-2%204.3-2zm4.9%205.8c0-3.4%202.2-5.8%205.5-5.8%203.4%200%205.5%202.3%205.5%205.7%200%203.4-2.2%205.8-5.5%205.8-3.5%200-5.5-2.4-5.5-5.7zm8.5-.1c0-3.2-1.2-4.7-3.2-4.7-1.9%200-2.9%201.4-2.9%204.7%200%203.2%201.2%204.7%203.2%204.7%201.8%200%202.9-1.5%202.9-4.7zm3.2%204.5c1.4%200%201.8-.3%201.8-.8v-7c0-.7-.4-1.2-1.8-1.2v-1l3.9-.1v1.9c.8-1.1%201.9-2%203.1-2%201.2%200%201.8.8%201.8%201.8%200%20.8-.6%201.4-1.3%201.4-.7%200-1.4-.4-1.4-1.3v-.4c-1.1%200-1.8.7-2.3%201.3v6.5c0%20.6.4.8%202%20.8v1h-6v-.9zm9.7%200c1.4%200%201.8-.3%201.8-.8v-7c0-.7-.3-1.2-1.7-1.2v-1l3.9-.1v9.3c0%20.6.3.8%201.8.8v1h-5.7v-1zm1.4-14.2c0-.9.6-1.5%201.4-1.5.9%200%201.4.6%201.4%201.5s-.6%201.5-1.4%201.5c-.8-.1-1.4-.6-1.4-1.5zm5.3%2012.8c0-1%20.5-2%201.5-2.5%201.8-1%204.7-1.4%205.1-1.7V23c0-2.1-.6-2.9-2.2-2.9-.8%200-1.2.2-1.6.5.2.4.3.8.3%201.1%200%20.7-.5%201.3-1.3%201.3s-1.3-.6-1.3-1.3c0-1.6%202-2.7%204.3-2.7%202.5%200%204%201.1%204%203.4v5.3c0%201.2.2%201.5%201.8%201.3l.1.8c-.9.3-1.4.5-2.1.5-1.3%200-1.6-.5-1.8-1.9h-.2c-1%201.1-2.1%201.9-3.5%201.9-2.1.1-3.1-1-3.1-2.4zm6.6-.4v-2.9c-3.4.8-4.1%201.3-4.1%202.7%200%20.9.5%201.6%201.7%201.6.9.1%201.8-.6%202.4-1.4zm4.7%201.8c1.4%200%201.8-.3%201.8-.8V15.8c0-.7-.5-1.2-1.9-1.2v-1l4-.1v15c0%20.6.4.8%201.8.8v1h-5.7v-1zm11.1-3.7h.9c1.3%202.8%202.9%203.9%204.9%203.9%202.2%200%203.1-1.4%203.1-2.7%200-1.7-1.1-2.4-4.1-3.4-2.2-.8-4.6-1.5-4.6-4.5s2.4-4.8%205.4-4.8c1.4%200%202.2.3%203%20.6l.8-.7h.7v4.7h-.9c-.8-2.2-2.1-3.3-4-3.3-1.5%200-2.8%201-2.8%202.6s1.2%202.2%203.8%203.1c2.2.7%204.6%201.5%204.6%204.5%200%202.4-1.5%205.2-5.5%205.2-1.3%200-2.5-.3-3.5-.7l-1.3.8h-.7v-5.3zm11.7%203.7c1.4%200%201.8-.3%201.8-.8V15.8c0-.7-.5-1.2-1.9-1.2v-1l4-.1v15c0%20.6.4.8%201.8.8v1h-5.7v-1zm6.2-4.4c0-3.4%202.2-5.8%205.5-5.8%203.4%200%205.5%202.3%205.5%205.7%200%203.4-2.2%205.8-5.5%205.8-3.5%200-5.5-2.4-5.5-5.7zm8.5-.1c0-3.2-1.2-4.7-3.2-4.7-1.9%200-2.9%201.4-2.9%204.7%200%203.2%201.2%204.7%203.2%204.7%201.9%200%202.9-1.5%202.9-4.7zm3.6%203.1c0-1%20.5-2%201.5-2.5%201.8-1%204.7-1.4%205.1-1.7V23c0-2.1-.6-2.9-2.2-2.9-.8%200-1.2.2-1.6.5.2.4.3.8.3%201.1%200%20.7-.5%201.3-1.3%201.3s-1.3-.6-1.3-1.3c0-1.6%202-2.7%204.3-2.7%202.5%200%204%201.1%204%203.4v5.3c0%201.2.2%201.5%201.8%201.3l.1.8c-.9.3-1.4.5-2.1.5-1.3%200-1.6-.5-1.8-1.9h-.2c-1%201.1-2.1%201.9-3.5%201.9-2.1.1-3.1-1-3.1-2.4zm6.6-.4v-2.9c-3.4.8-4.1%201.3-4.1%202.7%200%20.9.5%201.6%201.7%201.6%201%20.1%201.8-.6%202.4-1.4zm4.8%201.8c1.4%200%201.8-.3%201.8-.8v-7c0-.7-.4-1.2-1.8-1.2v-1l3.9-.1v1.7c1.3-.9%202.7-1.7%204.3-1.7%201.7%200%202.8%201.2%202.8%203.4v6c0%20.6.3.8%201.8.8v1h-5.5v-1c1.2%200%201.5-.3%201.5-.8v-5.1c0-2-.7-2.6-2.1-2.6-1.1%200-2%20.5-2.7.9v6.8c0%20.6.3.8%201.5.8v1H219v-1.1zm22.2-1.1c0%20.8.1%201%202%201v1h-7v-1c2-.1%202.5-.3%202.5-1V16.5c0-.7-.5-1-2.5-1v-1h7.3v1c-2.1.1-2.3.2-2.3%201v6.2l5.2-5.2c1.2-1.2%201.1-1.9-.7-2.1v-.9h6.2v.9c-1.8.3-2.5.7-4.2%202.4l-3.2%203.1%204.7%206.4c.9%201.2%201.3%201.8%203.3%202.1v1h-7v-1c1.7-.2%202.1-.6%201.3-1.7l-3.7-5.2-1.7%201.6v4.1zm14-3.5c0%202.5%201.2%204.5%203.6%204.5%201.4%200%202.5-.8%203.4-2l.6.6c-.9%201.5-2.3%202.8-4.7%202.8-3.4%200-5.2-2.4-5.2-5.6%200-3.3%202.1-5.8%205.2-5.8%203.4%200%204.7%202.8%204.5%205.5h-7.4zm5.1-1.1c.1-2-.6-3.6-2.4-3.6-1.5%200-2.5%201-2.7%203.7l5.1-.1zm4.8%203.9v-7.1h-2v-.8l2-.4v-3.1l2.1-.9v4h3.4v1.2h-3.4v6.8c0%201.3.4%201.9%201.4%201.9.7%200%201.2-.5%201.7-1.3l.7.5c-.9%201.6-1.7%202.2-3.2%202.2-1.7.1-2.7-1.1-2.7-3zm8.5%200v-7.1h-2v-.8l2-.4v-3.1l2.1-.9v4h3.4v1.2h-3.4v6.8c0%201.3.4%201.9%201.4%201.9.7%200%201.2-.5%201.7-1.3l.7.5c-.9%201.6-1.7%202.2-3.2%202.2-1.8.1-2.7-1.1-2.7-3zm8.9-2.8c0%202.5%201.2%204.5%203.6%204.5%201.4%200%202.5-.8%203.4-2l.6.6c-.9%201.5-2.3%202.8-4.7%202.8-3.4%200-5.2-2.4-5.2-5.6%200-3.3%202.1-5.8%205.2-5.8%203.4%200%204.7%202.8%204.5%205.5h-7.4zm5.1-1.1c.1-2-.7-3.6-2.4-3.6-1.5%200-2.5%201-2.7%203.7l5.1-.1zm3.3%205.7c1.4%200%201.8-.3%201.8-.8v-7c0-.7-.4-1.2-1.8-1.2v-1l3.9-.1v1.9c.8-1.1%201.9-2%203.1-2%201.2%200%201.8.8%201.8%201.8%200%20.8-.6%201.4-1.3%201.4-.7%200-1.4-.4-1.4-1.3v-.4c-1.1%200-1.8.7-2.3%201.3v6.5c0%20.6.4.8%202%20.8v1h-6v-.9zm9.7%200c1.4%200%201.8-.3%201.8-.8v-7c0-.7-.3-1.2-1.7-1.2v-1l3.9-.1v9.3c0%20.6.3.8%201.8.8v1h-5.7v-1zm1.3-14.2c0-.9.6-1.5%201.4-1.5.9%200%201.4.6%201.4%201.5s-.6%201.5-1.4%201.5c-.8-.1-1.4-.6-1.4-1.5zm5.4%2014.2c1.4%200%201.8-.3%201.8-.8v-7c0-.7-.4-1.2-1.8-1.2v-1l3.9-.1v1.7c1.3-.9%202.7-1.7%204.3-1.7%201.7%200%202.8%201.2%202.8%203.4v6c0%20.6.3.8%201.8.8v1h-5.5v-1c1.2%200%201.5-.3%201.5-.8v-5.1c0-2-.7-2.6-2.1-2.6-1.1%200-2%20.5-2.7.9v6.8c0%20.6.3.8%201.5.8v1h-5.5v-1.1zm22.8-11.7c.8%200%201.3.5%201.3%201.2%200%20.6-.4%201.1-.9%201.1-.6%200-1.1-.4-1.1-1.1-.5.2-1.1.6-1.4%201.1%201%20.6%201.7%201.6%201.7%203%200%202.3-1.9%203.8-4.3%203.8-.5%200-1%200-1.4-.2-.6.3-1%20.7-1%201.1%200%20.5.3%201%202.3%201h1.1c3.2%200%204.6.8%204.6%202.8%200%201.9-2%204-5.8%204-3.2%200-4.8-1.2-4.8-2.6%200-1.1%201.1-2.1%202.9-2.4V30c-1.4-.3-1.9-.9-1.9-1.9%200-.7.6-1.4%201.7-2-1.2-.6-2-1.6-2-3.2%200-2.3%201.9-3.8%204.4-3.8.7%200%201.4.1%201.9.3.4-1%201.4-1.8%202.7-1.8zm-.9%2014.5c0-1-.6-1.6-3-1.6h-2c-1.3.2-2.1.9-2.1%201.9%200%201.1%201.2%201.9%203.6%201.9%202.1-.1%203.5-1.1%203.5-2.2zm-1.7-9.2c0-1.8-.9-2.9-2.2-2.9-1.2%200-2%20.7-2%202.9s1%202.8%202.2%202.8c1.1%200%202-.8%202-2.8zM75.6%2047.6c0-4.9%203.6-8.5%208.2-8.5%201.7%200%202.9.6%203.8%201.1l.7-1h.9v5.5h-.8c-1.1-2.7-2.5-4.3-4.9-4.3-2.8%200-5.2%202.5-5.2%207.2%200%204.4%202.8%206.7%205.6%206.7%202.7%200%204-1.5%205-3.5l1%20.5c-1%202.3-3.1%204.6-6.6%204.6-4.5-.1-7.7-3.4-7.7-8.3zM91.1%2053c0-1%20.5-2%201.5-2.5%201.8-1%204.7-1.4%205.1-1.7v-.7c0-2.1-.6-2.9-2.2-2.9-.8%200-1.2.2-1.6.5.2.4.3.8.3%201.1%200%20.7-.5%201.3-1.3%201.3s-1.3-.6-1.3-1.3c0-1.6%202-2.7%204.3-2.7%202.5%200%204%201.1%204%203.4v5.3c0%201.2.2%201.5%201.8%201.3l.1.8c-.9.3-1.4.5-2.1.5-1.3%200-1.6-.5-1.8-1.9h-.2c-1%201.1-2.1%201.9-3.5%201.9-2.1.1-3.1-1-3.1-2.4zm6.5-.4v-2.9c-3.4.8-4.1%201.3-4.1%202.7%200%20.9.5%201.6%201.7%201.6%201%20.1%201.9-.7%202.4-1.4zm4.9%201.8c1.4%200%201.8-.3%201.8-.8v-7c0-.7-.4-1.2-1.8-1.2v-1l3.9-.1V46c1.3-.9%202.7-1.7%204.3-1.7%201.7%200%202.8%201.2%202.8%203.4v6c0%20.6.3.8%201.7.8v1h-5.5v-1c1.2%200%201.5-.3%201.5-.8v-5.1c0-2-.7-2.6-2.1-2.6-1.1%200-2%20.5-2.7.9v6.8c0%20.6.3.8%201.5.8v1h-5.5v-1.1zm13.1-4.4c0-3.4%202.4-5.8%205.4-5.8%202.5%200%204%201.4%204%202.7%200%20.9-.6%201.6-1.4%201.6-.8%200-1.4-.5-1.4-1.2s.4-1.1.8-1.3c-.3-.4-1.1-.8-2-.8-1.8%200-3.1%201.2-3.1%204.3%200%202.9%201.3%204.7%203.6%204.7%201.3%200%202.4-.7%203.2-1.7l.6.6c-1%201.5-2.3%202.5-4.6%202.5-3.1%200-5.1-2.4-5.1-5.6zm12.8-.2c0%202.5%201.2%204.5%203.6%204.5%201.3%200%202.5-.8%203.4-2l.6.6c-.9%201.5-2.3%202.8-4.7%202.8-3.4%200-5.2-2.4-5.2-5.6%200-3.3%202.1-5.8%205.2-5.8%203.4%200%204.7%202.8%204.5%205.5h-7.4zm5.1-1.1c.1-2-.7-3.6-2.4-3.6-1.5%200-2.5%201-2.7%203.7l5.1-.1zm3.3%205.7c1.4%200%201.8-.3%201.8-.8v-7c0-.7-.4-1.2-1.8-1.2v-1l3.9-.1v1.9c.8-1.1%201.9-2%203.1-2%201.2%200%201.8.8%201.8%201.8%200%20.8-.6%201.4-1.3%201.4-.7%200-1.4-.4-1.4-1.3v-.4c-1.1%200-1.8.7-2.3%201.3v6.5c0%20.6.4.8%202%20.8v1h-6v-.9zm13.5-6.8c0-4.9%203.6-8.5%208.2-8.5%201.7%200%202.9.6%203.8%201.1l.7-1h.9v5.5h-.8c-1.1-2.7-2.5-4.3-4.9-4.3-2.8%200-5.2%202.5-5.2%207.2%200%204.4%202.8%206.7%205.6%206.7%202.7%200%204-1.5%205-3.5l1%20.5c-1%202.3-3.1%204.6-6.6%204.6-4.5-.1-7.7-3.4-7.7-8.3zm18%202.2c0%202.5%201.2%204.5%203.6%204.5%201.3%200%202.5-.8%203.4-2l.6.6c-.9%201.5-2.3%202.8-4.7%202.8-3.4%200-5.2-2.4-5.2-5.6%200-3.3%202.1-5.8%205.2-5.8%203.4%200%204.7%202.8%204.5%205.5h-7.4zm5-1.1c.1-2-.7-3.6-2.4-3.6-1.5%200-2.5%201-2.7%203.7l5.1-.1zm3.3%205.7c1.4%200%201.8-.3%201.8-.8v-7c0-.7-.4-1.2-1.8-1.2v-1l3.9-.1V46c1.3-.9%202.7-1.7%204.3-1.7%201.7%200%202.8%201.2%202.8%203.4v6c0%20.6.3.8%201.8.8v1h-5.5v-1c1.2%200%201.5-.3%201.5-.8v-5.1c0-2-.7-2.6-2.2-2.6-1.1%200-2%20.5-2.7.9v6.8c0%20.6.3.8%201.5.8v1h-5.5v-1.1zm14.5-1.8v-7.1h-2v-.8l2-.4v-3.1l2.1-.9v4h3.4v1.2h-3.4v6.8c0%201.3.4%201.9%201.4%201.9.7%200%201.2-.5%201.7-1.3l.7.5c-.9%201.6-1.7%202.2-3.2%202.2-1.8%200-2.7-1.1-2.7-3zm8.9-2.8c0%202.5%201.2%204.5%203.6%204.5%201.4%200%202.5-.8%203.4-2l.6.6c-.9%201.5-2.3%202.8-4.7%202.8-3.4%200-5.2-2.4-5.2-5.6%200-3.3%202.1-5.8%205.2-5.8%203.4%200%204.7%202.8%204.5%205.5H200zm5.1-1.1c.1-2-.6-3.6-2.4-3.6-1.5%200-2.5%201-2.7%203.7l5.1-.1zm3.3%205.7c1.4%200%201.8-.3%201.8-.8v-7c0-.7-.4-1.2-1.8-1.2v-1l3.9-.1v1.9c.8-1.1%201.9-2%203.1-2%201.2%200%201.8.8%201.8%201.8%200%20.8-.6%201.4-1.3%201.4-.7%200-1.4-.4-1.4-1.3v-.4c-1.1%200-1.8.7-2.3%201.3v6.5c0%20.6.4.8%202%20.8v1h-6v-.9zM18.7%2053.3l.6.1-1%207.8-.9-.1.9-6.9-1.5.3-.1-.7%202-.5zm5.9%208.5c-1.6-.1-2.9-1.1-2.8-2.4%200-.9.7-1.6%201.7-1.8-.7-.4-1.3-1-1.2-1.9%200-1.2%201.3-2%202.8-1.9%201.4.1%202.6%201%202.5%202.2%200%20.9-.7%201.4-1.4%201.7.9.4%201.5%201.1%201.5%202-.2%201.4-1.5%202.2-3.1%202.1zm.2-3.7c-1.1-.1-2.1.5-2.1%201.4%200%20.8.7%201.5%202%201.6%201.3.1%202.1-.6%202.1-1.4%200-.9-.9-1.5-2-1.6zm.1-3.5c-1-.1-1.8.5-1.8%201.3-.1.9.7%201.5%201.7%201.5s1.8-.5%201.9-1.4c0-.7-.7-1.4-1.8-1.4zm8.5%207.3c-1.7.1-3-.8-3-2.1%200-.9.6-1.6%201.5-2-.7-.3-1.4-.8-1.4-1.7%200-1.2%201.2-2.1%202.6-2.2%201.4%200%202.7.8%202.7%202%200%20.9-.6%201.5-1.3%201.8.9.3%201.6.9%201.7%201.8%200%201.4-1.2%202.3-2.8%202.4zm-.2-3.7c-1.1%200-2%20.7-2%201.6%200%20.8.8%201.4%202.1%201.4%201.3-.1%202-.7%202-1.5%200-1-.9-1.6-2.1-1.5zm-.1-3.6c-1%200-1.8.6-1.7%201.4%200%20.9.8%201.4%201.8%201.4s1.8-.6%201.7-1.5c0-.7-.8-1.3-1.8-1.3zm9.3-1.5l.7%205.2%201.2-.2.1.7-1.2.2.2%201.8-.8.2-.2-1.8-4.1.5-.3-.6%203.7-5.9.7-.1zm-.7%201.3L39%2058.8l3.2-.4-.5-4zm-9.5-39.2l7.5%207.5%202.4-2.4L30.5%208.7%2018.9%2020.3l2.4%202.4%207.5-7.5v12.1h-8.3v3.4h8.3v2.9h-8.3V37h8.3v3h-8.3v3.4h8.3v8.7h3.4v-8.7h8.3V40h-8.3v-3h8.2v-3.4h-8.2v-2.9h8.3v-3.4h-8.3V15.2zm27.6%207.2c-2.5-11-9-18.2-18.9-21.1C37.9.5%2034.5%200%2030.8%200h-.3c-3.9%200-7.5.5-10.6%201.4-9.6%202.9-16%2010-18.5%2021C.5%2026%200%2029.9%200%2034.3s.4%208.4%201.2%2012c2.6%2011.5%209.4%2018.9%2019.9%2021.6%202.8.7%205.9%201.1%209.2%201.1h.3c3.3%200%206.4-.4%209.2-1%2010.5-2.6%2017.3-10%2020-21.6.8-3.5%201.2-7.4%201.2-11.6.1-4.6-.3-8.7-1.2-12.4zm-3.8%2024c-2%208.1-6.7%2015.4-16.5%2018.1-2.6.7-5.6%201.1-9.1%201.1h-.3c-3.4%200-6.5-.5-9.1-1.2-9.7-2.8-14.4-10-16.4-18.1-1-3.9-1.3-8.1-1.3-12%200-3.7.4-7.6%201.3-11.3%201.9-7.9%206.2-15%2015.2-18%202.9-1%206.4-1.6%2010.4-1.6h.3c3.9%200%207.2.6%2010%201.5%209.2%203%2013.6%2010.1%2015.5%2018%20.9%203.9%201.3%208%201.2%2011.8.1%203.8-.3%207.8-1.2%2011.7z'%3e%3c/path%3e%3c/svg%3e",Wf=[{key:"overview",label:"Overview",icon:hC},{key:"copyNumber",label:"Copy number",icon:aC},{key:"mutations",label:"Mutations",icon:pC},{key:"structuralVariants",label:"Structural variants",icon:wC},{key:"circos",label:"Circos",icon:vC},{key:"cnsv",label:"CN/SV by chromosome",icon:my},{key:"signatures",label:"Signatures and HRD",icon:iC},{key:"rna",label:"RNA",icon:EC},{key:"treatments",label:"Treatments",icon:SC},{key:"dmp",label:"DMP results",icon:NC},{key:"quality",label:"Quality",icon:xy},{key:"germline",label:"Germline",icon:jC,soon:!0}],zv="wgts-side-collapsed",qy=to(!1);function GM(){const[n,a]=C.useState(()=>{try{return localStorage.getItem(zv)==="1"}catch{return!1}});return C.useEffect(()=>qy.set(n),[n]),[n,i=>{a(i);try{localStorage.setItem(zv,i?"1":"0")}catch{}}]}function qM({analyses:n,onPage:a,sampleLabel:l,picked:i,onPick:c,sections:d,activeStore:f,onSection:m,profile:g}){const v=tc(f),[x,p]=GM(),{setBox:b,...S}=DM(Wf.map(({key:z})=>({key:z,available:d.has(z)})),v,".sc-nav",x),[j,N]=C.useState(!1),[R,A]=C.useState(!1),[T,O]=C.useState(!1),M=["cn","mut","msi","other"],E=(z,te)=>M.indexOf(lg(z.app))-M.indexOf(lg(te.app))||z.app.localeCompare(te.app),_=T||i!==null;C.useEffect(()=>{const z=te=>{te.key.toLowerCase()==="k"&&(te.metaKey||te.ctrlKey)&&(te.preventDefault(),qr())};return document.addEventListener("keydown",z),()=>document.removeEventListener("keydown",z)},[]);const D=n.filter(z=>z.role==="input"),P=D.filter(z=>a.has($n(z))).sort(E),Z=[...D.filter(z=>!a.has($n(z))).sort(E),...n.filter(z=>z.role==="cohort")];return r.jsxs("aside",{className:"side","aria-label":"Patient navigation","data-collapsed":x||void 0,children:[r.jsxs("div",{className:"side-brand",children:[x?r.jsx("span",{className:"side-badge","aria-label":"WGTS Report",children:r.jsx(ld,{size:17,strokeWidth:2,"aria-hidden":!0})}):r.jsx(FM,{watch:!!g}),r.jsx("button",{type:"button",className:"side-toggle","aria-label":x?"Expand the menu":"Collapse the menu","aria-expanded":!x,title:x?"Expand the menu":"Collapse the menu",onClick:()=>p(!x),children:x?r.jsx(bC,{size:17,"aria-hidden":!0}):r.jsx(yC,{size:17,"aria-hidden":!0})})]}),g&&!x&&r.jsx("section",{className:"side-profile","aria-label":"Patient and sample",children:g}),r.jsxs("nav",{ref:b,"aria-label":"Patient sections",className:"side-nav",style:{"--duration":`${S.duration}ms`},children:[r.jsx(kM,{...S}),Wf.map(({key:z,label:te,icon:ie,soon:J},se)=>{const re=d.has(z);return r.jsxs("div",{className:"contents",children:[J&&!Wf[se-1].soon&&r.jsx("span",{className:"side-group",children:"Coming soon"}),r.jsxs("button",{type:"button",className:"sc-nav","aria-current":re&&v===z?"location":void 0,"aria-label":te,disabled:!re,title:x?te:re?void 0:"Not available for this sample yet",onClick:()=>m(z),children:[r.jsx(ie,{size:17,strokeWidth:1.7,"aria-hidden":!0}),r.jsx("span",{className:"side-text",children:te})]})]},z)})]}),r.jsx("div",{className:"flex-auto"}),r.jsxs("div",{className:"side-foot",children:[r.jsxs("section",{"aria-label":"Analyses on this page",className:"side-sources",children:[r.jsxs("button",{type:"button",className:"side-fold","aria-expanded":_,onClick:()=>O(z=>!z),children:["Analyses on this page",r.jsx("span",{className:"side-count",children:P.length}),r.jsx(py,{size:14,"aria-hidden":!0,"data-open":_})]}),_&&P.length===0&&r.jsxs("span",{className:"px-3 text-xs",style:{color:"var(--menu-muted)"},children:["Nothing on this page reads an analysis for ",l||"this sample","."]}),_&&P.map(z=>{const te=$n(z),ie=z.state==="failed",J=z.modules.filter(se=>se.status==="failed");return r.jsxs("button",{type:"button",className:`tb-src${ie?" fail":""}`,"aria-pressed":i===te,title:ie?J.map(se=>`${se.label} failed`).join("; "):"Show what it feeds",onClick:()=>c(i===te?null:te),children:[ie?r.jsx(Ag,{size:12,strokeWidth:2.6,"aria-hidden":!0,style:{color:"var(--fail-d)",margin:"0 -2px"}}):r.jsx("span",{className:`tb-dot ${ig(z.app)}`,"aria-hidden":!0}),r.jsxs("span",{className:"truncate",children:[z.app," ",z.version??""]}),ie&&r.jsx("span",{className:"sr-only",children:", failed"}),r.jsx("span",{className:"tb-n",children:z.pk?`#${z.pk}`:""})]},te)}),_&&Z.length>0&&r.jsxs(r.Fragment,{children:[r.jsxs("button",{type:"button",className:"tb-src","aria-expanded":j,onClick:()=>N(z=>!z),children:[r.jsx("span",{className:"tb-dot fam-other","aria-hidden":!0}),j?"Hide":"Show"," ",Z.length," more for ",l||"this sample"]}),j&&Z.map(z=>r.jsxs("span",{className:"tb-src",style:{cursor:"default"},children:[r.jsx("span",{className:`tb-dot ${ig(z.app)}`,"aria-hidden":!0}),r.jsx("span",{className:"truncate",children:z.role==="cohort"?`${z.app}${z.project?`, project ${z.project}`:""}`:`${z.app} ${z.version??""}`}),r.jsx("span",{className:"tb-n",children:z.pk?`#${z.pk}`:""})]},$n(z)))]}),_&&r.jsx("span",{className:"px-3 pt-2 text-xs leading-normal",style:{color:"var(--menu-muted)"},children:"Pick one to see what it feeds."})]}),!x&&r.jsx("button",{type:"button",className:"side-msk","aria-label":"About this report",title:"About this report",onClick:()=>A(!0),style:{"--logo":`url("${Ov}")`}}),R&&r.jsx(VM,{logo:Ov,onClose:()=>A(!1)})]})]})}function Al({envelope:n}){const a=n.status==="error",l=a?oC:rC;return r.jsxs("div",{className:"flex items-start gap-2.5 text-sm",style:{color:"var(--ink-2)"},children:[r.jsx(l,{size:18,"aria-hidden":!0,style:{color:a?"var(--warn-ink)":"var(--chev)",flex:"none"}}),r.jsxs("div",{className:"flex flex-col gap-1",children:[r.jsx("span",{className:"font-semibold",style:{color:"var(--ink)"},children:a?"This panel could not be read":"Nothing to show here"}),n.warnings.map(i=>r.jsx("span",{children:i},i))]})]})}const og={summary:{title:"Genome fingerprint and summary",intro:"A one-glance portrait of the selected tumour: its copy-number changes and driver mutations drawn as a ring, a sentence describing them, and the headline measurements of the sample.",sections:[{heading:"The fingerprint ring",paragraphs:["The ring is the whole genome. Chromosome 1 starts at the top and the ring runs clockwise through chromosome 22 to X, each chromosome's arc in proportion to its length (GRCh37).","Copy-number changes are called against the tumour's baseline, its ploidy rounded to whole copies. Very short changes are drawn at a minimum length so they stay visible."],terms:[["Gains (outer track, orange)","Regions with at least one copy more than the baseline."],["Amplifications (outer track, darker and thicker)","Regions with three or more copies above the baseline."],["Losses (inner track, blue)","Regions with at least one copy fewer than the baseline."],["Drivers (black ticks)","Where the tumour's likely driver mutations sit (see the Mutations card for how they are flagged)."]]},{heading:"The sentence",paragraphs:["Written from the same data as the ring: how many amplifications, gains and losses there are and on which chromosomes, and which genes carry driver mutations."]},{heading:"The measurements",paragraphs:["Each tile shows a value, a small picture of where it sits on its scale when it has a natural one, and the analysis it came from. A tile with no value says why: the analysis was not run, it failed, or it does not apply to this kind of report (tumour-only reports have no matched normal)."],terms:[["Purity","The estimated fraction of cells in the sample that are tumour cells, from 0 to 1. The ring fills to the value."],["Ploidy","The tumour's average number of copies across the genome. The scale runs from 1 to 6 copies; the tall tick marks 2, a diploid genome."],["Coverage","The median sequencing depth of the tumour across the genome, in reads (×)."],["TMB per Mb","Tumour mutational burden: somatic SNVs and indels per megabase of genome. The report computes it from the counts of the SNV and indel calls. The scale is logarithmic, 0.01 to 100."],["MSI score","The MSIsensor score: the percentage of microsatellite sites that look unstable in the tumour."],["FGA","Fraction of the genome altered: the share of the genome whose copy number differs from the baseline, from 0 to 1. It is read from the project-wide Battenberg tables."]]},{heading:"Linking back to the analyses",paragraphs:[`Every value names its analysis, with version and Isabl id. Picking an analysis in the side menu's "Analyses on this page" highlights the tiles and cards it feeds.`]}]},copyNumber:{title:"Copy number",intro:"How many copies of each part of the genome the tumour carries, segment by segment, from chromosome 1 to X.",sections:[{heading:"What is drawn",paragraphs:['Each horizontal stroke is one segment: a stretch of the genome with a constant copy number. Its height is the number of copies, from 0 up to 8; anything higher is drawn at the top and the axis reads "8+". A gain or amplification rises as a column from the baseline to its stroke, and a loss falls to it, so the changes read as a landscape. Alternating grey bands mark the chromosomes, named in a strip along the bottom.',`The line across the plot is the baseline: the tumour's ploidy rounded to whole copies (labelled, for example, "2 copies"). Segments are coloured by how they compare with it.`],terms:[["Grey","Neutral: the same number of copies as the baseline."],["Orange","Gain: at least one copy more than the baseline."],["Dark orange","Amplification: three or more copies above the baseline."],["Blue","Loss: at least one copy fewer than the baseline."]]},{heading:"Total or allele-specific",paragraphs:["Total shows all copies together. Allele-specific, when the analysis provides it, splits each segment into its major allele (the more common parental copy, dark) and minor allele (light). Where the two are equal they are drawn slightly apart so both stay visible. A minor allele of 0 means one parent's copy is lost there (loss of heterozygosity)."]},{heading:"Driver genes",paragraphs:["A label along the top names each gene with likely driver mutations, one per gene, joined by a line to a dot on the segment the gene sits on, so its copy number can be read off at once. Hover one for its protein changes and the copies there."]},{heading:"Amplified and lost genes",paragraphs:["The oncogenes the report calls amplified and the tumour suppressors it calls homozygously lost, from the copy number over each gene, in chromosome order. The row of cells shows the copy number (all eight filled means eight copies or more). When the sample has RNA, each gene also shows its expression against each expression cohort: the log2 of this sample's level over the cohort's mean, so +1 is twice the cohort's level. Point at a gene to mark it on the plot; click it to glide to its chromosome."]},{heading:"Fraction of genome altered against the cohort",paragraphs:["The tumour's FGA (the share of the genome whose copy number differs from the baseline) set against every tumour in the project's FGA table, by disease, as the report draws it: only diseases with at least five tumours, plus this tumour's own, highest median first, with some disease labels merged (OSOS and CHOS as OS, MFH as US, LIHB as HBL). Each box spans the middle half of a disease's tumours, the line in it is the median, the whiskers reach the furthest tumours within one and a half box-lengths, and each dot is one tumour. The pin is this tumour; hover a disease for its numbers and, in the tumour's own disease, where it ranks.","The cohort is the one the report compared with when it ran. It does not grow as the project does; rerun the report to compare with the cohort as it is now."]},{heading:"Reading and moving around",terms:[["Hover a segment","Its call, copies (major + minor), coordinates and, when available, log2 ratio. A readout at the foot of the plot gives the pointer's place on the genome."],["Click a segment","Lists the mutations inside it in the Mutations card."],["Click a driver","Finds that gene in the Mutations card."],["Scroll up or down over the plot","Zooms around the pointer: up zooms in, down zooms out (two fingers on a trackpad, or a mouse wheel). A pinch zooms too. A scroll that starts outside the plot keeps scrolling the page, and once the whole genome is in view, scrolling down scrolls the page again."],["Scroll sideways, or drag","Pans a zoomed view (two fingers sideways on a trackpad, or Shift and a mouse wheel)."],["Arrow keys, plus and minus, 0","With the plot focused: pan, zoom in and out, and show the whole genome."],["Double-click a chromosome, or click its name","Glides to fill the view with it; the strip then counts megabases."],["The overview","The whole genome in miniature under the strip. Its window shows where the plot is: drag the window to move, its ends to resize, or click elsewhere to centre it there. The button by the title returns to the whole genome."],["Hover a mutation in the table","Marks it here, with a ring on the segment it sits on and its copy number."]]},{heading:"Tumour-only reports",paragraphs:["Without a matched normal there is no ploidy estimate, so segments come from CNVkit and are called against two copies. Allele-specific copy numbers are not available."]}]},mutations:{title:"Mutations",intro:"The tumour's somatic SNVs and indels that passed the callers' filters: how they are distributed across cancer cells, and a searchable, filterable table of every call.",sections:[{heading:"Which mutations",terms:[["Drivers","Likely drivers flagged by the report: coding mutations that match OncoKB or COSMIC driver annotations (the exact protein change, or a damaging consequence in a known cancer gene), plus known hotspots the callers missed and the report recovered from the tumour's reads."],["Coding","Mutations whose effect changes a protein, by the report's list of coding effects."],["All","Every PASS SNV and indel."]],paragraphs:["The counts beside each choice follow the search and filters, so they always say what you would see."]},{heading:"FFPE samples",paragraphs:["Formalin-fixed (FFPE) tissue damages DNA in ways that look like mutations, mostly C>T changes at low allele fractions. For an FFPE sample, FFPERASE scores each SNV and indel for how likely it is to be such an artifact, and the report counts only the calls scored at or below its threshold (quoted beside the table). Its SNV, indel and coding totals and the TMB leave the rest out.",`The report marks each call it leaves out, and the dashboard follows that mark: the Coding and All counts, the table and the curve leave those calls out, and the card's subtitle says so. Drivers are all listed, as in the report, and any the filter would remove carry an "FFPE filtered" tag. "Show filtered calls", under FFPE filter beside the table, brings the removed calls back, tagged the same way.`]},{heading:"Cancer cell fraction and variant allele fraction",paragraphs:["The curve across the top is a smoothed histogram of every PASS mutation; driver mutations sit on it as labelled dots, and the diamond on the axis is the median. Switch between the two measures:"],terms:[["CCF",'Cancer cell fraction: the estimated share of cancer cells carrying the mutation, corrected for purity and copy number. Around 1 (the "clonal" mark) means nearly every cancer cell has it, which suggests it arose early; clearly below 1 means a subclone. Estimates can land somewhat above 1. Shown from 0 to 2.'],["VAF","Variant allele fraction: the share of sequencing reads at the position that carry the mutation, from 0 to 1. Raw, not corrected for purity or copy number. Tumour-only reports open on VAF, since CCF needs a matched normal."]]},{heading:"Filtering by the curve",paragraphs:["Drag across the curve to keep only mutations in that CCF or VAF range: the curve stays lit inside the range and fades outside it, and the range is read out at its foot. Drag the edges to resize it, or its body to move it. The range appears with the other filters and can be removed there, or by clicking the curve."]},{heading:"Coding mutations against reference cohorts",paragraphs:["At the foot of the card, the tumour's coding SNVs and indels set against reference tumours of the same disease, as the report's TMB figure draws them: Grobner and colleagues' published pan-cancer cohort, where the disease has a match there, and MSK's TMB reference project. Each cohort is a violin cut at its smallest and largest tumour; two cohorts share one violin, one on each side. The bar inside marks the middle half and the circle the median. The line across is this tumour; hover a cohort for its numbers and where the tumour ranks.","Counts are coding mutations as the report counts them (after the FFPE filter for FFPE samples), the same numbers as the Coding tab. The MSK cohort leaves out tumours far above its 99th percentile, as the report does. The cohorts are the ones the report compared with when it ran; rerun the report to compare with them as they are now."]},{heading:"The table",terms:[["Gene and position","The gene, and the mutation's chromosome and position (GRCh37)."],["Change","The protein change, with the cDNA change beneath."],["Effect","What the mutation does to the gene, from the VEP consequence (or the report's effect). Truncating effects are in bold."],["VAF and CCF bars","The value with a bar for quick comparison; the CCF bar's tick marks 1, clonal."],["Driver","Flagged as a likely driver (shown when the table is not already limited to drivers)."],["Hotspot","The exact protein change is a known recurrent cancer hotspot."],["In DMP","The same mutation was also found by the patient's clinical MSK-IMPACT (DMP) sequencing."],["FFPE filtered","FFPE samples only: the report's FFPE artifact filter leaves this call out of its counts (see FFPE samples)."]]},{heading:"Opening a row",terms:[["Variant","SNV or indel, with the reference and alternate bases."],["Reads","Reads supporting the mutation out of all reads at the position. Only hotspots the report recovered from the tumour's reads have them; the callers' tables give no single count."],["Normal VAF","The mutation's allele fraction in the matched normal; near 0 for a somatic mutation."],["Mutant copies","How many copies of that part of the genome carry the mutation, out of all copies there."],["Consequence","The full VEP consequence."],["COSMIC","How many samples in COSMIC carry it, and how closely they match (exact change, same position, codon or gene)."],["Expression","The gene's expression in the tumour's RNA, in transcripts per million, when RNA was sequenced."],["Gene role","Whether the gene is a known oncogene or tumour suppressor gene (TSG)."],["Show on copy number","Zooms the Copy number card to the mutation's chromosome and marks it."]]},{heading:"Searching and filtering",paragraphs:["Search takes a gene, a protein or cDNA change, a COSMIC term, or a locus such as chr12:25,398,284 or a range such as chr8:1-50,000,000. Press / anywhere on the page to jump to it. Each filter's count is how many rows you would get by ticking it, given everything else."],terms:[["Missense","One amino acid replaced by another."],["Truncating","Stop gained or lost, start lost, or a frameshift."],["Splice","Changes a splice site or splice region."],["In-frame","Inserts or deletes amino acids without shifting the reading frame."],["Synonymous","Changes the DNA but not the amino acid."],["Other","Everything else, such as intronic, UTR or upstream changes."]]}]},structuralVariants:{title:"Structural variants",intro:"The tumour's rearrangements as the report shows them: those with a breakpoint in an oncogene or tumour suppressor, those that take in a whole gene, and how all of them group into rearrangement signatures.",sections:[{heading:"Which rearrangements",paragraphs:["The report works from the high-confidence structural variants of ANNOT_SVS, which keeps calls made by two or more callers (SvABA, BRASS and GRIDSS) and annotates the genes they touch with AnnotSV. The count beside the title is how many of these the report counts, its rearrangements total.",`The tables keep the rearrangements whose genes include an oncogene or tumour suppressor, by the report's gene lists. It also searches the callers' raw calls for known rearrangements the high-confidence set can miss, such as CIC fusions, and adds them; a rescued event that is not a two-caller PASS says so in its callers, as in "gridss (CIC rescued)".`]},{heading:"The two tables",terms:[["Rearranged oncogenes and tumour suppressors",'One row per rearrangement and gene it hits, with the gene and breakpoint on each side. A gene near a breakpoint rather than in it is named as the report names it, such as "TERT +/- 100Kb".'],["Whole-gene rearrangements","Rearrangements that take in a whole oncogene or tumour suppressor, from start to end: a deletion of the whole gene, for example."],["Role","Whether the row's genes include an oncogene, a tumour suppressor or both, as the report colours its rows. Click a role above the tables to show only its rows."],["Left and right","Each breakpoint's gene, position (GRCh37) and where it falls in the gene, as AnnotSV writes it (intron5, exon2-exon5). Breakpoints are ordered by chromosome, then position."],["Callers and support","The callers that made the call, and the most reads any of them gives in support."],["Pileups","Supporting reads over all reads at each breakpoint in the tumour's alignments, left then right."],["Expression","For tumours with RNA: whether each gene's expression is high or low against each expression cohort (p63 is cohort project 63): at or above its 90th percentile, at or below its 10th, or neither (None). N/A means the cohort has no value for the gene."]],paragraphs:["Open a row to see both breakpoints, show them on the copy-number card, or copy their IGV loci."]},{heading:"Rearrangement signatures",paragraphs:["WGSPOST groups the tumour's rearrangements the way rearrangement signatures are described: clustered (rearrangements that sit unusually close together, as in chromothripsis) or dispersed, then by class and, except for translocations, by size from under 1 kb to over 1 Mb. Each bar is how many rearrangements fall in a group, grouped under its class; lighter bars are the clustered ones, in the shaded zone. A group with none shows a short stub on the baseline. Hover a bar for its name and its share of all rearrangements, or a class in the key to light its bars.","WGSPOST counts from its own copy of the calls, so its total can differ slightly from the report's rearrangements count."],terms:[["Deletion","A stretch of the genome lost between two breakpoints."],["Tandem duplication","A stretch copied next to itself."],["Inversion","A stretch turned around in place."],["Translocation","A join between two chromosomes."]]}]},circos:{title:"Integrated circos",intro:"The tumour's whole genome on one circle, as WGSPOST's integrated circos draws it: every SNV, indel, copy-number change and rearrangement, from the outside in, with the counts beside it.",sections:[{heading:"The rings, from the outside in",terms:[["Drivers","Genes with likely driver mutations, outside the circle, as the Mutations card flags them."],["Chromosomes","1 to 22 and X, clockwise from the top, each in proportion to its length (GRCh37). Y is left out, as in WGSPOST's figure."],["SNV rainfall","One dot per SNV the report counts, coloured by its substitution (in the pyrimidine context). Its distance from the centre is the distance to the SNV before it on the chromosome, on a log scale: the rings mark 100 bp, 10 kb and 1 Mb. Mutations far apart sit near the outside; clusters, such as kataegis, fall inwards."],["Insertions and deletions","Two thin rings of ticks: insertions, then deletions, coloured by the mechanism WGSPOST's microhomology and repeat callers assign (complex indels are grey)."],["Copy number","Gains of the major allele, darker for more copies (2 to 3, 4 to 7, 8 or more), then loss of heterozygosity, where the minor allele has no copies. From Battenberg (CNVkit for tumour-only reports)."],["Rearrangements","Links across the middle, coloured by class as in the Structural variants card: deletions, tandem duplications, inversions and translocations."]]},{heading:"Reading it",paragraphs:["Click a chromosome to open it out to a large share of the circle, with its megabases counted inside the ring; click it again to close it. Hover a dot, a tick or a link for its details, and a chromosome for its counts. Hover a bar beside the circle to light its calls on it: a substitution, an indel kind or a rearrangement class. The buttons above the circle hide and show each track.","The circle is drawn from the same calls as the rest of the report (WGSPOST builds its figure from them too), so its counts match the Mutations and Structural variants cards. The indel kinds are WGSPOST's own classification of its indels."]}]},cnsv:{title:"Copy number and rearrangements by chromosome",intro:"One chromosome at a time, the evidence behind the copy-number calls set against the rearrangements, as WGSPOST's CN/SV integration figures show it; and Battenberg's raw data for the tumour and its normal.",sections:[{heading:"The CN/SV view, from the top",terms:[["BAF","The B-allele frequency of each heterozygous SNP in the tumour, after Battenberg's phasing (its corrected phased BAF). Balanced copies sit at 0.5; a gain or a loss pulls the SNPs of a segment away from it."],["Segments","Battenberg's copy-number segments, drawn at their BAF and labelled with their allele copies and the share of cells that carry them (“2+1: 64%” means two copies of one allele and one of the other, in 64% of cells). Green when every cell carries the state; red when it is subclonal, with the second state below."],["Rearrangements","Arcs join the two ends of a rearrangement within the chromosome: deletions and tandem duplications on the upper lane, inversions on the lower, coloured by class as in the Structural variants card. An arrow marks an end whose partner is on another chromosome, labelled with that chromosome. Faint lines drop from each end to the copy number below it, where a breakpoint often meets a step."],["Copy number","BRASS's read-depth copy number, averaged in 100 kb windows as the report's figure does, over alternating whole-copy bands. The dashed line is Battenberg's total copy number for the same stretch, green or red as its segment."]]},{heading:"Battenberg raw",paragraphs:["Battenberg's input data, as its Tumor and Germline figures show it: the LogR (read depth against the normal, on a log scale) and BAF of the tumour, then of the normal, at SNP loci across the chromosome or the whole genome. Homozygous loci sit at 0 and 1 in the BAF; the normal's heterozygous SNPs gather at 0.5."]},{heading:"Reading it",paragraphs:["Pick a chromosome above the plot; chromosomes with data stand out. Scroll up or down over the plot to zoom around the pointer (up zooms in), sideways or drag to pan, double-click to zoom in, and click a rearrangement to fit it in view; the arrow keys, plus, minus and 0 work too. Hover anywhere for the segment, its state and the read depth at that point, or a rearrangement for its ends.","Points are thinned to evenly spaced SNPs, at most 10,000 per chromosome (1,500 across the genome), so the shape of the data is kept while the page stays fast. The report shows the same figures as images, so there is nothing here to compare against it number by number."]}]},rna:{title:"RNA",intro:"What the tumour's RNA shows, as the report lists it: genes fused together, and cancer genes expressed far above tumours like it.",sections:[{heading:"Fusions",terms:[["Confident","Fusions ANNOT_FUSIONS is confident in, one row per gene pair: the most split and spanning reads among the pair's calls, and every caller that found it. Open a pair for its breakpoint events and every other field the report shows."],["Rescued","Fusions with less support that ANNOT_FUSIONS keeps because they involve genes known to fuse in cancer."],["Split and spanning reads","Split reads cross the junction itself; spanning read pairs have one mate on each gene. The bars compare the fusions in the list."],["Highlighted","The fusions the report colours: OncoKB calls them oncogenic or likely oncogenic, or, for calls the report grouped itself, one gene is a COSMIC fusion gene."],["Breakpoints","Click an end to show it on the copy-number plot, where a fusion's genomic breakpoint often meets a change in copy number or a rearrangement."]]},{heading:"Overexpressed cancer genes",paragraphs:["Oncogenes, tumour suppressors and COSMIC Census genes whose level in the tumour is above the 95% confidence interval of its cohort's mean and at least four times that mean (a log2 fold change over 2), as the report finds them. Tumours of blood cancers are compared with blood cancers, solid tumours with solid tumours. The bar is the log2 fold change, with the times-the-mean beside it; when the tumour belongs to several cohort projects there is one bar per project.","The cohort is as it was when the report ran; keeping it current is planned."]}]},treatments:{title:"Available treatments",intro:"Drugs OncoKB associates with the tumour's alterations, as the report lists them: its likely drivers, rearrangements, fusions and copy-number changes, and the alterations its DMP (MSK-IMPACT) test found.",sections:[{heading:"Reading the table",terms:[["Level","OncoKB's level of evidence for the association, the strongest first: 1 and 2 are standard care (FDA-recognised, or in guidelines), 3A and 3B clinical evidence, 4 biological evidence, R1 and R2 resistance. Hover the badge for OncoKB's own description."],["Alteration","The gene and the change OncoKB matched, with its kind (SNV/Indel, Fusion/SV or CNA). Click it for OncoKB's page."],["Drugs","Each option on its own: drugs joined by + are given together."],["Tumour type","The cancer type the level holds for; All Solid Tumors and similar apply across types."],["Called by","Who found the alteration: Isabl's own calls, the DMP's, or both. “Called by Isabl only” leaves out what only the DMP found."]]},{heading:"Where it comes from",paragraphs:["The report asks OncoKB for each alteration, for the tumour's disease, when it runs, and keeps one row per alteration, drug and level. OncoKB's knowledge changes over time; rerunning the report asks it again."]}]},dmp:{title:"DMP results",intro:"The patient's clinical sequencing (the DMP: MSK-IMPACT and MSK-ACCESS) as cBioPortal lists it, in the report's three tables, with each DMP mutation also looked up in the reads of every WGS tumour.",sections:[{heading:"Mutations",terms:[["DMP samples and VAF","Each DMP sample that carries the mutation, with its variant allele fraction there. The sample matched to the one you are reading (its matched IMPACT sample) is outlined. Hover a sample for its read counts."],["WGS columns","The mutation's VAF in each WGS tumour, piled up from its reads by the report, with the variant and total reads. A filled mark means the tumour's own calls include the mutation (the same rule the Mutations table uses to mark calls the DMP also made); click it on the tumour you are reading to open that call. A hollow mark means the reads were counted but the tumour has no call there. With no reads, the report shows 0."],["WGS against DMP VAF","Each mutation's VAF in the picked tumour's WGS against its DMP VAF: the matched sample's when it carries the mutation, otherwise the highest. Points near the diagonal agree. Hover a point or a row to find it in the other."]]},{heading:"SVs and CNAs",paragraphs:["Structural variants with their genes, class and event, and copy-number alterations by gene, as gains or losses, each with the DMP samples that carry them."]},{heading:"Where it comes from",paragraphs:["The report asks cBioPortal's API for the patient's DMP samples and their calls when it runs, so what is here is what cBioPortal held then; rerunning the report asks again. When cBioPortal did not answer in time, the card says which tables may be missing. cBioPortal is not an Isabl analysis, so no analyses are listed below."]}]},quality:{title:"Sample concordance",intro:"Conpair compares the patient's experiments at common germline SNPs to check that the samples come from the same person. A sample swap or mislabelling shows as a pair with low concordance.",sections:[{heading:"Reading the pairs",paragraphs:["Each row is a pair of experiments Conpair compared, with its concordance on one scale; the tick is the report's threshold. Conpair compares a pair in both directions; as the report does, each pair keeps the better of the two (hover the number for both). The report flags a pair whose concordance falls below the threshold."]}]},signaturesHrd:{title:"Signatures and HRD",intro:"Which mutational processes left their mark on the tumour, set against tumours of the same disease, and whether it shows homologous recombination deficiency (HRD), as the report shows them.",sections:[{heading:"Mutational signatures",paragraphs:["WGSPOST fits known COSMIC substitution signatures to the tumour's somatic SNVs and estimates how many mutations each one accounts for. The left column is this tumour: each band is a signature's share of its mutations, the largest first.","The right column is the average of tumours of the same disease in the cohort (n is how many), each tumour's shares averaged and scaled to the cohort's average mutation count. A ribbon joins each signature's two bands, widening or narrowing with its share, so a signature can be followed from the tumour to its cohort; a label on the ribbon says how many percentage points the tumour leads or trails the cohort by, where the difference is at least 5. Hover a band, a ribbon or a row of the table for the numbers.","Seven signatures get colours of their own (eight when there are no more than eight); any beyond that are drawn together as Other. A tumour without a cohort to compare shows its own shares as one column."],terms:[["Signature","A pattern of substitutions, by the base change and its neighbours, that a mutational process leaves (SBS1, SBS5)."],["Aetiology","The process the report links a signature to, when it names one."]]},{heading:"96 mutational contexts",paragraphs:["Every substitution is one of six kinds (C>A, C>G, C>T, T>A, T>C, T>G, naming the pyrimidine base of the pair) and sits between two neighbouring bases, which gives 96 contexts. The top panel counts the tumour's SNVs in each, as WGSPOST's MutationalPatterns step does. The middle panel is what the fitted signatures rebuild: each signature's probabilities for the 96 contexts, weighted by its contribution above and added up. The bottom panel is the first minus the second, so a bar above the line is a context with more SNVs than the signatures explain.","Share draws each profile as percentages of its own total, which is how the report's figure compares the two; Count draws SNVs. Both profiles share one scale, and the difference its own. Click a class in the header to open it and name its sixteen contexts, written as the base before, the mutated base in colour, and the base after. Hover a column to read all three panels at once.","Cosine similarity and RSS are the report's own measures of the fit: the closer to 1 (cosine) and to 0 (RSS), the better the signatures explain the tumour. They are computed by the report from the relative profiles, as MutationalPatterns does. For an FFPE sample, switch between the run the report uses (its FFPE-filtered calls) and the unfiltered one. When the report did not include the signature matrix its fit used, only the observed profile is drawn."]},{heading:"HRD scores",paragraphs:["Two classifiers estimate whether the tumour has lost homologous recombination repair, as BRCA1 or BRCA2 loss does: HRDetect, from the substitution, indel and rearrangement patterns below, and CHORD, from its own set of mutation features. The report rates each HIGH at or above its threshold and LOW below it; the line on each gauge is the threshold."]},{heading:"HRDetect features",paragraphs:["The six features HRDetect weighs, for every tumour in the cohort and this one, each scaled from 0 (the cohort's lowest) to 1 (its highest). Each row is one feature: the pin is this tumour, the dots beneath are the cohort's samples, the shaded band is the middle half of the cohort and the line in it the median. With eight or more cohort samples a smoothed outline of how the samples are spread is drawn above the dots; with fewer it is left out, because it would suggest more than the data says. The words at the right say how many of the other cohort samples the tumour is above. Hover a row for the unscaled value. For FFPE samples the tumour's values come from its FFPE-filtered analysis."],terms:[["Del. MH","The share of deletions with microhomology at their ends, a sign of repair by end joining."],["SBS3 and SBS8","Substitution signatures 3 and 8."],["RS3 and RS5","Rearrangement signatures 3 (small tandem duplications) and 5 (deletions)."],["HRD index","Loss of heterozygosity, telomeric allelic imbalance and large-scale state transitions, combined."]]}]}},IM={summary:{BATTENBERG:"Tumour purity and ploidy, and the copy-number segments the ring's gains and losses are called from.","BATTENBERG cohort":"Project-wide Battenberg tables, which hold the FGA value and the cohort it is compared with.",CNV_UNMATCHED:"Copy-number segments of a tumour-only report (CNVkit), which the ring's gains and losses are called from.",MOSDEPTH:"The median sequencing coverage.",MSISENSOR:"The MSI score.",MSISENSOR_UNMATCHED:"The MSI score of a tumour-only report.",ANNOT_SNVS:"Somatic SNV calls: their count goes into TMB, and driver SNVs are marked on the ring.",ANNOT_INDELS:"Somatic indel calls: their count goes into TMB, and driver indels are marked on the ring.",ANNOT_SNVS_UNMATCHED:"Tumour-only SNV calls: their count goes into TMB, and driver SNVs are marked on the ring.",ANNOT_INDELS_UNMATCHED:"Tumour-only indel calls: their count goes into TMB, and driver indels are marked on the ring.",WGSPOST:"Cancer cell fractions of the mutations, read together with the driver calls marked on the ring."},copyNumber:{BATTENBERG:"Every segment drawn: total copies, major and minor allele copies, and the ploidy the baseline is rounded from.","BATTENBERG cohort":"Project-wide Battenberg tables of FGA: the tumour's own FGA, and the cohort the FGA figure compares it with, as it was when the report ran.",CNV_UNMATCHED:"The segments of a tumour-only report (CNVkit), drawn against two copies."},mutations:{ANNOT_SNVS:"The tumour's PASS somatic SNVs and their annotation: gene, protein and cDNA change, effect, VAF, read counts, normal VAF and COSMIC.","ANNOT_SNVS cohort":"The TMB reference project's coding SNVs: MSK's reference tumours for the disease, counted for the TMB figure, as they were when the report ran.","ANNOT_INDELS cohort":"The TMB reference project's coding indels, counted for the TMB figure like its SNVs.",ANNOT_INDELS:"The tumour's PASS somatic indels and their annotation, as for SNVs.",ANNOT_SNVS_UNMATCHED:"Tumour-only SNV calls and their annotation.",ANNOT_INDELS_UNMATCHED:"Tumour-only indel calls and their annotation.",WGSPOST:"Each mutation's cancer cell fraction (CCF) and how many copies carry it.",BATTENBERG:"Ploidy, which fills in the copy count where WGSPOST has none, and purity, which gives a CCF to hotspots recovered from the tumour's reads.",FFPERASE_SNVS:"FFPE samples: each SNV's artifact score. Calls scoring above the report's threshold are left out of the counts.",FFPERASE_INDELS:"FFPE samples: each indel's artifact score. Calls scoring above the report's threshold are left out of the counts."},structuralVariants:{ANNOT_SVS:"The high-confidence structural variants and their AnnotSV gene annotation: the rearrangements the report counts and the rows of its tables.",ANNOT_SVS_UNMATCHED:"Tumour-only structural variants and their annotation, kept when rare in the population.",SVABA:"Raw SvABA calls, searched for known rearrangements the high-confidence set missed (rescued events).",GRIDSS:"Raw GRIDSS calls, searched for rescued events like SvABA's.",SVABA_UNMATCHED:"Raw tumour-only SvABA calls, searched for rescued events.",GRIDSS_UNMATCHED:"Raw tumour-only GRIDSS calls, searched for rescued events.",WGSPOST:"The rearrangement-signature counts.",WGSPOST_UNMATCHED:"The rearrangement-signature counts of a tumour-only report."},circos:{ANNOT_SNVS:"The SNVs of the rainfall, with their positions and substitutions.",ANNOT_SNVS_UNMATCHED:"The tumour-only SNVs of the rainfall.",WGSPOST:"The indel classification behind the indel rings (microhomology, repeat or other), and the signature contributions beside the circle.",WGSPOST_UNMATCHED:"The indel classification of a tumour-only report.",BATTENBERG:"The copy-number rings: major and minor allele copies of each segment, and the purity and ploidy beside the circle.",CNV_UNMATCHED:"The copy number of a tumour-only report (CNVkit).",ANNOT_SVS:"The rearrangements drawn across the middle.",ANNOT_SVS_UNMATCHED:"The tumour-only rearrangements drawn across the middle."},cnsv:{BATTENBERG:"The BAF per SNP, the segments with their allele states, and the raw tumour and normal LogR and BAF.",BRASS:"The read-depth copy number in 100 kb windows.",ANNOT_SVS:"The rearrangements drawn as arcs and arrows."},rna:{ANNOT_FUSIONS:"The confident and rescued fusions, and the link to the fusion callers' report.","SALMON_GENCODE cohort":"The tumour's gene levels and its project's, which the overexpressed genes are found against."},treatments:{ANNOT_SNVS:"The SNV drivers OncoKB is asked about.",ANNOT_INDELS:"The indel drivers OncoKB is asked about.",ANNOT_SVS:"The rearrangements of known oncogenes and fusions OncoKB is asked about.",BATTENBERG:"The amplified and lost genes OncoKB is asked about.",ANNOT_FUSIONS:"The RNA fusions OncoKB is asked about."},dmp:{},quality:{CONPAIR:"The concordance of each pair of the patient's experiments, and the report's verdict."},signaturesHrd:{WGSPOST:"The tumour's signature contributions, its SNV counts in the 96 mutational contexts, its HRDetect and CHORD scores, and its HRDetect features.",WGSPOST_FFPE:"For an FFPE sample, the same from the FFPE-filtered calls.","WGSPOST cohort":"The cohort's signature contributions and HRDetect features, which the tumour is compared with."}};function PM(n,a){const l=a.role==="cohort"||a.app.endsWith("Project Application"),i=a.app.replace(/ Project Application$/,""),c=IM[n];return(l?c[`${i} cohort`]:c[i])??(l?"A project-wide run the report reads for comparison with the cohort.":"An analysis the report reads to build this card.")}function QM({topic:n,lineage:a,subject:l,onClose:i}){const c=og[n],d=C.useId(),f=C.useRef(null),m=a.filter(M=>M.role!=="cohort"&&!M.app.endsWith("Project Application")),g=a.filter(M=>!m.includes(M)),v=C.useRef(i);v.current=i,C.useEffect(()=>{var P;const M=document.activeElement;(P=f.current)==null||P.focus();const E=document.documentElement,_=E.style.overflow;E.style.overflow="hidden";const D=Z=>{Z.key==="Escape"&&v.current()};return document.addEventListener("keydown",D),()=>{document.removeEventListener("keydown",D),E.style.overflow=_,M==null||M.focus()}},[]);const x=[...c.sections.map(M=>M.heading),"Sources"],p=x.map((M,E)=>`${d}-s${E}`),[b,S]=C.useState(0),j=C.useRef(null),N=C.useRef(!1),R=C.useRef(null),A=C.useRef(0);C.useEffect(()=>{const M=j.current;if(!M)return;const E=24,_=()=>{const Z=M.getBoundingClientRect().top,z=Math.max(0,M.scrollHeight-M.clientHeight),te=p.map(re=>{const $=document.getElementById(re);return $?$.getBoundingClientRect().top-Z:1/0}),ie=Math.max(0,...te.map(re=>Number.isFinite(re)?re+M.scrollTop-z-E:0)),J=E+(z>0?ie*Math.min(1,M.scrollTop/z):0);let se=0;te.forEach((re,$)=>{re<=J&&(se=$)}),S(se)},D=()=>{if(N.current){R.current===null?(window.clearTimeout(A.current),A.current=window.setTimeout(()=>R.current=M.scrollTop,160)):Math.abs(M.scrollTop-R.current)>4&&(N.current=!1,R.current=null,_());return}_()},P=()=>{N.current&&R.current===null&&(window.clearTimeout(A.current),N.current=!1,_())};return _(),M.addEventListener("scroll",D,{passive:!0}),M.addEventListener("wheel",P,{passive:!0}),M.addEventListener("touchstart",P,{passive:!0}),()=>{window.clearTimeout(A.current),M.removeEventListener("scroll",D),M.removeEventListener("wheel",P),M.removeEventListener("touchstart",P)}},[]);const T=M=>{var _;const E=typeof matchMedia<"u"&&matchMedia("(prefers-reduced-motion: reduce)").matches;N.current=!0,R.current=null,S(M),window.clearTimeout(A.current),A.current=window.setTimeout(()=>{var D;return R.current=((D=j.current)==null?void 0:D.scrollTop)??0},160),(_=document.getElementById(p[M]))==null||_.scrollIntoView({behavior:E?"auto":"smooth",block:"start"})},O=M=>r.jsxs("li",{className:"info-source",children:[r.jsx("span",{className:`tb-dot ${ig(M.app)}`,"aria-hidden":!0}),r.jsxs("span",{className:"info-source-text",children:[M.pk?r.jsxs("a",{className:"info-source-name info-source-link",href:eC(M.pk),target:"_blank",rel:"noopener noreferrer",title:"Open this analysis in Isabl",children:[r.jsxs("span",{className:"mono",children:[M.app,M.version?` ${M.version}`:""]}),r.jsxs("span",{className:"mono info-source-pk",children:["#",M.pk]}),r.jsx(hy,{size:13,"aria-hidden":!0,className:"info-source-arrow"})]}):r.jsxs("span",{className:"info-source-name",children:[r.jsxs("span",{className:"mono",children:[M.app,M.version?` ${M.version}`:""]}),M.project?r.jsxs("span",{className:"info-source-pk",children:["project ",M.project]}):null]}),r.jsx("span",{className:"info-source-role",children:PM(n,M)})]})]},$n(M));return Jr.createPortal(r.jsx("div",{className:`info-backdrop ${Wn.theme}`,onMouseDown:M=>M.target===M.currentTarget&&i(),children:r.jsxs("div",{className:"info-dialog",role:"dialog","aria-modal":"true","aria-labelledby":d,children:[r.jsx("button",{ref:f,type:"button",className:"info-close","aria-label":"Close",onClick:i,children:r.jsx(ec,{size:18,"aria-hidden":!0})}),r.jsxs("nav",{className:"info-rail","aria-label":"Contents",children:[r.jsx("span",{className:"info-kicker",children:l??"About"}),r.jsx("h2",{id:d,children:c.title}),r.jsx("ol",{children:x.map((M,E)=>r.jsx("li",{children:r.jsx("button",{type:"button","aria-current":E===b?"true":void 0,onClick:()=>T(E),children:M})},M))})]}),r.jsxs("div",{ref:j,className:"info-main",children:[r.jsx("p",{className:"info-intro",children:c.intro}),c.sections.map((M,E)=>{var _;return r.jsxs("section",{id:p[E],className:"info-section",children:[r.jsx("h3",{children:M.heading}),(_=M.paragraphs)==null?void 0:_.map(D=>r.jsx("p",{children:D},D)),M.terms&&r.jsx("dl",{children:M.terms.map(([D,P])=>r.jsxs("div",{children:[r.jsx("dt",{children:D}),r.jsx("dd",{children:P})]},D))})]},M.heading)}),r.jsxs("section",{id:p[p.length-1],className:"info-section","aria-label":"Sources",children:[r.jsx("h3",{children:"Sources"}),r.jsx("p",{children:"The analyses this card reads, with their version and Isabl id, and what each one is responsible for."}),a.length===0&&r.jsx("p",{children:"No analyses recorded for this card."}),r.jsx("ul",{className:"info-sources",children:m.map(O)}),g.length>0&&r.jsxs(r.Fragment,{children:[r.jsx("h4",{children:"Cohort runs"}),r.jsx("ul",{className:"info-sources",children:g.map(O)})]})]})]})]})}),document.body)}function Dv(n){return n.split(" ").map(a=>/^[A-Z0-9]{2,}$/.test(a)?a:a.toLowerCase()).join(" ")}function Iy({topic:n,lineage:a,subject:l}){const[i,c]=C.useState(!1);return r.jsxs(r.Fragment,{children:[r.jsx("button",{type:"button",className:"sc-ib sm info-trigger","aria-label":`About ${Dv(og[n].title)}`,title:`About ${Dv(og[n].title)}`,"aria-haspopup":"dialog",onClick:()=>c(!0),children:r.jsx(dC,{size:15,"aria-hidden":!0})}),i&&r.jsx(QM,{topic:n,lineage:a,subject:l,onClose:()=>c(!1)})]})}function YM({children:n}){return r.jsx("div",{className:"sc-cf",children:n})}function rd(...n){const a=new Map;for(const l of n.flat())l&&!a.has($n(l))&&a.set($n(l),l);return[...a.values()]}const hs=C.forwardRef(function({title:a,subtitle:l,controls:i,lineage:c,picked:d,footer:f,className:m="",info:g,expandable:v,children:x},p){const b=!!d&&c.some(N=>$n(N)===d),[S,j]=XM();return r.jsxs(r.Fragment,{children:[S&&r.jsx("div",{className:"sc-full-backdrop","aria-hidden":!0,onClick:()=>j(!1)}),r.jsxs("section",{ref:p,className:`sc-card flex flex-col ${m}`,"data-picked":b,"data-full":S||void 0,"aria-label":a,children:[r.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-x-4 gap-y-2.5 px-5 pt-5 pb-4",children:[r.jsxs("div",{className:"flex min-w-0 flex-col gap-0.5",children:[r.jsx("h2",{className:"m-0 text-[19px] font-semibold tracking-tight",children:a}),l&&r.jsx("span",{className:"text-[13px]",style:{color:"var(--muted)"},children:l})]}),(i||g||v)&&r.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[i,v&&r.jsx("button",{type:"button",className:"sc-ib","aria-label":S?"Exit full screen":`Expand ${a.toLowerCase()} to full screen`,title:S?"Exit full screen (Esc)":"Expand to full screen","aria-pressed":S,onClick:()=>j(!S),children:S?r.jsx(xC,{size:16,"aria-hidden":!0}):r.jsx(gC,{size:16,"aria-hidden":!0})}),g&&r.jsx(Iy,{topic:g,lineage:c,subject:typeof l=="string"?l:void 0})]})]}),r.jsx("div",{className:"min-w-0 flex-auto",children:x}),f&&r.jsx(YM,{children:f})]})]})});function XM(){const[n,a]=C.useState(!1);return C.useEffect(()=>{if(!n)return;const l=document.documentElement,i=l.style.overflow;l.style.overflow="hidden";const c=d=>{var f,m;d.key==="Escape"&&((m=(f=d.target)==null?void 0:f.closest)!=null&&m.call(f,"input, textarea, select")||document.querySelector(".info-backdrop")||a(!1))};return document.addEventListener("keydown",c),()=>{document.removeEventListener("keydown",c),l.style.overflow=i}},[n]),[n,a]}function Hn({label:n,envelope:a,loading:l,skeletonHeight:i=160,children:c}){return r.jsxs(r.Fragment,{children:[l&&!a&&r.jsx("div",{className:"px-5 py-3",children:r.jsx("div",{className:"skeleton",style:{height:i},"aria-label":`Loading ${n}`})}),a&&a.status!=="ok"&&r.jsx("div",{className:"px-5 py-4",children:r.jsx(Al,{envelope:a})}),(a==null?void 0:a.status)==="ok"&&a.data!==null&&c(a.data),(a==null?void 0:a.status)==="ok"&&a.warnings.length>0&&r.jsx("div",{className:"px-5 pb-1 text-xs",style:{color:"var(--warn-ink)"},children:a.warnings.join(" ")})]})}function KM({title:n,subtitle:a,controls:l,envelope:i,loading:c,picked:d,skeletonHeight:f=160,footer:m,className:g="",info:v,moreLineage:x,children:p}){return r.jsx(hs,{title:n,subtitle:a,controls:l,lineage:rd(i==null?void 0:i.lineage,x),picked:d,footer:m,className:g,info:v,children:r.jsx(Hn,{label:n,envelope:i,loading:c,skeletonHeight:f,children:p})})}function ZM(n,a){const[l,i]=C.useState(null),[c,d]=C.useState(!1);return C.useLayoutEffect(()=>{const f=n.current;if(!f)return;const m=()=>{const v=f.querySelector('[aria-pressed="true"]');i(v?{x:v.offsetLeft,y:v.offsetTop,width:v.offsetWidth,height:v.offsetHeight}:null)};if(m(),typeof ResizeObserver>"u")return;const g=new ResizeObserver(m);g.observe(f);for(const v of Array.from(f.children))g.observe(v);return()=>g.disconnect()},[n,a]),C.useEffect(()=>{if(l&&!c){const f=requestAnimationFrame(()=>d(!0));return()=>cancelAnimationFrame(f)}},[l,c]),{thumb:l,moving:c}}function es({label:n,options:a,value:l,onChange:i,className:c=""}){const d=C.useRef(null),{thumb:f,moving:m}=ZM(d,l);return r.jsxs("div",{ref:d,className:`sc-track ${c}`,role:"group","aria-label":n,children:[f&&r.jsx("span",{className:"sc-thumb","data-moving":m,"aria-hidden":!0,style:{width:f.width,height:f.height,transform:`translate(${f.x}px, ${f.y}px)`}}),a.map(g=>r.jsx("button",{type:"button",className:"sc-seg","aria-pressed":g.value===l,disabled:g.disabled,title:g.title,onClick:()=>i(g.value),children:g.label},g.value))]})}function JM(n){var l;const a=[];return n.mode==="unmatched"&&a.push("Tumour only"),n.individual.germline_consent&&a.push("Germline consented"),(l=n.individual.dmp_id)!=null&&l.startsWith("P-")&&a.push("DMP linked"),a}function WM({data:n,onVersion:a}){const l=n.report,[i,c]=C.useState(!1),d=C.useRef(null);C.useEffect(()=>{if(!i)return;const m=v=>{var x;(x=d.current)!=null&&x.contains(v.target)||c(!1)},g=v=>{v.key==="Escape"&&c(!1)};return document.addEventListener("mousedown",m),document.addEventListener("keydown",g),()=>{document.removeEventListener("mousedown",m),document.removeEventListener("keydown",g)}},[i]);const f=JM(n);return r.jsxs("div",{ref:d,className:"report-menu",children:[r.jsxs("button",{type:"button",className:"sc-btn sc-b2","aria-expanded":i,"aria-haspopup":"dialog",onClick:()=>c(m=>!m),children:["Report ",l.version,r.jsx(py,{size:14,"aria-hidden":!0})]}),i&&r.jsxs("div",{className:"report-pop",role:"dialog","aria-label":"Report",children:[r.jsxs("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1.5",children:[r.jsx("span",{className:"text-[13px] font-medium",style:{color:"var(--muted)"},children:"Report version"}),r.jsx(es,{label:"Report version",value:l.version,onChange:m=>{a(m),c(!1)},options:n.versions.map(m=>({value:m.version,label:m.version}))})]}),r.jsxs("span",{className:"mono text-[11.5px]",style:{color:"var(--muted)"},children:["WGTS_REPORT ",l.analysis?`run #${l.analysis}`:"run indexed by hand",l.built?`, built ${jy(l.built)}`:""]}),f.length>0&&r.jsx("div",{className:"flex flex-wrap gap-2",children:f.map(m=>r.jsx("span",{className:"sc-chip",children:m},m))})]})]})}const rg=["purity","ploidy","coverage","tmb","msi","fga"];function e3({value:n}){const l=2*Math.PI*13,i=Math.min(Math.max(n,0),1);return r.jsxs("svg",{viewBox:"0 0 34 34",className:"kpi-glyph h-[34px] w-[34px]","aria-hidden":!0,children:[r.jsx("circle",{cx:"17",cy:"17",r:13,fill:"none",strokeWidth:"4",className:"kpi-track"}),r.jsx("circle",{cx:"17",cy:"17",r:13,fill:"none",strokeWidth:"4",strokeLinecap:"round",className:"kpi-fill",strokeDasharray:`${i*l} ${l}`,transform:"rotate(-90 17 17)"})]})}function kv({value:n,min:a,max:l,ticks:i,reference:c}){const d=f=>4+(Math.min(Math.max(f,a),l)-a)/(l-a)*64;return r.jsxs("svg",{viewBox:"0 0 72 20",className:"kpi-glyph h-[18px] w-[60px]","aria-hidden":!0,children:[r.jsx("line",{x1:"4",x2:"68",y1:"12",y2:"12",className:"kpi-track",strokeWidth:"2",strokeLinecap:"round"}),i.map(f=>r.jsx("line",{x1:d(f),x2:d(f),y1:f===c?5:9,y2:"15",className:"kpi-tick",strokeWidth:f===c?1.5:1},f)),r.jsx("circle",{cx:d(n),cy:"12",r:"4.5",className:"kpi-dot",strokeWidth:"2"})]})}function t3({metric:n}){const a=n.value;if(a===null)return null;switch(n.key){case"purity":case"fga":return r.jsx(e3,{value:a});case"ploidy":return r.jsx(kv,{value:a,min:1,max:6,ticks:[1,2,3,4,5,6],reference:2});case"tmb":return r.jsx(kv,{value:Math.log10(Math.max(a,.01)),min:-2,max:2,ticks:[-2,-1,0,1,2]});default:return null}}const n3={purity:"Share of tumour cells, 0 to 1",fga:"Share of the genome altered, 0 to 1",ploidy:"On a scale of 1 to 6 copies; the tall tick marks 2",tmb:"On a log scale from 0.01 to 100 mutations per Mb"};function s3({metric:n,picked:a}){const l=n.value===null&&!n.text,i=!!a&&n.sources.some(c=>$n(c)===a);return r.jsxs("div",{className:"kpi","data-picked":i,title:n3[n.key],children:[r.jsxs("span",{className:"kpi-top",children:[r.jsx("span",{className:"kpi-label",children:n.label}),r.jsx(t3,{metric:n})]}),r.jsx("span",{className:"kpi-value","data-empty":l,children:l?TC(n):RC(n)})]})}function a3({sampleLabel:n,fingerprint:a,metrics:l,picked:i,lineage:c=[]}){var f;const d=(((f=l==null?void 0:l.data)==null?void 0:f.metrics)??[]).filter(m=>rg.includes(m.key));return r.jsxs("section",{className:"sc-card relative flex flex-wrap items-center gap-x-8 gap-y-5 px-6 py-5","aria-label":`Genome fingerprint and summary of ${n}`,children:[r.jsx("span",{className:"absolute top-3 right-3",children:r.jsx(Iy,{topic:"summary",lineage:c,subject:n})}),r.jsx(Og,{fingerprint:a,size:"hero",title:n.split(" ")[0],subtitle:"tumour",className:"h-[210px] w-[210px] max-w-full flex-none"}),r.jsxs("div",{className:"flex min-w-0 flex-[1_1_230px] flex-col gap-3",children:[r.jsxs("h2",{className:"m-0 text-lg font-semibold tracking-tight",children:["Genome fingerprint of ",n]}),r.jsx("p",{className:"m-0 max-w-[46ch] text-[14.5px] leading-relaxed",style:{color:"var(--ink-2)"},children:a?wy(a):"No copy-number data for this sample."}),r.jsxs("div",{className:"flex flex-wrap gap-x-4 gap-y-1.5 text-[12.5px]",style:{color:"var(--ink-2)"},children:[r.jsxs("span",{className:"flex items-center gap-1.5",children:[r.jsx("span",{className:"h-[5px] w-3.5 rounded-[3px]",style:{background:"var(--gain)"}}),"Gains, outer track"]}),r.jsxs("span",{className:"flex items-center gap-1.5",children:[r.jsx("span",{className:"h-[5px] w-3.5 rounded-[3px]",style:{background:"var(--loss)"}}),"Losses, inner track"]}),r.jsxs("span",{className:"flex items-center gap-1.5",children:[r.jsx("span",{className:"h-3 w-[5px] rounded-sm",style:{background:"var(--ink)"}}),"Drivers"]})]}),r.jsx("span",{className:"text-[12.5px]",style:{color:"var(--muted)"},children:"Chromosome 1 starts at the top and the ring runs clockwise to X."})]}),r.jsxs("div",{className:"kpi-grid min-w-0 flex-[1.4_1_420px]",children:[l===void 0&&rg.map(m=>r.jsx("div",{className:"kpi","aria-hidden":!0,children:r.jsx("div",{className:"skeleton h-[70px]"})},m)),l&&l.status!=="ok"&&r.jsx("div",{className:"col-span-full",children:r.jsx(Al,{envelope:l})}),d.map(m=>r.jsx(s3,{metric:m,picked:i},m.key))]})]})}function l3({sampleLabel:n,failures:a,analyses:l}){return a.length===0?null:r.jsx("div",{className:"flex flex-col gap-2.5",children:a.map(i=>{const c=l.filter(d=>d.modules.some(f=>f.etl===i.etl&&f.status==="failed"));return r.jsxs("div",{className:"sc-card flex flex-wrap items-center gap-x-4 gap-y-3 px-[18px] py-3.5",role:"status",children:[r.jsx("span",{className:"grid h-9 w-9 flex-none place-items-center rounded-[10px]",style:{background:"var(--warn-soft)",color:"var(--warn-ink)"},children:r.jsx(Ag,{size:18,"aria-hidden":!0})}),r.jsxs("div",{className:"flex min-w-0 flex-[1_1_360px] flex-col gap-0.5",children:[r.jsxs("span",{className:"text-[14.5px] font-semibold",children:[i.label," failed for ",n]}),r.jsx("span",{className:"text-[13.5px]",style:{color:"var(--ink-2)"},children:i.message.split(`
|
|
302
|
+
`)[0]}),c.length>0&&r.jsxs("span",{className:"mono text-[11.5px]",style:{color:"var(--muted)"},children:["Reading ",c.map(WC).join(", ")]})]})]},`${i.etl}-${i.node}`)})})}function i3({onSignedIn:n}){const[a,l]=C.useState("password"),[i,c]=C.useState(""),[d,f]=C.useState(""),[m,g]=C.useState(""),[v,x]=C.useState(null),[p,b]=C.useState(!1),S=a==="password"?!!i&&!!d:!!m.trim();return r.jsxs("form",{className:"sc-card mx-auto mt-16 flex w-[380px] max-w-full flex-col gap-3 p-6",onSubmit:async j=>{j.preventDefault(),b(!0),x(null);try{a==="password"?await KC(i,d):await XC(m.trim()),n()}catch(N){x(N.message)}finally{b(!1)}},children:[r.jsx("h1",{className:"m-0 text-lg font-semibold",children:"Sign in to Isabl"}),r.jsx("p",{className:"m-0 text-sm",style:{color:"var(--ink-2)"},children:"The WGTS dashboard uses your Isabl account."}),a==="password"?r.jsxs(r.Fragment,{children:[r.jsxs("label",{className:"flex flex-col gap-1 text-[13px] font-semibold",htmlFor:"username",children:["Username",r.jsx("span",{className:"field",children:r.jsx("input",{id:"username",autoComplete:"username",value:i,onChange:j=>c(j.target.value)})})]}),r.jsxs("label",{className:"flex flex-col gap-1 text-[13px] font-semibold",htmlFor:"password",children:["Password",r.jsx("span",{className:"field",children:r.jsx("input",{id:"password",type:"password",autoComplete:"current-password",value:d,onChange:j=>f(j.target.value)})})]})]}):r.jsxs("label",{className:"flex flex-col gap-1 text-[13px] font-semibold",htmlFor:"token",children:["API token",r.jsx("span",{className:"field",children:r.jsx("input",{id:"token",type:"password",autoComplete:"off",spellCheck:!1,value:m,onChange:j=>g(j.target.value)})}),r.jsx("span",{className:"text-xs font-normal",style:{color:"var(--muted)"},children:"The token the Isabl CLI uses. Admins find it under Auth Token in Django admin."})]}),v&&r.jsx("p",{className:"m-0 text-sm",style:{color:"var(--warn-ink)"},role:"alert",children:v}),r.jsx("button",{type:"submit",className:"sc-btn sc-b1",disabled:p||!S,children:p?"Signing in":"Sign in"}),r.jsx("button",{type:"button",className:"self-start border-0 bg-transparent p-0 text-[13px] font-semibold",style:{color:"var(--link)",cursor:"pointer"},onClick:()=>{l(a==="password"?"token":"password"),x(null)},children:a==="password"?"Use an API token instead":"Use a username and password instead"})]})}const it=1e3,cg=.35,o3=8,Qu=.1;function Vu(n,a){return(Pu(n,a)??0)*it}function Os(n){const[a,l]=id[n.replace(/^chr/,"")];return[a*it,l*it]}function em(n,a,l){const[i,c]=n,d=Math.min(it,Math.max(cg,(c-i)*l)),f=Math.min(Math.max(a-(a-i)/(c-i)*d,0),it-d);return[f,f+d]}function wr(n,a){const l=n[1]-n[0],i=Math.min(Math.max(n[0]+a,0),it-l);return[i,i+l]}function r3(n,a,l){const i=Math.min(Math.max(l,0),it);return a===0?[Math.min(i,n[1]-cg),n[1]]:[n[0],Math.max(i,n[0]+cg)]}function c3(n,a,l){const i=(n[0]+n[1])/2+((a[0]+a[1])/2-(n[0]+n[1])/2)*l,[c,d]=[n[1]-n[0],a[1]-a[0]],f=Math.exp(Math.log(c)+(Math.log(d)-Math.log(c))*l),m=Math.min(Math.max(i-f/2,0),it-f);return[m,m+f]}function Lv(n){return n[1]-n[0]<it-.5}function ug(n){for(const[a]of Nn){const[l,i]=Os(a);if(n>=l&&n<=i)return a}return null}function u3(n,a){const l=n.segments.flatMap(c=>a==="total"?[c.total_cn]:[c.major_cn,c.minor_cn]),i=Math.max(...l.map(c=>c??0));return Math.min(o3,Math.max(n.baseline+2,Math.ceil(i)))}function d3(n){const a=10**Math.floor(Math.log10(n)),l=n/a;return(l<1.5?1:l<3.5?2:l<7.5?5:10)*a}function h3(n,a,l=5){const i=Nn.filter(([b])=>{const[S,j]=Os(b);return j>n&&S<a});if(i.length!==1)return i.map(([b])=>{const[S,j]=Os(b);return{value:(S+j)/2,label:b}});const[c,d]=i[0],[f,m]=Os(c),g=(Math.max(n,f)-f)/(m-f)*d,v=(Math.min(a,m)-f)/(m-f)*d,x=d3(Math.max(v-g,1)/l),p=[];for(let b=Math.ceil(g/x)*x;b<=v;b+=x)p.push({value:f+b/d*(m-f),label:Lr(b,x)});return p}function f3(n,a){if(n<=.5&&a>=it-.5)return null;const l=ag(n/it,"start"),i=ag(a/it,"end");if(l.chrom===i.chrom){const c=(i.pos-l.pos)/10;return`chr${l.chrom}: ${Lr(l.pos,c).replace(" Mb","")}–${Lr(i.pos,c)}`}return`chr${l.chrom}:${Lr(l.pos,1e6)} – chr${i.chrom}:${Lr(i.pos,1e6)}`}function m3(n){const{chrom:a,pos:l}=ag(Math.min(Math.max(n,0),it)/it,"start");return`chr${a} · ${(l/1e6).toFixed(1)} Mb`}const cd=n=>n.call??"neutral",g3={neutral:"Neutral",gain:"Gain",amp:"Amplification",loss:"Loss"},Py={neutral:"var(--chev)",gain:"var(--gain)",amp:"var(--gain-strong)",loss:"var(--loss)"};function p3(n){return{call:g3[cd(n)],copies:n.total_cn===null?"? copies":`${n.total_cn} ${n.total_cn===1?"copy":"copies"}`,alleles:n.major_cn!==null&&n.minor_cn!==null?`${n.major_cn} + ${n.minor_cn}`:"",span:`chr${n.chrom}:${n.start.toLocaleString("en-US")}–${n.end.toLocaleString("en-US")}`,log2:n.log2!==null?n.log2.toFixed(2):""}}function x3(n){const a=new Map;for(const l of n){const i=l.gene??"?",c=a.get(i)??{gene:i,x:Vu(l.chrom,l.pos),chrom:l.chrom,pos:l.pos,changes:"",list:[]};l.protein_change&&c.list.push(l.protein_change),a.set(i,c)}return[...a.values()].map(({list:l,...i})=>({...i,changes:l.join(", ")})).sort((l,i)=>l.x-i.x)}function tm(n,a,l){const i=a.replace(/^chr/,"");return n.segments.find(c=>c.chrom===i&&c.start<=l&&l<=c.end)}function nm(n,a){return n?a==="total"?n.total_cn:n.major_cn:null}function v3(n){const a=n.length;if(a===0)return"";const l=m=>m.toFixed(2);if(a===1)return`M${l(n[0][0])},${l(n[0][1])}`;const i=n.slice(1).map((m,g)=>m[0]-n[g][0]),c=n.slice(1).map((m,g)=>i[g]===0?0:(m[1]-n[g][1])/i[g]),d=n.map((m,g)=>g===0?c[0]:g===a-1?c[a-2]:c[g-1]*c[g]<=0?0:(c[g-1]+c[g])/2);for(let m=0;m<a-1;m++){if(c[m]===0){d[m]=0,d[m+1]=0;continue}const g=d[m]/c[m],v=d[m+1]/c[m],x=Math.hypot(g,v);x>3&&(d[m]=3*g*c[m]/x,d[m+1]=3*v*c[m]/x)}let f=`M${l(n[0][0])},${l(n[0][1])}`;for(let m=0;m<a-1;m++){const[g,v]=n[m],[x,p]=n[m+1];f+=` C${l(g+i[m]/3)},${l(v+d[m]*i[m]/3)} ${l(x-i[m]/3)},${l(p-d[m+1]*i[m]/3)} ${l(x)},${l(p)}`}return f}function Yu(n,a){const l=[],i=new Array(n.length).fill(0);return[...n.keys()].sort((c,d)=>n[c].left-n[d].left).forEach(c=>{let d=l.findIndex(f=>f+a<=n[c].left);d===-1&&(d=l.push(0)-1),l[d]=n[c].left+n[c].width,i[c]=d}),i}function ud(n,a=4){const l=Math.max(n,1)/a,i=10**Math.floor(Math.log10(l)),c=l/i,d=Math.max(1,(c<=1?1:c<=2?2:c<=5?5:10)*i),f=[];for(let m=0;m<Math.max(n,1)+d&&(f.push(m),!(m>=n&&f.length>1));m+=d);return f}const Dg=n=>1-(1-n)**3;function zs(n,a,l=500){return n.length*a*(l>=600?.6:.56)}function Kt({x:n,y:a,width:l,above:i=!1,children:c}){const d=n>l-320,f=i?Math.min(Math.max(n,110),l-110):n,m=i?"translate(-50%, calc(-100% - 6px))":`translate(${d?"calc(-100% - 14px)":"14px"}, -50%)`;return r.jsx("div",{className:"ctip",style:{left:f,top:a,transform:m},role:"presentation",children:c})}function Xu(n,a,l){const i=n.clientX;let c=!1;const d=m=>{const g=m.clientX-i;Math.abs(g)>3&&(c=!0),a(g,m)},f=()=>{window.removeEventListener("pointermove",d),window.removeEventListener("pointerup",f),window.removeEventListener("pointercancel",f),l==null||l(c)};window.addEventListener("pointermove",d),window.addEventListener("pointerup",f),window.addEventListener("pointercancel",f)}const y3=.01,b3=16,S3=160;function Qy(n,a){const l=b=>{const S=n.getBoundingClientRect();return[b.clientX-S.left,b.clientY-S.top]};let i="page",c=-1/0;const d=b=>{n.contains(b.target)||(i="page",c=b.timeStamp)},f=b=>{const[S,j]=l(b),N=a(),R=b.ctrlKey||b.metaKey;if(!R&&(b.timeStamp-c>S3&&(i="plot"),c=b.timeStamp,i==="page")||!N.inside(S,j))return;const A=b.deltaMode===1?b3:b.deltaMode===2?n.clientWidth:1,T=(b.deltaX||(b.shiftKey?b.deltaY:0))*A;if(!R&&T!==0&&(b.shiftKey||Math.abs(b.deltaX)>Math.abs(b.deltaY))){b.preventDefault(),N.pan(T);return}if(b.deltaY===0)return;const M=Math.max(-50,Math.min(50,b.deltaY*A));N.zoom(Math.exp(M*y3),S)||R?b.preventDefault():i="page"};let m=1,g=null;const v=b=>{const S=b,[j,N]=l(S);a().inside(j,N)&&(b.preventDefault(),m=1,g=j)},x=b=>{if(g===null)return;b.preventDefault();const S=b.scale;S>0&&S!==m&&a().zoom(m/S,g),m=S},p=b=>{g!==null&&(b.preventDefault(),g=null)};return window.addEventListener("wheel",d,{capture:!0,passive:!0}),n.addEventListener("wheel",f,{passive:!1}),n.addEventListener("gesturestart",v),n.addEventListener("gesturechange",x),n.addEventListener("gestureend",p),()=>{window.removeEventListener("wheel",d,{capture:!0}),n.removeEventListener("wheel",f),n.removeEventListener("gesturestart",v),n.removeEventListener("gesturechange",x),n.removeEventListener("gestureend",p)}}function ks(n=640){const a=C.useRef(null),[l,i]=C.useState(n);return C.useLayoutEffect(()=>{const c=a.current;if(!c)return;const d=()=>i(Math.round(c.clientWidth)||n);if(d(),typeof ResizeObserver>"u")return;const f=new ResizeObserver(d);return f.observe(c),()=>f.disconnect()},[n]),[a,l]}const $v=36,j3=14,$r=232,Hv=22,Zi=28,Uv=19,w3=480,N3=C.memo(function({segments:a,spans:l,mode:i,shown:c,geo:d,hover:f,grad:m,onHover:g,onClick:v}){const x=c[1]-c[0],p=j=>d.plotL+(j-c[0])/x*d.plotW,b=j=>d.plotTop+(1-Math.min(Math.max(j,0),d.top)/d.top)*$r,S=b(d.baseline);return r.jsx("g",{children:a.map((j,N)=>{const[R,A]=l[N];if(A<c[0]-1||R>c[1]+1)return null;const T=cd(j),O=p(R),M=Math.max(p(A)-O,T==="neutral"?2:7),E=f===N;if(i==="total"){if(j.total_cn===null)return null;const P=b(j.total_cn);return r.jsxs("g",{className:"cn-seg","data-call":T,"data-on":E||void 0,children:[T!=="neutral"&&r.jsx("rect",{x:O,y:Math.min(P,S),width:M,height:Math.abs(P-S),fill:`url(#${m[T]})`,className:"cn-col"}),r.jsx("line",{x1:O,x2:O+M,y1:P,y2:P,style:{stroke:Py[T]},className:"cn-line"}),r.jsx("rect",{x:O-2,y:Math.min(P,S)-9,width:M+4,height:Math.abs(P-S)+18,fill:"transparent",className:"cn-hit",onMouseEnter:()=>g({index:N,x:O+M/2,y:P}),onMouseLeave:()=>g(null),onClick:()=>v(j)})]},N)}if(j.major_cn===null||j.minor_cn===null)return null;const _=b(j.major_cn+Qu),D=b(j.minor_cn-Qu);return r.jsxs("g",{className:"cn-seg","data-on":E||void 0,children:[r.jsx("line",{x1:O,x2:O+M,y1:D,y2:D,className:"cn-line cn-minor"}),r.jsx("line",{x1:O,x2:O+M,y1:_,y2:_,className:"cn-line cn-major"}),r.jsx("rect",{x:O-2,y:Math.min(_,D)-9,width:M+4,height:Math.abs(_-D)+18,fill:"transparent",className:"cn-hit",onMouseEnter:()=>g({index:N,x:O+M/2,y:_}),onMouseLeave:()=>g(null),onClick:()=>v(j)})]},N)})})}),C3=C.memo(function({segments:a,spans:l,mode:i,top:c,baseline:d,plotL:f,plotW:m,y0:g}){const v=x=>g+3+(1-Math.min(x,c)/c)*(Zi-6);return r.jsxs("g",{pointerEvents:"none",children:[Nn.map(([x],p)=>{const[b,S]=Os(x);return p%2===0?r.jsx("rect",{x:f+b/it*m,y:g,width:(S-b)/it*m,height:Zi,className:"cn-mini-band"},x):null}),r.jsx("line",{x1:f,x2:f+m,y1:v(d),y2:v(d),className:"cn-mini-base"}),a.map((x,p)=>{const b=i==="total"?x.total_cn:x.major_cn;if(b===null)return null;const S=cd(x),j=f+l[p][0]/it*m,N=Math.max((l[p][1]-l[p][0])/it*m,S==="neutral"?1:2);return r.jsx("line",{x1:j,x2:j+N,y1:v(b),y2:v(b),className:"cn-mini-line",style:{stroke:i==="total"?Py[S]:"var(--ink-2)"}},p)})]})});function M3({data:n,mode:a,drivers:l,focus:i,locate:c,view:d,onView:f,onSegment:m,onGene:g}){const[v,x]=ks(900),p=C.useRef(null),b=C.useId(),S={gain:`${b}-gain`,amp:`${b}-amp`,loss:`${b}-loss`},[j,N]=C.useState(d.window),R=C.useRef(j);R.current=j,C.useLayoutEffect(()=>{const W=d.window,he=typeof matchMedia<"u"&&matchMedia("(prefers-reduced-motion: reduce)").matches;if(!d.smooth||he){N(W);return}const we=R.current,Ge=performance.now();let Ke=0;const ft=zt=>{const tt=Math.min(1,(zt-Ge)/w3);N(c3(we,W,Dg(tt))),tt<1&&(Ke=requestAnimationFrame(ft))};return Ke=requestAnimationFrame(ft),()=>cancelAnimationFrame(Ke)},[d]);const[A,T]=C.useState(null),[O,M]=C.useState(null),[E,_]=C.useState(null),[D,P]=C.useState(!1),Z=C.useRef(!1),z=C.useMemo(()=>u3(n,a),[n,a]),te=C.useMemo(()=>n.segments.some(W=>Math.max(W.total_cn??0,W.major_cn??0)>z),[n,z]),ie=C.useMemo(()=>n.segments.map(W=>[Vu(W.chrom,W.start),Vu(W.chrom,W.end)]),[n]),J=C.useMemo(()=>x3(l),[l]),se=$v,re=Math.max(x-$v-j3,200),$=j[1]-j[0],G=W=>se+(W-j[0])/$*re,X=W=>j[0]+(W-se)/re*$,le=W=>zs(W,11.5,600)+14,ae=C.useMemo(()=>{const W=J.map(he=>({left:se+he.x/it*re-le(he.gene)/2,width:le(he.gene)}));return J.length?Math.max(...Yu(W,4))+1:0},[J,se,re]),Se=(ae?ae*Uv+8:4)+4,ce=Se+$r,k=ce+10,U=k+Hv+12,V=U+Zi+6,oe={plotL:se,plotW:re,plotTop:Se,top:z,baseline:n.baseline},de=W=>Se+(1-Math.min(Math.max(W,0),z)/z)*$r,be=J.map((W,he)=>({m:W,index:he,x:G(W.x)})).filter(({x:W})=>W>=se-4&&W<=se+re+4),Me=Yu(be.map(({m:W,x:he})=>({left:he-le(W.gene)/2,width:le(W.gene)})),4),ge=(W,he)=>W>=se&&W<=se+re&&he>=Se&&he<=ce,ve=W=>{const he=p.current.getBoundingClientRect();return[W.clientX-he.left,W.clientY-he.top]},ut=C.useCallback(W=>f({window:W,smooth:!1}),[f]),Zt=C.useCallback(W=>f({window:W,smooth:!0}),[f]),Bn=C.useRef({shown:j,plotL:se,plotW:re,plotTop:Se,plotBottom:ce,move:ut});Bn.current={shown:j,plotL:se,plotW:re,plotTop:Se,plotBottom:ce,move:ut},C.useEffect(()=>{const W=v.current;if(!W||!p.current)return;const he=()=>p.current.getBoundingClientRect();return Qy(W,()=>{const we=Bn.current,Ge=()=>he().left-W.getBoundingClientRect().left,Ke=()=>he().top-W.getBoundingClientRect().top,ft=we.shown[1]-we.shown[0];return{inside:(zt,tt)=>{const Dt=zt-Ge(),Cn=tt-Ke();return Dt>=we.plotL&&Dt<=we.plotL+we.plotW&&Cn>=we.plotTop&&Cn<=we.plotBottom},zoom:(zt,tt)=>{const Dt=em(we.shown,we.shown[0]+(tt-Ge()-we.plotL)/we.plotW*ft,zt);return Math.abs(Dt[0]-we.shown[0])<1e-6&&Math.abs(Dt[1]-we.shown[1])<1e-6?!1:(we.move(Dt),!0)},pan:zt=>we.move(wr(we.shown,zt/we.plotW*ft))}})},[v]),C.useEffect(()=>{c&&/^(\d+|X)$/.test(c.chrom.replace(/^chr/,""))&&Zt(Os(c.chrom))},[c,Zt]);const mn=W=>{if(W.button!==0)return;const[he,we]=ve(W);if(!ge(he,we)||!Lv(j))return;W.preventDefault();const Ge=j;P(!0),Xu(W,Ke=>ut(wr(Ge,-(Ke/re)*(Ge[1]-Ge[0]))),Ke=>{P(!1),Ke&&(Z.current=!0,setTimeout(()=>Z.current=!1,0))})},ot=W=>{const[he,we]=ve(W);_(ge(he,we)?he:null)},Ve=W=>{const[he,we]=ve(W);if(!ge(he,we))return;const Ge=ug(X(he));Ge&&Zt(Os(Ge))},Bt=W=>{const he=(j[0]+j[1])/2;if(W.key==="ArrowLeft"||W.key==="ArrowRight")W.preventDefault(),ut(wr(j,(W.key==="ArrowLeft"?-.15:.15)*$));else if(W.key==="+"||W.key==="=")Zt(em(j,he,.6));else if(W.key==="-")Zt(em(j,he,1/.6));else if(W.key==="0"||W.key==="Home")Zt([0,it]);else return;W.key!=="ArrowLeft"&&W.key!=="ArrowRight"&&W.preventDefault()},Fn=C.useCallback(W=>{Z.current||m(W)},[m]),Jt=Nn.map(([W],he)=>{const[we,Ge]=Os(W);return{chrom:W,i:he,x0:G(we),x1:G(Ge)}}).filter(({x0:W,x1:he})=>he>se&&W<se+re),Wt=Jt.length===1?Jt[0]:null,Ls=Wt?h3(j[0],j[1],Math.max(2,Math.round(re/120))):[],xt=(()=>{if(!i)return null;const W=Vu(i.chrom,i.pos);if(W<j[0]||W>j[1])return null;const he=tm(n,i.chrom,i.pos),we=nm(he,a),Ge=a==="allele"&&we!==null?Qu:0;return{x:G(W),y:de((we??n.baseline)+Ge),copies:(he==null?void 0:he.total_cn)??null}})(),fs=A?n.segments[A.index]:null,an=fs?p3(fs):null,gn=O!==null?J[O]:null,oa=W=>se+W/it*re,Ot={x0:oa(j[0]),x1:oa(j[1])},$s=Lv(j),ms=(W,he)=>{W.stopPropagation(),W.preventDefault();const we=j;P(!0),Xu(W,Ge=>{const Ke=Ge/re*it;ut(he==="move"?wr(we,Ke):r3(we,he,we[he]+Ke))},()=>P(!1))};return r.jsxs("div",{ref:v,className:"cn","data-dragging":D||void 0,"data-zoomed":$s||void 0,tabIndex:0,role:"group","aria-label":`Copy number of ${n.sample} across the genome, against ${n.baseline} copies.`,"aria-keyshortcuts":"ArrowLeft ArrowRight + - 0",onKeyDown:Bt,children:[r.jsxs("svg",{ref:p,width:x,height:V,"aria-hidden":!0,onPointerDown:mn,onPointerMove:ot,onPointerLeave:()=>_(null),onDoubleClick:Ve,children:[r.jsxs("defs",{children:[r.jsxs("linearGradient",{id:S.gain,x1:"0",y1:"0",x2:"0",y2:"1",children:[r.jsx("stop",{offset:"0",style:{stopColor:"var(--gain)"},stopOpacity:.46}),r.jsx("stop",{offset:"1",style:{stopColor:"var(--gain)"},stopOpacity:.04})]}),r.jsxs("linearGradient",{id:S.amp,x1:"0",y1:"0",x2:"0",y2:"1",children:[r.jsx("stop",{offset:"0",style:{stopColor:"var(--gain-strong)"},stopOpacity:.62}),r.jsx("stop",{offset:"1",style:{stopColor:"var(--gain-strong)"},stopOpacity:.05})]}),r.jsxs("linearGradient",{id:S.loss,x1:"0",y1:"0",x2:"0",y2:"1",children:[r.jsx("stop",{offset:"0",style:{stopColor:"var(--loss)"},stopOpacity:.04}),r.jsx("stop",{offset:"1",style:{stopColor:"var(--loss)"},stopOpacity:.46})]}),r.jsx("clipPath",{id:`${b}-plot`,children:r.jsx("rect",{x:se-4,y:Se-2,width:re+8,height:$r+4})})]}),r.jsx("g",{clipPath:`url(#${b}-plot)`,children:Nn.map(([W],he)=>{const[we,Ge]=Os(W),Ke=G(we),ft=G(Ge);return he%2===0&&ft>se&&Ke<se+re?r.jsx("rect",{x:Ke,y:Se,width:ft-Ke,height:$r,className:"cn-band"},W):null})}),Array.from({length:z+1},(W,he)=>r.jsxs("g",{children:[r.jsx("line",{x1:se,x2:se+re,y1:de(he),y2:de(he),className:"cn-grid"}),r.jsx("text",{x:se-10,y:de(he)+4,textAnchor:"end",className:"cn-tick",children:he===z&&te?`${he}+`:he})]},he)),r.jsx("line",{x1:se,x2:se+re,y1:de(n.baseline),y2:de(n.baseline),className:"cn-baseline"}),r.jsxs("text",{x:se+8,y:de(n.baseline)-7,className:"cn-baseline-label",children:[n.baseline," copies"]}),r.jsx("g",{className:"cn-reveal",children:r.jsx("g",{clipPath:`url(#${b}-plot)`,children:r.jsx(N3,{segments:n.segments,spans:ie,mode:a,shown:j,geo:oe,hover:A?A.index:null,grad:S,onHover:T,onClick:Fn})})}),E!==null&&!D&&!A&&O===null&&r.jsxs("g",{pointerEvents:"none",children:[r.jsx("line",{x1:E,x2:E,y1:Se,y2:ce,className:"cn-guide"}),r.jsxs("g",{transform:`translate(${Math.min(Math.max(E,se+52),se+re-52)} ${ce-24})`,children:[r.jsx("rect",{x:-50,width:100,height:18,rx:9,className:"cn-readout"}),r.jsx("text",{y:12.5,textAnchor:"middle",className:"cn-readout-text",children:m3(X(E))})]})]}),be.map(({m:W,x:he,index:we},Ge)=>{const Ke=tm(n,W.chrom,W.pos),ft=nm(Ke,a),zt=de((ft??n.baseline)+(a==="allele"&&ft!==null?Qu:0)),tt=le(W.gene),Dt=4+Me[Ge]*Uv,Cn=O===we;return r.jsxs("g",{className:"cn-driver","data-on":Cn||void 0,onPointerDown:sl=>sl.stopPropagation(),onMouseEnter:()=>M(we),onMouseLeave:()=>M(null),onClick:()=>g(W.gene),children:[r.jsx("line",{x1:he,x2:he,y1:Dt+16,y2:zt,className:"cn-leader"}),r.jsx("rect",{x:he-tt/2,y:Dt,width:tt,height:16,rx:8,className:"cn-chip"}),r.jsx("text",{x:he,y:Dt+11.5,textAnchor:"middle",className:"cn-gene",children:W.gene}),r.jsx("circle",{cx:he,cy:zt,r:Cn?6.5:5,className:"cn-dot"})]},W.gene)}),xt&&i&&r.jsxs("g",{pointerEvents:"none",children:[r.jsx("line",{x1:xt.x,x2:xt.x,y1:Se,y2:ce,className:"cn-focus-line"}),r.jsx("circle",{cx:xt.x,cy:xt.y,r:6.5,className:"cn-focus-dot"}),(()=>{const W=`${i.gene??"?"}${xt.copies!==null?` ${xt.copies} copies`:""}`,he=zs(W,11.5,600)+14,we=xt.x+12+he>se+re;return r.jsxs("g",{transform:`translate(${we?xt.x-12-he:xt.x+12} ${xt.y-12})`,children:[r.jsx("rect",{width:he,height:22,rx:7,className:"cn-focus-chip"}),r.jsx("text",{x:7,y:15,className:"cn-focus-text",children:W})]})})()]}),r.jsxs("g",{className:"cn-strip",children:[Jt.map(({chrom:W,i:he,x0:we,x1:Ge})=>{const Ke=Math.max(we,se),ft=Math.min(Ge,se+re),zt=ft-Ke,tt=Wt?`chr${W}`:W;return r.jsxs("g",{className:"cn-pill",onClick:()=>Zt(Os(W)),role:"presentation",children:[r.jsx("title",{children:`Zoom to chromosome ${W}`}),r.jsx("rect",{x:Ke+.5,y:k,width:Math.max(zt-1,1),height:Hv,rx:7,"data-odd":he%2?"":void 0}),zt>=zs(tt,11,600)+3&&r.jsx("text",{x:Wt?Ke+10:(Ke+ft)/2,y:k+15,textAnchor:Wt?"start":"middle",children:tt})]},W)}),Wt&&Ls.map(W=>{const he=G(W.value);return he>Math.max(Wt.x0,se)+70&&he<se+re-20?r.jsxs("g",{pointerEvents:"none",children:[r.jsx("line",{x1:he,x2:he,y1:k+3,y2:k+9,className:"cn-mb-tick"}),r.jsx("text",{x:he,y:k+18,textAnchor:"middle",className:"cn-mb",children:W.label})]},W.value):null})]}),r.jsx(C3,{segments:n.segments,spans:ie,mode:a,top:z,baseline:n.baseline,plotL:se,plotW:re,y0:U}),r.jsx("rect",{x:se,y:U,width:re,height:Zi,fill:"transparent",className:"cn-mini-track",onPointerDown:W=>{const[he]=ve(W),we=j[1]-j[0],Ge=(he-se)/re*it;Zt(wr([Ge-we/2,Ge+we/2],0))}}),$s&&r.jsxs("g",{className:"cn-mini-window",children:[r.jsx("rect",{x:Ot.x0,y:U-1,width:Math.max(Ot.x1-Ot.x0,4),height:Zi+2,rx:6,onPointerDown:W=>ms(W,"move"),className:"cn-mini-win"}),[0,1].map(W=>r.jsx("rect",{x:(W===0?Ot.x0:Ot.x1)-4,y:U+Zi/2-9,width:8,height:18,rx:4,className:"cn-mini-handle",onPointerDown:he=>ms(he,W)},W))]})]}),an&&A&&r.jsxs(Kt,{x:A.x+0,y:A.y+0,width:x,children:[r.jsxs("span",{className:"ctip-title",children:[r.jsx("span",{className:"cn-call-dot","data-call":cd(fs),"aria-hidden":!0}),an.call,r.jsx("span",{className:"ctip-sub",children:an.copies})]}),an.alleles&&r.jsxs("span",{className:"ctip-row",children:[r.jsx("span",{children:"Alleles"}),r.jsx("b",{children:an.alleles})]}),r.jsxs("span",{className:"ctip-row",children:[r.jsx("span",{children:"Region"}),r.jsx("b",{className:"mono",children:an.span})]}),an.log2&&r.jsxs("span",{className:"ctip-row",children:[r.jsx("span",{children:"log2 ratio"}),r.jsx("b",{children:an.log2})]}),r.jsx("span",{className:"ctip-note",children:"Click to list the mutations in this segment"})]}),gn&&O!==null&&r.jsxs(Kt,{x:G(gn.x),y:Se+10,width:x,children:[r.jsxs("span",{className:"ctip-title",children:[r.jsx("i",{children:gn.gene}),gn.changes&&r.jsx("span",{className:"ctip-sub",children:gn.changes})]}),(()=>{const W=nm(tm(n,gn.chrom,gn.pos),a);return W!==null?r.jsxs("span",{className:"ctip-row",children:[r.jsx("span",{children:"Copy number here"}),r.jsx("b",{children:W})]}):null})(),r.jsx("span",{className:"ctip-note",children:"Driver. Click to find it in the table"})]})]})}const E3={"del.mh.prop":{short:"Del. MH",long:"Deletions with microhomology (share of deletions)"},SNV3:{short:"SBS3",long:"Substitution signature 3"},SV3:{short:"RS3",long:"Rearrangement signature 3"},SV5:{short:"RS5",long:"Rearrangement signature 5"},hrd:{short:"HRD index",long:"HRD index (loss of heterozygosity, telomeric imbalance, large-scale transitions)"},SNV8:{short:"SBS8",long:"Substitution signature 8"}};function Bv(n,a="short"){var l;return((l=E3[n])==null?void 0:l[a])??n}const sm=8;function R3(n){const a=n.find(c=>c.group==="sample")??n[0],l=[...(a==null?void 0:a.signatures)??[]].sort((c,d)=>(d.proportion??0)-(c.proportion??0)).map(c=>c.signature),i=l.length>sm?sm-1:sm;return{shown:l.slice(0,i),other:l.slice(i)}}function Fv(n){return n.group==="sample"?"This tumour":`${n.label.replace(/\(\d+\)$/,"")} cohort${n.cohort_n?`, n = ${n.cohort_n}`:""}`}const Vv=["#2a78d6","#eb6834","#1baf7a","#eda100","#e87ba4","#008300","#6250d6","#e34948"],T3="#a3a3ab";function _3(n){const{shown:a,other:l}=R3(n),i=n.find(g=>g.group==="sample")??n[0],c=n.find(g=>g.group==="cohort")??null,d=(g,v,x)=>g?g.signatures.filter(p=>v.includes(p.signature)).reduce((p,b)=>p+(b[x]??0),0):null,f=(g,v,x)=>{var p,b;return{name:g,members:v,colour:x,share:d(i,v,"proportion")??0,cohortShare:d(c,v,"proportion"),count:d(i,v,"count")??0,cohortCount:d(c,v,"count"),aetiology:v.length===1?((p=i==null?void 0:i.signatures.find(S=>S.signature===g))==null?void 0:p.aetiology)??((b=c==null?void 0:c.signatures.find(S=>S.signature===g))==null?void 0:b.aetiology)??null:`${v.length} smaller signatures`}},m=a.map((g,v)=>f(g,[g],Vv[v%Vv.length]));return l.length&&m.push(f("Other",l,T3)),m}function Ia(n){return n.cohortShare===null?null:(n.share-n.cohortShare)*100}function Gv(n,a,l){const i=Math.max(a-l*Math.max(n.length-1,0),0),c=n.reduce((f,m)=>f+m,0)||1;let d=0;return n.map(f=>{const m=f/c*i,g={y0:d,y1:d+m};return d+=m+l,g})}function A3(n,a,l,i){const c=(n+l)/2,d=f=>f.toFixed(2);return`M${d(n)},${d(a.y0)} C${d(c)},${d(a.y0)} ${d(c)},${d(i.y0)} ${d(l)},${d(i.y0)} L${d(l)},${d(i.y1)} C${d(c)},${d(i.y1)} ${d(c)},${d(a.y1)} ${d(n)},${d(a.y1)} Z`}function Ds(n,a){const l=(n.length-1)*a,i=Math.floor(l),c=Math.ceil(l);return n[i]+(n[c]-n[i])*(l-i)}function Yy(n){var c;const a=n.cohort.filter(d=>d!==null&&Number.isFinite(d)).sort((d,f)=>d-f);if(a.length===0)return null;const l=((c=n.sample)==null?void 0:c.value)??null,i=[...a];if(l!==null){const d=i.indexOf(l);d>=0&&i.splice(d,1)}return{values:a,q1:Ds(a,.25),median:Ds(a,.5),q3:Ds(a,.75),tumour:l,above:l===null?null:i.filter(d=>d<l).length,others:i.length}}function O3(n,a=64){const l=n.length,i=n.reduce((v,x)=>v+x,0)/l,c=Math.sqrt(n.reduce((v,x)=>v+(x-i)**2,0)/Math.max(l-1,1)),d=Math.min(c,(Ds(n,.75)-Ds(n,.25))/1.34)||c||.1,f=Math.max(.9*d*l**-.2,.02),m=Array.from({length:a+1},(v,x)=>{const p=x/a;return{x:p,y:n.reduce((b,S)=>b+Math.exp(-.5*((p-S)/f)**2),0)}}),g=Math.max(...m.map(v=>v.y))||1;return m.map(v=>({x:v.x,y:v.y/g}))}function z3(n,a){const l=[],i=new Array(n.length).fill(0);return[...n.keys()].sort((c,d)=>n[c]-n[d]).forEach(c=>{let d=0;for(;l.some(f=>f.level===d&&Math.abs(f.x-n[c])<a);)d+=1;l.push({x:n[c],level:d}),i[c]=d}),i}function am(n){return n.above===null||n.others===0?"":n.above===n.others?n.others===1?"Above the other sample":"Highest in the cohort":n.above===0?"Lowest in the cohort":`Above ${n.above} of ${n.others} others`}function Ji(n,a,l,i){const c=Math.PI*(1-Math.min(Math.max(i,0),1));return{x:n+l*Math.cos(c),y:a-l*Math.sin(c)}}function D3(n){const{value:a,exact:l}=n;return a===null?"–":a===0&&l!=null&&l>0?l<1e-4?"<0.0001":String(Number(l.toPrecision(2))):a.toFixed(2)}function k3(n){const a=n.threshold;if(a===null)return null;const l=n.exact??n.value;return l===null||!n.rating?`High at ${a} and above`:n.rating==="HIGH"?`At or above the ${a} threshold`:l<a/2?`Well below the ${a} threshold`:`Below the ${a} threshold`}function dg(n){const a=n.filter(f=>f!==null&&Number.isFinite(f)).sort((f,m)=>f-m);if(!a.length)return null;const l=Ds(a,.25),i=Ds(a,.75),c=1.5*(i-l),d=a.filter(f=>f>=l-c&&f<=i+c);return{n:a.length,min:a[0],max:a[a.length-1],q1:l,median:Ds(a,.5),q3:i,low:d[0]??l,high:d[d.length-1]??i}}function L3(n,a=48){const l=n.filter(j=>j!==null&&Number.isFinite(j));if(l.length<2)return[];const i=Math.min(...l),c=Math.max(...l);if(c===i)return[];const d=l.length,f=l.reduce((j,N)=>j+N,0)/d,m=Math.sqrt(l.reduce((j,N)=>j+(N-f)**2,0)/(d-1)),g=[...l].sort((j,N)=>j-N),v=Ds(g,.75)-Ds(g,.25),x=Math.min(m,v/1.34)||m||(c-i)/4,p=Math.max(.9*x*d**-.2,(c-i)/200),b=Array.from({length:a+1},(j,N)=>{const R=i+(c-i)*N/a;return{v:R,d:l.reduce((A,T)=>A+Math.exp(-.5*((R-T)/p)**2),0)}}),S=Math.max(...b.map(j=>j.d))||1;return b.map(j=>({v:j.v,d:j.d/S}))}function Xy(n,a,l){if(n===null)return"";const i=a.filter(d=>d!==null&&Number.isFinite(d));if(!i.length)return"";const c=i.filter(d=>d<n).length;return c===i.length?`Higher than every ${l}`:c===0?`Lower than every ${l}`:`Higher than ${c} of ${i.length} ${l}s`}function $3(n,a){const l=[],i=new Array(n.length).fill(0),c=[...n.keys()].sort((d,f)=>n[d]-n[f]);for(const d of c){let f=0;const m=g=>g===0?0:g%2?-Math.ceil(g/2):g/2;for(;l.some(g=>g.slot===m(f)&&Math.abs(g.y-n[d])<a);)f+=1;l.push({y:n[d],slot:m(f)}),i[d]=m(f)}return i}const Hi=46,Ui=30,Bi=210,qv=30,H3=58,U3=132,Iv=6,Fi=n=>`${Math.round(n*100)}%`;function B3({data:n}){var M,E;const[a,l]=ks(760),[i,c]=C.useState(((M=n.projects[0])==null?void 0:M.project)??null),[d,f]=C.useState(null),m=n.projects.find(_=>_.project===i)??n.projects[0],g=m.diseases,v=l-Hi-8,x=Math.min(U3,Math.max(H3,v/Math.max(g.length,1))),p=x*g.length,b=Math.max(l,Hi+p+8),S=Hi+Math.max(0,(v-p)/2),j=Math.max(v,p),N=_=>Ui+Bi*(1-Math.min(Math.max(_,0),1)),R=m.tumour?g.findIndex(_=>{var D;return _.disease===((D=m.tumour)==null?void 0:D.disease)}):-1,A=C.useMemo(()=>g.map(_=>{const D=_.values.filter(Z=>Z!==null),P=D.map(Z=>N(Z));return{disease:_,stats:dg(D),values:D,py:P,slots:$3(P,Iv)}}),[g]),T=d===null?null:A[d],O=((E=m.tumour)==null?void 0:E.fga)??null;return r.jsxs("section",{className:"fga sig-section","aria-label":"Fraction of genome altered against the cohort",children:[r.jsxs("div",{className:"ctx-head",children:[r.jsxs("h3",{className:"sv-h",children:["Fraction of genome altered against the cohort",r.jsxs("span",{className:"sv-h-n",children:["project ",m.project,", n = ",m.n]})]}),r.jsxs("div",{className:"ctx-controls",children:[r.jsx("span",{className:"snap",title:"Cohorts show the samples the report compared with when it ran. Rerun the report to compare with the cohort as it is now.",children:"Cohort as of the report run"}),n.projects.length>1&&r.jsx(es,{label:"Project",value:m.project??"",onChange:_=>c(_),options:n.projects.map(_=>({value:_.project??"",label:`Project ${_.project}`}))})]})]}),r.jsx("div",{className:"fga-wrap",children:r.jsxs("div",{ref:a,className:"fga-plot",onMouseLeave:()=>f(null),children:[r.jsx("div",{className:"fga-scroll",children:r.jsxs("svg",{width:b,height:Ui+Bi+qv,role:"img","aria-label":`FGA by disease in project ${m.project}`,children:[[0,.25,.5,.75,1].map(_=>r.jsxs("g",{children:[r.jsx("line",{x1:Hi,x2:Hi+j,y1:N(_),y2:N(_),className:_===0?"ctx-base":"ctx-grid"}),r.jsx("text",{x:Hi-8,y:N(_)+4,textAnchor:"end",className:"ctx-tick",children:Fi(_)})]},_)),A.map(({disease:_,stats:D,values:P,py:Z,slots:z},te)=>{const ie=S+x*te+x/2,J=Math.min(30,x*.46),se=te===R;return r.jsxs("g",{className:"fga-col","data-on":d===te||void 0,"data-mine":se||void 0,children:[r.jsx("rect",{x:S+x*te+2,y:Ui-6,width:x-4,height:Bi+12,rx:10,className:"fga-band"}),D&&r.jsxs(r.Fragment,{children:[r.jsx("line",{x1:ie,x2:ie,y1:N(D.high),y2:N(D.low),className:"fga-whisker"}),r.jsx("rect",{x:ie-J/2,y:N(D.q3),width:J,height:Math.max(N(D.q1)-N(D.q3),1.5),rx:5,className:"fga-box"}),r.jsx("line",{x1:ie-J/2,x2:ie+J/2,y1:N(D.median),y2:N(D.median),className:"fga-median"})]}),P.map((re,$)=>r.jsx("circle",{cx:ie+z[$]*(Iv+1),cy:Z[$],r:2.8,className:"fga-dot"},$)),r.jsx("text",{x:ie,y:Ui+Bi+20,textAnchor:"middle",className:"fga-label",children:_.disease}),r.jsx("rect",{x:S+x*te,y:Ui-8,width:x,height:Bi+qv+8,fill:"transparent",tabIndex:0,"aria-label":`${_.name??_.disease}: ${P.length} samples`,onMouseEnter:()=>f(te),onFocus:()=>f(te),onBlur:()=>f(null)})]},_.disease)}),R>=0&&O!==null&&r.jsxs("g",{className:"fga-pin",pointerEvents:"none",transform:`translate(${S+x*R+x/2} ${N(O)})`,children:[r.jsx("circle",{r:8,className:"fga-pin-dot"}),r.jsxs("g",{transform:"translate(0 -18)",children:[r.jsx("rect",{x:-44,y:-11,width:88,height:20,rx:10,className:"fga-pin-chip"}),r.jsxs("text",{y:3.5,textAnchor:"middle",className:"fga-pin-text",children:["This tumour ",Fi(O)]})]})]})]})}),T&&d!==null&&r.jsxs(Kt,{x:Math.min(S+x*d+x/2,l-10),y:Ui+Bi/2,width:l,children:[r.jsx("span",{className:"ctip-title",children:T.disease.name??T.disease.disease}),T.stats&&r.jsxs(r.Fragment,{children:[r.jsxs("span",{className:"ctip-row",children:[r.jsx("span",{children:"Samples"}),r.jsx("b",{children:T.stats.n})]}),r.jsxs("span",{className:"ctip-row",children:[r.jsx("span",{children:"Median"}),r.jsx("b",{children:Fi(T.stats.median)})]}),r.jsxs("span",{className:"ctip-row",children:[r.jsx("span",{children:"Middle half"}),r.jsxs("b",{children:[Fi(T.stats.q1),"–",Fi(T.stats.q3)]})]})]}),d===R&&O!==null&&r.jsxs("span",{className:"ctip-note",children:["This tumour ",Fi(O),"."," ",Xy(O,F3(T.values,O),`${T.disease.disease} sample`)]})]})]})})]})}function F3(n,a){const l=n.indexOf(a);return l<0?n:[...n.slice(0,l),...n.slice(l+1)]}const Pv=8,Qv=n=>`chr${n.chrom} · ${(n.start/1e6).toFixed(1)} Mb`;function V3({gene:n}){const a=n.copy_number??0,l=Math.min(Math.round(a),Pv);return r.jsx("span",{className:"cng-meter","data-alteration":n.alteration,"aria-hidden":!0,children:Array.from({length:Pv},(i,c)=>r.jsx("span",{"data-on":c<l||void 0},c))})}function G3({project:n,value:a}){if(a===null)return null;const l=a>=0;return r.jsxs("span",{className:"cng-expr","data-up":l||void 0,title:`RNA expression against the project ${n} cohort: log2 of this sample's level over the cohort mean`,children:[r.jsx("span",{className:"cng-arrow","aria-hidden":!0,children:l?"▲":"▼"}),l?"+":"−",Math.abs(a).toFixed(1),r.jsxs("i",{children:["p",n]})]})}function q3({genes:n,onHover:a,onLocate:l}){const i=n.filter(d=>d.alteration==="amplification").length,c=n.length-i;return r.jsxs("section",{className:"cng sig-section","aria-label":"Amplified and lost genes",children:[r.jsxs("h3",{className:"sv-h",children:["Amplified and lost genes",r.jsx("span",{className:"sv-h-n",children:n.length?`${i} amplified oncogene${i===1?"":"s"}, ${c} lost tumour suppressor${c===1?"":"s"}`:"none"})]}),n.length===0?r.jsx("p",{className:"sv-empty",children:"The report calls no amplified oncogenes or homozygously lost tumour suppressors."}):r.jsx("ul",{className:"cng-list",onMouseLeave:()=>a(null),children:n.map(d=>r.jsx("li",{children:r.jsxs("button",{type:"button",className:"cng-row","data-alteration":d.alteration,onMouseEnter:()=>a(d),onFocus:()=>a(d),onBlur:()=>a(null),onClick:()=>l(d),"aria-label":`${d.gene}, ${d.alteration}, ${d.copy_number??"unknown"} copies, ${Qv(d)}: show on the plot`,children:[r.jsx("span",{className:"cng-gene",children:d.gene}),r.jsx("span",{className:"cng-where mono",children:Qv(d)}),r.jsxs("span",{className:"cng-copies",children:[r.jsx(V3,{gene:d}),r.jsxs("span",{className:"cng-n",children:[d.copy_number===null?"?":d.copy_number,r.jsx("small",{children:d.copy_number===1?" copy":" copies"})]})]}),r.jsx("span",{className:"cng-call",children:d.alteration==="amplification"?"Amplified":"Lost"}),r.jsx("span",{className:"cng-exprs",children:d.expression.map(f=>r.jsx(G3,{project:f.project,value:f.log2_fold},f.project))})]})},d.gene))})]})}function Nr({color:n,label:a}){return r.jsxs("span",{className:"flex items-center gap-1.5",children:[r.jsx("span",{className:"h-1 w-3.5 rounded-sm",style:{background:n}}),a]})}function I3({envelope:n,loading:a}){return(n==null?void 0:n.status)==="ok"&&n.data?r.jsx(B3,{data:n.data}):(n==null?void 0:n.status)==="missing"&&n.warnings.some(l=>l.includes("Rerun"))?r.jsxs("section",{className:"sig-section","aria-label":"Fraction of genome altered against the cohort",children:[r.jsx("h3",{className:"sv-h",children:"Fraction of genome altered against the cohort"}),r.jsx("p",{className:"sv-empty",children:n.warnings.join(" ")})]}):a&&!n?r.jsx("div",{className:"px-5 py-3",children:r.jsx("div",{className:"skeleton",style:{height:200},"aria-label":"Loading the FGA cohort figure"})}):null}function P3({envelope:n,loading:a,picked:l,sampleLabel:i,drivers:c,focus:d,locate:f,onSegment:m,onGene:g,fga:v,fgaLoading:x=!1,onOpenChromosome:p}){var te;const[b,S]=C.useState("total"),[j,N]=C.useState(null),[R,A]=C.useState(null),T=ie=>({chrom:ie.chrom,pos:Math.round((ie.start+ie.end)/2),gene:ie.gene}),O=C.useMemo(()=>R&&(!f||R.nonce>f.nonce)?R:f,[f,R]),[M,E]=C.useState({window:[0,it],smooth:!1}),_=((te=n==null?void 0:n.data)==null?void 0:te.allele_specific)??!1,D=f3(...M.window),P=C.useCallback(()=>E({window:[0,it],smooth:!0}),[]),Z=D?ug(M.window[0]+1e-6):null,z=Z&&Z===ug(M.window[1]-1e-6)?Z:null;return r.jsx(KM,{title:"Copy number",subtitle:`Copy number across the genome, ${i}`,info:"copyNumber",envelope:n,loading:a,picked:l,skeletonHeight:250,moreLineage:v==null?void 0:v.lineage,controls:r.jsxs(r.Fragment,{children:[D&&r.jsxs(r.Fragment,{children:[r.jsx("span",{className:"mono text-xs",style:{color:"var(--ink-2)"},"aria-live":"polite",children:D}),r.jsx("button",{type:"button",className:"sc-ib sm","aria-label":"Show the whole genome",title:"Show the whole genome",onClick:P,children:r.jsx(Sy,{size:15,"aria-hidden":!0})}),z&&p&&r.jsx("button",{type:"button",className:"sc-ib sm","aria-label":`Open chromosome ${z} in the CN/SV view`,title:`Open chromosome ${z} in the CN/SV view`,onClick:()=>p(z),children:r.jsx(my,{size:15,"aria-hidden":!0})})]}),r.jsx(es,{label:"Copy number view",value:_?b:"total",onChange:S,options:[{value:"total",label:"Total"},{value:"allele",label:"Allele-specific",disabled:!_}]})]}),footer:r.jsxs("span",{className:"flex flex-wrap items-center gap-x-4 gap-y-1 text-[12.5px]",style:{color:"var(--ink-2)"},children:[b==="total"||!_?r.jsxs(r.Fragment,{children:[r.jsx(Nr,{color:"var(--gain)",label:"Gain"}),r.jsx(Nr,{color:"var(--gain-strong)",label:"Amplification"}),r.jsx(Nr,{color:"var(--loss)",label:"Loss"})]}):r.jsxs(r.Fragment,{children:[r.jsx(Nr,{color:"var(--ink-2)",label:"Major allele"}),r.jsx(Nr,{color:"var(--chev)",label:"Minor allele"})]}),r.jsx("span",{style:{color:"var(--faint)"},children:"Scroll up or down over the plot to zoom, sideways (or drag) to pan, or move the window in the overview. Double-click a chromosome, or click its name, to fill the view."})]}),children:ie=>r.jsxs(r.Fragment,{children:[r.jsx(M3,{data:ie,mode:_?b:"total",drivers:c,focus:j??d,locate:O,view:M,onView:E,onSegment:m,onGene:g}),ie.genes&&r.jsx(q3,{genes:ie.genes,onHover:J=>N(J?T(J):null),onLocate:J=>A({...T(J),nonce:Date.now()})}),r.jsx(I3,{envelope:v,loading:x})]})})}function Q3(n){const[a,l]=n.range;return[[a,0],...n.bins.map(i=>[(i.x0+i.x1)/2,i.n]),[l,0]]}function lm(n,a){for(let l=1;l<n.length;l++){const[i,c]=n[l-1],[d,f]=n[l];if(a<=d)return d===i?f:c+(a-i)/(d-i)*(f-c)}return n[n.length-1][1]}function Y3(n){return n==="ccf"?"CCF":"VAF"}function Ws(n,a){return Math.min(Math.max(a,n.range[0]),n.range[1])}function X3(n){const a=n.measure==="ccf"?.25:.1,l=[];for(let i=n.range[0];i<=n.range[1]+1e-9;i+=a)l.push(Math.round(i*100)/100);return l}function K3(n,a){return n.measure==="ccf"?a===1?"1.0":a.toFixed(2).replace(/0$/,""):a.toFixed(1)}const Ml=14,Z3=22,Cr=118,J3=40,Vi=19,Yv=n=>Math.round(n*100)/100;function W3({data:n,range:a,focus:l,onRange:i,onGene:c}){const[d,f]=ks(),m=C.useId(),g=C.useRef(null),[v,x]=C.useState(null),[p,b]=C.useState(null),[S,j]=n.range,N=f-Z3,R=U=>Ml+(U-S)/(j-S)*(N-Ml),A=U=>S+(U-Ml)/(N-Ml)*(j-S),T=C.useMemo(()=>Q3(n),[n]),O=Math.max(1,...T.map(U=>U[1])),M=U=>U*Vi+8+Cr,E=(U,V)=>M(U)-V/(O*1.1)*Cr,_=C.useMemo(()=>[...n.drivers].sort((U,V)=>U.value-V.value),[n.drivers]),D=_.map(U=>({left:R(Ws(n,U.value))-zs(U.gene??"?",11.5,600)/2-6,width:zs(U.gene??"?",11.5,600)+12})),P=Yu(D,4),Z=_.length?Math.max(...P)+1:0,z=M(Z),te=z+J3,ie=T.map(([U,V])=>[R(U),E(Z,V)]),J=v3(ie),se=`${J} L${R(j).toFixed(2)},${z} L${R(S).toFixed(2)},${z} Z`,re=U=>U.kind==="new"?[Math.min(U.from,U.to),Math.max(U.from,U.to)]:U.kind==="edge"?[Math.min(U.fixed,U.to),Math.max(U.fixed,U.to)]:U.range,$=v?re(v):a,G=U=>{const V=g.current.getBoundingClientRect();return A(Math.min(Math.max(U-V.left,Ml),N))},X=(U,V,oe)=>{U.preventDefault(),U.stopPropagation();let de=V(G(U.clientX));x(de),Xu(U,(be,Me)=>{de=oe(de,G(Me.clientX)),x(de)},()=>{const[be,Me]=re(de);if(x(null),R(Me)-R(be)<4)return i(null);i([Yv(Ws(n,be)),Yv(Ws(n,Me))])})},le=(U,V)=>U.kind==="move"?U:{...U,to:V},ae=(U,V)=>{if(U.kind!=="move")return U;const oe=U.range[1]-U.range[0],de=Math.min(Math.max(U.range[0]+(V-U.grab),S),j-oe);return{...U,grab:V,range:[de,de+oe]}},me=$?[R(Ws(n,$[0])),R(Ws(n,$[1]))]:null,Se=Y3(n.measure),ce=l?n.measure==="ccf"?l.ccf:l.vaf:null,k=p!==null?_[p]:null;return r.jsxs("div",{ref:d,className:"dens","data-brushing":v?"":void 0,children:[r.jsxs("svg",{ref:g,width:f,height:te,role:"img","aria-label":`${Se} of ${n.total} variants in ${n.sample}${n.drivers.length?`, with ${n.drivers.map(U=>`${U.gene} at ${U.value.toFixed(2)}`).join(", ")}`:""}.`,onPointerDown:U=>{U.button===0&&X(U,V=>({kind:"new",from:V,to:V}),le)},children:[r.jsxs("defs",{children:[r.jsxs("linearGradient",{id:`${m}-fill`,x1:"0",y1:"0",x2:"0",y2:"1",children:[r.jsx("stop",{offset:"0",style:{stopColor:"var(--ccf-fill)"},stopOpacity:.42}),r.jsx("stop",{offset:"1",style:{stopColor:"var(--ccf-fill)"},stopOpacity:.03})]}),r.jsx("clipPath",{id:`${m}-spot`,children:me&&r.jsx("rect",{x:me[0],y:0,width:Math.max(me[1]-me[0],0),height:te})})]}),X3(n).map(U=>r.jsxs("g",{children:[r.jsx("line",{x1:R(U),x2:R(U),y1:Z*Vi+8,y2:z,className:"dens-grid","data-clonal":n.measure==="ccf"&&U===1?"":void 0}),r.jsx("text",{x:R(U),y:z+18,textAnchor:"middle",className:"dens-tick",children:K3(n,U)})]},U)),n.measure==="ccf"&&S<=1&&j>=1&&r.jsx("text",{x:R(1),y:z+31,textAnchor:"middle",className:"dens-clonal",children:"clonal"}),r.jsxs("g",{className:"dens-curve","data-dim":me?"":void 0,children:[r.jsx("path",{d:se,fill:`url(#${m}-fill)`}),r.jsx("path",{d:J,className:"dens-line"})]}),me&&r.jsx("g",{className:"dens-curve dens-lit",children:r.jsxs("g",{clipPath:`url(#${m}-spot)`,children:[r.jsx("path",{d:se,fill:`url(#${m}-fill)`}),r.jsx("path",{d:J,className:"dens-line"})]})}),r.jsx("line",{x1:Ml,x2:N,y1:z,y2:z,className:"dens-axis"}),n.median!==null&&r.jsx("path",{d:`M${R(n.median)},${z+1} l4.5,-6 l-4.5,-6 l-4.5,6 z`,className:"dens-median",children:r.jsx("title",{children:`Median ${n.median.toFixed(2)}`})}),_.map((U,V)=>{const oe=Ws(n,U.value),de=R(oe),be=E(Z,lm(T,oe)),Me=U.gene??"?",ge=zs(Me,11.5,600)+12,ve=8+P[V]*Vi,ut=p===V;return r.jsxs("g",{className:"dens-driver","data-on":ut||void 0,onPointerDown:Zt=>Zt.stopPropagation(),onMouseEnter:()=>b(V),onMouseLeave:()=>b(null),onClick:()=>U.gene&&c(U.gene),children:[r.jsx("line",{x1:de,x2:de,y1:ve+15,y2:be,className:"dens-leader"}),r.jsx("rect",{x:de-ge/2,y:ve,width:ge,height:16,rx:8,className:"dens-chip"}),r.jsx("text",{x:de,y:ve+11.5,textAnchor:"middle",className:"dens-gene",children:Me}),r.jsx("circle",{cx:de,cy:be,r:ut?7:5.5,className:"dens-dot"})]},`${Me}-${V}`)}),ce!=null&&r.jsx("g",{className:"dens-focus",pointerEvents:"none",children:(()=>{const U=Ws(n,ce),V=R(U),oe=E(Z,lm(T,U)),de=`${(l==null?void 0:l.gene)??"?"} ${ce.toFixed(2)}`,be=zs(de,11,600)+14,Me=V+12+be>f;return r.jsxs(r.Fragment,{children:[r.jsx("line",{x1:V,x2:V,y1:oe,y2:z,className:"dens-focus-line"}),r.jsx("circle",{cx:V,cy:oe,r:6.5,className:"dens-focus-dot"}),r.jsxs("g",{transform:`translate(${Me?V-12-be:V+12} ${oe-11})`,children:[r.jsx("rect",{width:be,height:22,rx:7,className:"dens-focus-chip"}),r.jsx("text",{x:7,y:15,className:"dens-focus-text",children:de})]})]})})()}),$&&me&&r.jsxs("g",{className:"dens-brush",children:[r.jsx("rect",{x:me[0],y:Z*Vi+4,width:Math.max(me[1]-me[0],0),height:Cr+8,className:"dens-sel",onPointerDown:U=>X(U,V=>({kind:"move",grab:V,range:$}),ae)}),[0,1].map(U=>r.jsxs("g",{children:[r.jsx("line",{x1:me[U],x2:me[U],y1:Z*Vi+4,y2:z,className:"dens-sel-edge"}),r.jsx("rect",{x:me[U]-5,y:Z*Vi+4,width:10,height:Cr+8,className:"dens-edge",onPointerDown:V=>X(V,()=>({kind:"edge",fixed:$[1-U],to:$[U]}),le)}),r.jsx("rect",{x:me[U]-3,y:z-Cr/2-10,width:6,height:20,rx:3,className:"dens-grip",pointerEvents:"none"})]},U)),r.jsxs("g",{transform:`translate(${Math.min(Math.max((me[0]+me[1])/2,Ml+48),N-48)} ${z-30})`,pointerEvents:"none",children:[r.jsx("rect",{x:-48,y:0,width:96,height:20,rx:10,className:"dens-readout"}),r.jsxs("text",{y:14,textAnchor:"middle",className:"dens-readout-text",children:[$[0].toFixed(2)," – ",$[1].toFixed(2)]})]})]})]}),k&&p!==null&&r.jsxs(Kt,{x:R(Ws(n,k.value)),y:E(Z,lm(T,Ws(n,k.value)))-22,width:f,above:!0,children:[r.jsxs("span",{className:"ctip-title",children:[r.jsx("i",{children:k.gene??"?"}),k.protein_change&&r.jsxs("span",{className:"ctip-sub",children:[" ",k.protein_change]})]}),r.jsxs("span",{className:"ctip-row",children:[r.jsx("span",{children:Se}),r.jsx("b",{children:k.value.toFixed(2)})]}),r.jsx("span",{className:"ctip-note",children:"Driver. Click to find it in the table"})]})]})}function eE({envelope:n,loading:a,measure:l,onMeasure:i,range:c,focus:d,onRange:f,onGene:m}){const g=l==="ccf"?"Cancer cell fraction":"Variant allele fraction",v=(n==null?void 0:n.status)==="ok"?n.data:null;return r.jsxs("div",{className:"strip",children:[r.jsxs("div",{className:"strip-head",children:[r.jsx("span",{className:"text-[13px] font-semibold",children:g}),v&&r.jsxs("span",{className:"text-[12.5px]",style:{color:"var(--muted)"},children:[v.median!==null?`Median ${v.median.toFixed(2)}. `:"","Drag across the plot to filter the table."]}),r.jsx("span",{className:"flex-auto"}),r.jsx(es,{label:"Measure",value:l,onChange:i,options:[{value:"ccf",label:"CCF"},{value:"vaf",label:"VAF"}]})]}),r.jsx(Hn,{label:g,envelope:n,loading:a,skeletonHeight:180,children:x=>r.jsx(W3,{data:x,range:c,focus:d,onRange:f,onGene:m})})]})}const tE=Object.keys($y),nE=Object.keys(Hy);function Xv(n,a){return n.includes(a)?n.filter(l=>l!==a):[...n,a]}function im({label:n,count:a,active:l,onClick:i}){return r.jsxs("button",{type:"button",className:"facet","aria-pressed":l,"data-empty":!l&&a===0,onClick:i,children:[r.jsx("span",{className:"facet-check","aria-hidden":!0,children:l&&r.jsx(gy,{size:11,strokeWidth:3})}),r.jsx("span",{className:"truncate",children:n}),r.jsx("span",{className:"facet-n",children:a===void 0?"":a.toLocaleString("en-US")})]})}function sE({table:n,data:a,onChange:l}){const i=a==null?void 0:a.facets.effects,c=a==null?void 0:a.facets.flags,d=n.range;return r.jsxs("aside",{className:"facets","aria-label":"Filters",children:[r.jsxs("div",{className:"facet-group",role:"group","aria-label":"Effect",children:[r.jsx("span",{className:"facet-title",children:"Effect"}),tE.map(f=>r.jsx(im,{label:$y[f],count:i==null?void 0:i[f],active:n.effects.includes(f),onClick:()=>l({effects:Xv(n.effects,f)})},f))]}),r.jsxs("div",{className:"facet-group",role:"group","aria-label":"Flags",children:[r.jsx("span",{className:"facet-title",children:"Flags"}),nE.map(f=>r.jsx(im,{label:Hy[f],count:c==null?void 0:c[f],active:n.flags.includes(f),onClick:()=>l({flags:Xv(n.flags,f)})},f))]}),(a==null?void 0:a.ffpe)&&r.jsxs("div",{className:"facet-group",role:"group","aria-label":"FFPE filter",children:[r.jsx("span",{className:"facet-title",children:"FFPE filter"}),r.jsx(im,{label:"Show filtered calls",count:a.ffpe.removed,active:n.ffpe,onClick:()=>l({ffpe:!n.ffpe})}),r.jsx("span",{className:"facet-note",children:a.ffpe.threshold!==null?`As in the report, calls FFPERASE scores above ${a.ffpe.threshold} are left out of the counts.`:"As in the report, calls its FFPE filter removes are left out of the counts."})]}),d&&r.jsxs("div",{className:"facet-group",role:"group","aria-label":"Range",children:[r.jsxs("span",{className:"facet-title",children:[d.measure==="ccf"?"CCF":"VAF"," range"]}),r.jsxs("span",{className:"facet-range",children:[r.jsxs("span",{className:"mono",children:[d.low.toFixed(2)," – ",d.high.toFixed(2)]}),r.jsx("button",{type:"button",className:"sc-ib xs","aria-label":"Remove the range",title:"Remove the range",onClick:()=>l({range:null}),children:r.jsx(ec,{size:13,"aria-hidden":!0})})]})]}),Ly(n)>0&&r.jsx("button",{type:"button",className:"facet-clear",onClick:()=>l({q:"",effects:[],flags:[],range:null}),children:"Clear all filters"})]})}const om=48,Mr=16,Er=200,aE=26,Gi=["#1baf7a","#eda100"],rm=[{key:"snvs",label:"SNVs"},{key:"indels",label:"Indels"}];function lE({data:n}){const[a,l]=ks(760),[i,c]=C.useState(null),d=n.cohorts,f=d.length>1,m=(l-om-8)/rm.length,g=Math.min(m*.34,90),v=j=>{const N=[...d.flatMap(A=>A[j]),n.tumour[j]].filter(A=>A!==null),R=ud(Math.max(...N,1),4);return{ticks:R,top:R[R.length-1]}},x=i?d[i.cohort]:null,p=i&&x?x[i.event]:[],b=dg(p),S=i?n.tumour[i.event]:null;return r.jsxs("section",{className:"tmbc sig-section","aria-label":"Coding mutations against reference cohorts",children:[r.jsxs("div",{className:"ctx-head",children:[r.jsxs("h3",{className:"sv-h",children:["Coding mutations against reference cohorts",n.disease&&r.jsx("span",{className:"sv-h-n",children:n.disease})]}),r.jsxs("div",{className:"ctx-controls",children:[r.jsxs("ul",{className:"sv-sigs-key","aria-label":"Key",children:[d.map((j,N)=>r.jsxs("li",{children:[r.jsx("span",{className:"sv-swatch",style:{background:Gi[N%Gi.length]},"aria-hidden":!0}),j.cohort,j.n!==null&&r.jsx("span",{className:"sv-key-n",children:j.n})]},j.cohort??N)),r.jsxs("li",{children:[r.jsx("span",{className:"hrd-key-pin","aria-hidden":!0}),"This tumour"]})]}),r.jsx("span",{className:"snap",title:"Cohorts show the samples the report compared with when it ran. Rerun the report to compare with the cohort as it is now.",children:"Cohort as of the report run"})]})]}),r.jsx("div",{className:"fga-wrap",children:r.jsxs("div",{ref:a,className:"fga-plot",onMouseLeave:()=>c(null),children:[r.jsx("svg",{width:l,height:Mr+Er+aE,role:"img","aria-label":`Coding SNVs and indels against ${d.map(j=>j.cohort).join(" and ")}`,children:rm.map(({key:j,label:N},R)=>{const{ticks:A,top:T}=v(j),O=om+m*R,M=O+m/2,E=D=>Mr+Er*(1-D/T),_=n.tumour[j];return r.jsxs("g",{children:[A.map(D=>r.jsxs("g",{children:[r.jsx("line",{x1:O+6,x2:O+m-6,y1:E(D),y2:E(D),className:D===0?"ctx-base":"ctx-grid"}),r.jsx("text",{x:O,y:E(D)+4,textAnchor:"end",className:"ctx-tick",children:D.toLocaleString("en-US")})]},D)),d.map((D,P)=>{const Z=L3(D[j]),z=f?P===0?-1:1:0,te=Gi[P%Gi.length],ie=Z.length?z===0?[...Z.map($=>`${M+$.d*g},${E($.v)}`),...[...Z].reverse().map($=>`${M-$.d*g},${E($.v)}`)]:[`${M},${E(Z[0].v)}`,...Z.map($=>`${M+z*$.d*g},${E($.v)}`),`${M},${E(Z[Z.length-1].v)}`]:[],J=dg(D[j]),se=(i==null?void 0:i.event)===j&&i.cohort===P,re=z===0?M:M+z*6;return r.jsxs("g",{className:"tmb-violin","data-on":se||void 0,onMouseEnter:()=>c({event:j,cohort:P}),children:[ie.length>0&&r.jsx("polygon",{points:ie.join(" "),style:{fill:te,stroke:te},className:"tmb-shape"}),J&&r.jsxs(r.Fragment,{children:[r.jsx("line",{x1:re,x2:re,y1:E(J.q1),y2:E(J.q3),className:"tmb-iqr"}),r.jsx("circle",{cx:re,cy:E(J.median),r:3,className:"tmb-median"})]}),!ie.length&&D[j].map(($,G)=>$===null?null:r.jsx("circle",{cx:M+z*10,cy:E($),r:3,style:{fill:te}},G)),r.jsx("rect",{x:z===1?M:M-g-4,y:Mr,width:z===0?g*2+8:g+4,height:Er,fill:"transparent"})]},D.cohort??P)}),_!==null&&r.jsxs("g",{pointerEvents:"none",className:"tmb-tumour",children:[r.jsx("line",{x1:M-g-10,x2:M+g+10,y1:E(_),y2:E(_),className:"tmb-tumour-line"}),r.jsx("circle",{cx:M,cy:E(_),r:7,className:"fga-pin-dot"}),r.jsx("text",{x:M+12,y:E(_)-9,className:"tmb-tumour-text",children:_.toLocaleString("en-US")})]}),r.jsx("text",{x:M,y:Mr+Er+19,textAnchor:"middle",className:"fga-label",children:N})]},j)})}),i&&x&&r.jsxs(Kt,{x:om+m*rm.findIndex(j=>j.key===i.event)+m/2+(f?i.cohort===0?-g/2:g/2:0),y:Mr+Er/2,width:l,children:[r.jsxs("span",{className:"ctip-title",children:[r.jsx("span",{className:"sv-swatch",style:{background:Gi[i.cohort%Gi.length]},"aria-hidden":!0}),x.cohort,", coding ",i.event==="snvs"?"SNVs":"indels"]}),b&&r.jsxs(r.Fragment,{children:[r.jsxs("span",{className:"ctip-row",children:[r.jsx("span",{children:"Tumours"}),r.jsx("b",{children:b.n})]}),r.jsxs("span",{className:"ctip-row",children:[r.jsx("span",{children:"Median"}),r.jsx("b",{children:Math.round(b.median).toLocaleString("en-US")})]}),r.jsxs("span",{className:"ctip-row",children:[r.jsx("span",{children:"Middle half"}),r.jsxs("b",{children:[Math.round(b.q1).toLocaleString("en-US"),"–",Math.round(b.q3).toLocaleString("en-US")]})]})]}),S!==null&&r.jsxs("span",{className:"ctip-note",children:["This tumour ",S.toLocaleString("en-US"),". ",Xy(S,p,`${x.cohort} tumour`)]})]})]})})]})}/**
|
|
278
303
|
* table-core
|
|
279
304
|
*
|
|
280
305
|
* Copyright (c) TanStack
|
|
@@ -283,10 +308,10 @@ Error generating stack: `+i.message+`
|
|
|
283
308
|
* LICENSE.md file in the root directory of this source tree.
|
|
284
309
|
*
|
|
285
310
|
* @license MIT
|
|
286
|
-
*/function
|
|
311
|
+
*/function tl(n,a){return typeof n=="function"?n(a):n}function Un(n,a){return l=>{a.setState(i=>({...i,[n]:tl(l,i[n])}))}}function dd(n){return n instanceof Function}function iE(n){return Array.isArray(n)&&n.every(a=>typeof a=="number")}function oE(n,a){const l=[],i=c=>{c.forEach(d=>{l.push(d);const f=a(d);f!=null&&f.length&&i(f)})};return i(n),l}function Ee(n,a,l){let i=[],c;return d=>{let f;l.key&&l.debug&&(f=Date.now());const m=n(d);if(!(m.length!==i.length||m.some((x,p)=>i[p]!==x)))return c;i=m;let v;if(l.key&&l.debug&&(v=Date.now()),c=a(...m),l==null||l.onChange==null||l.onChange(c),l.key&&l.debug&&l!=null&&l.debug()){const x=Math.round((Date.now()-f)*100)/100,p=Math.round((Date.now()-v)*100)/100,b=p/16,S=(j,N)=>{for(j=String(j);j.length<N;)j=" "+j;return j};console.info(`%c⏱ ${S(p,5)} /${S(x,5)} ms`,`
|
|
287
312
|
font-size: .6rem;
|
|
288
313
|
font-weight: bold;
|
|
289
|
-
color: hsl(${Math.max(0,Math.min(120-120*S,120))}deg 100% 31%);`,a==null?void 0:a.key)}return c}}function Ee(n,l,a,o){return{debug:()=>{var c;return(c=n==null?void 0:n.debugAll)!=null?c:n[l]},key:!1,onChange:o}}function dE(n,l,a,o){const c=()=>{var h;return(h=d.getValue())!=null?h:n.options.renderFallbackValue},d={id:`${l.id}_${a.id}`,row:l,column:a,getValue:()=>l.getValue(o),renderValue:c,getContext:Me(()=>[n,a,l,d],(h,m,g,x)=>({table:h,column:m,row:g,cell:x,getValue:x.getValue,renderValue:x.renderValue}),Ee(n.options,"debugCells"))};return n._features.forEach(h=>{h.createCell==null||h.createCell(d,a,l,n)},{}),d}function hE(n,l,a,o){var c,d;const m={...n._getDefaultColumnDef(),...l},g=m.accessorKey;let x=(c=(d=m.id)!=null?d:g?typeof String.prototype.replaceAll=="function"?g.replaceAll(".","_"):g.replace(/\./g,"_"):void 0)!=null?c:typeof m.header=="string"?m.header:void 0,v;if(m.accessorFn?v=m.accessorFn:g&&(g.includes(".")?v=S=>{let j=S;for(const N of g.split(".")){var b;j=(b=j)==null?void 0:b[N]}return j}:v=S=>S[m.accessorKey]),!x)throw new Error;let y={id:`${String(x)}`,accessorFn:v,parent:o,depth:a,columnDef:m,columns:[],getFlatColumns:Me(()=>[!0],()=>{var S;return[y,...(S=y.columns)==null?void 0:S.flatMap(j=>j.getFlatColumns())]},Ee(n.options,"debugColumns")),getLeafColumns:Me(()=>[n._getOrderColumnsFn()],S=>{var j;if((j=y.columns)!=null&&j.length){let b=y.columns.flatMap(N=>N.getLeafColumns());return S(b)}return[y]},Ee(n.options,"debugColumns"))};for(const S of n._features)S.createColumn==null||S.createColumn(y,n);return y}const Xt="debugHeaders";function zx(n,l,a){var o;let d={id:(o=a.id)!=null?o:l.id,column:l,index:a.index,isPlaceholder:!!a.isPlaceholder,placeholderId:a.placeholderId,depth:a.depth,subHeaders:[],colSpan:0,rowSpan:0,headerGroup:null,getLeafHeaders:()=>{const h=[],m=g=>{g.subHeaders&&g.subHeaders.length&&g.subHeaders.map(m),h.push(g)};return m(d),h},getContext:()=>({table:n,header:d,column:l})};return n._features.forEach(h=>{h.createHeader==null||h.createHeader(d,n)}),d}const mE={createTable:n=>{n.getHeaderGroups=Me(()=>[n.getAllColumns(),n.getVisibleLeafColumns(),n.getState().columnPinning.left,n.getState().columnPinning.right],(l,a,o,c)=>{var d,h;const m=(d=o==null?void 0:o.map(y=>a.find(S=>S.id===y)).filter(Boolean))!=null?d:[],g=(h=c==null?void 0:c.map(y=>a.find(S=>S.id===y)).filter(Boolean))!=null?h:[],x=a.filter(y=>!(o!=null&&o.includes(y.id))&&!(c!=null&&c.includes(y.id)));return vu(l,[...m,...x,...g],n)},Ee(n.options,Xt)),n.getCenterHeaderGroups=Me(()=>[n.getAllColumns(),n.getVisibleLeafColumns(),n.getState().columnPinning.left,n.getState().columnPinning.right],(l,a,o,c)=>(a=a.filter(d=>!(o!=null&&o.includes(d.id))&&!(c!=null&&c.includes(d.id))),vu(l,a,n,"center")),Ee(n.options,Xt)),n.getLeftHeaderGroups=Me(()=>[n.getAllColumns(),n.getVisibleLeafColumns(),n.getState().columnPinning.left],(l,a,o)=>{var c;const d=(c=o==null?void 0:o.map(h=>a.find(m=>m.id===h)).filter(Boolean))!=null?c:[];return vu(l,d,n,"left")},Ee(n.options,Xt)),n.getRightHeaderGroups=Me(()=>[n.getAllColumns(),n.getVisibleLeafColumns(),n.getState().columnPinning.right],(l,a,o)=>{var c;const d=(c=o==null?void 0:o.map(h=>a.find(m=>m.id===h)).filter(Boolean))!=null?c:[];return vu(l,d,n,"right")},Ee(n.options,Xt)),n.getFooterGroups=Me(()=>[n.getHeaderGroups()],l=>[...l].reverse(),Ee(n.options,Xt)),n.getLeftFooterGroups=Me(()=>[n.getLeftHeaderGroups()],l=>[...l].reverse(),Ee(n.options,Xt)),n.getCenterFooterGroups=Me(()=>[n.getCenterHeaderGroups()],l=>[...l].reverse(),Ee(n.options,Xt)),n.getRightFooterGroups=Me(()=>[n.getRightHeaderGroups()],l=>[...l].reverse(),Ee(n.options,Xt)),n.getFlatHeaders=Me(()=>[n.getHeaderGroups()],l=>l.map(a=>a.headers).flat(),Ee(n.options,Xt)),n.getLeftFlatHeaders=Me(()=>[n.getLeftHeaderGroups()],l=>l.map(a=>a.headers).flat(),Ee(n.options,Xt)),n.getCenterFlatHeaders=Me(()=>[n.getCenterHeaderGroups()],l=>l.map(a=>a.headers).flat(),Ee(n.options,Xt)),n.getRightFlatHeaders=Me(()=>[n.getRightHeaderGroups()],l=>l.map(a=>a.headers).flat(),Ee(n.options,Xt)),n.getCenterLeafHeaders=Me(()=>[n.getCenterFlatHeaders()],l=>l.filter(a=>{var o;return!((o=a.subHeaders)!=null&&o.length)}),Ee(n.options,Xt)),n.getLeftLeafHeaders=Me(()=>[n.getLeftFlatHeaders()],l=>l.filter(a=>{var o;return!((o=a.subHeaders)!=null&&o.length)}),Ee(n.options,Xt)),n.getRightLeafHeaders=Me(()=>[n.getRightFlatHeaders()],l=>l.filter(a=>{var o;return!((o=a.subHeaders)!=null&&o.length)}),Ee(n.options,Xt)),n.getLeafHeaders=Me(()=>[n.getLeftHeaderGroups(),n.getCenterHeaderGroups(),n.getRightHeaderGroups()],(l,a,o)=>{var c,d,h,m,g,x;return[...(c=(d=l[0])==null?void 0:d.headers)!=null?c:[],...(h=(m=a[0])==null?void 0:m.headers)!=null?h:[],...(g=(x=o[0])==null?void 0:x.headers)!=null?g:[]].map(v=>v.getLeafHeaders()).flat()},Ee(n.options,Xt))}};function vu(n,l,a,o){var c,d;let h=0;const m=function(S,j){j===void 0&&(j=1),h=Math.max(h,j),S.filter(b=>b.getIsVisible()).forEach(b=>{var N;(N=b.columns)!=null&&N.length&&m(b.columns,j+1)},0)};m(n);let g=[];const x=(S,j)=>{const b={depth:j,id:[o,`${j}`].filter(Boolean).join("_"),headers:[]},N=[];S.forEach(T=>{const O=[...N].reverse()[0],_=T.column.depth===b.depth;let D,C=!1;if(_&&T.column.parent?D=T.column.parent:(D=T.column,C=!0),O&&(O==null?void 0:O.column)===D)O.subHeaders.push(T);else{const E=zx(a,D,{id:[o,j,D.id,T==null?void 0:T.id].filter(Boolean).join("_"),isPlaceholder:C,placeholderId:C?`${N.filter(R=>R.column===D).length}`:void 0,depth:j,index:N.length});E.subHeaders.push(T),N.push(E)}b.headers.push(T),T.headerGroup=b}),g.push(b),j>0&&x(N,j-1)},v=l.map((S,j)=>zx(a,S,{depth:h,index:j}));x(v,h-1),g.reverse();const y=S=>S.filter(b=>b.column.getIsVisible()).map(b=>{let N=0,T=0,O=[0];b.subHeaders&&b.subHeaders.length?(O=[],y(b.subHeaders).forEach(D=>{let{colSpan:C,rowSpan:E}=D;N+=C,O.push(E)})):N=1;const _=Math.min(...O);return T=T+_,b.colSpan=N,b.rowSpan=T,{colSpan:N,rowSpan:T}});return y((c=(d=g[0])==null?void 0:d.headers)!=null?c:[]),g}const gE=(n,l,a,o,c,d,h)=>{let m={id:l,index:o,original:a,depth:c,parentId:h,_valuesCache:{},_uniqueValuesCache:{},getValue:g=>{if(m._valuesCache.hasOwnProperty(g))return m._valuesCache[g];const x=n.getColumn(g);if(x!=null&&x.accessorFn)return m._valuesCache[g]=x.accessorFn(m.original,o),m._valuesCache[g]},getUniqueValues:g=>{if(m._uniqueValuesCache.hasOwnProperty(g))return m._uniqueValuesCache[g];const x=n.getColumn(g);if(x!=null&&x.accessorFn)return x.columnDef.getUniqueValues?(m._uniqueValuesCache[g]=x.columnDef.getUniqueValues(m.original,o),m._uniqueValuesCache[g]):(m._uniqueValuesCache[g]=[m.getValue(g)],m._uniqueValuesCache[g])},renderValue:g=>{var x;return(x=m.getValue(g))!=null?x:n.options.renderFallbackValue},subRows:[],getLeafRows:()=>fE(m.subRows,g=>g.subRows),getParentRow:()=>m.parentId?n.getRow(m.parentId,!0):void 0,getParentRows:()=>{let g=[],x=m;for(;;){const v=x.getParentRow();if(!v)break;g.push(v),x=v}return g.reverse()},getAllCells:Me(()=>[n.getAllLeafColumns()],g=>g.map(x=>dE(n,m,x,x.id)),Ee(n.options,"debugRows")),_getAllCellsByColumnId:Me(()=>[m.getAllCells()],g=>g.reduce((x,v)=>(x[v.column.id]=v,x),{}),Ee(n.options,"debugRows"))};for(let g=0;g<n._features.length;g++){const x=n._features[g];x==null||x.createRow==null||x.createRow(m,n)}return m},pE={createColumn:(n,l)=>{n._getFacetedRowModel=l.options.getFacetedRowModel&&l.options.getFacetedRowModel(l,n.id),n.getFacetedRowModel=()=>n._getFacetedRowModel?n._getFacetedRowModel():l.getPreFilteredRowModel(),n._getFacetedUniqueValues=l.options.getFacetedUniqueValues&&l.options.getFacetedUniqueValues(l,n.id),n.getFacetedUniqueValues=()=>n._getFacetedUniqueValues?n._getFacetedUniqueValues():new Map,n._getFacetedMinMaxValues=l.options.getFacetedMinMaxValues&&l.options.getFacetedMinMaxValues(l,n.id),n.getFacetedMinMaxValues=()=>{if(n._getFacetedMinMaxValues)return n._getFacetedMinMaxValues()}}},xS=(n,l,a)=>{var o,c;const d=a==null||(o=a.toString())==null?void 0:o.toLowerCase();return!!(!((c=n.getValue(l))==null||(c=c.toString())==null||(c=c.toLowerCase())==null)&&c.includes(d))};xS.autoRemove=n=>as(n);const SS=(n,l,a)=>{var o;return!!(!((o=n.getValue(l))==null||(o=o.toString())==null)&&o.includes(a))};SS.autoRemove=n=>as(n);const bS=(n,l,a)=>{var o;return((o=n.getValue(l))==null||(o=o.toString())==null?void 0:o.toLowerCase())===(a==null?void 0:a.toLowerCase())};bS.autoRemove=n=>as(n);const jS=(n,l,a)=>{var o;return(o=n.getValue(l))==null?void 0:o.includes(a)};jS.autoRemove=n=>as(n);const wS=(n,l,a)=>!a.some(o=>{var c;return!((c=n.getValue(l))!=null&&c.includes(o))});wS.autoRemove=n=>as(n)||!(n!=null&&n.length);const NS=(n,l,a)=>a.some(o=>{var c;return(c=n.getValue(l))==null?void 0:c.includes(o)});NS.autoRemove=n=>as(n)||!(n!=null&&n.length);const CS=(n,l,a)=>n.getValue(l)===a;CS.autoRemove=n=>as(n);const MS=(n,l,a)=>n.getValue(l)==a;MS.autoRemove=n=>as(n);const yg=(n,l,a)=>{let[o,c]=a;const d=n.getValue(l);return d>=o&&d<=c};yg.resolveFilterValue=n=>{let[l,a]=n,o=typeof l!="number"?parseFloat(l):l,c=typeof a!="number"?parseFloat(a):a,d=l===null||Number.isNaN(o)?-1/0:o,h=a===null||Number.isNaN(c)?1/0:c;if(d>h){const m=d;d=h,h=m}return[d,h]};yg.autoRemove=n=>as(n)||as(n[0])&&as(n[1]);const Ps={includesString:xS,includesStringSensitive:SS,equalsString:bS,arrIncludes:jS,arrIncludesAll:wS,arrIncludesSome:NS,equals:CS,weakEquals:MS,inNumberRange:yg};function as(n){return n==null||n===""}const yE={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:n=>({columnFilters:[],...n}),getDefaultOptions:n=>({onColumnFiltersChange:Dn("columnFilters",n),filterFromLeafRows:!1,maxLeafRowFilterDepth:100}),createColumn:(n,l)=>{n.getAutoFilterFn=()=>{const a=l.getCoreRowModel().flatRows[0],o=a==null?void 0:a.getValue(n.id);return typeof o=="string"?Ps.includesString:typeof o=="number"?Ps.inNumberRange:typeof o=="boolean"||o!==null&&typeof o=="object"?Ps.equals:Array.isArray(o)?Ps.arrIncludes:Ps.weakEquals},n.getFilterFn=()=>{var a,o;return Xu(n.columnDef.filterFn)?n.columnDef.filterFn:n.columnDef.filterFn==="auto"?n.getAutoFilterFn():(a=(o=l.options.filterFns)==null?void 0:o[n.columnDef.filterFn])!=null?a:Ps[n.columnDef.filterFn]},n.getCanFilter=()=>{var a,o,c;return((a=n.columnDef.enableColumnFilter)!=null?a:!0)&&((o=l.options.enableColumnFilters)!=null?o:!0)&&((c=l.options.enableFilters)!=null?c:!0)&&!!n.accessorFn},n.getIsFiltered=()=>n.getFilterIndex()>-1,n.getFilterValue=()=>{var a;return(a=l.getState().columnFilters)==null||(a=a.find(o=>o.id===n.id))==null?void 0:a.value},n.getFilterIndex=()=>{var a,o;return(a=(o=l.getState().columnFilters)==null?void 0:o.findIndex(c=>c.id===n.id))!=null?a:-1},n.setFilterValue=a=>{l.setColumnFilters(o=>{const c=n.getFilterFn(),d=o==null?void 0:o.find(v=>v.id===n.id),h=Fl(a,d?d.value:void 0);if(Dx(c,h,n)){var m;return(m=o==null?void 0:o.filter(v=>v.id!==n.id))!=null?m:[]}const g={id:n.id,value:h};if(d){var x;return(x=o==null?void 0:o.map(v=>v.id===n.id?g:v))!=null?x:[]}return o!=null&&o.length?[...o,g]:[g]})}},createRow:(n,l)=>{n.columnFilters={},n.columnFiltersMeta={}},createTable:n=>{n.setColumnFilters=l=>{const a=n.getAllLeafColumns(),o=c=>{var d;return(d=Fl(l,c))==null?void 0:d.filter(h=>{const m=a.find(g=>g.id===h.id);if(m){const g=m.getFilterFn();if(Dx(g,h.value,m))return!1}return!0})};n.options.onColumnFiltersChange==null||n.options.onColumnFiltersChange(o)},n.resetColumnFilters=l=>{var a,o;n.setColumnFilters(l?[]:(a=(o=n.initialState)==null?void 0:o.columnFilters)!=null?a:[])},n.getPreFilteredRowModel=()=>n.getCoreRowModel(),n.getFilteredRowModel=()=>(!n._getFilteredRowModel&&n.options.getFilteredRowModel&&(n._getFilteredRowModel=n.options.getFilteredRowModel(n)),n.options.manualFiltering||!n._getFilteredRowModel?n.getPreFilteredRowModel():n._getFilteredRowModel())}};function Dx(n,l,a){return(n&&n.autoRemove?n.autoRemove(l,a):!1)||typeof l>"u"||typeof l=="string"&&!l}const vE=(n,l,a)=>a.reduce((o,c)=>{const d=c.getValue(n);return o+(typeof d=="number"?d:0)},0),xE=(n,l,a)=>{let o;return a.forEach(c=>{const d=c.getValue(n);d!=null&&(o>d||o===void 0&&d>=d)&&(o=d)}),o},SE=(n,l,a)=>{let o;return a.forEach(c=>{const d=c.getValue(n);d!=null&&(o<d||o===void 0&&d>=d)&&(o=d)}),o},bE=(n,l,a)=>{let o,c;return a.forEach(d=>{const h=d.getValue(n);h!=null&&(o===void 0?h>=h&&(o=c=h):(o>h&&(o=h),c<h&&(c=h)))}),[o,c]},jE=(n,l)=>{let a=0,o=0;if(l.forEach(c=>{let d=c.getValue(n);d!=null&&(d=+d)>=d&&(++a,o+=d)}),a)return o/a},wE=(n,l)=>{if(!l.length)return;const a=l.map(d=>d.getValue(n));if(!uE(a))return;if(a.length===1)return a[0];const o=Math.floor(a.length/2),c=a.sort((d,h)=>d-h);return a.length%2!==0?c[o]:(c[o-1]+c[o])/2},NE=(n,l)=>Array.from(new Set(l.map(a=>a.getValue(n))).values()),CE=(n,l)=>new Set(l.map(a=>a.getValue(n))).size,ME=(n,l)=>l.length,Qh={sum:vE,min:xE,max:SE,extent:bE,mean:jE,median:wE,unique:NE,uniqueCount:CE,count:ME},EE={getDefaultColumnDef:()=>({aggregatedCell:n=>{var l,a;return(l=(a=n.getValue())==null||a.toString==null?void 0:a.toString())!=null?l:null},aggregationFn:"auto"}),getInitialState:n=>({grouping:[],...n}),getDefaultOptions:n=>({onGroupingChange:Dn("grouping",n),groupedColumnMode:"reorder"}),createColumn:(n,l)=>{n.toggleGrouping=()=>{l.setGrouping(a=>a!=null&&a.includes(n.id)?a.filter(o=>o!==n.id):[...a??[],n.id])},n.getCanGroup=()=>{var a,o;return((a=n.columnDef.enableGrouping)!=null?a:!0)&&((o=l.options.enableGrouping)!=null?o:!0)&&(!!n.accessorFn||!!n.columnDef.getGroupingValue)},n.getIsGrouped=()=>{var a;return(a=l.getState().grouping)==null?void 0:a.includes(n.id)},n.getGroupedIndex=()=>{var a;return(a=l.getState().grouping)==null?void 0:a.indexOf(n.id)},n.getToggleGroupingHandler=()=>{const a=n.getCanGroup();return()=>{a&&n.toggleGrouping()}},n.getAutoAggregationFn=()=>{const a=l.getCoreRowModel().flatRows[0],o=a==null?void 0:a.getValue(n.id);if(typeof o=="number")return Qh.sum;if(Object.prototype.toString.call(o)==="[object Date]")return Qh.extent},n.getAggregationFn=()=>{var a,o;if(!n)throw new Error;return Xu(n.columnDef.aggregationFn)?n.columnDef.aggregationFn:n.columnDef.aggregationFn==="auto"?n.getAutoAggregationFn():(a=(o=l.options.aggregationFns)==null?void 0:o[n.columnDef.aggregationFn])!=null?a:Qh[n.columnDef.aggregationFn]}},createTable:n=>{n.setGrouping=l=>n.options.onGroupingChange==null?void 0:n.options.onGroupingChange(l),n.resetGrouping=l=>{var a,o;n.setGrouping(l?[]:(a=(o=n.initialState)==null?void 0:o.grouping)!=null?a:[])},n.getPreGroupedRowModel=()=>n.getFilteredRowModel(),n.getGroupedRowModel=()=>(!n._getGroupedRowModel&&n.options.getGroupedRowModel&&(n._getGroupedRowModel=n.options.getGroupedRowModel(n)),n.options.manualGrouping||!n._getGroupedRowModel?n.getPreGroupedRowModel():n._getGroupedRowModel())},createRow:(n,l)=>{n.getIsGrouped=()=>!!n.groupingColumnId,n.getGroupingValue=a=>{if(n._groupingValuesCache.hasOwnProperty(a))return n._groupingValuesCache[a];const o=l.getColumn(a);return o!=null&&o.columnDef.getGroupingValue?(n._groupingValuesCache[a]=o.columnDef.getGroupingValue(n.original),n._groupingValuesCache[a]):n.getValue(a)},n._groupingValuesCache={}},createCell:(n,l,a,o)=>{n.getIsGrouped=()=>l.getIsGrouped()&&l.id===a.groupingColumnId,n.getIsPlaceholder=()=>!n.getIsGrouped()&&l.getIsGrouped(),n.getIsAggregated=()=>{var c;return!n.getIsGrouped()&&!n.getIsPlaceholder()&&!!((c=a.subRows)!=null&&c.length)}}};function TE(n,l,a){if(!(l!=null&&l.length)||!a)return n;const o=n.filter(d=>!l.includes(d.id));return a==="remove"?o:[...l.map(d=>n.find(h=>h.id===d)).filter(Boolean),...o]}const _E={getInitialState:n=>({columnOrder:[],...n}),getDefaultOptions:n=>({onColumnOrderChange:Dn("columnOrder",n)}),createColumn:(n,l)=>{n.getIndex=Me(a=>[Mr(l,a)],a=>a.findIndex(o=>o.id===n.id),Ee(l.options,"debugColumns")),n.getIsFirstColumn=a=>{var o;return((o=Mr(l,a)[0])==null?void 0:o.id)===n.id},n.getIsLastColumn=a=>{var o;const c=Mr(l,a);return((o=c[c.length-1])==null?void 0:o.id)===n.id}},createTable:n=>{n.setColumnOrder=l=>n.options.onColumnOrderChange==null?void 0:n.options.onColumnOrderChange(l),n.resetColumnOrder=l=>{var a;n.setColumnOrder(l?[]:(a=n.initialState.columnOrder)!=null?a:[])},n._getOrderColumnsFn=Me(()=>[n.getState().columnOrder,n.getState().grouping,n.options.groupedColumnMode],(l,a,o)=>c=>{let d=[];if(!(l!=null&&l.length))d=c;else{const h=[...l],m=[...c];for(;m.length&&h.length;){const g=h.shift(),x=m.findIndex(v=>v.id===g);x>-1&&d.push(m.splice(x,1)[0])}d=[...d,...m]}return TE(d,a,o)},Ee(n.options,"debugTable"))}},Yh=()=>({left:[],right:[]}),RE={getInitialState:n=>({columnPinning:Yh(),...n}),getDefaultOptions:n=>({onColumnPinningChange:Dn("columnPinning",n)}),createColumn:(n,l)=>{n.pin=a=>{const o=n.getLeafColumns().map(c=>c.id).filter(Boolean);l.setColumnPinning(c=>{var d,h;if(a==="right"){var m,g;return{left:((m=c==null?void 0:c.left)!=null?m:[]).filter(y=>!(o!=null&&o.includes(y))),right:[...((g=c==null?void 0:c.right)!=null?g:[]).filter(y=>!(o!=null&&o.includes(y))),...o]}}if(a==="left"){var x,v;return{left:[...((x=c==null?void 0:c.left)!=null?x:[]).filter(y=>!(o!=null&&o.includes(y))),...o],right:((v=c==null?void 0:c.right)!=null?v:[]).filter(y=>!(o!=null&&o.includes(y)))}}return{left:((d=c==null?void 0:c.left)!=null?d:[]).filter(y=>!(o!=null&&o.includes(y))),right:((h=c==null?void 0:c.right)!=null?h:[]).filter(y=>!(o!=null&&o.includes(y)))}})},n.getCanPin=()=>n.getLeafColumns().some(o=>{var c,d,h;return((c=o.columnDef.enablePinning)!=null?c:!0)&&((d=(h=l.options.enableColumnPinning)!=null?h:l.options.enablePinning)!=null?d:!0)}),n.getIsPinned=()=>{const a=n.getLeafColumns().map(m=>m.id),{left:o,right:c}=l.getState().columnPinning,d=a.some(m=>o==null?void 0:o.includes(m)),h=a.some(m=>c==null?void 0:c.includes(m));return d?"left":h?"right":!1},n.getPinnedIndex=()=>{var a,o;const c=n.getIsPinned();return c?(a=(o=l.getState().columnPinning)==null||(o=o[c])==null?void 0:o.indexOf(n.id))!=null?a:-1:0}},createRow:(n,l)=>{n.getCenterVisibleCells=Me(()=>[n._getAllVisibleCells(),l.getState().columnPinning.left,l.getState().columnPinning.right],(a,o,c)=>{const d=[...o??[],...c??[]];return a.filter(h=>!d.includes(h.column.id))},Ee(l.options,"debugRows")),n.getLeftVisibleCells=Me(()=>[n._getAllVisibleCells(),l.getState().columnPinning.left],(a,o)=>(o??[]).map(d=>a.find(h=>h.column.id===d)).filter(Boolean).map(d=>({...d,position:"left"})),Ee(l.options,"debugRows")),n.getRightVisibleCells=Me(()=>[n._getAllVisibleCells(),l.getState().columnPinning.right],(a,o)=>(o??[]).map(d=>a.find(h=>h.column.id===d)).filter(Boolean).map(d=>({...d,position:"right"})),Ee(l.options,"debugRows"))},createTable:n=>{n.setColumnPinning=l=>n.options.onColumnPinningChange==null?void 0:n.options.onColumnPinningChange(l),n.resetColumnPinning=l=>{var a,o;return n.setColumnPinning(l?Yh():(a=(o=n.initialState)==null?void 0:o.columnPinning)!=null?a:Yh())},n.getIsSomeColumnsPinned=l=>{var a;const o=n.getState().columnPinning;if(!l){var c,d;return!!((c=o.left)!=null&&c.length||(d=o.right)!=null&&d.length)}return!!((a=o[l])!=null&&a.length)},n.getLeftLeafColumns=Me(()=>[n.getAllLeafColumns(),n.getState().columnPinning.left],(l,a)=>(a??[]).map(o=>l.find(c=>c.id===o)).filter(Boolean),Ee(n.options,"debugColumns")),n.getRightLeafColumns=Me(()=>[n.getAllLeafColumns(),n.getState().columnPinning.right],(l,a)=>(a??[]).map(o=>l.find(c=>c.id===o)).filter(Boolean),Ee(n.options,"debugColumns")),n.getCenterLeafColumns=Me(()=>[n.getAllLeafColumns(),n.getState().columnPinning.left,n.getState().columnPinning.right],(l,a,o)=>{const c=[...a??[],...o??[]];return l.filter(d=>!c.includes(d.id))},Ee(n.options,"debugColumns"))}};function AE(n){return n||(typeof document<"u"?document:null)}const xu={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},Ph=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),OE={getDefaultColumnDef:()=>xu,getInitialState:n=>({columnSizing:{},columnSizingInfo:Ph(),...n}),getDefaultOptions:n=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:Dn("columnSizing",n),onColumnSizingInfoChange:Dn("columnSizingInfo",n)}),createColumn:(n,l)=>{n.getSize=()=>{var a,o,c;const d=l.getState().columnSizing[n.id];return Math.min(Math.max((a=n.columnDef.minSize)!=null?a:xu.minSize,(o=d??n.columnDef.size)!=null?o:xu.size),(c=n.columnDef.maxSize)!=null?c:xu.maxSize)},n.getStart=Me(a=>[a,Mr(l,a),l.getState().columnSizing],(a,o)=>o.slice(0,n.getIndex(a)).reduce((c,d)=>c+d.getSize(),0),Ee(l.options,"debugColumns")),n.getAfter=Me(a=>[a,Mr(l,a),l.getState().columnSizing],(a,o)=>o.slice(n.getIndex(a)+1).reduce((c,d)=>c+d.getSize(),0),Ee(l.options,"debugColumns")),n.resetSize=()=>{l.setColumnSizing(a=>{let{[n.id]:o,...c}=a;return c})},n.getCanResize=()=>{var a,o;return((a=n.columnDef.enableResizing)!=null?a:!0)&&((o=l.options.enableColumnResizing)!=null?o:!0)},n.getIsResizing=()=>l.getState().columnSizingInfo.isResizingColumn===n.id},createHeader:(n,l)=>{n.getSize=()=>{let a=0;const o=c=>{if(c.subHeaders.length)c.subHeaders.forEach(o);else{var d;a+=(d=c.column.getSize())!=null?d:0}};return o(n),a},n.getStart=()=>{if(n.index>0){const a=n.headerGroup.headers[n.index-1];return a.getStart()+a.getSize()}return 0},n.getResizeHandler=a=>{const o=l.getColumn(n.column.id),c=o==null?void 0:o.getCanResize();return d=>{if(!o||!c||(d.persist==null||d.persist(),Xh(d)&&d.touches&&d.touches.length>1))return;const h=n.getSize(),m=n?n.getLeafHeaders().map(O=>[O.column.id,O.column.getSize()]):[[o.id,o.getSize()]],g=Xh(d)?Math.round(d.touches[0].clientX):d.clientX,x={},v=(O,_)=>{typeof _=="number"&&(l.setColumnSizingInfo(D=>{var C,E;const R=l.options.columnResizeDirection==="rtl"?-1:1,A=(_-((C=D==null?void 0:D.startOffset)!=null?C:0))*R,B=Math.max(A/((E=D==null?void 0:D.startSize)!=null?E:0),-.999999);return D.columnSizingStart.forEach(K=>{let[k,ie]=K;x[k]=Math.round(Math.max(ie+ie*B,0)*100)/100}),{...D,deltaOffset:A,deltaPercentage:B}}),(l.options.columnResizeMode==="onChange"||O==="end")&&l.setColumnSizing(D=>({...D,...x})))},y=O=>v("move",O),S=O=>{v("end",O),l.setColumnSizingInfo(_=>({..._,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},j=AE(a),b={moveHandler:O=>y(O.clientX),upHandler:O=>{j==null||j.removeEventListener("mousemove",b.moveHandler),j==null||j.removeEventListener("mouseup",b.upHandler),S(O.clientX)}},N={moveHandler:O=>(O.cancelable&&(O.preventDefault(),O.stopPropagation()),y(O.touches[0].clientX),!1),upHandler:O=>{var _;j==null||j.removeEventListener("touchmove",N.moveHandler),j==null||j.removeEventListener("touchend",N.upHandler),O.cancelable&&(O.preventDefault(),O.stopPropagation()),S((_=O.touches[0])==null?void 0:_.clientX)}},T=zE()?{passive:!1}:!1;Xh(d)?(j==null||j.addEventListener("touchmove",N.moveHandler,T),j==null||j.addEventListener("touchend",N.upHandler,T)):(j==null||j.addEventListener("mousemove",b.moveHandler,T),j==null||j.addEventListener("mouseup",b.upHandler,T)),l.setColumnSizingInfo(O=>({...O,startOffset:g,startSize:h,deltaOffset:0,deltaPercentage:0,columnSizingStart:m,isResizingColumn:o.id}))}}},createTable:n=>{n.setColumnSizing=l=>n.options.onColumnSizingChange==null?void 0:n.options.onColumnSizingChange(l),n.setColumnSizingInfo=l=>n.options.onColumnSizingInfoChange==null?void 0:n.options.onColumnSizingInfoChange(l),n.resetColumnSizing=l=>{var a;n.setColumnSizing(l?{}:(a=n.initialState.columnSizing)!=null?a:{})},n.resetHeaderSizeInfo=l=>{var a;n.setColumnSizingInfo(l?Ph():(a=n.initialState.columnSizingInfo)!=null?a:Ph())},n.getTotalSize=()=>{var l,a;return(l=(a=n.getHeaderGroups()[0])==null?void 0:a.headers.reduce((o,c)=>o+c.getSize(),0))!=null?l:0},n.getLeftTotalSize=()=>{var l,a;return(l=(a=n.getLeftHeaderGroups()[0])==null?void 0:a.headers.reduce((o,c)=>o+c.getSize(),0))!=null?l:0},n.getCenterTotalSize=()=>{var l,a;return(l=(a=n.getCenterHeaderGroups()[0])==null?void 0:a.headers.reduce((o,c)=>o+c.getSize(),0))!=null?l:0},n.getRightTotalSize=()=>{var l,a;return(l=(a=n.getRightHeaderGroups()[0])==null?void 0:a.headers.reduce((o,c)=>o+c.getSize(),0))!=null?l:0}}};let Su=null;function zE(){if(typeof Su=="boolean")return Su;let n=!1;try{const l={get passive(){return n=!0,!1}},a=()=>{};window.addEventListener("test",a,l),window.removeEventListener("test",a)}catch{n=!1}return Su=n,Su}function Xh(n){return n.type==="touchstart"}const DE={getInitialState:n=>({columnVisibility:{},...n}),getDefaultOptions:n=>({onColumnVisibilityChange:Dn("columnVisibility",n)}),createColumn:(n,l)=>{n.toggleVisibility=a=>{n.getCanHide()&&l.setColumnVisibility(o=>({...o,[n.id]:a??!n.getIsVisible()}))},n.getIsVisible=()=>{var a,o;const c=n.columns;return(a=c.length?c.some(d=>d.getIsVisible()):(o=l.getState().columnVisibility)==null?void 0:o[n.id])!=null?a:!0},n.getCanHide=()=>{var a,o;return((a=n.columnDef.enableHiding)!=null?a:!0)&&((o=l.options.enableHiding)!=null?o:!0)},n.getToggleVisibilityHandler=()=>a=>{n.toggleVisibility==null||n.toggleVisibility(a.target.checked)}},createRow:(n,l)=>{n._getAllVisibleCells=Me(()=>[n.getAllCells(),l.getState().columnVisibility],a=>a.filter(o=>o.column.getIsVisible()),Ee(l.options,"debugRows")),n.getVisibleCells=Me(()=>[n.getLeftVisibleCells(),n.getCenterVisibleCells(),n.getRightVisibleCells()],(a,o,c)=>[...a,...o,...c],Ee(l.options,"debugRows"))},createTable:n=>{const l=(a,o)=>Me(()=>[o(),o().filter(c=>c.getIsVisible()).map(c=>c.id).join("_")],c=>c.filter(d=>d.getIsVisible==null?void 0:d.getIsVisible()),Ee(n.options,"debugColumns"));n.getVisibleFlatColumns=l("getVisibleFlatColumns",()=>n.getAllFlatColumns()),n.getVisibleLeafColumns=l("getVisibleLeafColumns",()=>n.getAllLeafColumns()),n.getLeftVisibleLeafColumns=l("getLeftVisibleLeafColumns",()=>n.getLeftLeafColumns()),n.getRightVisibleLeafColumns=l("getRightVisibleLeafColumns",()=>n.getRightLeafColumns()),n.getCenterVisibleLeafColumns=l("getCenterVisibleLeafColumns",()=>n.getCenterLeafColumns()),n.setColumnVisibility=a=>n.options.onColumnVisibilityChange==null?void 0:n.options.onColumnVisibilityChange(a),n.resetColumnVisibility=a=>{var o;n.setColumnVisibility(a?{}:(o=n.initialState.columnVisibility)!=null?o:{})},n.toggleAllColumnsVisible=a=>{var o;a=(o=a)!=null?o:!n.getIsAllColumnsVisible(),n.setColumnVisibility(n.getAllLeafColumns().reduce((c,d)=>({...c,[d.id]:a||!(d.getCanHide!=null&&d.getCanHide())}),{}))},n.getIsAllColumnsVisible=()=>!n.getAllLeafColumns().some(a=>!(a.getIsVisible!=null&&a.getIsVisible())),n.getIsSomeColumnsVisible=()=>n.getAllLeafColumns().some(a=>a.getIsVisible==null?void 0:a.getIsVisible()),n.getToggleAllColumnsVisibilityHandler=()=>a=>{var o;n.toggleAllColumnsVisible((o=a.target)==null?void 0:o.checked)}}};function Mr(n,l){return l?l==="center"?n.getCenterVisibleLeafColumns():l==="left"?n.getLeftVisibleLeafColumns():n.getRightVisibleLeafColumns():n.getVisibleLeafColumns()}const LE={createTable:n=>{n._getGlobalFacetedRowModel=n.options.getFacetedRowModel&&n.options.getFacetedRowModel(n,"__global__"),n.getGlobalFacetedRowModel=()=>n.options.manualFiltering||!n._getGlobalFacetedRowModel?n.getPreFilteredRowModel():n._getGlobalFacetedRowModel(),n._getGlobalFacetedUniqueValues=n.options.getFacetedUniqueValues&&n.options.getFacetedUniqueValues(n,"__global__"),n.getGlobalFacetedUniqueValues=()=>n._getGlobalFacetedUniqueValues?n._getGlobalFacetedUniqueValues():new Map,n._getGlobalFacetedMinMaxValues=n.options.getFacetedMinMaxValues&&n.options.getFacetedMinMaxValues(n,"__global__"),n.getGlobalFacetedMinMaxValues=()=>{if(n._getGlobalFacetedMinMaxValues)return n._getGlobalFacetedMinMaxValues()}}},$E={getInitialState:n=>({globalFilter:void 0,...n}),getDefaultOptions:n=>({onGlobalFilterChange:Dn("globalFilter",n),globalFilterFn:"auto",getColumnCanGlobalFilter:l=>{var a;const o=(a=n.getCoreRowModel().flatRows[0])==null||(a=a._getAllCellsByColumnId()[l.id])==null?void 0:a.getValue();return typeof o=="string"||typeof o=="number"}}),createColumn:(n,l)=>{n.getCanGlobalFilter=()=>{var a,o,c,d;return((a=n.columnDef.enableGlobalFilter)!=null?a:!0)&&((o=l.options.enableGlobalFilter)!=null?o:!0)&&((c=l.options.enableFilters)!=null?c:!0)&&((d=l.options.getColumnCanGlobalFilter==null?void 0:l.options.getColumnCanGlobalFilter(n))!=null?d:!0)&&!!n.accessorFn}},createTable:n=>{n.getGlobalAutoFilterFn=()=>Ps.includesString,n.getGlobalFilterFn=()=>{var l,a;const{globalFilterFn:o}=n.options;return Xu(o)?o:o==="auto"?n.getGlobalAutoFilterFn():(l=(a=n.options.filterFns)==null?void 0:a[o])!=null?l:Ps[o]},n.setGlobalFilter=l=>{n.options.onGlobalFilterChange==null||n.options.onGlobalFilterChange(l)},n.resetGlobalFilter=l=>{n.setGlobalFilter(l?void 0:n.initialState.globalFilter)}}},kE={getInitialState:n=>({expanded:{},...n}),getDefaultOptions:n=>({onExpandedChange:Dn("expanded",n),paginateExpandedRows:!0}),createTable:n=>{let l=!1,a=!1;n._autoResetExpanded=()=>{var o,c;if(!l){n._queue(()=>{l=!0});return}if((o=(c=n.options.autoResetAll)!=null?c:n.options.autoResetExpanded)!=null?o:!n.options.manualExpanding){if(a)return;a=!0,n._queue(()=>{n.resetExpanded(),a=!1})}},n.setExpanded=o=>n.options.onExpandedChange==null?void 0:n.options.onExpandedChange(o),n.toggleAllRowsExpanded=o=>{o??!n.getIsAllRowsExpanded()?n.setExpanded(!0):n.setExpanded({})},n.resetExpanded=o=>{var c,d;n.setExpanded(o?{}:(c=(d=n.initialState)==null?void 0:d.expanded)!=null?c:{})},n.getCanSomeRowsExpand=()=>n.getPrePaginationRowModel().flatRows.some(o=>o.getCanExpand()),n.getToggleAllRowsExpandedHandler=()=>o=>{o.persist==null||o.persist(),n.toggleAllRowsExpanded()},n.getIsSomeRowsExpanded=()=>{const o=n.getState().expanded;return o===!0||Object.values(o).some(Boolean)},n.getIsAllRowsExpanded=()=>{const o=n.getState().expanded;return typeof o=="boolean"?o===!0:!(!Object.keys(o).length||n.getRowModel().flatRows.some(c=>!c.getIsExpanded()))},n.getExpandedDepth=()=>{let o=0;return(n.getState().expanded===!0?Object.keys(n.getRowModel().rowsById):Object.keys(n.getState().expanded)).forEach(d=>{const h=d.split(".");o=Math.max(o,h.length)}),o},n.getPreExpandedRowModel=()=>n.getSortedRowModel(),n.getExpandedRowModel=()=>(!n._getExpandedRowModel&&n.options.getExpandedRowModel&&(n._getExpandedRowModel=n.options.getExpandedRowModel(n)),n.options.manualExpanding||!n._getExpandedRowModel?n.getPreExpandedRowModel():n._getExpandedRowModel())},createRow:(n,l)=>{n.toggleExpanded=a=>{l.setExpanded(o=>{var c;const d=o===!0?!0:!!(o!=null&&o[n.id]);let h={};if(o===!0?Object.keys(l.getRowModel().rowsById).forEach(m=>{h[m]=!0}):h=o,a=(c=a)!=null?c:!d,!d&&a)return{...h,[n.id]:!0};if(d&&!a){const{[n.id]:m,...g}=h;return g}return o})},n.getIsExpanded=()=>{var a;const o=l.getState().expanded;return!!((a=l.options.getIsRowExpanded==null?void 0:l.options.getIsRowExpanded(n))!=null?a:o===!0||o!=null&&o[n.id])},n.getCanExpand=()=>{var a,o,c;return(a=l.options.getRowCanExpand==null?void 0:l.options.getRowCanExpand(n))!=null?a:((o=l.options.enableExpanding)!=null?o:!0)&&!!((c=n.subRows)!=null&&c.length)},n.getIsAllParentsExpanded=()=>{let a=!0,o=n;for(;a&&o.parentId;)o=l.getRow(o.parentId,!0),a=o.getIsExpanded();return a},n.getToggleExpandedHandler=()=>{const a=n.getCanExpand();return()=>{a&&n.toggleExpanded()}}}},Qm=0,Ym=10,Kh=()=>({pageIndex:Qm,pageSize:Ym}),HE={getInitialState:n=>({...n,pagination:{...Kh(),...n==null?void 0:n.pagination}}),getDefaultOptions:n=>({onPaginationChange:Dn("pagination",n)}),createTable:n=>{let l=!1,a=!1;n._autoResetPageIndex=()=>{var o,c;if(!l){n._queue(()=>{l=!0});return}if((o=(c=n.options.autoResetAll)!=null?c:n.options.autoResetPageIndex)!=null?o:!n.options.manualPagination){if(a)return;a=!0,n._queue(()=>{n.resetPageIndex(),a=!1})}},n.setPagination=o=>{const c=d=>Fl(o,d);return n.options.onPaginationChange==null?void 0:n.options.onPaginationChange(c)},n.resetPagination=o=>{var c;n.setPagination(o?Kh():(c=n.initialState.pagination)!=null?c:Kh())},n.setPageIndex=o=>{n.setPagination(c=>{let d=Fl(o,c.pageIndex);const h=typeof n.options.pageCount>"u"||n.options.pageCount===-1?Number.MAX_SAFE_INTEGER:n.options.pageCount-1;return d=Math.max(0,Math.min(d,h)),{...c,pageIndex:d}})},n.resetPageIndex=o=>{var c,d;n.setPageIndex(o?Qm:(c=(d=n.initialState)==null||(d=d.pagination)==null?void 0:d.pageIndex)!=null?c:Qm)},n.resetPageSize=o=>{var c,d;n.setPageSize(o?Ym:(c=(d=n.initialState)==null||(d=d.pagination)==null?void 0:d.pageSize)!=null?c:Ym)},n.setPageSize=o=>{n.setPagination(c=>{const d=Math.max(1,Fl(o,c.pageSize)),h=c.pageSize*c.pageIndex,m=Math.floor(h/d);return{...c,pageIndex:m,pageSize:d}})},n.setPageCount=o=>n.setPagination(c=>{var d;let h=Fl(o,(d=n.options.pageCount)!=null?d:-1);return typeof h=="number"&&(h=Math.max(-1,h)),{...c,pageCount:h}}),n.getPageOptions=Me(()=>[n.getPageCount()],o=>{let c=[];return o&&o>0&&(c=[...new Array(o)].fill(null).map((d,h)=>h)),c},Ee(n.options,"debugTable")),n.getCanPreviousPage=()=>n.getState().pagination.pageIndex>0,n.getCanNextPage=()=>{const{pageIndex:o}=n.getState().pagination,c=n.getPageCount();return c===-1?!0:c===0?!1:o<c-1},n.previousPage=()=>n.setPageIndex(o=>o-1),n.nextPage=()=>n.setPageIndex(o=>o+1),n.firstPage=()=>n.setPageIndex(0),n.lastPage=()=>n.setPageIndex(n.getPageCount()-1),n.getPrePaginationRowModel=()=>n.getExpandedRowModel(),n.getPaginationRowModel=()=>(!n._getPaginationRowModel&&n.options.getPaginationRowModel&&(n._getPaginationRowModel=n.options.getPaginationRowModel(n)),n.options.manualPagination||!n._getPaginationRowModel?n.getPrePaginationRowModel():n._getPaginationRowModel()),n.getPageCount=()=>{var o;return(o=n.options.pageCount)!=null?o:Math.ceil(n.getRowCount()/n.getState().pagination.pageSize)},n.getRowCount=()=>{var o;return(o=n.options.rowCount)!=null?o:n.getPrePaginationRowModel().rows.length}}},Zh=()=>({top:[],bottom:[]}),UE={getInitialState:n=>({rowPinning:Zh(),...n}),getDefaultOptions:n=>({onRowPinningChange:Dn("rowPinning",n)}),createRow:(n,l)=>{n.pin=(a,o,c)=>{const d=o?n.getLeafRows().map(g=>{let{id:x}=g;return x}):[],h=c?n.getParentRows().map(g=>{let{id:x}=g;return x}):[],m=new Set([...h,n.id,...d]);l.setRowPinning(g=>{var x,v;if(a==="bottom"){var y,S;return{top:((y=g==null?void 0:g.top)!=null?y:[]).filter(N=>!(m!=null&&m.has(N))),bottom:[...((S=g==null?void 0:g.bottom)!=null?S:[]).filter(N=>!(m!=null&&m.has(N))),...Array.from(m)]}}if(a==="top"){var j,b;return{top:[...((j=g==null?void 0:g.top)!=null?j:[]).filter(N=>!(m!=null&&m.has(N))),...Array.from(m)],bottom:((b=g==null?void 0:g.bottom)!=null?b:[]).filter(N=>!(m!=null&&m.has(N)))}}return{top:((x=g==null?void 0:g.top)!=null?x:[]).filter(N=>!(m!=null&&m.has(N))),bottom:((v=g==null?void 0:g.bottom)!=null?v:[]).filter(N=>!(m!=null&&m.has(N)))}})},n.getCanPin=()=>{var a;const{enableRowPinning:o,enablePinning:c}=l.options;return typeof o=="function"?o(n):(a=o??c)!=null?a:!0},n.getIsPinned=()=>{const a=[n.id],{top:o,bottom:c}=l.getState().rowPinning,d=a.some(m=>o==null?void 0:o.includes(m)),h=a.some(m=>c==null?void 0:c.includes(m));return d?"top":h?"bottom":!1},n.getPinnedIndex=()=>{var a,o;const c=n.getIsPinned();if(!c)return-1;const d=(a=c==="top"?l.getTopRows():l.getBottomRows())==null?void 0:a.map(h=>{let{id:m}=h;return m});return(o=d==null?void 0:d.indexOf(n.id))!=null?o:-1}},createTable:n=>{n.setRowPinning=l=>n.options.onRowPinningChange==null?void 0:n.options.onRowPinningChange(l),n.resetRowPinning=l=>{var a,o;return n.setRowPinning(l?Zh():(a=(o=n.initialState)==null?void 0:o.rowPinning)!=null?a:Zh())},n.getIsSomeRowsPinned=l=>{var a;const o=n.getState().rowPinning;if(!l){var c,d;return!!((c=o.top)!=null&&c.length||(d=o.bottom)!=null&&d.length)}return!!((a=o[l])!=null&&a.length)},n._getPinnedRows=(l,a,o)=>{var c;return((c=n.options.keepPinnedRows)==null||c?(a??[]).map(h=>{const m=n.getRow(h,!0);return m.getIsAllParentsExpanded()?m:null}):(a??[]).map(h=>l.find(m=>m.id===h))).filter(Boolean).map(h=>({...h,position:o}))},n.getTopRows=Me(()=>[n.getRowModel().rows,n.getState().rowPinning.top],(l,a)=>n._getPinnedRows(l,a,"top"),Ee(n.options,"debugRows")),n.getBottomRows=Me(()=>[n.getRowModel().rows,n.getState().rowPinning.bottom],(l,a)=>n._getPinnedRows(l,a,"bottom"),Ee(n.options,"debugRows")),n.getCenterRows=Me(()=>[n.getRowModel().rows,n.getState().rowPinning.top,n.getState().rowPinning.bottom],(l,a,o)=>{const c=new Set([...a??[],...o??[]]);return l.filter(d=>!c.has(d.id))},Ee(n.options,"debugRows"))}},FE={getInitialState:n=>({rowSelection:{},...n}),getDefaultOptions:n=>({onRowSelectionChange:Dn("rowSelection",n),enableRowSelection:!0,enableMultiRowSelection:!0,enableSubRowSelection:!0}),createTable:n=>{n.setRowSelection=l=>n.options.onRowSelectionChange==null?void 0:n.options.onRowSelectionChange(l),n.resetRowSelection=l=>{var a;return n.setRowSelection(l?{}:(a=n.initialState.rowSelection)!=null?a:{})},n.toggleAllRowsSelected=l=>{n.setRowSelection(a=>{l=typeof l<"u"?l:!n.getIsAllRowsSelected();const o={...a},c=n.getPreGroupedRowModel().flatRows;return l?c.forEach(d=>{d.getCanSelect()&&(o[d.id]=!0)}):c.forEach(d=>{delete o[d.id]}),o})},n.toggleAllPageRowsSelected=l=>n.setRowSelection(a=>{const o=typeof l<"u"?l:!n.getIsAllPageRowsSelected(),c={...a};return n.getRowModel().rows.forEach(d=>{Pm(c,d.id,o,!0,n)}),c}),n.getPreSelectedRowModel=()=>n.getCoreRowModel(),n.getSelectedRowModel=Me(()=>[n.getState().rowSelection,n.getCoreRowModel()],(l,a)=>Object.keys(l).length?Jh(n,a):{rows:[],flatRows:[],rowsById:{}},Ee(n.options,"debugTable")),n.getFilteredSelectedRowModel=Me(()=>[n.getState().rowSelection,n.getFilteredRowModel()],(l,a)=>Object.keys(l).length?Jh(n,a):{rows:[],flatRows:[],rowsById:{}},Ee(n.options,"debugTable")),n.getGroupedSelectedRowModel=Me(()=>[n.getState().rowSelection,n.getSortedRowModel()],(l,a)=>Object.keys(l).length?Jh(n,a):{rows:[],flatRows:[],rowsById:{}},Ee(n.options,"debugTable")),n.getIsAllRowsSelected=()=>{const l=n.getFilteredRowModel().flatRows,{rowSelection:a}=n.getState();let o=!!(l.length&&Object.keys(a).length);return o&&l.some(c=>c.getCanSelect()&&!a[c.id])&&(o=!1),o},n.getIsAllPageRowsSelected=()=>{const l=n.getPaginationRowModel().flatRows.filter(c=>c.getCanSelect()),{rowSelection:a}=n.getState();let o=!!l.length;return o&&l.some(c=>!a[c.id])&&(o=!1),o},n.getIsSomeRowsSelected=()=>{var l;const a=Object.keys((l=n.getState().rowSelection)!=null?l:{}).length;return a>0&&a<n.getFilteredRowModel().flatRows.length},n.getIsSomePageRowsSelected=()=>{const l=n.getPaginationRowModel().flatRows;return n.getIsAllPageRowsSelected()?!1:l.filter(a=>a.getCanSelect()).some(a=>a.getIsSelected()||a.getIsSomeSelected())},n.getToggleAllRowsSelectedHandler=()=>l=>{n.toggleAllRowsSelected(l.target.checked)},n.getToggleAllPageRowsSelectedHandler=()=>l=>{n.toggleAllPageRowsSelected(l.target.checked)}},createRow:(n,l)=>{n.toggleSelected=(a,o)=>{const c=n.getIsSelected();l.setRowSelection(d=>{var h;if(a=typeof a<"u"?a:!c,n.getCanSelect()&&c===a)return d;const m={...d};return Pm(m,n.id,a,(h=o==null?void 0:o.selectChildren)!=null?h:!0,l),m})},n.getIsSelected=()=>{const{rowSelection:a}=l.getState();return vg(n,a)},n.getIsSomeSelected=()=>{const{rowSelection:a}=l.getState();return Xm(n,a)==="some"},n.getIsAllSubRowsSelected=()=>{const{rowSelection:a}=l.getState();return Xm(n,a)==="all"},n.getCanSelect=()=>{var a;return typeof l.options.enableRowSelection=="function"?l.options.enableRowSelection(n):(a=l.options.enableRowSelection)!=null?a:!0},n.getCanSelectSubRows=()=>{var a;return typeof l.options.enableSubRowSelection=="function"?l.options.enableSubRowSelection(n):(a=l.options.enableSubRowSelection)!=null?a:!0},n.getCanMultiSelect=()=>{var a;return typeof l.options.enableMultiRowSelection=="function"?l.options.enableMultiRowSelection(n):(a=l.options.enableMultiRowSelection)!=null?a:!0},n.getToggleSelectedHandler=()=>{const a=n.getCanSelect();return o=>{var c;a&&n.toggleSelected((c=o.target)==null?void 0:c.checked)}}}},Pm=(n,l,a,o,c)=>{var d;const h=c.getRow(l,!0);a?(h.getCanMultiSelect()||Object.keys(n).forEach(m=>delete n[m]),h.getCanSelect()&&(n[l]=!0)):delete n[l],o&&(d=h.subRows)!=null&&d.length&&h.getCanSelectSubRows()&&h.subRows.forEach(m=>Pm(n,m.id,a,o,c))};function Jh(n,l){const a=n.getState().rowSelection,o=[],c={},d=function(h,m){return h.map(g=>{var x;const v=vg(g,a);if(v&&(o.push(g),c[g.id]=g),(x=g.subRows)!=null&&x.length&&(g={...g,subRows:d(g.subRows)}),v)return g}).filter(Boolean)};return{rows:d(l.rows),flatRows:o,rowsById:c}}function vg(n,l){var a;return(a=l[n.id])!=null?a:!1}function Xm(n,l,a){var o;if(!((o=n.subRows)!=null&&o.length))return!1;let c=!0,d=!1;return n.subRows.forEach(h=>{if(!(d&&!c)&&(h.getCanSelect()&&(vg(h,l)?d=!0:c=!1),h.subRows&&h.subRows.length)){const m=Xm(h,l);m==="all"?d=!0:(m==="some"&&(d=!0),c=!1)}}),c?"all":d?"some":!1}const Km=/([0-9]+)/gm,VE=(n,l,a)=>ES(Gl(n.getValue(a)).toLowerCase(),Gl(l.getValue(a)).toLowerCase()),BE=(n,l,a)=>ES(Gl(n.getValue(a)),Gl(l.getValue(a))),GE=(n,l,a)=>xg(Gl(n.getValue(a)).toLowerCase(),Gl(l.getValue(a)).toLowerCase()),qE=(n,l,a)=>xg(Gl(n.getValue(a)),Gl(l.getValue(a))),IE=(n,l,a)=>{const o=n.getValue(a),c=l.getValue(a);return o>c?1:o<c?-1:0},QE=(n,l,a)=>xg(n.getValue(a),l.getValue(a));function xg(n,l){return n===l?0:n>l?1:-1}function Gl(n){return typeof n=="number"?isNaN(n)||n===1/0||n===-1/0?"":String(n):typeof n=="string"?n:""}function ES(n,l){const a=n.split(Km).filter(Boolean),o=l.split(Km).filter(Boolean);for(;a.length&&o.length;){const c=a.shift(),d=o.shift(),h=parseInt(c,10),m=parseInt(d,10),g=[h,m].sort();if(isNaN(g[0])){if(c>d)return 1;if(d>c)return-1;continue}if(isNaN(g[1]))return isNaN(h)?-1:1;if(h>m)return 1;if(m>h)return-1}return a.length-o.length}const gr={alphanumeric:VE,alphanumericCaseSensitive:BE,text:GE,textCaseSensitive:qE,datetime:IE,basic:QE},YE={getInitialState:n=>({sorting:[],...n}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:n=>({onSortingChange:Dn("sorting",n),isMultiSortEvent:l=>l.shiftKey}),createColumn:(n,l)=>{n.getAutoSortingFn=()=>{const a=l.getFilteredRowModel().flatRows.slice(10);let o=!1;for(const c of a){const d=c==null?void 0:c.getValue(n.id);if(Object.prototype.toString.call(d)==="[object Date]")return gr.datetime;if(typeof d=="string"&&(o=!0,d.split(Km).length>1))return gr.alphanumeric}return o?gr.text:gr.basic},n.getAutoSortDir=()=>{const a=l.getFilteredRowModel().flatRows[0];return typeof(a==null?void 0:a.getValue(n.id))=="string"?"asc":"desc"},n.getSortingFn=()=>{var a,o;if(!n)throw new Error;return Xu(n.columnDef.sortingFn)?n.columnDef.sortingFn:n.columnDef.sortingFn==="auto"?n.getAutoSortingFn():(a=(o=l.options.sortingFns)==null?void 0:o[n.columnDef.sortingFn])!=null?a:gr[n.columnDef.sortingFn]},n.toggleSorting=(a,o)=>{const c=n.getNextSortingOrder(),d=typeof a<"u"&&a!==null;l.setSorting(h=>{const m=h==null?void 0:h.find(j=>j.id===n.id),g=h==null?void 0:h.findIndex(j=>j.id===n.id);let x=[],v,y=d?a:c==="desc";if(h!=null&&h.length&&n.getCanMultiSort()&&o?m?v="toggle":v="add":h!=null&&h.length&&g!==h.length-1?v="replace":m?v="toggle":v="replace",v==="toggle"&&(d||c||(v="remove")),v==="add"){var S;x=[...h,{id:n.id,desc:y}],x.splice(0,x.length-((S=l.options.maxMultiSortColCount)!=null?S:Number.MAX_SAFE_INTEGER))}else v==="toggle"?x=h.map(j=>j.id===n.id?{...j,desc:y}:j):v==="remove"?x=h.filter(j=>j.id!==n.id):x=[{id:n.id,desc:y}];return x})},n.getFirstSortDir=()=>{var a,o;return((a=(o=n.columnDef.sortDescFirst)!=null?o:l.options.sortDescFirst)!=null?a:n.getAutoSortDir()==="desc")?"desc":"asc"},n.getNextSortingOrder=a=>{var o,c;const d=n.getFirstSortDir(),h=n.getIsSorted();return h?h!==d&&((o=l.options.enableSortingRemoval)==null||o)&&(!(a&&(c=l.options.enableMultiRemove)!=null)||c)?!1:h==="desc"?"asc":"desc":d},n.getCanSort=()=>{var a,o;return((a=n.columnDef.enableSorting)!=null?a:!0)&&((o=l.options.enableSorting)!=null?o:!0)&&!!n.accessorFn},n.getCanMultiSort=()=>{var a,o;return(a=(o=n.columnDef.enableMultiSort)!=null?o:l.options.enableMultiSort)!=null?a:!!n.accessorFn},n.getIsSorted=()=>{var a;const o=(a=l.getState().sorting)==null?void 0:a.find(c=>c.id===n.id);return o?o.desc?"desc":"asc":!1},n.getSortIndex=()=>{var a,o;return(a=(o=l.getState().sorting)==null?void 0:o.findIndex(c=>c.id===n.id))!=null?a:-1},n.clearSorting=()=>{l.setSorting(a=>a!=null&&a.length?a.filter(o=>o.id!==n.id):[])},n.getToggleSortingHandler=()=>{const a=n.getCanSort();return o=>{a&&(o.persist==null||o.persist(),n.toggleSorting==null||n.toggleSorting(void 0,n.getCanMultiSort()?l.options.isMultiSortEvent==null?void 0:l.options.isMultiSortEvent(o):!1))}}},createTable:n=>{n.setSorting=l=>n.options.onSortingChange==null?void 0:n.options.onSortingChange(l),n.resetSorting=l=>{var a,o;n.setSorting(l?[]:(a=(o=n.initialState)==null?void 0:o.sorting)!=null?a:[])},n.getPreSortedRowModel=()=>n.getGroupedRowModel(),n.getSortedRowModel=()=>(!n._getSortedRowModel&&n.options.getSortedRowModel&&(n._getSortedRowModel=n.options.getSortedRowModel(n)),n.options.manualSorting||!n._getSortedRowModel?n.getPreSortedRowModel():n._getSortedRowModel())}},PE=[mE,DE,_E,RE,pE,yE,LE,$E,YE,EE,kE,HE,UE,FE,OE];function XE(n){var l,a;const o=[...PE,...(l=n._features)!=null?l:[]];let c={_features:o};const d=c._features.reduce((S,j)=>Object.assign(S,j.getDefaultOptions==null?void 0:j.getDefaultOptions(c)),{}),h=S=>c.options.mergeOptions?c.options.mergeOptions(d,S):{...d,...S};let g={...{},...(a=n.initialState)!=null?a:{}};c._features.forEach(S=>{var j;g=(j=S.getInitialState==null?void 0:S.getInitialState(g))!=null?j:g});const x=[];let v=!1;const y={_features:o,options:{...d,...n},initialState:g,_queue:S=>{x.push(S),v||(v=!0,Promise.resolve().then(()=>{for(;x.length;)x.shift()();v=!1}).catch(j=>setTimeout(()=>{throw j})))},reset:()=>{c.setState(c.initialState)},setOptions:S=>{const j=Fl(S,c.options);c.options=h(j)},getState:()=>c.options.state,setState:S=>{c.options.onStateChange==null||c.options.onStateChange(S)},_getRowId:(S,j,b)=>{var N;return(N=c.options.getRowId==null?void 0:c.options.getRowId(S,j,b))!=null?N:`${b?[b.id,j].join("."):j}`},getCoreRowModel:()=>(c._getCoreRowModel||(c._getCoreRowModel=c.options.getCoreRowModel(c)),c._getCoreRowModel()),getRowModel:()=>c.getPaginationRowModel(),getRow:(S,j)=>{let b=(j?c.getPrePaginationRowModel():c.getRowModel()).rowsById[S];if(!b&&(b=c.getCoreRowModel().rowsById[S],!b))throw new Error;return b},_getDefaultColumnDef:Me(()=>[c.options.defaultColumn],S=>{var j;return S=(j=S)!=null?j:{},{header:b=>{const N=b.header.column.columnDef;return N.accessorKey?N.accessorKey:N.accessorFn?N.id:null},cell:b=>{var N,T;return(N=(T=b.renderValue())==null||T.toString==null?void 0:T.toString())!=null?N:null},...c._features.reduce((b,N)=>Object.assign(b,N.getDefaultColumnDef==null?void 0:N.getDefaultColumnDef()),{}),...S}},Ee(n,"debugColumns")),_getColumnDefs:()=>c.options.columns,getAllColumns:Me(()=>[c._getColumnDefs()],S=>{const j=function(b,N,T){return T===void 0&&(T=0),b.map(O=>{const _=hE(c,O,T,N),D=O;return _.columns=D.columns?j(D.columns,_,T+1):[],_})};return j(S)},Ee(n,"debugColumns")),getAllFlatColumns:Me(()=>[c.getAllColumns()],S=>S.flatMap(j=>j.getFlatColumns()),Ee(n,"debugColumns")),_getAllFlatColumnsById:Me(()=>[c.getAllFlatColumns()],S=>S.reduce((j,b)=>(j[b.id]=b,j),{}),Ee(n,"debugColumns")),getAllLeafColumns:Me(()=>[c.getAllColumns(),c._getOrderColumnsFn()],(S,j)=>{let b=S.flatMap(N=>N.getLeafColumns());return j(b)},Ee(n,"debugColumns")),getColumn:S=>c._getAllFlatColumnsById()[S]};Object.assign(c,y);for(let S=0;S<c._features.length;S++){const j=c._features[S];j==null||j.createTable==null||j.createTable(c)}return c}function TS(){return n=>Me(()=>[n.options.data],l=>{const a={rows:[],flatRows:[],rowsById:{}},o=function(c,d,h){d===void 0&&(d=0);const m=[];for(let x=0;x<c.length;x++){const v=gE(n,n._getRowId(c[x],x,h),c[x],x,d,void 0,h==null?void 0:h.id);if(a.flatRows.push(v),a.rowsById[v.id]=v,m.push(v),n.options.getSubRows){var g;v.originalSubRows=n.options.getSubRows(c[x],x),(g=v.originalSubRows)!=null&&g.length&&(v.subRows=o(v.originalSubRows,d+1,v))}}return m};return a.rows=o(l),a},Ee(n.options,"debugTable","getRowModel",()=>n._autoResetPageIndex()))}function _S(){return n=>Me(()=>[n.getState().expanded,n.getPreExpandedRowModel(),n.options.paginateExpandedRows],(l,a,o)=>!a.rows.length||l!==!0&&!Object.keys(l??{}).length||!o?a:KE(a),Ee(n.options,"debugTable"))}function KE(n){const l=[],a=o=>{var c;l.push(o),(c=o.subRows)!=null&&c.length&&o.getIsExpanded()&&o.subRows.forEach(a)};return n.rows.forEach(a),{rows:l,flatRows:n.flatRows,rowsById:n.rowsById}}function ZE(){return n=>Me(()=>[n.getState().sorting,n.getPreSortedRowModel()],(l,a)=>{if(!a.rows.length||!(l!=null&&l.length))return a;const o=n.getState().sorting,c=[],d=o.filter(g=>{var x;return(x=n.getColumn(g.id))==null?void 0:x.getCanSort()}),h={};d.forEach(g=>{const x=n.getColumn(g.id);x&&(h[g.id]={sortUndefined:x.columnDef.sortUndefined,invertSorting:x.columnDef.invertSorting,sortingFn:x.getSortingFn()})});const m=g=>{const x=g.map(v=>({...v}));return x.sort((v,y)=>{for(let j=0;j<d.length;j+=1){var S;const b=d[j],N=h[b.id],T=N.sortUndefined,O=(S=b==null?void 0:b.desc)!=null?S:!1;let _=0;if(T){const D=v.getValue(b.id),C=y.getValue(b.id),E=D===void 0,R=C===void 0;if(E||R){if(T==="first")return E?-1:1;if(T==="last")return E?1:-1;_=E&&R?0:E?T:-T}}if(_===0&&(_=N.sortingFn(v,y,b.id)),_!==0)return O&&(_*=-1),N.invertSorting&&(_*=-1),_}return v.index-y.index}),x.forEach(v=>{var y;c.push(v),(y=v.subRows)!=null&&y.length&&(v.subRows=m(v.subRows))}),x};return{rows:m(a.rows),flatRows:c,rowsById:a.rowsById}},Ee(n.options,"debugTable","getSortedRowModel",()=>n._autoResetPageIndex()))}/**
|
|
314
|
+
color: hsl(${Math.max(0,Math.min(120-120*b,120))}deg 100% 31%);`,l==null?void 0:l.key)}return c}}function Re(n,a,l,i){return{debug:()=>{var c;return(c=n==null?void 0:n.debugAll)!=null?c:n[a]},key:!1,onChange:i}}function rE(n,a,l,i){const c=()=>{var f;return(f=d.getValue())!=null?f:n.options.renderFallbackValue},d={id:`${a.id}_${l.id}`,row:a,column:l,getValue:()=>a.getValue(i),renderValue:c,getContext:Ee(()=>[n,l,a,d],(f,m,g,v)=>({table:f,column:m,row:g,cell:v,getValue:v.getValue,renderValue:v.renderValue}),Re(n.options,"debugCells"))};return n._features.forEach(f=>{f.createCell==null||f.createCell(d,l,a,n)},{}),d}function cE(n,a,l,i){var c,d;const m={...n._getDefaultColumnDef(),...a},g=m.accessorKey;let v=(c=(d=m.id)!=null?d:g?typeof String.prototype.replaceAll=="function"?g.replaceAll(".","_"):g.replace(/\./g,"_"):void 0)!=null?c:typeof m.header=="string"?m.header:void 0,x;if(m.accessorFn?x=m.accessorFn:g&&(g.includes(".")?x=b=>{let S=b;for(const N of g.split(".")){var j;S=(j=S)==null?void 0:j[N]}return S}:x=b=>b[m.accessorKey]),!v)throw new Error;let p={id:`${String(v)}`,accessorFn:x,parent:i,depth:l,columnDef:m,columns:[],getFlatColumns:Ee(()=>[!0],()=>{var b;return[p,...(b=p.columns)==null?void 0:b.flatMap(S=>S.getFlatColumns())]},Re(n.options,"debugColumns")),getLeafColumns:Ee(()=>[n._getOrderColumnsFn()],b=>{var S;if((S=p.columns)!=null&&S.length){let j=p.columns.flatMap(N=>N.getLeafColumns());return b(j)}return[p]},Re(n.options,"debugColumns"))};for(const b of n._features)b.createColumn==null||b.createColumn(p,n);return p}const tn="debugHeaders";function Kv(n,a,l){var i;let d={id:(i=l.id)!=null?i:a.id,column:a,index:l.index,isPlaceholder:!!l.isPlaceholder,placeholderId:l.placeholderId,depth:l.depth,subHeaders:[],colSpan:0,rowSpan:0,headerGroup:null,getLeafHeaders:()=>{const f=[],m=g=>{g.subHeaders&&g.subHeaders.length&&g.subHeaders.map(m),f.push(g)};return m(d),f},getContext:()=>({table:n,header:d,column:a})};return n._features.forEach(f=>{f.createHeader==null||f.createHeader(d,n)}),d}const uE={createTable:n=>{n.getHeaderGroups=Ee(()=>[n.getAllColumns(),n.getVisibleLeafColumns(),n.getState().columnPinning.left,n.getState().columnPinning.right],(a,l,i,c)=>{var d,f;const m=(d=i==null?void 0:i.map(p=>l.find(b=>b.id===p)).filter(Boolean))!=null?d:[],g=(f=c==null?void 0:c.map(p=>l.find(b=>b.id===p)).filter(Boolean))!=null?f:[],v=l.filter(p=>!(i!=null&&i.includes(p.id))&&!(c!=null&&c.includes(p.id)));return zu(a,[...m,...v,...g],n)},Re(n.options,tn)),n.getCenterHeaderGroups=Ee(()=>[n.getAllColumns(),n.getVisibleLeafColumns(),n.getState().columnPinning.left,n.getState().columnPinning.right],(a,l,i,c)=>(l=l.filter(d=>!(i!=null&&i.includes(d.id))&&!(c!=null&&c.includes(d.id))),zu(a,l,n,"center")),Re(n.options,tn)),n.getLeftHeaderGroups=Ee(()=>[n.getAllColumns(),n.getVisibleLeafColumns(),n.getState().columnPinning.left],(a,l,i)=>{var c;const d=(c=i==null?void 0:i.map(f=>l.find(m=>m.id===f)).filter(Boolean))!=null?c:[];return zu(a,d,n,"left")},Re(n.options,tn)),n.getRightHeaderGroups=Ee(()=>[n.getAllColumns(),n.getVisibleLeafColumns(),n.getState().columnPinning.right],(a,l,i)=>{var c;const d=(c=i==null?void 0:i.map(f=>l.find(m=>m.id===f)).filter(Boolean))!=null?c:[];return zu(a,d,n,"right")},Re(n.options,tn)),n.getFooterGroups=Ee(()=>[n.getHeaderGroups()],a=>[...a].reverse(),Re(n.options,tn)),n.getLeftFooterGroups=Ee(()=>[n.getLeftHeaderGroups()],a=>[...a].reverse(),Re(n.options,tn)),n.getCenterFooterGroups=Ee(()=>[n.getCenterHeaderGroups()],a=>[...a].reverse(),Re(n.options,tn)),n.getRightFooterGroups=Ee(()=>[n.getRightHeaderGroups()],a=>[...a].reverse(),Re(n.options,tn)),n.getFlatHeaders=Ee(()=>[n.getHeaderGroups()],a=>a.map(l=>l.headers).flat(),Re(n.options,tn)),n.getLeftFlatHeaders=Ee(()=>[n.getLeftHeaderGroups()],a=>a.map(l=>l.headers).flat(),Re(n.options,tn)),n.getCenterFlatHeaders=Ee(()=>[n.getCenterHeaderGroups()],a=>a.map(l=>l.headers).flat(),Re(n.options,tn)),n.getRightFlatHeaders=Ee(()=>[n.getRightHeaderGroups()],a=>a.map(l=>l.headers).flat(),Re(n.options,tn)),n.getCenterLeafHeaders=Ee(()=>[n.getCenterFlatHeaders()],a=>a.filter(l=>{var i;return!((i=l.subHeaders)!=null&&i.length)}),Re(n.options,tn)),n.getLeftLeafHeaders=Ee(()=>[n.getLeftFlatHeaders()],a=>a.filter(l=>{var i;return!((i=l.subHeaders)!=null&&i.length)}),Re(n.options,tn)),n.getRightLeafHeaders=Ee(()=>[n.getRightFlatHeaders()],a=>a.filter(l=>{var i;return!((i=l.subHeaders)!=null&&i.length)}),Re(n.options,tn)),n.getLeafHeaders=Ee(()=>[n.getLeftHeaderGroups(),n.getCenterHeaderGroups(),n.getRightHeaderGroups()],(a,l,i)=>{var c,d,f,m,g,v;return[...(c=(d=a[0])==null?void 0:d.headers)!=null?c:[],...(f=(m=l[0])==null?void 0:m.headers)!=null?f:[],...(g=(v=i[0])==null?void 0:v.headers)!=null?g:[]].map(x=>x.getLeafHeaders()).flat()},Re(n.options,tn))}};function zu(n,a,l,i){var c,d;let f=0;const m=function(b,S){S===void 0&&(S=1),f=Math.max(f,S),b.filter(j=>j.getIsVisible()).forEach(j=>{var N;(N=j.columns)!=null&&N.length&&m(j.columns,S+1)},0)};m(n);let g=[];const v=(b,S)=>{const j={depth:S,id:[i,`${S}`].filter(Boolean).join("_"),headers:[]},N=[];b.forEach(R=>{const A=[...N].reverse()[0],T=R.column.depth===j.depth;let O,M=!1;if(T&&R.column.parent?O=R.column.parent:(O=R.column,M=!0),A&&(A==null?void 0:A.column)===O)A.subHeaders.push(R);else{const E=Kv(l,O,{id:[i,S,O.id,R==null?void 0:R.id].filter(Boolean).join("_"),isPlaceholder:M,placeholderId:M?`${N.filter(_=>_.column===O).length}`:void 0,depth:S,index:N.length});E.subHeaders.push(R),N.push(E)}j.headers.push(R),R.headerGroup=j}),g.push(j),S>0&&v(N,S-1)},x=a.map((b,S)=>Kv(l,b,{depth:f,index:S}));v(x,f-1),g.reverse();const p=b=>b.filter(j=>j.column.getIsVisible()).map(j=>{let N=0,R=0,A=[0];j.subHeaders&&j.subHeaders.length?(A=[],p(j.subHeaders).forEach(O=>{let{colSpan:M,rowSpan:E}=O;N+=M,A.push(E)})):N=1;const T=Math.min(...A);return R=R+T,j.colSpan=N,j.rowSpan=R,{colSpan:N,rowSpan:R}});return p((c=(d=g[0])==null?void 0:d.headers)!=null?c:[]),g}const dE=(n,a,l,i,c,d,f)=>{let m={id:a,index:i,original:l,depth:c,parentId:f,_valuesCache:{},_uniqueValuesCache:{},getValue:g=>{if(m._valuesCache.hasOwnProperty(g))return m._valuesCache[g];const v=n.getColumn(g);if(v!=null&&v.accessorFn)return m._valuesCache[g]=v.accessorFn(m.original,i),m._valuesCache[g]},getUniqueValues:g=>{if(m._uniqueValuesCache.hasOwnProperty(g))return m._uniqueValuesCache[g];const v=n.getColumn(g);if(v!=null&&v.accessorFn)return v.columnDef.getUniqueValues?(m._uniqueValuesCache[g]=v.columnDef.getUniqueValues(m.original,i),m._uniqueValuesCache[g]):(m._uniqueValuesCache[g]=[m.getValue(g)],m._uniqueValuesCache[g])},renderValue:g=>{var v;return(v=m.getValue(g))!=null?v:n.options.renderFallbackValue},subRows:[],getLeafRows:()=>oE(m.subRows,g=>g.subRows),getParentRow:()=>m.parentId?n.getRow(m.parentId,!0):void 0,getParentRows:()=>{let g=[],v=m;for(;;){const x=v.getParentRow();if(!x)break;g.push(x),v=x}return g.reverse()},getAllCells:Ee(()=>[n.getAllLeafColumns()],g=>g.map(v=>rE(n,m,v,v.id)),Re(n.options,"debugRows")),_getAllCellsByColumnId:Ee(()=>[m.getAllCells()],g=>g.reduce((v,x)=>(v[x.column.id]=x,v),{}),Re(n.options,"debugRows"))};for(let g=0;g<n._features.length;g++){const v=n._features[g];v==null||v.createRow==null||v.createRow(m,n)}return m},hE={createColumn:(n,a)=>{n._getFacetedRowModel=a.options.getFacetedRowModel&&a.options.getFacetedRowModel(a,n.id),n.getFacetedRowModel=()=>n._getFacetedRowModel?n._getFacetedRowModel():a.getPreFilteredRowModel(),n._getFacetedUniqueValues=a.options.getFacetedUniqueValues&&a.options.getFacetedUniqueValues(a,n.id),n.getFacetedUniqueValues=()=>n._getFacetedUniqueValues?n._getFacetedUniqueValues():new Map,n._getFacetedMinMaxValues=a.options.getFacetedMinMaxValues&&a.options.getFacetedMinMaxValues(a,n.id),n.getFacetedMinMaxValues=()=>{if(n._getFacetedMinMaxValues)return n._getFacetedMinMaxValues()}}},Ky=(n,a,l)=>{var i,c;const d=l==null||(i=l.toString())==null?void 0:i.toLowerCase();return!!(!((c=n.getValue(a))==null||(c=c.toString())==null||(c=c.toLowerCase())==null)&&c.includes(d))};Ky.autoRemove=n=>ds(n);const Zy=(n,a,l)=>{var i;return!!(!((i=n.getValue(a))==null||(i=i.toString())==null)&&i.includes(l))};Zy.autoRemove=n=>ds(n);const Jy=(n,a,l)=>{var i;return((i=n.getValue(a))==null||(i=i.toString())==null?void 0:i.toLowerCase())===(l==null?void 0:l.toLowerCase())};Jy.autoRemove=n=>ds(n);const Wy=(n,a,l)=>{var i;return(i=n.getValue(a))==null?void 0:i.includes(l)};Wy.autoRemove=n=>ds(n);const eb=(n,a,l)=>!l.some(i=>{var c;return!((c=n.getValue(a))!=null&&c.includes(i))});eb.autoRemove=n=>ds(n)||!(n!=null&&n.length);const tb=(n,a,l)=>l.some(i=>{var c;return(c=n.getValue(a))==null?void 0:c.includes(i)});tb.autoRemove=n=>ds(n)||!(n!=null&&n.length);const nb=(n,a,l)=>n.getValue(a)===l;nb.autoRemove=n=>ds(n);const sb=(n,a,l)=>n.getValue(a)==l;sb.autoRemove=n=>ds(n);const kg=(n,a,l)=>{let[i,c]=l;const d=n.getValue(a);return d>=i&&d<=c};kg.resolveFilterValue=n=>{let[a,l]=n,i=typeof a!="number"?parseFloat(a):a,c=typeof l!="number"?parseFloat(l):l,d=a===null||Number.isNaN(i)?-1/0:i,f=l===null||Number.isNaN(c)?1/0:c;if(d>f){const m=d;d=f,f=m}return[d,f]};kg.autoRemove=n=>ds(n)||ds(n[0])&&ds(n[1]);const aa={includesString:Ky,includesStringSensitive:Zy,equalsString:Jy,arrIncludes:Wy,arrIncludesAll:eb,arrIncludesSome:tb,equals:nb,weakEquals:sb,inNumberRange:kg};function ds(n){return n==null||n===""}const fE={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:n=>({columnFilters:[],...n}),getDefaultOptions:n=>({onColumnFiltersChange:Un("columnFilters",n),filterFromLeafRows:!1,maxLeafRowFilterDepth:100}),createColumn:(n,a)=>{n.getAutoFilterFn=()=>{const l=a.getCoreRowModel().flatRows[0],i=l==null?void 0:l.getValue(n.id);return typeof i=="string"?aa.includesString:typeof i=="number"?aa.inNumberRange:typeof i=="boolean"||i!==null&&typeof i=="object"?aa.equals:Array.isArray(i)?aa.arrIncludes:aa.weakEquals},n.getFilterFn=()=>{var l,i;return dd(n.columnDef.filterFn)?n.columnDef.filterFn:n.columnDef.filterFn==="auto"?n.getAutoFilterFn():(l=(i=a.options.filterFns)==null?void 0:i[n.columnDef.filterFn])!=null?l:aa[n.columnDef.filterFn]},n.getCanFilter=()=>{var l,i,c;return((l=n.columnDef.enableColumnFilter)!=null?l:!0)&&((i=a.options.enableColumnFilters)!=null?i:!0)&&((c=a.options.enableFilters)!=null?c:!0)&&!!n.accessorFn},n.getIsFiltered=()=>n.getFilterIndex()>-1,n.getFilterValue=()=>{var l;return(l=a.getState().columnFilters)==null||(l=l.find(i=>i.id===n.id))==null?void 0:l.value},n.getFilterIndex=()=>{var l,i;return(l=(i=a.getState().columnFilters)==null?void 0:i.findIndex(c=>c.id===n.id))!=null?l:-1},n.setFilterValue=l=>{a.setColumnFilters(i=>{const c=n.getFilterFn(),d=i==null?void 0:i.find(x=>x.id===n.id),f=tl(l,d?d.value:void 0);if(Zv(c,f,n)){var m;return(m=i==null?void 0:i.filter(x=>x.id!==n.id))!=null?m:[]}const g={id:n.id,value:f};if(d){var v;return(v=i==null?void 0:i.map(x=>x.id===n.id?g:x))!=null?v:[]}return i!=null&&i.length?[...i,g]:[g]})}},createRow:(n,a)=>{n.columnFilters={},n.columnFiltersMeta={}},createTable:n=>{n.setColumnFilters=a=>{const l=n.getAllLeafColumns(),i=c=>{var d;return(d=tl(a,c))==null?void 0:d.filter(f=>{const m=l.find(g=>g.id===f.id);if(m){const g=m.getFilterFn();if(Zv(g,f.value,m))return!1}return!0})};n.options.onColumnFiltersChange==null||n.options.onColumnFiltersChange(i)},n.resetColumnFilters=a=>{var l,i;n.setColumnFilters(a?[]:(l=(i=n.initialState)==null?void 0:i.columnFilters)!=null?l:[])},n.getPreFilteredRowModel=()=>n.getCoreRowModel(),n.getFilteredRowModel=()=>(!n._getFilteredRowModel&&n.options.getFilteredRowModel&&(n._getFilteredRowModel=n.options.getFilteredRowModel(n)),n.options.manualFiltering||!n._getFilteredRowModel?n.getPreFilteredRowModel():n._getFilteredRowModel())}};function Zv(n,a,l){return(n&&n.autoRemove?n.autoRemove(a,l):!1)||typeof a>"u"||typeof a=="string"&&!a}const mE=(n,a,l)=>l.reduce((i,c)=>{const d=c.getValue(n);return i+(typeof d=="number"?d:0)},0),gE=(n,a,l)=>{let i;return l.forEach(c=>{const d=c.getValue(n);d!=null&&(i>d||i===void 0&&d>=d)&&(i=d)}),i},pE=(n,a,l)=>{let i;return l.forEach(c=>{const d=c.getValue(n);d!=null&&(i<d||i===void 0&&d>=d)&&(i=d)}),i},xE=(n,a,l)=>{let i,c;return l.forEach(d=>{const f=d.getValue(n);f!=null&&(i===void 0?f>=f&&(i=c=f):(i>f&&(i=f),c<f&&(c=f)))}),[i,c]},vE=(n,a)=>{let l=0,i=0;if(a.forEach(c=>{let d=c.getValue(n);d!=null&&(d=+d)>=d&&(++l,i+=d)}),l)return i/l},yE=(n,a)=>{if(!a.length)return;const l=a.map(d=>d.getValue(n));if(!iE(l))return;if(l.length===1)return l[0];const i=Math.floor(l.length/2),c=l.sort((d,f)=>d-f);return l.length%2!==0?c[i]:(c[i-1]+c[i])/2},bE=(n,a)=>Array.from(new Set(a.map(l=>l.getValue(n))).values()),SE=(n,a)=>new Set(a.map(l=>l.getValue(n))).size,jE=(n,a)=>a.length,cm={sum:mE,min:gE,max:pE,extent:xE,mean:vE,median:yE,unique:bE,uniqueCount:SE,count:jE},wE={getDefaultColumnDef:()=>({aggregatedCell:n=>{var a,l;return(a=(l=n.getValue())==null||l.toString==null?void 0:l.toString())!=null?a:null},aggregationFn:"auto"}),getInitialState:n=>({grouping:[],...n}),getDefaultOptions:n=>({onGroupingChange:Un("grouping",n),groupedColumnMode:"reorder"}),createColumn:(n,a)=>{n.toggleGrouping=()=>{a.setGrouping(l=>l!=null&&l.includes(n.id)?l.filter(i=>i!==n.id):[...l??[],n.id])},n.getCanGroup=()=>{var l,i;return((l=n.columnDef.enableGrouping)!=null?l:!0)&&((i=a.options.enableGrouping)!=null?i:!0)&&(!!n.accessorFn||!!n.columnDef.getGroupingValue)},n.getIsGrouped=()=>{var l;return(l=a.getState().grouping)==null?void 0:l.includes(n.id)},n.getGroupedIndex=()=>{var l;return(l=a.getState().grouping)==null?void 0:l.indexOf(n.id)},n.getToggleGroupingHandler=()=>{const l=n.getCanGroup();return()=>{l&&n.toggleGrouping()}},n.getAutoAggregationFn=()=>{const l=a.getCoreRowModel().flatRows[0],i=l==null?void 0:l.getValue(n.id);if(typeof i=="number")return cm.sum;if(Object.prototype.toString.call(i)==="[object Date]")return cm.extent},n.getAggregationFn=()=>{var l,i;if(!n)throw new Error;return dd(n.columnDef.aggregationFn)?n.columnDef.aggregationFn:n.columnDef.aggregationFn==="auto"?n.getAutoAggregationFn():(l=(i=a.options.aggregationFns)==null?void 0:i[n.columnDef.aggregationFn])!=null?l:cm[n.columnDef.aggregationFn]}},createTable:n=>{n.setGrouping=a=>n.options.onGroupingChange==null?void 0:n.options.onGroupingChange(a),n.resetGrouping=a=>{var l,i;n.setGrouping(a?[]:(l=(i=n.initialState)==null?void 0:i.grouping)!=null?l:[])},n.getPreGroupedRowModel=()=>n.getFilteredRowModel(),n.getGroupedRowModel=()=>(!n._getGroupedRowModel&&n.options.getGroupedRowModel&&(n._getGroupedRowModel=n.options.getGroupedRowModel(n)),n.options.manualGrouping||!n._getGroupedRowModel?n.getPreGroupedRowModel():n._getGroupedRowModel())},createRow:(n,a)=>{n.getIsGrouped=()=>!!n.groupingColumnId,n.getGroupingValue=l=>{if(n._groupingValuesCache.hasOwnProperty(l))return n._groupingValuesCache[l];const i=a.getColumn(l);return i!=null&&i.columnDef.getGroupingValue?(n._groupingValuesCache[l]=i.columnDef.getGroupingValue(n.original),n._groupingValuesCache[l]):n.getValue(l)},n._groupingValuesCache={}},createCell:(n,a,l,i)=>{n.getIsGrouped=()=>a.getIsGrouped()&&a.id===l.groupingColumnId,n.getIsPlaceholder=()=>!n.getIsGrouped()&&a.getIsGrouped(),n.getIsAggregated=()=>{var c;return!n.getIsGrouped()&&!n.getIsPlaceholder()&&!!((c=l.subRows)!=null&&c.length)}}};function NE(n,a,l){if(!(a!=null&&a.length)||!l)return n;const i=n.filter(d=>!a.includes(d.id));return l==="remove"?i:[...a.map(d=>n.find(f=>f.id===d)).filter(Boolean),...i]}const CE={getInitialState:n=>({columnOrder:[],...n}),getDefaultOptions:n=>({onColumnOrderChange:Un("columnOrder",n)}),createColumn:(n,a)=>{n.getIndex=Ee(l=>[Ur(a,l)],l=>l.findIndex(i=>i.id===n.id),Re(a.options,"debugColumns")),n.getIsFirstColumn=l=>{var i;return((i=Ur(a,l)[0])==null?void 0:i.id)===n.id},n.getIsLastColumn=l=>{var i;const c=Ur(a,l);return((i=c[c.length-1])==null?void 0:i.id)===n.id}},createTable:n=>{n.setColumnOrder=a=>n.options.onColumnOrderChange==null?void 0:n.options.onColumnOrderChange(a),n.resetColumnOrder=a=>{var l;n.setColumnOrder(a?[]:(l=n.initialState.columnOrder)!=null?l:[])},n._getOrderColumnsFn=Ee(()=>[n.getState().columnOrder,n.getState().grouping,n.options.groupedColumnMode],(a,l,i)=>c=>{let d=[];if(!(a!=null&&a.length))d=c;else{const f=[...a],m=[...c];for(;m.length&&f.length;){const g=f.shift(),v=m.findIndex(x=>x.id===g);v>-1&&d.push(m.splice(v,1)[0])}d=[...d,...m]}return NE(d,l,i)},Re(n.options,"debugTable"))}},um=()=>({left:[],right:[]}),ME={getInitialState:n=>({columnPinning:um(),...n}),getDefaultOptions:n=>({onColumnPinningChange:Un("columnPinning",n)}),createColumn:(n,a)=>{n.pin=l=>{const i=n.getLeafColumns().map(c=>c.id).filter(Boolean);a.setColumnPinning(c=>{var d,f;if(l==="right"){var m,g;return{left:((m=c==null?void 0:c.left)!=null?m:[]).filter(p=>!(i!=null&&i.includes(p))),right:[...((g=c==null?void 0:c.right)!=null?g:[]).filter(p=>!(i!=null&&i.includes(p))),...i]}}if(l==="left"){var v,x;return{left:[...((v=c==null?void 0:c.left)!=null?v:[]).filter(p=>!(i!=null&&i.includes(p))),...i],right:((x=c==null?void 0:c.right)!=null?x:[]).filter(p=>!(i!=null&&i.includes(p)))}}return{left:((d=c==null?void 0:c.left)!=null?d:[]).filter(p=>!(i!=null&&i.includes(p))),right:((f=c==null?void 0:c.right)!=null?f:[]).filter(p=>!(i!=null&&i.includes(p)))}})},n.getCanPin=()=>n.getLeafColumns().some(i=>{var c,d,f;return((c=i.columnDef.enablePinning)!=null?c:!0)&&((d=(f=a.options.enableColumnPinning)!=null?f:a.options.enablePinning)!=null?d:!0)}),n.getIsPinned=()=>{const l=n.getLeafColumns().map(m=>m.id),{left:i,right:c}=a.getState().columnPinning,d=l.some(m=>i==null?void 0:i.includes(m)),f=l.some(m=>c==null?void 0:c.includes(m));return d?"left":f?"right":!1},n.getPinnedIndex=()=>{var l,i;const c=n.getIsPinned();return c?(l=(i=a.getState().columnPinning)==null||(i=i[c])==null?void 0:i.indexOf(n.id))!=null?l:-1:0}},createRow:(n,a)=>{n.getCenterVisibleCells=Ee(()=>[n._getAllVisibleCells(),a.getState().columnPinning.left,a.getState().columnPinning.right],(l,i,c)=>{const d=[...i??[],...c??[]];return l.filter(f=>!d.includes(f.column.id))},Re(a.options,"debugRows")),n.getLeftVisibleCells=Ee(()=>[n._getAllVisibleCells(),a.getState().columnPinning.left],(l,i)=>(i??[]).map(d=>l.find(f=>f.column.id===d)).filter(Boolean).map(d=>({...d,position:"left"})),Re(a.options,"debugRows")),n.getRightVisibleCells=Ee(()=>[n._getAllVisibleCells(),a.getState().columnPinning.right],(l,i)=>(i??[]).map(d=>l.find(f=>f.column.id===d)).filter(Boolean).map(d=>({...d,position:"right"})),Re(a.options,"debugRows"))},createTable:n=>{n.setColumnPinning=a=>n.options.onColumnPinningChange==null?void 0:n.options.onColumnPinningChange(a),n.resetColumnPinning=a=>{var l,i;return n.setColumnPinning(a?um():(l=(i=n.initialState)==null?void 0:i.columnPinning)!=null?l:um())},n.getIsSomeColumnsPinned=a=>{var l;const i=n.getState().columnPinning;if(!a){var c,d;return!!((c=i.left)!=null&&c.length||(d=i.right)!=null&&d.length)}return!!((l=i[a])!=null&&l.length)},n.getLeftLeafColumns=Ee(()=>[n.getAllLeafColumns(),n.getState().columnPinning.left],(a,l)=>(l??[]).map(i=>a.find(c=>c.id===i)).filter(Boolean),Re(n.options,"debugColumns")),n.getRightLeafColumns=Ee(()=>[n.getAllLeafColumns(),n.getState().columnPinning.right],(a,l)=>(l??[]).map(i=>a.find(c=>c.id===i)).filter(Boolean),Re(n.options,"debugColumns")),n.getCenterLeafColumns=Ee(()=>[n.getAllLeafColumns(),n.getState().columnPinning.left,n.getState().columnPinning.right],(a,l,i)=>{const c=[...l??[],...i??[]];return a.filter(d=>!c.includes(d.id))},Re(n.options,"debugColumns"))}};function EE(n){return n||(typeof document<"u"?document:null)}const Du={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},dm=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),RE={getDefaultColumnDef:()=>Du,getInitialState:n=>({columnSizing:{},columnSizingInfo:dm(),...n}),getDefaultOptions:n=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:Un("columnSizing",n),onColumnSizingInfoChange:Un("columnSizingInfo",n)}),createColumn:(n,a)=>{n.getSize=()=>{var l,i,c;const d=a.getState().columnSizing[n.id];return Math.min(Math.max((l=n.columnDef.minSize)!=null?l:Du.minSize,(i=d??n.columnDef.size)!=null?i:Du.size),(c=n.columnDef.maxSize)!=null?c:Du.maxSize)},n.getStart=Ee(l=>[l,Ur(a,l),a.getState().columnSizing],(l,i)=>i.slice(0,n.getIndex(l)).reduce((c,d)=>c+d.getSize(),0),Re(a.options,"debugColumns")),n.getAfter=Ee(l=>[l,Ur(a,l),a.getState().columnSizing],(l,i)=>i.slice(n.getIndex(l)+1).reduce((c,d)=>c+d.getSize(),0),Re(a.options,"debugColumns")),n.resetSize=()=>{a.setColumnSizing(l=>{let{[n.id]:i,...c}=l;return c})},n.getCanResize=()=>{var l,i;return((l=n.columnDef.enableResizing)!=null?l:!0)&&((i=a.options.enableColumnResizing)!=null?i:!0)},n.getIsResizing=()=>a.getState().columnSizingInfo.isResizingColumn===n.id},createHeader:(n,a)=>{n.getSize=()=>{let l=0;const i=c=>{if(c.subHeaders.length)c.subHeaders.forEach(i);else{var d;l+=(d=c.column.getSize())!=null?d:0}};return i(n),l},n.getStart=()=>{if(n.index>0){const l=n.headerGroup.headers[n.index-1];return l.getStart()+l.getSize()}return 0},n.getResizeHandler=l=>{const i=a.getColumn(n.column.id),c=i==null?void 0:i.getCanResize();return d=>{if(!i||!c||(d.persist==null||d.persist(),hm(d)&&d.touches&&d.touches.length>1))return;const f=n.getSize(),m=n?n.getLeafHeaders().map(A=>[A.column.id,A.column.getSize()]):[[i.id,i.getSize()]],g=hm(d)?Math.round(d.touches[0].clientX):d.clientX,v={},x=(A,T)=>{typeof T=="number"&&(a.setColumnSizingInfo(O=>{var M,E;const _=a.options.columnResizeDirection==="rtl"?-1:1,D=(T-((M=O==null?void 0:O.startOffset)!=null?M:0))*_,P=Math.max(D/((E=O==null?void 0:O.startSize)!=null?E:0),-.999999);return O.columnSizingStart.forEach(Z=>{let[z,te]=Z;v[z]=Math.round(Math.max(te+te*P,0)*100)/100}),{...O,deltaOffset:D,deltaPercentage:P}}),(a.options.columnResizeMode==="onChange"||A==="end")&&a.setColumnSizing(O=>({...O,...v})))},p=A=>x("move",A),b=A=>{x("end",A),a.setColumnSizingInfo(T=>({...T,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},S=EE(l),j={moveHandler:A=>p(A.clientX),upHandler:A=>{S==null||S.removeEventListener("mousemove",j.moveHandler),S==null||S.removeEventListener("mouseup",j.upHandler),b(A.clientX)}},N={moveHandler:A=>(A.cancelable&&(A.preventDefault(),A.stopPropagation()),p(A.touches[0].clientX),!1),upHandler:A=>{var T;S==null||S.removeEventListener("touchmove",N.moveHandler),S==null||S.removeEventListener("touchend",N.upHandler),A.cancelable&&(A.preventDefault(),A.stopPropagation()),b((T=A.touches[0])==null?void 0:T.clientX)}},R=TE()?{passive:!1}:!1;hm(d)?(S==null||S.addEventListener("touchmove",N.moveHandler,R),S==null||S.addEventListener("touchend",N.upHandler,R)):(S==null||S.addEventListener("mousemove",j.moveHandler,R),S==null||S.addEventListener("mouseup",j.upHandler,R)),a.setColumnSizingInfo(A=>({...A,startOffset:g,startSize:f,deltaOffset:0,deltaPercentage:0,columnSizingStart:m,isResizingColumn:i.id}))}}},createTable:n=>{n.setColumnSizing=a=>n.options.onColumnSizingChange==null?void 0:n.options.onColumnSizingChange(a),n.setColumnSizingInfo=a=>n.options.onColumnSizingInfoChange==null?void 0:n.options.onColumnSizingInfoChange(a),n.resetColumnSizing=a=>{var l;n.setColumnSizing(a?{}:(l=n.initialState.columnSizing)!=null?l:{})},n.resetHeaderSizeInfo=a=>{var l;n.setColumnSizingInfo(a?dm():(l=n.initialState.columnSizingInfo)!=null?l:dm())},n.getTotalSize=()=>{var a,l;return(a=(l=n.getHeaderGroups()[0])==null?void 0:l.headers.reduce((i,c)=>i+c.getSize(),0))!=null?a:0},n.getLeftTotalSize=()=>{var a,l;return(a=(l=n.getLeftHeaderGroups()[0])==null?void 0:l.headers.reduce((i,c)=>i+c.getSize(),0))!=null?a:0},n.getCenterTotalSize=()=>{var a,l;return(a=(l=n.getCenterHeaderGroups()[0])==null?void 0:l.headers.reduce((i,c)=>i+c.getSize(),0))!=null?a:0},n.getRightTotalSize=()=>{var a,l;return(a=(l=n.getRightHeaderGroups()[0])==null?void 0:l.headers.reduce((i,c)=>i+c.getSize(),0))!=null?a:0}}};let ku=null;function TE(){if(typeof ku=="boolean")return ku;let n=!1;try{const a={get passive(){return n=!0,!1}},l=()=>{};window.addEventListener("test",l,a),window.removeEventListener("test",l)}catch{n=!1}return ku=n,ku}function hm(n){return n.type==="touchstart"}const _E={getInitialState:n=>({columnVisibility:{},...n}),getDefaultOptions:n=>({onColumnVisibilityChange:Un("columnVisibility",n)}),createColumn:(n,a)=>{n.toggleVisibility=l=>{n.getCanHide()&&a.setColumnVisibility(i=>({...i,[n.id]:l??!n.getIsVisible()}))},n.getIsVisible=()=>{var l,i;const c=n.columns;return(l=c.length?c.some(d=>d.getIsVisible()):(i=a.getState().columnVisibility)==null?void 0:i[n.id])!=null?l:!0},n.getCanHide=()=>{var l,i;return((l=n.columnDef.enableHiding)!=null?l:!0)&&((i=a.options.enableHiding)!=null?i:!0)},n.getToggleVisibilityHandler=()=>l=>{n.toggleVisibility==null||n.toggleVisibility(l.target.checked)}},createRow:(n,a)=>{n._getAllVisibleCells=Ee(()=>[n.getAllCells(),a.getState().columnVisibility],l=>l.filter(i=>i.column.getIsVisible()),Re(a.options,"debugRows")),n.getVisibleCells=Ee(()=>[n.getLeftVisibleCells(),n.getCenterVisibleCells(),n.getRightVisibleCells()],(l,i,c)=>[...l,...i,...c],Re(a.options,"debugRows"))},createTable:n=>{const a=(l,i)=>Ee(()=>[i(),i().filter(c=>c.getIsVisible()).map(c=>c.id).join("_")],c=>c.filter(d=>d.getIsVisible==null?void 0:d.getIsVisible()),Re(n.options,"debugColumns"));n.getVisibleFlatColumns=a("getVisibleFlatColumns",()=>n.getAllFlatColumns()),n.getVisibleLeafColumns=a("getVisibleLeafColumns",()=>n.getAllLeafColumns()),n.getLeftVisibleLeafColumns=a("getLeftVisibleLeafColumns",()=>n.getLeftLeafColumns()),n.getRightVisibleLeafColumns=a("getRightVisibleLeafColumns",()=>n.getRightLeafColumns()),n.getCenterVisibleLeafColumns=a("getCenterVisibleLeafColumns",()=>n.getCenterLeafColumns()),n.setColumnVisibility=l=>n.options.onColumnVisibilityChange==null?void 0:n.options.onColumnVisibilityChange(l),n.resetColumnVisibility=l=>{var i;n.setColumnVisibility(l?{}:(i=n.initialState.columnVisibility)!=null?i:{})},n.toggleAllColumnsVisible=l=>{var i;l=(i=l)!=null?i:!n.getIsAllColumnsVisible(),n.setColumnVisibility(n.getAllLeafColumns().reduce((c,d)=>({...c,[d.id]:l||!(d.getCanHide!=null&&d.getCanHide())}),{}))},n.getIsAllColumnsVisible=()=>!n.getAllLeafColumns().some(l=>!(l.getIsVisible!=null&&l.getIsVisible())),n.getIsSomeColumnsVisible=()=>n.getAllLeafColumns().some(l=>l.getIsVisible==null?void 0:l.getIsVisible()),n.getToggleAllColumnsVisibilityHandler=()=>l=>{var i;n.toggleAllColumnsVisible((i=l.target)==null?void 0:i.checked)}}};function Ur(n,a){return a?a==="center"?n.getCenterVisibleLeafColumns():a==="left"?n.getLeftVisibleLeafColumns():n.getRightVisibleLeafColumns():n.getVisibleLeafColumns()}const AE={createTable:n=>{n._getGlobalFacetedRowModel=n.options.getFacetedRowModel&&n.options.getFacetedRowModel(n,"__global__"),n.getGlobalFacetedRowModel=()=>n.options.manualFiltering||!n._getGlobalFacetedRowModel?n.getPreFilteredRowModel():n._getGlobalFacetedRowModel(),n._getGlobalFacetedUniqueValues=n.options.getFacetedUniqueValues&&n.options.getFacetedUniqueValues(n,"__global__"),n.getGlobalFacetedUniqueValues=()=>n._getGlobalFacetedUniqueValues?n._getGlobalFacetedUniqueValues():new Map,n._getGlobalFacetedMinMaxValues=n.options.getFacetedMinMaxValues&&n.options.getFacetedMinMaxValues(n,"__global__"),n.getGlobalFacetedMinMaxValues=()=>{if(n._getGlobalFacetedMinMaxValues)return n._getGlobalFacetedMinMaxValues()}}},OE={getInitialState:n=>({globalFilter:void 0,...n}),getDefaultOptions:n=>({onGlobalFilterChange:Un("globalFilter",n),globalFilterFn:"auto",getColumnCanGlobalFilter:a=>{var l;const i=(l=n.getCoreRowModel().flatRows[0])==null||(l=l._getAllCellsByColumnId()[a.id])==null?void 0:l.getValue();return typeof i=="string"||typeof i=="number"}}),createColumn:(n,a)=>{n.getCanGlobalFilter=()=>{var l,i,c,d;return((l=n.columnDef.enableGlobalFilter)!=null?l:!0)&&((i=a.options.enableGlobalFilter)!=null?i:!0)&&((c=a.options.enableFilters)!=null?c:!0)&&((d=a.options.getColumnCanGlobalFilter==null?void 0:a.options.getColumnCanGlobalFilter(n))!=null?d:!0)&&!!n.accessorFn}},createTable:n=>{n.getGlobalAutoFilterFn=()=>aa.includesString,n.getGlobalFilterFn=()=>{var a,l;const{globalFilterFn:i}=n.options;return dd(i)?i:i==="auto"?n.getGlobalAutoFilterFn():(a=(l=n.options.filterFns)==null?void 0:l[i])!=null?a:aa[i]},n.setGlobalFilter=a=>{n.options.onGlobalFilterChange==null||n.options.onGlobalFilterChange(a)},n.resetGlobalFilter=a=>{n.setGlobalFilter(a?void 0:n.initialState.globalFilter)}}},zE={getInitialState:n=>({expanded:{},...n}),getDefaultOptions:n=>({onExpandedChange:Un("expanded",n),paginateExpandedRows:!0}),createTable:n=>{let a=!1,l=!1;n._autoResetExpanded=()=>{var i,c;if(!a){n._queue(()=>{a=!0});return}if((i=(c=n.options.autoResetAll)!=null?c:n.options.autoResetExpanded)!=null?i:!n.options.manualExpanding){if(l)return;l=!0,n._queue(()=>{n.resetExpanded(),l=!1})}},n.setExpanded=i=>n.options.onExpandedChange==null?void 0:n.options.onExpandedChange(i),n.toggleAllRowsExpanded=i=>{i??!n.getIsAllRowsExpanded()?n.setExpanded(!0):n.setExpanded({})},n.resetExpanded=i=>{var c,d;n.setExpanded(i?{}:(c=(d=n.initialState)==null?void 0:d.expanded)!=null?c:{})},n.getCanSomeRowsExpand=()=>n.getPrePaginationRowModel().flatRows.some(i=>i.getCanExpand()),n.getToggleAllRowsExpandedHandler=()=>i=>{i.persist==null||i.persist(),n.toggleAllRowsExpanded()},n.getIsSomeRowsExpanded=()=>{const i=n.getState().expanded;return i===!0||Object.values(i).some(Boolean)},n.getIsAllRowsExpanded=()=>{const i=n.getState().expanded;return typeof i=="boolean"?i===!0:!(!Object.keys(i).length||n.getRowModel().flatRows.some(c=>!c.getIsExpanded()))},n.getExpandedDepth=()=>{let i=0;return(n.getState().expanded===!0?Object.keys(n.getRowModel().rowsById):Object.keys(n.getState().expanded)).forEach(d=>{const f=d.split(".");i=Math.max(i,f.length)}),i},n.getPreExpandedRowModel=()=>n.getSortedRowModel(),n.getExpandedRowModel=()=>(!n._getExpandedRowModel&&n.options.getExpandedRowModel&&(n._getExpandedRowModel=n.options.getExpandedRowModel(n)),n.options.manualExpanding||!n._getExpandedRowModel?n.getPreExpandedRowModel():n._getExpandedRowModel())},createRow:(n,a)=>{n.toggleExpanded=l=>{a.setExpanded(i=>{var c;const d=i===!0?!0:!!(i!=null&&i[n.id]);let f={};if(i===!0?Object.keys(a.getRowModel().rowsById).forEach(m=>{f[m]=!0}):f=i,l=(c=l)!=null?c:!d,!d&&l)return{...f,[n.id]:!0};if(d&&!l){const{[n.id]:m,...g}=f;return g}return i})},n.getIsExpanded=()=>{var l;const i=a.getState().expanded;return!!((l=a.options.getIsRowExpanded==null?void 0:a.options.getIsRowExpanded(n))!=null?l:i===!0||i!=null&&i[n.id])},n.getCanExpand=()=>{var l,i,c;return(l=a.options.getRowCanExpand==null?void 0:a.options.getRowCanExpand(n))!=null?l:((i=a.options.enableExpanding)!=null?i:!0)&&!!((c=n.subRows)!=null&&c.length)},n.getIsAllParentsExpanded=()=>{let l=!0,i=n;for(;l&&i.parentId;)i=a.getRow(i.parentId,!0),l=i.getIsExpanded();return l},n.getToggleExpandedHandler=()=>{const l=n.getCanExpand();return()=>{l&&n.toggleExpanded()}}}},hg=0,fg=10,fm=()=>({pageIndex:hg,pageSize:fg}),DE={getInitialState:n=>({...n,pagination:{...fm(),...n==null?void 0:n.pagination}}),getDefaultOptions:n=>({onPaginationChange:Un("pagination",n)}),createTable:n=>{let a=!1,l=!1;n._autoResetPageIndex=()=>{var i,c;if(!a){n._queue(()=>{a=!0});return}if((i=(c=n.options.autoResetAll)!=null?c:n.options.autoResetPageIndex)!=null?i:!n.options.manualPagination){if(l)return;l=!0,n._queue(()=>{n.resetPageIndex(),l=!1})}},n.setPagination=i=>{const c=d=>tl(i,d);return n.options.onPaginationChange==null?void 0:n.options.onPaginationChange(c)},n.resetPagination=i=>{var c;n.setPagination(i?fm():(c=n.initialState.pagination)!=null?c:fm())},n.setPageIndex=i=>{n.setPagination(c=>{let d=tl(i,c.pageIndex);const f=typeof n.options.pageCount>"u"||n.options.pageCount===-1?Number.MAX_SAFE_INTEGER:n.options.pageCount-1;return d=Math.max(0,Math.min(d,f)),{...c,pageIndex:d}})},n.resetPageIndex=i=>{var c,d;n.setPageIndex(i?hg:(c=(d=n.initialState)==null||(d=d.pagination)==null?void 0:d.pageIndex)!=null?c:hg)},n.resetPageSize=i=>{var c,d;n.setPageSize(i?fg:(c=(d=n.initialState)==null||(d=d.pagination)==null?void 0:d.pageSize)!=null?c:fg)},n.setPageSize=i=>{n.setPagination(c=>{const d=Math.max(1,tl(i,c.pageSize)),f=c.pageSize*c.pageIndex,m=Math.floor(f/d);return{...c,pageIndex:m,pageSize:d}})},n.setPageCount=i=>n.setPagination(c=>{var d;let f=tl(i,(d=n.options.pageCount)!=null?d:-1);return typeof f=="number"&&(f=Math.max(-1,f)),{...c,pageCount:f}}),n.getPageOptions=Ee(()=>[n.getPageCount()],i=>{let c=[];return i&&i>0&&(c=[...new Array(i)].fill(null).map((d,f)=>f)),c},Re(n.options,"debugTable")),n.getCanPreviousPage=()=>n.getState().pagination.pageIndex>0,n.getCanNextPage=()=>{const{pageIndex:i}=n.getState().pagination,c=n.getPageCount();return c===-1?!0:c===0?!1:i<c-1},n.previousPage=()=>n.setPageIndex(i=>i-1),n.nextPage=()=>n.setPageIndex(i=>i+1),n.firstPage=()=>n.setPageIndex(0),n.lastPage=()=>n.setPageIndex(n.getPageCount()-1),n.getPrePaginationRowModel=()=>n.getExpandedRowModel(),n.getPaginationRowModel=()=>(!n._getPaginationRowModel&&n.options.getPaginationRowModel&&(n._getPaginationRowModel=n.options.getPaginationRowModel(n)),n.options.manualPagination||!n._getPaginationRowModel?n.getPrePaginationRowModel():n._getPaginationRowModel()),n.getPageCount=()=>{var i;return(i=n.options.pageCount)!=null?i:Math.ceil(n.getRowCount()/n.getState().pagination.pageSize)},n.getRowCount=()=>{var i;return(i=n.options.rowCount)!=null?i:n.getPrePaginationRowModel().rows.length}}},mm=()=>({top:[],bottom:[]}),kE={getInitialState:n=>({rowPinning:mm(),...n}),getDefaultOptions:n=>({onRowPinningChange:Un("rowPinning",n)}),createRow:(n,a)=>{n.pin=(l,i,c)=>{const d=i?n.getLeafRows().map(g=>{let{id:v}=g;return v}):[],f=c?n.getParentRows().map(g=>{let{id:v}=g;return v}):[],m=new Set([...f,n.id,...d]);a.setRowPinning(g=>{var v,x;if(l==="bottom"){var p,b;return{top:((p=g==null?void 0:g.top)!=null?p:[]).filter(N=>!(m!=null&&m.has(N))),bottom:[...((b=g==null?void 0:g.bottom)!=null?b:[]).filter(N=>!(m!=null&&m.has(N))),...Array.from(m)]}}if(l==="top"){var S,j;return{top:[...((S=g==null?void 0:g.top)!=null?S:[]).filter(N=>!(m!=null&&m.has(N))),...Array.from(m)],bottom:((j=g==null?void 0:g.bottom)!=null?j:[]).filter(N=>!(m!=null&&m.has(N)))}}return{top:((v=g==null?void 0:g.top)!=null?v:[]).filter(N=>!(m!=null&&m.has(N))),bottom:((x=g==null?void 0:g.bottom)!=null?x:[]).filter(N=>!(m!=null&&m.has(N)))}})},n.getCanPin=()=>{var l;const{enableRowPinning:i,enablePinning:c}=a.options;return typeof i=="function"?i(n):(l=i??c)!=null?l:!0},n.getIsPinned=()=>{const l=[n.id],{top:i,bottom:c}=a.getState().rowPinning,d=l.some(m=>i==null?void 0:i.includes(m)),f=l.some(m=>c==null?void 0:c.includes(m));return d?"top":f?"bottom":!1},n.getPinnedIndex=()=>{var l,i;const c=n.getIsPinned();if(!c)return-1;const d=(l=c==="top"?a.getTopRows():a.getBottomRows())==null?void 0:l.map(f=>{let{id:m}=f;return m});return(i=d==null?void 0:d.indexOf(n.id))!=null?i:-1}},createTable:n=>{n.setRowPinning=a=>n.options.onRowPinningChange==null?void 0:n.options.onRowPinningChange(a),n.resetRowPinning=a=>{var l,i;return n.setRowPinning(a?mm():(l=(i=n.initialState)==null?void 0:i.rowPinning)!=null?l:mm())},n.getIsSomeRowsPinned=a=>{var l;const i=n.getState().rowPinning;if(!a){var c,d;return!!((c=i.top)!=null&&c.length||(d=i.bottom)!=null&&d.length)}return!!((l=i[a])!=null&&l.length)},n._getPinnedRows=(a,l,i)=>{var c;return((c=n.options.keepPinnedRows)==null||c?(l??[]).map(f=>{const m=n.getRow(f,!0);return m.getIsAllParentsExpanded()?m:null}):(l??[]).map(f=>a.find(m=>m.id===f))).filter(Boolean).map(f=>({...f,position:i}))},n.getTopRows=Ee(()=>[n.getRowModel().rows,n.getState().rowPinning.top],(a,l)=>n._getPinnedRows(a,l,"top"),Re(n.options,"debugRows")),n.getBottomRows=Ee(()=>[n.getRowModel().rows,n.getState().rowPinning.bottom],(a,l)=>n._getPinnedRows(a,l,"bottom"),Re(n.options,"debugRows")),n.getCenterRows=Ee(()=>[n.getRowModel().rows,n.getState().rowPinning.top,n.getState().rowPinning.bottom],(a,l,i)=>{const c=new Set([...l??[],...i??[]]);return a.filter(d=>!c.has(d.id))},Re(n.options,"debugRows"))}},LE={getInitialState:n=>({rowSelection:{},...n}),getDefaultOptions:n=>({onRowSelectionChange:Un("rowSelection",n),enableRowSelection:!0,enableMultiRowSelection:!0,enableSubRowSelection:!0}),createTable:n=>{n.setRowSelection=a=>n.options.onRowSelectionChange==null?void 0:n.options.onRowSelectionChange(a),n.resetRowSelection=a=>{var l;return n.setRowSelection(a?{}:(l=n.initialState.rowSelection)!=null?l:{})},n.toggleAllRowsSelected=a=>{n.setRowSelection(l=>{a=typeof a<"u"?a:!n.getIsAllRowsSelected();const i={...l},c=n.getPreGroupedRowModel().flatRows;return a?c.forEach(d=>{d.getCanSelect()&&(i[d.id]=!0)}):c.forEach(d=>{delete i[d.id]}),i})},n.toggleAllPageRowsSelected=a=>n.setRowSelection(l=>{const i=typeof a<"u"?a:!n.getIsAllPageRowsSelected(),c={...l};return n.getRowModel().rows.forEach(d=>{mg(c,d.id,i,!0,n)}),c}),n.getPreSelectedRowModel=()=>n.getCoreRowModel(),n.getSelectedRowModel=Ee(()=>[n.getState().rowSelection,n.getCoreRowModel()],(a,l)=>Object.keys(a).length?gm(n,l):{rows:[],flatRows:[],rowsById:{}},Re(n.options,"debugTable")),n.getFilteredSelectedRowModel=Ee(()=>[n.getState().rowSelection,n.getFilteredRowModel()],(a,l)=>Object.keys(a).length?gm(n,l):{rows:[],flatRows:[],rowsById:{}},Re(n.options,"debugTable")),n.getGroupedSelectedRowModel=Ee(()=>[n.getState().rowSelection,n.getSortedRowModel()],(a,l)=>Object.keys(a).length?gm(n,l):{rows:[],flatRows:[],rowsById:{}},Re(n.options,"debugTable")),n.getIsAllRowsSelected=()=>{const a=n.getFilteredRowModel().flatRows,{rowSelection:l}=n.getState();let i=!!(a.length&&Object.keys(l).length);return i&&a.some(c=>c.getCanSelect()&&!l[c.id])&&(i=!1),i},n.getIsAllPageRowsSelected=()=>{const a=n.getPaginationRowModel().flatRows.filter(c=>c.getCanSelect()),{rowSelection:l}=n.getState();let i=!!a.length;return i&&a.some(c=>!l[c.id])&&(i=!1),i},n.getIsSomeRowsSelected=()=>{var a;const l=Object.keys((a=n.getState().rowSelection)!=null?a:{}).length;return l>0&&l<n.getFilteredRowModel().flatRows.length},n.getIsSomePageRowsSelected=()=>{const a=n.getPaginationRowModel().flatRows;return n.getIsAllPageRowsSelected()?!1:a.filter(l=>l.getCanSelect()).some(l=>l.getIsSelected()||l.getIsSomeSelected())},n.getToggleAllRowsSelectedHandler=()=>a=>{n.toggleAllRowsSelected(a.target.checked)},n.getToggleAllPageRowsSelectedHandler=()=>a=>{n.toggleAllPageRowsSelected(a.target.checked)}},createRow:(n,a)=>{n.toggleSelected=(l,i)=>{const c=n.getIsSelected();a.setRowSelection(d=>{var f;if(l=typeof l<"u"?l:!c,n.getCanSelect()&&c===l)return d;const m={...d};return mg(m,n.id,l,(f=i==null?void 0:i.selectChildren)!=null?f:!0,a),m})},n.getIsSelected=()=>{const{rowSelection:l}=a.getState();return Lg(n,l)},n.getIsSomeSelected=()=>{const{rowSelection:l}=a.getState();return gg(n,l)==="some"},n.getIsAllSubRowsSelected=()=>{const{rowSelection:l}=a.getState();return gg(n,l)==="all"},n.getCanSelect=()=>{var l;return typeof a.options.enableRowSelection=="function"?a.options.enableRowSelection(n):(l=a.options.enableRowSelection)!=null?l:!0},n.getCanSelectSubRows=()=>{var l;return typeof a.options.enableSubRowSelection=="function"?a.options.enableSubRowSelection(n):(l=a.options.enableSubRowSelection)!=null?l:!0},n.getCanMultiSelect=()=>{var l;return typeof a.options.enableMultiRowSelection=="function"?a.options.enableMultiRowSelection(n):(l=a.options.enableMultiRowSelection)!=null?l:!0},n.getToggleSelectedHandler=()=>{const l=n.getCanSelect();return i=>{var c;l&&n.toggleSelected((c=i.target)==null?void 0:c.checked)}}}},mg=(n,a,l,i,c)=>{var d;const f=c.getRow(a,!0);l?(f.getCanMultiSelect()||Object.keys(n).forEach(m=>delete n[m]),f.getCanSelect()&&(n[a]=!0)):delete n[a],i&&(d=f.subRows)!=null&&d.length&&f.getCanSelectSubRows()&&f.subRows.forEach(m=>mg(n,m.id,l,i,c))};function gm(n,a){const l=n.getState().rowSelection,i=[],c={},d=function(f,m){return f.map(g=>{var v;const x=Lg(g,l);if(x&&(i.push(g),c[g.id]=g),(v=g.subRows)!=null&&v.length&&(g={...g,subRows:d(g.subRows)}),x)return g}).filter(Boolean)};return{rows:d(a.rows),flatRows:i,rowsById:c}}function Lg(n,a){var l;return(l=a[n.id])!=null?l:!1}function gg(n,a,l){var i;if(!((i=n.subRows)!=null&&i.length))return!1;let c=!0,d=!1;return n.subRows.forEach(f=>{if(!(d&&!c)&&(f.getCanSelect()&&(Lg(f,a)?d=!0:c=!1),f.subRows&&f.subRows.length)){const m=gg(f,a);m==="all"?d=!0:(m==="some"&&(d=!0),c=!1)}}),c?"all":d?"some":!1}const pg=/([0-9]+)/gm,$E=(n,a,l)=>ab(nl(n.getValue(l)).toLowerCase(),nl(a.getValue(l)).toLowerCase()),HE=(n,a,l)=>ab(nl(n.getValue(l)),nl(a.getValue(l))),UE=(n,a,l)=>$g(nl(n.getValue(l)).toLowerCase(),nl(a.getValue(l)).toLowerCase()),BE=(n,a,l)=>$g(nl(n.getValue(l)),nl(a.getValue(l))),FE=(n,a,l)=>{const i=n.getValue(l),c=a.getValue(l);return i>c?1:i<c?-1:0},VE=(n,a,l)=>$g(n.getValue(l),a.getValue(l));function $g(n,a){return n===a?0:n>a?1:-1}function nl(n){return typeof n=="number"?isNaN(n)||n===1/0||n===-1/0?"":String(n):typeof n=="string"?n:""}function ab(n,a){const l=n.split(pg).filter(Boolean),i=a.split(pg).filter(Boolean);for(;l.length&&i.length;){const c=l.shift(),d=i.shift(),f=parseInt(c,10),m=parseInt(d,10),g=[f,m].sort();if(isNaN(g[0])){if(c>d)return 1;if(d>c)return-1;continue}if(isNaN(g[1]))return isNaN(f)?-1:1;if(f>m)return 1;if(m>f)return-1}return l.length-i.length}const Rr={alphanumeric:$E,alphanumericCaseSensitive:HE,text:UE,textCaseSensitive:BE,datetime:FE,basic:VE},GE={getInitialState:n=>({sorting:[],...n}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:n=>({onSortingChange:Un("sorting",n),isMultiSortEvent:a=>a.shiftKey}),createColumn:(n,a)=>{n.getAutoSortingFn=()=>{const l=a.getFilteredRowModel().flatRows.slice(10);let i=!1;for(const c of l){const d=c==null?void 0:c.getValue(n.id);if(Object.prototype.toString.call(d)==="[object Date]")return Rr.datetime;if(typeof d=="string"&&(i=!0,d.split(pg).length>1))return Rr.alphanumeric}return i?Rr.text:Rr.basic},n.getAutoSortDir=()=>{const l=a.getFilteredRowModel().flatRows[0];return typeof(l==null?void 0:l.getValue(n.id))=="string"?"asc":"desc"},n.getSortingFn=()=>{var l,i;if(!n)throw new Error;return dd(n.columnDef.sortingFn)?n.columnDef.sortingFn:n.columnDef.sortingFn==="auto"?n.getAutoSortingFn():(l=(i=a.options.sortingFns)==null?void 0:i[n.columnDef.sortingFn])!=null?l:Rr[n.columnDef.sortingFn]},n.toggleSorting=(l,i)=>{const c=n.getNextSortingOrder(),d=typeof l<"u"&&l!==null;a.setSorting(f=>{const m=f==null?void 0:f.find(S=>S.id===n.id),g=f==null?void 0:f.findIndex(S=>S.id===n.id);let v=[],x,p=d?l:c==="desc";if(f!=null&&f.length&&n.getCanMultiSort()&&i?m?x="toggle":x="add":f!=null&&f.length&&g!==f.length-1?x="replace":m?x="toggle":x="replace",x==="toggle"&&(d||c||(x="remove")),x==="add"){var b;v=[...f,{id:n.id,desc:p}],v.splice(0,v.length-((b=a.options.maxMultiSortColCount)!=null?b:Number.MAX_SAFE_INTEGER))}else x==="toggle"?v=f.map(S=>S.id===n.id?{...S,desc:p}:S):x==="remove"?v=f.filter(S=>S.id!==n.id):v=[{id:n.id,desc:p}];return v})},n.getFirstSortDir=()=>{var l,i;return((l=(i=n.columnDef.sortDescFirst)!=null?i:a.options.sortDescFirst)!=null?l:n.getAutoSortDir()==="desc")?"desc":"asc"},n.getNextSortingOrder=l=>{var i,c;const d=n.getFirstSortDir(),f=n.getIsSorted();return f?f!==d&&((i=a.options.enableSortingRemoval)==null||i)&&(!(l&&(c=a.options.enableMultiRemove)!=null)||c)?!1:f==="desc"?"asc":"desc":d},n.getCanSort=()=>{var l,i;return((l=n.columnDef.enableSorting)!=null?l:!0)&&((i=a.options.enableSorting)!=null?i:!0)&&!!n.accessorFn},n.getCanMultiSort=()=>{var l,i;return(l=(i=n.columnDef.enableMultiSort)!=null?i:a.options.enableMultiSort)!=null?l:!!n.accessorFn},n.getIsSorted=()=>{var l;const i=(l=a.getState().sorting)==null?void 0:l.find(c=>c.id===n.id);return i?i.desc?"desc":"asc":!1},n.getSortIndex=()=>{var l,i;return(l=(i=a.getState().sorting)==null?void 0:i.findIndex(c=>c.id===n.id))!=null?l:-1},n.clearSorting=()=>{a.setSorting(l=>l!=null&&l.length?l.filter(i=>i.id!==n.id):[])},n.getToggleSortingHandler=()=>{const l=n.getCanSort();return i=>{l&&(i.persist==null||i.persist(),n.toggleSorting==null||n.toggleSorting(void 0,n.getCanMultiSort()?a.options.isMultiSortEvent==null?void 0:a.options.isMultiSortEvent(i):!1))}}},createTable:n=>{n.setSorting=a=>n.options.onSortingChange==null?void 0:n.options.onSortingChange(a),n.resetSorting=a=>{var l,i;n.setSorting(a?[]:(l=(i=n.initialState)==null?void 0:i.sorting)!=null?l:[])},n.getPreSortedRowModel=()=>n.getGroupedRowModel(),n.getSortedRowModel=()=>(!n._getSortedRowModel&&n.options.getSortedRowModel&&(n._getSortedRowModel=n.options.getSortedRowModel(n)),n.options.manualSorting||!n._getSortedRowModel?n.getPreSortedRowModel():n._getSortedRowModel())}},qE=[uE,_E,CE,ME,hE,fE,AE,OE,GE,wE,zE,DE,kE,LE,RE];function IE(n){var a,l;const i=[...qE,...(a=n._features)!=null?a:[]];let c={_features:i};const d=c._features.reduce((b,S)=>Object.assign(b,S.getDefaultOptions==null?void 0:S.getDefaultOptions(c)),{}),f=b=>c.options.mergeOptions?c.options.mergeOptions(d,b):{...d,...b};let g={...{},...(l=n.initialState)!=null?l:{}};c._features.forEach(b=>{var S;g=(S=b.getInitialState==null?void 0:b.getInitialState(g))!=null?S:g});const v=[];let x=!1;const p={_features:i,options:{...d,...n},initialState:g,_queue:b=>{v.push(b),x||(x=!0,Promise.resolve().then(()=>{for(;v.length;)v.shift()();x=!1}).catch(S=>setTimeout(()=>{throw S})))},reset:()=>{c.setState(c.initialState)},setOptions:b=>{const S=tl(b,c.options);c.options=f(S)},getState:()=>c.options.state,setState:b=>{c.options.onStateChange==null||c.options.onStateChange(b)},_getRowId:(b,S,j)=>{var N;return(N=c.options.getRowId==null?void 0:c.options.getRowId(b,S,j))!=null?N:`${j?[j.id,S].join("."):S}`},getCoreRowModel:()=>(c._getCoreRowModel||(c._getCoreRowModel=c.options.getCoreRowModel(c)),c._getCoreRowModel()),getRowModel:()=>c.getPaginationRowModel(),getRow:(b,S)=>{let j=(S?c.getPrePaginationRowModel():c.getRowModel()).rowsById[b];if(!j&&(j=c.getCoreRowModel().rowsById[b],!j))throw new Error;return j},_getDefaultColumnDef:Ee(()=>[c.options.defaultColumn],b=>{var S;return b=(S=b)!=null?S:{},{header:j=>{const N=j.header.column.columnDef;return N.accessorKey?N.accessorKey:N.accessorFn?N.id:null},cell:j=>{var N,R;return(N=(R=j.renderValue())==null||R.toString==null?void 0:R.toString())!=null?N:null},...c._features.reduce((j,N)=>Object.assign(j,N.getDefaultColumnDef==null?void 0:N.getDefaultColumnDef()),{}),...b}},Re(n,"debugColumns")),_getColumnDefs:()=>c.options.columns,getAllColumns:Ee(()=>[c._getColumnDefs()],b=>{const S=function(j,N,R){return R===void 0&&(R=0),j.map(A=>{const T=cE(c,A,R,N),O=A;return T.columns=O.columns?S(O.columns,T,R+1):[],T})};return S(b)},Re(n,"debugColumns")),getAllFlatColumns:Ee(()=>[c.getAllColumns()],b=>b.flatMap(S=>S.getFlatColumns()),Re(n,"debugColumns")),_getAllFlatColumnsById:Ee(()=>[c.getAllFlatColumns()],b=>b.reduce((S,j)=>(S[j.id]=j,S),{}),Re(n,"debugColumns")),getAllLeafColumns:Ee(()=>[c.getAllColumns(),c._getOrderColumnsFn()],(b,S)=>{let j=b.flatMap(N=>N.getLeafColumns());return S(j)},Re(n,"debugColumns")),getColumn:b=>c._getAllFlatColumnsById()[b]};Object.assign(c,p);for(let b=0;b<c._features.length;b++){const S=c._features[b];S==null||S.createTable==null||S.createTable(c)}return c}function lb(){return n=>Ee(()=>[n.options.data],a=>{const l={rows:[],flatRows:[],rowsById:{}},i=function(c,d,f){d===void 0&&(d=0);const m=[];for(let v=0;v<c.length;v++){const x=dE(n,n._getRowId(c[v],v,f),c[v],v,d,void 0,f==null?void 0:f.id);if(l.flatRows.push(x),l.rowsById[x.id]=x,m.push(x),n.options.getSubRows){var g;x.originalSubRows=n.options.getSubRows(c[v],v),(g=x.originalSubRows)!=null&&g.length&&(x.subRows=i(x.originalSubRows,d+1,x))}}return m};return l.rows=i(a),l},Re(n.options,"debugTable","getRowModel",()=>n._autoResetPageIndex()))}function ib(){return n=>Ee(()=>[n.getState().expanded,n.getPreExpandedRowModel(),n.options.paginateExpandedRows],(a,l,i)=>!l.rows.length||a!==!0&&!Object.keys(a??{}).length||!i?l:PE(l),Re(n.options,"debugTable"))}function PE(n){const a=[],l=i=>{var c;a.push(i),(c=i.subRows)!=null&&c.length&&i.getIsExpanded()&&i.subRows.forEach(l)};return n.rows.forEach(l),{rows:a,flatRows:n.flatRows,rowsById:n.rowsById}}function QE(){return n=>Ee(()=>[n.getState().sorting,n.getPreSortedRowModel()],(a,l)=>{if(!l.rows.length||!(a!=null&&a.length))return l;const i=n.getState().sorting,c=[],d=i.filter(g=>{var v;return(v=n.getColumn(g.id))==null?void 0:v.getCanSort()}),f={};d.forEach(g=>{const v=n.getColumn(g.id);v&&(f[g.id]={sortUndefined:v.columnDef.sortUndefined,invertSorting:v.columnDef.invertSorting,sortingFn:v.getSortingFn()})});const m=g=>{const v=g.map(x=>({...x}));return v.sort((x,p)=>{for(let S=0;S<d.length;S+=1){var b;const j=d[S],N=f[j.id],R=N.sortUndefined,A=(b=j==null?void 0:j.desc)!=null?b:!1;let T=0;if(R){const O=x.getValue(j.id),M=p.getValue(j.id),E=O===void 0,_=M===void 0;if(E||_){if(R==="first")return E?-1:1;if(R==="last")return E?1:-1;T=E&&_?0:E?R:-R}}if(T===0&&(T=N.sortingFn(x,p,j.id)),T!==0)return A&&(T*=-1),N.invertSorting&&(T*=-1),T}return x.index-p.index}),v.forEach(x=>{var p;c.push(x),(p=x.subRows)!=null&&p.length&&(x.subRows=m(x.subRows))}),v};return{rows:m(l.rows),flatRows:c,rowsById:l.rowsById}},Re(n.options,"debugTable","getSortedRowModel",()=>n._autoResetPageIndex()))}/**
|
|
290
315
|
* react-table
|
|
291
316
|
*
|
|
292
317
|
* Copyright (c) TanStack
|
|
@@ -295,4 +320,4 @@ Error generating stack: `+i.message+`
|
|
|
295
320
|
* LICENSE.md file in the root directory of this source tree.
|
|
296
321
|
*
|
|
297
322
|
* @license MIT
|
|
298
|
-
*/function Lu(n,l){return n?JE(n)?M.createElement(n,l):n:null}function JE(n){return WE(n)||typeof n=="function"||eT(n)}function WE(n){return typeof n=="function"&&(()=>{const l=Object.getPrototypeOf(n);return l.prototype&&l.prototype.isReactComponent})()}function eT(n){return typeof n=="object"&&typeof n.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(n.$$typeof.description)}function RS(n){const l={state:{},onStateChange:()=>{},renderFallbackValue:null,...n},[a]=M.useState(()=>({current:XE(l)})),[o,c]=M.useState(()=>a.current.initialState);return a.current.setOptions(d=>({...d,...n,state:{...o,...n.state},onStateChange:h=>{c(h),n.onStateChange==null||n.onStateChange(h)}})),a.current}function $u({value:n,onChange:l,label:a="Search mutations",placeholder:o="Search gene, change or locus",shortcut:c=!0,delay:d=250}){const[h,m]=M.useState(n),g=M.useRef(null),x=M.useRef(l);x.current=l,M.useEffect(()=>m(n),[n]),M.useEffect(()=>{if(h===n)return;const y=window.setTimeout(()=>x.current(h),d);return()=>window.clearTimeout(y)},[h,n,d]),M.useEffect(()=>{if(!c)return;const y=S=>{var j,b,N;S.key!=="/"||S.metaKey||S.ctrlKey||S.altKey||(b=(j=S.target)==null?void 0:j.closest)!=null&&b.call(j,"input, textarea, select, [contenteditable]")||(S.preventDefault(),(N=g.current)==null||N.focus())};return document.addEventListener("keydown",y),()=>document.removeEventListener("keydown",y)},[c]);const v=()=>{m(""),l("")};return r.jsxs("div",{className:"tsearch",children:[r.jsx(_u,{size:15,"aria-hidden":!0}),r.jsx("input",{ref:g,type:"search","aria-label":a,placeholder:o,value:h,onChange:y=>{m(y.target.value),d===0&&l(y.target.value)},onKeyDown:y=>{y.key==="Escape"&&v(),y.key==="Enter"&&l(h)}}),h?r.jsx("button",{type:"button",className:"search-clear","aria-label":"Clear the search",onClick:v,children:r.jsx(Bu,{size:14,"aria-hidden":!0})}):c?r.jsx("kbd",{className:"kbd","aria-hidden":!0,children:"/"}):null]})}const Wh=n=>n.toLocaleString("en-US");function Ku({shown:n,total:l,noun:a,loaded:o=!1,note:c}){const h=n>=l?`${Wh(l)} ${l===1?a[0]:a[1]}`:`${Wh(n)} of ${Wh(l)} ${a[1]}${o?" loaded":""}`;return r.jsxs("div",{className:"vt-foot",role:"status",children:[c?r.jsx("span",{className:"vt-foot-note",children:c}):null,r.jsx("span",{className:"vt-foot-count",children:h})]})}function tT(n){return typeof n=="object"?n.key:n}function nT(n,l){const a=n.length;return new Proxy(n,{get(o,c,d){if(typeof c=="string"){const h=c.charCodeAt(0);if(h>=48&&h<=57){const m=+c;if(Number.isInteger(m)&&m>=0&&m<a){let g=o[m];if(typeof g!="object"){const x=l[m*2];g=o[m]={index:m,key:g,start:x,size:l[m*2+1],end:x+l[m*2+1],lane:0}}return g}}if(c==="length")return a}return Reflect.get(o,c,d)}})}function Li(n,l,a){let o=a.initialDeps??[],c,d=!0;function h(){const m=n();return(m.length!==o.length||m.some((x,v)=>o[v]!==x))&&(o=m,c=l(...m),a!=null&&a.onChange&&!(d&&a.skipInitialOnChange)&&a.onChange(c),d=!1),c}return h.updateDeps=m=>{o=m},h}function Lx(n,l){if(n===void 0)throw new Error("Unexpected undefined");return n}const $x=(n,l)=>Math.abs(n-l)<1.01,sT=(n,l,a)=>{let o;return Object.assign(function(...c){n.clearTimeout(o),o=n.setTimeout(()=>l.apply(this,c),a)},{cancel:()=>{n.clearTimeout(o)}})};let pr;const em=()=>{if(pr!==void 0)return pr;if(typeof navigator>"u")return pr=!1;if(/iP(hone|od|ad)/.test(navigator.userAgent))return pr=!0;const n=navigator.maxTouchPoints;return pr=navigator.platform==="MacIntel"&&n!==void 0&&n>0},kx=n=>{const{offsetWidth:l,offsetHeight:a}=n;return{width:l,height:a}},lT=n=>n,aT=n=>{const l=Math.max(n.startIndex-n.overscan,0),o=Math.min(n.endIndex+n.overscan,n.count-1)-l+1,c=new Array(o);for(let d=0;d<o;d++)c[d]=l+d;return c},iT=(n,l)=>{const a=n.scrollElement;if(!a)return;const o=n.targetWindow;if(!o)return;const c=h=>{const{width:m,height:g}=h;l({width:Math.round(m),height:Math.round(g)})};if(c(kx(a)),!o.ResizeObserver)return()=>{};const d=new o.ResizeObserver(h=>{const m=()=>{const g=h[0];if(g!=null&&g.borderBoxSize){const x=g.borderBoxSize[0];if(x){c({width:x.inlineSize,height:x.blockSize});return}}c(kx(a))};n.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(m):m()});return d.observe(a,{box:"border-box"}),()=>{d.unobserve(a)}},ku={passive:!0},oT=typeof window>"u"?!0:"onscrollend"in window,rT=(n,l,a)=>{const o=n.scrollElement;if(!o)return;const c=n.targetWindow;if(!c)return;const d=n.options.useScrollendEvent&&oT;let h=0;const m=d?null:sT(c,()=>l(a(o),!1),n.options.isScrollingResetDelay),g=y=>()=>{h=a(o),m==null||m(),l(h,y)},x=g(!0),v=g(!1);return o.addEventListener("scroll",x,ku),d&&o.addEventListener("scrollend",v,ku),()=>{o.removeEventListener("scroll",x),d&&o.removeEventListener("scrollend",v),m==null||m.cancel()}},cT=(n,l)=>rT(n,l,a=>{const{horizontal:o,isRtl:c}=n.options;return o?a.scrollLeft*(c&&-1||1):a.scrollTop}),uT=(n,l,a)=>{if(a.options.useCachedMeasurements){const o=a.indexFromElement(n),c=a.options.getItemKey(o);return a.itemSizeCache.get(c)??a.options.estimateSize(o)}if(l!=null&&l.borderBoxSize){const o=l.borderBoxSize[0];if(o)return Math.round(o[a.options.horizontal?"inlineSize":"blockSize"])}if(!l){const o=a.indexFromElement(n),c=a.options.getItemKey(o),d=a.itemSizeCache.get(c);if(d!==void 0)return d}return n[a.options.horizontal?"offsetWidth":"offsetHeight"]},fT=(n,{adjustments:l=0,behavior:a},o)=>{var c,d;(d=(c=o.scrollElement)==null?void 0:c.scrollTo)==null||d.call(c,{[o.options.horizontal?"left":"top"]:n+l,behavior:a})},dT=fT;function hT(n,l,a,o){if(l===0)return!1;const c=o(0),d=new Set;let h=0;for(;h<n;){const g=a(h);if(g===c)break;d.add(g),h++}const m=n-h;if(m===0||m>=l)return!1;for(let g=0;g<m;g++)if(o(g)!==a(h+g))return!1;for(let g=m;g<l;g++)if(d.has(o(g)))return!1;return!0}class mT{constructor(l){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this._singleLaneMeasurements=null,this.itemSizeCache=new Map,this.itemSizeCacheVersion=0,this.laneAssignments=new Map,this.pendingMin=null,this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.pendingScrollAnchor=null,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._intendedScrollOffset=null,this._clampedAdjustment=null,this.elementsCache=new Map,this.now=()=>{var a,o,c;return((c=(o=(a=this.targetWindow)==null?void 0:a.performance)==null?void 0:o.now)==null?void 0:c.call(o))??Date.now()},this.observer=(()=>{let a=null;const o=()=>a||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:a=new this.targetWindow.ResizeObserver(c=>{c.forEach(d=>{const h=()=>{const m=d.target,g=this.indexFromElement(m);if(!m.isConnected){this.observer.unobserve(m);for(const[x,v]of this.elementsCache)if(v===m){this.elementsCache.delete(x);break}return}this.isIndexInRange(g)&&this.shouldMeasureDuringScroll(g)&&this.resizeItem(g,this.options.measureElement(m,d,this))};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(h):h()})}));return{disconnect:()=>{var c;(c=o())==null||c.disconnect(),a=null},observe:c=>{var d;return(d=o())==null?void 0:d.observe(c,{box:"border-box"})},unobserve:c=>{var d;return(d=o())==null?void 0:d.unobserve(c)}}})(),this.range=null,this.setOptions=a=>{var o;const c={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:lT,rangeExtractor:aT,onChange:()=>{},measureElement:uT,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,anchorTo:"start",followOnAppend:!1,scrollEndThreshold:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,laneAssignmentMode:"estimate",useCachedMeasurements:!1};for(const y in a){const S=a[y];S!==void 0&&(c[y]=S)}const d=this.options;let h=null,m=null,g=!1;if(d!==void 0&&d.enabled&&c.enabled&&c.anchorTo==="end"&&this.scrollElement!==null){const y=d.count,S=c.count,j=this.getMeasurements(),b=((o=this._singleLaneMeasurements)==null?void 0:o.items)??j,N=C=>tT(b[C]),T=y>0?N(0):null,O=y>0?N(y-1):null;if(S!==y||y>0&&S>0&&(c.getItemKey(0)!==T||c.getItemKey(S-1)!==O)){g=!0;const C=y>0?this.getVirtualItemForOffset(this.getScrollOffset())??j[0]:null;C&&(h=[C.key,this.getScrollOffset()-C.start]);const E=c.followOnAppend===!0?"auto":c.followOnAppend||null;E&&S>0&&this.isAtEnd(d.scrollEndThreshold)&&(y===0||c.getItemKey(S-1)!==O)&&(S>y||hT(y,S,N,c.getItemKey))&&(m=E)}}this.options=c,g&&(this.pendingMin=0,this.itemSizeCacheVersion++);let x=!1,v=0;if(h&&this.scrollOffset!==null){const[y,S]=h,j=this.getMeasurements(),{count:b,getItemKey:N}=this.options;let T=0;for(;T<b&&N(T)!==y;)T++;if(T<b){const O=j[T];if(O){const _=Math.max(0,O.start+S);!m&&_!==this.scrollOffset&&(v=_-this.scrollOffset,this.scrollOffset=_,x=!0)}}}(x||m)&&(this.pendingScrollAnchor=[x?h[0]:null,x?h[1]:0,m,v])},this.notify=a=>{var o,c;(c=(o=this.options).onChange)==null||c.call(o,this,a)},this.maybeNotify=Li(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),a=>{this.notify(a)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(a=>a()),this.unsubs=[],this.observer.disconnect(),this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,this.isScrolling=!1,this.scrollDirection=null,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this._clampedAdjustment=null,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var a,o;const c=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==c){if(this.cleanup(),!c){this.maybeNotify();return}if(this.scrollElement=c,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((a=this.scrollElement)==null?void 0:a.window)??null,this.elementsCache.forEach(h=>{this.observer.observe(h)}),this.unsubs.push(this.options.observeElementRect(this,h=>{this.scrollRect=h,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(h,m)=>{if(m&&this._intendedScrollOffset===null&&h===this.scrollOffset)return;this._intendedScrollOffset!==null&&Math.abs(h-this._intendedScrollOffset)<1.5&&(h=this._intendedScrollOffset),this._intendedScrollOffset=null,this._clampedAdjustment!==null&&Math.abs(h-this._clampedAdjustment.maxAtWrite)>=1.5&&(this._clampedAdjustment=null),this.scrollAdjustments=0;const g=this.getScrollOffset();this.scrollDirection=m?g===h?this.scrollDirection:g<h?"forward":"backward":null,this.scrollOffset=h,this.isScrolling=m,this._flushIosDeferredIfReady(),this.scrollState&&this.scheduleScrollReconcile(),this.maybeNotify()})),"addEventListener"in this.scrollElement){const h=this.scrollElement,m=()=>{this._iosTouching=!0,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)},g=()=>{this._iosTouching=!1,!(!em()||this.targetWindow==null)&&(this._iosJustTouchEnded=!0,this._iosTouchEndTimerId=this.targetWindow.setTimeout(()=>{this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._flushIosDeferredIfReady()},150))};h.addEventListener("touchstart",m,ku),h.addEventListener("touchend",g,ku),this.unsubs.push(()=>{h.removeEventListener("touchstart",m),h.removeEventListener("touchend",g),this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)})}this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}const d=this.pendingScrollAnchor;if(this.pendingScrollAnchor=null,d&&this.scrollElement&&this.options.enabled){const[h,m,g,x]=d;h!==null&&!g&&(em()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?x!==0&&(this._iosDeferredAdjustment+=x):((o=this.scrollState)==null?void 0:o.behavior)==="smooth"&&!$x(this.getScrollOffset()-x,this.scrollState.lastTargetOffset)||this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})),g&&this.scrollToEnd({behavior:g})}this._retryClampedAdjustment()},this._retryClampedAdjustment=()=>{if(this._clampedAdjustment===null||!this.scrollElement||!this.options.enabled)return;const{target:a,maxAtWrite:o}=this._clampedAdjustment,c=this.getMaxScrollOffset();c>o+.5&&(this._clampedAdjustment=a>c+.5?{target:a,maxAtWrite:c}:null,this._scrollToOffset(a,{adjustments:void 0,behavior:void 0}))},this._flushIosDeferredIfReady=()=>{if(this._iosDeferredAdjustment===0||this.isScrolling||this._iosTouching||this._iosJustTouchEnded)return;const a=this.getScrollOffset(),o=this.getMaxScrollOffset();if(a<0||a>o)return;if(this._iosDeferredAdjustment<0&&a>=o-1){this._iosDeferredAdjustment=0;return}const c=this._iosDeferredAdjustment;this._iosDeferredAdjustment=0,this._scrollToOffset(a,{adjustments:this.scrollAdjustments+=c,behavior:void 0})},this.rafId=null,this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getMeasurementOptions=Li(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes,this.options.laneAssignmentMode,this.options.gap],(a,o,c,d,h,m,g,x)=>(this.prevLanes!==void 0&&this.prevLanes!==m&&(this.lanesChangedFlag=!0),this.prevLanes=m,this.pendingMin=null,{count:a,paddingStart:o,scrollMargin:c,getItemKey:d,enabled:h,lanes:m,laneAssignmentMode:g,gap:x}),{key:!1}),this.isIndexInRange=a=>a>=0&&a<this.options.count,this.getMeasurements=Li(()=>[this.getMeasurementOptions(),this.itemSizeCacheVersion],({count:a,paddingStart:o,scrollMargin:c,getItemKey:d,enabled:h,lanes:m,laneAssignmentMode:g,gap:x},v)=>{var y;const S=this.itemSizeCache;if(!h)return this.measurementsCache=[],this._singleLaneMeasurements=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>a)for(const _ of this.laneAssignments.keys())_>=a&&this.laneAssignments.delete(_);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this._singleLaneMeasurements=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMin=null),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(_=>{this.itemSizeCache.set(_.key,_.size)}));const j=this.lanesSettling?0:this.pendingMin??0;if(this.pendingMin=null,this.lanesSettling&&this.measurementsCache.length===a&&(this.lanesSettling=!1),m===1){const _=a*2;let D=(y=this._singleLaneMeasurements)==null?void 0:y.flat;if(!D||D.length<_){const A=new Float64Array(_);D&&j>0&&A.set(D.subarray(0,j*2)),D=A}const C=j===0?new Array(a):this._singleLaneMeasurements.items.slice();let E;if(j===0)E=o+c;else{const A=j-1;E=D[A*2]+D[A*2+1]+x}for(let A=j;A<a;A++){const B=d(A);C[A]=B;const K=S.get(B),k=typeof K=="number"?K:this.options.estimateSize(A);D[A*2]=E,D[A*2+1]=k,E+=k+x}this._singleLaneMeasurements={flat:D,items:C};const R=nT(C,D);return this.measurementsCache=R,R}const b=this.measurementsCache.slice(0,j),N=new Array(m).fill(void 0),T=new Float64Array(m);let O=0;for(let _=0;_<j;_++){const D=b[_];D&&(N[D.lane]===void 0&&O++,N[D.lane]=_,T[D.lane]=D.end)}for(let _=j;_<a;_++){const D=d(_),C=this.laneAssignments.get(_);let E,R;const A=g==="estimate"||S.has(D);if(C!==void 0&&this.options.lanes>1){E=C;const ie=N[E],oe=ie!==void 0?b[ie]:void 0;R=oe?oe.end+x:o+c}else if(O===m){let ie=0,oe=T[0],se=N[0];for(let P=1;P<m;P++){const le=T[P];(le<oe||le===oe&&N[P]<se)&&(ie=P,oe=le,se=N[P])}E=ie,R=oe+x,A&&this.laneAssignments.set(_,E)}else E=_%this.options.lanes,R=o+c,A&&this.laneAssignments.set(_,E);const B=S.get(D),K=typeof B=="number"?B:this.options.estimateSize(_),k=R+K;b[_]={index:_,start:R,size:K,end:k,key:D,lane:E},N[E]===void 0&&O++,N[E]=_,T[E]=k}return this.measurementsCache=b,b},{key:!1,debug:()=>this.options.debug}),this.calculateRange=Li(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(a,o,c,d)=>a.length===0||o===0?(this.range=null,null):(this.range=pT(a,o,c,d,d===1&&this._singleLaneMeasurements!==null?this._singleLaneMeasurements.flat:null),this.range),{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=Li(()=>{let a=null,o=null;const c=this.calculateRange();return c&&(a=c.startIndex,o=c.endIndex),this.maybeNotify.updateDeps([this.isScrolling,a,o]),[this.options.rangeExtractor,this.options.overscan,this.options.count,a,o]},(a,o,c,d,h)=>d===null||h===null?[]:a({startIndex:d,endIndex:h,overscan:o,count:c}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=a=>{const o=this.options.indexAttribute,c=a.getAttribute(o);return c?parseInt(c,10):(console.warn(`Missing attribute name '${o}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=a=>{var o;if(!this.scrollState||this.scrollState.behavior!=="smooth")return!0;const c=this.scrollState.index??((o=this.getVirtualItemForOffset(this.scrollState.lastTargetOffset))==null?void 0:o.index);if(c!==void 0&&this.range){const d=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),h=Math.max(0,c-d),m=Math.min(this.options.count-1,c+d);return a>=h&&a<=m}return!0},this.measureElement=a=>{if(!a){this.elementsCache.forEach((h,m)=>{h.isConnected||(this.observer.unobserve(h),this.elementsCache.delete(m))});return}const o=this.indexFromElement(a);if(!this.isIndexInRange(o))return;const c=this.options.getItemKey(o),d=this.elementsCache.get(c);d!==a&&(d&&this.observer.unobserve(d),this.observer.observe(a),this.elementsCache.set(c,a)),(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(o)&&this.resizeItem(o,this.options.measureElement(a,void 0,this))},this.resizeItem=(a,o)=>{var c,d,h;if(!this.isIndexInRange(a))return;let m,g,x;const v=(c=this._singleLaneMeasurements)==null?void 0:c.flat;if(this.options.lanes===1&&v!=null)x=this.options.getItemKey(a),g=v[a*2],m=v[a*2+1];else{const j=this.measurementsCache[a];if(!j)return;x=j.key,g=j.start,m=j.size}const y=this.itemSizeCache.get(x)??m,S=o-y;if(S!==0){const j=this.options.anchorTo==="end"&&((d=this.scrollState)==null?void 0:d.behavior)!=="smooth"&&this.getVirtualDistanceFromEnd()<=this.options.scrollEndThreshold,b=j?this.getTotalSize():0,N=this.getScrollOffset()+this.scrollAdjustments,O=!this.itemSizeCache.has(x)?g<N:g+y<=N&&this.scrollDirection!=="backward",_=((h=this.scrollState)==null?void 0:h.behavior)!=="smooth"&&(this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(this.measurementsCache[a]??{index:a,key:x,start:g,size:m,end:g+m,lane:0},S,this):O);(this.pendingMin===null||a<this.pendingMin)&&(this.pendingMin=a),this.itemSizeCache.set(x,o),this.itemSizeCacheVersion++;let D=!1;j?D=this.applyScrollAdjustment(this.getTotalSize()-b):_&&(D=this.applyScrollAdjustment(S)),this.notify(D),this._retryClampedAdjustment()}},this.getVirtualItems=Li(()=>[this.getVirtualIndexes(),this.getMeasurements()],(a,o)=>{const c=[];for(let d=0,h=a.length;d<h;d++){const m=a[d],g=o[m];c.push(g)}return c},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=a=>{var o;const c=this.getMeasurements();if(c.length===0)return;const d=(o=this._singleLaneMeasurements)==null?void 0:o.flat,h=this.options.lanes===1&&d!=null,m=AS(0,c.length-1,h?g=>d[g*2]:g=>Lx(c[g]).start,a);return Lx(c[m])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if("scrollHeight"in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{const a=this.scrollElement.document.documentElement;return this.options.horizontal?a.scrollWidth-this.scrollElement.innerWidth:a.scrollHeight-this.scrollElement.innerHeight}},this.getVirtualDistanceFromEnd=()=>Math.max(this.getTotalSize()-this.getSize()-this.getScrollOffset(),0),this.getDistanceFromEnd=()=>Math.max(this.getMaxScrollOffset()-this.getScrollOffset(),0),this.isAtEnd=(a=this.options.scrollEndThreshold)=>this.getDistanceFromEnd()<=a,this.getOffsetForAlignment=(a,o,c=0)=>{if(!this.scrollElement)return 0;const d=this.getSize(),h=this.getScrollOffset();o==="auto"&&(o=a>=h+d?"end":"start"),o==="center"?a+=(c-d)/2:o==="end"&&(a-=d);const m=this.getMaxScrollOffset();return Math.max(Math.min(m,a),0)},this.getOffsetForIndex=(a,o="auto")=>{a=Math.max(0,Math.min(a,this.options.count-1));const c=this.getSize(),d=this.getScrollOffset(),h=this.measurementsCache[a];if(!h)return;if(o==="auto")if(h.end>=d+c-this.options.scrollPaddingEnd)o="end";else if(h.start<=d+this.options.scrollPaddingStart)o="start";else return[d,o];if(o==="end"&&a===this.options.count-1)return[this.getMaxScrollOffset(),o];const m=o==="end"?h.end+this.options.scrollPaddingEnd:h.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(m,o,h.size),o]},this.scrollToOffset=(a,{align:o="start",behavior:c="auto"}={})=>{this._iosDeferredAdjustment=0;const d=this.getOffsetForAlignment(a,o),h=this.now();this.scrollState={index:null,align:o,behavior:c,startedAt:h,lastTargetOffset:d,stableFrames:0},this._scrollToOffset(d,{adjustments:void 0,behavior:c}),this.scheduleScrollReconcile()},this.scrollToIndex=(a,{align:o="auto",behavior:c="auto"}={})=>{this._iosDeferredAdjustment=0,a=Math.max(0,Math.min(a,this.options.count-1));const d=this.getOffsetForIndex(a,o);if(!d)return;const[h,m]=d,g=this.now();this.scrollState={index:a,align:m,behavior:c,startedAt:g,lastTargetOffset:h,stableFrames:0},this._scrollToOffset(h,{adjustments:void 0,behavior:c}),this.scheduleScrollReconcile()},this.scrollBy=(a,{behavior:o="auto"}={})=>{const c=this.getScrollOffset()+a,d=this.now();this.scrollState={index:null,align:"start",behavior:o,startedAt:d,lastTargetOffset:c,stableFrames:0},this._scrollToOffset(c,{adjustments:void 0,behavior:o}),this.scheduleScrollReconcile()},this.scrollToEnd=({behavior:a="auto"}={})=>{if(this.options.count>0){this.scrollToIndex(this.options.count-1,{align:"end",behavior:a});return}this.scrollToOffset(Math.max(this.getTotalSize()-this.getSize(),0),{behavior:a})},this.getTotalSize=()=>{var a,o;const c=this.getMeasurements();let d;if(c.length===0)d=this.options.paddingStart;else if(this.options.lanes===1){const h=c.length-1,m=(a=this._singleLaneMeasurements)==null?void 0:a.flat;m!=null?d=m[h*2]+m[h*2+1]:d=((o=c[h])==null?void 0:o.end)??0}else{const h=Array(this.options.lanes).fill(null);let m=c.length-1;for(;m>=0&&h.some(g=>g===null);){const g=c[m];h[g.lane]===null&&(h[g.lane]=g.end),m--}d=Math.max(...h.filter(g=>g!==null))}return Math.max(d-this.options.scrollMargin+this.options.paddingEnd,0)},this.takeSnapshot=()=>{const a=[];if(this.itemSizeCache.size===0)return a;const o=this.getMeasurements();for(const c of o)c&&this.itemSizeCache.has(c.key)&&a.push({index:c.index,key:c.key,start:c.start,size:c.size,end:c.end,lane:c.lane});return a},this._scrollToOffset=(a,{adjustments:o,behavior:c})=>{this._intendedScrollOffset=a+(o??0),this.options.scrollToFn(a,{behavior:c,adjustments:o},this)},this.measure=()=>{this.pendingMin=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),this.itemSizeCacheVersion++,this.notify(!1)},this.setOptions(l)}applyScrollAdjustment(l,a){if(l===0)return!1;if(em()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded))return this._iosDeferredAdjustment+=l,!1;{const o=this.getScrollOffset()+this.scrollAdjustments+l,c=this.scrollElement,d=c!==null&&("scrollHeight"in c||"document"in c)?this.getMaxScrollOffset():null;return this._clampedAdjustment=d!==null&&o>d+.5?{target:o,maxAtWrite:d}:null,this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=l,behavior:a}),this.scrollOffset!==null&&(this.scrollOffset+=this.scrollAdjustments,this.scrollOffset<0&&(this.scrollOffset=0),this.scrollAdjustments=0),!0}}scheduleScrollReconcile(){if(!this.targetWindow){this.scrollState=null;return}this.rafId==null&&(this.rafId=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()}))}reconcileScroll(){if(!this.scrollState||!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3){this.scrollState=null;return}const o=this.scrollState.index!=null?this.getOffsetForIndex(this.scrollState.index,this.scrollState.align):void 0,c=o?o[0]:this.scrollState.lastTargetOffset,d=1,h=c!==this.scrollState.lastTargetOffset;if(!h&&$x(c,this.getScrollOffset())){if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=d){this.getScrollOffset()!==c&&this._scrollToOffset(c,{adjustments:void 0,behavior:"auto"}),this.scrollState=null;return}}else if(this.scrollState.stableFrames=0,h){const m=this.getSize()||600,g=Math.abs(c-this.getScrollOffset()),x=this.scrollState.behavior==="smooth"&&g>m;this.scrollState.lastTargetOffset=c,x||(this.scrollState.behavior="auto"),this._scrollToOffset(c,{adjustments:void 0,behavior:x?"smooth":"auto"})}this.scheduleScrollReconcile()}}const AS=(n,l,a,o)=>{for(;n<=l;){const c=(n+l)/2|0,d=a(c);if(d<o)n=c+1;else if(d>o)l=c-1;else return c}return n>0?n-1:0};function gT(n,l,a){let o=0;for(;o<=l;){const c=(o+l)/2|0,d=n[c*2];if(d<a)o=c+1;else if(d>a)l=c-1;else return c}return o>0?o-1:0}function pT(n,l,a,o,c){const d=n.length-1;if(n.length<=o)return{startIndex:0,endIndex:d};if(o===1&&c!==null){const x=gT(c,d,a);let v=x;const y=a+l;for(;v<d&&c[v*2]+c[v*2+1]<y;)v++;return{startIndex:x,endIndex:v}}let m=AS(0,d,x=>n[x].start,a),g=m;if(o===1)for(;g<d&&n[g].end<a+l;)g++;else if(o>1){const x=Array(o).fill(0);for(;g<d&&x.some(y=>y<a+l);){const y=n[g];x[y.lane]=y.end,g++}const v=Array(o).fill(a+l);for(;m>=0&&v.some(y=>y>=a);){const y=n[m];v[y.lane]=y.start,m--}m=Math.max(0,m-m%o),g=Math.min(d,g+(o-1-g%o))}return{startIndex:m,endIndex:g}}const tm=typeof document<"u"?M.useLayoutEffect:M.useEffect;function yT({useFlushSync:n=!0,directDomUpdates:l=!1,directDomUpdatesMode:a="transform",...o}){const c=M.useReducer(y=>y+1,0)[1],d=M.useRef({enabled:l,mode:a,container:null,lastSize:null,lastPositions:new WeakMap,prevRange:null});d.current.enabled=l,d.current.mode=a;const h=M.useRef(!1),m=y=>{const S=d.current;if(!S.enabled||!S.container)return;const j=y.getTotalSize();if(j!==S.lastSize){S.lastSize=j;const b=y.options.horizontal?"width":"height";S.container.style[b]=`${j}px`}},g=y=>{const S=d.current;if(!S.enabled||!S.container)return;m(y);const j=!!y.options.horizontal,b=S.mode==="transform",N=j?"left":"top",T=y.options.scrollMargin,O=y.getVirtualItems();for(const _ of O){const D=_.start-T,C=y.elementsCache.get(_.key);C&&S.lastPositions.get(C)!==D&&(S.lastPositions.set(C,D),b?C.style.transform=j?`translate3d(${D}px, 0, 0)`:`translate3d(0, ${D}px, 0)`:C.style[N]=`${D}px`)}},x={...o,onChange:(y,S)=>{var j;const b=d.current;let N=!0;if(b.enabled){g(y);const T=y.range,O=b.prevRange;N=!O||O.isScrolling!==y.isScrolling||O.startIndex!==(T==null?void 0:T.startIndex)||O.endIndex!==(T==null?void 0:T.endIndex),N&&(b.prevRange=T?{startIndex:T.startIndex,endIndex:T.endIndex,isScrolling:y.isScrolling}:null)}N&&(n&&S&&!h.current?cg.flushSync(c):c()),(j=o.onChange)==null||j.call(o,y,S)}},[v]=M.useState(()=>{const y=new mT(x),S=y.measureElement;return y.measureElement=j=>{h.current=!0;try{S(j)}finally{h.current=!1}},Object.assign(y,{containerRef:j=>{const b=d.current;if(b.container=j,b.lastSize=null,j&&b.enabled){const N=y.getTotalSize();b.lastSize=N;const T=y.options.horizontal?"width":"height";j.style[T]=`${N}px`}}})});return v.setOptions(x),tm(()=>v._didMount(),[]),tm(()=>(m(v),v._willUpdate())),tm(()=>{g(v)}),v}function vT(n){return yT({observeElementRect:iT,observeElementOffset:cT,scrollToFn:dT,...n})}const OS=33,$i=32,xT=25;function zS({items:n,scrollRef:l,columnCount:a,getKey:o,render:c,onEndReached:d,endThreshold:h=15,rowHeight:m=OS}){var T;const g=vT({count:n.length,getScrollElement:()=>l.current,estimateSize:()=>m,overscan:8,scrollMargin:$i,getItemKey:O=>o(n[O],O),initialRect:{width:1e3,height:$i+m*10}}),x=!((T=g.scrollRect)!=null&&T.height),v=x?n.slice(0,xT).map((O,_)=>({key:o(O,_),index:_,start:$i+_*m,end:$i+(_+1)*m})):g.getVirtualItems(),y=v[0],S=v[v.length-1],j=(S==null?void 0:S.index)??-1;M.useEffect(()=>{d&&j>=0&&j>=n.length-h&&d()},[j,n.length,h,d]);const b=!x&&y?y.start-$i:0,N=!x&&S?g.getTotalSize()-(S.end-$i):0;return r.jsxs(r.Fragment,{children:[b>0&&r.jsx("tbody",{"aria-hidden":!0,children:r.jsx("tr",{className:"vt-spacer",style:{height:b},children:r.jsx("td",{colSpan:a})})}),v.map(O=>r.jsx("tbody",{"data-index":O.index,ref:x?void 0:g.measureElement,children:c(n[O.index],O.index)},O.key)),N>0&&r.jsx("tbody",{"aria-hidden":!0,children:r.jsx("tr",{className:"vt-spacer",style:{height:N},children:r.jsx("td",{colSpan:a})})})]})}function Da({text:n,query:l}){const a=l.trim();if(!a||bC(a))return r.jsx(r.Fragment,{children:n});const o=[],c=n.toLowerCase(),d=a.toLowerCase();let h=0;for(let m=c.indexOf(d);m!==-1;m=c.indexOf(d,h))m>h&&o.push(n.slice(h,m)),o.push(r.jsx("mark",{children:n.slice(m,m+a.length)},m)),h=m+a.length;return o.push(n.slice(h)),r.jsx(r.Fragment,{children:o})}function Hx({value:n,max:l,clonal:a}){return n===null?r.jsx("span",{style:{color:"var(--chev)"},children:"–"}):r.jsxs("span",{className:"vbar",children:[r.jsx("span",{className:"vbar-n",children:km(n)}),r.jsxs("span",{className:"vbar-track","aria-hidden":!0,children:[r.jsx("span",{className:"vbar-fill",style:{width:`${Math.min(n/l,1)*100}%`}}),a&&r.jsx("span",{className:"vbar-tick",style:{left:`${1/l*100}%`}})]})]})}function ST({variant:n,showDriver:l}){return r.jsxs("span",{className:"flex flex-wrap gap-1.5",children:[l&&n.is_driver&&r.jsx("span",{className:"sc-pill p-neu",children:"Driver"}),n.hotspot&&r.jsx("span",{className:"sc-pill p-hot",children:"Hotspot"}),n.in_dmp&&r.jsx("span",{className:"sc-pill p-dmp",children:"In DMP"}),n.ffpe_removed&&r.jsx("span",{className:"sc-pill p-ffpe",title:"Left out of the report's counts by its FFPE artifact filter",children:"FFPE filtered"})]})}function bT(n){return`${n.ref}>${n.alt}`}function jT({variant:n,onLocate:l}){const[a,o]=M.useState(!1),c=`chr${n.chrom}:${n.pos}`,d=[["Variant",`${n.kind==="snv"?"SNV":n.kind==="indel"?"Indel":n.kind}, ${bT(n)}`],...n.depth!==null?[["Reads",`${n.alt_reads??"?"} of ${n.depth}`]]:[],["Normal VAF",km(n.normal_vaf)],["Mutant copies",CC(n.mut_alleles)??"–"],["Consequence",(n.consequence??n.effect??"–").replace(/&/g,", ")],["COSMIC",NC(n.cosmic)??"–"],...n.ffpe_score!==null||n.ffpe_removed?[["FFPE artifact score",n.ffpe_score!==null?km(n.ffpe_score):"Not scored"]]:[],["Expression",n.gene_tpm!==null?`${n.gene_tpm.toFixed(1)} TPM`:"–"],["Gene role",MC(n)??"–"]];return r.jsxs("div",{className:"vt-detail-body",children:[r.jsx("dl",{className:"vt-facts",children:d.map(([h,m])=>r.jsxs("div",{children:[r.jsx("dt",{children:h}),r.jsx("dd",{children:m})]},h))}),r.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[r.jsxs("button",{type:"button",className:"sc-btn sc-b2 sm",onClick:()=>l(n),children:[r.jsx($m,{size:14,"aria-hidden":!0}),"Show on copy number"]}),r.jsxs("button",{type:"button",className:"sc-btn sc-b2 sm",onClick:async()=>{try{await navigator.clipboard.writeText(c),o(!0),window.setTimeout(()=>o(!1),1500)}catch{window.prompt("Copy this locus",c)}},children:[r.jsx(P1,{size:14,"aria-hidden":!0}),a?"Copied":"Copy locus"]})]})]})}function wT({sort:n,current:l,onSort:a}){const o=l.replace(/^-/,"")===n.key,c=l.startsWith("-"),d=o?c?n.key:`-${n.key}`:n.descFirst?`-${n.key}`:n.key;return r.jsxs("button",{type:"button",className:"vt-sort","data-active":o,onClick:()=>a(d),title:`Sort by ${n.label.toLowerCase()}`,children:[n.label,o&&c?r.jsx(Tu,{size:12,"aria-hidden":!0}):o?r.jsx(q1,{size:12,"aria-hidden":!0}):r.jsx(Tu,{size:12,"aria-hidden":!0,className:"vt-sort-idle"})]})}function NT({data:n,rows:l,hasMore:a,loadingMore:o,onMore:c,table:d,fetching:h,showCcf:m,onTable:g,onHover:x,onLocate:v}){const[y,S]=M.useState({}),j=d.q,b=d.scope!=="drivers",N=M.useMemo(()=>[{id:"expand",header:()=>r.jsx("span",{className:"sr-only",children:"Details"}),meta:{className:"pin vt-x"},cell:({row:R})=>r.jsx("button",{type:"button",className:"vt-expand","aria-expanded":R.getIsExpanded(),"aria-label":`Details of ${R.original.gene??"this mutation"} ${R.original.protein_change??""}`.trim(),onClick:A=>{A.stopPropagation(),R.toggleExpanded()},onFocus:()=>x(R.original),children:r.jsx(dg,{size:14,"aria-hidden":!0})})},{id:"gene",header:"Gene",meta:{className:"pin vt-g",sorts:[{key:"gene",label:"Gene"},{key:"position",label:"Position"}]},cell:({row:{original:R}})=>r.jsxs(r.Fragment,{children:[r.jsx("span",{className:"vt-gene",children:r.jsx(Da,{text:R.gene??"–",query:j})}),r.jsx("span",{className:"vt-sub mono",children:Rr(R.chrom,R.pos)})]})},{id:"change",header:"Change",cell:({row:{original:R}})=>r.jsxs(r.Fragment,{children:[r.jsx("span",{className:"mono text-[12.5px] font-medium",children:r.jsx(Da,{text:R.protein_change??"–",query:j})}),R.cdna_change&&r.jsx("span",{className:"vt-sub mono",children:r.jsx(Da,{text:R.cdna_change,query:j})})]})},{id:"effect",header:"Effect",meta:{sorts:[{key:"effect",label:"Effect"}]},cell:({row:{original:R}})=>r.jsx("span",{className:R.effect_class==="truncating"?"font-semibold":void 0,children:ZN(R.consequence,R.effect)})},{id:"vaf",header:"VAF",meta:{className:"n",sorts:[{key:"vaf",label:"VAF",descFirst:!0}]},cell:({row:{original:R}})=>r.jsx(Hx,{value:R.vaf,max:1})},...m?[{id:"ccf",header:"CCF",meta:{className:"n",sorts:[{key:"ccf",label:"CCF",descFirst:!0}]},cell:({row:{original:R}})=>r.jsx(Hx,{value:R.ccf,max:1.25,clonal:!0})}]:[],{id:"flags",header:"Flags",cell:({row:{original:R}})=>r.jsx(ST,{variant:R,showDriver:b})}],[j,b,m,x]),T=RS({data:l,columns:N,getRowId:SC,getCoreRowModel:TS(),getExpandedRowModel:_S(),getRowCanExpand:()=>!0,manualPagination:!0,state:{expanded:y},onExpandedChange:S}),O=d.sort.replace(/^-/,""),_=T.getVisibleLeafColumns().length,D=cS(d)>0,C=M.useRef(null),E=JSON.stringify([d.scope,d.sort,d.q,d.effects,d.flags,d.range,d.ffpe]);return M.useEffect(()=>{C.current&&(C.current.scrollTop=0)},[E]),r.jsxs("div",{className:"flex min-w-0 flex-col",children:[r.jsx("div",{className:"tbar",children:r.jsx($u,{value:d.q,onChange:R=>g({q:R})})}),r.jsxs("div",{ref:C,className:"vt-scroll vt-viewport",onMouseLeave:()=>x(null),"aria-busy":h,children:[h&&r.jsx("div",{className:"vt-progress","aria-hidden":!0}),r.jsxs("table",{className:"vt",children:[r.jsx("thead",{children:T.getHeaderGroups().map(R=>r.jsx("tr",{children:R.headers.map(A=>{var k;const B=A.column.columnDef.meta,K=(k=B==null?void 0:B.sorts)==null?void 0:k.some(ie=>ie.key===O);return r.jsx("th",{className:B==null?void 0:B.className,"aria-sort":K?d.sort.startsWith("-")?"descending":"ascending":void 0,children:B!=null&&B.sorts?r.jsx("span",{className:"vt-sorts",children:B.sorts.map(ie=>r.jsx(wT,{sort:ie,current:d.sort,onSort:oe=>g({sort:oe})},ie.key))}):Lu(A.column.columnDef.header,A.getContext())},A.id)})},R.id))}),r.jsx(zS,{items:T.getRowModel().rows,scrollRef:C,columnCount:_,getKey:R=>R.id,onEndReached:a&&!o?c:void 0,render:R=>r.jsxs(r.Fragment,{children:[r.jsx("tr",{className:"vt-row","data-expanded":R.getIsExpanded(),onClick:()=>R.toggleExpanded(),onMouseEnter:()=>x(R.original),children:R.getVisibleCells().map(A=>{var B;return r.jsx("td",{className:(B=A.column.columnDef.meta)==null?void 0:B.className,children:Lu(A.column.columnDef.cell,A.getContext())},A.id)})}),R.getIsExpanded()&&r.jsx("tr",{className:"vt-detail",children:r.jsx("td",{colSpan:_,children:r.jsx(jT,{variant:R.original,onLocate:v})})})]})}),l.length===0&&r.jsx("tbody",{children:r.jsx("tr",{children:r.jsx("td",{colSpan:_,children:r.jsx("div",{className:"vt-empty",children:D?r.jsxs(r.Fragment,{children:["No mutations match these filters.",r.jsx("button",{type:"button",className:"sc-btn sc-b2 sm",onClick:()=>g({q:"",effects:[],flags:[],range:null}),children:"Clear all filters"})]}):`No ${d.scope==="all"?"":`${d.scope} `}mutations in this sample.`})})})})]})]}),n.total>0&&r.jsx(Ku,{shown:l.length,total:n.total,noun:["mutation","mutations"],loaded:!0,note:o?"Loading more…":l.length<n.total?"Scroll the table for more":void 0})]})}const CT=M.forwardRef(function({variants:l,rows:a,hasMore:o,loadingMore:c,onMore:d,variantsLoading:h,variantsFetching:m,density:g,densityLoading:x,picked:v,measure:y,onMeasure:S,table:j,onTable:b,hovered:N,onHover:T,onLocate:O,showCcf:_,tmb:D},C){var ie,oe;const E=(l==null?void 0:l.status)==="ok"?l.data??void 0:void 0,R=E==null?void 0:E.counts,A=(g==null?void 0:g.status)==="ok"?(ie=g.data)==null?void 0:ie.total:void 0,B=(g==null?void 0:g.status)==="ok"?(oe=g.data)==null?void 0:oe.ffpe:null,K=se=>se===void 0?"":se.toLocaleString("en-US"),k=j.range&&j.range.measure===y?[j.range.low,j.range.high]:null;return r.jsxs(uo,{ref:C,title:"Mutations",subtitle:A!==void 0?`${K(A)} PASS SNVs and indels${B&&!B.shown?", after the FFPE filter":""}`:void 0,lineage:Qu(g==null?void 0:g.lineage,l==null?void 0:l.lineage,D==null?void 0:D.lineage),picked:v,className:"mut",info:"mutations",expandable:!0,controls:r.jsx(r.Fragment,{children:r.jsx(Bl,{label:"Which mutations",value:j.scope,onChange:se=>b({scope:se,sort:rS[se]}),options:[{value:"drivers",label:r.jsxs(r.Fragment,{children:["Drivers",r.jsx("span",{className:"seg-n",children:K(R==null?void 0:R.drivers)})]})},{value:"coding",label:r.jsxs(r.Fragment,{children:["Coding",r.jsx("span",{className:"seg-n",children:K(R==null?void 0:R.coding)})]})},{value:"all",label:r.jsxs(r.Fragment,{children:["All",r.jsx("span",{className:"seg-n",children:K(R==null?void 0:R.all)})]})}]})}),children:[r.jsx(lE,{envelope:g,loading:x,measure:y,onMeasure:S,range:k,focus:N,onRange:se=>{!se&&!j.range||b({range:se?{measure:y,low:se[0],high:se[1]}:null})},onGene:se=>b({q:se})}),E&&l&&l.warnings.length>0&&r.jsx("div",{className:"px-5 py-2 text-xs",role:"note",style:{color:"var(--warn-ink)"},children:l.warnings.join(" ")}),E?r.jsxs("div",{className:"mut-body",children:[r.jsx(oE,{table:j,data:E,onChange:b}),r.jsx(NT,{data:E,rows:a,hasMore:o,loadingMore:c,onMore:d,table:j,fetching:m,showCcf:_,onTable:b,onHover:T,onLocate:O})]}):r.jsx("div",{className:"mut-rule",children:r.jsx(Vl,{label:"mutations",envelope:l,loading:h,skeletonHeight:240,children:()=>null})}),(D==null?void 0:D.status)==="ok"&&D.data&&r.jsx(cE,{data:D.data}),(D==null?void 0:D.status)==="missing"&&D.warnings.some(se=>se.includes("Rerun"))&&r.jsxs("section",{className:"sig-section","aria-label":"Coding mutations against reference cohorts",children:[r.jsx("h3",{className:"sv-h",children:"Coding mutations against reference cohorts"}),r.jsx("p",{className:"sv-empty",children:D.warnings.join(" ")})]})]})}),Sg={oncogene:"Oncogene",tsg:"Tumour suppressor",both:"Oncogene and TSG"},DS=["oncogene","tsg","both"],$a={deletion:"Deletion","tandem-duplication":"Tandem duplication",inversion:"Inversion",translocation:"Translocation"},MT={"<1kb":"<1 kb","1kb-10kb":"1–10 kb","10kb-100kb":"10–100 kb","100kb-1Mb":"100 kb–1 Mb",">1Mb":">1 Mb"};function ET(n){return n?MT[n]??n:""}const TT={DEL:"Deletion",DUP:"Duplication",INV:"Inversion",TRA:"Translocation",BND:"Breakend",INS:"Insertion"};function bg(n){return n?TT[n]??n:"–"}function _T(n){return n==null?"–":n>=1e6?`${(n/1e6).toLocaleString("en-US",{maximumFractionDigits:1})} Mb`:n>=1e3?`${(n/1e3).toLocaleString("en-US",{maximumFractionDigits:1})} kb`:`${n.toLocaleString("en-US")} bp`}function RT(n){return n.some(l=>l.left_expression||l.right_expression||l.expression)}function AT(n){const l={oncogene:0,tsg:0,both:0};for(const a of n)a.role&&(l[a.role]+=1);return l}function OT(n){const l=n.trim().match(dS);if(!l)return null;const a=Number(l[2].replace(/,/g,"")),o=l[3]?Number(l[3].replace(/,/g,"")):a;return{chrom:l[1].toUpperCase(),start:Math.min(a,o),end:Math.max(a,o)}}function zT(n,l){const a=l.trim().toLowerCase();if(!a)return!0;const o=OT(l);if(o){const c=(d,h)=>(d==null?void 0:d.toUpperCase())===o.chrom&&h!==null&&h>=o.start&&h<=o.end;return c(n.left_chrom,n.left_pos)||c(n.right_chrom,n.right_pos)}return[n.gene,n.left_gene,n.right_gene,n.callers,n.left_loc,n.right_loc,n.sv_type,bg(n.sv_type),n.role?Sg[n.role]:null].some(c=>c==null?void 0:c.toLowerCase().includes(a))}const zn={deletion:"var(--sv-del)","tandem-duplication":"var(--sv-dup)",inversion:"var(--sv-inv)",translocation:"var(--sv-tra)"},DT={deletion:"Deletion","tandem-duplication":"Tandem dup.",inversion:"Inversion",translocation:"Transl."},LT={"<1kb":"<1k","1kb-10kb":"10k","10kb-100kb":"100k","100kb-1Mb":"1M",">1Mb":">1M"};function $T(n){return n.size?LT[n.size]??n.size:""}function Ux(n){const l=`${n.clustered?"Clustered":"Dispersed"} ${$a[n.sv_class].toLowerCase()}s`;return n.size?`${l}, ${ET(n.size)}`:l}function kT(n){const l=[];return n.forEach((a,o)=>{const c=l[l.length-1];c&&c.clustered===a.clustered&&c.sv_class===a.sv_class?c.end=o:l.push({clustered:a.clustered,sv_class:a.sv_class,start:o,end:o})}),l}function HT(n){const l=new Map;for(const a of n)l.set(a.sv_class,(l.get(a.sv_class)??0)+a.count);return[...l].map(([a,o])=>({sv_class:a,count:o}))}const UT=45;function FT({role:n}){return n?r.jsx("span",{className:`sc-pill p-${n==="oncogene"?"onco":n}`,children:Sg[n]}):r.jsx("span",{style:{color:"var(--chev)"},children:"–"})}function VT({rows:n,shown:l,onToggle:a}){const o=AT(n);return r.jsx("div",{className:"sv-legend",role:"group","aria-label":"Show rows by gene role",children:DS.filter(c=>o[c]>0).map(c=>r.jsxs("button",{type:"button",className:`sv-legend-item p-${c==="oncogene"?"onco":c}`,"aria-pressed":l.includes(c),onClick:()=>a(c),children:[Sg[c],r.jsx("span",{className:"sv-legend-n",children:o[c]})]},c))})}function Fx({gene:n,chrom:l,pos:a,loc:o,query:c}){return r.jsxs(r.Fragment,{children:[r.jsxs("span",{className:"sv-end",children:[r.jsx("span",{className:"vt-gene",children:r.jsx(Da,{text:n||"–",query:c})}),o&&r.jsx("span",{className:"sv-loc",children:o})]}),r.jsx("span",{className:"vt-sub stack mono",children:l&&a!==null?Rr(l,a):"–"})]})}function LS(n){return n?n.replace(/,\s*/g,", "):"–"}function BT({label:n,sorted:l,onClick:a}){return r.jsxs("button",{type:"button",className:"vt-sort","data-active":!!l,onClick:a,title:`Sort by ${n.toLowerCase()}`,children:[n,l==="desc"?r.jsx(Tu,{size:12,"aria-hidden":!0}):l==="asc"?r.jsx(q1,{size:12,"aria-hidden":!0}):r.jsx(Tu,{size:12,"aria-hidden":!0,className:"vt-sort-idle"})]})}function GT({row:n,onLocate:l}){const[a,o]=M.useState(!1),c=n.left_chrom&&n.left_pos!==null?{chrom:n.left_chrom,pos:n.left_pos}:null,d=n.right_chrom&&n.right_pos!==null?{chrom:n.right_chrom,pos:n.right_pos}:null,h=[["Type",bg(n.sv_type)],["Left breakpoint",c?`${Rr(c.chrom,c.pos)}${n.left_loc?`, ${n.left_loc}`:""}`:"–"],["Right breakpoint",d?`${Rr(d.chrom,d.pos)}${n.right_loc?`, ${n.right_loc}`:""}`:"–"],["Pileups (left, right)",[n.left_pileup,n.right_pileup].filter(Boolean).join(", ")||"–"],["Orientation",n.orientation??"–"],["Callers",LS(n.callers)]],m=n.gene??n.left_gene,g=n.gene??n.right_gene;return r.jsxs("div",{className:"vt-detail-body",children:[r.jsx("dl",{className:"vt-facts",children:h.map(([x,v])=>r.jsxs("div",{children:[r.jsx("dt",{children:x}),r.jsx("dd",{children:v})]},x))}),r.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[c&&r.jsxs("button",{type:"button",className:"sc-btn sc-b2 sm",onClick:()=>l({...c,gene:m}),children:[r.jsx($m,{size:14,"aria-hidden":!0}),"Show ",d&&d.chrom===c.chrom?"it":"left breakpoint"," on copy number"]}),d&&d.chrom!==(c==null?void 0:c.chrom)&&r.jsxs("button",{type:"button",className:"sc-btn sc-b2 sm",onClick:()=>l({...d,gene:g}),children:[r.jsx($m,{size:14,"aria-hidden":!0}),"Show right breakpoint on copy number"]}),n.igv_locus&&r.jsxs("button",{type:"button",className:"sc-btn sc-b2 sm",onClick:async()=>{try{await navigator.clipboard.writeText(n.igv_locus??""),o(!0),window.setTimeout(()=>o(!1),1500)}catch{window.prompt("Copy these IGV loci",n.igv_locus??"")}},children:[r.jsx(P1,{size:14,"aria-hidden":!0}),a?"Copied":"Copy IGV loci"]})]})]})}function Vx({kind:n,rows:l,total:a=l.length,query:o="",onLocate:c}){const[d,h]=M.useState({}),[m,g]=M.useState([]),x=M.useRef(null),v=RT(l);M.useEffect(()=>{x.current&&(x.current.scrollTop=0)},[o,l.length]);const y=M.useMemo(()=>{const N={id:"expand",header:()=>r.jsx("span",{className:"sr-only",children:"Details"}),enableSorting:!1,meta:{className:"pin vt-x"},cell:({row:_})=>r.jsx("button",{type:"button",className:"vt-expand","aria-expanded":_.getIsExpanded(),"aria-label":`Details of ${_.original.gene??[_.original.left_gene,_.original.right_gene].filter(Boolean).join(" and ")}`,onClick:D=>{D.stopPropagation(),_.toggleExpanded()},children:r.jsx(dg,{size:14,"aria-hidden":!0})})},T=[{id:"type",header:"Type",accessorFn:_=>_.sv_type??"",cell:({row:{original:_}})=>bg(_.sv_type)},{id:"role",header:"Role",accessorFn:_=>_.role?DS.indexOf(_.role):9,cell:({row:{original:_}})=>r.jsx(FT,{role:_.role})},{id:"callers",header:"Callers",accessorFn:_=>_.callers??"",cell:({row:{original:_}})=>r.jsx("span",{className:"text-[12.5px]",children:LS(_.callers)})},{id:"support",header:"Support",accessorFn:_=>_.max_support??-1,sortDescFirst:!0,meta:{className:"n"},cell:({row:{original:_}})=>r.jsx("span",{className:"mono",children:_.max_support??"–"})},{id:"pileups",header:"Pileups",enableSorting:!1,cell:({row:{original:_}})=>r.jsx("span",{className:"mono text-[12px]",children:[_.left_pileup,_.right_pileup].filter(Boolean).join(" · ")||"–"})}],O=v?[{id:"expression",header:"Expression",enableSorting:!1,cell:({row:{original:_}})=>n==="whole_gene"?r.jsx("span",{className:"text-[12.5px]",children:_.expression??"–"}):r.jsxs("span",{className:"flex flex-col text-[12.5px] leading-snug",children:[r.jsx("span",{children:_.left_expression??"–"}),r.jsx("span",{style:{color:"var(--muted)"},children:_.right_expression??"–"})]})}]:[];return n==="whole_gene"?[N,{id:"gene",header:"Gene",accessorFn:_=>_.gene??"",meta:{className:"pin vt-g"},cell:({row:{original:_}})=>r.jsxs(r.Fragment,{children:[r.jsx("span",{className:"vt-gene",children:r.jsx(Da,{text:_.gene??"–",query:o})}),r.jsx("span",{className:"vt-sub mono",children:_.left_chrom&&_.left_pos!==null&&_.right_pos!==null?`${Rr(_.left_chrom,_.left_pos)}–${_.right_pos.toLocaleString("en-US")}`:"–"})]})},{id:"length",header:"Length",accessorFn:_=>_.length??-1,sortDescFirst:!0,meta:{className:"n"},cell:({row:{original:_}})=>r.jsx("span",{className:"mono",children:_T(_.length)})},...T,...O]:[N,{id:"left",header:"Left",accessorFn:_=>_.left_gene??"",meta:{className:"pin vt-g"},cell:({row:{original:_}})=>r.jsx(Fx,{gene:_.left_gene,chrom:_.left_chrom,pos:_.left_pos,loc:_.left_loc,query:o})},{id:"right",header:"Right",accessorFn:_=>_.right_gene??"",cell:({row:{original:_}})=>r.jsx(Fx,{gene:_.right_gene,chrom:_.right_chrom,pos:_.right_pos,loc:_.right_loc,query:o})},...T,...O]},[n,v,o]),S=RS({data:l,columns:y,getRowId:N=>`${n}-${N.row}`,getCoreRowModel:TS(),getSortedRowModel:ZE(),getExpandedRowModel:_S(),getRowCanExpand:()=>!0,state:{expanded:d,sorting:m},onExpandedChange:h,onSortingChange:g}),j=S.getVisibleLeafColumns().length,b=n==="onco"?UT:OS;return r.jsxs(r.Fragment,{children:[r.jsx("div",{ref:x,className:"vt-scroll vt-viewport",style:{"--row-h":`${b}px`},children:r.jsxs("table",{className:"vt",children:[r.jsx("thead",{children:S.getHeaderGroups().map(N=>r.jsx("tr",{children:N.headers.map(T=>{const O=T.column.columnDef.meta,_=T.column.getIsSorted();return r.jsx("th",{className:O==null?void 0:O.className,"aria-sort":_?_==="desc"?"descending":"ascending":void 0,children:T.column.getCanSort()?r.jsx(BT,{label:String(T.column.columnDef.header),sorted:_,onClick:T.column.getToggleSortingHandler()}):Lu(T.column.columnDef.header,T.getContext())},T.id)})},N.id))}),r.jsx(zS,{items:S.getRowModel().rows,scrollRef:x,columnCount:j,rowHeight:b,getKey:N=>N.id,render:N=>r.jsxs(r.Fragment,{children:[r.jsx("tr",{className:"vt-row","data-expanded":N.getIsExpanded(),onClick:()=>N.toggleExpanded(),children:N.getVisibleCells().map(T=>{var O;return r.jsx("td",{className:(O=T.column.columnDef.meta)==null?void 0:O.className,children:Lu(T.column.columnDef.cell,T.getContext())},T.id)})}),N.getIsExpanded()&&r.jsx("tr",{className:"vt-detail",children:r.jsx("td",{colSpan:j,children:r.jsx(GT,{row:N.original,onLocate:c})})})]})})]})}),r.jsx(Ku,{shown:l.length,total:a,noun:["row","rows"]})]})}const yr=176,nm=34,sm=7,lm=22,bu=30,qT={deletion:"Del","tandem-duplication":"Dup",inversion:"Inv",translocation:"Tra"};function IT(n,l){return[$a[n],DT[n],qT[n]].find(o=>Cs(o,12)+8<=l)??""}function QT(n,l,a,o,c){const d=Math.min(c,a/2,o);return`M${n},${l+o} V${l+d} Q${n},${l} ${n+d},${l} H${n+a-d} Q${n+a},${l} ${n+a},${l+d} V${l+o} Z`}function YT({categories:n,total:l,litClass:a}){const[o,c]=Es(),d=M.useId(),[h,m]=M.useState(null),g=kT(n),x=Math.max(0,...n.map(k=>k.count)),v=Pu(x,3),y=v[v.length-1],S=n.length,j=(g.length-1)*sm,b=n.some(k=>k.clustered)&&n.some(k=>!k.clustered),N=Math.max((c-bu-6-j-(b?lm-sm:0))/S,4),T=Math.min(26,N*.64),O=[],_=[];let D=bu;g.forEach((k,ie)=>{ie>0&&(D+=g[ie-1].clustered!==k.clustered?lm:sm);const oe=D;for(let le=k.start;le<=k.end;le++)O[le]=D+(N-T)/2,D+=N;const se=_.find(le=>le.clustered===k.clustered&&le.x1>=oe-lm-1),P=n.slice(k.start,k.end+1).reduce((le,$)=>le+$.count,0);se?(se.x1=D,se.count+=P):_.push({clustered:k.clustered,x0:oe,x1:D,count:P})});const C=k=>nm+yr-k/y*yr,E=nm+yr,R=k=>h!==null?k===h:a?n[k].sv_class===a:!0,A=h===null?null:n[h],B=A&&l?Math.round(A.count/l*100):0,K=E+62;return r.jsxs("div",{ref:o,className:"rs","data-lit":h!==null||a?"":void 0,children:[r.jsxs("svg",{width:c,height:K,role:"img","aria-label":`Rearrangement signatures: ${n.filter(k=>k.count>0).map(k=>`${k.category} ${k.count}`).join(", ")}`,children:[r.jsx("defs",{children:Object.keys(zn).map(k=>r.jsxs("linearGradient",{id:`${d}-${k}`,x1:"0",y1:"0",x2:"0",y2:"1",children:[r.jsx("stop",{offset:"0",style:{stopColor:zn[k]}}),r.jsx("stop",{offset:"1",style:{stopColor:zn[k]},stopOpacity:.72})]},k))}),_.map(k=>r.jsxs("g",{children:[b&&k.clustered&&r.jsx("rect",{x:k.x0-6,y:0,width:k.x1-k.x0+12,height:E+56,rx:14,className:"rs-zone"}),b&&r.jsxs("text",{x:k.x0,y:17,className:"rs-zone-name",children:[k.clustered?"Clustered":"Dispersed",r.jsxs("tspan",{className:"rs-zone-n",children:[" ",k.count.toLocaleString("en-US")]})]})]},k.clustered?"c":"d")),v.map(k=>r.jsxs("g",{children:[r.jsx("line",{x1:bu-4,x2:c,y1:C(k),y2:C(k),className:k===0?"rs-base":"rs-grid"}),r.jsx("text",{x:bu-10,y:C(k)+4,textAnchor:"end",className:"rs-tick",children:k.toLocaleString("en-US")})]},k)),n.map((k,ie)=>{const oe=k.count/y*yr,se=R(ie);return r.jsxs("g",{className:"rs-bar","data-off":se?void 0:"",children:[k.count>0?r.jsxs(r.Fragment,{children:[r.jsx("path",{d:QT(O[ie],C(k.count),T,oe,6),fill:`url(#${d}-${k.sv_class})`,fillOpacity:k.clustered?.5:1}),r.jsx("text",{x:O[ie]+T/2,y:C(k.count)-7,textAnchor:"middle",className:"rs-count",children:k.count.toLocaleString("en-US")})]}):r.jsx("rect",{x:O[ie],y:E-3,width:T,height:3,rx:1.5,style:{fill:zn[k.sv_class]},fillOpacity:.28}),k.size&&N>=26&&r.jsx("text",{x:O[ie]+T/2,y:E+16,textAnchor:"middle",className:"rs-size",children:$T(k)}),r.jsx("rect",{x:O[ie]-(N-T)/2,y:nm-8,width:N,height:yr+30,fill:"transparent",tabIndex:0,"aria-label":`${Ux(k)}: ${k.count}`,onMouseEnter:()=>m(ie),onMouseLeave:()=>m(null),onFocus:()=>m(ie),onBlur:()=>m(null)})]},k.category)}),g.map(k=>{const ie=O[k.start],oe=O[k.end]+T,se=IT(k.sv_class,oe-ie+(N-T));return r.jsxs("g",{className:"rs-class","data-off":a&&a!==k.sv_class?"":void 0,children:[r.jsx("line",{x1:ie,x2:oe,y1:E+26,y2:E+26,style:{stroke:zn[k.sv_class]},className:"rs-bracket"}),r.jsx("text",{x:(ie+oe)/2,y:E+44,textAnchor:"middle",className:"rs-class-name",children:se})]},`${k.clustered}-${k.sv_class}`)})]}),A&&h!==null&&r.jsxs(Zt,{x:O[h]+T/2,y:Math.max(C(A.count)-8,40),width:c,above:!0,children:[r.jsxs("span",{className:"ctip-title",children:[r.jsx("span",{className:"sv-swatch",style:{background:zn[A.sv_class],opacity:A.clustered?.5:1},"aria-hidden":!0}),Ux(A)]}),r.jsxs("span",{className:"ctip-row",children:[r.jsx("span",{children:"Rearrangements"}),r.jsx("b",{children:A.count.toLocaleString("en-US")})]}),l>0&&r.jsxs("span",{className:"ctip-row",children:[r.jsx("span",{children:"Of all of them"}),r.jsxs("b",{children:[B===0&&A.count>0?"<1":B,"%"]})]})]})]})}function $S(n,l,a){return`${n.toLocaleString("en-US")} ${n===1?l:a}`}function PT({categories:n,total:l}){const[a,o]=M.useState(null),c=HT(n);return r.jsxs("div",{className:"sv-sigs",children:[r.jsxs("div",{className:"sv-sigs-head",children:[r.jsxs("h3",{className:"sv-h",children:["Rearrangement signatures",r.jsx("span",{className:"sv-h-n",children:$S(l,"rearrangement","rearrangements")})]}),r.jsxs("ul",{className:"sv-sigs-key","aria-label":"Classes",onMouseLeave:()=>o(null),children:[c.map(({sv_class:d,count:h})=>r.jsxs("li",{"data-on":a===d||void 0,onMouseEnter:()=>o(d),children:[r.jsx("span",{className:"sv-swatch",style:{background:zn[d]},"aria-hidden":!0}),$a[d],r.jsx("span",{className:"sv-key-n",children:h.toLocaleString("en-US")})]},d)),r.jsx("li",{className:"sv-sigs-note",children:"Lighter bars: clustered"})]})]}),r.jsx("div",{className:"sv-sigs-plot",children:r.jsx(YT,{categories:n,total:l,litClass:a})})]})}function XT({data:n,query:l,onQuery:a,onLocate:o}){const[c,d]=M.useState([]),h=j=>d(b=>b.includes(j)?b.filter(N=>N!==j):[...b,j]),m=j=>j.filter(b=>zT(b,l)),g=j=>c.length?j.filter(b=>b.role&&c.includes(b.role)):j,x=[...n.onco,...n.whole_gene],v=[...m(n.onco),...m(n.whole_gene)],y=g(m(n.onco)),S=g(m(n.whole_gene));return x.length===0?r.jsx("p",{className:"sv-empty",children:"No rearrangements with breakpoints in oncogenes or tumour suppressors."}):r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"tbar",children:[v.length>0&&r.jsx(VT,{rows:v,shown:c,onToggle:h}),r.jsx($u,{value:l,onChange:a,label:"Search structural variants",placeholder:"Search gene, caller or locus",shortcut:!1})]}),v.length===0&&r.jsxs("div",{className:"vt-empty sv-empty",children:["No rows match this search.",r.jsx("button",{type:"button",className:"sc-btn sc-b2 sm",onClick:()=>a(""),children:"Clear the search"})]}),y.length>0&&r.jsxs("section",{className:"sv-table","aria-label":"Rearranged oncogenes and tumour suppressors",children:[r.jsx("h3",{className:"sv-h",children:"Rearranged oncogenes and tumour suppressors"}),r.jsx(Vx,{kind:"onco",rows:y,total:n.onco.length,query:l,onLocate:o})]}),S.length>0&&r.jsxs("section",{className:"sv-table","aria-label":"Whole-gene rearrangements",children:[r.jsx("h3",{className:"sv-h",children:"Whole-gene rearrangements"}),r.jsx(Vx,{kind:"whole_gene",rows:S,total:n.whole_gene.length,query:l,onLocate:o})]})]})}const KT=M.forwardRef(function({envelope:l,loading:a,picked:o,onLocate:c},d){const h=(l==null?void 0:l.status)==="ok"?l.data:null,[m,g]=M.useState("");return r.jsx(uo,{ref:d,title:"Structural variants",subtitle:h?$S(h.rearrangements,"rearrangement","rearrangements"):void 0,lineage:(l==null?void 0:l.lineage)??[],picked:o,info:"structuralVariants",className:"svs",expandable:!0,children:r.jsx(Vl,{label:"structural variants",envelope:l,loading:a,skeletonHeight:220,children:x=>r.jsxs("div",{className:"sv-body",children:[r.jsx(XT,{data:x,query:m,onQuery:g,onLocate:c}),x.signatures&&r.jsx(PT,{categories:x.signatures.categories,total:x.signatures.total})]})})})}),Bx=["C>A","C>G","C>T","T>A","T>C","T>G"],wa={"C>A":"#03bcee","C>G":"#222222","C>T":"#e32926","T>A":"#999999","T>C":"#a1ce63","T>G":"#e9a9a5"};function ZT(n,l){const a=n.contexts.every(g=>g.reconstructed!==null),o=n.contexts.reduce((g,x)=>g+x.observed,0),c=a?n.contexts.reduce((g,x)=>g+(x.reconstructed??0),0):0,d=n.contexts.map(g=>l==="share"?o?g.observed/o*100:0:g.observed),h=a?n.contexts.map(g=>l==="share"?c?(g.reconstructed??0)/c*100:0:g.reconstructed??0):null,m=h?d.map((g,x)=>g-h[x]):null;return{observed:d,reconstructed:h,difference:m,top:Math.max(0,...d,...h??[]),reach:m?Math.max(0,...m.map(Math.abs)):0}}function JT(n){const l=[];return n.forEach((a,o)=>{const c=l[l.length-1];c&&c.substitution===a.substitution?c.end=o:l.push({substitution:a.substitution,start:o,end:o})}),l}function WT(n,l,a,o=10){const c=l-o*(n.length-1),d=y=>y.end-y.start+1,h=n.reduce((y,S)=>y+d(S),0),m=a?n.find(y=>y.substitution===a):void 0,g=m?Math.min(.62,Math.max(.4,d(m)*30/c)):0,x=[];let v=0;for(const y of n){const S=d(y),j=m?y===m?c*g:c*(1-g)*S/(h-d(m)):c*S/h,b=j/S;for(let N=0;N<S;N++)x.push({x:v+N*b+b*.11,width:b*.78});v+=j+o}return x}function am(n){return[n.five_prime,n.substitution[0],n.three_prime]}function im(n,l){return l==="count"?Math.round(n).toLocaleString("en-US"):`${n.toFixed(n>=10?1:2)}%`}function Gx(n,l){return n==="cosine"?l.toFixed(3):l.toExponential(2).replace("e-","e−").replace("e+","e")}const xn=46,e_=6,va=28,om=14,qs=96,ki=84,t_=["This tumour","Rebuilt from its signatures","Difference"],n_={reported:"Reported run",unfiltered:"Unfiltered"};function s_({data:n}){const[l,a]=Es(760),[o,c]=M.useState("share"),[d,h]=M.useState("reported"),[m,g]=M.useState(null),[x,v]=M.useState(null),y=n.runs.find(se=>se.source===d)??n.runs[0],S=n.reconstructed&&y.contexts.every(se=>se.reconstructed!==null),j=M.useMemo(()=>ZT(y,o),[y,o]),b=M.useMemo(()=>JT(y.contexts),[y]),N=Math.max(a-xn-e_,240),T=M.useMemo(()=>WT(b,N,m,om),[b,N,m]),O=S?3:1,_=m?22:0,D=[va,va+qs+om,va+2*(qs+om)],C=(S?D[2]+ki:D[0]+qs)+_+8,E=o==="share"?"%":"",R=Pu(j.top,2),A=R[R.length-1],B=Math.max(j.reach*1.15,o==="share"?.5:1),K=(se,P)=>P===2?ki/2*(1-se/B):qs*(1-se/A),k=[j.observed,j.reconstructed,j.difference],ie=x===null?null:y.contexts[x],oe=se=>xn+T[se].x+T[se].width/2;return r.jsxs("section",{className:"ctx sig-section","aria-label":"96 mutational contexts",children:[r.jsxs("div",{className:"ctx-head",children:[r.jsxs("h3",{className:"sv-h",children:["96 mutational contexts",r.jsxs("span",{className:"sv-h-n",children:[Math.round(y.total).toLocaleString("en-US")," SNVs"]})]}),r.jsxs("div",{className:"ctx-controls",children:[S&&n.fit&&r.jsxs("span",{className:"ctx-fit",title:"How well the fitted signatures rebuild the profile, as the report measures it",children:[n.fit.cosine!==null&&r.jsxs("span",{children:["Cosine similarity ",r.jsx("b",{children:Gx("cosine",n.fit.cosine)})]}),n.fit.rss!==null&&r.jsxs("span",{children:["RSS ",r.jsx("b",{children:Gx("rss",n.fit.rss)})]})]}),n.runs.length>1&&r.jsx(Bl,{label:"Run",value:d,onChange:h,options:n.runs.map(se=>({value:se.source,label:n_[se.source]}))}),r.jsx(Bl,{label:"Profile measure",value:o,onChange:c,options:[{value:"share",label:"Share"},{value:"count",label:"Count"}]})]})]}),r.jsx("div",{className:"ctx-wrap",children:r.jsxs("div",{ref:l,className:"ctx-plot",onMouseLeave:()=>v(null),children:[r.jsxs("svg",{width:a,height:C,role:"img","aria-label":`SNVs in the 96 mutational contexts${S?", observed and rebuilt from signatures":""}`,children:[r.jsx("g",{transform:`translate(${xn} 0)`,children:b.map(se=>{const P=T[se.start],le=T[se.end],$=P.x-P.width*.14,J=le.x+le.width*1.14,Z=m===se.substitution;return r.jsxs("g",{className:"ctx-chip","data-on":Z||void 0,role:"button",tabIndex:0,"aria-pressed":Z,"aria-label":`${se.substitution}: ${Z?"show all classes":"label its sixteen contexts"}`,onClick:()=>g(Z?null:se.substitution),onKeyDown:W=>{(W.key==="Enter"||W.key===" ")&&(W.preventDefault(),g(Z?null:se.substitution))},children:[r.jsx("rect",{x:$,y:0,width:Math.max(J-$,1),height:22,rx:11}),r.jsx("circle",{cx:$+11,cy:11,r:4.5,fill:wa[se.substitution]}),r.jsx("text",{x:$+22,y:15,children:se.substitution})]},se.substitution)})}),Array.from({length:O},(se,P)=>{const le=D[P],$=P===2?ki:qs,J=k[P];return J?r.jsxs("g",{transform:`translate(0 ${le})`,className:"ctx-panel",children:[P<2?R.map(Z=>r.jsxs("g",{children:[r.jsx("line",{x1:xn,x2:xn+N,y1:K(Z,P),y2:K(Z,P),className:Z===0?"ctx-base":"ctx-grid"}),r.jsxs("text",{x:xn-8,y:K(Z,P)+4,textAnchor:"end",className:"ctx-tick",children:[Z,E]})]},Z)):r.jsxs(r.Fragment,{children:[r.jsx("line",{x1:xn,x2:xn+N,y1:$/2,y2:$/2,className:"ctx-base"}),r.jsx("text",{x:xn-8,y:$/2+4,textAnchor:"end",className:"ctx-tick",children:"0"})]}),r.jsx("text",{x:xn+2,y:12,className:"ctx-name",children:t_[P]}),r.jsx("g",{className:"ctx-bars","data-hover":x!==null||void 0,children:J.map((Z,W)=>{const ae=T[W],de=xn+ae.x,ve=P===2?$/2:$,je=K(Z,P),L=wa[y.contexts[W].substitution],U=Math.abs(ve-je);return r.jsx("rect",{x:de,y:Math.min(je,ve),width:ae.width,height:Math.max(U,Z===0?0:.8),rx:Math.min(2,ae.width/2),fill:L,className:"ctx-bar","data-on":x===W||void 0,"data-dim":m&&y.contexts[W].substitution!==m?"":void 0},W)})})]},P):null}),x!==null&&r.jsx("rect",{x:xn+T[x].x-2,y:va-4,width:T[x].width+4,height:(S?D[2]+ki:D[0]+qs)-va+8,rx:4,className:"ctx-column",pointerEvents:"none"}),m&&y.contexts.map((se,P)=>se.substitution===m?r.jsxs("text",{x:xn+T[P].x+T[P].width/2,y:(S?D[2]+ki:D[0]+qs)+16,textAnchor:"middle",className:"ctx-tri",children:[am(se)[0],r.jsx("tspan",{className:"ctx-tri-mid",style:{fill:wa[se.substitution]},children:am(se)[1]}),am(se)[2]]},P):null),T.map((se,P)=>r.jsx("rect",{x:xn+se.x-(se.width*.14+1),y:va,width:se.width*1.28+2,height:(S?D[2]+ki:D[0]+qs)-va,fill:"transparent",className:"ctx-hit",tabIndex:0,"aria-label":`${y.contexts[P].context}: ${y.contexts[P].observed} SNVs`,onMouseEnter:()=>v(P),onFocus:()=>v(P),onBlur:()=>v(null)},P))]}),ie&&x!==null&&r.jsxs(Zt,{x:oe(x),y:D[0]+qs/2,width:a,children:[r.jsxs("span",{className:"ctip-title",children:[r.jsx("span",{className:"sv-swatch",style:{background:wa[ie.substitution]},"aria-hidden":!0}),r.jsx("span",{className:"mono",children:ie.context})]}),r.jsxs("span",{className:"ctip-row",children:[r.jsx("span",{children:"Observed"}),r.jsxs("b",{children:[im(j.observed[x],o),r.jsxs("i",{children:[" ",o==="share"?`${ie.observed.toLocaleString("en-US")} SNVs`:""]})]})]}),j.reconstructed&&j.difference&&r.jsxs(r.Fragment,{children:[r.jsxs("span",{className:"ctip-row",children:[r.jsx("span",{children:"Rebuilt"}),r.jsx("b",{children:im(j.reconstructed[x],o)})]}),r.jsxs("span",{className:"ctip-note",children:[j.difference[x]>=0?"Observed above":"Observed below"," the signatures by"," ",im(Math.abs(j.difference[x]),o).replace("%",o==="share"?" points":"")]})]})]})]})}),!S&&r.jsx("p",{className:"ctx-note",children:"Only the observed profile is shown: this report did not include the signature matrix its fit used, so what the signatures rebuild cannot be drawn."})]})}const Sa=n=>n==null?"–":n.toFixed(2),l_=8,a_=250,Ie={w:232,h:148,cx:116,cy:122,r:92};function rm(n,l){const a=qi(Ie.cx,Ie.cy,Ie.r,n),o=qi(Ie.cx,Ie.cy,Ie.r,l);return`M${a.x.toFixed(2)},${a.y.toFixed(2)} A${Ie.r},${Ie.r} 0 0 1 ${o.x.toFixed(2)},${o.y.toFixed(2)}`}function i_({score:n}){const l=n.value===null?null:n.exact??n.value,a=l===null?null:Math.min(Math.max(l,0),1),o=HM(n),c=n.value!==null&&o!==n.value.toFixed(2),d=UM(n),h=n.rating==="HIGH",m=n.threshold,g=m===null?null:[qi(Ie.cx,Ie.cy,Ie.r-14,m),qi(Ie.cx,Ie.cy,Ie.r+14,m),qi(Ie.cx,Ie.cy,Ie.r+27,m)],x=a===null?null:qi(Ie.cx,Ie.cy,Ie.r,a);return r.jsxs("div",{className:"hrd-score","data-high":h||void 0,children:[r.jsxs("div",{className:"hrd-score-head",children:[r.jsx("span",{className:"hrd-name",children:n.name}),n.rating&&r.jsx("span",{className:`sc-pill ${h?"p-warn":"p-neu"}`,children:n.rating})]}),r.jsxs("svg",{width:Ie.w,height:Ie.h,viewBox:`0 0 ${Ie.w} ${Ie.h}`,role:"img","aria-label":`${n.name} ${a===null?"has no score":`scores ${o}`}${n.rating?`, rated ${n.rating}`:""}`,className:"hrd-gauge",children:[r.jsx("path",{d:rm(0,1),pathLength:1,className:"hrd-track"}),m!==null&&r.jsx("path",{d:rm(m,1),pathLength:1,className:"hrd-zone"}),a!==null&&r.jsx("path",{d:rm(0,1),pathLength:1,className:"hrd-fill",style:{"--v":a}}),g&&r.jsxs(r.Fragment,{children:[r.jsx("line",{x1:g[0].x,y1:g[0].y,x2:g[1].x,y2:g[1].y,className:"hrd-tick"}),r.jsx("text",{x:g[2].x,y:g[2].y+4,textAnchor:"middle",className:"hrd-tick-label",children:m})]}),x&&r.jsx("circle",{cx:x.x,cy:x.y,r:8.5,className:"hrd-end"}),r.jsx("text",{x:Ie.cx,y:Ie.cy-10,textAnchor:"middle",className:"hrd-num",children:o}),r.jsx("text",{x:Ie.cx-Ie.r,y:Ie.cy+18,textAnchor:"middle",className:"hrd-end-label",children:"0"}),r.jsx("text",{x:Ie.cx+Ie.r,y:Ie.cy+18,textAnchor:"middle",className:"hrd-end-label",children:"1"})]}),(d||c)&&r.jsxs("span",{className:"hrd-rule",children:[d,c&&r.jsxs("span",{className:"hrd-rounded",children:["The report rounds it to ",Sa(n.value)]})]})]})}function o_(n){const l=n.filter(a=>a.stats&&a.stats.tumour!==null);return{above:l.filter(a=>a.stats.tumour>a.stats.median).length,of:l.length}}const r_="var(--font)";function c_({features:n}){var D;const[l,a]=Es(720),[o,c]=M.useState(null),d=n.map(C=>({feature:C,stats:yS(C)})),h=a<640,m=h?0:116,g=h?0:168,x=m+10,v=a-g-14,y=C=>x+C*(v-x),S=h?28:0,j=h?100:70,b=S+38,N=30,T=d.length*j+14,O=T+22,_=o===null?null:d[o];return r.jsxs("div",{ref:l,className:"clouds",onMouseLeave:()=>c(null),children:[r.jsxs("svg",{width:a,height:O,role:"img","aria-label":"HRDetect features against the cohort",style:{fontFamily:r_},children:[[0,.25,.5,.75,1].map(C=>r.jsx("line",{x1:y(C),x2:y(C),y1:0,y2:T,className:"cloud-grid","data-major":C===0||C===1||void 0},C)),d.map(({feature:C,stats:E},R)=>{var se;const A=R*j,B=wx(C.feature),K=E&&E.values.length<=a_?E.values:[],k=kM(K.map(y),7.5),ie=E&&E.values.length>=l_?$M(E.values):null,oe=E&&E.tumour!==null?y(E.tumour):null;return r.jsxs("g",{transform:`translate(0 ${A})`,className:"cloud-row","data-on":o===R||void 0,onMouseEnter:()=>c(R),children:[r.jsx("rect",{x:0,y:2,width:a,height:j-4,rx:12,className:"cloud-hit"}),E&&r.jsxs(r.Fragment,{children:[r.jsx("rect",{x:y(E.q1),y:S+4,width:Math.max(y(E.q3)-y(E.q1),2),height:j-S-10,rx:8,className:"cloud-iqr"}),r.jsx("line",{x1:y(E.median),x2:y(E.median),y1:S+10,y2:j-14,className:"cloud-median"}),ie&&r.jsxs(r.Fragment,{children:[r.jsx("path",{d:`M${y(0)},${b} ${ie.map(P=>`L${y(P.x).toFixed(1)},${(b-P.y*N).toFixed(1)}`).join(" ")} L${y(1)},${b} Z`,className:"cloud-area"}),r.jsx("path",{d:ie.map((P,le)=>`${le?"L":"M"}${y(P.x).toFixed(1)},${(b-P.y*N).toFixed(1)}`).join(" "),className:"cloud-line"})]}),K.map((P,le)=>r.jsx("circle",{cx:y(P),cy:b+11+Math.min(k[le],2)*7,r:3,className:"cloud-dot"},le)),oe!==null&&r.jsxs("g",{className:"cloud-pin",transform:`translate(${oe} 0)`,children:[r.jsx("line",{y1:S+8,y2:b,className:"cloud-stem"}),r.jsx("circle",{cy:b,r:8,className:"cloud-pin-dot"})]})]}),r.jsx("text",{x:h?4:6,y:h?18:b-6,className:"cloud-name",children:B}),!h&&r.jsxs("text",{x:6,y:b+10,className:"cloud-raw",children:["raw ",Sa((se=C.sample)==null?void 0:se.raw)]}),E&&r.jsx("text",{x:a-4,y:h?18:b-6,textAnchor:"end",className:"cloud-rank",children:Vh(E)}),!h&&E&&r.jsxs("text",{x:a-4,y:b+10,textAnchor:"end",className:"cloud-raw",children:["of ",E.values.length," in the cohort"]})]},C.feature)}),r.jsxs("g",{transform:`translate(0 ${T})`,className:"cloud-axis",children:[r.jsx("text",{x:y(0),y:12,textAnchor:"start",children:"0 · cohort lowest"}),r.jsx("text",{x:y(.5),y:12,textAnchor:"middle",children:"0.5"}),r.jsx("text",{x:y(1),y:12,textAnchor:"end",children:"cohort highest · 1"})]})]}),_&&o!==null&&_.stats&&r.jsxs(Zt,{x:_.stats.tumour!==null?y(_.stats.tumour):y(_.stats.median),y:o*j+b,width:a,children:[r.jsx("span",{className:"ctip-title",children:wx(_.feature.feature,"long")}),r.jsxs("span",{className:"ctip-row",children:[r.jsx("span",{children:"This tumour"}),r.jsxs("b",{children:[Sa((D=_.feature.sample)==null?void 0:D.raw)," ",r.jsxs("i",{children:["scaled ",Sa(_.stats.tumour)]})]})]}),r.jsxs("span",{className:"ctip-row",children:[r.jsx("span",{children:"Cohort median"}),r.jsx("b",{children:Sa(_.stats.median)})]}),r.jsxs("span",{className:"ctip-row",children:[r.jsx("span",{children:"Middle half"}),r.jsxs("b",{children:[Sa(_.stats.q1),"–",Sa(_.stats.q3)]})]}),Vh(_.stats)&&r.jsx("span",{className:"ctip-note",children:Vh(_.stats)})]})]})}const vr=n=>`${(n*100).toFixed(n>=.1||n===0?0:1)}%`,xr=n=>Math.round(n).toLocaleString("en-US"),u_=n=>`${n>=0?"+":"−"}${Math.abs(n).toFixed(Math.abs(n)>=10?0:1)}`,qx=3,Hi=26,Ui=52;function f_({groups:n,bands:l,lit:a,onLight:o}){const[c,d]=Es(),h=n.find(R=>R.group==="sample")??n[0],m=n.find(R=>R.group==="cohort")??null,g=m!==null,x=d>=440,v=x?d>=620?118:92:0,y=g?330:230,S=Mx(l.map(R=>R.share),y,qx),j=g?Mx(l.map(R=>R.cohortShare??0),y,qx):[],b=g?v:0,N=d-v-Hi,T=b+Hi,O=N,_=l.find(R=>R.name===a)??null,D=_?l.indexOf(_):-1,C=D<0?0:Ui+((S[D].y0+S[D].y1)/2+(g?(j[D].y0+j[D].y1)/2:(S[D].y0+S[D].y1)/2))/2,E=(R,A,B,K,k,ie)=>{const oe=R.y1-R.y0;if(!x||oe<17)return null;const se=Ui+(R.y0+R.y1)/2,P=oe>=36;return r.jsxs("text",{x:k,y:se,textAnchor:ie,className:"flow-label",children:[r.jsxs("tspan",{x:k,dy:P?"-0.35em":"0.35em",className:"flow-name",children:[A.name,!P&&r.jsxs("tspan",{className:"flow-share",children:[" ",vr(B)]})]}),P&&r.jsxs("tspan",{x:k,dy:"1.35em",className:"flow-share",children:[vr(B),K]})]})};return r.jsxs("div",{ref:c,className:"flow","data-lit":a??void 0,children:[r.jsxs("svg",{width:d,height:Ui+y+4,role:"img","aria-label":"Signature shares, tumour against cohort",children:[r.jsxs("g",{className:"flow-head",children:[r.jsx("text",{x:0,y:16,className:"flow-col",children:Nx(h)}),r.jsxs("text",{x:0,y:34,className:"flow-sub",children:[xr(h.total)," mutations"]}),m&&r.jsxs(r.Fragment,{children:[r.jsx("text",{x:d,y:16,textAnchor:"end",className:"flow-col",children:Nx(m)}),r.jsxs("text",{x:d,y:34,textAnchor:"end",className:"flow-sub",children:["about ",xr(m.total)," each, on average"]})]})]}),g&&r.jsx("g",{className:"flow-ribs",transform:`translate(0 ${Ui})`,children:l.map((R,A)=>r.jsx("path",{d:LM(T,S[A],O,j[A]),fill:R.colour,className:"flow-rib","data-on":a===R.name||void 0,onMouseEnter:()=>o(R.name),onMouseLeave:()=>o(null)},R.name))}),l.map((R,A)=>{const B=a===R.name||void 0,K=(k,ie)=>k.y1-k.y0>.4&&r.jsx("rect",{x:ie,y:Ui+k.y0,width:Hi,height:k.y1-k.y0,rx:Math.min(5,(k.y1-k.y0)/2),fill:R.colour,className:"flow-seg","data-on":B,tabIndex:0,"aria-label":`${R.name}, ${vr(R.share)} of this tumour`,onMouseEnter:()=>o(R.name),onMouseLeave:()=>o(null),onFocus:()=>o(R.name),onBlur:()=>o(null)});return r.jsxs("g",{className:"flow-band","data-on":B,children:[K(S[A],b),g&&K(j[A],N),E(S[A],R,R.share,R.count?` · ${xr(R.count)}`:"",g?b-10:b+Hi+10,g?"end":"start"),g&&E(j[A],R,R.cohortShare??0,"",N+Hi+10,"start")]},R.name)}),g&&d>=520&&l.map((R,A)=>{const B=Rl(R),K=S[A],k=j[A];if(B===null||Math.abs(B)<5||Math.min(K.y1-K.y0,k.y1-k.y0)<22)return null;const ie=(T+O)/2,oe=Ui+(K.y0+K.y1+k.y0+k.y1)/4;return r.jsxs("g",{transform:`translate(${ie} ${oe})`,className:"flow-delta","data-on":a===R.name||void 0,children:[r.jsx("rect",{x:-30,y:-10,width:60,height:20,rx:10}),r.jsxs("text",{y:4,textAnchor:"middle",children:[u_(B)," pts"]})]},R.name)})]}),_&&r.jsxs(Zt,{x:g?d/2:b+Hi+v+20,y:C,width:d,children:[r.jsxs("span",{className:"ctip-title",children:[r.jsx("span",{className:"sv-swatch",style:{background:_.colour},"aria-hidden":!0}),_.name]}),_.aetiology&&r.jsx("span",{className:"ctip-sub",children:_.aetiology}),r.jsxs("span",{className:"ctip-row",children:[r.jsx("span",{children:"This tumour"}),r.jsxs("b",{children:[vr(_.share)," ",r.jsxs("i",{children:[xr(_.count)," mutations"]})]})]}),_.cohortShare!==null&&r.jsxs("span",{className:"ctip-row",children:[r.jsx("span",{children:"Cohort"}),r.jsxs("b",{children:[vr(_.cohortShare)," ",r.jsx("i",{children:_.cohortCount!==null?`about ${xr(_.cohortCount)} each`:""})]})]}),Rl(_)!==null&&r.jsx("span",{className:"ctip-note",children:Math.abs(Rl(_))<1?"About the same as its cohort":`${Math.abs(Rl(_)).toFixed(Math.abs(Rl(_))>=10?0:1)} points ${Rl(_)>0?"above":"below"} its cohort`})]})]})}const Ix=n=>`${(n*100).toFixed(n>=.1||n===0?0:1)}%`,kS=n=>Math.round(n).toLocaleString("en-US");function d_({points:n,reach:l}){if(n===null)return null;const a=Math.min(Math.abs(n)/l,1)*100;return r.jsx("span",{className:"lead","aria-hidden":!0,children:r.jsx("span",{className:"lead-bar","data-up":n>=0||void 0,style:{width:`${Math.max(a,n===0?0:3)}%`}})})}function h_({groups:n}){const[l,a]=M.useState(null),o=M.useMemo(()=>DM(n),[n]),c=n.find(h=>h.group==="cohort"),d=Math.max(10,...o.map(h=>Math.abs(Rl(h)??0)));return r.jsxs("section",{className:"sig-section","aria-label":"Mutational signatures",children:[r.jsx("h3",{className:"sv-h",children:"Mutational signatures"}),r.jsxs("div",{className:"sig-grid",children:[r.jsx(f_,{groups:n,bands:o,lit:l,onLight:a}),r.jsxs("div",{className:"sig-tablebox",children:[r.jsxs("table",{className:"sig-table",children:[r.jsx("thead",{children:r.jsxs("tr",{children:[r.jsx("th",{children:"Signature"}),r.jsx("th",{className:"n",children:"This tumour"}),c&&r.jsx("th",{className:"n",children:"Cohort"}),c&&r.jsx("th",{className:"lead-h",children:"Against cohort"})]})}),r.jsx("tbody",{children:o.map(h=>{const m=Rl(h);return r.jsxs("tr",{"data-lit":l===h.name||void 0,onMouseEnter:()=>a(h.name),onMouseLeave:()=>a(null),children:[r.jsxs("td",{children:[r.jsxs("span",{className:"sig-name",title:h.members.length>1?h.members.join(", "):void 0,children:[r.jsx("span",{className:"sv-swatch",style:{background:h.colour},"aria-hidden":!0}),h.name]}),h.aetiology&&r.jsx("span",{className:"sig-aetiology",children:h.aetiology})]}),r.jsxs("td",{className:"n",children:[r.jsx("span",{className:"mono",children:Ix(h.share)}),r.jsx("span",{className:"sig-count",children:kS(h.count)})]}),c&&r.jsx("td",{className:"n mono",children:Ix(h.cohortShare??0)}),c&&r.jsx("td",{children:r.jsxs("span",{className:"lead-cell",children:[r.jsx(d_,{points:m,reach:d}),r.jsx("span",{className:"lead-n mono",children:m===null?"":`${m>=0?"+":"−"}${Math.abs(m).toFixed(0)}`})]})})]},h.name)})})]}),r.jsx(Ku,{shown:o.length,total:o.length,noun:["signature","signatures"]})]})]})]})}function m_({envelope:n,loading:l}){return(n==null?void 0:n.status)==="ok"&&n.data?r.jsx(s_,{data:n.data}):n?r.jsxs("section",{className:"sig-section","aria-label":"96 mutational contexts",children:[r.jsx("h3",{className:"sv-h",children:"96 mutational contexts"}),r.jsx("p",{className:"sv-empty",children:n.warnings.join(" ")||"No 96-context profile for this sample."})]}):l?r.jsxs("section",{className:"sig-section","aria-label":"96 mutational contexts",children:[r.jsx("h3",{className:"sv-h",children:"96 mutational contexts"}),r.jsx("div",{className:"px-5 pb-3",children:r.jsx("div",{className:"skeleton",style:{height:220},"aria-label":"Loading 96 mutational contexts"})})]}):null}function g_({hrd:n}){const l=M.useMemo(()=>o_(n.features.map(a=>({feature:a,stats:yS(a)}))),[n.features]);return r.jsxs("section",{className:"sig-section","aria-label":"Homologous recombination deficiency",children:[r.jsx("h3",{className:"sv-h",children:"Homologous recombination deficiency"}),r.jsxs("div",{className:"hrd-body",children:[n.scores.length>0&&r.jsx("div",{className:"hrd-scores",children:n.scores.map(a=>r.jsx(i_,{score:a},a.name))}),n.features.length>0&&r.jsxs("div",{className:"hrd-chart",children:[r.jsxs("div",{className:"sv-sigs-head",children:[r.jsxs("h4",{className:"hrd-sub",children:["HRDetect features against the cohort",n.cohort_n?r.jsxs("span",{className:"sv-h-n",children:["n = ",n.cohort_n]}):null]}),r.jsxs("ul",{className:"sv-sigs-key","aria-label":"Key",children:[r.jsxs("li",{children:[r.jsx("span",{className:"hrd-key-pin","aria-hidden":!0}),"This tumour"]}),r.jsxs("li",{children:[r.jsx("span",{className:"hrd-key-dot","aria-hidden":!0}),"Cohort sample"]}),r.jsxs("li",{children:[r.jsx("span",{className:"hrd-key-band","aria-hidden":!0}),"Middle half of the cohort"]})]})]}),l.of>0&&r.jsxs("p",{className:"hrd-lede",children:["Above the cohort median on ",r.jsx("b",{children:l.above})," of ",l.of," features"]}),r.jsx(c_,{features:n.features})]})]})]})}const p_=M.forwardRef(function({envelope:l,loading:a,contextEnvelope:o,contextLoading:c=!1,picked:d},h){var x;const m=(l==null?void 0:l.status)==="ok"?l.data:null,g=(x=m==null?void 0:m.signatures)==null?void 0:x.find(v=>v.group==="sample");return r.jsx(uo,{ref:h,title:"Signatures and HRD",subtitle:g?`${kS(g.total)} mutations attributed to signatures`:void 0,lineage:Qu(l==null?void 0:l.lineage,o==null?void 0:o.lineage),picked:d,info:"signaturesHrd",className:"sigs",children:r.jsx(Vl,{label:"signatures and HRD",envelope:l,loading:a,skeletonHeight:300,children:v=>r.jsxs("div",{className:"sig-body",children:[v.signatures?r.jsx(h_,{groups:v.signatures}):r.jsx("p",{className:"sv-empty",children:"No signature contributions for this sample."}),r.jsx(m_,{envelope:o,loading:c}),v.hrd&&r.jsx(g_,{hrd:v.hrd})]})})})});function Zm(n){return n.kind==="insertion"?"insertion":n.kind==="complex"?"complex":n.mechanism==="microhomology"?"microhomology":n.mechanism==="repeat"?"repeat":"other deletion"}const Jm=[{key:"microhomology",label:"Deletion, microhomology",colour:"#9f1d2d"},{key:"repeat",label:"Deletion, repeat",colour:"#d6455a"},{key:"other deletion",label:"Deletion, other",colour:"#f19aa6"},{key:"insertion",label:"Insertion",colour:"#1f9a6c"},{key:"complex",label:"Complex",colour:"#8a8a93"}],Qx=Object.fromEntries(Jm.map(n=>[n.key,n.colour]));function Ii(n){switch((n.sv_type??"").toUpperCase()){case"DEL":return"deletion";case"DUP":return"tandem-duplication";case"INV":return"inversion";default:return n.chrom1===n.chrom2?"inversion":"translocation"}}const ju=bn;function Yx(n=null,l=.42,a=.012){var g;const o=ju.reduce((x,[,v])=>x+v,0),c=2*Math.PI-a*ju.length,d=n?((g=ju.find(([x])=>x===n))==null?void 0:g[1])??0:0,h=[];let m=a/2;for(const[x,v]of ju){const y=!n||!d?v/o*c:x===n?c*l:v/(o-d)*c*(1-l);h.push({chrom:x,length:v,a0:m,a1:m+y}),m+=y+a}return h}function y_(n,l,a){return l.map((o,c)=>({...o,a0:n[c].a0+(o.a0-n[c].a0)*a,a1:n[c].a1+(o.a1-n[c].a1)*a}))}function v_(n){return new Map(n.map(l=>[l.chrom,l]))}function Is(n,l,a){const o=n.get(l.replace(/^chr/,""));if(!o)return null;const c=Math.min(Math.max(a/o.length,0),1);return o.a0+c*(o.a1-o.a0)}function Ot(n,l,a,o){return[n+a*Math.sin(o),l-a*Math.cos(o)]}function wu(n,l,a,o,c,d){const h=d-c>Math.PI?1:0,[m,g]=Ot(n,l,o,c),[x,v]=Ot(n,l,o,d),[y,S]=Ot(n,l,a,d),[j,b]=Ot(n,l,a,c),N=T=>T.toFixed(2);return`M${N(m)},${N(g)} A${o},${o} 0 ${h} 1 ${N(x)},${N(v)} L${N(y)},${N(S)} A${a},${a} 0 ${h} 0 ${N(j)},${N(b)} Z`}function x_(n,l,a,o,c){const[d,h]=Ot(n,l,a,o),[m,g]=Ot(n,l,a,c);let x=Math.abs(o-c);x>Math.PI&&(x=2*Math.PI-x);const v=Math.min(x/Math.PI,1),y=(o+c)/2+(Math.abs(o-c)>Math.PI?Math.PI:0),[S,j]=Ot(n,l,a*(1-v*.95),y),b=N=>N.toFixed(2);return`M${b(d)},${b(h)} Q${b(S)},${b(j)} ${b(m)},${b(g)}`}function cm(n,l,a,o){const c=Math.log10(Math.max(n,1));return l+Math.min(c,o)/o*(a-l)}function Px(n,l,a,o){const c=Math.atan2(a-n,l-o);return c<0?c+2*Math.PI:c}function Xx(n,l){return n.find(a=>l>=a.a0&&l<=a.a1)??null}function S_(n,l=12){const a=new Map;return n.forEach((o,c)=>{const d=`${Math.floor(o.x/l)},${Math.floor(o.y/l)}`,h=a.get(d);h?h.push(c):a.set(d,[c])}),(o,c,d=7)=>{const h=Math.floor(o/l),m=Math.floor(c/l);let g=null,x=d*d;for(let v=-1;v<=1;v++)for(let y=-1;y<=1;y++)for(const S of a.get(`${h+v},${m+y}`)??[]){const j=(n[S].x-o)**2+(n[S].y-c)**2;j<=x&&(x=j,g=S)}return g}}const We={ideoIn:.955,rainOut:.93,rainIn:.64,insOut:.625,insIn:.6,delOut:.59,delIn:.565,majOut:.553,majIn:.515,minOut:.505,minIn:.47,link:.455},um=8,b_=560,fm=1e6,Nu=(n,l)=>`chr${n}:${l.toLocaleString("en-US")}`,Kx=n=>n>=1e6?`${(n/1e6).toFixed(1)} Mb`:n>=1e3?`${(n/1e3).toFixed(1)} kb`:`${n} bp`;function j_(n){return n===null||n<2?null:n<4?"color-mix(in srgb, var(--gain) 45%, transparent)":n<8?"color-mix(in srgb, var(--gain) 80%, transparent)":"var(--gain-strong)"}function w_({data:n,drivers:l,size:a,tracks:o,lit:c}){var P,le;const d=M.useRef(null),[h,m]=M.useState(null),[g,x]=M.useState(null),[v,y]=M.useState(()=>Yx()),S=M.useRef(v);S.current=v,M.useLayoutEffect(()=>{const $=Yx(h);if(typeof matchMedia<"u"&&matchMedia("(prefers-reduced-motion: reduce)").matches){y($);return}const Z=S.current,W=performance.now();let ae=0;const de=ve=>{const je=Math.min(1,(ve-W)/b_);y(y_(Z,$,pg(je))),je<1&&(ae=requestAnimationFrame(de))};return ae=requestAnimationFrame(de),()=>cancelAnimationFrame(ae)},[h]);const j=M.useMemo(()=>v_(v),[v]),b=a/2,N=a/2,T=a/2-58,O=$=>T*$,_=M.useMemo(()=>{const $=[];for(const[J,Z]of Object.entries(n.snvs))for(let W=0;W<Z.pos.length;W++){const ae=Is(j,J,Z.pos[W]);if(ae===null)continue;const[de,ve]=Ot(b,N,cm(Z.distance[W],O(We.rainIn),O(We.rainOut),um),ae);$.push({x:de,y:ve,chrom:J,pos:Z.pos[W],substitution:Z.substitution[W],distance:Z.distance[W]})}return $},[n.snvs,j,a]),D=M.useMemo(()=>S_(_),[_]);M.useEffect(()=>{const $=d.current;if(!$)return;const J=typeof window<"u"&&window.devicePixelRatio||1;$.width=a*J,$.height=a*J;const Z=$.getContext("2d");if(Z){if(Z.setTransform(J,0,0,J,0,0),Z.clearRect(0,0,a,a),o.rainfall){const W=h?2.1:1.6;for(const ae of _){const de=c&&(c.kind!=="substitution"||c.value!==ae.substitution);Z.globalAlpha=de?.1:.85,Z.fillStyle=wa[ae.substitution]??"#999",Z.beginPath(),Z.arc(ae.x,ae.y,W,0,2*Math.PI),Z.fill()}}if(o.indels&&n.indels){Z.lineWidth=h?1.6:1.1;for(const W of n.indels){const ae=Is(j,W.chrom,(W.start+W.end)/2);if(ae===null)continue;const de=Zm(W),ve=c&&(c.kind!=="indel"||c.value!==de);Z.globalAlpha=ve?.12:.9,Z.strokeStyle=Qx[de];const je=W.kind==="insertion"?O(We.insIn):O(We.delIn),L=W.kind==="insertion"?O(We.insOut):O(We.delOut),[U,I]=Ot(b,N,je,ae),[re,ce]=Ot(b,N,L,ae);Z.beginPath(),Z.moveTo(U,I),Z.lineTo(re,ce),Z.stroke()}}Z.globalAlpha=1}},[_,n.indels,j,a,o.rainfall,o.indels,c,h,b,N,T]);const C=M.useMemo(()=>{const $=new Map;for(const ae of l)ae.gene&&!$.has(ae.gene)&&$.set(ae.gene,ae);const J=[...$.values()].map(ae=>({d:ae,angle:Is(j,ae.chrom,ae.pos)})).filter(ae=>ae.angle!==null).sort((ae,de)=>ae.angle-de.angle),Z=T+30,W=zu(J.map(ae=>({left:ae.angle*Z,width:Cs(ae.d.gene??"",11,600)+8})),2);return J.map((ae,de)=>({...ae,row:W[de]}))},[l,j,T]),E=n.svs,R=E.map($=>[Is(j,$.chrom1,$.pos1),Is(j,$.chrom2,$.pos2)]),A=h?j.get(h):void 0,B=A?Pu(A.length/fm,8).filter($=>$*fm<=A.length):[],K=$=>{var ve;if((ve=$.target.classList)!=null&&ve.contains("circ-link-hit"))return;const J=$.currentTarget.getBoundingClientRect(),Z=$.clientX-J.left,W=$.clientY-J.top,ae=Math.hypot(Z-b,W-N),de=Px(b,N,Z,W);if(ae>=O(We.ideoIn)&&ae<=T+22){const je=Xx(v,de);x(je?{kind:"chrom",chrom:je.chrom,x:Z,y:W}:null);return}if(o.rainfall&&ae>=O(We.rainIn)-4&&ae<=O(We.rainOut)+4){const je=D(Z,W);if(je!==null){const L=_[je];x({kind:"snv",chrom:L.chrom,pos:L.pos,substitution:L.substitution,distance:L.distance,x:L.x,y:L.y});return}}if(o.indels&&n.indels&&ae>=O(We.delIn)&&ae<=O(We.insOut)){let je=-1,L=.01;if(n.indels.forEach((U,I)=>{const re=Is(j,U.chrom,(U.start+U.end)/2);re!==null&&Math.abs(re-de)<L&&(L=Math.abs(re-de),je=I)}),je>=0){x({kind:"indel",index:je,x:Z,y:W});return}}(g==null?void 0:g.kind)!=="link"&&x(null)},k=$=>!c||c.kind==="sv"&&c.value===Ii($),ie=(g==null?void 0:g.kind)==="chrom"?g.chrom:null,oe=(g==null?void 0:g.kind)==="link"?E[g.index]:null,se=(g==null?void 0:g.kind)==="indel"&&n.indels?n.indels[g.index]:null;return r.jsxs("div",{className:"circ",style:{width:a,height:a},onMouseLeave:()=>x(null),children:[r.jsxs("svg",{width:a,height:a,className:"circ-under","aria-hidden":!0,children:[v.map(($,J)=>r.jsx("path",{d:wu(b,N,O(We.rainIn),O(We.rainOut),$.a0,$.a1),className:"circ-band","data-odd":J%2||void 0,"data-on":ie===$.chrom||h===$.chrom||void 0},$.chrom)),[2,4,6].map($=>r.jsx("circle",{cx:b,cy:N,r:cm(10**$,O(We.rainIn),O(We.rainOut),um),className:"circ-grid"},$))]}),r.jsx("canvas",{ref:d,className:"circ-canvas",style:{width:a,height:a},"aria-hidden":!0}),r.jsxs("svg",{width:a,height:a,className:"circ-over",role:"img","aria-label":`Integrated circos: ${n.snv_total.toLocaleString("en-US")} SNVs, ${((P=n.indels)==null?void 0:P.length)??0} indels, ${E.length} rearrangements`,onMouseMove:K,onClick:$=>{const J=$.currentTarget.getBoundingClientRect(),Z=$.clientX-J.left,W=$.clientY-J.top,ae=Math.hypot(Z-b,W-N);if(ae<O(We.ideoIn)||ae>T+22)return;const de=Xx(v,Px(b,N,Z,W));de&&m(ve=>ve===de.chrom?null:de.chrom)},children:[[2,4,6].map($=>{const[J,Z]=Ot(b,N,cm(10**$,O(We.rainIn),O(We.rainOut),um),0);return r.jsx("text",{x:J+3,y:Z-2,className:"circ-scale",children:$===2?"100 bp":$===4?"10 kb":"1 Mb"},$)}),o.copyNumber&&n.segments.map(($,J)=>{const Z=Is(j,$.chrom,$.start),W=Is(j,$.chrom,$.end);if(Z===null||W===null||W-Z<=0)return null;const ae=j_($.major_cn),de=$.minor_cn===0;return r.jsxs("g",{children:[ae&&r.jsx("path",{d:wu(b,N,O(We.majIn),O(We.majOut),Z,W),style:{fill:ae},className:"circ-cn"}),de&&r.jsx("path",{d:wu(b,N,O(We.minIn),O(We.minOut),Z,W),className:"circ-loh"})]},J)}),o.copyNumber&&r.jsxs(r.Fragment,{children:[r.jsx("circle",{cx:b,cy:N,r:O(We.majIn),className:"circ-ring-line"}),r.jsx("circle",{cx:b,cy:N,r:O(We.minIn),className:"circ-ring-line"})]}),o.links&&E.map(($,J)=>{const[Z,W]=R[J];if(Z===null||W===null)return null;const ae=x_(b,N,O(We.link),Z,W),de=(g==null?void 0:g.kind)==="link"&&g.index===J,ve=Ii($);return r.jsxs("g",{className:"circ-link","data-on":de||void 0,"data-dim":!k($)||void 0,children:[r.jsx("path",{d:ae,style:{stroke:zn[ve]},className:"circ-link-line"}),r.jsx("path",{d:ae,className:"circ-link-hit",onMouseEnter:je=>{const L=je.currentTarget.ownerSVGElement.getBoundingClientRect();x({kind:"link",index:J,x:je.clientX-L.left,y:je.clientY-L.top})},onMouseLeave:()=>x(null)})]},J)}),v.map(($,J)=>{const Z=($.a0+$.a1)/2,[W,ae]=Ot(b,N,T+13,Z),de=($.a1-$.a0)*T;return r.jsxs("g",{className:"circ-chrom","data-on":ie===$.chrom||h===$.chrom||void 0,children:[r.jsx("path",{d:wu(b,N,O(We.ideoIn),T,$.a0,$.a1),className:"circ-ideo","data-odd":J%2||void 0}),de>9&&r.jsx("text",{x:W,y:ae+4,textAnchor:"middle",className:"circ-name",children:$.chrom})]},$.chrom)}),A&&B.map($=>{const J=Is(j,A.chrom,$*fm);if(J===null)return null;const[Z,W]=Ot(b,N,O(We.ideoIn),J),[ae,de]=Ot(b,N,O(We.ideoIn)-6,J),[ve,je]=Ot(b,N,O(We.ideoIn)-15,J);return r.jsxs("g",{className:"circ-mb",children:[r.jsx("line",{x1:Z,y1:W,x2:ae,y2:de}),r.jsx("text",{x:ve,y:je+3,textAnchor:"middle",children:$})]},$)}),C.map(({d:$,angle:J,row:Z})=>{const[W,ae]=Ot(b,N,T+2,J),[de,ve]=Ot(b,N,T+24+Z*13,J),[je,L]=Ot(b,N,T+28+Z*13,J),U=Math.sin(J)>=0;return r.jsxs("g",{className:"circ-driver",children:[r.jsx("line",{x1:W,y1:ae,x2:de,y2:ve}),r.jsx("text",{x:je,y:L+4,textAnchor:U?"start":"end",children:$.gene})]},$.gene)}),h&&r.jsxs("text",{x:b,y:N+4,textAnchor:"middle",className:"circ-centre",children:["chr",h," · click it again to close"]})]}),(g==null?void 0:g.kind)==="snv"&&r.jsxs(Zt,{x:g.x,y:g.y,width:a,children:[r.jsxs("span",{className:"ctip-title",children:[r.jsx("span",{className:"sv-swatch",style:{background:wa[g.substitution]},"aria-hidden":!0}),g.substitution," SNV"]}),r.jsxs("span",{className:"ctip-row",children:[r.jsx("span",{children:"Position"}),r.jsx("b",{className:"mono",children:Nu(g.chrom,g.pos)})]}),r.jsxs("span",{className:"ctip-row",children:[r.jsx("span",{children:"From the SNV before"}),r.jsx("b",{children:Kx(g.distance)})]})]}),se&&g&&r.jsxs(Zt,{x:g.x,y:g.y,width:a,children:[r.jsxs("span",{className:"ctip-title",children:[r.jsx("span",{className:"sv-swatch",style:{background:Qx[Zm(se)]},"aria-hidden":!0}),se.kind==="deletion"?`Deletion, ${se.mechanism==="none"?"other":se.mechanism}`:se.kind==="insertion"?"Insertion":"Complex indel"]}),r.jsxs("span",{className:"ctip-row",children:[r.jsx("span",{children:"Position"}),r.jsx("b",{className:"mono",children:Nu(se.chrom,se.start)})]})]}),oe&&g&&r.jsxs(Zt,{x:g.x,y:g.y,width:a,children:[r.jsxs("span",{className:"ctip-title",children:[r.jsx("span",{className:"sv-swatch",style:{background:zn[Ii(oe)]},"aria-hidden":!0}),$a[Ii(oe)]]}),r.jsxs("span",{className:"ctip-row",children:[r.jsx("span",{children:"From"}),r.jsx("b",{className:"mono",children:Nu(oe.chrom1,oe.pos1)})]}),r.jsxs("span",{className:"ctip-row",children:[r.jsx("span",{children:"To"}),r.jsx("b",{className:"mono",children:Nu(oe.chrom2,oe.pos2)})]}),oe.chrom1===oe.chrom2&&r.jsxs("span",{className:"ctip-row",children:[r.jsx("span",{children:"Spanning"}),r.jsx("b",{children:Kx(Math.abs(oe.pos2-oe.pos1))})]})]}),(g==null?void 0:g.kind)==="chrom"&&r.jsxs(Zt,{x:g.x,y:g.y,width:a,children:[r.jsxs("span",{className:"ctip-title",children:["Chromosome ",g.chrom]}),r.jsxs("span",{className:"ctip-row",children:[r.jsx("span",{children:"SNVs"}),r.jsx("b",{children:(((le=n.snvs[g.chrom])==null?void 0:le.pos.length)??0).toLocaleString("en-US")})]}),r.jsxs("span",{className:"ctip-row",children:[r.jsx("span",{children:"Rearrangements touching it"}),r.jsx("b",{children:E.filter($=>$.chrom1===g.chrom||$.chrom2===g.chrom).length})]}),r.jsx("span",{className:"ctip-note",children:h===g.chrom?"Click to close it":"Click to open it out"})]})]})}const N_=[{key:"rainfall",label:"SNV rainfall"},{key:"indels",label:"Indels"},{key:"copyNumber",label:"Copy number"},{key:"links",label:"Rearrangements"}],Zx=["translocation","inversion","deletion","tandem-duplication"];function Cu({label:n,sub:l,count:a,top:o,colour:c,on:d,onEnter:h,onLeave:m}){return r.jsxs("li",{className:"circ-bar","data-on":d||void 0,onMouseEnter:h,onMouseLeave:m,tabIndex:h?0:void 0,onFocus:h,onBlur:m,children:[r.jsxs("span",{className:"circ-bar-label",children:[r.jsx("span",{className:"sv-swatch",style:{background:c},"aria-hidden":!0}),n,l&&r.jsx("i",{children:l})]}),r.jsx("span",{className:"circ-bar-track",children:r.jsx("span",{style:{width:`${o?a/o*100:0}%`,background:c}})}),r.jsx("span",{className:"circ-bar-n mono",children:a.toLocaleString("en-US")})]})}function C_({data:n,lit:l,onLit:a}){var x;const o=M.useMemo(()=>{const v=Object.fromEntries(Bx.map(y=>[y,0]));for(const y of Object.values(n.snvs))for(const S of y.substitution)v[S]=(v[S]??0)+1;return v},[n.snvs]),c=M.useMemo(()=>{const v=Object.fromEntries(Jm.map(y=>[y.key,0]));for(const y of n.indels??[])v[Zm(y)]+=1;return v},[n.indels]),d=M.useMemo(()=>{const v=Object.fromEntries(Zx.map(y=>[y,0]));for(const y of n.svs)v[Ii(y)]+=1;return v},[n.svs]),h=Math.max(0,...n.signatures.map(v=>v.count??0)),m=()=>a(null),g=(v,y)=>(l==null?void 0:l.kind)===v&&l.value===y;return r.jsxs("div",{className:"circ-panels",children:[r.jsxs("section",{"aria-label":"Substitutions",children:[r.jsxs("h4",{children:["Substitutions ",r.jsx("span",{children:n.snv_total.toLocaleString("en-US")})]}),r.jsx("ul",{children:Bx.map(v=>r.jsx(Cu,{label:v,count:o[v],top:Math.max(...Object.values(o),1),colour:wa[v],on:g("substitution",v),onEnter:()=>a({kind:"substitution",value:v}),onLeave:m},v))}),n.signatures.length>0&&r.jsxs(r.Fragment,{children:[r.jsx("h5",{children:"Top signatures"}),r.jsx("ul",{children:n.signatures.map(v=>r.jsx(Cu,{label:v.signature,sub:v.aetiology,count:Math.round(v.count??0),top:h,colour:"var(--chev)"},v.signature))})]})]}),r.jsxs("section",{"aria-label":"Indels",children:[r.jsxs("h4",{children:["Indels ",r.jsx("span",{children:(((x=n.indels)==null?void 0:x.length)??0).toLocaleString("en-US")})]}),n.indels?r.jsx("ul",{children:Jm.map(v=>r.jsx(Cu,{label:v.label,count:c[v.key],top:Math.max(...Object.values(c),1),colour:v.colour,on:g("indel",v.key),onEnter:()=>a({kind:"indel",value:v.key}),onLeave:m},v.key))}):r.jsx("p",{className:"circ-note",children:"This report did not include WGSPOST's indel classification; rerun it to see indels here."})]}),r.jsxs("section",{"aria-label":"Karyotype",children:[r.jsx("h4",{children:"Karyotype"}),r.jsxs("p",{className:"circ-karyo",children:["Purity ",r.jsx("b",{children:n.purity===null?"–":n.purity.toFixed(2)})," · Ploidy ",r.jsx("b",{children:n.ploidy===null?"–":n.ploidy.toFixed(1)})]}),r.jsxs("ul",{className:"circ-key",children:[r.jsxs("li",{children:[r.jsx("span",{className:"circ-key-gain","aria-hidden":!0})," Gain of the major allele, darker for more copies"]}),r.jsxs("li",{children:[r.jsx("span",{className:"circ-key-loh","aria-hidden":!0})," Loss of heterozygosity (no minor allele)"]})]})]}),r.jsxs("section",{"aria-label":"Rearrangements",children:[r.jsxs("h4",{children:["Rearrangements ",r.jsx("span",{children:n.svs.length.toLocaleString("en-US")})]}),r.jsx("ul",{children:Zx.map(v=>r.jsx(Cu,{label:$a[v],count:d[v],top:Math.max(...Object.values(d),1),colour:zn[v],on:g("sv",v),onEnter:()=>a({kind:"sv",value:v}),onLeave:m},v))})]})]})}const M_=M.forwardRef(function({envelope:l,loading:a,picked:o,drivers:c},d){const[h,m]=Es(900),[g,x]=M.useState({rainfall:!0,indels:!0,copyNumber:!0,links:!0}),[v,y]=M.useState(null),S=m>=860,j=Math.max(280,Math.min(S?m-340:m,680));return r.jsx(uo,{ref:d,title:"Integrated circos",subtitle:"SNVs, indels, copy number and rearrangements around the genome",lineage:(l==null?void 0:l.lineage)??[],picked:o,info:"circos",className:"circos",controls:r.jsx("div",{className:"circ-tracks",role:"group","aria-label":"Tracks",children:N_.map(b=>r.jsx("button",{type:"button",className:"circ-track","aria-pressed":g[b.key],onClick:()=>x(N=>({...N,[b.key]:!N[b.key]})),children:b.label},b.key))}),children:r.jsx("div",{ref:h,children:r.jsx(Vl,{label:"integrated circos",envelope:l,loading:a,skeletonHeight:420,children:b=>r.jsxs("div",{className:"circ-body","data-wide":S||void 0,children:[r.jsxs("div",{className:"circ-stage",children:[r.jsx(w_,{data:b,drivers:c,size:j,tracks:g,lit:v}),r.jsx("p",{className:"circ-hint",children:"Click a chromosome to open it out. Closer SNVs sit further in: clusters such as kataegis fall towards the centre."})]}),r.jsx(C_,{data:b,lit:v,onLit:y})]})})})})}),HS=Object.fromEntries([...bn,["Y",59373566]]),Or=Object.keys(HS),Yi=n=>HS[n]??1,E_=2e4;function dm(n){return[1,Yi(n)]}function Nr(n,l,a,o){const c=Math.min(Math.max((n[1]-n[0])*a,E_),o-1),d=(l-n[0])/(n[1]-n[0]||1);return US([l-d*c,l-d*c+c],o)}function hm(n,l,a){return US([n[0]+l,n[1]+l],a)}function US([n,l],a){const o=Math.min(l-n,a-1),c=Math.min(Math.max(n,1),a-o);return[c,c+o]}function T_(n,l,a){return[n[0]+(l[0]-n[0])*a,n[1]+(l[1]-n[1])*a]}function FS([n,l],a=6){const o=(l-n)/a,c=10**Math.floor(Math.log10(o)),d=o/c,h=(d<1.5?1:d<3.5?2:d<7.5?5:10)*c,m=[];for(let g=Math.ceil(n/h)*h;g<=l;g+=h)m.push({value:g,label:h<1e5?`${(g/1e3).toLocaleString("en-US")} kb`:`${+(g/1e6).toFixed(2)} Mb`});return m}function __(n){const l=n.filter(d=>Number.isFinite(d)).sort((d,h)=>d-h);if(!l.length)return[0,4];const a=d=>l[Math.min(l.length-1,Math.max(0,Math.round(d*(l.length-1))))],o=Math.max(0,Math.floor(a(.01))),c=Math.max(Math.ceil(a(.995)),o+1);return[o,c]}function R_(n,l=1){const a=n.filter(d=>Number.isFinite(d)).map(Math.abs).sort((d,h)=>d-h),o=a.length?a[Math.min(a.length-1,Math.floor(.995*(a.length-1)))]:l,c=Math.max(l,Math.ceil(o*2)/2);return[-c,c]}const Jx=n=>n===null?"":`: ${+(n*100).toFixed(1)}%`;function VS(n){if(n.major_cn===null||n.minor_cn===null)return[];const l=[`${n.major_cn}+${n.minor_cn}${Jx(n.clonal_frac)}`];return n.major_cn_2!==null&&n.minor_cn_2!==null&&l.push(`${n.major_cn_2}+${n.minor_cn_2}${Jx(n.clonal_frac_2)}`),l}const jg=n=>n.clonal_frac!==null&&n.clonal_frac<1;function A_(n,l){const a=[];for(const o of n){const c=Ii(o);if(o.chrom1===l&&o.chrom2===l){const[d,h]=o.pos1<=o.pos2?[o.pos1,o.pos2]:[o.pos2,o.pos1],m=c==="inversion"?"lower":"upper",g=c==="tandem-duplication"?!1:c==="inversion"?o.orientation!=="--":!0;a.push({kind:"arc",sv:o,svClass:c,from:d,to:h,lane:m,up:g})}else o.chrom1===l?a.push({kind:"out",sv:o,svClass:c,at:o.pos1,partner:o.chrom2,partnerPos:o.pos2}):o.chrom2===l&&a.push({kind:"out",sv:o,svClass:c,at:o.pos2,partner:o.chrom1,partnerPos:o.pos1})}return a}function BS(n,l){let a=0,o=n.length-1;if(o<0)return-1;for(;a<o;){const c=a+o>>1;n[c]<l?a=c+1:o=c}return a>0&&Math.abs(n[a-1]-l)<=Math.abs(n[a]-l)?a-1:a}const Ys=(()=>{const n={};let l=0;for(const a of Or)n[a]=l,l+=Yi(a);return{offsets:n,total:l}})(),O_=420;function GS({view:n,onView:l,length:a,left:o,plotW:c}){const d=M.useRef(null),[h,m]=M.useState(n.span),g=M.useRef(h);g.current=h,M.useLayoutEffect(()=>{const C=n.span,E=typeof matchMedia<"u"&&matchMedia("(prefers-reduced-motion: reduce)").matches;if(!n.smooth||E){m(C);return}const R=g.current,A=performance.now();let B=0;const K=k=>{const ie=Math.min(1,(k-A)/O_);m(T_(R,C,pg(ie))),ie<1&&(B=requestAnimationFrame(K))};return B=requestAnimationFrame(K),()=>cancelAnimationFrame(B)},[n]);const x=M.useCallback(C=>o+(C-h[0])/(h[1]-h[0])*c,[h,o,c]),v=M.useCallback(C=>h[0]+(C-o)/c*(h[1]-h[0]),[h,o,c]),y=M.useCallback(C=>l({span:C,smooth:!1}),[l]),S=M.useCallback(C=>l({span:C,smooth:!0}),[l]),j=h[1]-h[0]<a-1,b=M.useRef({shown:h,plotW:c,left:o,move:y,length:a});b.current={shown:h,plotW:c,left:o,move:y,length:a},M.useEffect(()=>{const C=d.current;if(C)return pS(C,()=>{const E=b.current,R=E.shown[1]-E.shown[0];return{inside:A=>A>=E.left&&A<=E.left+E.plotW,zoom:(A,B)=>{const K=Nr(E.shown,E.shown[0]+(B-E.left)/E.plotW*R,A,E.length);return Math.abs(K[0]-E.shown[0])<1&&Math.abs(K[1]-E.shown[1])<1?!1:(E.move(K),!0)},pan:A=>E.move(hm(E.shown,A/E.plotW*R,E.length))}})},[]);const N=C=>{var E;return C.clientX-(((E=d.current)==null?void 0:E.getBoundingClientRect().left)??0)},T=M.useRef(!1);return{box:d,shown:h,x,posAt:v,localX:N,glide:S,zoomed:j,dragged:T,handlers:{onPointerDown:C=>{if(C.button!==0||!j)return;const E=h;Du(C,R=>y(hm(E,-(R/c)*(E[1]-E[0]),a)),R=>{R&&(T.current=!0,setTimeout(()=>T.current=!1,0))})},onDoubleClick:C=>{const E=N(C);E>=o&&E<=o+c&&S(Nr(h,v(E),.5,a))},onKeyDown:C=>{const E=(h[0]+h[1])/2,R=h[1]-h[0];if(C.key==="ArrowLeft"||C.key==="ArrowRight")y(hm(h,(C.key==="ArrowLeft"?-.15:.15)*R,a));else if(C.key==="+"||C.key==="=")S(Nr(h,E,.6,a));else if(C.key==="-")S(Nr(h,E,1/.6,a));else if(C.key==="0"||C.key==="Home")S([1,a]);else return;C.preventDefault()}}}}const Ve=52,wg=14,Fi=150,Vi=96,xa=170,z_=26,Sr=n=>Math.round(n).toLocaleString("en-US"),D_=n=>`${+(n/1e6).toFixed(n<1e7?3:2)} Mb`;function L_(n,l,a){return!n||typeof getComputedStyle>"u"?a:getComputedStyle(n).getPropertyValue(l).trim()||a}function Wm({width:n,height:l,top:a,xs:o,ys:c,colour:d,radius:h=1.3,alpha:m=.5,label:g}){const x=M.useRef(null);return M.useEffect(()=>{const v=x.current;if(!v)return;const y=typeof window<"u"&&window.devicePixelRatio||1;v.width=Math.round(n*y),v.height=Math.round(l*y);const S=v.getContext("2d");if(S){S.setTransform(y,0,0,y,0,0),S.clearRect(0,0,n,l),S.fillStyle=d.startsWith("--")?L_(v,d,"#666"):d,S.globalAlpha=m;for(let j=0;j<o.length;j++){const b=o[j];b<Ve-h||b>n-wg+h||!Number.isFinite(c[j])||(S.beginPath(),S.arc(b,c[j],h,0,2*Math.PI),S.fill())}S.globalAlpha=1}},[n,l,o,c,d,h,m]),r.jsx("canvas",{ref:x,className:"cnsv-dots",style:{top:a,width:n,height:l},"aria-label":g,role:"img"})}function $_({data:n,width:l,view:a,onView:o}){const c=M.useId(),d=Yi(n.chrom),h=Math.max(l-Ve-wg,200),{box:m,shown:g,x,posAt:v,localX:y,glide:S,zoomed:j,dragged:b,handlers:N}=GS({view:a,onView:o,length:d,left:Ve,plotW:h}),T=0,O=Fi+10,_=O+Vi,D=_+xa,C=D+z_,E=O+Vi*.4,R=O+Vi*.8,A=I=>T+8+(1-I)*(Fi-16),[B,K]=M.useMemo(()=>{var I;return __(((I=n.depth)==null?void 0:I.cn)??[])},[n.depth]),k=I=>_+6+(1-(Math.min(Math.max(I,B),K)-B)/(K-B))*(xa-12),ie=M.useMemo(()=>n.baf?n.baf.pos.map(x):[],[n.baf,x]),oe=M.useMemo(()=>n.baf?n.baf.baf.map(A):[],[n.baf]),se=M.useMemo(()=>n.depth?n.depth.start.map((I,re)=>(I+n.depth.end[re])/2):[],[n.depth]),P=M.useMemo(()=>se.map(x),[se,x]),le=M.useMemo(()=>n.depth?n.depth.cn.map(k):[],[n.depth,B,K]),$=M.useMemo(()=>A_(n.svs,n.chrom),[n.svs,n.chrom]),[J,Z]=M.useState(null),W=(J==null?void 0:J.kind)==="sv"?J.mark.sv:null,ae=I=>{var ce,xe;if((xe=(ce=I.target).closest)!=null&&xe.call(ce,".cnsv-sv-hit"))return;const re=y(I);Z(re>=Ve&&re<=Ve+h?{kind:"cursor",x:re,pos:v(re)}:null)},de=I=>{if(b.current)return;const[re,ce]=I.kind==="arc"?[I.from,I.to]:[I.at-5e5,I.at+5e5],xe=Math.max((ce-re)*.4,15e4);S(Nr([re-xe,ce+xe],(re+ce)/2,1,d))},ve=FS(g,Math.max(2,Math.round(h/110))),je=n.segments.filter(I=>I.end>=g[0]&&I.start<=g[1]),L=M.useMemo(()=>{const I=Math.max(1,Math.ceil((K-B)/6)),re=[];for(let ce=B;ce<=K;ce+=I)re.push(ce);return re},[B,K]),U=`${c}-clip`;return r.jsxs("div",{ref:m,className:"cnsv-view",style:{height:C},tabIndex:0,role:"group","aria-label":`Chromosome ${n.chrom}: BAF, rearrangements and read depth. Arrow keys pan, plus and minus zoom.`,"data-zoomed":j||void 0,...N,onPointerMove:ae,onPointerLeave:()=>Z(null),children:[n.baf&&r.jsx(Wm,{width:l,height:Fi,top:T,xs:ie,ys:oe.map(I=>I-T),colour:"--ink-2",alpha:.32,label:"BAF per SNP"}),n.depth&&r.jsx(Wm,{width:l,height:xa,top:_,xs:P,ys:le.map(I=>I-_),colour:"--ink",radius:1.6,alpha:.78,label:"Read-depth copy number"}),r.jsxs("svg",{width:l,height:C,className:"cnsv-svg","aria-hidden":!0,children:[r.jsxs("defs",{children:[r.jsx("clipPath",{id:U,children:r.jsx("rect",{x:Ve,y:0,width:h,height:D})}),r.jsx("marker",{id:`${c}-arrow`,viewBox:"0 0 8 8",refX:"4",refY:"4",markerWidth:"7",markerHeight:"7",orient:"auto",children:r.jsx("path",{d:"M0,8 L4,0 L8,8 Z",fill:"var(--sv-tra)"})})]}),r.jsx("g",{className:"cnsv-grid",children:[0,.25,.5,.75,1].map(I=>r.jsx("line",{x1:Ve,x2:Ve+h,y1:A(I),y2:A(I),"data-mid":I===.5||void 0},I))}),[0,.5,1].map(I=>r.jsx("text",{x:Ve-8,y:A(I)+4,className:"cnsv-ylab",children:I},I)),r.jsx("text",{x:14,y:T+Fi/2,className:"cnsv-track-name",transform:`rotate(-90 14 ${T+Fi/2})`,children:"BAF"}),r.jsx("g",{clipPath:`url(#${U})`,children:je.map(I=>r.jsx(k_,{segment:I,x,y:A},`${I.start}-${I.end}`))}),!n.baf&&r.jsx(mm,{x:Ve+h/2,y:T+Fi/2,text:"No BAF data for this chromosome"}),r.jsx("line",{x1:Ve,x2:Ve+h,y1:E,y2:E,className:"cnsv-lane"}),r.jsx("line",{x1:Ve,x2:Ve+h,y1:R,y2:R,className:"cnsv-lane"}),r.jsx("text",{x:14,y:O+Vi/2,className:"cnsv-track-name",transform:`rotate(-90 14 ${O+Vi/2})`,children:"SVs"}),r.jsx("g",{clipPath:`url(#${U})`,className:"cnsv-svs","data-lit":W?"true":void 0,children:$.map((I,re)=>r.jsx(H_,{mark:I,x,upper:E,lower:R,svTop:O,bottom:_+xa,arrow:`url(#${c}-arrow)`,on:W===I.sv,onEnter:(ce,xe)=>Z({kind:"sv",mark:I,x:ce,y:xe}),onLeave:()=>Z(null),onClick:()=>de(I)},`${I.sv.id??re}-${I.kind}-${re}`))}),$.length===0&&r.jsx(mm,{x:Ve+h/2,y:O+Vi/2,text:"No rearrangements on this chromosome"}),r.jsx("g",{className:"cnsv-bands",children:Array.from({length:K-B+1},(I,re)=>B+re).map(I=>r.jsx("rect",{x:Ve,width:h,y:Math.min(k(I+.5),k(I-.5)),height:Math.abs(k(I-.5)-k(I+.5)),"data-odd":I%2===1||void 0},I))}),L.map(I=>r.jsx("text",{x:Ve-8,y:k(I)+4,className:"cnsv-ylab",children:I},I)),r.jsx("text",{x:14,y:_+xa/2,className:"cnsv-track-name",transform:`rotate(-90 14 ${_+xa/2})`,children:"Copy number"}),r.jsx("g",{clipPath:`url(#${U})`,className:"cnsv-total",children:je.filter(I=>I.total_cn!==null).map(I=>r.jsxs("g",{"data-sub":jg(I)||void 0,children:[r.jsx("line",{x1:x(I.start),x2:x(I.end),y1:k(I.total_cn),y2:k(I.total_cn),className:"cnsv-total-halo"}),r.jsx("line",{x1:x(I.start),x2:x(I.end),y1:k(I.total_cn),y2:k(I.total_cn)})]},`${I.start}-t`))}),!n.depth&&r.jsx(mm,{x:Ve+h/2,y:_+xa/2,text:"No BRASS read depth for this chromosome"}),r.jsx("line",{x1:Ve,x2:Ve+h,y1:D,y2:D,className:"cnsv-axis"}),ve.map(I=>r.jsxs("g",{transform:`translate(${x(I.value)},${D})`,className:"cnsv-tick",children:[r.jsx("line",{y2:4}),r.jsx("text",{y:17,children:I.label})]},I.value)),(J==null?void 0:J.kind)==="cursor"&&r.jsx("line",{x1:J.x,x2:J.x,y1:0,y2:D,className:"cnsv-cursor"})]}),J&&r.jsx(U_,{hot:J,data:n,mids:se,width:l,upper:E})]})}function mm({x:n,y:l,text:a}){return r.jsx("text",{x:n,y:l,className:"cnsv-empty",children:a})}function k_({segment:n,x:l,y:a}){if(n.baf===null)return null;const o=l(n.start),c=l(n.end),d=VS(n),h=d.length>0&&c-o>Math.max(...d.map(x=>Cs(x,11,600)))+10,m=a(n.baf),g=n.baf>.3;return r.jsxs("g",{className:"cnsv-seg","data-sub":jg(n)||void 0,children:[r.jsx("line",{x1:o,x2:c,y1:m,y2:m}),h&&d.map((x,v)=>r.jsx("text",{x:(Math.max(o,Ve)+Math.min(c,1e4))/2,y:g?m+15+v*13:m-8-(d.length-1-v)*13,children:x},x))]})}function H_({mark:n,x:l,upper:a,lower:o,svTop:c,bottom:d,arrow:h,on:m,onEnter:g,onLeave:x,onClick:v}){const y=zn[n.svClass];if(n.kind==="out"){const D=l(n.at),C=`M${D},${o+14} L${D},${c+12}`;return r.jsxs("g",{className:"cnsv-sv","data-on":m||void 0,style:{color:y},children:[r.jsx("line",{x1:D,x2:D,y1:o+14,y2:d,className:"cnsv-drop"}),r.jsx("path",{d:C,className:"cnsv-out",markerEnd:h}),r.jsx("text",{x:D,y:c+6,className:"cnsv-partner",children:n.partner}),r.jsx("path",{d:C,className:"cnsv-sv-hit",onPointerEnter:()=>g(D,c+20),onPointerLeave:x,onClick:v})]})}const S=l(n.from),j=l(n.to),b=n.lane==="upper"?a:o,N=Math.max((j-S)/2,.5),T=Math.min(n.lane==="upper"?30:18,Math.max(5,N*1.6)),O=`M${S},${b} A${N},${T} 0 0 ${n.up?1:0} ${j},${b}`,_=n.up?b-T:b+T;return r.jsxs("g",{className:"cnsv-sv","data-on":m||void 0,style:{color:y},children:[r.jsx("line",{x1:S,x2:S,y1:b,y2:d,className:"cnsv-drop"}),r.jsx("line",{x1:j,x2:j,y1:b,y2:d,className:"cnsv-drop"}),r.jsx("path",{d:O,className:"cnsv-arc"}),r.jsx("path",{d:O,className:"cnsv-sv-hit",onPointerEnter:()=>g((S+j)/2,_),onPointerLeave:x,onClick:v})]})}function U_({hot:n,data:l,mids:a,width:o,upper:c}){if(n.kind==="sv"){const{mark:y}=n,S=y.sv,j=y.kind==="arc"?`${l.chrom}:${Sr(y.from)}–${Sr(y.to)}`:`${l.chrom}:${Sr(y.at)} to ${y.partner}:${Sr(y.partnerPos)}`;return r.jsxs(Zt,{x:n.x,y:n.y,width:o,children:[r.jsxs("b",{children:[r.jsx("span",{className:"sv-swatch",style:{background:zn[y.svClass]},"aria-hidden":!0})," ",$a[y.svClass]]}),r.jsx("span",{className:"mono",children:j}),y.kind==="arc"&&r.jsxs("span",{children:[D_(y.to-y.from)," apart"]}),S.orientation&&r.jsxs("span",{children:["Orientation ",S.orientation]}),r.jsx("i",{children:"Click to fit it in view"})]})}const d=n.pos,h=l.segments.find(y=>y.start<=d&&y.end>=d),m=l.depth&&a.length?BS(a,d):-1,g=l.window??1e5,x=m>=0&&Math.abs(a[m]-d)<=g?l.depth.cn[m]:null,v=h?VS(h):[];return r.jsxs(Zt,{x:n.x,y:c,width:o,children:[r.jsxs("b",{className:"mono",children:[l.chrom,":",Sr(d)]}),h?r.jsxs(r.Fragment,{children:[r.jsxs("span",{children:["Battenberg ",v.join(", ")||"–",jg(h)?" (subclonal)":""]}),r.jsxs("span",{children:["Segment BAF ",h.baf===null?"–":h.baf.toFixed(2),", total copy number ",h.total_cn??"–"]})]}):r.jsx("span",{children:"No Battenberg segment here"}),r.jsxs("span",{children:["Read depth ",x===null?"–":`${x.toFixed(2)} copies`]})]})}const _l=92,Wx=14,F_=26,gm=[{source:"tumour",measure:"logr",label:"LogR"},{source:"tumour",measure:"baf",label:"BAF"},{source:"normal",measure:"logr",label:"LogR"},{source:"normal",measure:"baf",label:"BAF"}],eg={tumour:"Tumour",normal:"Normal"};function V_(n){if(!n)return null;const l={pos:[],baf:[],logr:[],at:[],chrom:[]};for(const a of Or){const o=n[a];if(!o)continue;const c=Ys.offsets[a];for(let d=0;d<o.pos.length;d++)l.pos.push(o.pos[d]),l.baf.push(o.baf[d]),l.logr.push(o.logr[d]),l.at.push(c+o.pos[d]),l.chrom.push(a)}return l}function B_(n,l){return n?{...n,at:n.pos,chrom:n.pos.map(()=>l)}:null}function e1(n){const{width:l}=n,a=Math.max(l-Ve-wg,200),o=n.scope==="genome",c=o?Ys.total:Yi(n.chrom),d=M.useMemo(()=>({span:[0,Ys.total],smooth:!1}),[]),h=GS({view:o?d:n.view,onView:o?()=>{}:n.onView,length:c,left:Ve,plotW:a}),m=o?C=>Ve+C/Ys.total*a:h.x,g=M.useMemo(()=>{var E;const C={};for(const R of["tumour","normal"])C[R]=n.scope==="genome"?V_(n.sources[R]):B_((E=n.raw)==null?void 0:E[R],n.chrom);return C},[n.scope,n.scope==="genome"?n.sources:n.raw]),x=M.useMemo(()=>{var E;const C={};for(const R of["tumour","normal"])C[R]=R_((((E=g[R])==null?void 0:E.logr)??[]).filter(A=>A!==null));return C},[g]),v=C=>C*(_l+Wx)+(C>=2?Wx:0),y=v(gm.length-1)+_l+4,S=y+F_,j=(C,E,R,A)=>{const[B,K]=E==="baf"?[0,1]:x[R]??[-1,1];return 6+(1-(Math.min(Math.max(A,B),K)-B)/(K-B))*(_l-12)},b=M.useMemo(()=>{var E;const C={};for(const R of["tumour","normal"])C[R]=((E=g[R])==null?void 0:E.at.map(m))??[];return C},[g,o?a:h.shown,a]),[N,T]=M.useState(null),O=C=>{const E=h.localX(C);T(E>=Ve&&E<=Ve+a?E:null)},_=o?[]:FS(h.shown,Math.max(2,Math.round(a/110))),D=["tumour","normal"].some(C=>{var E;return(((E=g[C])==null?void 0:E.pos.length)??0)>0});return r.jsxs("div",{ref:h.box,className:"cnsv-view cnsv-raw",style:{height:S},tabIndex:o?void 0:0,role:"group","aria-label":o?"Battenberg's raw LogR and BAF across the genome":`Battenberg's raw LogR and BAF on chromosome ${n.chrom}`,...o?{}:h.handlers,"data-zoomed":!o&&h.zoomed||void 0,onPointerMove:O,onPointerLeave:()=>T(null),children:[gm.map((C,E)=>{const R=g[C.source],A=(R==null?void 0:R[C.measure])??[];return r.jsx(Wm,{width:l,height:_l,top:v(E),xs:b[C.source]??[],ys:A.map(B=>B===null?NaN:j(E,C.measure,C.source,B)),colour:C.source==="tumour"?"--ink-2":"--faint",radius:o?1.05:1.6,alpha:o?.4:.6,label:`${eg[C.source]} ${C.label}`},`${C.source}-${C.measure}`)}),r.jsxs("svg",{width:l,height:S,className:"cnsv-svg","aria-hidden":!0,children:[gm.map((C,E)=>{const R=v(E),[A,B]=C.measure==="baf"?[0,1]:x[C.source]??[-1,1],K=C.measure==="baf"?[0,.5,1]:[A,0,B];return r.jsxs("g",{transform:`translate(0,${R})`,children:[r.jsx("rect",{x:Ve,y:0,width:a,height:_l,className:"cnsv-raw-bg"}),K.map(k=>r.jsxs("g",{children:[r.jsx("line",{x1:Ve,x2:Ve+a,y1:j(E,C.measure,C.source,k),y2:j(E,C.measure,C.source,k),className:"cnsv-raw-grid","data-mid":k===0||k===.5||void 0}),r.jsx("text",{x:Ve-8,y:j(E,C.measure,C.source,k)+4,className:"cnsv-ylab",children:+k.toFixed(1)})]},k)),r.jsx("text",{x:14,y:_l/2,className:"cnsv-track-name",transform:`rotate(-90 14 ${_l/2})`,children:C.label}),C.measure==="logr"&&r.jsx("text",{x:Ve+8,y:14,className:"cnsv-row-caption",children:eg[C.source]})]},`${C.source}-${C.measure}`)}),r.jsx("line",{x1:Ve,x2:Ve+a,y1:y,y2:y,className:"cnsv-axis"}),o?Or.map(C=>{const E=m(Ys.offsets[C]),R=m(Ys.offsets[C]+Yi(C));return r.jsxs("g",{children:[r.jsx("line",{x1:E,x2:E,y1:0,y2:y,className:"cnsv-chrom-sep"}),R-E>12&&r.jsx("text",{x:(E+R)/2,y:y+17,className:"cnsv-chrom-name",onClick:()=>n.scope==="genome"&&n.onPick(C),children:C})]},C)}):_.map(C=>r.jsxs("g",{transform:`translate(${m(C.value)},${y})`,className:"cnsv-tick",children:[r.jsx("line",{y2:4}),r.jsx("text",{y:17,children:C.label})]},C.value)),N!==null&&r.jsx("line",{x1:N,x2:N,y1:0,y2:y,className:"cnsv-cursor"}),!D&&r.jsxs("text",{x:Ve+a/2,y:y/2,className:"cnsv-empty",children:["No raw Battenberg data ",o?"in this report":"for this chromosome"]})]}),N!==null&&r.jsx(G_,{cursor:N,placed:g,at:o?C=>(C-Ve)/a*Ys.total:h.posAt,width:l}),o&&r.jsx("div",{className:"cnsv-chrom-hits",style:{top:y,left:0,width:l},children:Or.map(C=>{const E=m(Ys.offsets[C]),R=m(Ys.offsets[C]+Yi(C));return r.jsx("button",{type:"button",style:{left:E,width:R-E},"aria-label":`Open chromosome ${C}`,onClick:()=>n.scope==="genome"&&n.onPick(C)},C)})})]})}function G_({cursor:n,placed:l,at:a,width:o}){const c=a(n),d=["tumour","normal"].map(m=>{const g=l[m];if(!g||!g.at.length)return null;const x=BS(g.at,c),v=y=>y===null?"–":y.toFixed(2);return{source:m,chrom:g.chrom[x],pos:g.pos[x],text:`LogR ${v(g.logr[x])}, BAF ${v(g.baf[x])}`}}),h=d.find(Boolean);return h?r.jsxs(Zt,{x:n,y:_l,width:o,children:[r.jsxs("b",{className:"mono",children:[h.chrom,":",h.pos.toLocaleString("en-US")]}),d.map(m=>m&&r.jsxs("span",{children:[eg[m.source],": ",m.text]},m.source)),r.jsx("i",{children:"The nearest locus kept"})]}):null}const q_=["deletion","tandem-duplication","inversion","translocation"];function El({kind:n,colour:l,label:a}){return r.jsxs("span",{className:"flex items-center gap-1.5",children:[r.jsx("span",{className:`cnsv-key-${n}`,style:{background:n==="dot"||n==="line"?l:void 0,color:l},"aria-hidden":!0}),a]})}function I_({chrom:n,withData:l,genome:a,allowGenome:o,onPick:c,onGenome:d}){return r.jsxs("div",{className:"cnsv-picker",role:"group","aria-label":"Chromosome",children:[o&&r.jsx("button",{type:"button",className:"cnsv-chip cnsv-chip-genome","aria-pressed":a,onClick:d,children:"Genome"}),Or.map(h=>r.jsx("button",{type:"button",className:"cnsv-chip","aria-pressed":!a&&h===n,"data-empty":!l.has(h)||void 0,"aria-label":`Chromosome ${h}`,onClick:()=>c(h),children:h},h))]})}const Q_=M.forwardRef(function({envelope:l,loading:a,rawGenome:o,rawGenomeLoading:c,picked:d,chrom:h,onChrom:m,mode:g,onMode:x,genome:v,onGenome:y},S){const[j,b]=Es(900),[N,T]=M.useState({span:dm(h),smooth:!1});M.useEffect(()=>T({span:dm(h),smooth:!1}),[h]);const O=dm(h),_=N.span[1]-N.span[0]<O[1]-O[0]-1,D=l==null?void 0:l.data,C=new Set((D==null?void 0:D.chromosomes)??[]),E=g==="raw"&&v,R=A=>{y(!1),m(A)};return r.jsx(uo,{ref:S,title:"Copy number and rearrangements by chromosome",subtitle:g==="integrated"?`BAF, rearrangements and read depth along chromosome ${h}`:E?"Battenberg's raw LogR and BAF across the genome":`Battenberg's raw LogR and BAF along chromosome ${h}`,lineage:(l==null?void 0:l.lineage)??[],picked:d,info:"cnsv",className:"cnsv",controls:r.jsxs(r.Fragment,{children:[_&&!E&&r.jsx("button",{type:"button",className:"sc-ib sm","aria-label":"Show the whole chromosome",title:"Show the whole chromosome",onClick:()=>T({span:O,smooth:!0}),children:r.jsx(Z1,{size:15,"aria-hidden":!0})}),r.jsx(Bl,{label:"View",value:g,onChange:x,options:[{value:"integrated",label:"CN/SV"},{value:"raw",label:"Battenberg raw"}]})]}),footer:r.jsxs("span",{className:"flex flex-wrap items-center gap-x-4 gap-y-1 text-[12.5px]",style:{color:"var(--ink-2)"},children:[g==="integrated"?r.jsxs(r.Fragment,{children:[r.jsx(El,{kind:"dot",colour:"var(--chev)",label:"BAF per SNP"}),r.jsx(El,{kind:"line",colour:"var(--cnsv-clonal)",label:"Clonal segment"}),r.jsx(El,{kind:"line",colour:"var(--cnsv-subclonal)",label:"Subclonal segment"}),r.jsx(El,{kind:"dot",colour:"var(--ink)",label:"Read depth (BRASS)"}),r.jsx(El,{kind:"dash",colour:"var(--cnsv-clonal)",label:"Battenberg total copy number"}),q_.map(A=>r.jsx(El,{kind:"line",colour:zn[A],label:$a[A]},A))]}):r.jsxs(r.Fragment,{children:[r.jsx(El,{kind:"dot",colour:"var(--ink-2)",label:"Tumour"}),r.jsx(El,{kind:"dot",colour:"var(--faint)",label:"Normal"})]}),r.jsx("span",{style:{color:"var(--faint)"},children:E?"Click a chromosome's name to open it.":"Scroll up or down over the plot to zoom, sideways (or drag) to pan. Click a rearrangement to fit it."})]}),children:r.jsxs("div",{className:"cnsv-body",children:[r.jsx(I_,{chrom:h,withData:C,genome:E,allowGenome:g==="raw",onPick:R,onGenome:()=>y(!0)}),r.jsx("div",{ref:j,"data-stale":!E&&D&&D.chrom!==h||void 0,children:E?r.jsx(Vl,{label:"raw Battenberg data",envelope:o,loading:c,skeletonHeight:440,children:A=>r.jsx(e1,{scope:"genome",sources:A.sources,segments:A.segments,width:b,onPick:R})}):r.jsx(Vl,{label:"chromosome view",envelope:l,loading:a,skeletonHeight:460,children:A=>g==="integrated"?r.jsx($_,{data:A,width:b,view:N,onView:T},A.chrom):r.jsx(e1,{scope:"chromosome",chrom:A.chrom,raw:A.raw,width:b,view:N,onView:T},A.chrom)})})]})})});function Y_(n){var o;const l=n.samples.filter(c=>c.category==="TUMOR");return(o=l.find(c=>Object.values(c.datasets??{}).some(d=>Object.values(d).includes("ok")))??l[0]??n.samples[0])==null?void 0:o.id}const P_=[];function X_(n){const l=M.useRef(!1);return M.useEffect(()=>{let a=0;const o=()=>{l.current=!0,window.clearTimeout(a),a=window.setTimeout(()=>l.current=!1,150)};return window.addEventListener("scroll",o,{passive:!0}),()=>{window.removeEventListener("scroll",o),window.clearTimeout(a)}},[]),M.useCallback(a=>{(a===null||!l.current)&&n(a)},[n])}function K_(n){var a,o;const l=(o=(a=n==null?void 0:n.samples.find(c=>{var d;return(d=c.disease)==null?void 0:d.name}))==null?void 0:a.disease)==null?void 0:o.name;return l?l.charAt(0)+l.slice(1).toLowerCase():void 0}function Bi(n,l){const a=typeof matchMedia<"u"&&matchMedia("(prefers-reduced-motion: reduce)").matches;n==null||n.scrollIntoView({behavior:a?"auto":"smooth",block:l})}const t1=160;function Z_(n,l){const a=M.useRef(n);a.current=n;const o=M.useRef(null),c=M.useRef(null),d=M.useRef(0),h=M.useRef(()=>{}),m=M.useRef(()=>{});M.useEffect(()=>{let v=0;const y=()=>{var E;if(v=0,o.current)return;const T=a.current.filter(([,R])=>R.current).map(([R,A])=>[R,A.current.getBoundingClientRect().top]),O=Math.max(0,document.documentElement.scrollHeight-window.innerHeight),_=Math.max(0,...T.map(([,R])=>R+window.scrollY-O-t1)),D=t1+(O>0?_*Math.min(1,window.scrollY/O):0);let C=((E=T[0])==null?void 0:E[0])??null;for(const[R,A]of T)A<=D&&(C=R);l.set(C)},S=()=>{o.current=null,c.current=null,y()};m.current=()=>{c.current=window.scrollY};const j=()=>{if(o.current){c.current===null?(window.clearTimeout(d.current),d.current=window.setTimeout(m.current,160)):Math.abs(window.scrollY-c.current)>4&&S();return}v||(v=requestAnimationFrame(y))},b=()=>{o.current&&c.current===null&&(window.clearTimeout(d.current),S())};return h.current=y,y(),window.addEventListener("scroll",j,{passive:!0}),window.addEventListener("resize",j),window.addEventListener("wheel",b,{passive:!0}),window.addEventListener("touchstart",b,{passive:!0}),window.addEventListener("keydown",b),()=>{window.removeEventListener("scroll",j),window.removeEventListener("resize",j),window.removeEventListener("wheel",b),window.removeEventListener("touchstart",b),window.removeEventListener("keydown",b),window.clearTimeout(d.current),v&&cancelAnimationFrame(v)}},[]);const g=M.useRef("");return M.useEffect(()=>{const v=n.filter(([,y])=>y.current).map(([y])=>y).join();v!==g.current&&(g.current=v,h.current())}),v=>{o.current=v,c.current=null,l.set(v),window.clearTimeout(d.current),d.current=window.setTimeout(m.current,160)}}function J_({held:n,sampleId:l,...a}){const o=qu(n);return r.jsx(cC,{...a,sampleId:o??l})}function W_(){var Fr,Vr,Zs,Qt,Xn,Yt,Br,Gr,qr,Il,Ql,Yl,cs,Pl,Js,ho,Ir,mo,Ha,Ws;const{individual:n=""}=eN(),[l,a]=bN(),o=l.get("version")??void 0,[c,d]=M.useState(null),[h,m]=M.useState(null),[g,x]=M.useState(gx),[v,y]=M.useState(null),S=X_(y),[j,b]=M.useState(null),N=M.useRef(null),[T,O]=M.useState(null),_=M.useRef(Cr(!0)).current,D=M.useRef(null),C=M.useRef(null),E=M.useRef(null),R=M.useRef(null),A=M.useRef(null),B=M.useRef(null),K=M.useRef(Cr(null)).current,k=Z_([["overview",C],["copyNumber",N],["mutations",D],["structuralVariants",E],["circos",A],["cnsv",B],["signatures",R]],K),ie=m1();M.useEffect(()=>{const ge=T;if(!ge||typeof IntersectionObserver>"u")return;const at=new IntersectionObserver(([nn])=>_.set(nn.isIntersecting),{rootMargin:"-72px 0px 0px 0px",threshold:0});return at.observe(ge),()=>at.disconnect()},[T]);const oe=M.useCallback(ge=>x(at=>({...at,...ge})),[]),se=M.useCallback(ge=>{oe({q:jC(ge.chrom,ge.start,ge.end),scope:"all",sort:"position"}),Bi(D.current,"start")},[oe]),P=M.useCallback(ge=>{oe({q:ge}),Bi(D.current,"start")},[oe]),le=M.useCallback(ge=>{b({chrom:ge.chrom,pos:ge.pos,gene:ge.gene,nonce:Date.now()}),Bi(N.current,"center")},[]),$=M.useCallback(ge=>{b({...ge,nonce:Date.now()}),Bi(N.current,"center")},[]),J=EC(n,o),Z=J.data,W=(Z==null?void 0:Z.status)==="ok"?Z.data??void 0:void 0,ae=l.get("sample")??(W?Y_(W):void 0),de=W==null?void 0:W.samples.find(ge=>ge.id===ae),ve=(de==null?void 0:de.category)==="TUMOR"?ae:void 0,je=h??((W==null?void 0:W.mode)==="unmatched"?"vaf":"ccf"),L=TC(n,W?ae:void 0,o),U=_C(n,o),I=RC(n,ve,o),re=AC(n,ve,je,g.ffpe,o),ce=FC(n,ve,g,o),xe=(Fr=ce.data)==null?void 0:Fr.pages[0],Te=M.useMemo(()=>{var ge;return((ge=ce.data)==null?void 0:ge.pages.flatMap(at=>at.status==="ok"&&at.data?at.data.rows:[]))??[]},[ce.data]),{fetchNextPage:me}=ce,Se=M.useCallback(()=>void me(),[me]),ct=UC(n,ve,o),Ct=OC(n,ve,o),dn=zC(n,ve,o),zt=DC(n,ve,o),ut=LC(n,ve,o),Ge=$C(n,ve,o),[Wt,rs]=M.useState("1"),[en,wn]=M.useState("integrated"),[Ts,gt]=M.useState(!1),Yn=kC(n,ve,Wt,o),qt=HC(n,ve,en==="raw"&&Ts,o),Dt=(Zs=(Vr=U.data)==null?void 0:Vr.data)==null?void 0:Zs.samples.find(ge=>ge.sample===ae),Ks=M.useMemo(()=>(Dt==null?void 0:Dt.drivers)??P_,[Dt]),It=M.useMemo(()=>v?{chrom:v.chrom,pos:v.pos,gene:v.gene}:j,[v,j]),Ln=M.useRef(null),Pn=M.useRef(Cr(null)).current,te=(ge,at)=>{var nn;(nn=Ln.current)==null||nn.toggleAttribute("data-gliding",ge),Ln.current&&(Ln.current.style.minHeight=ge&&at?`${at}px`:"")},ue=M.useRef(null);M.useEffect(()=>()=>{var ge;return(ge=ue.current)==null?void 0:ge.call(ue)},[]);const we=ge=>{var xt,Lt;if(ge===ae)return;(xt=ue.current)==null||xt.call(ue);const at=typeof matchMedia<"u"&&matchMedia("(prefers-reduced-motion: reduce)").matches,nn=50;if(at||window.scrollY<=nn)return window.scrollTo({top:0,behavior:"auto"}),Ue("sample",ge);const Ua=window.scrollY,go=Math.min(520,240+Ua*.12),po=performance.now();te(!0,document.documentElement.scrollHeight-(((Lt=Ln.current)==null?void 0:Lt.getBoundingClientRect().top)??0)-Ua),Pn.set(ae??null),k("overview"),M.startTransition(()=>Ue("sample",ge));let Fa=0;function Kn(){cancelAnimationFrame(Fa),window.removeEventListener("wheel",Kn),window.removeEventListener("touchstart",Kn),window.removeEventListener("keydown",Kn),ue.current=null,Pn.set(null),te(!1)}const $n=el=>{const yo=Math.min(1,(el-po)/go),Qr=Ua*(1-yo)**3;window.scrollTo({top:Qr,behavior:"instant"}),Qr<=nn&&Pn.set(null),yo<1?Fa=requestAnimationFrame($n):Kn()};window.addEventListener("wheel",Kn,{passive:!0}),window.addEventListener("touchstart",Kn,{passive:!0}),window.addEventListener("keydown",Kn),ue.current=Kn,Fa=requestAnimationFrame($n)},Ue=(ge,at)=>{const nn=new URLSearchParams(l);nn.set(ge,at),a(nn,{replace:!1}),d(null),x(gx()),y(null),b(null)},Pe=[J,L,U,I,re,ce,ct,Ct,dn,zt,ut,Ge].map(ge=>ge.error);if(Pe.some(ge=>ge instanceof Iu))return r.jsx("div",{className:`wgts ${is.theme}`,children:r.jsx("main",{className:"page",children:r.jsx(uM,{onSignedIn:()=>ie.invalidateQueries()})})});const vt=Pe.find(ge=>ge instanceof sS),pt=de&&W?hg(de.id,W.individual.id):"",et=new Set(W?ve?["overview","copyNumber","mutations","structuralVariants","circos","cnsv","signatures"]:["overview"]:[]),hn=ge=>{if(k(ge),ge==="overview"){const nn=typeof matchMedia<"u"&&matchMedia("(prefers-reduced-motion: reduce)").matches;window.scrollTo({top:0,behavior:nn?"auto":"smooth"});return}const at={copyNumber:N,mutations:D,structuralVariants:E,circos:A,cnsv:B,signatures:R}[ge];Bi((at==null?void 0:at.current)??null,"start")},Nn=W&&ae&&W.analyses[ae]||[],ql=(W==null?void 0:W.failures.filter(ge=>ge.sample===ae))??[],ka=new Set(Nn.map(Gt)),fo=new Set,tn=ge=>ge==null?void 0:ge.forEach(at=>ka.has(Gt(at))&&fo.add(Gt(at)));for(const ge of((Xn=(Qt=L.data)==null?void 0:Qt.data)==null?void 0:Xn.metrics)??[])Bm.includes(ge.key)&&tn(ge.sources);tn((Yt=U.data)==null?void 0:Yt.lineage),tn((Br=I.data)==null?void 0:Br.lineage),tn((Gr=re.data)==null?void 0:Gr.lineage),tn(xe==null?void 0:xe.lineage),tn((qr=ct.data)==null?void 0:qr.lineage),tn((Il=Ct.data)==null?void 0:Il.lineage),tn((Ql=dn.data)==null?void 0:Ql.lineage),tn((Yl=zt.data)==null?void 0:Yl.lineage),tn((cs=ut.data)==null?void 0:cs.lineage),tn((Pl=Ge.data)==null?void 0:Pl.lineage),tn((Js=Yn.data)==null?void 0:Js.lineage);for(const ge of Nn)ge.state==="failed"&&ql.length>0&&fo.add(Gt(ge));return r.jsxs("div",{className:`wgts ${is.theme}`,children:[r.jsx(PC,{analyses:Nn,onPage:fo,sampleLabel:pt,picked:c,onPick:d,sections:et,activeStore:K,onSection:hn}),r.jsxs("div",{ref:Ln,className:"page",children:[r.jsx(nS,{individualId:n,subtitle:[K_(W),(ho=W==null?void 0:W.individual.sex)==null?void 0:ho.toLowerCase(),(W==null?void 0:W.mode)==="unmatched"?"tumour only":void 0].filter(Boolean).join(", ")||void 0,patientIcon:W?r.jsx(lC,{sex:W.individual.sex}):void 0,report:W?r.jsx(sM,{data:W,onVersion:ge=>Ue("version",ge)}):void 0,compact:W&&ae?r.jsx(uC,{data:W,sampleId:ae,fingerprint:((Ir=U.data)==null?void 0:Ir.data)??void 0,onSample:we}):void 0,headerInView:_}),r.jsxs("main",{className:"flex flex-1 flex-col",children:[W&&ae&&r.jsx("div",{className:"px-8 pt-1",children:r.jsx("div",{ref:O,children:r.jsx(J_,{held:Pn,data:W,sampleId:ae,fingerprint:((mo=U.data)==null?void 0:mo.data)??void 0,onSample:ge=>Ue("sample",ge)})})}),r.jsxs("div",{className:"sheet",children:[J.isPending&&r.jsx("div",{className:"skeleton h-24","aria-label":"Loading the patient"}),vt&&r.jsx("div",{className:"sc-card px-6 py-5",children:r.jsx(ba,{envelope:{status:"error",data:null,lineage:[],warnings:[vt.message]}})}),J.isError&&!vt&&r.jsx("div",{className:"sc-card px-6 py-5",children:r.jsx(ba,{envelope:{status:"error",data:null,lineage:[],warnings:[J.error.message]}})}),Z&&Z.status!=="ok"&&r.jsx("div",{className:"sc-card px-6 py-5",children:r.jsx(ba,{envelope:Z})}),(Z==null?void 0:Z.status)==="ok"&&Z.warnings.length>0&&r.jsx("div",{className:"sc-card px-6 py-4",children:r.jsx(ba,{envelope:{...Z,status:"missing"}})}),W&&ae&&r.jsxs(r.Fragment,{children:[r.jsx(cM,{sampleLabel:pt,failures:ql,analyses:Nn}),ve?r.jsxs(r.Fragment,{children:[r.jsx("div",{ref:C,className:"page-section",children:r.jsx(rM,{sampleLabel:`${pt} tumour`,fingerprint:Dt,metrics:L.data,picked:c,lineage:Qu((Ha=L.data)==null?void 0:Ha.lineage,(Ws=U.data)==null?void 0:Ws.lineage)})}),r.jsx("div",{ref:N,className:"page-section",children:r.jsx(KM,{envelope:I.data,loading:I.isPending,picked:c,sampleLabel:pt,drivers:Ks,focus:It,locate:j,onSegment:se,onGene:P,fga:zt.data,fgaLoading:zt.isPending,onOpenChromosome:ge=>{rs(ge),gt(!1),k("cnsv"),Bi(B.current,"start")}})}),r.jsx(CT,{ref:D,variants:xe,rows:Te,hasMore:ce.hasNextPage,loadingMore:ce.isFetchingNextPage,onMore:Se,variantsLoading:ce.isPending,variantsFetching:ce.isFetching&&ce.isPlaceholderData,density:re.data,densityLoading:re.isPending,picked:c,measure:je,onMeasure:ge=>{m(ge),g.range&&g.range.measure!==ge&&oe({range:null})},table:g,onTable:oe,hovered:v,onHover:S,onLocate:le,showCcf:W.mode!=="unmatched",tmb:ut.data}),r.jsx(KT,{ref:E,envelope:ct.data,loading:ct.isPending,picked:c,onLocate:$}),r.jsx(M_,{ref:A,envelope:Ge.data,loading:Ge.isPending,picked:c,drivers:Ks}),r.jsx(Q_,{ref:B,envelope:Yn.data,loading:Yn.isPending,rawGenome:qt.data,rawGenomeLoading:qt.isPending,picked:c,chrom:Wt,onChrom:rs,mode:en,onMode:wn,genome:Ts,onGenome:gt}),r.jsx(p_,{ref:R,envelope:Ct.data,loading:Ct.isPending,contextEnvelope:dn.data,contextLoading:dn.isPending,picked:c})]}):r.jsx("div",{ref:C,className:"sc-card px-6 py-5",children:r.jsx(ba,{envelope:{status:"missing",data:null,lineage:[],warnings:[`${pt} is a normal sample. Its germline and quality panels arrive with those sections.`]}})})]})]})]})]})]})}const pm=200,qS="wgts-picker-scope";function eR(){try{const n=localStorage.getItem(qS);return n&&/^\d+$/.test(n)?Number(n):"all"}catch{return"all"}}function tR(n,l){const a=l.toLowerCase().split(/\s+/).filter(Boolean);return a.length===0?n:n.filter(o=>{const c=`${o.individual} ${o.diseases.join(" ")} ${o.report_version}`.toLowerCase();return a.every(d=>c.includes(d))})}function nR(n,l){const a=l.toLowerCase().split(/\s+/).filter(Boolean);return a.length===0?n:n.filter(o=>{const c=`${o.title} ${o.short_title??""} ${o.description??""}`.toLowerCase();return a.every(d=>c.includes(d))})}const ym=n=>n.toLocaleString("en-US");function sR(){return qu(gg)?r.jsx(lR,{}):null}function lR(){var k,ie,oe,se;const n=fg(),l=((k=Jw("/:individual"))==null?void 0:k.params.individual)??"",a=M.useId(),o=M.useRef(null),[c,d]=M.useState(eR),[h,m]=M.useState(""),[g,x]=M.useState(""),[v,y]=M.useState(0),S=VC(),j=BC(c);M.useEffect(()=>{const P=document.activeElement,le=document.documentElement,$=le.style.overflow;return le.style.overflow="hidden",requestAnimationFrame(()=>{var J;return(J=document.querySelector(".pick-main .tsearch input"))==null?void 0:J.focus()}),()=>{le.style.overflow=$,P==null||P.focus()}},[]);const b=P=>{d(P),x(""),y(0);try{localStorage.setItem(qS,String(P))}catch{}requestAnimationFrame(()=>{var le;return(le=document.querySelector(".pick-main .tsearch input"))==null?void 0:le.focus()})},N=((ie=S.data)==null?void 0:ie.results)??[],T=M.useMemo(()=>nR(N,h),[N,h]),O=c==="all"?null:N.find(P=>P.pk===c)??((oe=j.data)==null?void 0:oe.project)??null,_=((se=j.data)==null?void 0:se.results)??[],D=M.useMemo(()=>tR(_,g),[_,g]),C=D.slice(0,pm),E=M.useRef(null),R=P=>{yu(),P.individual!==l&&n(`/${encodeURIComponent(P.individual)}`)};M.useEffect(()=>{var P,le,$;($=(le=(P=E.current)==null?void 0:P.querySelector(`[data-index="${v}"]`))==null?void 0:le.scrollIntoView)==null||$.call(le,{block:"nearest"})},[v]),M.useEffect(()=>y(0),[g]);const A=P=>{const le=P.target,$=le instanceof HTMLInputElement&&!!le.closest(".pick-main");if(P.key==="Escape"){if(le instanceof HTMLInputElement&&le.value)return;yu()}else if($&&P.key==="ArrowDown")P.preventDefault(),y(J=>Math.min(J+1,C.length-1));else if($&&P.key==="ArrowUp")P.preventDefault(),y(J=>Math.max(J-1,0));else if($&&P.key==="Enter"&&C[v])P.preventDefault(),R(C[v]);else if(le instanceof HTMLInputElement&&le.closest(".pick-rail")&&P.key==="Enter"){P.preventDefault();const J=T[0];J&&b(J.pk)}},B=S.isPending,K=S.isError||j.isError;return cg.createPortal(r.jsx("div",{className:`info-backdrop ${is.theme}`,onMouseDown:P=>P.target===P.currentTarget&&yu(),children:r.jsxs("div",{className:"info-dialog pick",role:"dialog","aria-modal":"true","aria-labelledby":a,tabIndex:-1,onKeyDown:A,children:[r.jsx("button",{ref:o,type:"button",className:"info-close","aria-label":"Close",onClick:yu,children:r.jsx(Bu,{size:18,"aria-hidden":!0})}),r.jsxs("nav",{className:"info-rail pick-rail","aria-label":"Projects",children:[r.jsx("span",{className:"info-kicker",children:"Browse"}),r.jsx("h2",{id:a,children:"Projects"}),r.jsx($u,{value:h,onChange:m,label:"Search projects",placeholder:"Search projects",shortcut:!1,delay:0}),r.jsxs("ol",{children:[r.jsx("li",{children:r.jsxs("button",{type:"button","aria-current":c==="all"?"true":void 0,onClick:()=>b("all"),children:[r.jsx("span",{className:"pick-name",children:r.jsxs("span",{children:[r.jsx(QN,{size:14,"aria-hidden":!0}),"All patients"]})}),r.jsx("span",{className:"pick-n",children:S.data?ym(S.data.total):""})]})}),T.map(P=>r.jsx("li",{children:r.jsxs("button",{type:"button","aria-current":c===P.pk?"true":void 0,onClick:()=>b(P.pk),title:P.short_title?`${P.title} (${P.short_title})`:P.title,children:[r.jsx("span",{className:"pick-name",children:P.title}),r.jsx("span",{className:"pick-n",children:ym(P.patients)})]})},P.pk))]}),B&&r.jsx("p",{className:"pick-note",children:"Loading projects…"}),!B&&N.length>0&&T.length===0&&r.jsxs("p",{className:"pick-note",children:["No project matches “",h,"”."]}),!B&&!S.isError&&N.length===0&&r.jsx("p",{className:"pick-note",children:"No project has a dashboard yet. “All patients” lists every one."})]}),r.jsxs("div",{className:"pick-main",children:[r.jsxs("header",{className:"pick-head",children:[r.jsx("span",{className:"info-kicker",children:(O==null?void 0:O.short_title)??(c==="all"?"Every project":"Project")}),r.jsx("h3",{children:(O==null?void 0:O.title)??"All patients"}),(O==null?void 0:O.description)&&r.jsx("p",{children:O.description})]}),r.jsx("div",{className:"tbar",children:r.jsx($u,{value:g,onChange:x,label:"Search patients",placeholder:"Search id or disease",shortcut:!1,delay:0})}),r.jsx("div",{ref:E,className:"pick-list",role:"group","aria-label":"Patients","aria-busy":j.isFetching,children:K?r.jsx("p",{className:"pick-note",children:"The patients could not be loaded. Close this window and try again."}):j.isPending?r.jsx("p",{className:"pick-note",children:"Loading patients…"}):C.length===0?r.jsx("p",{className:"pick-note",children:g?`No patient matches “${g}”.`:"No patients with a dashboard in this project yet."}):C.map((P,le)=>r.jsxs("button",{type:"button",className:"pick-row","data-index":le,"data-active":le===v||void 0,"data-current":P.individual===l||void 0,onMouseEnter:()=>y(le),onClick:()=>R(P),children:[r.jsx("span",{className:"pick-id mono",children:r.jsx(Da,{text:P.individual,query:g})}),r.jsx("span",{className:"pick-diseases",children:P.diseases.length>0?P.diseases.map($=>r.jsx("span",{className:"sc-chip",children:r.jsx(Da,{text:$,query:g})},$)):r.jsx("span",{className:"pick-faint",children:"No tumour disease recorded"})}),r.jsx("span",{className:"pick-aside",children:P.individual===l?r.jsxs("span",{className:"pick-here",children:[r.jsx(Q1,{size:13,"aria-hidden":!0}),"On this page"]}):r.jsxs(r.Fragment,{children:[r.jsxs("span",{children:[ym(P.samples)," ",P.samples===1?"sample":"samples"]}),r.jsxs("span",{className:"pick-faint",children:["report ",P.report_version,P.built?`, ${J1(P.built)}`:""]})]})})]},P.individual))}),j.data&&r.jsx(Ku,{shown:D.length,total:_.length,noun:["patient","patients"],note:D.length>pm?`Showing the first ${pm}; search to narrow`:void 0})]})]})}),document.body)}const aR=new mw({defaultOptions:{queries:{staleTime:6e4,refetchOnWindowFocus:!1}}});function iR(){return r.jsx(V2,{client:aR,children:r.jsxs(SN,{basename:is.basePath,children:[r.jsxs(pN,{children:[r.jsx(Om,{path:"/",element:r.jsx(dC,{})}),r.jsx(Om,{path:"/:individual",element:r.jsx(W_,{})})]}),r.jsx(sR,{})]})})}F2.createRoot(document.getElementById("root")).render(r.jsx(M.StrictMode,{children:r.jsx(iR,{})}));
|
|
323
|
+
*/function Ku(n,a){return n?YE(n)?C.createElement(n,a):n:null}function YE(n){return XE(n)||typeof n=="function"||KE(n)}function XE(n){return typeof n=="function"&&(()=>{const a=Object.getPrototypeOf(n);return a.prototype&&a.prototype.isReactComponent})()}function KE(n){return typeof n=="object"&&typeof n.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(n.$$typeof.description)}function ob(n){const a={state:{},onStateChange:()=>{},renderFallbackValue:null,...n},[l]=C.useState(()=>({current:IE(a)})),[i,c]=C.useState(()=>l.current.initialState);return l.current.setOptions(d=>({...d,...n,state:{...i,...n.state},onStateChange:f=>{c(f),n.onStateChange==null||n.onStateChange(f)}})),l.current}function Zu({value:n,onChange:a,label:l="Search mutations",placeholder:i="Search gene, change or locus",shortcut:c=!0,delay:d=250}){const[f,m]=C.useState(n),g=C.useRef(null),v=C.useRef(a);v.current=a,C.useEffect(()=>m(n),[n]),C.useEffect(()=>{if(f===n)return;const p=window.setTimeout(()=>v.current(f),d);return()=>window.clearTimeout(p)},[f,n,d]),C.useEffect(()=>{if(!c)return;const p=b=>{var S,j,N;b.key!=="/"||b.metaKey||b.ctrlKey||b.altKey||(j=(S=b.target)==null?void 0:S.closest)!=null&&j.call(S,"input, textarea, select, [contenteditable]")||(b.preventDefault(),(N=g.current)==null||N.focus())};return document.addEventListener("keydown",p),()=>document.removeEventListener("keydown",p)},[c]);const x=()=>{m(""),a("")};return r.jsxs("div",{className:"tsearch",children:[r.jsx(Iu,{size:15,"aria-hidden":!0}),r.jsx("input",{ref:g,type:"search","aria-label":l,placeholder:i,value:f,onChange:p=>{m(p.target.value),d===0&&a(p.target.value)},onKeyDown:p=>{p.key==="Escape"&&x(),p.key==="Enter"&&a(f)}}),f?r.jsx("button",{type:"button",className:"search-clear","aria-label":"Clear the search",onClick:x,children:r.jsx(ec,{size:14,"aria-hidden":!0})}):c?r.jsx("kbd",{className:"kbd","aria-hidden":!0,children:"/"}):null]})}const pm=n=>n.toLocaleString("en-US");function hd({shown:n,total:a,noun:l,loaded:i=!1,note:c}){const f=n>=a?`${pm(a)} ${a===1?l[0]:l[1]}`:`${pm(n)} of ${pm(a)} ${l[1]}${i?" loaded":""}`;return r.jsxs("div",{className:"vt-foot",role:"status",children:[c?r.jsx("span",{className:"vt-foot-note",children:c}):null,r.jsx("span",{className:"vt-foot-count",children:f})]})}function ZE(n){return typeof n=="object"?n.key:n}function JE(n,a){const l=n.length;return new Proxy(n,{get(i,c,d){if(typeof c=="string"){const f=c.charCodeAt(0);if(f>=48&&f<=57){const m=+c;if(Number.isInteger(m)&&m>=0&&m<l){let g=i[m];if(typeof g!="object"){const v=a[m*2];g=i[m]={index:m,key:g,start:v,size:a[m*2+1],end:v+a[m*2+1],lane:0}}return g}}if(c==="length")return l}return Reflect.get(i,c,d)}})}function qi(n,a,l){let i=l.initialDeps??[],c,d=!0;function f(){const m=n();return(m.length!==i.length||m.some((v,x)=>i[x]!==v))&&(i=m,c=a(...m),l!=null&&l.onChange&&!(d&&l.skipInitialOnChange)&&l.onChange(c),d=!1),c}return f.updateDeps=m=>{i=m},f}function Jv(n,a){if(n===void 0)throw new Error("Unexpected undefined");return n}const Wv=(n,a)=>Math.abs(n-a)<1.01,WE=(n,a,l)=>{let i;return Object.assign(function(...c){n.clearTimeout(i),i=n.setTimeout(()=>a.apply(this,c),l)},{cancel:()=>{n.clearTimeout(i)}})};let Tr;const xm=()=>{if(Tr!==void 0)return Tr;if(typeof navigator>"u")return Tr=!1;if(/iP(hone|od|ad)/.test(navigator.userAgent))return Tr=!0;const n=navigator.maxTouchPoints;return Tr=navigator.platform==="MacIntel"&&n!==void 0&&n>0},e2=n=>{const{offsetWidth:a,offsetHeight:l}=n;return{width:a,height:l}},e4=n=>n,t4=n=>{const a=Math.max(n.startIndex-n.overscan,0),i=Math.min(n.endIndex+n.overscan,n.count-1)-a+1,c=new Array(i);for(let d=0;d<i;d++)c[d]=a+d;return c},n4=(n,a)=>{const l=n.scrollElement;if(!l)return;const i=n.targetWindow;if(!i)return;const c=f=>{const{width:m,height:g}=f;a({width:Math.round(m),height:Math.round(g)})};if(c(e2(l)),!i.ResizeObserver)return()=>{};const d=new i.ResizeObserver(f=>{const m=()=>{const g=f[0];if(g!=null&&g.borderBoxSize){const v=g.borderBoxSize[0];if(v){c({width:v.inlineSize,height:v.blockSize});return}}c(e2(l))};n.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(m):m()});return d.observe(l,{box:"border-box"}),()=>{d.unobserve(l)}},Ju={passive:!0},s4=typeof window>"u"?!0:"onscrollend"in window,a4=(n,a,l)=>{const i=n.scrollElement;if(!i)return;const c=n.targetWindow;if(!c)return;const d=n.options.useScrollendEvent&&s4;let f=0;const m=d?null:WE(c,()=>a(l(i),!1),n.options.isScrollingResetDelay),g=p=>()=>{f=l(i),m==null||m(),a(f,p)},v=g(!0),x=g(!1);return i.addEventListener("scroll",v,Ju),d&&i.addEventListener("scrollend",x,Ju),()=>{i.removeEventListener("scroll",v),d&&i.removeEventListener("scrollend",x),m==null||m.cancel()}},l4=(n,a)=>a4(n,a,l=>{const{horizontal:i,isRtl:c}=n.options;return i?l.scrollLeft*(c&&-1||1):l.scrollTop}),i4=(n,a,l)=>{if(l.options.useCachedMeasurements){const i=l.indexFromElement(n),c=l.options.getItemKey(i);return l.itemSizeCache.get(c)??l.options.estimateSize(i)}if(a!=null&&a.borderBoxSize){const i=a.borderBoxSize[0];if(i)return Math.round(i[l.options.horizontal?"inlineSize":"blockSize"])}if(!a){const i=l.indexFromElement(n),c=l.options.getItemKey(i),d=l.itemSizeCache.get(c);if(d!==void 0)return d}return n[l.options.horizontal?"offsetWidth":"offsetHeight"]},o4=(n,{adjustments:a=0,behavior:l},i)=>{var c,d;(d=(c=i.scrollElement)==null?void 0:c.scrollTo)==null||d.call(c,{[i.options.horizontal?"left":"top"]:n+a,behavior:l})},r4=o4;function c4(n,a,l,i){if(a===0)return!1;const c=i(0),d=new Set;let f=0;for(;f<n;){const g=l(f);if(g===c)break;d.add(g),f++}const m=n-f;if(m===0||m>=a)return!1;for(let g=0;g<m;g++)if(i(g)!==l(f+g))return!1;for(let g=m;g<a;g++)if(d.has(i(g)))return!1;return!0}class u4{constructor(a){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this._singleLaneMeasurements=null,this.itemSizeCache=new Map,this.itemSizeCacheVersion=0,this.laneAssignments=new Map,this.pendingMin=null,this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.pendingScrollAnchor=null,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._intendedScrollOffset=null,this._clampedAdjustment=null,this.elementsCache=new Map,this.now=()=>{var l,i,c;return((c=(i=(l=this.targetWindow)==null?void 0:l.performance)==null?void 0:i.now)==null?void 0:c.call(i))??Date.now()},this.observer=(()=>{let l=null;const i=()=>l||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:l=new this.targetWindow.ResizeObserver(c=>{c.forEach(d=>{const f=()=>{const m=d.target,g=this.indexFromElement(m);if(!m.isConnected){this.observer.unobserve(m);for(const[v,x]of this.elementsCache)if(x===m){this.elementsCache.delete(v);break}return}this.isIndexInRange(g)&&this.shouldMeasureDuringScroll(g)&&this.resizeItem(g,this.options.measureElement(m,d,this))};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(f):f()})}));return{disconnect:()=>{var c;(c=i())==null||c.disconnect(),l=null},observe:c=>{var d;return(d=i())==null?void 0:d.observe(c,{box:"border-box"})},unobserve:c=>{var d;return(d=i())==null?void 0:d.unobserve(c)}}})(),this.range=null,this.setOptions=l=>{var i;const c={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:e4,rangeExtractor:t4,onChange:()=>{},measureElement:i4,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,anchorTo:"start",followOnAppend:!1,scrollEndThreshold:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,laneAssignmentMode:"estimate",useCachedMeasurements:!1};for(const p in l){const b=l[p];b!==void 0&&(c[p]=b)}const d=this.options;let f=null,m=null,g=!1;if(d!==void 0&&d.enabled&&c.enabled&&c.anchorTo==="end"&&this.scrollElement!==null){const p=d.count,b=c.count,S=this.getMeasurements(),j=((i=this._singleLaneMeasurements)==null?void 0:i.items)??S,N=M=>ZE(j[M]),R=p>0?N(0):null,A=p>0?N(p-1):null;if(b!==p||p>0&&b>0&&(c.getItemKey(0)!==R||c.getItemKey(b-1)!==A)){g=!0;const M=p>0?this.getVirtualItemForOffset(this.getScrollOffset())??S[0]:null;M&&(f=[M.key,this.getScrollOffset()-M.start]);const E=c.followOnAppend===!0?"auto":c.followOnAppend||null;E&&b>0&&this.isAtEnd(d.scrollEndThreshold)&&(p===0||c.getItemKey(b-1)!==A)&&(b>p||c4(p,b,N,c.getItemKey))&&(m=E)}}this.options=c,g&&(this.pendingMin=0,this.itemSizeCacheVersion++);let v=!1,x=0;if(f&&this.scrollOffset!==null){const[p,b]=f,S=this.getMeasurements(),{count:j,getItemKey:N}=this.options;let R=0;for(;R<j&&N(R)!==p;)R++;if(R<j){const A=S[R];if(A){const T=Math.max(0,A.start+b);!m&&T!==this.scrollOffset&&(x=T-this.scrollOffset,this.scrollOffset=T,v=!0)}}}(v||m)&&(this.pendingScrollAnchor=[v?f[0]:null,v?f[1]:0,m,x])},this.notify=l=>{var i,c;(c=(i=this.options).onChange)==null||c.call(i,this,l)},this.maybeNotify=qi(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),l=>{this.notify(l)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(l=>l()),this.unsubs=[],this.observer.disconnect(),this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,this.isScrolling=!1,this.scrollDirection=null,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this._clampedAdjustment=null,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var l,i;const c=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==c){if(this.cleanup(),!c){this.maybeNotify();return}if(this.scrollElement=c,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((l=this.scrollElement)==null?void 0:l.window)??null,this.elementsCache.forEach(f=>{this.observer.observe(f)}),this.unsubs.push(this.options.observeElementRect(this,f=>{this.scrollRect=f,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(f,m)=>{if(m&&this._intendedScrollOffset===null&&f===this.scrollOffset)return;this._intendedScrollOffset!==null&&Math.abs(f-this._intendedScrollOffset)<1.5&&(f=this._intendedScrollOffset),this._intendedScrollOffset=null,this._clampedAdjustment!==null&&Math.abs(f-this._clampedAdjustment.maxAtWrite)>=1.5&&(this._clampedAdjustment=null),this.scrollAdjustments=0;const g=this.getScrollOffset();this.scrollDirection=m?g===f?this.scrollDirection:g<f?"forward":"backward":null,this.scrollOffset=f,this.isScrolling=m,this._flushIosDeferredIfReady(),this.scrollState&&this.scheduleScrollReconcile(),this.maybeNotify()})),"addEventListener"in this.scrollElement){const f=this.scrollElement,m=()=>{this._iosTouching=!0,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)},g=()=>{this._iosTouching=!1,!(!xm()||this.targetWindow==null)&&(this._iosJustTouchEnded=!0,this._iosTouchEndTimerId=this.targetWindow.setTimeout(()=>{this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._flushIosDeferredIfReady()},150))};f.addEventListener("touchstart",m,Ju),f.addEventListener("touchend",g,Ju),this.unsubs.push(()=>{f.removeEventListener("touchstart",m),f.removeEventListener("touchend",g),this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)})}this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}const d=this.pendingScrollAnchor;if(this.pendingScrollAnchor=null,d&&this.scrollElement&&this.options.enabled){const[f,m,g,v]=d;f!==null&&!g&&(xm()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?v!==0&&(this._iosDeferredAdjustment+=v):((i=this.scrollState)==null?void 0:i.behavior)==="smooth"&&!Wv(this.getScrollOffset()-v,this.scrollState.lastTargetOffset)||this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})),g&&this.scrollToEnd({behavior:g})}this._retryClampedAdjustment()},this._retryClampedAdjustment=()=>{if(this._clampedAdjustment===null||!this.scrollElement||!this.options.enabled)return;const{target:l,maxAtWrite:i}=this._clampedAdjustment,c=this.getMaxScrollOffset();c>i+.5&&(this._clampedAdjustment=l>c+.5?{target:l,maxAtWrite:c}:null,this._scrollToOffset(l,{adjustments:void 0,behavior:void 0}))},this._flushIosDeferredIfReady=()=>{if(this._iosDeferredAdjustment===0||this.isScrolling||this._iosTouching||this._iosJustTouchEnded)return;const l=this.getScrollOffset(),i=this.getMaxScrollOffset();if(l<0||l>i)return;if(this._iosDeferredAdjustment<0&&l>=i-1){this._iosDeferredAdjustment=0;return}const c=this._iosDeferredAdjustment;this._iosDeferredAdjustment=0,this._scrollToOffset(l,{adjustments:this.scrollAdjustments+=c,behavior:void 0})},this.rafId=null,this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getMeasurementOptions=qi(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes,this.options.laneAssignmentMode,this.options.gap],(l,i,c,d,f,m,g,v)=>(this.prevLanes!==void 0&&this.prevLanes!==m&&(this.lanesChangedFlag=!0),this.prevLanes=m,this.pendingMin=null,{count:l,paddingStart:i,scrollMargin:c,getItemKey:d,enabled:f,lanes:m,laneAssignmentMode:g,gap:v}),{key:!1}),this.isIndexInRange=l=>l>=0&&l<this.options.count,this.getMeasurements=qi(()=>[this.getMeasurementOptions(),this.itemSizeCacheVersion],({count:l,paddingStart:i,scrollMargin:c,getItemKey:d,enabled:f,lanes:m,laneAssignmentMode:g,gap:v},x)=>{var p;const b=this.itemSizeCache;if(!f)return this.measurementsCache=[],this._singleLaneMeasurements=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>l)for(const T of this.laneAssignments.keys())T>=l&&this.laneAssignments.delete(T);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this._singleLaneMeasurements=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMin=null),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(T=>{this.itemSizeCache.set(T.key,T.size)}));const S=this.lanesSettling?0:this.pendingMin??0;if(this.pendingMin=null,this.lanesSettling&&this.measurementsCache.length===l&&(this.lanesSettling=!1),m===1){const T=l*2;let O=(p=this._singleLaneMeasurements)==null?void 0:p.flat;if(!O||O.length<T){const D=new Float64Array(T);O&&S>0&&D.set(O.subarray(0,S*2)),O=D}const M=S===0?new Array(l):this._singleLaneMeasurements.items.slice();let E;if(S===0)E=i+c;else{const D=S-1;E=O[D*2]+O[D*2+1]+v}for(let D=S;D<l;D++){const P=d(D);M[D]=P;const Z=b.get(P),z=typeof Z=="number"?Z:this.options.estimateSize(D);O[D*2]=E,O[D*2+1]=z,E+=z+v}this._singleLaneMeasurements={flat:O,items:M};const _=JE(M,O);return this.measurementsCache=_,_}const j=this.measurementsCache.slice(0,S),N=new Array(m).fill(void 0),R=new Float64Array(m);let A=0;for(let T=0;T<S;T++){const O=j[T];O&&(N[O.lane]===void 0&&A++,N[O.lane]=T,R[O.lane]=O.end)}for(let T=S;T<l;T++){const O=d(T),M=this.laneAssignments.get(T);let E,_;const D=g==="estimate"||b.has(O);if(M!==void 0&&this.options.lanes>1){E=M;const te=N[E],ie=te!==void 0?j[te]:void 0;_=ie?ie.end+v:i+c}else if(A===m){let te=0,ie=R[0],J=N[0];for(let se=1;se<m;se++){const re=R[se];(re<ie||re===ie&&N[se]<J)&&(te=se,ie=re,J=N[se])}E=te,_=ie+v,D&&this.laneAssignments.set(T,E)}else E=T%this.options.lanes,_=i+c,D&&this.laneAssignments.set(T,E);const P=b.get(O),Z=typeof P=="number"?P:this.options.estimateSize(T),z=_+Z;j[T]={index:T,start:_,size:Z,end:z,key:O,lane:E},N[E]===void 0&&A++,N[E]=T,R[E]=z}return this.measurementsCache=j,j},{key:!1,debug:()=>this.options.debug}),this.calculateRange=qi(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(l,i,c,d)=>l.length===0||i===0?(this.range=null,null):(this.range=h4(l,i,c,d,d===1&&this._singleLaneMeasurements!==null?this._singleLaneMeasurements.flat:null),this.range),{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=qi(()=>{let l=null,i=null;const c=this.calculateRange();return c&&(l=c.startIndex,i=c.endIndex),this.maybeNotify.updateDeps([this.isScrolling,l,i]),[this.options.rangeExtractor,this.options.overscan,this.options.count,l,i]},(l,i,c,d,f)=>d===null||f===null?[]:l({startIndex:d,endIndex:f,overscan:i,count:c}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=l=>{const i=this.options.indexAttribute,c=l.getAttribute(i);return c?parseInt(c,10):(console.warn(`Missing attribute name '${i}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=l=>{var i;if(!this.scrollState||this.scrollState.behavior!=="smooth")return!0;const c=this.scrollState.index??((i=this.getVirtualItemForOffset(this.scrollState.lastTargetOffset))==null?void 0:i.index);if(c!==void 0&&this.range){const d=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),f=Math.max(0,c-d),m=Math.min(this.options.count-1,c+d);return l>=f&&l<=m}return!0},this.measureElement=l=>{if(!l){this.elementsCache.forEach((f,m)=>{f.isConnected||(this.observer.unobserve(f),this.elementsCache.delete(m))});return}const i=this.indexFromElement(l);if(!this.isIndexInRange(i))return;const c=this.options.getItemKey(i),d=this.elementsCache.get(c);d!==l&&(d&&this.observer.unobserve(d),this.observer.observe(l),this.elementsCache.set(c,l)),(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(i)&&this.resizeItem(i,this.options.measureElement(l,void 0,this))},this.resizeItem=(l,i)=>{var c,d,f;if(!this.isIndexInRange(l))return;let m,g,v;const x=(c=this._singleLaneMeasurements)==null?void 0:c.flat;if(this.options.lanes===1&&x!=null)v=this.options.getItemKey(l),g=x[l*2],m=x[l*2+1];else{const S=this.measurementsCache[l];if(!S)return;v=S.key,g=S.start,m=S.size}const p=this.itemSizeCache.get(v)??m,b=i-p;if(b!==0){const S=this.options.anchorTo==="end"&&((d=this.scrollState)==null?void 0:d.behavior)!=="smooth"&&this.getVirtualDistanceFromEnd()<=this.options.scrollEndThreshold,j=S?this.getTotalSize():0,N=this.getScrollOffset()+this.scrollAdjustments,A=!this.itemSizeCache.has(v)?g<N:g+p<=N&&this.scrollDirection!=="backward",T=((f=this.scrollState)==null?void 0:f.behavior)!=="smooth"&&(this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(this.measurementsCache[l]??{index:l,key:v,start:g,size:m,end:g+m,lane:0},b,this):A);(this.pendingMin===null||l<this.pendingMin)&&(this.pendingMin=l),this.itemSizeCache.set(v,i),this.itemSizeCacheVersion++;let O=!1;S?O=this.applyScrollAdjustment(this.getTotalSize()-j):T&&(O=this.applyScrollAdjustment(b)),this.notify(O),this._retryClampedAdjustment()}},this.getVirtualItems=qi(()=>[this.getVirtualIndexes(),this.getMeasurements()],(l,i)=>{const c=[];for(let d=0,f=l.length;d<f;d++){const m=l[d],g=i[m];c.push(g)}return c},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=l=>{var i;const c=this.getMeasurements();if(c.length===0)return;const d=(i=this._singleLaneMeasurements)==null?void 0:i.flat,f=this.options.lanes===1&&d!=null,m=rb(0,c.length-1,f?g=>d[g*2]:g=>Jv(c[g]).start,l);return Jv(c[m])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if("scrollHeight"in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{const l=this.scrollElement.document.documentElement;return this.options.horizontal?l.scrollWidth-this.scrollElement.innerWidth:l.scrollHeight-this.scrollElement.innerHeight}},this.getVirtualDistanceFromEnd=()=>Math.max(this.getTotalSize()-this.getSize()-this.getScrollOffset(),0),this.getDistanceFromEnd=()=>Math.max(this.getMaxScrollOffset()-this.getScrollOffset(),0),this.isAtEnd=(l=this.options.scrollEndThreshold)=>this.getDistanceFromEnd()<=l,this.getOffsetForAlignment=(l,i,c=0)=>{if(!this.scrollElement)return 0;const d=this.getSize(),f=this.getScrollOffset();i==="auto"&&(i=l>=f+d?"end":"start"),i==="center"?l+=(c-d)/2:i==="end"&&(l-=d);const m=this.getMaxScrollOffset();return Math.max(Math.min(m,l),0)},this.getOffsetForIndex=(l,i="auto")=>{l=Math.max(0,Math.min(l,this.options.count-1));const c=this.getSize(),d=this.getScrollOffset(),f=this.measurementsCache[l];if(!f)return;if(i==="auto")if(f.end>=d+c-this.options.scrollPaddingEnd)i="end";else if(f.start<=d+this.options.scrollPaddingStart)i="start";else return[d,i];if(i==="end"&&l===this.options.count-1)return[this.getMaxScrollOffset(),i];const m=i==="end"?f.end+this.options.scrollPaddingEnd:f.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(m,i,f.size),i]},this.scrollToOffset=(l,{align:i="start",behavior:c="auto"}={})=>{this._iosDeferredAdjustment=0;const d=this.getOffsetForAlignment(l,i),f=this.now();this.scrollState={index:null,align:i,behavior:c,startedAt:f,lastTargetOffset:d,stableFrames:0},this._scrollToOffset(d,{adjustments:void 0,behavior:c}),this.scheduleScrollReconcile()},this.scrollToIndex=(l,{align:i="auto",behavior:c="auto"}={})=>{this._iosDeferredAdjustment=0,l=Math.max(0,Math.min(l,this.options.count-1));const d=this.getOffsetForIndex(l,i);if(!d)return;const[f,m]=d,g=this.now();this.scrollState={index:l,align:m,behavior:c,startedAt:g,lastTargetOffset:f,stableFrames:0},this._scrollToOffset(f,{adjustments:void 0,behavior:c}),this.scheduleScrollReconcile()},this.scrollBy=(l,{behavior:i="auto"}={})=>{const c=this.getScrollOffset()+l,d=this.now();this.scrollState={index:null,align:"start",behavior:i,startedAt:d,lastTargetOffset:c,stableFrames:0},this._scrollToOffset(c,{adjustments:void 0,behavior:i}),this.scheduleScrollReconcile()},this.scrollToEnd=({behavior:l="auto"}={})=>{if(this.options.count>0){this.scrollToIndex(this.options.count-1,{align:"end",behavior:l});return}this.scrollToOffset(Math.max(this.getTotalSize()-this.getSize(),0),{behavior:l})},this.getTotalSize=()=>{var l,i;const c=this.getMeasurements();let d;if(c.length===0)d=this.options.paddingStart;else if(this.options.lanes===1){const f=c.length-1,m=(l=this._singleLaneMeasurements)==null?void 0:l.flat;m!=null?d=m[f*2]+m[f*2+1]:d=((i=c[f])==null?void 0:i.end)??0}else{const f=Array(this.options.lanes).fill(null);let m=c.length-1;for(;m>=0&&f.some(g=>g===null);){const g=c[m];f[g.lane]===null&&(f[g.lane]=g.end),m--}d=Math.max(...f.filter(g=>g!==null))}return Math.max(d-this.options.scrollMargin+this.options.paddingEnd,0)},this.takeSnapshot=()=>{const l=[];if(this.itemSizeCache.size===0)return l;const i=this.getMeasurements();for(const c of i)c&&this.itemSizeCache.has(c.key)&&l.push({index:c.index,key:c.key,start:c.start,size:c.size,end:c.end,lane:c.lane});return l},this._scrollToOffset=(l,{adjustments:i,behavior:c})=>{this._intendedScrollOffset=l+(i??0),this.options.scrollToFn(l,{behavior:c,adjustments:i},this)},this.measure=()=>{this.pendingMin=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),this.itemSizeCacheVersion++,this.notify(!1)},this.setOptions(a)}applyScrollAdjustment(a,l){if(a===0)return!1;if(xm()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded))return this._iosDeferredAdjustment+=a,!1;{const i=this.getScrollOffset()+this.scrollAdjustments+a,c=this.scrollElement,d=c!==null&&("scrollHeight"in c||"document"in c)?this.getMaxScrollOffset():null;return this._clampedAdjustment=d!==null&&i>d+.5?{target:i,maxAtWrite:d}:null,this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=a,behavior:l}),this.scrollOffset!==null&&(this.scrollOffset+=this.scrollAdjustments,this.scrollOffset<0&&(this.scrollOffset=0),this.scrollAdjustments=0),!0}}scheduleScrollReconcile(){if(!this.targetWindow){this.scrollState=null;return}this.rafId==null&&(this.rafId=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()}))}reconcileScroll(){if(!this.scrollState||!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3){this.scrollState=null;return}const i=this.scrollState.index!=null?this.getOffsetForIndex(this.scrollState.index,this.scrollState.align):void 0,c=i?i[0]:this.scrollState.lastTargetOffset,d=1,f=c!==this.scrollState.lastTargetOffset;if(!f&&Wv(c,this.getScrollOffset())){if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=d){this.getScrollOffset()!==c&&this._scrollToOffset(c,{adjustments:void 0,behavior:"auto"}),this.scrollState=null;return}}else if(this.scrollState.stableFrames=0,f){const m=this.getSize()||600,g=Math.abs(c-this.getScrollOffset()),v=this.scrollState.behavior==="smooth"&&g>m;this.scrollState.lastTargetOffset=c,v||(this.scrollState.behavior="auto"),this._scrollToOffset(c,{adjustments:void 0,behavior:v?"smooth":"auto"})}this.scheduleScrollReconcile()}}const rb=(n,a,l,i)=>{for(;n<=a;){const c=(n+a)/2|0,d=l(c);if(d<i)n=c+1;else if(d>i)a=c-1;else return c}return n>0?n-1:0};function d4(n,a,l){let i=0;for(;i<=a;){const c=(i+a)/2|0,d=n[c*2];if(d<l)i=c+1;else if(d>l)a=c-1;else return c}return i>0?i-1:0}function h4(n,a,l,i,c){const d=n.length-1;if(n.length<=i)return{startIndex:0,endIndex:d};if(i===1&&c!==null){const v=d4(c,d,l);let x=v;const p=l+a;for(;x<d&&c[x*2]+c[x*2+1]<p;)x++;return{startIndex:v,endIndex:x}}let m=rb(0,d,v=>n[v].start,l),g=m;if(i===1)for(;g<d&&n[g].end<l+a;)g++;else if(i>1){const v=Array(i).fill(0);for(;g<d&&v.some(p=>p<l+a);){const p=n[g];v[p.lane]=p.end,g++}const x=Array(i).fill(l+a);for(;m>=0&&x.some(p=>p>=l);){const p=n[m];x[p.lane]=p.start,m--}m=Math.max(0,m-m%i),g=Math.min(d,g+(i-1-g%i))}return{startIndex:m,endIndex:g}}const vm=typeof document<"u"?C.useLayoutEffect:C.useEffect;function f4({useFlushSync:n=!0,directDomUpdates:a=!1,directDomUpdatesMode:l="transform",...i}){const c=C.useReducer(p=>p+1,0)[1],d=C.useRef({enabled:a,mode:l,container:null,lastSize:null,lastPositions:new WeakMap,prevRange:null});d.current.enabled=a,d.current.mode=l;const f=C.useRef(!1),m=p=>{const b=d.current;if(!b.enabled||!b.container)return;const S=p.getTotalSize();if(S!==b.lastSize){b.lastSize=S;const j=p.options.horizontal?"width":"height";b.container.style[j]=`${S}px`}},g=p=>{const b=d.current;if(!b.enabled||!b.container)return;m(p);const S=!!p.options.horizontal,j=b.mode==="transform",N=S?"left":"top",R=p.options.scrollMargin,A=p.getVirtualItems();for(const T of A){const O=T.start-R,M=p.elementsCache.get(T.key);M&&b.lastPositions.get(M)!==O&&(b.lastPositions.set(M,O),j?M.style.transform=S?`translate3d(${O}px, 0, 0)`:`translate3d(0, ${O}px, 0)`:M.style[N]=`${O}px`)}},v={...i,onChange:(p,b)=>{var S;const j=d.current;let N=!0;if(j.enabled){g(p);const R=p.range,A=j.prevRange;N=!A||A.isScrolling!==p.isScrolling||A.startIndex!==(R==null?void 0:R.startIndex)||A.endIndex!==(R==null?void 0:R.endIndex),N&&(j.prevRange=R?{startIndex:R.startIndex,endIndex:R.endIndex,isScrolling:p.isScrolling}:null)}N&&(n&&b&&!f.current?Jr.flushSync(c):c()),(S=i.onChange)==null||S.call(i,p,b)}},[x]=C.useState(()=>{const p=new u4(v),b=p.measureElement;return p.measureElement=S=>{f.current=!0;try{b(S)}finally{f.current=!1}},Object.assign(p,{containerRef:S=>{const j=d.current;if(j.container=S,j.lastSize=null,S&&j.enabled){const N=p.getTotalSize();j.lastSize=N;const R=p.options.horizontal?"width":"height";S.style[R]=`${N}px`}}})});return x.setOptions(v),vm(()=>x._didMount(),[]),vm(()=>(m(x),x._willUpdate())),vm(()=>{g(x)}),x}function m4(n){return f4({observeElementRect:n4,observeElementOffset:l4,scrollToFn:r4,...n})}const cb=33,Ii=32,g4=25;function ub({items:n,scrollRef:a,columnCount:l,getKey:i,render:c,onEndReached:d,endThreshold:f=15,rowHeight:m=cb}){var R;const g=m4({count:n.length,getScrollElement:()=>a.current,estimateSize:()=>m,overscan:8,scrollMargin:Ii,getItemKey:A=>i(n[A],A),initialRect:{width:1e3,height:Ii+m*10}}),v=!((R=g.scrollRect)!=null&&R.height),x=v?n.slice(0,g4).map((A,T)=>({key:i(A,T),index:T,start:Ii+T*m,end:Ii+(T+1)*m})):g.getVirtualItems(),p=x[0],b=x[x.length-1],S=(b==null?void 0:b.index)??-1;C.useEffect(()=>{d&&S>=0&&S>=n.length-f&&d()},[S,n.length,f,d]);const j=!v&&p?p.start-Ii:0,N=!v&&b?g.getTotalSize()-(b.end-Ii):0;return r.jsxs(r.Fragment,{children:[j>0&&r.jsx("tbody",{"aria-hidden":!0,children:r.jsx("tr",{className:"vt-spacer",style:{height:j},children:r.jsx("td",{colSpan:l})})}),x.map(A=>r.jsx("tbody",{"data-index":A.index,ref:v?void 0:g.measureElement,children:c(n[A.index],A.index)},A.key)),N>0&&r.jsx("tbody",{"aria-hidden":!0,children:r.jsx("tr",{className:"vt-spacer",style:{height:N},children:r.jsx("td",{colSpan:l})})})]})}function Il({text:n,query:a}){const l=a.trim();if(!l||iM(l))return r.jsx(r.Fragment,{children:n});const i=[],c=n.toLowerCase(),d=l.toLowerCase();let f=0;for(let m=c.indexOf(d);m!==-1;m=c.indexOf(d,f))m>f&&i.push(n.slice(f,m)),i.push(r.jsx("mark",{children:n.slice(m,m+l.length)},m)),f=m+l.length;return i.push(n.slice(f)),r.jsx(r.Fragment,{children:i})}function t2({value:n,max:a,clonal:l}){return n===null?r.jsx("span",{style:{color:"var(--chev)"},children:"–"}):r.jsxs("span",{className:"vbar",children:[r.jsx("span",{className:"vbar-n",children:ng(n)}),r.jsxs("span",{className:"vbar-track","aria-hidden":!0,children:[r.jsx("span",{className:"vbar-fill",style:{width:`${Math.min(n/a,1)*100}%`}}),l&&r.jsx("span",{className:"vbar-tick",style:{left:`${1/a*100}%`}})]})]})}function p4({variant:n,showDriver:a}){return r.jsxs("span",{className:"flex flex-wrap gap-1.5",children:[a&&n.is_driver&&r.jsx("span",{className:"sc-pill p-neu",children:"Driver"}),n.hotspot&&r.jsx("span",{className:"sc-pill p-hot",children:"Hotspot"}),n.in_dmp&&r.jsx("span",{className:"sc-pill p-dmp",children:"In DMP"}),n.ffpe_removed&&r.jsx("span",{className:"sc-pill p-ffpe",title:"Left out of the report's counts by its FFPE artifact filter",children:"FFPE filtered"})]})}function x4(n){return`${n.ref}>${n.alt}`}function v4({variant:n,onLocate:a}){const[l,i]=C.useState(!1),c=`chr${n.chrom}:${n.pos}`,d=[["Variant",`${n.kind==="snv"?"SNV":n.kind==="indel"?"Indel":n.kind}, ${x4(n)}`],...n.depth!==null?[["Reads",`${n.alt_reads??"?"} of ${n.depth}`]]:[],["Normal VAF",ng(n.normal_vaf)],["Mutant copies",cM(n.mut_alleles)??"–"],["Consequence",(n.consequence??n.effect??"–").replace(/&/g,", ")],["COSMIC",rM(n.cosmic)??"–"],...n.ffpe_score!==null||n.ffpe_removed?[["FFPE artifact score",n.ffpe_score!==null?ng(n.ffpe_score):"Not scored"]]:[],["Expression",n.gene_tpm!==null?`${n.gene_tpm.toFixed(1)} TPM`:"–"],["Gene role",uM(n)??"–"]];return r.jsxs("div",{className:"vt-detail-body",children:[r.jsx("dl",{className:"vt-facts",children:d.map(([f,m])=>r.jsxs("div",{children:[r.jsx("dt",{children:f}),r.jsx("dd",{children:m})]},f))}),r.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[r.jsxs("button",{type:"button",className:"sc-btn sc-b2 sm",onClick:()=>a(n),children:[r.jsx(tg,{size:14,"aria-hidden":!0}),"Show on copy number"]}),r.jsxs("button",{type:"button",className:"sc-btn sc-b2 sm",onClick:async()=>{try{await navigator.clipboard.writeText(c),i(!0),window.setTimeout(()=>i(!1),1500)}catch{window.prompt("Copy this locus",c)}},children:[r.jsx(vy,{size:14,"aria-hidden":!0}),l?"Copied":"Copy locus"]})]})]})}function y4({sort:n,current:a,onSort:l}){const i=a.replace(/^-/,"")===n.key,c=a.startsWith("-"),d=i?c?n.key:`-${n.key}`:n.descFirst?`-${n.key}`:n.key;return r.jsxs("button",{type:"button",className:"vt-sort","data-active":i,onClick:()=>l(d),title:`Sort by ${n.label.toLowerCase()}`,children:[n.label,i&&c?r.jsx(qu,{size:12,"aria-hidden":!0}):i?r.jsx(fy,{size:12,"aria-hidden":!0}):r.jsx(qu,{size:12,"aria-hidden":!0,className:"vt-sort-idle"})]})}function b4({data:n,rows:a,hasMore:l,loadingMore:i,onMore:c,table:d,fetching:f,showCcf:m,onTable:g,onHover:v,onLocate:x}){const[p,b]=C.useState({}),S=d.q,j=d.scope!=="drivers",N=C.useMemo(()=>[{id:"expand",header:()=>r.jsx("span",{className:"sr-only",children:"Details"}),meta:{className:"pin vt-x"},cell:({row:_})=>r.jsx("button",{type:"button",className:"vt-expand","aria-expanded":_.getIsExpanded(),"aria-label":`Details of ${_.original.gene??"this mutation"} ${_.original.protein_change??""}`.trim(),onClick:D=>{D.stopPropagation(),_.toggleExpanded()},onFocus:()=>v(_.original),children:r.jsx(ad,{size:14,"aria-hidden":!0})})},{id:"gene",header:"Gene",meta:{className:"pin vt-g",sorts:[{key:"gene",label:"Gene"},{key:"position",label:"Position"}]},cell:({row:{original:_}})=>r.jsxs(r.Fragment,{children:[r.jsx("span",{className:"vt-gene",children:r.jsx(Il,{text:_.gene??"–",query:S})}),r.jsx("span",{className:"vt-sub mono",children:Gr(_.chrom,_.pos)})]})},{id:"change",header:"Change",cell:({row:{original:_}})=>r.jsxs(r.Fragment,{children:[r.jsx("span",{className:"mono text-[12.5px] font-medium",children:r.jsx(Il,{text:_.protein_change??"–",query:S})}),_.cdna_change&&r.jsx("span",{className:"vt-sub mono",children:r.jsx(Il,{text:_.cdna_change,query:S})})]})},{id:"effect",header:"Effect",meta:{sorts:[{key:"effect",label:"Effect"}]},cell:({row:{original:_}})=>r.jsx("span",{className:_.effect_class==="truncating"?"font-semibold":void 0,children:AC(_.consequence,_.effect)})},{id:"vaf",header:"VAF",meta:{className:"n",sorts:[{key:"vaf",label:"VAF",descFirst:!0}]},cell:({row:{original:_}})=>r.jsx(t2,{value:_.vaf,max:1})},...m?[{id:"ccf",header:"CCF",meta:{className:"n",sorts:[{key:"ccf",label:"CCF",descFirst:!0}]},cell:({row:{original:_}})=>r.jsx(t2,{value:_.ccf,max:1.25,clonal:!0})}]:[],{id:"flags",header:"Flags",cell:({row:{original:_}})=>r.jsx(p4,{variant:_,showDriver:j})}],[S,j,m,v]),R=ob({data:a,columns:N,getRowId:lM,getCoreRowModel:lb(),getExpandedRowModel:ib(),getRowCanExpand:()=>!0,manualPagination:!0,state:{expanded:p},onExpandedChange:b}),A=d.sort.replace(/^-/,""),T=R.getVisibleLeafColumns().length,O=Ly(d)>0,M=C.useRef(null),E=JSON.stringify([d.scope,d.sort,d.q,d.effects,d.flags,d.range,d.ffpe]);return C.useEffect(()=>{M.current&&(M.current.scrollTop=0)},[E]),r.jsxs("div",{className:"flex min-w-0 flex-col",children:[r.jsx("div",{className:"tbar",children:r.jsx(Zu,{value:d.q,onChange:_=>g({q:_})})}),r.jsxs("div",{ref:M,className:"vt-scroll vt-viewport",onMouseLeave:()=>v(null),"aria-busy":f,children:[f&&r.jsx("div",{className:"vt-progress","aria-hidden":!0}),r.jsxs("table",{className:"vt",children:[r.jsx("thead",{children:R.getHeaderGroups().map(_=>r.jsx("tr",{children:_.headers.map(D=>{var z;const P=D.column.columnDef.meta,Z=(z=P==null?void 0:P.sorts)==null?void 0:z.some(te=>te.key===A);return r.jsx("th",{className:P==null?void 0:P.className,"aria-sort":Z?d.sort.startsWith("-")?"descending":"ascending":void 0,children:P!=null&&P.sorts?r.jsx("span",{className:"vt-sorts",children:P.sorts.map(te=>r.jsx(y4,{sort:te,current:d.sort,onSort:ie=>g({sort:ie})},te.key))}):Ku(D.column.columnDef.header,D.getContext())},D.id)})},_.id))}),r.jsx(ub,{items:R.getRowModel().rows,scrollRef:M,columnCount:T,getKey:_=>_.id,onEndReached:l&&!i?c:void 0,render:_=>r.jsxs(r.Fragment,{children:[r.jsx("tr",{className:"vt-row","data-expanded":_.getIsExpanded(),onClick:()=>_.toggleExpanded(),onMouseEnter:()=>v(_.original),children:_.getVisibleCells().map(D=>{var P;return r.jsx("td",{className:(P=D.column.columnDef.meta)==null?void 0:P.className,children:Ku(D.column.columnDef.cell,D.getContext())},D.id)})}),_.getIsExpanded()&&r.jsx("tr",{className:"vt-detail",children:r.jsx("td",{colSpan:T,children:r.jsx(v4,{variant:_.original,onLocate:x})})})]})}),a.length===0&&r.jsx("tbody",{children:r.jsx("tr",{children:r.jsx("td",{colSpan:T,children:r.jsx("div",{className:"vt-empty",children:O?r.jsxs(r.Fragment,{children:["No mutations match these filters.",r.jsx("button",{type:"button",className:"sc-btn sc-b2 sm",onClick:()=>g({q:"",effects:[],flags:[],range:null}),children:"Clear all filters"})]}):`No ${d.scope==="all"?"":`${d.scope} `}mutations in this sample.`})})})})]})]}),n.total>0&&r.jsx(hd,{shown:a.length,total:n.total,noun:["mutation","mutations"],loaded:!0,note:i?"Loading more…":a.length<n.total?"Scroll the table for more":void 0})]})}const S4=C.forwardRef(function({variants:a,rows:l,hasMore:i,loadingMore:c,onMore:d,variantsLoading:f,variantsFetching:m,density:g,densityLoading:v,picked:x,measure:p,onMeasure:b,table:S,onTable:j,hovered:N,onHover:R,onLocate:A,showCcf:T,tmb:O},M){var te,ie;const E=(a==null?void 0:a.status)==="ok"?a.data??void 0:void 0,_=E==null?void 0:E.counts,D=(g==null?void 0:g.status)==="ok"?(te=g.data)==null?void 0:te.total:void 0,P=(g==null?void 0:g.status)==="ok"?(ie=g.data)==null?void 0:ie.ffpe:null,Z=J=>J===void 0?"":J.toLocaleString("en-US"),z=S.range&&S.range.measure===p?[S.range.low,S.range.high]:null;return r.jsxs(hs,{ref:M,title:"Mutations",subtitle:D!==void 0?`${Z(D)} PASS SNVs and indels${P&&!P.shown?", after the FFPE filter":""}`:void 0,lineage:rd(g==null?void 0:g.lineage,a==null?void 0:a.lineage,O==null?void 0:O.lineage),picked:x,className:"mut",info:"mutations",expandable:!0,controls:r.jsx(r.Fragment,{children:r.jsx(es,{label:"Which mutations",value:S.scope,onChange:J=>j({scope:J,sort:ky[J]}),options:[{value:"drivers",label:r.jsxs(r.Fragment,{children:["Drivers",r.jsx("span",{className:"seg-n",children:Z(_==null?void 0:_.drivers)})]})},{value:"coding",label:r.jsxs(r.Fragment,{children:["Coding",r.jsx("span",{className:"seg-n",children:Z(_==null?void 0:_.coding)})]})},{value:"all",label:r.jsxs(r.Fragment,{children:["All",r.jsx("span",{className:"seg-n",children:Z(_==null?void 0:_.all)})]})}]})}),children:[r.jsx(eE,{envelope:g,loading:v,measure:p,onMeasure:b,range:z,focus:N,onRange:J=>{!J&&!S.range||j({range:J?{measure:p,low:J[0],high:J[1]}:null})},onGene:J=>j({q:J})}),E&&a&&a.warnings.length>0&&r.jsx("div",{className:"px-5 py-2 text-xs",role:"note",style:{color:"var(--warn-ink)"},children:a.warnings.join(" ")}),E?r.jsxs("div",{className:"mut-body",children:[r.jsx(sE,{table:S,data:E,onChange:j}),r.jsx(b4,{data:E,rows:l,hasMore:i,loadingMore:c,onMore:d,table:S,fetching:m,showCcf:T,onTable:j,onHover:R,onLocate:A})]}):r.jsx("div",{className:"mut-rule",children:r.jsx(Hn,{label:"mutations",envelope:a,loading:f,skeletonHeight:240,children:()=>null})}),(O==null?void 0:O.status)==="ok"&&O.data&&r.jsx(lE,{data:O.data}),(O==null?void 0:O.status)==="missing"&&O.warnings.some(J=>J.includes("Rerun"))&&r.jsxs("section",{className:"sig-section","aria-label":"Coding mutations against reference cohorts",children:[r.jsx("h3",{className:"sv-h",children:"Coding mutations against reference cohorts"}),r.jsx("p",{className:"sv-empty",children:O.warnings.join(" ")})]})]})}),Hg={oncogene:"Oncogene",tsg:"Tumour suppressor",both:"Oncogene and TSG"},db=["oncogene","tsg","both"],Ql={deletion:"Deletion","tandem-duplication":"Tandem duplication",inversion:"Inversion",translocation:"Translocation"},j4={"<1kb":"<1 kb","1kb-10kb":"1–10 kb","10kb-100kb":"10–100 kb","100kb-1Mb":"100 kb–1 Mb",">1Mb":">1 Mb"};function w4(n){return n?j4[n]??n:""}const N4={DEL:"Deletion",DUP:"Duplication",INV:"Inversion",TRA:"Translocation",BND:"Breakend",INS:"Insertion"};function Ug(n){return n?N4[n]??n:"–"}function C4(n){return n==null?"–":n>=1e6?`${(n/1e6).toLocaleString("en-US",{maximumFractionDigits:1})} Mb`:n>=1e3?`${(n/1e3).toLocaleString("en-US",{maximumFractionDigits:1})} kb`:`${n.toLocaleString("en-US")} bp`}function M4(n){return n.some(a=>a.left_expression||a.right_expression||a.expression)}function E4(n){const a={oncogene:0,tsg:0,both:0};for(const l of n)l.role&&(a[l.role]+=1);return a}function R4(n){const a=n.trim().match(Uy);if(!a)return null;const l=Number(a[2].replace(/,/g,"")),i=a[3]?Number(a[3].replace(/,/g,"")):l;return{chrom:a[1].toUpperCase(),start:Math.min(l,i),end:Math.max(l,i)}}function T4(n,a){const l=a.trim().toLowerCase();if(!l)return!0;const i=R4(a);if(i){const c=(d,f)=>(d==null?void 0:d.toUpperCase())===i.chrom&&f!==null&&f>=i.start&&f<=i.end;return c(n.left_chrom,n.left_pos)||c(n.right_chrom,n.right_pos)}return[n.gene,n.left_gene,n.right_gene,n.callers,n.left_loc,n.right_loc,n.sv_type,Ug(n.sv_type),n.role?Hg[n.role]:null].some(c=>c==null?void 0:c.toLowerCase().includes(l))}const Ln={deletion:"var(--sv-del)","tandem-duplication":"var(--sv-dup)",inversion:"var(--sv-inv)",translocation:"var(--sv-tra)"},_4={deletion:"Deletion","tandem-duplication":"Tandem dup.",inversion:"Inversion",translocation:"Transl."},A4={"<1kb":"<1k","1kb-10kb":"10k","10kb-100kb":"100k","100kb-1Mb":"1M",">1Mb":">1M"};function O4(n){return n.size?A4[n.size]??n.size:""}function n2(n){const a=`${n.clustered?"Clustered":"Dispersed"} ${Ql[n.sv_class].toLowerCase()}s`;return n.size?`${a}, ${w4(n.size)}`:a}function z4(n){const a=[];return n.forEach((l,i)=>{const c=a[a.length-1];c&&c.clustered===l.clustered&&c.sv_class===l.sv_class?c.end=i:a.push({clustered:l.clustered,sv_class:l.sv_class,start:i,end:i})}),a}function D4(n){const a=new Map;for(const l of n)a.set(l.sv_class,(a.get(l.sv_class)??0)+l.count);return[...a].map(([l,i])=>({sv_class:l,count:i}))}const k4=45;function L4({role:n}){return n?r.jsx("span",{className:`sc-pill p-${n==="oncogene"?"onco":n}`,children:Hg[n]}):r.jsx("span",{style:{color:"var(--chev)"},children:"–"})}function $4({rows:n,shown:a,onToggle:l}){const i=E4(n);return r.jsx("div",{className:"sv-legend",role:"group","aria-label":"Show rows by gene role",children:db.filter(c=>i[c]>0).map(c=>r.jsxs("button",{type:"button",className:`sv-legend-item p-${c==="oncogene"?"onco":c}`,"aria-pressed":a.includes(c),onClick:()=>l(c),children:[Hg[c],r.jsx("span",{className:"sv-legend-n",children:i[c]})]},c))})}function s2({gene:n,chrom:a,pos:l,loc:i,query:c}){return r.jsxs(r.Fragment,{children:[r.jsxs("span",{className:"sv-end",children:[r.jsx("span",{className:"vt-gene",children:r.jsx(Il,{text:n||"–",query:c})}),i&&r.jsx("span",{className:"sv-loc",children:i})]}),r.jsx("span",{className:"vt-sub stack mono",children:a&&l!==null?Gr(a,l):"–"})]})}function hb(n){return n?n.replace(/,\s*/g,", "):"–"}function H4({label:n,sorted:a,onClick:l}){return r.jsxs("button",{type:"button",className:"vt-sort","data-active":!!a,onClick:l,title:`Sort by ${n.toLowerCase()}`,children:[n,a==="desc"?r.jsx(qu,{size:12,"aria-hidden":!0}):a==="asc"?r.jsx(fy,{size:12,"aria-hidden":!0}):r.jsx(qu,{size:12,"aria-hidden":!0,className:"vt-sort-idle"})]})}function U4({row:n,onLocate:a}){const[l,i]=C.useState(!1),c=n.left_chrom&&n.left_pos!==null?{chrom:n.left_chrom,pos:n.left_pos}:null,d=n.right_chrom&&n.right_pos!==null?{chrom:n.right_chrom,pos:n.right_pos}:null,f=[["Type",Ug(n.sv_type)],["Left breakpoint",c?`${Gr(c.chrom,c.pos)}${n.left_loc?`, ${n.left_loc}`:""}`:"–"],["Right breakpoint",d?`${Gr(d.chrom,d.pos)}${n.right_loc?`, ${n.right_loc}`:""}`:"–"],["Pileups (left, right)",[n.left_pileup,n.right_pileup].filter(Boolean).join(", ")||"–"],["Orientation",n.orientation??"–"],["Callers",hb(n.callers)]],m=n.gene??n.left_gene,g=n.gene??n.right_gene;return r.jsxs("div",{className:"vt-detail-body",children:[r.jsx("dl",{className:"vt-facts",children:f.map(([v,x])=>r.jsxs("div",{children:[r.jsx("dt",{children:v}),r.jsx("dd",{children:x})]},v))}),r.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[c&&r.jsxs("button",{type:"button",className:"sc-btn sc-b2 sm",onClick:()=>a({...c,gene:m}),children:[r.jsx(tg,{size:14,"aria-hidden":!0}),"Show ",d&&d.chrom===c.chrom?"it":"left breakpoint"," on copy number"]}),d&&d.chrom!==(c==null?void 0:c.chrom)&&r.jsxs("button",{type:"button",className:"sc-btn sc-b2 sm",onClick:()=>a({...d,gene:g}),children:[r.jsx(tg,{size:14,"aria-hidden":!0}),"Show right breakpoint on copy number"]}),n.igv_locus&&r.jsxs("button",{type:"button",className:"sc-btn sc-b2 sm",onClick:async()=>{try{await navigator.clipboard.writeText(n.igv_locus??""),i(!0),window.setTimeout(()=>i(!1),1500)}catch{window.prompt("Copy these IGV loci",n.igv_locus??"")}},children:[r.jsx(vy,{size:14,"aria-hidden":!0}),l?"Copied":"Copy IGV loci"]})]})]})}function a2({kind:n,rows:a,total:l=a.length,query:i="",onLocate:c}){const[d,f]=C.useState({}),[m,g]=C.useState([]),v=C.useRef(null),x=M4(a);C.useEffect(()=>{v.current&&(v.current.scrollTop=0)},[i,a.length]);const p=C.useMemo(()=>{const N={id:"expand",header:()=>r.jsx("span",{className:"sr-only",children:"Details"}),enableSorting:!1,meta:{className:"pin vt-x"},cell:({row:T})=>r.jsx("button",{type:"button",className:"vt-expand","aria-expanded":T.getIsExpanded(),"aria-label":`Details of ${T.original.gene??[T.original.left_gene,T.original.right_gene].filter(Boolean).join(" and ")}`,onClick:O=>{O.stopPropagation(),T.toggleExpanded()},children:r.jsx(ad,{size:14,"aria-hidden":!0})})},R=[{id:"type",header:"Type",accessorFn:T=>T.sv_type??"",cell:({row:{original:T}})=>Ug(T.sv_type)},{id:"role",header:"Role",accessorFn:T=>T.role?db.indexOf(T.role):9,cell:({row:{original:T}})=>r.jsx(L4,{role:T.role})},{id:"callers",header:"Callers",accessorFn:T=>T.callers??"",cell:({row:{original:T}})=>r.jsx("span",{className:"text-[12.5px]",children:hb(T.callers)})},{id:"support",header:"Support",accessorFn:T=>T.max_support??-1,sortDescFirst:!0,meta:{className:"n"},cell:({row:{original:T}})=>r.jsx("span",{className:"mono",children:T.max_support??"–"})},{id:"pileups",header:"Pileups",enableSorting:!1,cell:({row:{original:T}})=>r.jsx("span",{className:"mono text-[12px]",children:[T.left_pileup,T.right_pileup].filter(Boolean).join(" · ")||"–"})}],A=x?[{id:"expression",header:"Expression",enableSorting:!1,cell:({row:{original:T}})=>n==="whole_gene"?r.jsx("span",{className:"text-[12.5px]",children:T.expression??"–"}):r.jsxs("span",{className:"flex flex-col text-[12.5px] leading-snug",children:[r.jsx("span",{children:T.left_expression??"–"}),r.jsx("span",{style:{color:"var(--muted)"},children:T.right_expression??"–"})]})}]:[];return n==="whole_gene"?[N,{id:"gene",header:"Gene",accessorFn:T=>T.gene??"",meta:{className:"pin vt-g"},cell:({row:{original:T}})=>r.jsxs(r.Fragment,{children:[r.jsx("span",{className:"vt-gene",children:r.jsx(Il,{text:T.gene??"–",query:i})}),r.jsx("span",{className:"vt-sub mono",children:T.left_chrom&&T.left_pos!==null&&T.right_pos!==null?`${Gr(T.left_chrom,T.left_pos)}–${T.right_pos.toLocaleString("en-US")}`:"–"})]})},{id:"length",header:"Length",accessorFn:T=>T.length??-1,sortDescFirst:!0,meta:{className:"n"},cell:({row:{original:T}})=>r.jsx("span",{className:"mono",children:C4(T.length)})},...R,...A]:[N,{id:"left",header:"Left",accessorFn:T=>T.left_gene??"",meta:{className:"pin vt-g"},cell:({row:{original:T}})=>r.jsx(s2,{gene:T.left_gene,chrom:T.left_chrom,pos:T.left_pos,loc:T.left_loc,query:i})},{id:"right",header:"Right",accessorFn:T=>T.right_gene??"",cell:({row:{original:T}})=>r.jsx(s2,{gene:T.right_gene,chrom:T.right_chrom,pos:T.right_pos,loc:T.right_loc,query:i})},...R,...A]},[n,x,i]),b=ob({data:a,columns:p,getRowId:N=>`${n}-${N.row}`,getCoreRowModel:lb(),getSortedRowModel:QE(),getExpandedRowModel:ib(),getRowCanExpand:()=>!0,state:{expanded:d,sorting:m},onExpandedChange:f,onSortingChange:g}),S=b.getVisibleLeafColumns().length,j=n==="onco"?k4:cb;return r.jsxs(r.Fragment,{children:[r.jsx("div",{ref:v,className:"vt-scroll vt-viewport",style:{"--row-h":`${j}px`},children:r.jsxs("table",{className:"vt",children:[r.jsx("thead",{children:b.getHeaderGroups().map(N=>r.jsx("tr",{children:N.headers.map(R=>{const A=R.column.columnDef.meta,T=R.column.getIsSorted();return r.jsx("th",{className:A==null?void 0:A.className,"aria-sort":T?T==="desc"?"descending":"ascending":void 0,children:R.column.getCanSort()?r.jsx(H4,{label:String(R.column.columnDef.header),sorted:T,onClick:R.column.getToggleSortingHandler()}):Ku(R.column.columnDef.header,R.getContext())},R.id)})},N.id))}),r.jsx(ub,{items:b.getRowModel().rows,scrollRef:v,columnCount:S,rowHeight:j,getKey:N=>N.id,render:N=>r.jsxs(r.Fragment,{children:[r.jsx("tr",{className:"vt-row","data-expanded":N.getIsExpanded(),onClick:()=>N.toggleExpanded(),children:N.getVisibleCells().map(R=>{var A;return r.jsx("td",{className:(A=R.column.columnDef.meta)==null?void 0:A.className,children:Ku(R.column.columnDef.cell,R.getContext())},R.id)})}),N.getIsExpanded()&&r.jsx("tr",{className:"vt-detail",children:r.jsx("td",{colSpan:S,children:r.jsx(U4,{row:N.original,onLocate:c})})})]})})]})}),r.jsx(hd,{shown:a.length,total:l,noun:["row","rows"]})]})}const _r=176,ym=34,bm=7,Sm=22,Lu=30,B4={deletion:"Del","tandem-duplication":"Dup",inversion:"Inv",translocation:"Tra"};function F4(n,a){return[Ql[n],_4[n],B4[n]].find(i=>zs(i,12)+8<=a)??""}function V4(n,a,l,i,c){const d=Math.min(c,l/2,i);return`M${n},${a+i} V${a+d} Q${n},${a} ${n+d},${a} H${n+l-d} Q${n+l},${a} ${n+l},${a+d} V${a+i} Z`}function G4({categories:n,total:a,litClass:l}){const[i,c]=ks(),d=C.useId(),[f,m]=C.useState(null),g=z4(n),v=Math.max(0,...n.map(z=>z.count)),x=ud(v,3),p=x[x.length-1],b=n.length,S=(g.length-1)*bm,j=n.some(z=>z.clustered)&&n.some(z=>!z.clustered),N=Math.max((c-Lu-6-S-(j?Sm-bm:0))/b,4),R=Math.min(26,N*.64),A=[],T=[];let O=Lu;g.forEach((z,te)=>{te>0&&(O+=g[te-1].clustered!==z.clustered?Sm:bm);const ie=O;for(let re=z.start;re<=z.end;re++)A[re]=O+(N-R)/2,O+=N;const J=T.find(re=>re.clustered===z.clustered&&re.x1>=ie-Sm-1),se=n.slice(z.start,z.end+1).reduce((re,$)=>re+$.count,0);J?(J.x1=O,J.count+=se):T.push({clustered:z.clustered,x0:ie,x1:O,count:se})});const M=z=>ym+_r-z/p*_r,E=ym+_r,_=z=>f!==null?z===f:l?n[z].sv_class===l:!0,D=f===null?null:n[f],P=D&&a?Math.round(D.count/a*100):0,Z=E+62;return r.jsxs("div",{ref:i,className:"rs","data-lit":f!==null||l?"":void 0,children:[r.jsxs("svg",{width:c,height:Z,role:"img","aria-label":`Rearrangement signatures: ${n.filter(z=>z.count>0).map(z=>`${z.category} ${z.count}`).join(", ")}`,children:[r.jsx("defs",{children:Object.keys(Ln).map(z=>r.jsxs("linearGradient",{id:`${d}-${z}`,x1:"0",y1:"0",x2:"0",y2:"1",children:[r.jsx("stop",{offset:"0",style:{stopColor:Ln[z]}}),r.jsx("stop",{offset:"1",style:{stopColor:Ln[z]},stopOpacity:.72})]},z))}),T.map(z=>r.jsxs("g",{children:[j&&z.clustered&&r.jsx("rect",{x:z.x0-6,y:0,width:z.x1-z.x0+12,height:E+56,rx:14,className:"rs-zone"}),j&&r.jsxs("text",{x:z.x0,y:17,className:"rs-zone-name",children:[z.clustered?"Clustered":"Dispersed",r.jsxs("tspan",{className:"rs-zone-n",children:[" ",z.count.toLocaleString("en-US")]})]})]},z.clustered?"c":"d")),x.map(z=>r.jsxs("g",{children:[r.jsx("line",{x1:Lu-4,x2:c,y1:M(z),y2:M(z),className:z===0?"rs-base":"rs-grid"}),r.jsx("text",{x:Lu-10,y:M(z)+4,textAnchor:"end",className:"rs-tick",children:z.toLocaleString("en-US")})]},z)),n.map((z,te)=>{const ie=z.count/p*_r,J=_(te);return r.jsxs("g",{className:"rs-bar","data-off":J?void 0:"",children:[z.count>0?r.jsxs(r.Fragment,{children:[r.jsx("path",{d:V4(A[te],M(z.count),R,ie,6),fill:`url(#${d}-${z.sv_class})`,fillOpacity:z.clustered?.5:1}),r.jsx("text",{x:A[te]+R/2,y:M(z.count)-7,textAnchor:"middle",className:"rs-count",children:z.count.toLocaleString("en-US")})]}):r.jsx("rect",{x:A[te],y:E-3,width:R,height:3,rx:1.5,style:{fill:Ln[z.sv_class]},fillOpacity:.28}),z.size&&N>=26&&r.jsx("text",{x:A[te]+R/2,y:E+16,textAnchor:"middle",className:"rs-size",children:O4(z)}),r.jsx("rect",{x:A[te]-(N-R)/2,y:ym-8,width:N,height:_r+30,fill:"transparent",tabIndex:0,"aria-label":`${n2(z)}: ${z.count}`,onMouseEnter:()=>m(te),onMouseLeave:()=>m(null),onFocus:()=>m(te),onBlur:()=>m(null)})]},z.category)}),g.map(z=>{const te=A[z.start],ie=A[z.end]+R,J=F4(z.sv_class,ie-te+(N-R));return r.jsxs("g",{className:"rs-class","data-off":l&&l!==z.sv_class?"":void 0,children:[r.jsx("line",{x1:te,x2:ie,y1:E+26,y2:E+26,style:{stroke:Ln[z.sv_class]},className:"rs-bracket"}),r.jsx("text",{x:(te+ie)/2,y:E+44,textAnchor:"middle",className:"rs-class-name",children:J})]},`${z.clustered}-${z.sv_class}`)})]}),D&&f!==null&&r.jsxs(Kt,{x:A[f]+R/2,y:Math.max(M(D.count)-8,40),width:c,above:!0,children:[r.jsxs("span",{className:"ctip-title",children:[r.jsx("span",{className:"sv-swatch",style:{background:Ln[D.sv_class],opacity:D.clustered?.5:1},"aria-hidden":!0}),n2(D)]}),r.jsxs("span",{className:"ctip-row",children:[r.jsx("span",{children:"Rearrangements"}),r.jsx("b",{children:D.count.toLocaleString("en-US")})]}),a>0&&r.jsxs("span",{className:"ctip-row",children:[r.jsx("span",{children:"Of all of them"}),r.jsxs("b",{children:[P===0&&D.count>0?"<1":P,"%"]})]})]})]})}function fb(n,a,l){return`${n.toLocaleString("en-US")} ${n===1?a:l}`}function q4({categories:n,total:a}){const[l,i]=C.useState(null),c=D4(n);return r.jsxs("div",{className:"sv-sigs",children:[r.jsxs("div",{className:"sv-sigs-head",children:[r.jsxs("h3",{className:"sv-h",children:["Rearrangement signatures",r.jsx("span",{className:"sv-h-n",children:fb(a,"rearrangement","rearrangements")})]}),r.jsxs("ul",{className:"sv-sigs-key","aria-label":"Classes",onMouseLeave:()=>i(null),children:[c.map(({sv_class:d,count:f})=>r.jsxs("li",{"data-on":l===d||void 0,onMouseEnter:()=>i(d),children:[r.jsx("span",{className:"sv-swatch",style:{background:Ln[d]},"aria-hidden":!0}),Ql[d],r.jsx("span",{className:"sv-key-n",children:f.toLocaleString("en-US")})]},d)),r.jsx("li",{className:"sv-sigs-note",children:"Lighter bars: clustered"})]})]}),r.jsx("div",{className:"sv-sigs-plot",children:r.jsx(G4,{categories:n,total:a,litClass:l})})]})}function I4({data:n,query:a,onQuery:l,onLocate:i}){const[c,d]=C.useState([]),f=S=>d(j=>j.includes(S)?j.filter(N=>N!==S):[...j,S]),m=S=>S.filter(j=>T4(j,a)),g=S=>c.length?S.filter(j=>j.role&&c.includes(j.role)):S,v=[...n.onco,...n.whole_gene],x=[...m(n.onco),...m(n.whole_gene)],p=g(m(n.onco)),b=g(m(n.whole_gene));return v.length===0?r.jsx("p",{className:"sv-empty",children:"No rearrangements with breakpoints in oncogenes or tumour suppressors."}):r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"tbar",children:[x.length>0&&r.jsx($4,{rows:x,shown:c,onToggle:f}),r.jsx(Zu,{value:a,onChange:l,label:"Search structural variants",placeholder:"Search gene, caller or locus",shortcut:!1})]}),x.length===0&&r.jsxs("div",{className:"vt-empty sv-empty",children:["No rows match this search.",r.jsx("button",{type:"button",className:"sc-btn sc-b2 sm",onClick:()=>l(""),children:"Clear the search"})]}),p.length>0&&r.jsxs("section",{className:"sv-table","aria-label":"Rearranged oncogenes and tumour suppressors",children:[r.jsx("h3",{className:"sv-h",children:"Rearranged oncogenes and tumour suppressors"}),r.jsx(a2,{kind:"onco",rows:p,total:n.onco.length,query:a,onLocate:i})]}),b.length>0&&r.jsxs("section",{className:"sv-table","aria-label":"Whole-gene rearrangements",children:[r.jsx("h3",{className:"sv-h",children:"Whole-gene rearrangements"}),r.jsx(a2,{kind:"whole_gene",rows:b,total:n.whole_gene.length,query:a,onLocate:i})]})]})}const P4=C.forwardRef(function({envelope:a,loading:l,picked:i,onLocate:c},d){const f=(a==null?void 0:a.status)==="ok"?a.data:null,[m,g]=C.useState("");return r.jsx(hs,{ref:d,title:"Structural variants",subtitle:f?fb(f.rearrangements,"rearrangement","rearrangements"):void 0,lineage:(a==null?void 0:a.lineage)??[],picked:i,info:"structuralVariants",className:"svs",expandable:!0,children:r.jsx(Hn,{label:"structural variants",envelope:a,loading:l,skeletonHeight:220,children:v=>r.jsxs("div",{className:"sv-body",children:[r.jsx(I4,{data:v,query:m,onQuery:g,onLocate:c}),v.signatures&&r.jsx(q4,{categories:v.signatures.categories,total:v.signatures.total})]})})})}),l2=["C>A","C>G","C>T","T>A","T>C","T>G"],zl={"C>A":"#03bcee","C>G":"#222222","C>T":"#e32926","T>A":"#999999","T>C":"#a1ce63","T>G":"#e9a9a5"};function Q4(n,a){const l=n.contexts.every(g=>g.reconstructed!==null),i=n.contexts.reduce((g,v)=>g+v.observed,0),c=l?n.contexts.reduce((g,v)=>g+(v.reconstructed??0),0):0,d=n.contexts.map(g=>a==="share"?i?g.observed/i*100:0:g.observed),f=l?n.contexts.map(g=>a==="share"?c?(g.reconstructed??0)/c*100:0:g.reconstructed??0):null,m=f?d.map((g,v)=>g-f[v]):null;return{observed:d,reconstructed:f,difference:m,top:Math.max(0,...d,...f??[]),reach:m?Math.max(0,...m.map(Math.abs)):0}}function Y4(n){const a=[];return n.forEach((l,i)=>{const c=a[a.length-1];c&&c.substitution===l.substitution?c.end=i:a.push({substitution:l.substitution,start:i,end:i})}),a}function X4(n,a,l,i=10){const c=a-i*(n.length-1),d=p=>p.end-p.start+1,f=n.reduce((p,b)=>p+d(b),0),m=l?n.find(p=>p.substitution===l):void 0,g=m?Math.min(.62,Math.max(.4,d(m)*30/c)):0,v=[];let x=0;for(const p of n){const b=d(p),S=m?p===m?c*g:c*(1-g)*b/(f-d(m)):c*b/f,j=S/b;for(let N=0;N<b;N++)v.push({x:x+N*j+j*.11,width:j*.78});x+=S+i}return v}function jm(n){return[n.five_prime,n.substitution[0],n.three_prime]}function wm(n,a){return a==="count"?Math.round(n).toLocaleString("en-US"):`${n.toFixed(n>=10?1:2)}%`}function i2(n,a){return n==="cosine"?a.toFixed(3):a.toExponential(2).replace("e-","e−").replace("e+","e")}const Sn=46,K4=6,El=28,Nm=14,ea=96,Pi=84,Z4=["This tumour","Rebuilt from its signatures","Difference"],J4={reported:"Reported run",unfiltered:"Unfiltered"};function W4({data:n}){const[a,l]=ks(760),[i,c]=C.useState("share"),[d,f]=C.useState("reported"),[m,g]=C.useState(null),[v,x]=C.useState(null),p=n.runs.find(J=>J.source===d)??n.runs[0],b=n.reconstructed&&p.contexts.every(J=>J.reconstructed!==null),S=C.useMemo(()=>Q4(p,i),[p,i]),j=C.useMemo(()=>Y4(p.contexts),[p]),N=Math.max(l-Sn-K4,240),R=C.useMemo(()=>X4(j,N,m,Nm),[j,N,m]),A=b?3:1,T=m?22:0,O=[El,El+ea+Nm,El+2*(ea+Nm)],M=(b?O[2]+Pi:O[0]+ea)+T+8,E=i==="share"?"%":"",_=ud(S.top,2),D=_[_.length-1],P=Math.max(S.reach*1.15,i==="share"?.5:1),Z=(J,se)=>se===2?Pi/2*(1-J/P):ea*(1-J/D),z=[S.observed,S.reconstructed,S.difference],te=v===null?null:p.contexts[v],ie=J=>Sn+R[J].x+R[J].width/2;return r.jsxs("section",{className:"ctx sig-section","aria-label":"96 mutational contexts",children:[r.jsxs("div",{className:"ctx-head",children:[r.jsxs("h3",{className:"sv-h",children:["96 mutational contexts",r.jsxs("span",{className:"sv-h-n",children:[Math.round(p.total).toLocaleString("en-US")," SNVs"]})]}),r.jsxs("div",{className:"ctx-controls",children:[b&&n.fit&&r.jsxs("span",{className:"ctx-fit",title:"How well the fitted signatures rebuild the profile, as the report measures it",children:[n.fit.cosine!==null&&r.jsxs("span",{children:["Cosine similarity ",r.jsx("b",{children:i2("cosine",n.fit.cosine)})]}),n.fit.rss!==null&&r.jsxs("span",{children:["RSS ",r.jsx("b",{children:i2("rss",n.fit.rss)})]})]}),n.runs.length>1&&r.jsx(es,{label:"Run",value:d,onChange:f,options:n.runs.map(J=>({value:J.source,label:J4[J.source]}))}),r.jsx(es,{label:"Profile measure",value:i,onChange:c,options:[{value:"share",label:"Share"},{value:"count",label:"Count"}]})]})]}),r.jsx("div",{className:"ctx-wrap",children:r.jsxs("div",{ref:a,className:"ctx-plot",onMouseLeave:()=>x(null),children:[r.jsxs("svg",{width:l,height:M,role:"img","aria-label":`SNVs in the 96 mutational contexts${b?", observed and rebuilt from signatures":""}`,children:[r.jsx("g",{transform:`translate(${Sn} 0)`,children:j.map(J=>{const se=R[J.start],re=R[J.end],$=se.x-se.width*.14,G=re.x+re.width*1.14,X=m===J.substitution;return r.jsxs("g",{className:"ctx-chip","data-on":X||void 0,role:"button",tabIndex:0,"aria-pressed":X,"aria-label":`${J.substitution}: ${X?"show all classes":"label its sixteen contexts"}`,onClick:()=>g(X?null:J.substitution),onKeyDown:le=>{(le.key==="Enter"||le.key===" ")&&(le.preventDefault(),g(X?null:J.substitution))},children:[r.jsx("rect",{x:$,y:0,width:Math.max(G-$,1),height:22,rx:11}),r.jsx("circle",{cx:$+11,cy:11,r:4.5,fill:zl[J.substitution]}),r.jsx("text",{x:$+22,y:15,children:J.substitution})]},J.substitution)})}),Array.from({length:A},(J,se)=>{const re=O[se],$=se===2?Pi:ea,G=z[se];return G?r.jsxs("g",{transform:`translate(0 ${re})`,className:"ctx-panel",children:[se<2?_.map(X=>r.jsxs("g",{children:[r.jsx("line",{x1:Sn,x2:Sn+N,y1:Z(X,se),y2:Z(X,se),className:X===0?"ctx-base":"ctx-grid"}),r.jsxs("text",{x:Sn-8,y:Z(X,se)+4,textAnchor:"end",className:"ctx-tick",children:[X,E]})]},X)):r.jsxs(r.Fragment,{children:[r.jsx("line",{x1:Sn,x2:Sn+N,y1:$/2,y2:$/2,className:"ctx-base"}),r.jsx("text",{x:Sn-8,y:$/2+4,textAnchor:"end",className:"ctx-tick",children:"0"})]}),r.jsx("text",{x:Sn+2,y:12,className:"ctx-name",children:Z4[se]}),r.jsx("g",{className:"ctx-bars","data-hover":v!==null||void 0,children:G.map((X,le)=>{const ae=R[le],me=Sn+ae.x,Se=se===2?$/2:$,ce=Z(X,se),k=zl[p.contexts[le].substitution],U=Math.abs(Se-ce);return r.jsx("rect",{x:me,y:Math.min(ce,Se),width:ae.width,height:Math.max(U,X===0?0:.8),rx:Math.min(2,ae.width/2),fill:k,className:"ctx-bar","data-on":v===le||void 0,"data-dim":m&&p.contexts[le].substitution!==m?"":void 0},le)})})]},se):null}),v!==null&&r.jsx("rect",{x:Sn+R[v].x-2,y:El-4,width:R[v].width+4,height:(b?O[2]+Pi:O[0]+ea)-El+8,rx:4,className:"ctx-column",pointerEvents:"none"}),m&&p.contexts.map((J,se)=>J.substitution===m?r.jsxs("text",{x:Sn+R[se].x+R[se].width/2,y:(b?O[2]+Pi:O[0]+ea)+16,textAnchor:"middle",className:"ctx-tri",children:[jm(J)[0],r.jsx("tspan",{className:"ctx-tri-mid",style:{fill:zl[J.substitution]},children:jm(J)[1]}),jm(J)[2]]},se):null),R.map((J,se)=>r.jsx("rect",{x:Sn+J.x-(J.width*.14+1),y:El,width:J.width*1.28+2,height:(b?O[2]+Pi:O[0]+ea)-El,fill:"transparent",className:"ctx-hit",tabIndex:0,"aria-label":`${p.contexts[se].context}: ${p.contexts[se].observed} SNVs`,onMouseEnter:()=>x(se),onFocus:()=>x(se),onBlur:()=>x(null)},se))]}),te&&v!==null&&r.jsxs(Kt,{x:ie(v),y:O[0]+ea/2,width:l,children:[r.jsxs("span",{className:"ctip-title",children:[r.jsx("span",{className:"sv-swatch",style:{background:zl[te.substitution]},"aria-hidden":!0}),r.jsx("span",{className:"mono",children:te.context})]}),r.jsxs("span",{className:"ctip-row",children:[r.jsx("span",{children:"Observed"}),r.jsxs("b",{children:[wm(S.observed[v],i),r.jsxs("i",{children:[" ",i==="share"?`${te.observed.toLocaleString("en-US")} SNVs`:""]})]})]}),S.reconstructed&&S.difference&&r.jsxs(r.Fragment,{children:[r.jsxs("span",{className:"ctip-row",children:[r.jsx("span",{children:"Rebuilt"}),r.jsx("b",{children:wm(S.reconstructed[v],i)})]}),r.jsxs("span",{className:"ctip-note",children:[S.difference[v]>=0?"Observed above":"Observed below"," the signatures by"," ",wm(Math.abs(S.difference[v]),i).replace("%",i==="share"?" points":"")]})]})]})]})}),!b&&r.jsx("p",{className:"ctx-note",children:"Only the observed profile is shown: this report did not include the signature matrix its fit used, so what the signatures rebuild cannot be drawn."})]})}const _l=n=>n==null?"–":n.toFixed(2),e5=8,t5=250,Ie={w:232,h:148,cx:116,cy:122,r:92};function Cm(n,a){const l=Ji(Ie.cx,Ie.cy,Ie.r,n),i=Ji(Ie.cx,Ie.cy,Ie.r,a);return`M${l.x.toFixed(2)},${l.y.toFixed(2)} A${Ie.r},${Ie.r} 0 0 1 ${i.x.toFixed(2)},${i.y.toFixed(2)}`}function n5({score:n}){const a=n.value===null?null:n.exact??n.value,l=a===null?null:Math.min(Math.max(a,0),1),i=D3(n),c=n.value!==null&&i!==n.value.toFixed(2),d=k3(n),f=n.rating==="HIGH",m=n.threshold,g=m===null?null:[Ji(Ie.cx,Ie.cy,Ie.r-14,m),Ji(Ie.cx,Ie.cy,Ie.r+14,m),Ji(Ie.cx,Ie.cy,Ie.r+27,m)],v=l===null?null:Ji(Ie.cx,Ie.cy,Ie.r,l);return r.jsxs("div",{className:"hrd-score","data-high":f||void 0,children:[r.jsxs("div",{className:"hrd-score-head",children:[r.jsx("span",{className:"hrd-name",children:n.name}),n.rating&&r.jsx("span",{className:`sc-pill ${f?"p-warn":"p-neu"}`,children:n.rating})]}),r.jsxs("svg",{width:Ie.w,height:Ie.h,viewBox:`0 0 ${Ie.w} ${Ie.h}`,role:"img","aria-label":`${n.name} ${l===null?"has no score":`scores ${i}`}${n.rating?`, rated ${n.rating}`:""}`,className:"hrd-gauge",children:[r.jsx("path",{d:Cm(0,1),pathLength:1,className:"hrd-track"}),m!==null&&r.jsx("path",{d:Cm(m,1),pathLength:1,className:"hrd-zone"}),l!==null&&r.jsx("path",{d:Cm(0,1),pathLength:1,className:"hrd-fill",style:{"--v":l}}),g&&r.jsxs(r.Fragment,{children:[r.jsx("line",{x1:g[0].x,y1:g[0].y,x2:g[1].x,y2:g[1].y,className:"hrd-tick"}),r.jsx("text",{x:g[2].x,y:g[2].y+4,textAnchor:"middle",className:"hrd-tick-label",children:m})]}),v&&r.jsx("circle",{cx:v.x,cy:v.y,r:8.5,className:"hrd-end"}),r.jsx("text",{x:Ie.cx,y:Ie.cy-10,textAnchor:"middle",className:"hrd-num",children:i}),r.jsx("text",{x:Ie.cx-Ie.r,y:Ie.cy+18,textAnchor:"middle",className:"hrd-end-label",children:"0"}),r.jsx("text",{x:Ie.cx+Ie.r,y:Ie.cy+18,textAnchor:"middle",className:"hrd-end-label",children:"1"})]}),(d||c)&&r.jsxs("span",{className:"hrd-rule",children:[d,c&&r.jsxs("span",{className:"hrd-rounded",children:["The report rounds it to ",_l(n.value)]})]})]})}function s5(n){const a=n.filter(l=>l.stats&&l.stats.tumour!==null);return{above:a.filter(l=>l.stats.tumour>l.stats.median).length,of:a.length}}const a5="var(--font)";function l5({features:n}){var O;const[a,l]=ks(720),[i,c]=C.useState(null),d=n.map(M=>({feature:M,stats:Yy(M)})),f=l<640,m=f?0:116,g=f?0:168,v=m+10,x=l-g-14,p=M=>v+M*(x-v),b=f?28:0,S=f?100:70,j=b+38,N=30,R=d.length*S+14,A=R+22,T=i===null?null:d[i];return r.jsxs("div",{ref:a,className:"clouds",onMouseLeave:()=>c(null),children:[r.jsxs("svg",{width:l,height:A,role:"img","aria-label":"HRDetect features against the cohort",style:{fontFamily:a5},children:[[0,.25,.5,.75,1].map(M=>r.jsx("line",{x1:p(M),x2:p(M),y1:0,y2:R,className:"cloud-grid","data-major":M===0||M===1||void 0},M)),d.map(({feature:M,stats:E},_)=>{var J;const D=_*S,P=Bv(M.feature),Z=E&&E.values.length<=t5?E.values:[],z=z3(Z.map(p),7.5),te=E&&E.values.length>=e5?O3(E.values):null,ie=E&&E.tumour!==null?p(E.tumour):null;return r.jsxs("g",{transform:`translate(0 ${D})`,className:"cloud-row","data-on":i===_||void 0,onMouseEnter:()=>c(_),children:[r.jsx("rect",{x:0,y:2,width:l,height:S-4,rx:12,className:"cloud-hit"}),E&&r.jsxs(r.Fragment,{children:[r.jsx("rect",{x:p(E.q1),y:b+4,width:Math.max(p(E.q3)-p(E.q1),2),height:S-b-10,rx:8,className:"cloud-iqr"}),r.jsx("line",{x1:p(E.median),x2:p(E.median),y1:b+10,y2:S-14,className:"cloud-median"}),te&&r.jsxs(r.Fragment,{children:[r.jsx("path",{d:`M${p(0)},${j} ${te.map(se=>`L${p(se.x).toFixed(1)},${(j-se.y*N).toFixed(1)}`).join(" ")} L${p(1)},${j} Z`,className:"cloud-area"}),r.jsx("path",{d:te.map((se,re)=>`${re?"L":"M"}${p(se.x).toFixed(1)},${(j-se.y*N).toFixed(1)}`).join(" "),className:"cloud-line"})]}),Z.map((se,re)=>r.jsx("circle",{cx:p(se),cy:j+11+Math.min(z[re],2)*7,r:3,className:"cloud-dot"},re)),ie!==null&&r.jsxs("g",{className:"cloud-pin",transform:`translate(${ie} 0)`,children:[r.jsx("line",{y1:b+8,y2:j,className:"cloud-stem"}),r.jsx("circle",{cy:j,r:8,className:"cloud-pin-dot"})]})]}),r.jsx("text",{x:f?4:6,y:f?18:j-6,className:"cloud-name",children:P}),!f&&r.jsxs("text",{x:6,y:j+10,className:"cloud-raw",children:["raw ",_l((J=M.sample)==null?void 0:J.raw)]}),E&&r.jsx("text",{x:l-4,y:f?18:j-6,textAnchor:"end",className:"cloud-rank",children:am(E)}),!f&&E&&r.jsxs("text",{x:l-4,y:j+10,textAnchor:"end",className:"cloud-raw",children:["of ",E.values.length," in the cohort"]})]},M.feature)}),r.jsxs("g",{transform:`translate(0 ${R})`,className:"cloud-axis",children:[r.jsx("text",{x:p(0),y:12,textAnchor:"start",children:"0 · cohort lowest"}),r.jsx("text",{x:p(.5),y:12,textAnchor:"middle",children:"0.5"}),r.jsx("text",{x:p(1),y:12,textAnchor:"end",children:"cohort highest · 1"})]})]}),T&&i!==null&&T.stats&&r.jsxs(Kt,{x:T.stats.tumour!==null?p(T.stats.tumour):p(T.stats.median),y:i*S+j,width:l,children:[r.jsx("span",{className:"ctip-title",children:Bv(T.feature.feature,"long")}),r.jsxs("span",{className:"ctip-row",children:[r.jsx("span",{children:"This tumour"}),r.jsxs("b",{children:[_l((O=T.feature.sample)==null?void 0:O.raw)," ",r.jsxs("i",{children:["scaled ",_l(T.stats.tumour)]})]})]}),r.jsxs("span",{className:"ctip-row",children:[r.jsx("span",{children:"Cohort median"}),r.jsx("b",{children:_l(T.stats.median)})]}),r.jsxs("span",{className:"ctip-row",children:[r.jsx("span",{children:"Middle half"}),r.jsxs("b",{children:[_l(T.stats.q1),"–",_l(T.stats.q3)]})]}),am(T.stats)&&r.jsx("span",{className:"ctip-note",children:am(T.stats)})]})]})}const Ar=n=>`${(n*100).toFixed(n>=.1||n===0?0:1)}%`,Or=n=>Math.round(n).toLocaleString("en-US"),i5=n=>`${n>=0?"+":"−"}${Math.abs(n).toFixed(Math.abs(n)>=10?0:1)}`,o2=3,Qi=26,Yi=52;function o5({groups:n,bands:a,lit:l,onLight:i}){const[c,d]=ks(),f=n.find(_=>_.group==="sample")??n[0],m=n.find(_=>_.group==="cohort")??null,g=m!==null,v=d>=440,x=v?d>=620?118:92:0,p=g?330:230,b=Gv(a.map(_=>_.share),p,o2),S=g?Gv(a.map(_=>_.cohortShare??0),p,o2):[],j=g?x:0,N=d-x-Qi,R=j+Qi,A=N,T=a.find(_=>_.name===l)??null,O=T?a.indexOf(T):-1,M=O<0?0:Yi+((b[O].y0+b[O].y1)/2+(g?(S[O].y0+S[O].y1)/2:(b[O].y0+b[O].y1)/2))/2,E=(_,D,P,Z,z,te)=>{const ie=_.y1-_.y0;if(!v||ie<17)return null;const J=Yi+(_.y0+_.y1)/2,se=ie>=36;return r.jsxs("text",{x:z,y:J,textAnchor:te,className:"flow-label",children:[r.jsxs("tspan",{x:z,dy:se?"-0.35em":"0.35em",className:"flow-name",children:[D.name,!se&&r.jsxs("tspan",{className:"flow-share",children:[" ",Ar(P)]})]}),se&&r.jsxs("tspan",{x:z,dy:"1.35em",className:"flow-share",children:[Ar(P),Z]})]})};return r.jsxs("div",{ref:c,className:"flow","data-lit":l??void 0,children:[r.jsxs("svg",{width:d,height:Yi+p+4,role:"img","aria-label":"Signature shares, tumour against cohort",children:[r.jsxs("g",{className:"flow-head",children:[r.jsx("text",{x:0,y:16,className:"flow-col",children:Fv(f)}),r.jsxs("text",{x:0,y:34,className:"flow-sub",children:[Or(f.total)," mutations"]}),m&&r.jsxs(r.Fragment,{children:[r.jsx("text",{x:d,y:16,textAnchor:"end",className:"flow-col",children:Fv(m)}),r.jsxs("text",{x:d,y:34,textAnchor:"end",className:"flow-sub",children:["about ",Or(m.total)," each, on average"]})]})]}),g&&r.jsx("g",{className:"flow-ribs",transform:`translate(0 ${Yi})`,children:a.map((_,D)=>r.jsx("path",{d:A3(R,b[D],A,S[D]),fill:_.colour,className:"flow-rib","data-on":l===_.name||void 0,onMouseEnter:()=>i(_.name),onMouseLeave:()=>i(null)},_.name))}),a.map((_,D)=>{const P=l===_.name||void 0,Z=(z,te)=>z.y1-z.y0>.4&&r.jsx("rect",{x:te,y:Yi+z.y0,width:Qi,height:z.y1-z.y0,rx:Math.min(5,(z.y1-z.y0)/2),fill:_.colour,className:"flow-seg","data-on":P,tabIndex:0,"aria-label":`${_.name}, ${Ar(_.share)} of this tumour`,onMouseEnter:()=>i(_.name),onMouseLeave:()=>i(null),onFocus:()=>i(_.name),onBlur:()=>i(null)});return r.jsxs("g",{className:"flow-band","data-on":P,children:[Z(b[D],j),g&&Z(S[D],N),E(b[D],_,_.share,_.count?` · ${Or(_.count)}`:"",g?j-10:j+Qi+10,g?"end":"start"),g&&E(S[D],_,_.cohortShare??0,"",N+Qi+10,"start")]},_.name)}),g&&d>=520&&a.map((_,D)=>{const P=Ia(_),Z=b[D],z=S[D];if(P===null||Math.abs(P)<5||Math.min(Z.y1-Z.y0,z.y1-z.y0)<22)return null;const te=(R+A)/2,ie=Yi+(Z.y0+Z.y1+z.y0+z.y1)/4;return r.jsxs("g",{transform:`translate(${te} ${ie})`,className:"flow-delta","data-on":l===_.name||void 0,children:[r.jsx("rect",{x:-30,y:-10,width:60,height:20,rx:10}),r.jsxs("text",{y:4,textAnchor:"middle",children:[i5(P)," pts"]})]},_.name)})]}),T&&r.jsxs(Kt,{x:g?d/2:j+Qi+x+20,y:M,width:d,children:[r.jsxs("span",{className:"ctip-title",children:[r.jsx("span",{className:"sv-swatch",style:{background:T.colour},"aria-hidden":!0}),T.name]}),T.aetiology&&r.jsx("span",{className:"ctip-sub",children:T.aetiology}),r.jsxs("span",{className:"ctip-row",children:[r.jsx("span",{children:"This tumour"}),r.jsxs("b",{children:[Ar(T.share)," ",r.jsxs("i",{children:[Or(T.count)," mutations"]})]})]}),T.cohortShare!==null&&r.jsxs("span",{className:"ctip-row",children:[r.jsx("span",{children:"Cohort"}),r.jsxs("b",{children:[Ar(T.cohortShare)," ",r.jsx("i",{children:T.cohortCount!==null?`about ${Or(T.cohortCount)} each`:""})]})]}),Ia(T)!==null&&r.jsx("span",{className:"ctip-note",children:Math.abs(Ia(T))<1?"About the same as its cohort":`${Math.abs(Ia(T)).toFixed(Math.abs(Ia(T))>=10?0:1)} points ${Ia(T)>0?"above":"below"} its cohort`})]})]})}const r2=n=>`${(n*100).toFixed(n>=.1||n===0?0:1)}%`,mb=n=>Math.round(n).toLocaleString("en-US");function r5({points:n,reach:a}){if(n===null)return null;const l=Math.min(Math.abs(n)/a,1)*100;return r.jsx("span",{className:"lead","aria-hidden":!0,children:r.jsx("span",{className:"lead-bar","data-up":n>=0||void 0,style:{width:`${Math.max(l,n===0?0:3)}%`}})})}function c5({groups:n}){const[a,l]=C.useState(null),i=C.useMemo(()=>_3(n),[n]),c=n.find(f=>f.group==="cohort"),d=Math.max(10,...i.map(f=>Math.abs(Ia(f)??0)));return r.jsxs("section",{className:"sig-section","aria-label":"Mutational signatures",children:[r.jsx("h3",{className:"sv-h",children:"Mutational signatures"}),r.jsxs("div",{className:"sig-grid",children:[r.jsx(o5,{groups:n,bands:i,lit:a,onLight:l}),r.jsxs("div",{className:"sig-tablebox",children:[r.jsxs("table",{className:"sig-table",children:[r.jsx("thead",{children:r.jsxs("tr",{children:[r.jsx("th",{children:"Signature"}),r.jsx("th",{className:"n",children:"This tumour"}),c&&r.jsx("th",{className:"n",children:"Cohort"}),c&&r.jsx("th",{className:"lead-h",children:"Against cohort"})]})}),r.jsx("tbody",{children:i.map(f=>{const m=Ia(f);return r.jsxs("tr",{"data-lit":a===f.name||void 0,onMouseEnter:()=>l(f.name),onMouseLeave:()=>l(null),children:[r.jsxs("td",{children:[r.jsxs("span",{className:"sig-name",title:f.members.length>1?f.members.join(", "):void 0,children:[r.jsx("span",{className:"sv-swatch",style:{background:f.colour},"aria-hidden":!0}),f.name]}),f.aetiology&&r.jsx("span",{className:"sig-aetiology",children:f.aetiology})]}),r.jsxs("td",{className:"n",children:[r.jsx("span",{className:"mono",children:r2(f.share)}),r.jsx("span",{className:"sig-count",children:mb(f.count)})]}),c&&r.jsx("td",{className:"n mono",children:r2(f.cohortShare??0)}),c&&r.jsx("td",{children:r.jsxs("span",{className:"lead-cell",children:[r.jsx(r5,{points:m,reach:d}),r.jsx("span",{className:"lead-n mono",children:m===null?"":`${m>=0?"+":"−"}${Math.abs(m).toFixed(0)}`})]})})]},f.name)})})]}),r.jsx(hd,{shown:i.length,total:i.length,noun:["signature","signatures"]})]})]})]})}function u5({envelope:n,loading:a}){return(n==null?void 0:n.status)==="ok"&&n.data?r.jsx(W4,{data:n.data}):n?r.jsxs("section",{className:"sig-section","aria-label":"96 mutational contexts",children:[r.jsx("h3",{className:"sv-h",children:"96 mutational contexts"}),r.jsx("p",{className:"sv-empty",children:n.warnings.join(" ")||"No 96-context profile for this sample."})]}):a?r.jsxs("section",{className:"sig-section","aria-label":"96 mutational contexts",children:[r.jsx("h3",{className:"sv-h",children:"96 mutational contexts"}),r.jsx("div",{className:"px-5 pb-3",children:r.jsx("div",{className:"skeleton",style:{height:220},"aria-label":"Loading 96 mutational contexts"})})]}):null}function d5({hrd:n}){const a=C.useMemo(()=>s5(n.features.map(l=>({feature:l,stats:Yy(l)}))),[n.features]);return r.jsxs("section",{className:"sig-section","aria-label":"Homologous recombination deficiency",children:[r.jsx("h3",{className:"sv-h",children:"Homologous recombination deficiency"}),r.jsxs("div",{className:"hrd-body",children:[n.scores.length>0&&r.jsx("div",{className:"hrd-scores",children:n.scores.map(l=>r.jsx(n5,{score:l},l.name))}),n.features.length>0&&r.jsxs("div",{className:"hrd-chart",children:[r.jsxs("div",{className:"sv-sigs-head",children:[r.jsxs("h4",{className:"hrd-sub",children:["HRDetect features against the cohort",n.cohort_n?r.jsxs("span",{className:"sv-h-n",children:["n = ",n.cohort_n]}):null]}),r.jsxs("ul",{className:"sv-sigs-key","aria-label":"Key",children:[r.jsxs("li",{children:[r.jsx("span",{className:"hrd-key-pin","aria-hidden":!0}),"This tumour"]}),r.jsxs("li",{children:[r.jsx("span",{className:"hrd-key-dot","aria-hidden":!0}),"Cohort sample"]}),r.jsxs("li",{children:[r.jsx("span",{className:"hrd-key-band","aria-hidden":!0}),"Middle half of the cohort"]})]})]}),a.of>0&&r.jsxs("p",{className:"hrd-lede",children:["Above the cohort median on ",r.jsx("b",{children:a.above})," of ",a.of," features"]}),r.jsx(l5,{features:n.features})]})]})]})}const h5=C.forwardRef(function({envelope:a,loading:l,contextEnvelope:i,contextLoading:c=!1,picked:d},f){var v;const m=(a==null?void 0:a.status)==="ok"?a.data:null,g=(v=m==null?void 0:m.signatures)==null?void 0:v.find(x=>x.group==="sample");return r.jsx(hs,{ref:f,title:"Signatures and HRD",subtitle:g?`${mb(g.total)} mutations attributed to signatures`:void 0,lineage:rd(a==null?void 0:a.lineage,i==null?void 0:i.lineage),picked:d,info:"signaturesHrd",className:"sigs",children:r.jsx(Hn,{label:"signatures and HRD",envelope:a,loading:l,skeletonHeight:300,children:x=>r.jsxs("div",{className:"sig-body",children:[x.signatures?r.jsx(c5,{groups:x.signatures}):r.jsx("p",{className:"sv-empty",children:"No signature contributions for this sample."}),r.jsx(u5,{envelope:i,loading:c}),x.hrd&&r.jsx(d5,{hrd:x.hrd})]})})})});function xg(n){return n.kind==="insertion"?"insertion":n.kind==="complex"?"complex":n.mechanism==="microhomology"?"microhomology":n.mechanism==="repeat"?"repeat":"other deletion"}const vg=[{key:"microhomology",label:"Deletion, microhomology",colour:"#9f1d2d"},{key:"repeat",label:"Deletion, repeat",colour:"#d6455a"},{key:"other deletion",label:"Deletion, other",colour:"#f19aa6"},{key:"insertion",label:"Insertion",colour:"#1f9a6c"},{key:"complex",label:"Complex",colour:"#8a8a93"}],c2=Object.fromEntries(vg.map(n=>[n.key,n.colour]));function Wi(n){switch((n.sv_type??"").toUpperCase()){case"DEL":return"deletion";case"DUP":return"tandem-duplication";case"INV":return"inversion";default:return n.chrom1===n.chrom2?"inversion":"translocation"}}const $u=Nn;function u2(n=null,a=.42,l=.012){var g;const i=$u.reduce((v,[,x])=>v+x,0),c=2*Math.PI-l*$u.length,d=n?((g=$u.find(([v])=>v===n))==null?void 0:g[1])??0:0,f=[];let m=l/2;for(const[v,x]of $u){const p=!n||!d?x/i*c:v===n?c*a:x/(i-d)*c*(1-a);f.push({chrom:v,length:x,a0:m,a1:m+p}),m+=p+l}return f}function f5(n,a,l){return a.map((i,c)=>({...i,a0:n[c].a0+(i.a0-n[c].a0)*l,a1:n[c].a1+(i.a1-n[c].a1)*l}))}function m5(n){return new Map(n.map(a=>[a.chrom,a]))}function ta(n,a,l){const i=n.get(a.replace(/^chr/,""));if(!i)return null;const c=Math.min(Math.max(l/i.length,0),1);return i.a0+c*(i.a1-i.a0)}function Ut(n,a,l,i){return[n+l*Math.sin(i),a-l*Math.cos(i)]}function Hu(n,a,l,i,c,d){const f=d-c>Math.PI?1:0,[m,g]=Ut(n,a,i,c),[v,x]=Ut(n,a,i,d),[p,b]=Ut(n,a,l,d),[S,j]=Ut(n,a,l,c),N=R=>R.toFixed(2);return`M${N(m)},${N(g)} A${i},${i} 0 ${f} 1 ${N(v)},${N(x)} L${N(p)},${N(b)} A${l},${l} 0 ${f} 0 ${N(S)},${N(j)} Z`}function g5(n,a,l,i,c){const[d,f]=Ut(n,a,l,i),[m,g]=Ut(n,a,l,c);let v=Math.abs(i-c);v>Math.PI&&(v=2*Math.PI-v);const x=Math.min(v/Math.PI,1),p=(i+c)/2+(Math.abs(i-c)>Math.PI?Math.PI:0),[b,S]=Ut(n,a,l*(1-x*.95),p),j=N=>N.toFixed(2);return`M${j(d)},${j(f)} Q${j(b)},${j(S)} ${j(m)},${j(g)}`}function Mm(n,a,l,i){const c=Math.log10(Math.max(n,1));return a+Math.min(c,i)/i*(l-a)}function d2(n,a,l,i){const c=Math.atan2(l-n,a-i);return c<0?c+2*Math.PI:c}function h2(n,a){return n.find(l=>a>=l.a0&&a<=l.a1)??null}function p5(n,a=12){const l=new Map;return n.forEach((i,c)=>{const d=`${Math.floor(i.x/a)},${Math.floor(i.y/a)}`,f=l.get(d);f?f.push(c):l.set(d,[c])}),(i,c,d=7)=>{const f=Math.floor(i/a),m=Math.floor(c/a);let g=null,v=d*d;for(let x=-1;x<=1;x++)for(let p=-1;p<=1;p++)for(const b of l.get(`${f+x},${m+p}`)??[]){const S=(n[b].x-i)**2+(n[b].y-c)**2;S<=v&&(v=S,g=b)}return g}}const et={ideoIn:.955,rainOut:.93,rainIn:.64,insOut:.625,insIn:.6,delOut:.59,delIn:.565,majOut:.553,majIn:.515,minOut:.505,minIn:.47,link:.455},Em=8,x5=560,Rm=1e6,Uu=(n,a)=>`chr${n}:${a.toLocaleString("en-US")}`,f2=n=>n>=1e6?`${(n/1e6).toFixed(1)} Mb`:n>=1e3?`${(n/1e3).toFixed(1)} kb`:`${n} bp`;function v5(n){return n===null||n<2?null:n<4?"color-mix(in srgb, var(--gain) 45%, transparent)":n<8?"color-mix(in srgb, var(--gain) 80%, transparent)":"var(--gain-strong)"}function y5({data:n,drivers:a,size:l,tracks:i,lit:c}){var se,re;const d=C.useRef(null),[f,m]=C.useState(null),[g,v]=C.useState(null),[x,p]=C.useState(()=>u2()),b=C.useRef(x);b.current=x,C.useLayoutEffect(()=>{const $=u2(f);if(typeof matchMedia<"u"&&matchMedia("(prefers-reduced-motion: reduce)").matches){p($);return}const X=b.current,le=performance.now();let ae=0;const me=Se=>{const ce=Math.min(1,(Se-le)/x5);p(f5(X,$,Dg(ce))),ce<1&&(ae=requestAnimationFrame(me))};return ae=requestAnimationFrame(me),()=>cancelAnimationFrame(ae)},[f]);const S=C.useMemo(()=>m5(x),[x]),j=l/2,N=l/2,R=l/2-58,A=$=>R*$,T=C.useMemo(()=>{const $=[];for(const[G,X]of Object.entries(n.snvs))for(let le=0;le<X.pos.length;le++){const ae=ta(S,G,X.pos[le]);if(ae===null)continue;const[me,Se]=Ut(j,N,Mm(X.distance[le],A(et.rainIn),A(et.rainOut),Em),ae);$.push({x:me,y:Se,chrom:G,pos:X.pos[le],substitution:X.substitution[le],distance:X.distance[le]})}return $},[n.snvs,S,l]),O=C.useMemo(()=>p5(T),[T]);C.useEffect(()=>{const $=d.current;if(!$)return;const G=typeof window<"u"&&window.devicePixelRatio||1;$.width=l*G,$.height=l*G;const X=$.getContext("2d");if(X){if(X.setTransform(G,0,0,G,0,0),X.clearRect(0,0,l,l),i.rainfall){const le=f?2.1:1.6;for(const ae of T){const me=c&&(c.kind!=="substitution"||c.value!==ae.substitution);X.globalAlpha=me?.1:.85,X.fillStyle=zl[ae.substitution]??"#999",X.beginPath(),X.arc(ae.x,ae.y,le,0,2*Math.PI),X.fill()}}if(i.indels&&n.indels){X.lineWidth=f?1.6:1.1;for(const le of n.indels){const ae=ta(S,le.chrom,(le.start+le.end)/2);if(ae===null)continue;const me=xg(le),Se=c&&(c.kind!=="indel"||c.value!==me);X.globalAlpha=Se?.12:.9,X.strokeStyle=c2[me];const ce=le.kind==="insertion"?A(et.insIn):A(et.delIn),k=le.kind==="insertion"?A(et.insOut):A(et.delOut),[U,V]=Ut(j,N,ce,ae),[oe,de]=Ut(j,N,k,ae);X.beginPath(),X.moveTo(U,V),X.lineTo(oe,de),X.stroke()}}X.globalAlpha=1}},[T,n.indels,S,l,i.rainfall,i.indels,c,f,j,N,R]);const M=C.useMemo(()=>{const $=new Map;for(const ae of a)ae.gene&&!$.has(ae.gene)&&$.set(ae.gene,ae);const G=[...$.values()].map(ae=>({d:ae,angle:ta(S,ae.chrom,ae.pos)})).filter(ae=>ae.angle!==null).sort((ae,me)=>ae.angle-me.angle),X=R+30,le=Yu(G.map(ae=>({left:ae.angle*X,width:zs(ae.d.gene??"",11,600)+8})),2);return G.map((ae,me)=>({...ae,row:le[me]}))},[a,S,R]),E=n.svs,_=E.map($=>[ta(S,$.chrom1,$.pos1),ta(S,$.chrom2,$.pos2)]),D=f?S.get(f):void 0,P=D?ud(D.length/Rm,8).filter($=>$*Rm<=D.length):[],Z=$=>{var Se;if((Se=$.target.classList)!=null&&Se.contains("circ-link-hit"))return;const G=$.currentTarget.getBoundingClientRect(),X=$.clientX-G.left,le=$.clientY-G.top,ae=Math.hypot(X-j,le-N),me=d2(j,N,X,le);if(ae>=A(et.ideoIn)&&ae<=R+22){const ce=h2(x,me);v(ce?{kind:"chrom",chrom:ce.chrom,x:X,y:le}:null);return}if(i.rainfall&&ae>=A(et.rainIn)-4&&ae<=A(et.rainOut)+4){const ce=O(X,le);if(ce!==null){const k=T[ce];v({kind:"snv",chrom:k.chrom,pos:k.pos,substitution:k.substitution,distance:k.distance,x:k.x,y:k.y});return}}if(i.indels&&n.indels&&ae>=A(et.delIn)&&ae<=A(et.insOut)){let ce=-1,k=.01;if(n.indels.forEach((U,V)=>{const oe=ta(S,U.chrom,(U.start+U.end)/2);oe!==null&&Math.abs(oe-me)<k&&(k=Math.abs(oe-me),ce=V)}),ce>=0){v({kind:"indel",index:ce,x:X,y:le});return}}(g==null?void 0:g.kind)!=="link"&&v(null)},z=$=>!c||c.kind==="sv"&&c.value===Wi($),te=(g==null?void 0:g.kind)==="chrom"?g.chrom:null,ie=(g==null?void 0:g.kind)==="link"?E[g.index]:null,J=(g==null?void 0:g.kind)==="indel"&&n.indels?n.indels[g.index]:null;return r.jsxs("div",{className:"circ",style:{width:l,height:l},onMouseLeave:()=>v(null),children:[r.jsxs("svg",{width:l,height:l,className:"circ-under","aria-hidden":!0,children:[x.map(($,G)=>r.jsx("path",{d:Hu(j,N,A(et.rainIn),A(et.rainOut),$.a0,$.a1),className:"circ-band","data-odd":G%2||void 0,"data-on":te===$.chrom||f===$.chrom||void 0},$.chrom)),[2,4,6].map($=>r.jsx("circle",{cx:j,cy:N,r:Mm(10**$,A(et.rainIn),A(et.rainOut),Em),className:"circ-grid"},$))]}),r.jsx("canvas",{ref:d,className:"circ-canvas",style:{width:l,height:l},"aria-hidden":!0}),r.jsxs("svg",{width:l,height:l,className:"circ-over",role:"img","aria-label":`Integrated circos: ${n.snv_total.toLocaleString("en-US")} SNVs, ${((se=n.indels)==null?void 0:se.length)??0} indels, ${E.length} rearrangements`,onMouseMove:Z,onClick:$=>{const G=$.currentTarget.getBoundingClientRect(),X=$.clientX-G.left,le=$.clientY-G.top,ae=Math.hypot(X-j,le-N);if(ae<A(et.ideoIn)||ae>R+22)return;const me=h2(x,d2(j,N,X,le));me&&m(Se=>Se===me.chrom?null:me.chrom)},children:[[2,4,6].map($=>{const[G,X]=Ut(j,N,Mm(10**$,A(et.rainIn),A(et.rainOut),Em),0);return r.jsx("text",{x:G+3,y:X-2,className:"circ-scale",children:$===2?"100 bp":$===4?"10 kb":"1 Mb"},$)}),i.copyNumber&&n.segments.map(($,G)=>{const X=ta(S,$.chrom,$.start),le=ta(S,$.chrom,$.end);if(X===null||le===null||le-X<=0)return null;const ae=v5($.major_cn),me=$.minor_cn===0;return r.jsxs("g",{children:[ae&&r.jsx("path",{d:Hu(j,N,A(et.majIn),A(et.majOut),X,le),style:{fill:ae},className:"circ-cn"}),me&&r.jsx("path",{d:Hu(j,N,A(et.minIn),A(et.minOut),X,le),className:"circ-loh"})]},G)}),i.copyNumber&&r.jsxs(r.Fragment,{children:[r.jsx("circle",{cx:j,cy:N,r:A(et.majIn),className:"circ-ring-line"}),r.jsx("circle",{cx:j,cy:N,r:A(et.minIn),className:"circ-ring-line"})]}),i.links&&E.map(($,G)=>{const[X,le]=_[G];if(X===null||le===null)return null;const ae=g5(j,N,A(et.link),X,le),me=(g==null?void 0:g.kind)==="link"&&g.index===G,Se=Wi($);return r.jsxs("g",{className:"circ-link","data-on":me||void 0,"data-dim":!z($)||void 0,children:[r.jsx("path",{d:ae,style:{stroke:Ln[Se]},className:"circ-link-line"}),r.jsx("path",{d:ae,className:"circ-link-hit",onMouseEnter:ce=>{const k=ce.currentTarget.ownerSVGElement.getBoundingClientRect();v({kind:"link",index:G,x:ce.clientX-k.left,y:ce.clientY-k.top})},onMouseLeave:()=>v(null)})]},G)}),x.map(($,G)=>{const X=($.a0+$.a1)/2,[le,ae]=Ut(j,N,R+13,X),me=($.a1-$.a0)*R;return r.jsxs("g",{className:"circ-chrom","data-on":te===$.chrom||f===$.chrom||void 0,children:[r.jsx("path",{d:Hu(j,N,A(et.ideoIn),R,$.a0,$.a1),className:"circ-ideo","data-odd":G%2||void 0}),me>9&&r.jsx("text",{x:le,y:ae+4,textAnchor:"middle",className:"circ-name",children:$.chrom})]},$.chrom)}),D&&P.map($=>{const G=ta(S,D.chrom,$*Rm);if(G===null)return null;const[X,le]=Ut(j,N,A(et.ideoIn),G),[ae,me]=Ut(j,N,A(et.ideoIn)-6,G),[Se,ce]=Ut(j,N,A(et.ideoIn)-15,G);return r.jsxs("g",{className:"circ-mb",children:[r.jsx("line",{x1:X,y1:le,x2:ae,y2:me}),r.jsx("text",{x:Se,y:ce+3,textAnchor:"middle",children:$})]},$)}),M.map(({d:$,angle:G,row:X})=>{const[le,ae]=Ut(j,N,R+2,G),[me,Se]=Ut(j,N,R+24+X*13,G),[ce,k]=Ut(j,N,R+28+X*13,G),U=Math.sin(G)>=0;return r.jsxs("g",{className:"circ-driver",children:[r.jsx("line",{x1:le,y1:ae,x2:me,y2:Se}),r.jsx("text",{x:ce,y:k+4,textAnchor:U?"start":"end",children:$.gene})]},$.gene)}),f&&r.jsxs("text",{x:j,y:N+4,textAnchor:"middle",className:"circ-centre",children:["chr",f," · click it again to close"]})]}),(g==null?void 0:g.kind)==="snv"&&r.jsxs(Kt,{x:g.x,y:g.y,width:l,children:[r.jsxs("span",{className:"ctip-title",children:[r.jsx("span",{className:"sv-swatch",style:{background:zl[g.substitution]},"aria-hidden":!0}),g.substitution," SNV"]}),r.jsxs("span",{className:"ctip-row",children:[r.jsx("span",{children:"Position"}),r.jsx("b",{className:"mono",children:Uu(g.chrom,g.pos)})]}),r.jsxs("span",{className:"ctip-row",children:[r.jsx("span",{children:"From the SNV before"}),r.jsx("b",{children:f2(g.distance)})]})]}),J&&g&&r.jsxs(Kt,{x:g.x,y:g.y,width:l,children:[r.jsxs("span",{className:"ctip-title",children:[r.jsx("span",{className:"sv-swatch",style:{background:c2[xg(J)]},"aria-hidden":!0}),J.kind==="deletion"?`Deletion, ${J.mechanism==="none"?"other":J.mechanism}`:J.kind==="insertion"?"Insertion":"Complex indel"]}),r.jsxs("span",{className:"ctip-row",children:[r.jsx("span",{children:"Position"}),r.jsx("b",{className:"mono",children:Uu(J.chrom,J.start)})]})]}),ie&&g&&r.jsxs(Kt,{x:g.x,y:g.y,width:l,children:[r.jsxs("span",{className:"ctip-title",children:[r.jsx("span",{className:"sv-swatch",style:{background:Ln[Wi(ie)]},"aria-hidden":!0}),Ql[Wi(ie)]]}),r.jsxs("span",{className:"ctip-row",children:[r.jsx("span",{children:"From"}),r.jsx("b",{className:"mono",children:Uu(ie.chrom1,ie.pos1)})]}),r.jsxs("span",{className:"ctip-row",children:[r.jsx("span",{children:"To"}),r.jsx("b",{className:"mono",children:Uu(ie.chrom2,ie.pos2)})]}),ie.chrom1===ie.chrom2&&r.jsxs("span",{className:"ctip-row",children:[r.jsx("span",{children:"Spanning"}),r.jsx("b",{children:f2(Math.abs(ie.pos2-ie.pos1))})]})]}),(g==null?void 0:g.kind)==="chrom"&&r.jsxs(Kt,{x:g.x,y:g.y,width:l,children:[r.jsxs("span",{className:"ctip-title",children:["Chromosome ",g.chrom]}),r.jsxs("span",{className:"ctip-row",children:[r.jsx("span",{children:"SNVs"}),r.jsx("b",{children:(((re=n.snvs[g.chrom])==null?void 0:re.pos.length)??0).toLocaleString("en-US")})]}),r.jsxs("span",{className:"ctip-row",children:[r.jsx("span",{children:"Rearrangements touching it"}),r.jsx("b",{children:E.filter($=>$.chrom1===g.chrom||$.chrom2===g.chrom).length})]}),r.jsx("span",{className:"ctip-note",children:f===g.chrom?"Click to close it":"Click to open it out"})]})]})}const b5=[{key:"rainfall",label:"SNV rainfall"},{key:"indels",label:"Indels"},{key:"copyNumber",label:"Copy number"},{key:"links",label:"Rearrangements"}],m2=["translocation","inversion","deletion","tandem-duplication"];function Bu({label:n,sub:a,count:l,top:i,colour:c,on:d,onEnter:f,onLeave:m}){return r.jsxs("li",{className:"circ-bar","data-on":d||void 0,onMouseEnter:f,onMouseLeave:m,tabIndex:f?0:void 0,onFocus:f,onBlur:m,children:[r.jsxs("span",{className:"circ-bar-label",children:[r.jsx("span",{className:"sv-swatch",style:{background:c},"aria-hidden":!0}),n,a&&r.jsx("i",{children:a})]}),r.jsx("span",{className:"circ-bar-track",children:r.jsx("span",{style:{width:`${i?l/i*100:0}%`,background:c}})}),r.jsx("span",{className:"circ-bar-n mono",children:l.toLocaleString("en-US")})]})}function S5({data:n,lit:a,onLit:l}){var v;const i=C.useMemo(()=>{const x=Object.fromEntries(l2.map(p=>[p,0]));for(const p of Object.values(n.snvs))for(const b of p.substitution)x[b]=(x[b]??0)+1;return x},[n.snvs]),c=C.useMemo(()=>{const x=Object.fromEntries(vg.map(p=>[p.key,0]));for(const p of n.indels??[])x[xg(p)]+=1;return x},[n.indels]),d=C.useMemo(()=>{const x=Object.fromEntries(m2.map(p=>[p,0]));for(const p of n.svs)x[Wi(p)]+=1;return x},[n.svs]),f=Math.max(0,...n.signatures.map(x=>x.count??0)),m=()=>l(null),g=(x,p)=>(a==null?void 0:a.kind)===x&&a.value===p;return r.jsxs("div",{className:"circ-panels",children:[r.jsxs("section",{"aria-label":"Substitutions",children:[r.jsxs("h4",{children:["Substitutions ",r.jsx("span",{children:n.snv_total.toLocaleString("en-US")})]}),r.jsx("ul",{children:l2.map(x=>r.jsx(Bu,{label:x,count:i[x],top:Math.max(...Object.values(i),1),colour:zl[x],on:g("substitution",x),onEnter:()=>l({kind:"substitution",value:x}),onLeave:m},x))}),n.signatures.length>0&&r.jsxs(r.Fragment,{children:[r.jsx("h5",{children:"Top signatures"}),r.jsx("ul",{children:n.signatures.map(x=>r.jsx(Bu,{label:x.signature,sub:x.aetiology,count:Math.round(x.count??0),top:f,colour:"var(--chev)"},x.signature))})]})]}),r.jsxs("section",{"aria-label":"Indels",children:[r.jsxs("h4",{children:["Indels ",r.jsx("span",{children:(((v=n.indels)==null?void 0:v.length)??0).toLocaleString("en-US")})]}),n.indels?r.jsx("ul",{children:vg.map(x=>r.jsx(Bu,{label:x.label,count:c[x.key],top:Math.max(...Object.values(c),1),colour:x.colour,on:g("indel",x.key),onEnter:()=>l({kind:"indel",value:x.key}),onLeave:m},x.key))}):r.jsx("p",{className:"circ-note",children:"This report did not include WGSPOST's indel classification; rerun it to see indels here."})]}),r.jsxs("section",{"aria-label":"Karyotype",children:[r.jsx("h4",{children:"Karyotype"}),r.jsxs("p",{className:"circ-karyo",children:["Purity ",r.jsx("b",{children:n.purity===null?"–":n.purity.toFixed(2)})," · Ploidy ",r.jsx("b",{children:n.ploidy===null?"–":n.ploidy.toFixed(1)})]}),r.jsxs("ul",{className:"circ-key",children:[r.jsxs("li",{children:[r.jsx("span",{className:"circ-key-gain","aria-hidden":!0})," Gain of the major allele, darker for more copies"]}),r.jsxs("li",{children:[r.jsx("span",{className:"circ-key-loh","aria-hidden":!0})," Loss of heterozygosity (no minor allele)"]})]})]}),r.jsxs("section",{"aria-label":"Rearrangements",children:[r.jsxs("h4",{children:["Rearrangements ",r.jsx("span",{children:n.svs.length.toLocaleString("en-US")})]}),r.jsx("ul",{children:m2.map(x=>r.jsx(Bu,{label:Ql[x],count:d[x],top:Math.max(...Object.values(d),1),colour:Ln[x],on:g("sv",x),onEnter:()=>l({kind:"sv",value:x}),onLeave:m},x))})]})]})}const j5=C.forwardRef(function({envelope:a,loading:l,picked:i,drivers:c},d){const[f,m]=ks(900),[g,v]=C.useState({rainfall:!0,indels:!0,copyNumber:!0,links:!0}),[x,p]=C.useState(null),b=m>=860,S=Math.max(280,Math.min(b?m-340:m,680));return r.jsx(hs,{ref:d,title:"Integrated circos",subtitle:"SNVs, indels, copy number and rearrangements around the genome",lineage:(a==null?void 0:a.lineage)??[],picked:i,info:"circos",className:"circos",controls:r.jsx("div",{className:"circ-tracks",role:"group","aria-label":"Tracks",children:b5.map(j=>r.jsx("button",{type:"button",className:"circ-track","aria-pressed":g[j.key],onClick:()=>v(N=>({...N,[j.key]:!N[j.key]})),children:j.label},j.key))}),children:r.jsx("div",{ref:f,children:r.jsx(Hn,{label:"integrated circos",envelope:a,loading:l,skeletonHeight:420,children:j=>r.jsxs("div",{className:"circ-body","data-wide":b||void 0,children:[r.jsxs("div",{className:"circ-stage",children:[r.jsx(y5,{data:j,drivers:c,size:S,tracks:g,lit:x}),r.jsx("p",{className:"circ-hint",children:"Click a chromosome to open it out. Closer SNVs sit further in: clusters such as kataegis fall towards the centre."})]}),r.jsx(S5,{data:j,lit:x,onLit:p})]})})})})}),gb=Object.fromEntries([...Nn,["Y",59373566]]),Ir=Object.keys(gb),no=n=>gb[n]??1,w5=2e4;function Tm(n){return[1,no(n)]}function Hr(n,a,l,i){const c=Math.min(Math.max((n[1]-n[0])*l,w5),i-1),d=(a-n[0])/(n[1]-n[0]||1);return pb([a-d*c,a-d*c+c],i)}function _m(n,a,l){return pb([n[0]+a,n[1]+a],l)}function pb([n,a],l){const i=Math.min(a-n,l-1),c=Math.min(Math.max(n,1),l-i);return[c,c+i]}function N5(n,a,l){return[n[0]+(a[0]-n[0])*l,n[1]+(a[1]-n[1])*l]}function xb([n,a],l=6){const i=(a-n)/l,c=10**Math.floor(Math.log10(i)),d=i/c,f=(d<1.5?1:d<3.5?2:d<7.5?5:10)*c,m=[];for(let g=Math.ceil(n/f)*f;g<=a;g+=f)m.push({value:g,label:f<1e5?`${(g/1e3).toLocaleString("en-US")} kb`:`${+(g/1e6).toFixed(2)} Mb`});return m}function C5(n){const a=n.filter(d=>Number.isFinite(d)).sort((d,f)=>d-f);if(!a.length)return[0,4];const l=d=>a[Math.min(a.length-1,Math.max(0,Math.round(d*(a.length-1))))],i=Math.max(0,Math.floor(l(.01))),c=Math.max(Math.ceil(l(.995)),i+1);return[i,c]}function M5(n,a=1){const l=n.filter(d=>Number.isFinite(d)).map(Math.abs).sort((d,f)=>d-f),i=l.length?l[Math.min(l.length-1,Math.floor(.995*(l.length-1)))]:a,c=Math.max(a,Math.ceil(i*2)/2);return[-c,c]}const g2=n=>n===null?"":`: ${+(n*100).toFixed(1)}%`;function vb(n){if(n.major_cn===null||n.minor_cn===null)return[];const a=[`${n.major_cn}+${n.minor_cn}${g2(n.clonal_frac)}`];return n.major_cn_2!==null&&n.minor_cn_2!==null&&a.push(`${n.major_cn_2}+${n.minor_cn_2}${g2(n.clonal_frac_2)}`),a}const Bg=n=>n.clonal_frac!==null&&n.clonal_frac<1;function E5(n,a){const l=[];for(const i of n){const c=Wi(i);if(i.chrom1===a&&i.chrom2===a){const[d,f]=i.pos1<=i.pos2?[i.pos1,i.pos2]:[i.pos2,i.pos1],m=c==="inversion"?"lower":"upper",g=c==="tandem-duplication"?!1:c==="inversion"?i.orientation!=="--":!0;l.push({kind:"arc",sv:i,svClass:c,from:d,to:f,lane:m,up:g})}else i.chrom1===a?l.push({kind:"out",sv:i,svClass:c,at:i.pos1,partner:i.chrom2,partnerPos:i.pos2}):i.chrom2===a&&l.push({kind:"out",sv:i,svClass:c,at:i.pos2,partner:i.chrom1,partnerPos:i.pos1})}return l}function yb(n,a){let l=0,i=n.length-1;if(i<0)return-1;for(;l<i;){const c=l+i>>1;n[c]<a?l=c+1:i=c}return l>0&&Math.abs(n[l-1]-a)<=Math.abs(n[l]-a)?l-1:l}const sa=(()=>{const n={};let a=0;for(const l of Ir)n[l]=a,a+=no(l);return{offsets:n,total:a}})(),R5=420;function bb({view:n,onView:a,length:l,left:i,plotW:c}){const d=C.useRef(null),[f,m]=C.useState(n.span),g=C.useRef(f);g.current=f,C.useLayoutEffect(()=>{const M=n.span,E=typeof matchMedia<"u"&&matchMedia("(prefers-reduced-motion: reduce)").matches;if(!n.smooth||E){m(M);return}const _=g.current,D=performance.now();let P=0;const Z=z=>{const te=Math.min(1,(z-D)/R5);m(N5(_,M,Dg(te))),te<1&&(P=requestAnimationFrame(Z))};return P=requestAnimationFrame(Z),()=>cancelAnimationFrame(P)},[n]);const v=C.useCallback(M=>i+(M-f[0])/(f[1]-f[0])*c,[f,i,c]),x=C.useCallback(M=>f[0]+(M-i)/c*(f[1]-f[0]),[f,i,c]),p=C.useCallback(M=>a({span:M,smooth:!1}),[a]),b=C.useCallback(M=>a({span:M,smooth:!0}),[a]),S=f[1]-f[0]<l-1,j=C.useRef({shown:f,plotW:c,left:i,move:p,length:l});j.current={shown:f,plotW:c,left:i,move:p,length:l},C.useEffect(()=>{const M=d.current;if(M)return Qy(M,()=>{const E=j.current,_=E.shown[1]-E.shown[0];return{inside:D=>D>=E.left&&D<=E.left+E.plotW,zoom:(D,P)=>{const Z=Hr(E.shown,E.shown[0]+(P-E.left)/E.plotW*_,D,E.length);return Math.abs(Z[0]-E.shown[0])<1&&Math.abs(Z[1]-E.shown[1])<1?!1:(E.move(Z),!0)},pan:D=>E.move(_m(E.shown,D/E.plotW*_,E.length))}})},[]);const N=M=>{var E;return M.clientX-(((E=d.current)==null?void 0:E.getBoundingClientRect().left)??0)},R=C.useRef(!1);return{box:d,shown:f,x:v,posAt:x,localX:N,glide:b,zoomed:S,dragged:R,handlers:{onPointerDown:M=>{if(M.button!==0||!S)return;const E=f;Xu(M,_=>p(_m(E,-(_/c)*(E[1]-E[0]),l)),_=>{_&&(R.current=!0,setTimeout(()=>R.current=!1,0))})},onDoubleClick:M=>{const E=N(M);E>=i&&E<=i+c&&b(Hr(f,x(E),.5,l))},onKeyDown:M=>{const E=(f[0]+f[1])/2,_=f[1]-f[0];if(M.key==="ArrowLeft"||M.key==="ArrowRight")p(_m(f,(M.key==="ArrowLeft"?-.15:.15)*_,l));else if(M.key==="+"||M.key==="=")b(Hr(f,E,.6,l));else if(M.key==="-")b(Hr(f,E,1/.6,l));else if(M.key==="0"||M.key==="Home")b([1,l]);else return;M.preventDefault()}}}}const Be=52,Fg=14,Xi=150,Ki=96,Rl=170,T5=26,zr=n=>Math.round(n).toLocaleString("en-US"),_5=n=>`${+(n/1e6).toFixed(n<1e7?3:2)} Mb`;function A5(n,a,l){return!n||typeof getComputedStyle>"u"?l:getComputedStyle(n).getPropertyValue(a).trim()||l}function yg({width:n,height:a,top:l,xs:i,ys:c,colour:d,radius:f=1.3,alpha:m=.5,label:g}){const v=C.useRef(null);return C.useEffect(()=>{const x=v.current;if(!x)return;const p=typeof window<"u"&&window.devicePixelRatio||1;x.width=Math.round(n*p),x.height=Math.round(a*p);const b=x.getContext("2d");if(b){b.setTransform(p,0,0,p,0,0),b.clearRect(0,0,n,a),b.fillStyle=d.startsWith("--")?A5(x,d,"#666"):d,b.globalAlpha=m;for(let S=0;S<i.length;S++){const j=i[S];j<Be-f||j>n-Fg+f||!Number.isFinite(c[S])||(b.beginPath(),b.arc(j,c[S],f,0,2*Math.PI),b.fill())}b.globalAlpha=1}},[n,a,i,c,d,f,m]),r.jsx("canvas",{ref:v,className:"cnsv-dots",style:{top:l,width:n,height:a},"aria-label":g,role:"img"})}function O5({data:n,width:a,view:l,onView:i}){const c=C.useId(),d=no(n.chrom),f=Math.max(a-Be-Fg,200),{box:m,shown:g,x:v,posAt:x,localX:p,glide:b,zoomed:S,dragged:j,handlers:N}=bb({view:l,onView:i,length:d,left:Be,plotW:f}),R=0,A=Xi+10,T=A+Ki,O=T+Rl,M=O+T5,E=A+Ki*.4,_=A+Ki*.8,D=V=>R+8+(1-V)*(Xi-16),[P,Z]=C.useMemo(()=>{var V;return C5(((V=n.depth)==null?void 0:V.cn)??[])},[n.depth]),z=V=>T+6+(1-(Math.min(Math.max(V,P),Z)-P)/(Z-P))*(Rl-12),te=C.useMemo(()=>n.baf?n.baf.pos.map(v):[],[n.baf,v]),ie=C.useMemo(()=>n.baf?n.baf.baf.map(D):[],[n.baf]),J=C.useMemo(()=>n.depth?n.depth.start.map((V,oe)=>(V+n.depth.end[oe])/2):[],[n.depth]),se=C.useMemo(()=>J.map(v),[J,v]),re=C.useMemo(()=>n.depth?n.depth.cn.map(z):[],[n.depth,P,Z]),$=C.useMemo(()=>E5(n.svs,n.chrom),[n.svs,n.chrom]),[G,X]=C.useState(null),le=(G==null?void 0:G.kind)==="sv"?G.mark.sv:null,ae=V=>{var de,be;if((be=(de=V.target).closest)!=null&&be.call(de,".cnsv-sv-hit"))return;const oe=p(V);X(oe>=Be&&oe<=Be+f?{kind:"cursor",x:oe,pos:x(oe)}:null)},me=V=>{if(j.current)return;const[oe,de]=V.kind==="arc"?[V.from,V.to]:[V.at-5e5,V.at+5e5],be=Math.max((de-oe)*.4,15e4);b(Hr([oe-be,de+be],(oe+de)/2,1,d))},Se=xb(g,Math.max(2,Math.round(f/110))),ce=n.segments.filter(V=>V.end>=g[0]&&V.start<=g[1]),k=C.useMemo(()=>{const V=Math.max(1,Math.ceil((Z-P)/6)),oe=[];for(let de=P;de<=Z;de+=V)oe.push(de);return oe},[P,Z]),U=`${c}-clip`;return r.jsxs("div",{ref:m,className:"cnsv-view",style:{height:M},tabIndex:0,role:"group","aria-label":`Chromosome ${n.chrom}: BAF, rearrangements and read depth. Arrow keys pan, plus and minus zoom.`,"data-zoomed":S||void 0,...N,onPointerMove:ae,onPointerLeave:()=>X(null),children:[n.baf&&r.jsx(yg,{width:a,height:Xi,top:R,xs:te,ys:ie.map(V=>V-R),colour:"--ink-2",alpha:.32,label:"BAF per SNP"}),n.depth&&r.jsx(yg,{width:a,height:Rl,top:T,xs:se,ys:re.map(V=>V-T),colour:"--ink",radius:1.6,alpha:.78,label:"Read-depth copy number"}),r.jsxs("svg",{width:a,height:M,className:"cnsv-svg","aria-hidden":!0,children:[r.jsxs("defs",{children:[r.jsx("clipPath",{id:U,children:r.jsx("rect",{x:Be,y:0,width:f,height:O})}),r.jsx("marker",{id:`${c}-arrow`,viewBox:"0 0 8 8",refX:"4",refY:"4",markerWidth:"7",markerHeight:"7",orient:"auto",children:r.jsx("path",{d:"M0,8 L4,0 L8,8 Z",fill:"var(--sv-tra)"})})]}),r.jsx("g",{className:"cnsv-grid",children:[0,.25,.5,.75,1].map(V=>r.jsx("line",{x1:Be,x2:Be+f,y1:D(V),y2:D(V),"data-mid":V===.5||void 0},V))}),[0,.5,1].map(V=>r.jsx("text",{x:Be-8,y:D(V)+4,className:"cnsv-ylab",children:V},V)),r.jsx("text",{x:14,y:R+Xi/2,className:"cnsv-track-name",transform:`rotate(-90 14 ${R+Xi/2})`,children:"BAF"}),r.jsx("g",{clipPath:`url(#${U})`,children:ce.map(V=>r.jsx(z5,{segment:V,x:v,y:D},`${V.start}-${V.end}`))}),!n.baf&&r.jsx(Am,{x:Be+f/2,y:R+Xi/2,text:"No BAF data for this chromosome"}),r.jsx("line",{x1:Be,x2:Be+f,y1:E,y2:E,className:"cnsv-lane"}),r.jsx("line",{x1:Be,x2:Be+f,y1:_,y2:_,className:"cnsv-lane"}),r.jsx("text",{x:14,y:A+Ki/2,className:"cnsv-track-name",transform:`rotate(-90 14 ${A+Ki/2})`,children:"SVs"}),r.jsx("g",{clipPath:`url(#${U})`,className:"cnsv-svs","data-lit":le?"true":void 0,children:$.map((V,oe)=>r.jsx(D5,{mark:V,x:v,upper:E,lower:_,svTop:A,bottom:T+Rl,arrow:`url(#${c}-arrow)`,on:le===V.sv,onEnter:(de,be)=>X({kind:"sv",mark:V,x:de,y:be}),onLeave:()=>X(null),onClick:()=>me(V)},`${V.sv.id??oe}-${V.kind}-${oe}`))}),$.length===0&&r.jsx(Am,{x:Be+f/2,y:A+Ki/2,text:"No rearrangements on this chromosome"}),r.jsx("g",{className:"cnsv-bands",children:Array.from({length:Z-P+1},(V,oe)=>P+oe).map(V=>r.jsx("rect",{x:Be,width:f,y:Math.min(z(V+.5),z(V-.5)),height:Math.abs(z(V-.5)-z(V+.5)),"data-odd":V%2===1||void 0},V))}),k.map(V=>r.jsx("text",{x:Be-8,y:z(V)+4,className:"cnsv-ylab",children:V},V)),r.jsx("text",{x:14,y:T+Rl/2,className:"cnsv-track-name",transform:`rotate(-90 14 ${T+Rl/2})`,children:"Copy number"}),r.jsx("g",{clipPath:`url(#${U})`,className:"cnsv-total",children:ce.filter(V=>V.total_cn!==null).map(V=>r.jsxs("g",{"data-sub":Bg(V)||void 0,children:[r.jsx("line",{x1:v(V.start),x2:v(V.end),y1:z(V.total_cn),y2:z(V.total_cn),className:"cnsv-total-halo"}),r.jsx("line",{x1:v(V.start),x2:v(V.end),y1:z(V.total_cn),y2:z(V.total_cn)})]},`${V.start}-t`))}),!n.depth&&r.jsx(Am,{x:Be+f/2,y:T+Rl/2,text:"No BRASS read depth for this chromosome"}),r.jsx("line",{x1:Be,x2:Be+f,y1:O,y2:O,className:"cnsv-axis"}),Se.map(V=>r.jsxs("g",{transform:`translate(${v(V.value)},${O})`,className:"cnsv-tick",children:[r.jsx("line",{y2:4}),r.jsx("text",{y:17,children:V.label})]},V.value)),(G==null?void 0:G.kind)==="cursor"&&r.jsx("line",{x1:G.x,x2:G.x,y1:0,y2:O,className:"cnsv-cursor"})]}),G&&r.jsx(k5,{hot:G,data:n,mids:J,width:a,upper:E})]})}function Am({x:n,y:a,text:l}){return r.jsx("text",{x:n,y:a,className:"cnsv-empty",children:l})}function z5({segment:n,x:a,y:l}){if(n.baf===null)return null;const i=a(n.start),c=a(n.end),d=vb(n),f=d.length>0&&c-i>Math.max(...d.map(v=>zs(v,11,600)))+10,m=l(n.baf),g=n.baf>.3;return r.jsxs("g",{className:"cnsv-seg","data-sub":Bg(n)||void 0,children:[r.jsx("line",{x1:i,x2:c,y1:m,y2:m}),f&&d.map((v,x)=>r.jsx("text",{x:(Math.max(i,Be)+Math.min(c,1e4))/2,y:g?m+15+x*13:m-8-(d.length-1-x)*13,children:v},v))]})}function D5({mark:n,x:a,upper:l,lower:i,svTop:c,bottom:d,arrow:f,on:m,onEnter:g,onLeave:v,onClick:x}){const p=Ln[n.svClass];if(n.kind==="out"){const O=a(n.at),M=`M${O},${i+14} L${O},${c+12}`;return r.jsxs("g",{className:"cnsv-sv","data-on":m||void 0,style:{color:p},children:[r.jsx("line",{x1:O,x2:O,y1:i+14,y2:d,className:"cnsv-drop"}),r.jsx("path",{d:M,className:"cnsv-out",markerEnd:f}),r.jsx("text",{x:O,y:c+6,className:"cnsv-partner",children:n.partner}),r.jsx("path",{d:M,className:"cnsv-sv-hit",onPointerEnter:()=>g(O,c+20),onPointerLeave:v,onClick:x})]})}const b=a(n.from),S=a(n.to),j=n.lane==="upper"?l:i,N=Math.max((S-b)/2,.5),R=Math.min(n.lane==="upper"?30:18,Math.max(5,N*1.6)),A=`M${b},${j} A${N},${R} 0 0 ${n.up?1:0} ${S},${j}`,T=n.up?j-R:j+R;return r.jsxs("g",{className:"cnsv-sv","data-on":m||void 0,style:{color:p},children:[r.jsx("line",{x1:b,x2:b,y1:j,y2:d,className:"cnsv-drop"}),r.jsx("line",{x1:S,x2:S,y1:j,y2:d,className:"cnsv-drop"}),r.jsx("path",{d:A,className:"cnsv-arc"}),r.jsx("path",{d:A,className:"cnsv-sv-hit",onPointerEnter:()=>g((b+S)/2,T),onPointerLeave:v,onClick:x})]})}function k5({hot:n,data:a,mids:l,width:i,upper:c}){if(n.kind==="sv"){const{mark:p}=n,b=p.sv,S=p.kind==="arc"?`${a.chrom}:${zr(p.from)}–${zr(p.to)}`:`${a.chrom}:${zr(p.at)} to ${p.partner}:${zr(p.partnerPos)}`;return r.jsxs(Kt,{x:n.x,y:n.y,width:i,children:[r.jsxs("b",{children:[r.jsx("span",{className:"sv-swatch",style:{background:Ln[p.svClass]},"aria-hidden":!0})," ",Ql[p.svClass]]}),r.jsx("span",{className:"mono",children:S}),p.kind==="arc"&&r.jsxs("span",{children:[_5(p.to-p.from)," apart"]}),b.orientation&&r.jsxs("span",{children:["Orientation ",b.orientation]}),r.jsx("i",{children:"Click to fit it in view"})]})}const d=n.pos,f=a.segments.find(p=>p.start<=d&&p.end>=d),m=a.depth&&l.length?yb(l,d):-1,g=a.window??1e5,v=m>=0&&Math.abs(l[m]-d)<=g?a.depth.cn[m]:null,x=f?vb(f):[];return r.jsxs(Kt,{x:n.x,y:c,width:i,children:[r.jsxs("b",{className:"mono",children:[a.chrom,":",zr(d)]}),f?r.jsxs(r.Fragment,{children:[r.jsxs("span",{children:["Battenberg ",x.join(", ")||"–",Bg(f)?" (subclonal)":""]}),r.jsxs("span",{children:["Segment BAF ",f.baf===null?"–":f.baf.toFixed(2),", total copy number ",f.total_cn??"–"]})]}):r.jsx("span",{children:"No Battenberg segment here"}),r.jsxs("span",{children:["Read depth ",v===null?"–":`${v.toFixed(2)} copies`]})]})}const qa=92,p2=14,L5=26,Om=[{source:"tumour",measure:"logr",label:"LogR"},{source:"tumour",measure:"baf",label:"BAF"},{source:"normal",measure:"logr",label:"LogR"},{source:"normal",measure:"baf",label:"BAF"}],bg={tumour:"Tumour",normal:"Normal"};function $5(n){if(!n)return null;const a={pos:[],baf:[],logr:[],at:[],chrom:[]};for(const l of Ir){const i=n[l];if(!i)continue;const c=sa.offsets[l];for(let d=0;d<i.pos.length;d++)a.pos.push(i.pos[d]),a.baf.push(i.baf[d]),a.logr.push(i.logr[d]),a.at.push(c+i.pos[d]),a.chrom.push(l)}return a}function H5(n,a){return n?{...n,at:n.pos,chrom:n.pos.map(()=>a)}:null}function x2(n){const{width:a}=n,l=Math.max(a-Be-Fg,200),i=n.scope==="genome",c=i?sa.total:no(n.chrom),d=C.useMemo(()=>({span:[0,sa.total],smooth:!1}),[]),f=bb({view:i?d:n.view,onView:i?()=>{}:n.onView,length:c,left:Be,plotW:l}),m=i?M=>Be+M/sa.total*l:f.x,g=C.useMemo(()=>{var E;const M={};for(const _ of["tumour","normal"])M[_]=n.scope==="genome"?$5(n.sources[_]):H5((E=n.raw)==null?void 0:E[_],n.chrom);return M},[n.scope,n.scope==="genome"?n.sources:n.raw]),v=C.useMemo(()=>{var E;const M={};for(const _ of["tumour","normal"])M[_]=M5((((E=g[_])==null?void 0:E.logr)??[]).filter(D=>D!==null));return M},[g]),x=M=>M*(qa+p2)+(M>=2?p2:0),p=x(Om.length-1)+qa+4,b=p+L5,S=(M,E,_,D)=>{const[P,Z]=E==="baf"?[0,1]:v[_]??[-1,1];return 6+(1-(Math.min(Math.max(D,P),Z)-P)/(Z-P))*(qa-12)},j=C.useMemo(()=>{var E;const M={};for(const _ of["tumour","normal"])M[_]=((E=g[_])==null?void 0:E.at.map(m))??[];return M},[g,i?l:f.shown,l]),[N,R]=C.useState(null),A=M=>{const E=f.localX(M);R(E>=Be&&E<=Be+l?E:null)},T=i?[]:xb(f.shown,Math.max(2,Math.round(l/110))),O=["tumour","normal"].some(M=>{var E;return(((E=g[M])==null?void 0:E.pos.length)??0)>0});return r.jsxs("div",{ref:f.box,className:"cnsv-view cnsv-raw",style:{height:b},tabIndex:i?void 0:0,role:"group","aria-label":i?"Battenberg's raw LogR and BAF across the genome":`Battenberg's raw LogR and BAF on chromosome ${n.chrom}`,...i?{}:f.handlers,"data-zoomed":!i&&f.zoomed||void 0,onPointerMove:A,onPointerLeave:()=>R(null),children:[Om.map((M,E)=>{const _=g[M.source],D=(_==null?void 0:_[M.measure])??[];return r.jsx(yg,{width:a,height:qa,top:x(E),xs:j[M.source]??[],ys:D.map(P=>P===null?NaN:S(E,M.measure,M.source,P)),colour:M.source==="tumour"?"--ink-2":"--faint",radius:i?1.05:1.6,alpha:i?.4:.6,label:`${bg[M.source]} ${M.label}`},`${M.source}-${M.measure}`)}),r.jsxs("svg",{width:a,height:b,className:"cnsv-svg","aria-hidden":!0,children:[Om.map((M,E)=>{const _=x(E),[D,P]=M.measure==="baf"?[0,1]:v[M.source]??[-1,1],Z=M.measure==="baf"?[0,.5,1]:[D,0,P];return r.jsxs("g",{transform:`translate(0,${_})`,children:[r.jsx("rect",{x:Be,y:0,width:l,height:qa,className:"cnsv-raw-bg"}),Z.map(z=>r.jsxs("g",{children:[r.jsx("line",{x1:Be,x2:Be+l,y1:S(E,M.measure,M.source,z),y2:S(E,M.measure,M.source,z),className:"cnsv-raw-grid","data-mid":z===0||z===.5||void 0}),r.jsx("text",{x:Be-8,y:S(E,M.measure,M.source,z)+4,className:"cnsv-ylab",children:+z.toFixed(1)})]},z)),r.jsx("text",{x:14,y:qa/2,className:"cnsv-track-name",transform:`rotate(-90 14 ${qa/2})`,children:M.label}),M.measure==="logr"&&r.jsx("text",{x:Be+8,y:14,className:"cnsv-row-caption",children:bg[M.source]})]},`${M.source}-${M.measure}`)}),r.jsx("line",{x1:Be,x2:Be+l,y1:p,y2:p,className:"cnsv-axis"}),i?Ir.map(M=>{const E=m(sa.offsets[M]),_=m(sa.offsets[M]+no(M));return r.jsxs("g",{children:[r.jsx("line",{x1:E,x2:E,y1:0,y2:p,className:"cnsv-chrom-sep"}),_-E>12&&r.jsx("text",{x:(E+_)/2,y:p+17,className:"cnsv-chrom-name",onClick:()=>n.scope==="genome"&&n.onPick(M),children:M})]},M)}):T.map(M=>r.jsxs("g",{transform:`translate(${m(M.value)},${p})`,className:"cnsv-tick",children:[r.jsx("line",{y2:4}),r.jsx("text",{y:17,children:M.label})]},M.value)),N!==null&&r.jsx("line",{x1:N,x2:N,y1:0,y2:p,className:"cnsv-cursor"}),!O&&r.jsxs("text",{x:Be+l/2,y:p/2,className:"cnsv-empty",children:["No raw Battenberg data ",i?"in this report":"for this chromosome"]})]}),N!==null&&r.jsx(U5,{cursor:N,placed:g,at:i?M=>(M-Be)/l*sa.total:f.posAt,width:a}),i&&r.jsx("div",{className:"cnsv-chrom-hits",style:{top:p,left:0,width:a},children:Ir.map(M=>{const E=m(sa.offsets[M]),_=m(sa.offsets[M]+no(M));return r.jsx("button",{type:"button",style:{left:E,width:_-E},"aria-label":`Open chromosome ${M}`,onClick:()=>n.scope==="genome"&&n.onPick(M)},M)})})]})}function U5({cursor:n,placed:a,at:l,width:i}){const c=l(n),d=["tumour","normal"].map(m=>{const g=a[m];if(!g||!g.at.length)return null;const v=yb(g.at,c),x=p=>p===null?"–":p.toFixed(2);return{source:m,chrom:g.chrom[v],pos:g.pos[v],text:`LogR ${x(g.logr[v])}, BAF ${x(g.baf[v])}`}}),f=d.find(Boolean);return f?r.jsxs(Kt,{x:n,y:qa,width:i,children:[r.jsxs("b",{className:"mono",children:[f.chrom,":",f.pos.toLocaleString("en-US")]}),d.map(m=>m&&r.jsxs("span",{children:[bg[m.source],": ",m.text]},m.source)),r.jsx("i",{children:"The nearest locus kept"})]}):null}const B5=["deletion","tandem-duplication","inversion","translocation"];function Fa({kind:n,colour:a,label:l}){return r.jsxs("span",{className:"flex items-center gap-1.5",children:[r.jsx("span",{className:`cnsv-key-${n}`,style:{background:n==="dot"||n==="line"?a:void 0,color:a},"aria-hidden":!0}),l]})}function F5({chrom:n,withData:a,genome:l,allowGenome:i,onPick:c,onGenome:d}){return r.jsxs("div",{className:"cnsv-picker",role:"group","aria-label":"Chromosome",children:[i&&r.jsx("button",{type:"button",className:"cnsv-chip cnsv-chip-genome","aria-pressed":l,onClick:d,children:"Genome"}),Ir.map(f=>r.jsx("button",{type:"button",className:"cnsv-chip","aria-pressed":!l&&f===n,"data-empty":!a.has(f)||void 0,"aria-label":`Chromosome ${f}`,onClick:()=>c(f),children:f},f))]})}const V5=C.forwardRef(function({envelope:a,loading:l,rawGenome:i,rawGenomeLoading:c,picked:d,chrom:f,onChrom:m,mode:g,onMode:v,genome:x,onGenome:p},b){const[S,j]=ks(900),[N,R]=C.useState({span:Tm(f),smooth:!1});C.useEffect(()=>R({span:Tm(f),smooth:!1}),[f]);const A=Tm(f),T=N.span[1]-N.span[0]<A[1]-A[0]-1,O=a==null?void 0:a.data,M=new Set((O==null?void 0:O.chromosomes)??[]),E=g==="raw"&&x,_=D=>{p(!1),m(D)};return r.jsx(hs,{ref:b,title:"Copy number and rearrangements by chromosome",subtitle:g==="integrated"?`BAF, rearrangements and read depth along chromosome ${f}`:E?"Battenberg's raw LogR and BAF across the genome":`Battenberg's raw LogR and BAF along chromosome ${f}`,lineage:(a==null?void 0:a.lineage)??[],picked:d,info:"cnsv",className:"cnsv",controls:r.jsxs(r.Fragment,{children:[T&&!E&&r.jsx("button",{type:"button",className:"sc-ib sm","aria-label":"Show the whole chromosome",title:"Show the whole chromosome",onClick:()=>R({span:A,smooth:!0}),children:r.jsx(Sy,{size:15,"aria-hidden":!0})}),r.jsx(es,{label:"View",value:g,onChange:v,options:[{value:"integrated",label:"CN/SV"},{value:"raw",label:"Battenberg raw"}]})]}),footer:r.jsxs("span",{className:"flex flex-wrap items-center gap-x-4 gap-y-1 text-[12.5px]",style:{color:"var(--ink-2)"},children:[g==="integrated"?r.jsxs(r.Fragment,{children:[r.jsx(Fa,{kind:"dot",colour:"var(--chev)",label:"BAF per SNP"}),r.jsx(Fa,{kind:"line",colour:"var(--cnsv-clonal)",label:"Clonal segment"}),r.jsx(Fa,{kind:"line",colour:"var(--cnsv-subclonal)",label:"Subclonal segment"}),r.jsx(Fa,{kind:"dot",colour:"var(--ink)",label:"Read depth (BRASS)"}),r.jsx(Fa,{kind:"dash",colour:"var(--cnsv-clonal)",label:"Battenberg total copy number"}),B5.map(D=>r.jsx(Fa,{kind:"line",colour:Ln[D],label:Ql[D]},D))]}):r.jsxs(r.Fragment,{children:[r.jsx(Fa,{kind:"dot",colour:"var(--ink-2)",label:"Tumour"}),r.jsx(Fa,{kind:"dot",colour:"var(--faint)",label:"Normal"})]}),r.jsx("span",{style:{color:"var(--faint)"},children:E?"Click a chromosome's name to open it.":"Scroll up or down over the plot to zoom, sideways (or drag) to pan. Click a rearrangement to fit it."})]}),children:r.jsxs("div",{className:"cnsv-body",children:[r.jsx(F5,{chrom:f,withData:M,genome:E,allowGenome:g==="raw",onPick:_,onGenome:()=>p(!0)}),r.jsx("div",{ref:S,"data-stale":!E&&O&&O.chrom!==f||void 0,children:E?r.jsx(Hn,{label:"raw Battenberg data",envelope:i,loading:c,skeletonHeight:440,children:D=>r.jsx(x2,{scope:"genome",sources:D.sources,segments:D.segments,width:j,onPick:_})}):r.jsx(Hn,{label:"chromosome view",envelope:a,loading:l,skeletonHeight:460,children:D=>g==="integrated"?r.jsx(O5,{data:D,width:j,view:N,onView:R},D.chrom):r.jsx(x2,{scope:"chromosome",chrom:D.chrom,raw:D.raw,width:j,view:N,onView:R},D.chrom)})})]})})});function G5(n){const a=/^(?:chr)?([0-9]{1,2}|[XYM]T?):([0-9,]+)/i.exec((n??"").trim());return a?{chrom:a[1].toUpperCase(),pos:Number(a[2].replace(/,/g,""))}:null}function q5(n){const a=2**n;return`${a>=100?Math.round(a).toLocaleString("en-US"):+a.toFixed(a>=10?0:1)}×`}function v2(n){return[...new Set((n.callers??"").split(",").map(a=>a.trim()).filter(Boolean))]}function I5(n){return n.highlighted?n.oncokb?`OncoKB: ${n.oncokb}`:"A COSMIC fusion gene":null}const Sg=n=>Math.max(...Object.values(n.folds));function P5(n,a){if(a==="report")return n;const l=[...n];return a==="fold"?l.sort((i,c)=>Sg(c)-Sg(i)):l.sort((i,c)=>i.gene.localeCompare(c.gene)),l}function Q5({details:n}){const a=Object.entries(n);return a.length?r.jsx("dl",{className:"rna-details",children:a.map(([l,i])=>r.jsxs("div",{children:[r.jsx("dt",{children:l}),r.jsx("dd",{children:i===null?"–":String(i)})]},l))}):null}function Fu({value:n,gene:a,onLocate:l}){const i=G5(n);return i?r.jsxs("button",{type:"button",className:"rna-break",title:`Show ${a??n} on the copy-number plot`,"aria-label":`Show ${n} on the copy-number plot`,onClick:()=>l({...i,gene:a}),children:[r.jsx(mC,{size:12,"aria-hidden":!0}),r.jsx("span",{className:"mono",children:n})]}):r.jsx("span",{className:"mono",children:n??"–"})}function Y5({fusion:n,top:a}){const l=(i,c,d,f)=>r.jsxs("span",{className:"rna-read","data-kind":f,children:[r.jsx("span",{className:"rna-read-label",children:d}),r.jsx("span",{className:"rna-read-track","aria-hidden":!0,children:r.jsx("span",{style:{width:`${c&&i?Math.max(i/c*100,3):0}%`}})}),r.jsx("span",{className:"rna-read-n mono",children:i??"–"})]});return r.jsxs("span",{className:"rna-reads",children:[l(n.split_reads,a.split,"Split","split"),l(n.span_reads,a.span,"Spanning","span")]})}function X5({pair:n,top:a,onLocate:l}){const[i,c]=C.useState(!1),d=I5(n),f=[...new Set(n.breakpoints.flatMap(g=>Object.keys(g.details)))],m=n.breakpoints.length>0||Object.keys(n.details).length>0||n.description;return r.jsxs("li",{className:"rna-fusion","data-on":n.highlighted||void 0,"data-open":i||void 0,children:[r.jsxs("div",{className:"rna-fusion-main",children:[r.jsxs("span",{className:"rna-junction","aria-label":`${n.gene1??"?"} fused to ${n.gene2??"?"}`,children:[r.jsx("b",{children:n.gene1??"?"}),r.jsx("span",{className:"rna-join","aria-hidden":!0}),r.jsx("b",{children:n.gene2??"?"})]}),d&&r.jsx("span",{className:"sc-pill p-onco",children:d}),r.jsx(Y5,{fusion:n,top:a}),r.jsx("span",{className:"rna-callers",children:v2(n).map(g=>r.jsx("span",{className:"rna-caller",children:g},g))}),m&&r.jsxs("button",{type:"button",className:"rna-more","aria-expanded":i,onClick:()=>c(g=>!g),children:[r.jsx(ad,{size:14,"aria-hidden":!0}),n.breakpoints.length?`${n.breakpoints.length} breakpoint${n.breakpoints.length===1?"":"s"}`:"Details"]})]}),r.jsxs("div",{className:"rna-ends",children:[r.jsx(Fu,{value:n.left_break,gene:n.gene1,onLocate:l}),r.jsx("span",{"aria-hidden":!0,children:"→"}),r.jsx(Fu,{value:n.right_break,gene:n.gene2,onLocate:l})]}),i&&r.jsxs("div",{className:"rna-open",children:[n.description&&r.jsx("p",{className:"rna-desc",children:n.description}),r.jsx(Q5,{details:n.details}),n.breakpoints.length>0&&r.jsxs("table",{className:"rna-bp",children:[r.jsx("thead",{children:r.jsxs("tr",{children:[r.jsx("th",{children:"Left break"}),r.jsx("th",{children:"Right break"}),r.jsx("th",{children:"Split"}),r.jsx("th",{children:"Spanning"}),r.jsx("th",{children:"Callers"}),f.map(g=>r.jsx("th",{children:g},g))]})}),r.jsx("tbody",{children:n.breakpoints.map((g,v)=>r.jsxs("tr",{children:[r.jsx("td",{children:r.jsx(Fu,{value:g.left_break,gene:g.gene1,onLocate:l})}),r.jsx("td",{children:r.jsx(Fu,{value:g.right_break,gene:g.gene2,onLocate:l})}),r.jsx("td",{className:"mono",children:g.split_reads??"–"}),r.jsx("td",{className:"mono",children:g.span_reads??"–"}),r.jsx("td",{children:v2(g).join(", ")}),f.map(x=>r.jsx("td",{children:g.details[x]===void 0||g.details[x]===null?"–":String(g.details[x])},x))]},`${g.left_break}-${g.right_break}-${v}`))})]})]})]})}function K5({rna:n,onLocate:a}){const[l,i]=C.useState("confident"),c=n[l],d={split:Math.max(0,...c.map(f=>f.split_reads??0)),span:Math.max(0,...c.map(f=>f.span_reads??0))};return r.jsxs("section",{className:"rna-section","aria-label":"Fusions",children:[r.jsxs("div",{className:"rna-head",children:[r.jsx("h3",{className:"sv-h",children:"Fusions"}),r.jsx(es,{label:"Fusion set",value:l,onChange:i,options:[{value:"confident",label:`Confident ${n.confident.length}`},{value:"rescued",label:`Rescued ${n.rescued.length}`}]})]}),c.length?r.jsx("ul",{className:"rna-fusions",children:c.map((f,m)=>r.jsx(X5,{pair:f,top:d,onLocate:a},`${f.gene1}-${f.gene2}-${m}`))}):r.jsx("p",{className:"sv-empty",children:l==="confident"?"No confident fusions.":"No rescued fusions."}),n.fusion_report&&r.jsxs("a",{className:"rna-report",href:n.fusion_report,target:"_blank",rel:"noreferrer",children:["Open the fusion callers' report ",r.jsx(yy,{size:13,"aria-hidden":!0})]})]})}function Z5({gene:n,projects:a,top:l}){return r.jsxs("li",{className:"rna-gene",children:[r.jsxs("span",{className:"rna-gene-name",children:[r.jsx("b",{children:n.gene}),n.band&&r.jsx("span",{className:"mono",children:n.band})]}),r.jsx("span",{className:"rna-folds","data-single":a.length===1||void 0,children:a.filter(i=>n.folds[i]!==void 0).map(i=>r.jsxs("span",{className:"rna-fold",title:`log2 fold change ${n.folds[i].toFixed(2)} against project ${i}`,children:[a.length>1&&r.jsxs("span",{className:"rna-fold-p",children:["p",i]}),r.jsx("span",{className:"rna-fold-track","aria-hidden":!0,children:r.jsx("span",{style:{width:`${l?Math.max(n.folds[i]/l*100,3):0}%`}})}),r.jsxs("span",{className:"rna-fold-n mono",children:[n.folds[i].toFixed(2)," ",r.jsxs("i",{children:["(",q5(n.folds[i]),")"]})]})]},i))}),n.cancers&&r.jsx("span",{className:"rna-cancers",title:n.cancers,children:n.cancers})]})}function J5({rna:n}){const[a,l]=C.useState("report"),i=P5(n.overexpressed,a),c=Math.max(0,...n.overexpressed.map(Sg));return r.jsxs("section",{className:"rna-section","aria-label":"Overexpressed cancer genes",children:[r.jsxs("div",{className:"rna-head",children:[r.jsxs("h3",{className:"sv-h",children:["Overexpressed cancer genes ",r.jsx("span",{className:"rna-count",children:n.overexpressed.length})]}),n.overexpressed.length>1&&r.jsx(es,{label:"Sort genes",value:a,onChange:l,options:[{value:"report",label:"As reported"},{value:"fold",label:"Largest"},{value:"gene",label:"A–Z"}]})]}),i.length?r.jsxs(r.Fragment,{children:[r.jsx("ul",{className:"rna-genes",children:i.map(d=>r.jsx(Z5,{gene:d,projects:n.projects,top:c},d.gene))}),r.jsxs("p",{className:"rna-note",children:["log2 fold change over the mean of ",n.projects.length>1?"each":"its"," cohort (project ",n.projects.join(", "),"), as the cohort was when the report ran."]})]}):r.jsx("p",{className:"sv-empty",children:"No overexpressed cancer genes."})]})}const W5=C.forwardRef(function({envelope:a,loading:l,picked:i,sampleLabel:c,onLocate:d},f){var p;const m=((p=a==null?void 0:a.data)==null?void 0:p.experiments)??[],[g,v]=C.useState(null),x=m.find(b=>b.node===g)??m[0];return r.jsx(hs,{ref:f,title:"RNA",subtitle:`Fusions and overexpressed cancer genes, ${c}`,lineage:(a==null?void 0:a.lineage)??[],picked:i,info:"rna",className:"rna",controls:m.length>1?r.jsx(es,{label:"RNA experiment",value:(x==null?void 0:x.node)??"",onChange:v,options:m.map(b=>({value:b.node,label:b.node.split("-").slice(-2).join("-")}))}):void 0,children:r.jsx(Hn,{label:"RNA",envelope:a,loading:l,skeletonHeight:260,children:()=>x?r.jsxs("div",{className:"rna-body",children:[r.jsx(K5,{rna:x,onLocate:d},`f-${x.node}`),r.jsx(J5,{rna:x},`o-${x.node}`)]}):null})})});function eR(n,a=[],l=new Date){const i=a.filter(f=>typeof f=="number").map(f=>Math.floor(f/365)),c=typeof n=="number"?Math.max(l.getFullYear()-n-1,0):null,d=[...i,...c===null?[]:[c]];return d.length?Math.max(...d):null}function tR(n){return typeof n=="number"?Math.round(n/365.25*10)/10:null}const nR=n=>(n??[]).filter(a=>a.includes("XPRO")),sR=n=>(n??"").replace(/^LEVEL_/,"")||"–",aR={LEVEL_1:"#33A02C",LEVEL_2:"#1F78B4",LEVEL_3A:"#984EA3",LEVEL_3B:"#BE98CE",LEVEL_4:"#424242",LEVEL_R1:"#EE3424",LEVEL_R2:"#F79A92"},lR=(n,a)=>a||aR[n??""]||"var(--chev)";function Sb(n){return n&&n.replace(/<[^>]+>/g," ").replace(/ /g," ").replace(/&/g,"&").replace(/\s+/g," ").trim()||null}function iR(n){return(n??"").split(",").map(a=>a.split("+").map(l=>l.trim()).filter(Boolean)).filter(a=>a.length)}const zm=n=>(n??"").split(",").map(a=>a.trim()).filter(Boolean),Wu=n=>n?n.charAt(0)+n.slice(1).toLowerCase():null;function ia({label:n,off:a,title:l,children:i}){return r.jsxs("p",{className:"pp-line","data-off":a||void 0,title:l,children:[n&&r.jsx("span",{className:"pp-label",children:n}),i]})}function oR({data:n,sample:a,concordance:l}){var v;const i=n.individual,c=n.samples.filter(x=>x.category==="TUMOR"),d=[...new Set(c.map(x=>{var p;return(p=x.disease)==null?void 0:p.name}).filter(Boolean))],f=eR(i.birth_year,c.map(x=>x.collection_days)),m=[Wu(i.sex),f!==null?`${f} years old`:null].filter(Boolean).join(", "),g=(v=i.links)==null?void 0:v.cbioportal;return r.jsxs("div",{className:"pp",children:[r.jsxs("div",{className:"pp-group","aria-label":"Patient",children:[d.length>0&&r.jsx("p",{className:"pp-lead",children:d.map(Wu).join(", ")}),m&&r.jsx(ia,{children:m}),i.dmp_id&&r.jsx(ia,{label:"DMP",children:g?r.jsxs("a",{href:g,target:"_blank",rel:"noreferrer",title:"Open the patient in cBioPortal",className:"pp-link",children:[i.dmp_id,r.jsx(hy,{size:12,"aria-hidden":!0})]}):i.dmp_id}),nR(i.tags).map(x=>r.jsx(ia,{children:x},x)),r.jsx(ia,{off:!i.germline_consent,title:i.germline_consent?"Consented to germline results (Part C)":"Not consented to germline results",children:i.germline_consent?"Germline consented":"No germline consent"}),l&&r.jsx("p",{className:"pp-line",children:r.jsx("button",{type:"button",className:"pp-qc","data-ok":l.ok||void 0,title:"Conpair's check that the samples come from the same person. Open Quality",onClick:l.onOpen,children:l.ok?"Samples concordant":"Sample mismatch"})})]}),r.jsx("div",{className:"pp-samples",children:n.samples.map(x=>r.jsx(rR,{data:n,sample:x,shown:x.id===(a==null?void 0:a.id)},x.id))})]})}function rR({data:n,sample:a,shown:l}){const i=tR(a.collection_days),c=[Wu(a.disease_status),a.tissue_site].filter(Boolean).join(", ");return r.jsxs("div",{className:"pp-group","aria-label":l?"Sample":void 0,"aria-hidden":!l||void 0,"data-hidden":!l||void 0,children:[r.jsxs("p",{className:"pp-lead",children:[eo(a.id,n.individual.id)," ",a.category==="TUMOR"?"tumour":"normal"]}),a.identifier&&r.jsx(ia,{title:"The sample's identifier",children:a.identifier}),c&&r.jsx(ia,{children:c}),a.source&&r.jsx(ia,{label:"Source",children:Wu(a.source)}),a.matched_impact&&r.jsx(ia,{label:"IMPACT",title:"The matched MSK-IMPACT sample",children:a.matched_impact}),i!==null&&r.jsxs(ia,{title:`${Math.round(a.collection_days??0).toLocaleString("en-US")} days after birth`,children:["Collected at ",i," years"]})]})}function cR({children:n}){var m;const[a,l]=C.useState(!1),i=C.useRef(null),c=C.useRef(null),[d,f]=C.useState(null);return C.useLayoutEffect(()=>{if(!a||!i.current)return;const g=i.current.getBoundingClientRect();f({top:g.bottom+8,left:g.left-8});const v=x=>{var b,S;const p=!((b=c.current)!=null&&b.contains(x.target))&&!((S=i.current)!=null&&S.contains(x.target));(x instanceof KeyboardEvent&&x.key==="Escape"||!(x instanceof KeyboardEvent)&&p)&&l(!1)};return window.addEventListener("pointerdown",v),window.addEventListener("keydown",v),()=>{window.removeEventListener("pointerdown",v),window.removeEventListener("keydown",v)}},[a]),r.jsxs(r.Fragment,{children:[r.jsx("button",{ref:i,type:"button",className:"sc-ib sm","aria-expanded":a,"aria-label":"Patient and sample details",title:"Patient and sample details",onClick:()=>l(g=>!g),children:r.jsx(uC,{size:15,"aria-hidden":!0})}),a&&d&&Jr.createPortal(r.jsx("div",{ref:c,className:"pp-card",style:{top:d.top,left:d.left},role:"dialog","aria-label":"Patient and sample details",children:n}),((m=i.current)==null?void 0:m.closest(".wgts"))??document.body)]})}const Dr=(n,a=2)=>n===null?"–":String(+n.toFixed(a)),y2=n=>n===null?"–":n>=1?n.toFixed(1):String(+n.toPrecision(2)),b2=(n,a)=>n===null&&a===null?"–":`${n??"–"} | ${a??"–"}`,S2=n=>n?n.charAt(0)+n.slice(1).toLowerCase():"–",j2=[{key:"coverage",label:"Coverage",value:n=>n.coverage===null?"–":`${Math.round(n.coverage)}×`,numeric:!0},{key:"purity",label:"Purity",value:n=>Dr(n.purity),numeric:!0},{key:"ploidy",label:"Ploidy",value:n=>Dr(n.ploidy),numeric:!0},{key:"msi",label:"MSI",value:n=>Dr(n.msi),numeric:!0},{key:"hrd",label:"HRDetect | CHORD",value:n=>n.hrdetect===null&&n.chord===null?"–":`${Dr(n.hrdetect)} | ${Dr(n.chord)}`,numeric:!0},{key:"tmb",label:"TMB",title:"Mutations per Mb, genome-wide",value:n=>y2(n.tmb_genome),numeric:!0},{key:"tmb_coding",label:"Coding TMB",title:"Coding mutations per Mb",value:n=>y2(n.tmb_coding),numeric:!0},{key:"wgs",label:"SNVs | indels",title:"Genome-wide",value:n=>b2(n.snvs_wgs,n.indels_wgs),numeric:!0},{key:"coding",label:"Coding SNVs | indels",value:n=>b2(n.snvs_coding,n.indels_coding),numeric:!0},{key:"svs",label:"Rearrangements",value:n=>n.rearrangements===null?"–":String(n.rearrangements),numeric:!0},{key:"fusions",label:"RNA fusions",value:n=>n.rna?String(n.fusions??"–"):"–",numeric:!0},{key:"overexpressed",label:"Overexpressed genes",value:n=>n.rna?String(n.overexpressed??"–"):"–",numeric:!0},{key:"treatments",label:"Druggable targets",title:"OncoKB treatments for the tumour's alterations",value:n=>String(n.treatments??0),numeric:!0},{key:"tumour_source",label:"Tumour source",value:n=>S2(n.tumour_source)},{key:"normal_source",label:"Normal source",value:n=>S2(n.normal_source)},{key:"normal",label:"Normal used",value:n=>n.normal??"–"}];function uR({envelope:n,loading:a,picked:l,current:i,label:c,onSample:d}){return r.jsx(hs,{title:"All tumours",subtitle:"The report's results for each of the patient's tumours",lineage:(n==null?void 0:n.lineage)??[],picked:l,info:"summary",className:"pt-results",children:r.jsx(Hn,{label:"results summary",envelope:n,loading:a,skeletonHeight:120,children:f=>r.jsx("div",{className:"pt-results-scroll",children:r.jsxs("table",{className:"pt-results-table",children:[r.jsx("thead",{children:r.jsxs("tr",{children:[r.jsx("th",{scope:"col",children:"Tumour"}),r.jsx("th",{scope:"col",children:"Data"}),j2.map(m=>r.jsx("th",{scope:"col",title:m.title,"data-num":m.numeric||void 0,children:m.label},m.key))]})}),r.jsx("tbody",{children:f.tumours.map(m=>r.jsxs("tr",{"data-current":m.sample===i||void 0,children:[r.jsx("th",{scope:"row",children:r.jsx("button",{type:"button",onClick:()=>d(m.sample),"aria-current":m.sample===i||void 0,children:c(m.sample)})}),r.jsx("td",{children:r.jsxs("span",{className:"pt-data",children:[r.jsx("span",{"data-on":m.wgs||void 0,children:"WGS"}),r.jsx("span",{"data-on":m.rna||void 0,children:"RNA"}),r.jsx("span",{"data-on":!!m.normal||void 0,children:"Normal"})]})}),j2.map(g=>r.jsx("td",{"data-num":g.numeric||void 0,className:g.numeric?"mono":void 0,children:g.value(m)},g.key))]},m.sample))})]})})})})}function w2({treatment:n}){const a=Sb(n.level_description);return r.jsx("span",{className:"tx-level",style:{background:lR(n.level,n.level_color)},title:a?`${n.level}: ${a}`:n.level??void 0,"aria-label":`OncoKB ${n.level??"level unknown"}`,children:sR(n.level)})}function dR({drugs:n}){const a=iR(n);return a.length?r.jsx("span",{className:"tx-drugs",children:a.map((l,i)=>r.jsx("span",{className:"tx-option",title:l.length>1?"Given together":void 0,children:l.map((c,d)=>r.jsxs("span",{children:[d>0&&r.jsx("i",{"aria-hidden":!0,children:"+"}),c]},c))},i))}):r.jsx("span",{children:"–"})}const hR=C.forwardRef(function({envelope:a,loading:l,picked:i,sampleLabel:c},d){var x,p;const[f,m]=C.useState(!1),g=C.useMemo(()=>{var S;const b=((S=a==null?void 0:a.data)==null?void 0:S.treatments)??[];return f?b.filter(j=>zm(j.found_by).includes("Isabl")):b},[a,f]),v=[...new Set((((x=a==null?void 0:a.data)==null?void 0:x.treatments)??[]).map(b=>b.level).filter(Boolean))];return r.jsx(hs,{ref:d,title:"Available treatments",subtitle:`OncoKB's biomarker-drug associations for ${c}'s alterations`,lineage:(a==null?void 0:a.lineage)??[],picked:i,info:"treatments",className:"tx",controls:(p=a==null?void 0:a.data)!=null&&p.treatments.some(b=>!zm(b.found_by).includes("Isabl"))?r.jsxs("label",{className:"tx-toggle",children:[r.jsx("input",{type:"checkbox",checked:f,onChange:b=>m(b.target.checked)}),"Called by Isabl only"]}):void 0,footer:v.length?r.jsxs("span",{className:"tx-legend",children:[v.map(b=>{const S=a.data.treatments.find(j=>j.level===b);return r.jsxs("span",{title:Sb(S.level_description)??void 0,children:[r.jsx(w2,{treatment:S})," ",b.replace("LEVEL_","Level ")]},b)}),r.jsxs("a",{href:"https://www.oncokb.org/levels",target:"_blank",rel:"noreferrer",children:["OncoKB levels of evidence ",r.jsx(yy,{size:11,"aria-hidden":!0})]})]}):void 0,children:r.jsx(Hn,{label:"treatments",envelope:a,loading:l,skeletonHeight:160,children:()=>g.length?r.jsx("div",{className:"tx-scroll",children:r.jsxs("table",{className:"tx-table",children:[r.jsx("thead",{children:r.jsxs("tr",{children:[r.jsx("th",{scope:"col",children:"Level"}),r.jsx("th",{scope:"col",children:"Alteration"}),r.jsx("th",{scope:"col",children:"Drugs"}),r.jsx("th",{scope:"col",children:"Tumour type"}),r.jsx("th",{scope:"col",children:"Called by"})]})}),r.jsx("tbody",{children:g.map((b,S)=>{const j=b.alteration&&b.gene&&!b.alteration.includes(b.gene)?`${b.gene} ${b.alteration}`:b.alteration??b.gene;return r.jsxs("tr",{children:[r.jsx("td",{children:r.jsx(w2,{treatment:b})}),r.jsxs("td",{children:[b.url?r.jsx("a",{href:b.url,target:"_blank",rel:"noreferrer",className:"tx-alt",title:"Open in OncoKB",children:j}):r.jsx("span",{className:"tx-alt",children:j}),b.alteration_type&&r.jsx("span",{className:"tx-type",children:b.alteration_type})]}),r.jsxs("td",{children:[r.jsx(dR,{drugs:b.drugs}),b.approved_indications&&r.jsx("span",{className:"tx-approved",children:b.approved_indications})]}),r.jsx("td",{children:b.tumor_type??"–"}),r.jsx("td",{children:r.jsx("span",{className:"tx-by",children:zm(b.found_by).map(N=>r.jsx("span",{"data-who":N,children:N},N))})})]},`${b.gene}-${b.alteration}-${b.level}-${S}`)})})]})}):r.jsx("p",{className:"sv-empty px-5",children:f?"No treatments for alterations Isabl called.":"OncoKB reports no treatments for this tumour's alterations."})})})}),fR="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAMAAABEpIrGAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA+tpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMy1jMDExIDY2LjE0NTY2MSwgMjAxMi8wMi8wNi0xNDo1NjoyNyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtbG5zOmRjPSJodHRwOi8vcHVybC5vcmcvZGMvZWxlbWVudHMvMS4xLyIgeG1wTU06T3JpZ2luYWxEb2N1bWVudElEPSJ1dWlkOjVEMjA4OTI0OTNCRkRCMTE5MTRBODU5MEQzMTUwOEM4IiB4bXBNTTpEb2N1bWVudElEPSJ4bXAuZGlkOkNDQTREM0ZFQUM4QzExRTM5NjBFRENCOTc4ODUxNkZCIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOkNDQTREM0ZEQUM4QzExRTM5NjBFRENCOTc4ODUxNkZCIiB4bXA6Q3JlYXRvclRvb2w9IkFkb2JlIElsbHVzdHJhdG9yIENTNiAoTWFjaW50b3NoKSI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ1dWlkOjNhN2EzODUyLWNlMjItNjg0OC04NjM2LTE5NGVkZDU5MDU5YSIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDowMTgwMTE3NDA3MjA2ODExODIyQUREOTM2RUMwOTlDMCIvPiA8ZGM6dGl0bGU+IDxyZGY6QWx0PiA8cmRmOmxpIHhtbDpsYW5nPSJ4LWRlZmF1bHQiPmljb248L3JkZjpsaT4gPC9yZGY6QWx0PiA8L2RjOnRpdGxlPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PmBoMdIAAALHUExURSyAxGJkZpGSk9HS03x+f7u9vc0mSM0kR2VnaW1vcXBydGRmaf/+/hV4QtDR0ujo6B59SrPR6tDj8i6Cxfz+/f///5W/4f/9/SuAxP/6+/3//q/P6cPb7vT59/H49LHQ6SqAxP3y9RJ2QMsbP73ZymhqbBd5RNE4VxV3QhN3QS2BxKbMuHV3edAxUWRmaIm7oDGIWSqEU7LR6sjg0/7//7bT68sZPv7//rDQ6f/8/fr6+tDQ0e71+vHx8TCDxf7+/jWGx/3x9EiSzcXe0Pz+/u3t7bq7vKvN50KOy63O6W9xc/rp7bjWxi6CxMgNNO/v74iKjIi6n8sfQvL59s0lR9VJZtpddyyBxIK4mufx+LS2tnFzdcrLy7rXx/n5+TaGx/z8/CaCUOumtPzx8+/v8M4pTPnn68oXO8wgQzuKyPf6/bvW7KqrrPz9/mZoari5und4e/vs78Lczo684PXU25yenq3QvQZvNswfQ8oYPNpeeMjf07S1tlxeYM0iRe30+hN3QLy+vrXT688vUM0kRoeIir/AwanM5x95wSt/xARuNVxfYdLS09bX1wxzO2FjZRx8Sayuru7u78oYPfz9/efn56jL55iZmil/xHJ0dvrq7bDQ6vXV2+Tl5a7P6fbZ376/wHp8fq6vsPf39yh+wy+HWNDk2eLi4/7+///9/sscP+Ht9/75+p7Hsfvv8pSUlpOVlvfa3zmNYJaXmPv9/CF6wfC9yMsaPglwOSJ7wr2+v9TV1ZbA4TGDxom43v3z9e/385CSk+/28o6+pN1rgv/7/PD39DKExpC84La3uNfn9LnV7Cd+wx55wfXT2vP59swhRIeJiubn511fYdHk8qTKtv3+/soWO4SGiM3OzyZ9w7XS6vC+yLzX7BV4Q8oVOtE2Vsrg8SOATsoaPgdvN2Vnas7Oz6OkpfP3/GdpayB+SzeHx/////8zYXkAAADtdFJOU///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////AOpBRAoAAAH6SURBVHjaYnjz5s3iXQELWVCAznTRN4IMr0GA4c2b3pmqL9EARyuSAut+1eiJjawoID/mDVyBrZfq5rg3WABMQY5qgdUbfAp0XrphlX8zb6cwCDBwclhjV3BqnxgIABXwvcEHUBSIrpsjusW52tjYuOjQG5uHQiCArCCtanIqz4FyJSDo8nljcVYBCDKRFNxJz2BX55HjfQUEmipvTEG+sNuDULDxeggbpoJ6uIKVoRfYMBTcykY4cv59dnb2ugcIBU0zhDtPA32Rd/kZWEGSMhvYhGM7NIDgSewbwb0nbEDetPWHhLSlJAgcfWN+XhYIgqe8yXWBhAOYNFnx5poIGLwRFQcBSx54QAFxlrvT7TeH1QwNDR9tMt/P3qyrq1t5Diyb4JoCVCAUH75k9pvAewICAhOWSimaAR3Lvj0ZrOBS7UuGN1fOOLxmMHqjrwZ0vICBlCLIsUFHIObzc3MxvPBweI2uoGXVLISC4uOv0RVUPC55g1DgqwUEWz3fRPTx8vI2JEo5+pmFeb9BUmAhDwTTVr9ZtlZbW/tqmcmabYWib5AV4E0tIAUyIHA3EruCqUAFEiDQ0Y5dwW4OHWjalsYqb7L+ZSk+BfY1L/WWIxTMvcmMAnrabrzUW/QGoeB5NyMq0HvKcdIeScGCi0wo4OCGqElAewACDACkaE2uw4IcwQAAAABJRU5ErkJggg==",Va=236,jn={left:34,right:10,top:10,bottom:30},mR=[0,.25,.5,.75,1];function gR({data:n,sample:a,sampleLabel:l,hovered:i,onHover:c}){const d=Va-jn.left-jn.right,f=Va-jn.top-jn.bottom,m=p=>jn.left+Math.min(Math.max(p,0),1)*d,g=p=>jn.top+(1-Math.min(Math.max(p,0),1))*f,v=n.mutations.map(p=>({m:p,dmp:eM(p,n.matched),wgs:p.wgs[a]})).filter(p=>!!p.dmp&&!!p.wgs&&typeof p.wgs.vaf=="number"),x=v.find(p=>p.m.rank===i);return r.jsxs("figure",{className:"dmp-plot",children:[r.jsxs("figcaption",{children:[l," WGS against DMP VAF"]}),r.jsxs("div",{className:"dmp-plot-box",style:{width:Va},children:[r.jsxs("svg",{width:Va,height:Va,role:"img","aria-label":`VAF of ${v.length} DMP mutations in ${l}'s WGS against the DMP`,children:[mR.map(p=>r.jsxs("g",{children:[r.jsx("line",{className:"dmp-grid",x1:m(p),x2:m(p),y1:jn.top,y2:jn.top+f}),r.jsx("line",{className:"dmp-grid",x1:jn.left,x2:jn.left+d,y1:g(p),y2:g(p)}),r.jsx("text",{className:"dmp-tick",x:m(p),y:Va-jn.bottom+14,textAnchor:"middle",children:p}),r.jsx("text",{className:"dmp-tick",x:jn.left-6,y:g(p)+3.5,textAnchor:"end",children:p})]},p)),r.jsx("line",{className:"dmp-diagonal",x1:m(0),y1:g(0),x2:m(1),y2:g(1)}),r.jsx("text",{className:"dmp-axis",x:jn.left+d/2,y:Va-3,textAnchor:"middle",children:"DMP VAF"}),r.jsx("text",{className:"dmp-axis",transform:`translate(10 ${jn.top+f/2}) rotate(-90)`,textAnchor:"middle",children:"WGS VAF"}),v.map(({m:p,dmp:b,wgs:S})=>r.jsx("circle",{className:"dmp-point","data-called":S.called||void 0,"data-hovered":p.rank===i||void 0,cx:m(b.vaf),cy:g(S.vaf),r:p.rank===i?6.5:5,onMouseEnter:()=>c(p.rank),onMouseLeave:()=>c(null)},p.rank))]}),x&&r.jsxs(Kt,{x:m(x.dmp.vaf),y:g(x.wgs.vaf)-8,width:Va,above:!0,children:[r.jsxs("span",{className:"ctip-title",children:[x.m.gene," ",x.m.protein_change]}),r.jsxs("span",{className:"ctip-row",children:[r.jsxs("span",{children:["DMP, ",Oy(x.dmp.sample,n.dmp_id)]}),r.jsx("b",{children:x.dmp.vaf.toFixed(2)})]}),r.jsxs("span",{className:"ctip-row",children:[r.jsxs("span",{children:[l," WGS"]}),r.jsxs("b",{children:[x.wgs.vaf.toFixed(2),typeof x.wgs.depth=="number"&&r.jsxs("i",{children:[" ",x.wgs.alt_reads??0," of ",x.wgs.depth," reads"]})]})]}),r.jsx("span",{className:"ctip-note",children:x.wgs.called?`${l}'s WGS calls it.`:`${l}'s WGS does not call it.`})]})]})]})}const jb=n=>typeof n=="number"?n.toFixed(2):"–";function Vg({samples:n,data:a,withVaf:l}){return r.jsx("span",{className:"dmp-chips",children:n.map(i=>{const c=i.dmp_sample===a.matched,d=typeof i.alt_reads=="number"&&typeof i.depth=="number"?`${i.alt_reads} of ${i.depth} reads`:null,f=[i.dmp_sample,d,c?"matched to this sample":i.matched?"matched to another sample of the report":null].filter(Boolean).join(", ");return r.jsxs("span",{className:"dmp-chip","data-mine":c||void 0,title:f,children:[Oy(i.dmp_sample,a.dmp_id),l&&r.jsx("b",{className:"mono",children:jb(i.vaf)})]},i.dmp_sample)})})}function pR({m:n}){return r.jsxs("span",{className:"dmp-name",title:n.keyword??void 0,children:[r.jsx("b",{children:n.gene??"–"})," ",n.protein_change]})}function xR({data:n,sample:a,label:l,onCall:i}){const[c,d]=C.useState(null);if(!n.mutations.length)return r.jsx("p",{className:"sv-empty",children:"cBioPortal lists no DMP mutations for this patient."});const f=!!a&&n.wgs_samples.includes(a);return r.jsxs("div",{className:"dmp-mutations","data-plot":f||void 0,children:[r.jsx("div",{className:"tx-scroll",children:r.jsxs("table",{className:"tx-table dmp-table",children:[r.jsx("thead",{children:r.jsxs("tr",{children:[r.jsx("th",{scope:"col",children:"Mutation"}),r.jsx("th",{scope:"col",children:"DMP samples and VAF"}),n.wgs_samples.map(m=>r.jsxs("th",{scope:"col",className:"dmp-wgs-h","data-current":m===a||void 0,children:[l(m)," WGS"]},m))]})}),r.jsx("tbody",{children:n.mutations.map(m=>r.jsxs("tr",{"data-hovered":c===m.rank||void 0,onMouseEnter:()=>d(m.rank),onMouseLeave:()=>d(null),children:[r.jsxs("td",{children:[r.jsx(pR,{m}),r.jsxs("span",{className:"dmp-sub",children:[zy(m.consequence),r.jsxs("span",{className:"mono",children:[m.chrom,":",m.pos.toLocaleString("en-US")," ",m.ref,">",m.alt]})]})]}),r.jsx("td",{children:r.jsx(Vg,{samples:m.samples,data:n,withVaf:!0})}),n.wgs_samples.map(g=>{const v=m.wgs[g],x=g===a;if(!v)return r.jsx("td",{className:"dmp-wgs","data-current":x||void 0,children:"–"},g);const p=typeof v.depth=="number"?`${v.alt_reads??0}/${v.depth}`:"no reads",b=r.jsx("span",{className:"dmp-mark","data-called":v.called||void 0,"aria-hidden":!0}),S=r.jsxs(r.Fragment,{children:[b,r.jsx("span",{className:"mono",children:jb(v.vaf)}),r.jsx("span",{className:"dmp-reads mono",children:p})]}),j=v.called?`${l(g)} calls it`:`${l(g)} does not call it`;return r.jsx("td",{className:"dmp-wgs","data-current":x||void 0,children:v.called&&x&&v.call_pos!==null?r.jsx("button",{type:"button",className:"dmp-call",title:`${j}. Show the call in Mutations`,onClick:()=>i(m,v.call_pos),children:S}):r.jsx("span",{className:"dmp-call",title:typeof v.depth=="number"?j:"The pileup returned no reads; the report shows 0",children:S})},g)})]},m.rank))})]})}),f&&a&&r.jsx(gR,{data:n,sample:a,sampleLabel:l(a),hovered:c,onHover:d})]})}function vR({data:n}){return n.svs.length?r.jsx("div",{className:"tx-scroll",children:r.jsxs("table",{className:"tx-table dmp-table",children:[r.jsx("thead",{children:r.jsxs("tr",{children:[r.jsx("th",{scope:"col",children:"Genes"}),r.jsx("th",{scope:"col",children:"Class"}),r.jsx("th",{scope:"col",children:"Event"}),r.jsx("th",{scope:"col",children:"DMP samples"}),r.jsx("th",{scope:"col",children:"Comments"})]})}),r.jsx("tbody",{children:n.svs.map(a=>r.jsxs("tr",{children:[r.jsx("td",{children:r.jsxs("span",{className:"dmp-name",children:[r.jsx("b",{children:a.gene1??"–"}),a.gene2&&a.gene2!==a.gene1&&r.jsxs(r.Fragment,{children:[r.jsx("span",{className:"dmp-join","aria-label":"and"}),r.jsx("b",{children:a.gene2})]})]})}),r.jsx("td",{children:zy(a.classification)??"–"}),r.jsx("td",{children:a.event_info??"–"}),r.jsx("td",{children:r.jsx(Vg,{samples:a.samples,data:n})}),r.jsx("td",{className:"dmp-comment",children:a.comments&&a.comments!=="-"?a.comments:"–"})]},a.rank))})]})}):r.jsx("p",{className:"sv-empty",children:"cBioPortal lists no DMP structural variants for this patient."})}function yR({data:n}){return n.cnas.length?r.jsx("div",{className:"tx-scroll",children:r.jsxs("table",{className:"tx-table dmp-table",children:[r.jsx("thead",{children:r.jsxs("tr",{children:[r.jsx("th",{scope:"col",children:"Gene"}),r.jsx("th",{scope:"col",children:"Alteration"}),r.jsx("th",{scope:"col",children:"DMP samples"})]})}),r.jsx("tbody",{children:n.cnas.map(a=>{var l;return r.jsxs("tr",{children:[r.jsx("td",{children:r.jsxs("span",{className:"dmp-name",children:[r.jsx("b",{children:a.gene??"–"}),a.cytoband&&a.cytoband!=="-"&&r.jsx("span",{className:"dmp-band mono",children:a.cytoband})]})}),r.jsx("td",{children:r.jsx("span",{className:"dmp-cna","data-kind":(l=a.alteration)==null?void 0:l.toLowerCase(),children:a.alteration==="GAIN"?"Gain":a.alteration==="LOSS"?"Loss":a.alteration??"–"})}),r.jsx("td",{children:r.jsx(Vg,{samples:a.samples,data:n})})]},a.rank)})})]})}):r.jsx("p",{className:"sv-empty",children:"cBioPortal lists no DMP copy-number alterations for this patient."})}const bR={mutations:"mutations",svs:"structural variants",cnas:"copy-number alterations"},SR=C.forwardRef(function({envelope:a,loading:l,picked:i,sample:c,label:d,onCall:f},m){const[g,v]=C.useState("mutations"),x=(a==null?void 0:a.status)==="ok"?a.data:null;return r.jsx(hs,{ref:m,title:"DMP results",subtitle:x!=null&&x.dmp_id?`MSK-IMPACT calls for ${x.dmp_id}, from cBioPortal`:"MSK-IMPACT calls, from cBioPortal",lineage:(a==null?void 0:a.lineage)??[],picked:i,info:"dmp",className:"dmp",controls:x?r.jsxs(r.Fragment,{children:[r.jsx(es,{label:"DMP calls",value:g,onChange:v,options:[{value:"mutations",label:`Mutations ${x.mutations.length}`},{value:"svs",label:`SVs ${x.svs.length}`},{value:"cnas",label:`CNAs ${x.cnas.length}`}]}),x.cbioportal&&r.jsx("a",{className:"sc-ib dmp-cbio",href:x.cbioportal,target:"_blank",rel:"noreferrer","aria-label":"Open the patient in cBioPortal",title:"Open the patient in cBioPortal",children:r.jsx("img",{src:fR,alt:"",width:18,height:18})})]}):void 0,footer:x&&g==="mutations"&&x.mutations.length>0&&x.wgs_samples.length>0?r.jsxs("span",{className:"dmp-legend",children:[r.jsxs("span",{children:[r.jsx("span",{className:"dmp-mark","data-called":!0,"aria-hidden":!0})," Called in that tumour's WGS"]}),r.jsxs("span",{children:[r.jsx("span",{className:"dmp-mark","aria-hidden":!0})," Not called; VAF from its reads"]})]}):void 0,children:r.jsx(Hn,{label:"DMP results",envelope:a,loading:l,skeletonHeight:180,children:p=>r.jsxs(r.Fragment,{children:[p.timed_out.length>0&&r.jsxs("p",{className:"dmp-warn",role:"note",children:["cBioPortal did not answer for the ",p.timed_out.map(b=>bR[b]??b).join(" and ")," when the report ran, so they may be missing here. Check them in cBioPortal."]}),g==="mutations"&&r.jsx(xR,{data:p,sample:c,label:d,onCall:f}),g==="svs"&&r.jsx(vR,{data:p}),g==="cnas"&&r.jsx(yR,{data:p})]})})})}),Dm=n=>typeof n=="number"?`${n.toFixed(1)}%`:"–",jR=C.forwardRef(function({envelope:a,loading:l,picked:i,label:c},d){return r.jsx(hs,{ref:d,title:"Sample concordance",subtitle:"Conpair: whether the patient's samples come from the same person",lineage:(a==null?void 0:a.lineage)??[],picked:i,info:"quality",className:"qc",children:r.jsx(Hn,{label:"sample concordance",envelope:a,loading:l,skeletonHeight:120,children:f=>r.jsx(wR,{quality:f,label:c})})})});function wR({quality:n,label:a}){const l=v=>{const x=n.experiments.find(p=>p.id===v);return x!=null&&x.sample?[a(x.sample),tM(x.technique)].filter(Boolean).join(" "):v};if(!n.pairs.length)return r.jsx("p",{className:"sv-empty",children:"Conpair compared no pairs of this patient's samples."});const i=Dy(n),c=n.threshold,[d,f]=nM(n.pairs,c),m=v=>`${(Math.min(Math.max(v,d),f)-d)/(f-d)*100}%`,g=v=>`${l(v.experiment_a)} and ${l(v.experiment_b)}`;return r.jsxs("div",{className:"qc-body",children:[r.jsxs("p",{className:"qc-verdict","data-ok":i.length===0||void 0,children:[i.length===0?r.jsx(xy,{size:17,"aria-hidden":!0}):r.jsx(Ag,{size:17,"aria-hidden":!0}),r.jsx("span",{children:i.length===0?`Every pair is concordant${c!==null?`, at or above ${c}%`:""}.`:`${i.length===1?"One pair falls":`${i.length} pairs fall`} below ${c}%: ${i.map(g).join("; ")}. The samples may not come from the same person.`})]}),r.jsxs("ul",{className:"qc-pairs","aria-label":"Pairs Conpair compared",children:[n.pairs.map(v=>{const x=[v.concordance_ab,v.concordance_ba].every(p=>typeof p=="number");return r.jsxs("li",{className:"qc-pair","data-below":!v.concordant||void 0,children:[r.jsxs("span",{className:"qc-names",children:[r.jsx("b",{children:l(v.experiment_a)}),r.jsx("span",{className:"qc-and","aria-label":"and"}),r.jsx("b",{children:l(v.experiment_b)})]}),r.jsxs("span",{className:"qc-scale","aria-hidden":!0,children:[c!==null&&r.jsx("span",{className:"qc-threshold",style:{left:m(c)}}),typeof v.concordance=="number"&&r.jsx("span",{className:"qc-dot",style:{left:m(v.concordance)}})]}),r.jsx("span",{className:"qc-value mono",title:x?`${Dm(v.concordance_ab)} with ${l(v.experiment_a)} as the target, ${Dm(v.concordance_ba)} the other way; the report keeps the better`:void 0,children:Dm(v.concordance)})]},`${v.experiment_a}-${v.experiment_b}`)}),r.jsxs("li",{className:"qc-pair qc-axis","aria-hidden":!0,children:[r.jsx("span",{}),r.jsxs("span",{className:"qc-scale-labels",children:[r.jsxs("span",{style:{left:0},children:[d,"%"]}),c!==null&&r.jsxs("span",{className:"qc-threshold-label",style:{left:m(c)},children:[c,"%"]}),r.jsxs("span",{style:{left:"100%"},children:[f,"%"]})]}),r.jsx("span",{})]})]})]})}function NR(n){var i;const a=n.samples.filter(c=>c.category==="TUMOR");return(i=a.find(c=>Object.values(c.datasets??{}).some(d=>Object.values(d).includes("ok")))??a[0]??n.samples[0])==null?void 0:i.id}const CR=[];function MR(n){const a=C.useRef(!1);return C.useEffect(()=>{let l=0;const i=()=>{a.current=!0,window.clearTimeout(l),l=window.setTimeout(()=>a.current=!1,150)};return window.addEventListener("scroll",i,{passive:!0}),()=>{window.removeEventListener("scroll",i),window.clearTimeout(l)}},[]),C.useCallback(l=>{(l===null||!a.current)&&n(l)},[n])}function Tl(n,a){const l=typeof matchMedia<"u"&&matchMedia("(prefers-reduced-motion: reduce)").matches;n==null||n.scrollIntoView({behavior:l?"auto":"smooth",block:a})}const N2=160;function ER(n,a){const l=C.useRef(n);l.current=n;const i=C.useRef(null),c=C.useRef(null),d=C.useRef(0),f=C.useRef(()=>{}),m=C.useRef(()=>{});C.useEffect(()=>{let x=0;const p=()=>{var E;if(x=0,i.current)return;const R=l.current.filter(([,_])=>_.current).map(([_,D])=>[_,D.current.getBoundingClientRect().top]),A=Math.max(0,document.documentElement.scrollHeight-window.innerHeight),T=Math.max(0,...R.map(([,_])=>_+window.scrollY-A-N2)),O=N2+(A>0?T*Math.min(1,window.scrollY/A):0);let M=((E=R[0])==null?void 0:E[0])??null;for(const[_,D]of R)D<=O&&(M=_);a.set(M)},b=()=>{i.current=null,c.current=null,p()};m.current=()=>{c.current=window.scrollY};const S=()=>{if(i.current){c.current===null?(window.clearTimeout(d.current),d.current=window.setTimeout(m.current,160)):Math.abs(window.scrollY-c.current)>4&&b();return}x||(x=requestAnimationFrame(p))},j=()=>{i.current&&c.current===null&&(window.clearTimeout(d.current),b())};return f.current=p,p(),window.addEventListener("scroll",S,{passive:!0}),window.addEventListener("resize",S),window.addEventListener("wheel",j,{passive:!0}),window.addEventListener("touchstart",j,{passive:!0}),window.addEventListener("keydown",j),()=>{window.removeEventListener("scroll",S),window.removeEventListener("resize",S),window.removeEventListener("wheel",j),window.removeEventListener("touchstart",j),window.removeEventListener("keydown",j),window.clearTimeout(d.current),x&&cancelAnimationFrame(x)}},[]);const g=C.useRef("");return C.useEffect(()=>{const x=n.filter(([,p])=>p.current).map(([p])=>p).join();x!==g.current&&(g.current=x,f.current())}),x=>{i.current=x,c.current=null,a.set(x),window.clearTimeout(d.current),d.current=window.setTimeout(m.current,160)}}function RR({held:n,sampleId:a,...l}){const i=tc(n);return r.jsx(qC,{...l,sampleId:i??a})}function TR(){var ua,So,lc,jo,Kl,da,ic,wo,No,Co,Zl,Jl,Mo,Eo,Vn,St,Vt,Hs,Ro,oc,rc,To,ha;const{individual:n=""}=AN(),[a,l]=JN(),i=a.get("version")??void 0,[c,d]=C.useState(null),[f,m]=C.useState(null),[g,v]=C.useState(Tv),[x,p]=C.useState(null),b=MR(p),[S,j]=C.useState(null),N=C.useRef(null),[R,A]=C.useState(null),T=C.useRef(to(!0)).current,O=C.useRef(null),M=C.useRef(null),E=C.useRef(null),_=C.useRef(null),D=C.useRef(null),P=C.useRef(null),Z=C.useRef(null),z=C.useRef(null),te=C.useRef(null),ie=C.useRef(null),J=C.useRef(to(null)).current,se=ER([["overview",M],["copyNumber",N],["mutations",O],["structuralVariants",E],["circos",D],["cnsv",P],["signatures",_],["rna",Z],["treatments",z],["dmp",te],["quality",ie]],J),re=$2();C.useEffect(()=>{const ue=R;if(!ue||typeof IntersectionObserver>"u")return;const Ye=new IntersectionObserver(([jt])=>T.set(jt.isIntersecting),{rootMargin:"-72px 0px 0px 0px",threshold:0});return Ye.observe(ue),()=>Ye.disconnect()},[R]);const $=C.useCallback(ue=>v(Ye=>({...Ye,...ue})),[]),G=C.useCallback(ue=>{$({q:_v(ue.chrom,ue.start,ue.end),scope:"all",sort:"position"}),Tl(O.current,"start")},[$]),X=C.useCallback(ue=>{$({q:ue}),Tl(O.current,"start")},[$]),le=C.useCallback(ue=>{j({chrom:ue.chrom,pos:ue.pos,gene:ue.gene,nonce:Date.now()}),Tl(N.current,"center")},[]),ae=C.useCallback(ue=>{j({...ue,nonce:Date.now()}),Tl(N.current,"center")},[]),me=dM(n,i),Se=me.data,ce=(Se==null?void 0:Se.status)==="ok"?Se.data??void 0:void 0,k=a.get("sample")??(ce?NR(ce):void 0),U=ce==null?void 0:ce.samples.find(ue=>ue.id===k),V=(U==null?void 0:U.category)==="TUMOR"?k:void 0,oe=f??((ce==null?void 0:ce.mode)==="unmatched"?"vaf":"ccf"),de=hM(n,ce?k:void 0,i),be=fM(n,i),Me=mM(n,V,i),ge=gM(n,V,oe,g.ffpe,i),ve=TM(n,V,g,i),ut=(ua=ve.data)==null?void 0:ua.pages[0],Zt=C.useMemo(()=>{var ue;return((ue=ve.data)==null?void 0:ue.pages.flatMap(Ye=>Ye.status==="ok"&&Ye.data?Ye.data.rows:[]))??[]},[ve.data]),{fetchNextPage:Bn}=ve,mn=C.useCallback(()=>void Bn(),[Bn]),ot=RM(n,V,i),Ve=pM(n,V,i),Bt=xM(n,V,i),Fn=vM(n,V,i),Jt=yM(n,V,i),Wt=bM(n,V,i),[Ls,xt]=C.useState("1"),[fs,an]=C.useState("integrated"),[gn,oa]=C.useState(!1),Ot=SM(n,V,Ls,i),$s=jM(n,V,fs==="raw"&&gn,i),ms=wM(n,V,i),W=EM(n,V,i),he=NM(n,ce?k:void 0,i),we=CM(n,!!ce,i),Ge=MM(n,!!ce,i),Ke=tc(qy),ft=(lc=(So=be.data)==null?void 0:So.data)==null?void 0:lc.samples.find(ue=>ue.sample===k),zt=C.useMemo(()=>(ft==null?void 0:ft.drivers)??CR,[ft]),tt=C.useMemo(()=>x?{chrom:x.chrom,pos:x.pos,gene:x.gene}:S,[x,S]),Dt=C.useRef(null),Cn=C.useRef(to(null)).current,sl=(ue,Ye)=>{var jt;(jt=Dt.current)==null||jt.toggleAttribute("data-gliding",ue),Dt.current&&(Dt.current.style.minHeight=ue&&Ye?`${Ye}px`:"")},Mn=C.useRef(null);C.useEffect(()=>()=>{var ue;return(ue=Mn.current)==null?void 0:ue.call(Mn)},[]);const fd=ue=>{var Ao,xs;if(ue===k)return;(Ao=Mn.current)==null||Ao.call(Mn);const Ye=typeof matchMedia<"u"&&matchMedia("(prefers-reduced-motion: reduce)").matches,jt=50;if(Ye||window.scrollY<=jt)return window.scrollTo({top:0,behavior:"auto"}),ra("sample",ue);const ps=window.scrollY,ll=Math.min(520,240+ps*.12),fa=performance.now();sl(!0,document.documentElement.scrollHeight-(((xs=Dt.current)==null?void 0:xs.getBoundingClientRect().top)??0)-ps),Cn.set(k??null),se("overview"),C.startTransition(()=>ra("sample",ue));let mt=0;function ns(){cancelAnimationFrame(mt),window.removeEventListener("wheel",ns),window.removeEventListener("touchstart",ns),window.removeEventListener("keydown",ns),Mn.current=null,Cn.set(null),sl(!1)}const _o=ma=>{const cc=Math.min(1,(ma-fa)/ll),Oo=ps*(1-cc)**3;window.scrollTo({top:Oo,behavior:"instant"}),Oo<=jt&&Cn.set(null),cc<1?mt=requestAnimationFrame(_o):ns()};window.addEventListener("wheel",ns,{passive:!0}),window.addEventListener("touchstart",ns,{passive:!0}),window.addEventListener("keydown",ns),Mn.current=ns,mt=requestAnimationFrame(_o)},ra=(ue,Ye)=>{const jt=new URLSearchParams(a);jt.set(ue,Ye),l(jt,{replace:!1}),d(null),v(Tv()),p(null),j(null)},nc=[me,de,be,Me,ge,ve,ot,Ve,Bt,Fn,Jt,Wt].map(ue=>ue.error);if(nc.some(ue=>ue instanceof od))return r.jsx("div",{className:`wgts ${Wn.theme}`,children:r.jsx("main",{className:"page",children:r.jsx(i3,{onSignedIn:()=>re.invalidateQueries()})})});const bo=nc.find(ue=>ue instanceof Ry),En=U&&ce?eo(U.id,ce.individual.id):"",Ft=((jo=we.data)==null?void 0:jo.status)==="ok"?we.data.data:null,ts=ce?r.jsx(oR,{data:ce,sample:U,concordance:Ft&&Ft.pairs.length?{ok:Dy(Ft).length===0,onOpen:()=>sc("quality")}:void 0}):void 0,ln=new Set(ce?V?["overview","copyNumber","mutations","structuralVariants","circos","cnsv","signatures","rna","treatments","dmp","quality"]:["overview","dmp","quality"]:[]),sc=ue=>{if(se(ue),ue==="overview"){const jt=typeof matchMedia<"u"&&matchMedia("(prefers-reduced-motion: reduce)").matches;window.scrollTo({top:0,behavior:jt?"auto":"smooth"});return}const Ye={copyNumber:N,mutations:O,structuralVariants:E,circos:D,cnsv:P,signatures:_,rna:Z,treatments:z,dmp:te,quality:ie}[ue];Tl((Ye==null?void 0:Ye.current)??null,"start")},Yl=ce&&k&&ce.analyses[k]||[],ac=(ce==null?void 0:ce.failures.filter(ue=>ue.sample===k))??[],Xl=new Set(Yl.map($n)),ca=new Set,bt=ue=>ue==null?void 0:ue.forEach(Ye=>Xl.has($n(Ye))&&ca.add($n(Ye)));for(const ue of((da=(Kl=de.data)==null?void 0:Kl.data)==null?void 0:da.metrics)??[])rg.includes(ue.key)&&bt(ue.sources);bt((ic=be.data)==null?void 0:ic.lineage),bt((wo=Me.data)==null?void 0:wo.lineage),bt((No=ge.data)==null?void 0:No.lineage),bt(ut==null?void 0:ut.lineage),bt((Co=ot.data)==null?void 0:Co.lineage),bt((Zl=Ve.data)==null?void 0:Zl.lineage),bt((Jl=Bt.data)==null?void 0:Jl.lineage),bt((Mo=Fn.data)==null?void 0:Mo.lineage),bt((Eo=Jt.data)==null?void 0:Eo.lineage),bt((Vn=Wt.data)==null?void 0:Vn.lineage),bt((St=Ot.data)==null?void 0:St.lineage),bt((Vt=ms.data)==null?void 0:Vt.lineage),bt((Hs=W.data)==null?void 0:Hs.lineage),bt((Ro=we.data)==null?void 0:Ro.lineage);for(const ue of Yl)ue.state==="failed"&&ac.length>0&&ca.add($n(ue));const gs=ue=>ce?eo(ue,ce.individual.id):ue,al=ce?r.jsxs(r.Fragment,{children:[r.jsx(SR,{ref:te,envelope:he.data,loading:he.isPending,picked:c,sample:k??void 0,label:gs,onCall:(ue,Ye)=>{$({q:_v(ue.chrom,Ye,Ye),scope:"all",sort:"position"}),se("mutations"),Tl(O.current,"start")}}),r.jsx(jR,{ref:ie,envelope:we.data,loading:we.isPending,picked:c,label:gs})]}):null;return r.jsxs("div",{className:`wgts ${Wn.theme}`,children:[r.jsx(qM,{analyses:Yl,onPage:ca,sampleLabel:En,picked:c,onPick:d,sections:ln,activeStore:J,onSection:sc,profile:ts}),r.jsxs("div",{ref:Dt,className:"page",children:[r.jsx(Ey,{individualId:n,subtitle:(ce==null?void 0:ce.mode)==="unmatched"?"tumour only":void 0,details:ce&&Ke?r.jsx(cR,{children:ts}):void 0,patientIcon:ce?r.jsx(HC,{sex:ce.individual.sex}):void 0,report:ce?r.jsx(WM,{data:ce,onVersion:ue=>ra("version",ue)}):void 0,compact:ce&&k?r.jsx(IC,{data:ce,sampleId:k,fingerprint:((oc=be.data)==null?void 0:oc.data)??void 0,onSample:fd}):void 0,headerInView:T}),r.jsxs("main",{className:"flex flex-1 flex-col",children:[ce&&k&&r.jsx("div",{className:"px-8 pt-1",children:r.jsx("div",{ref:A,children:r.jsx(RR,{held:Cn,data:ce,sampleId:k,fingerprint:((rc=be.data)==null?void 0:rc.data)??void 0,onSample:ue=>ra("sample",ue)})})}),r.jsxs("div",{className:"sheet",children:[me.isPending&&r.jsx("div",{className:"skeleton h-24","aria-label":"Loading the patient"}),bo&&r.jsx("div",{className:"sc-card px-6 py-5",children:r.jsx(Al,{envelope:{status:"error",data:null,lineage:[],warnings:[bo.message]}})}),me.isError&&!bo&&r.jsx("div",{className:"sc-card px-6 py-5",children:r.jsx(Al,{envelope:{status:"error",data:null,lineage:[],warnings:[me.error.message]}})}),Se&&Se.status!=="ok"&&r.jsx("div",{className:"sc-card px-6 py-5",children:r.jsx(Al,{envelope:Se})}),(Se==null?void 0:Se.status)==="ok"&&Se.warnings.length>0&&r.jsx("div",{className:"sc-card px-6 py-4",children:r.jsx(Al,{envelope:{...Se,status:"missing"}})}),ce&&k&&r.jsxs(r.Fragment,{children:[r.jsx(l3,{sampleLabel:En,failures:ac,analyses:Yl}),V?r.jsxs(r.Fragment,{children:[r.jsxs("div",{ref:M,className:"page-section",children:[r.jsx(a3,{sampleLabel:`${En} tumour`,fingerprint:ft,metrics:de.data,picked:c,lineage:rd((To=de.data)==null?void 0:To.lineage,(ha=be.data)==null?void 0:ha.lineage)}),r.jsx(uR,{envelope:Ge.data,loading:Ge.isPending,picked:c,current:k??void 0,label:ue=>ce?eo(ue,ce.individual.id):ue,onSample:ue=>ra("sample",ue)})]}),r.jsx("div",{ref:N,className:"page-section",children:r.jsx(P3,{envelope:Me.data,loading:Me.isPending,picked:c,sampleLabel:En,drivers:zt,focus:tt,locate:S,onSegment:G,onGene:X,fga:Fn.data,fgaLoading:Fn.isPending,onOpenChromosome:ue=>{xt(ue),oa(!1),se("cnsv"),Tl(P.current,"start")}})}),r.jsx(S4,{ref:O,variants:ut,rows:Zt,hasMore:ve.hasNextPage,loadingMore:ve.isFetchingNextPage,onMore:mn,variantsLoading:ve.isPending,variantsFetching:ve.isFetching&&ve.isPlaceholderData,density:ge.data,densityLoading:ge.isPending,picked:c,measure:oe,onMeasure:ue=>{m(ue),g.range&&g.range.measure!==ue&&$({range:null})},table:g,onTable:$,hovered:x,onHover:b,onLocate:le,showCcf:ce.mode!=="unmatched",tmb:Jt.data}),r.jsx(P4,{ref:E,envelope:ot.data,loading:ot.isPending,picked:c,onLocate:ae}),r.jsx(j5,{ref:D,envelope:Wt.data,loading:Wt.isPending,picked:c,drivers:zt}),r.jsx(V5,{ref:P,envelope:Ot.data,loading:Ot.isPending,rawGenome:$s.data,rawGenomeLoading:$s.isPending,picked:c,chrom:Ls,onChrom:xt,mode:fs,onMode:an,genome:gn,onGenome:oa}),r.jsx(h5,{ref:_,envelope:Ve.data,loading:Ve.isPending,contextEnvelope:Bt.data,contextLoading:Bt.isPending,picked:c}),r.jsx(W5,{ref:Z,envelope:ms.data,loading:ms.isPending,picked:c,sampleLabel:En,onLocate:ae}),r.jsx(hR,{ref:z,envelope:W.data,loading:W.isPending,picked:c,sampleLabel:En}),al]}):r.jsxs(r.Fragment,{children:[r.jsx("div",{ref:M,className:"sc-card px-6 py-5",children:r.jsx(Al,{envelope:{status:"missing",data:null,lineage:[],warnings:[`${En} is a normal sample. Its germline panels arrive with that section; the patient's DMP results and sample concordance are below.`]}})}),al]})]})]})]})]})]})}const km=200,wb="wgts-picker-scope";function _R(){try{const n=localStorage.getItem(wb);return n&&/^\d+$/.test(n)?Number(n):"all"}catch{return"all"}}function AR(n,a){const l=a.toLowerCase().split(/\s+/).filter(Boolean);return l.length===0?n:n.filter(i=>{const c=`${i.individual} ${i.diseases.join(" ")} ${i.report_version}`.toLowerCase();return l.every(d=>c.includes(d))})}function OR(n,a){const l=a.toLowerCase().split(/\s+/).filter(Boolean);return l.length===0?n:n.filter(i=>{const c=`${i.title} ${i.short_title??""} ${i.description??""}`.toLowerCase();return l.every(d=>c.includes(d))})}const Lm=n=>n.toLocaleString("en-US");function zR(){return tc(zg)?r.jsx(DR,{}):null}function DR(){var J,se,re,$;const n=_g(),a=((J=TN("/:individual"))==null?void 0:J.params.individual)??"",l=C.useId(),i=C.useRef(null),[c,d]=C.useState(_R),[f,m]=C.useState(""),[g,v]=C.useState(""),[x,p]=C.useState(0),b=C.useRef(null),S=C.useRef(!1),j=_M(),N=AM(c);C.useEffect(()=>{const G=document.activeElement,X=document.documentElement,le=X.style.overflow;return X.style.overflow="hidden",requestAnimationFrame(()=>{var ae;return(ae=document.querySelector(".pick-main .tsearch input"))==null?void 0:ae.focus()}),()=>{X.style.overflow=le,G==null||G.focus()}},[]);const R=G=>{S.current=!0,d(G),v(""),p(0);try{localStorage.setItem(wb,String(G))}catch{}requestAnimationFrame(()=>{var X;return(X=document.querySelector(".pick-main .tsearch input"))==null?void 0:X.focus()})},A=((se=j.data)==null?void 0:se.results)??[],T=C.useMemo(()=>OR(A,f),[A,f]),O=c==="all"?null:A.find(G=>G.pk===c)??((re=N.data)==null?void 0:re.project)??null,M=(($=N.data)==null?void 0:$.results)??[],E=C.useMemo(()=>AR(M,g),[M,g]),_=a?E.findIndex(G=>G.individual===a):-1,D=E.slice(0,Math.max(km,_+1)),P=C.useRef(null);C.useEffect(()=>{if(!N.data||N.isPlaceholderData||b.current===c)return;const G=a?M.findIndex(X=>X.individual===a):-1;if(G<0&&a&&c!=="all"&&!S.current){S.current=!0,d("all");return}S.current=!0,b.current=c,!(g||G<0)&&(p(G),requestAnimationFrame(()=>{var X,le,ae;return(ae=(le=(X=P.current)==null?void 0:X.querySelector(`[data-index="${G}"]`))==null?void 0:le.scrollIntoView)==null?void 0:ae.call(le,{block:"center"})}))},[N.data,N.isPlaceholderData,c]);const Z=G=>{Ou(),G.individual!==a&&n(`/${encodeURIComponent(G.individual)}`)};C.useEffect(()=>{var G,X,le;(le=(X=(G=P.current)==null?void 0:G.querySelector(`[data-index="${x}"]`))==null?void 0:X.scrollIntoView)==null||le.call(X,{block:"nearest"})},[x]);const z=G=>{const X=G.target,le=X instanceof HTMLInputElement&&!!X.closest(".pick-main");if(G.key==="Escape"){if(X instanceof HTMLInputElement&&X.value)return;Ou()}else if(le&&G.key==="ArrowDown")G.preventDefault(),p(ae=>Math.min(ae+1,D.length-1));else if(le&&G.key==="ArrowUp")G.preventDefault(),p(ae=>Math.max(ae-1,0));else if(le&&G.key==="Enter"&&D[x])G.preventDefault(),Z(D[x]);else if(X instanceof HTMLInputElement&&X.closest(".pick-rail")&&G.key==="Enter"){G.preventDefault();const ae=T[0];ae&&R(ae.pk)}},te=j.isPending,ie=j.isError||N.isError;return Jr.createPortal(r.jsx("div",{className:`info-backdrop ${Wn.theme}`,onMouseDown:G=>G.target===G.currentTarget&&Ou(),children:r.jsxs("div",{className:"info-dialog pick",role:"dialog","aria-modal":"true","aria-labelledby":l,tabIndex:-1,onKeyDown:z,children:[r.jsx("button",{ref:i,type:"button",className:"info-close","aria-label":"Close",onClick:Ou,children:r.jsx(ec,{size:18,"aria-hidden":!0})}),r.jsxs("nav",{className:"info-rail pick-rail","aria-label":"Projects",children:[r.jsx("span",{className:"info-kicker",children:"Browse"}),r.jsx("h2",{id:l,children:"Projects"}),r.jsx(Zu,{value:f,onChange:m,label:"Search projects",placeholder:"Search projects",shortcut:!1,delay:0}),r.jsxs("ol",{children:[r.jsx("li",{children:r.jsxs("button",{type:"button","aria-current":c==="all"?"true":void 0,onClick:()=>R("all"),children:[r.jsx("span",{className:"pick-name",children:r.jsxs("span",{children:[r.jsx(MC,{size:14,"aria-hidden":!0}),"All patients"]})}),r.jsx("span",{className:"pick-n",children:j.data?Lm(j.data.total):""})]})}),T.map(G=>r.jsx("li",{children:r.jsxs("button",{type:"button","aria-current":c===G.pk?"true":void 0,onClick:()=>R(G.pk),title:G.short_title?`${G.title} (${G.short_title})`:G.title,children:[r.jsx("span",{className:"pick-name",children:G.title}),r.jsx("span",{className:"pick-n",children:Lm(G.patients)})]})},G.pk))]}),te&&r.jsx("p",{className:"pick-note",children:"Loading projects…"}),!te&&A.length>0&&T.length===0&&r.jsxs("p",{className:"pick-note",children:["No project matches “",f,"”."]}),!te&&!j.isError&&A.length===0&&r.jsx("p",{className:"pick-note",children:"No project has a dashboard yet. “All patients” lists every one."})]}),r.jsxs("div",{className:"pick-main",children:[r.jsxs("header",{className:"pick-head",children:[r.jsx("span",{className:"info-kicker",children:(O==null?void 0:O.short_title)??(c==="all"?"Every project":"Project")}),r.jsx("h3",{children:(O==null?void 0:O.title)??"All patients"}),(O==null?void 0:O.description)&&r.jsx("p",{children:O.description})]}),r.jsx("div",{className:"tbar",children:r.jsx(Zu,{value:g,onChange:G=>{v(G),p(0)},label:"Search patients",placeholder:"Search id or disease",shortcut:!1,delay:0})}),r.jsx("div",{ref:P,className:"pick-list",role:"group","aria-label":"Patients","aria-busy":N.isFetching,children:ie?r.jsx("p",{className:"pick-note",children:"The patients could not be loaded. Close this window and try again."}):N.isPending?r.jsx("p",{className:"pick-note",children:"Loading patients…"}):D.length===0?r.jsx("p",{className:"pick-note",children:g?`No patient matches “${g}”.`:"No patients with a dashboard in this project yet."}):D.map((G,X)=>r.jsxs("button",{type:"button",className:"pick-row","data-index":X,"data-active":X===x||void 0,"data-current":G.individual===a||void 0,onMouseEnter:()=>p(X),onClick:()=>Z(G),children:[r.jsx("span",{className:"pick-id mono",children:r.jsx(Il,{text:G.individual,query:g})}),r.jsx("span",{className:"pick-diseases",children:G.diseases.length>0?G.diseases.map(le=>r.jsx("span",{className:"sc-chip",children:r.jsx(Il,{text:le,query:g})},le)):r.jsx("span",{className:"pick-faint",children:"No tumour disease recorded"})}),r.jsx("span",{className:"pick-aside",children:G.individual===a?r.jsxs("span",{className:"pick-here",children:[r.jsx(gy,{size:13,"aria-hidden":!0}),"On this page"]}):r.jsxs(r.Fragment,{children:[r.jsxs("span",{children:[Lm(G.samples)," ",G.samples===1?"sample":"samples"]}),r.jsxs("span",{className:"pick-faint",children:["report ",G.report_version,G.built?`, ${jy(G.built)}`:""]})]})})]},G.individual))}),N.data&&r.jsx(hd,{shown:E.length,total:M.length,noun:["patient","patients"],note:E.length>km?`Showing the first ${km}; search to narrow`:void 0})]})]})}),document.body)}const kR=new Iw({defaultOptions:{queries:{staleTime:6e4,refetchOnWindowFocus:!1}}});function LR(){return r.jsx(vw,{client:kR,children:r.jsxs(ZN,{basename:Wn.basePath,children:[r.jsxs(QN,{children:[r.jsx(Zm,{path:"/",element:r.jsx(QC,{})}),r.jsx(Zm,{path:"/:individual",element:r.jsx(TR,{})})]}),r.jsx(zR,{})]})})}xw.createRoot(document.getElementById("root")).render(r.jsx(C.StrictMode,{children:r.jsx(LR,{})}));
|