@exaudeus/workrail 3.18.0 → 3.18.1
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/README.md +13 -0
- package/dist/console/assets/index-DMaX2-CW.js +28 -0
- package/dist/console/assets/index-ibLhWBmX.css +1 -0
- package/dist/console/index.html +2 -2
- package/dist/infrastructure/storage/workflow-resolution.js +6 -6
- package/dist/manifest.json +30 -30
- package/dist/mcp-server.js +0 -0
- package/dist/types/workflow-source.js +1 -1
- package/dist/v2/durable-core/domain/observation-builder.d.ts +0 -3
- package/dist/v2/durable-core/domain/observation-builder.js +1 -3
- package/dist/v2/durable-core/domain/prompt-renderer.js +5 -1
- package/dist/v2/infra/local/session-summary-provider/index.js +1 -2
- package/dist/v2/projections/resume-ranking.d.ts +0 -1
- package/dist/v2/usecases/console-routes.js +65 -17
- package/dist/v2/usecases/console-service.js +4 -14
- package/dist/v2/usecases/console-types.d.ts +15 -1
- package/dist/v2/usecases/worktree-service.d.ts +1 -0
- package/dist/v2/usecases/worktree-service.js +143 -15
- package/package.json +3 -2
- package/workflows/coding-task-workflow-agentic.lean.v2.json +132 -1
- package/workflows/mr-review-workflow.agentic.v2.json +24 -10
- package/dist/console/assets/index-BZNM03t1.css +0 -1
- package/dist/console/assets/index-BwJelCXK.js +0 -28
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))a(o);new MutationObserver(o=>{for(const l of o)if(l.type==="childList")for(const u of l.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&a(u)}).observe(document,{childList:!0,subtree:!0});function r(o){const l={};return o.integrity&&(l.integrity=o.integrity),o.referrerPolicy&&(l.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?l.credentials="include":o.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function a(o){if(o.ep)return;o.ep=!0;const l=r(o);fetch(o.href,l)}})();function Lc(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var yh={exports:{}},xs={};var Ox;function a2(){if(Ox)return xs;Ox=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function r(a,o,l){var u=null;if(l!==void 0&&(u=""+l),o.key!==void 0&&(u=""+o.key),"key"in o){l={};for(var f in o)f!=="key"&&(l[f]=o[f])}else l=o;return o=l.ref,{$$typeof:e,type:a,key:u,ref:o!==void 0?o:null,props:l}}return xs.Fragment=t,xs.jsx=r,xs.jsxs=r,xs}var jx;function o2(){return jx||(jx=1,yh.exports=a2()),yh.exports}var b=o2(),xh={exports:{}},Me={};var Dx;function s2(){if(Dx)return Me;Dx=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),l=Symbol.for("react.consumer"),u=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),g=Symbol.for("react.activity"),y=Symbol.iterator;function v(z){return z===null||typeof z!="object"?null:(z=y&&z[y]||z["@@iterator"],typeof z=="function"?z:null)}var S={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},C=Object.assign,N={};function w(z,X,R){this.props=z,this.context=X,this.refs=N,this.updater=R||S}w.prototype.isReactComponent={},w.prototype.setState=function(z,X){if(typeof z!="object"&&typeof z!="function"&&z!=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,z,X,"setState")},w.prototype.forceUpdate=function(z){this.updater.enqueueForceUpdate(this,z,"forceUpdate")};function O(){}O.prototype=w.prototype;function _(z,X,R){this.props=z,this.context=X,this.refs=N,this.updater=R||S}var M=_.prototype=new O;M.constructor=_,C(M,w.prototype),M.isPureReactComponent=!0;var I=Array.isArray;function k(){}var D={H:null,A:null,T:null,S:null},U=Object.prototype.hasOwnProperty;function H(z,X,R){var te=R.ref;return{$$typeof:e,type:z,key:X,ref:te!==void 0?te:null,props:R}}function q(z,X){return H(z.type,X,z.props)}function L(z){return typeof z=="object"&&z!==null&&z.$$typeof===e}function P(z){var X={"=":"=0",":":"=2"};return"$"+z.replace(/[=:]/g,function(R){return X[R]})}var K=/\/+/g;function B(z,X){return typeof z=="object"&&z!==null&&z.key!=null?P(""+z.key):X.toString(36)}function V(z){switch(z.status){case"fulfilled":return z.value;case"rejected":throw z.reason;default:switch(typeof z.status=="string"?z.then(k,k):(z.status="pending",z.then(function(X){z.status==="pending"&&(z.status="fulfilled",z.value=X)},function(X){z.status==="pending"&&(z.status="rejected",z.reason=X)})),z.status){case"fulfilled":return z.value;case"rejected":throw z.reason}}throw z}function j(z,X,R,te,ue){var ce=typeof z;(ce==="undefined"||ce==="boolean")&&(z=null);var fe=!1;if(z===null)fe=!0;else switch(ce){case"bigint":case"string":case"number":fe=!0;break;case"object":switch(z.$$typeof){case e:case t:fe=!0;break;case m:return fe=z._init,j(fe(z._payload),X,R,te,ue)}}if(fe)return ue=ue(z),fe=te===""?"."+B(z,0):te,I(ue)?(R="",fe!=null&&(R=fe.replace(K,"$&/")+"/"),j(ue,X,R,"",function(be){return be})):ue!=null&&(L(ue)&&(ue=q(ue,R+(ue.key==null||z&&z.key===ue.key?"":(""+ue.key).replace(K,"$&/")+"/")+fe)),X.push(ue)),1;fe=0;var le=te===""?".":te+":";if(I(z))for(var pe=0;pe<z.length;pe++)te=z[pe],ce=le+B(te,pe),fe+=j(te,X,R,ce,ue);else if(pe=v(z),typeof pe=="function")for(z=pe.call(z),pe=0;!(te=z.next()).done;)te=te.value,ce=le+B(te,pe++),fe+=j(te,X,R,ce,ue);else if(ce==="object"){if(typeof z.then=="function")return j(V(z),X,R,te,ue);throw X=String(z),Error("Objects are not valid as a React child (found: "+(X==="[object Object]"?"object with keys {"+Object.keys(z).join(", ")+"}":X)+"). If you meant to render a collection of children, use an array instead.")}return fe}function F(z,X,R){if(z==null)return z;var te=[],ue=0;return j(z,te,"","",function(ce){return X.call(R,ce,ue++)}),te}function $(z){if(z._status===-1){var X=z._result;X=X(),X.then(function(R){(z._status===0||z._status===-1)&&(z._status=1,z._result=R)},function(R){(z._status===0||z._status===-1)&&(z._status=2,z._result=R)}),z._status===-1&&(z._status=0,z._result=X)}if(z._status===1)return z._result.default;throw z._result}var Z=typeof reportError=="function"?reportError:function(z){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var X=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof z=="object"&&z!==null&&typeof z.message=="string"?String(z.message):String(z),error:z});if(!window.dispatchEvent(X))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",z);return}console.error(z)},A={map:F,forEach:function(z,X,R){F(z,function(){X.apply(this,arguments)},R)},count:function(z){var X=0;return F(z,function(){X++}),X},toArray:function(z){return F(z,function(X){return X})||[]},only:function(z){if(!L(z))throw Error("React.Children.only expected to receive a single React element child.");return z}};return Me.Activity=g,Me.Children=A,Me.Component=w,Me.Fragment=r,Me.Profiler=o,Me.PureComponent=_,Me.StrictMode=a,Me.Suspense=h,Me.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=D,Me.__COMPILER_RUNTIME={__proto__:null,c:function(z){return D.H.useMemoCache(z)}},Me.cache=function(z){return function(){return z.apply(null,arguments)}},Me.cacheSignal=function(){return null},Me.cloneElement=function(z,X,R){if(z==null)throw Error("The argument must be a React element, but you passed "+z+".");var te=C({},z.props),ue=z.key;if(X!=null)for(ce in X.key!==void 0&&(ue=""+X.key),X)!U.call(X,ce)||ce==="key"||ce==="__self"||ce==="__source"||ce==="ref"&&X.ref===void 0||(te[ce]=X[ce]);var ce=arguments.length-2;if(ce===1)te.children=R;else if(1<ce){for(var fe=Array(ce),le=0;le<ce;le++)fe[le]=arguments[le+2];te.children=fe}return H(z.type,ue,te)},Me.createContext=function(z){return z={$$typeof:u,_currentValue:z,_currentValue2:z,_threadCount:0,Provider:null,Consumer:null},z.Provider=z,z.Consumer={$$typeof:l,_context:z},z},Me.createElement=function(z,X,R){var te,ue={},ce=null;if(X!=null)for(te in X.key!==void 0&&(ce=""+X.key),X)U.call(X,te)&&te!=="key"&&te!=="__self"&&te!=="__source"&&(ue[te]=X[te]);var fe=arguments.length-2;if(fe===1)ue.children=R;else if(1<fe){for(var le=Array(fe),pe=0;pe<fe;pe++)le[pe]=arguments[pe+2];ue.children=le}if(z&&z.defaultProps)for(te in fe=z.defaultProps,fe)ue[te]===void 0&&(ue[te]=fe[te]);return H(z,ce,ue)},Me.createRef=function(){return{current:null}},Me.forwardRef=function(z){return{$$typeof:f,render:z}},Me.isValidElement=L,Me.lazy=function(z){return{$$typeof:m,_payload:{_status:-1,_result:z},_init:$}},Me.memo=function(z,X){return{$$typeof:d,type:z,compare:X===void 0?null:X}},Me.startTransition=function(z){var X=D.T,R={};D.T=R;try{var te=z(),ue=D.S;ue!==null&&ue(R,te),typeof te=="object"&&te!==null&&typeof te.then=="function"&&te.then(k,Z)}catch(ce){Z(ce)}finally{X!==null&&R.types!==null&&(X.types=R.types),D.T=X}},Me.unstable_useCacheRefresh=function(){return D.H.useCacheRefresh()},Me.use=function(z){return D.H.use(z)},Me.useActionState=function(z,X,R){return D.H.useActionState(z,X,R)},Me.useCallback=function(z,X){return D.H.useCallback(z,X)},Me.useContext=function(z){return D.H.useContext(z)},Me.useDebugValue=function(){},Me.useDeferredValue=function(z,X){return D.H.useDeferredValue(z,X)},Me.useEffect=function(z,X){return D.H.useEffect(z,X)},Me.useEffectEvent=function(z){return D.H.useEffectEvent(z)},Me.useId=function(){return D.H.useId()},Me.useImperativeHandle=function(z,X,R){return D.H.useImperativeHandle(z,X,R)},Me.useInsertionEffect=function(z,X){return D.H.useInsertionEffect(z,X)},Me.useLayoutEffect=function(z,X){return D.H.useLayoutEffect(z,X)},Me.useMemo=function(z,X){return D.H.useMemo(z,X)},Me.useOptimistic=function(z,X){return D.H.useOptimistic(z,X)},Me.useReducer=function(z,X,R){return D.H.useReducer(z,X,R)},Me.useRef=function(z){return D.H.useRef(z)},Me.useState=function(z){return D.H.useState(z)},Me.useSyncExternalStore=function(z,X,R){return D.H.useSyncExternalStore(z,X,R)},Me.useTransition=function(){return D.H.useTransition()},Me.version="19.2.4",Me}var zx;function sl(){return zx||(zx=1,xh.exports=s2()),xh.exports}var Y=sl();const lo=Lc(Y);var vh={exports:{}},vs={},bh={exports:{}},Sh={};var Lx;function l2(){return Lx||(Lx=1,(function(e){function t(j,F){var $=j.length;j.push(F);e:for(;0<$;){var Z=$-1>>>1,A=j[Z];if(0<o(A,F))j[Z]=F,j[$]=A,$=Z;else break e}}function r(j){return j.length===0?null:j[0]}function a(j){if(j.length===0)return null;var F=j[0],$=j.pop();if($!==F){j[0]=$;e:for(var Z=0,A=j.length,z=A>>>1;Z<z;){var X=2*(Z+1)-1,R=j[X],te=X+1,ue=j[te];if(0>o(R,$))te<A&&0>o(ue,R)?(j[Z]=ue,j[te]=$,Z=te):(j[Z]=R,j[X]=$,Z=X);else if(te<A&&0>o(ue,$))j[Z]=ue,j[te]=$,Z=te;else break e}}return F}function o(j,F){var $=j.sortIndex-F.sortIndex;return $!==0?$:j.id-F.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var l=performance;e.unstable_now=function(){return l.now()}}else{var u=Date,f=u.now();e.unstable_now=function(){return u.now()-f}}var h=[],d=[],m=1,g=null,y=3,v=!1,S=!1,C=!1,N=!1,w=typeof setTimeout=="function"?setTimeout:null,O=typeof clearTimeout=="function"?clearTimeout:null,_=typeof setImmediate<"u"?setImmediate:null;function M(j){for(var F=r(d);F!==null;){if(F.callback===null)a(d);else if(F.startTime<=j)a(d),F.sortIndex=F.expirationTime,t(h,F);else break;F=r(d)}}function I(j){if(C=!1,M(j),!S)if(r(h)!==null)S=!0,k||(k=!0,P());else{var F=r(d);F!==null&&V(I,F.startTime-j)}}var k=!1,D=-1,U=5,H=-1;function q(){return N?!0:!(e.unstable_now()-H<U)}function L(){if(N=!1,k){var j=e.unstable_now();H=j;var F=!0;try{e:{S=!1,C&&(C=!1,O(D),D=-1),v=!0;var $=y;try{t:{for(M(j),g=r(h);g!==null&&!(g.expirationTime>j&&q());){var Z=g.callback;if(typeof Z=="function"){g.callback=null,y=g.priorityLevel;var A=Z(g.expirationTime<=j);if(j=e.unstable_now(),typeof A=="function"){g.callback=A,M(j),F=!0;break t}g===r(h)&&a(h),M(j)}else a(h);g=r(h)}if(g!==null)F=!0;else{var z=r(d);z!==null&&V(I,z.startTime-j),F=!1}}break e}finally{g=null,y=$,v=!1}F=void 0}}finally{F?P():k=!1}}}var P;if(typeof _=="function")P=function(){_(L)};else if(typeof MessageChannel<"u"){var K=new MessageChannel,B=K.port2;K.port1.onmessage=L,P=function(){B.postMessage(null)}}else P=function(){w(L,0)};function V(j,F){D=w(function(){j(e.unstable_now())},F)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(j){j.callback=null},e.unstable_forceFrameRate=function(j){0>j||125<j?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):U=0<j?Math.floor(1e3/j):5},e.unstable_getCurrentPriorityLevel=function(){return y},e.unstable_next=function(j){switch(y){case 1:case 2:case 3:var F=3;break;default:F=y}var $=y;y=F;try{return j()}finally{y=$}},e.unstable_requestPaint=function(){N=!0},e.unstable_runWithPriority=function(j,F){switch(j){case 1:case 2:case 3:case 4:case 5:break;default:j=3}var $=y;y=j;try{return F()}finally{y=$}},e.unstable_scheduleCallback=function(j,F,$){var Z=e.unstable_now();switch(typeof $=="object"&&$!==null?($=$.delay,$=typeof $=="number"&&0<$?Z+$:Z):$=Z,j){case 1:var A=-1;break;case 2:A=250;break;case 5:A=1073741823;break;case 4:A=1e4;break;default:A=5e3}return A=$+A,j={id:m++,callback:F,priorityLevel:j,startTime:$,expirationTime:A,sortIndex:-1},$>Z?(j.sortIndex=$,t(d,j),r(h)===null&&j===r(d)&&(C?(O(D),D=-1):C=!0,V(I,$-Z))):(j.sortIndex=A,t(h,j),S||v||(S=!0,k||(k=!0,P()))),j},e.unstable_shouldYield=q,e.unstable_wrapCallback=function(j){var F=y;return function(){var $=y;y=F;try{return j.apply(this,arguments)}finally{y=$}}}})(Sh)),Sh}var Bx;function u2(){return Bx||(Bx=1,bh.exports=l2()),bh.exports}var wh={exports:{}},zt={};var Ix;function c2(){if(Ix)return zt;Ix=1;var e=sl();function t(h){var d="https://react.dev/errors/"+h;if(1<arguments.length){d+="?args[]="+encodeURIComponent(arguments[1]);for(var m=2;m<arguments.length;m++)d+="&args[]="+encodeURIComponent(arguments[m])}return"Minified React error #"+h+"; visit "+d+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function r(){}var a={d:{f:r,r:function(){throw Error(t(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},o=Symbol.for("react.portal");function l(h,d,m){var g=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:g==null?null:""+g,children:h,containerInfo:d,implementation:m}}var u=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function f(h,d){if(h==="font")return"";if(typeof d=="string")return d==="use-credentials"?d:""}return zt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,zt.createPortal=function(h,d){var m=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!d||d.nodeType!==1&&d.nodeType!==9&&d.nodeType!==11)throw Error(t(299));return l(h,d,null,m)},zt.flushSync=function(h){var d=u.T,m=a.p;try{if(u.T=null,a.p=2,h)return h()}finally{u.T=d,a.p=m,a.d.f()}},zt.preconnect=function(h,d){typeof h=="string"&&(d?(d=d.crossOrigin,d=typeof d=="string"?d==="use-credentials"?d:"":void 0):d=null,a.d.C(h,d))},zt.prefetchDNS=function(h){typeof h=="string"&&a.d.D(h)},zt.preinit=function(h,d){if(typeof h=="string"&&d&&typeof d.as=="string"){var m=d.as,g=f(m,d.crossOrigin),y=typeof d.integrity=="string"?d.integrity:void 0,v=typeof d.fetchPriority=="string"?d.fetchPriority:void 0;m==="style"?a.d.S(h,typeof d.precedence=="string"?d.precedence:void 0,{crossOrigin:g,integrity:y,fetchPriority:v}):m==="script"&&a.d.X(h,{crossOrigin:g,integrity:y,fetchPriority:v,nonce:typeof d.nonce=="string"?d.nonce:void 0})}},zt.preinitModule=function(h,d){if(typeof h=="string")if(typeof d=="object"&&d!==null){if(d.as==null||d.as==="script"){var m=f(d.as,d.crossOrigin);a.d.M(h,{crossOrigin:m,integrity:typeof d.integrity=="string"?d.integrity:void 0,nonce:typeof d.nonce=="string"?d.nonce:void 0})}}else d==null&&a.d.M(h)},zt.preload=function(h,d){if(typeof h=="string"&&typeof d=="object"&&d!==null&&typeof d.as=="string"){var m=d.as,g=f(m,d.crossOrigin);a.d.L(h,m,{crossOrigin:g,integrity:typeof d.integrity=="string"?d.integrity:void 0,nonce:typeof d.nonce=="string"?d.nonce:void 0,type:typeof d.type=="string"?d.type:void 0,fetchPriority:typeof d.fetchPriority=="string"?d.fetchPriority:void 0,referrerPolicy:typeof d.referrerPolicy=="string"?d.referrerPolicy:void 0,imageSrcSet:typeof d.imageSrcSet=="string"?d.imageSrcSet:void 0,imageSizes:typeof d.imageSizes=="string"?d.imageSizes:void 0,media:typeof d.media=="string"?d.media:void 0})}},zt.preloadModule=function(h,d){if(typeof h=="string")if(d){var m=f(d.as,d.crossOrigin);a.d.m(h,{as:typeof d.as=="string"&&d.as!=="script"?d.as:void 0,crossOrigin:m,integrity:typeof d.integrity=="string"?d.integrity:void 0})}else a.d.m(h)},zt.requestFormReset=function(h){a.d.r(h)},zt.unstable_batchedUpdates=function(h,d){return h(d)},zt.useFormState=function(h,d,m){return u.H.useFormState(h,d,m)},zt.useFormStatus=function(){return u.H.useHostTransitionStatus()},zt.version="19.2.4",zt}var Hx;function k1(){if(Hx)return wh.exports;Hx=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),wh.exports=c2(),wh.exports}var Px;function f2(){if(Px)return vs;Px=1;var e=u2(),t=sl(),r=k1();function a(n){var i="https://react.dev/errors/"+n;if(1<arguments.length){i+="?args[]="+encodeURIComponent(arguments[1]);for(var s=2;s<arguments.length;s++)i+="&args[]="+encodeURIComponent(arguments[s])}return"Minified React error #"+n+"; visit "+i+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(n){return!(!n||n.nodeType!==1&&n.nodeType!==9&&n.nodeType!==11)}function l(n){var i=n,s=n;if(n.alternate)for(;i.return;)i=i.return;else{n=i;do i=n,(i.flags&4098)!==0&&(s=i.return),n=i.return;while(n)}return i.tag===3?s:null}function u(n){if(n.tag===13){var i=n.memoizedState;if(i===null&&(n=n.alternate,n!==null&&(i=n.memoizedState)),i!==null)return i.dehydrated}return null}function f(n){if(n.tag===31){var i=n.memoizedState;if(i===null&&(n=n.alternate,n!==null&&(i=n.memoizedState)),i!==null)return i.dehydrated}return null}function h(n){if(l(n)!==n)throw Error(a(188))}function d(n){var i=n.alternate;if(!i){if(i=l(n),i===null)throw Error(a(188));return i!==n?null:n}for(var s=n,c=i;;){var p=s.return;if(p===null)break;var x=p.alternate;if(x===null){if(c=p.return,c!==null){s=c;continue}break}if(p.child===x.child){for(x=p.child;x;){if(x===s)return h(p),n;if(x===c)return h(p),i;x=x.sibling}throw Error(a(188))}if(s.return!==c.return)s=p,c=x;else{for(var E=!1,T=p.child;T;){if(T===s){E=!0,s=p,c=x;break}if(T===c){E=!0,c=p,s=x;break}T=T.sibling}if(!E){for(T=x.child;T;){if(T===s){E=!0,s=x,c=p;break}if(T===c){E=!0,c=x,s=p;break}T=T.sibling}if(!E)throw Error(a(189))}}if(s.alternate!==c)throw Error(a(190))}if(s.tag!==3)throw Error(a(188));return s.stateNode.current===s?n:i}function m(n){var i=n.tag;if(i===5||i===26||i===27||i===6)return n;for(n=n.child;n!==null;){if(i=m(n),i!==null)return i;n=n.sibling}return null}var g=Object.assign,y=Symbol.for("react.element"),v=Symbol.for("react.transitional.element"),S=Symbol.for("react.portal"),C=Symbol.for("react.fragment"),N=Symbol.for("react.strict_mode"),w=Symbol.for("react.profiler"),O=Symbol.for("react.consumer"),_=Symbol.for("react.context"),M=Symbol.for("react.forward_ref"),I=Symbol.for("react.suspense"),k=Symbol.for("react.suspense_list"),D=Symbol.for("react.memo"),U=Symbol.for("react.lazy"),H=Symbol.for("react.activity"),q=Symbol.for("react.memo_cache_sentinel"),L=Symbol.iterator;function P(n){return n===null||typeof n!="object"?null:(n=L&&n[L]||n["@@iterator"],typeof n=="function"?n:null)}var K=Symbol.for("react.client.reference");function B(n){if(n==null)return null;if(typeof n=="function")return n.$$typeof===K?null:n.displayName||n.name||null;if(typeof n=="string")return n;switch(n){case C:return"Fragment";case w:return"Profiler";case N:return"StrictMode";case I:return"Suspense";case k:return"SuspenseList";case H:return"Activity"}if(typeof n=="object")switch(n.$$typeof){case S:return"Portal";case _:return n.displayName||"Context";case O:return(n._context.displayName||"Context")+".Consumer";case M:var i=n.render;return n=n.displayName,n||(n=i.displayName||i.name||"",n=n!==""?"ForwardRef("+n+")":"ForwardRef"),n;case D:return i=n.displayName||null,i!==null?i:B(n.type)||"Memo";case U:i=n._payload,n=n._init;try{return B(n(i))}catch{}}return null}var V=Array.isArray,j=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,F=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,$={pending:!1,data:null,method:null,action:null},Z=[],A=-1;function z(n){return{current:n}}function X(n){0>A||(n.current=Z[A],Z[A]=null,A--)}function R(n,i){A++,Z[A]=n.current,n.current=i}var te=z(null),ue=z(null),ce=z(null),fe=z(null);function le(n,i){switch(R(ce,i),R(ue,n),R(te,null),i.nodeType){case 9:case 11:n=(n=i.documentElement)&&(n=n.namespaceURI)?tx(n):0;break;default:if(n=i.tagName,i=i.namespaceURI)i=tx(i),n=nx(i,n);else switch(n){case"svg":n=1;break;case"math":n=2;break;default:n=0}}X(te),R(te,n)}function pe(){X(te),X(ue),X(ce)}function be(n){n.memoizedState!==null&&R(fe,n);var i=te.current,s=nx(i,n.type);i!==s&&(R(ue,n),R(te,s))}function Se(n){ue.current===n&&(X(te),X(ue)),fe.current===n&&(X(fe),ps._currentValue=$)}var ye,we;function Re(n){if(ye===void 0)try{throw Error()}catch(s){var i=s.stack.trim().match(/\n( *(at )?)/);ye=i&&i[1]||"",we=-1<s.stack.indexOf(`
|
|
2
|
-
at`)?" (<anonymous>)":-1<s.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
3
|
-
`+ye+n+we}var He=!1;function Be(n,i){if(!n||He)return"";He=!0;var s=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var c={DetermineComponentFrameRoot:function(){try{if(i){var se=function(){throw Error()};if(Object.defineProperty(se.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(se,[])}catch(re){var ne=re}Reflect.construct(n,[],se)}else{try{se.call()}catch(re){ne=re}n.call(se.prototype)}}else{try{throw Error()}catch(re){ne=re}(se=n())&&typeof se.catch=="function"&&se.catch(function(){})}}catch(re){if(re&&ne&&typeof re.stack=="string")return[re.stack,ne.stack]}return[null,null]}};c.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var p=Object.getOwnPropertyDescriptor(c.DetermineComponentFrameRoot,"name");p&&p.configurable&&Object.defineProperty(c.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var x=c.DetermineComponentFrameRoot(),E=x[0],T=x[1];if(E&&T){var G=E.split(`
|
|
4
|
-
`),ee=T.split(`
|
|
5
|
-
`);for(p=c=0;c<G.length&&!G[c].includes("DetermineComponentFrameRoot");)c++;for(;p<ee.length&&!ee[p].includes("DetermineComponentFrameRoot");)p++;if(c===G.length||p===ee.length)for(c=G.length-1,p=ee.length-1;1<=c&&0<=p&&G[c]!==ee[p];)p--;for(;1<=c&&0<=p;c--,p--)if(G[c]!==ee[p]){if(c!==1||p!==1)do if(c--,p--,0>p||G[c]!==ee[p]){var ae=`
|
|
6
|
-
`+G[c].replace(" at new "," at ");return n.displayName&&ae.includes("<anonymous>")&&(ae=ae.replace("<anonymous>",n.displayName)),ae}while(1<=c&&0<=p);break}}}finally{He=!1,Error.prepareStackTrace=s}return(s=n?n.displayName||n.name:"")?Re(s):""}function Qe(n,i){switch(n.tag){case 26:case 27:case 5:return Re(n.type);case 16:return Re("Lazy");case 13:return n.child!==i&&i!==null?Re("Suspense Fallback"):Re("Suspense");case 19:return Re("SuspenseList");case 0:case 15:return Be(n.type,!1);case 11:return Be(n.type.render,!1);case 1:return Be(n.type,!0);case 31:return Re("Activity");default:return""}}function _t(n){try{var i="",s=null;do i+=Qe(n,s),s=n,n=n.return;while(n);return i}catch(c){return`
|
|
7
|
-
Error generating stack: `+c.message+`
|
|
8
|
-
`+c.stack}}var it=Object.prototype.hasOwnProperty,Ot=e.unstable_scheduleCallback,qt=e.unstable_cancelCallback,An=e.unstable_shouldYield,vn=e.unstable_requestPaint,Ne=e.unstable_now,ut=e.unstable_getCurrentPriorityLevel,ie=e.unstable_ImmediatePriority,he=e.unstable_UserBlockingPriority,Ee=e.unstable_NormalPriority,Oe=e.unstable_LowPriority,Pe=e.unstable_IdlePriority,It=e.log,Rn=e.unstable_setDisableYieldValue,Nt=null,dt=null;function jt(n){if(typeof It=="function"&&Rn(n),dt&&typeof dt.setStrictMode=="function")try{dt.setStrictMode(Nt,n)}catch{}}var Xe=Math.clz32?Math.clz32:af,Un=Math.log,on=Math.LN2;function af(n){return n>>>=0,n===0?32:31-(Un(n)/on|0)|0}var sa=256,la=262144,ua=4194304;function nr(n){var i=n&42;if(i!==0)return i;switch(n&-n){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 n&261888;case 262144:case 524288:case 1048576:case 2097152:return n&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return n&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return n}}function ca(n,i,s){var c=n.pendingLanes;if(c===0)return 0;var p=0,x=n.suspendedLanes,E=n.pingedLanes;n=n.warmLanes;var T=c&134217727;return T!==0?(c=T&~x,c!==0?p=nr(c):(E&=T,E!==0?p=nr(E):s||(s=T&~n,s!==0&&(p=nr(s))))):(T=c&~x,T!==0?p=nr(T):E!==0?p=nr(E):s||(s=c&~n,s!==0&&(p=nr(s)))),p===0?0:i!==0&&i!==p&&(i&x)===0&&(x=p&-p,s=i&-i,x>=s||x===32&&(s&4194048)!==0)?i:p}function yi(n,i){return(n.pendingLanes&~(n.suspendedLanes&~n.pingedLanes)&i)===0}function of(n,i){switch(n){case 1:case 2:case 4:case 8:case 64:return i+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 i+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 xl(){var n=ua;return ua<<=1,(ua&62914560)===0&&(ua=4194304),n}function _o(n){for(var i=[],s=0;31>s;s++)i.push(n);return i}function xi(n,i){n.pendingLanes|=i,i!==268435456&&(n.suspendedLanes=0,n.pingedLanes=0,n.warmLanes=0)}function sf(n,i,s,c,p,x){var E=n.pendingLanes;n.pendingLanes=s,n.suspendedLanes=0,n.pingedLanes=0,n.warmLanes=0,n.expiredLanes&=s,n.entangledLanes&=s,n.errorRecoveryDisabledLanes&=s,n.shellSuspendCounter=0;var T=n.entanglements,G=n.expirationTimes,ee=n.hiddenUpdates;for(s=E&~s;0<s;){var ae=31-Xe(s),se=1<<ae;T[ae]=0,G[ae]=-1;var ne=ee[ae];if(ne!==null)for(ee[ae]=null,ae=0;ae<ne.length;ae++){var re=ne[ae];re!==null&&(re.lane&=-536870913)}s&=~se}c!==0&&vl(n,c,0),x!==0&&p===0&&n.tag!==0&&(n.suspendedLanes|=x&~(E&~i))}function vl(n,i,s){n.pendingLanes|=i,n.suspendedLanes&=~i;var c=31-Xe(i);n.entangledLanes|=i,n.entanglements[c]=n.entanglements[c]|1073741824|s&261930}function bl(n,i){var s=n.entangledLanes|=i;for(n=n.entanglements;s;){var c=31-Xe(s),p=1<<c;p&i|n[c]&i&&(n[c]|=i),s&=~p}}function Sl(n,i){var s=i&-i;return s=(s&42)!==0?1:No(s),(s&(n.suspendedLanes|i))!==0?0:s}function No(n){switch(n){case 2:n=1;break;case 8:n=4;break;case 32:n=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:n=128;break;case 268435456:n=134217728;break;default:n=0}return n}function Mo(n){return n&=-n,2<n?8<n?(n&134217727)!==0?32:268435456:8:2}function wl(){var n=F.p;return n!==0?n:(n=window.event,n===void 0?32:_x(n.type))}function El(n,i){var s=F.p;try{return F.p=n,i()}finally{F.p=s}}var qn=Math.random().toString(36).slice(2),wt="__reactFiber$"+qn,Dt="__reactProps$"+qn,rr="__reactContainer$"+qn,fa="__reactEvents$"+qn,Cl="__reactListeners$"+qn,lf="__reactHandles$"+qn,_l="__reactResources$"+qn,vi="__reactMarker$"+qn;function ko(n){delete n[wt],delete n[Dt],delete n[fa],delete n[Cl],delete n[lf]}function Ar(n){var i=n[wt];if(i)return i;for(var s=n.parentNode;s;){if(i=s[rr]||s[wt]){if(s=i.alternate,i.child!==null||s!==null&&s.child!==null)for(n=ux(n);n!==null;){if(s=n[wt])return s;n=ux(n)}return i}n=s,s=n.parentNode}return null}function Rr(n){if(n=n[wt]||n[rr]){var i=n.tag;if(i===5||i===6||i===13||i===31||i===26||i===27||i===3)return n}return null}function Or(n){var i=n.tag;if(i===5||i===26||i===27||i===6)return n.stateNode;throw Error(a(33))}function jr(n){var i=n[_l];return i||(i=n[_l]={hoistableStyles:new Map,hoistableScripts:new Map}),i}function mt(n){n[vi]=!0}var Nl=new Set,Ml={};function ir(n,i){Dr(n,i),Dr(n+"Capture",i)}function Dr(n,i){for(Ml[n]=i,n=0;n<i.length;n++)Nl.add(i[n])}var uf=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]*$"),To={},kl={};function cf(n){return it.call(kl,n)?!0:it.call(To,n)?!1:uf.test(n)?kl[n]=!0:(To[n]=!0,!1)}function da(n,i,s){if(cf(i))if(s===null)n.removeAttribute(i);else{switch(typeof s){case"undefined":case"function":case"symbol":n.removeAttribute(i);return;case"boolean":var c=i.toLowerCase().slice(0,5);if(c!=="data-"&&c!=="aria-"){n.removeAttribute(i);return}}n.setAttribute(i,""+s)}}function ha(n,i,s){if(s===null)n.removeAttribute(i);else{switch(typeof s){case"undefined":case"function":case"symbol":case"boolean":n.removeAttribute(i);return}n.setAttribute(i,""+s)}}function On(n,i,s,c){if(c===null)n.removeAttribute(s);else{switch(typeof c){case"undefined":case"function":case"symbol":case"boolean":n.removeAttribute(s);return}n.setAttributeNS(i,s,""+c)}}function Vt(n){switch(typeof n){case"bigint":case"boolean":case"number":case"string":case"undefined":return n;case"object":return n;default:return""}}function Tl(n){var i=n.type;return(n=n.nodeName)&&n.toLowerCase()==="input"&&(i==="checkbox"||i==="radio")}function ff(n,i,s){var c=Object.getOwnPropertyDescriptor(n.constructor.prototype,i);if(!n.hasOwnProperty(i)&&typeof c<"u"&&typeof c.get=="function"&&typeof c.set=="function"){var p=c.get,x=c.set;return Object.defineProperty(n,i,{configurable:!0,get:function(){return p.call(this)},set:function(E){s=""+E,x.call(this,E)}}),Object.defineProperty(n,i,{enumerable:c.enumerable}),{getValue:function(){return s},setValue:function(E){s=""+E},stopTracking:function(){n._valueTracker=null,delete n[i]}}}}function pa(n){if(!n._valueTracker){var i=Tl(n)?"checked":"value";n._valueTracker=ff(n,i,""+n[i])}}function Al(n){if(!n)return!1;var i=n._valueTracker;if(!i)return!0;var s=i.getValue(),c="";return n&&(c=Tl(n)?n.checked?"true":"false":n.value),n=c,n!==s?(i.setValue(n),!0):!1}function bi(n){if(n=n||(typeof document<"u"?document:void 0),typeof n>"u")return null;try{return n.activeElement||n.body}catch{return n.body}}var df=/[\n"\\]/g;function Ft(n){return n.replace(df,function(i){return"\\"+i.charCodeAt(0).toString(16)+" "})}function Si(n,i,s,c,p,x,E,T){n.name="",E!=null&&typeof E!="function"&&typeof E!="symbol"&&typeof E!="boolean"?n.type=E:n.removeAttribute("type"),i!=null?E==="number"?(i===0&&n.value===""||n.value!=i)&&(n.value=""+Vt(i)):n.value!==""+Vt(i)&&(n.value=""+Vt(i)):E!=="submit"&&E!=="reset"||n.removeAttribute("value"),i!=null?Ao(n,E,Vt(i)):s!=null?Ao(n,E,Vt(s)):c!=null&&n.removeAttribute("value"),p==null&&x!=null&&(n.defaultChecked=!!x),p!=null&&(n.checked=p&&typeof p!="function"&&typeof p!="symbol"),T!=null&&typeof T!="function"&&typeof T!="symbol"&&typeof T!="boolean"?n.name=""+Vt(T):n.removeAttribute("name")}function Rl(n,i,s,c,p,x,E,T){if(x!=null&&typeof x!="function"&&typeof x!="symbol"&&typeof x!="boolean"&&(n.type=x),i!=null||s!=null){if(!(x!=="submit"&&x!=="reset"||i!=null)){pa(n);return}s=s!=null?""+Vt(s):"",i=i!=null?""+Vt(i):s,T||i===n.value||(n.value=i),n.defaultValue=i}c=c??p,c=typeof c!="function"&&typeof c!="symbol"&&!!c,n.checked=T?n.checked:!!c,n.defaultChecked=!!c,E!=null&&typeof E!="function"&&typeof E!="symbol"&&typeof E!="boolean"&&(n.name=E),pa(n)}function Ao(n,i,s){i==="number"&&bi(n.ownerDocument)===n||n.defaultValue===""+s||(n.defaultValue=""+s)}function ar(n,i,s,c){if(n=n.options,i){i={};for(var p=0;p<s.length;p++)i["$"+s[p]]=!0;for(s=0;s<n.length;s++)p=i.hasOwnProperty("$"+n[s].value),n[s].selected!==p&&(n[s].selected=p),p&&c&&(n[s].defaultSelected=!0)}else{for(s=""+Vt(s),i=null,p=0;p<n.length;p++){if(n[p].value===s){n[p].selected=!0,c&&(n[p].defaultSelected=!0);return}i!==null||n[p].disabled||(i=n[p])}i!==null&&(i.selected=!0)}}function Zm(n,i,s){if(i!=null&&(i=""+Vt(i),i!==n.value&&(n.value=i),s==null)){n.defaultValue!==i&&(n.defaultValue=i);return}n.defaultValue=s!=null?""+Vt(s):""}function Km(n,i,s,c){if(i==null){if(c!=null){if(s!=null)throw Error(a(92));if(V(c)){if(1<c.length)throw Error(a(93));c=c[0]}s=c}s==null&&(s=""),i=s}s=Vt(i),n.defaultValue=s,c=n.textContent,c===s&&c!==""&&c!==null&&(n.value=c),pa(n)}function ma(n,i){if(i){var s=n.firstChild;if(s&&s===n.lastChild&&s.nodeType===3){s.nodeValue=i;return}}n.textContent=i}var eC=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 Jm(n,i,s){var c=i.indexOf("--")===0;s==null||typeof s=="boolean"||s===""?c?n.setProperty(i,""):i==="float"?n.cssFloat="":n[i]="":c?n.setProperty(i,s):typeof s!="number"||s===0||eC.has(i)?i==="float"?n.cssFloat=s:n[i]=(""+s).trim():n[i]=s+"px"}function Wm(n,i,s){if(i!=null&&typeof i!="object")throw Error(a(62));if(n=n.style,s!=null){for(var c in s)!s.hasOwnProperty(c)||i!=null&&i.hasOwnProperty(c)||(c.indexOf("--")===0?n.setProperty(c,""):c==="float"?n.cssFloat="":n[c]="");for(var p in i)c=i[p],i.hasOwnProperty(p)&&s[p]!==c&&Jm(n,p,c)}else for(var x in i)i.hasOwnProperty(x)&&Jm(n,x,i[x])}function hf(n){if(n.indexOf("-")===-1)return!1;switch(n){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 tC=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),nC=/^[\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 Ol(n){return nC.test(""+n)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":n}function or(){}var pf=null;function mf(n){return n=n.target||n.srcElement||window,n.correspondingUseElement&&(n=n.correspondingUseElement),n.nodeType===3?n.parentNode:n}var ga=null,ya=null;function eg(n){var i=Rr(n);if(i&&(n=i.stateNode)){var s=n[Dt]||null;e:switch(n=i.stateNode,i.type){case"input":if(Si(n,s.value,s.defaultValue,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name),i=s.name,s.type==="radio"&&i!=null){for(s=n;s.parentNode;)s=s.parentNode;for(s=s.querySelectorAll('input[name="'+Ft(""+i)+'"][type="radio"]'),i=0;i<s.length;i++){var c=s[i];if(c!==n&&c.form===n.form){var p=c[Dt]||null;if(!p)throw Error(a(90));Si(c,p.value,p.defaultValue,p.defaultValue,p.checked,p.defaultChecked,p.type,p.name)}}for(i=0;i<s.length;i++)c=s[i],c.form===n.form&&Al(c)}break e;case"textarea":Zm(n,s.value,s.defaultValue);break e;case"select":i=s.value,i!=null&&ar(n,!!s.multiple,i,!1)}}}var gf=!1;function tg(n,i,s){if(gf)return n(i,s);gf=!0;try{var c=n(i);return c}finally{if(gf=!1,(ga!==null||ya!==null)&&(vu(),ga&&(i=ga,n=ya,ya=ga=null,eg(i),n)))for(i=0;i<n.length;i++)eg(n[i])}}function Ro(n,i){var s=n.stateNode;if(s===null)return null;var c=s[Dt]||null;if(c===null)return null;s=c[i];e:switch(i){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(c=!c.disabled)||(n=n.type,c=!(n==="button"||n==="input"||n==="select"||n==="textarea")),n=!c;break e;default:n=!1}if(n)return null;if(s&&typeof s!="function")throw Error(a(231,i,typeof s));return s}var sr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),yf=!1;if(sr)try{var Oo={};Object.defineProperty(Oo,"passive",{get:function(){yf=!0}}),window.addEventListener("test",Oo,Oo),window.removeEventListener("test",Oo,Oo)}catch{yf=!1}var zr=null,xf=null,jl=null;function ng(){if(jl)return jl;var n,i=xf,s=i.length,c,p="value"in zr?zr.value:zr.textContent,x=p.length;for(n=0;n<s&&i[n]===p[n];n++);var E=s-n;for(c=1;c<=E&&i[s-c]===p[x-c];c++);return jl=p.slice(n,1<c?1-c:void 0)}function Dl(n){var i=n.keyCode;return"charCode"in n?(n=n.charCode,n===0&&i===13&&(n=13)):n=i,n===10&&(n=13),32<=n||n===13?n:0}function zl(){return!0}function rg(){return!1}function Yt(n){function i(s,c,p,x,E){this._reactName=s,this._targetInst=p,this.type=c,this.nativeEvent=x,this.target=E,this.currentTarget=null;for(var T in n)n.hasOwnProperty(T)&&(s=n[T],this[T]=s?s(x):x[T]);return this.isDefaultPrevented=(x.defaultPrevented!=null?x.defaultPrevented:x.returnValue===!1)?zl:rg,this.isPropagationStopped=rg,this}return g(i.prototype,{preventDefault:function(){this.defaultPrevented=!0;var s=this.nativeEvent;s&&(s.preventDefault?s.preventDefault():typeof s.returnValue!="unknown"&&(s.returnValue=!1),this.isDefaultPrevented=zl)},stopPropagation:function(){var s=this.nativeEvent;s&&(s.stopPropagation?s.stopPropagation():typeof s.cancelBubble!="unknown"&&(s.cancelBubble=!0),this.isPropagationStopped=zl)},persist:function(){},isPersistent:zl}),i}var wi={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(n){return n.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Ll=Yt(wi),jo=g({},wi,{view:0,detail:0}),rC=Yt(jo),vf,bf,Do,Bl=g({},jo,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:wf,button:0,buttons:0,relatedTarget:function(n){return n.relatedTarget===void 0?n.fromElement===n.srcElement?n.toElement:n.fromElement:n.relatedTarget},movementX:function(n){return"movementX"in n?n.movementX:(n!==Do&&(Do&&n.type==="mousemove"?(vf=n.screenX-Do.screenX,bf=n.screenY-Do.screenY):bf=vf=0,Do=n),vf)},movementY:function(n){return"movementY"in n?n.movementY:bf}}),ig=Yt(Bl),iC=g({},Bl,{dataTransfer:0}),aC=Yt(iC),oC=g({},jo,{relatedTarget:0}),Sf=Yt(oC),sC=g({},wi,{animationName:0,elapsedTime:0,pseudoElement:0}),lC=Yt(sC),uC=g({},wi,{clipboardData:function(n){return"clipboardData"in n?n.clipboardData:window.clipboardData}}),cC=Yt(uC),fC=g({},wi,{data:0}),ag=Yt(fC),dC={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},hC={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"},pC={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function mC(n){var i=this.nativeEvent;return i.getModifierState?i.getModifierState(n):(n=pC[n])?!!i[n]:!1}function wf(){return mC}var gC=g({},jo,{key:function(n){if(n.key){var i=dC[n.key]||n.key;if(i!=="Unidentified")return i}return n.type==="keypress"?(n=Dl(n),n===13?"Enter":String.fromCharCode(n)):n.type==="keydown"||n.type==="keyup"?hC[n.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:wf,charCode:function(n){return n.type==="keypress"?Dl(n):0},keyCode:function(n){return n.type==="keydown"||n.type==="keyup"?n.keyCode:0},which:function(n){return n.type==="keypress"?Dl(n):n.type==="keydown"||n.type==="keyup"?n.keyCode:0}}),yC=Yt(gC),xC=g({},Bl,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),og=Yt(xC),vC=g({},jo,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:wf}),bC=Yt(vC),SC=g({},wi,{propertyName:0,elapsedTime:0,pseudoElement:0}),wC=Yt(SC),EC=g({},Bl,{deltaX:function(n){return"deltaX"in n?n.deltaX:"wheelDeltaX"in n?-n.wheelDeltaX:0},deltaY:function(n){return"deltaY"in n?n.deltaY:"wheelDeltaY"in n?-n.wheelDeltaY:"wheelDelta"in n?-n.wheelDelta:0},deltaZ:0,deltaMode:0}),CC=Yt(EC),_C=g({},wi,{newState:0,oldState:0}),NC=Yt(_C),MC=[9,13,27,32],Ef=sr&&"CompositionEvent"in window,zo=null;sr&&"documentMode"in document&&(zo=document.documentMode);var kC=sr&&"TextEvent"in window&&!zo,sg=sr&&(!Ef||zo&&8<zo&&11>=zo),lg=" ",ug=!1;function cg(n,i){switch(n){case"keyup":return MC.indexOf(i.keyCode)!==-1;case"keydown":return i.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function fg(n){return n=n.detail,typeof n=="object"&&"data"in n?n.data:null}var xa=!1;function TC(n,i){switch(n){case"compositionend":return fg(i);case"keypress":return i.which!==32?null:(ug=!0,lg);case"textInput":return n=i.data,n===lg&&ug?null:n;default:return null}}function AC(n,i){if(xa)return n==="compositionend"||!Ef&&cg(n,i)?(n=ng(),jl=xf=zr=null,xa=!1,n):null;switch(n){case"paste":return null;case"keypress":if(!(i.ctrlKey||i.altKey||i.metaKey)||i.ctrlKey&&i.altKey){if(i.char&&1<i.char.length)return i.char;if(i.which)return String.fromCharCode(i.which)}return null;case"compositionend":return sg&&i.locale!=="ko"?null:i.data;default:return null}}var RC={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 dg(n){var i=n&&n.nodeName&&n.nodeName.toLowerCase();return i==="input"?!!RC[n.type]:i==="textarea"}function hg(n,i,s,c){ga?ya?ya.push(c):ya=[c]:ga=c,i=Nu(i,"onChange"),0<i.length&&(s=new Ll("onChange","change",null,s,c),n.push({event:s,listeners:i}))}var Lo=null,Bo=null;function OC(n){Q0(n,0)}function Il(n){var i=Or(n);if(Al(i))return n}function pg(n,i){if(n==="change")return i}var mg=!1;if(sr){var Cf;if(sr){var _f="oninput"in document;if(!_f){var gg=document.createElement("div");gg.setAttribute("oninput","return;"),_f=typeof gg.oninput=="function"}Cf=_f}else Cf=!1;mg=Cf&&(!document.documentMode||9<document.documentMode)}function yg(){Lo&&(Lo.detachEvent("onpropertychange",xg),Bo=Lo=null)}function xg(n){if(n.propertyName==="value"&&Il(Bo)){var i=[];hg(i,Bo,n,mf(n)),tg(OC,i)}}function jC(n,i,s){n==="focusin"?(yg(),Lo=i,Bo=s,Lo.attachEvent("onpropertychange",xg)):n==="focusout"&&yg()}function DC(n){if(n==="selectionchange"||n==="keyup"||n==="keydown")return Il(Bo)}function zC(n,i){if(n==="click")return Il(i)}function LC(n,i){if(n==="input"||n==="change")return Il(i)}function BC(n,i){return n===i&&(n!==0||1/n===1/i)||n!==n&&i!==i}var sn=typeof Object.is=="function"?Object.is:BC;function Io(n,i){if(sn(n,i))return!0;if(typeof n!="object"||n===null||typeof i!="object"||i===null)return!1;var s=Object.keys(n),c=Object.keys(i);if(s.length!==c.length)return!1;for(c=0;c<s.length;c++){var p=s[c];if(!it.call(i,p)||!sn(n[p],i[p]))return!1}return!0}function vg(n){for(;n&&n.firstChild;)n=n.firstChild;return n}function bg(n,i){var s=vg(n);n=0;for(var c;s;){if(s.nodeType===3){if(c=n+s.textContent.length,n<=i&&c>=i)return{node:s,offset:i-n};n=c}e:{for(;s;){if(s.nextSibling){s=s.nextSibling;break e}s=s.parentNode}s=void 0}s=vg(s)}}function Sg(n,i){return n&&i?n===i?!0:n&&n.nodeType===3?!1:i&&i.nodeType===3?Sg(n,i.parentNode):"contains"in n?n.contains(i):n.compareDocumentPosition?!!(n.compareDocumentPosition(i)&16):!1:!1}function wg(n){n=n!=null&&n.ownerDocument!=null&&n.ownerDocument.defaultView!=null?n.ownerDocument.defaultView:window;for(var i=bi(n.document);i instanceof n.HTMLIFrameElement;){try{var s=typeof i.contentWindow.location.href=="string"}catch{s=!1}if(s)n=i.contentWindow;else break;i=bi(n.document)}return i}function Nf(n){var i=n&&n.nodeName&&n.nodeName.toLowerCase();return i&&(i==="input"&&(n.type==="text"||n.type==="search"||n.type==="tel"||n.type==="url"||n.type==="password")||i==="textarea"||n.contentEditable==="true")}var IC=sr&&"documentMode"in document&&11>=document.documentMode,va=null,Mf=null,Ho=null,kf=!1;function Eg(n,i,s){var c=s.window===s?s.document:s.nodeType===9?s:s.ownerDocument;kf||va==null||va!==bi(c)||(c=va,"selectionStart"in c&&Nf(c)?c={start:c.selectionStart,end:c.selectionEnd}:(c=(c.ownerDocument&&c.ownerDocument.defaultView||window).getSelection(),c={anchorNode:c.anchorNode,anchorOffset:c.anchorOffset,focusNode:c.focusNode,focusOffset:c.focusOffset}),Ho&&Io(Ho,c)||(Ho=c,c=Nu(Mf,"onSelect"),0<c.length&&(i=new Ll("onSelect","select",null,i,s),n.push({event:i,listeners:c}),i.target=va)))}function Ei(n,i){var s={};return s[n.toLowerCase()]=i.toLowerCase(),s["Webkit"+n]="webkit"+i,s["Moz"+n]="moz"+i,s}var ba={animationend:Ei("Animation","AnimationEnd"),animationiteration:Ei("Animation","AnimationIteration"),animationstart:Ei("Animation","AnimationStart"),transitionrun:Ei("Transition","TransitionRun"),transitionstart:Ei("Transition","TransitionStart"),transitioncancel:Ei("Transition","TransitionCancel"),transitionend:Ei("Transition","TransitionEnd")},Tf={},Cg={};sr&&(Cg=document.createElement("div").style,"AnimationEvent"in window||(delete ba.animationend.animation,delete ba.animationiteration.animation,delete ba.animationstart.animation),"TransitionEvent"in window||delete ba.transitionend.transition);function Ci(n){if(Tf[n])return Tf[n];if(!ba[n])return n;var i=ba[n],s;for(s in i)if(i.hasOwnProperty(s)&&s in Cg)return Tf[n]=i[s];return n}var _g=Ci("animationend"),Ng=Ci("animationiteration"),Mg=Ci("animationstart"),HC=Ci("transitionrun"),PC=Ci("transitionstart"),UC=Ci("transitioncancel"),kg=Ci("transitionend"),Tg=new Map,Af="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");Af.push("scrollEnd");function jn(n,i){Tg.set(n,i),ir(i,[n])}var Hl=typeof reportError=="function"?reportError:function(n){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var i=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof n=="object"&&n!==null&&typeof n.message=="string"?String(n.message):String(n),error:n});if(!window.dispatchEvent(i))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",n);return}console.error(n)},bn=[],Sa=0,Rf=0;function Pl(){for(var n=Sa,i=Rf=Sa=0;i<n;){var s=bn[i];bn[i++]=null;var c=bn[i];bn[i++]=null;var p=bn[i];bn[i++]=null;var x=bn[i];if(bn[i++]=null,c!==null&&p!==null){var E=c.pending;E===null?p.next=p:(p.next=E.next,E.next=p),c.pending=p}x!==0&&Ag(s,p,x)}}function Ul(n,i,s,c){bn[Sa++]=n,bn[Sa++]=i,bn[Sa++]=s,bn[Sa++]=c,Rf|=c,n.lanes|=c,n=n.alternate,n!==null&&(n.lanes|=c)}function Of(n,i,s,c){return Ul(n,i,s,c),ql(n)}function _i(n,i){return Ul(n,null,null,i),ql(n)}function Ag(n,i,s){n.lanes|=s;var c=n.alternate;c!==null&&(c.lanes|=s);for(var p=!1,x=n.return;x!==null;)x.childLanes|=s,c=x.alternate,c!==null&&(c.childLanes|=s),x.tag===22&&(n=x.stateNode,n===null||n._visibility&1||(p=!0)),n=x,x=x.return;return n.tag===3?(x=n.stateNode,p&&i!==null&&(p=31-Xe(s),n=x.hiddenUpdates,c=n[p],c===null?n[p]=[i]:c.push(i),i.lane=s|536870912),x):null}function ql(n){if(50<ss)throw ss=0,Ud=null,Error(a(185));for(var i=n.return;i!==null;)n=i,i=n.return;return n.tag===3?n.stateNode:null}var wa={};function qC(n,i,s,c){this.tag=n,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=i,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=c,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ln(n,i,s,c){return new qC(n,i,s,c)}function jf(n){return n=n.prototype,!(!n||!n.isReactComponent)}function lr(n,i){var s=n.alternate;return s===null?(s=ln(n.tag,i,n.key,n.mode),s.elementType=n.elementType,s.type=n.type,s.stateNode=n.stateNode,s.alternate=n,n.alternate=s):(s.pendingProps=i,s.type=n.type,s.flags=0,s.subtreeFlags=0,s.deletions=null),s.flags=n.flags&65011712,s.childLanes=n.childLanes,s.lanes=n.lanes,s.child=n.child,s.memoizedProps=n.memoizedProps,s.memoizedState=n.memoizedState,s.updateQueue=n.updateQueue,i=n.dependencies,s.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext},s.sibling=n.sibling,s.index=n.index,s.ref=n.ref,s.refCleanup=n.refCleanup,s}function Rg(n,i){n.flags&=65011714;var s=n.alternate;return s===null?(n.childLanes=0,n.lanes=i,n.child=null,n.subtreeFlags=0,n.memoizedProps=null,n.memoizedState=null,n.updateQueue=null,n.dependencies=null,n.stateNode=null):(n.childLanes=s.childLanes,n.lanes=s.lanes,n.child=s.child,n.subtreeFlags=0,n.deletions=null,n.memoizedProps=s.memoizedProps,n.memoizedState=s.memoizedState,n.updateQueue=s.updateQueue,n.type=s.type,i=s.dependencies,n.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext}),n}function Vl(n,i,s,c,p,x){var E=0;if(c=n,typeof n=="function")jf(n)&&(E=1);else if(typeof n=="string")E=G_(n,s,te.current)?26:n==="html"||n==="head"||n==="body"?27:5;else e:switch(n){case H:return n=ln(31,s,i,p),n.elementType=H,n.lanes=x,n;case C:return Ni(s.children,p,x,i);case N:E=8,p|=24;break;case w:return n=ln(12,s,i,p|2),n.elementType=w,n.lanes=x,n;case I:return n=ln(13,s,i,p),n.elementType=I,n.lanes=x,n;case k:return n=ln(19,s,i,p),n.elementType=k,n.lanes=x,n;default:if(typeof n=="object"&&n!==null)switch(n.$$typeof){case _:E=10;break e;case O:E=9;break e;case M:E=11;break e;case D:E=14;break e;case U:E=16,c=null;break e}E=29,s=Error(a(130,n===null?"null":typeof n,"")),c=null}return i=ln(E,s,i,p),i.elementType=n,i.type=c,i.lanes=x,i}function Ni(n,i,s,c){return n=ln(7,n,c,i),n.lanes=s,n}function Df(n,i,s){return n=ln(6,n,null,i),n.lanes=s,n}function Og(n){var i=ln(18,null,null,0);return i.stateNode=n,i}function zf(n,i,s){return i=ln(4,n.children!==null?n.children:[],n.key,i),i.lanes=s,i.stateNode={containerInfo:n.containerInfo,pendingChildren:null,implementation:n.implementation},i}var jg=new WeakMap;function Sn(n,i){if(typeof n=="object"&&n!==null){var s=jg.get(n);return s!==void 0?s:(i={value:n,source:i,stack:_t(i)},jg.set(n,i),i)}return{value:n,source:i,stack:_t(i)}}var Ea=[],Ca=0,Fl=null,Po=0,wn=[],En=0,Lr=null,Vn=1,Fn="";function ur(n,i){Ea[Ca++]=Po,Ea[Ca++]=Fl,Fl=n,Po=i}function Dg(n,i,s){wn[En++]=Vn,wn[En++]=Fn,wn[En++]=Lr,Lr=n;var c=Vn;n=Fn;var p=32-Xe(c)-1;c&=~(1<<p),s+=1;var x=32-Xe(i)+p;if(30<x){var E=p-p%5;x=(c&(1<<E)-1).toString(32),c>>=E,p-=E,Vn=1<<32-Xe(i)+p|s<<p|c,Fn=x+n}else Vn=1<<x|s<<p|c,Fn=n}function Lf(n){n.return!==null&&(ur(n,1),Dg(n,1,0))}function Bf(n){for(;n===Fl;)Fl=Ea[--Ca],Ea[Ca]=null,Po=Ea[--Ca],Ea[Ca]=null;for(;n===Lr;)Lr=wn[--En],wn[En]=null,Fn=wn[--En],wn[En]=null,Vn=wn[--En],wn[En]=null}function zg(n,i){wn[En++]=Vn,wn[En++]=Fn,wn[En++]=Lr,Vn=i.id,Fn=i.overflow,Lr=n}var Mt=null,nt=null,Ie=!1,Br=null,Cn=!1,If=Error(a(519));function Ir(n){var i=Error(a(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Uo(Sn(i,n)),If}function Lg(n){var i=n.stateNode,s=n.type,c=n.memoizedProps;switch(i[wt]=n,i[Dt]=c,s){case"dialog":De("cancel",i),De("close",i);break;case"iframe":case"object":case"embed":De("load",i);break;case"video":case"audio":for(s=0;s<us.length;s++)De(us[s],i);break;case"source":De("error",i);break;case"img":case"image":case"link":De("error",i),De("load",i);break;case"details":De("toggle",i);break;case"input":De("invalid",i),Rl(i,c.value,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name,!0);break;case"select":De("invalid",i);break;case"textarea":De("invalid",i),Km(i,c.value,c.defaultValue,c.children)}s=c.children,typeof s!="string"&&typeof s!="number"&&typeof s!="bigint"||i.textContent===""+s||c.suppressHydrationWarning===!0||W0(i.textContent,s)?(c.popover!=null&&(De("beforetoggle",i),De("toggle",i)),c.onScroll!=null&&De("scroll",i),c.onScrollEnd!=null&&De("scrollend",i),c.onClick!=null&&(i.onclick=or),i=!0):i=!1,i||Ir(n,!0)}function Bg(n){for(Mt=n.return;Mt;)switch(Mt.tag){case 5:case 31:case 13:Cn=!1;return;case 27:case 3:Cn=!0;return;default:Mt=Mt.return}}function _a(n){if(n!==Mt)return!1;if(!Ie)return Bg(n),Ie=!0,!1;var i=n.tag,s;if((s=i!==3&&i!==27)&&((s=i===5)&&(s=n.type,s=!(s!=="form"&&s!=="button")||nh(n.type,n.memoizedProps)),s=!s),s&&nt&&Ir(n),Bg(n),i===13){if(n=n.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(a(317));nt=lx(n)}else if(i===31){if(n=n.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(a(317));nt=lx(n)}else i===27?(i=nt,Jr(n.type)?(n=sh,sh=null,nt=n):nt=i):nt=Mt?Nn(n.stateNode.nextSibling):null;return!0}function Mi(){nt=Mt=null,Ie=!1}function Hf(){var n=Br;return n!==null&&(Qt===null?Qt=n:Qt.push.apply(Qt,n),Br=null),n}function Uo(n){Br===null?Br=[n]:Br.push(n)}var Pf=z(null),ki=null,cr=null;function Hr(n,i,s){R(Pf,i._currentValue),i._currentValue=s}function fr(n){n._currentValue=Pf.current,X(Pf)}function Uf(n,i,s){for(;n!==null;){var c=n.alternate;if((n.childLanes&i)!==i?(n.childLanes|=i,c!==null&&(c.childLanes|=i)):c!==null&&(c.childLanes&i)!==i&&(c.childLanes|=i),n===s)break;n=n.return}}function qf(n,i,s,c){var p=n.child;for(p!==null&&(p.return=n);p!==null;){var x=p.dependencies;if(x!==null){var E=p.child;x=x.firstContext;e:for(;x!==null;){var T=x;x=p;for(var G=0;G<i.length;G++)if(T.context===i[G]){x.lanes|=s,T=x.alternate,T!==null&&(T.lanes|=s),Uf(x.return,s,n),c||(E=null);break e}x=T.next}}else if(p.tag===18){if(E=p.return,E===null)throw Error(a(341));E.lanes|=s,x=E.alternate,x!==null&&(x.lanes|=s),Uf(E,s,n),E=null}else E=p.child;if(E!==null)E.return=p;else for(E=p;E!==null;){if(E===n){E=null;break}if(p=E.sibling,p!==null){p.return=E.return,E=p;break}E=E.return}p=E}}function Na(n,i,s,c){n=null;for(var p=i,x=!1;p!==null;){if(!x){if((p.flags&524288)!==0)x=!0;else if((p.flags&262144)!==0)break}if(p.tag===10){var E=p.alternate;if(E===null)throw Error(a(387));if(E=E.memoizedProps,E!==null){var T=p.type;sn(p.pendingProps.value,E.value)||(n!==null?n.push(T):n=[T])}}else if(p===fe.current){if(E=p.alternate,E===null)throw Error(a(387));E.memoizedState.memoizedState!==p.memoizedState.memoizedState&&(n!==null?n.push(ps):n=[ps])}p=p.return}n!==null&&qf(i,n,s,c),i.flags|=262144}function Yl(n){for(n=n.firstContext;n!==null;){if(!sn(n.context._currentValue,n.memoizedValue))return!0;n=n.next}return!1}function Ti(n){ki=n,cr=null,n=n.dependencies,n!==null&&(n.firstContext=null)}function kt(n){return Ig(ki,n)}function Xl(n,i){return ki===null&&Ti(n),Ig(n,i)}function Ig(n,i){var s=i._currentValue;if(i={context:i,memoizedValue:s,next:null},cr===null){if(n===null)throw Error(a(308));cr=i,n.dependencies={lanes:0,firstContext:i},n.flags|=524288}else cr=cr.next=i;return s}var VC=typeof AbortController<"u"?AbortController:function(){var n=[],i=this.signal={aborted:!1,addEventListener:function(s,c){n.push(c)}};this.abort=function(){i.aborted=!0,n.forEach(function(s){return s()})}},FC=e.unstable_scheduleCallback,YC=e.unstable_NormalPriority,gt={$$typeof:_,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Vf(){return{controller:new VC,data:new Map,refCount:0}}function qo(n){n.refCount--,n.refCount===0&&FC(YC,function(){n.controller.abort()})}var Vo=null,Ff=0,Ma=0,ka=null;function XC(n,i){if(Vo===null){var s=Vo=[];Ff=0,Ma=Gd(),ka={status:"pending",value:void 0,then:function(c){s.push(c)}}}return Ff++,i.then(Hg,Hg),i}function Hg(){if(--Ff===0&&Vo!==null){ka!==null&&(ka.status="fulfilled");var n=Vo;Vo=null,Ma=0,ka=null;for(var i=0;i<n.length;i++)(0,n[i])()}}function GC(n,i){var s=[],c={status:"pending",value:null,reason:null,then:function(p){s.push(p)}};return n.then(function(){c.status="fulfilled",c.value=i;for(var p=0;p<s.length;p++)(0,s[p])(i)},function(p){for(c.status="rejected",c.reason=p,p=0;p<s.length;p++)(0,s[p])(void 0)}),c}var Pg=j.S;j.S=function(n,i){E0=Ne(),typeof i=="object"&&i!==null&&typeof i.then=="function"&&XC(n,i),Pg!==null&&Pg(n,i)};var Ai=z(null);function Yf(){var n=Ai.current;return n!==null?n:We.pooledCache}function Gl(n,i){i===null?R(Ai,Ai.current):R(Ai,i.pool)}function Ug(){var n=Yf();return n===null?null:{parent:gt._currentValue,pool:n}}var Ta=Error(a(460)),Xf=Error(a(474)),$l=Error(a(542)),Ql={then:function(){}};function qg(n){return n=n.status,n==="fulfilled"||n==="rejected"}function Vg(n,i,s){switch(s=n[s],s===void 0?n.push(i):s!==i&&(i.then(or,or),i=s),i.status){case"fulfilled":return i.value;case"rejected":throw n=i.reason,Yg(n),n;default:if(typeof i.status=="string")i.then(or,or);else{if(n=We,n!==null&&100<n.shellSuspendCounter)throw Error(a(482));n=i,n.status="pending",n.then(function(c){if(i.status==="pending"){var p=i;p.status="fulfilled",p.value=c}},function(c){if(i.status==="pending"){var p=i;p.status="rejected",p.reason=c}})}switch(i.status){case"fulfilled":return i.value;case"rejected":throw n=i.reason,Yg(n),n}throw Oi=i,Ta}}function Ri(n){try{var i=n._init;return i(n._payload)}catch(s){throw s!==null&&typeof s=="object"&&typeof s.then=="function"?(Oi=s,Ta):s}}var Oi=null;function Fg(){if(Oi===null)throw Error(a(459));var n=Oi;return Oi=null,n}function Yg(n){if(n===Ta||n===$l)throw Error(a(483))}var Aa=null,Fo=0;function Zl(n){var i=Fo;return Fo+=1,Aa===null&&(Aa=[]),Vg(Aa,n,i)}function Yo(n,i){i=i.props.ref,n.ref=i!==void 0?i:null}function Kl(n,i){throw i.$$typeof===y?Error(a(525)):(n=Object.prototype.toString.call(i),Error(a(31,n==="[object Object]"?"object with keys {"+Object.keys(i).join(", ")+"}":n)))}function Xg(n){function i(J,Q){if(n){var W=J.deletions;W===null?(J.deletions=[Q],J.flags|=16):W.push(Q)}}function s(J,Q){if(!n)return null;for(;Q!==null;)i(J,Q),Q=Q.sibling;return null}function c(J){for(var Q=new Map;J!==null;)J.key!==null?Q.set(J.key,J):Q.set(J.index,J),J=J.sibling;return Q}function p(J,Q){return J=lr(J,Q),J.index=0,J.sibling=null,J}function x(J,Q,W){return J.index=W,n?(W=J.alternate,W!==null?(W=W.index,W<Q?(J.flags|=67108866,Q):W):(J.flags|=67108866,Q)):(J.flags|=1048576,Q)}function E(J){return n&&J.alternate===null&&(J.flags|=67108866),J}function T(J,Q,W,oe){return Q===null||Q.tag!==6?(Q=Df(W,J.mode,oe),Q.return=J,Q):(Q=p(Q,W),Q.return=J,Q)}function G(J,Q,W,oe){var xe=W.type;return xe===C?ae(J,Q,W.props.children,oe,W.key):Q!==null&&(Q.elementType===xe||typeof xe=="object"&&xe!==null&&xe.$$typeof===U&&Ri(xe)===Q.type)?(Q=p(Q,W.props),Yo(Q,W),Q.return=J,Q):(Q=Vl(W.type,W.key,W.props,null,J.mode,oe),Yo(Q,W),Q.return=J,Q)}function ee(J,Q,W,oe){return Q===null||Q.tag!==4||Q.stateNode.containerInfo!==W.containerInfo||Q.stateNode.implementation!==W.implementation?(Q=zf(W,J.mode,oe),Q.return=J,Q):(Q=p(Q,W.children||[]),Q.return=J,Q)}function ae(J,Q,W,oe,xe){return Q===null||Q.tag!==7?(Q=Ni(W,J.mode,oe,xe),Q.return=J,Q):(Q=p(Q,W),Q.return=J,Q)}function se(J,Q,W){if(typeof Q=="string"&&Q!==""||typeof Q=="number"||typeof Q=="bigint")return Q=Df(""+Q,J.mode,W),Q.return=J,Q;if(typeof Q=="object"&&Q!==null){switch(Q.$$typeof){case v:return W=Vl(Q.type,Q.key,Q.props,null,J.mode,W),Yo(W,Q),W.return=J,W;case S:return Q=zf(Q,J.mode,W),Q.return=J,Q;case U:return Q=Ri(Q),se(J,Q,W)}if(V(Q)||P(Q))return Q=Ni(Q,J.mode,W,null),Q.return=J,Q;if(typeof Q.then=="function")return se(J,Zl(Q),W);if(Q.$$typeof===_)return se(J,Xl(J,Q),W);Kl(J,Q)}return null}function ne(J,Q,W,oe){var xe=Q!==null?Q.key:null;if(typeof W=="string"&&W!==""||typeof W=="number"||typeof W=="bigint")return xe!==null?null:T(J,Q,""+W,oe);if(typeof W=="object"&&W!==null){switch(W.$$typeof){case v:return W.key===xe?G(J,Q,W,oe):null;case S:return W.key===xe?ee(J,Q,W,oe):null;case U:return W=Ri(W),ne(J,Q,W,oe)}if(V(W)||P(W))return xe!==null?null:ae(J,Q,W,oe,null);if(typeof W.then=="function")return ne(J,Q,Zl(W),oe);if(W.$$typeof===_)return ne(J,Q,Xl(J,W),oe);Kl(J,W)}return null}function re(J,Q,W,oe,xe){if(typeof oe=="string"&&oe!==""||typeof oe=="number"||typeof oe=="bigint")return J=J.get(W)||null,T(Q,J,""+oe,xe);if(typeof oe=="object"&&oe!==null){switch(oe.$$typeof){case v:return J=J.get(oe.key===null?W:oe.key)||null,G(Q,J,oe,xe);case S:return J=J.get(oe.key===null?W:oe.key)||null,ee(Q,J,oe,xe);case U:return oe=Ri(oe),re(J,Q,W,oe,xe)}if(V(oe)||P(oe))return J=J.get(W)||null,ae(Q,J,oe,xe,null);if(typeof oe.then=="function")return re(J,Q,W,Zl(oe),xe);if(oe.$$typeof===_)return re(J,Q,W,Xl(Q,oe),xe);Kl(Q,oe)}return null}function me(J,Q,W,oe){for(var xe=null,qe=null,ge=Q,Te=Q=0,Le=null;ge!==null&&Te<W.length;Te++){ge.index>Te?(Le=ge,ge=null):Le=ge.sibling;var Ve=ne(J,ge,W[Te],oe);if(Ve===null){ge===null&&(ge=Le);break}n&&ge&&Ve.alternate===null&&i(J,ge),Q=x(Ve,Q,Te),qe===null?xe=Ve:qe.sibling=Ve,qe=Ve,ge=Le}if(Te===W.length)return s(J,ge),Ie&&ur(J,Te),xe;if(ge===null){for(;Te<W.length;Te++)ge=se(J,W[Te],oe),ge!==null&&(Q=x(ge,Q,Te),qe===null?xe=ge:qe.sibling=ge,qe=ge);return Ie&&ur(J,Te),xe}for(ge=c(ge);Te<W.length;Te++)Le=re(ge,J,Te,W[Te],oe),Le!==null&&(n&&Le.alternate!==null&&ge.delete(Le.key===null?Te:Le.key),Q=x(Le,Q,Te),qe===null?xe=Le:qe.sibling=Le,qe=Le);return n&&ge.forEach(function(ri){return i(J,ri)}),Ie&&ur(J,Te),xe}function Ce(J,Q,W,oe){if(W==null)throw Error(a(151));for(var xe=null,qe=null,ge=Q,Te=Q=0,Le=null,Ve=W.next();ge!==null&&!Ve.done;Te++,Ve=W.next()){ge.index>Te?(Le=ge,ge=null):Le=ge.sibling;var ri=ne(J,ge,Ve.value,oe);if(ri===null){ge===null&&(ge=Le);break}n&&ge&&ri.alternate===null&&i(J,ge),Q=x(ri,Q,Te),qe===null?xe=ri:qe.sibling=ri,qe=ri,ge=Le}if(Ve.done)return s(J,ge),Ie&&ur(J,Te),xe;if(ge===null){for(;!Ve.done;Te++,Ve=W.next())Ve=se(J,Ve.value,oe),Ve!==null&&(Q=x(Ve,Q,Te),qe===null?xe=Ve:qe.sibling=Ve,qe=Ve);return Ie&&ur(J,Te),xe}for(ge=c(ge);!Ve.done;Te++,Ve=W.next())Ve=re(ge,J,Te,Ve.value,oe),Ve!==null&&(n&&Ve.alternate!==null&&ge.delete(Ve.key===null?Te:Ve.key),Q=x(Ve,Q,Te),qe===null?xe=Ve:qe.sibling=Ve,qe=Ve);return n&&ge.forEach(function(i2){return i(J,i2)}),Ie&&ur(J,Te),xe}function Je(J,Q,W,oe){if(typeof W=="object"&&W!==null&&W.type===C&&W.key===null&&(W=W.props.children),typeof W=="object"&&W!==null){switch(W.$$typeof){case v:e:{for(var xe=W.key;Q!==null;){if(Q.key===xe){if(xe=W.type,xe===C){if(Q.tag===7){s(J,Q.sibling),oe=p(Q,W.props.children),oe.return=J,J=oe;break e}}else if(Q.elementType===xe||typeof xe=="object"&&xe!==null&&xe.$$typeof===U&&Ri(xe)===Q.type){s(J,Q.sibling),oe=p(Q,W.props),Yo(oe,W),oe.return=J,J=oe;break e}s(J,Q);break}else i(J,Q);Q=Q.sibling}W.type===C?(oe=Ni(W.props.children,J.mode,oe,W.key),oe.return=J,J=oe):(oe=Vl(W.type,W.key,W.props,null,J.mode,oe),Yo(oe,W),oe.return=J,J=oe)}return E(J);case S:e:{for(xe=W.key;Q!==null;){if(Q.key===xe)if(Q.tag===4&&Q.stateNode.containerInfo===W.containerInfo&&Q.stateNode.implementation===W.implementation){s(J,Q.sibling),oe=p(Q,W.children||[]),oe.return=J,J=oe;break e}else{s(J,Q);break}else i(J,Q);Q=Q.sibling}oe=zf(W,J.mode,oe),oe.return=J,J=oe}return E(J);case U:return W=Ri(W),Je(J,Q,W,oe)}if(V(W))return me(J,Q,W,oe);if(P(W)){if(xe=P(W),typeof xe!="function")throw Error(a(150));return W=xe.call(W),Ce(J,Q,W,oe)}if(typeof W.then=="function")return Je(J,Q,Zl(W),oe);if(W.$$typeof===_)return Je(J,Q,Xl(J,W),oe);Kl(J,W)}return typeof W=="string"&&W!==""||typeof W=="number"||typeof W=="bigint"?(W=""+W,Q!==null&&Q.tag===6?(s(J,Q.sibling),oe=p(Q,W),oe.return=J,J=oe):(s(J,Q),oe=Df(W,J.mode,oe),oe.return=J,J=oe),E(J)):s(J,Q)}return function(J,Q,W,oe){try{Fo=0;var xe=Je(J,Q,W,oe);return Aa=null,xe}catch(ge){if(ge===Ta||ge===$l)throw ge;var qe=ln(29,ge,null,J.mode);return qe.lanes=oe,qe.return=J,qe}}}var ji=Xg(!0),Gg=Xg(!1),Pr=!1;function Gf(n){n.updateQueue={baseState:n.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function $f(n,i){n=n.updateQueue,i.updateQueue===n&&(i.updateQueue={baseState:n.baseState,firstBaseUpdate:n.firstBaseUpdate,lastBaseUpdate:n.lastBaseUpdate,shared:n.shared,callbacks:null})}function Ur(n){return{lane:n,tag:0,payload:null,callback:null,next:null}}function qr(n,i,s){var c=n.updateQueue;if(c===null)return null;if(c=c.shared,(Fe&2)!==0){var p=c.pending;return p===null?i.next=i:(i.next=p.next,p.next=i),c.pending=i,i=ql(n),Ag(n,null,s),i}return Ul(n,c,i,s),ql(n)}function Xo(n,i,s){if(i=i.updateQueue,i!==null&&(i=i.shared,(s&4194048)!==0)){var c=i.lanes;c&=n.pendingLanes,s|=c,i.lanes=s,bl(n,s)}}function Qf(n,i){var s=n.updateQueue,c=n.alternate;if(c!==null&&(c=c.updateQueue,s===c)){var p=null,x=null;if(s=s.firstBaseUpdate,s!==null){do{var E={lane:s.lane,tag:s.tag,payload:s.payload,callback:null,next:null};x===null?p=x=E:x=x.next=E,s=s.next}while(s!==null);x===null?p=x=i:x=x.next=i}else p=x=i;s={baseState:c.baseState,firstBaseUpdate:p,lastBaseUpdate:x,shared:c.shared,callbacks:c.callbacks},n.updateQueue=s;return}n=s.lastBaseUpdate,n===null?s.firstBaseUpdate=i:n.next=i,s.lastBaseUpdate=i}var Zf=!1;function Go(){if(Zf){var n=ka;if(n!==null)throw n}}function $o(n,i,s,c){Zf=!1;var p=n.updateQueue;Pr=!1;var x=p.firstBaseUpdate,E=p.lastBaseUpdate,T=p.shared.pending;if(T!==null){p.shared.pending=null;var G=T,ee=G.next;G.next=null,E===null?x=ee:E.next=ee,E=G;var ae=n.alternate;ae!==null&&(ae=ae.updateQueue,T=ae.lastBaseUpdate,T!==E&&(T===null?ae.firstBaseUpdate=ee:T.next=ee,ae.lastBaseUpdate=G))}if(x!==null){var se=p.baseState;E=0,ae=ee=G=null,T=x;do{var ne=T.lane&-536870913,re=ne!==T.lane;if(re?(ze&ne)===ne:(c&ne)===ne){ne!==0&&ne===Ma&&(Zf=!0),ae!==null&&(ae=ae.next={lane:0,tag:T.tag,payload:T.payload,callback:null,next:null});e:{var me=n,Ce=T;ne=i;var Je=s;switch(Ce.tag){case 1:if(me=Ce.payload,typeof me=="function"){se=me.call(Je,se,ne);break e}se=me;break e;case 3:me.flags=me.flags&-65537|128;case 0:if(me=Ce.payload,ne=typeof me=="function"?me.call(Je,se,ne):me,ne==null)break e;se=g({},se,ne);break e;case 2:Pr=!0}}ne=T.callback,ne!==null&&(n.flags|=64,re&&(n.flags|=8192),re=p.callbacks,re===null?p.callbacks=[ne]:re.push(ne))}else re={lane:ne,tag:T.tag,payload:T.payload,callback:T.callback,next:null},ae===null?(ee=ae=re,G=se):ae=ae.next=re,E|=ne;if(T=T.next,T===null){if(T=p.shared.pending,T===null)break;re=T,T=re.next,re.next=null,p.lastBaseUpdate=re,p.shared.pending=null}}while(!0);ae===null&&(G=se),p.baseState=G,p.firstBaseUpdate=ee,p.lastBaseUpdate=ae,x===null&&(p.shared.lanes=0),Gr|=E,n.lanes=E,n.memoizedState=se}}function $g(n,i){if(typeof n!="function")throw Error(a(191,n));n.call(i)}function Qg(n,i){var s=n.callbacks;if(s!==null)for(n.callbacks=null,n=0;n<s.length;n++)$g(s[n],i)}var Ra=z(null),Jl=z(0);function Zg(n,i){n=br,R(Jl,n),R(Ra,i),br=n|i.baseLanes}function Kf(){R(Jl,br),R(Ra,Ra.current)}function Jf(){br=Jl.current,X(Ra),X(Jl)}var un=z(null),_n=null;function Vr(n){var i=n.alternate;R(ht,ht.current&1),R(un,n),_n===null&&(i===null||Ra.current!==null||i.memoizedState!==null)&&(_n=n)}function Wf(n){R(ht,ht.current),R(un,n),_n===null&&(_n=n)}function Kg(n){n.tag===22?(R(ht,ht.current),R(un,n),_n===null&&(_n=n)):Fr()}function Fr(){R(ht,ht.current),R(un,un.current)}function cn(n){X(un),_n===n&&(_n=null),X(ht)}var ht=z(0);function Wl(n){for(var i=n;i!==null;){if(i.tag===13){var s=i.memoizedState;if(s!==null&&(s=s.dehydrated,s===null||ah(s)||oh(s)))return i}else if(i.tag===19&&(i.memoizedProps.revealOrder==="forwards"||i.memoizedProps.revealOrder==="backwards"||i.memoizedProps.revealOrder==="unstable_legacy-backwards"||i.memoizedProps.revealOrder==="together")){if((i.flags&128)!==0)return i}else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===n)break;for(;i.sibling===null;){if(i.return===null||i.return===n)return null;i=i.return}i.sibling.return=i.return,i=i.sibling}return null}var dr=0,ke=null,Ze=null,yt=null,eu=!1,Oa=!1,Di=!1,tu=0,Qo=0,ja=null,$C=0;function ct(){throw Error(a(321))}function ed(n,i){if(i===null)return!1;for(var s=0;s<i.length&&s<n.length;s++)if(!sn(n[s],i[s]))return!1;return!0}function td(n,i,s,c,p,x){return dr=x,ke=i,i.memoizedState=null,i.updateQueue=null,i.lanes=0,j.H=n===null||n.memoizedState===null?Dy:gd,Di=!1,x=s(c,p),Di=!1,Oa&&(x=Wg(i,s,c,p)),Jg(n),x}function Jg(n){j.H=Jo;var i=Ze!==null&&Ze.next!==null;if(dr=0,yt=Ze=ke=null,eu=!1,Qo=0,ja=null,i)throw Error(a(300));n===null||xt||(n=n.dependencies,n!==null&&Yl(n)&&(xt=!0))}function Wg(n,i,s,c){ke=n;var p=0;do{if(Oa&&(ja=null),Qo=0,Oa=!1,25<=p)throw Error(a(301));if(p+=1,yt=Ze=null,n.updateQueue!=null){var x=n.updateQueue;x.lastEffect=null,x.events=null,x.stores=null,x.memoCache!=null&&(x.memoCache.index=0)}j.H=zy,x=i(s,c)}while(Oa);return x}function QC(){var n=j.H,i=n.useState()[0];return i=typeof i.then=="function"?Zo(i):i,n=n.useState()[0],(Ze!==null?Ze.memoizedState:null)!==n&&(ke.flags|=1024),i}function nd(){var n=tu!==0;return tu=0,n}function rd(n,i,s){i.updateQueue=n.updateQueue,i.flags&=-2053,n.lanes&=~s}function id(n){if(eu){for(n=n.memoizedState;n!==null;){var i=n.queue;i!==null&&(i.pending=null),n=n.next}eu=!1}dr=0,yt=Ze=ke=null,Oa=!1,Qo=tu=0,ja=null}function Ht(){var n={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return yt===null?ke.memoizedState=yt=n:yt=yt.next=n,yt}function pt(){if(Ze===null){var n=ke.alternate;n=n!==null?n.memoizedState:null}else n=Ze.next;var i=yt===null?ke.memoizedState:yt.next;if(i!==null)yt=i,Ze=n;else{if(n===null)throw ke.alternate===null?Error(a(467)):Error(a(310));Ze=n,n={memoizedState:Ze.memoizedState,baseState:Ze.baseState,baseQueue:Ze.baseQueue,queue:Ze.queue,next:null},yt===null?ke.memoizedState=yt=n:yt=yt.next=n}return yt}function nu(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Zo(n){var i=Qo;return Qo+=1,ja===null&&(ja=[]),n=Vg(ja,n,i),i=ke,(yt===null?i.memoizedState:yt.next)===null&&(i=i.alternate,j.H=i===null||i.memoizedState===null?Dy:gd),n}function ru(n){if(n!==null&&typeof n=="object"){if(typeof n.then=="function")return Zo(n);if(n.$$typeof===_)return kt(n)}throw Error(a(438,String(n)))}function ad(n){var i=null,s=ke.updateQueue;if(s!==null&&(i=s.memoCache),i==null){var c=ke.alternate;c!==null&&(c=c.updateQueue,c!==null&&(c=c.memoCache,c!=null&&(i={data:c.data.map(function(p){return p.slice()}),index:0})))}if(i==null&&(i={data:[],index:0}),s===null&&(s=nu(),ke.updateQueue=s),s.memoCache=i,s=i.data[i.index],s===void 0)for(s=i.data[i.index]=Array(n),c=0;c<n;c++)s[c]=q;return i.index++,s}function hr(n,i){return typeof i=="function"?i(n):i}function iu(n){var i=pt();return od(i,Ze,n)}function od(n,i,s){var c=n.queue;if(c===null)throw Error(a(311));c.lastRenderedReducer=s;var p=n.baseQueue,x=c.pending;if(x!==null){if(p!==null){var E=p.next;p.next=x.next,x.next=E}i.baseQueue=p=x,c.pending=null}if(x=n.baseState,p===null)n.memoizedState=x;else{i=p.next;var T=E=null,G=null,ee=i,ae=!1;do{var se=ee.lane&-536870913;if(se!==ee.lane?(ze&se)===se:(dr&se)===se){var ne=ee.revertLane;if(ne===0)G!==null&&(G=G.next={lane:0,revertLane:0,gesture:null,action:ee.action,hasEagerState:ee.hasEagerState,eagerState:ee.eagerState,next:null}),se===Ma&&(ae=!0);else if((dr&ne)===ne){ee=ee.next,ne===Ma&&(ae=!0);continue}else se={lane:0,revertLane:ee.revertLane,gesture:null,action:ee.action,hasEagerState:ee.hasEagerState,eagerState:ee.eagerState,next:null},G===null?(T=G=se,E=x):G=G.next=se,ke.lanes|=ne,Gr|=ne;se=ee.action,Di&&s(x,se),x=ee.hasEagerState?ee.eagerState:s(x,se)}else ne={lane:se,revertLane:ee.revertLane,gesture:ee.gesture,action:ee.action,hasEagerState:ee.hasEagerState,eagerState:ee.eagerState,next:null},G===null?(T=G=ne,E=x):G=G.next=ne,ke.lanes|=se,Gr|=se;ee=ee.next}while(ee!==null&&ee!==i);if(G===null?E=x:G.next=T,!sn(x,n.memoizedState)&&(xt=!0,ae&&(s=ka,s!==null)))throw s;n.memoizedState=x,n.baseState=E,n.baseQueue=G,c.lastRenderedState=x}return p===null&&(c.lanes=0),[n.memoizedState,c.dispatch]}function sd(n){var i=pt(),s=i.queue;if(s===null)throw Error(a(311));s.lastRenderedReducer=n;var c=s.dispatch,p=s.pending,x=i.memoizedState;if(p!==null){s.pending=null;var E=p=p.next;do x=n(x,E.action),E=E.next;while(E!==p);sn(x,i.memoizedState)||(xt=!0),i.memoizedState=x,i.baseQueue===null&&(i.baseState=x),s.lastRenderedState=x}return[x,c]}function ey(n,i,s){var c=ke,p=pt(),x=Ie;if(x){if(s===void 0)throw Error(a(407));s=s()}else s=i();var E=!sn((Ze||p).memoizedState,s);if(E&&(p.memoizedState=s,xt=!0),p=p.queue,cd(ry.bind(null,c,p,n),[n]),p.getSnapshot!==i||E||yt!==null&&yt.memoizedState.tag&1){if(c.flags|=2048,Da(9,{destroy:void 0},ny.bind(null,c,p,s,i),null),We===null)throw Error(a(349));x||(dr&127)!==0||ty(c,i,s)}return s}function ty(n,i,s){n.flags|=16384,n={getSnapshot:i,value:s},i=ke.updateQueue,i===null?(i=nu(),ke.updateQueue=i,i.stores=[n]):(s=i.stores,s===null?i.stores=[n]:s.push(n))}function ny(n,i,s,c){i.value=s,i.getSnapshot=c,iy(i)&&ay(n)}function ry(n,i,s){return s(function(){iy(i)&&ay(n)})}function iy(n){var i=n.getSnapshot;n=n.value;try{var s=i();return!sn(n,s)}catch{return!0}}function ay(n){var i=_i(n,2);i!==null&&Zt(i,n,2)}function ld(n){var i=Ht();if(typeof n=="function"){var s=n;if(n=s(),Di){jt(!0);try{s()}finally{jt(!1)}}}return i.memoizedState=i.baseState=n,i.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:hr,lastRenderedState:n},i}function oy(n,i,s,c){return n.baseState=s,od(n,Ze,typeof c=="function"?c:hr)}function ZC(n,i,s,c,p){if(su(n))throw Error(a(485));if(n=i.action,n!==null){var x={payload:p,action:n,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(E){x.listeners.push(E)}};j.T!==null?s(!0):x.isTransition=!1,c(x),s=i.pending,s===null?(x.next=i.pending=x,sy(i,x)):(x.next=s.next,i.pending=s.next=x)}}function sy(n,i){var s=i.action,c=i.payload,p=n.state;if(i.isTransition){var x=j.T,E={};j.T=E;try{var T=s(p,c),G=j.S;G!==null&&G(E,T),ly(n,i,T)}catch(ee){ud(n,i,ee)}finally{x!==null&&E.types!==null&&(x.types=E.types),j.T=x}}else try{x=s(p,c),ly(n,i,x)}catch(ee){ud(n,i,ee)}}function ly(n,i,s){s!==null&&typeof s=="object"&&typeof s.then=="function"?s.then(function(c){uy(n,i,c)},function(c){return ud(n,i,c)}):uy(n,i,s)}function uy(n,i,s){i.status="fulfilled",i.value=s,cy(i),n.state=s,i=n.pending,i!==null&&(s=i.next,s===i?n.pending=null:(s=s.next,i.next=s,sy(n,s)))}function ud(n,i,s){var c=n.pending;if(n.pending=null,c!==null){c=c.next;do i.status="rejected",i.reason=s,cy(i),i=i.next;while(i!==c)}n.action=null}function cy(n){n=n.listeners;for(var i=0;i<n.length;i++)(0,n[i])()}function fy(n,i){return i}function dy(n,i){if(Ie){var s=We.formState;if(s!==null){e:{var c=ke;if(Ie){if(nt){t:{for(var p=nt,x=Cn;p.nodeType!==8;){if(!x){p=null;break t}if(p=Nn(p.nextSibling),p===null){p=null;break t}}x=p.data,p=x==="F!"||x==="F"?p:null}if(p){nt=Nn(p.nextSibling),c=p.data==="F!";break e}}Ir(c)}c=!1}c&&(i=s[0])}}return s=Ht(),s.memoizedState=s.baseState=i,c={pending:null,lanes:0,dispatch:null,lastRenderedReducer:fy,lastRenderedState:i},s.queue=c,s=Ry.bind(null,ke,c),c.dispatch=s,c=ld(!1),x=md.bind(null,ke,!1,c.queue),c=Ht(),p={state:i,dispatch:null,action:n,pending:null},c.queue=p,s=ZC.bind(null,ke,p,x,s),p.dispatch=s,c.memoizedState=n,[i,s,!1]}function hy(n){var i=pt();return py(i,Ze,n)}function py(n,i,s){if(i=od(n,i,fy)[0],n=iu(hr)[0],typeof i=="object"&&i!==null&&typeof i.then=="function")try{var c=Zo(i)}catch(E){throw E===Ta?$l:E}else c=i;i=pt();var p=i.queue,x=p.dispatch;return s!==i.memoizedState&&(ke.flags|=2048,Da(9,{destroy:void 0},KC.bind(null,p,s),null)),[c,x,n]}function KC(n,i){n.action=i}function my(n){var i=pt(),s=Ze;if(s!==null)return py(i,s,n);pt(),i=i.memoizedState,s=pt();var c=s.queue.dispatch;return s.memoizedState=n,[i,c,!1]}function Da(n,i,s,c){return n={tag:n,create:s,deps:c,inst:i,next:null},i=ke.updateQueue,i===null&&(i=nu(),ke.updateQueue=i),s=i.lastEffect,s===null?i.lastEffect=n.next=n:(c=s.next,s.next=n,n.next=c,i.lastEffect=n),n}function gy(){return pt().memoizedState}function au(n,i,s,c){var p=Ht();ke.flags|=n,p.memoizedState=Da(1|i,{destroy:void 0},s,c===void 0?null:c)}function ou(n,i,s,c){var p=pt();c=c===void 0?null:c;var x=p.memoizedState.inst;Ze!==null&&c!==null&&ed(c,Ze.memoizedState.deps)?p.memoizedState=Da(i,x,s,c):(ke.flags|=n,p.memoizedState=Da(1|i,x,s,c))}function yy(n,i){au(8390656,8,n,i)}function cd(n,i){ou(2048,8,n,i)}function JC(n){ke.flags|=4;var i=ke.updateQueue;if(i===null)i=nu(),ke.updateQueue=i,i.events=[n];else{var s=i.events;s===null?i.events=[n]:s.push(n)}}function xy(n){var i=pt().memoizedState;return JC({ref:i,nextImpl:n}),function(){if((Fe&2)!==0)throw Error(a(440));return i.impl.apply(void 0,arguments)}}function vy(n,i){return ou(4,2,n,i)}function by(n,i){return ou(4,4,n,i)}function Sy(n,i){if(typeof i=="function"){n=n();var s=i(n);return function(){typeof s=="function"?s():i(null)}}if(i!=null)return n=n(),i.current=n,function(){i.current=null}}function wy(n,i,s){s=s!=null?s.concat([n]):null,ou(4,4,Sy.bind(null,i,n),s)}function fd(){}function Ey(n,i){var s=pt();i=i===void 0?null:i;var c=s.memoizedState;return i!==null&&ed(i,c[1])?c[0]:(s.memoizedState=[n,i],n)}function Cy(n,i){var s=pt();i=i===void 0?null:i;var c=s.memoizedState;if(i!==null&&ed(i,c[1]))return c[0];if(c=n(),Di){jt(!0);try{n()}finally{jt(!1)}}return s.memoizedState=[c,i],c}function dd(n,i,s){return s===void 0||(dr&1073741824)!==0&&(ze&261930)===0?n.memoizedState=i:(n.memoizedState=s,n=_0(),ke.lanes|=n,Gr|=n,s)}function _y(n,i,s,c){return sn(s,i)?s:Ra.current!==null?(n=dd(n,s,c),sn(n,i)||(xt=!0),n):(dr&42)===0||(dr&1073741824)!==0&&(ze&261930)===0?(xt=!0,n.memoizedState=s):(n=_0(),ke.lanes|=n,Gr|=n,i)}function Ny(n,i,s,c,p){var x=F.p;F.p=x!==0&&8>x?x:8;var E=j.T,T={};j.T=T,md(n,!1,i,s);try{var G=p(),ee=j.S;if(ee!==null&&ee(T,G),G!==null&&typeof G=="object"&&typeof G.then=="function"){var ae=GC(G,c);Ko(n,i,ae,hn(n))}else Ko(n,i,c,hn(n))}catch(se){Ko(n,i,{then:function(){},status:"rejected",reason:se},hn())}finally{F.p=x,E!==null&&T.types!==null&&(E.types=T.types),j.T=E}}function WC(){}function hd(n,i,s,c){if(n.tag!==5)throw Error(a(476));var p=My(n).queue;Ny(n,p,i,$,s===null?WC:function(){return ky(n),s(c)})}function My(n){var i=n.memoizedState;if(i!==null)return i;i={memoizedState:$,baseState:$,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:hr,lastRenderedState:$},next:null};var s={};return i.next={memoizedState:s,baseState:s,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:hr,lastRenderedState:s},next:null},n.memoizedState=i,n=n.alternate,n!==null&&(n.memoizedState=i),i}function ky(n){var i=My(n);i.next===null&&(i=n.alternate.memoizedState),Ko(n,i.next.queue,{},hn())}function pd(){return kt(ps)}function Ty(){return pt().memoizedState}function Ay(){return pt().memoizedState}function e_(n){for(var i=n.return;i!==null;){switch(i.tag){case 24:case 3:var s=hn();n=Ur(s);var c=qr(i,n,s);c!==null&&(Zt(c,i,s),Xo(c,i,s)),i={cache:Vf()},n.payload=i;return}i=i.return}}function t_(n,i,s){var c=hn();s={lane:c,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},su(n)?Oy(i,s):(s=Of(n,i,s,c),s!==null&&(Zt(s,n,c),jy(s,i,c)))}function Ry(n,i,s){var c=hn();Ko(n,i,s,c)}function Ko(n,i,s,c){var p={lane:c,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null};if(su(n))Oy(i,p);else{var x=n.alternate;if(n.lanes===0&&(x===null||x.lanes===0)&&(x=i.lastRenderedReducer,x!==null))try{var E=i.lastRenderedState,T=x(E,s);if(p.hasEagerState=!0,p.eagerState=T,sn(T,E))return Ul(n,i,p,0),We===null&&Pl(),!1}catch{}if(s=Of(n,i,p,c),s!==null)return Zt(s,n,c),jy(s,i,c),!0}return!1}function md(n,i,s,c){if(c={lane:2,revertLane:Gd(),gesture:null,action:c,hasEagerState:!1,eagerState:null,next:null},su(n)){if(i)throw Error(a(479))}else i=Of(n,s,c,2),i!==null&&Zt(i,n,2)}function su(n){var i=n.alternate;return n===ke||i!==null&&i===ke}function Oy(n,i){Oa=eu=!0;var s=n.pending;s===null?i.next=i:(i.next=s.next,s.next=i),n.pending=i}function jy(n,i,s){if((s&4194048)!==0){var c=i.lanes;c&=n.pendingLanes,s|=c,i.lanes=s,bl(n,s)}}var Jo={readContext:kt,use:ru,useCallback:ct,useContext:ct,useEffect:ct,useImperativeHandle:ct,useLayoutEffect:ct,useInsertionEffect:ct,useMemo:ct,useReducer:ct,useRef:ct,useState:ct,useDebugValue:ct,useDeferredValue:ct,useTransition:ct,useSyncExternalStore:ct,useId:ct,useHostTransitionStatus:ct,useFormState:ct,useActionState:ct,useOptimistic:ct,useMemoCache:ct,useCacheRefresh:ct};Jo.useEffectEvent=ct;var Dy={readContext:kt,use:ru,useCallback:function(n,i){return Ht().memoizedState=[n,i===void 0?null:i],n},useContext:kt,useEffect:yy,useImperativeHandle:function(n,i,s){s=s!=null?s.concat([n]):null,au(4194308,4,Sy.bind(null,i,n),s)},useLayoutEffect:function(n,i){return au(4194308,4,n,i)},useInsertionEffect:function(n,i){au(4,2,n,i)},useMemo:function(n,i){var s=Ht();i=i===void 0?null:i;var c=n();if(Di){jt(!0);try{n()}finally{jt(!1)}}return s.memoizedState=[c,i],c},useReducer:function(n,i,s){var c=Ht();if(s!==void 0){var p=s(i);if(Di){jt(!0);try{s(i)}finally{jt(!1)}}}else p=i;return c.memoizedState=c.baseState=p,n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:n,lastRenderedState:p},c.queue=n,n=n.dispatch=t_.bind(null,ke,n),[c.memoizedState,n]},useRef:function(n){var i=Ht();return n={current:n},i.memoizedState=n},useState:function(n){n=ld(n);var i=n.queue,s=Ry.bind(null,ke,i);return i.dispatch=s,[n.memoizedState,s]},useDebugValue:fd,useDeferredValue:function(n,i){var s=Ht();return dd(s,n,i)},useTransition:function(){var n=ld(!1);return n=Ny.bind(null,ke,n.queue,!0,!1),Ht().memoizedState=n,[!1,n]},useSyncExternalStore:function(n,i,s){var c=ke,p=Ht();if(Ie){if(s===void 0)throw Error(a(407));s=s()}else{if(s=i(),We===null)throw Error(a(349));(ze&127)!==0||ty(c,i,s)}p.memoizedState=s;var x={value:s,getSnapshot:i};return p.queue=x,yy(ry.bind(null,c,x,n),[n]),c.flags|=2048,Da(9,{destroy:void 0},ny.bind(null,c,x,s,i),null),s},useId:function(){var n=Ht(),i=We.identifierPrefix;if(Ie){var s=Fn,c=Vn;s=(c&~(1<<32-Xe(c)-1)).toString(32)+s,i="_"+i+"R_"+s,s=tu++,0<s&&(i+="H"+s.toString(32)),i+="_"}else s=$C++,i="_"+i+"r_"+s.toString(32)+"_";return n.memoizedState=i},useHostTransitionStatus:pd,useFormState:dy,useActionState:dy,useOptimistic:function(n){var i=Ht();i.memoizedState=i.baseState=n;var s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return i.queue=s,i=md.bind(null,ke,!0,s),s.dispatch=i,[n,i]},useMemoCache:ad,useCacheRefresh:function(){return Ht().memoizedState=e_.bind(null,ke)},useEffectEvent:function(n){var i=Ht(),s={impl:n};return i.memoizedState=s,function(){if((Fe&2)!==0)throw Error(a(440));return s.impl.apply(void 0,arguments)}}},gd={readContext:kt,use:ru,useCallback:Ey,useContext:kt,useEffect:cd,useImperativeHandle:wy,useInsertionEffect:vy,useLayoutEffect:by,useMemo:Cy,useReducer:iu,useRef:gy,useState:function(){return iu(hr)},useDebugValue:fd,useDeferredValue:function(n,i){var s=pt();return _y(s,Ze.memoizedState,n,i)},useTransition:function(){var n=iu(hr)[0],i=pt().memoizedState;return[typeof n=="boolean"?n:Zo(n),i]},useSyncExternalStore:ey,useId:Ty,useHostTransitionStatus:pd,useFormState:hy,useActionState:hy,useOptimistic:function(n,i){var s=pt();return oy(s,Ze,n,i)},useMemoCache:ad,useCacheRefresh:Ay};gd.useEffectEvent=xy;var zy={readContext:kt,use:ru,useCallback:Ey,useContext:kt,useEffect:cd,useImperativeHandle:wy,useInsertionEffect:vy,useLayoutEffect:by,useMemo:Cy,useReducer:sd,useRef:gy,useState:function(){return sd(hr)},useDebugValue:fd,useDeferredValue:function(n,i){var s=pt();return Ze===null?dd(s,n,i):_y(s,Ze.memoizedState,n,i)},useTransition:function(){var n=sd(hr)[0],i=pt().memoizedState;return[typeof n=="boolean"?n:Zo(n),i]},useSyncExternalStore:ey,useId:Ty,useHostTransitionStatus:pd,useFormState:my,useActionState:my,useOptimistic:function(n,i){var s=pt();return Ze!==null?oy(s,Ze,n,i):(s.baseState=n,[n,s.queue.dispatch])},useMemoCache:ad,useCacheRefresh:Ay};zy.useEffectEvent=xy;function yd(n,i,s,c){i=n.memoizedState,s=s(c,i),s=s==null?i:g({},i,s),n.memoizedState=s,n.lanes===0&&(n.updateQueue.baseState=s)}var xd={enqueueSetState:function(n,i,s){n=n._reactInternals;var c=hn(),p=Ur(c);p.payload=i,s!=null&&(p.callback=s),i=qr(n,p,c),i!==null&&(Zt(i,n,c),Xo(i,n,c))},enqueueReplaceState:function(n,i,s){n=n._reactInternals;var c=hn(),p=Ur(c);p.tag=1,p.payload=i,s!=null&&(p.callback=s),i=qr(n,p,c),i!==null&&(Zt(i,n,c),Xo(i,n,c))},enqueueForceUpdate:function(n,i){n=n._reactInternals;var s=hn(),c=Ur(s);c.tag=2,i!=null&&(c.callback=i),i=qr(n,c,s),i!==null&&(Zt(i,n,s),Xo(i,n,s))}};function Ly(n,i,s,c,p,x,E){return n=n.stateNode,typeof n.shouldComponentUpdate=="function"?n.shouldComponentUpdate(c,x,E):i.prototype&&i.prototype.isPureReactComponent?!Io(s,c)||!Io(p,x):!0}function By(n,i,s,c){n=i.state,typeof i.componentWillReceiveProps=="function"&&i.componentWillReceiveProps(s,c),typeof i.UNSAFE_componentWillReceiveProps=="function"&&i.UNSAFE_componentWillReceiveProps(s,c),i.state!==n&&xd.enqueueReplaceState(i,i.state,null)}function zi(n,i){var s=i;if("ref"in i){s={};for(var c in i)c!=="ref"&&(s[c]=i[c])}if(n=n.defaultProps){s===i&&(s=g({},s));for(var p in n)s[p]===void 0&&(s[p]=n[p])}return s}function Iy(n){Hl(n)}function Hy(n){console.error(n)}function Py(n){Hl(n)}function lu(n,i){try{var s=n.onUncaughtError;s(i.value,{componentStack:i.stack})}catch(c){setTimeout(function(){throw c})}}function Uy(n,i,s){try{var c=n.onCaughtError;c(s.value,{componentStack:s.stack,errorBoundary:i.tag===1?i.stateNode:null})}catch(p){setTimeout(function(){throw p})}}function vd(n,i,s){return s=Ur(s),s.tag=3,s.payload={element:null},s.callback=function(){lu(n,i)},s}function qy(n){return n=Ur(n),n.tag=3,n}function Vy(n,i,s,c){var p=s.type.getDerivedStateFromError;if(typeof p=="function"){var x=c.value;n.payload=function(){return p(x)},n.callback=function(){Uy(i,s,c)}}var E=s.stateNode;E!==null&&typeof E.componentDidCatch=="function"&&(n.callback=function(){Uy(i,s,c),typeof p!="function"&&($r===null?$r=new Set([this]):$r.add(this));var T=c.stack;this.componentDidCatch(c.value,{componentStack:T!==null?T:""})})}function n_(n,i,s,c,p){if(s.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){if(i=s.alternate,i!==null&&Na(i,s,p,!0),s=un.current,s!==null){switch(s.tag){case 31:case 13:return _n===null?bu():s.alternate===null&&ft===0&&(ft=3),s.flags&=-257,s.flags|=65536,s.lanes=p,c===Ql?s.flags|=16384:(i=s.updateQueue,i===null?s.updateQueue=new Set([c]):i.add(c),Fd(n,c,p)),!1;case 22:return s.flags|=65536,c===Ql?s.flags|=16384:(i=s.updateQueue,i===null?(i={transitions:null,markerInstances:null,retryQueue:new Set([c])},s.updateQueue=i):(s=i.retryQueue,s===null?i.retryQueue=new Set([c]):s.add(c)),Fd(n,c,p)),!1}throw Error(a(435,s.tag))}return Fd(n,c,p),bu(),!1}if(Ie)return i=un.current,i!==null?((i.flags&65536)===0&&(i.flags|=256),i.flags|=65536,i.lanes=p,c!==If&&(n=Error(a(422),{cause:c}),Uo(Sn(n,s)))):(c!==If&&(i=Error(a(423),{cause:c}),Uo(Sn(i,s))),n=n.current.alternate,n.flags|=65536,p&=-p,n.lanes|=p,c=Sn(c,s),p=vd(n.stateNode,c,p),Qf(n,p),ft!==4&&(ft=2)),!1;var x=Error(a(520),{cause:c});if(x=Sn(x,s),os===null?os=[x]:os.push(x),ft!==4&&(ft=2),i===null)return!0;c=Sn(c,s),s=i;do{switch(s.tag){case 3:return s.flags|=65536,n=p&-p,s.lanes|=n,n=vd(s.stateNode,c,n),Qf(s,n),!1;case 1:if(i=s.type,x=s.stateNode,(s.flags&128)===0&&(typeof i.getDerivedStateFromError=="function"||x!==null&&typeof x.componentDidCatch=="function"&&($r===null||!$r.has(x))))return s.flags|=65536,p&=-p,s.lanes|=p,p=qy(p),Vy(p,n,s,c),Qf(s,p),!1}s=s.return}while(s!==null);return!1}var bd=Error(a(461)),xt=!1;function Tt(n,i,s,c){i.child=n===null?Gg(i,null,s,c):ji(i,n.child,s,c)}function Fy(n,i,s,c,p){s=s.render;var x=i.ref;if("ref"in c){var E={};for(var T in c)T!=="ref"&&(E[T]=c[T])}else E=c;return Ti(i),c=td(n,i,s,E,x,p),T=nd(),n!==null&&!xt?(rd(n,i,p),pr(n,i,p)):(Ie&&T&&Lf(i),i.flags|=1,Tt(n,i,c,p),i.child)}function Yy(n,i,s,c,p){if(n===null){var x=s.type;return typeof x=="function"&&!jf(x)&&x.defaultProps===void 0&&s.compare===null?(i.tag=15,i.type=x,Xy(n,i,x,c,p)):(n=Vl(s.type,null,c,i,i.mode,p),n.ref=i.ref,n.return=i,i.child=n)}if(x=n.child,!kd(n,p)){var E=x.memoizedProps;if(s=s.compare,s=s!==null?s:Io,s(E,c)&&n.ref===i.ref)return pr(n,i,p)}return i.flags|=1,n=lr(x,c),n.ref=i.ref,n.return=i,i.child=n}function Xy(n,i,s,c,p){if(n!==null){var x=n.memoizedProps;if(Io(x,c)&&n.ref===i.ref)if(xt=!1,i.pendingProps=c=x,kd(n,p))(n.flags&131072)!==0&&(xt=!0);else return i.lanes=n.lanes,pr(n,i,p)}return Sd(n,i,s,c,p)}function Gy(n,i,s,c){var p=c.children,x=n!==null?n.memoizedState:null;if(n===null&&i.stateNode===null&&(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),c.mode==="hidden"){if((i.flags&128)!==0){if(x=x!==null?x.baseLanes|s:s,n!==null){for(c=i.child=n.child,p=0;c!==null;)p=p|c.lanes|c.childLanes,c=c.sibling;c=p&~x}else c=0,i.child=null;return $y(n,i,x,s,c)}if((s&536870912)!==0)i.memoizedState={baseLanes:0,cachePool:null},n!==null&&Gl(i,x!==null?x.cachePool:null),x!==null?Zg(i,x):Kf(),Kg(i);else return c=i.lanes=536870912,$y(n,i,x!==null?x.baseLanes|s:s,s,c)}else x!==null?(Gl(i,x.cachePool),Zg(i,x),Fr(),i.memoizedState=null):(n!==null&&Gl(i,null),Kf(),Fr());return Tt(n,i,p,s),i.child}function Wo(n,i){return n!==null&&n.tag===22||i.stateNode!==null||(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),i.sibling}function $y(n,i,s,c,p){var x=Yf();return x=x===null?null:{parent:gt._currentValue,pool:x},i.memoizedState={baseLanes:s,cachePool:x},n!==null&&Gl(i,null),Kf(),Kg(i),n!==null&&Na(n,i,c,!0),i.childLanes=p,null}function uu(n,i){return i=fu({mode:i.mode,children:i.children},n.mode),i.ref=n.ref,n.child=i,i.return=n,i}function Qy(n,i,s){return ji(i,n.child,null,s),n=uu(i,i.pendingProps),n.flags|=2,cn(i),i.memoizedState=null,n}function r_(n,i,s){var c=i.pendingProps,p=(i.flags&128)!==0;if(i.flags&=-129,n===null){if(Ie){if(c.mode==="hidden")return n=uu(i,c),i.lanes=536870912,Wo(null,n);if(Wf(i),(n=nt)?(n=sx(n,Cn),n=n!==null&&n.data==="&"?n:null,n!==null&&(i.memoizedState={dehydrated:n,treeContext:Lr!==null?{id:Vn,overflow:Fn}:null,retryLane:536870912,hydrationErrors:null},s=Og(n),s.return=i,i.child=s,Mt=i,nt=null)):n=null,n===null)throw Ir(i);return i.lanes=536870912,null}return uu(i,c)}var x=n.memoizedState;if(x!==null){var E=x.dehydrated;if(Wf(i),p)if(i.flags&256)i.flags&=-257,i=Qy(n,i,s);else if(i.memoizedState!==null)i.child=n.child,i.flags|=128,i=null;else throw Error(a(558));else if(xt||Na(n,i,s,!1),p=(s&n.childLanes)!==0,xt||p){if(c=We,c!==null&&(E=Sl(c,s),E!==0&&E!==x.retryLane))throw x.retryLane=E,_i(n,E),Zt(c,n,E),bd;bu(),i=Qy(n,i,s)}else n=x.treeContext,nt=Nn(E.nextSibling),Mt=i,Ie=!0,Br=null,Cn=!1,n!==null&&zg(i,n),i=uu(i,c),i.flags|=4096;return i}return n=lr(n.child,{mode:c.mode,children:c.children}),n.ref=i.ref,i.child=n,n.return=i,n}function cu(n,i){var s=i.ref;if(s===null)n!==null&&n.ref!==null&&(i.flags|=4194816);else{if(typeof s!="function"&&typeof s!="object")throw Error(a(284));(n===null||n.ref!==s)&&(i.flags|=4194816)}}function Sd(n,i,s,c,p){return Ti(i),s=td(n,i,s,c,void 0,p),c=nd(),n!==null&&!xt?(rd(n,i,p),pr(n,i,p)):(Ie&&c&&Lf(i),i.flags|=1,Tt(n,i,s,p),i.child)}function Zy(n,i,s,c,p,x){return Ti(i),i.updateQueue=null,s=Wg(i,c,s,p),Jg(n),c=nd(),n!==null&&!xt?(rd(n,i,x),pr(n,i,x)):(Ie&&c&&Lf(i),i.flags|=1,Tt(n,i,s,x),i.child)}function Ky(n,i,s,c,p){if(Ti(i),i.stateNode===null){var x=wa,E=s.contextType;typeof E=="object"&&E!==null&&(x=kt(E)),x=new s(c,x),i.memoizedState=x.state!==null&&x.state!==void 0?x.state:null,x.updater=xd,i.stateNode=x,x._reactInternals=i,x=i.stateNode,x.props=c,x.state=i.memoizedState,x.refs={},Gf(i),E=s.contextType,x.context=typeof E=="object"&&E!==null?kt(E):wa,x.state=i.memoizedState,E=s.getDerivedStateFromProps,typeof E=="function"&&(yd(i,s,E,c),x.state=i.memoizedState),typeof s.getDerivedStateFromProps=="function"||typeof x.getSnapshotBeforeUpdate=="function"||typeof x.UNSAFE_componentWillMount!="function"&&typeof x.componentWillMount!="function"||(E=x.state,typeof x.componentWillMount=="function"&&x.componentWillMount(),typeof x.UNSAFE_componentWillMount=="function"&&x.UNSAFE_componentWillMount(),E!==x.state&&xd.enqueueReplaceState(x,x.state,null),$o(i,c,x,p),Go(),x.state=i.memoizedState),typeof x.componentDidMount=="function"&&(i.flags|=4194308),c=!0}else if(n===null){x=i.stateNode;var T=i.memoizedProps,G=zi(s,T);x.props=G;var ee=x.context,ae=s.contextType;E=wa,typeof ae=="object"&&ae!==null&&(E=kt(ae));var se=s.getDerivedStateFromProps;ae=typeof se=="function"||typeof x.getSnapshotBeforeUpdate=="function",T=i.pendingProps!==T,ae||typeof x.UNSAFE_componentWillReceiveProps!="function"&&typeof x.componentWillReceiveProps!="function"||(T||ee!==E)&&By(i,x,c,E),Pr=!1;var ne=i.memoizedState;x.state=ne,$o(i,c,x,p),Go(),ee=i.memoizedState,T||ne!==ee||Pr?(typeof se=="function"&&(yd(i,s,se,c),ee=i.memoizedState),(G=Pr||Ly(i,s,G,c,ne,ee,E))?(ae||typeof x.UNSAFE_componentWillMount!="function"&&typeof x.componentWillMount!="function"||(typeof x.componentWillMount=="function"&&x.componentWillMount(),typeof x.UNSAFE_componentWillMount=="function"&&x.UNSAFE_componentWillMount()),typeof x.componentDidMount=="function"&&(i.flags|=4194308)):(typeof x.componentDidMount=="function"&&(i.flags|=4194308),i.memoizedProps=c,i.memoizedState=ee),x.props=c,x.state=ee,x.context=E,c=G):(typeof x.componentDidMount=="function"&&(i.flags|=4194308),c=!1)}else{x=i.stateNode,$f(n,i),E=i.memoizedProps,ae=zi(s,E),x.props=ae,se=i.pendingProps,ne=x.context,ee=s.contextType,G=wa,typeof ee=="object"&&ee!==null&&(G=kt(ee)),T=s.getDerivedStateFromProps,(ee=typeof T=="function"||typeof x.getSnapshotBeforeUpdate=="function")||typeof x.UNSAFE_componentWillReceiveProps!="function"&&typeof x.componentWillReceiveProps!="function"||(E!==se||ne!==G)&&By(i,x,c,G),Pr=!1,ne=i.memoizedState,x.state=ne,$o(i,c,x,p),Go();var re=i.memoizedState;E!==se||ne!==re||Pr||n!==null&&n.dependencies!==null&&Yl(n.dependencies)?(typeof T=="function"&&(yd(i,s,T,c),re=i.memoizedState),(ae=Pr||Ly(i,s,ae,c,ne,re,G)||n!==null&&n.dependencies!==null&&Yl(n.dependencies))?(ee||typeof x.UNSAFE_componentWillUpdate!="function"&&typeof x.componentWillUpdate!="function"||(typeof x.componentWillUpdate=="function"&&x.componentWillUpdate(c,re,G),typeof x.UNSAFE_componentWillUpdate=="function"&&x.UNSAFE_componentWillUpdate(c,re,G)),typeof x.componentDidUpdate=="function"&&(i.flags|=4),typeof x.getSnapshotBeforeUpdate=="function"&&(i.flags|=1024)):(typeof x.componentDidUpdate!="function"||E===n.memoizedProps&&ne===n.memoizedState||(i.flags|=4),typeof x.getSnapshotBeforeUpdate!="function"||E===n.memoizedProps&&ne===n.memoizedState||(i.flags|=1024),i.memoizedProps=c,i.memoizedState=re),x.props=c,x.state=re,x.context=G,c=ae):(typeof x.componentDidUpdate!="function"||E===n.memoizedProps&&ne===n.memoizedState||(i.flags|=4),typeof x.getSnapshotBeforeUpdate!="function"||E===n.memoizedProps&&ne===n.memoizedState||(i.flags|=1024),c=!1)}return x=c,cu(n,i),c=(i.flags&128)!==0,x||c?(x=i.stateNode,s=c&&typeof s.getDerivedStateFromError!="function"?null:x.render(),i.flags|=1,n!==null&&c?(i.child=ji(i,n.child,null,p),i.child=ji(i,null,s,p)):Tt(n,i,s,p),i.memoizedState=x.state,n=i.child):n=pr(n,i,p),n}function Jy(n,i,s,c){return Mi(),i.flags|=256,Tt(n,i,s,c),i.child}var wd={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Ed(n){return{baseLanes:n,cachePool:Ug()}}function Cd(n,i,s){return n=n!==null?n.childLanes&~s:0,i&&(n|=dn),n}function Wy(n,i,s){var c=i.pendingProps,p=!1,x=(i.flags&128)!==0,E;if((E=x)||(E=n!==null&&n.memoizedState===null?!1:(ht.current&2)!==0),E&&(p=!0,i.flags&=-129),E=(i.flags&32)!==0,i.flags&=-33,n===null){if(Ie){if(p?Vr(i):Fr(),(n=nt)?(n=sx(n,Cn),n=n!==null&&n.data!=="&"?n:null,n!==null&&(i.memoizedState={dehydrated:n,treeContext:Lr!==null?{id:Vn,overflow:Fn}:null,retryLane:536870912,hydrationErrors:null},s=Og(n),s.return=i,i.child=s,Mt=i,nt=null)):n=null,n===null)throw Ir(i);return oh(n)?i.lanes=32:i.lanes=536870912,null}var T=c.children;return c=c.fallback,p?(Fr(),p=i.mode,T=fu({mode:"hidden",children:T},p),c=Ni(c,p,s,null),T.return=i,c.return=i,T.sibling=c,i.child=T,c=i.child,c.memoizedState=Ed(s),c.childLanes=Cd(n,E,s),i.memoizedState=wd,Wo(null,c)):(Vr(i),_d(i,T))}var G=n.memoizedState;if(G!==null&&(T=G.dehydrated,T!==null)){if(x)i.flags&256?(Vr(i),i.flags&=-257,i=Nd(n,i,s)):i.memoizedState!==null?(Fr(),i.child=n.child,i.flags|=128,i=null):(Fr(),T=c.fallback,p=i.mode,c=fu({mode:"visible",children:c.children},p),T=Ni(T,p,s,null),T.flags|=2,c.return=i,T.return=i,c.sibling=T,i.child=c,ji(i,n.child,null,s),c=i.child,c.memoizedState=Ed(s),c.childLanes=Cd(n,E,s),i.memoizedState=wd,i=Wo(null,c));else if(Vr(i),oh(T)){if(E=T.nextSibling&&T.nextSibling.dataset,E)var ee=E.dgst;E=ee,c=Error(a(419)),c.stack="",c.digest=E,Uo({value:c,source:null,stack:null}),i=Nd(n,i,s)}else if(xt||Na(n,i,s,!1),E=(s&n.childLanes)!==0,xt||E){if(E=We,E!==null&&(c=Sl(E,s),c!==0&&c!==G.retryLane))throw G.retryLane=c,_i(n,c),Zt(E,n,c),bd;ah(T)||bu(),i=Nd(n,i,s)}else ah(T)?(i.flags|=192,i.child=n.child,i=null):(n=G.treeContext,nt=Nn(T.nextSibling),Mt=i,Ie=!0,Br=null,Cn=!1,n!==null&&zg(i,n),i=_d(i,c.children),i.flags|=4096);return i}return p?(Fr(),T=c.fallback,p=i.mode,G=n.child,ee=G.sibling,c=lr(G,{mode:"hidden",children:c.children}),c.subtreeFlags=G.subtreeFlags&65011712,ee!==null?T=lr(ee,T):(T=Ni(T,p,s,null),T.flags|=2),T.return=i,c.return=i,c.sibling=T,i.child=c,Wo(null,c),c=i.child,T=n.child.memoizedState,T===null?T=Ed(s):(p=T.cachePool,p!==null?(G=gt._currentValue,p=p.parent!==G?{parent:G,pool:G}:p):p=Ug(),T={baseLanes:T.baseLanes|s,cachePool:p}),c.memoizedState=T,c.childLanes=Cd(n,E,s),i.memoizedState=wd,Wo(n.child,c)):(Vr(i),s=n.child,n=s.sibling,s=lr(s,{mode:"visible",children:c.children}),s.return=i,s.sibling=null,n!==null&&(E=i.deletions,E===null?(i.deletions=[n],i.flags|=16):E.push(n)),i.child=s,i.memoizedState=null,s)}function _d(n,i){return i=fu({mode:"visible",children:i},n.mode),i.return=n,n.child=i}function fu(n,i){return n=ln(22,n,null,i),n.lanes=0,n}function Nd(n,i,s){return ji(i,n.child,null,s),n=_d(i,i.pendingProps.children),n.flags|=2,i.memoizedState=null,n}function e0(n,i,s){n.lanes|=i;var c=n.alternate;c!==null&&(c.lanes|=i),Uf(n.return,i,s)}function Md(n,i,s,c,p,x){var E=n.memoizedState;E===null?n.memoizedState={isBackwards:i,rendering:null,renderingStartTime:0,last:c,tail:s,tailMode:p,treeForkCount:x}:(E.isBackwards=i,E.rendering=null,E.renderingStartTime=0,E.last=c,E.tail=s,E.tailMode=p,E.treeForkCount=x)}function t0(n,i,s){var c=i.pendingProps,p=c.revealOrder,x=c.tail;c=c.children;var E=ht.current,T=(E&2)!==0;if(T?(E=E&1|2,i.flags|=128):E&=1,R(ht,E),Tt(n,i,c,s),c=Ie?Po:0,!T&&n!==null&&(n.flags&128)!==0)e:for(n=i.child;n!==null;){if(n.tag===13)n.memoizedState!==null&&e0(n,s,i);else if(n.tag===19)e0(n,s,i);else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===i)break e;for(;n.sibling===null;){if(n.return===null||n.return===i)break e;n=n.return}n.sibling.return=n.return,n=n.sibling}switch(p){case"forwards":for(s=i.child,p=null;s!==null;)n=s.alternate,n!==null&&Wl(n)===null&&(p=s),s=s.sibling;s=p,s===null?(p=i.child,i.child=null):(p=s.sibling,s.sibling=null),Md(i,!1,p,s,x,c);break;case"backwards":case"unstable_legacy-backwards":for(s=null,p=i.child,i.child=null;p!==null;){if(n=p.alternate,n!==null&&Wl(n)===null){i.child=p;break}n=p.sibling,p.sibling=s,s=p,p=n}Md(i,!0,s,null,x,c);break;case"together":Md(i,!1,null,null,void 0,c);break;default:i.memoizedState=null}return i.child}function pr(n,i,s){if(n!==null&&(i.dependencies=n.dependencies),Gr|=i.lanes,(s&i.childLanes)===0)if(n!==null){if(Na(n,i,s,!1),(s&i.childLanes)===0)return null}else return null;if(n!==null&&i.child!==n.child)throw Error(a(153));if(i.child!==null){for(n=i.child,s=lr(n,n.pendingProps),i.child=s,s.return=i;n.sibling!==null;)n=n.sibling,s=s.sibling=lr(n,n.pendingProps),s.return=i;s.sibling=null}return i.child}function kd(n,i){return(n.lanes&i)!==0?!0:(n=n.dependencies,!!(n!==null&&Yl(n)))}function i_(n,i,s){switch(i.tag){case 3:le(i,i.stateNode.containerInfo),Hr(i,gt,n.memoizedState.cache),Mi();break;case 27:case 5:be(i);break;case 4:le(i,i.stateNode.containerInfo);break;case 10:Hr(i,i.type,i.memoizedProps.value);break;case 31:if(i.memoizedState!==null)return i.flags|=128,Wf(i),null;break;case 13:var c=i.memoizedState;if(c!==null)return c.dehydrated!==null?(Vr(i),i.flags|=128,null):(s&i.child.childLanes)!==0?Wy(n,i,s):(Vr(i),n=pr(n,i,s),n!==null?n.sibling:null);Vr(i);break;case 19:var p=(n.flags&128)!==0;if(c=(s&i.childLanes)!==0,c||(Na(n,i,s,!1),c=(s&i.childLanes)!==0),p){if(c)return t0(n,i,s);i.flags|=128}if(p=i.memoizedState,p!==null&&(p.rendering=null,p.tail=null,p.lastEffect=null),R(ht,ht.current),c)break;return null;case 22:return i.lanes=0,Gy(n,i,s,i.pendingProps);case 24:Hr(i,gt,n.memoizedState.cache)}return pr(n,i,s)}function n0(n,i,s){if(n!==null)if(n.memoizedProps!==i.pendingProps)xt=!0;else{if(!kd(n,s)&&(i.flags&128)===0)return xt=!1,i_(n,i,s);xt=(n.flags&131072)!==0}else xt=!1,Ie&&(i.flags&1048576)!==0&&Dg(i,Po,i.index);switch(i.lanes=0,i.tag){case 16:e:{var c=i.pendingProps;if(n=Ri(i.elementType),i.type=n,typeof n=="function")jf(n)?(c=zi(n,c),i.tag=1,i=Ky(null,i,n,c,s)):(i.tag=0,i=Sd(null,i,n,c,s));else{if(n!=null){var p=n.$$typeof;if(p===M){i.tag=11,i=Fy(null,i,n,c,s);break e}else if(p===D){i.tag=14,i=Yy(null,i,n,c,s);break e}}throw i=B(n)||n,Error(a(306,i,""))}}return i;case 0:return Sd(n,i,i.type,i.pendingProps,s);case 1:return c=i.type,p=zi(c,i.pendingProps),Ky(n,i,c,p,s);case 3:e:{if(le(i,i.stateNode.containerInfo),n===null)throw Error(a(387));c=i.pendingProps;var x=i.memoizedState;p=x.element,$f(n,i),$o(i,c,null,s);var E=i.memoizedState;if(c=E.cache,Hr(i,gt,c),c!==x.cache&&qf(i,[gt],s,!0),Go(),c=E.element,x.isDehydrated)if(x={element:c,isDehydrated:!1,cache:E.cache},i.updateQueue.baseState=x,i.memoizedState=x,i.flags&256){i=Jy(n,i,c,s);break e}else if(c!==p){p=Sn(Error(a(424)),i),Uo(p),i=Jy(n,i,c,s);break e}else for(n=i.stateNode.containerInfo,n.nodeType===9?n=n.body:n=n.nodeName==="HTML"?n.ownerDocument.body:n,nt=Nn(n.firstChild),Mt=i,Ie=!0,Br=null,Cn=!0,s=Gg(i,null,c,s),i.child=s;s;)s.flags=s.flags&-3|4096,s=s.sibling;else{if(Mi(),c===p){i=pr(n,i,s);break e}Tt(n,i,c,s)}i=i.child}return i;case 26:return cu(n,i),n===null?(s=hx(i.type,null,i.pendingProps,null))?i.memoizedState=s:Ie||(s=i.type,n=i.pendingProps,c=Mu(ce.current).createElement(s),c[wt]=i,c[Dt]=n,At(c,s,n),mt(c),i.stateNode=c):i.memoizedState=hx(i.type,n.memoizedProps,i.pendingProps,n.memoizedState),null;case 27:return be(i),n===null&&Ie&&(c=i.stateNode=cx(i.type,i.pendingProps,ce.current),Mt=i,Cn=!0,p=nt,Jr(i.type)?(sh=p,nt=Nn(c.firstChild)):nt=p),Tt(n,i,i.pendingProps.children,s),cu(n,i),n===null&&(i.flags|=4194304),i.child;case 5:return n===null&&Ie&&((p=c=nt)&&(c=D_(c,i.type,i.pendingProps,Cn),c!==null?(i.stateNode=c,Mt=i,nt=Nn(c.firstChild),Cn=!1,p=!0):p=!1),p||Ir(i)),be(i),p=i.type,x=i.pendingProps,E=n!==null?n.memoizedProps:null,c=x.children,nh(p,x)?c=null:E!==null&&nh(p,E)&&(i.flags|=32),i.memoizedState!==null&&(p=td(n,i,QC,null,null,s),ps._currentValue=p),cu(n,i),Tt(n,i,c,s),i.child;case 6:return n===null&&Ie&&((n=s=nt)&&(s=z_(s,i.pendingProps,Cn),s!==null?(i.stateNode=s,Mt=i,nt=null,n=!0):n=!1),n||Ir(i)),null;case 13:return Wy(n,i,s);case 4:return le(i,i.stateNode.containerInfo),c=i.pendingProps,n===null?i.child=ji(i,null,c,s):Tt(n,i,c,s),i.child;case 11:return Fy(n,i,i.type,i.pendingProps,s);case 7:return Tt(n,i,i.pendingProps,s),i.child;case 8:return Tt(n,i,i.pendingProps.children,s),i.child;case 12:return Tt(n,i,i.pendingProps.children,s),i.child;case 10:return c=i.pendingProps,Hr(i,i.type,c.value),Tt(n,i,c.children,s),i.child;case 9:return p=i.type._context,c=i.pendingProps.children,Ti(i),p=kt(p),c=c(p),i.flags|=1,Tt(n,i,c,s),i.child;case 14:return Yy(n,i,i.type,i.pendingProps,s);case 15:return Xy(n,i,i.type,i.pendingProps,s);case 19:return t0(n,i,s);case 31:return r_(n,i,s);case 22:return Gy(n,i,s,i.pendingProps);case 24:return Ti(i),c=kt(gt),n===null?(p=Yf(),p===null&&(p=We,x=Vf(),p.pooledCache=x,x.refCount++,x!==null&&(p.pooledCacheLanes|=s),p=x),i.memoizedState={parent:c,cache:p},Gf(i),Hr(i,gt,p)):((n.lanes&s)!==0&&($f(n,i),$o(i,null,null,s),Go()),p=n.memoizedState,x=i.memoizedState,p.parent!==c?(p={parent:c,cache:c},i.memoizedState=p,i.lanes===0&&(i.memoizedState=i.updateQueue.baseState=p),Hr(i,gt,c)):(c=x.cache,Hr(i,gt,c),c!==p.cache&&qf(i,[gt],s,!0))),Tt(n,i,i.pendingProps.children,s),i.child;case 29:throw i.pendingProps}throw Error(a(156,i.tag))}function mr(n){n.flags|=4}function Td(n,i,s,c,p){if((i=(n.mode&32)!==0)&&(i=!1),i){if(n.flags|=16777216,(p&335544128)===p)if(n.stateNode.complete)n.flags|=8192;else if(T0())n.flags|=8192;else throw Oi=Ql,Xf}else n.flags&=-16777217}function r0(n,i){if(i.type!=="stylesheet"||(i.state.loading&4)!==0)n.flags&=-16777217;else if(n.flags|=16777216,!xx(i))if(T0())n.flags|=8192;else throw Oi=Ql,Xf}function du(n,i){i!==null&&(n.flags|=4),n.flags&16384&&(i=n.tag!==22?xl():536870912,n.lanes|=i,Ia|=i)}function es(n,i){if(!Ie)switch(n.tailMode){case"hidden":i=n.tail;for(var s=null;i!==null;)i.alternate!==null&&(s=i),i=i.sibling;s===null?n.tail=null:s.sibling=null;break;case"collapsed":s=n.tail;for(var c=null;s!==null;)s.alternate!==null&&(c=s),s=s.sibling;c===null?i||n.tail===null?n.tail=null:n.tail.sibling=null:c.sibling=null}}function rt(n){var i=n.alternate!==null&&n.alternate.child===n.child,s=0,c=0;if(i)for(var p=n.child;p!==null;)s|=p.lanes|p.childLanes,c|=p.subtreeFlags&65011712,c|=p.flags&65011712,p.return=n,p=p.sibling;else for(p=n.child;p!==null;)s|=p.lanes|p.childLanes,c|=p.subtreeFlags,c|=p.flags,p.return=n,p=p.sibling;return n.subtreeFlags|=c,n.childLanes=s,i}function a_(n,i,s){var c=i.pendingProps;switch(Bf(i),i.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return rt(i),null;case 1:return rt(i),null;case 3:return s=i.stateNode,c=null,n!==null&&(c=n.memoizedState.cache),i.memoizedState.cache!==c&&(i.flags|=2048),fr(gt),pe(),s.pendingContext&&(s.context=s.pendingContext,s.pendingContext=null),(n===null||n.child===null)&&(_a(i)?mr(i):n===null||n.memoizedState.isDehydrated&&(i.flags&256)===0||(i.flags|=1024,Hf())),rt(i),null;case 26:var p=i.type,x=i.memoizedState;return n===null?(mr(i),x!==null?(rt(i),r0(i,x)):(rt(i),Td(i,p,null,c,s))):x?x!==n.memoizedState?(mr(i),rt(i),r0(i,x)):(rt(i),i.flags&=-16777217):(n=n.memoizedProps,n!==c&&mr(i),rt(i),Td(i,p,n,c,s)),null;case 27:if(Se(i),s=ce.current,p=i.type,n!==null&&i.stateNode!=null)n.memoizedProps!==c&&mr(i);else{if(!c){if(i.stateNode===null)throw Error(a(166));return rt(i),null}n=te.current,_a(i)?Lg(i):(n=cx(p,c,s),i.stateNode=n,mr(i))}return rt(i),null;case 5:if(Se(i),p=i.type,n!==null&&i.stateNode!=null)n.memoizedProps!==c&&mr(i);else{if(!c){if(i.stateNode===null)throw Error(a(166));return rt(i),null}if(x=te.current,_a(i))Lg(i);else{var E=Mu(ce.current);switch(x){case 1:x=E.createElementNS("http://www.w3.org/2000/svg",p);break;case 2:x=E.createElementNS("http://www.w3.org/1998/Math/MathML",p);break;default:switch(p){case"svg":x=E.createElementNS("http://www.w3.org/2000/svg",p);break;case"math":x=E.createElementNS("http://www.w3.org/1998/Math/MathML",p);break;case"script":x=E.createElement("div"),x.innerHTML="<script><\/script>",x=x.removeChild(x.firstChild);break;case"select":x=typeof c.is=="string"?E.createElement("select",{is:c.is}):E.createElement("select"),c.multiple?x.multiple=!0:c.size&&(x.size=c.size);break;default:x=typeof c.is=="string"?E.createElement(p,{is:c.is}):E.createElement(p)}}x[wt]=i,x[Dt]=c;e:for(E=i.child;E!==null;){if(E.tag===5||E.tag===6)x.appendChild(E.stateNode);else if(E.tag!==4&&E.tag!==27&&E.child!==null){E.child.return=E,E=E.child;continue}if(E===i)break e;for(;E.sibling===null;){if(E.return===null||E.return===i)break e;E=E.return}E.sibling.return=E.return,E=E.sibling}i.stateNode=x;e:switch(At(x,p,c),p){case"button":case"input":case"select":case"textarea":c=!!c.autoFocus;break e;case"img":c=!0;break e;default:c=!1}c&&mr(i)}}return rt(i),Td(i,i.type,n===null?null:n.memoizedProps,i.pendingProps,s),null;case 6:if(n&&i.stateNode!=null)n.memoizedProps!==c&&mr(i);else{if(typeof c!="string"&&i.stateNode===null)throw Error(a(166));if(n=ce.current,_a(i)){if(n=i.stateNode,s=i.memoizedProps,c=null,p=Mt,p!==null)switch(p.tag){case 27:case 5:c=p.memoizedProps}n[wt]=i,n=!!(n.nodeValue===s||c!==null&&c.suppressHydrationWarning===!0||W0(n.nodeValue,s)),n||Ir(i,!0)}else n=Mu(n).createTextNode(c),n[wt]=i,i.stateNode=n}return rt(i),null;case 31:if(s=i.memoizedState,n===null||n.memoizedState!==null){if(c=_a(i),s!==null){if(n===null){if(!c)throw Error(a(318));if(n=i.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(a(557));n[wt]=i}else Mi(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;rt(i),n=!1}else s=Hf(),n!==null&&n.memoizedState!==null&&(n.memoizedState.hydrationErrors=s),n=!0;if(!n)return i.flags&256?(cn(i),i):(cn(i),null);if((i.flags&128)!==0)throw Error(a(558))}return rt(i),null;case 13:if(c=i.memoizedState,n===null||n.memoizedState!==null&&n.memoizedState.dehydrated!==null){if(p=_a(i),c!==null&&c.dehydrated!==null){if(n===null){if(!p)throw Error(a(318));if(p=i.memoizedState,p=p!==null?p.dehydrated:null,!p)throw Error(a(317));p[wt]=i}else Mi(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;rt(i),p=!1}else p=Hf(),n!==null&&n.memoizedState!==null&&(n.memoizedState.hydrationErrors=p),p=!0;if(!p)return i.flags&256?(cn(i),i):(cn(i),null)}return cn(i),(i.flags&128)!==0?(i.lanes=s,i):(s=c!==null,n=n!==null&&n.memoizedState!==null,s&&(c=i.child,p=null,c.alternate!==null&&c.alternate.memoizedState!==null&&c.alternate.memoizedState.cachePool!==null&&(p=c.alternate.memoizedState.cachePool.pool),x=null,c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(x=c.memoizedState.cachePool.pool),x!==p&&(c.flags|=2048)),s!==n&&s&&(i.child.flags|=8192),du(i,i.updateQueue),rt(i),null);case 4:return pe(),n===null&&Kd(i.stateNode.containerInfo),rt(i),null;case 10:return fr(i.type),rt(i),null;case 19:if(X(ht),c=i.memoizedState,c===null)return rt(i),null;if(p=(i.flags&128)!==0,x=c.rendering,x===null)if(p)es(c,!1);else{if(ft!==0||n!==null&&(n.flags&128)!==0)for(n=i.child;n!==null;){if(x=Wl(n),x!==null){for(i.flags|=128,es(c,!1),n=x.updateQueue,i.updateQueue=n,du(i,n),i.subtreeFlags=0,n=s,s=i.child;s!==null;)Rg(s,n),s=s.sibling;return R(ht,ht.current&1|2),Ie&&ur(i,c.treeForkCount),i.child}n=n.sibling}c.tail!==null&&Ne()>yu&&(i.flags|=128,p=!0,es(c,!1),i.lanes=4194304)}else{if(!p)if(n=Wl(x),n!==null){if(i.flags|=128,p=!0,n=n.updateQueue,i.updateQueue=n,du(i,n),es(c,!0),c.tail===null&&c.tailMode==="hidden"&&!x.alternate&&!Ie)return rt(i),null}else 2*Ne()-c.renderingStartTime>yu&&s!==536870912&&(i.flags|=128,p=!0,es(c,!1),i.lanes=4194304);c.isBackwards?(x.sibling=i.child,i.child=x):(n=c.last,n!==null?n.sibling=x:i.child=x,c.last=x)}return c.tail!==null?(n=c.tail,c.rendering=n,c.tail=n.sibling,c.renderingStartTime=Ne(),n.sibling=null,s=ht.current,R(ht,p?s&1|2:s&1),Ie&&ur(i,c.treeForkCount),n):(rt(i),null);case 22:case 23:return cn(i),Jf(),c=i.memoizedState!==null,n!==null?n.memoizedState!==null!==c&&(i.flags|=8192):c&&(i.flags|=8192),c?(s&536870912)!==0&&(i.flags&128)===0&&(rt(i),i.subtreeFlags&6&&(i.flags|=8192)):rt(i),s=i.updateQueue,s!==null&&du(i,s.retryQueue),s=null,n!==null&&n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(s=n.memoizedState.cachePool.pool),c=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(c=i.memoizedState.cachePool.pool),c!==s&&(i.flags|=2048),n!==null&&X(Ai),null;case 24:return s=null,n!==null&&(s=n.memoizedState.cache),i.memoizedState.cache!==s&&(i.flags|=2048),fr(gt),rt(i),null;case 25:return null;case 30:return null}throw Error(a(156,i.tag))}function o_(n,i){switch(Bf(i),i.tag){case 1:return n=i.flags,n&65536?(i.flags=n&-65537|128,i):null;case 3:return fr(gt),pe(),n=i.flags,(n&65536)!==0&&(n&128)===0?(i.flags=n&-65537|128,i):null;case 26:case 27:case 5:return Se(i),null;case 31:if(i.memoizedState!==null){if(cn(i),i.alternate===null)throw Error(a(340));Mi()}return n=i.flags,n&65536?(i.flags=n&-65537|128,i):null;case 13:if(cn(i),n=i.memoizedState,n!==null&&n.dehydrated!==null){if(i.alternate===null)throw Error(a(340));Mi()}return n=i.flags,n&65536?(i.flags=n&-65537|128,i):null;case 19:return X(ht),null;case 4:return pe(),null;case 10:return fr(i.type),null;case 22:case 23:return cn(i),Jf(),n!==null&&X(Ai),n=i.flags,n&65536?(i.flags=n&-65537|128,i):null;case 24:return fr(gt),null;case 25:return null;default:return null}}function i0(n,i){switch(Bf(i),i.tag){case 3:fr(gt),pe();break;case 26:case 27:case 5:Se(i);break;case 4:pe();break;case 31:i.memoizedState!==null&&cn(i);break;case 13:cn(i);break;case 19:X(ht);break;case 10:fr(i.type);break;case 22:case 23:cn(i),Jf(),n!==null&&X(Ai);break;case 24:fr(gt)}}function ts(n,i){try{var s=i.updateQueue,c=s!==null?s.lastEffect:null;if(c!==null){var p=c.next;s=p;do{if((s.tag&n)===n){c=void 0;var x=s.create,E=s.inst;c=x(),E.destroy=c}s=s.next}while(s!==p)}}catch(T){$e(i,i.return,T)}}function Yr(n,i,s){try{var c=i.updateQueue,p=c!==null?c.lastEffect:null;if(p!==null){var x=p.next;c=x;do{if((c.tag&n)===n){var E=c.inst,T=E.destroy;if(T!==void 0){E.destroy=void 0,p=i;var G=s,ee=T;try{ee()}catch(ae){$e(p,G,ae)}}}c=c.next}while(c!==x)}}catch(ae){$e(i,i.return,ae)}}function a0(n){var i=n.updateQueue;if(i!==null){var s=n.stateNode;try{Qg(i,s)}catch(c){$e(n,n.return,c)}}}function o0(n,i,s){s.props=zi(n.type,n.memoizedProps),s.state=n.memoizedState;try{s.componentWillUnmount()}catch(c){$e(n,i,c)}}function ns(n,i){try{var s=n.ref;if(s!==null){switch(n.tag){case 26:case 27:case 5:var c=n.stateNode;break;case 30:c=n.stateNode;break;default:c=n.stateNode}typeof s=="function"?n.refCleanup=s(c):s.current=c}}catch(p){$e(n,i,p)}}function Yn(n,i){var s=n.ref,c=n.refCleanup;if(s!==null)if(typeof c=="function")try{c()}catch(p){$e(n,i,p)}finally{n.refCleanup=null,n=n.alternate,n!=null&&(n.refCleanup=null)}else if(typeof s=="function")try{s(null)}catch(p){$e(n,i,p)}else s.current=null}function s0(n){var i=n.type,s=n.memoizedProps,c=n.stateNode;try{e:switch(i){case"button":case"input":case"select":case"textarea":s.autoFocus&&c.focus();break e;case"img":s.src?c.src=s.src:s.srcSet&&(c.srcset=s.srcSet)}}catch(p){$e(n,n.return,p)}}function Ad(n,i,s){try{var c=n.stateNode;k_(c,n.type,s,i),c[Dt]=i}catch(p){$e(n,n.return,p)}}function l0(n){return n.tag===5||n.tag===3||n.tag===26||n.tag===27&&Jr(n.type)||n.tag===4}function Rd(n){e:for(;;){for(;n.sibling===null;){if(n.return===null||l0(n.return))return null;n=n.return}for(n.sibling.return=n.return,n=n.sibling;n.tag!==5&&n.tag!==6&&n.tag!==18;){if(n.tag===27&&Jr(n.type)||n.flags&2||n.child===null||n.tag===4)continue e;n.child.return=n,n=n.child}if(!(n.flags&2))return n.stateNode}}function Od(n,i,s){var c=n.tag;if(c===5||c===6)n=n.stateNode,i?(s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s).insertBefore(n,i):(i=s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s,i.appendChild(n),s=s._reactRootContainer,s!=null||i.onclick!==null||(i.onclick=or));else if(c!==4&&(c===27&&Jr(n.type)&&(s=n.stateNode,i=null),n=n.child,n!==null))for(Od(n,i,s),n=n.sibling;n!==null;)Od(n,i,s),n=n.sibling}function hu(n,i,s){var c=n.tag;if(c===5||c===6)n=n.stateNode,i?s.insertBefore(n,i):s.appendChild(n);else if(c!==4&&(c===27&&Jr(n.type)&&(s=n.stateNode),n=n.child,n!==null))for(hu(n,i,s),n=n.sibling;n!==null;)hu(n,i,s),n=n.sibling}function u0(n){var i=n.stateNode,s=n.memoizedProps;try{for(var c=n.type,p=i.attributes;p.length;)i.removeAttributeNode(p[0]);At(i,c,s),i[wt]=n,i[Dt]=s}catch(x){$e(n,n.return,x)}}var gr=!1,vt=!1,jd=!1,c0=typeof WeakSet=="function"?WeakSet:Set,Ct=null;function s_(n,i){if(n=n.containerInfo,eh=Du,n=wg(n),Nf(n)){if("selectionStart"in n)var s={start:n.selectionStart,end:n.selectionEnd};else e:{s=(s=n.ownerDocument)&&s.defaultView||window;var c=s.getSelection&&s.getSelection();if(c&&c.rangeCount!==0){s=c.anchorNode;var p=c.anchorOffset,x=c.focusNode;c=c.focusOffset;try{s.nodeType,x.nodeType}catch{s=null;break e}var E=0,T=-1,G=-1,ee=0,ae=0,se=n,ne=null;t:for(;;){for(var re;se!==s||p!==0&&se.nodeType!==3||(T=E+p),se!==x||c!==0&&se.nodeType!==3||(G=E+c),se.nodeType===3&&(E+=se.nodeValue.length),(re=se.firstChild)!==null;)ne=se,se=re;for(;;){if(se===n)break t;if(ne===s&&++ee===p&&(T=E),ne===x&&++ae===c&&(G=E),(re=se.nextSibling)!==null)break;se=ne,ne=se.parentNode}se=re}s=T===-1||G===-1?null:{start:T,end:G}}else s=null}s=s||{start:0,end:0}}else s=null;for(th={focusedElem:n,selectionRange:s},Du=!1,Ct=i;Ct!==null;)if(i=Ct,n=i.child,(i.subtreeFlags&1028)!==0&&n!==null)n.return=i,Ct=n;else for(;Ct!==null;){switch(i=Ct,x=i.alternate,n=i.flags,i.tag){case 0:if((n&4)!==0&&(n=i.updateQueue,n=n!==null?n.events:null,n!==null))for(s=0;s<n.length;s++)p=n[s],p.ref.impl=p.nextImpl;break;case 11:case 15:break;case 1:if((n&1024)!==0&&x!==null){n=void 0,s=i,p=x.memoizedProps,x=x.memoizedState,c=s.stateNode;try{var me=zi(s.type,p);n=c.getSnapshotBeforeUpdate(me,x),c.__reactInternalSnapshotBeforeUpdate=n}catch(Ce){$e(s,s.return,Ce)}}break;case 3:if((n&1024)!==0){if(n=i.stateNode.containerInfo,s=n.nodeType,s===9)ih(n);else if(s===1)switch(n.nodeName){case"HEAD":case"HTML":case"BODY":ih(n);break;default:n.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((n&1024)!==0)throw Error(a(163))}if(n=i.sibling,n!==null){n.return=i.return,Ct=n;break}Ct=i.return}}function f0(n,i,s){var c=s.flags;switch(s.tag){case 0:case 11:case 15:xr(n,s),c&4&&ts(5,s);break;case 1:if(xr(n,s),c&4)if(n=s.stateNode,i===null)try{n.componentDidMount()}catch(E){$e(s,s.return,E)}else{var p=zi(s.type,i.memoizedProps);i=i.memoizedState;try{n.componentDidUpdate(p,i,n.__reactInternalSnapshotBeforeUpdate)}catch(E){$e(s,s.return,E)}}c&64&&a0(s),c&512&&ns(s,s.return);break;case 3:if(xr(n,s),c&64&&(n=s.updateQueue,n!==null)){if(i=null,s.child!==null)switch(s.child.tag){case 27:case 5:i=s.child.stateNode;break;case 1:i=s.child.stateNode}try{Qg(n,i)}catch(E){$e(s,s.return,E)}}break;case 27:i===null&&c&4&&u0(s);case 26:case 5:xr(n,s),i===null&&c&4&&s0(s),c&512&&ns(s,s.return);break;case 12:xr(n,s);break;case 31:xr(n,s),c&4&&p0(n,s);break;case 13:xr(n,s),c&4&&m0(n,s),c&64&&(n=s.memoizedState,n!==null&&(n=n.dehydrated,n!==null&&(s=g_.bind(null,s),L_(n,s))));break;case 22:if(c=s.memoizedState!==null||gr,!c){i=i!==null&&i.memoizedState!==null||vt,p=gr;var x=vt;gr=c,(vt=i)&&!x?vr(n,s,(s.subtreeFlags&8772)!==0):xr(n,s),gr=p,vt=x}break;case 30:break;default:xr(n,s)}}function d0(n){var i=n.alternate;i!==null&&(n.alternate=null,d0(i)),n.child=null,n.deletions=null,n.sibling=null,n.tag===5&&(i=n.stateNode,i!==null&&ko(i)),n.stateNode=null,n.return=null,n.dependencies=null,n.memoizedProps=null,n.memoizedState=null,n.pendingProps=null,n.stateNode=null,n.updateQueue=null}var at=null,Xt=!1;function yr(n,i,s){for(s=s.child;s!==null;)h0(n,i,s),s=s.sibling}function h0(n,i,s){if(dt&&typeof dt.onCommitFiberUnmount=="function")try{dt.onCommitFiberUnmount(Nt,s)}catch{}switch(s.tag){case 26:vt||Yn(s,i),yr(n,i,s),s.memoizedState?s.memoizedState.count--:s.stateNode&&(s=s.stateNode,s.parentNode.removeChild(s));break;case 27:vt||Yn(s,i);var c=at,p=Xt;Jr(s.type)&&(at=s.stateNode,Xt=!1),yr(n,i,s),fs(s.stateNode),at=c,Xt=p;break;case 5:vt||Yn(s,i);case 6:if(c=at,p=Xt,at=null,yr(n,i,s),at=c,Xt=p,at!==null)if(Xt)try{(at.nodeType===9?at.body:at.nodeName==="HTML"?at.ownerDocument.body:at).removeChild(s.stateNode)}catch(x){$e(s,i,x)}else try{at.removeChild(s.stateNode)}catch(x){$e(s,i,x)}break;case 18:at!==null&&(Xt?(n=at,ax(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,s.stateNode),Xa(n)):ax(at,s.stateNode));break;case 4:c=at,p=Xt,at=s.stateNode.containerInfo,Xt=!0,yr(n,i,s),at=c,Xt=p;break;case 0:case 11:case 14:case 15:Yr(2,s,i),vt||Yr(4,s,i),yr(n,i,s);break;case 1:vt||(Yn(s,i),c=s.stateNode,typeof c.componentWillUnmount=="function"&&o0(s,i,c)),yr(n,i,s);break;case 21:yr(n,i,s);break;case 22:vt=(c=vt)||s.memoizedState!==null,yr(n,i,s),vt=c;break;default:yr(n,i,s)}}function p0(n,i){if(i.memoizedState===null&&(n=i.alternate,n!==null&&(n=n.memoizedState,n!==null))){n=n.dehydrated;try{Xa(n)}catch(s){$e(i,i.return,s)}}}function m0(n,i){if(i.memoizedState===null&&(n=i.alternate,n!==null&&(n=n.memoizedState,n!==null&&(n=n.dehydrated,n!==null))))try{Xa(n)}catch(s){$e(i,i.return,s)}}function l_(n){switch(n.tag){case 31:case 13:case 19:var i=n.stateNode;return i===null&&(i=n.stateNode=new c0),i;case 22:return n=n.stateNode,i=n._retryCache,i===null&&(i=n._retryCache=new c0),i;default:throw Error(a(435,n.tag))}}function pu(n,i){var s=l_(n);i.forEach(function(c){if(!s.has(c)){s.add(c);var p=y_.bind(null,n,c);c.then(p,p)}})}function Gt(n,i){var s=i.deletions;if(s!==null)for(var c=0;c<s.length;c++){var p=s[c],x=n,E=i,T=E;e:for(;T!==null;){switch(T.tag){case 27:if(Jr(T.type)){at=T.stateNode,Xt=!1;break e}break;case 5:at=T.stateNode,Xt=!1;break e;case 3:case 4:at=T.stateNode.containerInfo,Xt=!0;break e}T=T.return}if(at===null)throw Error(a(160));h0(x,E,p),at=null,Xt=!1,x=p.alternate,x!==null&&(x.return=null),p.return=null}if(i.subtreeFlags&13886)for(i=i.child;i!==null;)g0(i,n),i=i.sibling}var Dn=null;function g0(n,i){var s=n.alternate,c=n.flags;switch(n.tag){case 0:case 11:case 14:case 15:Gt(i,n),$t(n),c&4&&(Yr(3,n,n.return),ts(3,n),Yr(5,n,n.return));break;case 1:Gt(i,n),$t(n),c&512&&(vt||s===null||Yn(s,s.return)),c&64&&gr&&(n=n.updateQueue,n!==null&&(c=n.callbacks,c!==null&&(s=n.shared.hiddenCallbacks,n.shared.hiddenCallbacks=s===null?c:s.concat(c))));break;case 26:var p=Dn;if(Gt(i,n),$t(n),c&512&&(vt||s===null||Yn(s,s.return)),c&4){var x=s!==null?s.memoizedState:null;if(c=n.memoizedState,s===null)if(c===null)if(n.stateNode===null){e:{c=n.type,s=n.memoizedProps,p=p.ownerDocument||p;t:switch(c){case"title":x=p.getElementsByTagName("title")[0],(!x||x[vi]||x[wt]||x.namespaceURI==="http://www.w3.org/2000/svg"||x.hasAttribute("itemprop"))&&(x=p.createElement(c),p.head.insertBefore(x,p.querySelector("head > title"))),At(x,c,s),x[wt]=n,mt(x),c=x;break e;case"link":var E=gx("link","href",p).get(c+(s.href||""));if(E){for(var T=0;T<E.length;T++)if(x=E[T],x.getAttribute("href")===(s.href==null||s.href===""?null:s.href)&&x.getAttribute("rel")===(s.rel==null?null:s.rel)&&x.getAttribute("title")===(s.title==null?null:s.title)&&x.getAttribute("crossorigin")===(s.crossOrigin==null?null:s.crossOrigin)){E.splice(T,1);break t}}x=p.createElement(c),At(x,c,s),p.head.appendChild(x);break;case"meta":if(E=gx("meta","content",p).get(c+(s.content||""))){for(T=0;T<E.length;T++)if(x=E[T],x.getAttribute("content")===(s.content==null?null:""+s.content)&&x.getAttribute("name")===(s.name==null?null:s.name)&&x.getAttribute("property")===(s.property==null?null:s.property)&&x.getAttribute("http-equiv")===(s.httpEquiv==null?null:s.httpEquiv)&&x.getAttribute("charset")===(s.charSet==null?null:s.charSet)){E.splice(T,1);break t}}x=p.createElement(c),At(x,c,s),p.head.appendChild(x);break;default:throw Error(a(468,c))}x[wt]=n,mt(x),c=x}n.stateNode=c}else yx(p,n.type,n.stateNode);else n.stateNode=mx(p,c,n.memoizedProps);else x!==c?(x===null?s.stateNode!==null&&(s=s.stateNode,s.parentNode.removeChild(s)):x.count--,c===null?yx(p,n.type,n.stateNode):mx(p,c,n.memoizedProps)):c===null&&n.stateNode!==null&&Ad(n,n.memoizedProps,s.memoizedProps)}break;case 27:Gt(i,n),$t(n),c&512&&(vt||s===null||Yn(s,s.return)),s!==null&&c&4&&Ad(n,n.memoizedProps,s.memoizedProps);break;case 5:if(Gt(i,n),$t(n),c&512&&(vt||s===null||Yn(s,s.return)),n.flags&32){p=n.stateNode;try{ma(p,"")}catch(me){$e(n,n.return,me)}}c&4&&n.stateNode!=null&&(p=n.memoizedProps,Ad(n,p,s!==null?s.memoizedProps:p)),c&1024&&(jd=!0);break;case 6:if(Gt(i,n),$t(n),c&4){if(n.stateNode===null)throw Error(a(162));c=n.memoizedProps,s=n.stateNode;try{s.nodeValue=c}catch(me){$e(n,n.return,me)}}break;case 3:if(Au=null,p=Dn,Dn=ku(i.containerInfo),Gt(i,n),Dn=p,$t(n),c&4&&s!==null&&s.memoizedState.isDehydrated)try{Xa(i.containerInfo)}catch(me){$e(n,n.return,me)}jd&&(jd=!1,y0(n));break;case 4:c=Dn,Dn=ku(n.stateNode.containerInfo),Gt(i,n),$t(n),Dn=c;break;case 12:Gt(i,n),$t(n);break;case 31:Gt(i,n),$t(n),c&4&&(c=n.updateQueue,c!==null&&(n.updateQueue=null,pu(n,c)));break;case 13:Gt(i,n),$t(n),n.child.flags&8192&&n.memoizedState!==null!=(s!==null&&s.memoizedState!==null)&&(gu=Ne()),c&4&&(c=n.updateQueue,c!==null&&(n.updateQueue=null,pu(n,c)));break;case 22:p=n.memoizedState!==null;var G=s!==null&&s.memoizedState!==null,ee=gr,ae=vt;if(gr=ee||p,vt=ae||G,Gt(i,n),vt=ae,gr=ee,$t(n),c&8192)e:for(i=n.stateNode,i._visibility=p?i._visibility&-2:i._visibility|1,p&&(s===null||G||gr||vt||Li(n)),s=null,i=n;;){if(i.tag===5||i.tag===26){if(s===null){G=s=i;try{if(x=G.stateNode,p)E=x.style,typeof E.setProperty=="function"?E.setProperty("display","none","important"):E.display="none";else{T=G.stateNode;var se=G.memoizedProps.style,ne=se!=null&&se.hasOwnProperty("display")?se.display:null;T.style.display=ne==null||typeof ne=="boolean"?"":(""+ne).trim()}}catch(me){$e(G,G.return,me)}}}else if(i.tag===6){if(s===null){G=i;try{G.stateNode.nodeValue=p?"":G.memoizedProps}catch(me){$e(G,G.return,me)}}}else if(i.tag===18){if(s===null){G=i;try{var re=G.stateNode;p?ox(re,!0):ox(G.stateNode,!1)}catch(me){$e(G,G.return,me)}}}else if((i.tag!==22&&i.tag!==23||i.memoizedState===null||i===n)&&i.child!==null){i.child.return=i,i=i.child;continue}if(i===n)break e;for(;i.sibling===null;){if(i.return===null||i.return===n)break e;s===i&&(s=null),i=i.return}s===i&&(s=null),i.sibling.return=i.return,i=i.sibling}c&4&&(c=n.updateQueue,c!==null&&(s=c.retryQueue,s!==null&&(c.retryQueue=null,pu(n,s))));break;case 19:Gt(i,n),$t(n),c&4&&(c=n.updateQueue,c!==null&&(n.updateQueue=null,pu(n,c)));break;case 30:break;case 21:break;default:Gt(i,n),$t(n)}}function $t(n){var i=n.flags;if(i&2){try{for(var s,c=n.return;c!==null;){if(l0(c)){s=c;break}c=c.return}if(s==null)throw Error(a(160));switch(s.tag){case 27:var p=s.stateNode,x=Rd(n);hu(n,x,p);break;case 5:var E=s.stateNode;s.flags&32&&(ma(E,""),s.flags&=-33);var T=Rd(n);hu(n,T,E);break;case 3:case 4:var G=s.stateNode.containerInfo,ee=Rd(n);Od(n,ee,G);break;default:throw Error(a(161))}}catch(ae){$e(n,n.return,ae)}n.flags&=-3}i&4096&&(n.flags&=-4097)}function y0(n){if(n.subtreeFlags&1024)for(n=n.child;n!==null;){var i=n;y0(i),i.tag===5&&i.flags&1024&&i.stateNode.reset(),n=n.sibling}}function xr(n,i){if(i.subtreeFlags&8772)for(i=i.child;i!==null;)f0(n,i.alternate,i),i=i.sibling}function Li(n){for(n=n.child;n!==null;){var i=n;switch(i.tag){case 0:case 11:case 14:case 15:Yr(4,i,i.return),Li(i);break;case 1:Yn(i,i.return);var s=i.stateNode;typeof s.componentWillUnmount=="function"&&o0(i,i.return,s),Li(i);break;case 27:fs(i.stateNode);case 26:case 5:Yn(i,i.return),Li(i);break;case 22:i.memoizedState===null&&Li(i);break;case 30:Li(i);break;default:Li(i)}n=n.sibling}}function vr(n,i,s){for(s=s&&(i.subtreeFlags&8772)!==0,i=i.child;i!==null;){var c=i.alternate,p=n,x=i,E=x.flags;switch(x.tag){case 0:case 11:case 15:vr(p,x,s),ts(4,x);break;case 1:if(vr(p,x,s),c=x,p=c.stateNode,typeof p.componentDidMount=="function")try{p.componentDidMount()}catch(ee){$e(c,c.return,ee)}if(c=x,p=c.updateQueue,p!==null){var T=c.stateNode;try{var G=p.shared.hiddenCallbacks;if(G!==null)for(p.shared.hiddenCallbacks=null,p=0;p<G.length;p++)$g(G[p],T)}catch(ee){$e(c,c.return,ee)}}s&&E&64&&a0(x),ns(x,x.return);break;case 27:u0(x);case 26:case 5:vr(p,x,s),s&&c===null&&E&4&&s0(x),ns(x,x.return);break;case 12:vr(p,x,s);break;case 31:vr(p,x,s),s&&E&4&&p0(p,x);break;case 13:vr(p,x,s),s&&E&4&&m0(p,x);break;case 22:x.memoizedState===null&&vr(p,x,s),ns(x,x.return);break;case 30:break;default:vr(p,x,s)}i=i.sibling}}function Dd(n,i){var s=null;n!==null&&n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(s=n.memoizedState.cachePool.pool),n=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(n=i.memoizedState.cachePool.pool),n!==s&&(n!=null&&n.refCount++,s!=null&&qo(s))}function zd(n,i){n=null,i.alternate!==null&&(n=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==n&&(i.refCount++,n!=null&&qo(n))}function zn(n,i,s,c){if(i.subtreeFlags&10256)for(i=i.child;i!==null;)x0(n,i,s,c),i=i.sibling}function x0(n,i,s,c){var p=i.flags;switch(i.tag){case 0:case 11:case 15:zn(n,i,s,c),p&2048&&ts(9,i);break;case 1:zn(n,i,s,c);break;case 3:zn(n,i,s,c),p&2048&&(n=null,i.alternate!==null&&(n=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==n&&(i.refCount++,n!=null&&qo(n)));break;case 12:if(p&2048){zn(n,i,s,c),n=i.stateNode;try{var x=i.memoizedProps,E=x.id,T=x.onPostCommit;typeof T=="function"&&T(E,i.alternate===null?"mount":"update",n.passiveEffectDuration,-0)}catch(G){$e(i,i.return,G)}}else zn(n,i,s,c);break;case 31:zn(n,i,s,c);break;case 13:zn(n,i,s,c);break;case 23:break;case 22:x=i.stateNode,E=i.alternate,i.memoizedState!==null?x._visibility&2?zn(n,i,s,c):rs(n,i):x._visibility&2?zn(n,i,s,c):(x._visibility|=2,za(n,i,s,c,(i.subtreeFlags&10256)!==0||!1)),p&2048&&Dd(E,i);break;case 24:zn(n,i,s,c),p&2048&&zd(i.alternate,i);break;default:zn(n,i,s,c)}}function za(n,i,s,c,p){for(p=p&&((i.subtreeFlags&10256)!==0||!1),i=i.child;i!==null;){var x=n,E=i,T=s,G=c,ee=E.flags;switch(E.tag){case 0:case 11:case 15:za(x,E,T,G,p),ts(8,E);break;case 23:break;case 22:var ae=E.stateNode;E.memoizedState!==null?ae._visibility&2?za(x,E,T,G,p):rs(x,E):(ae._visibility|=2,za(x,E,T,G,p)),p&&ee&2048&&Dd(E.alternate,E);break;case 24:za(x,E,T,G,p),p&&ee&2048&&zd(E.alternate,E);break;default:za(x,E,T,G,p)}i=i.sibling}}function rs(n,i){if(i.subtreeFlags&10256)for(i=i.child;i!==null;){var s=n,c=i,p=c.flags;switch(c.tag){case 22:rs(s,c),p&2048&&Dd(c.alternate,c);break;case 24:rs(s,c),p&2048&&zd(c.alternate,c);break;default:rs(s,c)}i=i.sibling}}var is=8192;function La(n,i,s){if(n.subtreeFlags&is)for(n=n.child;n!==null;)v0(n,i,s),n=n.sibling}function v0(n,i,s){switch(n.tag){case 26:La(n,i,s),n.flags&is&&n.memoizedState!==null&&$_(s,Dn,n.memoizedState,n.memoizedProps);break;case 5:La(n,i,s);break;case 3:case 4:var c=Dn;Dn=ku(n.stateNode.containerInfo),La(n,i,s),Dn=c;break;case 22:n.memoizedState===null&&(c=n.alternate,c!==null&&c.memoizedState!==null?(c=is,is=16777216,La(n,i,s),is=c):La(n,i,s));break;default:La(n,i,s)}}function b0(n){var i=n.alternate;if(i!==null&&(n=i.child,n!==null)){i.child=null;do i=n.sibling,n.sibling=null,n=i;while(n!==null)}}function as(n){var i=n.deletions;if((n.flags&16)!==0){if(i!==null)for(var s=0;s<i.length;s++){var c=i[s];Ct=c,w0(c,n)}b0(n)}if(n.subtreeFlags&10256)for(n=n.child;n!==null;)S0(n),n=n.sibling}function S0(n){switch(n.tag){case 0:case 11:case 15:as(n),n.flags&2048&&Yr(9,n,n.return);break;case 3:as(n);break;case 12:as(n);break;case 22:var i=n.stateNode;n.memoizedState!==null&&i._visibility&2&&(n.return===null||n.return.tag!==13)?(i._visibility&=-3,mu(n)):as(n);break;default:as(n)}}function mu(n){var i=n.deletions;if((n.flags&16)!==0){if(i!==null)for(var s=0;s<i.length;s++){var c=i[s];Ct=c,w0(c,n)}b0(n)}for(n=n.child;n!==null;){switch(i=n,i.tag){case 0:case 11:case 15:Yr(8,i,i.return),mu(i);break;case 22:s=i.stateNode,s._visibility&2&&(s._visibility&=-3,mu(i));break;default:mu(i)}n=n.sibling}}function w0(n,i){for(;Ct!==null;){var s=Ct;switch(s.tag){case 0:case 11:case 15:Yr(8,s,i);break;case 23:case 22:if(s.memoizedState!==null&&s.memoizedState.cachePool!==null){var c=s.memoizedState.cachePool.pool;c!=null&&c.refCount++}break;case 24:qo(s.memoizedState.cache)}if(c=s.child,c!==null)c.return=s,Ct=c;else e:for(s=n;Ct!==null;){c=Ct;var p=c.sibling,x=c.return;if(d0(c),c===s){Ct=null;break e}if(p!==null){p.return=x,Ct=p;break e}Ct=x}}}var u_={getCacheForType:function(n){var i=kt(gt),s=i.data.get(n);return s===void 0&&(s=n(),i.data.set(n,s)),s},cacheSignal:function(){return kt(gt).controller.signal}},c_=typeof WeakMap=="function"?WeakMap:Map,Fe=0,We=null,je=null,ze=0,Ge=0,fn=null,Xr=!1,Ba=!1,Ld=!1,br=0,ft=0,Gr=0,Bi=0,Bd=0,dn=0,Ia=0,os=null,Qt=null,Id=!1,gu=0,E0=0,yu=1/0,xu=null,$r=null,Et=0,Qr=null,Ha=null,Sr=0,Hd=0,Pd=null,C0=null,ss=0,Ud=null;function hn(){return(Fe&2)!==0&&ze!==0?ze&-ze:j.T!==null?Gd():wl()}function _0(){if(dn===0)if((ze&536870912)===0||Ie){var n=la;la<<=1,(la&3932160)===0&&(la=262144),dn=n}else dn=536870912;return n=un.current,n!==null&&(n.flags|=32),dn}function Zt(n,i,s){(n===We&&(Ge===2||Ge===9)||n.cancelPendingCommit!==null)&&(Pa(n,0),Zr(n,ze,dn,!1)),xi(n,s),((Fe&2)===0||n!==We)&&(n===We&&((Fe&2)===0&&(Bi|=s),ft===4&&Zr(n,ze,dn,!1)),Xn(n))}function N0(n,i,s){if((Fe&6)!==0)throw Error(a(327));var c=!s&&(i&127)===0&&(i&n.expiredLanes)===0||yi(n,i),p=c?h_(n,i):Vd(n,i,!0),x=c;do{if(p===0){Ba&&!c&&Zr(n,i,0,!1);break}else{if(s=n.current.alternate,x&&!f_(s)){p=Vd(n,i,!1),x=!1;continue}if(p===2){if(x=i,n.errorRecoveryDisabledLanes&x)var E=0;else E=n.pendingLanes&-536870913,E=E!==0?E:E&536870912?536870912:0;if(E!==0){i=E;e:{var T=n;p=os;var G=T.current.memoizedState.isDehydrated;if(G&&(Pa(T,E).flags|=256),E=Vd(T,E,!1),E!==2){if(Ld&&!G){T.errorRecoveryDisabledLanes|=x,Bi|=x,p=4;break e}x=Qt,Qt=p,x!==null&&(Qt===null?Qt=x:Qt.push.apply(Qt,x))}p=E}if(x=!1,p!==2)continue}}if(p===1){Pa(n,0),Zr(n,i,0,!0);break}e:{switch(c=n,x=p,x){case 0:case 1:throw Error(a(345));case 4:if((i&4194048)!==i)break;case 6:Zr(c,i,dn,!Xr);break e;case 2:Qt=null;break;case 3:case 5:break;default:throw Error(a(329))}if((i&62914560)===i&&(p=gu+300-Ne(),10<p)){if(Zr(c,i,dn,!Xr),ca(c,0,!0)!==0)break e;Sr=i,c.timeoutHandle=rx(M0.bind(null,c,s,Qt,xu,Id,i,dn,Bi,Ia,Xr,x,"Throttled",-0,0),p);break e}M0(c,s,Qt,xu,Id,i,dn,Bi,Ia,Xr,x,null,-0,0)}}break}while(!0);Xn(n)}function M0(n,i,s,c,p,x,E,T,G,ee,ae,se,ne,re){if(n.timeoutHandle=-1,se=i.subtreeFlags,se&8192||(se&16785408)===16785408){se={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:or},v0(i,x,se);var me=(x&62914560)===x?gu-Ne():(x&4194048)===x?E0-Ne():0;if(me=Q_(se,me),me!==null){Sr=x,n.cancelPendingCommit=me(z0.bind(null,n,i,x,s,c,p,E,T,G,ae,se,null,ne,re)),Zr(n,x,E,!ee);return}}z0(n,i,x,s,c,p,E,T,G)}function f_(n){for(var i=n;;){var s=i.tag;if((s===0||s===11||s===15)&&i.flags&16384&&(s=i.updateQueue,s!==null&&(s=s.stores,s!==null)))for(var c=0;c<s.length;c++){var p=s[c],x=p.getSnapshot;p=p.value;try{if(!sn(x(),p))return!1}catch{return!1}}if(s=i.child,i.subtreeFlags&16384&&s!==null)s.return=i,i=s;else{if(i===n)break;for(;i.sibling===null;){if(i.return===null||i.return===n)return!0;i=i.return}i.sibling.return=i.return,i=i.sibling}}return!0}function Zr(n,i,s,c){i&=~Bd,i&=~Bi,n.suspendedLanes|=i,n.pingedLanes&=~i,c&&(n.warmLanes|=i),c=n.expirationTimes;for(var p=i;0<p;){var x=31-Xe(p),E=1<<x;c[x]=-1,p&=~E}s!==0&&vl(n,s,i)}function vu(){return(Fe&6)===0?(ls(0),!1):!0}function qd(){if(je!==null){if(Ge===0)var n=je.return;else n=je,cr=ki=null,id(n),Aa=null,Fo=0,n=je;for(;n!==null;)i0(n.alternate,n),n=n.return;je=null}}function Pa(n,i){var s=n.timeoutHandle;s!==-1&&(n.timeoutHandle=-1,R_(s)),s=n.cancelPendingCommit,s!==null&&(n.cancelPendingCommit=null,s()),Sr=0,qd(),We=n,je=s=lr(n.current,null),ze=i,Ge=0,fn=null,Xr=!1,Ba=yi(n,i),Ld=!1,Ia=dn=Bd=Bi=Gr=ft=0,Qt=os=null,Id=!1,(i&8)!==0&&(i|=i&32);var c=n.entangledLanes;if(c!==0)for(n=n.entanglements,c&=i;0<c;){var p=31-Xe(c),x=1<<p;i|=n[p],c&=~x}return br=i,Pl(),s}function k0(n,i){ke=null,j.H=Jo,i===Ta||i===$l?(i=Fg(),Ge=3):i===Xf?(i=Fg(),Ge=4):Ge=i===bd?8:i!==null&&typeof i=="object"&&typeof i.then=="function"?6:1,fn=i,je===null&&(ft=1,lu(n,Sn(i,n.current)))}function T0(){var n=un.current;return n===null?!0:(ze&4194048)===ze?_n===null:(ze&62914560)===ze||(ze&536870912)!==0?n===_n:!1}function A0(){var n=j.H;return j.H=Jo,n===null?Jo:n}function R0(){var n=j.A;return j.A=u_,n}function bu(){ft=4,Xr||(ze&4194048)!==ze&&un.current!==null||(Ba=!0),(Gr&134217727)===0&&(Bi&134217727)===0||We===null||Zr(We,ze,dn,!1)}function Vd(n,i,s){var c=Fe;Fe|=2;var p=A0(),x=R0();(We!==n||ze!==i)&&(xu=null,Pa(n,i)),i=!1;var E=ft;e:do try{if(Ge!==0&&je!==null){var T=je,G=fn;switch(Ge){case 8:qd(),E=6;break e;case 3:case 2:case 9:case 6:un.current===null&&(i=!0);var ee=Ge;if(Ge=0,fn=null,Ua(n,T,G,ee),s&&Ba){E=0;break e}break;default:ee=Ge,Ge=0,fn=null,Ua(n,T,G,ee)}}d_(),E=ft;break}catch(ae){k0(n,ae)}while(!0);return i&&n.shellSuspendCounter++,cr=ki=null,Fe=c,j.H=p,j.A=x,je===null&&(We=null,ze=0,Pl()),E}function d_(){for(;je!==null;)O0(je)}function h_(n,i){var s=Fe;Fe|=2;var c=A0(),p=R0();We!==n||ze!==i?(xu=null,yu=Ne()+500,Pa(n,i)):Ba=yi(n,i);e:do try{if(Ge!==0&&je!==null){i=je;var x=fn;t:switch(Ge){case 1:Ge=0,fn=null,Ua(n,i,x,1);break;case 2:case 9:if(qg(x)){Ge=0,fn=null,j0(i);break}i=function(){Ge!==2&&Ge!==9||We!==n||(Ge=7),Xn(n)},x.then(i,i);break e;case 3:Ge=7;break e;case 4:Ge=5;break e;case 7:qg(x)?(Ge=0,fn=null,j0(i)):(Ge=0,fn=null,Ua(n,i,x,7));break;case 5:var E=null;switch(je.tag){case 26:E=je.memoizedState;case 5:case 27:var T=je;if(E?xx(E):T.stateNode.complete){Ge=0,fn=null;var G=T.sibling;if(G!==null)je=G;else{var ee=T.return;ee!==null?(je=ee,Su(ee)):je=null}break t}}Ge=0,fn=null,Ua(n,i,x,5);break;case 6:Ge=0,fn=null,Ua(n,i,x,6);break;case 8:qd(),ft=6;break e;default:throw Error(a(462))}}p_();break}catch(ae){k0(n,ae)}while(!0);return cr=ki=null,j.H=c,j.A=p,Fe=s,je!==null?0:(We=null,ze=0,Pl(),ft)}function p_(){for(;je!==null&&!An();)O0(je)}function O0(n){var i=n0(n.alternate,n,br);n.memoizedProps=n.pendingProps,i===null?Su(n):je=i}function j0(n){var i=n,s=i.alternate;switch(i.tag){case 15:case 0:i=Zy(s,i,i.pendingProps,i.type,void 0,ze);break;case 11:i=Zy(s,i,i.pendingProps,i.type.render,i.ref,ze);break;case 5:id(i);default:i0(s,i),i=je=Rg(i,br),i=n0(s,i,br)}n.memoizedProps=n.pendingProps,i===null?Su(n):je=i}function Ua(n,i,s,c){cr=ki=null,id(i),Aa=null,Fo=0;var p=i.return;try{if(n_(n,p,i,s,ze)){ft=1,lu(n,Sn(s,n.current)),je=null;return}}catch(x){if(p!==null)throw je=p,x;ft=1,lu(n,Sn(s,n.current)),je=null;return}i.flags&32768?(Ie||c===1?n=!0:Ba||(ze&536870912)!==0?n=!1:(Xr=n=!0,(c===2||c===9||c===3||c===6)&&(c=un.current,c!==null&&c.tag===13&&(c.flags|=16384))),D0(i,n)):Su(i)}function Su(n){var i=n;do{if((i.flags&32768)!==0){D0(i,Xr);return}n=i.return;var s=a_(i.alternate,i,br);if(s!==null){je=s;return}if(i=i.sibling,i!==null){je=i;return}je=i=n}while(i!==null);ft===0&&(ft=5)}function D0(n,i){do{var s=o_(n.alternate,n);if(s!==null){s.flags&=32767,je=s;return}if(s=n.return,s!==null&&(s.flags|=32768,s.subtreeFlags=0,s.deletions=null),!i&&(n=n.sibling,n!==null)){je=n;return}je=n=s}while(n!==null);ft=6,je=null}function z0(n,i,s,c,p,x,E,T,G){n.cancelPendingCommit=null;do wu();while(Et!==0);if((Fe&6)!==0)throw Error(a(327));if(i!==null){if(i===n.current)throw Error(a(177));if(x=i.lanes|i.childLanes,x|=Rf,sf(n,s,x,E,T,G),n===We&&(je=We=null,ze=0),Ha=i,Qr=n,Sr=s,Hd=x,Pd=p,C0=c,(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?(n.callbackNode=null,n.callbackPriority=0,x_(Ee,function(){return P0(),null})):(n.callbackNode=null,n.callbackPriority=0),c=(i.flags&13878)!==0,(i.subtreeFlags&13878)!==0||c){c=j.T,j.T=null,p=F.p,F.p=2,E=Fe,Fe|=4;try{s_(n,i,s)}finally{Fe=E,F.p=p,j.T=c}}Et=1,L0(),B0(),I0()}}function L0(){if(Et===1){Et=0;var n=Qr,i=Ha,s=(i.flags&13878)!==0;if((i.subtreeFlags&13878)!==0||s){s=j.T,j.T=null;var c=F.p;F.p=2;var p=Fe;Fe|=4;try{g0(i,n);var x=th,E=wg(n.containerInfo),T=x.focusedElem,G=x.selectionRange;if(E!==T&&T&&T.ownerDocument&&Sg(T.ownerDocument.documentElement,T)){if(G!==null&&Nf(T)){var ee=G.start,ae=G.end;if(ae===void 0&&(ae=ee),"selectionStart"in T)T.selectionStart=ee,T.selectionEnd=Math.min(ae,T.value.length);else{var se=T.ownerDocument||document,ne=se&&se.defaultView||window;if(ne.getSelection){var re=ne.getSelection(),me=T.textContent.length,Ce=Math.min(G.start,me),Je=G.end===void 0?Ce:Math.min(G.end,me);!re.extend&&Ce>Je&&(E=Je,Je=Ce,Ce=E);var J=bg(T,Ce),Q=bg(T,Je);if(J&&Q&&(re.rangeCount!==1||re.anchorNode!==J.node||re.anchorOffset!==J.offset||re.focusNode!==Q.node||re.focusOffset!==Q.offset)){var W=se.createRange();W.setStart(J.node,J.offset),re.removeAllRanges(),Ce>Je?(re.addRange(W),re.extend(Q.node,Q.offset)):(W.setEnd(Q.node,Q.offset),re.addRange(W))}}}}for(se=[],re=T;re=re.parentNode;)re.nodeType===1&&se.push({element:re,left:re.scrollLeft,top:re.scrollTop});for(typeof T.focus=="function"&&T.focus(),T=0;T<se.length;T++){var oe=se[T];oe.element.scrollLeft=oe.left,oe.element.scrollTop=oe.top}}Du=!!eh,th=eh=null}finally{Fe=p,F.p=c,j.T=s}}n.current=i,Et=2}}function B0(){if(Et===2){Et=0;var n=Qr,i=Ha,s=(i.flags&8772)!==0;if((i.subtreeFlags&8772)!==0||s){s=j.T,j.T=null;var c=F.p;F.p=2;var p=Fe;Fe|=4;try{f0(n,i.alternate,i)}finally{Fe=p,F.p=c,j.T=s}}Et=3}}function I0(){if(Et===4||Et===3){Et=0,vn();var n=Qr,i=Ha,s=Sr,c=C0;(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?Et=5:(Et=0,Ha=Qr=null,H0(n,n.pendingLanes));var p=n.pendingLanes;if(p===0&&($r=null),Mo(s),i=i.stateNode,dt&&typeof dt.onCommitFiberRoot=="function")try{dt.onCommitFiberRoot(Nt,i,void 0,(i.current.flags&128)===128)}catch{}if(c!==null){i=j.T,p=F.p,F.p=2,j.T=null;try{for(var x=n.onRecoverableError,E=0;E<c.length;E++){var T=c[E];x(T.value,{componentStack:T.stack})}}finally{j.T=i,F.p=p}}(Sr&3)!==0&&wu(),Xn(n),p=n.pendingLanes,(s&261930)!==0&&(p&42)!==0?n===Ud?ss++:(ss=0,Ud=n):ss=0,ls(0)}}function H0(n,i){(n.pooledCacheLanes&=i)===0&&(i=n.pooledCache,i!=null&&(n.pooledCache=null,qo(i)))}function wu(){return L0(),B0(),I0(),P0()}function P0(){if(Et!==5)return!1;var n=Qr,i=Hd;Hd=0;var s=Mo(Sr),c=j.T,p=F.p;try{F.p=32>s?32:s,j.T=null,s=Pd,Pd=null;var x=Qr,E=Sr;if(Et=0,Ha=Qr=null,Sr=0,(Fe&6)!==0)throw Error(a(331));var T=Fe;if(Fe|=4,S0(x.current),x0(x,x.current,E,s),Fe=T,ls(0,!1),dt&&typeof dt.onPostCommitFiberRoot=="function")try{dt.onPostCommitFiberRoot(Nt,x)}catch{}return!0}finally{F.p=p,j.T=c,H0(n,i)}}function U0(n,i,s){i=Sn(s,i),i=vd(n.stateNode,i,2),n=qr(n,i,2),n!==null&&(xi(n,2),Xn(n))}function $e(n,i,s){if(n.tag===3)U0(n,n,s);else for(;i!==null;){if(i.tag===3){U0(i,n,s);break}else if(i.tag===1){var c=i.stateNode;if(typeof i.type.getDerivedStateFromError=="function"||typeof c.componentDidCatch=="function"&&($r===null||!$r.has(c))){n=Sn(s,n),s=qy(2),c=qr(i,s,2),c!==null&&(Vy(s,c,i,n),xi(c,2),Xn(c));break}}i=i.return}}function Fd(n,i,s){var c=n.pingCache;if(c===null){c=n.pingCache=new c_;var p=new Set;c.set(i,p)}else p=c.get(i),p===void 0&&(p=new Set,c.set(i,p));p.has(s)||(Ld=!0,p.add(s),n=m_.bind(null,n,i,s),i.then(n,n))}function m_(n,i,s){var c=n.pingCache;c!==null&&c.delete(i),n.pingedLanes|=n.suspendedLanes&s,n.warmLanes&=~s,We===n&&(ze&s)===s&&(ft===4||ft===3&&(ze&62914560)===ze&&300>Ne()-gu?(Fe&2)===0&&Pa(n,0):Bd|=s,Ia===ze&&(Ia=0)),Xn(n)}function q0(n,i){i===0&&(i=xl()),n=_i(n,i),n!==null&&(xi(n,i),Xn(n))}function g_(n){var i=n.memoizedState,s=0;i!==null&&(s=i.retryLane),q0(n,s)}function y_(n,i){var s=0;switch(n.tag){case 31:case 13:var c=n.stateNode,p=n.memoizedState;p!==null&&(s=p.retryLane);break;case 19:c=n.stateNode;break;case 22:c=n.stateNode._retryCache;break;default:throw Error(a(314))}c!==null&&c.delete(i),q0(n,s)}function x_(n,i){return Ot(n,i)}var Eu=null,qa=null,Yd=!1,Cu=!1,Xd=!1,Kr=0;function Xn(n){n!==qa&&n.next===null&&(qa===null?Eu=qa=n:qa=qa.next=n),Cu=!0,Yd||(Yd=!0,b_())}function ls(n,i){if(!Xd&&Cu){Xd=!0;do for(var s=!1,c=Eu;c!==null;){if(n!==0){var p=c.pendingLanes;if(p===0)var x=0;else{var E=c.suspendedLanes,T=c.pingedLanes;x=(1<<31-Xe(42|n)+1)-1,x&=p&~(E&~T),x=x&201326741?x&201326741|1:x?x|2:0}x!==0&&(s=!0,X0(c,x))}else x=ze,x=ca(c,c===We?x:0,c.cancelPendingCommit!==null||c.timeoutHandle!==-1),(x&3)===0||yi(c,x)||(s=!0,X0(c,x));c=c.next}while(s);Xd=!1}}function v_(){V0()}function V0(){Cu=Yd=!1;var n=0;Kr!==0&&A_()&&(n=Kr);for(var i=Ne(),s=null,c=Eu;c!==null;){var p=c.next,x=F0(c,i);x===0?(c.next=null,s===null?Eu=p:s.next=p,p===null&&(qa=s)):(s=c,(n!==0||(x&3)!==0)&&(Cu=!0)),c=p}Et!==0&&Et!==5||ls(n),Kr!==0&&(Kr=0)}function F0(n,i){for(var s=n.suspendedLanes,c=n.pingedLanes,p=n.expirationTimes,x=n.pendingLanes&-62914561;0<x;){var E=31-Xe(x),T=1<<E,G=p[E];G===-1?((T&s)===0||(T&c)!==0)&&(p[E]=of(T,i)):G<=i&&(n.expiredLanes|=T),x&=~T}if(i=We,s=ze,s=ca(n,n===i?s:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),c=n.callbackNode,s===0||n===i&&(Ge===2||Ge===9)||n.cancelPendingCommit!==null)return c!==null&&c!==null&&qt(c),n.callbackNode=null,n.callbackPriority=0;if((s&3)===0||yi(n,s)){if(i=s&-s,i===n.callbackPriority)return i;switch(c!==null&&qt(c),Mo(s)){case 2:case 8:s=he;break;case 32:s=Ee;break;case 268435456:s=Pe;break;default:s=Ee}return c=Y0.bind(null,n),s=Ot(s,c),n.callbackPriority=i,n.callbackNode=s,i}return c!==null&&c!==null&&qt(c),n.callbackPriority=2,n.callbackNode=null,2}function Y0(n,i){if(Et!==0&&Et!==5)return n.callbackNode=null,n.callbackPriority=0,null;var s=n.callbackNode;if(wu()&&n.callbackNode!==s)return null;var c=ze;return c=ca(n,n===We?c:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),c===0?null:(N0(n,c,i),F0(n,Ne()),n.callbackNode!=null&&n.callbackNode===s?Y0.bind(null,n):null)}function X0(n,i){if(wu())return null;N0(n,i,!0)}function b_(){O_(function(){(Fe&6)!==0?Ot(ie,v_):V0()})}function Gd(){if(Kr===0){var n=Ma;n===0&&(n=sa,sa<<=1,(sa&261888)===0&&(sa=256)),Kr=n}return Kr}function G0(n){return n==null||typeof n=="symbol"||typeof n=="boolean"?null:typeof n=="function"?n:Ol(""+n)}function $0(n,i){var s=i.ownerDocument.createElement("input");return s.name=i.name,s.value=i.value,n.id&&s.setAttribute("form",n.id),i.parentNode.insertBefore(s,i),n=new FormData(n),s.parentNode.removeChild(s),n}function S_(n,i,s,c,p){if(i==="submit"&&s&&s.stateNode===p){var x=G0((p[Dt]||null).action),E=c.submitter;E&&(i=(i=E[Dt]||null)?G0(i.formAction):E.getAttribute("formAction"),i!==null&&(x=i,E=null));var T=new Ll("action","action",null,c,p);n.push({event:T,listeners:[{instance:null,listener:function(){if(c.defaultPrevented){if(Kr!==0){var G=E?$0(p,E):new FormData(p);hd(s,{pending:!0,data:G,method:p.method,action:x},null,G)}}else typeof x=="function"&&(T.preventDefault(),G=E?$0(p,E):new FormData(p),hd(s,{pending:!0,data:G,method:p.method,action:x},x,G))},currentTarget:p}]})}}for(var $d=0;$d<Af.length;$d++){var Qd=Af[$d],w_=Qd.toLowerCase(),E_=Qd[0].toUpperCase()+Qd.slice(1);jn(w_,"on"+E_)}jn(_g,"onAnimationEnd"),jn(Ng,"onAnimationIteration"),jn(Mg,"onAnimationStart"),jn("dblclick","onDoubleClick"),jn("focusin","onFocus"),jn("focusout","onBlur"),jn(HC,"onTransitionRun"),jn(PC,"onTransitionStart"),jn(UC,"onTransitionCancel"),jn(kg,"onTransitionEnd"),Dr("onMouseEnter",["mouseout","mouseover"]),Dr("onMouseLeave",["mouseout","mouseover"]),Dr("onPointerEnter",["pointerout","pointerover"]),Dr("onPointerLeave",["pointerout","pointerover"]),ir("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),ir("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),ir("onBeforeInput",["compositionend","keypress","textInput","paste"]),ir("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),ir("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),ir("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var us="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(" "),C_=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(us));function Q0(n,i){i=(i&4)!==0;for(var s=0;s<n.length;s++){var c=n[s],p=c.event;c=c.listeners;e:{var x=void 0;if(i)for(var E=c.length-1;0<=E;E--){var T=c[E],G=T.instance,ee=T.currentTarget;if(T=T.listener,G!==x&&p.isPropagationStopped())break e;x=T,p.currentTarget=ee;try{x(p)}catch(ae){Hl(ae)}p.currentTarget=null,x=G}else for(E=0;E<c.length;E++){if(T=c[E],G=T.instance,ee=T.currentTarget,T=T.listener,G!==x&&p.isPropagationStopped())break e;x=T,p.currentTarget=ee;try{x(p)}catch(ae){Hl(ae)}p.currentTarget=null,x=G}}}}function De(n,i){var s=i[fa];s===void 0&&(s=i[fa]=new Set);var c=n+"__bubble";s.has(c)||(Z0(i,n,2,!1),s.add(c))}function Zd(n,i,s){var c=0;i&&(c|=4),Z0(s,n,c,i)}var _u="_reactListening"+Math.random().toString(36).slice(2);function Kd(n){if(!n[_u]){n[_u]=!0,Nl.forEach(function(s){s!=="selectionchange"&&(C_.has(s)||Zd(s,!1,n),Zd(s,!0,n))});var i=n.nodeType===9?n:n.ownerDocument;i===null||i[_u]||(i[_u]=!0,Zd("selectionchange",!1,i))}}function Z0(n,i,s,c){switch(_x(i)){case 2:var p=J_;break;case 8:p=W_;break;default:p=dh}s=p.bind(null,i,s,n),p=void 0,!yf||i!=="touchstart"&&i!=="touchmove"&&i!=="wheel"||(p=!0),c?p!==void 0?n.addEventListener(i,s,{capture:!0,passive:p}):n.addEventListener(i,s,!0):p!==void 0?n.addEventListener(i,s,{passive:p}):n.addEventListener(i,s,!1)}function Jd(n,i,s,c,p){var x=c;if((i&1)===0&&(i&2)===0&&c!==null)e:for(;;){if(c===null)return;var E=c.tag;if(E===3||E===4){var T=c.stateNode.containerInfo;if(T===p)break;if(E===4)for(E=c.return;E!==null;){var G=E.tag;if((G===3||G===4)&&E.stateNode.containerInfo===p)return;E=E.return}for(;T!==null;){if(E=Ar(T),E===null)return;if(G=E.tag,G===5||G===6||G===26||G===27){c=x=E;continue e}T=T.parentNode}}c=c.return}tg(function(){var ee=x,ae=mf(s),se=[];e:{var ne=Tg.get(n);if(ne!==void 0){var re=Ll,me=n;switch(n){case"keypress":if(Dl(s)===0)break e;case"keydown":case"keyup":re=yC;break;case"focusin":me="focus",re=Sf;break;case"focusout":me="blur",re=Sf;break;case"beforeblur":case"afterblur":re=Sf;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":re=ig;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":re=aC;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":re=bC;break;case _g:case Ng:case Mg:re=lC;break;case kg:re=wC;break;case"scroll":case"scrollend":re=rC;break;case"wheel":re=CC;break;case"copy":case"cut":case"paste":re=cC;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":re=og;break;case"toggle":case"beforetoggle":re=NC}var Ce=(i&4)!==0,Je=!Ce&&(n==="scroll"||n==="scrollend"),J=Ce?ne!==null?ne+"Capture":null:ne;Ce=[];for(var Q=ee,W;Q!==null;){var oe=Q;if(W=oe.stateNode,oe=oe.tag,oe!==5&&oe!==26&&oe!==27||W===null||J===null||(oe=Ro(Q,J),oe!=null&&Ce.push(cs(Q,oe,W))),Je)break;Q=Q.return}0<Ce.length&&(ne=new re(ne,me,null,s,ae),se.push({event:ne,listeners:Ce}))}}if((i&7)===0){e:{if(ne=n==="mouseover"||n==="pointerover",re=n==="mouseout"||n==="pointerout",ne&&s!==pf&&(me=s.relatedTarget||s.fromElement)&&(Ar(me)||me[rr]))break e;if((re||ne)&&(ne=ae.window===ae?ae:(ne=ae.ownerDocument)?ne.defaultView||ne.parentWindow:window,re?(me=s.relatedTarget||s.toElement,re=ee,me=me?Ar(me):null,me!==null&&(Je=l(me),Ce=me.tag,me!==Je||Ce!==5&&Ce!==27&&Ce!==6)&&(me=null)):(re=null,me=ee),re!==me)){if(Ce=ig,oe="onMouseLeave",J="onMouseEnter",Q="mouse",(n==="pointerout"||n==="pointerover")&&(Ce=og,oe="onPointerLeave",J="onPointerEnter",Q="pointer"),Je=re==null?ne:Or(re),W=me==null?ne:Or(me),ne=new Ce(oe,Q+"leave",re,s,ae),ne.target=Je,ne.relatedTarget=W,oe=null,Ar(ae)===ee&&(Ce=new Ce(J,Q+"enter",me,s,ae),Ce.target=W,Ce.relatedTarget=Je,oe=Ce),Je=oe,re&&me)t:{for(Ce=__,J=re,Q=me,W=0,oe=J;oe;oe=Ce(oe))W++;oe=0;for(var xe=Q;xe;xe=Ce(xe))oe++;for(;0<W-oe;)J=Ce(J),W--;for(;0<oe-W;)Q=Ce(Q),oe--;for(;W--;){if(J===Q||Q!==null&&J===Q.alternate){Ce=J;break t}J=Ce(J),Q=Ce(Q)}Ce=null}else Ce=null;re!==null&&K0(se,ne,re,Ce,!1),me!==null&&Je!==null&&K0(se,Je,me,Ce,!0)}}e:{if(ne=ee?Or(ee):window,re=ne.nodeName&&ne.nodeName.toLowerCase(),re==="select"||re==="input"&&ne.type==="file")var qe=pg;else if(dg(ne))if(mg)qe=LC;else{qe=DC;var ge=jC}else re=ne.nodeName,!re||re.toLowerCase()!=="input"||ne.type!=="checkbox"&&ne.type!=="radio"?ee&&hf(ee.elementType)&&(qe=pg):qe=zC;if(qe&&(qe=qe(n,ee))){hg(se,qe,s,ae);break e}ge&&ge(n,ne,ee),n==="focusout"&&ee&&ne.type==="number"&&ee.memoizedProps.value!=null&&Ao(ne,"number",ne.value)}switch(ge=ee?Or(ee):window,n){case"focusin":(dg(ge)||ge.contentEditable==="true")&&(va=ge,Mf=ee,Ho=null);break;case"focusout":Ho=Mf=va=null;break;case"mousedown":kf=!0;break;case"contextmenu":case"mouseup":case"dragend":kf=!1,Eg(se,s,ae);break;case"selectionchange":if(IC)break;case"keydown":case"keyup":Eg(se,s,ae)}var Te;if(Ef)e:{switch(n){case"compositionstart":var Le="onCompositionStart";break e;case"compositionend":Le="onCompositionEnd";break e;case"compositionupdate":Le="onCompositionUpdate";break e}Le=void 0}else xa?cg(n,s)&&(Le="onCompositionEnd"):n==="keydown"&&s.keyCode===229&&(Le="onCompositionStart");Le&&(sg&&s.locale!=="ko"&&(xa||Le!=="onCompositionStart"?Le==="onCompositionEnd"&&xa&&(Te=ng()):(zr=ae,xf="value"in zr?zr.value:zr.textContent,xa=!0)),ge=Nu(ee,Le),0<ge.length&&(Le=new ag(Le,n,null,s,ae),se.push({event:Le,listeners:ge}),Te?Le.data=Te:(Te=fg(s),Te!==null&&(Le.data=Te)))),(Te=kC?TC(n,s):AC(n,s))&&(Le=Nu(ee,"onBeforeInput"),0<Le.length&&(ge=new ag("onBeforeInput","beforeinput",null,s,ae),se.push({event:ge,listeners:Le}),ge.data=Te)),S_(se,n,ee,s,ae)}Q0(se,i)})}function cs(n,i,s){return{instance:n,listener:i,currentTarget:s}}function Nu(n,i){for(var s=i+"Capture",c=[];n!==null;){var p=n,x=p.stateNode;if(p=p.tag,p!==5&&p!==26&&p!==27||x===null||(p=Ro(n,s),p!=null&&c.unshift(cs(n,p,x)),p=Ro(n,i),p!=null&&c.push(cs(n,p,x))),n.tag===3)return c;n=n.return}return[]}function __(n){if(n===null)return null;do n=n.return;while(n&&n.tag!==5&&n.tag!==27);return n||null}function K0(n,i,s,c,p){for(var x=i._reactName,E=[];s!==null&&s!==c;){var T=s,G=T.alternate,ee=T.stateNode;if(T=T.tag,G!==null&&G===c)break;T!==5&&T!==26&&T!==27||ee===null||(G=ee,p?(ee=Ro(s,x),ee!=null&&E.unshift(cs(s,ee,G))):p||(ee=Ro(s,x),ee!=null&&E.push(cs(s,ee,G)))),s=s.return}E.length!==0&&n.push({event:i,listeners:E})}var N_=/\r\n?/g,M_=/\u0000|\uFFFD/g;function J0(n){return(typeof n=="string"?n:""+n).replace(N_,`
|
|
9
|
-
`).replace(M_,"")}function W0(n,i){return i=J0(i),J0(n)===i}function Ke(n,i,s,c,p,x){switch(s){case"children":typeof c=="string"?i==="body"||i==="textarea"&&c===""||ma(n,c):(typeof c=="number"||typeof c=="bigint")&&i!=="body"&&ma(n,""+c);break;case"className":ha(n,"class",c);break;case"tabIndex":ha(n,"tabindex",c);break;case"dir":case"role":case"viewBox":case"width":case"height":ha(n,s,c);break;case"style":Wm(n,c,x);break;case"data":if(i!=="object"){ha(n,"data",c);break}case"src":case"href":if(c===""&&(i!=="a"||s!=="href")){n.removeAttribute(s);break}if(c==null||typeof c=="function"||typeof c=="symbol"||typeof c=="boolean"){n.removeAttribute(s);break}c=Ol(""+c),n.setAttribute(s,c);break;case"action":case"formAction":if(typeof c=="function"){n.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 x=="function"&&(s==="formAction"?(i!=="input"&&Ke(n,i,"name",p.name,p,null),Ke(n,i,"formEncType",p.formEncType,p,null),Ke(n,i,"formMethod",p.formMethod,p,null),Ke(n,i,"formTarget",p.formTarget,p,null)):(Ke(n,i,"encType",p.encType,p,null),Ke(n,i,"method",p.method,p,null),Ke(n,i,"target",p.target,p,null)));if(c==null||typeof c=="symbol"||typeof c=="boolean"){n.removeAttribute(s);break}c=Ol(""+c),n.setAttribute(s,c);break;case"onClick":c!=null&&(n.onclick=or);break;case"onScroll":c!=null&&De("scroll",n);break;case"onScrollEnd":c!=null&&De("scrollend",n);break;case"dangerouslySetInnerHTML":if(c!=null){if(typeof c!="object"||!("__html"in c))throw Error(a(61));if(s=c.__html,s!=null){if(p.children!=null)throw Error(a(60));n.innerHTML=s}}break;case"multiple":n.multiple=c&&typeof c!="function"&&typeof c!="symbol";break;case"muted":n.muted=c&&typeof c!="function"&&typeof c!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(c==null||typeof c=="function"||typeof c=="boolean"||typeof c=="symbol"){n.removeAttribute("xlink:href");break}s=Ol(""+c),n.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":c!=null&&typeof c!="function"&&typeof c!="symbol"?n.setAttribute(s,""+c):n.removeAttribute(s);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":c&&typeof c!="function"&&typeof c!="symbol"?n.setAttribute(s,""):n.removeAttribute(s);break;case"capture":case"download":c===!0?n.setAttribute(s,""):c!==!1&&c!=null&&typeof c!="function"&&typeof c!="symbol"?n.setAttribute(s,c):n.removeAttribute(s);break;case"cols":case"rows":case"size":case"span":c!=null&&typeof c!="function"&&typeof c!="symbol"&&!isNaN(c)&&1<=c?n.setAttribute(s,c):n.removeAttribute(s);break;case"rowSpan":case"start":c==null||typeof c=="function"||typeof c=="symbol"||isNaN(c)?n.removeAttribute(s):n.setAttribute(s,c);break;case"popover":De("beforetoggle",n),De("toggle",n),da(n,"popover",c);break;case"xlinkActuate":On(n,"http://www.w3.org/1999/xlink","xlink:actuate",c);break;case"xlinkArcrole":On(n,"http://www.w3.org/1999/xlink","xlink:arcrole",c);break;case"xlinkRole":On(n,"http://www.w3.org/1999/xlink","xlink:role",c);break;case"xlinkShow":On(n,"http://www.w3.org/1999/xlink","xlink:show",c);break;case"xlinkTitle":On(n,"http://www.w3.org/1999/xlink","xlink:title",c);break;case"xlinkType":On(n,"http://www.w3.org/1999/xlink","xlink:type",c);break;case"xmlBase":On(n,"http://www.w3.org/XML/1998/namespace","xml:base",c);break;case"xmlLang":On(n,"http://www.w3.org/XML/1998/namespace","xml:lang",c);break;case"xmlSpace":On(n,"http://www.w3.org/XML/1998/namespace","xml:space",c);break;case"is":da(n,"is",c);break;case"innerText":case"textContent":break;default:(!(2<s.length)||s[0]!=="o"&&s[0]!=="O"||s[1]!=="n"&&s[1]!=="N")&&(s=tC.get(s)||s,da(n,s,c))}}function Wd(n,i,s,c,p,x){switch(s){case"style":Wm(n,c,x);break;case"dangerouslySetInnerHTML":if(c!=null){if(typeof c!="object"||!("__html"in c))throw Error(a(61));if(s=c.__html,s!=null){if(p.children!=null)throw Error(a(60));n.innerHTML=s}}break;case"children":typeof c=="string"?ma(n,c):(typeof c=="number"||typeof c=="bigint")&&ma(n,""+c);break;case"onScroll":c!=null&&De("scroll",n);break;case"onScrollEnd":c!=null&&De("scrollend",n);break;case"onClick":c!=null&&(n.onclick=or);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Ml.hasOwnProperty(s))e:{if(s[0]==="o"&&s[1]==="n"&&(p=s.endsWith("Capture"),i=s.slice(2,p?s.length-7:void 0),x=n[Dt]||null,x=x!=null?x[s]:null,typeof x=="function"&&n.removeEventListener(i,x,p),typeof c=="function")){typeof x!="function"&&x!==null&&(s in n?n[s]=null:n.hasAttribute(s)&&n.removeAttribute(s)),n.addEventListener(i,c,p);break e}s in n?n[s]=c:c===!0?n.setAttribute(s,""):da(n,s,c)}}}function At(n,i,s){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":De("error",n),De("load",n);var c=!1,p=!1,x;for(x in s)if(s.hasOwnProperty(x)){var E=s[x];if(E!=null)switch(x){case"src":c=!0;break;case"srcSet":p=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(a(137,i));default:Ke(n,i,x,E,s,null)}}p&&Ke(n,i,"srcSet",s.srcSet,s,null),c&&Ke(n,i,"src",s.src,s,null);return;case"input":De("invalid",n);var T=x=E=p=null,G=null,ee=null;for(c in s)if(s.hasOwnProperty(c)){var ae=s[c];if(ae!=null)switch(c){case"name":p=ae;break;case"type":E=ae;break;case"checked":G=ae;break;case"defaultChecked":ee=ae;break;case"value":x=ae;break;case"defaultValue":T=ae;break;case"children":case"dangerouslySetInnerHTML":if(ae!=null)throw Error(a(137,i));break;default:Ke(n,i,c,ae,s,null)}}Rl(n,x,T,G,ee,E,p,!1);return;case"select":De("invalid",n),c=E=x=null;for(p in s)if(s.hasOwnProperty(p)&&(T=s[p],T!=null))switch(p){case"value":x=T;break;case"defaultValue":E=T;break;case"multiple":c=T;default:Ke(n,i,p,T,s,null)}i=x,s=E,n.multiple=!!c,i!=null?ar(n,!!c,i,!1):s!=null&&ar(n,!!c,s,!0);return;case"textarea":De("invalid",n),x=p=c=null;for(E in s)if(s.hasOwnProperty(E)&&(T=s[E],T!=null))switch(E){case"value":c=T;break;case"defaultValue":p=T;break;case"children":x=T;break;case"dangerouslySetInnerHTML":if(T!=null)throw Error(a(91));break;default:Ke(n,i,E,T,s,null)}Km(n,c,p,x);return;case"option":for(G in s)s.hasOwnProperty(G)&&(c=s[G],c!=null)&&(G==="selected"?n.selected=c&&typeof c!="function"&&typeof c!="symbol":Ke(n,i,G,c,s,null));return;case"dialog":De("beforetoggle",n),De("toggle",n),De("cancel",n),De("close",n);break;case"iframe":case"object":De("load",n);break;case"video":case"audio":for(c=0;c<us.length;c++)De(us[c],n);break;case"image":De("error",n),De("load",n);break;case"details":De("toggle",n);break;case"embed":case"source":case"link":De("error",n),De("load",n);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(ee in s)if(s.hasOwnProperty(ee)&&(c=s[ee],c!=null))switch(ee){case"children":case"dangerouslySetInnerHTML":throw Error(a(137,i));default:Ke(n,i,ee,c,s,null)}return;default:if(hf(i)){for(ae in s)s.hasOwnProperty(ae)&&(c=s[ae],c!==void 0&&Wd(n,i,ae,c,s,void 0));return}}for(T in s)s.hasOwnProperty(T)&&(c=s[T],c!=null&&Ke(n,i,T,c,s,null))}function k_(n,i,s,c){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var p=null,x=null,E=null,T=null,G=null,ee=null,ae=null;for(re in s){var se=s[re];if(s.hasOwnProperty(re)&&se!=null)switch(re){case"checked":break;case"value":break;case"defaultValue":G=se;default:c.hasOwnProperty(re)||Ke(n,i,re,null,c,se)}}for(var ne in c){var re=c[ne];if(se=s[ne],c.hasOwnProperty(ne)&&(re!=null||se!=null))switch(ne){case"type":x=re;break;case"name":p=re;break;case"checked":ee=re;break;case"defaultChecked":ae=re;break;case"value":E=re;break;case"defaultValue":T=re;break;case"children":case"dangerouslySetInnerHTML":if(re!=null)throw Error(a(137,i));break;default:re!==se&&Ke(n,i,ne,re,c,se)}}Si(n,E,T,G,ee,ae,x,p);return;case"select":re=E=T=ne=null;for(x in s)if(G=s[x],s.hasOwnProperty(x)&&G!=null)switch(x){case"value":break;case"multiple":re=G;default:c.hasOwnProperty(x)||Ke(n,i,x,null,c,G)}for(p in c)if(x=c[p],G=s[p],c.hasOwnProperty(p)&&(x!=null||G!=null))switch(p){case"value":ne=x;break;case"defaultValue":T=x;break;case"multiple":E=x;default:x!==G&&Ke(n,i,p,x,c,G)}i=T,s=E,c=re,ne!=null?ar(n,!!s,ne,!1):!!c!=!!s&&(i!=null?ar(n,!!s,i,!0):ar(n,!!s,s?[]:"",!1));return;case"textarea":re=ne=null;for(T in s)if(p=s[T],s.hasOwnProperty(T)&&p!=null&&!c.hasOwnProperty(T))switch(T){case"value":break;case"children":break;default:Ke(n,i,T,null,c,p)}for(E in c)if(p=c[E],x=s[E],c.hasOwnProperty(E)&&(p!=null||x!=null))switch(E){case"value":ne=p;break;case"defaultValue":re=p;break;case"children":break;case"dangerouslySetInnerHTML":if(p!=null)throw Error(a(91));break;default:p!==x&&Ke(n,i,E,p,c,x)}Zm(n,ne,re);return;case"option":for(var me in s)ne=s[me],s.hasOwnProperty(me)&&ne!=null&&!c.hasOwnProperty(me)&&(me==="selected"?n.selected=!1:Ke(n,i,me,null,c,ne));for(G in c)ne=c[G],re=s[G],c.hasOwnProperty(G)&&ne!==re&&(ne!=null||re!=null)&&(G==="selected"?n.selected=ne&&typeof ne!="function"&&typeof ne!="symbol":Ke(n,i,G,ne,c,re));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 Ce in s)ne=s[Ce],s.hasOwnProperty(Ce)&&ne!=null&&!c.hasOwnProperty(Ce)&&Ke(n,i,Ce,null,c,ne);for(ee in c)if(ne=c[ee],re=s[ee],c.hasOwnProperty(ee)&&ne!==re&&(ne!=null||re!=null))switch(ee){case"children":case"dangerouslySetInnerHTML":if(ne!=null)throw Error(a(137,i));break;default:Ke(n,i,ee,ne,c,re)}return;default:if(hf(i)){for(var Je in s)ne=s[Je],s.hasOwnProperty(Je)&&ne!==void 0&&!c.hasOwnProperty(Je)&&Wd(n,i,Je,void 0,c,ne);for(ae in c)ne=c[ae],re=s[ae],!c.hasOwnProperty(ae)||ne===re||ne===void 0&&re===void 0||Wd(n,i,ae,ne,c,re);return}}for(var J in s)ne=s[J],s.hasOwnProperty(J)&&ne!=null&&!c.hasOwnProperty(J)&&Ke(n,i,J,null,c,ne);for(se in c)ne=c[se],re=s[se],!c.hasOwnProperty(se)||ne===re||ne==null&&re==null||Ke(n,i,se,ne,c,re)}function ex(n){switch(n){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function T_(){if(typeof performance.getEntriesByType=="function"){for(var n=0,i=0,s=performance.getEntriesByType("resource"),c=0;c<s.length;c++){var p=s[c],x=p.transferSize,E=p.initiatorType,T=p.duration;if(x&&T&&ex(E)){for(E=0,T=p.responseEnd,c+=1;c<s.length;c++){var G=s[c],ee=G.startTime;if(ee>T)break;var ae=G.transferSize,se=G.initiatorType;ae&&ex(se)&&(G=G.responseEnd,E+=ae*(G<T?1:(T-ee)/(G-ee)))}if(--c,i+=8*(x+E)/(p.duration/1e3),n++,10<n)break}}if(0<n)return i/n/1e6}return navigator.connection&&(n=navigator.connection.downlink,typeof n=="number")?n:5}var eh=null,th=null;function Mu(n){return n.nodeType===9?n:n.ownerDocument}function tx(n){switch(n){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function nx(n,i){if(n===0)switch(i){case"svg":return 1;case"math":return 2;default:return 0}return n===1&&i==="foreignObject"?0:n}function nh(n,i){return n==="textarea"||n==="noscript"||typeof i.children=="string"||typeof i.children=="number"||typeof i.children=="bigint"||typeof i.dangerouslySetInnerHTML=="object"&&i.dangerouslySetInnerHTML!==null&&i.dangerouslySetInnerHTML.__html!=null}var rh=null;function A_(){var n=window.event;return n&&n.type==="popstate"?n===rh?!1:(rh=n,!0):(rh=null,!1)}var rx=typeof setTimeout=="function"?setTimeout:void 0,R_=typeof clearTimeout=="function"?clearTimeout:void 0,ix=typeof Promise=="function"?Promise:void 0,O_=typeof queueMicrotask=="function"?queueMicrotask:typeof ix<"u"?function(n){return ix.resolve(null).then(n).catch(j_)}:rx;function j_(n){setTimeout(function(){throw n})}function Jr(n){return n==="head"}function ax(n,i){var s=i,c=0;do{var p=s.nextSibling;if(n.removeChild(s),p&&p.nodeType===8)if(s=p.data,s==="/$"||s==="/&"){if(c===0){n.removeChild(p),Xa(i);return}c--}else if(s==="$"||s==="$?"||s==="$~"||s==="$!"||s==="&")c++;else if(s==="html")fs(n.ownerDocument.documentElement);else if(s==="head"){s=n.ownerDocument.head,fs(s);for(var x=s.firstChild;x;){var E=x.nextSibling,T=x.nodeName;x[vi]||T==="SCRIPT"||T==="STYLE"||T==="LINK"&&x.rel.toLowerCase()==="stylesheet"||s.removeChild(x),x=E}}else s==="body"&&fs(n.ownerDocument.body);s=p}while(s);Xa(i)}function ox(n,i){var s=n;n=0;do{var c=s.nextSibling;if(s.nodeType===1?i?(s._stashedDisplay=s.style.display,s.style.display="none"):(s.style.display=s._stashedDisplay||"",s.getAttribute("style")===""&&s.removeAttribute("style")):s.nodeType===3&&(i?(s._stashedText=s.nodeValue,s.nodeValue=""):s.nodeValue=s._stashedText||""),c&&c.nodeType===8)if(s=c.data,s==="/$"){if(n===0)break;n--}else s!=="$"&&s!=="$?"&&s!=="$~"&&s!=="$!"||n++;s=c}while(s)}function ih(n){var i=n.firstChild;for(i&&i.nodeType===10&&(i=i.nextSibling);i;){var s=i;switch(i=i.nextSibling,s.nodeName){case"HTML":case"HEAD":case"BODY":ih(s),ko(s);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(s.rel.toLowerCase()==="stylesheet")continue}n.removeChild(s)}}function D_(n,i,s,c){for(;n.nodeType===1;){var p=s;if(n.nodeName.toLowerCase()!==i.toLowerCase()){if(!c&&(n.nodeName!=="INPUT"||n.type!=="hidden"))break}else if(c){if(!n[vi])switch(i){case"meta":if(!n.hasAttribute("itemprop"))break;return n;case"link":if(x=n.getAttribute("rel"),x==="stylesheet"&&n.hasAttribute("data-precedence"))break;if(x!==p.rel||n.getAttribute("href")!==(p.href==null||p.href===""?null:p.href)||n.getAttribute("crossorigin")!==(p.crossOrigin==null?null:p.crossOrigin)||n.getAttribute("title")!==(p.title==null?null:p.title))break;return n;case"style":if(n.hasAttribute("data-precedence"))break;return n;case"script":if(x=n.getAttribute("src"),(x!==(p.src==null?null:p.src)||n.getAttribute("type")!==(p.type==null?null:p.type)||n.getAttribute("crossorigin")!==(p.crossOrigin==null?null:p.crossOrigin))&&x&&n.hasAttribute("async")&&!n.hasAttribute("itemprop"))break;return n;default:return n}}else if(i==="input"&&n.type==="hidden"){var x=p.name==null?null:""+p.name;if(p.type==="hidden"&&n.getAttribute("name")===x)return n}else return n;if(n=Nn(n.nextSibling),n===null)break}return null}function z_(n,i,s){if(i==="")return null;for(;n.nodeType!==3;)if((n.nodeType!==1||n.nodeName!=="INPUT"||n.type!=="hidden")&&!s||(n=Nn(n.nextSibling),n===null))return null;return n}function sx(n,i){for(;n.nodeType!==8;)if((n.nodeType!==1||n.nodeName!=="INPUT"||n.type!=="hidden")&&!i||(n=Nn(n.nextSibling),n===null))return null;return n}function ah(n){return n.data==="$?"||n.data==="$~"}function oh(n){return n.data==="$!"||n.data==="$?"&&n.ownerDocument.readyState!=="loading"}function L_(n,i){var s=n.ownerDocument;if(n.data==="$~")n._reactRetry=i;else if(n.data!=="$?"||s.readyState!=="loading")i();else{var c=function(){i(),s.removeEventListener("DOMContentLoaded",c)};s.addEventListener("DOMContentLoaded",c),n._reactRetry=c}}function Nn(n){for(;n!=null;n=n.nextSibling){var i=n.nodeType;if(i===1||i===3)break;if(i===8){if(i=n.data,i==="$"||i==="$!"||i==="$?"||i==="$~"||i==="&"||i==="F!"||i==="F")break;if(i==="/$"||i==="/&")return null}}return n}var sh=null;function lx(n){n=n.nextSibling;for(var i=0;n;){if(n.nodeType===8){var s=n.data;if(s==="/$"||s==="/&"){if(i===0)return Nn(n.nextSibling);i--}else s!=="$"&&s!=="$!"&&s!=="$?"&&s!=="$~"&&s!=="&"||i++}n=n.nextSibling}return null}function ux(n){n=n.previousSibling;for(var i=0;n;){if(n.nodeType===8){var s=n.data;if(s==="$"||s==="$!"||s==="$?"||s==="$~"||s==="&"){if(i===0)return n;i--}else s!=="/$"&&s!=="/&"||i++}n=n.previousSibling}return null}function cx(n,i,s){switch(i=Mu(s),n){case"html":if(n=i.documentElement,!n)throw Error(a(452));return n;case"head":if(n=i.head,!n)throw Error(a(453));return n;case"body":if(n=i.body,!n)throw Error(a(454));return n;default:throw Error(a(451))}}function fs(n){for(var i=n.attributes;i.length;)n.removeAttributeNode(i[0]);ko(n)}var Mn=new Map,fx=new Set;function ku(n){return typeof n.getRootNode=="function"?n.getRootNode():n.nodeType===9?n:n.ownerDocument}var wr=F.d;F.d={f:B_,r:I_,D:H_,C:P_,L:U_,m:q_,X:F_,S:V_,M:Y_};function B_(){var n=wr.f(),i=vu();return n||i}function I_(n){var i=Rr(n);i!==null&&i.tag===5&&i.type==="form"?ky(i):wr.r(n)}var Va=typeof document>"u"?null:document;function dx(n,i,s){var c=Va;if(c&&typeof i=="string"&&i){var p=Ft(i);p='link[rel="'+n+'"][href="'+p+'"]',typeof s=="string"&&(p+='[crossorigin="'+s+'"]'),fx.has(p)||(fx.add(p),n={rel:n,crossOrigin:s,href:i},c.querySelector(p)===null&&(i=c.createElement("link"),At(i,"link",n),mt(i),c.head.appendChild(i)))}}function H_(n){wr.D(n),dx("dns-prefetch",n,null)}function P_(n,i){wr.C(n,i),dx("preconnect",n,i)}function U_(n,i,s){wr.L(n,i,s);var c=Va;if(c&&n&&i){var p='link[rel="preload"][as="'+Ft(i)+'"]';i==="image"&&s&&s.imageSrcSet?(p+='[imagesrcset="'+Ft(s.imageSrcSet)+'"]',typeof s.imageSizes=="string"&&(p+='[imagesizes="'+Ft(s.imageSizes)+'"]')):p+='[href="'+Ft(n)+'"]';var x=p;switch(i){case"style":x=Fa(n);break;case"script":x=Ya(n)}Mn.has(x)||(n=g({rel:"preload",href:i==="image"&&s&&s.imageSrcSet?void 0:n,as:i},s),Mn.set(x,n),c.querySelector(p)!==null||i==="style"&&c.querySelector(ds(x))||i==="script"&&c.querySelector(hs(x))||(i=c.createElement("link"),At(i,"link",n),mt(i),c.head.appendChild(i)))}}function q_(n,i){wr.m(n,i);var s=Va;if(s&&n){var c=i&&typeof i.as=="string"?i.as:"script",p='link[rel="modulepreload"][as="'+Ft(c)+'"][href="'+Ft(n)+'"]',x=p;switch(c){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":x=Ya(n)}if(!Mn.has(x)&&(n=g({rel:"modulepreload",href:n},i),Mn.set(x,n),s.querySelector(p)===null)){switch(c){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(s.querySelector(hs(x)))return}c=s.createElement("link"),At(c,"link",n),mt(c),s.head.appendChild(c)}}}function V_(n,i,s){wr.S(n,i,s);var c=Va;if(c&&n){var p=jr(c).hoistableStyles,x=Fa(n);i=i||"default";var E=p.get(x);if(!E){var T={loading:0,preload:null};if(E=c.querySelector(ds(x)))T.loading=5;else{n=g({rel:"stylesheet",href:n,"data-precedence":i},s),(s=Mn.get(x))&&lh(n,s);var G=E=c.createElement("link");mt(G),At(G,"link",n),G._p=new Promise(function(ee,ae){G.onload=ee,G.onerror=ae}),G.addEventListener("load",function(){T.loading|=1}),G.addEventListener("error",function(){T.loading|=2}),T.loading|=4,Tu(E,i,c)}E={type:"stylesheet",instance:E,count:1,state:T},p.set(x,E)}}}function F_(n,i){wr.X(n,i);var s=Va;if(s&&n){var c=jr(s).hoistableScripts,p=Ya(n),x=c.get(p);x||(x=s.querySelector(hs(p)),x||(n=g({src:n,async:!0},i),(i=Mn.get(p))&&uh(n,i),x=s.createElement("script"),mt(x),At(x,"link",n),s.head.appendChild(x)),x={type:"script",instance:x,count:1,state:null},c.set(p,x))}}function Y_(n,i){wr.M(n,i);var s=Va;if(s&&n){var c=jr(s).hoistableScripts,p=Ya(n),x=c.get(p);x||(x=s.querySelector(hs(p)),x||(n=g({src:n,async:!0,type:"module"},i),(i=Mn.get(p))&&uh(n,i),x=s.createElement("script"),mt(x),At(x,"link",n),s.head.appendChild(x)),x={type:"script",instance:x,count:1,state:null},c.set(p,x))}}function hx(n,i,s,c){var p=(p=ce.current)?ku(p):null;if(!p)throw Error(a(446));switch(n){case"meta":case"title":return null;case"style":return typeof s.precedence=="string"&&typeof s.href=="string"?(i=Fa(s.href),s=jr(p).hoistableStyles,c=s.get(i),c||(c={type:"style",instance:null,count:0,state:null},s.set(i,c)),c):{type:"void",instance:null,count:0,state:null};case"link":if(s.rel==="stylesheet"&&typeof s.href=="string"&&typeof s.precedence=="string"){n=Fa(s.href);var x=jr(p).hoistableStyles,E=x.get(n);if(E||(p=p.ownerDocument||p,E={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},x.set(n,E),(x=p.querySelector(ds(n)))&&!x._p&&(E.instance=x,E.state.loading=5),Mn.has(n)||(s={rel:"preload",as:"style",href:s.href,crossOrigin:s.crossOrigin,integrity:s.integrity,media:s.media,hrefLang:s.hrefLang,referrerPolicy:s.referrerPolicy},Mn.set(n,s),x||X_(p,n,s,E.state))),i&&c===null)throw Error(a(528,""));return E}if(i&&c!==null)throw Error(a(529,""));return null;case"script":return i=s.async,s=s.src,typeof s=="string"&&i&&typeof i!="function"&&typeof i!="symbol"?(i=Ya(s),s=jr(p).hoistableScripts,c=s.get(i),c||(c={type:"script",instance:null,count:0,state:null},s.set(i,c)),c):{type:"void",instance:null,count:0,state:null};default:throw Error(a(444,n))}}function Fa(n){return'href="'+Ft(n)+'"'}function ds(n){return'link[rel="stylesheet"]['+n+"]"}function px(n){return g({},n,{"data-precedence":n.precedence,precedence:null})}function X_(n,i,s,c){n.querySelector('link[rel="preload"][as="style"]['+i+"]")?c.loading=1:(i=n.createElement("link"),c.preload=i,i.addEventListener("load",function(){return c.loading|=1}),i.addEventListener("error",function(){return c.loading|=2}),At(i,"link",s),mt(i),n.head.appendChild(i))}function Ya(n){return'[src="'+Ft(n)+'"]'}function hs(n){return"script[async]"+n}function mx(n,i,s){if(i.count++,i.instance===null)switch(i.type){case"style":var c=n.querySelector('style[data-href~="'+Ft(s.href)+'"]');if(c)return i.instance=c,mt(c),c;var p=g({},s,{"data-href":s.href,"data-precedence":s.precedence,href:null,precedence:null});return c=(n.ownerDocument||n).createElement("style"),mt(c),At(c,"style",p),Tu(c,s.precedence,n),i.instance=c;case"stylesheet":p=Fa(s.href);var x=n.querySelector(ds(p));if(x)return i.state.loading|=4,i.instance=x,mt(x),x;c=px(s),(p=Mn.get(p))&&lh(c,p),x=(n.ownerDocument||n).createElement("link"),mt(x);var E=x;return E._p=new Promise(function(T,G){E.onload=T,E.onerror=G}),At(x,"link",c),i.state.loading|=4,Tu(x,s.precedence,n),i.instance=x;case"script":return x=Ya(s.src),(p=n.querySelector(hs(x)))?(i.instance=p,mt(p),p):(c=s,(p=Mn.get(x))&&(c=g({},s),uh(c,p)),n=n.ownerDocument||n,p=n.createElement("script"),mt(p),At(p,"link",c),n.head.appendChild(p),i.instance=p);case"void":return null;default:throw Error(a(443,i.type))}else i.type==="stylesheet"&&(i.state.loading&4)===0&&(c=i.instance,i.state.loading|=4,Tu(c,s.precedence,n));return i.instance}function Tu(n,i,s){for(var c=s.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),p=c.length?c[c.length-1]:null,x=p,E=0;E<c.length;E++){var T=c[E];if(T.dataset.precedence===i)x=T;else if(x!==p)break}x?x.parentNode.insertBefore(n,x.nextSibling):(i=s.nodeType===9?s.head:s,i.insertBefore(n,i.firstChild))}function lh(n,i){n.crossOrigin==null&&(n.crossOrigin=i.crossOrigin),n.referrerPolicy==null&&(n.referrerPolicy=i.referrerPolicy),n.title==null&&(n.title=i.title)}function uh(n,i){n.crossOrigin==null&&(n.crossOrigin=i.crossOrigin),n.referrerPolicy==null&&(n.referrerPolicy=i.referrerPolicy),n.integrity==null&&(n.integrity=i.integrity)}var Au=null;function gx(n,i,s){if(Au===null){var c=new Map,p=Au=new Map;p.set(s,c)}else p=Au,c=p.get(s),c||(c=new Map,p.set(s,c));if(c.has(n))return c;for(c.set(n,null),s=s.getElementsByTagName(n),p=0;p<s.length;p++){var x=s[p];if(!(x[vi]||x[wt]||n==="link"&&x.getAttribute("rel")==="stylesheet")&&x.namespaceURI!=="http://www.w3.org/2000/svg"){var E=x.getAttribute(i)||"";E=n+E;var T=c.get(E);T?T.push(x):c.set(E,[x])}}return c}function yx(n,i,s){n=n.ownerDocument||n,n.head.insertBefore(s,i==="title"?n.querySelector("head > title"):null)}function G_(n,i,s){if(s===1||i.itemProp!=null)return!1;switch(n){case"meta":case"title":return!0;case"style":if(typeof i.precedence!="string"||typeof i.href!="string"||i.href==="")break;return!0;case"link":if(typeof i.rel!="string"||typeof i.href!="string"||i.href===""||i.onLoad||i.onError)break;return i.rel==="stylesheet"?(n=i.disabled,typeof i.precedence=="string"&&n==null):!0;case"script":if(i.async&&typeof i.async!="function"&&typeof i.async!="symbol"&&!i.onLoad&&!i.onError&&i.src&&typeof i.src=="string")return!0}return!1}function xx(n){return!(n.type==="stylesheet"&&(n.state.loading&3)===0)}function $_(n,i,s,c){if(s.type==="stylesheet"&&(typeof c.media!="string"||matchMedia(c.media).matches!==!1)&&(s.state.loading&4)===0){if(s.instance===null){var p=Fa(c.href),x=i.querySelector(ds(p));if(x){i=x._p,i!==null&&typeof i=="object"&&typeof i.then=="function"&&(n.count++,n=Ru.bind(n),i.then(n,n)),s.state.loading|=4,s.instance=x,mt(x);return}x=i.ownerDocument||i,c=px(c),(p=Mn.get(p))&&lh(c,p),x=x.createElement("link"),mt(x);var E=x;E._p=new Promise(function(T,G){E.onload=T,E.onerror=G}),At(x,"link",c),s.instance=x}n.stylesheets===null&&(n.stylesheets=new Map),n.stylesheets.set(s,i),(i=s.state.preload)&&(s.state.loading&3)===0&&(n.count++,s=Ru.bind(n),i.addEventListener("load",s),i.addEventListener("error",s))}}var ch=0;function Q_(n,i){return n.stylesheets&&n.count===0&&ju(n,n.stylesheets),0<n.count||0<n.imgCount?function(s){var c=setTimeout(function(){if(n.stylesheets&&ju(n,n.stylesheets),n.unsuspend){var x=n.unsuspend;n.unsuspend=null,x()}},6e4+i);0<n.imgBytes&&ch===0&&(ch=62500*T_());var p=setTimeout(function(){if(n.waitingForImages=!1,n.count===0&&(n.stylesheets&&ju(n,n.stylesheets),n.unsuspend)){var x=n.unsuspend;n.unsuspend=null,x()}},(n.imgBytes>ch?50:800)+i);return n.unsuspend=s,function(){n.unsuspend=null,clearTimeout(c),clearTimeout(p)}}:null}function Ru(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)ju(this,this.stylesheets);else if(this.unsuspend){var n=this.unsuspend;this.unsuspend=null,n()}}}var Ou=null;function ju(n,i){n.stylesheets=null,n.unsuspend!==null&&(n.count++,Ou=new Map,i.forEach(Z_,n),Ou=null,Ru.call(n))}function Z_(n,i){if(!(i.state.loading&4)){var s=Ou.get(n);if(s)var c=s.get(null);else{s=new Map,Ou.set(n,s);for(var p=n.querySelectorAll("link[data-precedence],style[data-precedence]"),x=0;x<p.length;x++){var E=p[x];(E.nodeName==="LINK"||E.getAttribute("media")!=="not all")&&(s.set(E.dataset.precedence,E),c=E)}c&&s.set(null,c)}p=i.instance,E=p.getAttribute("data-precedence"),x=s.get(E)||c,x===c&&s.set(null,p),s.set(E,p),this.count++,c=Ru.bind(this),p.addEventListener("load",c),p.addEventListener("error",c),x?x.parentNode.insertBefore(p,x.nextSibling):(n=n.nodeType===9?n.head:n,n.insertBefore(p,n.firstChild)),i.state.loading|=4}}var ps={$$typeof:_,Provider:null,Consumer:null,_currentValue:$,_currentValue2:$,_threadCount:0};function K_(n,i,s,c,p,x,E,T,G){this.tag=1,this.containerInfo=n,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=_o(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=_o(0),this.hiddenUpdates=_o(null),this.identifierPrefix=c,this.onUncaughtError=p,this.onCaughtError=x,this.onRecoverableError=E,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=G,this.incompleteTransitions=new Map}function vx(n,i,s,c,p,x,E,T,G,ee,ae,se){return n=new K_(n,i,s,E,G,ee,ae,se,T),i=1,x===!0&&(i|=24),x=ln(3,null,null,i),n.current=x,x.stateNode=n,i=Vf(),i.refCount++,n.pooledCache=i,i.refCount++,x.memoizedState={element:c,isDehydrated:s,cache:i},Gf(x),n}function bx(n){return n?(n=wa,n):wa}function Sx(n,i,s,c,p,x){p=bx(p),c.context===null?c.context=p:c.pendingContext=p,c=Ur(i),c.payload={element:s},x=x===void 0?null:x,x!==null&&(c.callback=x),s=qr(n,c,i),s!==null&&(Zt(s,n,i),Xo(s,n,i))}function wx(n,i){if(n=n.memoizedState,n!==null&&n.dehydrated!==null){var s=n.retryLane;n.retryLane=s!==0&&s<i?s:i}}function fh(n,i){wx(n,i),(n=n.alternate)&&wx(n,i)}function Ex(n){if(n.tag===13||n.tag===31){var i=_i(n,67108864);i!==null&&Zt(i,n,67108864),fh(n,67108864)}}function Cx(n){if(n.tag===13||n.tag===31){var i=hn();i=No(i);var s=_i(n,i);s!==null&&Zt(s,n,i),fh(n,i)}}var Du=!0;function J_(n,i,s,c){var p=j.T;j.T=null;var x=F.p;try{F.p=2,dh(n,i,s,c)}finally{F.p=x,j.T=p}}function W_(n,i,s,c){var p=j.T;j.T=null;var x=F.p;try{F.p=8,dh(n,i,s,c)}finally{F.p=x,j.T=p}}function dh(n,i,s,c){if(Du){var p=hh(c);if(p===null)Jd(n,i,c,zu,s),Nx(n,c);else if(t2(p,n,i,s,c))c.stopPropagation();else if(Nx(n,c),i&4&&-1<e2.indexOf(n)){for(;p!==null;){var x=Rr(p);if(x!==null)switch(x.tag){case 3:if(x=x.stateNode,x.current.memoizedState.isDehydrated){var E=nr(x.pendingLanes);if(E!==0){var T=x;for(T.pendingLanes|=2,T.entangledLanes|=2;E;){var G=1<<31-Xe(E);T.entanglements[1]|=G,E&=~G}Xn(x),(Fe&6)===0&&(yu=Ne()+500,ls(0))}}break;case 31:case 13:T=_i(x,2),T!==null&&Zt(T,x,2),vu(),fh(x,2)}if(x=hh(c),x===null&&Jd(n,i,c,zu,s),x===p)break;p=x}p!==null&&c.stopPropagation()}else Jd(n,i,c,null,s)}}function hh(n){return n=mf(n),ph(n)}var zu=null;function ph(n){if(zu=null,n=Ar(n),n!==null){var i=l(n);if(i===null)n=null;else{var s=i.tag;if(s===13){if(n=u(i),n!==null)return n;n=null}else if(s===31){if(n=f(i),n!==null)return n;n=null}else if(s===3){if(i.stateNode.current.memoizedState.isDehydrated)return i.tag===3?i.stateNode.containerInfo:null;n=null}else i!==n&&(n=null)}}return zu=n,null}function _x(n){switch(n){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(ut()){case ie:return 2;case he:return 8;case Ee:case Oe:return 32;case Pe:return 268435456;default:return 32}default:return 32}}var mh=!1,Wr=null,ei=null,ti=null,ms=new Map,gs=new Map,ni=[],e2="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 Nx(n,i){switch(n){case"focusin":case"focusout":Wr=null;break;case"dragenter":case"dragleave":ei=null;break;case"mouseover":case"mouseout":ti=null;break;case"pointerover":case"pointerout":ms.delete(i.pointerId);break;case"gotpointercapture":case"lostpointercapture":gs.delete(i.pointerId)}}function ys(n,i,s,c,p,x){return n===null||n.nativeEvent!==x?(n={blockedOn:i,domEventName:s,eventSystemFlags:c,nativeEvent:x,targetContainers:[p]},i!==null&&(i=Rr(i),i!==null&&Ex(i)),n):(n.eventSystemFlags|=c,i=n.targetContainers,p!==null&&i.indexOf(p)===-1&&i.push(p),n)}function t2(n,i,s,c,p){switch(i){case"focusin":return Wr=ys(Wr,n,i,s,c,p),!0;case"dragenter":return ei=ys(ei,n,i,s,c,p),!0;case"mouseover":return ti=ys(ti,n,i,s,c,p),!0;case"pointerover":var x=p.pointerId;return ms.set(x,ys(ms.get(x)||null,n,i,s,c,p)),!0;case"gotpointercapture":return x=p.pointerId,gs.set(x,ys(gs.get(x)||null,n,i,s,c,p)),!0}return!1}function Mx(n){var i=Ar(n.target);if(i!==null){var s=l(i);if(s!==null){if(i=s.tag,i===13){if(i=u(s),i!==null){n.blockedOn=i,El(n.priority,function(){Cx(s)});return}}else if(i===31){if(i=f(s),i!==null){n.blockedOn=i,El(n.priority,function(){Cx(s)});return}}else if(i===3&&s.stateNode.current.memoizedState.isDehydrated){n.blockedOn=s.tag===3?s.stateNode.containerInfo:null;return}}}n.blockedOn=null}function Lu(n){if(n.blockedOn!==null)return!1;for(var i=n.targetContainers;0<i.length;){var s=hh(n.nativeEvent);if(s===null){s=n.nativeEvent;var c=new s.constructor(s.type,s);pf=c,s.target.dispatchEvent(c),pf=null}else return i=Rr(s),i!==null&&Ex(i),n.blockedOn=s,!1;i.shift()}return!0}function kx(n,i,s){Lu(n)&&s.delete(i)}function n2(){mh=!1,Wr!==null&&Lu(Wr)&&(Wr=null),ei!==null&&Lu(ei)&&(ei=null),ti!==null&&Lu(ti)&&(ti=null),ms.forEach(kx),gs.forEach(kx)}function Bu(n,i){n.blockedOn===i&&(n.blockedOn=null,mh||(mh=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,n2)))}var Iu=null;function Tx(n){Iu!==n&&(Iu=n,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Iu===n&&(Iu=null);for(var i=0;i<n.length;i+=3){var s=n[i],c=n[i+1],p=n[i+2];if(typeof c!="function"){if(ph(c||s)===null)continue;break}var x=Rr(s);x!==null&&(n.splice(i,3),i-=3,hd(x,{pending:!0,data:p,method:s.method,action:c},c,p))}}))}function Xa(n){function i(G){return Bu(G,n)}Wr!==null&&Bu(Wr,n),ei!==null&&Bu(ei,n),ti!==null&&Bu(ti,n),ms.forEach(i),gs.forEach(i);for(var s=0;s<ni.length;s++){var c=ni[s];c.blockedOn===n&&(c.blockedOn=null)}for(;0<ni.length&&(s=ni[0],s.blockedOn===null);)Mx(s),s.blockedOn===null&&ni.shift();if(s=(n.ownerDocument||n).$$reactFormReplay,s!=null)for(c=0;c<s.length;c+=3){var p=s[c],x=s[c+1],E=p[Dt]||null;if(typeof x=="function")E||Tx(s);else if(E){var T=null;if(x&&x.hasAttribute("formAction")){if(p=x,E=x[Dt]||null)T=E.formAction;else if(ph(p)!==null)continue}else T=E.action;typeof T=="function"?s[c+1]=T:(s.splice(c,3),c-=3),Tx(s)}}}function Ax(){function n(x){x.canIntercept&&x.info==="react-transition"&&x.intercept({handler:function(){return new Promise(function(E){return p=E})},focusReset:"manual",scroll:"manual"})}function i(){p!==null&&(p(),p=null),c||setTimeout(s,20)}function s(){if(!c&&!navigation.transition){var x=navigation.currentEntry;x&&x.url!=null&&navigation.navigate(x.url,{state:x.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var c=!1,p=null;return navigation.addEventListener("navigate",n),navigation.addEventListener("navigatesuccess",i),navigation.addEventListener("navigateerror",i),setTimeout(s,100),function(){c=!0,navigation.removeEventListener("navigate",n),navigation.removeEventListener("navigatesuccess",i),navigation.removeEventListener("navigateerror",i),p!==null&&(p(),p=null)}}}function gh(n){this._internalRoot=n}Hu.prototype.render=gh.prototype.render=function(n){var i=this._internalRoot;if(i===null)throw Error(a(409));var s=i.current,c=hn();Sx(s,c,n,i,null,null)},Hu.prototype.unmount=gh.prototype.unmount=function(){var n=this._internalRoot;if(n!==null){this._internalRoot=null;var i=n.containerInfo;Sx(n.current,2,null,n,null,null),vu(),i[rr]=null}};function Hu(n){this._internalRoot=n}Hu.prototype.unstable_scheduleHydration=function(n){if(n){var i=wl();n={blockedOn:null,target:n,priority:i};for(var s=0;s<ni.length&&i!==0&&i<ni[s].priority;s++);ni.splice(s,0,n),s===0&&Mx(n)}};var Rx=t.version;if(Rx!=="19.2.4")throw Error(a(527,Rx,"19.2.4"));F.findDOMNode=function(n){var i=n._reactInternals;if(i===void 0)throw typeof n.render=="function"?Error(a(188)):(n=Object.keys(n).join(","),Error(a(268,n)));return n=d(i),n=n!==null?m(n):null,n=n===null?null:n.stateNode,n};var r2={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:j,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Pu=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Pu.isDisabled&&Pu.supportsFiber)try{Nt=Pu.inject(r2),dt=Pu}catch{}}return vs.createRoot=function(n,i){if(!o(n))throw Error(a(299));var s=!1,c="",p=Iy,x=Hy,E=Py;return i!=null&&(i.unstable_strictMode===!0&&(s=!0),i.identifierPrefix!==void 0&&(c=i.identifierPrefix),i.onUncaughtError!==void 0&&(p=i.onUncaughtError),i.onCaughtError!==void 0&&(x=i.onCaughtError),i.onRecoverableError!==void 0&&(E=i.onRecoverableError)),i=vx(n,1,!1,null,null,s,c,null,p,x,E,Ax),n[rr]=i.current,Kd(n),new gh(i)},vs.hydrateRoot=function(n,i,s){if(!o(n))throw Error(a(299));var c=!1,p="",x=Iy,E=Hy,T=Py,G=null;return s!=null&&(s.unstable_strictMode===!0&&(c=!0),s.identifierPrefix!==void 0&&(p=s.identifierPrefix),s.onUncaughtError!==void 0&&(x=s.onUncaughtError),s.onCaughtError!==void 0&&(E=s.onCaughtError),s.onRecoverableError!==void 0&&(T=s.onRecoverableError),s.formState!==void 0&&(G=s.formState)),i=vx(n,1,!0,i,s??null,c,p,G,x,E,T,Ax),i.context=bx(null),s=i.current,c=hn(),c=No(c),p=Ur(c),p.callback=null,qr(s,p,c),s=c,i.current.lanes=s,xi(i,s),Xn(i),n[rr]=i.current,Kd(n),new Hu(i)},vs.version="19.2.4",vs}var Ux;function d2(){if(Ux)return vh.exports;Ux=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),vh.exports=f2(),vh.exports}var h2=d2(),ll=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},p2=class extends ll{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<"u"&&window.addEventListener){const t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(t=>{typeof t=="boolean"?this.setFocused(t):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}},Wp=new p2,m2={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},g2=class{#e=m2;#t=!1;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}},Ui=new g2;function y2(e){setTimeout(e,0)}var x2=typeof window>"u"||"Deno"in globalThis;function Jt(){}function v2(e,t){return typeof e=="function"?e(t):e}function up(e){return typeof e=="number"&&e>=0&&e!==1/0}function T1(e,t){return Math.max(e+(t||0)-Date.now(),0)}function di(e,t){return typeof e=="function"?e(t):e}function kn(e,t){return typeof e=="function"?e(t):e}function qx(e,t){const{type:r="all",exact:a,fetchStatus:o,predicate:l,queryKey:u,stale:f}=e;if(u){if(a){if(t.queryHash!==em(u,t.options))return!1}else if(!Us(t.queryKey,u))return!1}if(r!=="all"){const h=t.isActive();if(r==="active"&&!h||r==="inactive"&&h)return!1}return!(typeof f=="boolean"&&t.isStale()!==f||o&&o!==t.state.fetchStatus||l&&!l(t))}function Vx(e,t){const{exact:r,status:a,predicate:o,mutationKey:l}=e;if(l){if(!t.options.mutationKey)return!1;if(r){if(Ps(t.options.mutationKey)!==Ps(l))return!1}else if(!Us(t.options.mutationKey,l))return!1}return!(a&&t.state.status!==a||o&&!o(t))}function em(e,t){return(t?.queryKeyHashFn||Ps)(e)}function Ps(e){return JSON.stringify(e,(t,r)=>fp(r)?Object.keys(r).sort().reduce((a,o)=>(a[o]=r[o],a),{}):r)}function Us(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(r=>Us(e[r],t[r])):!1}var b2=Object.prototype.hasOwnProperty;function A1(e,t,r=0){if(e===t)return e;if(r>500)return t;const a=Fx(e)&&Fx(t);if(!a&&!(fp(e)&&fp(t)))return t;const l=(a?e:Object.keys(e)).length,u=a?t:Object.keys(t),f=u.length,h=a?new Array(f):{};let d=0;for(let m=0;m<f;m++){const g=a?m:u[m],y=e[g],v=t[g];if(y===v){h[g]=y,(a?m<l:b2.call(e,g))&&d++;continue}if(y===null||v===null||typeof y!="object"||typeof v!="object"){h[g]=v;continue}const S=A1(y,v,r+1);h[g]=S,S===y&&d++}return l===f&&d===l?e:h}function cp(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const r in e)if(e[r]!==t[r])return!1;return!0}function Fx(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function fp(e){if(!Yx(e))return!1;const t=e.constructor;if(t===void 0)return!0;const r=t.prototype;return!(!Yx(r)||!r.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function Yx(e){return Object.prototype.toString.call(e)==="[object Object]"}function S2(e){return new Promise(t=>{Ui.setTimeout(t,e)})}function dp(e,t,r){return typeof r.structuralSharing=="function"?r.structuralSharing(e,t):r.structuralSharing!==!1?A1(e,t):t}function w2(e,t,r=0){const a=[...e,t];return r&&a.length>r?a.slice(1):a}function E2(e,t,r=0){const a=[t,...e];return r&&a.length>r?a.slice(0,-1):a}var tm=Symbol();function R1(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===tm?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function O1(e,t){return typeof e=="function"?e(...t):!!e}function C2(e,t,r){let a=!1,o;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(o??=t(),a||(a=!0,o.aborted?r():o.addEventListener("abort",r,{once:!0})),o)}),e}var qs=(()=>{let e=()=>x2;return{isServer(){return e()},setIsServer(t){e=t}}})();function hp(){let e,t;const r=new Promise((o,l)=>{e=o,t=l});r.status="pending",r.catch(()=>{});function a(o){Object.assign(r,o),delete r.resolve,delete r.reject}return r.resolve=o=>{a({status:"fulfilled",value:o}),e(o)},r.reject=o=>{a({status:"rejected",reason:o}),t(o)},r}var _2=y2;function N2(){let e=[],t=0,r=f=>{f()},a=f=>{f()},o=_2;const l=f=>{t?e.push(f):o(()=>{r(f)})},u=()=>{const f=e;e=[],f.length&&o(()=>{a(()=>{f.forEach(h=>{r(h)})})})};return{batch:f=>{let h;t++;try{h=f()}finally{t--,t||u()}return h},batchCalls:f=>(...h)=>{l(()=>{f(...h)})},schedule:l,setNotifyFunction:f=>{r=f},setBatchNotifyFunction:f=>{a=f},setScheduler:f=>{o=f}}}var Rt=N2(),M2=class extends ll{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<"u"&&window.addEventListener){const t=()=>e(!0),r=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",r)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(r=>{r(e)}))}isOnline(){return this.#e}},mc=new M2;function k2(e){return Math.min(1e3*2**e,3e4)}function j1(e){return(e??"online")==="online"?mc.isOnline():!0}var pp=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function D1(e){let t=!1,r=0,a;const o=hp(),l=()=>o.status!=="pending",u=C=>{if(!l()){const N=new pp(C);y(N),e.onCancel?.(N)}},f=()=>{t=!0},h=()=>{t=!1},d=()=>Wp.isFocused()&&(e.networkMode==="always"||mc.isOnline())&&e.canRun(),m=()=>j1(e.networkMode)&&e.canRun(),g=C=>{l()||(a?.(),o.resolve(C))},y=C=>{l()||(a?.(),o.reject(C))},v=()=>new Promise(C=>{a=N=>{(l()||d())&&C(N)},e.onPause?.()}).then(()=>{a=void 0,l()||e.onContinue?.()}),S=()=>{if(l())return;let C;const N=r===0?e.initialPromise:void 0;try{C=N??e.fn()}catch(w){C=Promise.reject(w)}Promise.resolve(C).then(g).catch(w=>{if(l())return;const O=e.retry??(qs.isServer()?0:3),_=e.retryDelay??k2,M=typeof _=="function"?_(r,w):_,I=O===!0||typeof O=="number"&&r<O||typeof O=="function"&&O(r,w);if(t||!I){y(w);return}r++,e.onFail?.(r,w),S2(M).then(()=>d()?void 0:v()).then(()=>{t?y(w):S()})})};return{promise:o,status:()=>o.status,cancel:u,continue:()=>(a?.(),o),cancelRetry:f,continueRetry:h,canStart:m,start:()=>(m()?S():v().then(S),o)}}var z1=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),up(this.gcTime)&&(this.#e=Ui.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(qs.isServer()?1/0:300*1e3))}clearGcTimeout(){this.#e&&(Ui.clearTimeout(this.#e),this.#e=void 0)}},T2=class extends z1{#e;#t;#n;#i;#r;#o;#a;constructor(e){super(),this.#a=!1,this.#o=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#i=e.client,this.#n=this.#i.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#e=Gx(this.options),this.state=e.state??this.#e,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#r?.promise}setOptions(e){if(this.options={...this.#o,...e},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const t=Gx(this.options);t.data!==void 0&&(this.setState(Xx(t.data,t.dataUpdatedAt)),this.#e=t)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#n.remove(this)}setData(e,t){const r=dp(this.state.data,e,this.options);return this.#l({data:r,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),r}setState(e,t){this.#l({type:"setState",state:e,setStateOptions:t})}cancel(e){const t=this.#r?.promise;return this.#r?.cancel(e),t?t.then(Jt).catch(Jt):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#e}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>kn(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===tm||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>di(e.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e==="static"?!1:this.state.isInvalidated?!0:!T1(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(t=>t.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#r?.continue()}onOnline(){this.observers.find(t=>t.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#r?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#r&&(this.#a||this.#s()?this.#r.cancel({revert:!0}):this.#r.cancelRetry()),this.scheduleGc()),this.#n.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}#s(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"}invalidate(){this.state.isInvalidated||this.#l({type:"invalidate"})}async fetch(e,t){if(this.state.fetchStatus!=="idle"&&this.#r?.status()!=="rejected"){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#r)return this.#r.continueRetry(),this.#r.promise}if(e&&this.setOptions(e),!this.options.queryFn){const f=this.observers.find(h=>h.options.queryFn);f&&this.setOptions(f.options)}const r=new AbortController,a=f=>{Object.defineProperty(f,"signal",{enumerable:!0,get:()=>(this.#a=!0,r.signal)})},o=()=>{const f=R1(this.options,t),d=(()=>{const m={client:this.#i,queryKey:this.queryKey,meta:this.meta};return a(m),m})();return this.#a=!1,this.options.persister?this.options.persister(f,d,this):f(d)},u=(()=>{const f={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:o};return a(f),f})();this.options.behavior?.onFetch(u,this),this.#t=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==u.fetchOptions?.meta)&&this.#l({type:"fetch",meta:u.fetchOptions?.meta}),this.#r=D1({initialPromise:t?.initialPromise,fn:u.fetchFn,onCancel:f=>{f instanceof pp&&f.revert&&this.setState({...this.#t,fetchStatus:"idle"}),r.abort()},onFail:(f,h)=>{this.#l({type:"failed",failureCount:f,error:h})},onPause:()=>{this.#l({type:"pause"})},onContinue:()=>{this.#l({type:"continue"})},retry:u.options.retry,retryDelay:u.options.retryDelay,networkMode:u.options.networkMode,canRun:()=>!0});try{const f=await this.#r.start();if(f===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(f),this.#n.config.onSuccess?.(f,this),this.#n.config.onSettled?.(f,this.state.error,this),f}catch(f){if(f instanceof pp){if(f.silent)return this.#r.promise;if(f.revert){if(this.state.data===void 0)throw f;return this.state.data}}throw this.#l({type:"error",error:f}),this.#n.config.onError?.(f,this),this.#n.config.onSettled?.(this.state.data,f,this),f}finally{this.scheduleGc()}}#l(e){const t=r=>{switch(e.type){case"failed":return{...r,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...L1(r.data,this.options),fetchMeta:e.meta??null};case"success":const a={...r,...Xx(e.data,e.dataUpdatedAt),dataUpdateCount:r.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#t=e.manual?a:void 0,a;case"error":const o=e.error;return{...r,error:o,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:o,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...e.state}}};this.state=t(this.state),Rt.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),this.#n.notify({query:this,type:"updated",action:e})})}};function L1(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:j1(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function Xx(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function Gx(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,r=t!==void 0,a=r?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:r?a??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}var A2=class extends ll{constructor(e,t){super(),this.options=t,this.#e=e,this.#s=null,this.#a=hp(),this.bindMethods(),this.setOptions(t)}#e;#t=void 0;#n=void 0;#i=void 0;#r;#o;#a;#s;#l;#h;#p;#c;#f;#u;#m=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),$x(this.#t,this.options)?this.#d():this.updateResult(),this.#v())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return mp(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return mp(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#S(),this.#t.removeObserver(this)}setOptions(e){const t=this.options,r=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof kn(this.options.enabled,this.#t)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#w(),this.#t.setOptions(this.options),t._defaulted&&!cp(this.options,t)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const a=this.hasListeners();a&&Qx(this.#t,r,this.options,t)&&this.#d(),this.updateResult(),a&&(this.#t!==r||kn(this.options.enabled,this.#t)!==kn(t.enabled,this.#t)||di(this.options.staleTime,this.#t)!==di(t.staleTime,this.#t))&&this.#g();const o=this.#y();a&&(this.#t!==r||kn(this.options.enabled,this.#t)!==kn(t.enabled,this.#t)||o!==this.#u)&&this.#x(o)}getOptimisticResult(e){const t=this.#e.getQueryCache().build(this.#e,e),r=this.createResult(t,e);return O2(this,r)&&(this.#i=r,this.#o=this.options,this.#r=this.#t.state),r}getCurrentResult(){return this.#i}trackResult(e,t){return new Proxy(e,{get:(r,a)=>(this.trackProp(a),t?.(a),a==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&this.#a.status==="pending"&&this.#a.reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(r,a))})}trackProp(e){this.#m.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const t=this.#e.defaultQueryOptions(e),r=this.#e.getQueryCache().build(this.#e,t);return r.fetch().then(()=>this.createResult(r,t))}fetch(e){return this.#d({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#i))}#d(e){this.#w();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(Jt)),t}#g(){this.#b();const e=di(this.options.staleTime,this.#t);if(qs.isServer()||this.#i.isStale||!up(e))return;const r=T1(this.#i.dataUpdatedAt,e)+1;this.#c=Ui.setTimeout(()=>{this.#i.isStale||this.updateResult()},r)}#y(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#x(e){this.#S(),this.#u=e,!(qs.isServer()||kn(this.options.enabled,this.#t)===!1||!up(this.#u)||this.#u===0)&&(this.#f=Ui.setInterval(()=>{(this.options.refetchIntervalInBackground||Wp.isFocused())&&this.#d()},this.#u))}#v(){this.#g(),this.#x(this.#y())}#b(){this.#c&&(Ui.clearTimeout(this.#c),this.#c=void 0)}#S(){this.#f&&(Ui.clearInterval(this.#f),this.#f=void 0)}createResult(e,t){const r=this.#t,a=this.options,o=this.#i,l=this.#r,u=this.#o,h=e!==r?e.state:this.#n,{state:d}=e;let m={...d},g=!1,y;if(t._optimisticResults){const U=this.hasListeners(),H=!U&&$x(e,t),q=U&&Qx(e,r,t,a);(H||q)&&(m={...m,...L1(d.data,e.options)}),t._optimisticResults==="isRestoring"&&(m.fetchStatus="idle")}let{error:v,errorUpdatedAt:S,status:C}=m;y=m.data;let N=!1;if(t.placeholderData!==void 0&&y===void 0&&C==="pending"){let U;o?.isPlaceholderData&&t.placeholderData===u?.placeholderData?(U=o.data,N=!0):U=typeof t.placeholderData=="function"?t.placeholderData(this.#p?.state.data,this.#p):t.placeholderData,U!==void 0&&(C="success",y=dp(o?.data,U,t),g=!0)}if(t.select&&y!==void 0&&!N)if(o&&y===l?.data&&t.select===this.#l)y=this.#h;else try{this.#l=t.select,y=t.select(y),y=dp(o?.data,y,t),this.#h=y,this.#s=null}catch(U){this.#s=U}this.#s&&(v=this.#s,y=this.#h,S=Date.now(),C="error");const w=m.fetchStatus==="fetching",O=C==="pending",_=C==="error",M=O&&w,I=y!==void 0,D={status:C,fetchStatus:m.fetchStatus,isPending:O,isSuccess:C==="success",isError:_,isInitialLoading:M,isLoading:M,data:y,dataUpdatedAt:m.dataUpdatedAt,error:v,errorUpdatedAt:S,failureCount:m.fetchFailureCount,failureReason:m.fetchFailureReason,errorUpdateCount:m.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:m.dataUpdateCount>h.dataUpdateCount||m.errorUpdateCount>h.errorUpdateCount,isFetching:w,isRefetching:w&&!O,isLoadingError:_&&!I,isPaused:m.fetchStatus==="paused",isPlaceholderData:g,isRefetchError:_&&I,isStale:nm(e,t),refetch:this.refetch,promise:this.#a,isEnabled:kn(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const U=D.data!==void 0,H=D.status==="error"&&!U,q=K=>{H?K.reject(D.error):U&&K.resolve(D.data)},L=()=>{const K=this.#a=D.promise=hp();q(K)},P=this.#a;switch(P.status){case"pending":e.queryHash===r.queryHash&&q(P);break;case"fulfilled":(H||D.data!==P.value)&&L();break;case"rejected":(!H||D.error!==P.reason)&&L();break}}return D}updateResult(){const e=this.#i,t=this.createResult(this.#t,this.options);if(this.#r=this.#t.state,this.#o=this.options,this.#r.data!==void 0&&(this.#p=this.#t),cp(t,e))return;this.#i=t;const r=()=>{if(!e)return!0;const{notifyOnChangeProps:a}=this.options,o=typeof a=="function"?a():a;if(o==="all"||!o&&!this.#m.size)return!0;const l=new Set(o??this.#m);return this.options.throwOnError&&l.add("error"),Object.keys(this.#i).some(u=>{const f=u;return this.#i[f]!==e[f]&&l.has(f)})};this.#E({listeners:r()})}#w(){const e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;const t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#v()}#E(e){Rt.batch(()=>{e.listeners&&this.listeners.forEach(t=>{t(this.#i)}),this.#e.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}};function R2(e,t){return kn(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function $x(e,t){return R2(e,t)||e.state.data!==void 0&&mp(e,t,t.refetchOnMount)}function mp(e,t,r){if(kn(t.enabled,e)!==!1&&di(t.staleTime,e)!=="static"){const a=typeof r=="function"?r(e):r;return a==="always"||a!==!1&&nm(e,t)}return!1}function Qx(e,t,r,a){return(e!==t||kn(a.enabled,e)===!1)&&(!r.suspense||e.state.status!=="error")&&nm(e,r)}function nm(e,t){return kn(t.enabled,e)!==!1&&e.isStaleByTime(di(t.staleTime,e))}function O2(e,t){return!cp(e.getCurrentResult(),t)}function Zx(e){return{onFetch:(t,r)=>{const a=t.options,o=t.fetchOptions?.meta?.fetchMore?.direction,l=t.state.data?.pages||[],u=t.state.data?.pageParams||[];let f={pages:[],pageParams:[]},h=0;const d=async()=>{let m=!1;const g=S=>{C2(S,()=>t.signal,()=>m=!0)},y=R1(t.options,t.fetchOptions),v=async(S,C,N)=>{if(m)return Promise.reject();if(C==null&&S.pages.length)return Promise.resolve(S);const O=(()=>{const k={client:t.client,queryKey:t.queryKey,pageParam:C,direction:N?"backward":"forward",meta:t.options.meta};return g(k),k})(),_=await y(O),{maxPages:M}=t.options,I=N?E2:w2;return{pages:I(S.pages,_,M),pageParams:I(S.pageParams,C,M)}};if(o&&l.length){const S=o==="backward",C=S?j2:Kx,N={pages:l,pageParams:u},w=C(a,N);f=await v(N,w,S)}else{const S=e??l.length;do{const C=h===0?u[0]??a.initialPageParam:Kx(a,f);if(h>0&&C==null)break;f=await v(f,C),h++}while(h<S)}return f};t.options.persister?t.fetchFn=()=>t.options.persister?.(d,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},r):t.fetchFn=d}}}function Kx(e,{pages:t,pageParams:r}){const a=t.length-1;return t.length>0?e.getNextPageParam(t[a],t,r[a],r):void 0}function j2(e,{pages:t,pageParams:r}){return t.length>0?e.getPreviousPageParam?.(t[0],t,r[0],r):void 0}var D2=class extends z1{#e;#t;#n;#i;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||z2(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status==="pending"?this.scheduleGc():this.#n.remove(this))}continue(){return this.#i?.continue()??this.execute(this.state.variables)}async execute(e){const t=()=>{this.#r({type:"continue"})},r={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#i=D1({fn:()=>this.options.mutationFn?this.options.mutationFn(e,r):Promise.reject(new Error("No mutationFn found")),onFail:(l,u)=>{this.#r({type:"failed",failureCount:l,error:u})},onPause:()=>{this.#r({type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});const a=this.state.status==="pending",o=!this.#i.canStart();try{if(a)t();else{this.#r({type:"pending",variables:e,isPaused:o}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,r);const u=await this.options.onMutate?.(e,r);u!==this.state.context&&this.#r({type:"pending",context:u,variables:e,isPaused:o})}const l=await this.#i.start();return await this.#n.config.onSuccess?.(l,e,this.state.context,this,r),await this.options.onSuccess?.(l,e,this.state.context,r),await this.#n.config.onSettled?.(l,null,this.state.variables,this.state.context,this,r),await this.options.onSettled?.(l,null,e,this.state.context,r),this.#r({type:"success",data:l}),l}catch(l){try{await this.#n.config.onError?.(l,e,this.state.context,this,r)}catch(u){Promise.reject(u)}try{await this.options.onError?.(l,e,this.state.context,r)}catch(u){Promise.reject(u)}try{await this.#n.config.onSettled?.(void 0,l,this.state.variables,this.state.context,this,r)}catch(u){Promise.reject(u)}try{await this.options.onSettled?.(void 0,l,e,this.state.context,r)}catch(u){Promise.reject(u)}throw this.#r({type:"error",error:l}),l}finally{this.#n.runNext(this)}}#r(e){const t=r=>{switch(e.type){case"failed":return{...r,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...r,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:e.error,failureCount:r.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=t(this.state),Rt.batch(()=>{this.#t.forEach(r=>{r.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:"updated",action:e})})}};function z2(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var L2=class extends ll{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,t,r){const a=new D2({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:r});return this.add(a),a}add(e){this.#e.add(e);const t=Uu(e);if(typeof t=="string"){const r=this.#t.get(t);r?r.push(e):this.#t.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#e.delete(e)){const t=Uu(e);if(typeof t=="string"){const r=this.#t.get(t);if(r)if(r.length>1){const a=r.indexOf(e);a!==-1&&r.splice(a,1)}else r[0]===e&&this.#t.delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){const t=Uu(e);if(typeof t=="string"){const a=this.#t.get(t)?.find(o=>o.state.status==="pending");return!a||a===e}else return!0}runNext(e){const t=Uu(e);return typeof t=="string"?this.#t.get(t)?.find(a=>a!==e&&a.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){Rt.batch(()=>{this.#e.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){const t={exact:!0,...e};return this.getAll().find(r=>Vx(t,r))}findAll(e={}){return this.getAll().filter(t=>Vx(e,t))}notify(e){Rt.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>t.state.isPaused);return Rt.batch(()=>Promise.all(e.map(t=>t.continue().catch(Jt))))}};function Uu(e){return e.options.scope?.id}var B2=class extends ll{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,r){const a=t.queryKey,o=t.queryHash??em(a,t);let l=this.get(o);return l||(l=new T2({client:e,queryKey:a,queryHash:o,options:e.defaultQueryOptions(t),state:r,defaultOptions:e.getQueryDefaults(a)}),this.add(l)),l}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){Rt.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){const t={exact:!0,...e};return this.getAll().find(r=>qx(t,r))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(r=>qx(e,r)):t}notify(e){Rt.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){Rt.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Rt.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},I2=class{#e;#t;#n;#i;#r;#o;#a;#s;constructor(e={}){this.#e=e.queryCache||new B2,this.#t=e.mutationCache||new L2,this.#n=e.defaultOptions||{},this.#i=new Map,this.#r=new Map,this.#o=0}mount(){this.#o++,this.#o===1&&(this.#a=Wp.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=mc.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#o--,this.#o===0&&(this.#a?.(),this.#a=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#t.findAll({...e,status:"pending"}).length}getQueryData(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),r=this.#e.build(this,t),a=r.state.data;return a===void 0?this.fetchQuery(e):(e.revalidateIfStale&&r.isStaleByTime(di(t.staleTime,r))&&this.prefetchQuery(t),Promise.resolve(a))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:t,state:r})=>{const a=r.data;return[t,a]})}setQueryData(e,t,r){const a=this.defaultQueryOptions({queryKey:e}),l=this.#e.get(a.queryHash)?.state.data,u=v2(t,l);if(u!==void 0)return this.#e.build(this,a).setData(u,{...r,manual:!0})}setQueriesData(e,t,r){return Rt.batch(()=>this.#e.findAll(e).map(({queryKey:a})=>[a,this.setQueryData(a,t,r)]))}getQueryState(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){const t=this.#e;Rt.batch(()=>{t.findAll(e).forEach(r=>{t.remove(r)})})}resetQueries(e,t){const r=this.#e;return Rt.batch(()=>(r.findAll(e).forEach(a=>{a.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const r={revert:!0,...t},a=Rt.batch(()=>this.#e.findAll(e).map(o=>o.cancel(r)));return Promise.all(a).then(Jt).catch(Jt)}invalidateQueries(e,t={}){return Rt.batch(()=>(this.#e.findAll(e).forEach(r=>{r.invalidate()}),e?.refetchType==="none"?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},t)))}refetchQueries(e,t={}){const r={...t,cancelRefetch:t.cancelRefetch??!0},a=Rt.batch(()=>this.#e.findAll(e).filter(o=>!o.isDisabled()&&!o.isStatic()).map(o=>{let l=o.fetch(void 0,r);return r.throwOnError||(l=l.catch(Jt)),o.state.fetchStatus==="paused"?Promise.resolve():l}));return Promise.all(a).then(Jt)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const r=this.#e.build(this,t);return r.isStaleByTime(di(t.staleTime,r))?r.fetch(t):Promise.resolve(r.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Jt).catch(Jt)}fetchInfiniteQuery(e){return e.behavior=Zx(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Jt).catch(Jt)}ensureInfiniteQueryData(e){return e.behavior=Zx(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return mc.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#i.set(Ps(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#i.values()],r={};return t.forEach(a=>{Us(e,a.queryKey)&&Object.assign(r,a.defaultOptions)}),r}setMutationDefaults(e,t){this.#r.set(Ps(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#r.values()],r={};return t.forEach(a=>{Us(e,a.mutationKey)&&Object.assign(r,a.defaultOptions)}),r}defaultQueryOptions(e){if(e._defaulted)return e;const t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=em(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===tm&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},B1=Y.createContext(void 0),rm=e=>{const t=Y.useContext(B1);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},H2=({client:e,children:t})=>(Y.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),b.jsx(B1.Provider,{value:e,children:t})),I1=Y.createContext(!1),P2=()=>Y.useContext(I1);I1.Provider;function U2(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var q2=Y.createContext(U2()),V2=()=>Y.useContext(q2),F2=(e,t,r)=>{const a=r?.state.error&&typeof e.throwOnError=="function"?O1(e.throwOnError,[r.state.error,r]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||a)&&(t.isReset()||(e.retryOnMount=!1))},Y2=e=>{Y.useEffect(()=>{e.clearReset()},[e])},X2=({result:e,errorResetBoundary:t,throwOnError:r,query:a,suspense:o})=>e.isError&&!t.isReset()&&!e.isFetching&&a&&(o&&e.data===void 0||O1(r,[e.error,a])),G2=e=>{if(e.suspense){const r=o=>o==="static"?o:Math.max(o??1e3,1e3),a=e.staleTime;e.staleTime=typeof a=="function"?(...o)=>r(a(...o)):r(a),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},$2=(e,t)=>e.isLoading&&e.isFetching&&!t,Q2=(e,t)=>e?.suspense&&t.isPending,Jx=(e,t,r)=>t.fetchOptimistic(e).catch(()=>{r.clearReset()});function Z2(e,t,r){const a=P2(),o=V2(),l=rm(),u=l.defaultQueryOptions(e);l.getDefaultOptions().queries?._experimental_beforeQuery?.(u);const f=l.getQueryCache().get(u.queryHash);u._optimisticResults=a?"isRestoring":"optimistic",G2(u),F2(u,o,f),Y2(o);const h=!l.getQueryCache().get(u.queryHash),[d]=Y.useState(()=>new t(l,u)),m=d.getOptimisticResult(u),g=!a&&e.subscribed!==!1;if(Y.useSyncExternalStore(Y.useCallback(y=>{const v=g?d.subscribe(Rt.batchCalls(y)):Jt;return d.updateResult(),v},[d,g]),()=>d.getCurrentResult(),()=>d.getCurrentResult()),Y.useEffect(()=>{d.setOptions(u)},[u,d]),Q2(u,m))throw Jx(u,d,o);if(X2({result:m,errorResetBoundary:o,throwOnError:u.throwOnError,query:f,suspense:u.suspense}))throw m.error;return l.getDefaultOptions().queries?._experimental_afterQuery?.(u,m),u.experimental_prefetchInRender&&!qs.isServer()&&$2(m,a)&&(h?Jx(u,d,o):f?.promise)?.catch(Jt).finally(()=>{d.updateResult()}),u.notifyOnChangeProps?m:d.trackResult(m)}function bo(e,t){return Z2(e,A2)}var Rs=typeof window<"u"?Y.useLayoutEffect:Y.useEffect;function Eh(e){const t=Y.useRef({value:e,prev:null}),r=t.current.value;return e!==r&&(t.current={value:e,prev:r}),t.current.prev}function K2(e,t,r={},a={}){Y.useEffect(()=>{if(!e.current||a.disabled||typeof IntersectionObserver!="function")return;const o=new IntersectionObserver(([l])=>{t(l)},r);return o.observe(e.current),()=>{o.disconnect()}},[t,r,a.disabled,e])}function J2(e){const t=Y.useRef(null);return Y.useImperativeHandle(e,()=>t.current,[]),t}var H1=!1;function Vs(e){return e[e.length-1]}function W2(e){return typeof e=="function"}function ui(e,t){return W2(e)?e(t):e}var eN=Object.prototype.hasOwnProperty,Wx=Object.prototype.propertyIsEnumerable,tN=()=>Object.create(null),Ii=(e,t)=>qi(e,t,tN);function qi(e,t,r=()=>({}),a=0){if(e===t)return e;if(a>500)return t;const o=t,l=nv(e)&&nv(o);if(!l&&!(uo(e)&&uo(o)))return o;const u=l?e:ev(e);if(!u)return o;const f=l?o:ev(o);if(!f)return o;const h=u.length,d=f.length,m=l?new Array(d):r();let g=0;for(let y=0;y<d;y++){const v=l?y:f[y],S=e[v],C=o[v];if(S===C){m[v]=S,(l?y<h:eN.call(e,v))&&g++;continue}if(S===null||C===null||typeof S!="object"||typeof C!="object"){m[v]=C;continue}const N=qi(S,C,r,a+1);m[v]=N,N===S&&g++}return h===d&&g===h?e:m}function ev(e){const t=Object.getOwnPropertyNames(e);for(const o of t)if(!Wx.call(e,o))return!1;const r=Object.getOwnPropertySymbols(e);if(r.length===0)return t;const a=t;for(const o of r){if(!Wx.call(e,o))return!1;a.push(o)}return a}function uo(e){if(!tv(e))return!1;const t=e.constructor;if(typeof t>"u")return!0;const r=t.prototype;return!(!tv(r)||!r.hasOwnProperty("isPrototypeOf"))}function tv(e){return Object.prototype.toString.call(e)==="[object Object]"}function nv(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Xi(e,t,r){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let a=0,o=e.length;a<o;a++)if(!Xi(e[a],t[a],r))return!1;return!0}if(uo(e)&&uo(t)){const a=r?.ignoreUndefined??!0;if(r?.partial){for(const u in t)if((!a||t[u]!==void 0)&&!Xi(e[u],t[u],r))return!1;return!0}let o=0;if(!a)o=Object.keys(e).length;else for(const u in e)e[u]!==void 0&&o++;let l=0;for(const u in t)if((!a||t[u]!==void 0)&&(l++,l>o||!Xi(e[u],t[u],r)))return!1;return o===l}return!1}function co(e){let t,r;const a=new Promise((o,l)=>{t=o,r=l});return a.status="pending",a.resolve=o=>{a.status="resolved",a.value=o,t(o),e?.(o)},a.reject=o=>{a.status="rejected",r(o)},a}function Fs(e){return!!(e&&typeof e=="object"&&typeof e.then=="function")}function nN(e){return e.replace(/[\x00-\x1f\x7f]/g,"")}function rv(e){let t;try{t=decodeURI(e)}catch{t=e.replaceAll(/%[0-9A-F]{2}/gi,r=>{try{return decodeURI(r)}catch{return r}})}return nN(t)}var rN=["http:","https:","mailto:","tel:"];function gc(e,t){if(!e)return!1;try{const r=new URL(e);return!t.has(r.protocol)}catch{return!1}}function bs(e){if(!e)return{path:e,handledProtocolRelativeURL:!1};if(!/[%\\\x00-\x1f\x7f]/.test(e)&&!e.startsWith("//"))return{path:e,handledProtocolRelativeURL:!1};const t=/%25|%5C/gi;let r=0,a="",o;for(;(o=t.exec(e))!==null;)a+=rv(e.slice(r,o.index))+o[0],r=t.lastIndex;a=a+rv(r?e.slice(r):e);let l=!1;return a.startsWith("//")&&(l=!0,a="/"+a.replace(/^\/+/,"")),{path:a,handledProtocolRelativeURL:l}}function iN(e){return/\s|[^\u0000-\u007F]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}function aN(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(e[r]!==t[r])return!1;return!0}function Mr(){throw new Error("Invariant failed")}function Ys(e){const t=new Map;let r,a;const o=l=>{l.next&&(l.prev?(l.prev.next=l.next,l.next.prev=l.prev,l.next=void 0,a&&(a.next=l,l.prev=a)):(l.next.prev=void 0,r=l.next,l.next=void 0,a&&(l.prev=a,a.next=l)),a=l)};return{get(l){const u=t.get(l);if(u)return o(u),u.value},set(l,u){if(t.size>=e&&r){const h=r;t.delete(h.key),h.next&&(r=h.next,h.next.prev=void 0),h===a&&(a=void 0)}const f=t.get(l);if(f)f.value=u,o(f);else{const h={key:l,value:u,prev:a};a&&(a.next=h),a=h,r||(r=h),t.set(l,h)}},clear(){t.clear(),r=void 0,a=void 0}}}var Vi=4,P1=5;function oN(e){const t=e.indexOf("{");if(t===-1)return null;const r=e.indexOf("}",t);return r===-1||t+1>=e.length?null:[t,r]}function im(e,t,r=new Uint16Array(6)){const a=e.indexOf("/",t),o=a===-1?e.length:a,l=e.substring(t,o);if(!l||!l.includes("$"))return r[0]=0,r[1]=t,r[2]=t,r[3]=o,r[4]=o,r[5]=o,r;if(l==="$"){const f=e.length;return r[0]=2,r[1]=t,r[2]=t,r[3]=f,r[4]=f,r[5]=f,r}if(l.charCodeAt(0)===36)return r[0]=1,r[1]=t,r[2]=t+1,r[3]=o,r[4]=o,r[5]=o,r;const u=oN(l);if(u){const[f,h]=u,d=l.charCodeAt(f+1);if(d===45){if(f+2<l.length&&l.charCodeAt(f+2)===36){const m=f+3,g=h;if(m<g)return r[0]=3,r[1]=t+f,r[2]=t+m,r[3]=t+g,r[4]=t+h+1,r[5]=o,r}}else if(d===36){const m=f+1,g=f+2;return g===h?(r[0]=2,r[1]=t+f,r[2]=t+m,r[3]=t+g,r[4]=t+h+1,r[5]=e.length,r):(r[0]=1,r[1]=t+f,r[2]=t+g,r[3]=t+h,r[4]=t+h+1,r[5]=o,r)}}return r[0]=0,r[1]=t,r[2]=t,r[3]=o,r[4]=o,r[5]=o,r}function Bc(e,t,r,a,o,l,u){u?.(r);let f=a;{const h=r.fullPath??r.from,d=h.length,m=r.options?.caseSensitive??e,g=!!(r.options?.params?.parse&&r.options?.skipRouteOnParseError?.params);for(;f<d;){const v=im(h,f,t);let S;const C=f,N=v[5];switch(f=N+1,l++,v[0]){case 0:{const w=h.substring(v[2],v[3]);if(m){const O=o.static?.get(w);if(O)S=O;else{o.static??=new Map;const _=Fi(r.fullPath??r.from);_.parent=o,_.depth=l,S=_,o.static.set(w,_)}}else{const O=w.toLowerCase(),_=o.staticInsensitive?.get(O);if(_)S=_;else{o.staticInsensitive??=new Map;const M=Fi(r.fullPath??r.from);M.parent=o,M.depth=l,S=M,o.staticInsensitive.set(O,M)}}break}case 1:{const w=h.substring(C,v[1]),O=h.substring(v[4],N),_=m&&!!(w||O),M=w?_?w:w.toLowerCase():void 0,I=O?_?O:O.toLowerCase():void 0,k=!g&&o.dynamic?.find(D=>!D.skipOnParamError&&D.caseSensitive===_&&D.prefix===M&&D.suffix===I);if(k)S=k;else{const D=_h(1,r.fullPath??r.from,_,M,I);S=D,D.depth=l,D.parent=o,o.dynamic??=[],o.dynamic.push(D)}break}case 3:{const w=h.substring(C,v[1]),O=h.substring(v[4],N),_=m&&!!(w||O),M=w?_?w:w.toLowerCase():void 0,I=O?_?O:O.toLowerCase():void 0,k=!g&&o.optional?.find(D=>!D.skipOnParamError&&D.caseSensitive===_&&D.prefix===M&&D.suffix===I);if(k)S=k;else{const D=_h(3,r.fullPath??r.from,_,M,I);S=D,D.parent=o,D.depth=l,o.optional??=[],o.optional.push(D)}break}case 2:{const w=h.substring(C,v[1]),O=h.substring(v[4],N),_=m&&!!(w||O),M=w?_?w:w.toLowerCase():void 0,I=O?_?O:O.toLowerCase():void 0,k=_h(2,r.fullPath??r.from,_,M,I);S=k,k.parent=o,k.depth=l,o.wildcard??=[],o.wildcard.push(k)}}o=S}if(g&&r.children&&!r.isRoot&&r.id&&r.id.charCodeAt(r.id.lastIndexOf("/")+1)===95){const v=Fi(r.fullPath??r.from);v.kind=P1,v.parent=o,l++,v.depth=l,o.pathless??=[],o.pathless.push(v),o=v}const y=(r.path||!r.children)&&!r.isRoot;if(y&&h.endsWith("/")){const v=Fi(r.fullPath??r.from);v.kind=Vi,v.parent=o,l++,v.depth=l,o.index=v,o=v}o.parse=r.options?.params?.parse??null,o.skipOnParamError=g,o.parsingPriority=r.options?.skipRouteOnParseError?.priority??0,y&&!o.route&&(o.route=r,o.fullPath=r.fullPath??r.from)}if(r.children)for(const h of r.children)Bc(e,t,h,f,o,l,u)}function Ch(e,t){if(e.skipOnParamError&&!t.skipOnParamError)return-1;if(!e.skipOnParamError&&t.skipOnParamError)return 1;if(e.skipOnParamError&&t.skipOnParamError&&(e.parsingPriority||t.parsingPriority))return t.parsingPriority-e.parsingPriority;if(e.prefix&&t.prefix&&e.prefix!==t.prefix){if(e.prefix.startsWith(t.prefix))return-1;if(t.prefix.startsWith(e.prefix))return 1}if(e.suffix&&t.suffix&&e.suffix!==t.suffix){if(e.suffix.endsWith(t.suffix))return-1;if(t.suffix.endsWith(e.suffix))return 1}return e.prefix&&!t.prefix?-1:!e.prefix&&t.prefix?1:e.suffix&&!t.suffix?-1:!e.suffix&&t.suffix?1:e.caseSensitive&&!t.caseSensitive?-1:!e.caseSensitive&&t.caseSensitive?1:0}function si(e){if(e.pathless)for(const t of e.pathless)si(t);if(e.static)for(const t of e.static.values())si(t);if(e.staticInsensitive)for(const t of e.staticInsensitive.values())si(t);if(e.dynamic?.length){e.dynamic.sort(Ch);for(const t of e.dynamic)si(t)}if(e.optional?.length){e.optional.sort(Ch);for(const t of e.optional)si(t)}if(e.wildcard?.length){e.wildcard.sort(Ch);for(const t of e.wildcard)si(t)}}function Fi(e){return{kind:0,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:e,parent:null,parse:null,skipOnParamError:!1,parsingPriority:0}}function _h(e,t,r,a,o){return{kind:e,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:t,parent:null,parse:null,skipOnParamError:!1,parsingPriority:0,caseSensitive:r,prefix:a,suffix:o}}function sN(e,t){const r=Fi("/"),a=new Uint16Array(6);for(const o of e)Bc(!1,a,o,1,r,0);si(r),t.masksTree=r,t.flatCache=Ys(1e3)}function lN(e,t){e||="/";const r=t.flatCache.get(e);if(r)return r;const a=am(e,t.masksTree);return t.flatCache.set(e,a),a}function uN(e,t,r,a,o){e||="/",a||="/";const l=t?`case\0${e}`:e;let u=o.singleCache.get(l);return u||(u=Fi("/"),Bc(t,new Uint16Array(6),{from:e},1,u,0),o.singleCache.set(l,u)),am(a,u,r)}function cN(e,t,r=!1){const a=r?e:`nofuzz\0${e}`,o=t.matchCache.get(a);if(o!==void 0)return o;e||="/";let l;try{l=am(e,t.segmentTree,r)}catch(u){if(u instanceof URIError)l=null;else throw u}return l&&(l.branch=hN(l.route)),t.matchCache.set(a,l),l}function fN(e){return e==="/"?e:e.replace(/\/{1,}$/,"")}function dN(e,t=!1,r){const a=Fi(e.fullPath),o=new Uint16Array(6),l={},u={};let f=0;return Bc(t,o,e,1,a,0,h=>{if(r?.(h,f),h.id in l&&Mr(),l[h.id]=h,f!==0&&h.path){const d=fN(h.fullPath);(!u[d]||h.fullPath.endsWith("/"))&&(u[d]=h)}f++}),si(a),{processedTree:{segmentTree:a,singleCache:Ys(1e3),matchCache:Ys(1e3),flatCache:null,masksTree:null},routesById:l,routesByPath:u}}function am(e,t,r=!1){const a=e.split("/"),o=mN(e,a,t,r);if(!o)return null;const[l]=U1(e,a,o);return{route:o.node.route,rawParams:l,parsedParams:o.parsedParams}}function U1(e,t,r){const a=pN(r.node);let o=null;const l=Object.create(null);let u=r.extract?.part??0,f=r.extract?.node??0,h=r.extract?.path??0,d=r.extract?.segment??0;for(;f<a.length;u++,f++,h++,d++){const m=a[f];if(m.kind===Vi)break;if(m.kind===P1){d--,u--,h--;continue}const g=t[u],y=h;if(g&&(h+=g.length),m.kind===1){o??=r.node.fullPath.split("/");const v=o[d],S=m.prefix?.length??0;if(v.charCodeAt(S)===123){const C=m.suffix?.length??0,N=v.substring(S+2,v.length-C-1),w=g.substring(S,g.length-C);l[N]=decodeURIComponent(w)}else{const C=v.substring(1);l[C]=decodeURIComponent(g)}}else if(m.kind===3){if(r.skipped&1<<f){u--,h=y-1;continue}o??=r.node.fullPath.split("/");const v=o[d],S=m.prefix?.length??0,C=m.suffix?.length??0,N=v.substring(S+3,v.length-C-1),w=m.suffix||m.prefix?g.substring(S,g.length-C):g;w&&(l[N]=decodeURIComponent(w))}else if(m.kind===2){const v=m,S=e.substring(y+(v.prefix?.length??0),e.length-(v.suffix?.length??0)),C=decodeURIComponent(S);l["*"]=C,l._splat=C;break}}return r.rawParams&&Object.assign(l,r.rawParams),[l,{part:u,node:f,path:h,segment:d}]}function hN(e){const t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function pN(e){const t=Array(e.depth+1);do t[e.depth]=e,e=e.parent;while(e);return t}function mN(e,t,r,a){if(e==="/"&&r.index)return{node:r.index,skipped:0};const o=!Vs(t),l=o&&e!=="/",u=t.length-(o?1:0),f=[{node:r,index:1,skipped:0,depth:1,statics:1,dynamics:0,optionals:0}];let h=null,d=null,m=null;for(;f.length;){const g=f.pop(),{node:y,index:v,skipped:S,depth:C,statics:N,dynamics:w,optionals:O}=g;let{extract:_,rawParams:M,parsedParams:I}=g;if(y.skipOnParamError){if(!Nh(e,t,g))continue;M=g.rawParams,_=g.extract,I=g.parsedParams}a&&y.route&&y.kind!==Vi&&Ss(d,g)&&(d=g);const k=v===u;if(k&&(y.route&&!l&&Ss(m,g)&&(m=g),!y.optional&&!y.wildcard&&!y.index&&!y.pathless))continue;const D=k?void 0:t[v];let U;if(k&&y.index){const H={node:y.index,index:v,skipped:S,depth:C+1,statics:N,dynamics:w,optionals:O,extract:_,rawParams:M,parsedParams:I};let q=!0;if(y.index.skipOnParamError&&(Nh(e,t,H)||(q=!1)),q){if(N===u&&!w&&!O&&!S)return H;Ss(m,H)&&(m=H)}}if(y.wildcard&&Ss(h,g))for(const H of y.wildcard){const{prefix:q,suffix:L}=H;if(q&&(k||!(H.caseSensitive?D:U??=D.toLowerCase()).startsWith(q)))continue;if(L){if(k)continue;const K=t.slice(v).join("/").slice(-L.length);if((H.caseSensitive?K:K.toLowerCase())!==L)continue}const P={node:H,index:u,skipped:S,depth:C,statics:N,dynamics:w,optionals:O,extract:_,rawParams:M,parsedParams:I};if(!(H.skipOnParamError&&!Nh(e,t,P))){h=P;break}}if(y.optional){const H=S|1<<C,q=C+1;for(let L=y.optional.length-1;L>=0;L--){const P=y.optional[L];f.push({node:P,index:v,skipped:H,depth:q,statics:N,dynamics:w,optionals:O,extract:_,rawParams:M,parsedParams:I})}if(!k)for(let L=y.optional.length-1;L>=0;L--){const P=y.optional[L],{prefix:K,suffix:B}=P;if(K||B){const V=P.caseSensitive?D:U??=D.toLowerCase();if(K&&!V.startsWith(K)||B&&!V.endsWith(B))continue}f.push({node:P,index:v+1,skipped:S,depth:q,statics:N,dynamics:w,optionals:O+1,extract:_,rawParams:M,parsedParams:I})}}if(!k&&y.dynamic&&D)for(let H=y.dynamic.length-1;H>=0;H--){const q=y.dynamic[H],{prefix:L,suffix:P}=q;if(L||P){const K=q.caseSensitive?D:U??=D.toLowerCase();if(L&&!K.startsWith(L)||P&&!K.endsWith(P))continue}f.push({node:q,index:v+1,skipped:S,depth:C+1,statics:N,dynamics:w+1,optionals:O,extract:_,rawParams:M,parsedParams:I})}if(!k&&y.staticInsensitive){const H=y.staticInsensitive.get(U??=D.toLowerCase());H&&f.push({node:H,index:v+1,skipped:S,depth:C+1,statics:N+1,dynamics:w,optionals:O,extract:_,rawParams:M,parsedParams:I})}if(!k&&y.static){const H=y.static.get(D);H&&f.push({node:H,index:v+1,skipped:S,depth:C+1,statics:N+1,dynamics:w,optionals:O,extract:_,rawParams:M,parsedParams:I})}if(y.pathless){const H=C+1;for(let q=y.pathless.length-1;q>=0;q--){const L=y.pathless[q];f.push({node:L,index:v,skipped:S,depth:H,statics:N,dynamics:w,optionals:O,extract:_,rawParams:M,parsedParams:I})}}}if(m&&h)return Ss(h,m)?m:h;if(m)return m;if(h)return h;if(a&&d){let g=d.index;for(let v=0;v<d.index;v++)g+=t[v].length;const y=g===e.length?"/":e.slice(g);return d.rawParams??=Object.create(null),d.rawParams["**"]=decodeURIComponent(y),d}return null}function Nh(e,t,r){try{const[a,o]=U1(e,t,r);r.rawParams=a,r.extract=o;const l=r.node.parse(a);return r.parsedParams=Object.assign(Object.create(null),r.parsedParams,l),!0}catch{return null}}function Ss(e,t){return e?t.statics>e.statics||t.statics===e.statics&&(t.dynamics>e.dynamics||t.dynamics===e.dynamics&&(t.optionals>e.optionals||t.optionals===e.optionals&&((t.node.kind===Vi)>(e.node.kind===Vi)||t.node.kind===Vi==(e.node.kind===Vi)&&t.depth>e.depth))):!0}function ic(e){return om(e.filter(t=>t!==void 0).join("/"))}function om(e){return e.replace(/\/{2,}/g,"/")}function q1(e){return e==="/"?e:e.replace(/^\/{1,}/,"")}function hi(e){const t=e.length;return t>1&&e[t-1]==="/"?e.replace(/\/{1,}$/,""):e}function V1(e){return hi(q1(e))}function yc(e,t){return e?.endsWith("/")&&e!=="/"&&e!==`${t}/`?e.slice(0,-1):e}function gN(e,t,r){return yc(e,r)===yc(t,r)}function yN({base:e,to:t,trailingSlash:r="never",cache:a}){const o=t.startsWith("/"),l=!o&&t===".";let u;if(a){u=o?t:l?e:e+"\0"+t;const g=a.get(u);if(g)return g}let f;if(l)f=e.split("/");else if(o)f=t.split("/");else{for(f=e.split("/");f.length>1&&Vs(f)==="";)f.pop();const g=t.split("/");for(let y=0,v=g.length;y<v;y++){const S=g[y];S===""?y?y===v-1&&f.push(S):f=[S]:S===".."?f.pop():S==="."||f.push(S)}}f.length>1&&(Vs(f)===""?r==="never"&&f.pop():r==="always"&&f.push(""));let h,d="";for(let g=0;g<f.length;g++){g>0&&(d+="/");const y=f[g];if(!y)continue;h=im(y,0,h);const v=h[0];if(v===0){d+=y;continue}const S=h[5],C=y.substring(0,h[1]),N=y.substring(h[4],S),w=y.substring(h[2],h[3]);v===1?d+=C||N?`${C}{$${w}}${N}`:`$${w}`:v===2?d+=C||N?`${C}{$}${N}`:"$":d+=`${C}{-$${w}}${N}`}d=om(d);const m=d||"/";return u&&a&&a.set(u,m),m}function xN(e){const t=new Map(e.map(o=>[encodeURIComponent(o),o])),r=Array.from(t.keys()).map(o=>o.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|"),a=new RegExp(r,"g");return o=>o.replace(a,l=>t.get(l)??l)}function Mh(e,t,r){const a=t[e];return typeof a!="string"?a:e==="_splat"?/^[a-zA-Z0-9\-._~!/]*$/.test(a)?a:a.split("/").map(o=>av(o,r)).join("/"):av(a,r)}function iv({path:e,params:t,decoder:r,...a}){let o=!1;const l=Object.create(null);if(!e||e==="/")return{interpolatedPath:"/",usedParams:l,isMissingParams:o};if(!e.includes("$"))return{interpolatedPath:e,usedParams:l,isMissingParams:o};const u=e.length;let f=0,h,d="";for(;f<u;){const m=f;h=im(e,m,h);const g=h[5];if(f=g+1,m===g)continue;const y=h[0];if(y===0){d+="/"+e.substring(m,g);continue}if(y===2){const v=t._splat;l._splat=v,l["*"]=v;const S=e.substring(m,h[1]),C=e.substring(h[4],g);if(!v){o=!0,(S||C)&&(d+="/"+S+C);continue}const N=Mh("_splat",t,r);d+="/"+S+N+C;continue}if(y===1){const v=e.substring(h[2],h[3]);!o&&!(v in t)&&(o=!0),l[v]=t[v];const S=e.substring(m,h[1]),C=e.substring(h[4],g),N=Mh(v,t,r)??"undefined";d+="/"+S+N+C;continue}if(y===3){const v=e.substring(h[2],h[3]),S=t[v];if(S==null)continue;l[v]=S;const C=e.substring(m,h[1]),N=e.substring(h[4],g),w=Mh(v,t,r)??"";d+="/"+C+w+N;continue}}return e.endsWith("/")&&(d+="/"),{usedParams:l,interpolatedPath:d||"/",isMissingParams:o}}function av(e,t){const r=encodeURIComponent(e);return t?.(r)??r}function Pt(e){return!!e?.isNotFound}function vN(){try{return typeof window<"u"&&typeof window.sessionStorage=="object"?window.sessionStorage:void 0}catch{return}}var bN="tsr-scroll-restoration-v1_3";function SN(){const e=vN();if(!e)return null;let t={};try{const a=JSON.parse(e.getItem("tsr-scroll-restoration-v1_3")||"{}");uo(a)&&(t=a)}catch{}return{get state(){return t},set:a=>{t=ui(a,t)||t},persist:()=>{try{e.setItem(bN,JSON.stringify(t))}catch{}}}}var ov=SN(),wN=e=>e.state.__TSR_key||e.href;function EN(e){const t=[];let r;for(;r=e.parentNode;)t.push(`${e.tagName}:nth-child(${Array.prototype.indexOf.call(r.children,e)+1})`),e=r;return`${t.reverse().join(" > ")}`.toLowerCase()}var qu=!1,ws="window",sv="data-scroll-restoration-id";function CN(e,t){if(!ov)return;const r=ov;if((e.options.scrollRestoration??!1)&&(e.isScrollRestoring=!0),e.isScrollRestorationSetup||!r)return;e.isScrollRestorationSetup=!0,qu=!1;const a=e.options.getScrollRestorationKey||wN,o=new Map;window.history.scrollRestoration="manual";const l=f=>{if(!(qu||!e.isScrollRestoring))if(f.target===document||f.target===window)o.set(ws,{scrollX:window.scrollX||0,scrollY:window.scrollY||0});else{const h=f.target;o.set(h,{scrollX:h.scrollLeft||0,scrollY:h.scrollTop||0})}},u=f=>{if(!e.isScrollRestoring||!f||o.size===0||!r)return;const h=r.state[f]||={};for(const[d,m]of o){let g;if(d===ws)g=ws;else if(d.isConnected){const y=d.getAttribute(sv);g=y?`[${sv}="${y}"]`:EN(d)}g&&(h[g]=m)}};document.addEventListener("scroll",l,!0),e.subscribe("onBeforeLoad",f=>{u(f.fromLocation?a(f.fromLocation):void 0),o.clear()}),window.addEventListener("pagehide",()=>{u(a(e.stores.resolvedLocation.state??e.stores.location.state)),r.persist()}),e.subscribe("onRendered",f=>{const h=a(f.toLocation),d=e.options.scrollRestorationBehavior,m=e.options.scrollToTopSelectors;if(o.clear(),!e.resetNextScroll){e.resetNextScroll=!0;return}if(!(typeof e.options.scrollRestoration=="function"&&!e.options.scrollRestoration({location:e.latestLocation}))){qu=!0;try{const g=e.isScrollRestoring?r.state[h]:void 0;let y=!1;if(g)for(const v in g){const S=g[v];if(!uo(S))continue;const{scrollX:C,scrollY:N}=S;if(!(!Number.isFinite(C)||!Number.isFinite(N))){if(v===ws)window.scrollTo({top:N,left:C,behavior:d}),y=!0;else if(v){let w;try{w=document.querySelector(v)}catch{continue}w&&(w.scrollLeft=C,w.scrollTop=N,y=!0)}}}if(!y){const v=e.history.location.hash.slice(1);if(v){const S=window.history.state?.__hashScrollIntoViewOptions??!0;if(S){const C=document.getElementById(v);C&&C.scrollIntoView(S)}}else{const S={top:0,left:0,behavior:d};if(window.scrollTo(S),m)for(const C of m){if(C===ws)continue;const N=typeof C=="function"?C():document.querySelector(C);N&&N.scrollTo(S)}}}}finally{qu=!1}e.isScrollRestoring&&r.set(g=>(g[h]||={},g))}})}function _N(e,t=String){const r=new URLSearchParams;for(const a in e){const o=e[a];o!==void 0&&r.set(a,t(o))}return r.toString()}function kh(e){return e?e==="false"?!1:e==="true"?!0:+e*0===0&&+e+""===e?+e:e:""}function NN(e){const t=new URLSearchParams(e),r=Object.create(null);for(const[a,o]of t.entries()){const l=r[a];l==null?r[a]=kh(o):Array.isArray(l)?l.push(kh(o)):r[a]=[l,kh(o)]}return r}var MN=TN(JSON.parse),kN=AN(JSON.stringify,JSON.parse);function TN(e){return t=>{t[0]==="?"&&(t=t.substring(1));const r=NN(t);for(const a in r){const o=r[a];if(typeof o=="string")try{r[a]=e(o)}catch{}}return r}}function AN(e,t){const r=typeof t=="function";function a(o){if(typeof o=="object"&&o!==null)try{return e(o)}catch{}else if(r&&typeof o=="string")try{return t(o),e(o)}catch{}return o}return o=>{const l=_N(o,a);return l?`?${l}`:""}}var Gi="__root__";function RN(e){if(e.statusCode=e.statusCode||e.code||307,!e._builtLocation&&!e.reloadDocument&&typeof e.href=="string")try{new URL(e.href),e.reloadDocument=!0}catch{}const t=new Headers(e.headers);e.href&&t.get("Location")===null&&t.set("Location",e.href);const r=new Response(null,{status:e.statusCode,headers:t});if(r.options=e,e.throw)throw r;return r}function en(e){return e instanceof Response&&!!e.options}function ON(e){return{input:({url:t})=>{for(const r of e)t=gp(r,t);return t},output:({url:t})=>{for(let r=e.length-1;r>=0;r--)t=F1(e[r],t);return t}}}function jN(e){const t=V1(e.basepath),r=`/${t}`,a=`${r}/`,o=e.caseSensitive?r:r.toLowerCase(),l=e.caseSensitive?a:a.toLowerCase();return{input:({url:u})=>{const f=e.caseSensitive?u.pathname:u.pathname.toLowerCase();return f===o?u.pathname="/":f.startsWith(l)&&(u.pathname=u.pathname.slice(r.length)),u},output:({url:u})=>(u.pathname=ic(["/",t,u.pathname]),u)}}function gp(e,t){const r=e?.input?.({url:t});if(r){if(typeof r=="string")return new URL(r);if(r instanceof URL)return r}return t}function F1(e,t){const r=e?.output?.({url:t});if(r){if(typeof r=="string")return new URL(r);if(r instanceof URL)return r}return t}function DN(e,t){const{createMutableStore:r,createReadonlyStore:a,batch:o,init:l}=t,u=new Map,f=new Map,h=new Map,d=r(e.status),m=r(e.loadedAt),g=r(e.isLoading),y=r(e.isTransitioning),v=r(e.location),S=r(e.resolvedLocation),C=r(e.statusCode),N=r(e.redirect),w=r([]),O=r([]),_=r([]),M=a(()=>Th(u,w.state)),I=a(()=>Th(f,O.state)),k=a(()=>Th(h,_.state)),D=a(()=>w.state[0]),U=a(()=>w.state.some(F=>u.get(F)?.state.status==="pending")),H=a(()=>({locationHref:v.state.href,resolvedLocationHref:S.state?.href,status:d.state})),q=a(()=>({status:d.state,loadedAt:m.state,isLoading:g.state,isTransitioning:y.state,matches:M.state,location:v.state,resolvedLocation:S.state,statusCode:C.state,redirect:N.state})),L=Ys(64);function P(F){let $=L.get(F);return $||($=a(()=>{const Z=w.state;for(const A of Z){const z=u.get(A);if(z&&z.routeId===F)return z.state}}),L.set(F,$)),$}const K={status:d,loadedAt:m,isLoading:g,isTransitioning:y,location:v,resolvedLocation:S,statusCode:C,redirect:N,matchesId:w,pendingMatchesId:O,cachedMatchesId:_,activeMatchesSnapshot:M,pendingMatchesSnapshot:I,cachedMatchesSnapshot:k,firstMatchId:D,hasPendingMatches:U,matchRouteReactivity:H,activeMatchStoresById:u,pendingMatchStoresById:f,cachedMatchStoresById:h,__store:q,getMatchStoreByRouteId:P,setActiveMatches:B,setPendingMatches:V,setCachedMatches:j};B(e.matches),l?.(K);function B(F){Ah(F,u,w,r,o)}function V(F){Ah(F,f,O,r,o)}function j(F){Ah(F,h,_,r,o)}return K}function Th(e,t){const r=[];for(const a of t){const o=e.get(a);o&&r.push(o.state)}return r}function Ah(e,t,r,a,o){const l=e.map(f=>f.id),u=new Set(l);o(()=>{for(const f of t.keys())u.has(f)||t.delete(f);for(const f of e){const h=t.get(f.id);if(!h){const d=a(f);d.routeId=f.routeId,t.set(f.id,d);continue}h.routeId=f.routeId,h.state!==f&&h.setState(()=>f)}aN(r.state,l)||r.setState(()=>l)})}var yp=e=>{if(!e.rendered)return e.rendered=!0,e.onReady?.()},zN=e=>e.stores.matchesId.state.some(t=>e.stores.activeMatchStoresById.get(t)?.state._forcePending),Ic=(e,t)=>!!(e.preload&&!e.router.stores.activeMatchStoresById.has(t)),$i=(e,t,r=!0)=>{const a={...e.router.options.context??{}},o=r?t:t-1;for(let l=0;l<=o;l++){const u=e.matches[l];if(!u)continue;const f=e.router.getMatch(u.id);f&&Object.assign(a,f.__routeContext,f.__beforeLoadContext)}return a},lv=(e,t)=>{if(!e.matches.length)return;const r=t.routeId,a=e.matches.findIndex(u=>u.routeId===e.router.routeTree.id),o=a>=0?a:0;let l=r?e.matches.findIndex(u=>u.routeId===r):e.firstBadMatchIndex??e.matches.length-1;l<0&&(l=o);for(let u=l;u>=0;u--){const f=e.matches[u];if(e.router.looseRoutesById[f.routeId].options.notFoundComponent)return u}return r?l:o},ci=(e,t,r)=>{if(!(!en(r)&&!Pt(r)))throw en(r)&&r.redirectHandled&&!r.options.reloadDocument||(t&&(t._nonReactive.beforeLoadPromise?.resolve(),t._nonReactive.loaderPromise?.resolve(),t._nonReactive.beforeLoadPromise=void 0,t._nonReactive.loaderPromise=void 0,t._nonReactive.error=r,e.updateMatch(t.id,a=>({...a,status:en(r)?"redirected":a.status==="pending"?"success":a.status,context:$i(e,t.index),isFetching:!1,error:r})),Pt(r)&&!r.routeId&&(r.routeId=t.routeId),t._nonReactive.loadPromise?.resolve()),en(r)&&(e.rendered=!0,r.options._fromLocation=e.location,r.redirectHandled=!0,r=e.router.resolveRedirect(r))),r},Y1=(e,t)=>{const r=e.router.getMatch(t);return!!(!r||r._nonReactive.dehydrated)},uv=(e,t,r)=>{const a=$i(e,r);e.updateMatch(t,o=>({...o,context:a}))},Es=(e,t,r,a)=>{const{id:o,routeId:l}=e.matches[t],u=e.router.looseRoutesById[l];if(r instanceof Promise)throw r;r.routerCode=a,e.firstBadMatchIndex??=t,ci(e,e.router.getMatch(o),r);try{u.options.onError?.(r)}catch(f){r=f,ci(e,e.router.getMatch(o),r)}e.updateMatch(o,f=>(f._nonReactive.beforeLoadPromise?.resolve(),f._nonReactive.beforeLoadPromise=void 0,f._nonReactive.loadPromise?.resolve(),{...f,error:r,status:"error",isFetching:!1,updatedAt:Date.now(),abortController:new AbortController})),!e.preload&&!en(r)&&!Pt(r)&&(e.serialError??=r)},X1=(e,t,r,a)=>{if(a._nonReactive.pendingTimeout!==void 0)return;const o=r.options.pendingMs??e.router.options.defaultPendingMs;if(e.onReady&&!Ic(e,t)&&(r.options.loader||r.options.beforeLoad||$1(r))&&typeof o=="number"&&o!==1/0&&(r.options.pendingComponent??e.router.options?.defaultPendingComponent)){const l=setTimeout(()=>{yp(e)},o);a._nonReactive.pendingTimeout=l}},LN=(e,t,r)=>{const a=e.router.getMatch(t);if(!a._nonReactive.beforeLoadPromise&&!a._nonReactive.loaderPromise)return;X1(e,t,r,a);const o=()=>{const l=e.router.getMatch(t);l.preload&&(l.status==="redirected"||l.status==="notFound")&&ci(e,l,l.error)};return a._nonReactive.beforeLoadPromise?a._nonReactive.beforeLoadPromise.then(o):o()},BN=(e,t,r,a)=>{const o=e.router.getMatch(t);let l=o._nonReactive.loadPromise;o._nonReactive.loadPromise=co(()=>{l?.resolve(),l=void 0});const{paramsError:u,searchError:f}=o;u&&Es(e,r,u,"PARSE_PARAMS"),f&&Es(e,r,f,"VALIDATE_SEARCH"),X1(e,t,a,o);const h=new AbortController;let d=!1;const m=()=>{d||(d=!0,e.updateMatch(t,M=>({...M,isFetching:"beforeLoad",fetchCount:M.fetchCount+1,abortController:h})))},g=()=>{o._nonReactive.beforeLoadPromise?.resolve(),o._nonReactive.beforeLoadPromise=void 0,e.updateMatch(t,M=>({...M,isFetching:!1}))};if(!a.options.beforeLoad){e.router.batch(()=>{m(),g()});return}o._nonReactive.beforeLoadPromise=co();const y={...$i(e,r,!1),...o.__routeContext},{search:v,params:S,cause:C}=o,N=Ic(e,t),w={search:v,abortController:h,params:S,preload:N,context:y,location:e.location,navigate:M=>e.router.navigate({...M,_fromLocation:e.location}),buildLocation:e.router.buildLocation,cause:N?"preload":C,matches:e.matches,routeId:a.id,...e.router.options.additionalContext},O=M=>{if(M===void 0){e.router.batch(()=>{m(),g()});return}(en(M)||Pt(M))&&(m(),Es(e,r,M,"BEFORE_LOAD")),e.router.batch(()=>{m(),e.updateMatch(t,I=>({...I,__beforeLoadContext:M})),g()})};let _;try{if(_=a.options.beforeLoad(w),Fs(_))return m(),_.catch(M=>{Es(e,r,M,"BEFORE_LOAD")}).then(O)}catch(M){m(),Es(e,r,M,"BEFORE_LOAD")}O(_)},IN=(e,t)=>{const{id:r,routeId:a}=e.matches[t],o=e.router.looseRoutesById[a],l=()=>f(),u=()=>BN(e,r,t,o),f=()=>{if(Y1(e,r))return;const h=LN(e,r,o);return Fs(h)?h.then(u):u()};return l()},HN=(e,t,r)=>{const a=e.router.getMatch(t);if(!a||!r.options.head&&!r.options.scripts&&!r.options.headers)return;const o={ssr:e.router.options.ssr,matches:e.matches,match:a,params:a.params,loaderData:a.loaderData};return Promise.all([r.options.head?.(o),r.options.scripts?.(o),r.options.headers?.(o)]).then(([l,u,f])=>({meta:l?.meta,links:l?.links,headScripts:l?.scripts,headers:f,scripts:u,styles:l?.styles}))},G1=(e,t,r,a,o)=>{const l=t[a-1],{params:u,loaderDeps:f,abortController:h,cause:d}=e.router.getMatch(r),m=$i(e,a),g=Ic(e,r);return{params:u,deps:f,preload:!!g,parentMatchPromise:l,abortController:h,context:m,location:e.location,navigate:y=>e.router.navigate({...y,_fromLocation:e.location}),cause:g?"preload":d,route:o,...e.router.options.additionalContext}},cv=async(e,t,r,a,o)=>{try{const l=e.router.getMatch(r);try{(!(H1??e.router.isServer)||l.ssr===!0)&&Xs(o);const u=o.options.loader,f=typeof u=="function"?u:u?.handler,h=f?.(G1(e,t,r,a,o)),d=!!f&&Fs(h);if((d||o._lazyPromise||o._componentsPromise||o.options.head||o.options.scripts||o.options.headers||l._nonReactive.minPendingPromise)&&e.updateMatch(r,g=>({...g,isFetching:"loader"})),f){const g=d?await h:h;ci(e,e.router.getMatch(r),g),g!==void 0&&e.updateMatch(r,y=>({...y,loaderData:g}))}o._lazyPromise&&await o._lazyPromise;const m=l._nonReactive.minPendingPromise;m&&await m,o._componentsPromise&&await o._componentsPromise,e.updateMatch(r,g=>({...g,error:void 0,context:$i(e,a),status:"success",isFetching:!1,updatedAt:Date.now()}))}catch(u){let f=u;if(f?.name==="AbortError"){if(l.abortController.signal.aborted){l._nonReactive.loaderPromise?.resolve(),l._nonReactive.loaderPromise=void 0;return}e.updateMatch(r,d=>({...d,status:d.status==="pending"?"success":d.status,isFetching:!1,context:$i(e,a)}));return}const h=l._nonReactive.minPendingPromise;h&&await h,Pt(u)&&await o.options.notFoundComponent?.preload?.(),ci(e,e.router.getMatch(r),u);try{o.options.onError?.(u)}catch(d){f=d,ci(e,e.router.getMatch(r),d)}!en(f)&&!Pt(f)&&await Xs(o,["errorComponent"]),e.updateMatch(r,d=>({...d,error:f,context:$i(e,a),status:"error",isFetching:!1}))}}catch(l){const u=e.router.getMatch(r);u&&(u._nonReactive.loaderPromise=void 0),ci(e,u,l)}},PN=async(e,t,r)=>{async function a(v,S,C,N,w){const O=Date.now()-S.updatedAt,_=v?w.options.preloadStaleTime??e.router.options.defaultPreloadStaleTime??3e4:w.options.staleTime??e.router.options.defaultStaleTime??0,M=w.options.shouldReload,I=typeof M=="function"?M(G1(e,t,o,r,w)):M,{status:k,invalid:D}=N,U=O>=_&&(!!e.forceStaleReload||N.cause==="enter"||C!==void 0&&C!==N.id);u=k==="success"&&(D||(I??U)),v&&w.options.preload===!1||(u&&!e.sync&&m?(f=!0,(async()=>{try{await cv(e,t,o,r,w);const H=e.router.getMatch(o);H._nonReactive.loaderPromise?.resolve(),H._nonReactive.loadPromise?.resolve(),H._nonReactive.loaderPromise=void 0,H._nonReactive.loadPromise=void 0}catch(H){en(H)&&await e.router.navigate(H.options)}})()):k!=="success"||u?await cv(e,t,o,r,w):uv(e,o,r))}const{id:o,routeId:l}=e.matches[r];let u=!1,f=!1;const h=e.router.looseRoutesById[l],d=h.options.loader,m=((typeof d=="function"?void 0:d?.staleReloadMode)??e.router.options.defaultStaleReloadMode)!=="blocking";if(Y1(e,o)){if(!e.router.getMatch(o))return e.matches[r];uv(e,o,r)}else{const v=e.router.getMatch(o),S=e.router.stores.matchesId.state[r],C=(S&&e.router.stores.activeMatchStoresById.get(S)||null)?.routeId===l?S:e.router.stores.activeMatchesSnapshot.state.find(w=>w.routeId===l)?.id,N=Ic(e,o);if(v._nonReactive.loaderPromise){if(v.status==="success"&&!e.sync&&!v.preload&&m)return v;await v._nonReactive.loaderPromise;const w=e.router.getMatch(o),O=w._nonReactive.error||w.error;O&&ci(e,w,O),w.status==="pending"&&await a(N,v,C,w,h)}else{const w=N&&!e.router.stores.activeMatchStoresById.has(o),O=e.router.getMatch(o);O._nonReactive.loaderPromise=co(),w!==O.preload&&e.updateMatch(o,_=>({..._,preload:w})),await a(N,v,C,O,h)}}const g=e.router.getMatch(o);f||(g._nonReactive.loaderPromise?.resolve(),g._nonReactive.loadPromise?.resolve(),g._nonReactive.loadPromise=void 0),clearTimeout(g._nonReactive.pendingTimeout),g._nonReactive.pendingTimeout=void 0,f||(g._nonReactive.loaderPromise=void 0),g._nonReactive.dehydrated=void 0;const y=f?g.isFetching:!1;return y!==g.isFetching||g.invalid!==!1?(e.updateMatch(o,v=>({...v,isFetching:y,invalid:!1})),e.router.getMatch(o)):g};async function fv(e){const t=e,r=[];zN(t.router)&&yp(t);let a;for(let y=0;y<t.matches.length;y++){try{const v=IN(t,y);Fs(v)&&await v}catch(v){if(en(v))throw v;if(Pt(v))a=v;else if(!t.preload)throw v;break}if(t.serialError||t.firstBadMatchIndex!=null)break}const o=t.firstBadMatchIndex??t.matches.length,l=a&&!t.preload?lv(t,a):void 0,u=a&&t.preload?0:l!==void 0?Math.min(l+1,o):o;let f,h;for(let y=0;y<u;y++)r.push(PN(t,r,y));try{await Promise.all(r)}catch{const y=await Promise.allSettled(r);for(const v of y){if(v.status!=="rejected")continue;const S=v.reason;if(en(S))throw S;Pt(S)?f??=S:h??=S}if(h!==void 0)throw h}const d=f??(a&&!t.preload?a:void 0);let m=t.firstBadMatchIndex!==void 0?t.firstBadMatchIndex:t.matches.length-1;if(!d&&a&&t.preload)return t.matches;if(d){const y=lv(t,d);y===void 0&&Mr();const v=t.matches[y],S=t.router.looseRoutesById[v.routeId],C=t.router.options?.defaultNotFoundComponent;!S.options.notFoundComponent&&C&&(S.options.notFoundComponent=C),d.routeId=v.routeId;const N=v.routeId===t.router.routeTree.id;t.updateMatch(v.id,w=>({...w,...N?{status:"success",globalNotFound:!0,error:void 0}:{status:"notFound",error:d},isFetching:!1})),m=y,await Xs(S,["notFoundComponent"])}else if(!t.preload){const y=t.matches[0];y.globalNotFound||t.router.getMatch(y.id)?.globalNotFound&&t.updateMatch(y.id,v=>({...v,globalNotFound:!1,error:void 0}))}if(t.serialError&&t.firstBadMatchIndex!==void 0){const y=t.router.looseRoutesById[t.matches[t.firstBadMatchIndex].routeId];await Xs(y,["errorComponent"])}for(let y=0;y<=m;y++){const{id:v,routeId:S}=t.matches[y],C=t.router.looseRoutesById[S];try{const N=HN(t,v,C);if(N){const w=await N;t.updateMatch(v,O=>({...O,...w}))}}catch(N){console.error(`Error executing head for route ${S}:`,N)}}const g=yp(t);if(Fs(g)&&await g,d)throw d;if(t.serialError&&!t.preload&&!t.onReady)throw t.serialError;return t.matches}function dv(e,t){const r=t.map(a=>e.options[a]?.preload?.()).filter(Boolean);if(r.length!==0)return Promise.all(r)}function Xs(e,t=ac){!e._lazyLoaded&&e._lazyPromise===void 0&&(e.lazyFn?e._lazyPromise=e.lazyFn().then(a=>{const{id:o,...l}=a.options;Object.assign(e.options,l),e._lazyLoaded=!0,e._lazyPromise=void 0}):e._lazyLoaded=!0);const r=()=>e._componentsLoaded?void 0:t===ac?(()=>{if(e._componentsPromise===void 0){const a=dv(e,ac);a?e._componentsPromise=a.then(()=>{e._componentsLoaded=!0,e._componentsPromise=void 0}):e._componentsLoaded=!0}return e._componentsPromise})():dv(e,t);return e._lazyPromise?e._lazyPromise.then(r):r()}function $1(e){for(const t of ac)if(e.options[t]?.preload)return!0;return!1}var ac=["component","errorComponent","pendingComponent","notFoundComponent"],pi="__TSR_index",hv="popstate",pv="beforeunload";function UN(e){let t=e.getLocation();const r=new Set,a=u=>{t=e.getLocation(),r.forEach(f=>f({location:t,action:u}))},o=u=>{e.notifyOnIndexChange??!0?a(u):t=e.getLocation()},l=async({task:u,navigateOpts:f,...h})=>{if(f?.ignoreBlocker??!1){u();return}const d=e.getBlockers?.()??[],m=h.type==="PUSH"||h.type==="REPLACE";if(typeof document<"u"&&d.length&&m)for(const g of d){const y=Gs(h.path,h.state);if(await g.blockerFn({currentLocation:t,nextLocation:y,action:h.type})){e.onBlocked?.();return}}u()};return{get location(){return t},get length(){return e.getLength()},subscribers:r,subscribe:u=>(r.add(u),()=>{r.delete(u)}),push:(u,f,h)=>{const d=t.state[pi];f=mv(d+1,f),l({task:()=>{e.pushState(u,f),a({type:"PUSH"})},navigateOpts:h,type:"PUSH",path:u,state:f})},replace:(u,f,h)=>{const d=t.state[pi];f=mv(d,f),l({task:()=>{e.replaceState(u,f),a({type:"REPLACE"})},navigateOpts:h,type:"REPLACE",path:u,state:f})},go:(u,f)=>{l({task:()=>{e.go(u),o({type:"GO",index:u})},navigateOpts:f,type:"GO"})},back:u=>{l({task:()=>{e.back(u?.ignoreBlocker??!1),o({type:"BACK"})},navigateOpts:u,type:"BACK"})},forward:u=>{l({task:()=>{e.forward(u?.ignoreBlocker??!1),o({type:"FORWARD"})},navigateOpts:u,type:"FORWARD"})},canGoBack:()=>t.state[pi]!==0,createHref:u=>e.createHref(u),block:u=>{if(!e.setBlockers)return()=>{};const f=e.getBlockers?.()??[];return e.setBlockers([...f,u]),()=>{const h=e.getBlockers?.()??[];e.setBlockers?.(h.filter(d=>d!==u))}},flush:()=>e.flush?.(),destroy:()=>e.destroy?.(),notify:a}}function mv(e,t){t||(t={});const r=sm();return{...t,key:r,__TSR_key:r,[pi]:e}}function Q1(e){const t=e?.window??(typeof document<"u"?window:void 0),r=t.history.pushState,a=t.history.replaceState;let o=[];const l=()=>o,u=U=>o=U,f=e?.createHref??(U=>U),h=e?.parseLocation??(()=>Gs(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){const U=sm();t.history.replaceState({[pi]:0,key:U,__TSR_key:U},"")}let d=h(),m,g=!1,y=!1,v=!1,S=!1;const C=()=>d;let N,w;const O=()=>{N&&(D._ignoreSubscribers=!0,(N.isPush?t.history.pushState:t.history.replaceState)(N.state,"",N.href),D._ignoreSubscribers=!1,N=void 0,w=void 0,m=void 0)},_=(U,H,q)=>{const L=f(H);w||(m=d),d=Gs(H,q),N={href:L,state:q,isPush:N?.isPush||U==="push"},w||(w=Promise.resolve().then(()=>O()))},M=U=>{d=h(),D.notify({type:U})},I=async()=>{if(y){y=!1;return}const U=h(),H=U.state[pi]-d.state[pi],q=H===1,L=H===-1,P=!q&&!L||g;g=!1;const K=P?"GO":L?"BACK":"FORWARD",B=P?{type:"GO",index:H}:{type:L?"BACK":"FORWARD"};if(v)v=!1;else{const V=l();if(typeof document<"u"&&V.length){for(const j of V)if(await j.blockerFn({currentLocation:d,nextLocation:U,action:K})){y=!0,t.history.go(1),D.notify(B);return}}}d=h(),D.notify(B)},k=U=>{if(S){S=!1;return}let H=!1;const q=l();if(typeof document<"u"&&q.length)for(const L of q){const P=L.enableBeforeUnload??!0;if(P===!0){H=!0;break}if(typeof P=="function"&&P()===!0){H=!0;break}}if(H)return U.preventDefault(),U.returnValue=""},D=UN({getLocation:C,getLength:()=>t.history.length,pushState:(U,H)=>_("push",U,H),replaceState:(U,H)=>_("replace",U,H),back:U=>(U&&(v=!0),S=!0,t.history.back()),forward:U=>{U&&(v=!0),S=!0,t.history.forward()},go:U=>{g=!0,t.history.go(U)},createHref:U=>f(U),flush:O,destroy:()=>{t.history.pushState=r,t.history.replaceState=a,t.removeEventListener(pv,k,{capture:!0}),t.removeEventListener(hv,I)},onBlocked:()=>{m&&d!==m&&(d=m)},getBlockers:l,setBlockers:u,notifyOnIndexChange:!1});return t.addEventListener(pv,k,{capture:!0}),t.addEventListener(hv,I),t.history.pushState=function(...U){const H=r.apply(t.history,U);return D._ignoreSubscribers||M("PUSH"),H},t.history.replaceState=function(...U){const H=a.apply(t.history,U);return D._ignoreSubscribers||M("REPLACE"),H},D}function qN(e){const t=typeof document<"u"?window:void 0;return Q1({window:t,parseLocation:()=>{const r=t.location.hash.split("#").slice(1),a=r[0]??"/",o=t.location.search,l=r.slice(1);return Gs(`${a}${o}${l.length===0?"":`#${l.join("#")}`}`,t.history.state)},createHref:r=>`${t.location.pathname}${t.location.search}#${r}`})}function VN(e){let t=e.replace(/[\x00-\x1f\x7f]/g,"");return t.startsWith("//")&&(t="/"+t.replace(/^\/+/,"")),t}function Gs(e,t){const r=VN(e),a=r.indexOf("#"),o=r.indexOf("?"),l=sm();return{href:r,pathname:r.substring(0,a>0?o>0?Math.min(a,o):a:o>0?o:r.length),hash:a>-1?r.substring(a):"",search:o>-1?r.slice(o,a===-1?void 0:a):"",state:t||{[pi]:0,key:l,__TSR_key:l}}}function sm(){return(Math.random()+1).toString(36).substring(7)}function no(e,t){const r=t,a=e;return{fromLocation:r,toLocation:a,pathChanged:r?.pathname!==a.pathname,hrefChanged:r?.href!==a.href,hashChanged:r?.hash!==a.hash}}var FN=class{constructor(e,t){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this.resetNextScroll=!0,this.shouldViewTransition=void 0,this.isViewTransitionTypesSupported=void 0,this.subscribers=new Set,this.isScrollRestoring=!1,this.isScrollRestorationSetup=!1,this.startTransition=r=>r(),this.update=r=>{const a=this.options,o=this.basepath??a?.basepath??"/",l=this.basepath===void 0,u=a?.rewrite;if(this.options={...a,...r},this.isServer=this.options.isServer??typeof document>"u",this.protocolAllowlist=new Set(this.options.protocolAllowlist),this.options.pathParamsAllowedCharacters&&(this.pathParamsDecoder=xN(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=Q1()),this.origin=this.options.origin,this.origin||(window?.origin&&window.origin!=="null"?this.origin=window.origin:this.origin="http://localhost"),this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree){this.routeTree=this.options.routeTree;let m;this.resolvePathCache=Ys(1e3),m=this.buildRouteTree(),this.setRoutes(m)}if(!this.stores&&this.latestLocation){const m=this.getStoreConfig(this);this.batch=m.batch,this.stores=DN(XN(this.latestLocation),m),CN(this)}let f=!1;const h=this.options.basepath??"/",d=this.options.rewrite;if(l||o!==h||u!==d){this.basepath=h;const m=[],g=V1(h);g&&g!=="/"&&m.push(jN({basepath:h})),d&&m.push(d),this.rewrite=m.length===0?void 0:m.length===1?m[0]:ON(m),this.history&&this.updateLatestLocation(),f=!0}f&&this.stores&&this.stores.location.setState(()=>this.latestLocation),typeof window<"u"&&"CSS"in window&&typeof window.CSS?.supports=="function"&&(this.isViewTransitionTypesSupported=window.CSS.supports("selector(:active-view-transition-type(a)"))},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{const r=dN(this.routeTree,this.options.caseSensitive,(a,o)=>{a.init({originalIndex:o})});return this.options.routeMasks&&sN(this.options.routeMasks,r.processedTree),r},this.subscribe=(r,a)=>{const o={eventType:r,fn:a};return this.subscribers.add(o),()=>{this.subscribers.delete(o)}},this.emit=r=>{this.subscribers.forEach(a=>{a.eventType===r.type&&a.fn(r)})},this.parseLocation=(r,a)=>{const o=({pathname:h,search:d,hash:m,href:g,state:y})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(h)){const w=this.options.parseSearch(d),O=this.options.stringifySearch(w);return{href:h+O+m,publicHref:h+O+m,pathname:bs(h).path,external:!1,searchStr:O,search:Ii(a?.search,w),hash:bs(m.slice(1)).path,state:qi(a?.state,y)}}const v=new URL(g,this.origin),S=gp(this.rewrite,v),C=this.options.parseSearch(S.search),N=this.options.stringifySearch(C);return S.search=N,{href:S.href.replace(S.origin,""),publicHref:g,pathname:bs(S.pathname).path,external:!!this.rewrite&&S.origin!==this.origin,searchStr:N,search:Ii(a?.search,C),hash:bs(S.hash.slice(1)).path,state:qi(a?.state,y)}},l=o(r),{__tempLocation:u,__tempKey:f}=l.state;if(u&&(!f||f===this.tempLocationKey)){const h=o(u);return h.state.key=l.state.key,h.state.__TSR_key=l.state.__TSR_key,delete h.state.__tempLocation,{...h,maskedLocation:l}}return l},this.resolvePathWithBase=(r,a)=>yN({base:r,to:om(a),trailingSlash:this.options.trailingSlash,cache:this.resolvePathCache}),this.matchRoutes=(r,a,o)=>typeof r=="string"?this.matchRoutesInternal({pathname:r,search:a},o):this.matchRoutesInternal(r,a),this.getMatchedRoutes=r=>GN({pathname:r,routesById:this.routesById,processedTree:this.processedTree}),this.cancelMatch=r=>{const a=this.getMatch(r);a&&(a.abortController.abort(),clearTimeout(a._nonReactive.pendingTimeout),a._nonReactive.pendingTimeout=void 0)},this.cancelMatches=()=>{this.stores.pendingMatchesId.state.forEach(r=>{this.cancelMatch(r)}),this.stores.matchesId.state.forEach(r=>{if(this.stores.pendingMatchStoresById.has(r))return;const a=this.stores.activeMatchStoresById.get(r)?.state;a&&(a.status==="pending"||a.isFetching==="loader")&&this.cancelMatch(r)})},this.buildLocation=r=>{const a=(l={})=>{const u=l._fromLocation||this.pendingBuiltLocation||this.latestLocation,f=this.matchRoutesLightweight(u);l.from;const h=l.unsafeRelative==="path"?u.pathname:l.from??f.fullPath,d=this.resolvePathWithBase(h,"."),m=f.search,g=Object.assign(Object.create(null),f.params),y=l.to?this.resolvePathWithBase(d,`${l.to}`):this.resolvePathWithBase(d,"."),v=l.params===!1||l.params===null?Object.create(null):(l.params??!0)===!0?g:Object.assign(g,ui(l.params,g)),S=this.getMatchedRoutes(y);let C=S.matchedRoutes;if((!S.foundRoute||S.foundRoute.path!=="/"&&S.routeParams["**"])&&this.options.notFoundRoute&&(C=[...C,this.options.notFoundRoute]),Object.keys(v).length>0)for(const q of C){const L=q.options.params?.stringify??q.options.stringifyParams;if(L)try{Object.assign(v,L(v))}catch{}}const N=r.leaveParams?y:bs(iv({path:y,params:v,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath).path;let w=m;if(r._includeValidateSearch&&this.options.search?.strict){const q={};C.forEach(L=>{if(L.options.validateSearch)try{Object.assign(q,oc(L.options.validateSearch,{...q,...w}))}catch{}}),w=q}w=$N({search:w,dest:l,destRoutes:C,_includeValidateSearch:r._includeValidateSearch}),w=Ii(m,w);const O=this.options.stringifySearch(w),_=l.hash===!0?u.hash:l.hash?ui(l.hash,u.hash):void 0,M=_?`#${_}`:"";let I=l.state===!0?u.state:l.state?ui(l.state,u.state):{};I=qi(u.state,I);const k=`${N}${O}${M}`;let D,U,H=!1;if(this.rewrite){const q=new URL(k,this.origin),L=F1(this.rewrite,q);D=q.href.replace(q.origin,""),L.origin!==this.origin?(U=L.href,H=!0):U=L.pathname+L.search+L.hash}else D=iN(k),U=D;return{publicHref:U,href:D,pathname:N,search:w,searchStr:O,state:I,hash:_??"",external:H,unmaskOnReload:l.unmaskOnReload}},o=(l={},u)=>{const f=a(l);let h=u?a(u):void 0;if(!h){const d=Object.create(null);if(this.options.routeMasks){const m=lN(f.pathname,this.processedTree);if(m){Object.assign(d,m.rawParams);const{from:g,params:y,...v}=m.route,S=y===!1||y===null?Object.create(null):(y??!0)===!0?d:Object.assign(d,ui(y,d));u={from:r.from,...v,params:S},h=a(u)}}}return h&&(f.maskedLocation=h),f};return r.mask?o(r,{from:r.from,...r.mask}):o(r)},this.commitLocation=async({viewTransition:r,ignoreBlocker:a,...o})=>{const l=()=>{const h=["key","__TSR_key","__TSR_index","__hashScrollIntoViewOptions"];h.forEach(m=>{o.state[m]=this.latestLocation.state[m]});const d=Xi(o.state,this.latestLocation.state);return h.forEach(m=>{delete o.state[m]}),d},u=hi(this.latestLocation.href)===hi(o.href);let f=this.commitLocationPromise;if(this.commitLocationPromise=co(()=>{f?.resolve(),f=void 0}),u&&l())this.load();else{let{maskedLocation:h,hashScrollIntoView:d,...m}=o;h&&(m={...h,state:{...h.state,__tempKey:void 0,__tempLocation:{...m,search:m.searchStr,state:{...m.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(m.unmaskOnReload??this.options.unmaskOnReload??!1)&&(m.state.__tempKey=this.tempLocationKey)),m.state.__hashScrollIntoViewOptions=d??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=r,this.history[o.replace?"replace":"push"](m.publicHref,m.state,{ignoreBlocker:a})}return this.resetNextScroll=o.resetScroll??!0,this.history.subscribers.size||this.load(),this.commitLocationPromise},this.buildAndCommitLocation=({replace:r,resetScroll:a,hashScrollIntoView:o,viewTransition:l,ignoreBlocker:u,href:f,...h}={})=>{if(f){const g=this.history.location.state.__TSR_index,y=Gs(f,{__TSR_index:r?g:g+1}),v=new URL(y.pathname,this.origin);h.to=gp(this.rewrite,v).pathname,h.search=this.options.parseSearch(y.search),h.hash=y.hash.slice(1)}const d=this.buildLocation({...h,_includeValidateSearch:!0});this.pendingBuiltLocation=d;const m=this.commitLocation({...d,viewTransition:l,replace:r,resetScroll:a,hashScrollIntoView:o,ignoreBlocker:u});return Promise.resolve().then(()=>{this.pendingBuiltLocation===d&&(this.pendingBuiltLocation=void 0)}),m},this.navigate=async({to:r,reloadDocument:a,href:o,publicHref:l,...u})=>{let f=!1;if(o)try{new URL(`${o}`),f=!0}catch{}if(f&&!a&&(a=!0),a){if(r!==void 0||!o){const d=this.buildLocation({to:r,...u});o=o??d.publicHref,l=l??d.publicHref}const h=!f&&l?l:o;if(gc(h,this.protocolAllowlist))return Promise.resolve();if(!u.ignoreBlocker){const d=this.history.getBlockers?.()??[];for(const m of d)if(m?.blockerFn&&await m.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:"PUSH"}))return Promise.resolve()}return u.replace?window.location.replace(h):window.location.href=h,Promise.resolve()}return this.buildAndCommitLocation({...u,href:o,to:r,_isNavigate:!0})},this.beforeLoad=()=>{this.cancelMatches(),this.updateLatestLocation();const r=this.matchRoutes(this.latestLocation),a=this.stores.cachedMatchesSnapshot.state.filter(o=>!r.some(l=>l.id===o.id));this.batch(()=>{this.stores.status.setState(()=>"pending"),this.stores.statusCode.setState(()=>200),this.stores.isLoading.setState(()=>!0),this.stores.location.setState(()=>this.latestLocation),this.stores.setPendingMatches(r),this.stores.setCachedMatches(a)})},this.load=async r=>{let a,o,l;const u=this.stores.resolvedLocation.state??this.stores.location.state;for(l=new Promise(h=>{this.startTransition(async()=>{try{this.beforeLoad();const d=this.latestLocation,m=this.stores.resolvedLocation.state,g=no(d,m);this.stores.redirect.state||this.emit({type:"onBeforeNavigate",...g}),this.emit({type:"onBeforeLoad",...g}),await fv({router:this,sync:r?.sync,forceStaleReload:u.href===d.href,matches:this.stores.pendingMatchesSnapshot.state,location:d,updateMatch:this.updateMatch,onReady:async()=>{this.startTransition(()=>{this.startViewTransition(async()=>{let y=null,v=null,S=null,C=null;this.batch(()=>{const N=this.stores.pendingMatchesSnapshot.state,w=N.length,O=this.stores.activeMatchesSnapshot.state;y=w?O.filter(I=>!this.stores.pendingMatchStoresById.has(I.id)):null;const _=new Set;for(const I of this.stores.pendingMatchStoresById.values())I.routeId&&_.add(I.routeId);const M=new Set;for(const I of this.stores.activeMatchStoresById.values())I.routeId&&M.add(I.routeId);v=w?O.filter(I=>!_.has(I.routeId)):null,S=w?N.filter(I=>!M.has(I.routeId)):null,C=w?N.filter(I=>M.has(I.routeId)):O,this.stores.isLoading.setState(()=>!1),this.stores.loadedAt.setState(()=>Date.now()),w&&(this.stores.setActiveMatches(N),this.stores.setPendingMatches([]),this.stores.setCachedMatches([...this.stores.cachedMatchesSnapshot.state,...y.filter(I=>I.status!=="error"&&I.status!=="notFound"&&I.status!=="redirected")]),this.clearExpiredCache())});for(const[N,w]of[[v,"onLeave"],[S,"onEnter"],[C,"onStay"]])if(N)for(const O of N)this.looseRoutesById[O.routeId].options[w]?.(O)})})}})}catch(d){en(d)?(a=d,this.navigate({...a.options,replace:!0,ignoreBlocker:!0})):Pt(d)&&(o=d);const m=a?a.status:o?404:this.stores.activeMatchesSnapshot.state.some(g=>g.status==="error")?500:200;this.batch(()=>{this.stores.statusCode.setState(()=>m),this.stores.redirect.setState(()=>a)})}this.latestLoadPromise===l&&(this.commitLocationPromise?.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),h()})}),this.latestLoadPromise=l,await l;this.latestLoadPromise&&l!==this.latestLoadPromise;)await this.latestLoadPromise;let f;this.hasNotFoundMatch()?f=404:this.stores.activeMatchesSnapshot.state.some(h=>h.status==="error")&&(f=500),f!==void 0&&this.stores.statusCode.setState(()=>f)},this.startViewTransition=r=>{const a=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,a&&typeof document<"u"&&"startViewTransition"in document&&typeof document.startViewTransition=="function"){let o;if(typeof a=="object"&&this.isViewTransitionTypesSupported){const l=this.latestLocation,u=this.stores.resolvedLocation.state,f=typeof a.types=="function"?a.types(no(l,u)):a.types;if(f===!1){r();return}o={update:r,types:f}}else o=r;document.startViewTransition(o)}else r()},this.updateMatch=(r,a)=>{this.startTransition(()=>{const o=this.stores.pendingMatchStoresById.get(r);if(o){o.setState(a);return}const l=this.stores.activeMatchStoresById.get(r);if(l){l.setState(a);return}const u=this.stores.cachedMatchStoresById.get(r);if(u){const f=a(u.state);f.status==="redirected"?this.stores.cachedMatchStoresById.delete(r)&&this.stores.cachedMatchesId.setState(h=>h.filter(d=>d!==r)):u.setState(()=>f)}})},this.getMatch=r=>this.stores.cachedMatchStoresById.get(r)?.state??this.stores.pendingMatchStoresById.get(r)?.state??this.stores.activeMatchStoresById.get(r)?.state,this.invalidate=r=>{const a=o=>r?.filter?.(o)??!0?{...o,invalid:!0,...r?.forcePending||o.status==="error"||o.status==="notFound"?{status:"pending",error:void 0}:void 0}:o;return this.batch(()=>{this.stores.setActiveMatches(this.stores.activeMatchesSnapshot.state.map(a)),this.stores.setCachedMatches(this.stores.cachedMatchesSnapshot.state.map(a)),this.stores.setPendingMatches(this.stores.pendingMatchesSnapshot.state.map(a))}),this.shouldViewTransition=!1,this.load({sync:r?.sync})},this.getParsedLocationHref=r=>r.publicHref||"/",this.resolveRedirect=r=>{const a=r.headers.get("Location");if(!r.options.href||r.options._builtLocation){const o=r.options._builtLocation??this.buildLocation(r.options),l=this.getParsedLocationHref(o);r.options.href=l,r.headers.set("Location",l)}else if(a)try{const o=new URL(a);if(this.origin&&o.origin===this.origin){const l=o.pathname+o.search+o.hash;r.options.href=l,r.headers.set("Location",l)}}catch{}if(r.options.href&&!r.options._builtLocation&&gc(r.options.href,this.protocolAllowlist))throw new Error("Redirect blocked: unsafe protocol");return r.headers.get("Location")||r.headers.set("Location",r.options.href),r},this.clearCache=r=>{const a=r?.filter;a!==void 0?this.stores.setCachedMatches(this.stores.cachedMatchesSnapshot.state.filter(o=>!a(o))):this.stores.setCachedMatches([])},this.clearExpiredCache=()=>{const r=Date.now(),a=o=>{const l=this.looseRoutesById[o.routeId];if(!l.options.loader)return!0;const u=(o.preload?l.options.preloadGcTime??this.options.defaultPreloadGcTime:l.options.gcTime??this.options.defaultGcTime)??300*1e3;return o.status==="error"?!0:r-o.updatedAt>=u};this.clearCache({filter:a})},this.loadRouteChunk=Xs,this.preloadRoute=async r=>{const a=r._builtLocation??this.buildLocation(r);let o=this.matchRoutes(a,{throwOnError:!0,preload:!0,dest:r});const l=new Set([...this.stores.matchesId.state,...this.stores.pendingMatchesId.state]),u=new Set([...l,...this.stores.cachedMatchesId.state]),f=o.filter(h=>!u.has(h.id));if(f.length){const h=this.stores.cachedMatchesSnapshot.state;this.stores.setCachedMatches([...h,...f])}try{return o=await fv({router:this,matches:o,location:a,preload:!0,updateMatch:(h,d)=>{l.has(h)?o=o.map(m=>m.id===h?d(m):m):this.updateMatch(h,d)}}),o}catch(h){if(en(h))return h.options.reloadDocument?void 0:await this.preloadRoute({...h.options,_fromLocation:a});Pt(h)||console.error(h);return}},this.matchRoute=(r,a)=>{const o={...r,to:r.to?this.resolvePathWithBase(r.from||"",r.to):void 0,params:r.params||{},leaveParams:!0},l=this.buildLocation(o);if(a?.pending&&this.stores.status.state!=="pending")return!1;const u=(a?.pending===void 0?!this.stores.isLoading.state:a.pending)?this.latestLocation:this.stores.resolvedLocation.state||this.stores.location.state,f=uN(l.pathname,a?.caseSensitive??!1,a?.fuzzy??!1,u.pathname,this.processedTree);return!f||r.params&&!Xi(f.rawParams,r.params,{partial:!0})?!1:a?.includeSearch??!0?Xi(u.search,l.search,{partial:!0})?f.rawParams:!1:f.rawParams},this.hasNotFoundMatch=()=>this.stores.activeMatchesSnapshot.state.some(r=>r.status==="notFound"||r.globalNotFound),this.getStoreConfig=t,this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...e,caseSensitive:e.caseSensitive??!1,notFoundMode:e.notFoundMode??"fuzzy",stringifySearch:e.stringifySearch??kN,parseSearch:e.parseSearch??MN,protocolAllowlist:e.protocolAllowlist??rN}),typeof document<"u"&&(self.__TSR_ROUTER__=this)}isShell(){return!!this.options.isShell}isPrerendering(){return!!this.options.isPrerendering}get state(){return this.stores.__store.state}setRoutes({routesById:e,routesByPath:t,processedTree:r}){this.routesById=e,this.routesByPath=t,this.processedTree=r;const a=this.options.notFoundRoute;a&&(a.init({originalIndex:99999999999}),this.routesById[a.id]=a)}get looseRoutesById(){return this.routesById}getParentContext(e){return e?.id?e.context??this.options.context??void 0:this.options.context??void 0}matchRoutesInternal(e,t){const r=this.getMatchedRoutes(e.pathname),{foundRoute:a,routeParams:o,parsedParams:l}=r;let{matchedRoutes:u}=r,f=!1;(a?a.path!=="/"&&o["**"]:hi(e.pathname))&&(this.options.notFoundRoute?u=[...u,this.options.notFoundRoute]:f=!0);const h=f?ZN(this.options.notFoundMode,u):void 0,d=new Array(u.length),m=new Map;for(const g of this.stores.activeMatchStoresById.values())g.routeId&&m.set(g.routeId,g.state);for(let g=0;g<u.length;g++){const y=u[g],v=d[g-1];let S,C,N;{const K=v?.search??e.search,B=v?._strictSearch??void 0;try{const V=oc(y.options.validateSearch,{...K})??void 0;S={...K,...V},C={...B,...V},N=void 0}catch(V){let j=V;if(V instanceof xc||(j=new xc(V.message,{cause:V})),t?.throwOnError)throw j;S=K,C={},N=j}}const w=y.options.loaderDeps?.({search:S})??"",O=w?JSON.stringify(w):"",{interpolatedPath:_,usedParams:M}=iv({path:y.fullPath,params:o,decoder:this.pathParamsDecoder,server:this.isServer}),I=y.id+_+O,k=this.getMatch(I),D=m.get(y.id),U=k?._strictParams??M;let H;if(!k)try{gv(y,M,l,U)}catch(K){if(Pt(K)||en(K)?H=K:H=new YN(K.message,{cause:K}),t?.throwOnError)throw H}Object.assign(o,U);const q=D?"stay":"enter";let L;if(k)L={...k,cause:q,params:D?.params??o,_strictParams:U,search:Ii(D?D.search:k.search,S),_strictSearch:C};else{const K=y.options.loader||y.options.beforeLoad||y.lazyFn||$1(y)?"pending":"success";L={id:I,ssr:y.options.ssr,index:g,routeId:y.id,params:D?.params??o,_strictParams:U,pathname:_,updatedAt:Date.now(),search:D?Ii(D.search,S):S,_strictSearch:C,searchError:void 0,status:K,isFetching:!1,error:void 0,paramsError:H,__routeContext:void 0,_nonReactive:{loadPromise:co()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:q,loaderDeps:D?qi(D.loaderDeps,w):w,invalid:!1,preload:!1,links:void 0,scripts:void 0,headScripts:void 0,meta:void 0,staticData:y.options.staticData||{},fullPath:y.fullPath}}t?.preload||(L.globalNotFound=h===y.id),L.searchError=N;const P=this.getParentContext(v);L.context={...P,...L.__routeContext,...L.__beforeLoadContext},d[g]=L}for(let g=0;g<d.length;g++){const y=d[g],v=this.looseRoutesById[y.routeId],S=this.getMatch(y.id),C=m.get(y.routeId);if(y.params=C?Ii(C.params,o):o,!S){const N=d[g-1],w=this.getParentContext(N);if(v.options.context){const O={deps:y.loaderDeps,params:y.params,context:w??{},location:e,navigate:_=>this.navigate({..._,_fromLocation:e}),buildLocation:this.buildLocation,cause:y.cause,abortController:y.abortController,preload:!!y.preload,matches:d,routeId:v.id};y.__routeContext=v.options.context(O)??void 0}y.context={...w,...y.__routeContext,...y.__beforeLoadContext}}}return d}matchRoutesLightweight(e){const{matchedRoutes:t,routeParams:r,parsedParams:a}=this.getMatchedRoutes(e.pathname),o=Vs(t),l={...e.search};for(const m of t)try{Object.assign(l,oc(m.options.validateSearch,l))}catch{}const u=Vs(this.stores.matchesId.state),f=u&&this.stores.activeMatchStoresById.get(u)?.state,h=f&&f.routeId===o.id&&f.pathname===e.pathname;let d;if(h)d=f.params;else{const m=Object.assign(Object.create(null),r);for(const g of t)try{gv(g,r,a??{},m)}catch{}d=m}return{matchedRoutes:t,fullPath:o.fullPath,search:l,params:d}}},xc=class extends Error{},YN=class extends Error{};function XN(e){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:"idle",resolvedLocation:void 0,location:e,matches:[],statusCode:200}}function oc(e,t){if(e==null)return{};if("~standard"in e){const r=e["~standard"].validate(t);if(r instanceof Promise)throw new xc("Async validation not supported");if(r.issues)throw new xc(JSON.stringify(r.issues,void 0,2),{cause:r});return r.value}return"parse"in e?e.parse(t):typeof e=="function"?e(t):{}}function GN({pathname:e,routesById:t,processedTree:r}){const a=Object.create(null),o=hi(e);let l,u;const f=cN(o,r,!0);return f&&(l=f.route,Object.assign(a,f.rawParams),u=Object.assign(Object.create(null),f.parsedParams)),{matchedRoutes:f?.branch||[t.__root__],routeParams:a,foundRoute:l,parsedParams:u}}function $N({search:e,dest:t,destRoutes:r,_includeValidateSearch:a}){return QN(r)(e,t,a??!1)}function QN(e){const t={dest:null,_includeValidateSearch:!1,middlewares:[]};for(const o of e){if("search"in o.options)o.options.search?.middlewares&&t.middlewares.push(...o.options.search.middlewares);else if(o.options.preSearchFilters||o.options.postSearchFilters){const l=({search:u,next:f})=>{let h=u;"preSearchFilters"in o.options&&o.options.preSearchFilters&&(h=o.options.preSearchFilters.reduce((m,g)=>g(m),u));const d=f(h);return"postSearchFilters"in o.options&&o.options.postSearchFilters?o.options.postSearchFilters.reduce((m,g)=>g(m),d):d};t.middlewares.push(l)}if(o.options.validateSearch){const l=({search:u,next:f})=>{const h=f(u);if(!t._includeValidateSearch)return h;try{return{...h,...oc(o.options.validateSearch,h)??void 0}}catch{return h}};t.middlewares.push(l)}}const r=({search:o})=>{const l=t.dest;return l.search?l.search===!0?o:ui(l.search,o):{}};t.middlewares.push(r);const a=(o,l,u)=>{if(o>=u.length)return l;const f=u[o];return f({search:l,next:d=>a(o+1,d,u)})};return function(l,u,f){return t.dest=u,t._includeValidateSearch=f,a(0,l,t.middlewares)}}function ZN(e,t){if(e!=="root")for(let r=t.length-1;r>=0;r--){const a=t[r];if(a.children)return a.id}return Gi}function gv(e,t,r,a){const o=e.options.params?.parse??e.options.parseParams;if(o)if(e.options.skipRouteOnParseError)for(const l in t)l in r&&(a[l]=r[l]);else{const l=o(a);Object.assign(a,l)}}var KN="Error preloading route! ☝️",Z1=class{get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}constructor(e){if(this.init=t=>{this.originalIndex=t.originalIndex;const r=this.options,a=!r?.path&&!r?.id;this.parentRoute=this.options.getParentRoute?.(),a?this._path=Gi:this.parentRoute||Mr();let o=a?Gi:r?.path;o&&o!=="/"&&(o=q1(o));const l=r?.id||o;let u=a?Gi:ic([this.parentRoute.id==="__root__"?"":this.parentRoute.id,l]);o==="__root__"&&(o="/"),u!=="__root__"&&(u=ic(["/",u]));const f=u==="__root__"?"/":ic([this.parentRoute.fullPath,o]);this._path=o,this._id=u,this._fullPath=f,this._to=hi(f)},this.addChildren=t=>this._addFileChildren(t),this._addFileChildren=t=>(Array.isArray(t)&&(this.children=t),typeof t=="object"&&t!==null&&(this.children=Object.values(t)),this),this._addFileTypes=()=>this,this.updateLoader=t=>(Object.assign(this.options,t),this),this.update=t=>(Object.assign(this.options,t),this),this.lazy=t=>(this.lazyFn=t,this),this.redirect=t=>RN({from:this.fullPath,...t}),this.options=e||{},this.isRoot=!e?.getParentRoute,e?.id&&e?.path)throw new Error("Route cannot have both an 'id' and a 'path' option.")}},JN=class extends Z1{constructor(e){super(e)}};function WN(e){if(typeof document<"u"&&document.querySelector){const t=e.stores.location.state,r=t.state.__hashScrollIntoViewOptions??!0;if(r&&t.hash!==""){const a=document.getElementById(t.hash);a&&a.scrollIntoView(r)}}}function lm(e){const t=e.errorComponent??um;return b.jsx(eM,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:r,reset:a})=>r?Y.createElement(t,{error:r,reset:a}):e.children})}var eM=class extends Y.Component{constructor(...e){super(...e),this.state={error:null}}static getDerivedStateFromProps(e){return{resetKey:e.getResetKey()}}static getDerivedStateFromError(e){return{error:e}}reset(){this.setState({error:null})}componentDidUpdate(e,t){t.error&&t.resetKey!==this.state.resetKey&&this.reset()}componentDidCatch(e,t){this.props.onCatch&&this.props.onCatch(e,t)}render(){return this.props.children({error:this.state.resetKey!==this.props.getResetKey()?null:this.state.error,reset:()=>{this.reset()}})}};function um({error:e}){const[t,r]=Y.useState(!1);return b.jsxs("div",{style:{padding:".5rem",maxWidth:"100%"},children:[b.jsxs("div",{style:{display:"flex",alignItems:"center",gap:".5rem"},children:[b.jsx("strong",{style:{fontSize:"1rem"},children:"Something went wrong!"}),b.jsx("button",{style:{appearance:"none",fontSize:".6em",border:"1px solid currentColor",padding:".1rem .2rem",fontWeight:"bold",borderRadius:".25rem"},onClick:()=>r(a=>!a),children:t?"Hide Error":"Show Error"})]}),b.jsx("div",{style:{height:".25rem"}}),t?b.jsx("div",{children:b.jsx("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"},children:e.message?b.jsx("code",{children:e.message}):null})}):null]})}function tM({children:e,fallback:t=null}){return K1()?b.jsx(lo.Fragment,{children:e}):b.jsx(lo.Fragment,{children:t})}function K1(){return lo.useSyncExternalStore(nM,()=>!0,()=>!1)}function nM(){return()=>{}}var J1=Y.createContext(null);function rn(e){return Y.useContext(J1)}var Hc=Y.createContext(void 0),rM=Y.createContext(void 0),ot=(e=>(e[e.None=0]="None",e[e.Mutable=1]="Mutable",e[e.Watching=2]="Watching",e[e.RecursedCheck=4]="RecursedCheck",e[e.Recursed=8]="Recursed",e[e.Dirty=16]="Dirty",e[e.Pending=32]="Pending",e))(ot||{});function iM({update:e,notify:t,unwatched:r}){return{link:a,unlink:o,propagate:l,checkDirty:u,shallowPropagate:f};function a(d,m,g){const y=m.depsTail;if(y!==void 0&&y.dep===d)return;const v=y!==void 0?y.nextDep:m.deps;if(v!==void 0&&v.dep===d){v.version=g,m.depsTail=v;return}const S=d.subsTail;if(S!==void 0&&S.version===g&&S.sub===m)return;const C=m.depsTail=d.subsTail={version:g,dep:d,sub:m,prevDep:y,nextDep:v,prevSub:S,nextSub:void 0};v!==void 0&&(v.prevDep=C),y!==void 0?y.nextDep=C:m.deps=C,S!==void 0?S.nextSub=C:d.subs=C}function o(d,m=d.sub){const g=d.dep,y=d.prevDep,v=d.nextDep,S=d.nextSub,C=d.prevSub;return v!==void 0?v.prevDep=y:m.depsTail=y,y!==void 0?y.nextDep=v:m.deps=v,S!==void 0?S.prevSub=C:g.subsTail=C,C!==void 0?C.nextSub=S:(g.subs=S)===void 0&&r(g),v}function l(d){let m=d.nextSub,g;e:do{const y=d.sub;let v=y.flags;if(v&60?v&12?v&4?!(v&48)&&h(d,y)?(y.flags=v|40,v&=1):v=0:y.flags=v&-9|32:v=0:y.flags=v|32,v&2&&t(y),v&1){const S=y.subs;if(S!==void 0){const C=(d=S).nextSub;C!==void 0&&(g={value:m,prev:g},m=C);continue}}if((d=m)!==void 0){m=d.nextSub;continue}for(;g!==void 0;)if(d=g.value,g=g.prev,d!==void 0){m=d.nextSub;continue e}break}while(!0)}function u(d,m){let g,y=0,v=!1;e:do{const S=d.dep,C=S.flags;if(m.flags&16)v=!0;else if((C&17)===17){if(e(S)){const N=S.subs;N.nextSub!==void 0&&f(N),v=!0}}else if((C&33)===33){(d.nextSub!==void 0||d.prevSub!==void 0)&&(g={value:d,prev:g}),d=S.deps,m=S,++y;continue}if(!v){const N=d.nextDep;if(N!==void 0){d=N;continue}}for(;y--;){const N=m.subs,w=N.nextSub!==void 0;if(w?(d=g.value,g=g.prev):d=N,v){if(e(m)){w&&f(N),m=d.sub;continue}v=!1}else m.flags&=-33;m=d.sub;const O=d.nextDep;if(O!==void 0){d=O;continue e}}return v}while(!0)}function f(d){do{const m=d.sub,g=m.flags;(g&48)===32&&(m.flags=g|16,(g&6)===2&&t(m))}while((d=d.nextSub)!==void 0)}function h(d,m){let g=m.depsTail;for(;g!==void 0;){if(g===d)return!0;g=g.prevDep}return!1}}function cm(e,t,r){const a=typeof e=="object",o=a?e:void 0;return{next:(a?e.next:e)?.bind(o),error:(a?e.error:t)?.bind(o),complete:(a?e.complete:r)?.bind(o)}}const xp=[];let sc=0;const{link:yv,unlink:aM,propagate:oM,checkDirty:W1,shallowPropagate:xv}=iM({update(e){return e._update()},notify(e){xp[vp++]=e,e.flags&=~ot.Watching},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=ot.Mutable|ot.Dirty,vc(e))}});let Vu=0,vp=0,Qn,bp=0;function eS(e){try{++bp,e()}finally{--bp||tS()}}function vc(e){const t=e.depsTail;let r=t!==void 0?t.nextDep:e.deps;for(;r!==void 0;)r=aM(r,e)}function tS(){if(!(bp>0)){for(;Vu<vp;){const e=xp[Vu];xp[Vu++]=void 0,e.notify()}Vu=0,vp=0}}function nS(e,t){const r=typeof e=="function",a=e,o={_snapshot:r?void 0:e,subs:void 0,subsTail:void 0,deps:void 0,depsTail:void 0,flags:r?ot.None:ot.Mutable,get(){return Qn!==void 0&&yv(o,Qn,sc),o._snapshot},subscribe(l){const u=cm(l),f={current:!1},h=sM(()=>{o.get(),f.current?u.next?.(o._snapshot):f.current=!0});return{unsubscribe:()=>{h.stop()}}},_update(l){const u=Qn,f=Object.is;if(r)Qn=o,++sc,o.depsTail=void 0;else if(l===void 0)return!1;r&&(o.flags=ot.Mutable|ot.RecursedCheck);try{const h=o._snapshot,d=typeof l=="function"?l(h):l===void 0&&r?a(h):l;return h===void 0||!f(h,d)?(o._snapshot=d,!0):!1}finally{Qn=u,r&&(o.flags&=~ot.RecursedCheck),vc(o)}}};return r?(o.flags=ot.Mutable|ot.Dirty,o.get=function(){const l=o.flags;if(l&ot.Dirty||l&ot.Pending&&W1(o.deps,o)){if(o._update()){const u=o.subs;u!==void 0&&xv(u)}}else l&ot.Pending&&(o.flags=l&~ot.Pending);return Qn!==void 0&&yv(o,Qn,sc),o._snapshot}):o.set=function(l){if(o._update(l)){const u=o.subs;u!==void 0&&(oM(u),xv(u),tS())}},o}function sM(e){const t=()=>{const a=Qn;Qn=r,++sc,r.depsTail=void 0,r.flags=ot.Watching|ot.RecursedCheck;try{return e()}finally{Qn=a,r.flags&=~ot.RecursedCheck,vc(r)}},r={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:ot.Watching|ot.RecursedCheck,notify(){const a=this.flags;a&ot.Dirty||a&ot.Pending&&W1(this.deps,this)?t():this.flags=ot.Watching},stop(){this.flags=ot.None,this.depsTail=void 0,vc(this)}};return t(),r}class lM{constructor(t){this.atom=nS(t)}setState(t){this.atom.set(t)}get state(){return this.atom.get()}get(){return this.state}subscribe(t){return this.atom.subscribe(cm(t))}}class uM{constructor(t){this.atom=nS(t)}get state(){return this.atom.get()}get(){return this.state}subscribe(t){return this.atom.subscribe(cm(t))}}function vv(e){return typeof e=="function"?new uM(e):new lM(e)}var Rh={exports:{}},Oh={},jh={exports:{}},Dh={};var bv;function cM(){if(bv)return Dh;bv=1;var e=sl();function t(g,y){return g===y&&(g!==0||1/g===1/y)||g!==g&&y!==y}var r=typeof Object.is=="function"?Object.is:t,a=e.useState,o=e.useEffect,l=e.useLayoutEffect,u=e.useDebugValue;function f(g,y){var v=y(),S=a({inst:{value:v,getSnapshot:y}}),C=S[0].inst,N=S[1];return l(function(){C.value=v,C.getSnapshot=y,h(C)&&N({inst:C})},[g,v,y]),o(function(){return h(C)&&N({inst:C}),g(function(){h(C)&&N({inst:C})})},[g]),u(v),v}function h(g){var y=g.getSnapshot;g=g.value;try{var v=y();return!r(g,v)}catch{return!0}}function d(g,y){return y()}var m=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?d:f;return Dh.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:m,Dh}var Sv;function fM(){return Sv||(Sv=1,jh.exports=cM()),jh.exports}var wv;function dM(){if(wv)return Oh;wv=1;var e=sl(),t=fM();function r(d,m){return d===m&&(d!==0||1/d===1/m)||d!==d&&m!==m}var a=typeof Object.is=="function"?Object.is:r,o=t.useSyncExternalStore,l=e.useRef,u=e.useEffect,f=e.useMemo,h=e.useDebugValue;return Oh.useSyncExternalStoreWithSelector=function(d,m,g,y,v){var S=l(null);if(S.current===null){var C={hasValue:!1,value:null};S.current=C}else C=S.current;S=f(function(){function w(k){if(!O){if(O=!0,_=k,k=y(k),v!==void 0&&C.hasValue){var D=C.value;if(v(D,k))return M=D}return M=k}if(D=M,a(_,k))return D;var U=y(k);return v!==void 0&&v(D,U)?(_=k,D):(_=k,M=U)}var O=!1,_,M,I=g===void 0?null:g;return[function(){return w(m())},I===null?void 0:function(){return w(I())}]},[m,g,y,v]);var N=o(d,S[0],S[1]);return u(function(){C.hasValue=!0,C.value=N},[N]),h(N),N},Oh}var Ev;function hM(){return Ev||(Ev=1,Rh.exports=dM()),Rh.exports}var rS=hM();const pM=Lc(rS);function mM(e,t){return e===t}function Ut(e,t,r=mM){const a=Y.useCallback(u=>{if(!e)return()=>{};const{unsubscribe:f}=e.subscribe(u);return f},[e]),o=Y.useCallback(()=>e?.get(),[e]);return rS.useSyncExternalStoreWithSelector(a,o,o,t,r)}var gM={state:void 0,get:()=>{},subscribe:()=>()=>{}};function ra(e){const t=rn(),r=Y.useContext(e.from?rM:Hc),a=e.from??r,o=a?e.from?t.stores.getMatchStoreByRouteId(a):t.stores.activeMatchStoresById.get(a):void 0,l=Y.useRef(void 0);return Ut(o??gM,u=>{if((e.shouldThrow??!0)&&!u&&Mr(),u===void 0)return;const f=e.select?e.select(u):u;if(e.structuralSharing??t.options.defaultStructuralSharing){const h=qi(l.current,f);return l.current=h,h}return f})}function iS(e){return ra({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function aS(e){const{select:t,...r}=e;return ra({...r,select:a=>t?t(a.loaderDeps):a.loaderDeps})}function oS(e){return ra({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:t=>{const r=e.strict===!1?t.params:t._strictParams;return e.select?e.select(r):r}})}function sS(e){return ra({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function Pc(e){const t=rn();return Y.useCallback(r=>t.navigate({...r,from:r.from??e?.from}),[e?.from,t])}function lS(e){return ra({...e,select:t=>e.select?e.select(t.context):t.context})}var yM=k1();function xM(e,t){const r=rn(),a=J2(t),{activeProps:o,inactiveProps:l,activeOptions:u,to:f,preload:h,preloadDelay:d,hashScrollIntoView:m,replace:g,startTransition:y,resetScroll:v,viewTransition:S,children:C,target:N,disabled:w,style:O,className:_,onClick:M,onBlur:I,onFocus:k,onMouseEnter:D,onMouseLeave:U,onTouchStart:H,ignoreBlocker:q,params:L,search:P,hash:K,state:B,mask:V,reloadDocument:j,unsafeRelative:F,from:$,_fromLocation:Z,...A}=e,z=K1(),X=Y.useMemo(()=>e,[r,e.from,e._fromLocation,e.hash,e.to,e.search,e.params,e.state,e.mask,e.unsafeRelative]),R=Ut(r.stores.location,Ne=>Ne,(Ne,ut)=>Ne.href===ut.href),te=Y.useMemo(()=>{const Ne={_fromLocation:R,...X};return r.buildLocation(Ne)},[r,R,X]),ue=te.maskedLocation?te.maskedLocation.publicHref:te.publicHref,ce=te.maskedLocation?te.maskedLocation.external:te.external,fe=Y.useMemo(()=>CM(ue,ce,r.history,w),[w,ce,ue,r.history]),le=Y.useMemo(()=>{if(fe?.external)return gc(fe.href,r.protocolAllowlist)?void 0:fe.href;if(!_M(f)&&!(typeof f!="string"||f.indexOf(":")===-1))try{return new URL(f),gc(f,r.protocolAllowlist)?void 0:f}catch{}},[f,fe,r.protocolAllowlist]),pe=Y.useMemo(()=>{if(le)return!1;if(u?.exact){if(!gN(R.pathname,te.pathname,r.basepath))return!1}else{const Ne=yc(R.pathname,r.basepath),ut=yc(te.pathname,r.basepath);if(!(Ne.startsWith(ut)&&(Ne.length===ut.length||Ne[ut.length]==="/")))return!1}return(u?.includeSearch??!0)&&!Xi(R.search,te.search,{partial:!u?.exact,ignoreUndefined:!u?.explicitUndefined})?!1:u?.includeHash?z&&R.hash===te.hash:!0},[u?.exact,u?.explicitUndefined,u?.includeHash,u?.includeSearch,R,le,z,te.hash,te.pathname,te.search,r.basepath]),be=pe?ui(o,{})??vM:zh,Se=pe?zh:ui(l,{})??zh,ye=[_,be.className,Se.className].filter(Boolean).join(" "),we=(O||be.style||Se.style)&&{...O,...be.style,...Se.style},[Re,He]=Y.useState(!1),Be=Y.useRef(!1),Qe=e.reloadDocument||le?!1:h??r.options.defaultPreload,_t=d??r.options.defaultPreloadDelay??0,it=Y.useCallback(()=>{r.preloadRoute({...X,_builtLocation:te}).catch(Ne=>{console.warn(Ne),console.warn(KN)})},[r,X,te]);K2(a,Y.useCallback(Ne=>{Ne?.isIntersecting&&it()},[it]),EM,{disabled:!!w||Qe!=="viewport"}),Y.useEffect(()=>{Be.current||!w&&Qe==="render"&&(it(),Be.current=!0)},[w,it,Qe]);const Ot=Ne=>{const ut=Ne.currentTarget.getAttribute("target"),ie=N!==void 0?N:ut;if(!w&&!NM(Ne)&&!Ne.defaultPrevented&&(!ie||ie==="_self")&&Ne.button===0){Ne.preventDefault(),yM.flushSync(()=>{He(!0)});const he=r.subscribe("onResolved",()=>{he(),He(!1)});r.navigate({...X,replace:g,resetScroll:v,hashScrollIntoView:m,startTransition:y,viewTransition:S,ignoreBlocker:q})}};if(le)return{...A,ref:a,href:le,...C&&{children:C},...N&&{target:N},...w&&{disabled:w},...O&&{style:O},..._&&{className:_},...M&&{onClick:M},...I&&{onBlur:I},...k&&{onFocus:k},...D&&{onMouseEnter:D},...U&&{onMouseLeave:U},...H&&{onTouchStart:H}};const qt=Ne=>{if(w||Qe!=="intent")return;if(!_t){it();return}const ut=Ne.currentTarget;if(Cs.has(ut))return;const ie=setTimeout(()=>{Cs.delete(ut),it()},_t);Cs.set(ut,ie)},An=Ne=>{w||Qe!=="intent"||it()},vn=Ne=>{if(w||!Qe||!_t)return;const ut=Ne.currentTarget,ie=Cs.get(ut);ie&&(clearTimeout(ie),Cs.delete(ut))};return{...A,...be,...Se,href:fe?.href,ref:a,onClick:Ga([M,Ot]),onBlur:Ga([I,vn]),onFocus:Ga([k,qt]),onMouseEnter:Ga([D,qt]),onMouseLeave:Ga([U,vn]),onTouchStart:Ga([H,An]),disabled:!!w,target:N,...we&&{style:we},...ye&&{className:ye},...w&&bM,...pe&&SM,...z&&Re&&wM}}var zh={},vM={className:"active"},bM={role:"link","aria-disabled":!0},SM={"data-status":"active","aria-current":"page"},wM={"data-transitioning":"transitioning"},Cs=new WeakMap,EM={rootMargin:"100px"},Ga=e=>t=>{for(const r of e)if(r){if(t.defaultPrevented)return;r(t)}};function CM(e,t,r,a){if(!a)return t?{href:e,external:!0}:{href:r.createHref(e)||"/",external:!1}}function _M(e){if(typeof e!="string")return!1;const t=e.charCodeAt(0);return t===47?e.charCodeAt(1)!==47:t===46}var uS=Y.forwardRef((e,t)=>{const{_asChild:r,...a}=e,{type:o,...l}=xM(a,t),u=typeof a.children=="function"?a.children({isActive:l["data-status"]==="active"}):a.children;if(!r){const{disabled:f,...h}=l;return Y.createElement("a",h,u)}return Y.createElement(r,l,u)});function NM(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}var MM=class extends Z1{constructor(e){super(e),this.useMatch=t=>ra({select:t?.select,from:this.id,structuralSharing:t?.structuralSharing}),this.useRouteContext=t=>lS({...t,from:this.id}),this.useSearch=t=>sS({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useParams=t=>oS({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useLoaderDeps=t=>aS({...t,from:this.id}),this.useLoaderData=t=>iS({...t,from:this.id}),this.useNavigate=()=>Pc({from:this.fullPath}),this.Link=lo.forwardRef((t,r)=>b.jsx(uS,{ref:r,from:this.fullPath,...t}))}};function ul(e){return new MM(e)}var kM=class extends JN{constructor(e){super(e),this.useMatch=t=>ra({select:t?.select,from:this.id,structuralSharing:t?.structuralSharing}),this.useRouteContext=t=>lS({...t,from:this.id}),this.useSearch=t=>sS({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useParams=t=>oS({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useLoaderDeps=t=>aS({...t,from:this.id}),this.useLoaderData=t=>iS({...t,from:this.id}),this.useNavigate=()=>Pc({from:this.fullPath}),this.Link=lo.forwardRef((t,r)=>b.jsx(uS,{ref:r,from:this.fullPath,...t}))}};function TM(e){return new kM(e)}function AM(e){const t=rn(),r=`not-found-${Ut(t.stores.location,a=>a.pathname)}-${Ut(t.stores.status,a=>a)}`;return b.jsx(lm,{getResetKey:()=>r,onCatch:(a,o)=>{if(Pt(a))e.onCatch?.(a,o);else throw a},errorComponent:({error:a})=>{if(Pt(a))return e.fallback?.(a);throw a},children:e.children})}function RM(){return b.jsx("p",{children:"Not Found"})}function Ja(e){return b.jsx(b.Fragment,{children:e.children})}function cS(e,t,r){return t.options.notFoundComponent?b.jsx(t.options.notFoundComponent,{...r}):e.options.defaultNotFoundComponent?b.jsx(e.options.defaultNotFoundComponent,{...r}):b.jsx(RM,{})}function OM(e){return null}function jM(){return OM(rn()),null}var fS=Y.memo(function({matchId:t}){const r=rn(),a=r.stores.activeMatchStoresById.get(t);a||Mr();const o=Ut(r.stores.loadedAt,u=>u),l=Ut(a,u=>u);return b.jsx(DM,{router:r,matchId:t,resetKey:o,matchState:Y.useMemo(()=>{const u=l.routeId,f=r.routesById[u].parentRoute?.id;return{routeId:u,ssr:l.ssr,_displayPending:l._displayPending,parentRouteId:f}},[l._displayPending,l.routeId,l.ssr,r.routesById])})});function DM({router:e,matchId:t,resetKey:r,matchState:a}){const o=e.routesById[a.routeId],l=o.options.pendingComponent??e.options.defaultPendingComponent,u=l?b.jsx(l,{}):null,f=o.options.errorComponent??e.options.defaultErrorComponent,h=o.options.onCatch??e.options.defaultOnCatch,d=o.isRoot?o.options.notFoundComponent??e.options.notFoundRoute?.options.component:o.options.notFoundComponent,m=a.ssr===!1||a.ssr==="data-only",g=(!o.isRoot||o.options.wrapInSuspense||m)&&(o.options.wrapInSuspense??l??(o.options.errorComponent?.preload||m))?Y.Suspense:Ja,y=f?lm:Ja,v=d?AM:Ja;return b.jsxs(o.isRoot?o.options.shellComponent??Ja:Ja,{children:[b.jsx(Hc.Provider,{value:t,children:b.jsx(g,{fallback:u,children:b.jsx(y,{getResetKey:()=>r,errorComponent:f||um,onCatch:(S,C)=>{if(Pt(S))throw S.routeId??=a.routeId,S;h?.(S,C)},children:b.jsx(v,{fallback:S=>{if(S.routeId??=a.routeId,!d||S.routeId&&S.routeId!==a.routeId||!S.routeId&&!o.isRoot)throw S;return Y.createElement(d,S)},children:m||a._displayPending?b.jsx(tM,{fallback:u,children:b.jsx(Cv,{matchId:t})}):b.jsx(Cv,{matchId:t})})})})}),a.parentRouteId===Gi?b.jsxs(b.Fragment,{children:[b.jsx(zM,{resetKey:r}),e.options.scrollRestoration&&H1?b.jsx(jM,{}):null]}):null]})}function zM({resetKey:e}){const t=rn(),r=Y.useRef(void 0);return Rs(()=>{const a=t.latestLocation.href;(r.current===void 0||r.current!==a)&&(t.emit({type:"onRendered",...no(t.stores.location.state,t.stores.resolvedLocation.state)}),r.current=a)},[t.latestLocation.state.__TSR_key,e,t]),null}var Cv=Y.memo(function({matchId:t}){const r=rn(),a=r.stores.activeMatchStoresById.get(t);a||Mr();const o=Ut(a,d=>d),l=o.routeId,u=r.routesById[l],f=Y.useMemo(()=>{const d=(r.routesById[l].options.remountDeps??r.options.defaultRemountDeps)?.({routeId:l,loaderDeps:o.loaderDeps,params:o._strictParams,search:o._strictSearch});return d?JSON.stringify(d):void 0},[l,o.loaderDeps,o._strictParams,o._strictSearch,r.options.defaultRemountDeps,r.routesById]),h=Y.useMemo(()=>{const d=u.options.component??r.options.defaultComponent;return d?b.jsx(d,{},f):b.jsx(LM,{})},[f,u.options.component,r.options.defaultComponent]);if(o._displayPending)throw r.getMatch(o.id)?._nonReactive.displayPendingPromise;if(o._forcePending)throw r.getMatch(o.id)?._nonReactive.minPendingPromise;if(o.status==="pending"){const d=u.options.pendingMinMs??r.options.defaultPendingMinMs;if(d){const m=r.getMatch(o.id);if(m&&!m._nonReactive.minPendingPromise){const g=co();m._nonReactive.minPendingPromise=g,setTimeout(()=>{g.resolve(),m._nonReactive.minPendingPromise=void 0},d)}}throw r.getMatch(o.id)?._nonReactive.loadPromise}if(o.status==="notFound")return Pt(o.error)||Mr(),cS(r,u,o.error);if(o.status==="redirected")throw en(o.error)||Mr(),r.getMatch(o.id)?._nonReactive.loadPromise;if(o.status==="error")throw o.error;return h}),LM=Y.memo(function(){const t=rn(),r=Y.useContext(Hc);let a,o=!1,l;{const d=r?t.stores.activeMatchStoresById.get(r):void 0;[a,o]=Ut(d,m=>[m?.routeId,m?.globalNotFound??!1]),l=Ut(t.stores.matchesId,m=>m[m.findIndex(g=>g===r)+1])}const u=a?t.routesById[a]:void 0,f=t.options.defaultPendingComponent?b.jsx(t.options.defaultPendingComponent,{}):null;if(o)return u||Mr(),cS(t,u,void 0);if(!l)return null;const h=b.jsx(fS,{matchId:l});return a===Gi?b.jsx(Y.Suspense,{fallback:f,children:h}):h});function BM(){const e=rn(),t=Y.useRef({router:e,mounted:!1}),[r,a]=Y.useState(!1),o=Ut(e.stores.isLoading,g=>g),l=Ut(e.stores.hasPendingMatches,g=>g),u=Eh(o),f=o||r||l,h=Eh(f),d=o||l,m=Eh(d);return e.startTransition=g=>{a(!0),Y.startTransition(()=>{g(),a(!1)})},Y.useEffect(()=>{const g=e.history.subscribe(e.load),y=e.buildLocation({to:e.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return hi(e.latestLocation.publicHref)!==hi(y.publicHref)&&e.commitLocation({...y,replace:!0}),()=>{g()}},[e,e.history]),Rs(()=>{if(typeof window<"u"&&e.ssr||t.current.router===e&&t.current.mounted)return;t.current={router:e,mounted:!0},(async()=>{try{await e.load()}catch(y){console.error(y)}})()},[e]),Rs(()=>{u&&!o&&e.emit({type:"onLoad",...no(e.stores.location.state,e.stores.resolvedLocation.state)})},[u,e,o]),Rs(()=>{m&&!d&&e.emit({type:"onBeforeRouteMount",...no(e.stores.location.state,e.stores.resolvedLocation.state)})},[d,m,e]),Rs(()=>{if(h&&!f){const g=no(e.stores.location.state,e.stores.resolvedLocation.state);e.emit({type:"onResolved",...g}),eS(()=>{e.stores.status.setState(()=>"idle"),e.stores.resolvedLocation.setState(()=>e.stores.location.state)}),g.hrefChanged&&WN(e)}},[f,h,e]),null}function IM(){const e=rn(),t=e.routesById[Gi].options.pendingComponent??e.options.defaultPendingComponent,r=t?b.jsx(t,{}):null,a=b.jsxs(typeof document<"u"&&e.ssr?Ja:Y.Suspense,{fallback:r,children:[b.jsx(BM,{}),b.jsx(HM,{})]});return e.options.InnerWrap?b.jsx(e.options.InnerWrap,{children:a}):a}function HM(){const e=rn(),t=Ut(e.stores.firstMatchId,o=>o),r=Ut(e.stores.loadedAt,o=>o),a=t?b.jsx(fS,{matchId:t}):null;return b.jsx(Hc.Provider,{value:t,children:e.options.disableGlobalCatchBoundary?a:b.jsx(lm,{getResetKey:()=>r,errorComponent:um,onCatch:void 0,children:a})})}function PM(){const e=rn();return Ut(e.stores.matchRouteReactivity,t=>t),Y.useCallback(t=>{const{pending:r,caseSensitive:a,fuzzy:o,includeSearch:l,...u}=t;return e.matchRoute(u,{pending:r,caseSensitive:a,fuzzy:o,includeSearch:l})},[e])}var UM=e=>({createMutableStore:vv,createReadonlyStore:vv,batch:eS}),qM=e=>new VM(e),VM=class extends FN{constructor(e){super(e,UM)}};function FM({router:e,children:t,...r}){Object.keys(r).length>0&&e.update({...e.options,...r,context:{...e.options.context,...r.context}});const a=b.jsx(J1.Provider,{value:e,children:t});return e.options.Wrap?b.jsx(e.options.Wrap,{children:a}):a}function YM({router:e,...t}){return b.jsx(FM,{router:e,...t,children:b.jsx(IM,{})})}function XM(e){const r=rn();return Y.useRef(void 0),Ut(r.stores.__store,a=>a)}const Sp=new Set,Lt=new WeakMap,Ji=new WeakMap,gn=new WeakMap,$s=new WeakMap,Lh=new WeakMap,Os=new WeakMap,Qi=new WeakMap,fi=new WeakMap,Wa=new WeakSet;let Wt,fm=0,dm=0;const _r="__aa_tgt",Qs="__aa_del",bc="__aa_new",dS=e=>{const t=ZM(e);t&&t.forEach(r=>KM(r))},GM=e=>{e.forEach(t=>{t.target===Wt&&$M(),Lt.has(t.target)&&ia(t.target)})};function hS(e){const t=e.getBoundingClientRect(),r=Wt?.clientWidth||0,a=Wt?.clientHeight||0;return t.bottom<0||t.top>a||t.right<0||t.left>r}function hm(e){const t=$s.get(e);t?.disconnect();let r=Lt.get(e),a=0;const o=5;r||(r=fo(e),Lt.set(e,r));const{offsetWidth:l,offsetHeight:u}=Wt,h=[r.top-o,l-(r.left+o+r.width),u-(r.top+o+r.height),r.left-o].map(m=>`${-1*Math.floor(m)}px`).join(" "),d=new IntersectionObserver(()=>{++a>1&&ia(e)},{root:Wt,threshold:1,rootMargin:h});d.observe(e),$s.set(e,d)}function ia(e,t=!0){clearTimeout(fi.get(e));const r=Uc(e),a=t?Zs(r)?500:r.duration:0;fi.set(e,setTimeout(async()=>{const o=gn.get(e);try{await o?.finished,Lt.set(e,fo(e)),hm(e)}catch{}},a))}function $M(){clearTimeout(fi.get(Wt)),fi.set(Wt,setTimeout(()=>{Sp.forEach(e=>lc(e,t=>pS(()=>ia(t))))},100))}function QM(e){setTimeout(()=>{Os.set(e,setInterval(()=>pS(ia.bind(null,e)),2e3))},Math.round(2e3*Math.random()))}function pS(e){typeof requestIdleCallback=="function"?requestIdleCallback(()=>e()):requestAnimationFrame(()=>e())}let Cr;const mS=typeof window<"u"&&"ResizeObserver"in window;mS&&(Wt=document.documentElement,new MutationObserver(dS),Cr=new ResizeObserver(GM),window.addEventListener("scroll",()=>{dm=window.scrollY,fm=window.scrollX}),Cr.observe(Wt));function ZM(e){return e.reduce((a,o)=>[...a,...Array.from(o.addedNodes),...Array.from(o.removedNodes)],[]).every(a=>a.nodeName==="#comment")?!1:e.reduce((a,o)=>{if(a===!1)return!1;if(o.target instanceof Element){if(Bh(o.target),!a.has(o.target)){a.add(o.target);for(let l=0;l<o.target.children.length;l++){const u=o.target.children.item(l);if(u){if(Qs in u)return!1;Bh(o.target,u),a.add(u)}}}if(o.removedNodes.length)for(let l=0;l<o.removedNodes.length;l++){const u=o.removedNodes[l];if(Qs in u)return!1;u instanceof Element&&(a.add(u),Bh(o.target,u),Ji.set(u,[o.previousSibling,o.nextSibling]))}}return a},new Set)}function Bh(e,t){!t&&!(_r in e)?Object.defineProperty(e,_r,{value:e}):t&&!(_r in t)&&Object.defineProperty(t,_r,{value:e})}function KM(e){var t,r;const a=e.isConnected,o=Lt.has(e);a&&Ji.has(e)&&Ji.delete(e),((t=gn.get(e))===null||t===void 0?void 0:t.playState)!=="finished"&&((r=gn.get(e))===null||r===void 0||r.cancel()),bc in e?_v(e):o&&a?WM(e):o&&!a?ek(e):_v(e)}function Gn(e){return Number(e.replace(/[^0-9.\-]/g,""))}function JM(e){let t=e.parentElement;for(;t;){if(t.scrollLeft||t.scrollTop)return{x:t.scrollLeft,y:t.scrollTop};t=t.parentElement}return{x:0,y:0}}function fo(e){const t=e.getBoundingClientRect(),{x:r,y:a}=JM(e);return{top:t.top+a,left:t.left+r,width:t.width,height:t.height}}function gS(e,t,r){let a=t.width,o=t.height,l=r.width,u=r.height;const f=getComputedStyle(e);if(f.getPropertyValue("box-sizing")==="content-box"){const d=Gn(f.paddingTop)+Gn(f.paddingBottom)+Gn(f.borderTopWidth)+Gn(f.borderBottomWidth),m=Gn(f.paddingLeft)+Gn(f.paddingRight)+Gn(f.borderRightWidth)+Gn(f.borderLeftWidth);a-=m,l-=m,o-=d,u-=d}return[a,l,o,u].map(Math.round)}function Uc(e){return _r in e&&Qi.has(e[_r])?Qi.get(e[_r]):{duration:250,easing:"ease-in-out"}}function yS(e){if(_r in e)return e[_r]}function pm(e){const t=yS(e);return t?Wa.has(t):!1}function lc(e,...t){t.forEach(r=>r(e,Qi.has(e)));for(let r=0;r<e.children.length;r++){const a=e.children.item(r);a&&t.forEach(o=>o(a,Qi.has(a)))}}function mm(e){return Array.isArray(e)?e:[e]}function Zs(e){return typeof e=="function"}function WM(e){const t=Lt.get(e),r=fo(e);if(!pm(e))return Lt.set(e,r);if(hS(e)){Lt.set(e,r),hm(e);return}let a;if(!t)return;const o=Uc(e);if(typeof o!="function"){let l=t.left-r.left,u=t.top-r.top;const f=t.left+t.width-(r.left+r.width);t.top+t.height-(r.top+r.height)==0&&(u=0),f==0&&(l=0);const[d,m,g,y]=gS(e,t,r),v={transform:`translate(${l}px, ${u}px)`},S={transform:"translate(0, 0)"};d!==m&&(v.width=`${d}px`,S.width=`${m}px`),g!==y&&(v.height=`${g}px`,S.height=`${y}px`),a=e.animate([v,S],{duration:o.duration,easing:o.easing})}else{const[l]=mm(o(e,"remain",t,r));a=new Animation(l),a.play()}gn.set(e,a),Lt.set(e,r),a.addEventListener("finish",ia.bind(null,e,!1),{once:!0})}function _v(e){bc in e&&delete e[bc];const t=fo(e);Lt.set(e,t);const r=Uc(e);if(!pm(e))return;if(hS(e)){hm(e);return}let a;if(typeof r!="function")a=e.animate([{transform:"scale(.98)",opacity:0},{transform:"scale(0.98)",opacity:0,offset:.5},{transform:"scale(1)",opacity:1}],{duration:r.duration*1.5,easing:"ease-in"});else{const[o]=mm(r(e,"add",t));a=new Animation(o),a.play()}gn.set(e,a),a.addEventListener("finish",ia.bind(null,e,!1),{once:!0})}function Nv(e,t){var r;e.remove(),Lt.delete(e),Ji.delete(e),gn.delete(e),(r=$s.get(e))===null||r===void 0||r.disconnect(),setTimeout(()=>{if(Qs in e&&delete e[Qs],Object.defineProperty(e,bc,{value:!0,configurable:!0}),t&&e instanceof HTMLElement)for(const a in t)e.style[a]=""},0)}function ek(e){var t;if(!Ji.has(e)||!Lt.has(e))return;const[r,a]=Ji.get(e);Object.defineProperty(e,Qs,{value:!0,configurable:!0});const o=window.scrollX,l=window.scrollY;if(a&&a.parentNode&&a.parentNode instanceof Element?a.parentNode.insertBefore(e,a):r&&r.parentNode?r.parentNode.appendChild(e):(t=yS(e))===null||t===void 0||t.appendChild(e),!pm(e))return Nv(e);const[u,f,h,d]=nk(e),m=Uc(e),g=Lt.get(e);(o!==fm||l!==dm)&&tk(e,o,l,m);let y,v={position:"absolute",top:`${u}px`,left:`${f}px`,width:`${h}px`,height:`${d}px`,margin:"0",pointerEvents:"none",transformOrigin:"center",zIndex:"100"};if(!Zs(m))Object.assign(e.style,v),y=e.animate([{transform:"scale(1)",opacity:1},{transform:"scale(.98)",opacity:0}],{duration:m.duration,easing:"ease-out"});else{const[S,C]=mm(m(e,"remove",g));C?.styleReset!==!1&&(v=C?.styleReset||v,Object.assign(e.style,v)),y=new Animation(S),y.play()}gn.set(e,y),y.addEventListener("finish",()=>Nv(e,v),{once:!0})}function tk(e,t,r,a){const o=fm-t,l=dm-r,u=document.documentElement.style.scrollBehavior;if(getComputedStyle(Wt).scrollBehavior==="smooth"&&(document.documentElement.style.scrollBehavior="auto"),window.scrollTo(window.scrollX+o,window.scrollY+l),!e.parentElement)return;const h=e.parentElement;let d=h.clientHeight,m=h.clientWidth;const g=performance.now();function y(){requestAnimationFrame(()=>{if(!Zs(a)){const v=d-h.clientHeight,S=m-h.clientWidth;g+a.duration>performance.now()?(window.scrollTo({left:window.scrollX-S,top:window.scrollY-v}),d=h.clientHeight,m=h.clientWidth,y()):document.documentElement.style.scrollBehavior=u}})}y()}function nk(e){var t;const r=Lt.get(e),[a,,o]=gS(e,r,fo(e));let l=e.parentElement;for(;l&&(getComputedStyle(l).position==="static"||l instanceof HTMLBodyElement);)l=l.parentElement;l||(l=document.body);const u=getComputedStyle(l),f=!gn.has(e)||((t=gn.get(e))===null||t===void 0?void 0:t.playState)==="finished"?fo(l):Lt.get(l),h=Math.round(r.top-f.top)-Gn(u.borderTopWidth),d=Math.round(r.left-f.left)-Gn(u.borderLeftWidth);return[h,d,a,o]}function rk(e,t={}){if(mS&&Cr&&!(window.matchMedia("(prefers-reduced-motion: reduce)").matches&&!Zs(t)&&!t.disrespectUserMotionPreference)){Wa.add(e),getComputedStyle(e).position==="static"&&Object.assign(e.style,{position:"relative"}),lc(e,ia,QM,u=>Cr?.observe(u)),Zs(t)?Qi.set(e,t):Qi.set(e,{duration:250,easing:"ease-in-out",...t});const l=new MutationObserver(dS);l.observe(e,{childList:!0}),Lh.set(e,l),Sp.add(e)}return Object.freeze({parent:e,enable:()=>{Wa.add(e)},disable:()=>{Wa.delete(e),lc(e,a=>{const o=gn.get(a);try{o?.cancel()}catch{}gn.delete(a);const l=fi.get(a);l&&clearTimeout(l),fi.delete(a);const u=Os.get(a);u&&clearInterval(u),Os.delete(a)})},isEnabled:()=>Wa.has(e),destroy:()=>{Wa.delete(e),Sp.delete(e),Qi.delete(e);const a=Lh.get(e);a?.disconnect(),Lh.delete(e),lc(e,o=>{Cr?.unobserve(o);const l=gn.get(o);try{l?.cancel()}catch{}gn.delete(o);const u=$s.get(o);u?.disconnect(),$s.delete(o);const f=Os.get(o);f&&clearInterval(f),Os.delete(o);const h=fi.get(o);h&&clearTimeout(h),fi.delete(o),Lt.delete(o),Ji.delete(o)})}})}function xS(e){const[t,r]=Y.useState(),a=Y.useMemo(()=>e,[]),o=Y.useCallback(u=>{u instanceof HTMLElement?r(rk(u,a)):r(void 0)},[a]),l=Y.useCallback(u=>{t&&(u?t.enable():t.disable())},[t]);return Y.useEffect(()=>()=>{var u;(u=t?.destroy)===null||u===void 0||u.call(t)},[t]),[o,l]}class vS extends Error{constructor(t,r){super(`HTTP ${t}: ${r}`),this.status=t,this.name="HttpError"}}async function So(e){const t=await fetch(e);if(!t.ok)throw new vS(t.status,t.statusText);const r=await t.json();if(!r.success||!r.data)throw new Error(r.error??"Unknown error");return r.data}function bS(){return bo({queryKey:["sessions"],queryFn:()=>So("/api/v2/sessions"),refetchInterval:3e4,staleTime:25e3})}function ik(e){return bo({queryKey:["session",e],queryFn:()=>So(`/api/v2/sessions/${e}`),enabled:!!e,refetchInterval:5e3,refetchIntervalInBackground:!1,staleTime:3e3})}function ak(e,t){return bo({queryKey:["node",e,t],queryFn:()=>So(`/api/v2/sessions/${e}/nodes/${t}`),enabled:!!t})}function ok(){return bo({queryKey:["worktrees"],queryFn:()=>So("/api/v2/worktrees"),refetchInterval:3e4,staleTime:2e4})}function sk(){return bo({queryKey:["workflows"],queryFn:()=>So("/api/v2/workflows"),staleTime:1/0,refetchInterval:!1})}function lk(e){return bo({queryKey:["workflow",e],queryFn:()=>So(`/api/v2/workflows/${e}`),enabled:e!==null,staleTime:1/0,refetchInterval:!1})}function uk(){const e=rm();Y.useEffect(()=>{let t=null,r=null;function a(){t=new EventSource("/api/v2/workspace/events"),t.onmessage=o=>{try{JSON.parse(o.data).type==="change"&&e.invalidateQueries({queryKey:["sessions"]})}catch{}},t.onerror=()=>{t?.close(),t=null,r=setTimeout(a,5e3)}}return a(),()=>{r!==null&&clearTimeout(r),t?.close()}},[e])}const ck={in_progress:{label:"In Progress",color:"var(--accent)"},dormant:{label:"Dormant",color:"var(--text-secondary)"},complete:{label:"Complete",color:"var(--success)"},complete_with_gaps:{label:"Gaps",color:"var(--warning)"},blocked:{label:"Blocked",color:"var(--blocked)"}};function SS({status:e}){const t=ck[e];return b.jsx("span",{className:"inline-flex items-center px-2 py-0.5 rounded text-xs font-medium",style:{backgroundColor:`color-mix(in srgb, ${t.color} 12%, transparent)`,color:t.color},children:t.label})}function wS({health:e}){return e==="healthy"?null:b.jsx("span",{className:"inline-flex items-center px-2 py-0.5 rounded text-xs font-medium",style:{backgroundColor:"var(--error)20",color:"var(--error)"},children:"Corrupt"})}function qc(e){const t=Date.now()-e;if(t<0)return"just now";const r=Math.floor(t/1e3);if(r<60)return"just now";const a=Math.floor(r/60);if(a<60)return`${a}m ago`;const o=Math.floor(a/60);if(o<24)return`${o}h ago`;const l=Math.floor(o/24);if(l<7)return`${l}d ago`;const u=Math.floor(l/7);return u<5?`${u}w ago`:`${Math.floor(l/30)}mo ago`}const Sc={in_progress:0,blocked:1,dormant:2,complete_with_gaps:3,complete:4},wp=[{value:"recent",label:"Recent",compareFn:(e,t)=>t.lastModifiedMs-e.lastModifiedMs},{value:"status",label:"Status",compareFn:(e,t)=>Sc[e.status]-Sc[t.status]||t.lastModifiedMs-e.lastModifiedMs},{value:"workflow",label:"Workflow",compareFn:(e,t)=>(e.workflowName??e.workflowId??"").localeCompare(t.workflowName??t.workflowId??"")||t.lastModifiedMs-e.lastModifiedMs},{value:"nodes",label:"Node count",compareFn:(e,t)=>t.nodeCount-e.nodeCount||t.lastModifiedMs-e.lastModifiedMs}],Ep=[{value:"none",label:"No grouping",keyFn:null},{value:"workflow",label:"Workflow",keyFn:e=>e.workflowName??e.workflowId??"Unknown workflow"},{value:"status",label:"Status",keyFn:e=>e.status,groupCompareFn:(e,t)=>(Sc[e]??99)-(Sc[t]??99)},{value:"branch",label:"Branch",keyFn:e=>e.gitBranch??"No branch"}],fk=[{value:"all",label:"All"},{value:"in_progress",label:"In Progress"},{value:"dormant",label:"Dormant"},{value:"complete",label:"Complete"},{value:"complete_with_gaps",label:"Gaps"},{value:"blocked",label:"Blocked"}],ro=25;function dk(e,t,r,a){let o=[...e];if(r!=="all"&&(o=o.filter(l=>l.status===r)),a!==null&&(o=o.filter(l=>l.repoRoot===a||l.repoRoot===null)),t.trim()){const l=t.toLowerCase();o=o.filter(u=>(u.sessionTitle??"").toLowerCase().includes(l)||(u.workflowName??"").toLowerCase().includes(l)||(u.workflowId??"").toLowerCase().includes(l)||u.sessionId.toLowerCase().includes(l)||(u.gitBranch??"").toLowerCase().includes(l))}return o}function hk(e,t){const r=wp.find(a=>a.value===t)??wp[0];return[...e].sort(r.compareFn)}function pk(e,t){const r=Ep.find(l=>l.value===t)??Ep[0];if(!r.keyFn)return[{label:"",sessions:e}];const a=new Map;for(const l of e){const u=r.keyFn(l),f=a.get(u)??[];f.push(l),a.set(u,f)}const o=r.groupCompareFn??((l,u)=>l.localeCompare(u));return Array.from(a.entries()).sort(([l],[u])=>o(l,u)).map(([l,u])=>({label:l,sessions:u}))}function mk(e,t){const[r,a]=Y.useState(e),o=Y.useRef(null);return Y.useEffect(()=>(o.current!==null&&clearTimeout(o.current),o.current=setTimeout(()=>a(e),t),()=>{o.current!==null&&clearTimeout(o.current)}),[e,t]),r}function gk({onSelectSession:e,initialSearch:t="",initialRepoRoot:r=null}){const{data:a,isLoading:o,error:l}=bS(),[u,f]=Y.useState(t),[h]=Y.useState(r),[d,m]=Y.useState("recent"),[g,y]=Y.useState("none"),[v,S]=Y.useState("all"),[C,N]=Y.useState(0),w=mk(u,200),O=Y.useCallback(P=>{f(P),N(0)},[]),_=Y.useCallback(P=>{m(P),N(0)},[]),M=Y.useCallback(P=>{y(P),N(0)},[]),I=Y.useCallback(P=>{S(P),N(0)},[]),k=Y.useMemo(()=>{if(!a)return{groups:[],total:0,filtered:0};const P=dk(a.sessions,w,v,h),K=hk(P,d);return{groups:pk(K,g),total:a.sessions.length,filtered:P.length}},[a,w,v,h,d,g]),D=Y.useMemo(()=>{if(!a)return{};const P={all:a.sessions.length};for(const K of a.sessions)P[K.status]=(P[K.status]??0)+1;return P},[a]);if(o)return b.jsx("div",{className:"flex items-center justify-center py-20",children:b.jsx("div",{className:"text-[var(--text-secondary)] text-sm",children:"Loading sessions..."})});if(l)return b.jsxs("div",{className:"text-[var(--error)] bg-[var(--bg-card)] rounded-lg p-4",children:["Failed to load sessions: ",l.message]});if(!a||a.sessions.length===0)return b.jsxs("div",{className:"text-center py-16",children:[b.jsx("p",{className:"text-[var(--text-secondary)] text-lg",children:"No v2 sessions found"}),b.jsx("p",{className:"text-[var(--text-muted)] text-sm mt-2",children:"Sessions will appear here when workflows are executed with v2 tools enabled."})]});const U=g!=="none",H=C*ro,q=H+ro,L=Math.ceil(k.filtered/ro);return b.jsxs("div",{className:"space-y-4",children:[b.jsx("div",{className:"flex items-center justify-between",children:b.jsxs("h2",{className:"text-lg font-medium text-[var(--text-primary)]",children:["Sessions",b.jsx("span",{className:"text-[var(--text-muted)] font-normal ml-2 text-sm",children:k.filtered===k.total?k.total:`${k.filtered} / ${k.total}`})]})}),b.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[b.jsxs("div",{className:"relative flex-1 min-w-[200px] max-w-[360px]",children:[b.jsx("input",{type:"text",value:u,onChange:P=>O(P.target.value),placeholder:"Search sessions...",className:"w-full bg-[var(--bg-secondary)] border border-[var(--border)] rounded-md px-3 py-1.5 text-sm text-[var(--text-primary)] placeholder-[var(--text-muted)] focus:outline-none focus:border-[var(--accent)] transition-colors"}),u&&b.jsx("button",{onClick:()=>O(""),className:"absolute right-2 top-1/2 -translate-y-1/2 text-[var(--text-muted)] hover:text-[var(--text-primary)] text-xs",children:"clear"})]}),b.jsx(Mv,{label:"Sort",value:d,options:wp,onChange:_}),b.jsx(Mv,{label:"Group",value:g,options:Ep,onChange:M})]}),b.jsx("div",{className:"flex flex-wrap gap-1.5",children:fk.map(P=>{const K=D[P.value]??0;if(P.value!=="all"&&K===0)return null;const B=v===P.value;return b.jsxs("button",{onClick:()=>I(P.value),className:`px-2.5 py-1 rounded-full text-xs font-medium transition-colors cursor-pointer ${B?"bg-[var(--accent)] text-white":"bg-[var(--bg-secondary)] text-[var(--text-secondary)] hover:bg-[var(--bg-card)] hover:text-[var(--text-primary)]"}`,children:[P.label,b.jsx("span",{className:"ml-1 opacity-70",children:K})]},P.value)})}),k.filtered===0?b.jsx("div",{className:"text-center py-12 text-[var(--text-muted)] text-sm",children:"No sessions match the current filters"}):U?b.jsx("div",{className:"space-y-6",children:k.groups.map(P=>b.jsx(yk,{label:P.label,sessions:P.sessions,sort:d,statusFilter:v,onSelectSession:e},P.label+"-"+d+"-"+v))}):b.jsxs(b.Fragment,{children:[b.jsx("div",{className:"space-y-2",children:k.groups[0]?.sessions.slice(H,q).map(P=>b.jsx(CS,{session:P,onClick:()=>e(P.sessionId)},P.sessionId))}),L>1&&b.jsx(ES,{page:C,totalPages:L,onPageChange:N})]})]})}function Mv({label:e,value:t,options:r,onChange:a}){return b.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-[var(--text-muted)]",children:[e,b.jsx("select",{value:t,onChange:o=>a(o.target.value),className:"bg-[var(--bg-secondary)] border border-[var(--border)] rounded-md px-2 py-1.5 text-xs text-[var(--text-primary)] focus:outline-none focus:border-[var(--accent)] cursor-pointer",children:r.map(o=>b.jsx("option",{value:o.value,children:o.label},o.value))})]})}function yk({label:e,sessions:t,sort:r,statusFilter:a,onSelectSession:o}){const[l,u]=Y.useState(!1),[f,h]=Y.useState(0);Y.useEffect(()=>h(0),[t.length]);const d=Math.ceil(t.length/ro),m=f*ro,g=m+ro,y=t.slice(m,g);return b.jsxs("div",{children:[b.jsxs("button",{onClick:()=>u(!l),className:"flex items-center gap-2 mb-2 cursor-pointer group",children:[b.jsx("span",{className:"text-[var(--text-muted)] text-xs transition-transform duration-150",style:{transform:l?"rotate(-90deg)":"rotate(0deg)"},children:"▼"}),b.jsx("span",{className:"text-sm font-medium text-[var(--text-secondary)] group-hover:text-[var(--text-primary)] transition-colors",children:e}),b.jsxs("span",{className:"text-xs text-[var(--text-muted)]",children:["(",t.length,")"]})]}),!l&&b.jsxs("div",{className:"ml-4",children:[b.jsx("div",{className:"space-y-2",children:y.map(v=>b.jsx(CS,{session:v,onClick:()=>o(v.sessionId)},v.sessionId))}),d>1&&b.jsx("div",{className:"mt-2",children:b.jsx(ES,{page:f,totalPages:d,onPageChange:h})})]})]})}function ES({page:e,totalPages:t,onPageChange:r}){return b.jsxs("div",{className:"flex items-center justify-center gap-2 pt-2",children:[b.jsx("button",{onClick:()=>r(e-1),disabled:e===0,className:"px-3 py-1.5 text-xs rounded-md bg-[var(--bg-secondary)] border border-[var(--border)] text-[var(--text-secondary)] disabled:opacity-30 disabled:cursor-not-allowed hover:bg-[var(--bg-card)] transition-colors cursor-pointer",children:"Prev"}),b.jsxs("span",{className:"text-xs text-[var(--text-muted)]",children:[e+1," / ",t]}),b.jsx("button",{onClick:()=>r(e+1),disabled:e>=t-1,className:"px-3 py-1.5 text-xs rounded-md bg-[var(--bg-secondary)] border border-[var(--border)] text-[var(--text-secondary)] disabled:opacity-30 disabled:cursor-not-allowed hover:bg-[var(--bg-card)] transition-colors cursor-pointer",children:"Next"})]})}function CS({session:e,onClick:t}){const r=e.sessionTitle,a=e.workflowName??e.workflowId,o=qc(e.lastModifiedMs);return b.jsxs("button",{onClick:t,className:"w-full text-left bg-[var(--bg-card)] border border-[var(--border)] rounded-lg px-4 py-3 hover:border-[var(--accent)] transition-colors cursor-pointer group",children:[b.jsxs("div",{className:"flex items-start justify-between gap-3",children:[b.jsx("div",{className:"min-w-0 flex-1",children:b.jsx("div",{className:"text-sm font-medium text-[var(--text-primary)] line-clamp-1 group-hover:text-[var(--accent)] transition-colors",children:r??a??"Unnamed session"})}),b.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[b.jsx("span",{className:"text-[10px] text-[var(--text-muted)] tabular-nums",children:o}),b.jsx(wS,{health:e.health}),b.jsx(SS,{status:e.status})]})]}),b.jsxs("div",{className:"flex items-center gap-2 mt-1.5 flex-wrap",children:[r&&a&&b.jsx(Fu,{children:a}),e.gitBranch&&b.jsx(Fu,{icon:"branch",children:e.gitBranch}),b.jsxs(Fu,{icon:"graph",children:[e.nodeCount,"N / ",e.edgeCount,"E"]}),e.tipCount>1&&b.jsxs(Fu,{icon:"fork",children:[e.tipCount," tips"]}),e.hasUnresolvedGaps&&b.jsx("span",{className:"inline-flex items-center gap-1 text-[10px] text-[var(--warning)]",children:"⚠ gaps"})]}),b.jsx("div",{className:"mt-1.5 font-mono text-[10px] text-[var(--text-muted)] opacity-60 group-hover:opacity-100 transition-opacity truncate",children:e.sessionId})]})}const xk={branch:b.jsx("svg",{width:"10",height:"10",viewBox:"0 0 16 16",fill:"currentColor",className:"shrink-0",children:b.jsx("path",{d:"M9.5 3.25a2.25 2.25 0 1 1 3 2.122V6A2.5 2.5 0 0 1 10 8.5H6a1 1 0 0 0-1 1v1.128a2.251 2.251 0 1 1-1.5 0V5.372a2.25 2.25 0 1 1 1.5 0v1.836A2.5 2.5 0 0 1 6 7h4a1 1 0 0 0 1-1v-.628A2.25 2.25 0 0 1 9.5 3.25Z"})}),graph:b.jsx("svg",{width:"10",height:"10",viewBox:"0 0 16 16",fill:"currentColor",className:"shrink-0",children:b.jsx("path",{d:"M2 2.5A2.5 2.5 0 0 1 4.5 0h8.75a.75.75 0 0 1 .75.75v12.5a.75.75 0 0 1-.75.75h-2.5a.75.75 0 0 1 0-1.5h1.75v-2h-8a1 1 0 0 0-.714 1.7.75.75 0 1 1-1.072 1.05A2.5 2.5 0 0 1 2 11.5Z"})}),fork:b.jsx("svg",{width:"10",height:"10",viewBox:"0 0 16 16",fill:"currentColor",className:"shrink-0",children:b.jsx("path",{d:"M5 3.25a.75.75 0 1 1-1.5 0 .75.75 0 0 1 1.5 0Zm2.122-.75a2.25 2.25 0 1 0-3.244 0A2.5 2.5 0 0 0 2 5v5.5A2.5 2.5 0 0 0 4.5 13h3.25a.75.75 0 0 0 0-1.5H4.5a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h7a1 1 0 0 1 1 1v5.5a1 1 0 0 1-1 1H8.75Z"})})};function Fu({children:e,icon:t}){return b.jsxs("span",{className:"inline-flex items-center gap-1 px-1.5 py-0.5 rounded bg-[var(--bg-secondary)] text-[10px] text-[var(--text-muted)] max-w-[200px] truncate",children:[t&&xk[t],e]})}const vk=720*60*60*1e3,kv={in_progress:0,dormant:0,blocked:1,complete_with_gaps:2,complete:3};function bk(e){if(e.length!==0)return[...e].sort((t,r)=>{const a=kv[t.status]-kv[r.status];return a!==0?a:r.lastModifiedMs-t.lastModifiedMs})[0]}function Sk(e,t,r){const a=e.primarySession?.status;if(a==="in_progress"||a==="dormant"||a==="blocked")return"visible";const o=(e.worktree?.changedCount??0)>0,l=(e.worktree?.aheadCount??0)>0;return o||l||r-e.activityMs<vk||t==="all"?"visible":"hidden"}function Tv(e){switch(e.primarySession?.status){case"in_progress":return 0;case"blocked":return 1;case"dormant":return 2;default:return(e.worktree?.changedCount??0)>0||(e.worktree?.aheadCount??0)>0?3:4}}function wk(e,t,r){return[...e].filter(a=>Sk(a,t,r)==="visible").sort((a,o)=>{const l=Tv(a)-Tv(o);return l!==0?l:o.activityMs-a.activityMs})}function Ek(e,t){const r=new Map;for(const h of t)for(const d of h.worktrees)d.branch!==null&&r.set(`${d.branch}\0${h.repoRoot}`,{wt:d,repoName:h.repoName});const a=new Map;for(const h of t)for(const d of h.worktrees)a.set(d.path,h.repoRoot);const o=new Map;for(const h of e){if(h.repoRoot===null||h.gitBranch===null)continue;const d=a.get(h.repoRoot)??h.repoRoot,m=`${h.gitBranch}\0${d}`,g=o.get(m);g?g.push(h):o.set(m,[h])}const l=new Map;for(const h of t)l.set(h.repoRoot,h.repoName);const u=[],f=new Set;for(const[h,d]of o){const[m,g]=h.split("\0"),y=r.get(h),v=bk(d),S=Math.max(v?.lastModifiedMs??0,y?.wt.headTimestampMs??0),C=y?.repoName??l.get(g)??g.split("/").at(-1)??g;u.push({branch:m,repoRoot:g,repoName:C,worktree:y?.wt,primarySession:v,allSessions:d,activityMs:S}),f.add(h)}for(const[h,{wt:d,repoName:m}]of r){if(f.has(h))continue;const[g,y]=h.split("\0");u.push({branch:g,repoRoot:y,repoName:m,worktree:d,primarySession:void 0,allSessions:[],activityMs:d.headTimestampMs})}return u}function Ck(e){return e.reduce((t,r)=>{const a=r.primarySession?.status;return a==="blocked"||a==="dormant"?t+1:t},0)}const _k={blocked:"var(--blocked)",dormant:"var(--text-muted)",complete_with_gaps:"var(--warning)",in_progress:"var(--accent)",complete:"var(--success)"},Av={in_progress:"In progress",dormant:"Dormant",blocked:"Blocked",complete_with_gaps:"Complete with gaps",complete:"Complete"},_S=[{workflow:"coding task workflow",task:"add a dark mode toggle to the settings page"},{workflow:"coding task workflow",task:"write tests for the authentication module"},{workflow:"coding task workflow",task:"refactor the data layer to use a repository pattern"},{workflow:"coding task workflow",task:"add pagination to the search results view"},{workflow:"bug investigation workflow",task:"find why the API returns 500 on logout"},{workflow:"bug investigation workflow",task:"trace why notifications stop sending after 24 hours"},{workflow:"bug investigation workflow",task:"figure out why the build is failing on CI but not locally"},{workflow:"MR review workflow",task:"review my latest changes on this branch"},{workflow:"MR review workflow",task:"review PR #123 before it merges"}],Ih=["The DAG view shows every node the agent created, including blocked attempts and alternative paths.","Dormant sessions have been idle for 3 days -- return to the original conversation to resume.","Gaps are open questions the agent flagged but could not resolve. Check them in the node detail panel.","The preferred tip node (highlighted in yellow in the DAG) is the most recent forward position.","Complete with gaps means the workflow finished but left critical follow-ups unresolved.","The tip count badge shows how many execution paths a session explored.","Use j and k to navigate between branches, Enter to expand, and / to open the full session archive."];function Nk(e){return e[Math.floor(Math.random()*e.length)]}function Mk(e){return e.replace(/^#{1,6}\s+/gm,"").replace(/\*{1,3}([^*\n]+)\*{1,3}/g,"$1").replace(/^[-*+]\s+/gm,"").replace(/`([^`]+)`/g,"$1").replace(/\[([^\]]+)\]\([^)]+\)/g,"$1").replace(/\n+/g," ").replace(/\s{2,}/g," ").trim()}function kk(e,t=220){const r=Mk(e);if(r.length<=t)return r;const a=r.lastIndexOf(" ",t);return r.slice(0,a>0?a:t)+"…"}function Tk({hidden:e=!1}){const t=Pc(),{data:r,isLoading:a,error:o,refetch:l}=bS(),{data:u,isFetching:f}=ok();uk();const[h,d]=Y.useState("active"),[m,g]=Y.useState(-1),[y,v]=Y.useState(!1),[S,C]=Y.useState(null),N=Y.useRef(0),w=Y.useRef(!0),O=Y.useRef(new Map),_=Y.useCallback(q=>{N.current=window.scrollY,t({to:"/session/$sessionId",params:{sessionId:q}})},[t]);Y.useEffect(()=>{if(w.current){w.current=!1;return}if(!e){const q=requestAnimationFrame(()=>{window.scrollTo({top:N.current})});return()=>cancelAnimationFrame(q)}},[e]);const{repoGroups:M,orderedItems:I,needsAttentionCount:k,archiveRepos:D}=Y.useMemo(()=>{const q=Date.now(),L={repoGroups:[],orderedItems:[],needsAttentionCount:0,archiveRepos:[]};if(!r)return L;const P=u?.repos??[],K=Ek(r.sessions,P),B=new Map;for(const Z of K)B.has(Z.repoRoot)||B.set(Z.repoRoot,Z.repoName);const V=y?K.filter(Z=>{const A=Z.primarySession?.status;return A==="blocked"||A==="dormant"}):K,j=new Map;for(const Z of V){const A=j.get(Z.repoRoot);A?A.push(Z):j.set(Z.repoRoot,[Z])}const F=[...j.entries()].map(([Z,A])=>({repoRoot:Z,repoName:A[0].repoName,sortedItems:wk(A,h,q)})).filter(Z=>Z.sortedItems.length>0).sort((Z,A)=>{const z=Z.sortedItems.some(R=>R.primarySession?.status==="in_progress"||R.primarySession?.status==="blocked")?0:1,X=A.sortedItems.some(R=>R.primarySession?.status==="in_progress"||R.primarySession?.status==="blocked")?0:1;return z!==X?z-X:Z.repoName.localeCompare(A.repoName)}),$=F.flatMap(Z=>Z.sortedItems);return{repoGroups:F,orderedItems:$,needsAttentionCount:Ck(K),archiveRepos:[...B.entries()]}},[r,u,h,y]);Y.useEffect(()=>{g(-1)},[I.length]);const U=Y.useCallback(()=>{v(q=>{const L=!q;return d(L?"all":"active"),L})},[]);qk({items:I,focusedIndex:m,setFocusedIndex:g,onSelectSession:_,scope:h,setScope:d,refetch:l,archive:S,setArchive:C,disabled:e});const H=(r?.totalCount??0)>0;return a?b.jsx("div",{className:`flex items-center justify-center py-32 ${e?"hidden":""}`,children:b.jsx("div",{className:"text-[var(--text-muted)] text-sm",children:"Loading workspace..."})}):o?b.jsxs("div",{className:`text-[var(--error)] bg-[var(--bg-card)] border border-[var(--border)] rounded-lg p-4 text-sm ${e?"hidden":""}`,children:["Failed to load workspace: ",o.message]}):S!==null?b.jsxs("div",{className:`space-y-4 ${e?"hidden":""}`,children:[b.jsxs("div",{className:"flex items-center gap-3",children:[b.jsx("button",{onClick:()=>C(null),className:"text-[var(--text-secondary)] hover:text-[var(--text-primary)] transition-colors text-sm",children:"← Back to Workspace"}),S.repoName&&b.jsx("span",{className:"text-sm text-[var(--text-muted)] font-mono",children:S.repoName})]}),b.jsx(gk,{onSelectSession:_,initialRepoRoot:S.repoRoot??null})]}):b.jsxs("div",{className:`space-y-5 ${e?"hidden":""}`,children:[H?b.jsxs(b.Fragment,{children:[k>0&&b.jsx(Hk,{count:k,active:y,onFocusAttention:U}),b.jsx(Ik,{scope:h,onChange:d}),M.length===0?b.jsx("div",{className:"text-sm text-[var(--text-muted)] py-8 text-center",children:"No branches match the current filter."}):b.jsx("div",{className:"space-y-6",children:M.map((q,L)=>{const P=M.slice(0,L).reduce((K,B)=>K+B.sortedItems.length,0);return b.jsx(Ak,{group:q,showHeader:M.length>1,focusedIndex:m,groupOffset:P,worktreesFetching:f,onSelectSession:_,expandStateRef:O},q.repoRoot)})}),b.jsx(Pk,{repos:D,onOpen:(q,L)=>C({repoName:q,repoRoot:L})})]}):b.jsxs(b.Fragment,{children:[b.jsx(Uk,{prompt:Nk(_S)}),b.jsx(Ov,{})]}),b.jsx(Ov,{})]})}const Rv=12;function Ak({group:e,showHeader:t,focusedIndex:r,groupOffset:a,worktreesFetching:o,onSelectSession:l,expandStateRef:u}){const[f,h]=Y.useState(!1),d=f?e.sortedItems:e.sortedItems.slice(0,Rv),m=e.sortedItems.length-Rv,g=e.sortedItems.filter(v=>v.primarySession?.status==="in_progress"||v.primarySession?.status==="blocked").length,y=e.sortedItems.filter(v=>(v.worktree?.changedCount??0)>0).length;return b.jsxs("section",{children:[t&&b.jsxs("div",{style:{position:"sticky",top:"var(--app-header-height)",zIndex:10},className:"flex items-center gap-2 border-b border-[var(--border)] pb-2 mb-2 bg-[var(--bg-primary)]",children:[b.jsx("h3",{className:"text-sm font-semibold text-[var(--text-primary)] font-mono",children:e.repoName}),g>0&&b.jsxs("span",{className:"text-xs font-medium text-[var(--accent)]",children:["● ",g," active"]}),y>0&&b.jsxs("span",{className:"text-xs font-medium text-orange-400",children:["· ",y," uncommitted"]})]}),b.jsxs("div",{className:"space-y-px",children:[d.map((v,S)=>{const C=a+S,N=r===C;if(v.allSessions.length===0)return b.jsx(Dk,{item:v,isFocused:N,worktreesFetching:o,expandStateRef:u},`${v.branch}\0${v.repoRoot}`);if(v.allSessions.length>1)return b.jsx(Ok,{item:v,isFocused:N,worktreesFetching:o,onSelectSession:l,expandStateRef:u},`${v.branch}\0${v.repoRoot}`);const w=v.allSessions[0];return b.jsx("div",{className:N?"ring-2 ring-[var(--accent)] ring-offset-1 rounded":"",children:b.jsx(Cp,{session:w,item:v,showBranch:!0,onSelect:()=>l(w.sessionId)})},`${v.branch}\0${v.repoRoot}`)}),!f&&m>0&&b.jsxs("button",{type:"button",onClick:()=>h(!0),className:"w-full text-left px-3 py-2 text-xs text-[var(--text-muted)] hover:text-[var(--text-secondary)] transition-colors",children:["show ",m," more ",m===1?"branch":"branches"," →"]})]})]})}const Rk=(e,t)=>{const r=o=>o.status==="in_progress"||o.status==="dormant"?0:o.status==="blocked"?1:2,a=r(e)-r(t);return a!==0?a:t.lastModifiedMs-e.lastModifiedMs};function Ok({item:e,isFocused:t,worktreesFetching:r,onSelectSession:a,expandStateRef:o}){const l=`${e.branch}\0${e.repoRoot}`,u=()=>o.current?.get(l)??{filesExpanded:!1,unpushedExpanded:!1},[f,h]=Y.useState(!1),[d,m]=Y.useState(()=>u().filesExpanded),[g,y]=Y.useState(()=>u().unpushedExpanded),[v]=xS(),S=[...e.allSessions].sort(Rk),C=Y.useCallback(()=>{m(_=>{const M=!_,I=o.current?.get(l)??{filesExpanded:!1,unpushedExpanded:!1};return o.current?.set(l,{...I,filesExpanded:M}),M})},[l,o]),N=Y.useCallback(()=>{y(_=>{const M=!_,I=o.current?.get(l)??{filesExpanded:!1,unpushedExpanded:!1};return o.current?.set(l,{...I,unpushedExpanded:M}),M})},[l,o]),w=S.filter(_=>_.status==="in_progress"||_.status==="blocked"||_.status==="dormant"),O=S.filter(_=>_.status!=="in_progress"&&_.status!=="blocked"&&_.status!=="dormant");return b.jsxs("div",{ref:v,className:t?"ring-2 ring-[var(--accent)] ring-offset-1 rounded":"",children:[b.jsx(jk,{item:e,worktreesFetching:r,filesExpanded:d,onToggleFiles:C,unpushedExpanded:g,onToggleUnpushed:N}),d&&e.worktree&&e.worktree.changedFiles.length>0&&b.jsx(MS,{files:e.worktree.changedFiles}),g&&e.worktree&&b.jsx(kS,{commits:e.worktree.unpushedCommits,count:e.worktree.aheadCount}),w.map(_=>b.jsx(Cp,{session:_,showBranch:!1,onSelect:()=>a(_.sessionId)},_.sessionId)),O.length>0&&b.jsxs(b.Fragment,{children:[f&&O.map(_=>b.jsx(Cp,{session:_,showBranch:!1,onSelect:()=>a(_.sessionId)},_.sessionId)),b.jsx("button",{type:"button",onClick:()=>h(_=>!_),className:"w-full text-left px-3 py-1.5 text-[10px] text-[var(--text-muted)] hover:text-[var(--text-secondary)] transition-colors",children:f?"hide history ▴":`${O.length} completed workflow${O.length!==1?"s":""} ▾`})]})]})}function Cp({session:e,item:t,showBranch:r,onSelect:a}){const o=_k[e.status],l=e.status==="dormant",u=e.workflowName??e.workflowId??null,f=qc(e.lastModifiedMs),h=e.sessionTitle?.trim()||u||e.sessionId.slice(0,8),d=e.recapSnippet&&!e.sessionTitle?kk(e.recapSnippet,100):null;return b.jsxs("button",{type:"button",onClick:a,className:"w-full text-left flex items-start gap-3 px-3 py-2.5 rounded hover:bg-[var(--bg-card)] transition-colors group",children:[l?b.jsx("div",{className:"w-1.5 h-1.5 rounded-full shrink-0 mt-[3px] border-2 bg-transparent",style:{borderColor:o},title:Av.dormant}):b.jsx("div",{className:"w-1.5 h-1.5 rounded-full shrink-0 mt-[3px]",style:{backgroundColor:o},title:Av[e.status]}),b.jsxs("div",{className:"flex-1 min-w-0",children:[b.jsx("p",{className:"text-sm text-[var(--text-primary)] group-hover:text-[var(--accent)] transition-colors leading-snug mb-0.5 max-w-prose line-clamp-2",children:h}),b.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[r&&t&&b.jsx("span",{className:"font-mono text-xs text-[var(--text-muted)] truncate flex-1",children:t.branch}),r&&t?.worktree?.isMerged&&t.worktree.branch!==null&&t.worktree.branch!=="main"&&b.jsx(gm,{}),!r&&u&&b.jsx("span",{className:"text-[10px] text-[var(--text-muted)] shrink-0",children:u}),e.hasUnresolvedGaps&&b.jsx("span",{title:"Unresolved gaps",className:"text-[10px] text-[var(--warning)] shrink-0",children:"⚠"}),b.jsx("span",{className:"text-[10px] text-[var(--text-muted)] tabular-nums shrink-0 ml-auto",children:f})]}),d&&b.jsx("p",{className:"text-xs text-[var(--text-muted)] truncate leading-snug",children:d})]})]})}function jk({item:e,worktreesFetching:t,filesExpanded:r,onToggleFiles:a,unpushedExpanded:o,onToggleUnpushed:l}){const u=qc(e.activityMs);return b.jsxs("div",{className:"flex items-center gap-2 px-3 pt-2 pb-1",children:[b.jsx("span",{className:"font-mono text-xs font-medium text-[var(--text-secondary)] truncate flex-1",children:e.branch}),e.worktree?.isMerged&&e.worktree.branch!==null&&e.worktree.branch!=="main"&&b.jsx(gm,{}),b.jsx(NS,{item:e,fetching:t,compact:!0,filesExpanded:r,onToggleFiles:a,unpushedExpanded:o,onToggleUnpushed:l}),b.jsx("span",{className:"text-[10px] text-[var(--text-muted)] tabular-nums shrink-0",children:u})]})}function Dk({item:e,isFocused:t,worktreesFetching:r,expandStateRef:a}){const o=`${e.branch}\0${e.repoRoot}`,l=()=>a.current?.get(o)??{filesExpanded:!1,unpushedExpanded:!1},[u,f]=Y.useState(()=>l().filesExpanded),[h,d]=Y.useState(()=>l().unpushedExpanded),[m]=xS(),g=qc(e.activityMs),y=Y.useCallback(()=>{f(S=>{const C=!S,N=a.current?.get(o)??{filesExpanded:!1,unpushedExpanded:!1};return a.current?.set(o,{...N,filesExpanded:C}),C})},[o,a]),v=Y.useCallback(()=>{d(S=>{const C=!S,N=a.current?.get(o)??{filesExpanded:!1,unpushedExpanded:!1};return a.current?.set(o,{...N,unpushedExpanded:C}),C})},[o,a]);return b.jsxs("div",{ref:m,children:[b.jsxs("div",{className:`flex items-center gap-3 px-3 py-2 rounded ${t?"ring-2 ring-[var(--accent)] ring-offset-1":""}`,children:[b.jsx("div",{className:"w-1.5 h-1.5 rounded-full shrink-0 bg-[var(--border)]",title:"No sessions"}),b.jsx("span",{className:"font-mono text-xs text-[var(--text-muted)] truncate flex-1",children:e.branch}),e.worktree?.isMerged&&e.worktree.branch!==null&&e.worktree.branch!=="main"&&b.jsx(gm,{}),b.jsx(NS,{item:e,fetching:r,compact:!0,filesExpanded:u,onToggleFiles:y,unpushedExpanded:h,onToggleUnpushed:v}),e.worktree?.headMessage&&b.jsx("span",{className:"text-[10px] text-[var(--text-muted)] truncate hidden sm:block max-w-[200px] opacity-60",children:e.worktree.headMessage}),b.jsx("span",{className:"text-[10px] text-[var(--text-muted)] tabular-nums shrink-0",children:g})]}),u&&e.worktree&&e.worktree.changedFiles.length>0&&b.jsx(MS,{files:e.worktree.changedFiles}),h&&e.worktree&&b.jsx(kS,{commits:e.worktree.unpushedCommits,count:e.worktree.aheadCount})]})}function NS({item:e,fetching:t,compact:r=!1,filesExpanded:a,onToggleFiles:o,unpushedExpanded:l,onToggleUnpushed:u}){if(t&&e.worktree===void 0)return b.jsx("span",{className:"flex gap-1",children:b.jsx(Bk,{})});const f=e.worktree;if(!f)return null;const h=f.changedCount,d=f.aheadCount;if(h===0&&d===0)return null;const m=`text-xs px-1.5 py-0.5 rounded bg-orange-500/10 text-orange-400 border border-orange-500/20 tabular-nums${r?" text-[10px]":""}`;return b.jsxs("span",{className:"flex items-center gap-1",children:[h>0&&(o?b.jsxs("button",{type:"button","aria-expanded":a??!1,"aria-label":`Show ${h} uncommitted file${h===1?"":"s"}`,title:`${h} file${h===1?"":"s"} edited but not yet committed — click to expand`,onClick:o,className:`${m} cursor-pointer hover:bg-orange-500/20 transition-colors focus-visible:ring-2 focus-visible:ring-[var(--accent)] focus-visible:ring-offset-1${a?" ring-1 ring-orange-500/40":""}`,children:[h," uncommitted"]}):b.jsxs("span",{title:`${h} file${h===1?"":"s"} edited but not yet committed`,className:m,children:[h," uncommitted"]})),d>0&&(u?b.jsxs("button",{type:"button","aria-expanded":l??!1,"aria-label":`Show ${d} unpushed commit${d===1?"":"s"}`,title:`${d} commit${d===1?"":"s"} not yet pushed -- click to expand`,onClick:u,className:`text-xs px-1.5 py-0.5 rounded bg-blue-500/10 text-blue-400 border border-blue-500/20 cursor-pointer hover:bg-blue-500/20 transition-colors focus-visible:ring-2 focus-visible:ring-[var(--accent)] focus-visible:ring-offset-1 tabular-nums${r?" text-[10px]":""}${l?" ring-1 ring-blue-500/40":""}`,children:[d," unpushed"]}):b.jsxs("span",{title:`${d} commit${d===1?"":"s"} not yet pushed`,className:`text-xs px-1.5 py-0.5 rounded bg-blue-500/10 text-blue-400 border border-blue-500/20 tabular-nums${r?" text-[10px]":""}`,children:[d," unpushed"]}))]})}const zk={modified:"var(--warning)",added:"var(--success)",deleted:"var(--error)",untracked:"#a0a0a0",renamed:"var(--accent)",other:"#a0a0a0"},Lk={modified:"M",added:"A",deleted:"D",untracked:"?",renamed:"R",other:"~"};function MS({files:e}){return b.jsx("div",{className:"mx-3 mb-1 max-h-48 overflow-y-auto rounded border border-[var(--border)] bg-[var(--bg-card)]",children:e.map((t,r)=>b.jsxs("div",{className:"flex items-center gap-2 px-2 py-0.5 hover:bg-[var(--bg-tertiary)]",children:[b.jsx("span",{className:"text-[10px] font-mono font-semibold w-3 shrink-0 tabular-nums",style:{color:zk[t.status]},title:t.status,children:Lk[t.status]}),b.jsx("span",{className:"font-mono text-[11px] text-[var(--text-secondary)] truncate",children:t.path})]},r))})}function kS({commits:e,count:t}){return e.length===0?b.jsx("div",{className:"mx-3 mb-1 px-2 py-1.5 rounded border border-[var(--border)] bg-[var(--bg-card)]",children:b.jsx("span",{className:"text-[11px] text-[var(--text-muted)] italic",children:t!==void 0&&t>0?`${t} commit${t===1?"":"s"} ahead -- details unavailable`:"No unpushed commits"})}):b.jsx("div",{className:"mx-3 mb-1 max-h-48 overflow-y-auto rounded border border-[var(--border)] bg-[var(--bg-card)]",children:e.map((r,a)=>b.jsxs("div",{className:"flex items-center gap-2 px-2 py-0.5 hover:bg-[var(--bg-tertiary)]",children:[b.jsx("span",{className:"font-mono text-[10px] text-[var(--text-muted)] shrink-0 tabular-nums w-14",children:r.hash}),b.jsx("span",{className:"font-mono text-[11px] text-[var(--text-secondary)] truncate",children:r.message})]},a))})}function gm(){return b.jsx("span",{title:"Merged into main",className:"text-[10px] px-1.5 py-0.5 rounded bg-green-500/10 text-green-400 border border-green-500/20 shrink-0",children:"merged"})}function Bk(){return b.jsx("span",{className:"inline-block h-5 w-20 rounded bg-[var(--bg-tertiary)] animate-pulse"})}function Ik({scope:e,onChange:t}){return b.jsx("div",{className:"flex items-center gap-1",children:["active","all"].map(r=>b.jsx("button",{type:"button",onClick:()=>t(r),className:`px-3 py-1 rounded-full text-xs font-medium transition-colors capitalize ${e===r?"bg-[var(--bg-tertiary)] text-[var(--text-primary)]":"text-[var(--text-muted)] hover:text-[var(--text-secondary)]"}`,children:r==="active"?"Active":"All"},r))})}function Hk({count:e,active:t,onFocusAttention:r}){return b.jsxs("button",{type:"button",onClick:r,className:`w-full flex items-center gap-3 bg-[var(--bg-card)] border rounded-lg px-4 py-2.5 overflow-hidden text-left transition-colors hover:border-[var(--blocked)] ${t?"border-[var(--blocked)]":"border-[var(--border)]"}`,style:{borderLeftColor:"var(--blocked)",borderLeftWidth:"3px"},title:t?"Click to show all branches":"Click to focus on sessions needing attention",children:[b.jsxs("span",{className:"text-sm font-medium",style:{color:"var(--blocked)"},children:[e," session",e!==1?"s":""," ",e!==1?"need":"needs"," attention"]}),b.jsx("span",{className:"text-xs text-[var(--text-muted)]",children:t?"-- click to clear filter":"-- click to focus"})]})}function Pk({repos:e,onOpen:t}){return b.jsxs("div",{className:"flex flex-col gap-1 pt-2 border-t border-[var(--border)]",children:[e.map(([r,a])=>b.jsxs("button",{type:"button",onClick:()=>t(a,r),className:"text-xs text-[var(--text-muted)] hover:text-[var(--text-secondary)] transition-colors text-left",children:["All ",a," sessions →"]},r)),e.length!==1&&b.jsx("button",{type:"button",onClick:()=>t(void 0,void 0),className:"text-xs text-[var(--text-muted)] hover:text-[var(--text-secondary)] transition-colors text-left",children:"All sessions →"})]})}function Uk({prompt:e}){return b.jsxs("div",{className:"flex flex-col items-center gap-8 py-20 text-center",children:[b.jsxs("div",{children:[b.jsx("h2",{className:"text-xl font-semibold text-[var(--text-primary)] mb-3",children:"Ready when you are"}),b.jsx("p",{className:"text-sm text-[var(--text-muted)] max-w-sm leading-relaxed",children:"Sessions appear here when your agent runs a workflow. Start one by telling your agent:"})]}),b.jsxs("div",{className:"bg-[var(--bg-card)] border border-[var(--border)] rounded-xl px-6 py-5 max-w-lg w-full text-left",children:[b.jsx("p",{className:"text-xs font-medium text-[var(--text-muted)] uppercase tracking-wider mb-2",children:"Try this prompt"}),b.jsxs("p",{className:"text-[var(--text-primary)] text-sm leading-relaxed",children:['"Use the'," ",b.jsx("span",{className:"text-[var(--accent)] font-medium",children:e.workflow})," ","to ",e.task,'"']})]}),b.jsxs("p",{className:"text-xs text-[var(--text-muted)]",children:["Prompts rotate each visit -- there are ",_S.length," to discover."]})]})}function Ov(){const[e,t]=Y.useState(()=>Math.floor(Math.random()*Ih.length)),[r,a]=Y.useState(!1);return Y.useEffect(()=>{let o=null;const l=setInterval(()=>{a(!0),o=setTimeout(()=>{t(u=>(u+1)%Ih.length),a(!1),o=null},300)},6e4);return()=>{clearInterval(l),o!==null&&clearTimeout(o)}},[]),b.jsxs("div",{className:"flex items-start gap-3 bg-[var(--bg-card)] border border-[var(--border)] rounded-lg px-4 py-3",children:[b.jsx("div",{className:"w-0.5 shrink-0 self-stretch rounded-full",style:{backgroundColor:"var(--accent)"}}),b.jsxs("div",{style:{opacity:r?0:1,transition:"opacity 300ms"},children:[b.jsx("span",{className:"text-[10px] font-semibold text-[var(--accent)] uppercase tracking-widest",children:"Tip"}),b.jsx("p",{className:"text-sm text-[var(--text-secondary)] mt-1 leading-relaxed",children:Ih[e]})]})]})}function qk({items:e,focusedIndex:t,setFocusedIndex:r,onSelectSession:a,scope:o,setScope:l,refetch:u,archive:f,setArchive:h,disabled:d}){const m=Y.useRef(e);m.current=e;const g=Y.useRef(a);g.current=a;const y=Y.useRef(o);y.current=o;const v=Y.useRef(t);v.current=t;const S=Y.useRef(f);S.current=f;const C=Y.useRef(d);C.current=d,Y.useEffect(()=>{function N(w){if(C.current||w.metaKey||w.ctrlKey||w.altKey)return;const O=document.activeElement;if(O instanceof HTMLInputElement||O instanceof HTMLTextAreaElement||O instanceof HTMLSelectElement)return;if(w.key==="Escape"&&S.current!==null){h(null);return}const _=m.current,M=v.current;switch(w.key){case"j":case"ArrowDown":{w.preventDefault();const I=Math.min(M+1,_.length-1);r(I);break}case"k":case"ArrowUp":{w.preventDefault();const I=Math.max(M-1,0);r(I);break}case"Enter":case" ":{if(w.preventDefault(),M>=0&&M<_.length){const k=_[M].primarySession?.sessionId;k&&g.current(k)}break}case"Escape":break;case"/":{w.preventDefault(),h({repoName:void 0,repoRoot:void 0});break}case"r":{w.preventDefault(),u();break}case"a":{w.preventDefault(),l(y.current==="active"?"all":"active");break}}}return document.addEventListener("keydown",N),()=>document.removeEventListener("keydown",N)},[r,l,u,h])}function St(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let r=0,a;r<e.length;r++)(a=St(e[r]))!==""&&(t+=(t&&" ")+a);else for(let r in e)e[r]&&(t+=(t&&" ")+r);return t}var Vk={value:()=>{}};function Vc(){for(var e=0,t=arguments.length,r={},a;e<t;++e){if(!(a=arguments[e]+"")||a in r||/[\s.]/.test(a))throw new Error("illegal type: "+a);r[a]=[]}return new uc(r)}function uc(e){this._=e}function Fk(e,t){return e.trim().split(/^|\s+/).map(function(r){var a="",o=r.indexOf(".");if(o>=0&&(a=r.slice(o+1),r=r.slice(0,o)),r&&!t.hasOwnProperty(r))throw new Error("unknown type: "+r);return{type:r,name:a}})}uc.prototype=Vc.prototype={constructor:uc,on:function(e,t){var r=this._,a=Fk(e+"",r),o,l=-1,u=a.length;if(arguments.length<2){for(;++l<u;)if((o=(e=a[l]).type)&&(o=Yk(r[o],e.name)))return o;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++l<u;)if(o=(e=a[l]).type)r[o]=jv(r[o],e.name,t);else if(t==null)for(o in r)r[o]=jv(r[o],e.name,null);return this},copy:function(){var e={},t=this._;for(var r in t)e[r]=t[r].slice();return new uc(e)},call:function(e,t){if((o=arguments.length-2)>0)for(var r=new Array(o),a=0,o,l;a<o;++a)r[a]=arguments[a+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(l=this._[e],a=0,o=l.length;a<o;++a)l[a].value.apply(t,r)},apply:function(e,t,r){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var a=this._[e],o=0,l=a.length;o<l;++o)a[o].value.apply(t,r)}};function Yk(e,t){for(var r=0,a=e.length,o;r<a;++r)if((o=e[r]).name===t)return o.value}function jv(e,t,r){for(var a=0,o=e.length;a<o;++a)if(e[a].name===t){e[a]=Vk,e=e.slice(0,a).concat(e.slice(a+1));break}return r!=null&&e.push({name:t,value:r}),e}var _p="http://www.w3.org/1999/xhtml";const Dv={svg:"http://www.w3.org/2000/svg",xhtml:_p,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Fc(e){var t=e+="",r=t.indexOf(":");return r>=0&&(t=e.slice(0,r))!=="xmlns"&&(e=e.slice(r+1)),Dv.hasOwnProperty(t)?{space:Dv[t],local:e}:e}function Xk(e){return function(){var t=this.ownerDocument,r=this.namespaceURI;return r===_p&&t.documentElement.namespaceURI===_p?t.createElement(e):t.createElementNS(r,e)}}function Gk(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function TS(e){var t=Fc(e);return(t.local?Gk:Xk)(t)}function $k(){}function ym(e){return e==null?$k:function(){return this.querySelector(e)}}function Qk(e){typeof e!="function"&&(e=ym(e));for(var t=this._groups,r=t.length,a=new Array(r),o=0;o<r;++o)for(var l=t[o],u=l.length,f=a[o]=new Array(u),h,d,m=0;m<u;++m)(h=l[m])&&(d=e.call(h,h.__data__,m,l))&&("__data__"in h&&(d.__data__=h.__data__),f[m]=d);return new xn(a,this._parents)}function Zk(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function Kk(){return[]}function AS(e){return e==null?Kk:function(){return this.querySelectorAll(e)}}function Jk(e){return function(){return Zk(e.apply(this,arguments))}}function Wk(e){typeof e=="function"?e=Jk(e):e=AS(e);for(var t=this._groups,r=t.length,a=[],o=[],l=0;l<r;++l)for(var u=t[l],f=u.length,h,d=0;d<f;++d)(h=u[d])&&(a.push(e.call(h,h.__data__,d,u)),o.push(h));return new xn(a,o)}function RS(e){return function(){return this.matches(e)}}function OS(e){return function(t){return t.matches(e)}}var eT=Array.prototype.find;function tT(e){return function(){return eT.call(this.children,e)}}function nT(){return this.firstElementChild}function rT(e){return this.select(e==null?nT:tT(typeof e=="function"?e:OS(e)))}var iT=Array.prototype.filter;function aT(){return Array.from(this.children)}function oT(e){return function(){return iT.call(this.children,e)}}function sT(e){return this.selectAll(e==null?aT:oT(typeof e=="function"?e:OS(e)))}function lT(e){typeof e!="function"&&(e=RS(e));for(var t=this._groups,r=t.length,a=new Array(r),o=0;o<r;++o)for(var l=t[o],u=l.length,f=a[o]=[],h,d=0;d<u;++d)(h=l[d])&&e.call(h,h.__data__,d,l)&&f.push(h);return new xn(a,this._parents)}function jS(e){return new Array(e.length)}function uT(){return new xn(this._enter||this._groups.map(jS),this._parents)}function wc(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}wc.prototype={constructor:wc,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function cT(e){return function(){return e}}function fT(e,t,r,a,o,l){for(var u=0,f,h=t.length,d=l.length;u<d;++u)(f=t[u])?(f.__data__=l[u],a[u]=f):r[u]=new wc(e,l[u]);for(;u<h;++u)(f=t[u])&&(o[u]=f)}function dT(e,t,r,a,o,l,u){var f,h,d=new Map,m=t.length,g=l.length,y=new Array(m),v;for(f=0;f<m;++f)(h=t[f])&&(y[f]=v=u.call(h,h.__data__,f,t)+"",d.has(v)?o[f]=h:d.set(v,h));for(f=0;f<g;++f)v=u.call(e,l[f],f,l)+"",(h=d.get(v))?(a[f]=h,h.__data__=l[f],d.delete(v)):r[f]=new wc(e,l[f]);for(f=0;f<m;++f)(h=t[f])&&d.get(y[f])===h&&(o[f]=h)}function hT(e){return e.__data__}function pT(e,t){if(!arguments.length)return Array.from(this,hT);var r=t?dT:fT,a=this._parents,o=this._groups;typeof e!="function"&&(e=cT(e));for(var l=o.length,u=new Array(l),f=new Array(l),h=new Array(l),d=0;d<l;++d){var m=a[d],g=o[d],y=g.length,v=mT(e.call(m,m&&m.__data__,d,a)),S=v.length,C=f[d]=new Array(S),N=u[d]=new Array(S),w=h[d]=new Array(y);r(m,g,C,N,w,v,t);for(var O=0,_=0,M,I;O<S;++O)if(M=C[O]){for(O>=_&&(_=O+1);!(I=N[_])&&++_<S;);M._next=I||null}}return u=new xn(u,a),u._enter=f,u._exit=h,u}function mT(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function gT(){return new xn(this._exit||this._groups.map(jS),this._parents)}function yT(e,t,r){var a=this.enter(),o=this,l=this.exit();return typeof e=="function"?(a=e(a),a&&(a=a.selection())):a=a.append(e+""),t!=null&&(o=t(o),o&&(o=o.selection())),r==null?l.remove():r(l),a&&o?a.merge(o).order():o}function xT(e){for(var t=e.selection?e.selection():e,r=this._groups,a=t._groups,o=r.length,l=a.length,u=Math.min(o,l),f=new Array(o),h=0;h<u;++h)for(var d=r[h],m=a[h],g=d.length,y=f[h]=new Array(g),v,S=0;S<g;++S)(v=d[S]||m[S])&&(y[S]=v);for(;h<o;++h)f[h]=r[h];return new xn(f,this._parents)}function vT(){for(var e=this._groups,t=-1,r=e.length;++t<r;)for(var a=e[t],o=a.length-1,l=a[o],u;--o>=0;)(u=a[o])&&(l&&u.compareDocumentPosition(l)^4&&l.parentNode.insertBefore(u,l),l=u);return this}function bT(e){e||(e=ST);function t(g,y){return g&&y?e(g.__data__,y.__data__):!g-!y}for(var r=this._groups,a=r.length,o=new Array(a),l=0;l<a;++l){for(var u=r[l],f=u.length,h=o[l]=new Array(f),d,m=0;m<f;++m)(d=u[m])&&(h[m]=d);h.sort(t)}return new xn(o,this._parents).order()}function ST(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function wT(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function ET(){return Array.from(this)}function CT(){for(var e=this._groups,t=0,r=e.length;t<r;++t)for(var a=e[t],o=0,l=a.length;o<l;++o){var u=a[o];if(u)return u}return null}function _T(){let e=0;for(const t of this)++e;return e}function NT(){return!this.node()}function MT(e){for(var t=this._groups,r=0,a=t.length;r<a;++r)for(var o=t[r],l=0,u=o.length,f;l<u;++l)(f=o[l])&&e.call(f,f.__data__,l,o);return this}function kT(e){return function(){this.removeAttribute(e)}}function TT(e){return function(){this.removeAttributeNS(e.space,e.local)}}function AT(e,t){return function(){this.setAttribute(e,t)}}function RT(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function OT(e,t){return function(){var r=t.apply(this,arguments);r==null?this.removeAttribute(e):this.setAttribute(e,r)}}function jT(e,t){return function(){var r=t.apply(this,arguments);r==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,r)}}function DT(e,t){var r=Fc(e);if(arguments.length<2){var a=this.node();return r.local?a.getAttributeNS(r.space,r.local):a.getAttribute(r)}return this.each((t==null?r.local?TT:kT:typeof t=="function"?r.local?jT:OT:r.local?RT:AT)(r,t))}function DS(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function zT(e){return function(){this.style.removeProperty(e)}}function LT(e,t,r){return function(){this.style.setProperty(e,t,r)}}function BT(e,t,r){return function(){var a=t.apply(this,arguments);a==null?this.style.removeProperty(e):this.style.setProperty(e,a,r)}}function IT(e,t,r){return arguments.length>1?this.each((t==null?zT:typeof t=="function"?BT:LT)(e,t,r??"")):ho(this.node(),e)}function ho(e,t){return e.style.getPropertyValue(t)||DS(e).getComputedStyle(e,null).getPropertyValue(t)}function HT(e){return function(){delete this[e]}}function PT(e,t){return function(){this[e]=t}}function UT(e,t){return function(){var r=t.apply(this,arguments);r==null?delete this[e]:this[e]=r}}function qT(e,t){return arguments.length>1?this.each((t==null?HT:typeof t=="function"?UT:PT)(e,t)):this.node()[e]}function zS(e){return e.trim().split(/^|\s+/)}function xm(e){return e.classList||new LS(e)}function LS(e){this._node=e,this._names=zS(e.getAttribute("class")||"")}LS.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function BS(e,t){for(var r=xm(e),a=-1,o=t.length;++a<o;)r.add(t[a])}function IS(e,t){for(var r=xm(e),a=-1,o=t.length;++a<o;)r.remove(t[a])}function VT(e){return function(){BS(this,e)}}function FT(e){return function(){IS(this,e)}}function YT(e,t){return function(){(t.apply(this,arguments)?BS:IS)(this,e)}}function XT(e,t){var r=zS(e+"");if(arguments.length<2){for(var a=xm(this.node()),o=-1,l=r.length;++o<l;)if(!a.contains(r[o]))return!1;return!0}return this.each((typeof t=="function"?YT:t?VT:FT)(r,t))}function GT(){this.textContent=""}function $T(e){return function(){this.textContent=e}}function QT(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function ZT(e){return arguments.length?this.each(e==null?GT:(typeof e=="function"?QT:$T)(e)):this.node().textContent}function KT(){this.innerHTML=""}function JT(e){return function(){this.innerHTML=e}}function WT(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function eA(e){return arguments.length?this.each(e==null?KT:(typeof e=="function"?WT:JT)(e)):this.node().innerHTML}function tA(){this.nextSibling&&this.parentNode.appendChild(this)}function nA(){return this.each(tA)}function rA(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function iA(){return this.each(rA)}function aA(e){var t=typeof e=="function"?e:TS(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function oA(){return null}function sA(e,t){var r=typeof e=="function"?e:TS(e),a=t==null?oA:typeof t=="function"?t:ym(t);return this.select(function(){return this.insertBefore(r.apply(this,arguments),a.apply(this,arguments)||null)})}function lA(){var e=this.parentNode;e&&e.removeChild(this)}function uA(){return this.each(lA)}function cA(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function fA(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function dA(e){return this.select(e?fA:cA)}function hA(e){return arguments.length?this.property("__data__",e):this.node().__data__}function pA(e){return function(t){e.call(this,t,this.__data__)}}function mA(e){return e.trim().split(/^|\s+/).map(function(t){var r="",a=t.indexOf(".");return a>=0&&(r=t.slice(a+1),t=t.slice(0,a)),{type:t,name:r}})}function gA(e){return function(){var t=this.__on;if(t){for(var r=0,a=-1,o=t.length,l;r<o;++r)l=t[r],(!e.type||l.type===e.type)&&l.name===e.name?this.removeEventListener(l.type,l.listener,l.options):t[++a]=l;++a?t.length=a:delete this.__on}}}function yA(e,t,r){return function(){var a=this.__on,o,l=pA(t);if(a){for(var u=0,f=a.length;u<f;++u)if((o=a[u]).type===e.type&&o.name===e.name){this.removeEventListener(o.type,o.listener,o.options),this.addEventListener(o.type,o.listener=l,o.options=r),o.value=t;return}}this.addEventListener(e.type,l,r),o={type:e.type,name:e.name,value:t,listener:l,options:r},a?a.push(o):this.__on=[o]}}function xA(e,t,r){var a=mA(e+""),o,l=a.length,u;if(arguments.length<2){var f=this.node().__on;if(f){for(var h=0,d=f.length,m;h<d;++h)for(o=0,m=f[h];o<l;++o)if((u=a[o]).type===m.type&&u.name===m.name)return m.value}return}for(f=t?yA:gA,o=0;o<l;++o)this.each(f(a[o],t,r));return this}function HS(e,t,r){var a=DS(e),o=a.CustomEvent;typeof o=="function"?o=new o(t,r):(o=a.document.createEvent("Event"),r?(o.initEvent(t,r.bubbles,r.cancelable),o.detail=r.detail):o.initEvent(t,!1,!1)),e.dispatchEvent(o)}function vA(e,t){return function(){return HS(this,e,t)}}function bA(e,t){return function(){return HS(this,e,t.apply(this,arguments))}}function SA(e,t){return this.each((typeof t=="function"?bA:vA)(e,t))}function*wA(){for(var e=this._groups,t=0,r=e.length;t<r;++t)for(var a=e[t],o=0,l=a.length,u;o<l;++o)(u=a[o])&&(yield u)}var PS=[null];function xn(e,t){this._groups=e,this._parents=t}function cl(){return new xn([[document.documentElement]],PS)}function EA(){return this}xn.prototype=cl.prototype={constructor:xn,select:Qk,selectAll:Wk,selectChild:rT,selectChildren:sT,filter:lT,data:pT,enter:uT,exit:gT,join:yT,merge:xT,selection:EA,order:vT,sort:bT,call:wT,nodes:ET,node:CT,size:_T,empty:NT,each:MT,attr:DT,style:IT,property:qT,classed:XT,text:ZT,html:eA,raise:nA,lower:iA,append:aA,insert:sA,remove:uA,clone:dA,datum:hA,on:xA,dispatch:SA,[Symbol.iterator]:wA};function mn(e){return typeof e=="string"?new xn([[document.querySelector(e)]],[document.documentElement]):new xn([[e]],PS)}function CA(e){let t;for(;t=e.sourceEvent;)e=t;return e}function Ln(e,t){if(e=CA(e),t===void 0&&(t=e.currentTarget),t){var r=t.ownerSVGElement||t;if(r.createSVGPoint){var a=r.createSVGPoint();return a.x=e.clientX,a.y=e.clientY,a=a.matrixTransform(t.getScreenCTM().inverse()),[a.x,a.y]}if(t.getBoundingClientRect){var o=t.getBoundingClientRect();return[e.clientX-o.left-t.clientLeft,e.clientY-o.top-t.clientTop]}}return[e.pageX,e.pageY]}const _A={passive:!1},Ks={capture:!0,passive:!1};function Hh(e){e.stopImmediatePropagation()}function io(e){e.preventDefault(),e.stopImmediatePropagation()}function US(e){var t=e.document.documentElement,r=mn(e).on("dragstart.drag",io,Ks);"onselectstart"in t?r.on("selectstart.drag",io,Ks):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function qS(e,t){var r=e.document.documentElement,a=mn(e).on("dragstart.drag",null);t&&(a.on("click.drag",io,Ks),setTimeout(function(){a.on("click.drag",null)},0)),"onselectstart"in r?a.on("selectstart.drag",null):(r.style.MozUserSelect=r.__noselect,delete r.__noselect)}const Yu=e=>()=>e;function Np(e,{sourceEvent:t,subject:r,target:a,identifier:o,active:l,x:u,y:f,dx:h,dy:d,dispatch:m}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:r,enumerable:!0,configurable:!0},target:{value:a,enumerable:!0,configurable:!0},identifier:{value:o,enumerable:!0,configurable:!0},active:{value:l,enumerable:!0,configurable:!0},x:{value:u,enumerable:!0,configurable:!0},y:{value:f,enumerable:!0,configurable:!0},dx:{value:h,enumerable:!0,configurable:!0},dy:{value:d,enumerable:!0,configurable:!0},_:{value:m}})}Np.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function NA(e){return!e.ctrlKey&&!e.button}function MA(){return this.parentNode}function kA(e,t){return t??{x:e.x,y:e.y}}function TA(){return navigator.maxTouchPoints||"ontouchstart"in this}function VS(){var e=NA,t=MA,r=kA,a=TA,o={},l=Vc("start","drag","end"),u=0,f,h,d,m,g=0;function y(M){M.on("mousedown.drag",v).filter(a).on("touchstart.drag",N).on("touchmove.drag",w,_A).on("touchend.drag touchcancel.drag",O).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function v(M,I){if(!(m||!e.call(this,M,I))){var k=_(this,t.call(this,M,I),M,I,"mouse");k&&(mn(M.view).on("mousemove.drag",S,Ks).on("mouseup.drag",C,Ks),US(M.view),Hh(M),d=!1,f=M.clientX,h=M.clientY,k("start",M))}}function S(M){if(io(M),!d){var I=M.clientX-f,k=M.clientY-h;d=I*I+k*k>g}o.mouse("drag",M)}function C(M){mn(M.view).on("mousemove.drag mouseup.drag",null),qS(M.view,d),io(M),o.mouse("end",M)}function N(M,I){if(e.call(this,M,I)){var k=M.changedTouches,D=t.call(this,M,I),U=k.length,H,q;for(H=0;H<U;++H)(q=_(this,D,M,I,k[H].identifier,k[H]))&&(Hh(M),q("start",M,k[H]))}}function w(M){var I=M.changedTouches,k=I.length,D,U;for(D=0;D<k;++D)(U=o[I[D].identifier])&&(io(M),U("drag",M,I[D]))}function O(M){var I=M.changedTouches,k=I.length,D,U;for(m&&clearTimeout(m),m=setTimeout(function(){m=null},500),D=0;D<k;++D)(U=o[I[D].identifier])&&(Hh(M),U("end",M,I[D]))}function _(M,I,k,D,U,H){var q=l.copy(),L=Ln(H||k,I),P,K,B;if((B=r.call(M,new Np("beforestart",{sourceEvent:k,target:y,identifier:U,active:u,x:L[0],y:L[1],dx:0,dy:0,dispatch:q}),D))!=null)return P=B.x-L[0]||0,K=B.y-L[1]||0,function V(j,F,$){var Z=L,A;switch(j){case"start":o[U]=V,A=u++;break;case"end":delete o[U],--u;case"drag":L=Ln($||F,I),A=u;break}q.call(j,M,new Np(j,{sourceEvent:F,subject:B,target:y,identifier:U,active:A,x:L[0]+P,y:L[1]+K,dx:L[0]-Z[0],dy:L[1]-Z[1],dispatch:q}),D)}}return y.filter=function(M){return arguments.length?(e=typeof M=="function"?M:Yu(!!M),y):e},y.container=function(M){return arguments.length?(t=typeof M=="function"?M:Yu(M),y):t},y.subject=function(M){return arguments.length?(r=typeof M=="function"?M:Yu(M),y):r},y.touchable=function(M){return arguments.length?(a=typeof M=="function"?M:Yu(!!M),y):a},y.on=function(){var M=l.on.apply(l,arguments);return M===l?y:M},y.clickDistance=function(M){return arguments.length?(g=(M=+M)*M,y):Math.sqrt(g)},y}function vm(e,t,r){e.prototype=t.prototype=r,r.constructor=e}function FS(e,t){var r=Object.create(e.prototype);for(var a in t)r[a]=t[a];return r}function fl(){}var Js=.7,Ec=1/Js,ao="\\s*([+-]?\\d+)\\s*",Ws="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Jn="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",AA=/^#([0-9a-f]{3,8})$/,RA=new RegExp(`^rgb\\(${ao},${ao},${ao}\\)$`),OA=new RegExp(`^rgb\\(${Jn},${Jn},${Jn}\\)$`),jA=new RegExp(`^rgba\\(${ao},${ao},${ao},${Ws}\\)$`),DA=new RegExp(`^rgba\\(${Jn},${Jn},${Jn},${Ws}\\)$`),zA=new RegExp(`^hsl\\(${Ws},${Jn},${Jn}\\)$`),LA=new RegExp(`^hsla\\(${Ws},${Jn},${Jn},${Ws}\\)$`),zv={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};vm(fl,Wi,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Lv,formatHex:Lv,formatHex8:BA,formatHsl:IA,formatRgb:Bv,toString:Bv});function Lv(){return this.rgb().formatHex()}function BA(){return this.rgb().formatHex8()}function IA(){return YS(this).formatHsl()}function Bv(){return this.rgb().formatRgb()}function Wi(e){var t,r;return e=(e+"").trim().toLowerCase(),(t=AA.exec(e))?(r=t[1].length,t=parseInt(t[1],16),r===6?Iv(t):r===3?new tn(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):r===8?Xu(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):r===4?Xu(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=RA.exec(e))?new tn(t[1],t[2],t[3],1):(t=OA.exec(e))?new tn(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=jA.exec(e))?Xu(t[1],t[2],t[3],t[4]):(t=DA.exec(e))?Xu(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=zA.exec(e))?Uv(t[1],t[2]/100,t[3]/100,1):(t=LA.exec(e))?Uv(t[1],t[2]/100,t[3]/100,t[4]):zv.hasOwnProperty(e)?Iv(zv[e]):e==="transparent"?new tn(NaN,NaN,NaN,0):null}function Iv(e){return new tn(e>>16&255,e>>8&255,e&255,1)}function Xu(e,t,r,a){return a<=0&&(e=t=r=NaN),new tn(e,t,r,a)}function HA(e){return e instanceof fl||(e=Wi(e)),e?(e=e.rgb(),new tn(e.r,e.g,e.b,e.opacity)):new tn}function Mp(e,t,r,a){return arguments.length===1?HA(e):new tn(e,t,r,a??1)}function tn(e,t,r,a){this.r=+e,this.g=+t,this.b=+r,this.opacity=+a}vm(tn,Mp,FS(fl,{brighter(e){return e=e==null?Ec:Math.pow(Ec,e),new tn(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Js:Math.pow(Js,e),new tn(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new tn(Zi(this.r),Zi(this.g),Zi(this.b),Cc(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Hv,formatHex:Hv,formatHex8:PA,formatRgb:Pv,toString:Pv}));function Hv(){return`#${Yi(this.r)}${Yi(this.g)}${Yi(this.b)}`}function PA(){return`#${Yi(this.r)}${Yi(this.g)}${Yi(this.b)}${Yi((isNaN(this.opacity)?1:this.opacity)*255)}`}function Pv(){const e=Cc(this.opacity);return`${e===1?"rgb(":"rgba("}${Zi(this.r)}, ${Zi(this.g)}, ${Zi(this.b)}${e===1?")":`, ${e})`}`}function Cc(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Zi(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Yi(e){return e=Zi(e),(e<16?"0":"")+e.toString(16)}function Uv(e,t,r,a){return a<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new Bn(e,t,r,a)}function YS(e){if(e instanceof Bn)return new Bn(e.h,e.s,e.l,e.opacity);if(e instanceof fl||(e=Wi(e)),!e)return new Bn;if(e instanceof Bn)return e;e=e.rgb();var t=e.r/255,r=e.g/255,a=e.b/255,o=Math.min(t,r,a),l=Math.max(t,r,a),u=NaN,f=l-o,h=(l+o)/2;return f?(t===l?u=(r-a)/f+(r<a)*6:r===l?u=(a-t)/f+2:u=(t-r)/f+4,f/=h<.5?l+o:2-l-o,u*=60):f=h>0&&h<1?0:u,new Bn(u,f,h,e.opacity)}function UA(e,t,r,a){return arguments.length===1?YS(e):new Bn(e,t,r,a??1)}function Bn(e,t,r,a){this.h=+e,this.s=+t,this.l=+r,this.opacity=+a}vm(Bn,UA,FS(fl,{brighter(e){return e=e==null?Ec:Math.pow(Ec,e),new Bn(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Js:Math.pow(Js,e),new Bn(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,r=this.l,a=r+(r<.5?r:1-r)*t,o=2*r-a;return new tn(Ph(e>=240?e-240:e+120,o,a),Ph(e,o,a),Ph(e<120?e+240:e-120,o,a),this.opacity)},clamp(){return new Bn(qv(this.h),Gu(this.s),Gu(this.l),Cc(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=Cc(this.opacity);return`${e===1?"hsl(":"hsla("}${qv(this.h)}, ${Gu(this.s)*100}%, ${Gu(this.l)*100}%${e===1?")":`, ${e})`}`}}));function qv(e){return e=(e||0)%360,e<0?e+360:e}function Gu(e){return Math.max(0,Math.min(1,e||0))}function Ph(e,t,r){return(e<60?t+(r-t)*e/60:e<180?r:e<240?t+(r-t)*(240-e)/60:t)*255}const bm=e=>()=>e;function qA(e,t){return function(r){return e+r*t}}function VA(e,t,r){return e=Math.pow(e,r),t=Math.pow(t,r)-e,r=1/r,function(a){return Math.pow(e+a*t,r)}}function FA(e){return(e=+e)==1?XS:function(t,r){return r-t?VA(t,r,e):bm(isNaN(t)?r:t)}}function XS(e,t){var r=t-e;return r?qA(e,r):bm(isNaN(e)?t:e)}const _c=(function e(t){var r=FA(t);function a(o,l){var u=r((o=Mp(o)).r,(l=Mp(l)).r),f=r(o.g,l.g),h=r(o.b,l.b),d=XS(o.opacity,l.opacity);return function(m){return o.r=u(m),o.g=f(m),o.b=h(m),o.opacity=d(m),o+""}}return a.gamma=e,a})(1);function YA(e,t){t||(t=[]);var r=e?Math.min(t.length,e.length):0,a=t.slice(),o;return function(l){for(o=0;o<r;++o)a[o]=e[o]*(1-l)+t[o]*l;return a}}function XA(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function GA(e,t){var r=t?t.length:0,a=e?Math.min(r,e.length):0,o=new Array(a),l=new Array(r),u;for(u=0;u<a;++u)o[u]=zs(e[u],t[u]);for(;u<r;++u)l[u]=t[u];return function(f){for(u=0;u<a;++u)l[u]=o[u](f);return l}}function $A(e,t){var r=new Date;return e=+e,t=+t,function(a){return r.setTime(e*(1-a)+t*a),r}}function Zn(e,t){return e=+e,t=+t,function(r){return e*(1-r)+t*r}}function QA(e,t){var r={},a={},o;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(o in t)o in e?r[o]=zs(e[o],t[o]):a[o]=t[o];return function(l){for(o in r)a[o]=r[o](l);return a}}var kp=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Uh=new RegExp(kp.source,"g");function ZA(e){return function(){return e}}function KA(e){return function(t){return e(t)+""}}function GS(e,t){var r=kp.lastIndex=Uh.lastIndex=0,a,o,l,u=-1,f=[],h=[];for(e=e+"",t=t+"";(a=kp.exec(e))&&(o=Uh.exec(t));)(l=o.index)>r&&(l=t.slice(r,l),f[u]?f[u]+=l:f[++u]=l),(a=a[0])===(o=o[0])?f[u]?f[u]+=o:f[++u]=o:(f[++u]=null,h.push({i:u,x:Zn(a,o)})),r=Uh.lastIndex;return r<t.length&&(l=t.slice(r),f[u]?f[u]+=l:f[++u]=l),f.length<2?h[0]?KA(h[0].x):ZA(t):(t=h.length,function(d){for(var m=0,g;m<t;++m)f[(g=h[m]).i]=g.x(d);return f.join("")})}function zs(e,t){var r=typeof t,a;return t==null||r==="boolean"?bm(t):(r==="number"?Zn:r==="string"?(a=Wi(t))?(t=a,_c):GS:t instanceof Wi?_c:t instanceof Date?$A:XA(t)?YA:Array.isArray(t)?GA:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?QA:Zn)(e,t)}var Vv=180/Math.PI,Tp={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function $S(e,t,r,a,o,l){var u,f,h;return(u=Math.sqrt(e*e+t*t))&&(e/=u,t/=u),(h=e*r+t*a)&&(r-=e*h,a-=t*h),(f=Math.sqrt(r*r+a*a))&&(r/=f,a/=f,h/=f),e*a<t*r&&(e=-e,t=-t,h=-h,u=-u),{translateX:o,translateY:l,rotate:Math.atan2(t,e)*Vv,skewX:Math.atan(h)*Vv,scaleX:u,scaleY:f}}var $u;function JA(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?Tp:$S(t.a,t.b,t.c,t.d,t.e,t.f)}function WA(e){return e==null||($u||($u=document.createElementNS("http://www.w3.org/2000/svg","g")),$u.setAttribute("transform",e),!(e=$u.transform.baseVal.consolidate()))?Tp:(e=e.matrix,$S(e.a,e.b,e.c,e.d,e.e,e.f))}function QS(e,t,r,a){function o(d){return d.length?d.pop()+" ":""}function l(d,m,g,y,v,S){if(d!==g||m!==y){var C=v.push("translate(",null,t,null,r);S.push({i:C-4,x:Zn(d,g)},{i:C-2,x:Zn(m,y)})}else(g||y)&&v.push("translate("+g+t+y+r)}function u(d,m,g,y){d!==m?(d-m>180?m+=360:m-d>180&&(d+=360),y.push({i:g.push(o(g)+"rotate(",null,a)-2,x:Zn(d,m)})):m&&g.push(o(g)+"rotate("+m+a)}function f(d,m,g,y){d!==m?y.push({i:g.push(o(g)+"skewX(",null,a)-2,x:Zn(d,m)}):m&&g.push(o(g)+"skewX("+m+a)}function h(d,m,g,y,v,S){if(d!==g||m!==y){var C=v.push(o(v)+"scale(",null,",",null,")");S.push({i:C-4,x:Zn(d,g)},{i:C-2,x:Zn(m,y)})}else(g!==1||y!==1)&&v.push(o(v)+"scale("+g+","+y+")")}return function(d,m){var g=[],y=[];return d=e(d),m=e(m),l(d.translateX,d.translateY,m.translateX,m.translateY,g,y),u(d.rotate,m.rotate,g,y),f(d.skewX,m.skewX,g,y),h(d.scaleX,d.scaleY,m.scaleX,m.scaleY,g,y),d=m=null,function(v){for(var S=-1,C=y.length,N;++S<C;)g[(N=y[S]).i]=N.x(v);return g.join("")}}}var eR=QS(JA,"px, ","px)","deg)"),tR=QS(WA,", ",")",")"),nR=1e-12;function Fv(e){return((e=Math.exp(e))+1/e)/2}function rR(e){return((e=Math.exp(e))-1/e)/2}function iR(e){return((e=Math.exp(2*e))-1)/(e+1)}const cc=(function e(t,r,a){function o(l,u){var f=l[0],h=l[1],d=l[2],m=u[0],g=u[1],y=u[2],v=m-f,S=g-h,C=v*v+S*S,N,w;if(C<nR)w=Math.log(y/d)/t,N=function(D){return[f+D*v,h+D*S,d*Math.exp(t*D*w)]};else{var O=Math.sqrt(C),_=(y*y-d*d+a*C)/(2*d*r*O),M=(y*y-d*d-a*C)/(2*y*r*O),I=Math.log(Math.sqrt(_*_+1)-_),k=Math.log(Math.sqrt(M*M+1)-M);w=(k-I)/t,N=function(D){var U=D*w,H=Fv(I),q=d/(r*O)*(H*iR(t*U+I)-rR(I));return[f+q*v,h+q*S,d*H/Fv(t*U+I)]}}return N.duration=w*1e3*t/Math.SQRT2,N}return o.rho=function(l){var u=Math.max(.001,+l),f=u*u,h=f*f;return e(u,f,h)},o})(Math.SQRT2,2,4);var po=0,js=0,_s=0,ZS=1e3,Nc,Ds,Mc=0,ea=0,Yc=0,el=typeof performance=="object"&&performance.now?performance:Date,KS=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Sm(){return ea||(KS(aR),ea=el.now()+Yc)}function aR(){ea=0}function kc(){this._call=this._time=this._next=null}kc.prototype=JS.prototype={constructor:kc,restart:function(e,t,r){if(typeof e!="function")throw new TypeError("callback is not a function");r=(r==null?Sm():+r)+(t==null?0:+t),!this._next&&Ds!==this&&(Ds?Ds._next=this:Nc=this,Ds=this),this._call=e,this._time=r,Ap()},stop:function(){this._call&&(this._call=null,this._time=1/0,Ap())}};function JS(e,t,r){var a=new kc;return a.restart(e,t,r),a}function oR(){Sm(),++po;for(var e=Nc,t;e;)(t=ea-e._time)>=0&&e._call.call(void 0,t),e=e._next;--po}function Yv(){ea=(Mc=el.now())+Yc,po=js=0;try{oR()}finally{po=0,lR(),ea=0}}function sR(){var e=el.now(),t=e-Mc;t>ZS&&(Yc-=t,Mc=e)}function lR(){for(var e,t=Nc,r,a=1/0;t;)t._call?(a>t._time&&(a=t._time),e=t,t=t._next):(r=t._next,t._next=null,t=e?e._next=r:Nc=r);Ds=e,Ap(a)}function Ap(e){if(!po){js&&(js=clearTimeout(js));var t=e-ea;t>24?(e<1/0&&(js=setTimeout(Yv,e-el.now()-Yc)),_s&&(_s=clearInterval(_s))):(_s||(Mc=el.now(),_s=setInterval(sR,ZS)),po=1,KS(Yv))}}function Xv(e,t,r){var a=new kc;return t=t==null?0:+t,a.restart(o=>{a.stop(),e(o+t)},t,r),a}var uR=Vc("start","end","cancel","interrupt"),cR=[],WS=0,Gv=1,Rp=2,fc=3,$v=4,Op=5,dc=6;function Xc(e,t,r,a,o,l){var u=e.__transition;if(!u)e.__transition={};else if(r in u)return;fR(e,r,{name:t,index:a,group:o,on:uR,tween:cR,time:l.time,delay:l.delay,duration:l.duration,ease:l.ease,timer:null,state:WS})}function wm(e,t){var r=Pn(e,t);if(r.state>WS)throw new Error("too late; already scheduled");return r}function tr(e,t){var r=Pn(e,t);if(r.state>fc)throw new Error("too late; already running");return r}function Pn(e,t){var r=e.__transition;if(!r||!(r=r[t]))throw new Error("transition not found");return r}function fR(e,t,r){var a=e.__transition,o;a[t]=r,r.timer=JS(l,0,r.time);function l(d){r.state=Gv,r.timer.restart(u,r.delay,r.time),r.delay<=d&&u(d-r.delay)}function u(d){var m,g,y,v;if(r.state!==Gv)return h();for(m in a)if(v=a[m],v.name===r.name){if(v.state===fc)return Xv(u);v.state===$v?(v.state=dc,v.timer.stop(),v.on.call("interrupt",e,e.__data__,v.index,v.group),delete a[m]):+m<t&&(v.state=dc,v.timer.stop(),v.on.call("cancel",e,e.__data__,v.index,v.group),delete a[m])}if(Xv(function(){r.state===fc&&(r.state=$v,r.timer.restart(f,r.delay,r.time),f(d))}),r.state=Rp,r.on.call("start",e,e.__data__,r.index,r.group),r.state===Rp){for(r.state=fc,o=new Array(y=r.tween.length),m=0,g=-1;m<y;++m)(v=r.tween[m].value.call(e,e.__data__,r.index,r.group))&&(o[++g]=v);o.length=g+1}}function f(d){for(var m=d<r.duration?r.ease.call(null,d/r.duration):(r.timer.restart(h),r.state=Op,1),g=-1,y=o.length;++g<y;)o[g].call(e,m);r.state===Op&&(r.on.call("end",e,e.__data__,r.index,r.group),h())}function h(){r.state=dc,r.timer.stop(),delete a[t];for(var d in a)return;delete e.__transition}}function hc(e,t){var r=e.__transition,a,o,l=!0,u;if(r){t=t==null?null:t+"";for(u in r){if((a=r[u]).name!==t){l=!1;continue}o=a.state>Rp&&a.state<Op,a.state=dc,a.timer.stop(),a.on.call(o?"interrupt":"cancel",e,e.__data__,a.index,a.group),delete r[u]}l&&delete e.__transition}}function dR(e){return this.each(function(){hc(this,e)})}function hR(e,t){var r,a;return function(){var o=tr(this,e),l=o.tween;if(l!==r){a=r=l;for(var u=0,f=a.length;u<f;++u)if(a[u].name===t){a=a.slice(),a.splice(u,1);break}}o.tween=a}}function pR(e,t,r){var a,o;if(typeof r!="function")throw new Error;return function(){var l=tr(this,e),u=l.tween;if(u!==a){o=(a=u).slice();for(var f={name:t,value:r},h=0,d=o.length;h<d;++h)if(o[h].name===t){o[h]=f;break}h===d&&o.push(f)}l.tween=o}}function mR(e,t){var r=this._id;if(e+="",arguments.length<2){for(var a=Pn(this.node(),r).tween,o=0,l=a.length,u;o<l;++o)if((u=a[o]).name===e)return u.value;return null}return this.each((t==null?hR:pR)(r,e,t))}function Em(e,t,r){var a=e._id;return e.each(function(){var o=tr(this,a);(o.value||(o.value={}))[t]=r.apply(this,arguments)}),function(o){return Pn(o,a).value[t]}}function ew(e,t){var r;return(typeof t=="number"?Zn:t instanceof Wi?_c:(r=Wi(t))?(t=r,_c):GS)(e,t)}function gR(e){return function(){this.removeAttribute(e)}}function yR(e){return function(){this.removeAttributeNS(e.space,e.local)}}function xR(e,t,r){var a,o=r+"",l;return function(){var u=this.getAttribute(e);return u===o?null:u===a?l:l=t(a=u,r)}}function vR(e,t,r){var a,o=r+"",l;return function(){var u=this.getAttributeNS(e.space,e.local);return u===o?null:u===a?l:l=t(a=u,r)}}function bR(e,t,r){var a,o,l;return function(){var u,f=r(this),h;return f==null?void this.removeAttribute(e):(u=this.getAttribute(e),h=f+"",u===h?null:u===a&&h===o?l:(o=h,l=t(a=u,f)))}}function SR(e,t,r){var a,o,l;return function(){var u,f=r(this),h;return f==null?void this.removeAttributeNS(e.space,e.local):(u=this.getAttributeNS(e.space,e.local),h=f+"",u===h?null:u===a&&h===o?l:(o=h,l=t(a=u,f)))}}function wR(e,t){var r=Fc(e),a=r==="transform"?tR:ew;return this.attrTween(e,typeof t=="function"?(r.local?SR:bR)(r,a,Em(this,"attr."+e,t)):t==null?(r.local?yR:gR)(r):(r.local?vR:xR)(r,a,t))}function ER(e,t){return function(r){this.setAttribute(e,t.call(this,r))}}function CR(e,t){return function(r){this.setAttributeNS(e.space,e.local,t.call(this,r))}}function _R(e,t){var r,a;function o(){var l=t.apply(this,arguments);return l!==a&&(r=(a=l)&&CR(e,l)),r}return o._value=t,o}function NR(e,t){var r,a;function o(){var l=t.apply(this,arguments);return l!==a&&(r=(a=l)&&ER(e,l)),r}return o._value=t,o}function MR(e,t){var r="attr."+e;if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!="function")throw new Error;var a=Fc(e);return this.tween(r,(a.local?_R:NR)(a,t))}function kR(e,t){return function(){wm(this,e).delay=+t.apply(this,arguments)}}function TR(e,t){return t=+t,function(){wm(this,e).delay=t}}function AR(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?kR:TR)(t,e)):Pn(this.node(),t).delay}function RR(e,t){return function(){tr(this,e).duration=+t.apply(this,arguments)}}function OR(e,t){return t=+t,function(){tr(this,e).duration=t}}function jR(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?RR:OR)(t,e)):Pn(this.node(),t).duration}function DR(e,t){if(typeof t!="function")throw new Error;return function(){tr(this,e).ease=t}}function zR(e){var t=this._id;return arguments.length?this.each(DR(t,e)):Pn(this.node(),t).ease}function LR(e,t){return function(){var r=t.apply(this,arguments);if(typeof r!="function")throw new Error;tr(this,e).ease=r}}function BR(e){if(typeof e!="function")throw new Error;return this.each(LR(this._id,e))}function IR(e){typeof e!="function"&&(e=RS(e));for(var t=this._groups,r=t.length,a=new Array(r),o=0;o<r;++o)for(var l=t[o],u=l.length,f=a[o]=[],h,d=0;d<u;++d)(h=l[d])&&e.call(h,h.__data__,d,l)&&f.push(h);return new kr(a,this._parents,this._name,this._id)}function HR(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,r=e._groups,a=t.length,o=r.length,l=Math.min(a,o),u=new Array(a),f=0;f<l;++f)for(var h=t[f],d=r[f],m=h.length,g=u[f]=new Array(m),y,v=0;v<m;++v)(y=h[v]||d[v])&&(g[v]=y);for(;f<a;++f)u[f]=t[f];return new kr(u,this._parents,this._name,this._id)}function PR(e){return(e+"").trim().split(/^|\s+/).every(function(t){var r=t.indexOf(".");return r>=0&&(t=t.slice(0,r)),!t||t==="start"})}function UR(e,t,r){var a,o,l=PR(t)?wm:tr;return function(){var u=l(this,e),f=u.on;f!==a&&(o=(a=f).copy()).on(t,r),u.on=o}}function qR(e,t){var r=this._id;return arguments.length<2?Pn(this.node(),r).on.on(e):this.each(UR(r,e,t))}function VR(e){return function(){var t=this.parentNode;for(var r in this.__transition)if(+r!==e)return;t&&t.removeChild(this)}}function FR(){return this.on("end.remove",VR(this._id))}function YR(e){var t=this._name,r=this._id;typeof e!="function"&&(e=ym(e));for(var a=this._groups,o=a.length,l=new Array(o),u=0;u<o;++u)for(var f=a[u],h=f.length,d=l[u]=new Array(h),m,g,y=0;y<h;++y)(m=f[y])&&(g=e.call(m,m.__data__,y,f))&&("__data__"in m&&(g.__data__=m.__data__),d[y]=g,Xc(d[y],t,r,y,d,Pn(m,r)));return new kr(l,this._parents,t,r)}function XR(e){var t=this._name,r=this._id;typeof e!="function"&&(e=AS(e));for(var a=this._groups,o=a.length,l=[],u=[],f=0;f<o;++f)for(var h=a[f],d=h.length,m,g=0;g<d;++g)if(m=h[g]){for(var y=e.call(m,m.__data__,g,h),v,S=Pn(m,r),C=0,N=y.length;C<N;++C)(v=y[C])&&Xc(v,t,r,C,y,S);l.push(y),u.push(m)}return new kr(l,u,t,r)}var GR=cl.prototype.constructor;function $R(){return new GR(this._groups,this._parents)}function QR(e,t){var r,a,o;return function(){var l=ho(this,e),u=(this.style.removeProperty(e),ho(this,e));return l===u?null:l===r&&u===a?o:o=t(r=l,a=u)}}function tw(e){return function(){this.style.removeProperty(e)}}function ZR(e,t,r){var a,o=r+"",l;return function(){var u=ho(this,e);return u===o?null:u===a?l:l=t(a=u,r)}}function KR(e,t,r){var a,o,l;return function(){var u=ho(this,e),f=r(this),h=f+"";return f==null&&(h=f=(this.style.removeProperty(e),ho(this,e))),u===h?null:u===a&&h===o?l:(o=h,l=t(a=u,f))}}function JR(e,t){var r,a,o,l="style."+t,u="end."+l,f;return function(){var h=tr(this,e),d=h.on,m=h.value[l]==null?f||(f=tw(t)):void 0;(d!==r||o!==m)&&(a=(r=d).copy()).on(u,o=m),h.on=a}}function WR(e,t,r){var a=(e+="")=="transform"?eR:ew;return t==null?this.styleTween(e,QR(e,a)).on("end.style."+e,tw(e)):typeof t=="function"?this.styleTween(e,KR(e,a,Em(this,"style."+e,t))).each(JR(this._id,e)):this.styleTween(e,ZR(e,a,t),r).on("end.style."+e,null)}function e3(e,t,r){return function(a){this.style.setProperty(e,t.call(this,a),r)}}function t3(e,t,r){var a,o;function l(){var u=t.apply(this,arguments);return u!==o&&(a=(o=u)&&e3(e,u,r)),a}return l._value=t,l}function n3(e,t,r){var a="style."+(e+="");if(arguments.length<2)return(a=this.tween(a))&&a._value;if(t==null)return this.tween(a,null);if(typeof t!="function")throw new Error;return this.tween(a,t3(e,t,r??""))}function r3(e){return function(){this.textContent=e}}function i3(e){return function(){var t=e(this);this.textContent=t??""}}function a3(e){return this.tween("text",typeof e=="function"?i3(Em(this,"text",e)):r3(e==null?"":e+""))}function o3(e){return function(t){this.textContent=e.call(this,t)}}function s3(e){var t,r;function a(){var o=e.apply(this,arguments);return o!==r&&(t=(r=o)&&o3(o)),t}return a._value=e,a}function l3(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!="function")throw new Error;return this.tween(t,s3(e))}function u3(){for(var e=this._name,t=this._id,r=nw(),a=this._groups,o=a.length,l=0;l<o;++l)for(var u=a[l],f=u.length,h,d=0;d<f;++d)if(h=u[d]){var m=Pn(h,t);Xc(h,e,r,d,u,{time:m.time+m.delay+m.duration,delay:0,duration:m.duration,ease:m.ease})}return new kr(a,this._parents,e,r)}function c3(){var e,t,r=this,a=r._id,o=r.size();return new Promise(function(l,u){var f={value:u},h={value:function(){--o===0&&l()}};r.each(function(){var d=tr(this,a),m=d.on;m!==e&&(t=(e=m).copy(),t._.cancel.push(f),t._.interrupt.push(f),t._.end.push(h)),d.on=t}),o===0&&l()})}var f3=0;function kr(e,t,r,a){this._groups=e,this._parents=t,this._name=r,this._id=a}function nw(){return++f3}var Er=cl.prototype;kr.prototype={constructor:kr,select:YR,selectAll:XR,selectChild:Er.selectChild,selectChildren:Er.selectChildren,filter:IR,merge:HR,selection:$R,transition:u3,call:Er.call,nodes:Er.nodes,node:Er.node,size:Er.size,empty:Er.empty,each:Er.each,on:qR,attr:wR,attrTween:MR,style:WR,styleTween:n3,text:a3,textTween:l3,remove:FR,tween:mR,delay:AR,duration:jR,ease:zR,easeVarying:BR,end:c3,[Symbol.iterator]:Er[Symbol.iterator]};function d3(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var h3={time:null,delay:0,duration:250,ease:d3};function p3(e,t){for(var r;!(r=e.__transition)||!(r=r[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return r}function m3(e){var t,r;e instanceof kr?(t=e._id,e=e._name):(t=nw(),(r=h3).time=Sm(),e=e==null?null:e+"");for(var a=this._groups,o=a.length,l=0;l<o;++l)for(var u=a[l],f=u.length,h,d=0;d<f;++d)(h=u[d])&&Xc(h,e,t,d,u,r||p3(h,t));return new kr(a,this._parents,e,t)}cl.prototype.interrupt=dR;cl.prototype.transition=m3;const Qu=e=>()=>e;function g3(e,{sourceEvent:t,target:r,transform:a,dispatch:o}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},transform:{value:a,enumerable:!0,configurable:!0},_:{value:o}})}function Nr(e,t,r){this.k=e,this.x=t,this.y=r}Nr.prototype={constructor:Nr,scale:function(e){return e===1?this:new Nr(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Nr(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var Gc=new Nr(1,0,0);rw.prototype=Nr.prototype;function rw(e){for(;!e.__zoom;)if(!(e=e.parentNode))return Gc;return e.__zoom}function qh(e){e.stopImmediatePropagation()}function Ns(e){e.preventDefault(),e.stopImmediatePropagation()}function y3(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function x3(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function Qv(){return this.__zoom||Gc}function v3(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function b3(){return navigator.maxTouchPoints||"ontouchstart"in this}function S3(e,t,r){var a=e.invertX(t[0][0])-r[0][0],o=e.invertX(t[1][0])-r[1][0],l=e.invertY(t[0][1])-r[0][1],u=e.invertY(t[1][1])-r[1][1];return e.translate(o>a?(a+o)/2:Math.min(0,a)||Math.max(0,o),u>l?(l+u)/2:Math.min(0,l)||Math.max(0,u))}function iw(){var e=y3,t=x3,r=S3,a=v3,o=b3,l=[0,1/0],u=[[-1/0,-1/0],[1/0,1/0]],f=250,h=cc,d=Vc("start","zoom","end"),m,g,y,v=500,S=150,C=0,N=10;function w(B){B.property("__zoom",Qv).on("wheel.zoom",U,{passive:!1}).on("mousedown.zoom",H).on("dblclick.zoom",q).filter(o).on("touchstart.zoom",L).on("touchmove.zoom",P).on("touchend.zoom touchcancel.zoom",K).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}w.transform=function(B,V,j,F){var $=B.selection?B.selection():B;$.property("__zoom",Qv),B!==$?I(B,V,j,F):$.interrupt().each(function(){k(this,arguments).event(F).start().zoom(null,typeof V=="function"?V.apply(this,arguments):V).end()})},w.scaleBy=function(B,V,j,F){w.scaleTo(B,function(){var $=this.__zoom.k,Z=typeof V=="function"?V.apply(this,arguments):V;return $*Z},j,F)},w.scaleTo=function(B,V,j,F){w.transform(B,function(){var $=t.apply(this,arguments),Z=this.__zoom,A=j==null?M($):typeof j=="function"?j.apply(this,arguments):j,z=Z.invert(A),X=typeof V=="function"?V.apply(this,arguments):V;return r(_(O(Z,X),A,z),$,u)},j,F)},w.translateBy=function(B,V,j,F){w.transform(B,function(){return r(this.__zoom.translate(typeof V=="function"?V.apply(this,arguments):V,typeof j=="function"?j.apply(this,arguments):j),t.apply(this,arguments),u)},null,F)},w.translateTo=function(B,V,j,F,$){w.transform(B,function(){var Z=t.apply(this,arguments),A=this.__zoom,z=F==null?M(Z):typeof F=="function"?F.apply(this,arguments):F;return r(Gc.translate(z[0],z[1]).scale(A.k).translate(typeof V=="function"?-V.apply(this,arguments):-V,typeof j=="function"?-j.apply(this,arguments):-j),Z,u)},F,$)};function O(B,V){return V=Math.max(l[0],Math.min(l[1],V)),V===B.k?B:new Nr(V,B.x,B.y)}function _(B,V,j){var F=V[0]-j[0]*B.k,$=V[1]-j[1]*B.k;return F===B.x&&$===B.y?B:new Nr(B.k,F,$)}function M(B){return[(+B[0][0]+ +B[1][0])/2,(+B[0][1]+ +B[1][1])/2]}function I(B,V,j,F){B.on("start.zoom",function(){k(this,arguments).event(F).start()}).on("interrupt.zoom end.zoom",function(){k(this,arguments).event(F).end()}).tween("zoom",function(){var $=this,Z=arguments,A=k($,Z).event(F),z=t.apply($,Z),X=j==null?M(z):typeof j=="function"?j.apply($,Z):j,R=Math.max(z[1][0]-z[0][0],z[1][1]-z[0][1]),te=$.__zoom,ue=typeof V=="function"?V.apply($,Z):V,ce=h(te.invert(X).concat(R/te.k),ue.invert(X).concat(R/ue.k));return function(fe){if(fe===1)fe=ue;else{var le=ce(fe),pe=R/le[2];fe=new Nr(pe,X[0]-le[0]*pe,X[1]-le[1]*pe)}A.zoom(null,fe)}})}function k(B,V,j){return!j&&B.__zooming||new D(B,V)}function D(B,V){this.that=B,this.args=V,this.active=0,this.sourceEvent=null,this.extent=t.apply(B,V),this.taps=0}D.prototype={event:function(B){return B&&(this.sourceEvent=B),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(B,V){return this.mouse&&B!=="mouse"&&(this.mouse[1]=V.invert(this.mouse[0])),this.touch0&&B!=="touch"&&(this.touch0[1]=V.invert(this.touch0[0])),this.touch1&&B!=="touch"&&(this.touch1[1]=V.invert(this.touch1[0])),this.that.__zoom=V,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(B){var V=mn(this.that).datum();d.call(B,this.that,new g3(B,{sourceEvent:this.sourceEvent,target:w,transform:this.that.__zoom,dispatch:d}),V)}};function U(B,...V){if(!e.apply(this,arguments))return;var j=k(this,V).event(B),F=this.__zoom,$=Math.max(l[0],Math.min(l[1],F.k*Math.pow(2,a.apply(this,arguments)))),Z=Ln(B);if(j.wheel)(j.mouse[0][0]!==Z[0]||j.mouse[0][1]!==Z[1])&&(j.mouse[1]=F.invert(j.mouse[0]=Z)),clearTimeout(j.wheel);else{if(F.k===$)return;j.mouse=[Z,F.invert(Z)],hc(this),j.start()}Ns(B),j.wheel=setTimeout(A,S),j.zoom("mouse",r(_(O(F,$),j.mouse[0],j.mouse[1]),j.extent,u));function A(){j.wheel=null,j.end()}}function H(B,...V){if(y||!e.apply(this,arguments))return;var j=B.currentTarget,F=k(this,V,!0).event(B),$=mn(B.view).on("mousemove.zoom",X,!0).on("mouseup.zoom",R,!0),Z=Ln(B,j),A=B.clientX,z=B.clientY;US(B.view),qh(B),F.mouse=[Z,this.__zoom.invert(Z)],hc(this),F.start();function X(te){if(Ns(te),!F.moved){var ue=te.clientX-A,ce=te.clientY-z;F.moved=ue*ue+ce*ce>C}F.event(te).zoom("mouse",r(_(F.that.__zoom,F.mouse[0]=Ln(te,j),F.mouse[1]),F.extent,u))}function R(te){$.on("mousemove.zoom mouseup.zoom",null),qS(te.view,F.moved),Ns(te),F.event(te).end()}}function q(B,...V){if(e.apply(this,arguments)){var j=this.__zoom,F=Ln(B.changedTouches?B.changedTouches[0]:B,this),$=j.invert(F),Z=j.k*(B.shiftKey?.5:2),A=r(_(O(j,Z),F,$),t.apply(this,V),u);Ns(B),f>0?mn(this).transition().duration(f).call(I,A,F,B):mn(this).call(w.transform,A,F,B)}}function L(B,...V){if(e.apply(this,arguments)){var j=B.touches,F=j.length,$=k(this,V,B.changedTouches.length===F).event(B),Z,A,z,X;for(qh(B),A=0;A<F;++A)z=j[A],X=Ln(z,this),X=[X,this.__zoom.invert(X),z.identifier],$.touch0?!$.touch1&&$.touch0[2]!==X[2]&&($.touch1=X,$.taps=0):($.touch0=X,Z=!0,$.taps=1+!!m);m&&(m=clearTimeout(m)),Z&&($.taps<2&&(g=X[0],m=setTimeout(function(){m=null},v)),hc(this),$.start())}}function P(B,...V){if(this.__zooming){var j=k(this,V).event(B),F=B.changedTouches,$=F.length,Z,A,z,X;for(Ns(B),Z=0;Z<$;++Z)A=F[Z],z=Ln(A,this),j.touch0&&j.touch0[2]===A.identifier?j.touch0[0]=z:j.touch1&&j.touch1[2]===A.identifier&&(j.touch1[0]=z);if(A=j.that.__zoom,j.touch1){var R=j.touch0[0],te=j.touch0[1],ue=j.touch1[0],ce=j.touch1[1],fe=(fe=ue[0]-R[0])*fe+(fe=ue[1]-R[1])*fe,le=(le=ce[0]-te[0])*le+(le=ce[1]-te[1])*le;A=O(A,Math.sqrt(fe/le)),z=[(R[0]+ue[0])/2,(R[1]+ue[1])/2],X=[(te[0]+ce[0])/2,(te[1]+ce[1])/2]}else if(j.touch0)z=j.touch0[0],X=j.touch0[1];else return;j.zoom("touch",r(_(A,z,X),j.extent,u))}}function K(B,...V){if(this.__zooming){var j=k(this,V).event(B),F=B.changedTouches,$=F.length,Z,A;for(qh(B),y&&clearTimeout(y),y=setTimeout(function(){y=null},v),Z=0;Z<$;++Z)A=F[Z],j.touch0&&j.touch0[2]===A.identifier?delete j.touch0:j.touch1&&j.touch1[2]===A.identifier&&delete j.touch1;if(j.touch1&&!j.touch0&&(j.touch0=j.touch1,delete j.touch1),j.touch0)j.touch0[1]=this.__zoom.invert(j.touch0[0]);else if(j.end(),j.taps===2&&(A=Ln(A,this),Math.hypot(g[0]-A[0],g[1]-A[1])<N)){var z=mn(this).on("dblclick.zoom");z&&z.apply(this,arguments)}}}return w.wheelDelta=function(B){return arguments.length?(a=typeof B=="function"?B:Qu(+B),w):a},w.filter=function(B){return arguments.length?(e=typeof B=="function"?B:Qu(!!B),w):e},w.touchable=function(B){return arguments.length?(o=typeof B=="function"?B:Qu(!!B),w):o},w.extent=function(B){return arguments.length?(t=typeof B=="function"?B:Qu([[+B[0][0],+B[0][1]],[+B[1][0],+B[1][1]]]),w):t},w.scaleExtent=function(B){return arguments.length?(l[0]=+B[0],l[1]=+B[1],w):[l[0],l[1]]},w.translateExtent=function(B){return arguments.length?(u[0][0]=+B[0][0],u[1][0]=+B[1][0],u[0][1]=+B[0][1],u[1][1]=+B[1][1],w):[[u[0][0],u[0][1]],[u[1][0],u[1][1]]]},w.constrain=function(B){return arguments.length?(r=B,w):r},w.duration=function(B){return arguments.length?(f=+B,w):f},w.interpolate=function(B){return arguments.length?(h=B,w):h},w.on=function(){var B=d.on.apply(d,arguments);return B===d?w:B},w.clickDistance=function(B){return arguments.length?(C=(B=+B)*B,w):Math.sqrt(C)},w.tapDistance=function(B){return arguments.length?(N=+B,w):N},w}const Wn={error001:()=>"[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001",error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>"The React Flow parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,{id:t,sourceHandle:r,targetHandle:a})=>`Couldn't create edge for ${e} handle id: "${e==="source"?r:a}", edge id: ${t}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(e="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${e}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.",error015:()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs."},tl=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],aw=["Enter"," ","Escape"],ow={"node.a11yDescription.default":"Press enter or space to select a node. Press delete to remove it and escape to cancel.","node.a11yDescription.keyboardDisabled":"Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.","node.a11yDescription.ariaLiveMessage":({direction:e,x:t,y:r})=>`Moved selected node ${e}. New position, x: ${t}, y: ${r}`,"edge.a11yDescription.default":"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.","controls.ariaLabel":"Control Panel","controls.zoomIn.ariaLabel":"Zoom In","controls.zoomOut.ariaLabel":"Zoom Out","controls.fitView.ariaLabel":"Fit View","controls.interactive.ariaLabel":"Toggle Interactivity","minimap.ariaLabel":"Mini Map","handle.ariaLabel":"Handle"};var mo;(function(e){e.Strict="strict",e.Loose="loose"})(mo||(mo={}));var Ki;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(Ki||(Ki={}));var nl;(function(e){e.Partial="partial",e.Full="full"})(nl||(nl={}));const sw={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var li;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(li||(li={}));var Tc;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(Tc||(Tc={}));var ve;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(ve||(ve={}));const Zv={[ve.Left]:ve.Right,[ve.Right]:ve.Left,[ve.Top]:ve.Bottom,[ve.Bottom]:ve.Top};function lw(e){return e===null?null:e?"valid":"invalid"}const uw=e=>"id"in e&&"source"in e&&"target"in e,w3=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),Cm=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),dl=(e,t=[0,0])=>{const{width:r,height:a}=Tr(e),o=e.origin??t,l=r*o[0],u=a*o[1];return{x:e.position.x-l,y:e.position.y-u}},E3=(e,t={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const r=e.reduce((a,o)=>{const l=typeof o=="string";let u=!t.nodeLookup&&!l?o:void 0;t.nodeLookup&&(u=l?t.nodeLookup.get(o):Cm(o)?o:t.nodeLookup.get(o.id));const f=u?Ac(u,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return $c(a,f)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return Qc(r)},hl=(e,t={})=>{let r={x:1/0,y:1/0,x2:-1/0,y2:-1/0},a=!1;return e.forEach(o=>{(t.filter===void 0||t.filter(o))&&(r=$c(r,Ac(o)),a=!0)}),a?Qc(r):{x:0,y:0,width:0,height:0}},_m=(e,t,[r,a,o]=[0,0,1],l=!1,u=!1)=>{const f={...ml(t,[r,a,o]),width:t.width/o,height:t.height/o},h=[];for(const d of e.values()){const{measured:m,selectable:g=!0,hidden:y=!1}=d;if(u&&!g||y)continue;const v=m.width??d.width??d.initialWidth??null,S=m.height??d.height??d.initialHeight??null,C=rl(f,yo(d)),N=(v??0)*(S??0),w=l&&C>0;(!d.internals.handleBounds||w||C>=N||d.dragging)&&h.push(d)}return h},C3=(e,t)=>{const r=new Set;return e.forEach(a=>{r.add(a.id)}),t.filter(a=>r.has(a.source)||r.has(a.target))};function _3(e,t){const r=new Map,a=t?.nodes?new Set(t.nodes.map(o=>o.id)):null;return e.forEach(o=>{o.measured.width&&o.measured.height&&(t?.includeHiddenNodes||!o.hidden)&&(!a||a.has(o.id))&&r.set(o.id,o)}),r}async function N3({nodes:e,width:t,height:r,panZoom:a,minZoom:o,maxZoom:l},u){if(e.size===0)return Promise.resolve(!0);const f=_3(e,u),h=hl(f),d=Nm(h,t,r,u?.minZoom??o,u?.maxZoom??l,u?.padding??.1);return await a.setViewport(d,{duration:u?.duration,ease:u?.ease,interpolate:u?.interpolate}),Promise.resolve(!0)}function cw({nodeId:e,nextPosition:t,nodeLookup:r,nodeOrigin:a=[0,0],nodeExtent:o,onError:l}){const u=r.get(e),f=u.parentId?r.get(u.parentId):void 0,{x:h,y:d}=f?f.internals.positionAbsolute:{x:0,y:0},m=u.origin??a;let g=u.extent||o;if(u.extent==="parent"&&!u.expandParent)if(!f)l?.("005",Wn.error005());else{const v=f.measured.width,S=f.measured.height;v&&S&&(g=[[h,d],[h+v,d+S]])}else f&&xo(u.extent)&&(g=[[u.extent[0][0]+h,u.extent[0][1]+d],[u.extent[1][0]+h,u.extent[1][1]+d]]);const y=xo(g)?ta(t,g,u.measured):t;return(u.measured.width===void 0||u.measured.height===void 0)&&l?.("015",Wn.error015()),{position:{x:y.x-h+(u.measured.width??0)*m[0],y:y.y-d+(u.measured.height??0)*m[1]},positionAbsolute:y}}async function M3({nodesToRemove:e=[],edgesToRemove:t=[],nodes:r,edges:a,onBeforeDelete:o}){const l=new Set(e.map(y=>y.id)),u=[];for(const y of r){if(y.deletable===!1)continue;const v=l.has(y.id),S=!v&&y.parentId&&u.find(C=>C.id===y.parentId);(v||S)&&u.push(y)}const f=new Set(t.map(y=>y.id)),h=a.filter(y=>y.deletable!==!1),m=C3(u,h);for(const y of h)f.has(y.id)&&!m.find(S=>S.id===y.id)&&m.push(y);if(!o)return{edges:m,nodes:u};const g=await o({nodes:u,edges:m});return typeof g=="boolean"?g?{edges:m,nodes:u}:{edges:[],nodes:[]}:g}const go=(e,t=0,r=1)=>Math.min(Math.max(e,t),r),ta=(e={x:0,y:0},t,r)=>({x:go(e.x,t[0][0],t[1][0]-(r?.width??0)),y:go(e.y,t[0][1],t[1][1]-(r?.height??0))});function fw(e,t,r){const{width:a,height:o}=Tr(r),{x:l,y:u}=r.internals.positionAbsolute;return ta(e,[[l,u],[l+a,u+o]],t)}const Kv=(e,t,r)=>e<t?go(Math.abs(e-t),1,t)/t:e>r?-go(Math.abs(e-r),1,t)/t:0,dw=(e,t,r=15,a=40)=>{const o=Kv(e.x,a,t.width-a)*r,l=Kv(e.y,a,t.height-a)*r;return[o,l]},$c=(e,t)=>({x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}),jp=({x:e,y:t,width:r,height:a})=>({x:e,y:t,x2:e+r,y2:t+a}),Qc=({x:e,y:t,x2:r,y2:a})=>({x:e,y:t,width:r-e,height:a-t}),yo=(e,t=[0,0])=>{const{x:r,y:a}=Cm(e)?e.internals.positionAbsolute:dl(e,t);return{x:r,y:a,width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}},Ac=(e,t=[0,0])=>{const{x:r,y:a}=Cm(e)?e.internals.positionAbsolute:dl(e,t);return{x:r,y:a,x2:r+(e.measured?.width??e.width??e.initialWidth??0),y2:a+(e.measured?.height??e.height??e.initialHeight??0)}},hw=(e,t)=>Qc($c(jp(e),jp(t))),rl=(e,t)=>{const r=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),a=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(r*a)},Jv=e=>In(e.width)&&In(e.height)&&In(e.x)&&In(e.y),In=e=>!isNaN(e)&&isFinite(e),k3=(e,t)=>{},pl=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),ml=({x:e,y:t},[r,a,o],l=!1,u=[1,1])=>{const f={x:(e-r)/o,y:(t-a)/o};return l?pl(f,u):f},Rc=({x:e,y:t},[r,a,o])=>({x:e*o+r,y:t*o+a});function $a(e,t){if(typeof e=="number")return Math.floor((t-t/(1+e))*.5);if(typeof e=="string"&&e.endsWith("px")){const r=parseFloat(e);if(!Number.isNaN(r))return Math.floor(r)}if(typeof e=="string"&&e.endsWith("%")){const r=parseFloat(e);if(!Number.isNaN(r))return Math.floor(t*r*.01)}return console.error(`[React Flow] The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function T3(e,t,r){if(typeof e=="string"||typeof e=="number"){const a=$a(e,r),o=$a(e,t);return{top:a,right:o,bottom:a,left:o,x:o*2,y:a*2}}if(typeof e=="object"){const a=$a(e.top??e.y??0,r),o=$a(e.bottom??e.y??0,r),l=$a(e.left??e.x??0,t),u=$a(e.right??e.x??0,t);return{top:a,right:u,bottom:o,left:l,x:l+u,y:a+o}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function A3(e,t,r,a,o,l){const{x:u,y:f}=Rc(e,[t,r,a]),{x:h,y:d}=Rc({x:e.x+e.width,y:e.y+e.height},[t,r,a]),m=o-h,g=l-d;return{left:Math.floor(u),top:Math.floor(f),right:Math.floor(m),bottom:Math.floor(g)}}const Nm=(e,t,r,a,o,l)=>{const u=T3(l,t,r),f=(t-u.x)/e.width,h=(r-u.y)/e.height,d=Math.min(f,h),m=go(d,a,o),g=e.x+e.width/2,y=e.y+e.height/2,v=t/2-g*m,S=r/2-y*m,C=A3(e,v,S,m,t,r),N={left:Math.min(C.left-u.left,0),top:Math.min(C.top-u.top,0),right:Math.min(C.right-u.right,0),bottom:Math.min(C.bottom-u.bottom,0)};return{x:v-N.left+N.right,y:S-N.top+N.bottom,zoom:m}},il=()=>typeof navigator<"u"&&navigator?.userAgent?.indexOf("Mac")>=0;function xo(e){return e!=null&&e!=="parent"}function Tr(e){return{width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}}function pw(e){return(e.measured?.width??e.width??e.initialWidth)!==void 0&&(e.measured?.height??e.height??e.initialHeight)!==void 0}function mw(e,t={width:0,height:0},r,a,o){const l={...e},u=a.get(r);if(u){const f=u.origin||o;l.x+=u.internals.positionAbsolute.x-(t.width??0)*f[0],l.y+=u.internals.positionAbsolute.y-(t.height??0)*f[1]}return l}function Wv(e,t){if(e.size!==t.size)return!1;for(const r of e)if(!t.has(r))return!1;return!0}function R3(){let e,t;return{promise:new Promise((a,o)=>{e=a,t=o}),resolve:e,reject:t}}function O3(e){return{...ow,...e||{}}}function Ls(e,{snapGrid:t=[0,0],snapToGrid:r=!1,transform:a,containerBounds:o}){const{x:l,y:u}=Hn(e),f=ml({x:l-(o?.left??0),y:u-(o?.top??0)},a),{x:h,y:d}=r?pl(f,t):f;return{xSnapped:h,ySnapped:d,...f}}const Mm=e=>({width:e.offsetWidth,height:e.offsetHeight}),gw=e=>e?.getRootNode?.()||window?.document,j3=["INPUT","SELECT","TEXTAREA"];function yw(e){const t=e.composedPath?.()?.[0]||e.target;return t?.nodeType!==1?!1:j3.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}const xw=e=>"clientX"in e,Hn=(e,t)=>{const r=xw(e),a=r?e.clientX:e.touches?.[0].clientX,o=r?e.clientY:e.touches?.[0].clientY;return{x:a-(t?.left??0),y:o-(t?.top??0)}},eb=(e,t,r,a,o)=>{const l=t.querySelectorAll(`.${e}`);return!l||!l.length?null:Array.from(l).map(u=>{const f=u.getBoundingClientRect();return{id:u.getAttribute("data-handleid"),type:e,nodeId:o,position:u.getAttribute("data-handlepos"),x:(f.left-r.left)/a,y:(f.top-r.top)/a,...Mm(u)}})};function vw({sourceX:e,sourceY:t,targetX:r,targetY:a,sourceControlX:o,sourceControlY:l,targetControlX:u,targetControlY:f}){const h=e*.125+o*.375+u*.375+r*.125,d=t*.125+l*.375+f*.375+a*.125,m=Math.abs(h-e),g=Math.abs(d-t);return[h,d,m,g]}function Zu(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function tb({pos:e,x1:t,y1:r,x2:a,y2:o,c:l}){switch(e){case ve.Left:return[t-Zu(t-a,l),r];case ve.Right:return[t+Zu(a-t,l),r];case ve.Top:return[t,r-Zu(r-o,l)];case ve.Bottom:return[t,r+Zu(o-r,l)]}}function bw({sourceX:e,sourceY:t,sourcePosition:r=ve.Bottom,targetX:a,targetY:o,targetPosition:l=ve.Top,curvature:u=.25}){const[f,h]=tb({pos:r,x1:e,y1:t,x2:a,y2:o,c:u}),[d,m]=tb({pos:l,x1:a,y1:o,x2:e,y2:t,c:u}),[g,y,v,S]=vw({sourceX:e,sourceY:t,targetX:a,targetY:o,sourceControlX:f,sourceControlY:h,targetControlX:d,targetControlY:m});return[`M${e},${t} C${f},${h} ${d},${m} ${a},${o}`,g,y,v,S]}function Sw({sourceX:e,sourceY:t,targetX:r,targetY:a}){const o=Math.abs(r-e)/2,l=r<e?r+o:r-o,u=Math.abs(a-t)/2,f=a<t?a+u:a-u;return[l,f,o,u]}function D3({sourceNode:e,targetNode:t,selected:r=!1,zIndex:a=0,elevateOnSelect:o=!1,zIndexMode:l="basic"}){if(l==="manual")return a;const u=o&&r?a+1e3:a,f=Math.max(e.parentId||o&&e.selected?e.internals.z:0,t.parentId||o&&t.selected?t.internals.z:0);return u+f}function z3({sourceNode:e,targetNode:t,width:r,height:a,transform:o}){const l=$c(Ac(e),Ac(t));l.x===l.x2&&(l.x2+=1),l.y===l.y2&&(l.y2+=1);const u={x:-o[0]/o[2],y:-o[1]/o[2],width:r/o[2],height:a/o[2]};return rl(u,Qc(l))>0}const L3=({source:e,sourceHandle:t,target:r,targetHandle:a})=>`xy-edge__${e}${t||""}-${r}${a||""}`,B3=(e,t)=>t.some(r=>r.source===e.source&&r.target===e.target&&(r.sourceHandle===e.sourceHandle||!r.sourceHandle&&!e.sourceHandle)&&(r.targetHandle===e.targetHandle||!r.targetHandle&&!e.targetHandle)),I3=(e,t,r={})=>{if(!e.source||!e.target)return t;const a=r.getEdgeId||L3;let o;return uw(e)?o={...e}:o={...e,id:a(e)},B3(o,t)?t:(o.sourceHandle===null&&delete o.sourceHandle,o.targetHandle===null&&delete o.targetHandle,t.concat(o))};function ww({sourceX:e,sourceY:t,targetX:r,targetY:a}){const[o,l,u,f]=Sw({sourceX:e,sourceY:t,targetX:r,targetY:a});return[`M ${e},${t}L ${r},${a}`,o,l,u,f]}const nb={[ve.Left]:{x:-1,y:0},[ve.Right]:{x:1,y:0},[ve.Top]:{x:0,y:-1},[ve.Bottom]:{x:0,y:1}},H3=({source:e,sourcePosition:t=ve.Bottom,target:r})=>t===ve.Left||t===ve.Right?e.x<r.x?{x:1,y:0}:{x:-1,y:0}:e.y<r.y?{x:0,y:1}:{x:0,y:-1},rb=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function P3({source:e,sourcePosition:t=ve.Bottom,target:r,targetPosition:a=ve.Top,center:o,offset:l,stepPosition:u}){const f=nb[t],h=nb[a],d={x:e.x+f.x*l,y:e.y+f.y*l},m={x:r.x+h.x*l,y:r.y+h.y*l},g=H3({source:d,sourcePosition:t,target:m}),y=g.x!==0?"x":"y",v=g[y];let S=[],C,N;const w={x:0,y:0},O={x:0,y:0},[,,_,M]=Sw({sourceX:e.x,sourceY:e.y,targetX:r.x,targetY:r.y});if(f[y]*h[y]===-1){y==="x"?(C=o.x??d.x+(m.x-d.x)*u,N=o.y??(d.y+m.y)/2):(C=o.x??(d.x+m.x)/2,N=o.y??d.y+(m.y-d.y)*u);const U=[{x:C,y:d.y},{x:C,y:m.y}],H=[{x:d.x,y:N},{x:m.x,y:N}];f[y]===v?S=y==="x"?U:H:S=y==="x"?H:U}else{const U=[{x:d.x,y:m.y}],H=[{x:m.x,y:d.y}];if(y==="x"?S=f.x===v?H:U:S=f.y===v?U:H,t===a){const B=Math.abs(e[y]-r[y]);if(B<=l){const V=Math.min(l-1,l-B);f[y]===v?w[y]=(d[y]>e[y]?-1:1)*V:O[y]=(m[y]>r[y]?-1:1)*V}}if(t!==a){const B=y==="x"?"y":"x",V=f[y]===h[B],j=d[B]>m[B],F=d[B]<m[B];(f[y]===1&&(!V&&j||V&&F)||f[y]!==1&&(!V&&F||V&&j))&&(S=y==="x"?U:H)}const q={x:d.x+w.x,y:d.y+w.y},L={x:m.x+O.x,y:m.y+O.y},P=Math.max(Math.abs(q.x-S[0].x),Math.abs(L.x-S[0].x)),K=Math.max(Math.abs(q.y-S[0].y),Math.abs(L.y-S[0].y));P>=K?(C=(q.x+L.x)/2,N=S[0].y):(C=S[0].x,N=(q.y+L.y)/2)}const I={x:d.x+w.x,y:d.y+w.y},k={x:m.x+O.x,y:m.y+O.y};return[[e,...I.x!==S[0].x||I.y!==S[0].y?[I]:[],...S,...k.x!==S[S.length-1].x||k.y!==S[S.length-1].y?[k]:[],r],C,N,_,M]}function U3(e,t,r,a){const o=Math.min(rb(e,t)/2,rb(t,r)/2,a),{x:l,y:u}=t;if(e.x===l&&l===r.x||e.y===u&&u===r.y)return`L${l} ${u}`;if(e.y===u){const d=e.x<r.x?-1:1,m=e.y<r.y?1:-1;return`L ${l+o*d},${u}Q ${l},${u} ${l},${u+o*m}`}const f=e.x<r.x?1:-1,h=e.y<r.y?-1:1;return`L ${l},${u+o*h}Q ${l},${u} ${l+o*f},${u}`}function Dp({sourceX:e,sourceY:t,sourcePosition:r=ve.Bottom,targetX:a,targetY:o,targetPosition:l=ve.Top,borderRadius:u=5,centerX:f,centerY:h,offset:d=20,stepPosition:m=.5}){const[g,y,v,S,C]=P3({source:{x:e,y:t},sourcePosition:r,target:{x:a,y:o},targetPosition:l,center:{x:f,y:h},offset:d,stepPosition:m});let N=`M${g[0].x} ${g[0].y}`;for(let w=1;w<g.length-1;w++)N+=U3(g[w-1],g[w],g[w+1],u);return N+=`L${g[g.length-1].x} ${g[g.length-1].y}`,[N,y,v,S,C]}function ib(e){return e&&!!(e.internals.handleBounds||e.handles?.length)&&!!(e.measured.width||e.width||e.initialWidth)}function q3(e){const{sourceNode:t,targetNode:r}=e;if(!ib(t)||!ib(r))return null;const a=t.internals.handleBounds||ab(t.handles),o=r.internals.handleBounds||ab(r.handles),l=ob(a?.source??[],e.sourceHandle),u=ob(e.connectionMode===mo.Strict?o?.target??[]:(o?.target??[]).concat(o?.source??[]),e.targetHandle);if(!l||!u)return e.onError?.("008",Wn.error008(l?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;const f=l?.position||ve.Bottom,h=u?.position||ve.Top,d=na(t,l,f),m=na(r,u,h);return{sourceX:d.x,sourceY:d.y,targetX:m.x,targetY:m.y,sourcePosition:f,targetPosition:h}}function ab(e){if(!e)return null;const t=[],r=[];for(const a of e)a.width=a.width??1,a.height=a.height??1,a.type==="source"?t.push(a):a.type==="target"&&r.push(a);return{source:t,target:r}}function na(e,t,r=ve.Left,a=!1){const o=(t?.x??0)+e.internals.positionAbsolute.x,l=(t?.y??0)+e.internals.positionAbsolute.y,{width:u,height:f}=t??Tr(e);if(a)return{x:o+u/2,y:l+f/2};switch(t?.position??r){case ve.Top:return{x:o+u/2,y:l};case ve.Right:return{x:o+u,y:l+f/2};case ve.Bottom:return{x:o+u/2,y:l+f};case ve.Left:return{x:o,y:l+f/2}}}function ob(e,t){return e&&(t?e.find(r=>r.id===t):e[0])||null}function zp(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(a=>`${a}=${e[a]}`).join("&")}`:""}function V3(e,{id:t,defaultColor:r,defaultMarkerStart:a,defaultMarkerEnd:o}){const l=new Set;return e.reduce((u,f)=>([f.markerStart||a,f.markerEnd||o].forEach(h=>{if(h&&typeof h=="object"){const d=zp(h,t);l.has(d)||(u.push({id:d,color:h.color||r,...h}),l.add(d))}}),u),[]).sort((u,f)=>u.id.localeCompare(f.id))}const Ew=1e3,F3=10,km={nodeOrigin:[0,0],nodeExtent:tl,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},Y3={...km,checkEquality:!0};function Tm(e,t){const r={...e};for(const a in t)t[a]!==void 0&&(r[a]=t[a]);return r}function X3(e,t,r){const a=Tm(km,r);for(const o of e.values())if(o.parentId)Rm(o,e,t,a);else{const l=dl(o,a.nodeOrigin),u=xo(o.extent)?o.extent:a.nodeExtent,f=ta(l,u,Tr(o));o.internals.positionAbsolute=f}}function G3(e,t){if(!e.handles)return e.measured?t?.internals.handleBounds:void 0;const r=[],a=[];for(const o of e.handles){const l={id:o.id,width:o.width??1,height:o.height??1,nodeId:e.id,x:o.x,y:o.y,position:o.position,type:o.type};o.type==="source"?r.push(l):o.type==="target"&&a.push(l)}return{source:r,target:a}}function Am(e){return e==="manual"}function Lp(e,t,r,a={}){const o=Tm(Y3,a),l={i:0},u=new Map(t),f=o?.elevateNodesOnSelect&&!Am(o.zIndexMode)?Ew:0;let h=e.length>0,d=!1;t.clear(),r.clear();for(const m of e){let g=u.get(m.id);if(o.checkEquality&&m===g?.internals.userNode)t.set(m.id,g);else{const y=dl(m,o.nodeOrigin),v=xo(m.extent)?m.extent:o.nodeExtent,S=ta(y,v,Tr(m));g={...o.defaults,...m,measured:{width:m.measured?.width,height:m.measured?.height},internals:{positionAbsolute:S,handleBounds:G3(m,g),z:Cw(m,f,o.zIndexMode),userNode:m}},t.set(m.id,g)}(g.measured===void 0||g.measured.width===void 0||g.measured.height===void 0)&&!g.hidden&&(h=!1),m.parentId&&Rm(g,t,r,a,l),d||=m.selected??!1}return{nodesInitialized:h,hasSelectedNodes:d}}function $3(e,t){if(!e.parentId)return;const r=t.get(e.parentId);r?r.set(e.id,e):t.set(e.parentId,new Map([[e.id,e]]))}function Rm(e,t,r,a,o){const{elevateNodesOnSelect:l,nodeOrigin:u,nodeExtent:f,zIndexMode:h}=Tm(km,a),d=e.parentId,m=t.get(d);if(!m){console.warn(`Parent node ${d} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}$3(e,r),o&&!m.parentId&&m.internals.rootParentIndex===void 0&&h==="auto"&&(m.internals.rootParentIndex=++o.i,m.internals.z=m.internals.z+o.i*F3),o&&m.internals.rootParentIndex!==void 0&&(o.i=m.internals.rootParentIndex);const g=l&&!Am(h)?Ew:0,{x:y,y:v,z:S}=Q3(e,m,u,f,g,h),{positionAbsolute:C}=e.internals,N=y!==C.x||v!==C.y;(N||S!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:N?{x:y,y:v}:C,z:S}})}function Cw(e,t,r){const a=In(e.zIndex)?e.zIndex:0;return Am(r)?a:a+(e.selected?t:0)}function Q3(e,t,r,a,o,l){const{x:u,y:f}=t.internals.positionAbsolute,h=Tr(e),d=dl(e,r),m=xo(e.extent)?ta(d,e.extent,h):d;let g=ta({x:u+m.x,y:f+m.y},a,h);e.extent==="parent"&&(g=fw(g,h,t));const y=Cw(e,o,l),v=t.internals.z??0;return{x:g.x,y:g.y,z:v>=y?v+1:y}}function Om(e,t,r,a=[0,0]){const o=[],l=new Map;for(const u of e){const f=t.get(u.parentId);if(!f)continue;const h=l.get(u.parentId)?.expandedRect??yo(f),d=hw(h,u.rect);l.set(u.parentId,{expandedRect:d,parent:f})}return l.size>0&&l.forEach(({expandedRect:u,parent:f},h)=>{const d=f.internals.positionAbsolute,m=Tr(f),g=f.origin??a,y=u.x<d.x?Math.round(Math.abs(d.x-u.x)):0,v=u.y<d.y?Math.round(Math.abs(d.y-u.y)):0,S=Math.max(m.width,Math.round(u.width)),C=Math.max(m.height,Math.round(u.height)),N=(S-m.width)*g[0],w=(C-m.height)*g[1];(y>0||v>0||N||w)&&(o.push({id:h,type:"position",position:{x:f.position.x-y+N,y:f.position.y-v+w}}),r.get(h)?.forEach(O=>{e.some(_=>_.id===O.id)||o.push({id:O.id,type:"position",position:{x:O.position.x+y,y:O.position.y+v}})})),(m.width<u.width||m.height<u.height||y||v)&&o.push({id:h,type:"dimensions",setAttributes:!0,dimensions:{width:S+(y?g[0]*y-N:0),height:C+(v?g[1]*v-w:0)}})}),o}function Z3(e,t,r,a,o,l,u){const f=a?.querySelector(".xyflow__viewport");let h=!1;if(!f)return{changes:[],updatedInternals:h};const d=[],m=window.getComputedStyle(f),{m22:g}=new window.DOMMatrixReadOnly(m.transform),y=[];for(const v of e.values()){const S=t.get(v.id);if(!S)continue;if(S.hidden){t.set(S.id,{...S,internals:{...S.internals,handleBounds:void 0}}),h=!0;continue}const C=Mm(v.nodeElement),N=S.measured.width!==C.width||S.measured.height!==C.height;if(!!(C.width&&C.height&&(N||!S.internals.handleBounds||v.force))){const O=v.nodeElement.getBoundingClientRect(),_=xo(S.extent)?S.extent:l;let{positionAbsolute:M}=S.internals;S.parentId&&S.extent==="parent"?M=fw(M,C,t.get(S.parentId)):_&&(M=ta(M,_,C));const I={...S,measured:C,internals:{...S.internals,positionAbsolute:M,handleBounds:{source:eb("source",v.nodeElement,O,g,S.id),target:eb("target",v.nodeElement,O,g,S.id)}}};t.set(S.id,I),S.parentId&&Rm(I,t,r,{nodeOrigin:o,zIndexMode:u}),h=!0,N&&(d.push({id:S.id,type:"dimensions",dimensions:C}),S.expandParent&&S.parentId&&y.push({id:S.id,parentId:S.parentId,rect:yo(I,o)}))}}if(y.length>0){const v=Om(y,t,r,o);d.push(...v)}return{changes:d,updatedInternals:h}}async function K3({delta:e,panZoom:t,transform:r,translateExtent:a,width:o,height:l}){if(!t||!e.x&&!e.y)return Promise.resolve(!1);const u=await t.setViewportConstrained({x:r[0]+e.x,y:r[1]+e.y,zoom:r[2]},[[0,0],[o,l]],a),f=!!u&&(u.x!==r[0]||u.y!==r[1]||u.k!==r[2]);return Promise.resolve(f)}function sb(e,t,r,a,o,l){let u=o;const f=a.get(u)||new Map;a.set(u,f.set(r,t)),u=`${o}-${e}`;const h=a.get(u)||new Map;if(a.set(u,h.set(r,t)),l){u=`${o}-${e}-${l}`;const d=a.get(u)||new Map;a.set(u,d.set(r,t))}}function _w(e,t,r){e.clear(),t.clear();for(const a of r){const{source:o,target:l,sourceHandle:u=null,targetHandle:f=null}=a,h={edgeId:a.id,source:o,target:l,sourceHandle:u,targetHandle:f},d=`${o}-${u}--${l}-${f}`,m=`${l}-${f}--${o}-${u}`;sb("source",h,m,e,o,u),sb("target",h,d,e,l,f),t.set(a.id,a)}}function Nw(e,t){if(!e.parentId)return!1;const r=t.get(e.parentId);return r?r.selected?!0:Nw(r,t):!1}function lb(e,t,r){let a=e;do{if(a?.matches?.(t))return!0;if(a===r)return!1;a=a?.parentElement}while(a);return!1}function J3(e,t,r,a){const o=new Map;for(const[l,u]of e)if((u.selected||u.id===a)&&(!u.parentId||!Nw(u,e))&&(u.draggable||t&&typeof u.draggable>"u")){const f=e.get(l);f&&o.set(l,{id:l,position:f.position||{x:0,y:0},distance:{x:r.x-f.internals.positionAbsolute.x,y:r.y-f.internals.positionAbsolute.y},extent:f.extent,parentId:f.parentId,origin:f.origin,expandParent:f.expandParent,internals:{positionAbsolute:f.internals.positionAbsolute||{x:0,y:0}},measured:{width:f.measured.width??0,height:f.measured.height??0}})}return o}function Vh({nodeId:e,dragItems:t,nodeLookup:r,dragging:a=!0}){const o=[];for(const[u,f]of t){const h=r.get(u)?.internals.userNode;h&&o.push({...h,position:f.position,dragging:a})}if(!e)return[o[0],o];const l=r.get(e)?.internals.userNode;return[l?{...l,position:t.get(e)?.position||l.position,dragging:a}:o[0],o]}function W3({dragItems:e,snapGrid:t,x:r,y:a}){const o=e.values().next().value;if(!o)return null;const l={x:r-o.distance.x,y:a-o.distance.y},u=pl(l,t);return{x:u.x-l.x,y:u.y-l.y}}function eO({onNodeMouseDown:e,getStoreItems:t,onDragStart:r,onDrag:a,onDragStop:o}){let l={x:null,y:null},u=0,f=new Map,h=!1,d={x:0,y:0},m=null,g=!1,y=null,v=!1,S=!1,C=null;function N({noDragClassName:O,handleSelector:_,domNode:M,isSelectable:I,nodeId:k,nodeClickDistance:D=0}){y=mn(M);function U({x:P,y:K}){const{nodeLookup:B,nodeExtent:V,snapGrid:j,snapToGrid:F,nodeOrigin:$,onNodeDrag:Z,onSelectionDrag:A,onError:z,updateNodePositions:X}=t();l={x:P,y:K};let R=!1;const te=f.size>1,ue=te&&V?jp(hl(f)):null,ce=te&&F?W3({dragItems:f,snapGrid:j,x:P,y:K}):null;for(const[fe,le]of f){if(!B.has(fe))continue;let pe={x:P-le.distance.x,y:K-le.distance.y};F&&(pe=ce?{x:Math.round(pe.x+ce.x),y:Math.round(pe.y+ce.y)}:pl(pe,j));let be=null;if(te&&V&&!le.extent&&ue){const{positionAbsolute:we}=le.internals,Re=we.x-ue.x+V[0][0],He=we.x+le.measured.width-ue.x2+V[1][0],Be=we.y-ue.y+V[0][1],Qe=we.y+le.measured.height-ue.y2+V[1][1];be=[[Re,Be],[He,Qe]]}const{position:Se,positionAbsolute:ye}=cw({nodeId:fe,nextPosition:pe,nodeLookup:B,nodeExtent:be||V,nodeOrigin:$,onError:z});R=R||le.position.x!==Se.x||le.position.y!==Se.y,le.position=Se,le.internals.positionAbsolute=ye}if(S=S||R,!!R&&(X(f,!0),C&&(a||Z||!k&&A))){const[fe,le]=Vh({nodeId:k,dragItems:f,nodeLookup:B});a?.(C,f,fe,le),Z?.(C,fe,le),k||A?.(C,le)}}async function H(){if(!m)return;const{transform:P,panBy:K,autoPanSpeed:B,autoPanOnNodeDrag:V}=t();if(!V){h=!1,cancelAnimationFrame(u);return}const[j,F]=dw(d,m,B);(j!==0||F!==0)&&(l.x=(l.x??0)-j/P[2],l.y=(l.y??0)-F/P[2],await K({x:j,y:F})&&U(l)),u=requestAnimationFrame(H)}function q(P){const{nodeLookup:K,multiSelectionActive:B,nodesDraggable:V,transform:j,snapGrid:F,snapToGrid:$,selectNodesOnDrag:Z,onNodeDragStart:A,onSelectionDragStart:z,unselectNodesAndEdges:X}=t();g=!0,(!Z||!I)&&!B&&k&&(K.get(k)?.selected||X()),I&&Z&&k&&e?.(k);const R=Ls(P.sourceEvent,{transform:j,snapGrid:F,snapToGrid:$,containerBounds:m});if(l=R,f=J3(K,V,R,k),f.size>0&&(r||A||!k&&z)){const[te,ue]=Vh({nodeId:k,dragItems:f,nodeLookup:K});r?.(P.sourceEvent,f,te,ue),A?.(P.sourceEvent,te,ue),k||z?.(P.sourceEvent,ue)}}const L=VS().clickDistance(D).on("start",P=>{const{domNode:K,nodeDragThreshold:B,transform:V,snapGrid:j,snapToGrid:F}=t();m=K?.getBoundingClientRect()||null,v=!1,S=!1,C=P.sourceEvent,B===0&&q(P),l=Ls(P.sourceEvent,{transform:V,snapGrid:j,snapToGrid:F,containerBounds:m}),d=Hn(P.sourceEvent,m)}).on("drag",P=>{const{autoPanOnNodeDrag:K,transform:B,snapGrid:V,snapToGrid:j,nodeDragThreshold:F,nodeLookup:$}=t(),Z=Ls(P.sourceEvent,{transform:B,snapGrid:V,snapToGrid:j,containerBounds:m});if(C=P.sourceEvent,(P.sourceEvent.type==="touchmove"&&P.sourceEvent.touches.length>1||k&&!$.has(k))&&(v=!0),!v){if(!h&&K&&g&&(h=!0,H()),!g){const A=Hn(P.sourceEvent,m),z=A.x-d.x,X=A.y-d.y;Math.sqrt(z*z+X*X)>F&&q(P)}(l.x!==Z.xSnapped||l.y!==Z.ySnapped)&&f&&g&&(d=Hn(P.sourceEvent,m),U(Z))}}).on("end",P=>{if(!(!g||v)&&(h=!1,g=!1,cancelAnimationFrame(u),f.size>0)){const{nodeLookup:K,updateNodePositions:B,onNodeDragStop:V,onSelectionDragStop:j}=t();if(S&&(B(f,!1),S=!1),o||V||!k&&j){const[F,$]=Vh({nodeId:k,dragItems:f,nodeLookup:K,dragging:!1});o?.(P.sourceEvent,f,F,$),V?.(P.sourceEvent,F,$),k||j?.(P.sourceEvent,$)}}}).filter(P=>{const K=P.target;return!P.button&&(!O||!lb(K,`.${O}`,M))&&(!_||lb(K,_,M))});y.call(L)}function w(){y?.on(".drag",null)}return{update:N,destroy:w}}function tO(e,t,r){const a=[],o={x:e.x-r,y:e.y-r,width:r*2,height:r*2};for(const l of t.values())rl(o,yo(l))>0&&a.push(l);return a}const nO=250;function rO(e,t,r,a){let o=[],l=1/0;const u=tO(e,r,t+nO);for(const f of u){const h=[...f.internals.handleBounds?.source??[],...f.internals.handleBounds?.target??[]];for(const d of h){if(a.nodeId===d.nodeId&&a.type===d.type&&a.id===d.id)continue;const{x:m,y:g}=na(f,d,d.position,!0),y=Math.sqrt(Math.pow(m-e.x,2)+Math.pow(g-e.y,2));y>t||(y<l?(o=[{...d,x:m,y:g}],l=y):y===l&&o.push({...d,x:m,y:g}))}}if(!o.length)return null;if(o.length>1){const f=a.type==="source"?"target":"source";return o.find(h=>h.type===f)??o[0]}return o[0]}function Mw(e,t,r,a,o,l=!1){const u=a.get(e);if(!u)return null;const f=o==="strict"?u.internals.handleBounds?.[t]:[...u.internals.handleBounds?.source??[],...u.internals.handleBounds?.target??[]],h=(r?f?.find(d=>d.id===r):f?.[0])??null;return h&&l?{...h,...na(u,h,h.position,!0)}:h}function kw(e,t){return e||(t?.classList.contains("target")?"target":t?.classList.contains("source")?"source":null)}function iO(e,t){let r=null;return t?r=!0:e&&!t&&(r=!1),r}const Tw=()=>!0;function aO(e,{connectionMode:t,connectionRadius:r,handleId:a,nodeId:o,edgeUpdaterType:l,isTarget:u,domNode:f,nodeLookup:h,lib:d,autoPanOnConnect:m,flowId:g,panBy:y,cancelConnection:v,onConnectStart:S,onConnect:C,onConnectEnd:N,isValidConnection:w=Tw,onReconnectEnd:O,updateConnection:_,getTransform:M,getFromHandle:I,autoPanSpeed:k,dragThreshold:D=1,handleDomNode:U}){const H=gw(e.target);let q=0,L;const{x:P,y:K}=Hn(e),B=kw(l,U),V=f?.getBoundingClientRect();let j=!1;if(!V||!B)return;const F=Mw(o,B,a,h,t);if(!F)return;let $=Hn(e,V),Z=!1,A=null,z=!1,X=null;function R(){if(!m||!V)return;const[Se,ye]=dw($,V,k);y({x:Se,y:ye}),q=requestAnimationFrame(R)}const te={...F,nodeId:o,type:B,position:F.position},ue=h.get(o);let fe={inProgress:!0,isValid:null,from:na(ue,te,ve.Left,!0),fromHandle:te,fromPosition:te.position,fromNode:ue,to:$,toHandle:null,toPosition:Zv[te.position],toNode:null,pointer:$};function le(){j=!0,_(fe),S?.(e,{nodeId:o,handleId:a,handleType:B})}D===0&&le();function pe(Se){if(!j){const{x:Qe,y:_t}=Hn(Se),it=Qe-P,Ot=_t-K;if(!(it*it+Ot*Ot>D*D))return;le()}if(!I()||!te){be(Se);return}const ye=M();$=Hn(Se,V),L=rO(ml($,ye,!1,[1,1]),r,h,te),Z||(R(),Z=!0);const we=Aw(Se,{handle:L,connectionMode:t,fromNodeId:o,fromHandleId:a,fromType:u?"target":"source",isValidConnection:w,doc:H,lib:d,flowId:g,nodeLookup:h});X=we.handleDomNode,A=we.connection,z=iO(!!L,we.isValid);const Re=h.get(o),He=Re?na(Re,te,ve.Left,!0):fe.from,Be={...fe,from:He,isValid:z,to:we.toHandle&&z?Rc({x:we.toHandle.x,y:we.toHandle.y},ye):$,toHandle:we.toHandle,toPosition:z&&we.toHandle?we.toHandle.position:Zv[te.position],toNode:we.toHandle?h.get(we.toHandle.nodeId):null,pointer:$};_(Be),fe=Be}function be(Se){if(!("touches"in Se&&Se.touches.length>0)){if(j){(L||X)&&A&&z&&C?.(A);const{inProgress:ye,...we}=fe,Re={...we,toPosition:fe.toHandle?fe.toPosition:null};N?.(Se,Re),l&&O?.(Se,Re)}v(),cancelAnimationFrame(q),Z=!1,z=!1,A=null,X=null,H.removeEventListener("mousemove",pe),H.removeEventListener("mouseup",be),H.removeEventListener("touchmove",pe),H.removeEventListener("touchend",be)}}H.addEventListener("mousemove",pe),H.addEventListener("mouseup",be),H.addEventListener("touchmove",pe),H.addEventListener("touchend",be)}function Aw(e,{handle:t,connectionMode:r,fromNodeId:a,fromHandleId:o,fromType:l,doc:u,lib:f,flowId:h,isValidConnection:d=Tw,nodeLookup:m}){const g=l==="target",y=t?u.querySelector(`.${f}-flow__handle[data-id="${h}-${t?.nodeId}-${t?.id}-${t?.type}"]`):null,{x:v,y:S}=Hn(e),C=u.elementFromPoint(v,S),N=C?.classList.contains(`${f}-flow__handle`)?C:y,w={handleDomNode:N,isValid:!1,connection:null,toHandle:null};if(N){const O=kw(void 0,N),_=N.getAttribute("data-nodeid"),M=N.getAttribute("data-handleid"),I=N.classList.contains("connectable"),k=N.classList.contains("connectableend");if(!_||!O)return w;const D={source:g?_:a,sourceHandle:g?M:o,target:g?a:_,targetHandle:g?o:M};w.connection=D;const H=I&&k&&(r===mo.Strict?g&&O==="source"||!g&&O==="target":_!==a||M!==o);w.isValid=H&&d(D),w.toHandle=Mw(_,O,M,m,r,!0)}return w}const Bp={onPointerDown:aO,isValid:Aw};function oO({domNode:e,panZoom:t,getTransform:r,getViewScale:a}){const o=mn(e);function l({translateExtent:f,width:h,height:d,zoomStep:m=1,pannable:g=!0,zoomable:y=!0,inversePan:v=!1}){const S=_=>{if(_.sourceEvent.type!=="wheel"||!t)return;const M=r(),I=_.sourceEvent.ctrlKey&&il()?10:1,k=-_.sourceEvent.deltaY*(_.sourceEvent.deltaMode===1?.05:_.sourceEvent.deltaMode?1:.002)*m,D=M[2]*Math.pow(2,k*I);t.scaleTo(D)};let C=[0,0];const N=_=>{(_.sourceEvent.type==="mousedown"||_.sourceEvent.type==="touchstart")&&(C=[_.sourceEvent.clientX??_.sourceEvent.touches[0].clientX,_.sourceEvent.clientY??_.sourceEvent.touches[0].clientY])},w=_=>{const M=r();if(_.sourceEvent.type!=="mousemove"&&_.sourceEvent.type!=="touchmove"||!t)return;const I=[_.sourceEvent.clientX??_.sourceEvent.touches[0].clientX,_.sourceEvent.clientY??_.sourceEvent.touches[0].clientY],k=[I[0]-C[0],I[1]-C[1]];C=I;const D=a()*Math.max(M[2],Math.log(M[2]))*(v?-1:1),U={x:M[0]-k[0]*D,y:M[1]-k[1]*D},H=[[0,0],[h,d]];t.setViewportConstrained({x:U.x,y:U.y,zoom:M[2]},H,f)},O=iw().on("start",N).on("zoom",g?w:null).on("zoom.wheel",y?S:null);o.call(O,{})}function u(){o.on("zoom",null)}return{update:l,destroy:u,pointer:Ln}}const Zc=e=>({x:e.x,y:e.y,zoom:e.k}),Fh=({x:e,y:t,zoom:r})=>Gc.translate(e,t).scale(r),eo=(e,t)=>e.target.closest(`.${t}`),Rw=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),sO=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,Yh=(e,t=0,r=sO,a=()=>{})=>{const o=typeof t=="number"&&t>0;return o||a(),o?e.transition().duration(t).ease(r).on("end",a):e},Ow=e=>{const t=e.ctrlKey&&il()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function lO({zoomPanValues:e,noWheelClassName:t,d3Selection:r,d3Zoom:a,panOnScrollMode:o,panOnScrollSpeed:l,zoomOnPinch:u,onPanZoomStart:f,onPanZoom:h,onPanZoomEnd:d}){return m=>{if(eo(m,t))return m.ctrlKey&&m.preventDefault(),!1;m.preventDefault(),m.stopImmediatePropagation();const g=r.property("__zoom").k||1;if(m.ctrlKey&&u){const N=Ln(m),w=Ow(m),O=g*Math.pow(2,w);a.scaleTo(r,O,N,m);return}const y=m.deltaMode===1?20:1;let v=o===Ki.Vertical?0:m.deltaX*y,S=o===Ki.Horizontal?0:m.deltaY*y;!il()&&m.shiftKey&&o!==Ki.Vertical&&(v=m.deltaY*y,S=0),a.translateBy(r,-(v/g)*l,-(S/g)*l,{internal:!0});const C=Zc(r.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?(h?.(m,C),e.panScrollTimeout=setTimeout(()=>{d?.(m,C),e.isPanScrolling=!1},150)):(e.isPanScrolling=!0,f?.(m,C))}}function uO({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:r}){return function(a,o){const l=a.type==="wheel",u=!t&&l&&!a.ctrlKey,f=eo(a,e);if(a.ctrlKey&&l&&f&&a.preventDefault(),u||f)return null;a.preventDefault(),r.call(this,a,o)}}function cO({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:r}){return a=>{if(a.sourceEvent?.internal)return;const o=Zc(a.transform);e.mouseButton=a.sourceEvent?.button||0,e.isZoomingOrPanning=!0,e.prevViewport=o,a.sourceEvent?.type==="mousedown"&&t(!0),r&&r?.(a.sourceEvent,o)}}function fO({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:r,onTransformChange:a,onPanZoom:o}){return l=>{e.usedRightMouseButton=!!(r&&Rw(t,e.mouseButton??0)),l.sourceEvent?.sync||a([l.transform.x,l.transform.y,l.transform.k]),o&&!l.sourceEvent?.internal&&o?.(l.sourceEvent,Zc(l.transform))}}function dO({zoomPanValues:e,panOnDrag:t,panOnScroll:r,onDraggingChange:a,onPanZoomEnd:o,onPaneContextMenu:l}){return u=>{if(!u.sourceEvent?.internal&&(e.isZoomingOrPanning=!1,l&&Rw(t,e.mouseButton??0)&&!e.usedRightMouseButton&&u.sourceEvent&&l(u.sourceEvent),e.usedRightMouseButton=!1,a(!1),o)){const f=Zc(u.transform);e.prevViewport=f,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{o?.(u.sourceEvent,f)},r?150:0)}}}function hO({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:r,panOnDrag:a,panOnScroll:o,zoomOnDoubleClick:l,userSelectionActive:u,noWheelClassName:f,noPanClassName:h,lib:d,connectionInProgress:m}){return g=>{const y=e||t,v=r&&g.ctrlKey,S=g.type==="wheel";if(g.button===1&&g.type==="mousedown"&&(eo(g,`${d}-flow__node`)||eo(g,`${d}-flow__edge`)))return!0;if(!a&&!y&&!o&&!l&&!r||u||m&&!S||eo(g,f)&&S||eo(g,h)&&(!S||o&&S&&!e)||!r&&g.ctrlKey&&S)return!1;if(!r&&g.type==="touchstart"&&g.touches?.length>1)return g.preventDefault(),!1;if(!y&&!o&&!v&&S||!a&&(g.type==="mousedown"||g.type==="touchstart")||Array.isArray(a)&&!a.includes(g.button)&&g.type==="mousedown")return!1;const C=Array.isArray(a)&&a.includes(g.button)||!g.button||g.button<=1;return(!g.ctrlKey||S)&&C}}function pO({domNode:e,minZoom:t,maxZoom:r,translateExtent:a,viewport:o,onPanZoom:l,onPanZoomStart:u,onPanZoomEnd:f,onDraggingChange:h}){const d={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},m=e.getBoundingClientRect(),g=iw().scaleExtent([t,r]).translateExtent(a),y=mn(e).call(g);O({x:o.x,y:o.y,zoom:go(o.zoom,t,r)},[[0,0],[m.width,m.height]],a);const v=y.on("wheel.zoom"),S=y.on("dblclick.zoom");g.wheelDelta(Ow);function C(L,P){return y?new Promise(K=>{g?.interpolate(P?.interpolate==="linear"?zs:cc).transform(Yh(y,P?.duration,P?.ease,()=>K(!0)),L)}):Promise.resolve(!1)}function N({noWheelClassName:L,noPanClassName:P,onPaneContextMenu:K,userSelectionActive:B,panOnScroll:V,panOnDrag:j,panOnScrollMode:F,panOnScrollSpeed:$,preventScrolling:Z,zoomOnPinch:A,zoomOnScroll:z,zoomOnDoubleClick:X,zoomActivationKeyPressed:R,lib:te,onTransformChange:ue,connectionInProgress:ce,paneClickDistance:fe,selectionOnDrag:le}){B&&!d.isZoomingOrPanning&&w();const pe=V&&!R&&!B;g.clickDistance(le?1/0:!In(fe)||fe<0?0:fe);const be=pe?lO({zoomPanValues:d,noWheelClassName:L,d3Selection:y,d3Zoom:g,panOnScrollMode:F,panOnScrollSpeed:$,zoomOnPinch:A,onPanZoomStart:u,onPanZoom:l,onPanZoomEnd:f}):uO({noWheelClassName:L,preventScrolling:Z,d3ZoomHandler:v});if(y.on("wheel.zoom",be,{passive:!1}),!B){const ye=cO({zoomPanValues:d,onDraggingChange:h,onPanZoomStart:u});g.on("start",ye);const we=fO({zoomPanValues:d,panOnDrag:j,onPaneContextMenu:!!K,onPanZoom:l,onTransformChange:ue});g.on("zoom",we);const Re=dO({zoomPanValues:d,panOnDrag:j,panOnScroll:V,onPaneContextMenu:K,onPanZoomEnd:f,onDraggingChange:h});g.on("end",Re)}const Se=hO({zoomActivationKeyPressed:R,panOnDrag:j,zoomOnScroll:z,panOnScroll:V,zoomOnDoubleClick:X,zoomOnPinch:A,userSelectionActive:B,noPanClassName:P,noWheelClassName:L,lib:te,connectionInProgress:ce});g.filter(Se),X?y.on("dblclick.zoom",S):y.on("dblclick.zoom",null)}function w(){g.on("zoom",null)}async function O(L,P,K){const B=Fh(L),V=g?.constrain()(B,P,K);return V&&await C(V),new Promise(j=>j(V))}async function _(L,P){const K=Fh(L);return await C(K,P),new Promise(B=>B(K))}function M(L){if(y){const P=Fh(L),K=y.property("__zoom");(K.k!==L.zoom||K.x!==L.x||K.y!==L.y)&&g?.transform(y,P,null,{sync:!0})}}function I(){const L=y?rw(y.node()):{x:0,y:0,k:1};return{x:L.x,y:L.y,zoom:L.k}}function k(L,P){return y?new Promise(K=>{g?.interpolate(P?.interpolate==="linear"?zs:cc).scaleTo(Yh(y,P?.duration,P?.ease,()=>K(!0)),L)}):Promise.resolve(!1)}function D(L,P){return y?new Promise(K=>{g?.interpolate(P?.interpolate==="linear"?zs:cc).scaleBy(Yh(y,P?.duration,P?.ease,()=>K(!0)),L)}):Promise.resolve(!1)}function U(L){g?.scaleExtent(L)}function H(L){g?.translateExtent(L)}function q(L){const P=!In(L)||L<0?0:L;g?.clickDistance(P)}return{update:N,destroy:w,setViewport:_,setViewportConstrained:O,getViewport:I,scaleTo:k,scaleBy:D,setScaleExtent:U,setTranslateExtent:H,syncViewport:M,setClickDistance:q}}var vo;(function(e){e.Line="line",e.Handle="handle"})(vo||(vo={}));function mO({width:e,prevWidth:t,height:r,prevHeight:a,affectsX:o,affectsY:l}){const u=e-t,f=r-a,h=[u>0?1:u<0?-1:0,f>0?1:f<0?-1:0];return u&&o&&(h[0]=h[0]*-1),f&&l&&(h[1]=h[1]*-1),h}function ub(e){const t=e.includes("right")||e.includes("left"),r=e.includes("bottom")||e.includes("top"),a=e.includes("left"),o=e.includes("top");return{isHorizontal:t,isVertical:r,affectsX:a,affectsY:o}}function ii(e,t){return Math.max(0,t-e)}function ai(e,t){return Math.max(0,e-t)}function Ku(e,t,r){return Math.max(0,t-e,e-r)}function cb(e,t){return e?!t:t}function gO(e,t,r,a,o,l,u,f){let{affectsX:h,affectsY:d}=t;const{isHorizontal:m,isVertical:g}=t,y=m&&g,{xSnapped:v,ySnapped:S}=r,{minWidth:C,maxWidth:N,minHeight:w,maxHeight:O}=a,{x:_,y:M,width:I,height:k,aspectRatio:D}=e;let U=Math.floor(m?v-e.pointerX:0),H=Math.floor(g?S-e.pointerY:0);const q=I+(h?-U:U),L=k+(d?-H:H),P=-l[0]*I,K=-l[1]*k;let B=Ku(q,C,N),V=Ku(L,w,O);if(u){let $=0,Z=0;h&&U<0?$=ii(_+U+P,u[0][0]):!h&&U>0&&($=ai(_+q+P,u[1][0])),d&&H<0?Z=ii(M+H+K,u[0][1]):!d&&H>0&&(Z=ai(M+L+K,u[1][1])),B=Math.max(B,$),V=Math.max(V,Z)}if(f){let $=0,Z=0;h&&U>0?$=ai(_+U,f[0][0]):!h&&U<0&&($=ii(_+q,f[1][0])),d&&H>0?Z=ai(M+H,f[0][1]):!d&&H<0&&(Z=ii(M+L,f[1][1])),B=Math.max(B,$),V=Math.max(V,Z)}if(o){if(m){const $=Ku(q/D,w,O)*D;if(B=Math.max(B,$),u){let Z=0;!h&&!d||h&&!d&&y?Z=ai(M+K+q/D,u[1][1])*D:Z=ii(M+K+(h?U:-U)/D,u[0][1])*D,B=Math.max(B,Z)}if(f){let Z=0;!h&&!d||h&&!d&&y?Z=ii(M+q/D,f[1][1])*D:Z=ai(M+(h?U:-U)/D,f[0][1])*D,B=Math.max(B,Z)}}if(g){const $=Ku(L*D,C,N)/D;if(V=Math.max(V,$),u){let Z=0;!h&&!d||d&&!h&&y?Z=ai(_+L*D+P,u[1][0])/D:Z=ii(_+(d?H:-H)*D+P,u[0][0])/D,V=Math.max(V,Z)}if(f){let Z=0;!h&&!d||d&&!h&&y?Z=ii(_+L*D,f[1][0])/D:Z=ai(_+(d?H:-H)*D,f[0][0])/D,V=Math.max(V,Z)}}}H=H+(H<0?V:-V),U=U+(U<0?B:-B),o&&(y?q>L*D?H=(cb(h,d)?-U:U)/D:U=(cb(h,d)?-H:H)*D:m?(H=U/D,d=h):(U=H*D,h=d));const j=h?_+U:_,F=d?M+H:M;return{width:I+(h?-U:U),height:k+(d?-H:H),x:l[0]*U*(h?-1:1)+j,y:l[1]*H*(d?-1:1)+F}}const jw={width:0,height:0,x:0,y:0},yO={...jw,pointerX:0,pointerY:0,aspectRatio:1};function xO(e){return[[0,0],[e.measured.width,e.measured.height]]}function vO(e,t,r){const a=t.position.x+e.position.x,o=t.position.y+e.position.y,l=e.measured.width??0,u=e.measured.height??0,f=r[0]*l,h=r[1]*u;return[[a-f,o-h],[a+l-f,o+u-h]]}function bO({domNode:e,nodeId:t,getStoreItems:r,onChange:a,onEnd:o}){const l=mn(e);let u={controlDirection:ub("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function f({controlPosition:d,boundaries:m,keepAspectRatio:g,resizeDirection:y,onResizeStart:v,onResize:S,onResizeEnd:C,shouldResize:N}){let w={...jw},O={...yO};u={boundaries:m,resizeDirection:y,keepAspectRatio:g,controlDirection:ub(d)};let _,M=null,I=[],k,D,U,H=!1;const q=VS().on("start",L=>{const{nodeLookup:P,transform:K,snapGrid:B,snapToGrid:V,nodeOrigin:j,paneDomNode:F}=r();if(_=P.get(t),!_)return;M=F?.getBoundingClientRect()??null;const{xSnapped:$,ySnapped:Z}=Ls(L.sourceEvent,{transform:K,snapGrid:B,snapToGrid:V,containerBounds:M});w={width:_.measured.width??0,height:_.measured.height??0,x:_.position.x??0,y:_.position.y??0},O={...w,pointerX:$,pointerY:Z,aspectRatio:w.width/w.height},k=void 0,_.parentId&&(_.extent==="parent"||_.expandParent)&&(k=P.get(_.parentId),D=k&&_.extent==="parent"?xO(k):void 0),I=[],U=void 0;for(const[A,z]of P)if(z.parentId===t&&(I.push({id:A,position:{...z.position},extent:z.extent}),z.extent==="parent"||z.expandParent)){const X=vO(z,_,z.origin??j);U?U=[[Math.min(X[0][0],U[0][0]),Math.min(X[0][1],U[0][1])],[Math.max(X[1][0],U[1][0]),Math.max(X[1][1],U[1][1])]]:U=X}v?.(L,{...w})}).on("drag",L=>{const{transform:P,snapGrid:K,snapToGrid:B,nodeOrigin:V}=r(),j=Ls(L.sourceEvent,{transform:P,snapGrid:K,snapToGrid:B,containerBounds:M}),F=[];if(!_)return;const{x:$,y:Z,width:A,height:z}=w,X={},R=_.origin??V,{width:te,height:ue,x:ce,y:fe}=gO(O,u.controlDirection,j,u.boundaries,u.keepAspectRatio,R,D,U),le=te!==A,pe=ue!==z,be=ce!==$&&le,Se=fe!==Z&&pe;if(!be&&!Se&&!le&&!pe)return;if((be||Se||R[0]===1||R[1]===1)&&(X.x=be?ce:w.x,X.y=Se?fe:w.y,w.x=X.x,w.y=X.y,I.length>0)){const He=ce-$,Be=fe-Z;for(const Qe of I)Qe.position={x:Qe.position.x-He+R[0]*(te-A),y:Qe.position.y-Be+R[1]*(ue-z)},F.push(Qe)}if((le||pe)&&(X.width=le&&(!u.resizeDirection||u.resizeDirection==="horizontal")?te:w.width,X.height=pe&&(!u.resizeDirection||u.resizeDirection==="vertical")?ue:w.height,w.width=X.width,w.height=X.height),k&&_.expandParent){const He=R[0]*(X.width??0);X.x&&X.x<He&&(w.x=He,O.x=O.x-(X.x-He));const Be=R[1]*(X.height??0);X.y&&X.y<Be&&(w.y=Be,O.y=O.y-(X.y-Be))}const ye=mO({width:w.width,prevWidth:A,height:w.height,prevHeight:z,affectsX:u.controlDirection.affectsX,affectsY:u.controlDirection.affectsY}),we={...w,direction:ye};N?.(L,we)!==!1&&(H=!0,S?.(L,we),a(X,F))}).on("end",L=>{H&&(C?.(L,{...w}),o?.({...w}),H=!1)});l.call(q)}function h(){l.on(".drag",null)}return{update:f,destroy:h}}const SO={},fb=e=>{let t;const r=new Set,a=(m,g)=>{const y=typeof m=="function"?m(t):m;if(!Object.is(y,t)){const v=t;t=g??(typeof y!="object"||y===null)?y:Object.assign({},t,y),r.forEach(S=>S(t,v))}},o=()=>t,h={setState:a,getState:o,getInitialState:()=>d,subscribe:m=>(r.add(m),()=>r.delete(m)),destroy:()=>{(SO?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),r.clear()}},d=t=e(a,o,h);return h},wO=e=>e?fb(e):fb,{useDebugValue:EO}=lo,{useSyncExternalStoreWithSelector:CO}=pM,_O=e=>e;function Dw(e,t=_O,r){const a=CO(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,r);return EO(a),a}const db=(e,t)=>{const r=wO(e),a=(o,l=t)=>Dw(r,o,l);return Object.assign(a,r),a},NO=(e,t)=>e?db(e,t):db;function st(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[a,o]of e)if(!Object.is(o,t.get(a)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const a of e)if(!t.has(a))return!1;return!0}const r=Object.keys(e);if(r.length!==Object.keys(t).length)return!1;for(const a of r)if(!Object.prototype.hasOwnProperty.call(t,a)||!Object.is(e[a],t[a]))return!1;return!0}const Kc=Y.createContext(null),MO=Kc.Provider,zw=Wn.error001();function Ue(e,t){const r=Y.useContext(Kc);if(r===null)throw new Error(zw);return Dw(r,e,t)}function lt(){const e=Y.useContext(Kc);if(e===null)throw new Error(zw);return Y.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const hb={display:"none"},kO={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},Lw="react-flow__node-desc",Bw="react-flow__edge-desc",TO="react-flow__aria-live",AO=e=>e.ariaLiveMessage,RO=e=>e.ariaLabelConfig;function OO({rfId:e}){const t=Ue(AO);return b.jsx("div",{id:`${TO}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:kO,children:t})}function jO({rfId:e,disableKeyboardA11y:t}){const r=Ue(RO);return b.jsxs(b.Fragment,{children:[b.jsx("div",{id:`${Lw}-${e}`,style:hb,children:t?r["node.a11yDescription.default"]:r["node.a11yDescription.keyboardDisabled"]}),b.jsx("div",{id:`${Bw}-${e}`,style:hb,children:r["edge.a11yDescription.default"]}),!t&&b.jsx(OO,{rfId:e})]})}const Jc=Y.forwardRef(({position:e="top-left",children:t,className:r,style:a,...o},l)=>{const u=`${e}`.split("-");return b.jsx("div",{className:St(["react-flow__panel",r,...u]),style:a,ref:l,...o,children:t})});Jc.displayName="Panel";function DO({proOptions:e,position:t="bottom-right"}){return e?.hideAttribution?null:b.jsx(Jc,{position:t,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://pro.reactflow.dev",children:b.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const zO=e=>{const t=[],r=[];for(const[,a]of e.nodeLookup)a.selected&&t.push(a.internals.userNode);for(const[,a]of e.edgeLookup)a.selected&&r.push(a);return{selectedNodes:t,selectedEdges:r}},Ju=e=>e.id;function LO(e,t){return st(e.selectedNodes.map(Ju),t.selectedNodes.map(Ju))&&st(e.selectedEdges.map(Ju),t.selectedEdges.map(Ju))}function BO({onSelectionChange:e}){const t=lt(),{selectedNodes:r,selectedEdges:a}=Ue(zO,LO);return Y.useEffect(()=>{const o={nodes:r,edges:a};e?.(o),t.getState().onSelectionChangeHandlers.forEach(l=>l(o))},[r,a,e]),null}const IO=e=>!!e.onSelectionChangeHandlers;function HO({onSelectionChange:e}){const t=Ue(IO);return e||t?b.jsx(BO,{onSelectionChange:e}):null}const Ip=typeof window<"u"?Y.useLayoutEffect:Y.useEffect,Iw=[0,0],PO={x:0,y:0,zoom:1},UO=["nodes","edges","defaultNodes","defaultEdges","onConnect","onConnectStart","onConnectEnd","onClickConnectStart","onClickConnectEnd","nodesDraggable","autoPanOnNodeFocus","nodesConnectable","nodesFocusable","edgesFocusable","edgesReconnectable","elevateNodesOnSelect","elevateEdgesOnSelect","minZoom","maxZoom","nodeExtent","onNodesChange","onEdgesChange","elementsSelectable","connectionMode","snapGrid","snapToGrid","translateExtent","connectOnClick","defaultEdgeOptions","fitView","fitViewOptions","onNodesDelete","onEdgesDelete","onDelete","onNodeDrag","onNodeDragStart","onNodeDragStop","onSelectionDrag","onSelectionDragStart","onSelectionDragStop","onMoveStart","onMove","onMoveEnd","noPanClassName","nodeOrigin","autoPanOnConnect","autoPanOnNodeDrag","onError","connectionRadius","isValidConnection","selectNodesOnDrag","nodeDragThreshold","connectionDragThreshold","onBeforeDelete","debug","autoPanSpeed","ariaLabelConfig","zIndexMode"],pb=[...UO,"rfId"],qO=e=>({setNodes:e.setNodes,setEdges:e.setEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges}),mb={translateExtent:tl,nodeOrigin:Iw,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function VO(e){const{setNodes:t,setEdges:r,setMinZoom:a,setMaxZoom:o,setTranslateExtent:l,setNodeExtent:u,reset:f,setDefaultNodesAndEdges:h}=Ue(qO,st),d=lt();Ip(()=>(h(e.defaultNodes,e.defaultEdges),()=>{m.current=mb,f()}),[]);const m=Y.useRef(mb);return Ip(()=>{for(const g of pb){const y=e[g],v=m.current[g];y!==v&&(typeof e[g]>"u"||(g==="nodes"?t(y):g==="edges"?r(y):g==="minZoom"?a(y):g==="maxZoom"?o(y):g==="translateExtent"?l(y):g==="nodeExtent"?u(y):g==="ariaLabelConfig"?d.setState({ariaLabelConfig:O3(y)}):g==="fitView"?d.setState({fitViewQueued:y}):g==="fitViewOptions"?d.setState({fitViewOptions:y}):d.setState({[g]:y})))}m.current=e},pb.map(g=>e[g])),null}function gb(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function FO(e){const[t,r]=Y.useState(e==="system"?null:e);return Y.useEffect(()=>{if(e!=="system"){r(e);return}const a=gb(),o=()=>r(a?.matches?"dark":"light");return o(),a?.addEventListener("change",o),()=>{a?.removeEventListener("change",o)}},[e]),t!==null?t:gb()?.matches?"dark":"light"}const yb=typeof document<"u"?document:null;function al(e=null,t={target:yb,actInsideInputWithModifier:!0}){const[r,a]=Y.useState(!1),o=Y.useRef(!1),l=Y.useRef(new Set([])),[u,f]=Y.useMemo(()=>{if(e!==null){const d=(Array.isArray(e)?e:[e]).filter(g=>typeof g=="string").map(g=>g.replace("+",`
|
|
10
|
-
`).replace(`
|
|
11
|
-
|
|
12
|
-
`,`
|
|
13
|
-
+`).split(`
|
|
14
|
-
`)),m=d.reduce((g,y)=>g.concat(...y),[]);return[d,m]}return[[],[]]},[e]);return Y.useEffect(()=>{const h=t?.target??yb,d=t?.actInsideInputWithModifier??!0;if(e!==null){const m=v=>{if(o.current=v.ctrlKey||v.metaKey||v.shiftKey||v.altKey,(!o.current||o.current&&!d)&&yw(v))return!1;const C=vb(v.code,f);if(l.current.add(v[C]),xb(u,l.current,!1)){const N=v.composedPath?.()?.[0]||v.target,w=N?.nodeName==="BUTTON"||N?.nodeName==="A";t.preventDefault!==!1&&(o.current||!w)&&v.preventDefault(),a(!0)}},g=v=>{const S=vb(v.code,f);xb(u,l.current,!0)?(a(!1),l.current.clear()):l.current.delete(v[S]),v.key==="Meta"&&l.current.clear(),o.current=!1},y=()=>{l.current.clear(),a(!1)};return h?.addEventListener("keydown",m),h?.addEventListener("keyup",g),window.addEventListener("blur",y),window.addEventListener("contextmenu",y),()=>{h?.removeEventListener("keydown",m),h?.removeEventListener("keyup",g),window.removeEventListener("blur",y),window.removeEventListener("contextmenu",y)}}},[e,a]),r}function xb(e,t,r){return e.filter(a=>r||a.length===t.size).some(a=>a.every(o=>t.has(o)))}function vb(e,t){return t.includes(e)?"code":"key"}const YO=()=>{const e=lt();return Y.useMemo(()=>({zoomIn:t=>{const{panZoom:r}=e.getState();return r?r.scaleBy(1.2,t):Promise.resolve(!1)},zoomOut:t=>{const{panZoom:r}=e.getState();return r?r.scaleBy(1/1.2,t):Promise.resolve(!1)},zoomTo:(t,r)=>{const{panZoom:a}=e.getState();return a?a.scaleTo(t,r):Promise.resolve(!1)},getZoom:()=>e.getState().transform[2],setViewport:async(t,r)=>{const{transform:[a,o,l],panZoom:u}=e.getState();return u?(await u.setViewport({x:t.x??a,y:t.y??o,zoom:t.zoom??l},r),Promise.resolve(!0)):Promise.resolve(!1)},getViewport:()=>{const[t,r,a]=e.getState().transform;return{x:t,y:r,zoom:a}},setCenter:async(t,r,a)=>e.getState().setCenter(t,r,a),fitBounds:async(t,r)=>{const{width:a,height:o,minZoom:l,maxZoom:u,panZoom:f}=e.getState(),h=Nm(t,a,o,l,u,r?.padding??.1);return f?(await f.setViewport(h,{duration:r?.duration,ease:r?.ease,interpolate:r?.interpolate}),Promise.resolve(!0)):Promise.resolve(!1)},screenToFlowPosition:(t,r={})=>{const{transform:a,snapGrid:o,snapToGrid:l,domNode:u}=e.getState();if(!u)return t;const{x:f,y:h}=u.getBoundingClientRect(),d={x:t.x-f,y:t.y-h},m=r.snapGrid??o,g=r.snapToGrid??l;return ml(d,a,g,m)},flowToScreenPosition:t=>{const{transform:r,domNode:a}=e.getState();if(!a)return t;const{x:o,y:l}=a.getBoundingClientRect(),u=Rc(t,r);return{x:u.x+o,y:u.y+l}}}),[])};function Hw(e,t){const r=[],a=new Map,o=[];for(const l of e)if(l.type==="add"){o.push(l);continue}else if(l.type==="remove"||l.type==="replace")a.set(l.id,[l]);else{const u=a.get(l.id);u?u.push(l):a.set(l.id,[l])}for(const l of t){const u=a.get(l.id);if(!u){r.push(l);continue}if(u[0].type==="remove")continue;if(u[0].type==="replace"){r.push({...u[0].item});continue}const f={...l};for(const h of u)XO(h,f);r.push(f)}return o.length&&o.forEach(l=>{l.index!==void 0?r.splice(l.index,0,{...l.item}):r.push({...l.item})}),r}function XO(e,t){switch(e.type){case"select":{t.selected=e.selected;break}case"position":{typeof e.position<"u"&&(t.position=e.position),typeof e.dragging<"u"&&(t.dragging=e.dragging);break}case"dimensions":{typeof e.dimensions<"u"&&(t.measured={...e.dimensions},e.setAttributes&&((e.setAttributes===!0||e.setAttributes==="width")&&(t.width=e.dimensions.width),(e.setAttributes===!0||e.setAttributes==="height")&&(t.height=e.dimensions.height))),typeof e.resizing=="boolean"&&(t.resizing=e.resizing);break}}}function GO(e,t){return Hw(e,t)}function $O(e,t){return Hw(e,t)}function Pi(e,t){return{id:e,type:"select",selected:t}}function to(e,t=new Set,r=!1){const a=[];for(const[o,l]of e){const u=t.has(o);!(l.selected===void 0&&!u)&&l.selected!==u&&(r&&(l.selected=u),a.push(Pi(l.id,u)))}return a}function bb({items:e=[],lookup:t}){const r=[],a=new Map(e.map(o=>[o.id,o]));for(const[o,l]of e.entries()){const u=t.get(l.id),f=u?.internals?.userNode??u;f!==void 0&&f!==l&&r.push({id:l.id,item:l,type:"replace"}),f===void 0&&r.push({item:l,type:"add",index:o})}for(const[o]of t)a.get(o)===void 0&&r.push({id:o,type:"remove"});return r}function Sb(e){return{id:e.id,type:"remove"}}const wb=e=>w3(e),QO=e=>uw(e);function Pw(e){return Y.forwardRef(e)}function Eb(e){const[t,r]=Y.useState(BigInt(0)),[a]=Y.useState(()=>ZO(()=>r(o=>o+BigInt(1))));return Ip(()=>{const o=a.get();o.length&&(e(o),a.reset())},[t]),a}function ZO(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:r=>{t.push(r),e()}}}const Uw=Y.createContext(null);function KO({children:e}){const t=lt(),r=Y.useCallback(f=>{const{nodes:h=[],setNodes:d,hasDefaultNodes:m,onNodesChange:g,nodeLookup:y,fitViewQueued:v,onNodesChangeMiddlewareMap:S}=t.getState();let C=h;for(const w of f)C=typeof w=="function"?w(C):w;let N=bb({items:C,lookup:y});for(const w of S.values())N=w(N);m&&d(C),N.length>0?g?.(N):v&&window.requestAnimationFrame(()=>{const{fitViewQueued:w,nodes:O,setNodes:_}=t.getState();w&&_(O)})},[]),a=Eb(r),o=Y.useCallback(f=>{const{edges:h=[],setEdges:d,hasDefaultEdges:m,onEdgesChange:g,edgeLookup:y}=t.getState();let v=h;for(const S of f)v=typeof S=="function"?S(v):S;m?d(v):g&&g(bb({items:v,lookup:y}))},[]),l=Eb(o),u=Y.useMemo(()=>({nodeQueue:a,edgeQueue:l}),[]);return b.jsx(Uw.Provider,{value:u,children:e})}function JO(){const e=Y.useContext(Uw);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const WO=e=>!!e.panZoom;function jm(){const e=YO(),t=lt(),r=JO(),a=Ue(WO),o=Y.useMemo(()=>{const l=g=>t.getState().nodeLookup.get(g),u=g=>{r.nodeQueue.push(g)},f=g=>{r.edgeQueue.push(g)},h=g=>{const{nodeLookup:y,nodeOrigin:v}=t.getState(),S=wb(g)?g:y.get(g.id),C=S.parentId?mw(S.position,S.measured,S.parentId,y,v):S.position,N={...S,position:C,width:S.measured?.width??S.width,height:S.measured?.height??S.height};return yo(N)},d=(g,y,v={replace:!1})=>{u(S=>S.map(C=>{if(C.id===g){const N=typeof y=="function"?y(C):y;return v.replace&&wb(N)?N:{...C,...N}}return C}))},m=(g,y,v={replace:!1})=>{f(S=>S.map(C=>{if(C.id===g){const N=typeof y=="function"?y(C):y;return v.replace&&QO(N)?N:{...C,...N}}return C}))};return{getNodes:()=>t.getState().nodes.map(g=>({...g})),getNode:g=>l(g)?.internals.userNode,getInternalNode:l,getEdges:()=>{const{edges:g=[]}=t.getState();return g.map(y=>({...y}))},getEdge:g=>t.getState().edgeLookup.get(g),setNodes:u,setEdges:f,addNodes:g=>{const y=Array.isArray(g)?g:[g];r.nodeQueue.push(v=>[...v,...y])},addEdges:g=>{const y=Array.isArray(g)?g:[g];r.edgeQueue.push(v=>[...v,...y])},toObject:()=>{const{nodes:g=[],edges:y=[],transform:v}=t.getState(),[S,C,N]=v;return{nodes:g.map(w=>({...w})),edges:y.map(w=>({...w})),viewport:{x:S,y:C,zoom:N}}},deleteElements:async({nodes:g=[],edges:y=[]})=>{const{nodes:v,edges:S,onNodesDelete:C,onEdgesDelete:N,triggerNodeChanges:w,triggerEdgeChanges:O,onDelete:_,onBeforeDelete:M}=t.getState(),{nodes:I,edges:k}=await M3({nodesToRemove:g,edgesToRemove:y,nodes:v,edges:S,onBeforeDelete:M}),D=k.length>0,U=I.length>0;if(D){const H=k.map(Sb);N?.(k),O(H)}if(U){const H=I.map(Sb);C?.(I),w(H)}return(U||D)&&_?.({nodes:I,edges:k}),{deletedNodes:I,deletedEdges:k}},getIntersectingNodes:(g,y=!0,v)=>{const S=Jv(g),C=S?g:h(g),N=v!==void 0;return C?(v||t.getState().nodes).filter(w=>{const O=t.getState().nodeLookup.get(w.id);if(O&&!S&&(w.id===g.id||!O.internals.positionAbsolute))return!1;const _=yo(N?w:O),M=rl(_,C);return y&&M>0||M>=_.width*_.height||M>=C.width*C.height}):[]},isNodeIntersecting:(g,y,v=!0)=>{const C=Jv(g)?g:h(g);if(!C)return!1;const N=rl(C,y);return v&&N>0||N>=y.width*y.height||N>=C.width*C.height},updateNode:d,updateNodeData:(g,y,v={replace:!1})=>{d(g,S=>{const C=typeof y=="function"?y(S):y;return v.replace?{...S,data:C}:{...S,data:{...S.data,...C}}},v)},updateEdge:m,updateEdgeData:(g,y,v={replace:!1})=>{m(g,S=>{const C=typeof y=="function"?y(S):y;return v.replace?{...S,data:C}:{...S,data:{...S.data,...C}}},v)},getNodesBounds:g=>{const{nodeLookup:y,nodeOrigin:v}=t.getState();return E3(g,{nodeLookup:y,nodeOrigin:v})},getHandleConnections:({type:g,id:y,nodeId:v})=>Array.from(t.getState().connectionLookup.get(`${v}-${g}${y?`-${y}`:""}`)?.values()??[]),getNodeConnections:({type:g,handleId:y,nodeId:v})=>Array.from(t.getState().connectionLookup.get(`${v}${g?y?`-${g}-${y}`:`-${g}`:""}`)?.values()??[]),fitView:async g=>{const y=t.getState().fitViewResolver??R3();return t.setState({fitViewQueued:!0,fitViewOptions:g,fitViewResolver:y}),r.nodeQueue.push(v=>[...v]),y.promise}}},[]);return Y.useMemo(()=>({...o,...e,viewportInitialized:a}),[a])}const Cb=e=>e.selected,ej=typeof window<"u"?window:void 0;function tj({deleteKeyCode:e,multiSelectionKeyCode:t}){const r=lt(),{deleteElements:a}=jm(),o=al(e,{actInsideInputWithModifier:!1}),l=al(t,{target:ej});Y.useEffect(()=>{if(o){const{edges:u,nodes:f}=r.getState();a({nodes:f.filter(Cb),edges:u.filter(Cb)}),r.setState({nodesSelectionActive:!1})}},[o]),Y.useEffect(()=>{r.setState({multiSelectionActive:l})},[l])}function nj(e){const t=lt();Y.useEffect(()=>{const r=()=>{if(!e.current||!(e.current.checkVisibility?.()??!0))return!1;const a=Mm(e.current);(a.height===0||a.width===0)&&t.getState().onError?.("004",Wn.error004()),t.setState({width:a.width||500,height:a.height||500})};if(e.current){r(),window.addEventListener("resize",r);const a=new ResizeObserver(()=>r());return a.observe(e.current),()=>{window.removeEventListener("resize",r),a&&e.current&&a.unobserve(e.current)}}},[])}const Wc={position:"absolute",width:"100%",height:"100%",top:0,left:0},rj=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function ij({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:r=!0,panOnScroll:a=!1,panOnScrollSpeed:o=.5,panOnScrollMode:l=Ki.Free,zoomOnDoubleClick:u=!0,panOnDrag:f=!0,defaultViewport:h,translateExtent:d,minZoom:m,maxZoom:g,zoomActivationKeyCode:y,preventScrolling:v=!0,children:S,noWheelClassName:C,noPanClassName:N,onViewportChange:w,isControlledViewport:O,paneClickDistance:_,selectionOnDrag:M}){const I=lt(),k=Y.useRef(null),{userSelectionActive:D,lib:U,connectionInProgress:H}=Ue(rj,st),q=al(y),L=Y.useRef();nj(k);const P=Y.useCallback(K=>{w?.({x:K[0],y:K[1],zoom:K[2]}),O||I.setState({transform:K})},[w,O]);return Y.useEffect(()=>{if(k.current){L.current=pO({domNode:k.current,minZoom:m,maxZoom:g,translateExtent:d,viewport:h,onDraggingChange:j=>I.setState(F=>F.paneDragging===j?F:{paneDragging:j}),onPanZoomStart:(j,F)=>{const{onViewportChangeStart:$,onMoveStart:Z}=I.getState();Z?.(j,F),$?.(F)},onPanZoom:(j,F)=>{const{onViewportChange:$,onMove:Z}=I.getState();Z?.(j,F),$?.(F)},onPanZoomEnd:(j,F)=>{const{onViewportChangeEnd:$,onMoveEnd:Z}=I.getState();Z?.(j,F),$?.(F)}});const{x:K,y:B,zoom:V}=L.current.getViewport();return I.setState({panZoom:L.current,transform:[K,B,V],domNode:k.current.closest(".react-flow")}),()=>{L.current?.destroy()}}},[]),Y.useEffect(()=>{L.current?.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:r,panOnScroll:a,panOnScrollSpeed:o,panOnScrollMode:l,zoomOnDoubleClick:u,panOnDrag:f,zoomActivationKeyPressed:q,preventScrolling:v,noPanClassName:N,userSelectionActive:D,noWheelClassName:C,lib:U,onTransformChange:P,connectionInProgress:H,selectionOnDrag:M,paneClickDistance:_})},[e,t,r,a,o,l,u,f,q,v,N,D,C,U,P,H,M,_]),b.jsx("div",{className:"react-flow__renderer",ref:k,style:Wc,children:S})}const aj=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function oj(){const{userSelectionActive:e,userSelectionRect:t}=Ue(aj,st);return e&&t?b.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:t.width,height:t.height,transform:`translate(${t.x}px, ${t.y}px)`}}):null}const Xh=(e,t)=>r=>{r.target===t.current&&e?.(r)},sj=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,connectionInProgress:e.connection.inProgress,dragging:e.paneDragging});function lj({isSelecting:e,selectionKeyPressed:t,selectionMode:r=nl.Full,panOnDrag:a,paneClickDistance:o,selectionOnDrag:l,onSelectionStart:u,onSelectionEnd:f,onPaneClick:h,onPaneContextMenu:d,onPaneScroll:m,onPaneMouseEnter:g,onPaneMouseMove:y,onPaneMouseLeave:v,children:S}){const C=lt(),{userSelectionActive:N,elementsSelectable:w,dragging:O,connectionInProgress:_}=Ue(sj,st),M=w&&(e||N),I=Y.useRef(null),k=Y.useRef(),D=Y.useRef(new Set),U=Y.useRef(new Set),H=Y.useRef(!1),q=$=>{if(H.current||_){H.current=!1;return}h?.($),C.getState().resetSelectedElements(),C.setState({nodesSelectionActive:!1})},L=$=>{if(Array.isArray(a)&&a?.includes(2)){$.preventDefault();return}d?.($)},P=m?$=>m($):void 0,K=$=>{H.current&&($.stopPropagation(),H.current=!1)},B=$=>{const{domNode:Z}=C.getState();if(k.current=Z?.getBoundingClientRect(),!k.current)return;const A=$.target===I.current;if(!A&&!!$.target.closest(".nokey")||!e||!(l&&A||t)||$.button!==0||!$.isPrimary)return;$.target?.setPointerCapture?.($.pointerId),H.current=!1;const{x:R,y:te}=Hn($.nativeEvent,k.current);C.setState({userSelectionRect:{width:0,height:0,startX:R,startY:te,x:R,y:te}}),A||($.stopPropagation(),$.preventDefault())},V=$=>{const{userSelectionRect:Z,transform:A,nodeLookup:z,edgeLookup:X,connectionLookup:R,triggerNodeChanges:te,triggerEdgeChanges:ue,defaultEdgeOptions:ce,resetSelectedElements:fe}=C.getState();if(!k.current||!Z)return;const{x:le,y:pe}=Hn($.nativeEvent,k.current),{startX:be,startY:Se}=Z;if(!H.current){const Be=t?0:o;if(Math.hypot(le-be,pe-Se)<=Be)return;fe(),u?.($)}H.current=!0;const ye={startX:be,startY:Se,x:le<be?le:be,y:pe<Se?pe:Se,width:Math.abs(le-be),height:Math.abs(pe-Se)},we=D.current,Re=U.current;D.current=new Set(_m(z,ye,A,r===nl.Partial,!0).map(Be=>Be.id)),U.current=new Set;const He=ce?.selectable??!0;for(const Be of D.current){const Qe=R.get(Be);if(Qe)for(const{edgeId:_t}of Qe.values()){const it=X.get(_t);it&&(it.selectable??He)&&U.current.add(_t)}}if(!Wv(we,D.current)){const Be=to(z,D.current,!0);te(Be)}if(!Wv(Re,U.current)){const Be=to(X,U.current);ue(Be)}C.setState({userSelectionRect:ye,userSelectionActive:!0,nodesSelectionActive:!1})},j=$=>{$.button===0&&($.target?.releasePointerCapture?.($.pointerId),!N&&$.target===I.current&&C.getState().userSelectionRect&&q?.($),C.setState({userSelectionActive:!1,userSelectionRect:null}),H.current&&(f?.($),C.setState({nodesSelectionActive:D.current.size>0})))},F=a===!0||Array.isArray(a)&&a.includes(0);return b.jsxs("div",{className:St(["react-flow__pane",{draggable:F,dragging:O,selection:e}]),onClick:M?void 0:Xh(q,I),onContextMenu:Xh(L,I),onWheel:Xh(P,I),onPointerEnter:M?void 0:g,onPointerMove:M?V:y,onPointerUp:M?j:void 0,onPointerDownCapture:M?B:void 0,onClickCapture:M?K:void 0,onPointerLeave:v,ref:I,style:Wc,children:[S,b.jsx(oj,{})]})}function Hp({id:e,store:t,unselect:r=!1,nodeRef:a}){const{addSelectedNodes:o,unselectNodesAndEdges:l,multiSelectionActive:u,nodeLookup:f,onError:h}=t.getState(),d=f.get(e);if(!d){h?.("012",Wn.error012(e));return}t.setState({nodesSelectionActive:!1}),d.selected?(r||d.selected&&u)&&(l({nodes:[d],edges:[]}),requestAnimationFrame(()=>a?.current?.blur())):o([e])}function qw({nodeRef:e,disabled:t=!1,noDragClassName:r,handleSelector:a,nodeId:o,isSelectable:l,nodeClickDistance:u}){const f=lt(),[h,d]=Y.useState(!1),m=Y.useRef();return Y.useEffect(()=>{m.current=eO({getStoreItems:()=>f.getState(),onNodeMouseDown:g=>{Hp({id:g,store:f,nodeRef:e})},onDragStart:()=>{d(!0)},onDragStop:()=>{d(!1)}})},[]),Y.useEffect(()=>{if(!(t||!e.current||!m.current))return m.current.update({noDragClassName:r,handleSelector:a,domNode:e.current,isSelectable:l,nodeId:o,nodeClickDistance:u}),()=>{m.current?.destroy()}},[r,a,t,l,e,o,u]),h}const uj=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function Vw(){const e=lt();return Y.useCallback(r=>{const{nodeExtent:a,snapToGrid:o,snapGrid:l,nodesDraggable:u,onError:f,updateNodePositions:h,nodeLookup:d,nodeOrigin:m}=e.getState(),g=new Map,y=uj(u),v=o?l[0]:5,S=o?l[1]:5,C=r.direction.x*v*r.factor,N=r.direction.y*S*r.factor;for(const[,w]of d){if(!y(w))continue;let O={x:w.internals.positionAbsolute.x+C,y:w.internals.positionAbsolute.y+N};o&&(O=pl(O,l));const{position:_,positionAbsolute:M}=cw({nodeId:w.id,nextPosition:O,nodeLookup:d,nodeExtent:a,nodeOrigin:m,onError:f});w.position=_,w.internals.positionAbsolute=M,g.set(w.id,w)}h(g)},[])}const Dm=Y.createContext(null),cj=Dm.Provider;Dm.Consumer;const Fw=()=>Y.useContext(Dm),fj=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),dj=(e,t,r)=>a=>{const{connectionClickStartHandle:o,connectionMode:l,connection:u}=a,{fromHandle:f,toHandle:h,isValid:d}=u,m=h?.nodeId===e&&h?.id===t&&h?.type===r;return{connectingFrom:f?.nodeId===e&&f?.id===t&&f?.type===r,connectingTo:m,clickConnecting:o?.nodeId===e&&o?.id===t&&o?.type===r,isPossibleEndHandle:l===mo.Strict?f?.type!==r:e!==f?.nodeId||t!==f?.id,connectionInProcess:!!f,clickConnectionInProcess:!!o,valid:m&&d}};function hj({type:e="source",position:t=ve.Top,isValidConnection:r,isConnectable:a=!0,isConnectableStart:o=!0,isConnectableEnd:l=!0,id:u,onConnect:f,children:h,className:d,onMouseDown:m,onTouchStart:g,...y},v){const S=u||null,C=e==="target",N=lt(),w=Fw(),{connectOnClick:O,noPanClassName:_,rfId:M}=Ue(fj,st),{connectingFrom:I,connectingTo:k,clickConnecting:D,isPossibleEndHandle:U,connectionInProcess:H,clickConnectionInProcess:q,valid:L}=Ue(dj(w,S,e),st);w||N.getState().onError?.("010",Wn.error010());const P=V=>{const{defaultEdgeOptions:j,onConnect:F,hasDefaultEdges:$}=N.getState(),Z={...j,...V};if($){const{edges:A,setEdges:z}=N.getState();z(I3(Z,A))}F?.(Z),f?.(Z)},K=V=>{if(!w)return;const j=xw(V.nativeEvent);if(o&&(j&&V.button===0||!j)){const F=N.getState();Bp.onPointerDown(V.nativeEvent,{handleDomNode:V.currentTarget,autoPanOnConnect:F.autoPanOnConnect,connectionMode:F.connectionMode,connectionRadius:F.connectionRadius,domNode:F.domNode,nodeLookup:F.nodeLookup,lib:F.lib,isTarget:C,handleId:S,nodeId:w,flowId:F.rfId,panBy:F.panBy,cancelConnection:F.cancelConnection,onConnectStart:F.onConnectStart,onConnectEnd:(...$)=>N.getState().onConnectEnd?.(...$),updateConnection:F.updateConnection,onConnect:P,isValidConnection:r||((...$)=>N.getState().isValidConnection?.(...$)??!0),getTransform:()=>N.getState().transform,getFromHandle:()=>N.getState().connection.fromHandle,autoPanSpeed:F.autoPanSpeed,dragThreshold:F.connectionDragThreshold})}j?m?.(V):g?.(V)},B=V=>{const{onClickConnectStart:j,onClickConnectEnd:F,connectionClickStartHandle:$,connectionMode:Z,isValidConnection:A,lib:z,rfId:X,nodeLookup:R,connection:te}=N.getState();if(!w||!$&&!o)return;if(!$){j?.(V.nativeEvent,{nodeId:w,handleId:S,handleType:e}),N.setState({connectionClickStartHandle:{nodeId:w,type:e,id:S}});return}const ue=gw(V.target),ce=r||A,{connection:fe,isValid:le}=Bp.isValid(V.nativeEvent,{handle:{nodeId:w,id:S,type:e},connectionMode:Z,fromNodeId:$.nodeId,fromHandleId:$.id||null,fromType:$.type,isValidConnection:ce,flowId:X,doc:ue,lib:z,nodeLookup:R});le&&fe&&P(fe);const pe=structuredClone(te);delete pe.inProgress,pe.toPosition=pe.toHandle?pe.toHandle.position:null,F?.(V,pe),N.setState({connectionClickStartHandle:null})};return b.jsx("div",{"data-handleid":S,"data-nodeid":w,"data-handlepos":t,"data-id":`${M}-${w}-${S}-${e}`,className:St(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",_,d,{source:!C,target:C,connectable:a,connectablestart:o,connectableend:l,clickconnecting:D,connectingfrom:I,connectingto:k,valid:L,connectionindicator:a&&(!H||U)&&(H||q?l:o)}]),onMouseDown:K,onTouchStart:K,onClick:O?B:void 0,ref:v,...y,children:h})}const Oc=Y.memo(Pw(hj));function pj({data:e,isConnectable:t,sourcePosition:r=ve.Bottom}){return b.jsxs(b.Fragment,{children:[e?.label,b.jsx(Oc,{type:"source",position:r,isConnectable:t})]})}function mj({data:e,isConnectable:t,targetPosition:r=ve.Top,sourcePosition:a=ve.Bottom}){return b.jsxs(b.Fragment,{children:[b.jsx(Oc,{type:"target",position:r,isConnectable:t}),e?.label,b.jsx(Oc,{type:"source",position:a,isConnectable:t})]})}function gj(){return null}function yj({data:e,isConnectable:t,targetPosition:r=ve.Top}){return b.jsxs(b.Fragment,{children:[b.jsx(Oc,{type:"target",position:r,isConnectable:t}),e?.label]})}const jc={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},_b={input:pj,default:mj,output:yj,group:gj};function xj(e){return e.internals.handleBounds===void 0?{width:e.width??e.initialWidth??e.style?.width,height:e.height??e.initialHeight??e.style?.height}:{width:e.width??e.style?.width,height:e.height??e.style?.height}}const vj=e=>{const{width:t,height:r,x:a,y:o}=hl(e.nodeLookup,{filter:l=>!!l.selected});return{width:In(t)?t:null,height:In(r)?r:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${a}px,${o}px)`}};function bj({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:r}){const a=lt(),{width:o,height:l,transformString:u,userSelectionActive:f}=Ue(vj,st),h=Vw(),d=Y.useRef(null);Y.useEffect(()=>{r||d.current?.focus({preventScroll:!0})},[r]);const m=!f&&o!==null&&l!==null;if(qw({nodeRef:d,disabled:!m}),!m)return null;const g=e?v=>{const S=a.getState().nodes.filter(C=>C.selected);e(v,S)}:void 0,y=v=>{Object.prototype.hasOwnProperty.call(jc,v.key)&&(v.preventDefault(),h({direction:jc[v.key],factor:v.shiftKey?4:1}))};return b.jsx("div",{className:St(["react-flow__nodesselection","react-flow__container",t]),style:{transform:u},children:b.jsx("div",{ref:d,className:"react-flow__nodesselection-rect",onContextMenu:g,tabIndex:r?void 0:-1,onKeyDown:r?void 0:y,style:{width:o,height:l}})})}const Nb=typeof window<"u"?window:void 0,Sj=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function Yw({children:e,onPaneClick:t,onPaneMouseEnter:r,onPaneMouseMove:a,onPaneMouseLeave:o,onPaneContextMenu:l,onPaneScroll:u,paneClickDistance:f,deleteKeyCode:h,selectionKeyCode:d,selectionOnDrag:m,selectionMode:g,onSelectionStart:y,onSelectionEnd:v,multiSelectionKeyCode:S,panActivationKeyCode:C,zoomActivationKeyCode:N,elementsSelectable:w,zoomOnScroll:O,zoomOnPinch:_,panOnScroll:M,panOnScrollSpeed:I,panOnScrollMode:k,zoomOnDoubleClick:D,panOnDrag:U,defaultViewport:H,translateExtent:q,minZoom:L,maxZoom:P,preventScrolling:K,onSelectionContextMenu:B,noWheelClassName:V,noPanClassName:j,disableKeyboardA11y:F,onViewportChange:$,isControlledViewport:Z}){const{nodesSelectionActive:A,userSelectionActive:z}=Ue(Sj,st),X=al(d,{target:Nb}),R=al(C,{target:Nb}),te=R||U,ue=R||M,ce=m&&te!==!0,fe=X||z||ce;return tj({deleteKeyCode:h,multiSelectionKeyCode:S}),b.jsx(ij,{onPaneContextMenu:l,elementsSelectable:w,zoomOnScroll:O,zoomOnPinch:_,panOnScroll:ue,panOnScrollSpeed:I,panOnScrollMode:k,zoomOnDoubleClick:D,panOnDrag:!X&&te,defaultViewport:H,translateExtent:q,minZoom:L,maxZoom:P,zoomActivationKeyCode:N,preventScrolling:K,noWheelClassName:V,noPanClassName:j,onViewportChange:$,isControlledViewport:Z,paneClickDistance:f,selectionOnDrag:ce,children:b.jsxs(lj,{onSelectionStart:y,onSelectionEnd:v,onPaneClick:t,onPaneMouseEnter:r,onPaneMouseMove:a,onPaneMouseLeave:o,onPaneContextMenu:l,onPaneScroll:u,panOnDrag:te,isSelecting:!!fe,selectionMode:g,selectionKeyPressed:X,paneClickDistance:f,selectionOnDrag:ce,children:[e,A&&b.jsx(bj,{onSelectionContextMenu:B,noPanClassName:j,disableKeyboardA11y:F})]})})}Yw.displayName="FlowRenderer";const wj=Y.memo(Yw),Ej=e=>t=>e?_m(t.nodeLookup,{x:0,y:0,width:t.width,height:t.height},t.transform,!0).map(r=>r.id):Array.from(t.nodeLookup.keys());function Cj(e){return Ue(Y.useCallback(Ej(e),[e]),st)}const _j=e=>e.updateNodeInternals;function Nj(){const e=Ue(_j),[t]=Y.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(r=>{const a=new Map;r.forEach(o=>{const l=o.target.getAttribute("data-id");a.set(l,{id:l,nodeElement:o.target,force:!0})}),e(a)}));return Y.useEffect(()=>()=>{t?.disconnect()},[t]),t}function Mj({node:e,nodeType:t,hasDimensions:r,resizeObserver:a}){const o=lt(),l=Y.useRef(null),u=Y.useRef(null),f=Y.useRef(e.sourcePosition),h=Y.useRef(e.targetPosition),d=Y.useRef(t),m=r&&!!e.internals.handleBounds;return Y.useEffect(()=>{l.current&&!e.hidden&&(!m||u.current!==l.current)&&(u.current&&a?.unobserve(u.current),a?.observe(l.current),u.current=l.current)},[m,e.hidden]),Y.useEffect(()=>()=>{u.current&&(a?.unobserve(u.current),u.current=null)},[]),Y.useEffect(()=>{if(l.current){const g=d.current!==t,y=f.current!==e.sourcePosition,v=h.current!==e.targetPosition;(g||y||v)&&(d.current=t,f.current=e.sourcePosition,h.current=e.targetPosition,o.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:l.current,force:!0}]])))}},[e.id,t,e.sourcePosition,e.targetPosition]),l}function kj({id:e,onClick:t,onMouseEnter:r,onMouseMove:a,onMouseLeave:o,onContextMenu:l,onDoubleClick:u,nodesDraggable:f,elementsSelectable:h,nodesConnectable:d,nodesFocusable:m,resizeObserver:g,noDragClassName:y,noPanClassName:v,disableKeyboardA11y:S,rfId:C,nodeTypes:N,nodeClickDistance:w,onError:O}){const{node:_,internals:M,isParent:I}=Ue(le=>{const pe=le.nodeLookup.get(e),be=le.parentLookup.has(e);return{node:pe,internals:pe.internals,isParent:be}},st);let k=_.type||"default",D=N?.[k]||_b[k];D===void 0&&(O?.("003",Wn.error003(k)),k="default",D=N?.default||_b.default);const U=!!(_.draggable||f&&typeof _.draggable>"u"),H=!!(_.selectable||h&&typeof _.selectable>"u"),q=!!(_.connectable||d&&typeof _.connectable>"u"),L=!!(_.focusable||m&&typeof _.focusable>"u"),P=lt(),K=pw(_),B=Mj({node:_,nodeType:k,hasDimensions:K,resizeObserver:g}),V=qw({nodeRef:B,disabled:_.hidden||!U,noDragClassName:y,handleSelector:_.dragHandle,nodeId:e,isSelectable:H,nodeClickDistance:w}),j=Vw();if(_.hidden)return null;const F=Tr(_),$=xj(_),Z=H||U||t||r||a||o,A=r?le=>r(le,{...M.userNode}):void 0,z=a?le=>a(le,{...M.userNode}):void 0,X=o?le=>o(le,{...M.userNode}):void 0,R=l?le=>l(le,{...M.userNode}):void 0,te=u?le=>u(le,{...M.userNode}):void 0,ue=le=>{const{selectNodesOnDrag:pe,nodeDragThreshold:be}=P.getState();H&&(!pe||!U||be>0)&&Hp({id:e,store:P,nodeRef:B}),t&&t(le,{...M.userNode})},ce=le=>{if(!(yw(le.nativeEvent)||S)){if(aw.includes(le.key)&&H){const pe=le.key==="Escape";Hp({id:e,store:P,unselect:pe,nodeRef:B})}else if(U&&_.selected&&Object.prototype.hasOwnProperty.call(jc,le.key)){le.preventDefault();const{ariaLabelConfig:pe}=P.getState();P.setState({ariaLiveMessage:pe["node.a11yDescription.ariaLiveMessage"]({direction:le.key.replace("Arrow","").toLowerCase(),x:~~M.positionAbsolute.x,y:~~M.positionAbsolute.y})}),j({direction:jc[le.key],factor:le.shiftKey?4:1})}}},fe=()=>{if(S||!B.current?.matches(":focus-visible"))return;const{transform:le,width:pe,height:be,autoPanOnNodeFocus:Se,setCenter:ye}=P.getState();if(!Se)return;_m(new Map([[e,_]]),{x:0,y:0,width:pe,height:be},le,!0).length>0||ye(_.position.x+F.width/2,_.position.y+F.height/2,{zoom:le[2]})};return b.jsx("div",{className:St(["react-flow__node",`react-flow__node-${k}`,{[v]:U},_.className,{selected:_.selected,selectable:H,parent:I,draggable:U,dragging:V}]),ref:B,style:{zIndex:M.z,transform:`translate(${M.positionAbsolute.x}px,${M.positionAbsolute.y}px)`,pointerEvents:Z?"all":"none",visibility:K?"visible":"hidden",..._.style,...$},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:A,onMouseMove:z,onMouseLeave:X,onContextMenu:R,onClick:ue,onDoubleClick:te,onKeyDown:L?ce:void 0,tabIndex:L?0:void 0,onFocus:L?fe:void 0,role:_.ariaRole??(L?"group":void 0),"aria-roledescription":"node","aria-describedby":S?void 0:`${Lw}-${C}`,"aria-label":_.ariaLabel,..._.domAttributes,children:b.jsx(cj,{value:e,children:b.jsx(D,{id:e,data:_.data,type:k,positionAbsoluteX:M.positionAbsolute.x,positionAbsoluteY:M.positionAbsolute.y,selected:_.selected??!1,selectable:H,draggable:U,deletable:_.deletable??!0,isConnectable:q,sourcePosition:_.sourcePosition,targetPosition:_.targetPosition,dragging:V,dragHandle:_.dragHandle,zIndex:M.z,parentId:_.parentId,...F})})})}var Tj=Y.memo(kj);const Aj=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function Xw(e){const{nodesDraggable:t,nodesConnectable:r,nodesFocusable:a,elementsSelectable:o,onError:l}=Ue(Aj,st),u=Cj(e.onlyRenderVisibleElements),f=Nj();return b.jsx("div",{className:"react-flow__nodes",style:Wc,children:u.map(h=>b.jsx(Tj,{id:h,nodeTypes:e.nodeTypes,nodeExtent:e.nodeExtent,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,resizeObserver:f,nodesDraggable:t,nodesConnectable:r,nodesFocusable:a,elementsSelectable:o,nodeClickDistance:e.nodeClickDistance,onError:l},h))})}Xw.displayName="NodeRenderer";const Rj=Y.memo(Xw);function Oj(e){return Ue(Y.useCallback(r=>{if(!e)return r.edges.map(o=>o.id);const a=[];if(r.width&&r.height)for(const o of r.edges){const l=r.nodeLookup.get(o.source),u=r.nodeLookup.get(o.target);l&&u&&z3({sourceNode:l,targetNode:u,width:r.width,height:r.height,transform:r.transform})&&a.push(o.id)}return a},[e]),st)}const jj=({color:e="none",strokeWidth:t=1})=>{const r={strokeWidth:t,...e&&{stroke:e}};return b.jsx("polyline",{className:"arrow",style:r,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},Dj=({color:e="none",strokeWidth:t=1})=>{const r={strokeWidth:t,...e&&{stroke:e,fill:e}};return b.jsx("polyline",{className:"arrowclosed",style:r,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},Mb={[Tc.Arrow]:jj,[Tc.ArrowClosed]:Dj};function zj(e){const t=lt();return Y.useMemo(()=>Object.prototype.hasOwnProperty.call(Mb,e)?Mb[e]:(t.getState().onError?.("009",Wn.error009(e)),null),[e])}const Lj=({id:e,type:t,color:r,width:a=12.5,height:o=12.5,markerUnits:l="strokeWidth",strokeWidth:u,orient:f="auto-start-reverse"})=>{const h=zj(t);return h?b.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${a}`,markerHeight:`${o}`,viewBox:"-10 -10 20 20",markerUnits:l,orient:f,refX:"0",refY:"0",children:b.jsx(h,{color:r,strokeWidth:u})}):null},Gw=({defaultColor:e,rfId:t})=>{const r=Ue(l=>l.edges),a=Ue(l=>l.defaultEdgeOptions),o=Y.useMemo(()=>V3(r,{id:t,defaultColor:e,defaultMarkerStart:a?.markerStart,defaultMarkerEnd:a?.markerEnd}),[r,a,t,e]);return o.length?b.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:b.jsx("defs",{children:o.map(l=>b.jsx(Lj,{id:l.id,type:l.type,color:l.color,width:l.width,height:l.height,markerUnits:l.markerUnits,strokeWidth:l.strokeWidth,orient:l.orient},l.id))})}):null};Gw.displayName="MarkerDefinitions";var Bj=Y.memo(Gw);function $w({x:e,y:t,label:r,labelStyle:a,labelShowBg:o=!0,labelBgStyle:l,labelBgPadding:u=[2,4],labelBgBorderRadius:f=2,children:h,className:d,...m}){const[g,y]=Y.useState({x:1,y:0,width:0,height:0}),v=St(["react-flow__edge-textwrapper",d]),S=Y.useRef(null);return Y.useEffect(()=>{if(S.current){const C=S.current.getBBox();y({x:C.x,y:C.y,width:C.width,height:C.height})}},[r]),r?b.jsxs("g",{transform:`translate(${e-g.width/2} ${t-g.height/2})`,className:v,visibility:g.width?"visible":"hidden",...m,children:[o&&b.jsx("rect",{width:g.width+2*u[0],x:-u[0],y:-u[1],height:g.height+2*u[1],className:"react-flow__edge-textbg",style:l,rx:f,ry:f}),b.jsx("text",{className:"react-flow__edge-text",y:g.height/2,dy:"0.3em",ref:S,style:a,children:r}),h]}):null}$w.displayName="EdgeText";const Ij=Y.memo($w);function ef({path:e,labelX:t,labelY:r,label:a,labelStyle:o,labelShowBg:l,labelBgStyle:u,labelBgPadding:f,labelBgBorderRadius:h,interactionWidth:d=20,...m}){return b.jsxs(b.Fragment,{children:[b.jsx("path",{...m,d:e,fill:"none",className:St(["react-flow__edge-path",m.className])}),d?b.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:d,className:"react-flow__edge-interaction"}):null,a&&In(t)&&In(r)?b.jsx(Ij,{x:t,y:r,label:a,labelStyle:o,labelShowBg:l,labelBgStyle:u,labelBgPadding:f,labelBgBorderRadius:h}):null]})}function kb({pos:e,x1:t,y1:r,x2:a,y2:o}){return e===ve.Left||e===ve.Right?[.5*(t+a),r]:[t,.5*(r+o)]}function Qw({sourceX:e,sourceY:t,sourcePosition:r=ve.Bottom,targetX:a,targetY:o,targetPosition:l=ve.Top}){const[u,f]=kb({pos:r,x1:e,y1:t,x2:a,y2:o}),[h,d]=kb({pos:l,x1:a,y1:o,x2:e,y2:t}),[m,g,y,v]=vw({sourceX:e,sourceY:t,targetX:a,targetY:o,sourceControlX:u,sourceControlY:f,targetControlX:h,targetControlY:d});return[`M${e},${t} C${u},${f} ${h},${d} ${a},${o}`,m,g,y,v]}function Zw(e){return Y.memo(({id:t,sourceX:r,sourceY:a,targetX:o,targetY:l,sourcePosition:u,targetPosition:f,label:h,labelStyle:d,labelShowBg:m,labelBgStyle:g,labelBgPadding:y,labelBgBorderRadius:v,style:S,markerEnd:C,markerStart:N,interactionWidth:w})=>{const[O,_,M]=Qw({sourceX:r,sourceY:a,sourcePosition:u,targetX:o,targetY:l,targetPosition:f}),I=e.isInternal?void 0:t;return b.jsx(ef,{id:I,path:O,labelX:_,labelY:M,label:h,labelStyle:d,labelShowBg:m,labelBgStyle:g,labelBgPadding:y,labelBgBorderRadius:v,style:S,markerEnd:C,markerStart:N,interactionWidth:w})})}const Hj=Zw({isInternal:!1}),Kw=Zw({isInternal:!0});Hj.displayName="SimpleBezierEdge";Kw.displayName="SimpleBezierEdgeInternal";function Jw(e){return Y.memo(({id:t,sourceX:r,sourceY:a,targetX:o,targetY:l,label:u,labelStyle:f,labelShowBg:h,labelBgStyle:d,labelBgPadding:m,labelBgBorderRadius:g,style:y,sourcePosition:v=ve.Bottom,targetPosition:S=ve.Top,markerEnd:C,markerStart:N,pathOptions:w,interactionWidth:O})=>{const[_,M,I]=Dp({sourceX:r,sourceY:a,sourcePosition:v,targetX:o,targetY:l,targetPosition:S,borderRadius:w?.borderRadius,offset:w?.offset,stepPosition:w?.stepPosition}),k=e.isInternal?void 0:t;return b.jsx(ef,{id:k,path:_,labelX:M,labelY:I,label:u,labelStyle:f,labelShowBg:h,labelBgStyle:d,labelBgPadding:m,labelBgBorderRadius:g,style:y,markerEnd:C,markerStart:N,interactionWidth:O})})}const Ww=Jw({isInternal:!1}),eE=Jw({isInternal:!0});Ww.displayName="SmoothStepEdge";eE.displayName="SmoothStepEdgeInternal";function tE(e){return Y.memo(({id:t,...r})=>{const a=e.isInternal?void 0:t;return b.jsx(Ww,{...r,id:a,pathOptions:Y.useMemo(()=>({borderRadius:0,offset:r.pathOptions?.offset}),[r.pathOptions?.offset])})})}const Pj=tE({isInternal:!1}),nE=tE({isInternal:!0});Pj.displayName="StepEdge";nE.displayName="StepEdgeInternal";function rE(e){return Y.memo(({id:t,sourceX:r,sourceY:a,targetX:o,targetY:l,label:u,labelStyle:f,labelShowBg:h,labelBgStyle:d,labelBgPadding:m,labelBgBorderRadius:g,style:y,markerEnd:v,markerStart:S,interactionWidth:C})=>{const[N,w,O]=ww({sourceX:r,sourceY:a,targetX:o,targetY:l}),_=e.isInternal?void 0:t;return b.jsx(ef,{id:_,path:N,labelX:w,labelY:O,label:u,labelStyle:f,labelShowBg:h,labelBgStyle:d,labelBgPadding:m,labelBgBorderRadius:g,style:y,markerEnd:v,markerStart:S,interactionWidth:C})})}const Uj=rE({isInternal:!1}),iE=rE({isInternal:!0});Uj.displayName="StraightEdge";iE.displayName="StraightEdgeInternal";function aE(e){return Y.memo(({id:t,sourceX:r,sourceY:a,targetX:o,targetY:l,sourcePosition:u=ve.Bottom,targetPosition:f=ve.Top,label:h,labelStyle:d,labelShowBg:m,labelBgStyle:g,labelBgPadding:y,labelBgBorderRadius:v,style:S,markerEnd:C,markerStart:N,pathOptions:w,interactionWidth:O})=>{const[_,M,I]=bw({sourceX:r,sourceY:a,sourcePosition:u,targetX:o,targetY:l,targetPosition:f,curvature:w?.curvature}),k=e.isInternal?void 0:t;return b.jsx(ef,{id:k,path:_,labelX:M,labelY:I,label:h,labelStyle:d,labelShowBg:m,labelBgStyle:g,labelBgPadding:y,labelBgBorderRadius:v,style:S,markerEnd:C,markerStart:N,interactionWidth:O})})}const qj=aE({isInternal:!1}),oE=aE({isInternal:!0});qj.displayName="BezierEdge";oE.displayName="BezierEdgeInternal";const Tb={default:oE,straight:iE,step:nE,smoothstep:eE,simplebezier:Kw},Ab={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},Vj=(e,t,r)=>r===ve.Left?e-t:r===ve.Right?e+t:e,Fj=(e,t,r)=>r===ve.Top?e-t:r===ve.Bottom?e+t:e,Rb="react-flow__edgeupdater";function Ob({position:e,centerX:t,centerY:r,radius:a=10,onMouseDown:o,onMouseEnter:l,onMouseOut:u,type:f}){return b.jsx("circle",{onMouseDown:o,onMouseEnter:l,onMouseOut:u,className:St([Rb,`${Rb}-${f}`]),cx:Vj(t,a,e),cy:Fj(r,a,e),r:a,stroke:"transparent",fill:"transparent"})}function Yj({isReconnectable:e,reconnectRadius:t,edge:r,sourceX:a,sourceY:o,targetX:l,targetY:u,sourcePosition:f,targetPosition:h,onReconnect:d,onReconnectStart:m,onReconnectEnd:g,setReconnecting:y,setUpdateHover:v}){const S=lt(),C=(M,I)=>{if(M.button!==0)return;const{autoPanOnConnect:k,domNode:D,connectionMode:U,connectionRadius:H,lib:q,onConnectStart:L,cancelConnection:P,nodeLookup:K,rfId:B,panBy:V,updateConnection:j}=S.getState(),F=I.type==="target",$=(z,X)=>{y(!1),g?.(z,r,I.type,X)},Z=z=>d?.(r,z),A=(z,X)=>{y(!0),m?.(M,r,I.type),L?.(z,X)};Bp.onPointerDown(M.nativeEvent,{autoPanOnConnect:k,connectionMode:U,connectionRadius:H,domNode:D,handleId:I.id,nodeId:I.nodeId,nodeLookup:K,isTarget:F,edgeUpdaterType:I.type,lib:q,flowId:B,cancelConnection:P,panBy:V,isValidConnection:(...z)=>S.getState().isValidConnection?.(...z)??!0,onConnect:Z,onConnectStart:A,onConnectEnd:(...z)=>S.getState().onConnectEnd?.(...z),onReconnectEnd:$,updateConnection:j,getTransform:()=>S.getState().transform,getFromHandle:()=>S.getState().connection.fromHandle,dragThreshold:S.getState().connectionDragThreshold,handleDomNode:M.currentTarget})},N=M=>C(M,{nodeId:r.target,id:r.targetHandle??null,type:"target"}),w=M=>C(M,{nodeId:r.source,id:r.sourceHandle??null,type:"source"}),O=()=>v(!0),_=()=>v(!1);return b.jsxs(b.Fragment,{children:[(e===!0||e==="source")&&b.jsx(Ob,{position:f,centerX:a,centerY:o,radius:t,onMouseDown:N,onMouseEnter:O,onMouseOut:_,type:"source"}),(e===!0||e==="target")&&b.jsx(Ob,{position:h,centerX:l,centerY:u,radius:t,onMouseDown:w,onMouseEnter:O,onMouseOut:_,type:"target"})]})}function Xj({id:e,edgesFocusable:t,edgesReconnectable:r,elementsSelectable:a,onClick:o,onDoubleClick:l,onContextMenu:u,onMouseEnter:f,onMouseMove:h,onMouseLeave:d,reconnectRadius:m,onReconnect:g,onReconnectStart:y,onReconnectEnd:v,rfId:S,edgeTypes:C,noPanClassName:N,onError:w,disableKeyboardA11y:O}){let _=Ue(ye=>ye.edgeLookup.get(e));const M=Ue(ye=>ye.defaultEdgeOptions);_=M?{...M,..._}:_;let I=_.type||"default",k=C?.[I]||Tb[I];k===void 0&&(w?.("011",Wn.error011(I)),I="default",k=C?.default||Tb.default);const D=!!(_.focusable||t&&typeof _.focusable>"u"),U=typeof g<"u"&&(_.reconnectable||r&&typeof _.reconnectable>"u"),H=!!(_.selectable||a&&typeof _.selectable>"u"),q=Y.useRef(null),[L,P]=Y.useState(!1),[K,B]=Y.useState(!1),V=lt(),{zIndex:j,sourceX:F,sourceY:$,targetX:Z,targetY:A,sourcePosition:z,targetPosition:X}=Ue(Y.useCallback(ye=>{const we=ye.nodeLookup.get(_.source),Re=ye.nodeLookup.get(_.target);if(!we||!Re)return{zIndex:_.zIndex,...Ab};const He=q3({id:e,sourceNode:we,targetNode:Re,sourceHandle:_.sourceHandle||null,targetHandle:_.targetHandle||null,connectionMode:ye.connectionMode,onError:w});return{zIndex:D3({selected:_.selected,zIndex:_.zIndex,sourceNode:we,targetNode:Re,elevateOnSelect:ye.elevateEdgesOnSelect,zIndexMode:ye.zIndexMode}),...He||Ab}},[_.source,_.target,_.sourceHandle,_.targetHandle,_.selected,_.zIndex]),st),R=Y.useMemo(()=>_.markerStart?`url('#${zp(_.markerStart,S)}')`:void 0,[_.markerStart,S]),te=Y.useMemo(()=>_.markerEnd?`url('#${zp(_.markerEnd,S)}')`:void 0,[_.markerEnd,S]);if(_.hidden||F===null||$===null||Z===null||A===null)return null;const ue=ye=>{const{addSelectedEdges:we,unselectNodesAndEdges:Re,multiSelectionActive:He}=V.getState();H&&(V.setState({nodesSelectionActive:!1}),_.selected&&He?(Re({nodes:[],edges:[_]}),q.current?.blur()):we([e])),o&&o(ye,_)},ce=l?ye=>{l(ye,{..._})}:void 0,fe=u?ye=>{u(ye,{..._})}:void 0,le=f?ye=>{f(ye,{..._})}:void 0,pe=h?ye=>{h(ye,{..._})}:void 0,be=d?ye=>{d(ye,{..._})}:void 0,Se=ye=>{if(!O&&aw.includes(ye.key)&&H){const{unselectNodesAndEdges:we,addSelectedEdges:Re}=V.getState();ye.key==="Escape"?(q.current?.blur(),we({edges:[_]})):Re([e])}};return b.jsx("svg",{style:{zIndex:j},children:b.jsxs("g",{className:St(["react-flow__edge",`react-flow__edge-${I}`,_.className,N,{selected:_.selected,animated:_.animated,inactive:!H&&!o,updating:L,selectable:H}]),onClick:ue,onDoubleClick:ce,onContextMenu:fe,onMouseEnter:le,onMouseMove:pe,onMouseLeave:be,onKeyDown:D?Se:void 0,tabIndex:D?0:void 0,role:_.ariaRole??(D?"group":"img"),"aria-roledescription":"edge","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":_.ariaLabel===null?void 0:_.ariaLabel||`Edge from ${_.source} to ${_.target}`,"aria-describedby":D?`${Bw}-${S}`:void 0,ref:q,..._.domAttributes,children:[!K&&b.jsx(k,{id:e,source:_.source,target:_.target,type:_.type,selected:_.selected,animated:_.animated,selectable:H,deletable:_.deletable??!0,label:_.label,labelStyle:_.labelStyle,labelShowBg:_.labelShowBg,labelBgStyle:_.labelBgStyle,labelBgPadding:_.labelBgPadding,labelBgBorderRadius:_.labelBgBorderRadius,sourceX:F,sourceY:$,targetX:Z,targetY:A,sourcePosition:z,targetPosition:X,data:_.data,style:_.style,sourceHandleId:_.sourceHandle,targetHandleId:_.targetHandle,markerStart:R,markerEnd:te,pathOptions:"pathOptions"in _?_.pathOptions:void 0,interactionWidth:_.interactionWidth}),U&&b.jsx(Yj,{edge:_,isReconnectable:U,reconnectRadius:m,onReconnect:g,onReconnectStart:y,onReconnectEnd:v,sourceX:F,sourceY:$,targetX:Z,targetY:A,sourcePosition:z,targetPosition:X,setUpdateHover:P,setReconnecting:B})]})})}var Gj=Y.memo(Xj);const $j=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function sE({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:r,edgeTypes:a,noPanClassName:o,onReconnect:l,onEdgeContextMenu:u,onEdgeMouseEnter:f,onEdgeMouseMove:h,onEdgeMouseLeave:d,onEdgeClick:m,reconnectRadius:g,onEdgeDoubleClick:y,onReconnectStart:v,onReconnectEnd:S,disableKeyboardA11y:C}){const{edgesFocusable:N,edgesReconnectable:w,elementsSelectable:O,onError:_}=Ue($j,st),M=Oj(t);return b.jsxs("div",{className:"react-flow__edges",children:[b.jsx(Bj,{defaultColor:e,rfId:r}),M.map(I=>b.jsx(Gj,{id:I,edgesFocusable:N,edgesReconnectable:w,elementsSelectable:O,noPanClassName:o,onReconnect:l,onContextMenu:u,onMouseEnter:f,onMouseMove:h,onMouseLeave:d,onClick:m,reconnectRadius:g,onDoubleClick:y,onReconnectStart:v,onReconnectEnd:S,rfId:r,onError:_,edgeTypes:a,disableKeyboardA11y:C},I))]})}sE.displayName="EdgeRenderer";const Qj=Y.memo(sE),Zj=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function Kj({children:e}){const t=Ue(Zj);return b.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:t},children:e})}function Jj(e){const t=jm(),r=Y.useRef(!1);Y.useEffect(()=>{!r.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),r.current=!0)},[e,t.viewportInitialized])}const Wj=e=>e.panZoom?.syncViewport;function eD(e){const t=Ue(Wj),r=lt();return Y.useEffect(()=>{e&&(t?.(e),r.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function tD(e){return e.connection.inProgress?{...e.connection,to:ml(e.connection.to,e.transform)}:{...e.connection}}function nD(e){return tD}function rD(e){const t=nD();return Ue(t,st)}const iD=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function aD({containerStyle:e,style:t,type:r,component:a}){const{nodesConnectable:o,width:l,height:u,isValid:f,inProgress:h}=Ue(iD,st);return!(l&&o&&h)?null:b.jsx("svg",{style:e,width:l,height:u,className:"react-flow__connectionline react-flow__container",children:b.jsx("g",{className:St(["react-flow__connection",lw(f)]),children:b.jsx(lE,{style:t,type:r,CustomComponent:a,isValid:f})})})}const lE=({style:e,type:t=li.Bezier,CustomComponent:r,isValid:a})=>{const{inProgress:o,from:l,fromNode:u,fromHandle:f,fromPosition:h,to:d,toNode:m,toHandle:g,toPosition:y,pointer:v}=rD();if(!o)return;if(r)return b.jsx(r,{connectionLineType:t,connectionLineStyle:e,fromNode:u,fromHandle:f,fromX:l.x,fromY:l.y,toX:d.x,toY:d.y,fromPosition:h,toPosition:y,connectionStatus:lw(a),toNode:m,toHandle:g,pointer:v});let S="";const C={sourceX:l.x,sourceY:l.y,sourcePosition:h,targetX:d.x,targetY:d.y,targetPosition:y};switch(t){case li.Bezier:[S]=bw(C);break;case li.SimpleBezier:[S]=Qw(C);break;case li.Step:[S]=Dp({...C,borderRadius:0});break;case li.SmoothStep:[S]=Dp(C);break;default:[S]=ww(C)}return b.jsx("path",{d:S,fill:"none",className:"react-flow__connection-path",style:e})};lE.displayName="ConnectionLine";const oD={};function jb(e=oD){Y.useRef(e),lt(),Y.useEffect(()=>{},[e])}function sD(){lt(),Y.useRef(!1),Y.useEffect(()=>{},[])}function uE({nodeTypes:e,edgeTypes:t,onInit:r,onNodeClick:a,onEdgeClick:o,onNodeDoubleClick:l,onEdgeDoubleClick:u,onNodeMouseEnter:f,onNodeMouseMove:h,onNodeMouseLeave:d,onNodeContextMenu:m,onSelectionContextMenu:g,onSelectionStart:y,onSelectionEnd:v,connectionLineType:S,connectionLineStyle:C,connectionLineComponent:N,connectionLineContainerStyle:w,selectionKeyCode:O,selectionOnDrag:_,selectionMode:M,multiSelectionKeyCode:I,panActivationKeyCode:k,zoomActivationKeyCode:D,deleteKeyCode:U,onlyRenderVisibleElements:H,elementsSelectable:q,defaultViewport:L,translateExtent:P,minZoom:K,maxZoom:B,preventScrolling:V,defaultMarkerColor:j,zoomOnScroll:F,zoomOnPinch:$,panOnScroll:Z,panOnScrollSpeed:A,panOnScrollMode:z,zoomOnDoubleClick:X,panOnDrag:R,onPaneClick:te,onPaneMouseEnter:ue,onPaneMouseMove:ce,onPaneMouseLeave:fe,onPaneScroll:le,onPaneContextMenu:pe,paneClickDistance:be,nodeClickDistance:Se,onEdgeContextMenu:ye,onEdgeMouseEnter:we,onEdgeMouseMove:Re,onEdgeMouseLeave:He,reconnectRadius:Be,onReconnect:Qe,onReconnectStart:_t,onReconnectEnd:it,noDragClassName:Ot,noWheelClassName:qt,noPanClassName:An,disableKeyboardA11y:vn,nodeExtent:Ne,rfId:ut,viewport:ie,onViewportChange:he}){return jb(e),jb(t),sD(),Jj(r),eD(ie),b.jsx(wj,{onPaneClick:te,onPaneMouseEnter:ue,onPaneMouseMove:ce,onPaneMouseLeave:fe,onPaneContextMenu:pe,onPaneScroll:le,paneClickDistance:be,deleteKeyCode:U,selectionKeyCode:O,selectionOnDrag:_,selectionMode:M,onSelectionStart:y,onSelectionEnd:v,multiSelectionKeyCode:I,panActivationKeyCode:k,zoomActivationKeyCode:D,elementsSelectable:q,zoomOnScroll:F,zoomOnPinch:$,zoomOnDoubleClick:X,panOnScroll:Z,panOnScrollSpeed:A,panOnScrollMode:z,panOnDrag:R,defaultViewport:L,translateExtent:P,minZoom:K,maxZoom:B,onSelectionContextMenu:g,preventScrolling:V,noDragClassName:Ot,noWheelClassName:qt,noPanClassName:An,disableKeyboardA11y:vn,onViewportChange:he,isControlledViewport:!!ie,children:b.jsxs(Kj,{children:[b.jsx(Qj,{edgeTypes:t,onEdgeClick:o,onEdgeDoubleClick:u,onReconnect:Qe,onReconnectStart:_t,onReconnectEnd:it,onlyRenderVisibleElements:H,onEdgeContextMenu:ye,onEdgeMouseEnter:we,onEdgeMouseMove:Re,onEdgeMouseLeave:He,reconnectRadius:Be,defaultMarkerColor:j,noPanClassName:An,disableKeyboardA11y:vn,rfId:ut}),b.jsx(aD,{style:C,type:S,component:N,containerStyle:w}),b.jsx("div",{className:"react-flow__edgelabel-renderer"}),b.jsx(Rj,{nodeTypes:e,onNodeClick:a,onNodeDoubleClick:l,onNodeMouseEnter:f,onNodeMouseMove:h,onNodeMouseLeave:d,onNodeContextMenu:m,nodeClickDistance:Se,onlyRenderVisibleElements:H,noPanClassName:An,noDragClassName:Ot,disableKeyboardA11y:vn,nodeExtent:Ne,rfId:ut}),b.jsx("div",{className:"react-flow__viewport-portal"})]})})}uE.displayName="GraphView";const lD=Y.memo(uE),Db=({nodes:e,edges:t,defaultNodes:r,defaultEdges:a,width:o,height:l,fitView:u,fitViewOptions:f,minZoom:h=.5,maxZoom:d=2,nodeOrigin:m,nodeExtent:g,zIndexMode:y="basic"}={})=>{const v=new Map,S=new Map,C=new Map,N=new Map,w=a??t??[],O=r??e??[],_=m??[0,0],M=g??tl;_w(C,N,w);const{nodesInitialized:I}=Lp(O,v,S,{nodeOrigin:_,nodeExtent:M,zIndexMode:y});let k=[0,0,1];if(u&&o&&l){const D=hl(v,{filter:L=>!!((L.width||L.initialWidth)&&(L.height||L.initialHeight))}),{x:U,y:H,zoom:q}=Nm(D,o,l,h,d,f?.padding??.1);k=[U,H,q]}return{rfId:"1",width:o??0,height:l??0,transform:k,nodes:O,nodesInitialized:I,nodeLookup:v,parentLookup:S,edges:w,edgeLookup:N,connectionLookup:C,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:r!==void 0,hasDefaultEdges:a!==void 0,panZoom:null,minZoom:h,maxZoom:d,translateExtent:tl,nodeExtent:M,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:mo.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:_,nodeDragThreshold:1,connectionDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!0,selectNodesOnDrag:!0,multiSelectionActive:!1,fitViewQueued:u??!1,fitViewOptions:f,fitViewResolver:null,connection:{...sw},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:k3,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:ow,zIndexMode:y,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},uD=({nodes:e,edges:t,defaultNodes:r,defaultEdges:a,width:o,height:l,fitView:u,fitViewOptions:f,minZoom:h,maxZoom:d,nodeOrigin:m,nodeExtent:g,zIndexMode:y})=>NO((v,S)=>{async function C(){const{nodeLookup:N,panZoom:w,fitViewOptions:O,fitViewResolver:_,width:M,height:I,minZoom:k,maxZoom:D}=S();w&&(await N3({nodes:N,width:M,height:I,panZoom:w,minZoom:k,maxZoom:D},O),_?.resolve(!0),v({fitViewResolver:null}))}return{...Db({nodes:e,edges:t,width:o,height:l,fitView:u,fitViewOptions:f,minZoom:h,maxZoom:d,nodeOrigin:m,nodeExtent:g,defaultNodes:r,defaultEdges:a,zIndexMode:y}),setNodes:N=>{const{nodeLookup:w,parentLookup:O,nodeOrigin:_,elevateNodesOnSelect:M,fitViewQueued:I,zIndexMode:k,nodesSelectionActive:D}=S(),{nodesInitialized:U,hasSelectedNodes:H}=Lp(N,w,O,{nodeOrigin:_,nodeExtent:g,elevateNodesOnSelect:M,checkEquality:!0,zIndexMode:k}),q=D&&H;I&&U?(C(),v({nodes:N,nodesInitialized:U,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:q})):v({nodes:N,nodesInitialized:U,nodesSelectionActive:q})},setEdges:N=>{const{connectionLookup:w,edgeLookup:O}=S();_w(w,O,N),v({edges:N})},setDefaultNodesAndEdges:(N,w)=>{if(N){const{setNodes:O}=S();O(N),v({hasDefaultNodes:!0})}if(w){const{setEdges:O}=S();O(w),v({hasDefaultEdges:!0})}},updateNodeInternals:N=>{const{triggerNodeChanges:w,nodeLookup:O,parentLookup:_,domNode:M,nodeOrigin:I,nodeExtent:k,debug:D,fitViewQueued:U,zIndexMode:H}=S(),{changes:q,updatedInternals:L}=Z3(N,O,_,M,I,k,H);L&&(X3(O,_,{nodeOrigin:I,nodeExtent:k,zIndexMode:H}),U?(C(),v({fitViewQueued:!1,fitViewOptions:void 0})):v({}),q?.length>0&&(D&&console.log("React Flow: trigger node changes",q),w?.(q)))},updateNodePositions:(N,w=!1)=>{const O=[];let _=[];const{nodeLookup:M,triggerNodeChanges:I,connection:k,updateConnection:D,onNodesChangeMiddlewareMap:U}=S();for(const[H,q]of N){const L=M.get(H),P=!!(L?.expandParent&&L?.parentId&&q?.position),K={id:H,type:"position",position:P?{x:Math.max(0,q.position.x),y:Math.max(0,q.position.y)}:q.position,dragging:w};if(L&&k.inProgress&&k.fromNode.id===L.id){const B=na(L,k.fromHandle,ve.Left,!0);D({...k,from:B})}P&&L.parentId&&O.push({id:H,parentId:L.parentId,rect:{...q.internals.positionAbsolute,width:q.measured.width??0,height:q.measured.height??0}}),_.push(K)}if(O.length>0){const{parentLookup:H,nodeOrigin:q}=S(),L=Om(O,M,H,q);_.push(...L)}for(const H of U.values())_=H(_);I(_)},triggerNodeChanges:N=>{const{onNodesChange:w,setNodes:O,nodes:_,hasDefaultNodes:M,debug:I}=S();if(N?.length){if(M){const k=GO(N,_);O(k)}I&&console.log("React Flow: trigger node changes",N),w?.(N)}},triggerEdgeChanges:N=>{const{onEdgesChange:w,setEdges:O,edges:_,hasDefaultEdges:M,debug:I}=S();if(N?.length){if(M){const k=$O(N,_);O(k)}I&&console.log("React Flow: trigger edge changes",N),w?.(N)}},addSelectedNodes:N=>{const{multiSelectionActive:w,edgeLookup:O,nodeLookup:_,triggerNodeChanges:M,triggerEdgeChanges:I}=S();if(w){const k=N.map(D=>Pi(D,!0));M(k);return}M(to(_,new Set([...N]),!0)),I(to(O))},addSelectedEdges:N=>{const{multiSelectionActive:w,edgeLookup:O,nodeLookup:_,triggerNodeChanges:M,triggerEdgeChanges:I}=S();if(w){const k=N.map(D=>Pi(D,!0));I(k);return}I(to(O,new Set([...N]))),M(to(_,new Set,!0))},unselectNodesAndEdges:({nodes:N,edges:w}={})=>{const{edges:O,nodes:_,nodeLookup:M,triggerNodeChanges:I,triggerEdgeChanges:k}=S(),D=N||_,U=w||O,H=[];for(const L of D){if(!L.selected)continue;const P=M.get(L.id);P&&(P.selected=!1),H.push(Pi(L.id,!1))}const q=[];for(const L of U)L.selected&&q.push(Pi(L.id,!1));I(H),k(q)},setMinZoom:N=>{const{panZoom:w,maxZoom:O}=S();w?.setScaleExtent([N,O]),v({minZoom:N})},setMaxZoom:N=>{const{panZoom:w,minZoom:O}=S();w?.setScaleExtent([O,N]),v({maxZoom:N})},setTranslateExtent:N=>{S().panZoom?.setTranslateExtent(N),v({translateExtent:N})},resetSelectedElements:()=>{const{edges:N,nodes:w,triggerNodeChanges:O,triggerEdgeChanges:_,elementsSelectable:M}=S();if(!M)return;const I=w.reduce((D,U)=>U.selected?[...D,Pi(U.id,!1)]:D,[]),k=N.reduce((D,U)=>U.selected?[...D,Pi(U.id,!1)]:D,[]);O(I),_(k)},setNodeExtent:N=>{const{nodes:w,nodeLookup:O,parentLookup:_,nodeOrigin:M,elevateNodesOnSelect:I,nodeExtent:k,zIndexMode:D}=S();N[0][0]===k[0][0]&&N[0][1]===k[0][1]&&N[1][0]===k[1][0]&&N[1][1]===k[1][1]||(Lp(w,O,_,{nodeOrigin:M,nodeExtent:N,elevateNodesOnSelect:I,checkEquality:!1,zIndexMode:D}),v({nodeExtent:N}))},panBy:N=>{const{transform:w,width:O,height:_,panZoom:M,translateExtent:I}=S();return K3({delta:N,panZoom:M,transform:w,translateExtent:I,width:O,height:_})},setCenter:async(N,w,O)=>{const{width:_,height:M,maxZoom:I,panZoom:k}=S();if(!k)return Promise.resolve(!1);const D=typeof O?.zoom<"u"?O.zoom:I;return await k.setViewport({x:_/2-N*D,y:M/2-w*D,zoom:D},{duration:O?.duration,ease:O?.ease,interpolate:O?.interpolate}),Promise.resolve(!0)},cancelConnection:()=>{v({connection:{...sw}})},updateConnection:N=>{v({connection:N})},reset:()=>v({...Db()})}},Object.is);function cD({initialNodes:e,initialEdges:t,defaultNodes:r,defaultEdges:a,initialWidth:o,initialHeight:l,initialMinZoom:u,initialMaxZoom:f,initialFitViewOptions:h,fitView:d,nodeOrigin:m,nodeExtent:g,zIndexMode:y,children:v}){const[S]=Y.useState(()=>uD({nodes:e,edges:t,defaultNodes:r,defaultEdges:a,width:o,height:l,fitView:d,minZoom:u,maxZoom:f,fitViewOptions:h,nodeOrigin:m,nodeExtent:g,zIndexMode:y}));return b.jsx(MO,{value:S,children:b.jsx(KO,{children:v})})}function fD({children:e,nodes:t,edges:r,defaultNodes:a,defaultEdges:o,width:l,height:u,fitView:f,fitViewOptions:h,minZoom:d,maxZoom:m,nodeOrigin:g,nodeExtent:y,zIndexMode:v}){return Y.useContext(Kc)?b.jsx(b.Fragment,{children:e}):b.jsx(cD,{initialNodes:t,initialEdges:r,defaultNodes:a,defaultEdges:o,initialWidth:l,initialHeight:u,fitView:f,initialFitViewOptions:h,initialMinZoom:d,initialMaxZoom:m,nodeOrigin:g,nodeExtent:y,zIndexMode:v,children:e})}const dD={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function hD({nodes:e,edges:t,defaultNodes:r,defaultEdges:a,className:o,nodeTypes:l,edgeTypes:u,onNodeClick:f,onEdgeClick:h,onInit:d,onMove:m,onMoveStart:g,onMoveEnd:y,onConnect:v,onConnectStart:S,onConnectEnd:C,onClickConnectStart:N,onClickConnectEnd:w,onNodeMouseEnter:O,onNodeMouseMove:_,onNodeMouseLeave:M,onNodeContextMenu:I,onNodeDoubleClick:k,onNodeDragStart:D,onNodeDrag:U,onNodeDragStop:H,onNodesDelete:q,onEdgesDelete:L,onDelete:P,onSelectionChange:K,onSelectionDragStart:B,onSelectionDrag:V,onSelectionDragStop:j,onSelectionContextMenu:F,onSelectionStart:$,onSelectionEnd:Z,onBeforeDelete:A,connectionMode:z,connectionLineType:X=li.Bezier,connectionLineStyle:R,connectionLineComponent:te,connectionLineContainerStyle:ue,deleteKeyCode:ce="Backspace",selectionKeyCode:fe="Shift",selectionOnDrag:le=!1,selectionMode:pe=nl.Full,panActivationKeyCode:be="Space",multiSelectionKeyCode:Se=il()?"Meta":"Control",zoomActivationKeyCode:ye=il()?"Meta":"Control",snapToGrid:we,snapGrid:Re,onlyRenderVisibleElements:He=!1,selectNodesOnDrag:Be,nodesDraggable:Qe,autoPanOnNodeFocus:_t,nodesConnectable:it,nodesFocusable:Ot,nodeOrigin:qt=Iw,edgesFocusable:An,edgesReconnectable:vn,elementsSelectable:Ne=!0,defaultViewport:ut=PO,minZoom:ie=.5,maxZoom:he=2,translateExtent:Ee=tl,preventScrolling:Oe=!0,nodeExtent:Pe,defaultMarkerColor:It="#b1b1b7",zoomOnScroll:Rn=!0,zoomOnPinch:Nt=!0,panOnScroll:dt=!1,panOnScrollSpeed:jt=.5,panOnScrollMode:Xe=Ki.Free,zoomOnDoubleClick:Un=!0,panOnDrag:on=!0,onPaneClick:af,onPaneMouseEnter:sa,onPaneMouseMove:la,onPaneMouseLeave:ua,onPaneScroll:nr,onPaneContextMenu:ca,paneClickDistance:yi=1,nodeClickDistance:of=0,children:xl,onReconnect:_o,onReconnectStart:xi,onReconnectEnd:sf,onEdgeContextMenu:vl,onEdgeDoubleClick:bl,onEdgeMouseEnter:Sl,onEdgeMouseMove:No,onEdgeMouseLeave:Mo,reconnectRadius:wl=10,onNodesChange:El,onEdgesChange:qn,noDragClassName:wt="nodrag",noWheelClassName:Dt="nowheel",noPanClassName:rr="nopan",fitView:fa,fitViewOptions:Cl,connectOnClick:lf,attributionPosition:_l,proOptions:vi,defaultEdgeOptions:ko,elevateNodesOnSelect:Ar=!0,elevateEdgesOnSelect:Rr=!1,disableKeyboardA11y:Or=!1,autoPanOnConnect:jr,autoPanOnNodeDrag:mt,autoPanSpeed:Nl,connectionRadius:Ml,isValidConnection:ir,onError:Dr,style:uf,id:To,nodeDragThreshold:kl,connectionDragThreshold:cf,viewport:da,onViewportChange:ha,width:On,height:Vt,colorMode:Tl="light",debug:ff,onScroll:pa,ariaLabelConfig:Al,zIndexMode:bi="basic",...df},Ft){const Si=To||"1",Rl=FO(Tl),Ao=Y.useCallback(ar=>{ar.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),pa?.(ar)},[pa]);return b.jsx("div",{"data-testid":"rf__wrapper",...df,onScroll:Ao,style:{...uf,...dD},ref:Ft,className:St(["react-flow",o,Rl]),id:To,role:"application",children:b.jsxs(fD,{nodes:e,edges:t,width:On,height:Vt,fitView:fa,fitViewOptions:Cl,minZoom:ie,maxZoom:he,nodeOrigin:qt,nodeExtent:Pe,zIndexMode:bi,children:[b.jsx(VO,{nodes:e,edges:t,defaultNodes:r,defaultEdges:a,onConnect:v,onConnectStart:S,onConnectEnd:C,onClickConnectStart:N,onClickConnectEnd:w,nodesDraggable:Qe,autoPanOnNodeFocus:_t,nodesConnectable:it,nodesFocusable:Ot,edgesFocusable:An,edgesReconnectable:vn,elementsSelectable:Ne,elevateNodesOnSelect:Ar,elevateEdgesOnSelect:Rr,minZoom:ie,maxZoom:he,nodeExtent:Pe,onNodesChange:El,onEdgesChange:qn,snapToGrid:we,snapGrid:Re,connectionMode:z,translateExtent:Ee,connectOnClick:lf,defaultEdgeOptions:ko,fitView:fa,fitViewOptions:Cl,onNodesDelete:q,onEdgesDelete:L,onDelete:P,onNodeDragStart:D,onNodeDrag:U,onNodeDragStop:H,onSelectionDrag:V,onSelectionDragStart:B,onSelectionDragStop:j,onMove:m,onMoveStart:g,onMoveEnd:y,noPanClassName:rr,nodeOrigin:qt,rfId:Si,autoPanOnConnect:jr,autoPanOnNodeDrag:mt,autoPanSpeed:Nl,onError:Dr,connectionRadius:Ml,isValidConnection:ir,selectNodesOnDrag:Be,nodeDragThreshold:kl,connectionDragThreshold:cf,onBeforeDelete:A,debug:ff,ariaLabelConfig:Al,zIndexMode:bi}),b.jsx(lD,{onInit:d,onNodeClick:f,onEdgeClick:h,onNodeMouseEnter:O,onNodeMouseMove:_,onNodeMouseLeave:M,onNodeContextMenu:I,onNodeDoubleClick:k,nodeTypes:l,edgeTypes:u,connectionLineType:X,connectionLineStyle:R,connectionLineComponent:te,connectionLineContainerStyle:ue,selectionKeyCode:fe,selectionOnDrag:le,selectionMode:pe,deleteKeyCode:ce,multiSelectionKeyCode:Se,panActivationKeyCode:be,zoomActivationKeyCode:ye,onlyRenderVisibleElements:He,defaultViewport:ut,translateExtent:Ee,minZoom:ie,maxZoom:he,preventScrolling:Oe,zoomOnScroll:Rn,zoomOnPinch:Nt,zoomOnDoubleClick:Un,panOnScroll:dt,panOnScrollSpeed:jt,panOnScrollMode:Xe,panOnDrag:on,onPaneClick:af,onPaneMouseEnter:sa,onPaneMouseMove:la,onPaneMouseLeave:ua,onPaneScroll:nr,onPaneContextMenu:ca,paneClickDistance:yi,nodeClickDistance:of,onSelectionContextMenu:F,onSelectionStart:$,onSelectionEnd:Z,onReconnect:_o,onReconnectStart:xi,onReconnectEnd:sf,onEdgeContextMenu:vl,onEdgeDoubleClick:bl,onEdgeMouseEnter:Sl,onEdgeMouseMove:No,onEdgeMouseLeave:Mo,reconnectRadius:wl,defaultMarkerColor:It,noDragClassName:wt,noWheelClassName:Dt,noPanClassName:rr,rfId:Si,disableKeyboardA11y:Or,nodeExtent:Pe,viewport:da,onViewportChange:ha}),b.jsx(HO,{onSelectionChange:K}),xl,b.jsx(DO,{proOptions:vi,position:_l}),b.jsx(jO,{rfId:Si,disableKeyboardA11y:Or})]})})}var pD=Pw(hD);function mD({dimensions:e,lineWidth:t,variant:r,className:a}){return b.jsx("path",{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:St(["react-flow__background-pattern",r,a])})}function gD({radius:e,className:t}){return b.jsx("circle",{cx:e,cy:e,r:e,className:St(["react-flow__background-pattern","dots",t])})}var mi;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(mi||(mi={}));const yD={[mi.Dots]:1,[mi.Lines]:1,[mi.Cross]:6},xD=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function cE({id:e,variant:t=mi.Dots,gap:r=20,size:a,lineWidth:o=1,offset:l=0,color:u,bgColor:f,style:h,className:d,patternClassName:m}){const g=Y.useRef(null),{transform:y,patternId:v}=Ue(xD,st),S=a||yD[t],C=t===mi.Dots,N=t===mi.Cross,w=Array.isArray(r)?r:[r,r],O=[w[0]*y[2]||1,w[1]*y[2]||1],_=S*y[2],M=Array.isArray(l)?l:[l,l],I=N?[_,_]:O,k=[M[0]*y[2]||1+I[0]/2,M[1]*y[2]||1+I[1]/2],D=`${v}${e||""}`;return b.jsxs("svg",{className:St(["react-flow__background",d]),style:{...h,...Wc,"--xy-background-color-props":f,"--xy-background-pattern-color-props":u},ref:g,"data-testid":"rf__background",children:[b.jsx("pattern",{id:D,x:y[0]%O[0],y:y[1]%O[1],width:O[0],height:O[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${k[0]},-${k[1]})`,children:C?b.jsx(gD,{radius:_/2,className:m}):b.jsx(mD,{dimensions:I,lineWidth:o,variant:t,className:m})}),b.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${D})`})]})}cE.displayName="Background";Y.memo(cE);function vD(){return b.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:b.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function bD(){return b.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:b.jsx("path",{d:"M0 0h32v4.2H0z"})})}function SD(){return b.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:b.jsx("path",{d:"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"})})}function wD(){return b.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:b.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"})})}function ED(){return b.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:b.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z"})})}function Wu({children:e,className:t,...r}){return b.jsx("button",{type:"button",className:St(["react-flow__controls-button",t]),...r,children:e})}const CD=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function fE({style:e,showZoom:t=!0,showFitView:r=!0,showInteractive:a=!0,fitViewOptions:o,onZoomIn:l,onZoomOut:u,onFitView:f,onInteractiveChange:h,className:d,children:m,position:g="bottom-left",orientation:y="vertical","aria-label":v}){const S=lt(),{isInteractive:C,minZoomReached:N,maxZoomReached:w,ariaLabelConfig:O}=Ue(CD,st),{zoomIn:_,zoomOut:M,fitView:I}=jm(),k=()=>{_(),l?.()},D=()=>{M(),u?.()},U=()=>{I(o),f?.()},H=()=>{S.setState({nodesDraggable:!C,nodesConnectable:!C,elementsSelectable:!C}),h?.(!C)},q=y==="horizontal"?"horizontal":"vertical";return b.jsxs(Jc,{className:St(["react-flow__controls",q,d]),position:g,style:e,"data-testid":"rf__controls","aria-label":v??O["controls.ariaLabel"],children:[t&&b.jsxs(b.Fragment,{children:[b.jsx(Wu,{onClick:k,className:"react-flow__controls-zoomin",title:O["controls.zoomIn.ariaLabel"],"aria-label":O["controls.zoomIn.ariaLabel"],disabled:w,children:b.jsx(vD,{})}),b.jsx(Wu,{onClick:D,className:"react-flow__controls-zoomout",title:O["controls.zoomOut.ariaLabel"],"aria-label":O["controls.zoomOut.ariaLabel"],disabled:N,children:b.jsx(bD,{})})]}),r&&b.jsx(Wu,{className:"react-flow__controls-fitview",onClick:U,title:O["controls.fitView.ariaLabel"],"aria-label":O["controls.fitView.ariaLabel"],children:b.jsx(SD,{})}),a&&b.jsx(Wu,{className:"react-flow__controls-interactive",onClick:H,title:O["controls.interactive.ariaLabel"],"aria-label":O["controls.interactive.ariaLabel"],children:C?b.jsx(ED,{}):b.jsx(wD,{})}),m]})}fE.displayName="Controls";Y.memo(fE);function _D({id:e,x:t,y:r,width:a,height:o,style:l,color:u,strokeColor:f,strokeWidth:h,className:d,borderRadius:m,shapeRendering:g,selected:y,onClick:v}){const{background:S,backgroundColor:C}=l||{},N=u||S||C;return b.jsx("rect",{className:St(["react-flow__minimap-node",{selected:y},d]),x:t,y:r,rx:m,ry:m,width:a,height:o,style:{fill:N,stroke:f,strokeWidth:h},shapeRendering:g,onClick:v?w=>v(w,e):void 0})}const ND=Y.memo(_D),MD=e=>e.nodes.map(t=>t.id),Gh=e=>e instanceof Function?e:()=>e;function kD({nodeStrokeColor:e,nodeColor:t,nodeClassName:r="",nodeBorderRadius:a=5,nodeStrokeWidth:o,nodeComponent:l=ND,onClick:u}){const f=Ue(MD,st),h=Gh(t),d=Gh(e),m=Gh(r),g=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return b.jsx(b.Fragment,{children:f.map(y=>b.jsx(AD,{id:y,nodeColorFunc:h,nodeStrokeColorFunc:d,nodeClassNameFunc:m,nodeBorderRadius:a,nodeStrokeWidth:o,NodeComponent:l,onClick:u,shapeRendering:g},y))})}function TD({id:e,nodeColorFunc:t,nodeStrokeColorFunc:r,nodeClassNameFunc:a,nodeBorderRadius:o,nodeStrokeWidth:l,shapeRendering:u,NodeComponent:f,onClick:h}){const{node:d,x:m,y:g,width:y,height:v}=Ue(S=>{const C=S.nodeLookup.get(e);if(!C)return{node:void 0,x:0,y:0,width:0,height:0};const N=C.internals.userNode,{x:w,y:O}=C.internals.positionAbsolute,{width:_,height:M}=Tr(N);return{node:N,x:w,y:O,width:_,height:M}},st);return!d||d.hidden||!pw(d)?null:b.jsx(f,{x:m,y:g,width:y,height:v,style:d.style,selected:!!d.selected,className:a(d),color:t(d),borderRadius:o,strokeColor:r(d),strokeWidth:l,shapeRendering:u,onClick:h,id:d.id})}const AD=Y.memo(TD);var RD=Y.memo(kD);const OD=200,jD=150,DD=e=>!e.hidden,zD=e=>{const t={x:-e.transform[0]/e.transform[2],y:-e.transform[1]/e.transform[2],width:e.width/e.transform[2],height:e.height/e.transform[2]};return{viewBB:t,boundingRect:e.nodeLookup.size>0?hw(hl(e.nodeLookup,{filter:DD}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},LD="react-flow__minimap-desc";function dE({style:e,className:t,nodeStrokeColor:r,nodeColor:a,nodeClassName:o="",nodeBorderRadius:l=5,nodeStrokeWidth:u,nodeComponent:f,bgColor:h,maskColor:d,maskStrokeColor:m,maskStrokeWidth:g,position:y="bottom-right",onClick:v,onNodeClick:S,pannable:C=!1,zoomable:N=!1,ariaLabel:w,inversePan:O,zoomStep:_=1,offsetScale:M=5}){const I=lt(),k=Y.useRef(null),{boundingRect:D,viewBB:U,rfId:H,panZoom:q,translateExtent:L,flowWidth:P,flowHeight:K,ariaLabelConfig:B}=Ue(zD,st),V=e?.width??OD,j=e?.height??jD,F=D.width/V,$=D.height/j,Z=Math.max(F,$),A=Z*V,z=Z*j,X=M*Z,R=D.x-(A-D.width)/2-X,te=D.y-(z-D.height)/2-X,ue=A+X*2,ce=z+X*2,fe=`${LD}-${H}`,le=Y.useRef(0),pe=Y.useRef();le.current=Z,Y.useEffect(()=>{if(k.current&&q)return pe.current=oO({domNode:k.current,panZoom:q,getTransform:()=>I.getState().transform,getViewScale:()=>le.current}),()=>{pe.current?.destroy()}},[q]),Y.useEffect(()=>{pe.current?.update({translateExtent:L,width:P,height:K,inversePan:O,pannable:C,zoomStep:_,zoomable:N})},[C,N,O,_,L,P,K]);const be=v?we=>{const[Re,He]=pe.current?.pointer(we)||[0,0];v(we,{x:Re,y:He})}:void 0,Se=S?Y.useCallback((we,Re)=>{const He=I.getState().nodeLookup.get(Re).internals.userNode;S(we,He)},[]):void 0,ye=w??B["minimap.ariaLabel"];return b.jsx(Jc,{position:y,style:{...e,"--xy-minimap-background-color-props":typeof h=="string"?h:void 0,"--xy-minimap-mask-background-color-props":typeof d=="string"?d:void 0,"--xy-minimap-mask-stroke-color-props":typeof m=="string"?m:void 0,"--xy-minimap-mask-stroke-width-props":typeof g=="number"?g*Z:void 0,"--xy-minimap-node-background-color-props":typeof a=="string"?a:void 0,"--xy-minimap-node-stroke-color-props":typeof r=="string"?r:void 0,"--xy-minimap-node-stroke-width-props":typeof u=="number"?u:void 0},className:St(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:b.jsxs("svg",{width:V,height:j,viewBox:`${R} ${te} ${ue} ${ce}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":fe,ref:k,onClick:be,children:[ye&&b.jsx("title",{id:fe,children:ye}),b.jsx(RD,{onClick:Se,nodeColor:a,nodeStrokeColor:r,nodeBorderRadius:l,nodeClassName:o,nodeStrokeWidth:u,nodeComponent:f}),b.jsx("path",{className:"react-flow__minimap-mask",d:`M${R-X},${te-X}h${ue+X*2}v${ce+X*2}h${-ue-X*2}z
|
|
15
|
-
M${U.x},${U.y}h${U.width}v${U.height}h${-U.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}dE.displayName="MiniMap";Y.memo(dE);const BD=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,ID={[vo.Line]:"right",[vo.Handle]:"bottom-right"};function HD({nodeId:e,position:t,variant:r=vo.Handle,className:a,style:o=void 0,children:l,color:u,minWidth:f=10,minHeight:h=10,maxWidth:d=Number.MAX_VALUE,maxHeight:m=Number.MAX_VALUE,keepAspectRatio:g=!1,resizeDirection:y,autoScale:v=!0,shouldResize:S,onResizeStart:C,onResize:N,onResizeEnd:w}){const O=Fw(),_=typeof e=="string"?e:O,M=lt(),I=Y.useRef(null),k=r===vo.Handle,D=Ue(Y.useCallback(BD(k&&v),[k,v]),st),U=Y.useRef(null),H=t??ID[r];Y.useEffect(()=>{if(!(!I.current||!_))return U.current||(U.current=bO({domNode:I.current,nodeId:_,getStoreItems:()=>{const{nodeLookup:L,transform:P,snapGrid:K,snapToGrid:B,nodeOrigin:V,domNode:j}=M.getState();return{nodeLookup:L,transform:P,snapGrid:K,snapToGrid:B,nodeOrigin:V,paneDomNode:j}},onChange:(L,P)=>{const{triggerNodeChanges:K,nodeLookup:B,parentLookup:V,nodeOrigin:j}=M.getState(),F=[],$={x:L.x,y:L.y},Z=B.get(_);if(Z&&Z.expandParent&&Z.parentId){const A=Z.origin??j,z=L.width??Z.measured.width??0,X=L.height??Z.measured.height??0,R={id:Z.id,parentId:Z.parentId,rect:{width:z,height:X,...mw({x:L.x??Z.position.x,y:L.y??Z.position.y},{width:z,height:X},Z.parentId,B,A)}},te=Om([R],B,V,j);F.push(...te),$.x=L.x?Math.max(A[0]*z,L.x):void 0,$.y=L.y?Math.max(A[1]*X,L.y):void 0}if($.x!==void 0&&$.y!==void 0){const A={id:_,type:"position",position:{...$}};F.push(A)}if(L.width!==void 0&&L.height!==void 0){const z={id:_,type:"dimensions",resizing:!0,setAttributes:y?y==="horizontal"?"width":"height":!0,dimensions:{width:L.width,height:L.height}};F.push(z)}for(const A of P){const z={...A,type:"position"};F.push(z)}K(F)},onEnd:({width:L,height:P})=>{const K={id:_,type:"dimensions",resizing:!1,dimensions:{width:L,height:P}};M.getState().triggerNodeChanges([K])}})),U.current.update({controlPosition:H,boundaries:{minWidth:f,minHeight:h,maxWidth:d,maxHeight:m},keepAspectRatio:g,resizeDirection:y,onResizeStart:C,onResize:N,onResizeEnd:w,shouldResize:S}),()=>{U.current?.destroy()}},[H,f,h,d,m,g,C,N,w,S]);const q=H.split("-");return b.jsx("div",{className:St(["react-flow__resize-control","nodrag",...q,r,a]),ref:I,style:{...o,scale:D,...u&&{[k?"backgroundColor":"borderColor"]:u}},children:l})}Y.memo(HD);const zb=268,Lb=112,Qa=56,Pp=220,Bb=172,Up=124,Ib=104,Hb=600;function PD(e){if(e.nodes.length===0)return{nodes:[],edges:[],graphWidth:Qa*2,graphHeight:Qa*2,currentNodeId:null,startNodeId:null,latestBranchNodeId:null,summary:{currentNodeLabel:"No active node",lineageNodeCount:0,sideNodeCount:0,alternateBranchCount:0,blockedAttemptCount:0}};const t=new Map(e.nodes.map(q=>[q.nodeId,q])),r=new Map;for(const q of e.nodes){if(!q.parentNodeId)continue;const L=r.get(q.parentNodeId)??[];L.push(q),r.set(q.parentNodeId,L)}for(const q of r.values())q.sort((L,P)=>L.createdAtEventIndex-P.createdAtEventIndex);const a=UD(e),o=a?qD(a,t):new Set,l=VD(e.nodes,t),u=new Map,f=new Map,h=new Map,d=new Set,m=new Set;let g=0,y=0;const v=()=>{g+=1;const q=Math.ceil(g/2);return g%2===1?-q:q},S=(q,L,P,K)=>{if(u.has(q))return;u.set(q,L),f.set(q,P),h.set(q,K);const B=r.get(q)??[];if(B.length===0)return;const[V,...j]=B;V&&S(V.nodeId,L,P,K);let F=1;for(const $ of j){const Z=L<0?L-F:L+F;S($.nodeId,Z,P,K),F+=1}},C=[...o].sort((q,L)=>(l.get(q)??0)-(l.get(L)??0));for(const q of C){u.set(q,0),f.set(q,"active"),h.set(q,null);const L=r.get(q)??[];for(const P of L){if(o.has(P.nodeId))continue;y+=1;const K=P.nodeKind==="blocked_attempt"?"blocked":"alternate";K==="blocked"?m.add(P.nodeId):d.add(P.nodeId),S(P.nodeId,v(),K,y)}}const N=e.nodes.filter(q=>!q.parentNodeId||!t.has(q.parentNodeId)).sort((q,L)=>q.createdAtEventIndex-L.createdAtEventIndex);for(const q of N)if(!u.has(q.nodeId)){if(!o.has(q.nodeId)){y+=1;const L=q.nodeKind==="blocked_attempt"?"blocked":"alternate";L==="blocked"?m.add(q.nodeId):d.add(q.nodeId),S(q.nodeId,v(),L,y);continue}u.set(q.nodeId,0),f.set(q.nodeId,"active"),h.set(q.nodeId,null)}for(const q of e.nodes)if(!u.has(q.nodeId)){y+=1;const L=q.nodeKind==="blocked_attempt"?"blocked":"alternate";L==="blocked"?m.add(q.nodeId):d.add(q.nodeId),S(q.nodeId,v(),L,y)}const w=Math.min(...u.values()),O=Math.max(...u.values()),_=FD(e.nodes,l,t,o),M=e.nodes.map(q=>{const L=o.has(q.nodeId),P=_.get(q.nodeId)??0;return{node:q,depth:P,lane:u.get(q.nodeId)??0,x:Hb+Qa+P*zb,y:Qa+((u.get(q.nodeId)??0)-w)*Lb,isActiveLineage:L,isCurrent:q.nodeId===a,branchKind:f.get(q.nodeId)??"alternate",branchIndex:h.get(q.nodeId)??null}}),I=M.reduce((q,L)=>Math.max(q,L.depth),0),k=a?t.get(a)??null:null,D=[...d,...m].map(q=>t.get(q)).filter(q=>!!q).sort((q,L)=>L.createdAtEventIndex-q.createdAtEventIndex)[0]??null,U={currentNodeLabel:k?.stepLabel??(k?zm(k.nodeId):"No active node"),lineageNodeCount:o.size,sideNodeCount:e.nodes.length-o.size,alternateBranchCount:d.size,blockedAttemptCount:e.nodes.filter(q=>q.nodeKind==="blocked_attempt").length},H=new Set(M.map(q=>q.node.nodeId));return{nodes:M,edges:e.edges.filter(q=>H.has(q.fromNodeId)&&H.has(q.toNodeId)),graphWidth:Hb*2+Qa*2+I*zb+Pp,graphHeight:Qa*2+(O-w)*Lb+Up,currentNodeId:a,startNodeId:C[0]??N[0]?.nodeId??null,latestBranchNodeId:D?.nodeId??null,summary:U}}function UD(e){if(e.preferredTipNodeId)return e.preferredTipNodeId;const t=e.nodes.find(a=>a.isPreferredTip);if(t)return t.nodeId;const r=e.nodes.filter(a=>a.isTip).sort((a,o)=>o.createdAtEventIndex-a.createdAtEventIndex)[0];return r?r.nodeId:[...e.nodes].sort((a,o)=>o.createdAtEventIndex-a.createdAtEventIndex)[0]?.nodeId??null}function qD(e,t){const r=new Set;let a=e;for(;a&&!r.has(a);){r.add(a);const o=t.get(a)?.parentNodeId??null;a=o&&t.has(o)?o:null}return r}function VD(e,t){const r=new Map,a=new Set,o=l=>{const u=r.get(l);if(u!==void 0)return u;if(a.has(l))return r.set(l,0),0;a.add(l);const h=t.get(l)?.parentNodeId??null;if(!h||!t.has(h))return r.set(l,0),a.delete(l),0;const d=o(h)+1;return r.set(l,d),a.delete(l),d};for(const l of e)o(l.nodeId);return r}function zm(e){return e.slice(-8)}function FD(e,t,r,a){const o=new Map;for(const f of a)o.set(f,t.get(f)??0);const l=new Set,u=f=>{const h=o.get(f);if(h!==void 0)return h;if(l.has(f)){const v=t.get(f)??0;return o.set(f,v),v}l.add(f);const m=r.get(f)?.parentNodeId??null;if(!m||!r.has(m)){const v=t.get(f)??0;return o.set(f,v),l.delete(f),v}const y=u(m)+1;return o.set(f,y),l.delete(f),y};for(const f of e)o.has(f.nodeId)||u(f.nodeId);return o}function YD({run:e,selectedNodeId:t=null,onNodeClick:r}){const a=Y.useRef(null),o=Y.useRef(null),l=Y.useRef(!1),[u,f]=Y.useState(null),[h,d]=Y.useState(null),m=Y.useRef(null),g=Y.useMemo(()=>PD(e),[e]),y=Y.useMemo(()=>new Map(g.nodes.map(M=>[M.node.nodeId,M])),[g.nodes]),v=e.status==="in_progress",S=Y.useCallback((M,I="smooth")=>{if(!M)return;const k=o.current,D=y.get(M);if(!k||!D)return;a.current?.scrollIntoView({behavior:I,block:"nearest"});const U=D.isActiveLineage?Pp:Bb,H=D.isActiveLineage?Up:Ib;k.scrollTo({left:Math.max(0,D.x-k.clientWidth/2+U/2),top:Math.max(0,D.y-k.clientHeight/2+H/2),behavior:I})},[y]);Y.useEffect(()=>{l.current||g.currentNodeId&&(l.current=!0,S(g.currentNodeId,"auto"))},[]);const{nodes:C,edges:N}=Y.useMemo(()=>{const M=g.currentNodeId?g.edges.find(D=>D.toNodeId===g.currentNodeId)?.fromNodeId??null:null,I=g.nodes.map(D=>{const{node:U,isActiveLineage:H,isCurrent:q}=D,L=U.nodeId===t,P=H?Pp:Bb,K=H?Up:Ib,B=ZD(U,H,q,L),V=$D(U,H),j=hE(U,D.branchKind,D.branchIndex);return{id:U.nodeId,position:{x:D.x,y:D.y},data:{label:b.jsx(XD,{node:U,isActiveLineage:H,isCurrent:q,isSelected:L,isLiveRun:v,branchKind:D.branchKind,branchIndex:D.branchIndex,displayLabel:j,stepNumber:H?D.depth+1:null,totalSteps:H?g.summary.lineageNodeCount:null})},style:{width:P,height:K,padding:0,borderRadius:0,border:`1px solid ${B}`,background:V,color:"var(--text-primary)",boxShadow:L?"0 0 0 1px rgba(244, 179, 65, 0.7), 0 0 18px rgba(244, 179, 65, 0.16)":q?"0 0 0 1px rgba(0, 240, 255, 0.65), 0 0 24px rgba(0, 240, 255, 0.18)":H?"0 0 16px rgba(0, 240, 255, 0.1)":"none",opacity:H?1:.72,cursor:"pointer",display:"flex",alignItems:"stretch",justifyContent:"stretch"}}}),k=g.edges.map((D,U)=>{const H=y.get(D.fromNodeId),q=y.get(D.toNodeId),L=!!(H?.isActiveLineage&&q?.isActiveLineage),P=v&&!!g.currentNodeId&&D.toNodeId===g.currentNodeId&&D.fromNodeId===M;return{id:`lineage-edge-${U}`,source:D.fromNodeId,target:D.toNodeId,type:"smoothstep",animated:P,className:P?"workrail-current-lineage-edge":void 0,style:{stroke:P?"var(--accent-strong)":L?D.edgeKind==="checkpoint"?"var(--success)":"var(--accent-strong)":"rgba(123, 141, 167, 0.45)",strokeWidth:P?2.6:L?2.2:1.5,opacity:L?1:.72}}});return{nodes:I,edges:k}},[v,g.currentNodeId,g.edges,g.nodes,y,t]),w=Y.useCallback((M,I)=>{r?.(I.id)},[r]),O=Y.useCallback((M,I)=>{const k=y.get(I.id)?.node.stepLabel??null;if(!k||k.length<=35)return;const D=o.current?.getBoundingClientRect();if(!D)return;const U=M.clientX-D.left+12,H=M.clientY-D.top+16,q=Math.min(U,(o.current?.clientWidth??9999)-272);m.current!==null&&clearTimeout(m.current),m.current=setTimeout(()=>{f(k),d({x:q,y:H})},300)},[y]),_=Y.useCallback(()=>{m.current!==null&&(clearTimeout(m.current),m.current=null),f(null),d(null)},[]);return b.jsxs("div",{ref:a,className:"h-full flex flex-col bg-[var(--bg-primary)]",children:[b.jsxs("div",{className:"border-b border-[var(--border)] px-4 py-3 console-blueprint-grid",children:[b.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[b.jsxs("div",{className:"flex flex-wrap gap-2",children:[b.jsx(Hi,{label:"Current",value:g.summary.currentNodeLabel,emphasis:!0}),b.jsx(Hi,{label:"Status",value:tz(e.status)}),b.jsx(Hi,{label:"Active lineage",value:`${g.summary.lineageNodeCount} nodes`}),b.jsx(Hi,{label:"Alternate branches",value:`${g.summary.alternateBranchCount}`}),b.jsx(Hi,{label:"Historical nodes",value:`${g.summary.sideNodeCount}`}),b.jsx(Hi,{label:"Blocked attempts",value:`${g.summary.blockedAttemptCount}`}),b.jsx(Hi,{label:"Critical gaps",value:e.hasUnresolvedCriticalGaps?"Present":"None"})]}),b.jsxs("div",{className:"flex items-center gap-2",children:[b.jsx($h,{onClick:()=>S(g.startNodeId),children:"Start"}),b.jsx($h,{onClick:()=>S(g.currentNodeId),children:"Current"}),b.jsx($h,{onClick:()=>S(g.latestBranchNodeId),children:"Latest branch"})]})]}),b.jsx(GD,{model:g,selectedNodeId:t,onNavigateToNode:S})]}),b.jsxs("div",{ref:o,className:"relative flex-1 overflow-auto lineage-scroll-surface",children:[b.jsx("div",{style:{width:Math.max(g.graphWidth,960),height:Math.max(g.graphHeight,360)},children:b.jsx(pD,{nodes:C,edges:N,fitView:!1,defaultViewport:{x:0,y:0,zoom:1},proOptions:{hideAttribution:!0},nodesDraggable:!1,nodesConnectable:!1,elementsSelectable:!1,panOnDrag:!1,zoomOnScroll:!1,zoomOnPinch:!1,zoomOnDoubleClick:!1,preventScrolling:!1,colorMode:"dark",onNodeClick:w,onNodeMouseEnter:O,onNodeMouseLeave:_,style:{background:"transparent"}})}),u&&h&&b.jsx("div",{style:{position:"absolute",left:h.x,top:h.y,pointerEvents:"none",zIndex:50,maxWidth:260,background:"rgba(10, 12, 20, 0.96)",border:"1px solid rgba(123, 141, 167, 0.35)",padding:"6px 10px",fontSize:12,lineHeight:1.5,color:"var(--text-primary)",wordWrap:"break-word",boxShadow:"0 4px 16px rgba(0,0,0,0.4)"},children:u})]})]})}function XD({node:e,isActiveLineage:t,isCurrent:r,isSelected:a,isLiveRun:o,branchKind:l,branchIndex:u,displayLabel:f,stepNumber:h,totalSteps:d}){const m=JD(e);return b.jsxs("div",{className:`relative flex h-full w-full flex-col text-left overflow-hidden ${r&&o?"workrail-current-lineage-node":""} ${a?"workrail-selected-lineage-node":""}`,children:[m&&b.jsx("div",{style:{position:"absolute",left:0,top:0,bottom:0,width:3,background:m,pointerEvents:"none"}}),b.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-2 overflow-hidden px-3 py-3",children:[b.jsxs("div",{className:"flex items-start justify-between gap-2",children:[b.jsx("span",{className:"font-mono text-[10px] uppercase tracking-[0.18em]",style:{color:QD(l,t)},children:ez(e.nodeKind,l,u)}),b.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[a&&b.jsx("span",{className:"font-mono text-[10px] uppercase tracking-[0.18em]",style:{color:"var(--warning)"},children:"Selected"}),r&&b.jsx("span",{className:"font-mono text-[10px] uppercase tracking-[0.18em]",style:{color:o?"var(--accent-strong)":"var(--text-secondary)"},children:"Current"})]})]}),b.jsx("div",{className:t?"text-sm font-medium leading-snug":"text-[13px] leading-snug",style:{color:"var(--text-primary)",display:"-webkit-box",WebkitLineClamp:t?4:3,WebkitBoxOrient:"vertical",overflow:"hidden"},children:f})]}),b.jsxs("div",{className:"flex items-center justify-between gap-2 border-t border-[rgba(255,255,255,0.06)] bg-[rgba(0,0,0,0.18)] px-3 py-2",children:[b.jsx("span",{className:"min-w-0 truncate font-mono text-[11px] text-[var(--text-secondary)]",children:h!==null&&d!==null?`${h} / ${d}`:`evt ${e.createdAtEventIndex}`}),e.isTip?b.jsx("span",{className:"shrink-0 font-mono text-[10px] uppercase tracking-[0.18em]",style:{color:e.isPreferredTip?"var(--warning)":"var(--text-muted)"},children:e.isPreferredTip?"Preferred tip":"Tip"}):b.jsx("span",{className:"shrink-0 font-mono text-[10px] uppercase tracking-[0.18em] text-transparent",children:"spacer"})]})]})}function GD({model:e,selectedNodeId:t,onNavigateToNode:r}){const a=e.nodes.filter(l=>l.isActiveLineage),o=e.nodes.filter(l=>!l.isActiveLineage).slice(-8);return b.jsx("div",{className:"mt-3 border border-[var(--border)] bg-[rgba(10,10,10,0.38)] px-3 py-2",children:b.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[b.jsx("span",{className:"font-mono text-[10px] uppercase tracking-[0.18em] text-[var(--text-muted)]",children:"Lineage rail"}),a.map(l=>b.jsx(Pb,{label:l.node.stepLabel??zm(l.node.nodeId),isCurrent:l.isCurrent,isSelected:l.node.nodeId===t,tone:"active",onClick:()=>r(l.node.nodeId)},l.node.nodeId)),o.length>0&&b.jsxs(b.Fragment,{children:[b.jsx("span",{className:"mx-1 h-px w-6 bg-[var(--border)]"}),o.map(l=>b.jsx(Pb,{label:hE(l.node,l.branchKind,l.branchIndex),isCurrent:!1,isSelected:l.node.nodeId===t,tone:l.branchKind==="blocked"?"blocked":"side",onClick:()=>r(l.node.nodeId)},l.node.nodeId))]})]})})}function Hi({label:e,value:t,emphasis:r=!1}){return b.jsxs("div",{className:"min-w-[120px] border px-3 py-2",style:{borderColor:r?"rgba(0, 240, 255, 0.42)":"var(--border)",background:r?"rgba(0, 240, 255, 0.08)":"rgba(15, 19, 31, 0.78)"},children:[b.jsx("div",{className:"font-mono text-[10px] uppercase tracking-[0.18em] text-[var(--text-muted)]",children:e}),b.jsx("div",{className:"mt-1 text-sm text-[var(--text-primary)]",children:t})]})}function $h({children:e,onClick:t}){return b.jsx("button",{type:"button",onClick:t,className:"border border-[var(--border)] bg-[var(--bg-primary)] px-3 py-2 font-mono text-[11px] uppercase tracking-[0.18em] text-[var(--text-secondary)] transition-colors hover:border-[var(--accent-strong)] hover:text-[var(--text-primary)]",children:e})}function Pb({label:e,isCurrent:t,isSelected:r,tone:a,onClick:o}){const l=r?"rgba(244, 179, 65, 0.16)":a==="active"?t?"rgba(0, 240, 255, 0.2)":"rgba(0, 240, 255, 0.08)":a==="blocked"?"rgba(239, 68, 68, 0.12)":"rgba(125, 136, 156, 0.12)",u=r?"rgba(244, 179, 65, 0.48)":a==="active"?t?"rgba(0, 240, 255, 0.6)":"rgba(0, 240, 255, 0.32)":a==="blocked"?"rgba(239, 68, 68, 0.34)":"rgba(125, 136, 156, 0.3)";return b.jsx("button",{type:"button",title:e,onClick:o,className:"border px-2 py-1 font-mono text-[10px] uppercase tracking-[0.16em] text-[var(--text-secondary)] transition-colors hover:text-[var(--text-primary)]",style:{background:l,borderColor:u},children:nz(e)})}function $D(e,t){return e.nodeKind==="blocked_attempt"?t?"rgba(80, 24, 31, 0.92)":"rgba(52, 24, 30, 0.82)":e.nodeKind==="checkpoint"?t?"rgba(18, 61, 51, 0.92)":"rgba(18, 43, 38, 0.82)":t?"rgba(27, 31, 44, 0.96)":"rgba(24, 28, 39, 0.82)"}function QD(e,t){return e==="blocked"?"var(--error)":e==="alternate"?t?"var(--accent-strong)":"rgba(186, 197, 219, 0.72)":t?"var(--accent-strong)":"var(--text-muted)"}function ZD(e,t,r,a){return a?"var(--warning)":r?"var(--accent-strong)":e.nodeKind==="blocked_attempt"?t?"var(--error)":"rgba(239, 68, 68, 0.5)":e.nodeKind==="checkpoint"?t?"var(--success)":"rgba(34, 197, 94, 0.45)":t?"rgba(0, 240, 255, 0.55)":"rgba(123, 141, 167, 0.45)"}const KD=[{test:e=>e.hasFailedValidations,color:"var(--error)"},{test:e=>e.hasGaps,color:"var(--warning)"},{test:e=>e.hasRecap||e.hasArtifacts,color:"var(--accent)"}];function JD(e){return KD.find(t=>t.test(e))?.color??null}function WD(e){switch(e){case"blocked_attempt":return"Blocked";case"checkpoint":return"Checkpoint";case"step":return"Step"}}function ez(e,t,r){return t==="blocked"?r?`Blocked branch ${r}`:"Blocked branch":t==="alternate"?r?`Alt branch ${r}`:"Alt branch":WD(e)}function tz(e){switch(e){case"complete":return"Complete";case"complete_with_gaps":return"Complete with gaps";case"blocked":return"Blocked";case"in_progress":return"In progress"}}function hE(e,t,r){return e.stepLabel?e.stepLabel:t==="blocked"?r?`Blocked attempt ${r}`:"Blocked attempt":t==="alternate"?r?`Alternate path ${r}`:"Alternate path":zm(e.nodeId)}function nz(e){return e.length>18?`${e.slice(0,18)}…`:e}function rz(e,t){const r={};return(e[e.length-1]===""?[...e,""]:e).join((r.padRight?" ":"")+","+(r.padLeft===!1?"":" ")).trim()}const iz=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,az=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,oz={};function Ub(e,t){return(oz.jsx?az:iz).test(e)}const sz=/[ \t\n\f\r]/g;function lz(e){return typeof e=="object"?e.type==="text"?qb(e.value):!1:qb(e)}function qb(e){return e.replace(sz,"")===""}class gl{constructor(t,r,a){this.normal=r,this.property=t,a&&(this.space=a)}}gl.prototype.normal={};gl.prototype.property={};gl.prototype.space=void 0;function pE(e,t){const r={},a={};for(const o of e)Object.assign(r,o.property),Object.assign(a,o.normal);return new gl(r,a,t)}function qp(e){return e.toLowerCase()}class an{constructor(t,r){this.attribute=r,this.property=t}}an.prototype.attribute="";an.prototype.booleanish=!1;an.prototype.boolean=!1;an.prototype.commaOrSpaceSeparated=!1;an.prototype.commaSeparated=!1;an.prototype.defined=!1;an.prototype.mustUseProperty=!1;an.prototype.number=!1;an.prototype.overloadedBoolean=!1;an.prototype.property="";an.prototype.spaceSeparated=!1;an.prototype.space=void 0;let uz=0;const Ae=aa(),bt=aa(),Vp=aa(),de=aa(),et=aa(),oo=aa(),pn=aa();function aa(){return 2**++uz}const Fp=Object.freeze(Object.defineProperty({__proto__:null,boolean:Ae,booleanish:bt,commaOrSpaceSeparated:pn,commaSeparated:oo,number:de,overloadedBoolean:Vp,spaceSeparated:et},Symbol.toStringTag,{value:"Module"})),Qh=Object.keys(Fp);class Lm extends an{constructor(t,r,a,o){let l=-1;if(super(t,r),Vb(this,"space",o),typeof a=="number")for(;++l<Qh.length;){const u=Qh[l];Vb(this,Qh[l],(a&Fp[u])===Fp[u])}}}Lm.prototype.defined=!0;function Vb(e,t,r){r&&(e[t]=r)}function wo(e){const t={},r={};for(const[a,o]of Object.entries(e.properties)){const l=new Lm(a,e.transform(e.attributes||{},a),o,e.space);e.mustUseProperty&&e.mustUseProperty.includes(a)&&(l.mustUseProperty=!0),t[a]=l,r[qp(a)]=a,r[qp(l.attribute)]=a}return new gl(t,r,e.space)}const mE=wo({properties:{ariaActiveDescendant:null,ariaAtomic:bt,ariaAutoComplete:null,ariaBusy:bt,ariaChecked:bt,ariaColCount:de,ariaColIndex:de,ariaColSpan:de,ariaControls:et,ariaCurrent:null,ariaDescribedBy:et,ariaDetails:null,ariaDisabled:bt,ariaDropEffect:et,ariaErrorMessage:null,ariaExpanded:bt,ariaFlowTo:et,ariaGrabbed:bt,ariaHasPopup:null,ariaHidden:bt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:et,ariaLevel:de,ariaLive:null,ariaModal:bt,ariaMultiLine:bt,ariaMultiSelectable:bt,ariaOrientation:null,ariaOwns:et,ariaPlaceholder:null,ariaPosInSet:de,ariaPressed:bt,ariaReadOnly:bt,ariaRelevant:null,ariaRequired:bt,ariaRoleDescription:et,ariaRowCount:de,ariaRowIndex:de,ariaRowSpan:de,ariaSelected:bt,ariaSetSize:de,ariaSort:null,ariaValueMax:de,ariaValueMin:de,ariaValueNow:de,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function gE(e,t){return t in e?e[t]:t}function yE(e,t){return gE(e,t.toLowerCase())}const cz=wo({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:oo,acceptCharset:et,accessKey:et,action:null,allow:null,allowFullScreen:Ae,allowPaymentRequest:Ae,allowUserMedia:Ae,alt:null,as:null,async:Ae,autoCapitalize:null,autoComplete:et,autoFocus:Ae,autoPlay:Ae,blocking:et,capture:null,charSet:null,checked:Ae,cite:null,className:et,cols:de,colSpan:null,content:null,contentEditable:bt,controls:Ae,controlsList:et,coords:de|oo,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Ae,defer:Ae,dir:null,dirName:null,disabled:Ae,download:Vp,draggable:bt,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Ae,formTarget:null,headers:et,height:de,hidden:Vp,high:de,href:null,hrefLang:null,htmlFor:et,httpEquiv:et,id:null,imageSizes:null,imageSrcSet:null,inert:Ae,inputMode:null,integrity:null,is:null,isMap:Ae,itemId:null,itemProp:et,itemRef:et,itemScope:Ae,itemType:et,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Ae,low:de,manifest:null,max:null,maxLength:de,media:null,method:null,min:null,minLength:de,multiple:Ae,muted:Ae,name:null,nonce:null,noModule:Ae,noValidate:Ae,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:Ae,optimum:de,pattern:null,ping:et,placeholder:null,playsInline:Ae,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Ae,referrerPolicy:null,rel:et,required:Ae,reversed:Ae,rows:de,rowSpan:de,sandbox:et,scope:null,scoped:Ae,seamless:Ae,selected:Ae,shadowRootClonable:Ae,shadowRootDelegatesFocus:Ae,shadowRootMode:null,shape:null,size:de,sizes:null,slot:null,span:de,spellCheck:bt,src:null,srcDoc:null,srcLang:null,srcSet:null,start:de,step:null,style:null,tabIndex:de,target:null,title:null,translate:null,type:null,typeMustMatch:Ae,useMap:null,value:bt,width:de,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:et,axis:null,background:null,bgColor:null,border:de,borderColor:null,bottomMargin:de,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Ae,declare:Ae,event:null,face:null,frame:null,frameBorder:null,hSpace:de,leftMargin:de,link:null,longDesc:null,lowSrc:null,marginHeight:de,marginWidth:de,noResize:Ae,noHref:Ae,noShade:Ae,noWrap:Ae,object:null,profile:null,prompt:null,rev:null,rightMargin:de,rules:null,scheme:null,scrolling:bt,standby:null,summary:null,text:null,topMargin:de,valueType:null,version:null,vAlign:null,vLink:null,vSpace:de,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Ae,disableRemotePlayback:Ae,prefix:null,property:null,results:de,security:null,unselectable:null},space:"html",transform:yE}),fz=wo({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",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",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",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",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",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",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:pn,accentHeight:de,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:de,amplitude:de,arabicForm:null,ascent:de,attributeName:null,attributeType:null,azimuth:de,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:de,by:null,calcMode:null,capHeight:de,className:et,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:de,diffuseConstant:de,direction:null,display:null,dur:null,divisor:de,dominantBaseline:null,download:Ae,dx:null,dy:null,edgeMode:null,editable:null,elevation:de,enableBackground:null,end:null,event:null,exponent:de,externalResourcesRequired:null,fill:null,fillOpacity:de,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:oo,g2:oo,glyphName:oo,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:de,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:de,horizOriginX:de,horizOriginY:de,id:null,ideographic:de,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:de,k:de,k1:de,k2:de,k3:de,k4:de,kernelMatrix:pn,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:de,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:de,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:de,overlineThickness:de,paintOrder:null,panose1:null,path:null,pathLength:de,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:et,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:de,pointsAtY:de,pointsAtZ:de,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:pn,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:pn,rev:pn,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:pn,requiredFeatures:pn,requiredFonts:pn,requiredFormats:pn,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:de,specularExponent:de,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:de,strikethroughThickness:de,string:null,stroke:null,strokeDashArray:pn,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:de,strokeOpacity:de,strokeWidth:null,style:null,surfaceScale:de,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:pn,tabIndex:de,tableValues:null,target:null,targetX:de,targetY:de,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:pn,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:de,underlineThickness:de,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:de,values:null,vAlphabetic:de,vMathematical:de,vectorEffect:null,vHanging:de,vIdeographic:de,version:null,vertAdvY:de,vertOriginX:de,vertOriginY:de,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:de,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:gE}),xE=wo({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),vE=wo({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:yE}),bE=wo({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),dz={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},hz=/[A-Z]/g,Fb=/-[a-z]/g,pz=/^data[-\w.:]+$/i;function mz(e,t){const r=qp(t);let a=t,o=an;if(r in e.normal)return e.property[e.normal[r]];if(r.length>4&&r.slice(0,4)==="data"&&pz.test(t)){if(t.charAt(4)==="-"){const l=t.slice(5).replace(Fb,yz);a="data"+l.charAt(0).toUpperCase()+l.slice(1)}else{const l=t.slice(4);if(!Fb.test(l)){let u=l.replace(hz,gz);u.charAt(0)!=="-"&&(u="-"+u),t="data"+u}}o=Lm}return new o(a,t)}function gz(e){return"-"+e.toLowerCase()}function yz(e){return e.charAt(1).toUpperCase()}const xz=pE([mE,cz,xE,vE,bE],"html"),Bm=pE([mE,fz,xE,vE,bE],"svg");function vz(e){return e.join(" ").trim()}var Za={},Zh,Yb;function bz(){if(Yb)return Zh;Yb=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,r=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,l=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,u=/^[;\s]*/,f=/^\s+|\s+$/g,h=`
|
|
16
|
-
`,d="/",m="*",g="",y="comment",v="declaration";function S(N,w){if(typeof N!="string")throw new TypeError("First argument must be a string");if(!N)return[];w=w||{};var O=1,_=1;function M(B){var V=B.match(t);V&&(O+=V.length);var j=B.lastIndexOf(h);_=~j?B.length-j:_+B.length}function I(){var B={line:O,column:_};return function(V){return V.position=new k(B),H(),V}}function k(B){this.start=B,this.end={line:O,column:_},this.source=w.source}k.prototype.content=N;function D(B){var V=new Error(w.source+":"+O+":"+_+": "+B);if(V.reason=B,V.filename=w.source,V.line=O,V.column=_,V.source=N,!w.silent)throw V}function U(B){var V=B.exec(N);if(V){var j=V[0];return M(j),N=N.slice(j.length),V}}function H(){U(r)}function q(B){var V;for(B=B||[];V=L();)V!==!1&&B.push(V);return B}function L(){var B=I();if(!(d!=N.charAt(0)||m!=N.charAt(1))){for(var V=2;g!=N.charAt(V)&&(m!=N.charAt(V)||d!=N.charAt(V+1));)++V;if(V+=2,g===N.charAt(V-1))return D("End of comment missing");var j=N.slice(2,V-2);return _+=2,M(j),N=N.slice(V),_+=2,B({type:y,comment:j})}}function P(){var B=I(),V=U(a);if(V){if(L(),!U(o))return D("property missing ':'");var j=U(l),F=B({type:v,property:C(V[0].replace(e,g)),value:j?C(j[0].replace(e,g)):g});return U(u),F}}function K(){var B=[];q(B);for(var V;V=P();)V!==!1&&(B.push(V),q(B));return B}return H(),K()}function C(N){return N?N.replace(f,g):g}return Zh=S,Zh}var Xb;function Sz(){if(Xb)return Za;Xb=1;var e=Za&&Za.__importDefault||function(a){return a&&a.__esModule?a:{default:a}};Object.defineProperty(Za,"__esModule",{value:!0}),Za.default=r;const t=e(bz());function r(a,o){let l=null;if(!a||typeof a!="string")return l;const u=(0,t.default)(a),f=typeof o=="function";return u.forEach(h=>{if(h.type!=="declaration")return;const{property:d,value:m}=h;f?o(d,m,h):m&&(l=l||{},l[d]=m)}),l}return Za}var Ms={},Gb;function wz(){if(Gb)return Ms;Gb=1,Object.defineProperty(Ms,"__esModule",{value:!0}),Ms.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,r=/^[^-]+$/,a=/^-(webkit|moz|ms|o|khtml)-/,o=/^-(ms)-/,l=function(d){return!d||r.test(d)||e.test(d)},u=function(d,m){return m.toUpperCase()},f=function(d,m){return"".concat(m,"-")},h=function(d,m){return m===void 0&&(m={}),l(d)?d:(d=d.toLowerCase(),m.reactCompat?d=d.replace(o,f):d=d.replace(a,f),d.replace(t,u))};return Ms.camelCase=h,Ms}var ks,$b;function Ez(){if($b)return ks;$b=1;var e=ks&&ks.__importDefault||function(o){return o&&o.__esModule?o:{default:o}},t=e(Sz()),r=wz();function a(o,l){var u={};return!o||typeof o!="string"||(0,t.default)(o,function(f,h){f&&h&&(u[(0,r.camelCase)(f,l)]=h)}),u}return a.default=a,ks=a,ks}var Cz=Ez();const _z=Lc(Cz),SE=wE("end"),Im=wE("start");function wE(e){return t;function t(r){const a=r&&r.position&&r.position[e]||{};if(typeof a.line=="number"&&a.line>0&&typeof a.column=="number"&&a.column>0)return{line:a.line,column:a.column,offset:typeof a.offset=="number"&&a.offset>-1?a.offset:void 0}}}function Nz(e){const t=Im(e),r=SE(e);if(t&&r)return{start:t,end:r}}function Bs(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Qb(e.position):"start"in e||"end"in e?Qb(e):"line"in e||"column"in e?Yp(e):""}function Yp(e){return Zb(e&&e.line)+":"+Zb(e&&e.column)}function Qb(e){return Yp(e&&e.start)+"-"+Yp(e&&e.end)}function Zb(e){return e&&typeof e=="number"?e:1}class Bt extends Error{constructor(t,r,a){super(),typeof r=="string"&&(a=r,r=void 0);let o="",l={},u=!1;if(r&&("line"in r&&"column"in r?l={place:r}:"start"in r&&"end"in r?l={place:r}:"type"in r?l={ancestors:[r],place:r.position}:l={...r}),typeof t=="string"?o=t:!l.cause&&t&&(u=!0,o=t.message,l.cause=t),!l.ruleId&&!l.source&&typeof a=="string"){const h=a.indexOf(":");h===-1?l.ruleId=a:(l.source=a.slice(0,h),l.ruleId=a.slice(h+1))}if(!l.place&&l.ancestors&&l.ancestors){const h=l.ancestors[l.ancestors.length-1];h&&(l.place=h.position)}const f=l.place&&"start"in l.place?l.place.start:l.place;this.ancestors=l.ancestors||void 0,this.cause=l.cause||void 0,this.column=f?f.column:void 0,this.fatal=void 0,this.file="",this.message=o,this.line=f?f.line:void 0,this.name=Bs(l.place)||"1:1",this.place=l.place||void 0,this.reason=this.message,this.ruleId=l.ruleId||void 0,this.source=l.source||void 0,this.stack=u&&l.cause&&typeof l.cause.stack=="string"?l.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Bt.prototype.file="";Bt.prototype.name="";Bt.prototype.reason="";Bt.prototype.message="";Bt.prototype.stack="";Bt.prototype.column=void 0;Bt.prototype.line=void 0;Bt.prototype.ancestors=void 0;Bt.prototype.cause=void 0;Bt.prototype.fatal=void 0;Bt.prototype.place=void 0;Bt.prototype.ruleId=void 0;Bt.prototype.source=void 0;const Hm={}.hasOwnProperty,Mz=new Map,kz=/[A-Z]/g,Tz=new Set(["table","tbody","thead","tfoot","tr"]),Az=new Set(["td","th"]),EE="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function Rz(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const r=t.filePath||void 0;let a;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");a=Hz(r,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");a=Iz(r,t.jsx,t.jsxs)}const o={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:a,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:r,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?Bm:xz,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},l=CE(o,e,void 0);return l&&typeof l!="string"?l:o.create(e,o.Fragment,{children:l||void 0},void 0)}function CE(e,t,r){if(t.type==="element")return Oz(e,t,r);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return jz(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return zz(e,t,r);if(t.type==="mdxjsEsm")return Dz(e,t);if(t.type==="root")return Lz(e,t,r);if(t.type==="text")return Bz(e,t)}function Oz(e,t,r){const a=e.schema;let o=a;t.tagName.toLowerCase()==="svg"&&a.space==="html"&&(o=Bm,e.schema=o),e.ancestors.push(t);const l=NE(e,t.tagName,!1),u=Pz(e,t);let f=Um(e,t);return Tz.has(t.tagName)&&(f=f.filter(function(h){return typeof h=="string"?!lz(h):!0})),_E(e,u,l,t),Pm(u,f),e.ancestors.pop(),e.schema=a,e.create(t,l,u,r)}function jz(e,t){if(t.data&&t.data.estree&&e.evaluater){const a=t.data.estree.body[0];return a.type,e.evaluater.evaluateExpression(a.expression)}ol(e,t.position)}function Dz(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);ol(e,t.position)}function zz(e,t,r){const a=e.schema;let o=a;t.name==="svg"&&a.space==="html"&&(o=Bm,e.schema=o),e.ancestors.push(t);const l=t.name===null?e.Fragment:NE(e,t.name,!0),u=Uz(e,t),f=Um(e,t);return _E(e,u,l,t),Pm(u,f),e.ancestors.pop(),e.schema=a,e.create(t,l,u,r)}function Lz(e,t,r){const a={};return Pm(a,Um(e,t)),e.create(t,e.Fragment,a,r)}function Bz(e,t){return t.value}function _E(e,t,r,a){typeof r!="string"&&r!==e.Fragment&&e.passNode&&(t.node=a)}function Pm(e,t){if(t.length>0){const r=t.length>1?t:t[0];r&&(e.children=r)}}function Iz(e,t,r){return a;function a(o,l,u,f){const d=Array.isArray(u.children)?r:t;return f?d(l,u,f):d(l,u)}}function Hz(e,t){return r;function r(a,o,l,u){const f=Array.isArray(l.children),h=Im(a);return t(o,l,u,f,{columnNumber:h?h.column-1:void 0,fileName:e,lineNumber:h?h.line:void 0},void 0)}}function Pz(e,t){const r={};let a,o;for(o in t.properties)if(o!=="children"&&Hm.call(t.properties,o)){const l=qz(e,o,t.properties[o]);if(l){const[u,f]=l;e.tableCellAlignToStyle&&u==="align"&&typeof f=="string"&&Az.has(t.tagName)?a=f:r[u]=f}}if(a){const l=r.style||(r.style={});l[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=a}return r}function Uz(e,t){const r={};for(const a of t.attributes)if(a.type==="mdxJsxExpressionAttribute")if(a.data&&a.data.estree&&e.evaluater){const l=a.data.estree.body[0];l.type;const u=l.expression;u.type;const f=u.properties[0];f.type,Object.assign(r,e.evaluater.evaluateExpression(f.argument))}else ol(e,t.position);else{const o=a.name;let l;if(a.value&&typeof a.value=="object")if(a.value.data&&a.value.data.estree&&e.evaluater){const f=a.value.data.estree.body[0];f.type,l=e.evaluater.evaluateExpression(f.expression)}else ol(e,t.position);else l=a.value===null?!0:a.value;r[o]=l}return r}function Um(e,t){const r=[];let a=-1;const o=e.passKeys?new Map:Mz;for(;++a<t.children.length;){const l=t.children[a];let u;if(e.passKeys){const h=l.type==="element"?l.tagName:l.type==="mdxJsxFlowElement"||l.type==="mdxJsxTextElement"?l.name:void 0;if(h){const d=o.get(h)||0;u=h+"-"+d,o.set(h,d+1)}}const f=CE(e,l,u);f!==void 0&&r.push(f)}return r}function qz(e,t,r){const a=mz(e.schema,t);if(!(r==null||typeof r=="number"&&Number.isNaN(r))){if(Array.isArray(r)&&(r=a.commaSeparated?rz(r):vz(r)),a.property==="style"){let o=typeof r=="object"?r:Vz(e,String(r));return e.stylePropertyNameCase==="css"&&(o=Fz(o)),["style",o]}return[e.elementAttributeNameCase==="react"&&a.space?dz[a.property]||a.property:a.attribute,r]}}function Vz(e,t){try{return _z(t,{reactCompat:!0})}catch(r){if(e.ignoreInvalidStyle)return{};const a=r,o=new Bt("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:a,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw o.file=e.filePath||void 0,o.url=EE+"#cannot-parse-style-attribute",o}}function NE(e,t,r){let a;if(!r)a={type:"Literal",value:t};else if(t.includes(".")){const o=t.split(".");let l=-1,u;for(;++l<o.length;){const f=Ub(o[l])?{type:"Identifier",name:o[l]}:{type:"Literal",value:o[l]};u=u?{type:"MemberExpression",object:u,property:f,computed:!!(l&&f.type==="Literal"),optional:!1}:f}a=u}else a=Ub(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(a.type==="Literal"){const o=a.value;return Hm.call(e.components,o)?e.components[o]:o}if(e.evaluater)return e.evaluater.evaluateExpression(a);ol(e)}function ol(e,t){const r=new Bt("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw r.file=e.filePath||void 0,r.url=EE+"#cannot-handle-mdx-estrees-without-createevaluater",r}function Fz(e){const t={};let r;for(r in e)Hm.call(e,r)&&(t[Yz(r)]=e[r]);return t}function Yz(e){let t=e.replace(kz,Xz);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function Xz(e){return"-"+e.toLowerCase()}const Kh={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},Gz={};function $z(e,t){const r=Gz,a=typeof r.includeImageAlt=="boolean"?r.includeImageAlt:!0,o=typeof r.includeHtml=="boolean"?r.includeHtml:!0;return ME(e,a,o)}function ME(e,t,r){if(Qz(e)){if("value"in e)return e.type==="html"&&!r?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return Kb(e.children,t,r)}return Array.isArray(e)?Kb(e,t,r):""}function Kb(e,t,r){const a=[];let o=-1;for(;++o<e.length;)a[o]=ME(e[o],t,r);return a.join("")}function Qz(e){return!!(e&&typeof e=="object")}const Jb=document.createElement("i");function qm(e){const t="&"+e+";";Jb.innerHTML=t;const r=Jb.textContent;return r.charCodeAt(r.length-1)===59&&e!=="semi"||r===t?!1:r}function er(e,t,r,a){const o=e.length;let l=0,u;if(t<0?t=-t>o?0:o+t:t=t>o?o:t,r=r>0?r:0,a.length<1e4)u=Array.from(a),u.unshift(t,r),e.splice(...u);else for(r&&e.splice(t,r);l<a.length;)u=a.slice(l,l+1e4),u.unshift(t,0),e.splice(...u),l+=1e4,t+=1e4}function Tn(e,t){return e.length>0?(er(e,e.length,0,t),e):t}const Wb={}.hasOwnProperty;function Zz(e){const t={};let r=-1;for(;++r<e.length;)Kz(t,e[r]);return t}function Kz(e,t){let r;for(r in t){const o=(Wb.call(e,r)?e[r]:void 0)||(e[r]={}),l=t[r];let u;if(l)for(u in l){Wb.call(o,u)||(o[u]=[]);const f=l[u];Jz(o[u],Array.isArray(f)?f:f?[f]:[])}}}function Jz(e,t){let r=-1;const a=[];for(;++r<t.length;)(t[r].add==="after"?e:a).push(t[r]);er(e,0,0,a)}function kE(e,t){const r=Number.parseInt(e,t);return r<9||r===11||r>13&&r<32||r>126&&r<160||r>55295&&r<57344||r>64975&&r<65008||(r&65535)===65535||(r&65535)===65534||r>1114111?"�":String.fromCodePoint(r)}function so(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Kn=gi(/[A-Za-z]/),yn=gi(/[\dA-Za-z]/),Wz=gi(/[#-'*+\--9=?A-Z^-~]/);function Xp(e){return e!==null&&(e<32||e===127)}const Gp=gi(/\d/),e5=gi(/[\dA-Fa-f]/),t5=gi(/[!-/:-@[-`{-~]/);function _e(e){return e!==null&&e<-2}function nn(e){return e!==null&&(e<0||e===32)}function Ye(e){return e===-2||e===-1||e===32}const n5=gi(new RegExp("\\p{P}|\\p{S}","u")),r5=gi(/\s/);function gi(e){return t;function t(r){return r!==null&&r>-1&&e.test(String.fromCharCode(r))}}function Eo(e){const t=[];let r=-1,a=0,o=0;for(;++r<e.length;){const l=e.charCodeAt(r);let u="";if(l===37&&yn(e.charCodeAt(r+1))&&yn(e.charCodeAt(r+2)))o=2;else if(l<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(l))||(u=String.fromCharCode(l));else if(l>55295&&l<57344){const f=e.charCodeAt(r+1);l<56320&&f>56319&&f<57344?(u=String.fromCharCode(l,f),o=1):u="�"}else u=String.fromCharCode(l);u&&(t.push(e.slice(a,r),encodeURIComponent(u)),a=r+o+1,u=""),o&&(r+=o,o=0)}return t.join("")+e.slice(a)}function tt(e,t,r,a){const o=a?a-1:Number.POSITIVE_INFINITY;let l=0;return u;function u(h){return Ye(h)?(e.enter(r),f(h)):t(h)}function f(h){return Ye(h)&&l++<o?(e.consume(h),f):(e.exit(r),t(h))}}const i5={tokenize:a5};function a5(e){const t=e.attempt(this.parser.constructs.contentInitial,a,o);let r;return t;function a(f){if(f===null){e.consume(f);return}return e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),tt(e,t,"linePrefix")}function o(f){return e.enter("paragraph"),l(f)}function l(f){const h=e.enter("chunkText",{contentType:"text",previous:r});return r&&(r.next=h),r=h,u(f)}function u(f){if(f===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(f);return}return _e(f)?(e.consume(f),e.exit("chunkText"),l):(e.consume(f),u)}}const o5={tokenize:s5},e1={tokenize:l5};function s5(e){const t=this,r=[];let a=0,o,l,u;return f;function f(_){if(a<r.length){const M=r[a];return t.containerState=M[1],e.attempt(M[0].continuation,h,d)(_)}return d(_)}function h(_){if(a++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,o&&O();const M=t.events.length;let I=M,k;for(;I--;)if(t.events[I][0]==="exit"&&t.events[I][1].type==="chunkFlow"){k=t.events[I][1].end;break}w(a);let D=M;for(;D<t.events.length;)t.events[D][1].end={...k},D++;return er(t.events,I+1,0,t.events.slice(M)),t.events.length=D,d(_)}return f(_)}function d(_){if(a===r.length){if(!o)return y(_);if(o.currentConstruct&&o.currentConstruct.concrete)return S(_);t.interrupt=!!(o.currentConstruct&&!o._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(e1,m,g)(_)}function m(_){return o&&O(),w(a),y(_)}function g(_){return t.parser.lazy[t.now().line]=a!==r.length,u=t.now().offset,S(_)}function y(_){return t.containerState={},e.attempt(e1,v,S)(_)}function v(_){return a++,r.push([t.currentConstruct,t.containerState]),y(_)}function S(_){if(_===null){o&&O(),w(0),e.consume(_);return}return o=o||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:o,contentType:"flow",previous:l}),C(_)}function C(_){if(_===null){N(e.exit("chunkFlow"),!0),w(0),e.consume(_);return}return _e(_)?(e.consume(_),N(e.exit("chunkFlow")),a=0,t.interrupt=void 0,f):(e.consume(_),C)}function N(_,M){const I=t.sliceStream(_);if(M&&I.push(null),_.previous=l,l&&(l.next=_),l=_,o.defineSkip(_.start),o.write(I),t.parser.lazy[_.start.line]){let k=o.events.length;for(;k--;)if(o.events[k][1].start.offset<u&&(!o.events[k][1].end||o.events[k][1].end.offset>u))return;const D=t.events.length;let U=D,H,q;for(;U--;)if(t.events[U][0]==="exit"&&t.events[U][1].type==="chunkFlow"){if(H){q=t.events[U][1].end;break}H=!0}for(w(a),k=D;k<t.events.length;)t.events[k][1].end={...q},k++;er(t.events,U+1,0,t.events.slice(D)),t.events.length=k}}function w(_){let M=r.length;for(;M-- >_;){const I=r[M];t.containerState=I[1],I[0].exit.call(t,e)}r.length=_}function O(){o.write([null]),l=void 0,o=void 0,t.containerState._closeFlow=void 0}}function l5(e,t,r){return tt(e,e.attempt(this.parser.constructs.document,t,r),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function t1(e){if(e===null||nn(e)||r5(e))return 1;if(n5(e))return 2}function Vm(e,t,r){const a=[];let o=-1;for(;++o<e.length;){const l=e[o].resolveAll;l&&!a.includes(l)&&(t=l(t,r),a.push(l))}return t}const $p={name:"attention",resolveAll:u5,tokenize:c5};function u5(e,t){let r=-1,a,o,l,u,f,h,d,m;for(;++r<e.length;)if(e[r][0]==="enter"&&e[r][1].type==="attentionSequence"&&e[r][1]._close){for(a=r;a--;)if(e[a][0]==="exit"&&e[a][1].type==="attentionSequence"&&e[a][1]._open&&t.sliceSerialize(e[a][1]).charCodeAt(0)===t.sliceSerialize(e[r][1]).charCodeAt(0)){if((e[a][1]._close||e[r][1]._open)&&(e[r][1].end.offset-e[r][1].start.offset)%3&&!((e[a][1].end.offset-e[a][1].start.offset+e[r][1].end.offset-e[r][1].start.offset)%3))continue;h=e[a][1].end.offset-e[a][1].start.offset>1&&e[r][1].end.offset-e[r][1].start.offset>1?2:1;const g={...e[a][1].end},y={...e[r][1].start};n1(g,-h),n1(y,h),u={type:h>1?"strongSequence":"emphasisSequence",start:g,end:{...e[a][1].end}},f={type:h>1?"strongSequence":"emphasisSequence",start:{...e[r][1].start},end:y},l={type:h>1?"strongText":"emphasisText",start:{...e[a][1].end},end:{...e[r][1].start}},o={type:h>1?"strong":"emphasis",start:{...u.start},end:{...f.end}},e[a][1].end={...u.start},e[r][1].start={...f.end},d=[],e[a][1].end.offset-e[a][1].start.offset&&(d=Tn(d,[["enter",e[a][1],t],["exit",e[a][1],t]])),d=Tn(d,[["enter",o,t],["enter",u,t],["exit",u,t],["enter",l,t]]),d=Tn(d,Vm(t.parser.constructs.insideSpan.null,e.slice(a+1,r),t)),d=Tn(d,[["exit",l,t],["enter",f,t],["exit",f,t],["exit",o,t]]),e[r][1].end.offset-e[r][1].start.offset?(m=2,d=Tn(d,[["enter",e[r][1],t],["exit",e[r][1],t]])):m=0,er(e,a-1,r-a+3,d),r=a+d.length-m-2;break}}for(r=-1;++r<e.length;)e[r][1].type==="attentionSequence"&&(e[r][1].type="data");return e}function c5(e,t){const r=this.parser.constructs.attentionMarkers.null,a=this.previous,o=t1(a);let l;return u;function u(h){return l=h,e.enter("attentionSequence"),f(h)}function f(h){if(h===l)return e.consume(h),f;const d=e.exit("attentionSequence"),m=t1(h),g=!m||m===2&&o||r.includes(h),y=!o||o===2&&m||r.includes(a);return d._open=!!(l===42?g:g&&(o||!y)),d._close=!!(l===42?y:y&&(m||!g)),t(h)}}function n1(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const f5={name:"autolink",tokenize:d5};function d5(e,t,r){let a=0;return o;function o(v){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(v),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),l}function l(v){return Kn(v)?(e.consume(v),u):v===64?r(v):d(v)}function u(v){return v===43||v===45||v===46||yn(v)?(a=1,f(v)):d(v)}function f(v){return v===58?(e.consume(v),a=0,h):(v===43||v===45||v===46||yn(v))&&a++<32?(e.consume(v),f):(a=0,d(v))}function h(v){return v===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(v),e.exit("autolinkMarker"),e.exit("autolink"),t):v===null||v===32||v===60||Xp(v)?r(v):(e.consume(v),h)}function d(v){return v===64?(e.consume(v),m):Wz(v)?(e.consume(v),d):r(v)}function m(v){return yn(v)?g(v):r(v)}function g(v){return v===46?(e.consume(v),a=0,m):v===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(v),e.exit("autolinkMarker"),e.exit("autolink"),t):y(v)}function y(v){if((v===45||yn(v))&&a++<63){const S=v===45?y:g;return e.consume(v),S}return r(v)}}const tf={partial:!0,tokenize:h5};function h5(e,t,r){return a;function a(l){return Ye(l)?tt(e,o,"linePrefix")(l):o(l)}function o(l){return l===null||_e(l)?t(l):r(l)}}const TE={continuation:{tokenize:m5},exit:g5,name:"blockQuote",tokenize:p5};function p5(e,t,r){const a=this;return o;function o(u){if(u===62){const f=a.containerState;return f.open||(e.enter("blockQuote",{_container:!0}),f.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(u),e.exit("blockQuoteMarker"),l}return r(u)}function l(u){return Ye(u)?(e.enter("blockQuotePrefixWhitespace"),e.consume(u),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(u))}}function m5(e,t,r){const a=this;return o;function o(u){return Ye(u)?tt(e,l,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(u):l(u)}function l(u){return e.attempt(TE,t,r)(u)}}function g5(e){e.exit("blockQuote")}const AE={name:"characterEscape",tokenize:y5};function y5(e,t,r){return a;function a(l){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(l),e.exit("escapeMarker"),o}function o(l){return t5(l)?(e.enter("characterEscapeValue"),e.consume(l),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):r(l)}}const RE={name:"characterReference",tokenize:x5};function x5(e,t,r){const a=this;let o=0,l,u;return f;function f(g){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(g),e.exit("characterReferenceMarker"),h}function h(g){return g===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(g),e.exit("characterReferenceMarkerNumeric"),d):(e.enter("characterReferenceValue"),l=31,u=yn,m(g))}function d(g){return g===88||g===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(g),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),l=6,u=e5,m):(e.enter("characterReferenceValue"),l=7,u=Gp,m(g))}function m(g){if(g===59&&o){const y=e.exit("characterReferenceValue");return u===yn&&!qm(a.sliceSerialize(y))?r(g):(e.enter("characterReferenceMarker"),e.consume(g),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return u(g)&&o++<l?(e.consume(g),m):r(g)}}const r1={partial:!0,tokenize:b5},i1={concrete:!0,name:"codeFenced",tokenize:v5};function v5(e,t,r){const a=this,o={partial:!0,tokenize:I};let l=0,u=0,f;return h;function h(k){return d(k)}function d(k){const D=a.events[a.events.length-1];return l=D&&D[1].type==="linePrefix"?D[2].sliceSerialize(D[1],!0).length:0,f=k,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),m(k)}function m(k){return k===f?(u++,e.consume(k),m):u<3?r(k):(e.exit("codeFencedFenceSequence"),Ye(k)?tt(e,g,"whitespace")(k):g(k))}function g(k){return k===null||_e(k)?(e.exit("codeFencedFence"),a.interrupt?t(k):e.check(r1,C,M)(k)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),y(k))}function y(k){return k===null||_e(k)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),g(k)):Ye(k)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),tt(e,v,"whitespace")(k)):k===96&&k===f?r(k):(e.consume(k),y)}function v(k){return k===null||_e(k)?g(k):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),S(k))}function S(k){return k===null||_e(k)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),g(k)):k===96&&k===f?r(k):(e.consume(k),S)}function C(k){return e.attempt(o,M,N)(k)}function N(k){return e.enter("lineEnding"),e.consume(k),e.exit("lineEnding"),w}function w(k){return l>0&&Ye(k)?tt(e,O,"linePrefix",l+1)(k):O(k)}function O(k){return k===null||_e(k)?e.check(r1,C,M)(k):(e.enter("codeFlowValue"),_(k))}function _(k){return k===null||_e(k)?(e.exit("codeFlowValue"),O(k)):(e.consume(k),_)}function M(k){return e.exit("codeFenced"),t(k)}function I(k,D,U){let H=0;return q;function q(V){return k.enter("lineEnding"),k.consume(V),k.exit("lineEnding"),L}function L(V){return k.enter("codeFencedFence"),Ye(V)?tt(k,P,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(V):P(V)}function P(V){return V===f?(k.enter("codeFencedFenceSequence"),K(V)):U(V)}function K(V){return V===f?(H++,k.consume(V),K):H>=u?(k.exit("codeFencedFenceSequence"),Ye(V)?tt(k,B,"whitespace")(V):B(V)):U(V)}function B(V){return V===null||_e(V)?(k.exit("codeFencedFence"),D(V)):U(V)}}}function b5(e,t,r){const a=this;return o;function o(u){return u===null?r(u):(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),l)}function l(u){return a.parser.lazy[a.now().line]?r(u):t(u)}}const Jh={name:"codeIndented",tokenize:w5},S5={partial:!0,tokenize:E5};function w5(e,t,r){const a=this;return o;function o(d){return e.enter("codeIndented"),tt(e,l,"linePrefix",5)(d)}function l(d){const m=a.events[a.events.length-1];return m&&m[1].type==="linePrefix"&&m[2].sliceSerialize(m[1],!0).length>=4?u(d):r(d)}function u(d){return d===null?h(d):_e(d)?e.attempt(S5,u,h)(d):(e.enter("codeFlowValue"),f(d))}function f(d){return d===null||_e(d)?(e.exit("codeFlowValue"),u(d)):(e.consume(d),f)}function h(d){return e.exit("codeIndented"),t(d)}}function E5(e,t,r){const a=this;return o;function o(u){return a.parser.lazy[a.now().line]?r(u):_e(u)?(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),o):tt(e,l,"linePrefix",5)(u)}function l(u){const f=a.events[a.events.length-1];return f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?t(u):_e(u)?o(u):r(u)}}const C5={name:"codeText",previous:N5,resolve:_5,tokenize:M5};function _5(e){let t=e.length-4,r=3,a,o;if((e[r][1].type==="lineEnding"||e[r][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(a=r;++a<t;)if(e[a][1].type==="codeTextData"){e[r][1].type="codeTextPadding",e[t][1].type="codeTextPadding",r+=2,t-=2;break}}for(a=r-1,t++;++a<=t;)o===void 0?a!==t&&e[a][1].type!=="lineEnding"&&(o=a):(a===t||e[a][1].type==="lineEnding")&&(e[o][1].type="codeTextData",a!==o+2&&(e[o][1].end=e[a-1][1].end,e.splice(o+2,a-o-2),t-=a-o-2,a=o+2),o=void 0);return e}function N5(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function M5(e,t,r){let a=0,o,l;return u;function u(g){return e.enter("codeText"),e.enter("codeTextSequence"),f(g)}function f(g){return g===96?(e.consume(g),a++,f):(e.exit("codeTextSequence"),h(g))}function h(g){return g===null?r(g):g===32?(e.enter("space"),e.consume(g),e.exit("space"),h):g===96?(l=e.enter("codeTextSequence"),o=0,m(g)):_e(g)?(e.enter("lineEnding"),e.consume(g),e.exit("lineEnding"),h):(e.enter("codeTextData"),d(g))}function d(g){return g===null||g===32||g===96||_e(g)?(e.exit("codeTextData"),h(g)):(e.consume(g),d)}function m(g){return g===96?(e.consume(g),o++,m):o===a?(e.exit("codeTextSequence"),e.exit("codeText"),t(g)):(l.type="codeTextData",d(g))}}class k5{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,r){const a=r??Number.POSITIVE_INFINITY;return a<this.left.length?this.left.slice(t,a):t>this.left.length?this.right.slice(this.right.length-a+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-a+this.left.length).reverse())}splice(t,r,a){const o=r||0;this.setCursor(Math.trunc(t));const l=this.right.splice(this.right.length-o,Number.POSITIVE_INFINITY);return a&&Ts(this.left,a),l.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),Ts(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Ts(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const r=this.left.splice(t,Number.POSITIVE_INFINITY);Ts(this.right,r.reverse())}else{const r=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Ts(this.left,r.reverse())}}}function Ts(e,t){let r=0;if(t.length<1e4)e.push(...t);else for(;r<t.length;)e.push(...t.slice(r,r+1e4)),r+=1e4}function OE(e){const t={};let r=-1,a,o,l,u,f,h,d;const m=new k5(e);for(;++r<m.length;){for(;r in t;)r=t[r];if(a=m.get(r),r&&a[1].type==="chunkFlow"&&m.get(r-1)[1].type==="listItemPrefix"&&(h=a[1]._tokenizer.events,l=0,l<h.length&&h[l][1].type==="lineEndingBlank"&&(l+=2),l<h.length&&h[l][1].type==="content"))for(;++l<h.length&&h[l][1].type!=="content";)h[l][1].type==="chunkText"&&(h[l][1]._isInFirstContentOfListItem=!0,l++);if(a[0]==="enter")a[1].contentType&&(Object.assign(t,T5(m,r)),r=t[r],d=!0);else if(a[1]._container){for(l=r,o=void 0;l--;)if(u=m.get(l),u[1].type==="lineEnding"||u[1].type==="lineEndingBlank")u[0]==="enter"&&(o&&(m.get(o)[1].type="lineEndingBlank"),u[1].type="lineEnding",o=l);else if(!(u[1].type==="linePrefix"||u[1].type==="listItemIndent"))break;o&&(a[1].end={...m.get(o)[1].start},f=m.slice(o,r),f.unshift(a),m.splice(o,r-o+1,f))}}return er(e,0,Number.POSITIVE_INFINITY,m.slice(0)),!d}function T5(e,t){const r=e.get(t)[1],a=e.get(t)[2];let o=t-1;const l=[];let u=r._tokenizer;u||(u=a.parser[r.contentType](r.start),r._contentTypeTextTrailing&&(u._contentTypeTextTrailing=!0));const f=u.events,h=[],d={};let m,g,y=-1,v=r,S=0,C=0;const N=[C];for(;v;){for(;e.get(++o)[1]!==v;);l.push(o),v._tokenizer||(m=a.sliceStream(v),v.next||m.push(null),g&&u.defineSkip(v.start),v._isInFirstContentOfListItem&&(u._gfmTasklistFirstContentOfListItem=!0),u.write(m),v._isInFirstContentOfListItem&&(u._gfmTasklistFirstContentOfListItem=void 0)),g=v,v=v.next}for(v=r;++y<f.length;)f[y][0]==="exit"&&f[y-1][0]==="enter"&&f[y][1].type===f[y-1][1].type&&f[y][1].start.line!==f[y][1].end.line&&(C=y+1,N.push(C),v._tokenizer=void 0,v.previous=void 0,v=v.next);for(u.events=[],v?(v._tokenizer=void 0,v.previous=void 0):N.pop(),y=N.length;y--;){const w=f.slice(N[y],N[y+1]),O=l.pop();h.push([O,O+w.length-1]),e.splice(O,2,w)}for(h.reverse(),y=-1;++y<h.length;)d[S+h[y][0]]=S+h[y][1],S+=h[y][1]-h[y][0]-1;return d}const A5={resolve:O5,tokenize:j5},R5={partial:!0,tokenize:D5};function O5(e){return OE(e),e}function j5(e,t){let r;return a;function a(f){return e.enter("content"),r=e.enter("chunkContent",{contentType:"content"}),o(f)}function o(f){return f===null?l(f):_e(f)?e.check(R5,u,l)(f):(e.consume(f),o)}function l(f){return e.exit("chunkContent"),e.exit("content"),t(f)}function u(f){return e.consume(f),e.exit("chunkContent"),r.next=e.enter("chunkContent",{contentType:"content",previous:r}),r=r.next,o}}function D5(e,t,r){const a=this;return o;function o(u){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),tt(e,l,"linePrefix")}function l(u){if(u===null||_e(u))return r(u);const f=a.events[a.events.length-1];return!a.parser.constructs.disable.null.includes("codeIndented")&&f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?t(u):e.interrupt(a.parser.constructs.flow,r,t)(u)}}function jE(e,t,r,a,o,l,u,f,h){const d=h||Number.POSITIVE_INFINITY;let m=0;return g;function g(w){return w===60?(e.enter(a),e.enter(o),e.enter(l),e.consume(w),e.exit(l),y):w===null||w===32||w===41||Xp(w)?r(w):(e.enter(a),e.enter(u),e.enter(f),e.enter("chunkString",{contentType:"string"}),C(w))}function y(w){return w===62?(e.enter(l),e.consume(w),e.exit(l),e.exit(o),e.exit(a),t):(e.enter(f),e.enter("chunkString",{contentType:"string"}),v(w))}function v(w){return w===62?(e.exit("chunkString"),e.exit(f),y(w)):w===null||w===60||_e(w)?r(w):(e.consume(w),w===92?S:v)}function S(w){return w===60||w===62||w===92?(e.consume(w),v):v(w)}function C(w){return!m&&(w===null||w===41||nn(w))?(e.exit("chunkString"),e.exit(f),e.exit(u),e.exit(a),t(w)):m<d&&w===40?(e.consume(w),m++,C):w===41?(e.consume(w),m--,C):w===null||w===32||w===40||Xp(w)?r(w):(e.consume(w),w===92?N:C)}function N(w){return w===40||w===41||w===92?(e.consume(w),C):C(w)}}function DE(e,t,r,a,o,l){const u=this;let f=0,h;return d;function d(v){return e.enter(a),e.enter(o),e.consume(v),e.exit(o),e.enter(l),m}function m(v){return f>999||v===null||v===91||v===93&&!h||v===94&&!f&&"_hiddenFootnoteSupport"in u.parser.constructs?r(v):v===93?(e.exit(l),e.enter(o),e.consume(v),e.exit(o),e.exit(a),t):_e(v)?(e.enter("lineEnding"),e.consume(v),e.exit("lineEnding"),m):(e.enter("chunkString",{contentType:"string"}),g(v))}function g(v){return v===null||v===91||v===93||_e(v)||f++>999?(e.exit("chunkString"),m(v)):(e.consume(v),h||(h=!Ye(v)),v===92?y:g)}function y(v){return v===91||v===92||v===93?(e.consume(v),f++,g):g(v)}}function zE(e,t,r,a,o,l){let u;return f;function f(y){return y===34||y===39||y===40?(e.enter(a),e.enter(o),e.consume(y),e.exit(o),u=y===40?41:y,h):r(y)}function h(y){return y===u?(e.enter(o),e.consume(y),e.exit(o),e.exit(a),t):(e.enter(l),d(y))}function d(y){return y===u?(e.exit(l),h(u)):y===null?r(y):_e(y)?(e.enter("lineEnding"),e.consume(y),e.exit("lineEnding"),tt(e,d,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),m(y))}function m(y){return y===u||y===null||_e(y)?(e.exit("chunkString"),d(y)):(e.consume(y),y===92?g:m)}function g(y){return y===u||y===92?(e.consume(y),m):m(y)}}function Is(e,t){let r;return a;function a(o){return _e(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),r=!0,a):Ye(o)?tt(e,a,r?"linePrefix":"lineSuffix")(o):t(o)}}const z5={name:"definition",tokenize:B5},L5={partial:!0,tokenize:I5};function B5(e,t,r){const a=this;let o;return l;function l(v){return e.enter("definition"),u(v)}function u(v){return DE.call(a,e,f,r,"definitionLabel","definitionLabelMarker","definitionLabelString")(v)}function f(v){return o=so(a.sliceSerialize(a.events[a.events.length-1][1]).slice(1,-1)),v===58?(e.enter("definitionMarker"),e.consume(v),e.exit("definitionMarker"),h):r(v)}function h(v){return nn(v)?Is(e,d)(v):d(v)}function d(v){return jE(e,m,r,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(v)}function m(v){return e.attempt(L5,g,g)(v)}function g(v){return Ye(v)?tt(e,y,"whitespace")(v):y(v)}function y(v){return v===null||_e(v)?(e.exit("definition"),a.parser.defined.push(o),t(v)):r(v)}}function I5(e,t,r){return a;function a(f){return nn(f)?Is(e,o)(f):r(f)}function o(f){return zE(e,l,r,"definitionTitle","definitionTitleMarker","definitionTitleString")(f)}function l(f){return Ye(f)?tt(e,u,"whitespace")(f):u(f)}function u(f){return f===null||_e(f)?t(f):r(f)}}const H5={name:"hardBreakEscape",tokenize:P5};function P5(e,t,r){return a;function a(l){return e.enter("hardBreakEscape"),e.consume(l),o}function o(l){return _e(l)?(e.exit("hardBreakEscape"),t(l)):r(l)}}const U5={name:"headingAtx",resolve:q5,tokenize:V5};function q5(e,t){let r=e.length-2,a=3,o,l;return e[a][1].type==="whitespace"&&(a+=2),r-2>a&&e[r][1].type==="whitespace"&&(r-=2),e[r][1].type==="atxHeadingSequence"&&(a===r-1||r-4>a&&e[r-2][1].type==="whitespace")&&(r-=a+1===r?2:4),r>a&&(o={type:"atxHeadingText",start:e[a][1].start,end:e[r][1].end},l={type:"chunkText",start:e[a][1].start,end:e[r][1].end,contentType:"text"},er(e,a,r-a+1,[["enter",o,t],["enter",l,t],["exit",l,t],["exit",o,t]])),e}function V5(e,t,r){let a=0;return o;function o(m){return e.enter("atxHeading"),l(m)}function l(m){return e.enter("atxHeadingSequence"),u(m)}function u(m){return m===35&&a++<6?(e.consume(m),u):m===null||nn(m)?(e.exit("atxHeadingSequence"),f(m)):r(m)}function f(m){return m===35?(e.enter("atxHeadingSequence"),h(m)):m===null||_e(m)?(e.exit("atxHeading"),t(m)):Ye(m)?tt(e,f,"whitespace")(m):(e.enter("atxHeadingText"),d(m))}function h(m){return m===35?(e.consume(m),h):(e.exit("atxHeadingSequence"),f(m))}function d(m){return m===null||m===35||nn(m)?(e.exit("atxHeadingText"),f(m)):(e.consume(m),d)}}const F5=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],a1=["pre","script","style","textarea"],Y5={concrete:!0,name:"htmlFlow",resolveTo:$5,tokenize:Q5},X5={partial:!0,tokenize:K5},G5={partial:!0,tokenize:Z5};function $5(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function Q5(e,t,r){const a=this;let o,l,u,f,h;return d;function d(R){return m(R)}function m(R){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(R),g}function g(R){return R===33?(e.consume(R),y):R===47?(e.consume(R),l=!0,C):R===63?(e.consume(R),o=3,a.interrupt?t:A):Kn(R)?(e.consume(R),u=String.fromCharCode(R),N):r(R)}function y(R){return R===45?(e.consume(R),o=2,v):R===91?(e.consume(R),o=5,f=0,S):Kn(R)?(e.consume(R),o=4,a.interrupt?t:A):r(R)}function v(R){return R===45?(e.consume(R),a.interrupt?t:A):r(R)}function S(R){const te="CDATA[";return R===te.charCodeAt(f++)?(e.consume(R),f===te.length?a.interrupt?t:P:S):r(R)}function C(R){return Kn(R)?(e.consume(R),u=String.fromCharCode(R),N):r(R)}function N(R){if(R===null||R===47||R===62||nn(R)){const te=R===47,ue=u.toLowerCase();return!te&&!l&&a1.includes(ue)?(o=1,a.interrupt?t(R):P(R)):F5.includes(u.toLowerCase())?(o=6,te?(e.consume(R),w):a.interrupt?t(R):P(R)):(o=7,a.interrupt&&!a.parser.lazy[a.now().line]?r(R):l?O(R):_(R))}return R===45||yn(R)?(e.consume(R),u+=String.fromCharCode(R),N):r(R)}function w(R){return R===62?(e.consume(R),a.interrupt?t:P):r(R)}function O(R){return Ye(R)?(e.consume(R),O):q(R)}function _(R){return R===47?(e.consume(R),q):R===58||R===95||Kn(R)?(e.consume(R),M):Ye(R)?(e.consume(R),_):q(R)}function M(R){return R===45||R===46||R===58||R===95||yn(R)?(e.consume(R),M):I(R)}function I(R){return R===61?(e.consume(R),k):Ye(R)?(e.consume(R),I):_(R)}function k(R){return R===null||R===60||R===61||R===62||R===96?r(R):R===34||R===39?(e.consume(R),h=R,D):Ye(R)?(e.consume(R),k):U(R)}function D(R){return R===h?(e.consume(R),h=null,H):R===null||_e(R)?r(R):(e.consume(R),D)}function U(R){return R===null||R===34||R===39||R===47||R===60||R===61||R===62||R===96||nn(R)?I(R):(e.consume(R),U)}function H(R){return R===47||R===62||Ye(R)?_(R):r(R)}function q(R){return R===62?(e.consume(R),L):r(R)}function L(R){return R===null||_e(R)?P(R):Ye(R)?(e.consume(R),L):r(R)}function P(R){return R===45&&o===2?(e.consume(R),j):R===60&&o===1?(e.consume(R),F):R===62&&o===4?(e.consume(R),z):R===63&&o===3?(e.consume(R),A):R===93&&o===5?(e.consume(R),Z):_e(R)&&(o===6||o===7)?(e.exit("htmlFlowData"),e.check(X5,X,K)(R)):R===null||_e(R)?(e.exit("htmlFlowData"),K(R)):(e.consume(R),P)}function K(R){return e.check(G5,B,X)(R)}function B(R){return e.enter("lineEnding"),e.consume(R),e.exit("lineEnding"),V}function V(R){return R===null||_e(R)?K(R):(e.enter("htmlFlowData"),P(R))}function j(R){return R===45?(e.consume(R),A):P(R)}function F(R){return R===47?(e.consume(R),u="",$):P(R)}function $(R){if(R===62){const te=u.toLowerCase();return a1.includes(te)?(e.consume(R),z):P(R)}return Kn(R)&&u.length<8?(e.consume(R),u+=String.fromCharCode(R),$):P(R)}function Z(R){return R===93?(e.consume(R),A):P(R)}function A(R){return R===62?(e.consume(R),z):R===45&&o===2?(e.consume(R),A):P(R)}function z(R){return R===null||_e(R)?(e.exit("htmlFlowData"),X(R)):(e.consume(R),z)}function X(R){return e.exit("htmlFlow"),t(R)}}function Z5(e,t,r){const a=this;return o;function o(u){return _e(u)?(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),l):r(u)}function l(u){return a.parser.lazy[a.now().line]?r(u):t(u)}}function K5(e,t,r){return a;function a(o){return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),e.attempt(tf,t,r)}}const J5={name:"htmlText",tokenize:W5};function W5(e,t,r){const a=this;let o,l,u;return f;function f(A){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(A),h}function h(A){return A===33?(e.consume(A),d):A===47?(e.consume(A),I):A===63?(e.consume(A),_):Kn(A)?(e.consume(A),U):r(A)}function d(A){return A===45?(e.consume(A),m):A===91?(e.consume(A),l=0,S):Kn(A)?(e.consume(A),O):r(A)}function m(A){return A===45?(e.consume(A),v):r(A)}function g(A){return A===null?r(A):A===45?(e.consume(A),y):_e(A)?(u=g,F(A)):(e.consume(A),g)}function y(A){return A===45?(e.consume(A),v):g(A)}function v(A){return A===62?j(A):A===45?y(A):g(A)}function S(A){const z="CDATA[";return A===z.charCodeAt(l++)?(e.consume(A),l===z.length?C:S):r(A)}function C(A){return A===null?r(A):A===93?(e.consume(A),N):_e(A)?(u=C,F(A)):(e.consume(A),C)}function N(A){return A===93?(e.consume(A),w):C(A)}function w(A){return A===62?j(A):A===93?(e.consume(A),w):C(A)}function O(A){return A===null||A===62?j(A):_e(A)?(u=O,F(A)):(e.consume(A),O)}function _(A){return A===null?r(A):A===63?(e.consume(A),M):_e(A)?(u=_,F(A)):(e.consume(A),_)}function M(A){return A===62?j(A):_(A)}function I(A){return Kn(A)?(e.consume(A),k):r(A)}function k(A){return A===45||yn(A)?(e.consume(A),k):D(A)}function D(A){return _e(A)?(u=D,F(A)):Ye(A)?(e.consume(A),D):j(A)}function U(A){return A===45||yn(A)?(e.consume(A),U):A===47||A===62||nn(A)?H(A):r(A)}function H(A){return A===47?(e.consume(A),j):A===58||A===95||Kn(A)?(e.consume(A),q):_e(A)?(u=H,F(A)):Ye(A)?(e.consume(A),H):j(A)}function q(A){return A===45||A===46||A===58||A===95||yn(A)?(e.consume(A),q):L(A)}function L(A){return A===61?(e.consume(A),P):_e(A)?(u=L,F(A)):Ye(A)?(e.consume(A),L):H(A)}function P(A){return A===null||A===60||A===61||A===62||A===96?r(A):A===34||A===39?(e.consume(A),o=A,K):_e(A)?(u=P,F(A)):Ye(A)?(e.consume(A),P):(e.consume(A),B)}function K(A){return A===o?(e.consume(A),o=void 0,V):A===null?r(A):_e(A)?(u=K,F(A)):(e.consume(A),K)}function B(A){return A===null||A===34||A===39||A===60||A===61||A===96?r(A):A===47||A===62||nn(A)?H(A):(e.consume(A),B)}function V(A){return A===47||A===62||nn(A)?H(A):r(A)}function j(A){return A===62?(e.consume(A),e.exit("htmlTextData"),e.exit("htmlText"),t):r(A)}function F(A){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(A),e.exit("lineEnding"),$}function $(A){return Ye(A)?tt(e,Z,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(A):Z(A)}function Z(A){return e.enter("htmlTextData"),u(A)}}const Fm={name:"labelEnd",resolveAll:r4,resolveTo:i4,tokenize:a4},e4={tokenize:o4},t4={tokenize:s4},n4={tokenize:l4};function r4(e){let t=-1;const r=[];for(;++t<e.length;){const a=e[t][1];if(r.push(e[t]),a.type==="labelImage"||a.type==="labelLink"||a.type==="labelEnd"){const o=a.type==="labelImage"?4:2;a.type="data",t+=o}}return e.length!==r.length&&er(e,0,e.length,r),e}function i4(e,t){let r=e.length,a=0,o,l,u,f;for(;r--;)if(o=e[r][1],l){if(o.type==="link"||o.type==="labelLink"&&o._inactive)break;e[r][0]==="enter"&&o.type==="labelLink"&&(o._inactive=!0)}else if(u){if(e[r][0]==="enter"&&(o.type==="labelImage"||o.type==="labelLink")&&!o._balanced&&(l=r,o.type!=="labelLink")){a=2;break}}else o.type==="labelEnd"&&(u=r);const h={type:e[l][1].type==="labelLink"?"link":"image",start:{...e[l][1].start},end:{...e[e.length-1][1].end}},d={type:"label",start:{...e[l][1].start},end:{...e[u][1].end}},m={type:"labelText",start:{...e[l+a+2][1].end},end:{...e[u-2][1].start}};return f=[["enter",h,t],["enter",d,t]],f=Tn(f,e.slice(l+1,l+a+3)),f=Tn(f,[["enter",m,t]]),f=Tn(f,Vm(t.parser.constructs.insideSpan.null,e.slice(l+a+4,u-3),t)),f=Tn(f,[["exit",m,t],e[u-2],e[u-1],["exit",d,t]]),f=Tn(f,e.slice(u+1)),f=Tn(f,[["exit",h,t]]),er(e,l,e.length,f),e}function a4(e,t,r){const a=this;let o=a.events.length,l,u;for(;o--;)if((a.events[o][1].type==="labelImage"||a.events[o][1].type==="labelLink")&&!a.events[o][1]._balanced){l=a.events[o][1];break}return f;function f(y){return l?l._inactive?g(y):(u=a.parser.defined.includes(so(a.sliceSerialize({start:l.end,end:a.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(y),e.exit("labelMarker"),e.exit("labelEnd"),h):r(y)}function h(y){return y===40?e.attempt(e4,m,u?m:g)(y):y===91?e.attempt(t4,m,u?d:g)(y):u?m(y):g(y)}function d(y){return e.attempt(n4,m,g)(y)}function m(y){return t(y)}function g(y){return l._balanced=!0,r(y)}}function o4(e,t,r){return a;function a(g){return e.enter("resource"),e.enter("resourceMarker"),e.consume(g),e.exit("resourceMarker"),o}function o(g){return nn(g)?Is(e,l)(g):l(g)}function l(g){return g===41?m(g):jE(e,u,f,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(g)}function u(g){return nn(g)?Is(e,h)(g):m(g)}function f(g){return r(g)}function h(g){return g===34||g===39||g===40?zE(e,d,r,"resourceTitle","resourceTitleMarker","resourceTitleString")(g):m(g)}function d(g){return nn(g)?Is(e,m)(g):m(g)}function m(g){return g===41?(e.enter("resourceMarker"),e.consume(g),e.exit("resourceMarker"),e.exit("resource"),t):r(g)}}function s4(e,t,r){const a=this;return o;function o(f){return DE.call(a,e,l,u,"reference","referenceMarker","referenceString")(f)}function l(f){return a.parser.defined.includes(so(a.sliceSerialize(a.events[a.events.length-1][1]).slice(1,-1)))?t(f):r(f)}function u(f){return r(f)}}function l4(e,t,r){return a;function a(l){return e.enter("reference"),e.enter("referenceMarker"),e.consume(l),e.exit("referenceMarker"),o}function o(l){return l===93?(e.enter("referenceMarker"),e.consume(l),e.exit("referenceMarker"),e.exit("reference"),t):r(l)}}const u4={name:"labelStartImage",resolveAll:Fm.resolveAll,tokenize:c4};function c4(e,t,r){const a=this;return o;function o(f){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(f),e.exit("labelImageMarker"),l}function l(f){return f===91?(e.enter("labelMarker"),e.consume(f),e.exit("labelMarker"),e.exit("labelImage"),u):r(f)}function u(f){return f===94&&"_hiddenFootnoteSupport"in a.parser.constructs?r(f):t(f)}}const f4={name:"labelStartLink",resolveAll:Fm.resolveAll,tokenize:d4};function d4(e,t,r){const a=this;return o;function o(u){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(u),e.exit("labelMarker"),e.exit("labelLink"),l}function l(u){return u===94&&"_hiddenFootnoteSupport"in a.parser.constructs?r(u):t(u)}}const Wh={name:"lineEnding",tokenize:h4};function h4(e,t){return r;function r(a){return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),tt(e,t,"linePrefix")}}const pc={name:"thematicBreak",tokenize:p4};function p4(e,t,r){let a=0,o;return l;function l(d){return e.enter("thematicBreak"),u(d)}function u(d){return o=d,f(d)}function f(d){return d===o?(e.enter("thematicBreakSequence"),h(d)):a>=3&&(d===null||_e(d))?(e.exit("thematicBreak"),t(d)):r(d)}function h(d){return d===o?(e.consume(d),a++,h):(e.exit("thematicBreakSequence"),Ye(d)?tt(e,f,"whitespace")(d):f(d))}}const Kt={continuation:{tokenize:x4},exit:b4,name:"list",tokenize:y4},m4={partial:!0,tokenize:S4},g4={partial:!0,tokenize:v4};function y4(e,t,r){const a=this,o=a.events[a.events.length-1];let l=o&&o[1].type==="linePrefix"?o[2].sliceSerialize(o[1],!0).length:0,u=0;return f;function f(v){const S=a.containerState.type||(v===42||v===43||v===45?"listUnordered":"listOrdered");if(S==="listUnordered"?!a.containerState.marker||v===a.containerState.marker:Gp(v)){if(a.containerState.type||(a.containerState.type=S,e.enter(S,{_container:!0})),S==="listUnordered")return e.enter("listItemPrefix"),v===42||v===45?e.check(pc,r,d)(v):d(v);if(!a.interrupt||v===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),h(v)}return r(v)}function h(v){return Gp(v)&&++u<10?(e.consume(v),h):(!a.interrupt||u<2)&&(a.containerState.marker?v===a.containerState.marker:v===41||v===46)?(e.exit("listItemValue"),d(v)):r(v)}function d(v){return e.enter("listItemMarker"),e.consume(v),e.exit("listItemMarker"),a.containerState.marker=a.containerState.marker||v,e.check(tf,a.interrupt?r:m,e.attempt(m4,y,g))}function m(v){return a.containerState.initialBlankLine=!0,l++,y(v)}function g(v){return Ye(v)?(e.enter("listItemPrefixWhitespace"),e.consume(v),e.exit("listItemPrefixWhitespace"),y):r(v)}function y(v){return a.containerState.size=l+a.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(v)}}function x4(e,t,r){const a=this;return a.containerState._closeFlow=void 0,e.check(tf,o,l);function o(f){return a.containerState.furtherBlankLines=a.containerState.furtherBlankLines||a.containerState.initialBlankLine,tt(e,t,"listItemIndent",a.containerState.size+1)(f)}function l(f){return a.containerState.furtherBlankLines||!Ye(f)?(a.containerState.furtherBlankLines=void 0,a.containerState.initialBlankLine=void 0,u(f)):(a.containerState.furtherBlankLines=void 0,a.containerState.initialBlankLine=void 0,e.attempt(g4,t,u)(f))}function u(f){return a.containerState._closeFlow=!0,a.interrupt=void 0,tt(e,e.attempt(Kt,t,r),"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(f)}}function v4(e,t,r){const a=this;return tt(e,o,"listItemIndent",a.containerState.size+1);function o(l){const u=a.events[a.events.length-1];return u&&u[1].type==="listItemIndent"&&u[2].sliceSerialize(u[1],!0).length===a.containerState.size?t(l):r(l)}}function b4(e){e.exit(this.containerState.type)}function S4(e,t,r){const a=this;return tt(e,o,"listItemPrefixWhitespace",a.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function o(l){const u=a.events[a.events.length-1];return!Ye(l)&&u&&u[1].type==="listItemPrefixWhitespace"?t(l):r(l)}}const o1={name:"setextUnderline",resolveTo:w4,tokenize:E4};function w4(e,t){let r=e.length,a,o,l;for(;r--;)if(e[r][0]==="enter"){if(e[r][1].type==="content"){a=r;break}e[r][1].type==="paragraph"&&(o=r)}else e[r][1].type==="content"&&e.splice(r,1),!l&&e[r][1].type==="definition"&&(l=r);const u={type:"setextHeading",start:{...e[a][1].start},end:{...e[e.length-1][1].end}};return e[o][1].type="setextHeadingText",l?(e.splice(o,0,["enter",u,t]),e.splice(l+1,0,["exit",e[a][1],t]),e[a][1].end={...e[l][1].end}):e[a][1]=u,e.push(["exit",u,t]),e}function E4(e,t,r){const a=this;let o;return l;function l(d){let m=a.events.length,g;for(;m--;)if(a.events[m][1].type!=="lineEnding"&&a.events[m][1].type!=="linePrefix"&&a.events[m][1].type!=="content"){g=a.events[m][1].type==="paragraph";break}return!a.parser.lazy[a.now().line]&&(a.interrupt||g)?(e.enter("setextHeadingLine"),o=d,u(d)):r(d)}function u(d){return e.enter("setextHeadingLineSequence"),f(d)}function f(d){return d===o?(e.consume(d),f):(e.exit("setextHeadingLineSequence"),Ye(d)?tt(e,h,"lineSuffix")(d):h(d))}function h(d){return d===null||_e(d)?(e.exit("setextHeadingLine"),t(d)):r(d)}}const C4={tokenize:_4};function _4(e){const t=this,r=e.attempt(tf,a,e.attempt(this.parser.constructs.flowInitial,o,tt(e,e.attempt(this.parser.constructs.flow,o,e.attempt(A5,o)),"linePrefix")));return r;function a(l){if(l===null){e.consume(l);return}return e.enter("lineEndingBlank"),e.consume(l),e.exit("lineEndingBlank"),t.currentConstruct=void 0,r}function o(l){if(l===null){e.consume(l);return}return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),t.currentConstruct=void 0,r}}const N4={resolveAll:BE()},M4=LE("string"),k4=LE("text");function LE(e){return{resolveAll:BE(e==="text"?T4:void 0),tokenize:t};function t(r){const a=this,o=this.parser.constructs[e],l=r.attempt(o,u,f);return u;function u(m){return d(m)?l(m):f(m)}function f(m){if(m===null){r.consume(m);return}return r.enter("data"),r.consume(m),h}function h(m){return d(m)?(r.exit("data"),l(m)):(r.consume(m),h)}function d(m){if(m===null)return!0;const g=o[m];let y=-1;if(g)for(;++y<g.length;){const v=g[y];if(!v.previous||v.previous.call(a,a.previous))return!0}return!1}}}function BE(e){return t;function t(r,a){let o=-1,l;for(;++o<=r.length;)l===void 0?r[o]&&r[o][1].type==="data"&&(l=o,o++):(!r[o]||r[o][1].type!=="data")&&(o!==l+2&&(r[l][1].end=r[o-1][1].end,r.splice(l+2,o-l-2),o=l+2),l=void 0);return e?e(r,a):r}}function T4(e,t){let r=0;for(;++r<=e.length;)if((r===e.length||e[r][1].type==="lineEnding")&&e[r-1][1].type==="data"){const a=e[r-1][1],o=t.sliceStream(a);let l=o.length,u=-1,f=0,h;for(;l--;){const d=o[l];if(typeof d=="string"){for(u=d.length;d.charCodeAt(u-1)===32;)f++,u--;if(u)break;u=-1}else if(d===-2)h=!0,f++;else if(d!==-1){l++;break}}if(t._contentTypeTextTrailing&&r===e.length&&(f=0),f){const d={type:r===e.length||h||f<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:l?u:a.start._bufferIndex+u,_index:a.start._index+l,line:a.end.line,column:a.end.column-f,offset:a.end.offset-f},end:{...a.end}};a.end={...d.start},a.start.offset===a.end.offset?Object.assign(a,d):(e.splice(r,0,["enter",d,t],["exit",d,t]),r+=2)}r++}return e}const A4={42:Kt,43:Kt,45:Kt,48:Kt,49:Kt,50:Kt,51:Kt,52:Kt,53:Kt,54:Kt,55:Kt,56:Kt,57:Kt,62:TE},R4={91:z5},O4={[-2]:Jh,[-1]:Jh,32:Jh},j4={35:U5,42:pc,45:[o1,pc],60:Y5,61:o1,95:pc,96:i1,126:i1},D4={38:RE,92:AE},z4={[-5]:Wh,[-4]:Wh,[-3]:Wh,33:u4,38:RE,42:$p,60:[f5,J5],91:f4,92:[H5,AE],93:Fm,95:$p,96:C5},L4={null:[$p,N4]},B4={null:[42,95]},I4={null:[]},H4=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:B4,contentInitial:R4,disable:I4,document:A4,flow:j4,flowInitial:O4,insideSpan:L4,string:D4,text:z4},Symbol.toStringTag,{value:"Module"}));function P4(e,t,r){let a={_bufferIndex:-1,_index:0,line:r&&r.line||1,column:r&&r.column||1,offset:r&&r.offset||0};const o={},l=[];let u=[],f=[];const h={attempt:D(I),check:D(k),consume:O,enter:_,exit:M,interrupt:D(k,{interrupt:!0})},d={code:null,containerState:{},defineSkip:C,events:[],now:S,parser:e,previous:null,sliceSerialize:y,sliceStream:v,write:g};let m=t.tokenize.call(d,h);return t.resolveAll&&l.push(t),d;function g(L){return u=Tn(u,L),N(),u[u.length-1]!==null?[]:(U(t,0),d.events=Vm(l,d.events,d),d.events)}function y(L,P){return q4(v(L),P)}function v(L){return U4(u,L)}function S(){const{_bufferIndex:L,_index:P,line:K,column:B,offset:V}=a;return{_bufferIndex:L,_index:P,line:K,column:B,offset:V}}function C(L){o[L.line]=L.column,q()}function N(){let L;for(;a._index<u.length;){const P=u[a._index];if(typeof P=="string")for(L=a._index,a._bufferIndex<0&&(a._bufferIndex=0);a._index===L&&a._bufferIndex<P.length;)w(P.charCodeAt(a._bufferIndex));else w(P)}}function w(L){m=m(L)}function O(L){_e(L)?(a.line++,a.column=1,a.offset+=L===-3?2:1,q()):L!==-1&&(a.column++,a.offset++),a._bufferIndex<0?a._index++:(a._bufferIndex++,a._bufferIndex===u[a._index].length&&(a._bufferIndex=-1,a._index++)),d.previous=L}function _(L,P){const K=P||{};return K.type=L,K.start=S(),d.events.push(["enter",K,d]),f.push(K),K}function M(L){const P=f.pop();return P.end=S(),d.events.push(["exit",P,d]),P}function I(L,P){U(L,P.from)}function k(L,P){P.restore()}function D(L,P){return K;function K(B,V,j){let F,$,Z,A;return Array.isArray(B)?X(B):"tokenize"in B?X([B]):z(B);function z(ce){return fe;function fe(le){const pe=le!==null&&ce[le],be=le!==null&&ce.null,Se=[...Array.isArray(pe)?pe:pe?[pe]:[],...Array.isArray(be)?be:be?[be]:[]];return X(Se)(le)}}function X(ce){return F=ce,$=0,ce.length===0?j:R(ce[$])}function R(ce){return fe;function fe(le){return A=H(),Z=ce,ce.partial||(d.currentConstruct=ce),ce.name&&d.parser.constructs.disable.null.includes(ce.name)?ue():ce.tokenize.call(P?Object.assign(Object.create(d),P):d,h,te,ue)(le)}}function te(ce){return L(Z,A),V}function ue(ce){return A.restore(),++$<F.length?R(F[$]):j}}}function U(L,P){L.resolveAll&&!l.includes(L)&&l.push(L),L.resolve&&er(d.events,P,d.events.length-P,L.resolve(d.events.slice(P),d)),L.resolveTo&&(d.events=L.resolveTo(d.events,d))}function H(){const L=S(),P=d.previous,K=d.currentConstruct,B=d.events.length,V=Array.from(f);return{from:B,restore:j};function j(){a=L,d.previous=P,d.currentConstruct=K,d.events.length=B,f=V,q()}}function q(){a.line in o&&a.column<2&&(a.column=o[a.line],a.offset+=o[a.line]-1)}}function U4(e,t){const r=t.start._index,a=t.start._bufferIndex,o=t.end._index,l=t.end._bufferIndex;let u;if(r===o)u=[e[r].slice(a,l)];else{if(u=e.slice(r,o),a>-1){const f=u[0];typeof f=="string"?u[0]=f.slice(a):u.shift()}l>0&&u.push(e[o].slice(0,l))}return u}function q4(e,t){let r=-1;const a=[];let o;for(;++r<e.length;){const l=e[r];let u;if(typeof l=="string")u=l;else switch(l){case-5:{u="\r";break}case-4:{u=`
|
|
17
|
-
`;break}case-3:{u=`\r
|
|
18
|
-
`;break}case-2:{u=t?" ":" ";break}case-1:{if(!t&&o)continue;u=" ";break}default:u=String.fromCharCode(l)}o=l===-2,a.push(u)}return a.join("")}function V4(e){const a={constructs:Zz([H4,...(e||{}).extensions||[]]),content:o(i5),defined:[],document:o(o5),flow:o(C4),lazy:{},string:o(M4),text:o(k4)};return a;function o(l){return u;function u(f){return P4(a,l,f)}}}function F4(e){for(;!OE(e););return e}const s1=/[\0\t\n\r]/g;function Y4(){let e=1,t="",r=!0,a;return o;function o(l,u,f){const h=[];let d,m,g,y,v;for(l=t+(typeof l=="string"?l.toString():new TextDecoder(u||void 0).decode(l)),g=0,t="",r&&(l.charCodeAt(0)===65279&&g++,r=void 0);g<l.length;){if(s1.lastIndex=g,d=s1.exec(l),y=d&&d.index!==void 0?d.index:l.length,v=l.charCodeAt(y),!d){t=l.slice(g);break}if(v===10&&g===y&&a)h.push(-3),a=void 0;else switch(a&&(h.push(-5),a=void 0),g<y&&(h.push(l.slice(g,y)),e+=y-g),v){case 0:{h.push(65533),e++;break}case 9:{for(m=Math.ceil(e/4)*4,h.push(-2);e++<m;)h.push(-1);break}case 10:{h.push(-4),e=1;break}default:a=!0,e=1}g=y+1}return f&&(a&&h.push(-5),t&&h.push(t),h.push(null)),h}}const X4=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function G4(e){return e.replace(X4,$4)}function $4(e,t,r){if(t)return t;if(r.charCodeAt(0)===35){const o=r.charCodeAt(1),l=o===120||o===88;return kE(r.slice(l?2:1),l?16:10)}return qm(r)||e}const IE={}.hasOwnProperty;function Q4(e,t,r){return typeof t!="string"&&(r=t,t=void 0),Z4(r)(F4(V4(r).document().write(Y4()(e,t,!0))))}function Z4(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:l(it),autolinkProtocol:H,autolinkEmail:H,atxHeading:l(He),blockQuote:l(be),characterEscape:H,characterReference:H,codeFenced:l(Se),codeFencedFenceInfo:u,codeFencedFenceMeta:u,codeIndented:l(Se,u),codeText:l(ye,u),codeTextData:H,data:H,codeFlowValue:H,definition:l(we),definitionDestinationString:u,definitionLabelString:u,definitionTitleString:u,emphasis:l(Re),hardBreakEscape:l(Be),hardBreakTrailing:l(Be),htmlFlow:l(Qe,u),htmlFlowData:H,htmlText:l(Qe,u),htmlTextData:H,image:l(_t),label:u,link:l(it),listItem:l(qt),listItemValue:y,listOrdered:l(Ot,g),listUnordered:l(Ot),paragraph:l(An),reference:R,referenceString:u,resourceDestinationString:u,resourceTitleString:u,setextHeading:l(He),strong:l(vn),thematicBreak:l(ut)},exit:{atxHeading:h(),atxHeadingSequence:I,autolink:h(),autolinkEmail:pe,autolinkProtocol:le,blockQuote:h(),characterEscapeValue:q,characterReferenceMarkerHexadecimal:ue,characterReferenceMarkerNumeric:ue,characterReferenceValue:ce,characterReference:fe,codeFenced:h(N),codeFencedFence:C,codeFencedFenceInfo:v,codeFencedFenceMeta:S,codeFlowValue:q,codeIndented:h(w),codeText:h(V),codeTextData:q,data:q,definition:h(),definitionDestinationString:M,definitionLabelString:O,definitionTitleString:_,emphasis:h(),hardBreakEscape:h(P),hardBreakTrailing:h(P),htmlFlow:h(K),htmlFlowData:q,htmlText:h(B),htmlTextData:q,image:h(F),label:Z,labelText:$,lineEnding:L,link:h(j),listItem:h(),listOrdered:h(),listUnordered:h(),paragraph:h(),referenceString:te,resourceDestinationString:A,resourceTitleString:z,resource:X,setextHeading:h(U),setextHeadingLineSequence:D,setextHeadingText:k,strong:h(),thematicBreak:h()}};HE(t,(e||{}).mdastExtensions||[]);const r={};return a;function a(ie){let he={type:"root",children:[]};const Ee={stack:[he],tokenStack:[],config:t,enter:f,exit:d,buffer:u,resume:m,data:r},Oe=[];let Pe=-1;for(;++Pe<ie.length;)if(ie[Pe][1].type==="listOrdered"||ie[Pe][1].type==="listUnordered")if(ie[Pe][0]==="enter")Oe.push(Pe);else{const It=Oe.pop();Pe=o(ie,It,Pe)}for(Pe=-1;++Pe<ie.length;){const It=t[ie[Pe][0]];IE.call(It,ie[Pe][1].type)&&It[ie[Pe][1].type].call(Object.assign({sliceSerialize:ie[Pe][2].sliceSerialize},Ee),ie[Pe][1])}if(Ee.tokenStack.length>0){const It=Ee.tokenStack[Ee.tokenStack.length-1];(It[1]||l1).call(Ee,void 0,It[0])}for(he.position={start:oi(ie.length>0?ie[0][1].start:{line:1,column:1,offset:0}),end:oi(ie.length>0?ie[ie.length-2][1].end:{line:1,column:1,offset:0})},Pe=-1;++Pe<t.transforms.length;)he=t.transforms[Pe](he)||he;return he}function o(ie,he,Ee){let Oe=he-1,Pe=-1,It=!1,Rn,Nt,dt,jt;for(;++Oe<=Ee;){const Xe=ie[Oe];switch(Xe[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Xe[0]==="enter"?Pe++:Pe--,jt=void 0;break}case"lineEndingBlank":{Xe[0]==="enter"&&(Rn&&!jt&&!Pe&&!dt&&(dt=Oe),jt=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:jt=void 0}if(!Pe&&Xe[0]==="enter"&&Xe[1].type==="listItemPrefix"||Pe===-1&&Xe[0]==="exit"&&(Xe[1].type==="listUnordered"||Xe[1].type==="listOrdered")){if(Rn){let Un=Oe;for(Nt=void 0;Un--;){const on=ie[Un];if(on[1].type==="lineEnding"||on[1].type==="lineEndingBlank"){if(on[0]==="exit")continue;Nt&&(ie[Nt][1].type="lineEndingBlank",It=!0),on[1].type="lineEnding",Nt=Un}else if(!(on[1].type==="linePrefix"||on[1].type==="blockQuotePrefix"||on[1].type==="blockQuotePrefixWhitespace"||on[1].type==="blockQuoteMarker"||on[1].type==="listItemIndent"))break}dt&&(!Nt||dt<Nt)&&(Rn._spread=!0),Rn.end=Object.assign({},Nt?ie[Nt][1].start:Xe[1].end),ie.splice(Nt||Oe,0,["exit",Rn,Xe[2]]),Oe++,Ee++}if(Xe[1].type==="listItemPrefix"){const Un={type:"listItem",_spread:!1,start:Object.assign({},Xe[1].start),end:void 0};Rn=Un,ie.splice(Oe,0,["enter",Un,Xe[2]]),Oe++,Ee++,dt=void 0,jt=!0}}}return ie[he][1]._spread=It,Ee}function l(ie,he){return Ee;function Ee(Oe){f.call(this,ie(Oe),Oe),he&&he.call(this,Oe)}}function u(){this.stack.push({type:"fragment",children:[]})}function f(ie,he,Ee){this.stack[this.stack.length-1].children.push(ie),this.stack.push(ie),this.tokenStack.push([he,Ee||void 0]),ie.position={start:oi(he.start),end:void 0}}function h(ie){return he;function he(Ee){ie&&ie.call(this,Ee),d.call(this,Ee)}}function d(ie,he){const Ee=this.stack.pop(),Oe=this.tokenStack.pop();if(Oe)Oe[0].type!==ie.type&&(he?he.call(this,ie,Oe[0]):(Oe[1]||l1).call(this,ie,Oe[0]));else throw new Error("Cannot close `"+ie.type+"` ("+Bs({start:ie.start,end:ie.end})+"): it’s not open");Ee.position.end=oi(ie.end)}function m(){return $z(this.stack.pop())}function g(){this.data.expectingFirstListItemValue=!0}function y(ie){if(this.data.expectingFirstListItemValue){const he=this.stack[this.stack.length-2];he.start=Number.parseInt(this.sliceSerialize(ie),10),this.data.expectingFirstListItemValue=void 0}}function v(){const ie=this.resume(),he=this.stack[this.stack.length-1];he.lang=ie}function S(){const ie=this.resume(),he=this.stack[this.stack.length-1];he.meta=ie}function C(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function N(){const ie=this.resume(),he=this.stack[this.stack.length-1];he.value=ie.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function w(){const ie=this.resume(),he=this.stack[this.stack.length-1];he.value=ie.replace(/(\r?\n|\r)$/g,"")}function O(ie){const he=this.resume(),Ee=this.stack[this.stack.length-1];Ee.label=he,Ee.identifier=so(this.sliceSerialize(ie)).toLowerCase()}function _(){const ie=this.resume(),he=this.stack[this.stack.length-1];he.title=ie}function M(){const ie=this.resume(),he=this.stack[this.stack.length-1];he.url=ie}function I(ie){const he=this.stack[this.stack.length-1];if(!he.depth){const Ee=this.sliceSerialize(ie).length;he.depth=Ee}}function k(){this.data.setextHeadingSlurpLineEnding=!0}function D(ie){const he=this.stack[this.stack.length-1];he.depth=this.sliceSerialize(ie).codePointAt(0)===61?1:2}function U(){this.data.setextHeadingSlurpLineEnding=void 0}function H(ie){const Ee=this.stack[this.stack.length-1].children;let Oe=Ee[Ee.length-1];(!Oe||Oe.type!=="text")&&(Oe=Ne(),Oe.position={start:oi(ie.start),end:void 0},Ee.push(Oe)),this.stack.push(Oe)}function q(ie){const he=this.stack.pop();he.value+=this.sliceSerialize(ie),he.position.end=oi(ie.end)}function L(ie){const he=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Ee=he.children[he.children.length-1];Ee.position.end=oi(ie.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(he.type)&&(H.call(this,ie),q.call(this,ie))}function P(){this.data.atHardBreak=!0}function K(){const ie=this.resume(),he=this.stack[this.stack.length-1];he.value=ie}function B(){const ie=this.resume(),he=this.stack[this.stack.length-1];he.value=ie}function V(){const ie=this.resume(),he=this.stack[this.stack.length-1];he.value=ie}function j(){const ie=this.stack[this.stack.length-1];if(this.data.inReference){const he=this.data.referenceType||"shortcut";ie.type+="Reference",ie.referenceType=he,delete ie.url,delete ie.title}else delete ie.identifier,delete ie.label;this.data.referenceType=void 0}function F(){const ie=this.stack[this.stack.length-1];if(this.data.inReference){const he=this.data.referenceType||"shortcut";ie.type+="Reference",ie.referenceType=he,delete ie.url,delete ie.title}else delete ie.identifier,delete ie.label;this.data.referenceType=void 0}function $(ie){const he=this.sliceSerialize(ie),Ee=this.stack[this.stack.length-2];Ee.label=G4(he),Ee.identifier=so(he).toLowerCase()}function Z(){const ie=this.stack[this.stack.length-1],he=this.resume(),Ee=this.stack[this.stack.length-1];if(this.data.inReference=!0,Ee.type==="link"){const Oe=ie.children;Ee.children=Oe}else Ee.alt=he}function A(){const ie=this.resume(),he=this.stack[this.stack.length-1];he.url=ie}function z(){const ie=this.resume(),he=this.stack[this.stack.length-1];he.title=ie}function X(){this.data.inReference=void 0}function R(){this.data.referenceType="collapsed"}function te(ie){const he=this.resume(),Ee=this.stack[this.stack.length-1];Ee.label=he,Ee.identifier=so(this.sliceSerialize(ie)).toLowerCase(),this.data.referenceType="full"}function ue(ie){this.data.characterReferenceType=ie.type}function ce(ie){const he=this.sliceSerialize(ie),Ee=this.data.characterReferenceType;let Oe;Ee?(Oe=kE(he,Ee==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Oe=qm(he);const Pe=this.stack[this.stack.length-1];Pe.value+=Oe}function fe(ie){const he=this.stack.pop();he.position.end=oi(ie.end)}function le(ie){q.call(this,ie);const he=this.stack[this.stack.length-1];he.url=this.sliceSerialize(ie)}function pe(ie){q.call(this,ie);const he=this.stack[this.stack.length-1];he.url="mailto:"+this.sliceSerialize(ie)}function be(){return{type:"blockquote",children:[]}}function Se(){return{type:"code",lang:null,meta:null,value:""}}function ye(){return{type:"inlineCode",value:""}}function we(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Re(){return{type:"emphasis",children:[]}}function He(){return{type:"heading",depth:0,children:[]}}function Be(){return{type:"break"}}function Qe(){return{type:"html",value:""}}function _t(){return{type:"image",title:null,url:"",alt:null}}function it(){return{type:"link",title:null,url:"",children:[]}}function Ot(ie){return{type:"list",ordered:ie.type==="listOrdered",start:null,spread:ie._spread,children:[]}}function qt(ie){return{type:"listItem",spread:ie._spread,checked:null,children:[]}}function An(){return{type:"paragraph",children:[]}}function vn(){return{type:"strong",children:[]}}function Ne(){return{type:"text",value:""}}function ut(){return{type:"thematicBreak"}}}function oi(e){return{line:e.line,column:e.column,offset:e.offset}}function HE(e,t){let r=-1;for(;++r<t.length;){const a=t[r];Array.isArray(a)?HE(e,a):K4(e,a)}}function K4(e,t){let r;for(r in t)if(IE.call(t,r))switch(r){case"canContainEols":{const a=t[r];a&&e[r].push(...a);break}case"transforms":{const a=t[r];a&&e[r].push(...a);break}case"enter":case"exit":{const a=t[r];a&&Object.assign(e[r],a);break}}}function l1(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Bs({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Bs({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Bs({start:t.start,end:t.end})+") is still open")}function J4(e){const t=this;t.parser=r;function r(a){return Q4(a,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function W4(e,t){const r={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,r),e.applyData(t,r)}function eL(e,t){const r={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,r),[e.applyData(t,r),{type:"text",value:`
|
|
19
|
-
`}]}function tL(e,t){const r=t.value?t.value+`
|
|
20
|
-
`:"",a={},o=t.lang?t.lang.split(/\s+/):[];o.length>0&&(a.className=["language-"+o[0]]);let l={type:"element",tagName:"code",properties:a,children:[{type:"text",value:r}]};return t.meta&&(l.data={meta:t.meta}),e.patch(t,l),l=e.applyData(t,l),l={type:"element",tagName:"pre",properties:{},children:[l]},e.patch(t,l),l}function nL(e,t){const r={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function rL(e,t){const r={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function iL(e,t){const r=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",a=String(t.identifier).toUpperCase(),o=Eo(a.toLowerCase()),l=e.footnoteOrder.indexOf(a);let u,f=e.footnoteCounts.get(a);f===void 0?(f=0,e.footnoteOrder.push(a),u=e.footnoteOrder.length):u=l+1,f+=1,e.footnoteCounts.set(a,f);const h={type:"element",tagName:"a",properties:{href:"#"+r+"fn-"+o,id:r+"fnref-"+o+(f>1?"-"+f:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(u)}]};e.patch(t,h);const d={type:"element",tagName:"sup",properties:{},children:[h]};return e.patch(t,d),e.applyData(t,d)}function aL(e,t){const r={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function oL(e,t){if(e.options.allowDangerousHtml){const r={type:"raw",value:t.value};return e.patch(t,r),e.applyData(t,r)}}function PE(e,t){const r=t.referenceType;let a="]";if(r==="collapsed"?a+="[]":r==="full"&&(a+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+a}];const o=e.all(t),l=o[0];l&&l.type==="text"?l.value="["+l.value:o.unshift({type:"text",value:"["});const u=o[o.length-1];return u&&u.type==="text"?u.value+=a:o.push({type:"text",value:a}),o}function sL(e,t){const r=String(t.identifier).toUpperCase(),a=e.definitionById.get(r);if(!a)return PE(e,t);const o={src:Eo(a.url||""),alt:t.alt};a.title!==null&&a.title!==void 0&&(o.title=a.title);const l={type:"element",tagName:"img",properties:o,children:[]};return e.patch(t,l),e.applyData(t,l)}function lL(e,t){const r={src:Eo(t.url)};t.alt!==null&&t.alt!==void 0&&(r.alt=t.alt),t.title!==null&&t.title!==void 0&&(r.title=t.title);const a={type:"element",tagName:"img",properties:r,children:[]};return e.patch(t,a),e.applyData(t,a)}function uL(e,t){const r={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,r);const a={type:"element",tagName:"code",properties:{},children:[r]};return e.patch(t,a),e.applyData(t,a)}function cL(e,t){const r=String(t.identifier).toUpperCase(),a=e.definitionById.get(r);if(!a)return PE(e,t);const o={href:Eo(a.url||"")};a.title!==null&&a.title!==void 0&&(o.title=a.title);const l={type:"element",tagName:"a",properties:o,children:e.all(t)};return e.patch(t,l),e.applyData(t,l)}function fL(e,t){const r={href:Eo(t.url)};t.title!==null&&t.title!==void 0&&(r.title=t.title);const a={type:"element",tagName:"a",properties:r,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function dL(e,t,r){const a=e.all(t),o=r?hL(r):UE(t),l={},u=[];if(typeof t.checked=="boolean"){const m=a[0];let g;m&&m.type==="element"&&m.tagName==="p"?g=m:(g={type:"element",tagName:"p",properties:{},children:[]},a.unshift(g)),g.children.length>0&&g.children.unshift({type:"text",value:" "}),g.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),l.className=["task-list-item"]}let f=-1;for(;++f<a.length;){const m=a[f];(o||f!==0||m.type!=="element"||m.tagName!=="p")&&u.push({type:"text",value:`
|
|
21
|
-
`}),m.type==="element"&&m.tagName==="p"&&!o?u.push(...m.children):u.push(m)}const h=a[a.length-1];h&&(o||h.type!=="element"||h.tagName!=="p")&&u.push({type:"text",value:`
|
|
22
|
-
`});const d={type:"element",tagName:"li",properties:l,children:u};return e.patch(t,d),e.applyData(t,d)}function hL(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const r=e.children;let a=-1;for(;!t&&++a<r.length;)t=UE(r[a])}return t}function UE(e){const t=e.spread;return t??e.children.length>1}function pL(e,t){const r={},a=e.all(t);let o=-1;for(typeof t.start=="number"&&t.start!==1&&(r.start=t.start);++o<a.length;){const u=a[o];if(u.type==="element"&&u.tagName==="li"&&u.properties&&Array.isArray(u.properties.className)&&u.properties.className.includes("task-list-item")){r.className=["contains-task-list"];break}}const l={type:"element",tagName:t.ordered?"ol":"ul",properties:r,children:e.wrap(a,!0)};return e.patch(t,l),e.applyData(t,l)}function mL(e,t){const r={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function gL(e,t){const r={type:"root",children:e.wrap(e.all(t))};return e.patch(t,r),e.applyData(t,r)}function yL(e,t){const r={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function xL(e,t){const r=e.all(t),a=r.shift(),o=[];if(a){const u={type:"element",tagName:"thead",properties:{},children:e.wrap([a],!0)};e.patch(t.children[0],u),o.push(u)}if(r.length>0){const u={type:"element",tagName:"tbody",properties:{},children:e.wrap(r,!0)},f=Im(t.children[1]),h=SE(t.children[t.children.length-1]);f&&h&&(u.position={start:f,end:h}),o.push(u)}const l={type:"element",tagName:"table",properties:{},children:e.wrap(o,!0)};return e.patch(t,l),e.applyData(t,l)}function vL(e,t,r){const a=r?r.children:void 0,l=(a?a.indexOf(t):1)===0?"th":"td",u=r&&r.type==="table"?r.align:void 0,f=u?u.length:t.children.length;let h=-1;const d=[];for(;++h<f;){const g=t.children[h],y={},v=u?u[h]:void 0;v&&(y.align=v);let S={type:"element",tagName:l,properties:y,children:[]};g&&(S.children=e.all(g),e.patch(g,S),S=e.applyData(g,S)),d.push(S)}const m={type:"element",tagName:"tr",properties:{},children:e.wrap(d,!0)};return e.patch(t,m),e.applyData(t,m)}function bL(e,t){const r={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}const u1=9,c1=32;function SL(e){const t=String(e),r=/\r?\n|\r/g;let a=r.exec(t),o=0;const l=[];for(;a;)l.push(f1(t.slice(o,a.index),o>0,!0),a[0]),o=a.index+a[0].length,a=r.exec(t);return l.push(f1(t.slice(o),o>0,!1)),l.join("")}function f1(e,t,r){let a=0,o=e.length;if(t){let l=e.codePointAt(a);for(;l===u1||l===c1;)a++,l=e.codePointAt(a)}if(r){let l=e.codePointAt(o-1);for(;l===u1||l===c1;)o--,l=e.codePointAt(o-1)}return o>a?e.slice(a,o):""}function wL(e,t){const r={type:"text",value:SL(String(t.value))};return e.patch(t,r),e.applyData(t,r)}function EL(e,t){const r={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,r),e.applyData(t,r)}const CL={blockquote:W4,break:eL,code:tL,delete:nL,emphasis:rL,footnoteReference:iL,heading:aL,html:oL,imageReference:sL,image:lL,inlineCode:uL,linkReference:cL,link:fL,listItem:dL,list:pL,paragraph:mL,root:gL,strong:yL,table:xL,tableCell:bL,tableRow:vL,text:wL,thematicBreak:EL,toml:ec,yaml:ec,definition:ec,footnoteDefinition:ec};function ec(){}const qE=-1,nf=0,Hs=1,Dc=2,Ym=3,Xm=4,Gm=5,$m=6,VE=7,FE=8,d1=typeof self=="object"?self:globalThis,_L=(e,t)=>{const r=(o,l)=>(e.set(l,o),o),a=o=>{if(e.has(o))return e.get(o);const[l,u]=t[o];switch(l){case nf:case qE:return r(u,o);case Hs:{const f=r([],o);for(const h of u)f.push(a(h));return f}case Dc:{const f=r({},o);for(const[h,d]of u)f[a(h)]=a(d);return f}case Ym:return r(new Date(u),o);case Xm:{const{source:f,flags:h}=u;return r(new RegExp(f,h),o)}case Gm:{const f=r(new Map,o);for(const[h,d]of u)f.set(a(h),a(d));return f}case $m:{const f=r(new Set,o);for(const h of u)f.add(a(h));return f}case VE:{const{name:f,message:h}=u;return r(new d1[f](h),o)}case FE:return r(BigInt(u),o);case"BigInt":return r(Object(BigInt(u)),o);case"ArrayBuffer":return r(new Uint8Array(u).buffer,u);case"DataView":{const{buffer:f}=new Uint8Array(u);return r(new DataView(f),u)}}return r(new d1[l](u),o)};return a},h1=e=>_L(new Map,e)(0),Ka="",{toString:NL}={},{keys:ML}=Object,As=e=>{const t=typeof e;if(t!=="object"||!e)return[nf,t];const r=NL.call(e).slice(8,-1);switch(r){case"Array":return[Hs,Ka];case"Object":return[Dc,Ka];case"Date":return[Ym,Ka];case"RegExp":return[Xm,Ka];case"Map":return[Gm,Ka];case"Set":return[$m,Ka];case"DataView":return[Hs,r]}return r.includes("Array")?[Hs,r]:r.includes("Error")?[VE,r]:[Dc,r]},tc=([e,t])=>e===nf&&(t==="function"||t==="symbol"),kL=(e,t,r,a)=>{const o=(u,f)=>{const h=a.push(u)-1;return r.set(f,h),h},l=u=>{if(r.has(u))return r.get(u);let[f,h]=As(u);switch(f){case nf:{let m=u;switch(h){case"bigint":f=FE,m=u.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+h);m=null;break;case"undefined":return o([qE],u)}return o([f,m],u)}case Hs:{if(h){let y=u;return h==="DataView"?y=new Uint8Array(u.buffer):h==="ArrayBuffer"&&(y=new Uint8Array(u)),o([h,[...y]],u)}const m=[],g=o([f,m],u);for(const y of u)m.push(l(y));return g}case Dc:{if(h)switch(h){case"BigInt":return o([h,u.toString()],u);case"Boolean":case"Number":case"String":return o([h,u.valueOf()],u)}if(t&&"toJSON"in u)return l(u.toJSON());const m=[],g=o([f,m],u);for(const y of ML(u))(e||!tc(As(u[y])))&&m.push([l(y),l(u[y])]);return g}case Ym:return o([f,u.toISOString()],u);case Xm:{const{source:m,flags:g}=u;return o([f,{source:m,flags:g}],u)}case Gm:{const m=[],g=o([f,m],u);for(const[y,v]of u)(e||!(tc(As(y))||tc(As(v))))&&m.push([l(y),l(v)]);return g}case $m:{const m=[],g=o([f,m],u);for(const y of u)(e||!tc(As(y)))&&m.push(l(y));return g}}const{message:d}=u;return o([f,{name:h,message:d}],u)};return l},p1=(e,{json:t,lossy:r}={})=>{const a=[];return kL(!(t||r),!!t,new Map,a)(e),a},zc=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?h1(p1(e,t)):structuredClone(e):(e,t)=>h1(p1(e,t));function TL(e,t){const r=[{type:"text",value:"↩"}];return t>1&&r.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),r}function AL(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function RL(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=e.options.footnoteBackContent||TL,a=e.options.footnoteBackLabel||AL,o=e.options.footnoteLabel||"Footnotes",l=e.options.footnoteLabelTagName||"h2",u=e.options.footnoteLabelProperties||{className:["sr-only"]},f=[];let h=-1;for(;++h<e.footnoteOrder.length;){const d=e.footnoteById.get(e.footnoteOrder[h]);if(!d)continue;const m=e.all(d),g=String(d.identifier).toUpperCase(),y=Eo(g.toLowerCase());let v=0;const S=[],C=e.footnoteCounts.get(g);for(;C!==void 0&&++v<=C;){S.length>0&&S.push({type:"text",value:" "});let O=typeof r=="string"?r:r(h,v);typeof O=="string"&&(O={type:"text",value:O}),S.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+y+(v>1?"-"+v:""),dataFootnoteBackref:"",ariaLabel:typeof a=="string"?a:a(h,v),className:["data-footnote-backref"]},children:Array.isArray(O)?O:[O]})}const N=m[m.length-1];if(N&&N.type==="element"&&N.tagName==="p"){const O=N.children[N.children.length-1];O&&O.type==="text"?O.value+=" ":N.children.push({type:"text",value:" "}),N.children.push(...S)}else m.push(...S);const w={type:"element",tagName:"li",properties:{id:t+"fn-"+y},children:e.wrap(m,!0)};e.patch(d,w),f.push(w)}if(f.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:l,properties:{...zc(u),id:"footnote-label"},children:[{type:"text",value:o}]},{type:"text",value:`
|
|
23
|
-
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(f,!0)},{type:"text",value:`
|
|
24
|
-
`}]}}const YE=(function(e){if(e==null)return zL;if(typeof e=="function")return rf(e);if(typeof e=="object")return Array.isArray(e)?OL(e):jL(e);if(typeof e=="string")return DL(e);throw new Error("Expected function, string, or object as test")});function OL(e){const t=[];let r=-1;for(;++r<e.length;)t[r]=YE(e[r]);return rf(a);function a(...o){let l=-1;for(;++l<t.length;)if(t[l].apply(this,o))return!0;return!1}}function jL(e){const t=e;return rf(r);function r(a){const o=a;let l;for(l in e)if(o[l]!==t[l])return!1;return!0}}function DL(e){return rf(t);function t(r){return r&&r.type===e}}function rf(e){return t;function t(r,a,o){return!!(LL(r)&&e.call(this,r,typeof a=="number"?a:void 0,o||void 0))}}function zL(){return!0}function LL(e){return e!==null&&typeof e=="object"&&"type"in e}const XE=[],BL=!0,m1=!1,IL="skip";function HL(e,t,r,a){let o;typeof t=="function"&&typeof r!="function"?(a=r,r=t):o=t;const l=YE(o),u=a?-1:1;f(e,void 0,[])();function f(h,d,m){const g=h&&typeof h=="object"?h:{};if(typeof g.type=="string"){const v=typeof g.tagName=="string"?g.tagName:typeof g.name=="string"?g.name:void 0;Object.defineProperty(y,"name",{value:"node ("+(h.type+(v?"<"+v+">":""))+")"})}return y;function y(){let v=XE,S,C,N;if((!t||l(h,d,m[m.length-1]||void 0))&&(v=PL(r(h,m)),v[0]===m1))return v;if("children"in h&&h.children){const w=h;if(w.children&&v[0]!==IL)for(C=(a?w.children.length:-1)+u,N=m.concat(w);C>-1&&C<w.children.length;){const O=w.children[C];if(S=f(O,C,N)(),S[0]===m1)return S;C=typeof S[1]=="number"?S[1]:C+u}}return v}}}function PL(e){return Array.isArray(e)?e:typeof e=="number"?[BL,e]:e==null?XE:[e]}function GE(e,t,r,a){let o,l,u;typeof t=="function"&&typeof r!="function"?(l=void 0,u=t,o=r):(l=t,u=r,o=a),HL(e,l,f,o);function f(h,d){const m=d[d.length-1],g=m?m.children.indexOf(h):void 0;return u(h,g,m)}}const Qp={}.hasOwnProperty,UL={};function qL(e,t){const r=t||UL,a=new Map,o=new Map,l=new Map,u={...CL,...r.handlers},f={all:d,applyData:FL,definitionById:a,footnoteById:o,footnoteCounts:l,footnoteOrder:[],handlers:u,one:h,options:r,patch:VL,wrap:XL};return GE(e,function(m){if(m.type==="definition"||m.type==="footnoteDefinition"){const g=m.type==="definition"?a:o,y=String(m.identifier).toUpperCase();g.has(y)||g.set(y,m)}}),f;function h(m,g){const y=m.type,v=f.handlers[y];if(Qp.call(f.handlers,y)&&v)return v(f,m,g);if(f.options.passThrough&&f.options.passThrough.includes(y)){if("children"in m){const{children:C,...N}=m,w=zc(N);return w.children=f.all(m),w}return zc(m)}return(f.options.unknownHandler||YL)(f,m,g)}function d(m){const g=[];if("children"in m){const y=m.children;let v=-1;for(;++v<y.length;){const S=f.one(y[v],m);if(S){if(v&&y[v-1].type==="break"&&(!Array.isArray(S)&&S.type==="text"&&(S.value=g1(S.value)),!Array.isArray(S)&&S.type==="element")){const C=S.children[0];C&&C.type==="text"&&(C.value=g1(C.value))}Array.isArray(S)?g.push(...S):g.push(S)}}}return g}}function VL(e,t){e.position&&(t.position=Nz(e))}function FL(e,t){let r=t;if(e&&e.data){const a=e.data.hName,o=e.data.hChildren,l=e.data.hProperties;if(typeof a=="string")if(r.type==="element")r.tagName=a;else{const u="children"in r?r.children:[r];r={type:"element",tagName:a,properties:{},children:u}}r.type==="element"&&l&&Object.assign(r.properties,zc(l)),"children"in r&&r.children&&o!==null&&o!==void 0&&(r.children=o)}return r}function YL(e,t){const r=t.data||{},a="value"in t&&!(Qp.call(r,"hProperties")||Qp.call(r,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function XL(e,t){const r=[];let a=-1;for(t&&r.push({type:"text",value:`
|
|
25
|
-
`});++a<e.length;)a&&r.push({type:"text",value:`
|
|
26
|
-
`}),r.push(e[a]);return t&&e.length>0&&r.push({type:"text",value:`
|
|
27
|
-
`}),r}function g1(e){let t=0,r=e.charCodeAt(t);for(;r===9||r===32;)t++,r=e.charCodeAt(t);return e.slice(t)}function y1(e,t){const r=qL(e,t),a=r.one(e,void 0),o=RL(r),l=Array.isArray(a)?{type:"root",children:a}:a||{type:"root",children:[]};return o&&l.children.push({type:"text",value:`
|
|
28
|
-
`},o),l}function GL(e,t){return e&&"run"in e?async function(r,a){const o=y1(r,{file:a,...t});await e.run(o,a)}:function(r,a){return y1(r,{file:a,...e||t})}}function x1(e){if(e)throw e}var ep,v1;function $L(){if(v1)return ep;v1=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,r=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=function(d){return typeof Array.isArray=="function"?Array.isArray(d):t.call(d)==="[object Array]"},l=function(d){if(!d||t.call(d)!=="[object Object]")return!1;var m=e.call(d,"constructor"),g=d.constructor&&d.constructor.prototype&&e.call(d.constructor.prototype,"isPrototypeOf");if(d.constructor&&!m&&!g)return!1;var y;for(y in d);return typeof y>"u"||e.call(d,y)},u=function(d,m){r&&m.name==="__proto__"?r(d,m.name,{enumerable:!0,configurable:!0,value:m.newValue,writable:!0}):d[m.name]=m.newValue},f=function(d,m){if(m==="__proto__")if(e.call(d,m)){if(a)return a(d,m).value}else return;return d[m]};return ep=function h(){var d,m,g,y,v,S,C=arguments[0],N=1,w=arguments.length,O=!1;for(typeof C=="boolean"&&(O=C,C=arguments[1]||{},N=2),(C==null||typeof C!="object"&&typeof C!="function")&&(C={});N<w;++N)if(d=arguments[N],d!=null)for(m in d)g=f(C,m),y=f(d,m),C!==y&&(O&&y&&(l(y)||(v=o(y)))?(v?(v=!1,S=g&&o(g)?g:[]):S=g&&l(g)?g:{},u(C,{name:m,newValue:h(O,S,y)})):typeof y<"u"&&u(C,{name:m,newValue:y}));return C},ep}var QL=$L();const tp=Lc(QL);function Zp(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function ZL(){const e=[],t={run:r,use:a};return t;function r(...o){let l=-1;const u=o.pop();if(typeof u!="function")throw new TypeError("Expected function as last argument, not "+u);f(null,...o);function f(h,...d){const m=e[++l];let g=-1;if(h){u(h);return}for(;++g<o.length;)(d[g]===null||d[g]===void 0)&&(d[g]=o[g]);o=d,m?KL(m,f)(...d):u(null,...d)}}function a(o){if(typeof o!="function")throw new TypeError("Expected `middelware` to be a function, not "+o);return e.push(o),t}}function KL(e,t){let r;return a;function a(...u){const f=e.length>u.length;let h;f&&u.push(o);try{h=e.apply(this,u)}catch(d){const m=d;if(f&&r)throw m;return o(m)}f||(h&&h.then&&typeof h.then=="function"?h.then(l,o):h instanceof Error?o(h):l(h))}function o(u,...f){r||(r=!0,t(u,...f))}function l(u){o(null,u)}}const $n={basename:JL,dirname:WL,extname:e6,join:t6,sep:"/"};function JL(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');yl(e);let r=0,a=-1,o=e.length,l;if(t===void 0||t.length===0||t.length>e.length){for(;o--;)if(e.codePointAt(o)===47){if(l){r=o+1;break}}else a<0&&(l=!0,a=o+1);return a<0?"":e.slice(r,a)}if(t===e)return"";let u=-1,f=t.length-1;for(;o--;)if(e.codePointAt(o)===47){if(l){r=o+1;break}}else u<0&&(l=!0,u=o+1),f>-1&&(e.codePointAt(o)===t.codePointAt(f--)?f<0&&(a=o):(f=-1,a=u));return r===a?a=u:a<0&&(a=e.length),e.slice(r,a)}function WL(e){if(yl(e),e.length===0)return".";let t=-1,r=e.length,a;for(;--r;)if(e.codePointAt(r)===47){if(a){t=r;break}}else a||(a=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function e6(e){yl(e);let t=e.length,r=-1,a=0,o=-1,l=0,u;for(;t--;){const f=e.codePointAt(t);if(f===47){if(u){a=t+1;break}continue}r<0&&(u=!0,r=t+1),f===46?o<0?o=t:l!==1&&(l=1):o>-1&&(l=-1)}return o<0||r<0||l===0||l===1&&o===r-1&&o===a+1?"":e.slice(o,r)}function t6(...e){let t=-1,r;for(;++t<e.length;)yl(e[t]),e[t]&&(r=r===void 0?e[t]:r+"/"+e[t]);return r===void 0?".":n6(r)}function n6(e){yl(e);const t=e.codePointAt(0)===47;let r=r6(e,!t);return r.length===0&&!t&&(r="."),r.length>0&&e.codePointAt(e.length-1)===47&&(r+="/"),t?"/"+r:r}function r6(e,t){let r="",a=0,o=-1,l=0,u=-1,f,h;for(;++u<=e.length;){if(u<e.length)f=e.codePointAt(u);else{if(f===47)break;f=47}if(f===47){if(!(o===u-1||l===1))if(o!==u-1&&l===2){if(r.length<2||a!==2||r.codePointAt(r.length-1)!==46||r.codePointAt(r.length-2)!==46){if(r.length>2){if(h=r.lastIndexOf("/"),h!==r.length-1){h<0?(r="",a=0):(r=r.slice(0,h),a=r.length-1-r.lastIndexOf("/")),o=u,l=0;continue}}else if(r.length>0){r="",a=0,o=u,l=0;continue}}t&&(r=r.length>0?r+"/..":"..",a=2)}else r.length>0?r+="/"+e.slice(o+1,u):r=e.slice(o+1,u),a=u-o-1;o=u,l=0}else f===46&&l>-1?l++:l=-1}return r}function yl(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const i6={cwd:a6};function a6(){return"/"}function Kp(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function o6(e){if(typeof e=="string")e=new URL(e);else if(!Kp(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return s6(e)}function s6(e){if(e.hostname!==""){const a=new TypeError('File URL host must be "localhost" or empty on darwin');throw a.code="ERR_INVALID_FILE_URL_HOST",a}const t=e.pathname;let r=-1;for(;++r<t.length;)if(t.codePointAt(r)===37&&t.codePointAt(r+1)===50){const a=t.codePointAt(r+2);if(a===70||a===102){const o=new TypeError("File URL path must not include encoded / characters");throw o.code="ERR_INVALID_FILE_URL_PATH",o}}return decodeURIComponent(t)}const np=["history","path","basename","stem","extname","dirname"];class $E{constructor(t){let r;t?Kp(t)?r={path:t}:typeof t=="string"||l6(t)?r={value:t}:r=t:r={},this.cwd="cwd"in r?"":i6.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let a=-1;for(;++a<np.length;){const l=np[a];l in r&&r[l]!==void 0&&r[l]!==null&&(this[l]=l==="history"?[...r[l]]:r[l])}let o;for(o in r)np.includes(o)||(this[o]=r[o])}get basename(){return typeof this.path=="string"?$n.basename(this.path):void 0}set basename(t){ip(t,"basename"),rp(t,"basename"),this.path=$n.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?$n.dirname(this.path):void 0}set dirname(t){b1(this.basename,"dirname"),this.path=$n.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?$n.extname(this.path):void 0}set extname(t){if(rp(t,"extname"),b1(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=$n.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){Kp(t)&&(t=o6(t)),ip(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?$n.basename(this.path,this.extname):void 0}set stem(t){ip(t,"stem"),rp(t,"stem"),this.path=$n.join(this.dirname||"",t+(this.extname||""))}fail(t,r,a){const o=this.message(t,r,a);throw o.fatal=!0,o}info(t,r,a){const o=this.message(t,r,a);return o.fatal=void 0,o}message(t,r,a){const o=new Bt(t,r,a);return this.path&&(o.name=this.path+":"+o.name,o.file=this.path),o.fatal=!1,this.messages.push(o),o}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function rp(e,t){if(e&&e.includes($n.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+$n.sep+"`")}function ip(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function b1(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function l6(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const u6=(function(e){const a=this.constructor.prototype,o=a[e],l=function(){return o.apply(l,arguments)};return Object.setPrototypeOf(l,a),l}),c6={}.hasOwnProperty;class Qm extends u6{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=ZL()}copy(){const t=new Qm;let r=-1;for(;++r<this.attachers.length;){const a=this.attachers[r];t.use(...a)}return t.data(tp(!0,{},this.namespace)),t}data(t,r){return typeof t=="string"?arguments.length===2?(sp("data",this.frozen),this.namespace[t]=r,this):c6.call(this.namespace,t)&&this.namespace[t]||void 0:t?(sp("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[r,...a]=this.attachers[this.freezeIndex];if(a[0]===!1)continue;a[0]===!0&&(a[0]=void 0);const o=r.call(t,...a);typeof o=="function"&&this.transformers.use(o)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const r=nc(t),a=this.parser||this.Parser;return ap("parse",a),a(String(r),r)}process(t,r){const a=this;return this.freeze(),ap("process",this.parser||this.Parser),op("process",this.compiler||this.Compiler),r?o(void 0,r):new Promise(o);function o(l,u){const f=nc(t),h=a.parse(f);a.run(h,f,function(m,g,y){if(m||!g||!y)return d(m);const v=g,S=a.stringify(v,y);h6(S)?y.value=S:y.result=S,d(m,y)});function d(m,g){m||!g?u(m):l?l(g):r(void 0,g)}}}processSync(t){let r=!1,a;return this.freeze(),ap("processSync",this.parser||this.Parser),op("processSync",this.compiler||this.Compiler),this.process(t,o),w1("processSync","process",r),a;function o(l,u){r=!0,x1(l),a=u}}run(t,r,a){S1(t),this.freeze();const o=this.transformers;return!a&&typeof r=="function"&&(a=r,r=void 0),a?l(void 0,a):new Promise(l);function l(u,f){const h=nc(r);o.run(t,h,d);function d(m,g,y){const v=g||t;m?f(m):u?u(v):a(void 0,v,y)}}}runSync(t,r){let a=!1,o;return this.run(t,r,l),w1("runSync","run",a),o;function l(u,f){x1(u),o=f,a=!0}}stringify(t,r){this.freeze();const a=nc(r),o=this.compiler||this.Compiler;return op("stringify",o),S1(t),o(t,a)}use(t,...r){const a=this.attachers,o=this.namespace;if(sp("use",this.frozen),t!=null)if(typeof t=="function")h(t,r);else if(typeof t=="object")Array.isArray(t)?f(t):u(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function l(d){if(typeof d=="function")h(d,[]);else if(typeof d=="object")if(Array.isArray(d)){const[m,...g]=d;h(m,g)}else u(d);else throw new TypeError("Expected usable value, not `"+d+"`")}function u(d){if(!("plugins"in d)&&!("settings"in d))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");f(d.plugins),d.settings&&(o.settings=tp(!0,o.settings,d.settings))}function f(d){let m=-1;if(d!=null)if(Array.isArray(d))for(;++m<d.length;){const g=d[m];l(g)}else throw new TypeError("Expected a list of plugins, not `"+d+"`")}function h(d,m){let g=-1,y=-1;for(;++g<a.length;)if(a[g][0]===d){y=g;break}if(y===-1)a.push([d,...m]);else if(m.length>0){let[v,...S]=m;const C=a[y][1];Zp(C)&&Zp(v)&&(v=tp(!0,C,v)),a[y]=[d,v,...S]}}}}const f6=new Qm().freeze();function ap(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function op(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function sp(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function S1(e){if(!Zp(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function w1(e,t,r){if(!r)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function nc(e){return d6(e)?e:new $E(e)}function d6(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function h6(e){return typeof e=="string"||p6(e)}function p6(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const m6="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",E1=[],C1={allowDangerousHtml:!0},g6=/^(https?|ircs?|mailto|xmpp)$/i,y6=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function x6(e){const t=v6(e),r=b6(e);return S6(t.runSync(t.parse(r),r),e)}function v6(e){const t=e.rehypePlugins||E1,r=e.remarkPlugins||E1,a=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...C1}:C1;return f6().use(J4).use(r).use(GL,a).use(t)}function b6(e){const t=e.children||"",r=new $E;return typeof t=="string"&&(r.value=t),r}function S6(e,t){const r=t.allowedElements,a=t.allowElement,o=t.components,l=t.disallowedElements,u=t.skipHtml,f=t.unwrapDisallowed,h=t.urlTransform||w6;for(const m of y6)Object.hasOwn(t,m.from)&&(""+m.from+(m.to?"use `"+m.to+"` instead":"remove it")+m6+m.id,void 0);return GE(e,d),Rz(e,{Fragment:b.Fragment,components:o,ignoreInvalidStyle:!0,jsx:b.jsx,jsxs:b.jsxs,passKeys:!0,passNode:!0});function d(m,g,y){if(m.type==="raw"&&y&&typeof g=="number")return u?y.children.splice(g,1):y.children[g]={type:"text",value:m.value},g;if(m.type==="element"){let v;for(v in Kh)if(Object.hasOwn(Kh,v)&&Object.hasOwn(m.properties,v)){const S=m.properties[v],C=Kh[v];(C===null||C.includes(m.tagName))&&(m.properties[v]=h(String(S||""),v,m))}}if(m.type==="element"){let v=r?!r.includes(m.tagName):l?l.includes(m.tagName):!1;if(!v&&a&&typeof g=="number"&&(v=!a(m,g,y)),v&&y&&typeof g=="number")return f&&m.children?y.children.splice(g,1,...m.children):y.children.splice(g,1),g}}}function w6(e){const t=e.indexOf(":"),r=e.indexOf("?"),a=e.indexOf("#"),o=e.indexOf("/");return t===-1||o!==-1&&t>o||r!==-1&&t>r||a!==-1&&t>a||g6.test(e.slice(0,t))?e:""}function QE({children:e,className:t}){return b.jsx("div",{className:`markdown-view ${t??""}`,children:b.jsx(x6,{children:e})})}function E6({sessionId:e,nodeId:t,runStatus:r="complete",currentNodeId:a=null}){const{data:o,isLoading:l,error:u}=ak(e,t);return t?b.jsxs("div",{children:[b.jsx(C6,{stepLabel:o?.stepLabel??null,nodeId:t}),b.jsxs("div",{className:"p-4 space-y-4",children:[l&&b.jsx("div",{className:"text-[var(--text-secondary)] text-sm",children:"Loading..."}),u&&b.jsx("div",{className:"text-[var(--error)] text-sm bg-[var(--bg-primary)] border border-[var(--border)] px-4 py-3",children:u.message}),o&&b.jsx(N6,{detail:o,runStatus:r,currentNodeId:a})]})]}):b.jsx("div",{className:"px-5 py-8 text-sm text-[var(--text-secondary)]",children:"Select a node in the lineage to inspect its recap, validations, gaps, and artifacts."})}function C6({stepLabel:e,nodeId:t}){return b.jsxs("div",{className:"px-5 py-4 border-b border-[var(--border)] console-blueprint-grid",children:[b.jsx("div",{className:"text-base font-semibold text-[var(--text-primary)] leading-tight",children:e??"Untitled node"}),b.jsx("div",{className:"mt-1 font-mono text-[11px] text-[var(--text-muted)] truncate",children:t})]})}const _6=[{id:"recap",column:"primary",render:({detail:e,runStatus:t,currentNodeId:r})=>e.recapMarkdown?b.jsx(A6,{markdown:e.recapMarkdown},"recap"):t==="in_progress"&&e.nodeId===r&&!e.recapMarkdown?b.jsx(M6,{detail:e},"recap-in-progress"):null},{id:"validations",column:"primary",render:({detail:e})=>e.validations.length>0?b.jsx(O6,{validations:e.validations},"validations"):null},{id:"gaps",column:"primary",render:({detail:e})=>e.gaps.length>0?b.jsx(D6,{gaps:e.gaps},"gaps"):null},{id:"advance-outcome",column:"primary",render:({detail:e})=>e.advanceOutcome?b.jsx(R6,{outcome:e.advanceOutcome},"advance-outcome"):null},{id:"artifacts",column:"primary",render:({detail:e})=>e.artifacts.length>0?b.jsx(B6,{artifacts:e.artifacts},"artifacts"):null},{id:"node-meta",column:"primary",render:({detail:e})=>b.jsx(T6,{detail:e},"node-meta")}];function N6(e){return b.jsx("div",{className:"space-y-4",children:_6.map(t=>t.render(e))})}function M6({detail:e}){return b.jsx(oa,{title:"Recap",children:b.jsxs("div",{className:"space-y-4 text-sm text-[var(--text-secondary)]",children:[b.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[b.jsx(k6,{children:"In progress"}),b.jsxs("span",{className:"font-mono text-xs text-[var(--text-muted)]",children:["event #",e.createdAtEventIndex]})]}),b.jsxs("div",{className:"grid gap-3 md:grid-cols-2 xl:grid-cols-[minmax(0,1.15fr)_minmax(0,0.85fr)]",children:[b.jsx(_1,{label:"Current focus",value:e.stepLabel??"Current workflow step",supportingText:"This step is still running, so the recap will appear once execution finishes."}),b.jsx(_1,{label:"Current state",value:"Waiting for step completion",supportingText:"The node has been created and selected as the current workflow position.",mono:!0})]}),b.jsxs("div",{className:"bg-[var(--bg-primary)] border border-[var(--border)] overflow-hidden",children:[b.jsx("div",{className:"px-4 py-3 border-b border-[var(--border)]",children:b.jsx("div",{className:"font-mono text-[10px] uppercase tracking-[0.18em] text-[var(--text-muted)]",children:"What lands here next"})}),b.jsxs("div",{className:"p-4 grid gap-3 md:grid-cols-3",children:[b.jsx(lp,{title:"Recap",description:"A step summary is written when this node completes."}),b.jsx(lp,{title:"Validations",description:"Validation results appear if this step records contract checks."}),b.jsx(lp,{title:"Artifacts",description:"Generated outputs show up here after the step produces them."})]})]})]})})}function k6({children:e}){return b.jsx("span",{className:"inline-flex items-center px-2 py-1 font-medium text-xs",style:{backgroundColor:"rgba(0, 240, 255, 0.12)",color:"var(--accent-strong)"},children:e})}function _1({label:e,value:t,supportingText:r,mono:a=!1}){return b.jsxs("div",{className:"bg-[var(--bg-primary)] border border-[var(--border)] px-4 py-3 space-y-2",children:[b.jsx("div",{className:"font-mono text-[10px] uppercase tracking-[0.18em] text-[var(--text-muted)]",children:e}),b.jsx("div",{className:a?"font-mono text-sm text-[var(--text-primary)]":"text-[var(--text-primary)]",children:t}),b.jsx("div",{className:"text-xs text-[var(--text-muted)] leading-relaxed",children:r})]})}function lp({title:e,description:t}){return b.jsxs("div",{className:"border border-[var(--border)] bg-[rgba(255,255,255,0.02)] px-3 py-3 space-y-2",children:[b.jsx("div",{className:"font-mono text-[10px] uppercase tracking-[0.18em] text-[var(--text-secondary)]",children:e}),b.jsx("div",{className:"text-xs text-[var(--text-muted)] leading-relaxed",children:t})]})}function T6({detail:e}){return b.jsx(oa,{title:"Node details",children:b.jsxs("div",{className:"space-y-3",children:[b.jsx(rc,{label:"Kind",value:b.jsx(H6,{kind:e.nodeKind})}),b.jsx(rc,{label:"Event index",value:String(e.createdAtEventIndex),mono:!0}),b.jsx(rc,{label:"Parent",value:e.parentNodeId??"Root",mono:!0}),b.jsx(rc,{label:"Tip state",value:e.isTip?e.isPreferredTip?"Preferred tip":"Tip":"Historical"})]})})}function A6({markdown:e}){return b.jsx(oa,{title:"Recap",children:b.jsx(QE,{children:e})})}function R6({outcome:e}){const t=e.kind==="advanced";return b.jsx(oa,{title:"Advance outcome",children:b.jsxs("div",{className:"flex flex-wrap items-center gap-3 text-xs",children:[b.jsx("span",{className:"inline-flex items-center px-2 py-1 font-medium",style:{backgroundColor:t?"var(--success)20":"var(--blocked)20",color:t?"var(--success)":"var(--blocked)"},children:t?"Advanced":"Blocked"}),b.jsxs("span",{className:"text-[var(--text-muted)]",children:["attempt ",e.attemptId.slice(-8)," at event #",e.recordedAtEventIndex]})]})})}function O6({validations:e}){return b.jsx(oa,{title:`Validations (${e.length})`,children:b.jsx("div",{className:"space-y-2",children:e.map(t=>b.jsx(j6,{validation:t},t.validationId))})})}function j6({validation:e}){const t=e.outcome==="pass";return b.jsxs("div",{className:"bg-[var(--bg-primary)] border border-[var(--border)] px-4 py-3 text-xs space-y-2",children:[b.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[b.jsx("span",{className:"inline-flex items-center px-2 py-1 font-medium",style:{backgroundColor:t?"var(--success)20":"var(--error)20",color:t?"var(--success)":"var(--error)"},children:t?"Pass":"Fail"}),b.jsx("span",{className:"text-[var(--text-muted)] font-mono",children:e.contractRef})]}),e.issues.length>0&&b.jsxs("div",{className:"space-y-1",children:[b.jsx("div",{className:"text-[var(--text-muted)] mb-1",children:"Issues"}),b.jsx("ul",{className:"list-disc list-inside text-[var(--error)] space-y-0.5",children:e.issues.map((r,a)=>b.jsx("li",{children:r},a))})]}),e.suggestions.length>0&&b.jsxs("div",{children:[b.jsx("div",{className:"text-[var(--text-muted)] mb-1",children:"Suggestions"}),b.jsx("ul",{className:"list-disc list-inside text-[var(--text-secondary)] space-y-0.5",children:e.suggestions.map((r,a)=>b.jsx("li",{children:r},a))})]})]})}function D6({gaps:e}){return b.jsx(oa,{title:`Gaps (${e.length})`,children:b.jsx("div",{className:"space-y-2",children:e.map(t=>b.jsxs("div",{className:"flex items-start gap-3 text-xs bg-[var(--bg-primary)] border border-[var(--border)] px-3 py-3",children:[b.jsx("span",{className:"shrink-0 inline-flex items-center px-2 py-1 font-medium",style:{backgroundColor:t.isResolved?"var(--success)20":t.severity==="critical"?"var(--error)20":"var(--warning)20",color:t.isResolved?"var(--success)":t.severity==="critical"?"var(--error)":"var(--warning)"},children:t.isResolved?"Resolved":t.severity==="critical"?"Critical":"Non-critical"}),b.jsx("span",{className:"text-[var(--text-secondary)] leading-relaxed",children:t.summary})]},t.gapId))})})}const N1=1e5,z6=[{prefix:"text/",render:e=>b.jsx("pre",{className:"text-[var(--text-secondary)] whitespace-pre-wrap break-words font-mono max-h-40 overflow-y-auto",children:typeof e=="string"?e:String(e)})},{prefix:"application/json",render:e=>b.jsx("pre",{className:"text-[var(--text-secondary)] whitespace-pre-wrap break-words font-mono max-h-40 overflow-y-auto",children:typeof e=="string"?e:JSON.stringify(e,null,2)})}];function L6(e){if(e.byteLength>N1)return b.jsxs("div",{className:"text-[var(--text-muted)] italic",children:["Content too large to display (",Jp(e.byteLength)," -- limit ",Jp(N1),")"]});const t=z6.find(r=>e.contentType.startsWith(r.prefix));return t?t.render(e.content):b.jsx("pre",{className:"text-[var(--text-secondary)] whitespace-pre-wrap break-words font-mono max-h-40 overflow-y-auto",children:typeof e.content=="string"?e.content:JSON.stringify(e.content,null,2)})}function B6({artifacts:e}){return b.jsx(oa,{title:`Artifacts (${e.length})`,children:b.jsx("div",{className:"space-y-2",children:e.map(t=>b.jsxs("div",{className:"bg-[var(--bg-primary)] border border-[var(--border)] px-4 py-3 text-xs space-y-2",children:[b.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-[var(--text-muted)]",children:[b.jsx("span",{children:t.contentType}),b.jsx("span",{children:"·"}),b.jsx("span",{children:Jp(t.byteLength)})]}),L6(t)]},t.sha256))})})}function oa({title:e,children:t}){return b.jsxs("div",{children:[b.jsx("div",{className:"mb-2",children:b.jsx("h3",{className:"font-mono text-[10px] uppercase tracking-[0.18em] text-[var(--text-muted)]",children:e})}),t]})}function rc({label:e,value:t,mono:r=!1}){return b.jsxs("div",{className:"bg-[var(--bg-primary)] border border-[var(--border)] px-4 py-3",children:[b.jsx("div",{className:"font-mono text-[10px] uppercase tracking-[0.18em] text-[var(--text-muted)]",children:e}),b.jsx("div",{className:r?"mt-2 font-mono text-sm text-[var(--text-secondary)] truncate":"mt-2 text-sm text-[var(--text-primary)]",children:t})]})}const I6={step:{label:"Step",color:"var(--accent)"},checkpoint:{label:"Checkpoint",color:"var(--success)"},blocked_attempt:{label:"Blocked",color:"var(--error)"}};function H6({kind:e}){const t=I6[e];return b.jsx("span",{className:"inline-flex items-center px-2 py-1 font-medium",style:{backgroundColor:`${t.color}20`,color:t.color},children:t.label})}function Jp(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}const P6=1;function U6(e){return`polygon(${e}px 0, 100% 0, 100% 100%, 0 100%, 0 ${e}px)`}function ZE({cut:e=12,borderColor:t="var(--border)",background:r="var(--bg-card)",dropShadow:a,className:o,style:l,children:u}){const f=U6(e);return b.jsxs("div",{className:o,style:{filter:a?`${a}`:void 0,...l},children:[b.jsx("div",{"aria-hidden":!0,style:{position:"absolute",inset:0,background:t,clipPath:f,pointerEvents:"none"}}),b.jsx("div",{style:{position:"absolute",inset:P6,background:r,clipPath:f,display:"flex",flexDirection:"column",overflow:"hidden"},children:u})]})}function q6(e){return e.length>16?`…${e.slice(-16)}`:e}function V6({data:e}){const t=e.runs[0]??null,r=t?.workflowName??t?.workflowId??"--",a=t?.workflowHash?.slice(0,12)??"--";return b.jsxs("div",{className:"bg-[var(--bg-card)] border border-[var(--border)] px-5 py-4",children:[e.sessionTitle&&b.jsx("h2",{className:"text-base font-medium text-[var(--text-primary)] mb-3",children:e.sessionTitle}),b.jsxs("dl",{className:"grid grid-cols-[auto_1fr] gap-x-8 gap-y-2",children:[b.jsx("dt",{className:"font-mono text-[10px] uppercase tracking-[0.18em] text-[var(--text-muted)] self-center",children:"Session"}),b.jsx("dd",{className:"font-mono text-xs text-[var(--text-secondary)] self-center",children:q6(e.sessionId)}),b.jsx("dt",{className:"font-mono text-[10px] uppercase tracking-[0.18em] text-[var(--text-muted)] self-center",children:"Workflow"}),b.jsx("dd",{className:"text-sm text-[var(--text-primary)] self-center",children:r}),b.jsx("dt",{className:"font-mono text-[10px] uppercase tracking-[0.18em] text-[var(--text-muted)] self-center",children:"Hash"}),b.jsx("dd",{className:"font-mono text-xs text-[var(--text-secondary)] self-center",children:a}),b.jsx("dt",{className:"font-mono text-[10px] uppercase tracking-[0.18em] text-[var(--text-muted)] self-center",children:"Status"}),b.jsxs("dd",{className:"self-center flex items-center gap-2",children:[b.jsx(wS,{health:e.health}),e.health==="healthy"&&b.jsx("span",{className:"text-sm text-[var(--text-primary)]",children:"Healthy"})]}),b.jsx("dt",{className:"font-mono text-[10px] uppercase tracking-[0.18em] text-[var(--text-muted)] self-center",children:"Runs"}),b.jsxs("dd",{className:"text-sm text-[var(--text-primary)] self-center",children:[e.runs.length," run",e.runs.length!==1?"s":""]})]})]})}function F6({runs:e}){const r=e.some(a=>a.preferredTipNodeId!==null)?"Nodes with a gold border are the current execution tips — click any node to inspect its execution detail.":"Click any node in the DAG to inspect its execution detail.";return b.jsx("p",{className:"border border-[var(--border)] px-4 py-3 text-xs text-[var(--text-muted)]",children:r})}function Y6({sessionId:e}){const{data:t,isLoading:r,error:a}=ik(e),[o,l]=Y.useState(null),u=Y.useCallback((h,d)=>{l(m=>m?.runId===h&&m?.nodeId===d?null:{runId:h,nodeId:d})},[]);if(r)return b.jsx("div",{className:"text-[var(--text-secondary)]",children:"Loading session..."});if(a)return b.jsxs("div",{className:"text-[var(--error)] bg-[var(--bg-card)] rounded-lg p-4",children:["Failed to load session: ",a.message]});if(!t)return null;const f=o?t.runs.find(h=>h.runId===o.runId)??null:null;return b.jsxs(b.Fragment,{children:[b.jsxs("div",{className:"space-y-4",children:[b.jsx(V6,{data:t}),t.runs.length===0?b.jsx("div",{className:"text-center py-16 text-[var(--text-secondary)]",children:"No runs in this session"}):b.jsxs(b.Fragment,{children:[o===null&&b.jsx(F6,{runs:t.runs}),b.jsx("div",{className:"space-y-6",children:t.runs.map(h=>b.jsx(X6,{run:h,selectedNodeId:o?.runId===h.runId?o.nodeId:null,onNodeClick:u},h.runId))})]})]}),b.jsxs(ZE,{cut:18,borderColor:"rgba(0, 240, 255, 0.28)",background:"color-mix(in srgb, var(--bg-card) 92%, var(--accent) 8%)",dropShadow:"drop-shadow(0 16px 48px rgba(0,0,0,0.8)) drop-shadow(0 2px 8px rgba(0,0,0,0.55))",className:"fixed top-3 right-3 bottom-3 w-[560px] max-w-[calc(92vw-12px)] transition-transform duration-200 ease-out",style:{zIndex:40,transform:o?"translateX(0)":"translateX(calc(100% + 12px))"},children:[b.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-[var(--border)] shrink-0 console-blueprint-grid",children:[b.jsx("span",{className:"font-mono text-[10px] uppercase tracking-[0.18em] text-[var(--text-muted)]",children:"Node detail"}),b.jsx("button",{onClick:()=>l(null),className:"text-[var(--text-muted)] hover:text-[var(--text-primary)] transition-colors text-xl leading-none px-1","aria-label":"Close",children:"×"})]}),b.jsx("div",{className:"flex-1 overflow-auto",children:b.jsx(E6,{sessionId:e,nodeId:o?.nodeId??null,runStatus:f?.status??"complete",currentNodeId:f?.preferredTipNodeId??null})})]})]})}function X6({run:e,selectedNodeId:t,onNodeClick:r}){return b.jsxs(ZE,{cut:10,className:"relative",style:{height:"506px"},children:[b.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-[var(--border)] shrink-0",children:[b.jsxs("div",{className:"flex items-center gap-3",children:[b.jsx("span",{className:"text-sm font-medium text-[var(--text-primary)]",children:e.workflowName??e.workflowId??"Run"}),b.jsx("span",{className:"font-mono text-xs text-[var(--text-muted)]",children:e.runId}),b.jsxs("span",{className:"font-mono text-xs text-[var(--text-muted)]",children:[e.nodes.length," nodes · ",e.tipNodeIds.length," tip",e.tipNodeIds.length!==1?"s":""]})]}),b.jsxs("div",{className:"flex items-center gap-2",children:[e.hasUnresolvedCriticalGaps&&b.jsx("span",{className:"text-xs text-[var(--warning)]",children:"Critical gaps"}),b.jsx(SS,{status:e.status})]})]}),b.jsx("div",{className:"flex-1",children:b.jsx(YD,{run:e,selectedNodeId:t,onNodeClick:a=>r(e.runId,a)})})]})}const KE=[{id:"coding",label:"Coding"},{id:"review_audit",label:"Review & Audit"},{id:"investigation",label:"Investigation"},{id:"design",label:"Design"},{id:"documentation",label:"Documentation"},{id:"tickets",label:"Tickets"},{id:"learning",label:"Learning"},{id:"authoring",label:"Workflow Authoring"}],JE=Object.fromEntries(KE.map(e=>[e.id,e.label]));function G6({selectedTag:e,onSelectTag:t,onSelectWorkflow:r}){const{data:a,isLoading:o,isError:l,error:u,refetch:f}=sk(),h=a?.workflows.filter(g=>!g.tags.includes("routines"))??[],d=e?h.filter(g=>g.tags.includes(e)):h,m=new Set(h.flatMap(g=>g.tags));return b.jsxs("div",{className:"space-y-4","aria-busy":o,children:[b.jsxs("div",{role:"group","aria-label":"Filter workflows by category",className:"flex flex-wrap gap-1.5",children:[b.jsx(M1,{label:"All",isActive:e===null,disabled:o,onClick:()=>t(null)}),KE.filter(g=>m.has(g.id)||!a).map(g=>b.jsx(M1,{label:g.label,isActive:e===g.id,disabled:o,onClick:()=>t(e===g.id?null:g.id)},g.id))]}),o?b.jsx(Q6,{}):l?b.jsx(Z6,{message:u instanceof Error?u.message:"Could not load workflows.",onRetry:()=>{f()}}):d.length===0?b.jsx("p",{className:"text-sm text-[var(--text-muted)] py-8 text-center",children:"No workflows in this category."}):b.jsx("div",{className:"space-y-px",children:d.map(g=>b.jsx($6,{workflow:g,onSelect:()=>r(g.id)},g.id))})]})}function M1({label:e,isActive:t,disabled:r,onClick:a}){return b.jsxs("button",{type:"button",onClick:a,disabled:r,"aria-pressed":t,className:["px-3 py-2 min-w-[44px] rounded-full text-xs font-medium transition-colors","disabled:opacity-50 disabled:cursor-not-allowed",t?"bg-[var(--bg-tertiary)] text-[var(--text-primary)]":"text-[var(--text-muted)] hover:text-[var(--text-secondary)]"].join(" "),children:[e,t&&b.jsx("span",{className:"sr-only",children:"(selected)"})]})}function $6({workflow:e,onSelect:t}){const r=e.tags.filter(o=>o!=="routines").map(o=>JE[o]??o),a=[e.name,e.description,r.length>0?`Tag: ${r.join(", ")}`:null,`Source: ${e.source.displayName}`].filter(Boolean).join(". ");return b.jsx("button",{type:"button",onClick:t,"aria-label":a,className:"w-full text-left flex items-start gap-3 px-3 py-2.5 rounded hover:bg-[var(--bg-card)] transition-colors group",children:b.jsxs("div",{className:"flex-1 min-w-0 space-y-1",children:[b.jsx("p",{className:"text-sm text-[var(--text-primary)] group-hover:text-[var(--accent)] transition-colors leading-snug truncate",children:e.name}),b.jsx("p",{className:"text-xs text-[var(--text-secondary)] truncate",children:e.description}),b.jsxs("div",{className:"flex items-center gap-2",children:[r.map(o=>b.jsx("span",{"aria-hidden":"true",className:"text-[10px] px-1.5 py-0.5 rounded bg-[var(--bg-secondary)] text-[var(--text-muted)]",children:o},o)),b.jsx("span",{"aria-hidden":"true",className:"text-[10px] px-1.5 py-0.5 rounded border border-[var(--border)] text-[var(--text-muted)]",children:e.source.displayName})]})]})})}function Q6(){return b.jsx("div",{className:"space-y-px animate-pulse","aria-busy":"true","aria-label":"Loading workflows",children:Array.from({length:8}).map((e,t)=>b.jsxs("div",{className:"px-3 py-3 space-y-1.5",children:[b.jsx("div",{className:"h-4 w-2/3 rounded bg-[var(--bg-tertiary)]"}),b.jsx("div",{className:"h-3 w-full rounded bg-[var(--bg-tertiary)]"}),b.jsxs("div",{className:"flex gap-1.5",children:[b.jsx("div",{className:"h-4 w-14 rounded bg-[var(--bg-tertiary)]"}),b.jsx("div",{className:"h-4 w-16 rounded bg-[var(--bg-tertiary)]"})]})]},t))})}function Z6({message:e,onRetry:t}){return b.jsxs("div",{className:"space-y-3 py-8 text-center",children:[b.jsx("p",{className:"text-sm text-[var(--error)]",children:e}),b.jsx("button",{type:"button",onClick:t,className:"text-sm text-[var(--accent)] hover:text-[var(--accent-hover)] transition-colors",children:"Try again"})]})}function K6({workflowId:e,onBack:t}){const o=rm().getQueryData(["workflows"])?.workflows.find(C=>C.id===e),{data:l,isLoading:u,isError:f,error:h,refetch:d}=lk(e),m="Workflows",g=l?.name??o?.name??e,y=l?.description??o?.description??null,v=l?.tags??o?.tags??[],S=l?.source??o?.source??null;return b.jsxs("div",{className:"space-y-5 max-w-3xl",children:[b.jsxs("button",{type:"button",onClick:t,"aria-label":m,className:"text-[var(--text-secondary)] hover:text-[var(--text-primary)] transition-colors text-sm",children:["← ",m]}),b.jsxs("div",{className:"space-y-2",children:[b.jsx("h2",{className:"text-xl font-semibold text-[var(--text-primary)] leading-snug",children:g}),b.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[v.filter(C=>C!=="routines").map(C=>b.jsx("span",{"aria-hidden":"true",className:"text-[10px] px-2 py-0.5 rounded bg-[var(--bg-tertiary)] text-[var(--text-secondary)]",children:JE[C]??C},C)),S&&b.jsx("span",{"aria-hidden":"true",className:"text-[10px] px-2 py-0.5 rounded bg-[var(--bg-secondary)] text-[var(--text-muted)] border border-[var(--border)]",children:S.displayName}),l&&b.jsxs("span",{className:"text-[10px] text-[var(--text-muted)]",children:[l.stepCount," ",l.stepCount===1?"step":"steps"]})]}),y&&b.jsx("p",{className:"text-sm text-[var(--text-secondary)] leading-relaxed",children:y})]}),u&&!o?b.jsx(W6,{}):f?b.jsx(eB,{message:h instanceof Error?h.message:"Could not load workflow details.",is404:h instanceof vS&&h.status===404,onRetry:()=>{d()},onBack:t}):l?b.jsx(J6,{detail:l}):b.jsx("div",{className:"space-y-4",children:b.jsx(WE,{})})]})}function J6({detail:e}){const t=e.about!==void 0&&e.about.length>0,r=e.examples!==void 0&&e.examples.length>0,a=e.preconditions!==void 0&&e.preconditions.length>0;return t||r||a?b.jsxs("div",{className:"space-y-6",children:[t&&b.jsxs("section",{children:[b.jsx("h3",{className:"text-xs font-semibold text-[var(--text-muted)] uppercase tracking-wider mb-3",children:"About"}),b.jsx(QE,{children:e.about})]}),r&&b.jsxs("section",{children:[b.jsx("h3",{className:"text-xs font-semibold text-[var(--text-muted)] uppercase tracking-wider mb-3",children:"Try it with:"}),b.jsx("ul",{className:"space-y-2",children:e.examples.map(l=>b.jsxs("li",{className:"flex items-start gap-3 bg-[var(--bg-card)] border border-[var(--border)] rounded-lg px-4 py-3",children:[b.jsx("div",{className:"w-0.5 shrink-0 self-stretch rounded-full",style:{backgroundColor:"var(--accent)"}}),b.jsxs("span",{className:"text-sm text-[var(--text-secondary)] leading-relaxed",children:['"',l,'"']})]},l))})]}),a&&b.jsxs("section",{children:[b.jsx("h3",{className:"text-xs font-semibold text-[var(--text-muted)] uppercase tracking-wider mb-3",children:"Before you start:"}),b.jsx("ul",{className:"space-y-1.5",children:e.preconditions.map(l=>b.jsxs("li",{className:"flex items-start gap-2 text-sm text-[var(--text-secondary)]",children:[b.jsx("span",{className:"shrink-0 text-[var(--text-muted)] mt-0.5",children:"•"}),b.jsx("span",{children:l})]},l))})]})]}):b.jsx("p",{className:"text-sm text-[var(--text-muted)] italic",children:"No extended description available for this workflow."})}function WE(){return b.jsxs("div",{className:"space-y-3 animate-pulse",children:[b.jsx("div",{className:"h-3 w-16 rounded bg-[var(--bg-tertiary)]"}),b.jsx("div",{className:"h-4 w-full rounded bg-[var(--bg-tertiary)]"}),b.jsx("div",{className:"h-4 w-5/6 rounded bg-[var(--bg-tertiary)]"}),b.jsx("div",{className:"h-4 w-4/6 rounded bg-[var(--bg-tertiary)]"})]})}function W6(){return b.jsxs("div",{className:"space-y-6 animate-pulse",children:[b.jsxs("div",{className:"space-y-2",children:[b.jsx("div",{className:"h-6 w-1/2 rounded bg-[var(--bg-tertiary)]"}),b.jsxs("div",{className:"flex gap-2",children:[b.jsx("div",{className:"h-5 w-16 rounded bg-[var(--bg-tertiary)]"}),b.jsx("div",{className:"h-5 w-24 rounded bg-[var(--bg-tertiary)]"})]}),b.jsx("div",{className:"h-4 w-full rounded bg-[var(--bg-tertiary)]"})]}),b.jsx(WE,{})]})}function eB({message:e,is404:t,onRetry:r,onBack:a}){return b.jsxs("div",{className:"space-y-4 bg-[var(--bg-card)] border border-[var(--border)] rounded-lg p-4",children:[b.jsx("p",{className:"text-sm text-[var(--error)]",children:t?"Workflow not found.":e}),b.jsxs("div",{className:"flex gap-3",children:[!t&&b.jsx("button",{type:"button",onClick:r,className:"text-sm text-[var(--accent)] hover:text-[var(--accent-hover)] transition-colors",children:"Try again"}),b.jsx("button",{type:"button",onClick:a,"aria-label":"Back to workflows list",className:"text-sm text-[var(--text-secondary)] hover:text-[var(--text-primary)] transition-colors",children:"← Back to Workflows"})]})]})}function tB(){const e=Pc(),t=PM(),{location:r}=XM(),a=t({to:"/session/$sessionId"}),o=t({to:"/workflows"}),l=t({to:"/workflows/$workflowId"}),u=a!==!1,f=o!==!1||l!==!1,h=l!==!1,d=u?a.sessionId:null,m=h?l.workflowId:null,g=new URLSearchParams(r.search).get("tag"),y=Y.useCallback(()=>{e({to:"/"})},[e]),v=Y.useCallback(w=>{e({to:"/workflows",search:{tag:w??void 0}})},[e]),S=Y.useCallback(w=>{e({to:"/workflows/$workflowId",params:{workflowId:w},search:{tag:g??void 0}})},[e,g]),C=Y.useCallback(()=>{e({to:"/workflows",search:{tag:g??void 0}})},[e,g]),N=Y.useRef(null);return Y.useEffect(()=>{const w=N.current;if(!w)return;function O(_){(_.key==="ArrowLeft"||_.key==="ArrowRight")&&(_.preventDefault(),e(f?{to:"/"}:{to:"/workflows",search:{tag:void 0}}))}return w.addEventListener("keydown",O),()=>w.removeEventListener("keydown",O)},[f,e]),b.jsxs("div",{className:"min-h-screen bg-[var(--bg-primary)]",style:{"--app-header-height":"61px"},children:[b.jsx("header",{className:"sticky top-0 z-20 border-b border-[var(--border)] px-6 py-4 bg-[var(--bg-primary)]",children:b.jsxs("div",{className:"flex items-center gap-4",children:[u&&b.jsx("button",{onClick:y,className:"text-[var(--text-secondary)] hover:text-[var(--text-primary)] transition-colors",children:"← Back"}),b.jsx("h1",{className:"text-lg font-semibold text-[var(--text-primary)]",children:"WorkRail Console"}),u&&d&&b.jsx("span",{className:"text-sm text-[var(--text-muted)] font-mono",children:d}),!u&&b.jsxs("div",{role:"tablist","aria-label":"Console sections",ref:N,className:"flex items-center gap-1 ml-4",children:[b.jsx("button",{role:"tab",id:"tab-workspace","aria-selected":!f,"aria-controls":"panel-workspace",tabIndex:f?-1:0,onClick:()=>{e({to:"/"})},className:["px-3 py-1 rounded text-sm font-medium transition-colors",f?"text-[var(--text-muted)] hover:text-[var(--text-secondary)]":"text-[var(--text-primary)]"].join(" "),children:"Workspace"}),b.jsx("button",{role:"tab",id:"tab-workflows","aria-selected":f,"aria-controls":"panel-workflows",tabIndex:f?0:-1,onClick:()=>{e({to:"/workflows",search:{tag:void 0}})},className:["px-3 py-1 rounded text-sm font-medium transition-colors",f?"text-[var(--text-primary)]":"text-[var(--text-muted)] hover:text-[var(--text-secondary)]"].join(" "),children:"Workflows"})]})]})}),b.jsxs("main",{className:"p-6",children:[b.jsxs("div",{id:"panel-workspace",role:"tabpanel","aria-labelledby":"tab-workspace",hidden:f,children:[b.jsx(Tk,{hidden:u}),u&&d&&b.jsx(Y6,{sessionId:d})]}),f&&b.jsx("div",{id:"panel-workflows",role:"tabpanel","aria-labelledby":"tab-workflows",children:h&&m?b.jsx(K6,{workflowId:m,onBack:C}):b.jsx(G6,{selectedTag:g,onSelectTag:v,onSelectWorkflow:S})})]})]})}const Co=TM({component:tB}),nB=ul({getParentRoute:()=>Co,path:"/",component:()=>null}),rB=ul({getParentRoute:()=>Co,path:"/session/$sessionId",component:()=>null}),iB=ul({getParentRoute:()=>Co,path:"/workflows",validateSearch:e=>({tag:typeof e.tag=="string"?e.tag:void 0}),component:()=>null}),aB=ul({getParentRoute:()=>Co,path:"/workflows/$workflowId",validateSearch:e=>({tag:typeof e.tag=="string"?e.tag:void 0}),component:()=>null}),oB=ul({getParentRoute:()=>Co,path:"/perf",component:()=>null}),sB=Co.addChildren([nB,rB,iB,aB,oB]),lB=qM({routeTree:sB,history:qN()}),uB=new I2({defaultOptions:{queries:{refetchInterval:5e3,staleTime:2e3}}});h2.createRoot(document.getElementById("root")).render(b.jsx(Y.StrictMode,{children:b.jsx(H2,{client:uB,children:b.jsx(YM,{router:lB})})}));
|