@exaudeus/workrail 3.14.0 → 3.15.0

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.
Files changed (62) hide show
  1. package/dist/application/services/validation-engine.js +4 -9
  2. package/dist/application/services/workflow-compiler.js +4 -6
  3. package/dist/console/assets/index-BZYIjrzJ.js +28 -0
  4. package/dist/console/assets/index-OLCKbDdm.css +1 -0
  5. package/dist/console/index.html +2 -2
  6. package/dist/engine/engine-factory.js +2 -2
  7. package/dist/engine/types.d.ts +1 -1
  8. package/dist/manifest.json +63 -63
  9. package/dist/mcp/handlers/shared/request-workflow-reader.d.ts +5 -0
  10. package/dist/mcp/handlers/shared/request-workflow-reader.js +47 -2
  11. package/dist/mcp/handlers/v2-advance-core/assessment-consequences.d.ts +1 -1
  12. package/dist/mcp/handlers/v2-advance-core/assessment-consequences.js +4 -5
  13. package/dist/mcp/handlers/v2-advance-core/index.js +1 -1
  14. package/dist/mcp/handlers/v2-advance-core/outcome-blocked.js +1 -1
  15. package/dist/mcp/handlers/v2-execution/start.d.ts +1 -0
  16. package/dist/mcp/handlers/v2-execution/start.js +20 -1
  17. package/dist/mcp/handlers/v2-workflow.d.ts +20 -0
  18. package/dist/mcp/handlers/v2-workflow.js +119 -10
  19. package/dist/mcp/output-schemas.d.ts +109 -8
  20. package/dist/mcp/output-schemas.js +31 -11
  21. package/dist/mcp/server.js +48 -1
  22. package/dist/mcp/tool-descriptions.js +17 -9
  23. package/dist/mcp/v2/tools.d.ts +6 -0
  24. package/dist/mcp/v2/tools.js +2 -0
  25. package/dist/mcp/workflow-protocol-contracts.js +5 -1
  26. package/dist/types/workflow-definition.d.ts +1 -2
  27. package/dist/v2/infra/local/workspace-anchor/index.js +4 -1
  28. package/dist/v2/usecases/console-routes.js +49 -1
  29. package/dist/v2/usecases/console-service.d.ts +1 -0
  30. package/dist/v2/usecases/console-service.js +4 -1
  31. package/dist/v2/usecases/console-types.d.ts +12 -0
  32. package/dist/v2/usecases/worktree-service.js +55 -7
  33. package/package.json +2 -2
  34. package/spec/authoring-spec.json +82 -1
  35. package/spec/workflow-tags.json +132 -0
  36. package/spec/workflow.schema.json +3 -11
  37. package/workflows/adaptive-ticket-creation.json +40 -22
  38. package/workflows/architecture-scalability-audit.json +65 -31
  39. package/workflows/bug-investigation.agentic.v2.json +36 -14
  40. package/workflows/coding-task-workflow-agentic.json +50 -38
  41. package/workflows/coding-task-workflow-agentic.lean.v2.json +124 -37
  42. package/workflows/coding-task-workflow-agentic.v2.json +90 -30
  43. package/workflows/cross-platform-code-conversion.v2.json +168 -48
  44. package/workflows/document-creation-workflow.json +47 -17
  45. package/workflows/documentation-update-workflow.json +8 -8
  46. package/workflows/intelligent-test-case-generation.json +2 -2
  47. package/workflows/learner-centered-course-workflow.json +267 -267
  48. package/workflows/mr-review-workflow.agentic.v2.json +81 -14
  49. package/workflows/personal-learning-materials-creation-branched.json +175 -175
  50. package/workflows/presentation-creation.json +159 -159
  51. package/workflows/production-readiness-audit.json +54 -15
  52. package/workflows/relocation-workflow-us.json +44 -35
  53. package/workflows/routines/tension-driven-design.json +1 -1
  54. package/workflows/scoped-documentation-workflow.json +25 -25
  55. package/workflows/test-artifact-loop-control.json +1 -2
  56. package/workflows/ui-ux-design-workflow.json +327 -0
  57. package/workflows/workflow-diagnose-environment.json +1 -1
  58. package/workflows/workflow-for-workflows.json +507 -484
  59. package/workflows/workflow-for-workflows.v2.json +43 -11
  60. package/workflows/wr.discovery.json +112 -30
  61. package/dist/console/assets/index-DW78t31j.css +0 -1
  62. package/dist/console/assets/index-EsSXrC_a.js +0 -28
@@ -0,0 +1,28 @@
1
+ (function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))o(s);new MutationObserver(s=>{for(const l of s)if(l.type==="childList")for(const c of l.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&o(c)}).observe(document,{childList:!0,subtree:!0});function i(s){const l={};return s.integrity&&(l.integrity=s.integrity),s.referrerPolicy&&(l.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?l.credentials="include":s.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function o(s){if(s.ep)return;s.ep=!0;const l=i(s);fetch(s.href,l)}})();function Dc(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var gh={exports:{}},ps={};var Tv;function RC(){if(Tv)return ps;Tv=1;var t=Symbol.for("react.transitional.element"),n=Symbol.for("react.fragment");function i(o,s,l){var c=null;if(l!==void 0&&(c=""+l),s.key!==void 0&&(c=""+s.key),"key"in s){l={};for(var f in s)f!=="key"&&(l[f]=s[f])}else l=s;return s=l.ref,{$$typeof:t,type:o,key:c,ref:s!==void 0?s:null,props:l}}return ps.Fragment=n,ps.jsx=i,ps.jsxs=i,ps}var Mv;function OC(){return Mv||(Mv=1,gh.exports=RC()),gh.exports}var w=OC(),yh={exports:{}},Tt={};var Nv;function zC(){if(Nv)return Tt;Nv=1;var t=Symbol.for("react.transitional.element"),n=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),l=Symbol.for("react.consumer"),c=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),g=Symbol.for("react.activity"),v=Symbol.iterator;function x(L){return L===null||typeof L!="object"?null:(L=v&&L[v]||L["@@iterator"],typeof L=="function"?L:null)}var b={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},_=Object.assign,T={};function C(L,X,A){this.props=L,this.context=X,this.refs=T,this.updater=A||b}C.prototype.isReactComponent={},C.prototype.setState=function(L,X){if(typeof L!="object"&&typeof L!="function"&&L!=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,L,X,"setState")},C.prototype.forceUpdate=function(L){this.updater.enqueueForceUpdate(this,L,"forceUpdate")};function z(){}z.prototype=C.prototype;function E(L,X,A){this.props=L,this.context=X,this.refs=T,this.updater=A||b}var M=E.prototype=new z;M.constructor=E,_(M,C.prototype),M.isPureReactComponent=!0;var H=Array.isArray;function R(){}var B={H:null,A:null,T:null,S:null},P=Object.prototype.hasOwnProperty;function q(L,X,A){var it=A.ref;return{$$typeof:t,type:L,key:X,ref:it!==void 0?it:null,props:A}}function J(L,X){return q(L.type,X,L.props)}function j(L){return typeof L=="object"&&L!==null&&L.$$typeof===t}function V(L){var X={"=":"=0",":":"=2"};return"$"+L.replace(/[=:]/g,function(A){return X[A]})}var K=/\/+/g;function D(L,X){return typeof L=="object"&&L!==null&&L.key!=null?V(""+L.key):X.toString(36)}function I(L){switch(L.status){case"fulfilled":return L.value;case"rejected":throw L.reason;default:switch(typeof L.status=="string"?L.then(R,R):(L.status="pending",L.then(function(X){L.status==="pending"&&(L.status="fulfilled",L.value=X)},function(X){L.status==="pending"&&(L.status="rejected",L.reason=X)})),L.status){case"fulfilled":return L.value;case"rejected":throw L.reason}}throw L}function O(L,X,A,it,ct){var ft=typeof L;(ft==="undefined"||ft==="boolean")&&(L=null);var dt=!1;if(L===null)dt=!0;else switch(ft){case"bigint":case"string":case"number":dt=!0;break;case"object":switch(L.$$typeof){case t:case n:dt=!0;break;case m:return dt=L._init,O(dt(L._payload),X,A,it,ct)}}if(dt)return ct=ct(L),dt=it===""?"."+D(L,0):it,H(ct)?(A="",dt!=null&&(A=dt.replace(K,"$&/")+"/"),O(ct,X,A,"",function(St){return St})):ct!=null&&(j(ct)&&(ct=J(ct,A+(ct.key==null||L&&L.key===ct.key?"":(""+ct.key).replace(K,"$&/")+"/")+dt)),X.push(ct)),1;dt=0;var lt=it===""?".":it+":";if(H(L))for(var pt=0;pt<L.length;pt++)it=L[pt],ft=lt+D(it,pt),dt+=O(it,X,A,ft,ct);else if(pt=x(L),typeof pt=="function")for(L=pt.call(L),pt=0;!(it=L.next()).done;)it=it.value,ft=lt+D(it,pt++),dt+=O(it,X,A,ft,ct);else if(ft==="object"){if(typeof L.then=="function")return O(I(L),X,A,it,ct);throw X=String(L),Error("Objects are not valid as a React child (found: "+(X==="[object Object]"?"object with keys {"+Object.keys(L).join(", ")+"}":X)+"). If you meant to render a collection of children, use an array instead.")}return dt}function U(L,X,A){if(L==null)return L;var it=[],ct=0;return O(L,it,"","",function(ft){return X.call(A,ft,ct++)}),it}function G(L){if(L._status===-1){var X=L._result;X=X(),X.then(function(A){(L._status===0||L._status===-1)&&(L._status=1,L._result=A)},function(A){(L._status===0||L._status===-1)&&(L._status=2,L._result=A)}),L._status===-1&&(L._status=0,L._result=X)}if(L._status===1)return L._result.default;throw L._result}var $=typeof reportError=="function"?reportError:function(L){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var X=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof L=="object"&&L!==null&&typeof L.message=="string"?String(L.message):String(L),error:L});if(!window.dispatchEvent(X))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",L);return}console.error(L)},k={map:U,forEach:function(L,X,A){U(L,function(){X.apply(this,arguments)},A)},count:function(L){var X=0;return U(L,function(){X++}),X},toArray:function(L){return U(L,function(X){return X})||[]},only:function(L){if(!j(L))throw Error("React.Children.only expected to receive a single React element child.");return L}};return Tt.Activity=g,Tt.Children=k,Tt.Component=C,Tt.Fragment=i,Tt.Profiler=s,Tt.PureComponent=E,Tt.StrictMode=o,Tt.Suspense=d,Tt.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=B,Tt.__COMPILER_RUNTIME={__proto__:null,c:function(L){return B.H.useMemoCache(L)}},Tt.cache=function(L){return function(){return L.apply(null,arguments)}},Tt.cacheSignal=function(){return null},Tt.cloneElement=function(L,X,A){if(L==null)throw Error("The argument must be a React element, but you passed "+L+".");var it=_({},L.props),ct=L.key;if(X!=null)for(ft in X.key!==void 0&&(ct=""+X.key),X)!P.call(X,ft)||ft==="key"||ft==="__self"||ft==="__source"||ft==="ref"&&X.ref===void 0||(it[ft]=X[ft]);var ft=arguments.length-2;if(ft===1)it.children=A;else if(1<ft){for(var dt=Array(ft),lt=0;lt<ft;lt++)dt[lt]=arguments[lt+2];it.children=dt}return q(L.type,ct,it)},Tt.createContext=function(L){return L={$$typeof:c,_currentValue:L,_currentValue2:L,_threadCount:0,Provider:null,Consumer:null},L.Provider=L,L.Consumer={$$typeof:l,_context:L},L},Tt.createElement=function(L,X,A){var it,ct={},ft=null;if(X!=null)for(it in X.key!==void 0&&(ft=""+X.key),X)P.call(X,it)&&it!=="key"&&it!=="__self"&&it!=="__source"&&(ct[it]=X[it]);var dt=arguments.length-2;if(dt===1)ct.children=A;else if(1<dt){for(var lt=Array(dt),pt=0;pt<dt;pt++)lt[pt]=arguments[pt+2];ct.children=lt}if(L&&L.defaultProps)for(it in dt=L.defaultProps,dt)ct[it]===void 0&&(ct[it]=dt[it]);return q(L,ft,ct)},Tt.createRef=function(){return{current:null}},Tt.forwardRef=function(L){return{$$typeof:f,render:L}},Tt.isValidElement=j,Tt.lazy=function(L){return{$$typeof:m,_payload:{_status:-1,_result:L},_init:G}},Tt.memo=function(L,X){return{$$typeof:h,type:L,compare:X===void 0?null:X}},Tt.startTransition=function(L){var X=B.T,A={};B.T=A;try{var it=L(),ct=B.S;ct!==null&&ct(A,it),typeof it=="object"&&it!==null&&typeof it.then=="function"&&it.then(R,$)}catch(ft){$(ft)}finally{X!==null&&A.types!==null&&(X.types=A.types),B.T=X}},Tt.unstable_useCacheRefresh=function(){return B.H.useCacheRefresh()},Tt.use=function(L){return B.H.use(L)},Tt.useActionState=function(L,X,A){return B.H.useActionState(L,X,A)},Tt.useCallback=function(L,X){return B.H.useCallback(L,X)},Tt.useContext=function(L){return B.H.useContext(L)},Tt.useDebugValue=function(){},Tt.useDeferredValue=function(L,X){return B.H.useDeferredValue(L,X)},Tt.useEffect=function(L,X){return B.H.useEffect(L,X)},Tt.useEffectEvent=function(L){return B.H.useEffectEvent(L)},Tt.useId=function(){return B.H.useId()},Tt.useImperativeHandle=function(L,X,A){return B.H.useImperativeHandle(L,X,A)},Tt.useInsertionEffect=function(L,X){return B.H.useInsertionEffect(L,X)},Tt.useLayoutEffect=function(L,X){return B.H.useLayoutEffect(L,X)},Tt.useMemo=function(L,X){return B.H.useMemo(L,X)},Tt.useOptimistic=function(L,X){return B.H.useOptimistic(L,X)},Tt.useReducer=function(L,X,A){return B.H.useReducer(L,X,A)},Tt.useRef=function(L){return B.H.useRef(L)},Tt.useState=function(L){return B.H.useState(L)},Tt.useSyncExternalStore=function(L,X,A){return B.H.useSyncExternalStore(L,X,A)},Tt.useTransition=function(){return B.H.useTransition()},Tt.version="19.2.4",Tt}var kv;function nl(){return kv||(kv=1,yh.exports=zC()),yh.exports}var F=nl();const sa=Dc(F);var vh={exports:{}},ms={},xh={exports:{}},bh={};var Av;function DC(){return Av||(Av=1,(function(t){function n(O,U){var G=O.length;O.push(U);t:for(;0<G;){var $=G-1>>>1,k=O[$];if(0<s(k,U))O[$]=U,O[G]=k,G=$;else break t}}function i(O){return O.length===0?null:O[0]}function o(O){if(O.length===0)return null;var U=O[0],G=O.pop();if(G!==U){O[0]=G;t:for(var $=0,k=O.length,L=k>>>1;$<L;){var X=2*($+1)-1,A=O[X],it=X+1,ct=O[it];if(0>s(A,G))it<k&&0>s(ct,A)?(O[$]=ct,O[it]=G,$=it):(O[$]=A,O[X]=G,$=X);else if(it<k&&0>s(ct,G))O[$]=ct,O[it]=G,$=it;else break t}}return U}function s(O,U){var G=O.sortIndex-U.sortIndex;return G!==0?G:O.id-U.id}if(t.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var l=performance;t.unstable_now=function(){return l.now()}}else{var c=Date,f=c.now();t.unstable_now=function(){return c.now()-f}}var d=[],h=[],m=1,g=null,v=3,x=!1,b=!1,_=!1,T=!1,C=typeof setTimeout=="function"?setTimeout:null,z=typeof clearTimeout=="function"?clearTimeout:null,E=typeof setImmediate<"u"?setImmediate:null;function M(O){for(var U=i(h);U!==null;){if(U.callback===null)o(h);else if(U.startTime<=O)o(h),U.sortIndex=U.expirationTime,n(d,U);else break;U=i(h)}}function H(O){if(_=!1,M(O),!b)if(i(d)!==null)b=!0,R||(R=!0,V());else{var U=i(h);U!==null&&I(H,U.startTime-O)}}var R=!1,B=-1,P=5,q=-1;function J(){return T?!0:!(t.unstable_now()-q<P)}function j(){if(T=!1,R){var O=t.unstable_now();q=O;var U=!0;try{t:{b=!1,_&&(_=!1,z(B),B=-1),x=!0;var G=v;try{e:{for(M(O),g=i(d);g!==null&&!(g.expirationTime>O&&J());){var $=g.callback;if(typeof $=="function"){g.callback=null,v=g.priorityLevel;var k=$(g.expirationTime<=O);if(O=t.unstable_now(),typeof k=="function"){g.callback=k,M(O),U=!0;break e}g===i(d)&&o(d),M(O)}else o(d);g=i(d)}if(g!==null)U=!0;else{var L=i(h);L!==null&&I(H,L.startTime-O),U=!1}}break t}finally{g=null,v=G,x=!1}U=void 0}}finally{U?V():R=!1}}}var V;if(typeof E=="function")V=function(){E(j)};else if(typeof MessageChannel<"u"){var K=new MessageChannel,D=K.port2;K.port1.onmessage=j,V=function(){D.postMessage(null)}}else V=function(){C(j,0)};function I(O,U){B=C(function(){O(t.unstable_now())},U)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(O){O.callback=null},t.unstable_forceFrameRate=function(O){0>O||125<O?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):P=0<O?Math.floor(1e3/O):5},t.unstable_getCurrentPriorityLevel=function(){return v},t.unstable_next=function(O){switch(v){case 1:case 2:case 3:var U=3;break;default:U=v}var G=v;v=U;try{return O()}finally{v=G}},t.unstable_requestPaint=function(){T=!0},t.unstable_runWithPriority=function(O,U){switch(O){case 1:case 2:case 3:case 4:case 5:break;default:O=3}var G=v;v=O;try{return U()}finally{v=G}},t.unstable_scheduleCallback=function(O,U,G){var $=t.unstable_now();switch(typeof G=="object"&&G!==null?(G=G.delay,G=typeof G=="number"&&0<G?$+G:$):G=$,O){case 1:var k=-1;break;case 2:k=250;break;case 5:k=1073741823;break;case 4:k=1e4;break;default:k=5e3}return k=G+k,O={id:m++,callback:U,priorityLevel:O,startTime:G,expirationTime:k,sortIndex:-1},G>$?(O.sortIndex=G,n(h,O),i(d)===null&&O===i(h)&&(_?(z(B),B=-1):_=!0,I(H,G-$))):(O.sortIndex=k,n(d,O),b||x||(b=!0,R||(R=!0,V()))),O},t.unstable_shouldYield=J,t.unstable_wrapCallback=function(O){var U=v;return function(){var G=v;v=U;try{return O.apply(this,arguments)}finally{v=G}}}})(bh)),bh}var Rv;function LC(){return Rv||(Rv=1,xh.exports=DC()),xh.exports}var Sh={exports:{}},ze={};var Ov;function jC(){if(Ov)return ze;Ov=1;var t=nl();function n(d){var h="https://react.dev/errors/"+d;if(1<arguments.length){h+="?args[]="+encodeURIComponent(arguments[1]);for(var m=2;m<arguments.length;m++)h+="&args[]="+encodeURIComponent(arguments[m])}return"Minified React error #"+d+"; visit "+h+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function i(){}var o={d:{f:i,r:function(){throw Error(n(522))},D:i,C:i,L:i,m:i,X:i,S:i,M:i},p:0,findDOMNode:null},s=Symbol.for("react.portal");function l(d,h,m){var g=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:s,key:g==null?null:""+g,children:d,containerInfo:h,implementation:m}}var c=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function f(d,h){if(d==="font")return"";if(typeof h=="string")return h==="use-credentials"?h:""}return ze.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=o,ze.createPortal=function(d,h){var m=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!h||h.nodeType!==1&&h.nodeType!==9&&h.nodeType!==11)throw Error(n(299));return l(d,h,null,m)},ze.flushSync=function(d){var h=c.T,m=o.p;try{if(c.T=null,o.p=2,d)return d()}finally{c.T=h,o.p=m,o.d.f()}},ze.preconnect=function(d,h){typeof d=="string"&&(h?(h=h.crossOrigin,h=typeof h=="string"?h==="use-credentials"?h:"":void 0):h=null,o.d.C(d,h))},ze.prefetchDNS=function(d){typeof d=="string"&&o.d.D(d)},ze.preinit=function(d,h){if(typeof d=="string"&&h&&typeof h.as=="string"){var m=h.as,g=f(m,h.crossOrigin),v=typeof h.integrity=="string"?h.integrity:void 0,x=typeof h.fetchPriority=="string"?h.fetchPriority:void 0;m==="style"?o.d.S(d,typeof h.precedence=="string"?h.precedence:void 0,{crossOrigin:g,integrity:v,fetchPriority:x}):m==="script"&&o.d.X(d,{crossOrigin:g,integrity:v,fetchPriority:x,nonce:typeof h.nonce=="string"?h.nonce:void 0})}},ze.preinitModule=function(d,h){if(typeof d=="string")if(typeof h=="object"&&h!==null){if(h.as==null||h.as==="script"){var m=f(h.as,h.crossOrigin);o.d.M(d,{crossOrigin:m,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0})}}else h==null&&o.d.M(d)},ze.preload=function(d,h){if(typeof d=="string"&&typeof h=="object"&&h!==null&&typeof h.as=="string"){var m=h.as,g=f(m,h.crossOrigin);o.d.L(d,m,{crossOrigin:g,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0,type:typeof h.type=="string"?h.type:void 0,fetchPriority:typeof h.fetchPriority=="string"?h.fetchPriority:void 0,referrerPolicy:typeof h.referrerPolicy=="string"?h.referrerPolicy:void 0,imageSrcSet:typeof h.imageSrcSet=="string"?h.imageSrcSet:void 0,imageSizes:typeof h.imageSizes=="string"?h.imageSizes:void 0,media:typeof h.media=="string"?h.media:void 0})}},ze.preloadModule=function(d,h){if(typeof d=="string")if(h){var m=f(h.as,h.crossOrigin);o.d.m(d,{as:typeof h.as=="string"&&h.as!=="script"?h.as:void 0,crossOrigin:m,integrity:typeof h.integrity=="string"?h.integrity:void 0})}else o.d.m(d)},ze.requestFormReset=function(d){o.d.r(d)},ze.unstable_batchedUpdates=function(d,h){return d(h)},ze.useFormState=function(d,h,m){return c.H.useFormState(d,h,m)},ze.useFormStatus=function(){return c.H.useHostTransitionStatus()},ze.version="19.2.4",ze}var zv;function d1(){if(zv)return Sh.exports;zv=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(n){console.error(n)}}return t(),Sh.exports=jC(),Sh.exports}var Dv;function BC(){if(Dv)return ms;Dv=1;var t=LC(),n=nl(),i=d1();function o(e){var r="https://react.dev/errors/"+e;if(1<arguments.length){r+="?args[]="+encodeURIComponent(arguments[1]);for(var a=2;a<arguments.length;a++)r+="&args[]="+encodeURIComponent(arguments[a])}return"Minified React error #"+e+"; visit "+r+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function s(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function l(e){var r=e,a=e;if(e.alternate)for(;r.return;)r=r.return;else{e=r;do r=e,(r.flags&4098)!==0&&(a=r.return),e=r.return;while(e)}return r.tag===3?a:null}function c(e){if(e.tag===13){var r=e.memoizedState;if(r===null&&(e=e.alternate,e!==null&&(r=e.memoizedState)),r!==null)return r.dehydrated}return null}function f(e){if(e.tag===31){var r=e.memoizedState;if(r===null&&(e=e.alternate,e!==null&&(r=e.memoizedState)),r!==null)return r.dehydrated}return null}function d(e){if(l(e)!==e)throw Error(o(188))}function h(e){var r=e.alternate;if(!r){if(r=l(e),r===null)throw Error(o(188));return r!==e?null:e}for(var a=e,u=r;;){var p=a.return;if(p===null)break;var y=p.alternate;if(y===null){if(u=p.return,u!==null){a=u;continue}break}if(p.child===y.child){for(y=p.child;y;){if(y===a)return d(p),e;if(y===u)return d(p),r;y=y.sibling}throw Error(o(188))}if(a.return!==u.return)a=p,u=y;else{for(var S=!1,N=p.child;N;){if(N===a){S=!0,a=p,u=y;break}if(N===u){S=!0,u=p,a=y;break}N=N.sibling}if(!S){for(N=y.child;N;){if(N===a){S=!0,a=y,u=p;break}if(N===u){S=!0,u=y,a=p;break}N=N.sibling}if(!S)throw Error(o(189))}}if(a.alternate!==u)throw Error(o(190))}if(a.tag!==3)throw Error(o(188));return a.stateNode.current===a?e:r}function m(e){var r=e.tag;if(r===5||r===26||r===27||r===6)return e;for(e=e.child;e!==null;){if(r=m(e),r!==null)return r;e=e.sibling}return null}var g=Object.assign,v=Symbol.for("react.element"),x=Symbol.for("react.transitional.element"),b=Symbol.for("react.portal"),_=Symbol.for("react.fragment"),T=Symbol.for("react.strict_mode"),C=Symbol.for("react.profiler"),z=Symbol.for("react.consumer"),E=Symbol.for("react.context"),M=Symbol.for("react.forward_ref"),H=Symbol.for("react.suspense"),R=Symbol.for("react.suspense_list"),B=Symbol.for("react.memo"),P=Symbol.for("react.lazy"),q=Symbol.for("react.activity"),J=Symbol.for("react.memo_cache_sentinel"),j=Symbol.iterator;function V(e){return e===null||typeof e!="object"?null:(e=j&&e[j]||e["@@iterator"],typeof e=="function"?e:null)}var K=Symbol.for("react.client.reference");function D(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===K?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case _:return"Fragment";case C:return"Profiler";case T:return"StrictMode";case H:return"Suspense";case R:return"SuspenseList";case q:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case b:return"Portal";case E:return e.displayName||"Context";case z:return(e._context.displayName||"Context")+".Consumer";case M:var r=e.render;return e=e.displayName,e||(e=r.displayName||r.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case B:return r=e.displayName||null,r!==null?r:D(e.type)||"Memo";case P:r=e._payload,e=e._init;try{return D(e(r))}catch{}}return null}var I=Array.isArray,O=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,U=i.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,G={pending:!1,data:null,method:null,action:null},$=[],k=-1;function L(e){return{current:e}}function X(e){0>k||(e.current=$[k],$[k]=null,k--)}function A(e,r){k++,$[k]=e.current,e.current=r}var it=L(null),ct=L(null),ft=L(null),dt=L(null);function lt(e,r){switch(A(ft,r),A(ct,e),A(it,null),r.nodeType){case 9:case 11:e=(e=r.documentElement)&&(e=e.namespaceURI)?$0(e):0;break;default:if(e=r.tagName,r=r.namespaceURI)r=$0(r),e=Z0(r,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}X(it),A(it,e)}function pt(){X(it),X(ct),X(ft)}function St(e){e.memoizedState!==null&&A(dt,e);var r=it.current,a=Z0(r,e.type);r!==a&&(A(ct,e),A(it,a))}function wt(e){ct.current===e&&(X(it),X(ct)),dt.current===e&&(X(dt),cs._currentValue=G)}var vt,Et;function Rt(e){if(vt===void 0)try{throw Error()}catch(a){var r=a.stack.trim().match(/\n( *(at )?)/);vt=r&&r[1]||"",Et=-1<a.stack.indexOf(`
2
+ at`)?" (<anonymous>)":-1<a.stack.indexOf("@")?"@unknown:0:0":""}return`
3
+ `+vt+e+Et}var Ht=!1;function jt(e,r){if(!e||Ht)return"";Ht=!0;var a=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var u={DetermineComponentFrameRoot:function(){try{if(r){var st=function(){throw Error()};if(Object.defineProperty(st.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(st,[])}catch(rt){var nt=rt}Reflect.construct(e,[],st)}else{try{st.call()}catch(rt){nt=rt}e.call(st.prototype)}}else{try{throw Error()}catch(rt){nt=rt}(st=e())&&typeof st.catch=="function"&&st.catch(function(){})}}catch(rt){if(rt&&nt&&typeof rt.stack=="string")return[rt.stack,nt.stack]}return[null,null]}};u.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var p=Object.getOwnPropertyDescriptor(u.DetermineComponentFrameRoot,"name");p&&p.configurable&&Object.defineProperty(u.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var y=u.DetermineComponentFrameRoot(),S=y[0],N=y[1];if(S&&N){var Y=S.split(`
4
+ `),tt=N.split(`
5
+ `);for(p=u=0;u<Y.length&&!Y[u].includes("DetermineComponentFrameRoot");)u++;for(;p<tt.length&&!tt[p].includes("DetermineComponentFrameRoot");)p++;if(u===Y.length||p===tt.length)for(u=Y.length-1,p=tt.length-1;1<=u&&0<=p&&Y[u]!==tt[p];)p--;for(;1<=u&&0<=p;u--,p--)if(Y[u]!==tt[p]){if(u!==1||p!==1)do if(u--,p--,0>p||Y[u]!==tt[p]){var ot=`
6
+ `+Y[u].replace(" at new "," at ");return e.displayName&&ot.includes("<anonymous>")&&(ot=ot.replace("<anonymous>",e.displayName)),ot}while(1<=u&&0<=p);break}}}finally{Ht=!1,Error.prepareStackTrace=a}return(a=e?e.displayName||e.name:"")?Rt(a):""}function Qt(e,r){switch(e.tag){case 26:case 27:case 5:return Rt(e.type);case 16:return Rt("Lazy");case 13:return e.child!==r&&r!==null?Rt("Suspense Fallback"):Rt("Suspense");case 19:return Rt("SuspenseList");case 0:case 15:return jt(e.type,!1);case 11:return jt(e.type.render,!1);case 1:return jt(e.type,!0);case 31:return Rt("Activity");default:return""}}function Ee(e){try{var r="",a=null;do r+=Qt(e,a),a=e,e=e.return;while(e);return r}catch(u){return`
7
+ Error generating stack: `+u.message+`
8
+ `+u.stack}}var ie=Object.prototype.hasOwnProperty,Ae=t.unstable_scheduleCallback,Je=t.unstable_cancelCallback,yn=t.unstable_shouldYield,An=t.unstable_requestPaint,ue=t.unstable_now,Un=t.unstable_getCurrentPriorityLevel,et=t.unstable_ImmediatePriority,ut=t.unstable_UserBlockingPriority,gt=t.unstable_NormalPriority,Mt=t.unstable_LowPriority,Pt=t.unstable_IdlePriority,je=t.log,Rn=t.unstable_setDisableYieldValue,_e=null,ce=null;function Re(e){if(typeof je=="function"&&Rn(e),ce&&typeof ce.setStrictMode=="function")try{ce.setStrictMode(_e,e)}catch{}}var Yt=Math.clz32?Math.clz32:rf,Vn=Math.log,We=Math.LN2;function rf(e){return e>>>=0,e===0?32:31-(Vn(e)/We|0)|0}var oo=256,ao=262144,so=4194304;function ii(e){var r=e&42;if(r!==0)return r;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function lo(e,r,a){var u=e.pendingLanes;if(u===0)return 0;var p=0,y=e.suspendedLanes,S=e.pingedLanes;e=e.warmLanes;var N=u&134217727;return N!==0?(u=N&~y,u!==0?p=ii(u):(S&=N,S!==0?p=ii(S):a||(a=N&~e,a!==0&&(p=ii(a))))):(N=u&~y,N!==0?p=ii(N):S!==0?p=ii(S):a||(a=u&~e,a!==0&&(p=ii(a)))),p===0?0:r!==0&&r!==p&&(r&y)===0&&(y=p&-p,a=r&-r,y>=a||y===32&&(a&4194048)!==0)?r:p}function vr(e,r){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&r)===0}function of(e,r){switch(e){case 1:case 2:case 4:case 8:case 64:return r+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 r+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 hl(){var e=so;return so<<=1,(so&62914560)===0&&(so=4194304),e}function Sa(e){for(var r=[],a=0;31>a;a++)r.push(e);return r}function xr(e,r){e.pendingLanes|=r,r!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function af(e,r,a,u,p,y){var S=e.pendingLanes;e.pendingLanes=a,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=a,e.entangledLanes&=a,e.errorRecoveryDisabledLanes&=a,e.shellSuspendCounter=0;var N=e.entanglements,Y=e.expirationTimes,tt=e.hiddenUpdates;for(a=S&~a;0<a;){var ot=31-Yt(a),st=1<<ot;N[ot]=0,Y[ot]=-1;var nt=tt[ot];if(nt!==null)for(tt[ot]=null,ot=0;ot<nt.length;ot++){var rt=nt[ot];rt!==null&&(rt.lane&=-536870913)}a&=~st}u!==0&&pl(e,u,0),y!==0&&p===0&&e.tag!==0&&(e.suspendedLanes|=y&~(S&~r))}function pl(e,r,a){e.pendingLanes|=r,e.suspendedLanes&=~r;var u=31-Yt(r);e.entangledLanes|=r,e.entanglements[u]=e.entanglements[u]|1073741824|a&261930}function ml(e,r){var a=e.entangledLanes|=r;for(e=e.entanglements;a;){var u=31-Yt(a),p=1<<u;p&r|e[u]&r&&(e[u]|=r),a&=~p}}function gl(e,r){var a=r&-r;return a=(a&42)!==0?1:wa(a),(a&(e.suspendedLanes|r))!==0?0:a}function wa(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function Ea(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function yl(){var e=U.p;return e!==0?e:(e=window.event,e===void 0?32:xv(e.type))}function vl(e,r){var a=U.p;try{return U.p=e,r()}finally{U.p=a}}var qn=Math.random().toString(36).slice(2),be="__reactFiber$"+qn,Oe="__reactProps$"+qn,ri="__reactContainer$"+qn,uo="__reactEvents$"+qn,xl="__reactListeners$"+qn,sf="__reactHandles$"+qn,bl="__reactResources$"+qn,br="__reactMarker$"+qn;function _a(e){delete e[be],delete e[Oe],delete e[uo],delete e[xl],delete e[sf]}function Oi(e){var r=e[be];if(r)return r;for(var a=e.parentNode;a;){if(r=a[ri]||a[be]){if(a=r.alternate,r.child!==null||a!==null&&a.child!==null)for(e=iv(e);e!==null;){if(a=e[be])return a;e=iv(e)}return r}e=a,a=e.parentNode}return null}function zi(e){if(e=e[be]||e[ri]){var r=e.tag;if(r===5||r===6||r===13||r===31||r===26||r===27||r===3)return e}return null}function Di(e){var r=e.tag;if(r===5||r===26||r===27||r===6)return e.stateNode;throw Error(o(33))}function Li(e){var r=e[bl];return r||(r=e[bl]={hoistableStyles:new Map,hoistableScripts:new Map}),r}function he(e){e[br]=!0}var Sl=new Set,wl={};function oi(e,r){ji(e,r),ji(e+"Capture",r)}function ji(e,r){for(wl[e]=r,e=0;e<r.length;e++)Sl.add(r[e])}var lf=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]*$"),Ca={},El={};function uf(e){return ie.call(El,e)?!0:ie.call(Ca,e)?!1:lf.test(e)?El[e]=!0:(Ca[e]=!0,!1)}function co(e,r,a){if(uf(r))if(a===null)e.removeAttribute(r);else{switch(typeof a){case"undefined":case"function":case"symbol":e.removeAttribute(r);return;case"boolean":var u=r.toLowerCase().slice(0,5);if(u!=="data-"&&u!=="aria-"){e.removeAttribute(r);return}}e.setAttribute(r,""+a)}}function fo(e,r,a){if(a===null)e.removeAttribute(r);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(r);return}e.setAttribute(r,""+a)}}function On(e,r,a,u){if(u===null)e.removeAttribute(a);else{switch(typeof u){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(a);return}e.setAttributeNS(r,a,""+u)}}function He(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function _l(e){var r=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(r==="checkbox"||r==="radio")}function cf(e,r,a){var u=Object.getOwnPropertyDescriptor(e.constructor.prototype,r);if(!e.hasOwnProperty(r)&&typeof u<"u"&&typeof u.get=="function"&&typeof u.set=="function"){var p=u.get,y=u.set;return Object.defineProperty(e,r,{configurable:!0,get:function(){return p.call(this)},set:function(S){a=""+S,y.call(this,S)}}),Object.defineProperty(e,r,{enumerable:u.enumerable}),{getValue:function(){return a},setValue:function(S){a=""+S},stopTracking:function(){e._valueTracker=null,delete e[r]}}}}function ho(e){if(!e._valueTracker){var r=_l(e)?"checked":"value";e._valueTracker=cf(e,r,""+e[r])}}function Cl(e){if(!e)return!1;var r=e._valueTracker;if(!r)return!0;var a=r.getValue(),u="";return e&&(u=_l(e)?e.checked?"true":"false":e.value),e=u,e!==a?(r.setValue(e),!0):!1}function Sr(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var ff=/[\n"\\]/g;function Pe(e){return e.replace(ff,function(r){return"\\"+r.charCodeAt(0).toString(16)+" "})}function wr(e,r,a,u,p,y,S,N){e.name="",S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"?e.type=S:e.removeAttribute("type"),r!=null?S==="number"?(r===0&&e.value===""||e.value!=r)&&(e.value=""+He(r)):e.value!==""+He(r)&&(e.value=""+He(r)):S!=="submit"&&S!=="reset"||e.removeAttribute("value"),r!=null?Ta(e,S,He(r)):a!=null?Ta(e,S,He(a)):u!=null&&e.removeAttribute("value"),p==null&&y!=null&&(e.defaultChecked=!!y),p!=null&&(e.checked=p&&typeof p!="function"&&typeof p!="symbol"),N!=null&&typeof N!="function"&&typeof N!="symbol"&&typeof N!="boolean"?e.name=""+He(N):e.removeAttribute("name")}function Tl(e,r,a,u,p,y,S,N){if(y!=null&&typeof y!="function"&&typeof y!="symbol"&&typeof y!="boolean"&&(e.type=y),r!=null||a!=null){if(!(y!=="submit"&&y!=="reset"||r!=null)){ho(e);return}a=a!=null?""+He(a):"",r=r!=null?""+He(r):a,N||r===e.value||(e.value=r),e.defaultValue=r}u=u??p,u=typeof u!="function"&&typeof u!="symbol"&&!!u,e.checked=N?e.checked:!!u,e.defaultChecked=!!u,S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"&&(e.name=S),ho(e)}function Ta(e,r,a){r==="number"&&Sr(e.ownerDocument)===e||e.defaultValue===""+a||(e.defaultValue=""+a)}function ai(e,r,a,u){if(e=e.options,r){r={};for(var p=0;p<a.length;p++)r["$"+a[p]]=!0;for(a=0;a<e.length;a++)p=r.hasOwnProperty("$"+e[a].value),e[a].selected!==p&&(e[a].selected=p),p&&u&&(e[a].defaultSelected=!0)}else{for(a=""+He(a),r=null,p=0;p<e.length;p++){if(e[p].value===a){e[p].selected=!0,u&&(e[p].defaultSelected=!0);return}r!==null||e[p].disabled||(r=e[p])}r!==null&&(r.selected=!0)}}function Fm(e,r,a){if(r!=null&&(r=""+He(r),r!==e.value&&(e.value=r),a==null)){e.defaultValue!==r&&(e.defaultValue=r);return}e.defaultValue=a!=null?""+He(a):""}function Ym(e,r,a,u){if(r==null){if(u!=null){if(a!=null)throw Error(o(92));if(I(u)){if(1<u.length)throw Error(o(93));u=u[0]}a=u}a==null&&(a=""),r=a}a=He(r),e.defaultValue=a,u=e.textContent,u===a&&u!==""&&u!==null&&(e.value=u),ho(e)}function po(e,r){if(r){var a=e.firstChild;if(a&&a===e.lastChild&&a.nodeType===3){a.nodeValue=r;return}}e.textContent=r}var TE=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 Xm(e,r,a){var u=r.indexOf("--")===0;a==null||typeof a=="boolean"||a===""?u?e.setProperty(r,""):r==="float"?e.cssFloat="":e[r]="":u?e.setProperty(r,a):typeof a!="number"||a===0||TE.has(r)?r==="float"?e.cssFloat=a:e[r]=(""+a).trim():e[r]=a+"px"}function Gm(e,r,a){if(r!=null&&typeof r!="object")throw Error(o(62));if(e=e.style,a!=null){for(var u in a)!a.hasOwnProperty(u)||r!=null&&r.hasOwnProperty(u)||(u.indexOf("--")===0?e.setProperty(u,""):u==="float"?e.cssFloat="":e[u]="");for(var p in r)u=r[p],r.hasOwnProperty(p)&&a[p]!==u&&Xm(e,p,u)}else for(var y in r)r.hasOwnProperty(y)&&Xm(e,y,r[y])}function df(e){if(e.indexOf("-")===-1)return!1;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var ME=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"]]),NE=/^[\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 Ml(e){return NE.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function si(){}var hf=null;function pf(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var mo=null,go=null;function Qm(e){var r=zi(e);if(r&&(e=r.stateNode)){var a=e[Oe]||null;t:switch(e=r.stateNode,r.type){case"input":if(wr(e,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name),r=a.name,a.type==="radio"&&r!=null){for(a=e;a.parentNode;)a=a.parentNode;for(a=a.querySelectorAll('input[name="'+Pe(""+r)+'"][type="radio"]'),r=0;r<a.length;r++){var u=a[r];if(u!==e&&u.form===e.form){var p=u[Oe]||null;if(!p)throw Error(o(90));wr(u,p.value,p.defaultValue,p.defaultValue,p.checked,p.defaultChecked,p.type,p.name)}}for(r=0;r<a.length;r++)u=a[r],u.form===e.form&&Cl(u)}break t;case"textarea":Fm(e,a.value,a.defaultValue);break t;case"select":r=a.value,r!=null&&ai(e,!!a.multiple,r,!1)}}}var mf=!1;function $m(e,r,a){if(mf)return e(r,a);mf=!0;try{var u=e(r);return u}finally{if(mf=!1,(mo!==null||go!==null)&&(pu(),mo&&(r=mo,e=go,go=mo=null,Qm(r),e)))for(r=0;r<e.length;r++)Qm(e[r])}}function Ma(e,r){var a=e.stateNode;if(a===null)return null;var u=a[Oe]||null;if(u===null)return null;a=u[r];t:switch(r){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(u=!u.disabled)||(e=e.type,u=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!u;break t;default:e=!1}if(e)return null;if(a&&typeof a!="function")throw Error(o(231,r,typeof a));return a}var li=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),gf=!1;if(li)try{var Na={};Object.defineProperty(Na,"passive",{get:function(){gf=!0}}),window.addEventListener("test",Na,Na),window.removeEventListener("test",Na,Na)}catch{gf=!1}var Bi=null,yf=null,Nl=null;function Zm(){if(Nl)return Nl;var e,r=yf,a=r.length,u,p="value"in Bi?Bi.value:Bi.textContent,y=p.length;for(e=0;e<a&&r[e]===p[e];e++);var S=a-e;for(u=1;u<=S&&r[a-u]===p[y-u];u++);return Nl=p.slice(e,1<u?1-u:void 0)}function kl(e){var r=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&r===13&&(e=13)):e=r,e===10&&(e=13),32<=e||e===13?e:0}function Al(){return!0}function Km(){return!1}function Ie(e){function r(a,u,p,y,S){this._reactName=a,this._targetInst=p,this.type=u,this.nativeEvent=y,this.target=S,this.currentTarget=null;for(var N in e)e.hasOwnProperty(N)&&(a=e[N],this[N]=a?a(y):y[N]);return this.isDefaultPrevented=(y.defaultPrevented!=null?y.defaultPrevented:y.returnValue===!1)?Al:Km,this.isPropagationStopped=Km,this}return g(r.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():typeof a.returnValue!="unknown"&&(a.returnValue=!1),this.isDefaultPrevented=Al)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=Al)},persist:function(){},isPersistent:Al}),r}var Er={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Rl=Ie(Er),ka=g({},Er,{view:0,detail:0}),kE=Ie(ka),vf,xf,Aa,Ol=g({},ka,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Sf,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==Aa&&(Aa&&e.type==="mousemove"?(vf=e.screenX-Aa.screenX,xf=e.screenY-Aa.screenY):xf=vf=0,Aa=e),vf)},movementY:function(e){return"movementY"in e?e.movementY:xf}}),Jm=Ie(Ol),AE=g({},Ol,{dataTransfer:0}),RE=Ie(AE),OE=g({},ka,{relatedTarget:0}),bf=Ie(OE),zE=g({},Er,{animationName:0,elapsedTime:0,pseudoElement:0}),DE=Ie(zE),LE=g({},Er,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),jE=Ie(LE),BE=g({},Er,{data:0}),Wm=Ie(BE),HE={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},PE={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"},IE={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function UE(e){var r=this.nativeEvent;return r.getModifierState?r.getModifierState(e):(e=IE[e])?!!r[e]:!1}function Sf(){return UE}var VE=g({},ka,{key:function(e){if(e.key){var r=HE[e.key]||e.key;if(r!=="Unidentified")return r}return e.type==="keypress"?(e=kl(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?PE[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Sf,charCode:function(e){return e.type==="keypress"?kl(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?kl(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),qE=Ie(VE),FE=g({},Ol,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),tg=Ie(FE),YE=g({},ka,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Sf}),XE=Ie(YE),GE=g({},Er,{propertyName:0,elapsedTime:0,pseudoElement:0}),QE=Ie(GE),$E=g({},Ol,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),ZE=Ie($E),KE=g({},Er,{newState:0,oldState:0}),JE=Ie(KE),WE=[9,13,27,32],wf=li&&"CompositionEvent"in window,Ra=null;li&&"documentMode"in document&&(Ra=document.documentMode);var t_=li&&"TextEvent"in window&&!Ra,eg=li&&(!wf||Ra&&8<Ra&&11>=Ra),ng=" ",ig=!1;function rg(e,r){switch(e){case"keyup":return WE.indexOf(r.keyCode)!==-1;case"keydown":return r.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function og(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var yo=!1;function e_(e,r){switch(e){case"compositionend":return og(r);case"keypress":return r.which!==32?null:(ig=!0,ng);case"textInput":return e=r.data,e===ng&&ig?null:e;default:return null}}function n_(e,r){if(yo)return e==="compositionend"||!wf&&rg(e,r)?(e=Zm(),Nl=yf=Bi=null,yo=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(r.ctrlKey||r.altKey||r.metaKey)||r.ctrlKey&&r.altKey){if(r.char&&1<r.char.length)return r.char;if(r.which)return String.fromCharCode(r.which)}return null;case"compositionend":return eg&&r.locale!=="ko"?null:r.data;default:return null}}var i_={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 ag(e){var r=e&&e.nodeName&&e.nodeName.toLowerCase();return r==="input"?!!i_[e.type]:r==="textarea"}function sg(e,r,a,u){mo?go?go.push(u):go=[u]:mo=u,r=Su(r,"onChange"),0<r.length&&(a=new Rl("onChange","change",null,a,u),e.push({event:a,listeners:r}))}var Oa=null,za=null;function r_(e){q0(e,0)}function zl(e){var r=Di(e);if(Cl(r))return e}function lg(e,r){if(e==="change")return r}var ug=!1;if(li){var Ef;if(li){var _f="oninput"in document;if(!_f){var cg=document.createElement("div");cg.setAttribute("oninput","return;"),_f=typeof cg.oninput=="function"}Ef=_f}else Ef=!1;ug=Ef&&(!document.documentMode||9<document.documentMode)}function fg(){Oa&&(Oa.detachEvent("onpropertychange",dg),za=Oa=null)}function dg(e){if(e.propertyName==="value"&&zl(za)){var r=[];sg(r,za,e,pf(e)),$m(r_,r)}}function o_(e,r,a){e==="focusin"?(fg(),Oa=r,za=a,Oa.attachEvent("onpropertychange",dg)):e==="focusout"&&fg()}function a_(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return zl(za)}function s_(e,r){if(e==="click")return zl(r)}function l_(e,r){if(e==="input"||e==="change")return zl(r)}function u_(e,r){return e===r&&(e!==0||1/e===1/r)||e!==e&&r!==r}var tn=typeof Object.is=="function"?Object.is:u_;function Da(e,r){if(tn(e,r))return!0;if(typeof e!="object"||e===null||typeof r!="object"||r===null)return!1;var a=Object.keys(e),u=Object.keys(r);if(a.length!==u.length)return!1;for(u=0;u<a.length;u++){var p=a[u];if(!ie.call(r,p)||!tn(e[p],r[p]))return!1}return!0}function hg(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function pg(e,r){var a=hg(e);e=0;for(var u;a;){if(a.nodeType===3){if(u=e+a.textContent.length,e<=r&&u>=r)return{node:a,offset:r-e};e=u}t:{for(;a;){if(a.nextSibling){a=a.nextSibling;break t}a=a.parentNode}a=void 0}a=hg(a)}}function mg(e,r){return e&&r?e===r?!0:e&&e.nodeType===3?!1:r&&r.nodeType===3?mg(e,r.parentNode):"contains"in e?e.contains(r):e.compareDocumentPosition?!!(e.compareDocumentPosition(r)&16):!1:!1}function gg(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var r=Sr(e.document);r instanceof e.HTMLIFrameElement;){try{var a=typeof r.contentWindow.location.href=="string"}catch{a=!1}if(a)e=r.contentWindow;else break;r=Sr(e.document)}return r}function Cf(e){var r=e&&e.nodeName&&e.nodeName.toLowerCase();return r&&(r==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||r==="textarea"||e.contentEditable==="true")}var c_=li&&"documentMode"in document&&11>=document.documentMode,vo=null,Tf=null,La=null,Mf=!1;function yg(e,r,a){var u=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;Mf||vo==null||vo!==Sr(u)||(u=vo,"selectionStart"in u&&Cf(u)?u={start:u.selectionStart,end:u.selectionEnd}:(u=(u.ownerDocument&&u.ownerDocument.defaultView||window).getSelection(),u={anchorNode:u.anchorNode,anchorOffset:u.anchorOffset,focusNode:u.focusNode,focusOffset:u.focusOffset}),La&&Da(La,u)||(La=u,u=Su(Tf,"onSelect"),0<u.length&&(r=new Rl("onSelect","select",null,r,a),e.push({event:r,listeners:u}),r.target=vo)))}function _r(e,r){var a={};return a[e.toLowerCase()]=r.toLowerCase(),a["Webkit"+e]="webkit"+r,a["Moz"+e]="moz"+r,a}var xo={animationend:_r("Animation","AnimationEnd"),animationiteration:_r("Animation","AnimationIteration"),animationstart:_r("Animation","AnimationStart"),transitionrun:_r("Transition","TransitionRun"),transitionstart:_r("Transition","TransitionStart"),transitioncancel:_r("Transition","TransitionCancel"),transitionend:_r("Transition","TransitionEnd")},Nf={},vg={};li&&(vg=document.createElement("div").style,"AnimationEvent"in window||(delete xo.animationend.animation,delete xo.animationiteration.animation,delete xo.animationstart.animation),"TransitionEvent"in window||delete xo.transitionend.transition);function Cr(e){if(Nf[e])return Nf[e];if(!xo[e])return e;var r=xo[e],a;for(a in r)if(r.hasOwnProperty(a)&&a in vg)return Nf[e]=r[a];return e}var xg=Cr("animationend"),bg=Cr("animationiteration"),Sg=Cr("animationstart"),f_=Cr("transitionrun"),d_=Cr("transitionstart"),h_=Cr("transitioncancel"),wg=Cr("transitionend"),Eg=new Map,kf="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(" ");kf.push("scrollEnd");function zn(e,r){Eg.set(e,r),oi(r,[e])}var Dl=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var r=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(r))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},vn=[],bo=0,Af=0;function Ll(){for(var e=bo,r=Af=bo=0;r<e;){var a=vn[r];vn[r++]=null;var u=vn[r];vn[r++]=null;var p=vn[r];vn[r++]=null;var y=vn[r];if(vn[r++]=null,u!==null&&p!==null){var S=u.pending;S===null?p.next=p:(p.next=S.next,S.next=p),u.pending=p}y!==0&&_g(a,p,y)}}function jl(e,r,a,u){vn[bo++]=e,vn[bo++]=r,vn[bo++]=a,vn[bo++]=u,Af|=u,e.lanes|=u,e=e.alternate,e!==null&&(e.lanes|=u)}function Rf(e,r,a,u){return jl(e,r,a,u),Bl(e)}function Tr(e,r){return jl(e,null,null,r),Bl(e)}function _g(e,r,a){e.lanes|=a;var u=e.alternate;u!==null&&(u.lanes|=a);for(var p=!1,y=e.return;y!==null;)y.childLanes|=a,u=y.alternate,u!==null&&(u.childLanes|=a),y.tag===22&&(e=y.stateNode,e===null||e._visibility&1||(p=!0)),e=y,y=y.return;return e.tag===3?(y=e.stateNode,p&&r!==null&&(p=31-Yt(a),e=y.hiddenUpdates,u=e[p],u===null?e[p]=[r]:u.push(r),r.lane=a|536870912),y):null}function Bl(e){if(50<is)throw is=0,Id=null,Error(o(185));for(var r=e.return;r!==null;)e=r,r=e.return;return e.tag===3?e.stateNode:null}var So={};function p_(e,r,a,u){this.tag=e,this.key=a,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=r,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=u,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function en(e,r,a,u){return new p_(e,r,a,u)}function Of(e){return e=e.prototype,!(!e||!e.isReactComponent)}function ui(e,r){var a=e.alternate;return a===null?(a=en(e.tag,r,e.key,e.mode),a.elementType=e.elementType,a.type=e.type,a.stateNode=e.stateNode,a.alternate=e,e.alternate=a):(a.pendingProps=r,a.type=e.type,a.flags=0,a.subtreeFlags=0,a.deletions=null),a.flags=e.flags&65011712,a.childLanes=e.childLanes,a.lanes=e.lanes,a.child=e.child,a.memoizedProps=e.memoizedProps,a.memoizedState=e.memoizedState,a.updateQueue=e.updateQueue,r=e.dependencies,a.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext},a.sibling=e.sibling,a.index=e.index,a.ref=e.ref,a.refCleanup=e.refCleanup,a}function Cg(e,r){e.flags&=65011714;var a=e.alternate;return a===null?(e.childLanes=0,e.lanes=r,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=a.childLanes,e.lanes=a.lanes,e.child=a.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=a.memoizedProps,e.memoizedState=a.memoizedState,e.updateQueue=a.updateQueue,e.type=a.type,r=a.dependencies,e.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext}),e}function Hl(e,r,a,u,p,y){var S=0;if(u=e,typeof e=="function")Of(e)&&(S=1);else if(typeof e=="string")S=xC(e,a,it.current)?26:e==="html"||e==="head"||e==="body"?27:5;else t:switch(e){case q:return e=en(31,a,r,p),e.elementType=q,e.lanes=y,e;case _:return Mr(a.children,p,y,r);case T:S=8,p|=24;break;case C:return e=en(12,a,r,p|2),e.elementType=C,e.lanes=y,e;case H:return e=en(13,a,r,p),e.elementType=H,e.lanes=y,e;case R:return e=en(19,a,r,p),e.elementType=R,e.lanes=y,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case E:S=10;break t;case z:S=9;break t;case M:S=11;break t;case B:S=14;break t;case P:S=16,u=null;break t}S=29,a=Error(o(130,e===null?"null":typeof e,"")),u=null}return r=en(S,a,r,p),r.elementType=e,r.type=u,r.lanes=y,r}function Mr(e,r,a,u){return e=en(7,e,u,r),e.lanes=a,e}function zf(e,r,a){return e=en(6,e,null,r),e.lanes=a,e}function Tg(e){var r=en(18,null,null,0);return r.stateNode=e,r}function Df(e,r,a){return r=en(4,e.children!==null?e.children:[],e.key,r),r.lanes=a,r.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},r}var Mg=new WeakMap;function xn(e,r){if(typeof e=="object"&&e!==null){var a=Mg.get(e);return a!==void 0?a:(r={value:e,source:r,stack:Ee(r)},Mg.set(e,r),r)}return{value:e,source:r,stack:Ee(r)}}var wo=[],Eo=0,Pl=null,ja=0,bn=[],Sn=0,Hi=null,Fn=1,Yn="";function ci(e,r){wo[Eo++]=ja,wo[Eo++]=Pl,Pl=e,ja=r}function Ng(e,r,a){bn[Sn++]=Fn,bn[Sn++]=Yn,bn[Sn++]=Hi,Hi=e;var u=Fn;e=Yn;var p=32-Yt(u)-1;u&=~(1<<p),a+=1;var y=32-Yt(r)+p;if(30<y){var S=p-p%5;y=(u&(1<<S)-1).toString(32),u>>=S,p-=S,Fn=1<<32-Yt(r)+p|a<<p|u,Yn=y+e}else Fn=1<<y|a<<p|u,Yn=e}function Lf(e){e.return!==null&&(ci(e,1),Ng(e,1,0))}function jf(e){for(;e===Pl;)Pl=wo[--Eo],wo[Eo]=null,ja=wo[--Eo],wo[Eo]=null;for(;e===Hi;)Hi=bn[--Sn],bn[Sn]=null,Yn=bn[--Sn],bn[Sn]=null,Fn=bn[--Sn],bn[Sn]=null}function kg(e,r){bn[Sn++]=Fn,bn[Sn++]=Yn,bn[Sn++]=Hi,Fn=r.id,Yn=r.overflow,Hi=e}var Ce=null,ee=null,Bt=!1,Pi=null,wn=!1,Bf=Error(o(519));function Ii(e){var r=Error(o(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Ba(xn(r,e)),Bf}function Ag(e){var r=e.stateNode,a=e.type,u=e.memoizedProps;switch(r[be]=e,r[Oe]=u,a){case"dialog":zt("cancel",r),zt("close",r);break;case"iframe":case"object":case"embed":zt("load",r);break;case"video":case"audio":for(a=0;a<os.length;a++)zt(os[a],r);break;case"source":zt("error",r);break;case"img":case"image":case"link":zt("error",r),zt("load",r);break;case"details":zt("toggle",r);break;case"input":zt("invalid",r),Tl(r,u.value,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name,!0);break;case"select":zt("invalid",r);break;case"textarea":zt("invalid",r),Ym(r,u.value,u.defaultValue,u.children)}a=u.children,typeof a!="string"&&typeof a!="number"&&typeof a!="bigint"||r.textContent===""+a||u.suppressHydrationWarning===!0||G0(r.textContent,a)?(u.popover!=null&&(zt("beforetoggle",r),zt("toggle",r)),u.onScroll!=null&&zt("scroll",r),u.onScrollEnd!=null&&zt("scrollend",r),u.onClick!=null&&(r.onclick=si),r=!0):r=!1,r||Ii(e,!0)}function Rg(e){for(Ce=e.return;Ce;)switch(Ce.tag){case 5:case 31:case 13:wn=!1;return;case 27:case 3:wn=!0;return;default:Ce=Ce.return}}function _o(e){if(e!==Ce)return!1;if(!Bt)return Rg(e),Bt=!0,!1;var r=e.tag,a;if((a=r!==3&&r!==27)&&((a=r===5)&&(a=e.type,a=!(a!=="form"&&a!=="button")||eh(e.type,e.memoizedProps)),a=!a),a&&ee&&Ii(e),Rg(e),r===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));ee=nv(e)}else if(r===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));ee=nv(e)}else r===27?(r=ee,tr(e.type)?(e=ah,ah=null,ee=e):ee=r):ee=Ce?_n(e.stateNode.nextSibling):null;return!0}function Nr(){ee=Ce=null,Bt=!1}function Hf(){var e=Pi;return e!==null&&(Fe===null?Fe=e:Fe.push.apply(Fe,e),Pi=null),e}function Ba(e){Pi===null?Pi=[e]:Pi.push(e)}var Pf=L(null),kr=null,fi=null;function Ui(e,r,a){A(Pf,r._currentValue),r._currentValue=a}function di(e){e._currentValue=Pf.current,X(Pf)}function If(e,r,a){for(;e!==null;){var u=e.alternate;if((e.childLanes&r)!==r?(e.childLanes|=r,u!==null&&(u.childLanes|=r)):u!==null&&(u.childLanes&r)!==r&&(u.childLanes|=r),e===a)break;e=e.return}}function Uf(e,r,a,u){var p=e.child;for(p!==null&&(p.return=e);p!==null;){var y=p.dependencies;if(y!==null){var S=p.child;y=y.firstContext;t:for(;y!==null;){var N=y;y=p;for(var Y=0;Y<r.length;Y++)if(N.context===r[Y]){y.lanes|=a,N=y.alternate,N!==null&&(N.lanes|=a),If(y.return,a,e),u||(S=null);break t}y=N.next}}else if(p.tag===18){if(S=p.return,S===null)throw Error(o(341));S.lanes|=a,y=S.alternate,y!==null&&(y.lanes|=a),If(S,a,e),S=null}else S=p.child;if(S!==null)S.return=p;else for(S=p;S!==null;){if(S===e){S=null;break}if(p=S.sibling,p!==null){p.return=S.return,S=p;break}S=S.return}p=S}}function Co(e,r,a,u){e=null;for(var p=r,y=!1;p!==null;){if(!y){if((p.flags&524288)!==0)y=!0;else if((p.flags&262144)!==0)break}if(p.tag===10){var S=p.alternate;if(S===null)throw Error(o(387));if(S=S.memoizedProps,S!==null){var N=p.type;tn(p.pendingProps.value,S.value)||(e!==null?e.push(N):e=[N])}}else if(p===dt.current){if(S=p.alternate,S===null)throw Error(o(387));S.memoizedState.memoizedState!==p.memoizedState.memoizedState&&(e!==null?e.push(cs):e=[cs])}p=p.return}e!==null&&Uf(r,e,a,u),r.flags|=262144}function Il(e){for(e=e.firstContext;e!==null;){if(!tn(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Ar(e){kr=e,fi=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Te(e){return Og(kr,e)}function Ul(e,r){return kr===null&&Ar(e),Og(e,r)}function Og(e,r){var a=r._currentValue;if(r={context:r,memoizedValue:a,next:null},fi===null){if(e===null)throw Error(o(308));fi=r,e.dependencies={lanes:0,firstContext:r},e.flags|=524288}else fi=fi.next=r;return a}var m_=typeof AbortController<"u"?AbortController:function(){var e=[],r=this.signal={aborted:!1,addEventListener:function(a,u){e.push(u)}};this.abort=function(){r.aborted=!0,e.forEach(function(a){return a()})}},g_=t.unstable_scheduleCallback,y_=t.unstable_NormalPriority,pe={$$typeof:E,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Vf(){return{controller:new m_,data:new Map,refCount:0}}function Ha(e){e.refCount--,e.refCount===0&&g_(y_,function(){e.controller.abort()})}var Pa=null,qf=0,To=0,Mo=null;function v_(e,r){if(Pa===null){var a=Pa=[];qf=0,To=Xd(),Mo={status:"pending",value:void 0,then:function(u){a.push(u)}}}return qf++,r.then(zg,zg),r}function zg(){if(--qf===0&&Pa!==null){Mo!==null&&(Mo.status="fulfilled");var e=Pa;Pa=null,To=0,Mo=null;for(var r=0;r<e.length;r++)(0,e[r])()}}function x_(e,r){var a=[],u={status:"pending",value:null,reason:null,then:function(p){a.push(p)}};return e.then(function(){u.status="fulfilled",u.value=r;for(var p=0;p<a.length;p++)(0,a[p])(r)},function(p){for(u.status="rejected",u.reason=p,p=0;p<a.length;p++)(0,a[p])(void 0)}),u}var Dg=O.S;O.S=function(e,r){y0=ue(),typeof r=="object"&&r!==null&&typeof r.then=="function"&&v_(e,r),Dg!==null&&Dg(e,r)};var Rr=L(null);function Ff(){var e=Rr.current;return e!==null?e:Jt.pooledCache}function Vl(e,r){r===null?A(Rr,Rr.current):A(Rr,r.pool)}function Lg(){var e=Ff();return e===null?null:{parent:pe._currentValue,pool:e}}var No=Error(o(460)),Yf=Error(o(474)),ql=Error(o(542)),Fl={then:function(){}};function jg(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Bg(e,r,a){switch(a=e[a],a===void 0?e.push(r):a!==r&&(r.then(si,si),r=a),r.status){case"fulfilled":return r.value;case"rejected":throw e=r.reason,Pg(e),e;default:if(typeof r.status=="string")r.then(si,si);else{if(e=Jt,e!==null&&100<e.shellSuspendCounter)throw Error(o(482));e=r,e.status="pending",e.then(function(u){if(r.status==="pending"){var p=r;p.status="fulfilled",p.value=u}},function(u){if(r.status==="pending"){var p=r;p.status="rejected",p.reason=u}})}switch(r.status){case"fulfilled":return r.value;case"rejected":throw e=r.reason,Pg(e),e}throw zr=r,No}}function Or(e){try{var r=e._init;return r(e._payload)}catch(a){throw a!==null&&typeof a=="object"&&typeof a.then=="function"?(zr=a,No):a}}var zr=null;function Hg(){if(zr===null)throw Error(o(459));var e=zr;return zr=null,e}function Pg(e){if(e===No||e===ql)throw Error(o(483))}var ko=null,Ia=0;function Yl(e){var r=Ia;return Ia+=1,ko===null&&(ko=[]),Bg(ko,e,r)}function Ua(e,r){r=r.props.ref,e.ref=r!==void 0?r:null}function Xl(e,r){throw r.$$typeof===v?Error(o(525)):(e=Object.prototype.toString.call(r),Error(o(31,e==="[object Object]"?"object with keys {"+Object.keys(r).join(", ")+"}":e)))}function Ig(e){function r(Z,Q){if(e){var W=Z.deletions;W===null?(Z.deletions=[Q],Z.flags|=16):W.push(Q)}}function a(Z,Q){if(!e)return null;for(;Q!==null;)r(Z,Q),Q=Q.sibling;return null}function u(Z){for(var Q=new Map;Z!==null;)Z.key!==null?Q.set(Z.key,Z):Q.set(Z.index,Z),Z=Z.sibling;return Q}function p(Z,Q){return Z=ui(Z,Q),Z.index=0,Z.sibling=null,Z}function y(Z,Q,W){return Z.index=W,e?(W=Z.alternate,W!==null?(W=W.index,W<Q?(Z.flags|=67108866,Q):W):(Z.flags|=67108866,Q)):(Z.flags|=1048576,Q)}function S(Z){return e&&Z.alternate===null&&(Z.flags|=67108866),Z}function N(Z,Q,W,at){return Q===null||Q.tag!==6?(Q=zf(W,Z.mode,at),Q.return=Z,Q):(Q=p(Q,W),Q.return=Z,Q)}function Y(Z,Q,W,at){var xt=W.type;return xt===_?ot(Z,Q,W.props.children,at,W.key):Q!==null&&(Q.elementType===xt||typeof xt=="object"&&xt!==null&&xt.$$typeof===P&&Or(xt)===Q.type)?(Q=p(Q,W.props),Ua(Q,W),Q.return=Z,Q):(Q=Hl(W.type,W.key,W.props,null,Z.mode,at),Ua(Q,W),Q.return=Z,Q)}function tt(Z,Q,W,at){return Q===null||Q.tag!==4||Q.stateNode.containerInfo!==W.containerInfo||Q.stateNode.implementation!==W.implementation?(Q=Df(W,Z.mode,at),Q.return=Z,Q):(Q=p(Q,W.children||[]),Q.return=Z,Q)}function ot(Z,Q,W,at,xt){return Q===null||Q.tag!==7?(Q=Mr(W,Z.mode,at,xt),Q.return=Z,Q):(Q=p(Q,W),Q.return=Z,Q)}function st(Z,Q,W){if(typeof Q=="string"&&Q!==""||typeof Q=="number"||typeof Q=="bigint")return Q=zf(""+Q,Z.mode,W),Q.return=Z,Q;if(typeof Q=="object"&&Q!==null){switch(Q.$$typeof){case x:return W=Hl(Q.type,Q.key,Q.props,null,Z.mode,W),Ua(W,Q),W.return=Z,W;case b:return Q=Df(Q,Z.mode,W),Q.return=Z,Q;case P:return Q=Or(Q),st(Z,Q,W)}if(I(Q)||V(Q))return Q=Mr(Q,Z.mode,W,null),Q.return=Z,Q;if(typeof Q.then=="function")return st(Z,Yl(Q),W);if(Q.$$typeof===E)return st(Z,Ul(Z,Q),W);Xl(Z,Q)}return null}function nt(Z,Q,W,at){var xt=Q!==null?Q.key:null;if(typeof W=="string"&&W!==""||typeof W=="number"||typeof W=="bigint")return xt!==null?null:N(Z,Q,""+W,at);if(typeof W=="object"&&W!==null){switch(W.$$typeof){case x:return W.key===xt?Y(Z,Q,W,at):null;case b:return W.key===xt?tt(Z,Q,W,at):null;case P:return W=Or(W),nt(Z,Q,W,at)}if(I(W)||V(W))return xt!==null?null:ot(Z,Q,W,at,null);if(typeof W.then=="function")return nt(Z,Q,Yl(W),at);if(W.$$typeof===E)return nt(Z,Q,Ul(Z,W),at);Xl(Z,W)}return null}function rt(Z,Q,W,at,xt){if(typeof at=="string"&&at!==""||typeof at=="number"||typeof at=="bigint")return Z=Z.get(W)||null,N(Q,Z,""+at,xt);if(typeof at=="object"&&at!==null){switch(at.$$typeof){case x:return Z=Z.get(at.key===null?W:at.key)||null,Y(Q,Z,at,xt);case b:return Z=Z.get(at.key===null?W:at.key)||null,tt(Q,Z,at,xt);case P:return at=Or(at),rt(Z,Q,W,at,xt)}if(I(at)||V(at))return Z=Z.get(W)||null,ot(Q,Z,at,xt,null);if(typeof at.then=="function")return rt(Z,Q,W,Yl(at),xt);if(at.$$typeof===E)return rt(Z,Q,W,Ul(Q,at),xt);Xl(Q,at)}return null}function mt(Z,Q,W,at){for(var xt=null,Ut=null,yt=Q,kt=Q=0,Lt=null;yt!==null&&kt<W.length;kt++){yt.index>kt?(Lt=yt,yt=null):Lt=yt.sibling;var Vt=nt(Z,yt,W[kt],at);if(Vt===null){yt===null&&(yt=Lt);break}e&&yt&&Vt.alternate===null&&r(Z,yt),Q=y(Vt,Q,kt),Ut===null?xt=Vt:Ut.sibling=Vt,Ut=Vt,yt=Lt}if(kt===W.length)return a(Z,yt),Bt&&ci(Z,kt),xt;if(yt===null){for(;kt<W.length;kt++)yt=st(Z,W[kt],at),yt!==null&&(Q=y(yt,Q,kt),Ut===null?xt=yt:Ut.sibling=yt,Ut=yt);return Bt&&ci(Z,kt),xt}for(yt=u(yt);kt<W.length;kt++)Lt=rt(yt,Z,kt,W[kt],at),Lt!==null&&(e&&Lt.alternate!==null&&yt.delete(Lt.key===null?kt:Lt.key),Q=y(Lt,Q,kt),Ut===null?xt=Lt:Ut.sibling=Lt,Ut=Lt);return e&&yt.forEach(function(or){return r(Z,or)}),Bt&&ci(Z,kt),xt}function _t(Z,Q,W,at){if(W==null)throw Error(o(151));for(var xt=null,Ut=null,yt=Q,kt=Q=0,Lt=null,Vt=W.next();yt!==null&&!Vt.done;kt++,Vt=W.next()){yt.index>kt?(Lt=yt,yt=null):Lt=yt.sibling;var or=nt(Z,yt,Vt.value,at);if(or===null){yt===null&&(yt=Lt);break}e&&yt&&or.alternate===null&&r(Z,yt),Q=y(or,Q,kt),Ut===null?xt=or:Ut.sibling=or,Ut=or,yt=Lt}if(Vt.done)return a(Z,yt),Bt&&ci(Z,kt),xt;if(yt===null){for(;!Vt.done;kt++,Vt=W.next())Vt=st(Z,Vt.value,at),Vt!==null&&(Q=y(Vt,Q,kt),Ut===null?xt=Vt:Ut.sibling=Vt,Ut=Vt);return Bt&&ci(Z,kt),xt}for(yt=u(yt);!Vt.done;kt++,Vt=W.next())Vt=rt(yt,Z,kt,Vt.value,at),Vt!==null&&(e&&Vt.alternate!==null&&yt.delete(Vt.key===null?kt:Vt.key),Q=y(Vt,Q,kt),Ut===null?xt=Vt:Ut.sibling=Vt,Ut=Vt);return e&&yt.forEach(function(AC){return r(Z,AC)}),Bt&&ci(Z,kt),xt}function Kt(Z,Q,W,at){if(typeof W=="object"&&W!==null&&W.type===_&&W.key===null&&(W=W.props.children),typeof W=="object"&&W!==null){switch(W.$$typeof){case x:t:{for(var xt=W.key;Q!==null;){if(Q.key===xt){if(xt=W.type,xt===_){if(Q.tag===7){a(Z,Q.sibling),at=p(Q,W.props.children),at.return=Z,Z=at;break t}}else if(Q.elementType===xt||typeof xt=="object"&&xt!==null&&xt.$$typeof===P&&Or(xt)===Q.type){a(Z,Q.sibling),at=p(Q,W.props),Ua(at,W),at.return=Z,Z=at;break t}a(Z,Q);break}else r(Z,Q);Q=Q.sibling}W.type===_?(at=Mr(W.props.children,Z.mode,at,W.key),at.return=Z,Z=at):(at=Hl(W.type,W.key,W.props,null,Z.mode,at),Ua(at,W),at.return=Z,Z=at)}return S(Z);case b:t:{for(xt=W.key;Q!==null;){if(Q.key===xt)if(Q.tag===4&&Q.stateNode.containerInfo===W.containerInfo&&Q.stateNode.implementation===W.implementation){a(Z,Q.sibling),at=p(Q,W.children||[]),at.return=Z,Z=at;break t}else{a(Z,Q);break}else r(Z,Q);Q=Q.sibling}at=Df(W,Z.mode,at),at.return=Z,Z=at}return S(Z);case P:return W=Or(W),Kt(Z,Q,W,at)}if(I(W))return mt(Z,Q,W,at);if(V(W)){if(xt=V(W),typeof xt!="function")throw Error(o(150));return W=xt.call(W),_t(Z,Q,W,at)}if(typeof W.then=="function")return Kt(Z,Q,Yl(W),at);if(W.$$typeof===E)return Kt(Z,Q,Ul(Z,W),at);Xl(Z,W)}return typeof W=="string"&&W!==""||typeof W=="number"||typeof W=="bigint"?(W=""+W,Q!==null&&Q.tag===6?(a(Z,Q.sibling),at=p(Q,W),at.return=Z,Z=at):(a(Z,Q),at=zf(W,Z.mode,at),at.return=Z,Z=at),S(Z)):a(Z,Q)}return function(Z,Q,W,at){try{Ia=0;var xt=Kt(Z,Q,W,at);return ko=null,xt}catch(yt){if(yt===No||yt===ql)throw yt;var Ut=en(29,yt,null,Z.mode);return Ut.lanes=at,Ut.return=Z,Ut}}}var Dr=Ig(!0),Ug=Ig(!1),Vi=!1;function Xf(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Gf(e,r){e=e.updateQueue,r.updateQueue===e&&(r.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function qi(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Fi(e,r,a){var u=e.updateQueue;if(u===null)return null;if(u=u.shared,(qt&2)!==0){var p=u.pending;return p===null?r.next=r:(r.next=p.next,p.next=r),u.pending=r,r=Bl(e),_g(e,null,a),r}return jl(e,u,r,a),Bl(e)}function Va(e,r,a){if(r=r.updateQueue,r!==null&&(r=r.shared,(a&4194048)!==0)){var u=r.lanes;u&=e.pendingLanes,a|=u,r.lanes=a,ml(e,a)}}function Qf(e,r){var a=e.updateQueue,u=e.alternate;if(u!==null&&(u=u.updateQueue,a===u)){var p=null,y=null;if(a=a.firstBaseUpdate,a!==null){do{var S={lane:a.lane,tag:a.tag,payload:a.payload,callback:null,next:null};y===null?p=y=S:y=y.next=S,a=a.next}while(a!==null);y===null?p=y=r:y=y.next=r}else p=y=r;a={baseState:u.baseState,firstBaseUpdate:p,lastBaseUpdate:y,shared:u.shared,callbacks:u.callbacks},e.updateQueue=a;return}e=a.lastBaseUpdate,e===null?a.firstBaseUpdate=r:e.next=r,a.lastBaseUpdate=r}var $f=!1;function qa(){if($f){var e=Mo;if(e!==null)throw e}}function Fa(e,r,a,u){$f=!1;var p=e.updateQueue;Vi=!1;var y=p.firstBaseUpdate,S=p.lastBaseUpdate,N=p.shared.pending;if(N!==null){p.shared.pending=null;var Y=N,tt=Y.next;Y.next=null,S===null?y=tt:S.next=tt,S=Y;var ot=e.alternate;ot!==null&&(ot=ot.updateQueue,N=ot.lastBaseUpdate,N!==S&&(N===null?ot.firstBaseUpdate=tt:N.next=tt,ot.lastBaseUpdate=Y))}if(y!==null){var st=p.baseState;S=0,ot=tt=Y=null,N=y;do{var nt=N.lane&-536870913,rt=nt!==N.lane;if(rt?(Dt&nt)===nt:(u&nt)===nt){nt!==0&&nt===To&&($f=!0),ot!==null&&(ot=ot.next={lane:0,tag:N.tag,payload:N.payload,callback:null,next:null});t:{var mt=e,_t=N;nt=r;var Kt=a;switch(_t.tag){case 1:if(mt=_t.payload,typeof mt=="function"){st=mt.call(Kt,st,nt);break t}st=mt;break t;case 3:mt.flags=mt.flags&-65537|128;case 0:if(mt=_t.payload,nt=typeof mt=="function"?mt.call(Kt,st,nt):mt,nt==null)break t;st=g({},st,nt);break t;case 2:Vi=!0}}nt=N.callback,nt!==null&&(e.flags|=64,rt&&(e.flags|=8192),rt=p.callbacks,rt===null?p.callbacks=[nt]:rt.push(nt))}else rt={lane:nt,tag:N.tag,payload:N.payload,callback:N.callback,next:null},ot===null?(tt=ot=rt,Y=st):ot=ot.next=rt,S|=nt;if(N=N.next,N===null){if(N=p.shared.pending,N===null)break;rt=N,N=rt.next,rt.next=null,p.lastBaseUpdate=rt,p.shared.pending=null}}while(!0);ot===null&&(Y=st),p.baseState=Y,p.firstBaseUpdate=tt,p.lastBaseUpdate=ot,y===null&&(p.shared.lanes=0),$i|=S,e.lanes=S,e.memoizedState=st}}function Vg(e,r){if(typeof e!="function")throw Error(o(191,e));e.call(r)}function qg(e,r){var a=e.callbacks;if(a!==null)for(e.callbacks=null,e=0;e<a.length;e++)Vg(a[e],r)}var Ao=L(null),Gl=L(0);function Fg(e,r){e=Si,A(Gl,e),A(Ao,r),Si=e|r.baseLanes}function Zf(){A(Gl,Si),A(Ao,Ao.current)}function Kf(){Si=Gl.current,X(Ao),X(Gl)}var nn=L(null),En=null;function Yi(e){var r=e.alternate;A(fe,fe.current&1),A(nn,e),En===null&&(r===null||Ao.current!==null||r.memoizedState!==null)&&(En=e)}function Jf(e){A(fe,fe.current),A(nn,e),En===null&&(En=e)}function Yg(e){e.tag===22?(A(fe,fe.current),A(nn,e),En===null&&(En=e)):Xi()}function Xi(){A(fe,fe.current),A(nn,nn.current)}function rn(e){X(nn),En===e&&(En=null),X(fe)}var fe=L(0);function Ql(e){for(var r=e;r!==null;){if(r.tag===13){var a=r.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||rh(a)||oh(a)))return r}else if(r.tag===19&&(r.memoizedProps.revealOrder==="forwards"||r.memoizedProps.revealOrder==="backwards"||r.memoizedProps.revealOrder==="unstable_legacy-backwards"||r.memoizedProps.revealOrder==="together")){if((r.flags&128)!==0)return r}else if(r.child!==null){r.child.return=r,r=r.child;continue}if(r===e)break;for(;r.sibling===null;){if(r.return===null||r.return===e)return null;r=r.return}r.sibling.return=r.return,r=r.sibling}return null}var hi=0,Nt=null,$t=null,me=null,$l=!1,Ro=!1,Lr=!1,Zl=0,Ya=0,Oo=null,b_=0;function se(){throw Error(o(321))}function Wf(e,r){if(r===null)return!1;for(var a=0;a<r.length&&a<e.length;a++)if(!tn(e[a],r[a]))return!1;return!0}function td(e,r,a,u,p,y){return hi=y,Nt=r,r.memoizedState=null,r.updateQueue=null,r.lanes=0,O.H=e===null||e.memoizedState===null?Ny:md,Lr=!1,y=a(u,p),Lr=!1,Ro&&(y=Gg(r,a,u,p)),Xg(e),y}function Xg(e){O.H=Qa;var r=$t!==null&&$t.next!==null;if(hi=0,me=$t=Nt=null,$l=!1,Ya=0,Oo=null,r)throw Error(o(300));e===null||ge||(e=e.dependencies,e!==null&&Il(e)&&(ge=!0))}function Gg(e,r,a,u){Nt=e;var p=0;do{if(Ro&&(Oo=null),Ya=0,Ro=!1,25<=p)throw Error(o(301));if(p+=1,me=$t=null,e.updateQueue!=null){var y=e.updateQueue;y.lastEffect=null,y.events=null,y.stores=null,y.memoCache!=null&&(y.memoCache.index=0)}O.H=ky,y=r(a,u)}while(Ro);return y}function S_(){var e=O.H,r=e.useState()[0];return r=typeof r.then=="function"?Xa(r):r,e=e.useState()[0],($t!==null?$t.memoizedState:null)!==e&&(Nt.flags|=1024),r}function ed(){var e=Zl!==0;return Zl=0,e}function nd(e,r,a){r.updateQueue=e.updateQueue,r.flags&=-2053,e.lanes&=~a}function id(e){if($l){for(e=e.memoizedState;e!==null;){var r=e.queue;r!==null&&(r.pending=null),e=e.next}$l=!1}hi=0,me=$t=Nt=null,Ro=!1,Ya=Zl=0,Oo=null}function Be(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return me===null?Nt.memoizedState=me=e:me=me.next=e,me}function de(){if($t===null){var e=Nt.alternate;e=e!==null?e.memoizedState:null}else e=$t.next;var r=me===null?Nt.memoizedState:me.next;if(r!==null)me=r,$t=e;else{if(e===null)throw Nt.alternate===null?Error(o(467)):Error(o(310));$t=e,e={memoizedState:$t.memoizedState,baseState:$t.baseState,baseQueue:$t.baseQueue,queue:$t.queue,next:null},me===null?Nt.memoizedState=me=e:me=me.next=e}return me}function Kl(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Xa(e){var r=Ya;return Ya+=1,Oo===null&&(Oo=[]),e=Bg(Oo,e,r),r=Nt,(me===null?r.memoizedState:me.next)===null&&(r=r.alternate,O.H=r===null||r.memoizedState===null?Ny:md),e}function Jl(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Xa(e);if(e.$$typeof===E)return Te(e)}throw Error(o(438,String(e)))}function rd(e){var r=null,a=Nt.updateQueue;if(a!==null&&(r=a.memoCache),r==null){var u=Nt.alternate;u!==null&&(u=u.updateQueue,u!==null&&(u=u.memoCache,u!=null&&(r={data:u.data.map(function(p){return p.slice()}),index:0})))}if(r==null&&(r={data:[],index:0}),a===null&&(a=Kl(),Nt.updateQueue=a),a.memoCache=r,a=r.data[r.index],a===void 0)for(a=r.data[r.index]=Array(e),u=0;u<e;u++)a[u]=J;return r.index++,a}function pi(e,r){return typeof r=="function"?r(e):r}function Wl(e){var r=de();return od(r,$t,e)}function od(e,r,a){var u=e.queue;if(u===null)throw Error(o(311));u.lastRenderedReducer=a;var p=e.baseQueue,y=u.pending;if(y!==null){if(p!==null){var S=p.next;p.next=y.next,y.next=S}r.baseQueue=p=y,u.pending=null}if(y=e.baseState,p===null)e.memoizedState=y;else{r=p.next;var N=S=null,Y=null,tt=r,ot=!1;do{var st=tt.lane&-536870913;if(st!==tt.lane?(Dt&st)===st:(hi&st)===st){var nt=tt.revertLane;if(nt===0)Y!==null&&(Y=Y.next={lane:0,revertLane:0,gesture:null,action:tt.action,hasEagerState:tt.hasEagerState,eagerState:tt.eagerState,next:null}),st===To&&(ot=!0);else if((hi&nt)===nt){tt=tt.next,nt===To&&(ot=!0);continue}else st={lane:0,revertLane:tt.revertLane,gesture:null,action:tt.action,hasEagerState:tt.hasEagerState,eagerState:tt.eagerState,next:null},Y===null?(N=Y=st,S=y):Y=Y.next=st,Nt.lanes|=nt,$i|=nt;st=tt.action,Lr&&a(y,st),y=tt.hasEagerState?tt.eagerState:a(y,st)}else nt={lane:st,revertLane:tt.revertLane,gesture:tt.gesture,action:tt.action,hasEagerState:tt.hasEagerState,eagerState:tt.eagerState,next:null},Y===null?(N=Y=nt,S=y):Y=Y.next=nt,Nt.lanes|=st,$i|=st;tt=tt.next}while(tt!==null&&tt!==r);if(Y===null?S=y:Y.next=N,!tn(y,e.memoizedState)&&(ge=!0,ot&&(a=Mo,a!==null)))throw a;e.memoizedState=y,e.baseState=S,e.baseQueue=Y,u.lastRenderedState=y}return p===null&&(u.lanes=0),[e.memoizedState,u.dispatch]}function ad(e){var r=de(),a=r.queue;if(a===null)throw Error(o(311));a.lastRenderedReducer=e;var u=a.dispatch,p=a.pending,y=r.memoizedState;if(p!==null){a.pending=null;var S=p=p.next;do y=e(y,S.action),S=S.next;while(S!==p);tn(y,r.memoizedState)||(ge=!0),r.memoizedState=y,r.baseQueue===null&&(r.baseState=y),a.lastRenderedState=y}return[y,u]}function Qg(e,r,a){var u=Nt,p=de(),y=Bt;if(y){if(a===void 0)throw Error(o(407));a=a()}else a=r();var S=!tn(($t||p).memoizedState,a);if(S&&(p.memoizedState=a,ge=!0),p=p.queue,ud(Kg.bind(null,u,p,e),[e]),p.getSnapshot!==r||S||me!==null&&me.memoizedState.tag&1){if(u.flags|=2048,zo(9,{destroy:void 0},Zg.bind(null,u,p,a,r),null),Jt===null)throw Error(o(349));y||(hi&127)!==0||$g(u,r,a)}return a}function $g(e,r,a){e.flags|=16384,e={getSnapshot:r,value:a},r=Nt.updateQueue,r===null?(r=Kl(),Nt.updateQueue=r,r.stores=[e]):(a=r.stores,a===null?r.stores=[e]:a.push(e))}function Zg(e,r,a,u){r.value=a,r.getSnapshot=u,Jg(r)&&Wg(e)}function Kg(e,r,a){return a(function(){Jg(r)&&Wg(e)})}function Jg(e){var r=e.getSnapshot;e=e.value;try{var a=r();return!tn(e,a)}catch{return!0}}function Wg(e){var r=Tr(e,2);r!==null&&Ye(r,e,2)}function sd(e){var r=Be();if(typeof e=="function"){var a=e;if(e=a(),Lr){Re(!0);try{a()}finally{Re(!1)}}}return r.memoizedState=r.baseState=e,r.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:pi,lastRenderedState:e},r}function ty(e,r,a,u){return e.baseState=a,od(e,$t,typeof u=="function"?u:pi)}function w_(e,r,a,u,p){if(nu(e))throw Error(o(485));if(e=r.action,e!==null){var y={payload:p,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(S){y.listeners.push(S)}};O.T!==null?a(!0):y.isTransition=!1,u(y),a=r.pending,a===null?(y.next=r.pending=y,ey(r,y)):(y.next=a.next,r.pending=a.next=y)}}function ey(e,r){var a=r.action,u=r.payload,p=e.state;if(r.isTransition){var y=O.T,S={};O.T=S;try{var N=a(p,u),Y=O.S;Y!==null&&Y(S,N),ny(e,r,N)}catch(tt){ld(e,r,tt)}finally{y!==null&&S.types!==null&&(y.types=S.types),O.T=y}}else try{y=a(p,u),ny(e,r,y)}catch(tt){ld(e,r,tt)}}function ny(e,r,a){a!==null&&typeof a=="object"&&typeof a.then=="function"?a.then(function(u){iy(e,r,u)},function(u){return ld(e,r,u)}):iy(e,r,a)}function iy(e,r,a){r.status="fulfilled",r.value=a,ry(r),e.state=a,r=e.pending,r!==null&&(a=r.next,a===r?e.pending=null:(a=a.next,r.next=a,ey(e,a)))}function ld(e,r,a){var u=e.pending;if(e.pending=null,u!==null){u=u.next;do r.status="rejected",r.reason=a,ry(r),r=r.next;while(r!==u)}e.action=null}function ry(e){e=e.listeners;for(var r=0;r<e.length;r++)(0,e[r])()}function oy(e,r){return r}function ay(e,r){if(Bt){var a=Jt.formState;if(a!==null){t:{var u=Nt;if(Bt){if(ee){e:{for(var p=ee,y=wn;p.nodeType!==8;){if(!y){p=null;break e}if(p=_n(p.nextSibling),p===null){p=null;break e}}y=p.data,p=y==="F!"||y==="F"?p:null}if(p){ee=_n(p.nextSibling),u=p.data==="F!";break t}}Ii(u)}u=!1}u&&(r=a[0])}}return a=Be(),a.memoizedState=a.baseState=r,u={pending:null,lanes:0,dispatch:null,lastRenderedReducer:oy,lastRenderedState:r},a.queue=u,a=Cy.bind(null,Nt,u),u.dispatch=a,u=sd(!1),y=pd.bind(null,Nt,!1,u.queue),u=Be(),p={state:r,dispatch:null,action:e,pending:null},u.queue=p,a=w_.bind(null,Nt,p,y,a),p.dispatch=a,u.memoizedState=e,[r,a,!1]}function sy(e){var r=de();return ly(r,$t,e)}function ly(e,r,a){if(r=od(e,r,oy)[0],e=Wl(pi)[0],typeof r=="object"&&r!==null&&typeof r.then=="function")try{var u=Xa(r)}catch(S){throw S===No?ql:S}else u=r;r=de();var p=r.queue,y=p.dispatch;return a!==r.memoizedState&&(Nt.flags|=2048,zo(9,{destroy:void 0},E_.bind(null,p,a),null)),[u,y,e]}function E_(e,r){e.action=r}function uy(e){var r=de(),a=$t;if(a!==null)return ly(r,a,e);de(),r=r.memoizedState,a=de();var u=a.queue.dispatch;return a.memoizedState=e,[r,u,!1]}function zo(e,r,a,u){return e={tag:e,create:a,deps:u,inst:r,next:null},r=Nt.updateQueue,r===null&&(r=Kl(),Nt.updateQueue=r),a=r.lastEffect,a===null?r.lastEffect=e.next=e:(u=a.next,a.next=e,e.next=u,r.lastEffect=e),e}function cy(){return de().memoizedState}function tu(e,r,a,u){var p=Be();Nt.flags|=e,p.memoizedState=zo(1|r,{destroy:void 0},a,u===void 0?null:u)}function eu(e,r,a,u){var p=de();u=u===void 0?null:u;var y=p.memoizedState.inst;$t!==null&&u!==null&&Wf(u,$t.memoizedState.deps)?p.memoizedState=zo(r,y,a,u):(Nt.flags|=e,p.memoizedState=zo(1|r,y,a,u))}function fy(e,r){tu(8390656,8,e,r)}function ud(e,r){eu(2048,8,e,r)}function __(e){Nt.flags|=4;var r=Nt.updateQueue;if(r===null)r=Kl(),Nt.updateQueue=r,r.events=[e];else{var a=r.events;a===null?r.events=[e]:a.push(e)}}function dy(e){var r=de().memoizedState;return __({ref:r,nextImpl:e}),function(){if((qt&2)!==0)throw Error(o(440));return r.impl.apply(void 0,arguments)}}function hy(e,r){return eu(4,2,e,r)}function py(e,r){return eu(4,4,e,r)}function my(e,r){if(typeof r=="function"){e=e();var a=r(e);return function(){typeof a=="function"?a():r(null)}}if(r!=null)return e=e(),r.current=e,function(){r.current=null}}function gy(e,r,a){a=a!=null?a.concat([e]):null,eu(4,4,my.bind(null,r,e),a)}function cd(){}function yy(e,r){var a=de();r=r===void 0?null:r;var u=a.memoizedState;return r!==null&&Wf(r,u[1])?u[0]:(a.memoizedState=[e,r],e)}function vy(e,r){var a=de();r=r===void 0?null:r;var u=a.memoizedState;if(r!==null&&Wf(r,u[1]))return u[0];if(u=e(),Lr){Re(!0);try{e()}finally{Re(!1)}}return a.memoizedState=[u,r],u}function fd(e,r,a){return a===void 0||(hi&1073741824)!==0&&(Dt&261930)===0?e.memoizedState=r:(e.memoizedState=a,e=x0(),Nt.lanes|=e,$i|=e,a)}function xy(e,r,a,u){return tn(a,r)?a:Ao.current!==null?(e=fd(e,a,u),tn(e,r)||(ge=!0),e):(hi&42)===0||(hi&1073741824)!==0&&(Dt&261930)===0?(ge=!0,e.memoizedState=a):(e=x0(),Nt.lanes|=e,$i|=e,r)}function by(e,r,a,u,p){var y=U.p;U.p=y!==0&&8>y?y:8;var S=O.T,N={};O.T=N,pd(e,!1,r,a);try{var Y=p(),tt=O.S;if(tt!==null&&tt(N,Y),Y!==null&&typeof Y=="object"&&typeof Y.then=="function"){var ot=x_(Y,u);Ga(e,r,ot,sn(e))}else Ga(e,r,u,sn(e))}catch(st){Ga(e,r,{then:function(){},status:"rejected",reason:st},sn())}finally{U.p=y,S!==null&&N.types!==null&&(S.types=N.types),O.T=S}}function C_(){}function dd(e,r,a,u){if(e.tag!==5)throw Error(o(476));var p=Sy(e).queue;by(e,p,r,G,a===null?C_:function(){return wy(e),a(u)})}function Sy(e){var r=e.memoizedState;if(r!==null)return r;r={memoizedState:G,baseState:G,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:pi,lastRenderedState:G},next:null};var a={};return r.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:pi,lastRenderedState:a},next:null},e.memoizedState=r,e=e.alternate,e!==null&&(e.memoizedState=r),r}function wy(e){var r=Sy(e);r.next===null&&(r=e.alternate.memoizedState),Ga(e,r.next.queue,{},sn())}function hd(){return Te(cs)}function Ey(){return de().memoizedState}function _y(){return de().memoizedState}function T_(e){for(var r=e.return;r!==null;){switch(r.tag){case 24:case 3:var a=sn();e=qi(a);var u=Fi(r,e,a);u!==null&&(Ye(u,r,a),Va(u,r,a)),r={cache:Vf()},e.payload=r;return}r=r.return}}function M_(e,r,a){var u=sn();a={lane:u,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},nu(e)?Ty(r,a):(a=Rf(e,r,a,u),a!==null&&(Ye(a,e,u),My(a,r,u)))}function Cy(e,r,a){var u=sn();Ga(e,r,a,u)}function Ga(e,r,a,u){var p={lane:u,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null};if(nu(e))Ty(r,p);else{var y=e.alternate;if(e.lanes===0&&(y===null||y.lanes===0)&&(y=r.lastRenderedReducer,y!==null))try{var S=r.lastRenderedState,N=y(S,a);if(p.hasEagerState=!0,p.eagerState=N,tn(N,S))return jl(e,r,p,0),Jt===null&&Ll(),!1}catch{}if(a=Rf(e,r,p,u),a!==null)return Ye(a,e,u),My(a,r,u),!0}return!1}function pd(e,r,a,u){if(u={lane:2,revertLane:Xd(),gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null},nu(e)){if(r)throw Error(o(479))}else r=Rf(e,a,u,2),r!==null&&Ye(r,e,2)}function nu(e){var r=e.alternate;return e===Nt||r!==null&&r===Nt}function Ty(e,r){Ro=$l=!0;var a=e.pending;a===null?r.next=r:(r.next=a.next,a.next=r),e.pending=r}function My(e,r,a){if((a&4194048)!==0){var u=r.lanes;u&=e.pendingLanes,a|=u,r.lanes=a,ml(e,a)}}var Qa={readContext:Te,use:Jl,useCallback:se,useContext:se,useEffect:se,useImperativeHandle:se,useLayoutEffect:se,useInsertionEffect:se,useMemo:se,useReducer:se,useRef:se,useState:se,useDebugValue:se,useDeferredValue:se,useTransition:se,useSyncExternalStore:se,useId:se,useHostTransitionStatus:se,useFormState:se,useActionState:se,useOptimistic:se,useMemoCache:se,useCacheRefresh:se};Qa.useEffectEvent=se;var Ny={readContext:Te,use:Jl,useCallback:function(e,r){return Be().memoizedState=[e,r===void 0?null:r],e},useContext:Te,useEffect:fy,useImperativeHandle:function(e,r,a){a=a!=null?a.concat([e]):null,tu(4194308,4,my.bind(null,r,e),a)},useLayoutEffect:function(e,r){return tu(4194308,4,e,r)},useInsertionEffect:function(e,r){tu(4,2,e,r)},useMemo:function(e,r){var a=Be();r=r===void 0?null:r;var u=e();if(Lr){Re(!0);try{e()}finally{Re(!1)}}return a.memoizedState=[u,r],u},useReducer:function(e,r,a){var u=Be();if(a!==void 0){var p=a(r);if(Lr){Re(!0);try{a(r)}finally{Re(!1)}}}else p=r;return u.memoizedState=u.baseState=p,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:p},u.queue=e,e=e.dispatch=M_.bind(null,Nt,e),[u.memoizedState,e]},useRef:function(e){var r=Be();return e={current:e},r.memoizedState=e},useState:function(e){e=sd(e);var r=e.queue,a=Cy.bind(null,Nt,r);return r.dispatch=a,[e.memoizedState,a]},useDebugValue:cd,useDeferredValue:function(e,r){var a=Be();return fd(a,e,r)},useTransition:function(){var e=sd(!1);return e=by.bind(null,Nt,e.queue,!0,!1),Be().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,r,a){var u=Nt,p=Be();if(Bt){if(a===void 0)throw Error(o(407));a=a()}else{if(a=r(),Jt===null)throw Error(o(349));(Dt&127)!==0||$g(u,r,a)}p.memoizedState=a;var y={value:a,getSnapshot:r};return p.queue=y,fy(Kg.bind(null,u,y,e),[e]),u.flags|=2048,zo(9,{destroy:void 0},Zg.bind(null,u,y,a,r),null),a},useId:function(){var e=Be(),r=Jt.identifierPrefix;if(Bt){var a=Yn,u=Fn;a=(u&~(1<<32-Yt(u)-1)).toString(32)+a,r="_"+r+"R_"+a,a=Zl++,0<a&&(r+="H"+a.toString(32)),r+="_"}else a=b_++,r="_"+r+"r_"+a.toString(32)+"_";return e.memoizedState=r},useHostTransitionStatus:hd,useFormState:ay,useActionState:ay,useOptimistic:function(e){var r=Be();r.memoizedState=r.baseState=e;var a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return r.queue=a,r=pd.bind(null,Nt,!0,a),a.dispatch=r,[e,r]},useMemoCache:rd,useCacheRefresh:function(){return Be().memoizedState=T_.bind(null,Nt)},useEffectEvent:function(e){var r=Be(),a={impl:e};return r.memoizedState=a,function(){if((qt&2)!==0)throw Error(o(440));return a.impl.apply(void 0,arguments)}}},md={readContext:Te,use:Jl,useCallback:yy,useContext:Te,useEffect:ud,useImperativeHandle:gy,useInsertionEffect:hy,useLayoutEffect:py,useMemo:vy,useReducer:Wl,useRef:cy,useState:function(){return Wl(pi)},useDebugValue:cd,useDeferredValue:function(e,r){var a=de();return xy(a,$t.memoizedState,e,r)},useTransition:function(){var e=Wl(pi)[0],r=de().memoizedState;return[typeof e=="boolean"?e:Xa(e),r]},useSyncExternalStore:Qg,useId:Ey,useHostTransitionStatus:hd,useFormState:sy,useActionState:sy,useOptimistic:function(e,r){var a=de();return ty(a,$t,e,r)},useMemoCache:rd,useCacheRefresh:_y};md.useEffectEvent=dy;var ky={readContext:Te,use:Jl,useCallback:yy,useContext:Te,useEffect:ud,useImperativeHandle:gy,useInsertionEffect:hy,useLayoutEffect:py,useMemo:vy,useReducer:ad,useRef:cy,useState:function(){return ad(pi)},useDebugValue:cd,useDeferredValue:function(e,r){var a=de();return $t===null?fd(a,e,r):xy(a,$t.memoizedState,e,r)},useTransition:function(){var e=ad(pi)[0],r=de().memoizedState;return[typeof e=="boolean"?e:Xa(e),r]},useSyncExternalStore:Qg,useId:Ey,useHostTransitionStatus:hd,useFormState:uy,useActionState:uy,useOptimistic:function(e,r){var a=de();return $t!==null?ty(a,$t,e,r):(a.baseState=e,[e,a.queue.dispatch])},useMemoCache:rd,useCacheRefresh:_y};ky.useEffectEvent=dy;function gd(e,r,a,u){r=e.memoizedState,a=a(u,r),a=a==null?r:g({},r,a),e.memoizedState=a,e.lanes===0&&(e.updateQueue.baseState=a)}var yd={enqueueSetState:function(e,r,a){e=e._reactInternals;var u=sn(),p=qi(u);p.payload=r,a!=null&&(p.callback=a),r=Fi(e,p,u),r!==null&&(Ye(r,e,u),Va(r,e,u))},enqueueReplaceState:function(e,r,a){e=e._reactInternals;var u=sn(),p=qi(u);p.tag=1,p.payload=r,a!=null&&(p.callback=a),r=Fi(e,p,u),r!==null&&(Ye(r,e,u),Va(r,e,u))},enqueueForceUpdate:function(e,r){e=e._reactInternals;var a=sn(),u=qi(a);u.tag=2,r!=null&&(u.callback=r),r=Fi(e,u,a),r!==null&&(Ye(r,e,a),Va(r,e,a))}};function Ay(e,r,a,u,p,y,S){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(u,y,S):r.prototype&&r.prototype.isPureReactComponent?!Da(a,u)||!Da(p,y):!0}function Ry(e,r,a,u){e=r.state,typeof r.componentWillReceiveProps=="function"&&r.componentWillReceiveProps(a,u),typeof r.UNSAFE_componentWillReceiveProps=="function"&&r.UNSAFE_componentWillReceiveProps(a,u),r.state!==e&&yd.enqueueReplaceState(r,r.state,null)}function jr(e,r){var a=r;if("ref"in r){a={};for(var u in r)u!=="ref"&&(a[u]=r[u])}if(e=e.defaultProps){a===r&&(a=g({},a));for(var p in e)a[p]===void 0&&(a[p]=e[p])}return a}function Oy(e){Dl(e)}function zy(e){console.error(e)}function Dy(e){Dl(e)}function iu(e,r){try{var a=e.onUncaughtError;a(r.value,{componentStack:r.stack})}catch(u){setTimeout(function(){throw u})}}function Ly(e,r,a){try{var u=e.onCaughtError;u(a.value,{componentStack:a.stack,errorBoundary:r.tag===1?r.stateNode:null})}catch(p){setTimeout(function(){throw p})}}function vd(e,r,a){return a=qi(a),a.tag=3,a.payload={element:null},a.callback=function(){iu(e,r)},a}function jy(e){return e=qi(e),e.tag=3,e}function By(e,r,a,u){var p=a.type.getDerivedStateFromError;if(typeof p=="function"){var y=u.value;e.payload=function(){return p(y)},e.callback=function(){Ly(r,a,u)}}var S=a.stateNode;S!==null&&typeof S.componentDidCatch=="function"&&(e.callback=function(){Ly(r,a,u),typeof p!="function"&&(Zi===null?Zi=new Set([this]):Zi.add(this));var N=u.stack;this.componentDidCatch(u.value,{componentStack:N!==null?N:""})})}function N_(e,r,a,u,p){if(a.flags|=32768,u!==null&&typeof u=="object"&&typeof u.then=="function"){if(r=a.alternate,r!==null&&Co(r,a,p,!0),a=nn.current,a!==null){switch(a.tag){case 31:case 13:return En===null?mu():a.alternate===null&&le===0&&(le=3),a.flags&=-257,a.flags|=65536,a.lanes=p,u===Fl?a.flags|=16384:(r=a.updateQueue,r===null?a.updateQueue=new Set([u]):r.add(u),qd(e,u,p)),!1;case 22:return a.flags|=65536,u===Fl?a.flags|=16384:(r=a.updateQueue,r===null?(r={transitions:null,markerInstances:null,retryQueue:new Set([u])},a.updateQueue=r):(a=r.retryQueue,a===null?r.retryQueue=new Set([u]):a.add(u)),qd(e,u,p)),!1}throw Error(o(435,a.tag))}return qd(e,u,p),mu(),!1}if(Bt)return r=nn.current,r!==null?((r.flags&65536)===0&&(r.flags|=256),r.flags|=65536,r.lanes=p,u!==Bf&&(e=Error(o(422),{cause:u}),Ba(xn(e,a)))):(u!==Bf&&(r=Error(o(423),{cause:u}),Ba(xn(r,a))),e=e.current.alternate,e.flags|=65536,p&=-p,e.lanes|=p,u=xn(u,a),p=vd(e.stateNode,u,p),Qf(e,p),le!==4&&(le=2)),!1;var y=Error(o(520),{cause:u});if(y=xn(y,a),ns===null?ns=[y]:ns.push(y),le!==4&&(le=2),r===null)return!0;u=xn(u,a),a=r;do{switch(a.tag){case 3:return a.flags|=65536,e=p&-p,a.lanes|=e,e=vd(a.stateNode,u,e),Qf(a,e),!1;case 1:if(r=a.type,y=a.stateNode,(a.flags&128)===0&&(typeof r.getDerivedStateFromError=="function"||y!==null&&typeof y.componentDidCatch=="function"&&(Zi===null||!Zi.has(y))))return a.flags|=65536,p&=-p,a.lanes|=p,p=jy(p),By(p,e,a,u),Qf(a,p),!1}a=a.return}while(a!==null);return!1}var xd=Error(o(461)),ge=!1;function Me(e,r,a,u){r.child=e===null?Ug(r,null,a,u):Dr(r,e.child,a,u)}function Hy(e,r,a,u,p){a=a.render;var y=r.ref;if("ref"in u){var S={};for(var N in u)N!=="ref"&&(S[N]=u[N])}else S=u;return Ar(r),u=td(e,r,a,S,y,p),N=ed(),e!==null&&!ge?(nd(e,r,p),mi(e,r,p)):(Bt&&N&&Lf(r),r.flags|=1,Me(e,r,u,p),r.child)}function Py(e,r,a,u,p){if(e===null){var y=a.type;return typeof y=="function"&&!Of(y)&&y.defaultProps===void 0&&a.compare===null?(r.tag=15,r.type=y,Iy(e,r,y,u,p)):(e=Hl(a.type,null,u,r,r.mode,p),e.ref=r.ref,e.return=r,r.child=e)}if(y=e.child,!Md(e,p)){var S=y.memoizedProps;if(a=a.compare,a=a!==null?a:Da,a(S,u)&&e.ref===r.ref)return mi(e,r,p)}return r.flags|=1,e=ui(y,u),e.ref=r.ref,e.return=r,r.child=e}function Iy(e,r,a,u,p){if(e!==null){var y=e.memoizedProps;if(Da(y,u)&&e.ref===r.ref)if(ge=!1,r.pendingProps=u=y,Md(e,p))(e.flags&131072)!==0&&(ge=!0);else return r.lanes=e.lanes,mi(e,r,p)}return bd(e,r,a,u,p)}function Uy(e,r,a,u){var p=u.children,y=e!==null?e.memoizedState:null;if(e===null&&r.stateNode===null&&(r.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),u.mode==="hidden"){if((r.flags&128)!==0){if(y=y!==null?y.baseLanes|a:a,e!==null){for(u=r.child=e.child,p=0;u!==null;)p=p|u.lanes|u.childLanes,u=u.sibling;u=p&~y}else u=0,r.child=null;return Vy(e,r,y,a,u)}if((a&536870912)!==0)r.memoizedState={baseLanes:0,cachePool:null},e!==null&&Vl(r,y!==null?y.cachePool:null),y!==null?Fg(r,y):Zf(),Yg(r);else return u=r.lanes=536870912,Vy(e,r,y!==null?y.baseLanes|a:a,a,u)}else y!==null?(Vl(r,y.cachePool),Fg(r,y),Xi(),r.memoizedState=null):(e!==null&&Vl(r,null),Zf(),Xi());return Me(e,r,p,a),r.child}function $a(e,r){return e!==null&&e.tag===22||r.stateNode!==null||(r.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.sibling}function Vy(e,r,a,u,p){var y=Ff();return y=y===null?null:{parent:pe._currentValue,pool:y},r.memoizedState={baseLanes:a,cachePool:y},e!==null&&Vl(r,null),Zf(),Yg(r),e!==null&&Co(e,r,u,!0),r.childLanes=p,null}function ru(e,r){return r=au({mode:r.mode,children:r.children},e.mode),r.ref=e.ref,e.child=r,r.return=e,r}function qy(e,r,a){return Dr(r,e.child,null,a),e=ru(r,r.pendingProps),e.flags|=2,rn(r),r.memoizedState=null,e}function k_(e,r,a){var u=r.pendingProps,p=(r.flags&128)!==0;if(r.flags&=-129,e===null){if(Bt){if(u.mode==="hidden")return e=ru(r,u),r.lanes=536870912,$a(null,e);if(Jf(r),(e=ee)?(e=ev(e,wn),e=e!==null&&e.data==="&"?e:null,e!==null&&(r.memoizedState={dehydrated:e,treeContext:Hi!==null?{id:Fn,overflow:Yn}:null,retryLane:536870912,hydrationErrors:null},a=Tg(e),a.return=r,r.child=a,Ce=r,ee=null)):e=null,e===null)throw Ii(r);return r.lanes=536870912,null}return ru(r,u)}var y=e.memoizedState;if(y!==null){var S=y.dehydrated;if(Jf(r),p)if(r.flags&256)r.flags&=-257,r=qy(e,r,a);else if(r.memoizedState!==null)r.child=e.child,r.flags|=128,r=null;else throw Error(o(558));else if(ge||Co(e,r,a,!1),p=(a&e.childLanes)!==0,ge||p){if(u=Jt,u!==null&&(S=gl(u,a),S!==0&&S!==y.retryLane))throw y.retryLane=S,Tr(e,S),Ye(u,e,S),xd;mu(),r=qy(e,r,a)}else e=y.treeContext,ee=_n(S.nextSibling),Ce=r,Bt=!0,Pi=null,wn=!1,e!==null&&kg(r,e),r=ru(r,u),r.flags|=4096;return r}return e=ui(e.child,{mode:u.mode,children:u.children}),e.ref=r.ref,r.child=e,e.return=r,e}function ou(e,r){var a=r.ref;if(a===null)e!==null&&e.ref!==null&&(r.flags|=4194816);else{if(typeof a!="function"&&typeof a!="object")throw Error(o(284));(e===null||e.ref!==a)&&(r.flags|=4194816)}}function bd(e,r,a,u,p){return Ar(r),a=td(e,r,a,u,void 0,p),u=ed(),e!==null&&!ge?(nd(e,r,p),mi(e,r,p)):(Bt&&u&&Lf(r),r.flags|=1,Me(e,r,a,p),r.child)}function Fy(e,r,a,u,p,y){return Ar(r),r.updateQueue=null,a=Gg(r,u,a,p),Xg(e),u=ed(),e!==null&&!ge?(nd(e,r,y),mi(e,r,y)):(Bt&&u&&Lf(r),r.flags|=1,Me(e,r,a,y),r.child)}function Yy(e,r,a,u,p){if(Ar(r),r.stateNode===null){var y=So,S=a.contextType;typeof S=="object"&&S!==null&&(y=Te(S)),y=new a(u,y),r.memoizedState=y.state!==null&&y.state!==void 0?y.state:null,y.updater=yd,r.stateNode=y,y._reactInternals=r,y=r.stateNode,y.props=u,y.state=r.memoizedState,y.refs={},Xf(r),S=a.contextType,y.context=typeof S=="object"&&S!==null?Te(S):So,y.state=r.memoizedState,S=a.getDerivedStateFromProps,typeof S=="function"&&(gd(r,a,S,u),y.state=r.memoizedState),typeof a.getDerivedStateFromProps=="function"||typeof y.getSnapshotBeforeUpdate=="function"||typeof y.UNSAFE_componentWillMount!="function"&&typeof y.componentWillMount!="function"||(S=y.state,typeof y.componentWillMount=="function"&&y.componentWillMount(),typeof y.UNSAFE_componentWillMount=="function"&&y.UNSAFE_componentWillMount(),S!==y.state&&yd.enqueueReplaceState(y,y.state,null),Fa(r,u,y,p),qa(),y.state=r.memoizedState),typeof y.componentDidMount=="function"&&(r.flags|=4194308),u=!0}else if(e===null){y=r.stateNode;var N=r.memoizedProps,Y=jr(a,N);y.props=Y;var tt=y.context,ot=a.contextType;S=So,typeof ot=="object"&&ot!==null&&(S=Te(ot));var st=a.getDerivedStateFromProps;ot=typeof st=="function"||typeof y.getSnapshotBeforeUpdate=="function",N=r.pendingProps!==N,ot||typeof y.UNSAFE_componentWillReceiveProps!="function"&&typeof y.componentWillReceiveProps!="function"||(N||tt!==S)&&Ry(r,y,u,S),Vi=!1;var nt=r.memoizedState;y.state=nt,Fa(r,u,y,p),qa(),tt=r.memoizedState,N||nt!==tt||Vi?(typeof st=="function"&&(gd(r,a,st,u),tt=r.memoizedState),(Y=Vi||Ay(r,a,Y,u,nt,tt,S))?(ot||typeof y.UNSAFE_componentWillMount!="function"&&typeof y.componentWillMount!="function"||(typeof y.componentWillMount=="function"&&y.componentWillMount(),typeof y.UNSAFE_componentWillMount=="function"&&y.UNSAFE_componentWillMount()),typeof y.componentDidMount=="function"&&(r.flags|=4194308)):(typeof y.componentDidMount=="function"&&(r.flags|=4194308),r.memoizedProps=u,r.memoizedState=tt),y.props=u,y.state=tt,y.context=S,u=Y):(typeof y.componentDidMount=="function"&&(r.flags|=4194308),u=!1)}else{y=r.stateNode,Gf(e,r),S=r.memoizedProps,ot=jr(a,S),y.props=ot,st=r.pendingProps,nt=y.context,tt=a.contextType,Y=So,typeof tt=="object"&&tt!==null&&(Y=Te(tt)),N=a.getDerivedStateFromProps,(tt=typeof N=="function"||typeof y.getSnapshotBeforeUpdate=="function")||typeof y.UNSAFE_componentWillReceiveProps!="function"&&typeof y.componentWillReceiveProps!="function"||(S!==st||nt!==Y)&&Ry(r,y,u,Y),Vi=!1,nt=r.memoizedState,y.state=nt,Fa(r,u,y,p),qa();var rt=r.memoizedState;S!==st||nt!==rt||Vi||e!==null&&e.dependencies!==null&&Il(e.dependencies)?(typeof N=="function"&&(gd(r,a,N,u),rt=r.memoizedState),(ot=Vi||Ay(r,a,ot,u,nt,rt,Y)||e!==null&&e.dependencies!==null&&Il(e.dependencies))?(tt||typeof y.UNSAFE_componentWillUpdate!="function"&&typeof y.componentWillUpdate!="function"||(typeof y.componentWillUpdate=="function"&&y.componentWillUpdate(u,rt,Y),typeof y.UNSAFE_componentWillUpdate=="function"&&y.UNSAFE_componentWillUpdate(u,rt,Y)),typeof y.componentDidUpdate=="function"&&(r.flags|=4),typeof y.getSnapshotBeforeUpdate=="function"&&(r.flags|=1024)):(typeof y.componentDidUpdate!="function"||S===e.memoizedProps&&nt===e.memoizedState||(r.flags|=4),typeof y.getSnapshotBeforeUpdate!="function"||S===e.memoizedProps&&nt===e.memoizedState||(r.flags|=1024),r.memoizedProps=u,r.memoizedState=rt),y.props=u,y.state=rt,y.context=Y,u=ot):(typeof y.componentDidUpdate!="function"||S===e.memoizedProps&&nt===e.memoizedState||(r.flags|=4),typeof y.getSnapshotBeforeUpdate!="function"||S===e.memoizedProps&&nt===e.memoizedState||(r.flags|=1024),u=!1)}return y=u,ou(e,r),u=(r.flags&128)!==0,y||u?(y=r.stateNode,a=u&&typeof a.getDerivedStateFromError!="function"?null:y.render(),r.flags|=1,e!==null&&u?(r.child=Dr(r,e.child,null,p),r.child=Dr(r,null,a,p)):Me(e,r,a,p),r.memoizedState=y.state,e=r.child):e=mi(e,r,p),e}function Xy(e,r,a,u){return Nr(),r.flags|=256,Me(e,r,a,u),r.child}var Sd={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function wd(e){return{baseLanes:e,cachePool:Lg()}}function Ed(e,r,a){return e=e!==null?e.childLanes&~a:0,r&&(e|=an),e}function Gy(e,r,a){var u=r.pendingProps,p=!1,y=(r.flags&128)!==0,S;if((S=y)||(S=e!==null&&e.memoizedState===null?!1:(fe.current&2)!==0),S&&(p=!0,r.flags&=-129),S=(r.flags&32)!==0,r.flags&=-33,e===null){if(Bt){if(p?Yi(r):Xi(),(e=ee)?(e=ev(e,wn),e=e!==null&&e.data!=="&"?e:null,e!==null&&(r.memoizedState={dehydrated:e,treeContext:Hi!==null?{id:Fn,overflow:Yn}:null,retryLane:536870912,hydrationErrors:null},a=Tg(e),a.return=r,r.child=a,Ce=r,ee=null)):e=null,e===null)throw Ii(r);return oh(e)?r.lanes=32:r.lanes=536870912,null}var N=u.children;return u=u.fallback,p?(Xi(),p=r.mode,N=au({mode:"hidden",children:N},p),u=Mr(u,p,a,null),N.return=r,u.return=r,N.sibling=u,r.child=N,u=r.child,u.memoizedState=wd(a),u.childLanes=Ed(e,S,a),r.memoizedState=Sd,$a(null,u)):(Yi(r),_d(r,N))}var Y=e.memoizedState;if(Y!==null&&(N=Y.dehydrated,N!==null)){if(y)r.flags&256?(Yi(r),r.flags&=-257,r=Cd(e,r,a)):r.memoizedState!==null?(Xi(),r.child=e.child,r.flags|=128,r=null):(Xi(),N=u.fallback,p=r.mode,u=au({mode:"visible",children:u.children},p),N=Mr(N,p,a,null),N.flags|=2,u.return=r,N.return=r,u.sibling=N,r.child=u,Dr(r,e.child,null,a),u=r.child,u.memoizedState=wd(a),u.childLanes=Ed(e,S,a),r.memoizedState=Sd,r=$a(null,u));else if(Yi(r),oh(N)){if(S=N.nextSibling&&N.nextSibling.dataset,S)var tt=S.dgst;S=tt,u=Error(o(419)),u.stack="",u.digest=S,Ba({value:u,source:null,stack:null}),r=Cd(e,r,a)}else if(ge||Co(e,r,a,!1),S=(a&e.childLanes)!==0,ge||S){if(S=Jt,S!==null&&(u=gl(S,a),u!==0&&u!==Y.retryLane))throw Y.retryLane=u,Tr(e,u),Ye(S,e,u),xd;rh(N)||mu(),r=Cd(e,r,a)}else rh(N)?(r.flags|=192,r.child=e.child,r=null):(e=Y.treeContext,ee=_n(N.nextSibling),Ce=r,Bt=!0,Pi=null,wn=!1,e!==null&&kg(r,e),r=_d(r,u.children),r.flags|=4096);return r}return p?(Xi(),N=u.fallback,p=r.mode,Y=e.child,tt=Y.sibling,u=ui(Y,{mode:"hidden",children:u.children}),u.subtreeFlags=Y.subtreeFlags&65011712,tt!==null?N=ui(tt,N):(N=Mr(N,p,a,null),N.flags|=2),N.return=r,u.return=r,u.sibling=N,r.child=u,$a(null,u),u=r.child,N=e.child.memoizedState,N===null?N=wd(a):(p=N.cachePool,p!==null?(Y=pe._currentValue,p=p.parent!==Y?{parent:Y,pool:Y}:p):p=Lg(),N={baseLanes:N.baseLanes|a,cachePool:p}),u.memoizedState=N,u.childLanes=Ed(e,S,a),r.memoizedState=Sd,$a(e.child,u)):(Yi(r),a=e.child,e=a.sibling,a=ui(a,{mode:"visible",children:u.children}),a.return=r,a.sibling=null,e!==null&&(S=r.deletions,S===null?(r.deletions=[e],r.flags|=16):S.push(e)),r.child=a,r.memoizedState=null,a)}function _d(e,r){return r=au({mode:"visible",children:r},e.mode),r.return=e,e.child=r}function au(e,r){return e=en(22,e,null,r),e.lanes=0,e}function Cd(e,r,a){return Dr(r,e.child,null,a),e=_d(r,r.pendingProps.children),e.flags|=2,r.memoizedState=null,e}function Qy(e,r,a){e.lanes|=r;var u=e.alternate;u!==null&&(u.lanes|=r),If(e.return,r,a)}function Td(e,r,a,u,p,y){var S=e.memoizedState;S===null?e.memoizedState={isBackwards:r,rendering:null,renderingStartTime:0,last:u,tail:a,tailMode:p,treeForkCount:y}:(S.isBackwards=r,S.rendering=null,S.renderingStartTime=0,S.last=u,S.tail=a,S.tailMode=p,S.treeForkCount=y)}function $y(e,r,a){var u=r.pendingProps,p=u.revealOrder,y=u.tail;u=u.children;var S=fe.current,N=(S&2)!==0;if(N?(S=S&1|2,r.flags|=128):S&=1,A(fe,S),Me(e,r,u,a),u=Bt?ja:0,!N&&e!==null&&(e.flags&128)!==0)t:for(e=r.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Qy(e,a,r);else if(e.tag===19)Qy(e,a,r);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===r)break t;for(;e.sibling===null;){if(e.return===null||e.return===r)break t;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(p){case"forwards":for(a=r.child,p=null;a!==null;)e=a.alternate,e!==null&&Ql(e)===null&&(p=a),a=a.sibling;a=p,a===null?(p=r.child,r.child=null):(p=a.sibling,a.sibling=null),Td(r,!1,p,a,y,u);break;case"backwards":case"unstable_legacy-backwards":for(a=null,p=r.child,r.child=null;p!==null;){if(e=p.alternate,e!==null&&Ql(e)===null){r.child=p;break}e=p.sibling,p.sibling=a,a=p,p=e}Td(r,!0,a,null,y,u);break;case"together":Td(r,!1,null,null,void 0,u);break;default:r.memoizedState=null}return r.child}function mi(e,r,a){if(e!==null&&(r.dependencies=e.dependencies),$i|=r.lanes,(a&r.childLanes)===0)if(e!==null){if(Co(e,r,a,!1),(a&r.childLanes)===0)return null}else return null;if(e!==null&&r.child!==e.child)throw Error(o(153));if(r.child!==null){for(e=r.child,a=ui(e,e.pendingProps),r.child=a,a.return=r;e.sibling!==null;)e=e.sibling,a=a.sibling=ui(e,e.pendingProps),a.return=r;a.sibling=null}return r.child}function Md(e,r){return(e.lanes&r)!==0?!0:(e=e.dependencies,!!(e!==null&&Il(e)))}function A_(e,r,a){switch(r.tag){case 3:lt(r,r.stateNode.containerInfo),Ui(r,pe,e.memoizedState.cache),Nr();break;case 27:case 5:St(r);break;case 4:lt(r,r.stateNode.containerInfo);break;case 10:Ui(r,r.type,r.memoizedProps.value);break;case 31:if(r.memoizedState!==null)return r.flags|=128,Jf(r),null;break;case 13:var u=r.memoizedState;if(u!==null)return u.dehydrated!==null?(Yi(r),r.flags|=128,null):(a&r.child.childLanes)!==0?Gy(e,r,a):(Yi(r),e=mi(e,r,a),e!==null?e.sibling:null);Yi(r);break;case 19:var p=(e.flags&128)!==0;if(u=(a&r.childLanes)!==0,u||(Co(e,r,a,!1),u=(a&r.childLanes)!==0),p){if(u)return $y(e,r,a);r.flags|=128}if(p=r.memoizedState,p!==null&&(p.rendering=null,p.tail=null,p.lastEffect=null),A(fe,fe.current),u)break;return null;case 22:return r.lanes=0,Uy(e,r,a,r.pendingProps);case 24:Ui(r,pe,e.memoizedState.cache)}return mi(e,r,a)}function Zy(e,r,a){if(e!==null)if(e.memoizedProps!==r.pendingProps)ge=!0;else{if(!Md(e,a)&&(r.flags&128)===0)return ge=!1,A_(e,r,a);ge=(e.flags&131072)!==0}else ge=!1,Bt&&(r.flags&1048576)!==0&&Ng(r,ja,r.index);switch(r.lanes=0,r.tag){case 16:t:{var u=r.pendingProps;if(e=Or(r.elementType),r.type=e,typeof e=="function")Of(e)?(u=jr(e,u),r.tag=1,r=Yy(null,r,e,u,a)):(r.tag=0,r=bd(null,r,e,u,a));else{if(e!=null){var p=e.$$typeof;if(p===M){r.tag=11,r=Hy(null,r,e,u,a);break t}else if(p===B){r.tag=14,r=Py(null,r,e,u,a);break t}}throw r=D(e)||e,Error(o(306,r,""))}}return r;case 0:return bd(e,r,r.type,r.pendingProps,a);case 1:return u=r.type,p=jr(u,r.pendingProps),Yy(e,r,u,p,a);case 3:t:{if(lt(r,r.stateNode.containerInfo),e===null)throw Error(o(387));u=r.pendingProps;var y=r.memoizedState;p=y.element,Gf(e,r),Fa(r,u,null,a);var S=r.memoizedState;if(u=S.cache,Ui(r,pe,u),u!==y.cache&&Uf(r,[pe],a,!0),qa(),u=S.element,y.isDehydrated)if(y={element:u,isDehydrated:!1,cache:S.cache},r.updateQueue.baseState=y,r.memoizedState=y,r.flags&256){r=Xy(e,r,u,a);break t}else if(u!==p){p=xn(Error(o(424)),r),Ba(p),r=Xy(e,r,u,a);break t}else for(e=r.stateNode.containerInfo,e.nodeType===9?e=e.body:e=e.nodeName==="HTML"?e.ownerDocument.body:e,ee=_n(e.firstChild),Ce=r,Bt=!0,Pi=null,wn=!0,a=Ug(r,null,u,a),r.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling;else{if(Nr(),u===p){r=mi(e,r,a);break t}Me(e,r,u,a)}r=r.child}return r;case 26:return ou(e,r),e===null?(a=sv(r.type,null,r.pendingProps,null))?r.memoizedState=a:Bt||(a=r.type,e=r.pendingProps,u=wu(ft.current).createElement(a),u[be]=r,u[Oe]=e,Ne(u,a,e),he(u),r.stateNode=u):r.memoizedState=sv(r.type,e.memoizedProps,r.pendingProps,e.memoizedState),null;case 27:return St(r),e===null&&Bt&&(u=r.stateNode=rv(r.type,r.pendingProps,ft.current),Ce=r,wn=!0,p=ee,tr(r.type)?(ah=p,ee=_n(u.firstChild)):ee=p),Me(e,r,r.pendingProps.children,a),ou(e,r),e===null&&(r.flags|=4194304),r.child;case 5:return e===null&&Bt&&((p=u=ee)&&(u=aC(u,r.type,r.pendingProps,wn),u!==null?(r.stateNode=u,Ce=r,ee=_n(u.firstChild),wn=!1,p=!0):p=!1),p||Ii(r)),St(r),p=r.type,y=r.pendingProps,S=e!==null?e.memoizedProps:null,u=y.children,eh(p,y)?u=null:S!==null&&eh(p,S)&&(r.flags|=32),r.memoizedState!==null&&(p=td(e,r,S_,null,null,a),cs._currentValue=p),ou(e,r),Me(e,r,u,a),r.child;case 6:return e===null&&Bt&&((e=a=ee)&&(a=sC(a,r.pendingProps,wn),a!==null?(r.stateNode=a,Ce=r,ee=null,e=!0):e=!1),e||Ii(r)),null;case 13:return Gy(e,r,a);case 4:return lt(r,r.stateNode.containerInfo),u=r.pendingProps,e===null?r.child=Dr(r,null,u,a):Me(e,r,u,a),r.child;case 11:return Hy(e,r,r.type,r.pendingProps,a);case 7:return Me(e,r,r.pendingProps,a),r.child;case 8:return Me(e,r,r.pendingProps.children,a),r.child;case 12:return Me(e,r,r.pendingProps.children,a),r.child;case 10:return u=r.pendingProps,Ui(r,r.type,u.value),Me(e,r,u.children,a),r.child;case 9:return p=r.type._context,u=r.pendingProps.children,Ar(r),p=Te(p),u=u(p),r.flags|=1,Me(e,r,u,a),r.child;case 14:return Py(e,r,r.type,r.pendingProps,a);case 15:return Iy(e,r,r.type,r.pendingProps,a);case 19:return $y(e,r,a);case 31:return k_(e,r,a);case 22:return Uy(e,r,a,r.pendingProps);case 24:return Ar(r),u=Te(pe),e===null?(p=Ff(),p===null&&(p=Jt,y=Vf(),p.pooledCache=y,y.refCount++,y!==null&&(p.pooledCacheLanes|=a),p=y),r.memoizedState={parent:u,cache:p},Xf(r),Ui(r,pe,p)):((e.lanes&a)!==0&&(Gf(e,r),Fa(r,null,null,a),qa()),p=e.memoizedState,y=r.memoizedState,p.parent!==u?(p={parent:u,cache:u},r.memoizedState=p,r.lanes===0&&(r.memoizedState=r.updateQueue.baseState=p),Ui(r,pe,u)):(u=y.cache,Ui(r,pe,u),u!==p.cache&&Uf(r,[pe],a,!0))),Me(e,r,r.pendingProps.children,a),r.child;case 29:throw r.pendingProps}throw Error(o(156,r.tag))}function gi(e){e.flags|=4}function Nd(e,r,a,u,p){if((r=(e.mode&32)!==0)&&(r=!1),r){if(e.flags|=16777216,(p&335544128)===p)if(e.stateNode.complete)e.flags|=8192;else if(E0())e.flags|=8192;else throw zr=Fl,Yf}else e.flags&=-16777217}function Ky(e,r){if(r.type!=="stylesheet"||(r.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!dv(r))if(E0())e.flags|=8192;else throw zr=Fl,Yf}function su(e,r){r!==null&&(e.flags|=4),e.flags&16384&&(r=e.tag!==22?hl():536870912,e.lanes|=r,Bo|=r)}function Za(e,r){if(!Bt)switch(e.tailMode){case"hidden":r=e.tail;for(var a=null;r!==null;)r.alternate!==null&&(a=r),r=r.sibling;a===null?e.tail=null:a.sibling=null;break;case"collapsed":a=e.tail;for(var u=null;a!==null;)a.alternate!==null&&(u=a),a=a.sibling;u===null?r||e.tail===null?e.tail=null:e.tail.sibling=null:u.sibling=null}}function ne(e){var r=e.alternate!==null&&e.alternate.child===e.child,a=0,u=0;if(r)for(var p=e.child;p!==null;)a|=p.lanes|p.childLanes,u|=p.subtreeFlags&65011712,u|=p.flags&65011712,p.return=e,p=p.sibling;else for(p=e.child;p!==null;)a|=p.lanes|p.childLanes,u|=p.subtreeFlags,u|=p.flags,p.return=e,p=p.sibling;return e.subtreeFlags|=u,e.childLanes=a,r}function R_(e,r,a){var u=r.pendingProps;switch(jf(r),r.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ne(r),null;case 1:return ne(r),null;case 3:return a=r.stateNode,u=null,e!==null&&(u=e.memoizedState.cache),r.memoizedState.cache!==u&&(r.flags|=2048),di(pe),pt(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(e===null||e.child===null)&&(_o(r)?gi(r):e===null||e.memoizedState.isDehydrated&&(r.flags&256)===0||(r.flags|=1024,Hf())),ne(r),null;case 26:var p=r.type,y=r.memoizedState;return e===null?(gi(r),y!==null?(ne(r),Ky(r,y)):(ne(r),Nd(r,p,null,u,a))):y?y!==e.memoizedState?(gi(r),ne(r),Ky(r,y)):(ne(r),r.flags&=-16777217):(e=e.memoizedProps,e!==u&&gi(r),ne(r),Nd(r,p,e,u,a)),null;case 27:if(wt(r),a=ft.current,p=r.type,e!==null&&r.stateNode!=null)e.memoizedProps!==u&&gi(r);else{if(!u){if(r.stateNode===null)throw Error(o(166));return ne(r),null}e=it.current,_o(r)?Ag(r):(e=rv(p,u,a),r.stateNode=e,gi(r))}return ne(r),null;case 5:if(wt(r),p=r.type,e!==null&&r.stateNode!=null)e.memoizedProps!==u&&gi(r);else{if(!u){if(r.stateNode===null)throw Error(o(166));return ne(r),null}if(y=it.current,_o(r))Ag(r);else{var S=wu(ft.current);switch(y){case 1:y=S.createElementNS("http://www.w3.org/2000/svg",p);break;case 2:y=S.createElementNS("http://www.w3.org/1998/Math/MathML",p);break;default:switch(p){case"svg":y=S.createElementNS("http://www.w3.org/2000/svg",p);break;case"math":y=S.createElementNS("http://www.w3.org/1998/Math/MathML",p);break;case"script":y=S.createElement("div"),y.innerHTML="<script><\/script>",y=y.removeChild(y.firstChild);break;case"select":y=typeof u.is=="string"?S.createElement("select",{is:u.is}):S.createElement("select"),u.multiple?y.multiple=!0:u.size&&(y.size=u.size);break;default:y=typeof u.is=="string"?S.createElement(p,{is:u.is}):S.createElement(p)}}y[be]=r,y[Oe]=u;t:for(S=r.child;S!==null;){if(S.tag===5||S.tag===6)y.appendChild(S.stateNode);else if(S.tag!==4&&S.tag!==27&&S.child!==null){S.child.return=S,S=S.child;continue}if(S===r)break t;for(;S.sibling===null;){if(S.return===null||S.return===r)break t;S=S.return}S.sibling.return=S.return,S=S.sibling}r.stateNode=y;t:switch(Ne(y,p,u),p){case"button":case"input":case"select":case"textarea":u=!!u.autoFocus;break t;case"img":u=!0;break t;default:u=!1}u&&gi(r)}}return ne(r),Nd(r,r.type,e===null?null:e.memoizedProps,r.pendingProps,a),null;case 6:if(e&&r.stateNode!=null)e.memoizedProps!==u&&gi(r);else{if(typeof u!="string"&&r.stateNode===null)throw Error(o(166));if(e=ft.current,_o(r)){if(e=r.stateNode,a=r.memoizedProps,u=null,p=Ce,p!==null)switch(p.tag){case 27:case 5:u=p.memoizedProps}e[be]=r,e=!!(e.nodeValue===a||u!==null&&u.suppressHydrationWarning===!0||G0(e.nodeValue,a)),e||Ii(r,!0)}else e=wu(e).createTextNode(u),e[be]=r,r.stateNode=e}return ne(r),null;case 31:if(a=r.memoizedState,e===null||e.memoizedState!==null){if(u=_o(r),a!==null){if(e===null){if(!u)throw Error(o(318));if(e=r.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(557));e[be]=r}else Nr(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;ne(r),e=!1}else a=Hf(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),e=!0;if(!e)return r.flags&256?(rn(r),r):(rn(r),null);if((r.flags&128)!==0)throw Error(o(558))}return ne(r),null;case 13:if(u=r.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(p=_o(r),u!==null&&u.dehydrated!==null){if(e===null){if(!p)throw Error(o(318));if(p=r.memoizedState,p=p!==null?p.dehydrated:null,!p)throw Error(o(317));p[be]=r}else Nr(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;ne(r),p=!1}else p=Hf(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=p),p=!0;if(!p)return r.flags&256?(rn(r),r):(rn(r),null)}return rn(r),(r.flags&128)!==0?(r.lanes=a,r):(a=u!==null,e=e!==null&&e.memoizedState!==null,a&&(u=r.child,p=null,u.alternate!==null&&u.alternate.memoizedState!==null&&u.alternate.memoizedState.cachePool!==null&&(p=u.alternate.memoizedState.cachePool.pool),y=null,u.memoizedState!==null&&u.memoizedState.cachePool!==null&&(y=u.memoizedState.cachePool.pool),y!==p&&(u.flags|=2048)),a!==e&&a&&(r.child.flags|=8192),su(r,r.updateQueue),ne(r),null);case 4:return pt(),e===null&&Zd(r.stateNode.containerInfo),ne(r),null;case 10:return di(r.type),ne(r),null;case 19:if(X(fe),u=r.memoizedState,u===null)return ne(r),null;if(p=(r.flags&128)!==0,y=u.rendering,y===null)if(p)Za(u,!1);else{if(le!==0||e!==null&&(e.flags&128)!==0)for(e=r.child;e!==null;){if(y=Ql(e),y!==null){for(r.flags|=128,Za(u,!1),e=y.updateQueue,r.updateQueue=e,su(r,e),r.subtreeFlags=0,e=a,a=r.child;a!==null;)Cg(a,e),a=a.sibling;return A(fe,fe.current&1|2),Bt&&ci(r,u.treeForkCount),r.child}e=e.sibling}u.tail!==null&&ue()>du&&(r.flags|=128,p=!0,Za(u,!1),r.lanes=4194304)}else{if(!p)if(e=Ql(y),e!==null){if(r.flags|=128,p=!0,e=e.updateQueue,r.updateQueue=e,su(r,e),Za(u,!0),u.tail===null&&u.tailMode==="hidden"&&!y.alternate&&!Bt)return ne(r),null}else 2*ue()-u.renderingStartTime>du&&a!==536870912&&(r.flags|=128,p=!0,Za(u,!1),r.lanes=4194304);u.isBackwards?(y.sibling=r.child,r.child=y):(e=u.last,e!==null?e.sibling=y:r.child=y,u.last=y)}return u.tail!==null?(e=u.tail,u.rendering=e,u.tail=e.sibling,u.renderingStartTime=ue(),e.sibling=null,a=fe.current,A(fe,p?a&1|2:a&1),Bt&&ci(r,u.treeForkCount),e):(ne(r),null);case 22:case 23:return rn(r),Kf(),u=r.memoizedState!==null,e!==null?e.memoizedState!==null!==u&&(r.flags|=8192):u&&(r.flags|=8192),u?(a&536870912)!==0&&(r.flags&128)===0&&(ne(r),r.subtreeFlags&6&&(r.flags|=8192)):ne(r),a=r.updateQueue,a!==null&&su(r,a.retryQueue),a=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),u=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(u=r.memoizedState.cachePool.pool),u!==a&&(r.flags|=2048),e!==null&&X(Rr),null;case 24:return a=null,e!==null&&(a=e.memoizedState.cache),r.memoizedState.cache!==a&&(r.flags|=2048),di(pe),ne(r),null;case 25:return null;case 30:return null}throw Error(o(156,r.tag))}function O_(e,r){switch(jf(r),r.tag){case 1:return e=r.flags,e&65536?(r.flags=e&-65537|128,r):null;case 3:return di(pe),pt(),e=r.flags,(e&65536)!==0&&(e&128)===0?(r.flags=e&-65537|128,r):null;case 26:case 27:case 5:return wt(r),null;case 31:if(r.memoizedState!==null){if(rn(r),r.alternate===null)throw Error(o(340));Nr()}return e=r.flags,e&65536?(r.flags=e&-65537|128,r):null;case 13:if(rn(r),e=r.memoizedState,e!==null&&e.dehydrated!==null){if(r.alternate===null)throw Error(o(340));Nr()}return e=r.flags,e&65536?(r.flags=e&-65537|128,r):null;case 19:return X(fe),null;case 4:return pt(),null;case 10:return di(r.type),null;case 22:case 23:return rn(r),Kf(),e!==null&&X(Rr),e=r.flags,e&65536?(r.flags=e&-65537|128,r):null;case 24:return di(pe),null;case 25:return null;default:return null}}function Jy(e,r){switch(jf(r),r.tag){case 3:di(pe),pt();break;case 26:case 27:case 5:wt(r);break;case 4:pt();break;case 31:r.memoizedState!==null&&rn(r);break;case 13:rn(r);break;case 19:X(fe);break;case 10:di(r.type);break;case 22:case 23:rn(r),Kf(),e!==null&&X(Rr);break;case 24:di(pe)}}function Ka(e,r){try{var a=r.updateQueue,u=a!==null?a.lastEffect:null;if(u!==null){var p=u.next;a=p;do{if((a.tag&e)===e){u=void 0;var y=a.create,S=a.inst;u=y(),S.destroy=u}a=a.next}while(a!==p)}}catch(N){Gt(r,r.return,N)}}function Gi(e,r,a){try{var u=r.updateQueue,p=u!==null?u.lastEffect:null;if(p!==null){var y=p.next;u=y;do{if((u.tag&e)===e){var S=u.inst,N=S.destroy;if(N!==void 0){S.destroy=void 0,p=r;var Y=a,tt=N;try{tt()}catch(ot){Gt(p,Y,ot)}}}u=u.next}while(u!==y)}}catch(ot){Gt(r,r.return,ot)}}function Wy(e){var r=e.updateQueue;if(r!==null){var a=e.stateNode;try{qg(r,a)}catch(u){Gt(e,e.return,u)}}}function t0(e,r,a){a.props=jr(e.type,e.memoizedProps),a.state=e.memoizedState;try{a.componentWillUnmount()}catch(u){Gt(e,r,u)}}function Ja(e,r){try{var a=e.ref;if(a!==null){switch(e.tag){case 26:case 27:case 5:var u=e.stateNode;break;case 30:u=e.stateNode;break;default:u=e.stateNode}typeof a=="function"?e.refCleanup=a(u):a.current=u}}catch(p){Gt(e,r,p)}}function Xn(e,r){var a=e.ref,u=e.refCleanup;if(a!==null)if(typeof u=="function")try{u()}catch(p){Gt(e,r,p)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof a=="function")try{a(null)}catch(p){Gt(e,r,p)}else a.current=null}function e0(e){var r=e.type,a=e.memoizedProps,u=e.stateNode;try{t:switch(r){case"button":case"input":case"select":case"textarea":a.autoFocus&&u.focus();break t;case"img":a.src?u.src=a.src:a.srcSet&&(u.srcset=a.srcSet)}}catch(p){Gt(e,e.return,p)}}function kd(e,r,a){try{var u=e.stateNode;tC(u,e.type,a,r),u[Oe]=r}catch(p){Gt(e,e.return,p)}}function n0(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&tr(e.type)||e.tag===4}function Ad(e){t:for(;;){for(;e.sibling===null;){if(e.return===null||n0(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&tr(e.type)||e.flags&2||e.child===null||e.tag===4)continue t;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Rd(e,r,a){var u=e.tag;if(u===5||u===6)e=e.stateNode,r?(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a).insertBefore(e,r):(r=a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,r.appendChild(e),a=a._reactRootContainer,a!=null||r.onclick!==null||(r.onclick=si));else if(u!==4&&(u===27&&tr(e.type)&&(a=e.stateNode,r=null),e=e.child,e!==null))for(Rd(e,r,a),e=e.sibling;e!==null;)Rd(e,r,a),e=e.sibling}function lu(e,r,a){var u=e.tag;if(u===5||u===6)e=e.stateNode,r?a.insertBefore(e,r):a.appendChild(e);else if(u!==4&&(u===27&&tr(e.type)&&(a=e.stateNode),e=e.child,e!==null))for(lu(e,r,a),e=e.sibling;e!==null;)lu(e,r,a),e=e.sibling}function i0(e){var r=e.stateNode,a=e.memoizedProps;try{for(var u=e.type,p=r.attributes;p.length;)r.removeAttributeNode(p[0]);Ne(r,u,a),r[be]=e,r[Oe]=a}catch(y){Gt(e,e.return,y)}}var yi=!1,ye=!1,Od=!1,r0=typeof WeakSet=="function"?WeakSet:Set,we=null;function z_(e,r){if(e=e.containerInfo,Wd=ku,e=gg(e),Cf(e)){if("selectionStart"in e)var a={start:e.selectionStart,end:e.selectionEnd};else t:{a=(a=e.ownerDocument)&&a.defaultView||window;var u=a.getSelection&&a.getSelection();if(u&&u.rangeCount!==0){a=u.anchorNode;var p=u.anchorOffset,y=u.focusNode;u=u.focusOffset;try{a.nodeType,y.nodeType}catch{a=null;break t}var S=0,N=-1,Y=-1,tt=0,ot=0,st=e,nt=null;e:for(;;){for(var rt;st!==a||p!==0&&st.nodeType!==3||(N=S+p),st!==y||u!==0&&st.nodeType!==3||(Y=S+u),st.nodeType===3&&(S+=st.nodeValue.length),(rt=st.firstChild)!==null;)nt=st,st=rt;for(;;){if(st===e)break e;if(nt===a&&++tt===p&&(N=S),nt===y&&++ot===u&&(Y=S),(rt=st.nextSibling)!==null)break;st=nt,nt=st.parentNode}st=rt}a=N===-1||Y===-1?null:{start:N,end:Y}}else a=null}a=a||{start:0,end:0}}else a=null;for(th={focusedElem:e,selectionRange:a},ku=!1,we=r;we!==null;)if(r=we,e=r.child,(r.subtreeFlags&1028)!==0&&e!==null)e.return=r,we=e;else for(;we!==null;){switch(r=we,y=r.alternate,e=r.flags,r.tag){case 0:if((e&4)!==0&&(e=r.updateQueue,e=e!==null?e.events:null,e!==null))for(a=0;a<e.length;a++)p=e[a],p.ref.impl=p.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&y!==null){e=void 0,a=r,p=y.memoizedProps,y=y.memoizedState,u=a.stateNode;try{var mt=jr(a.type,p);e=u.getSnapshotBeforeUpdate(mt,y),u.__reactInternalSnapshotBeforeUpdate=e}catch(_t){Gt(a,a.return,_t)}}break;case 3:if((e&1024)!==0){if(e=r.stateNode.containerInfo,a=e.nodeType,a===9)ih(e);else if(a===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":ih(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(o(163))}if(e=r.sibling,e!==null){e.return=r.return,we=e;break}we=r.return}}function o0(e,r,a){var u=a.flags;switch(a.tag){case 0:case 11:case 15:xi(e,a),u&4&&Ka(5,a);break;case 1:if(xi(e,a),u&4)if(e=a.stateNode,r===null)try{e.componentDidMount()}catch(S){Gt(a,a.return,S)}else{var p=jr(a.type,r.memoizedProps);r=r.memoizedState;try{e.componentDidUpdate(p,r,e.__reactInternalSnapshotBeforeUpdate)}catch(S){Gt(a,a.return,S)}}u&64&&Wy(a),u&512&&Ja(a,a.return);break;case 3:if(xi(e,a),u&64&&(e=a.updateQueue,e!==null)){if(r=null,a.child!==null)switch(a.child.tag){case 27:case 5:r=a.child.stateNode;break;case 1:r=a.child.stateNode}try{qg(e,r)}catch(S){Gt(a,a.return,S)}}break;case 27:r===null&&u&4&&i0(a);case 26:case 5:xi(e,a),r===null&&u&4&&e0(a),u&512&&Ja(a,a.return);break;case 12:xi(e,a);break;case 31:xi(e,a),u&4&&l0(e,a);break;case 13:xi(e,a),u&4&&u0(e,a),u&64&&(e=a.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(a=V_.bind(null,a),lC(e,a))));break;case 22:if(u=a.memoizedState!==null||yi,!u){r=r!==null&&r.memoizedState!==null||ye,p=yi;var y=ye;yi=u,(ye=r)&&!y?bi(e,a,(a.subtreeFlags&8772)!==0):xi(e,a),yi=p,ye=y}break;case 30:break;default:xi(e,a)}}function a0(e){var r=e.alternate;r!==null&&(e.alternate=null,a0(r)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(r=e.stateNode,r!==null&&_a(r)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var re=null,Ue=!1;function vi(e,r,a){for(a=a.child;a!==null;)s0(e,r,a),a=a.sibling}function s0(e,r,a){if(ce&&typeof ce.onCommitFiberUnmount=="function")try{ce.onCommitFiberUnmount(_e,a)}catch{}switch(a.tag){case 26:ye||Xn(a,r),vi(e,r,a),a.memoizedState?a.memoizedState.count--:a.stateNode&&(a=a.stateNode,a.parentNode.removeChild(a));break;case 27:ye||Xn(a,r);var u=re,p=Ue;tr(a.type)&&(re=a.stateNode,Ue=!1),vi(e,r,a),ss(a.stateNode),re=u,Ue=p;break;case 5:ye||Xn(a,r);case 6:if(u=re,p=Ue,re=null,vi(e,r,a),re=u,Ue=p,re!==null)if(Ue)try{(re.nodeType===9?re.body:re.nodeName==="HTML"?re.ownerDocument.body:re).removeChild(a.stateNode)}catch(y){Gt(a,r,y)}else try{re.removeChild(a.stateNode)}catch(y){Gt(a,r,y)}break;case 18:re!==null&&(Ue?(e=re,W0(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,a.stateNode),Yo(e)):W0(re,a.stateNode));break;case 4:u=re,p=Ue,re=a.stateNode.containerInfo,Ue=!0,vi(e,r,a),re=u,Ue=p;break;case 0:case 11:case 14:case 15:Gi(2,a,r),ye||Gi(4,a,r),vi(e,r,a);break;case 1:ye||(Xn(a,r),u=a.stateNode,typeof u.componentWillUnmount=="function"&&t0(a,r,u)),vi(e,r,a);break;case 21:vi(e,r,a);break;case 22:ye=(u=ye)||a.memoizedState!==null,vi(e,r,a),ye=u;break;default:vi(e,r,a)}}function l0(e,r){if(r.memoizedState===null&&(e=r.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Yo(e)}catch(a){Gt(r,r.return,a)}}}function u0(e,r){if(r.memoizedState===null&&(e=r.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Yo(e)}catch(a){Gt(r,r.return,a)}}function D_(e){switch(e.tag){case 31:case 13:case 19:var r=e.stateNode;return r===null&&(r=e.stateNode=new r0),r;case 22:return e=e.stateNode,r=e._retryCache,r===null&&(r=e._retryCache=new r0),r;default:throw Error(o(435,e.tag))}}function uu(e,r){var a=D_(e);r.forEach(function(u){if(!a.has(u)){a.add(u);var p=q_.bind(null,e,u);u.then(p,p)}})}function Ve(e,r){var a=r.deletions;if(a!==null)for(var u=0;u<a.length;u++){var p=a[u],y=e,S=r,N=S;t:for(;N!==null;){switch(N.tag){case 27:if(tr(N.type)){re=N.stateNode,Ue=!1;break t}break;case 5:re=N.stateNode,Ue=!1;break t;case 3:case 4:re=N.stateNode.containerInfo,Ue=!0;break t}N=N.return}if(re===null)throw Error(o(160));s0(y,S,p),re=null,Ue=!1,y=p.alternate,y!==null&&(y.return=null),p.return=null}if(r.subtreeFlags&13886)for(r=r.child;r!==null;)c0(r,e),r=r.sibling}var Dn=null;function c0(e,r){var a=e.alternate,u=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Ve(r,e),qe(e),u&4&&(Gi(3,e,e.return),Ka(3,e),Gi(5,e,e.return));break;case 1:Ve(r,e),qe(e),u&512&&(ye||a===null||Xn(a,a.return)),u&64&&yi&&(e=e.updateQueue,e!==null&&(u=e.callbacks,u!==null&&(a=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=a===null?u:a.concat(u))));break;case 26:var p=Dn;if(Ve(r,e),qe(e),u&512&&(ye||a===null||Xn(a,a.return)),u&4){var y=a!==null?a.memoizedState:null;if(u=e.memoizedState,a===null)if(u===null)if(e.stateNode===null){t:{u=e.type,a=e.memoizedProps,p=p.ownerDocument||p;e:switch(u){case"title":y=p.getElementsByTagName("title")[0],(!y||y[br]||y[be]||y.namespaceURI==="http://www.w3.org/2000/svg"||y.hasAttribute("itemprop"))&&(y=p.createElement(u),p.head.insertBefore(y,p.querySelector("head > title"))),Ne(y,u,a),y[be]=e,he(y),u=y;break t;case"link":var S=cv("link","href",p).get(u+(a.href||""));if(S){for(var N=0;N<S.length;N++)if(y=S[N],y.getAttribute("href")===(a.href==null||a.href===""?null:a.href)&&y.getAttribute("rel")===(a.rel==null?null:a.rel)&&y.getAttribute("title")===(a.title==null?null:a.title)&&y.getAttribute("crossorigin")===(a.crossOrigin==null?null:a.crossOrigin)){S.splice(N,1);break e}}y=p.createElement(u),Ne(y,u,a),p.head.appendChild(y);break;case"meta":if(S=cv("meta","content",p).get(u+(a.content||""))){for(N=0;N<S.length;N++)if(y=S[N],y.getAttribute("content")===(a.content==null?null:""+a.content)&&y.getAttribute("name")===(a.name==null?null:a.name)&&y.getAttribute("property")===(a.property==null?null:a.property)&&y.getAttribute("http-equiv")===(a.httpEquiv==null?null:a.httpEquiv)&&y.getAttribute("charset")===(a.charSet==null?null:a.charSet)){S.splice(N,1);break e}}y=p.createElement(u),Ne(y,u,a),p.head.appendChild(y);break;default:throw Error(o(468,u))}y[be]=e,he(y),u=y}e.stateNode=u}else fv(p,e.type,e.stateNode);else e.stateNode=uv(p,u,e.memoizedProps);else y!==u?(y===null?a.stateNode!==null&&(a=a.stateNode,a.parentNode.removeChild(a)):y.count--,u===null?fv(p,e.type,e.stateNode):uv(p,u,e.memoizedProps)):u===null&&e.stateNode!==null&&kd(e,e.memoizedProps,a.memoizedProps)}break;case 27:Ve(r,e),qe(e),u&512&&(ye||a===null||Xn(a,a.return)),a!==null&&u&4&&kd(e,e.memoizedProps,a.memoizedProps);break;case 5:if(Ve(r,e),qe(e),u&512&&(ye||a===null||Xn(a,a.return)),e.flags&32){p=e.stateNode;try{po(p,"")}catch(mt){Gt(e,e.return,mt)}}u&4&&e.stateNode!=null&&(p=e.memoizedProps,kd(e,p,a!==null?a.memoizedProps:p)),u&1024&&(Od=!0);break;case 6:if(Ve(r,e),qe(e),u&4){if(e.stateNode===null)throw Error(o(162));u=e.memoizedProps,a=e.stateNode;try{a.nodeValue=u}catch(mt){Gt(e,e.return,mt)}}break;case 3:if(Cu=null,p=Dn,Dn=Eu(r.containerInfo),Ve(r,e),Dn=p,qe(e),u&4&&a!==null&&a.memoizedState.isDehydrated)try{Yo(r.containerInfo)}catch(mt){Gt(e,e.return,mt)}Od&&(Od=!1,f0(e));break;case 4:u=Dn,Dn=Eu(e.stateNode.containerInfo),Ve(r,e),qe(e),Dn=u;break;case 12:Ve(r,e),qe(e);break;case 31:Ve(r,e),qe(e),u&4&&(u=e.updateQueue,u!==null&&(e.updateQueue=null,uu(e,u)));break;case 13:Ve(r,e),qe(e),e.child.flags&8192&&e.memoizedState!==null!=(a!==null&&a.memoizedState!==null)&&(fu=ue()),u&4&&(u=e.updateQueue,u!==null&&(e.updateQueue=null,uu(e,u)));break;case 22:p=e.memoizedState!==null;var Y=a!==null&&a.memoizedState!==null,tt=yi,ot=ye;if(yi=tt||p,ye=ot||Y,Ve(r,e),ye=ot,yi=tt,qe(e),u&8192)t:for(r=e.stateNode,r._visibility=p?r._visibility&-2:r._visibility|1,p&&(a===null||Y||yi||ye||Br(e)),a=null,r=e;;){if(r.tag===5||r.tag===26){if(a===null){Y=a=r;try{if(y=Y.stateNode,p)S=y.style,typeof S.setProperty=="function"?S.setProperty("display","none","important"):S.display="none";else{N=Y.stateNode;var st=Y.memoizedProps.style,nt=st!=null&&st.hasOwnProperty("display")?st.display:null;N.style.display=nt==null||typeof nt=="boolean"?"":(""+nt).trim()}}catch(mt){Gt(Y,Y.return,mt)}}}else if(r.tag===6){if(a===null){Y=r;try{Y.stateNode.nodeValue=p?"":Y.memoizedProps}catch(mt){Gt(Y,Y.return,mt)}}}else if(r.tag===18){if(a===null){Y=r;try{var rt=Y.stateNode;p?tv(rt,!0):tv(Y.stateNode,!1)}catch(mt){Gt(Y,Y.return,mt)}}}else if((r.tag!==22&&r.tag!==23||r.memoizedState===null||r===e)&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===e)break t;for(;r.sibling===null;){if(r.return===null||r.return===e)break t;a===r&&(a=null),r=r.return}a===r&&(a=null),r.sibling.return=r.return,r=r.sibling}u&4&&(u=e.updateQueue,u!==null&&(a=u.retryQueue,a!==null&&(u.retryQueue=null,uu(e,a))));break;case 19:Ve(r,e),qe(e),u&4&&(u=e.updateQueue,u!==null&&(e.updateQueue=null,uu(e,u)));break;case 30:break;case 21:break;default:Ve(r,e),qe(e)}}function qe(e){var r=e.flags;if(r&2){try{for(var a,u=e.return;u!==null;){if(n0(u)){a=u;break}u=u.return}if(a==null)throw Error(o(160));switch(a.tag){case 27:var p=a.stateNode,y=Ad(e);lu(e,y,p);break;case 5:var S=a.stateNode;a.flags&32&&(po(S,""),a.flags&=-33);var N=Ad(e);lu(e,N,S);break;case 3:case 4:var Y=a.stateNode.containerInfo,tt=Ad(e);Rd(e,tt,Y);break;default:throw Error(o(161))}}catch(ot){Gt(e,e.return,ot)}e.flags&=-3}r&4096&&(e.flags&=-4097)}function f0(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var r=e;f0(r),r.tag===5&&r.flags&1024&&r.stateNode.reset(),e=e.sibling}}function xi(e,r){if(r.subtreeFlags&8772)for(r=r.child;r!==null;)o0(e,r.alternate,r),r=r.sibling}function Br(e){for(e=e.child;e!==null;){var r=e;switch(r.tag){case 0:case 11:case 14:case 15:Gi(4,r,r.return),Br(r);break;case 1:Xn(r,r.return);var a=r.stateNode;typeof a.componentWillUnmount=="function"&&t0(r,r.return,a),Br(r);break;case 27:ss(r.stateNode);case 26:case 5:Xn(r,r.return),Br(r);break;case 22:r.memoizedState===null&&Br(r);break;case 30:Br(r);break;default:Br(r)}e=e.sibling}}function bi(e,r,a){for(a=a&&(r.subtreeFlags&8772)!==0,r=r.child;r!==null;){var u=r.alternate,p=e,y=r,S=y.flags;switch(y.tag){case 0:case 11:case 15:bi(p,y,a),Ka(4,y);break;case 1:if(bi(p,y,a),u=y,p=u.stateNode,typeof p.componentDidMount=="function")try{p.componentDidMount()}catch(tt){Gt(u,u.return,tt)}if(u=y,p=u.updateQueue,p!==null){var N=u.stateNode;try{var Y=p.shared.hiddenCallbacks;if(Y!==null)for(p.shared.hiddenCallbacks=null,p=0;p<Y.length;p++)Vg(Y[p],N)}catch(tt){Gt(u,u.return,tt)}}a&&S&64&&Wy(y),Ja(y,y.return);break;case 27:i0(y);case 26:case 5:bi(p,y,a),a&&u===null&&S&4&&e0(y),Ja(y,y.return);break;case 12:bi(p,y,a);break;case 31:bi(p,y,a),a&&S&4&&l0(p,y);break;case 13:bi(p,y,a),a&&S&4&&u0(p,y);break;case 22:y.memoizedState===null&&bi(p,y,a),Ja(y,y.return);break;case 30:break;default:bi(p,y,a)}r=r.sibling}}function zd(e,r){var a=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),e=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(e=r.memoizedState.cachePool.pool),e!==a&&(e!=null&&e.refCount++,a!=null&&Ha(a))}function Dd(e,r){e=null,r.alternate!==null&&(e=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==e&&(r.refCount++,e!=null&&Ha(e))}function Ln(e,r,a,u){if(r.subtreeFlags&10256)for(r=r.child;r!==null;)d0(e,r,a,u),r=r.sibling}function d0(e,r,a,u){var p=r.flags;switch(r.tag){case 0:case 11:case 15:Ln(e,r,a,u),p&2048&&Ka(9,r);break;case 1:Ln(e,r,a,u);break;case 3:Ln(e,r,a,u),p&2048&&(e=null,r.alternate!==null&&(e=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==e&&(r.refCount++,e!=null&&Ha(e)));break;case 12:if(p&2048){Ln(e,r,a,u),e=r.stateNode;try{var y=r.memoizedProps,S=y.id,N=y.onPostCommit;typeof N=="function"&&N(S,r.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(Y){Gt(r,r.return,Y)}}else Ln(e,r,a,u);break;case 31:Ln(e,r,a,u);break;case 13:Ln(e,r,a,u);break;case 23:break;case 22:y=r.stateNode,S=r.alternate,r.memoizedState!==null?y._visibility&2?Ln(e,r,a,u):Wa(e,r):y._visibility&2?Ln(e,r,a,u):(y._visibility|=2,Do(e,r,a,u,(r.subtreeFlags&10256)!==0||!1)),p&2048&&zd(S,r);break;case 24:Ln(e,r,a,u),p&2048&&Dd(r.alternate,r);break;default:Ln(e,r,a,u)}}function Do(e,r,a,u,p){for(p=p&&((r.subtreeFlags&10256)!==0||!1),r=r.child;r!==null;){var y=e,S=r,N=a,Y=u,tt=S.flags;switch(S.tag){case 0:case 11:case 15:Do(y,S,N,Y,p),Ka(8,S);break;case 23:break;case 22:var ot=S.stateNode;S.memoizedState!==null?ot._visibility&2?Do(y,S,N,Y,p):Wa(y,S):(ot._visibility|=2,Do(y,S,N,Y,p)),p&&tt&2048&&zd(S.alternate,S);break;case 24:Do(y,S,N,Y,p),p&&tt&2048&&Dd(S.alternate,S);break;default:Do(y,S,N,Y,p)}r=r.sibling}}function Wa(e,r){if(r.subtreeFlags&10256)for(r=r.child;r!==null;){var a=e,u=r,p=u.flags;switch(u.tag){case 22:Wa(a,u),p&2048&&zd(u.alternate,u);break;case 24:Wa(a,u),p&2048&&Dd(u.alternate,u);break;default:Wa(a,u)}r=r.sibling}}var ts=8192;function Lo(e,r,a){if(e.subtreeFlags&ts)for(e=e.child;e!==null;)h0(e,r,a),e=e.sibling}function h0(e,r,a){switch(e.tag){case 26:Lo(e,r,a),e.flags&ts&&e.memoizedState!==null&&bC(a,Dn,e.memoizedState,e.memoizedProps);break;case 5:Lo(e,r,a);break;case 3:case 4:var u=Dn;Dn=Eu(e.stateNode.containerInfo),Lo(e,r,a),Dn=u;break;case 22:e.memoizedState===null&&(u=e.alternate,u!==null&&u.memoizedState!==null?(u=ts,ts=16777216,Lo(e,r,a),ts=u):Lo(e,r,a));break;default:Lo(e,r,a)}}function p0(e){var r=e.alternate;if(r!==null&&(e=r.child,e!==null)){r.child=null;do r=e.sibling,e.sibling=null,e=r;while(e!==null)}}function es(e){var r=e.deletions;if((e.flags&16)!==0){if(r!==null)for(var a=0;a<r.length;a++){var u=r[a];we=u,g0(u,e)}p0(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)m0(e),e=e.sibling}function m0(e){switch(e.tag){case 0:case 11:case 15:es(e),e.flags&2048&&Gi(9,e,e.return);break;case 3:es(e);break;case 12:es(e);break;case 22:var r=e.stateNode;e.memoizedState!==null&&r._visibility&2&&(e.return===null||e.return.tag!==13)?(r._visibility&=-3,cu(e)):es(e);break;default:es(e)}}function cu(e){var r=e.deletions;if((e.flags&16)!==0){if(r!==null)for(var a=0;a<r.length;a++){var u=r[a];we=u,g0(u,e)}p0(e)}for(e=e.child;e!==null;){switch(r=e,r.tag){case 0:case 11:case 15:Gi(8,r,r.return),cu(r);break;case 22:a=r.stateNode,a._visibility&2&&(a._visibility&=-3,cu(r));break;default:cu(r)}e=e.sibling}}function g0(e,r){for(;we!==null;){var a=we;switch(a.tag){case 0:case 11:case 15:Gi(8,a,r);break;case 23:case 22:if(a.memoizedState!==null&&a.memoizedState.cachePool!==null){var u=a.memoizedState.cachePool.pool;u!=null&&u.refCount++}break;case 24:Ha(a.memoizedState.cache)}if(u=a.child,u!==null)u.return=a,we=u;else t:for(a=e;we!==null;){u=we;var p=u.sibling,y=u.return;if(a0(u),u===a){we=null;break t}if(p!==null){p.return=y,we=p;break t}we=y}}}var L_={getCacheForType:function(e){var r=Te(pe),a=r.data.get(e);return a===void 0&&(a=e(),r.data.set(e,a)),a},cacheSignal:function(){return Te(pe).controller.signal}},j_=typeof WeakMap=="function"?WeakMap:Map,qt=0,Jt=null,Ot=null,Dt=0,Xt=0,on=null,Qi=!1,jo=!1,Ld=!1,Si=0,le=0,$i=0,Hr=0,jd=0,an=0,Bo=0,ns=null,Fe=null,Bd=!1,fu=0,y0=0,du=1/0,hu=null,Zi=null,Se=0,Ki=null,Ho=null,wi=0,Hd=0,Pd=null,v0=null,is=0,Id=null;function sn(){return(qt&2)!==0&&Dt!==0?Dt&-Dt:O.T!==null?Xd():yl()}function x0(){if(an===0)if((Dt&536870912)===0||Bt){var e=ao;ao<<=1,(ao&3932160)===0&&(ao=262144),an=e}else an=536870912;return e=nn.current,e!==null&&(e.flags|=32),an}function Ye(e,r,a){(e===Jt&&(Xt===2||Xt===9)||e.cancelPendingCommit!==null)&&(Po(e,0),Ji(e,Dt,an,!1)),xr(e,a),((qt&2)===0||e!==Jt)&&(e===Jt&&((qt&2)===0&&(Hr|=a),le===4&&Ji(e,Dt,an,!1)),Gn(e))}function b0(e,r,a){if((qt&6)!==0)throw Error(o(327));var u=!a&&(r&127)===0&&(r&e.expiredLanes)===0||vr(e,r),p=u?P_(e,r):Vd(e,r,!0),y=u;do{if(p===0){jo&&!u&&Ji(e,r,0,!1);break}else{if(a=e.current.alternate,y&&!B_(a)){p=Vd(e,r,!1),y=!1;continue}if(p===2){if(y=r,e.errorRecoveryDisabledLanes&y)var S=0;else S=e.pendingLanes&-536870913,S=S!==0?S:S&536870912?536870912:0;if(S!==0){r=S;t:{var N=e;p=ns;var Y=N.current.memoizedState.isDehydrated;if(Y&&(Po(N,S).flags|=256),S=Vd(N,S,!1),S!==2){if(Ld&&!Y){N.errorRecoveryDisabledLanes|=y,Hr|=y,p=4;break t}y=Fe,Fe=p,y!==null&&(Fe===null?Fe=y:Fe.push.apply(Fe,y))}p=S}if(y=!1,p!==2)continue}}if(p===1){Po(e,0),Ji(e,r,0,!0);break}t:{switch(u=e,y=p,y){case 0:case 1:throw Error(o(345));case 4:if((r&4194048)!==r)break;case 6:Ji(u,r,an,!Qi);break t;case 2:Fe=null;break;case 3:case 5:break;default:throw Error(o(329))}if((r&62914560)===r&&(p=fu+300-ue(),10<p)){if(Ji(u,r,an,!Qi),lo(u,0,!0)!==0)break t;wi=r,u.timeoutHandle=K0(S0.bind(null,u,a,Fe,hu,Bd,r,an,Hr,Bo,Qi,y,"Throttled",-0,0),p);break t}S0(u,a,Fe,hu,Bd,r,an,Hr,Bo,Qi,y,null,-0,0)}}break}while(!0);Gn(e)}function S0(e,r,a,u,p,y,S,N,Y,tt,ot,st,nt,rt){if(e.timeoutHandle=-1,st=r.subtreeFlags,st&8192||(st&16785408)===16785408){st={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:si},h0(r,y,st);var mt=(y&62914560)===y?fu-ue():(y&4194048)===y?y0-ue():0;if(mt=SC(st,mt),mt!==null){wi=y,e.cancelPendingCommit=mt(k0.bind(null,e,r,y,a,u,p,S,N,Y,ot,st,null,nt,rt)),Ji(e,y,S,!tt);return}}k0(e,r,y,a,u,p,S,N,Y)}function B_(e){for(var r=e;;){var a=r.tag;if((a===0||a===11||a===15)&&r.flags&16384&&(a=r.updateQueue,a!==null&&(a=a.stores,a!==null)))for(var u=0;u<a.length;u++){var p=a[u],y=p.getSnapshot;p=p.value;try{if(!tn(y(),p))return!1}catch{return!1}}if(a=r.child,r.subtreeFlags&16384&&a!==null)a.return=r,r=a;else{if(r===e)break;for(;r.sibling===null;){if(r.return===null||r.return===e)return!0;r=r.return}r.sibling.return=r.return,r=r.sibling}}return!0}function Ji(e,r,a,u){r&=~jd,r&=~Hr,e.suspendedLanes|=r,e.pingedLanes&=~r,u&&(e.warmLanes|=r),u=e.expirationTimes;for(var p=r;0<p;){var y=31-Yt(p),S=1<<y;u[y]=-1,p&=~S}a!==0&&pl(e,a,r)}function pu(){return(qt&6)===0?(rs(0),!1):!0}function Ud(){if(Ot!==null){if(Xt===0)var e=Ot.return;else e=Ot,fi=kr=null,id(e),ko=null,Ia=0,e=Ot;for(;e!==null;)Jy(e.alternate,e),e=e.return;Ot=null}}function Po(e,r){var a=e.timeoutHandle;a!==-1&&(e.timeoutHandle=-1,iC(a)),a=e.cancelPendingCommit,a!==null&&(e.cancelPendingCommit=null,a()),wi=0,Ud(),Jt=e,Ot=a=ui(e.current,null),Dt=r,Xt=0,on=null,Qi=!1,jo=vr(e,r),Ld=!1,Bo=an=jd=Hr=$i=le=0,Fe=ns=null,Bd=!1,(r&8)!==0&&(r|=r&32);var u=e.entangledLanes;if(u!==0)for(e=e.entanglements,u&=r;0<u;){var p=31-Yt(u),y=1<<p;r|=e[p],u&=~y}return Si=r,Ll(),a}function w0(e,r){Nt=null,O.H=Qa,r===No||r===ql?(r=Hg(),Xt=3):r===Yf?(r=Hg(),Xt=4):Xt=r===xd?8:r!==null&&typeof r=="object"&&typeof r.then=="function"?6:1,on=r,Ot===null&&(le=1,iu(e,xn(r,e.current)))}function E0(){var e=nn.current;return e===null?!0:(Dt&4194048)===Dt?En===null:(Dt&62914560)===Dt||(Dt&536870912)!==0?e===En:!1}function _0(){var e=O.H;return O.H=Qa,e===null?Qa:e}function C0(){var e=O.A;return O.A=L_,e}function mu(){le=4,Qi||(Dt&4194048)!==Dt&&nn.current!==null||(jo=!0),($i&134217727)===0&&(Hr&134217727)===0||Jt===null||Ji(Jt,Dt,an,!1)}function Vd(e,r,a){var u=qt;qt|=2;var p=_0(),y=C0();(Jt!==e||Dt!==r)&&(hu=null,Po(e,r)),r=!1;var S=le;t:do try{if(Xt!==0&&Ot!==null){var N=Ot,Y=on;switch(Xt){case 8:Ud(),S=6;break t;case 3:case 2:case 9:case 6:nn.current===null&&(r=!0);var tt=Xt;if(Xt=0,on=null,Io(e,N,Y,tt),a&&jo){S=0;break t}break;default:tt=Xt,Xt=0,on=null,Io(e,N,Y,tt)}}H_(),S=le;break}catch(ot){w0(e,ot)}while(!0);return r&&e.shellSuspendCounter++,fi=kr=null,qt=u,O.H=p,O.A=y,Ot===null&&(Jt=null,Dt=0,Ll()),S}function H_(){for(;Ot!==null;)T0(Ot)}function P_(e,r){var a=qt;qt|=2;var u=_0(),p=C0();Jt!==e||Dt!==r?(hu=null,du=ue()+500,Po(e,r)):jo=vr(e,r);t:do try{if(Xt!==0&&Ot!==null){r=Ot;var y=on;e:switch(Xt){case 1:Xt=0,on=null,Io(e,r,y,1);break;case 2:case 9:if(jg(y)){Xt=0,on=null,M0(r);break}r=function(){Xt!==2&&Xt!==9||Jt!==e||(Xt=7),Gn(e)},y.then(r,r);break t;case 3:Xt=7;break t;case 4:Xt=5;break t;case 7:jg(y)?(Xt=0,on=null,M0(r)):(Xt=0,on=null,Io(e,r,y,7));break;case 5:var S=null;switch(Ot.tag){case 26:S=Ot.memoizedState;case 5:case 27:var N=Ot;if(S?dv(S):N.stateNode.complete){Xt=0,on=null;var Y=N.sibling;if(Y!==null)Ot=Y;else{var tt=N.return;tt!==null?(Ot=tt,gu(tt)):Ot=null}break e}}Xt=0,on=null,Io(e,r,y,5);break;case 6:Xt=0,on=null,Io(e,r,y,6);break;case 8:Ud(),le=6;break t;default:throw Error(o(462))}}I_();break}catch(ot){w0(e,ot)}while(!0);return fi=kr=null,O.H=u,O.A=p,qt=a,Ot!==null?0:(Jt=null,Dt=0,Ll(),le)}function I_(){for(;Ot!==null&&!yn();)T0(Ot)}function T0(e){var r=Zy(e.alternate,e,Si);e.memoizedProps=e.pendingProps,r===null?gu(e):Ot=r}function M0(e){var r=e,a=r.alternate;switch(r.tag){case 15:case 0:r=Fy(a,r,r.pendingProps,r.type,void 0,Dt);break;case 11:r=Fy(a,r,r.pendingProps,r.type.render,r.ref,Dt);break;case 5:id(r);default:Jy(a,r),r=Ot=Cg(r,Si),r=Zy(a,r,Si)}e.memoizedProps=e.pendingProps,r===null?gu(e):Ot=r}function Io(e,r,a,u){fi=kr=null,id(r),ko=null,Ia=0;var p=r.return;try{if(N_(e,p,r,a,Dt)){le=1,iu(e,xn(a,e.current)),Ot=null;return}}catch(y){if(p!==null)throw Ot=p,y;le=1,iu(e,xn(a,e.current)),Ot=null;return}r.flags&32768?(Bt||u===1?e=!0:jo||(Dt&536870912)!==0?e=!1:(Qi=e=!0,(u===2||u===9||u===3||u===6)&&(u=nn.current,u!==null&&u.tag===13&&(u.flags|=16384))),N0(r,e)):gu(r)}function gu(e){var r=e;do{if((r.flags&32768)!==0){N0(r,Qi);return}e=r.return;var a=R_(r.alternate,r,Si);if(a!==null){Ot=a;return}if(r=r.sibling,r!==null){Ot=r;return}Ot=r=e}while(r!==null);le===0&&(le=5)}function N0(e,r){do{var a=O_(e.alternate,e);if(a!==null){a.flags&=32767,Ot=a;return}if(a=e.return,a!==null&&(a.flags|=32768,a.subtreeFlags=0,a.deletions=null),!r&&(e=e.sibling,e!==null)){Ot=e;return}Ot=e=a}while(e!==null);le=6,Ot=null}function k0(e,r,a,u,p,y,S,N,Y){e.cancelPendingCommit=null;do yu();while(Se!==0);if((qt&6)!==0)throw Error(o(327));if(r!==null){if(r===e.current)throw Error(o(177));if(y=r.lanes|r.childLanes,y|=Af,af(e,a,y,S,N,Y),e===Jt&&(Ot=Jt=null,Dt=0),Ho=r,Ki=e,wi=a,Hd=y,Pd=p,v0=u,(r.subtreeFlags&10256)!==0||(r.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,F_(gt,function(){return D0(),null})):(e.callbackNode=null,e.callbackPriority=0),u=(r.flags&13878)!==0,(r.subtreeFlags&13878)!==0||u){u=O.T,O.T=null,p=U.p,U.p=2,S=qt,qt|=4;try{z_(e,r,a)}finally{qt=S,U.p=p,O.T=u}}Se=1,A0(),R0(),O0()}}function A0(){if(Se===1){Se=0;var e=Ki,r=Ho,a=(r.flags&13878)!==0;if((r.subtreeFlags&13878)!==0||a){a=O.T,O.T=null;var u=U.p;U.p=2;var p=qt;qt|=4;try{c0(r,e);var y=th,S=gg(e.containerInfo),N=y.focusedElem,Y=y.selectionRange;if(S!==N&&N&&N.ownerDocument&&mg(N.ownerDocument.documentElement,N)){if(Y!==null&&Cf(N)){var tt=Y.start,ot=Y.end;if(ot===void 0&&(ot=tt),"selectionStart"in N)N.selectionStart=tt,N.selectionEnd=Math.min(ot,N.value.length);else{var st=N.ownerDocument||document,nt=st&&st.defaultView||window;if(nt.getSelection){var rt=nt.getSelection(),mt=N.textContent.length,_t=Math.min(Y.start,mt),Kt=Y.end===void 0?_t:Math.min(Y.end,mt);!rt.extend&&_t>Kt&&(S=Kt,Kt=_t,_t=S);var Z=pg(N,_t),Q=pg(N,Kt);if(Z&&Q&&(rt.rangeCount!==1||rt.anchorNode!==Z.node||rt.anchorOffset!==Z.offset||rt.focusNode!==Q.node||rt.focusOffset!==Q.offset)){var W=st.createRange();W.setStart(Z.node,Z.offset),rt.removeAllRanges(),_t>Kt?(rt.addRange(W),rt.extend(Q.node,Q.offset)):(W.setEnd(Q.node,Q.offset),rt.addRange(W))}}}}for(st=[],rt=N;rt=rt.parentNode;)rt.nodeType===1&&st.push({element:rt,left:rt.scrollLeft,top:rt.scrollTop});for(typeof N.focus=="function"&&N.focus(),N=0;N<st.length;N++){var at=st[N];at.element.scrollLeft=at.left,at.element.scrollTop=at.top}}ku=!!Wd,th=Wd=null}finally{qt=p,U.p=u,O.T=a}}e.current=r,Se=2}}function R0(){if(Se===2){Se=0;var e=Ki,r=Ho,a=(r.flags&8772)!==0;if((r.subtreeFlags&8772)!==0||a){a=O.T,O.T=null;var u=U.p;U.p=2;var p=qt;qt|=4;try{o0(e,r.alternate,r)}finally{qt=p,U.p=u,O.T=a}}Se=3}}function O0(){if(Se===4||Se===3){Se=0,An();var e=Ki,r=Ho,a=wi,u=v0;(r.subtreeFlags&10256)!==0||(r.flags&10256)!==0?Se=5:(Se=0,Ho=Ki=null,z0(e,e.pendingLanes));var p=e.pendingLanes;if(p===0&&(Zi=null),Ea(a),r=r.stateNode,ce&&typeof ce.onCommitFiberRoot=="function")try{ce.onCommitFiberRoot(_e,r,void 0,(r.current.flags&128)===128)}catch{}if(u!==null){r=O.T,p=U.p,U.p=2,O.T=null;try{for(var y=e.onRecoverableError,S=0;S<u.length;S++){var N=u[S];y(N.value,{componentStack:N.stack})}}finally{O.T=r,U.p=p}}(wi&3)!==0&&yu(),Gn(e),p=e.pendingLanes,(a&261930)!==0&&(p&42)!==0?e===Id?is++:(is=0,Id=e):is=0,rs(0)}}function z0(e,r){(e.pooledCacheLanes&=r)===0&&(r=e.pooledCache,r!=null&&(e.pooledCache=null,Ha(r)))}function yu(){return A0(),R0(),O0(),D0()}function D0(){if(Se!==5)return!1;var e=Ki,r=Hd;Hd=0;var a=Ea(wi),u=O.T,p=U.p;try{U.p=32>a?32:a,O.T=null,a=Pd,Pd=null;var y=Ki,S=wi;if(Se=0,Ho=Ki=null,wi=0,(qt&6)!==0)throw Error(o(331));var N=qt;if(qt|=4,m0(y.current),d0(y,y.current,S,a),qt=N,rs(0,!1),ce&&typeof ce.onPostCommitFiberRoot=="function")try{ce.onPostCommitFiberRoot(_e,y)}catch{}return!0}finally{U.p=p,O.T=u,z0(e,r)}}function L0(e,r,a){r=xn(a,r),r=vd(e.stateNode,r,2),e=Fi(e,r,2),e!==null&&(xr(e,2),Gn(e))}function Gt(e,r,a){if(e.tag===3)L0(e,e,a);else for(;r!==null;){if(r.tag===3){L0(r,e,a);break}else if(r.tag===1){var u=r.stateNode;if(typeof r.type.getDerivedStateFromError=="function"||typeof u.componentDidCatch=="function"&&(Zi===null||!Zi.has(u))){e=xn(a,e),a=jy(2),u=Fi(r,a,2),u!==null&&(By(a,u,r,e),xr(u,2),Gn(u));break}}r=r.return}}function qd(e,r,a){var u=e.pingCache;if(u===null){u=e.pingCache=new j_;var p=new Set;u.set(r,p)}else p=u.get(r),p===void 0&&(p=new Set,u.set(r,p));p.has(a)||(Ld=!0,p.add(a),e=U_.bind(null,e,r,a),r.then(e,e))}function U_(e,r,a){var u=e.pingCache;u!==null&&u.delete(r),e.pingedLanes|=e.suspendedLanes&a,e.warmLanes&=~a,Jt===e&&(Dt&a)===a&&(le===4||le===3&&(Dt&62914560)===Dt&&300>ue()-fu?(qt&2)===0&&Po(e,0):jd|=a,Bo===Dt&&(Bo=0)),Gn(e)}function j0(e,r){r===0&&(r=hl()),e=Tr(e,r),e!==null&&(xr(e,r),Gn(e))}function V_(e){var r=e.memoizedState,a=0;r!==null&&(a=r.retryLane),j0(e,a)}function q_(e,r){var a=0;switch(e.tag){case 31:case 13:var u=e.stateNode,p=e.memoizedState;p!==null&&(a=p.retryLane);break;case 19:u=e.stateNode;break;case 22:u=e.stateNode._retryCache;break;default:throw Error(o(314))}u!==null&&u.delete(r),j0(e,a)}function F_(e,r){return Ae(e,r)}var vu=null,Uo=null,Fd=!1,xu=!1,Yd=!1,Wi=0;function Gn(e){e!==Uo&&e.next===null&&(Uo===null?vu=Uo=e:Uo=Uo.next=e),xu=!0,Fd||(Fd=!0,X_())}function rs(e,r){if(!Yd&&xu){Yd=!0;do for(var a=!1,u=vu;u!==null;){if(e!==0){var p=u.pendingLanes;if(p===0)var y=0;else{var S=u.suspendedLanes,N=u.pingedLanes;y=(1<<31-Yt(42|e)+1)-1,y&=p&~(S&~N),y=y&201326741?y&201326741|1:y?y|2:0}y!==0&&(a=!0,I0(u,y))}else y=Dt,y=lo(u,u===Jt?y:0,u.cancelPendingCommit!==null||u.timeoutHandle!==-1),(y&3)===0||vr(u,y)||(a=!0,I0(u,y));u=u.next}while(a);Yd=!1}}function Y_(){B0()}function B0(){xu=Fd=!1;var e=0;Wi!==0&&nC()&&(e=Wi);for(var r=ue(),a=null,u=vu;u!==null;){var p=u.next,y=H0(u,r);y===0?(u.next=null,a===null?vu=p:a.next=p,p===null&&(Uo=a)):(a=u,(e!==0||(y&3)!==0)&&(xu=!0)),u=p}Se!==0&&Se!==5||rs(e),Wi!==0&&(Wi=0)}function H0(e,r){for(var a=e.suspendedLanes,u=e.pingedLanes,p=e.expirationTimes,y=e.pendingLanes&-62914561;0<y;){var S=31-Yt(y),N=1<<S,Y=p[S];Y===-1?((N&a)===0||(N&u)!==0)&&(p[S]=of(N,r)):Y<=r&&(e.expiredLanes|=N),y&=~N}if(r=Jt,a=Dt,a=lo(e,e===r?a:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),u=e.callbackNode,a===0||e===r&&(Xt===2||Xt===9)||e.cancelPendingCommit!==null)return u!==null&&u!==null&&Je(u),e.callbackNode=null,e.callbackPriority=0;if((a&3)===0||vr(e,a)){if(r=a&-a,r===e.callbackPriority)return r;switch(u!==null&&Je(u),Ea(a)){case 2:case 8:a=ut;break;case 32:a=gt;break;case 268435456:a=Pt;break;default:a=gt}return u=P0.bind(null,e),a=Ae(a,u),e.callbackPriority=r,e.callbackNode=a,r}return u!==null&&u!==null&&Je(u),e.callbackPriority=2,e.callbackNode=null,2}function P0(e,r){if(Se!==0&&Se!==5)return e.callbackNode=null,e.callbackPriority=0,null;var a=e.callbackNode;if(yu()&&e.callbackNode!==a)return null;var u=Dt;return u=lo(e,e===Jt?u:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),u===0?null:(b0(e,u,r),H0(e,ue()),e.callbackNode!=null&&e.callbackNode===a?P0.bind(null,e):null)}function I0(e,r){if(yu())return null;b0(e,r,!0)}function X_(){rC(function(){(qt&6)!==0?Ae(et,Y_):B0()})}function Xd(){if(Wi===0){var e=To;e===0&&(e=oo,oo<<=1,(oo&261888)===0&&(oo=256)),Wi=e}return Wi}function U0(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Ml(""+e)}function V0(e,r){var a=r.ownerDocument.createElement("input");return a.name=r.name,a.value=r.value,e.id&&a.setAttribute("form",e.id),r.parentNode.insertBefore(a,r),e=new FormData(e),a.parentNode.removeChild(a),e}function G_(e,r,a,u,p){if(r==="submit"&&a&&a.stateNode===p){var y=U0((p[Oe]||null).action),S=u.submitter;S&&(r=(r=S[Oe]||null)?U0(r.formAction):S.getAttribute("formAction"),r!==null&&(y=r,S=null));var N=new Rl("action","action",null,u,p);e.push({event:N,listeners:[{instance:null,listener:function(){if(u.defaultPrevented){if(Wi!==0){var Y=S?V0(p,S):new FormData(p);dd(a,{pending:!0,data:Y,method:p.method,action:y},null,Y)}}else typeof y=="function"&&(N.preventDefault(),Y=S?V0(p,S):new FormData(p),dd(a,{pending:!0,data:Y,method:p.method,action:y},y,Y))},currentTarget:p}]})}}for(var Gd=0;Gd<kf.length;Gd++){var Qd=kf[Gd],Q_=Qd.toLowerCase(),$_=Qd[0].toUpperCase()+Qd.slice(1);zn(Q_,"on"+$_)}zn(xg,"onAnimationEnd"),zn(bg,"onAnimationIteration"),zn(Sg,"onAnimationStart"),zn("dblclick","onDoubleClick"),zn("focusin","onFocus"),zn("focusout","onBlur"),zn(f_,"onTransitionRun"),zn(d_,"onTransitionStart"),zn(h_,"onTransitionCancel"),zn(wg,"onTransitionEnd"),ji("onMouseEnter",["mouseout","mouseover"]),ji("onMouseLeave",["mouseout","mouseover"]),ji("onPointerEnter",["pointerout","pointerover"]),ji("onPointerLeave",["pointerout","pointerover"]),oi("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),oi("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),oi("onBeforeInput",["compositionend","keypress","textInput","paste"]),oi("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),oi("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),oi("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var os="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(" "),Z_=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(os));function q0(e,r){r=(r&4)!==0;for(var a=0;a<e.length;a++){var u=e[a],p=u.event;u=u.listeners;t:{var y=void 0;if(r)for(var S=u.length-1;0<=S;S--){var N=u[S],Y=N.instance,tt=N.currentTarget;if(N=N.listener,Y!==y&&p.isPropagationStopped())break t;y=N,p.currentTarget=tt;try{y(p)}catch(ot){Dl(ot)}p.currentTarget=null,y=Y}else for(S=0;S<u.length;S++){if(N=u[S],Y=N.instance,tt=N.currentTarget,N=N.listener,Y!==y&&p.isPropagationStopped())break t;y=N,p.currentTarget=tt;try{y(p)}catch(ot){Dl(ot)}p.currentTarget=null,y=Y}}}}function zt(e,r){var a=r[uo];a===void 0&&(a=r[uo]=new Set);var u=e+"__bubble";a.has(u)||(F0(r,e,2,!1),a.add(u))}function $d(e,r,a){var u=0;r&&(u|=4),F0(a,e,u,r)}var bu="_reactListening"+Math.random().toString(36).slice(2);function Zd(e){if(!e[bu]){e[bu]=!0,Sl.forEach(function(a){a!=="selectionchange"&&(Z_.has(a)||$d(a,!1,e),$d(a,!0,e))});var r=e.nodeType===9?e:e.ownerDocument;r===null||r[bu]||(r[bu]=!0,$d("selectionchange",!1,r))}}function F0(e,r,a,u){switch(xv(r)){case 2:var p=_C;break;case 8:p=CC;break;default:p=fh}a=p.bind(null,r,a,e),p=void 0,!gf||r!=="touchstart"&&r!=="touchmove"&&r!=="wheel"||(p=!0),u?p!==void 0?e.addEventListener(r,a,{capture:!0,passive:p}):e.addEventListener(r,a,!0):p!==void 0?e.addEventListener(r,a,{passive:p}):e.addEventListener(r,a,!1)}function Kd(e,r,a,u,p){var y=u;if((r&1)===0&&(r&2)===0&&u!==null)t:for(;;){if(u===null)return;var S=u.tag;if(S===3||S===4){var N=u.stateNode.containerInfo;if(N===p)break;if(S===4)for(S=u.return;S!==null;){var Y=S.tag;if((Y===3||Y===4)&&S.stateNode.containerInfo===p)return;S=S.return}for(;N!==null;){if(S=Oi(N),S===null)return;if(Y=S.tag,Y===5||Y===6||Y===26||Y===27){u=y=S;continue t}N=N.parentNode}}u=u.return}$m(function(){var tt=y,ot=pf(a),st=[];t:{var nt=Eg.get(e);if(nt!==void 0){var rt=Rl,mt=e;switch(e){case"keypress":if(kl(a)===0)break t;case"keydown":case"keyup":rt=qE;break;case"focusin":mt="focus",rt=bf;break;case"focusout":mt="blur",rt=bf;break;case"beforeblur":case"afterblur":rt=bf;break;case"click":if(a.button===2)break t;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":rt=Jm;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":rt=RE;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":rt=XE;break;case xg:case bg:case Sg:rt=DE;break;case wg:rt=QE;break;case"scroll":case"scrollend":rt=kE;break;case"wheel":rt=ZE;break;case"copy":case"cut":case"paste":rt=jE;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":rt=tg;break;case"toggle":case"beforetoggle":rt=JE}var _t=(r&4)!==0,Kt=!_t&&(e==="scroll"||e==="scrollend"),Z=_t?nt!==null?nt+"Capture":null:nt;_t=[];for(var Q=tt,W;Q!==null;){var at=Q;if(W=at.stateNode,at=at.tag,at!==5&&at!==26&&at!==27||W===null||Z===null||(at=Ma(Q,Z),at!=null&&_t.push(as(Q,at,W))),Kt)break;Q=Q.return}0<_t.length&&(nt=new rt(nt,mt,null,a,ot),st.push({event:nt,listeners:_t}))}}if((r&7)===0){t:{if(nt=e==="mouseover"||e==="pointerover",rt=e==="mouseout"||e==="pointerout",nt&&a!==hf&&(mt=a.relatedTarget||a.fromElement)&&(Oi(mt)||mt[ri]))break t;if((rt||nt)&&(nt=ot.window===ot?ot:(nt=ot.ownerDocument)?nt.defaultView||nt.parentWindow:window,rt?(mt=a.relatedTarget||a.toElement,rt=tt,mt=mt?Oi(mt):null,mt!==null&&(Kt=l(mt),_t=mt.tag,mt!==Kt||_t!==5&&_t!==27&&_t!==6)&&(mt=null)):(rt=null,mt=tt),rt!==mt)){if(_t=Jm,at="onMouseLeave",Z="onMouseEnter",Q="mouse",(e==="pointerout"||e==="pointerover")&&(_t=tg,at="onPointerLeave",Z="onPointerEnter",Q="pointer"),Kt=rt==null?nt:Di(rt),W=mt==null?nt:Di(mt),nt=new _t(at,Q+"leave",rt,a,ot),nt.target=Kt,nt.relatedTarget=W,at=null,Oi(ot)===tt&&(_t=new _t(Z,Q+"enter",mt,a,ot),_t.target=W,_t.relatedTarget=Kt,at=_t),Kt=at,rt&&mt)e:{for(_t=K_,Z=rt,Q=mt,W=0,at=Z;at;at=_t(at))W++;at=0;for(var xt=Q;xt;xt=_t(xt))at++;for(;0<W-at;)Z=_t(Z),W--;for(;0<at-W;)Q=_t(Q),at--;for(;W--;){if(Z===Q||Q!==null&&Z===Q.alternate){_t=Z;break e}Z=_t(Z),Q=_t(Q)}_t=null}else _t=null;rt!==null&&Y0(st,nt,rt,_t,!1),mt!==null&&Kt!==null&&Y0(st,Kt,mt,_t,!0)}}t:{if(nt=tt?Di(tt):window,rt=nt.nodeName&&nt.nodeName.toLowerCase(),rt==="select"||rt==="input"&&nt.type==="file")var Ut=lg;else if(ag(nt))if(ug)Ut=l_;else{Ut=a_;var yt=o_}else rt=nt.nodeName,!rt||rt.toLowerCase()!=="input"||nt.type!=="checkbox"&&nt.type!=="radio"?tt&&df(tt.elementType)&&(Ut=lg):Ut=s_;if(Ut&&(Ut=Ut(e,tt))){sg(st,Ut,a,ot);break t}yt&&yt(e,nt,tt),e==="focusout"&&tt&&nt.type==="number"&&tt.memoizedProps.value!=null&&Ta(nt,"number",nt.value)}switch(yt=tt?Di(tt):window,e){case"focusin":(ag(yt)||yt.contentEditable==="true")&&(vo=yt,Tf=tt,La=null);break;case"focusout":La=Tf=vo=null;break;case"mousedown":Mf=!0;break;case"contextmenu":case"mouseup":case"dragend":Mf=!1,yg(st,a,ot);break;case"selectionchange":if(c_)break;case"keydown":case"keyup":yg(st,a,ot)}var kt;if(wf)t:{switch(e){case"compositionstart":var Lt="onCompositionStart";break t;case"compositionend":Lt="onCompositionEnd";break t;case"compositionupdate":Lt="onCompositionUpdate";break t}Lt=void 0}else yo?rg(e,a)&&(Lt="onCompositionEnd"):e==="keydown"&&a.keyCode===229&&(Lt="onCompositionStart");Lt&&(eg&&a.locale!=="ko"&&(yo||Lt!=="onCompositionStart"?Lt==="onCompositionEnd"&&yo&&(kt=Zm()):(Bi=ot,yf="value"in Bi?Bi.value:Bi.textContent,yo=!0)),yt=Su(tt,Lt),0<yt.length&&(Lt=new Wm(Lt,e,null,a,ot),st.push({event:Lt,listeners:yt}),kt?Lt.data=kt:(kt=og(a),kt!==null&&(Lt.data=kt)))),(kt=t_?e_(e,a):n_(e,a))&&(Lt=Su(tt,"onBeforeInput"),0<Lt.length&&(yt=new Wm("onBeforeInput","beforeinput",null,a,ot),st.push({event:yt,listeners:Lt}),yt.data=kt)),G_(st,e,tt,a,ot)}q0(st,r)})}function as(e,r,a){return{instance:e,listener:r,currentTarget:a}}function Su(e,r){for(var a=r+"Capture",u=[];e!==null;){var p=e,y=p.stateNode;if(p=p.tag,p!==5&&p!==26&&p!==27||y===null||(p=Ma(e,a),p!=null&&u.unshift(as(e,p,y)),p=Ma(e,r),p!=null&&u.push(as(e,p,y))),e.tag===3)return u;e=e.return}return[]}function K_(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Y0(e,r,a,u,p){for(var y=r._reactName,S=[];a!==null&&a!==u;){var N=a,Y=N.alternate,tt=N.stateNode;if(N=N.tag,Y!==null&&Y===u)break;N!==5&&N!==26&&N!==27||tt===null||(Y=tt,p?(tt=Ma(a,y),tt!=null&&S.unshift(as(a,tt,Y))):p||(tt=Ma(a,y),tt!=null&&S.push(as(a,tt,Y)))),a=a.return}S.length!==0&&e.push({event:r,listeners:S})}var J_=/\r\n?/g,W_=/\u0000|\uFFFD/g;function X0(e){return(typeof e=="string"?e:""+e).replace(J_,`
9
+ `).replace(W_,"")}function G0(e,r){return r=X0(r),X0(e)===r}function Zt(e,r,a,u,p,y){switch(a){case"children":typeof u=="string"?r==="body"||r==="textarea"&&u===""||po(e,u):(typeof u=="number"||typeof u=="bigint")&&r!=="body"&&po(e,""+u);break;case"className":fo(e,"class",u);break;case"tabIndex":fo(e,"tabindex",u);break;case"dir":case"role":case"viewBox":case"width":case"height":fo(e,a,u);break;case"style":Gm(e,u,y);break;case"data":if(r!=="object"){fo(e,"data",u);break}case"src":case"href":if(u===""&&(r!=="a"||a!=="href")){e.removeAttribute(a);break}if(u==null||typeof u=="function"||typeof u=="symbol"||typeof u=="boolean"){e.removeAttribute(a);break}u=Ml(""+u),e.setAttribute(a,u);break;case"action":case"formAction":if(typeof u=="function"){e.setAttribute(a,"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 y=="function"&&(a==="formAction"?(r!=="input"&&Zt(e,r,"name",p.name,p,null),Zt(e,r,"formEncType",p.formEncType,p,null),Zt(e,r,"formMethod",p.formMethod,p,null),Zt(e,r,"formTarget",p.formTarget,p,null)):(Zt(e,r,"encType",p.encType,p,null),Zt(e,r,"method",p.method,p,null),Zt(e,r,"target",p.target,p,null)));if(u==null||typeof u=="symbol"||typeof u=="boolean"){e.removeAttribute(a);break}u=Ml(""+u),e.setAttribute(a,u);break;case"onClick":u!=null&&(e.onclick=si);break;case"onScroll":u!=null&&zt("scroll",e);break;case"onScrollEnd":u!=null&&zt("scrollend",e);break;case"dangerouslySetInnerHTML":if(u!=null){if(typeof u!="object"||!("__html"in u))throw Error(o(61));if(a=u.__html,a!=null){if(p.children!=null)throw Error(o(60));e.innerHTML=a}}break;case"multiple":e.multiple=u&&typeof u!="function"&&typeof u!="symbol";break;case"muted":e.muted=u&&typeof u!="function"&&typeof u!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(u==null||typeof u=="function"||typeof u=="boolean"||typeof u=="symbol"){e.removeAttribute("xlink:href");break}a=Ml(""+u),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",a);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":u!=null&&typeof u!="function"&&typeof u!="symbol"?e.setAttribute(a,""+u):e.removeAttribute(a);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":u&&typeof u!="function"&&typeof u!="symbol"?e.setAttribute(a,""):e.removeAttribute(a);break;case"capture":case"download":u===!0?e.setAttribute(a,""):u!==!1&&u!=null&&typeof u!="function"&&typeof u!="symbol"?e.setAttribute(a,u):e.removeAttribute(a);break;case"cols":case"rows":case"size":case"span":u!=null&&typeof u!="function"&&typeof u!="symbol"&&!isNaN(u)&&1<=u?e.setAttribute(a,u):e.removeAttribute(a);break;case"rowSpan":case"start":u==null||typeof u=="function"||typeof u=="symbol"||isNaN(u)?e.removeAttribute(a):e.setAttribute(a,u);break;case"popover":zt("beforetoggle",e),zt("toggle",e),co(e,"popover",u);break;case"xlinkActuate":On(e,"http://www.w3.org/1999/xlink","xlink:actuate",u);break;case"xlinkArcrole":On(e,"http://www.w3.org/1999/xlink","xlink:arcrole",u);break;case"xlinkRole":On(e,"http://www.w3.org/1999/xlink","xlink:role",u);break;case"xlinkShow":On(e,"http://www.w3.org/1999/xlink","xlink:show",u);break;case"xlinkTitle":On(e,"http://www.w3.org/1999/xlink","xlink:title",u);break;case"xlinkType":On(e,"http://www.w3.org/1999/xlink","xlink:type",u);break;case"xmlBase":On(e,"http://www.w3.org/XML/1998/namespace","xml:base",u);break;case"xmlLang":On(e,"http://www.w3.org/XML/1998/namespace","xml:lang",u);break;case"xmlSpace":On(e,"http://www.w3.org/XML/1998/namespace","xml:space",u);break;case"is":co(e,"is",u);break;case"innerText":case"textContent":break;default:(!(2<a.length)||a[0]!=="o"&&a[0]!=="O"||a[1]!=="n"&&a[1]!=="N")&&(a=ME.get(a)||a,co(e,a,u))}}function Jd(e,r,a,u,p,y){switch(a){case"style":Gm(e,u,y);break;case"dangerouslySetInnerHTML":if(u!=null){if(typeof u!="object"||!("__html"in u))throw Error(o(61));if(a=u.__html,a!=null){if(p.children!=null)throw Error(o(60));e.innerHTML=a}}break;case"children":typeof u=="string"?po(e,u):(typeof u=="number"||typeof u=="bigint")&&po(e,""+u);break;case"onScroll":u!=null&&zt("scroll",e);break;case"onScrollEnd":u!=null&&zt("scrollend",e);break;case"onClick":u!=null&&(e.onclick=si);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!wl.hasOwnProperty(a))t:{if(a[0]==="o"&&a[1]==="n"&&(p=a.endsWith("Capture"),r=a.slice(2,p?a.length-7:void 0),y=e[Oe]||null,y=y!=null?y[a]:null,typeof y=="function"&&e.removeEventListener(r,y,p),typeof u=="function")){typeof y!="function"&&y!==null&&(a in e?e[a]=null:e.hasAttribute(a)&&e.removeAttribute(a)),e.addEventListener(r,u,p);break t}a in e?e[a]=u:u===!0?e.setAttribute(a,""):co(e,a,u)}}}function Ne(e,r,a){switch(r){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":zt("error",e),zt("load",e);var u=!1,p=!1,y;for(y in a)if(a.hasOwnProperty(y)){var S=a[y];if(S!=null)switch(y){case"src":u=!0;break;case"srcSet":p=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(o(137,r));default:Zt(e,r,y,S,a,null)}}p&&Zt(e,r,"srcSet",a.srcSet,a,null),u&&Zt(e,r,"src",a.src,a,null);return;case"input":zt("invalid",e);var N=y=S=p=null,Y=null,tt=null;for(u in a)if(a.hasOwnProperty(u)){var ot=a[u];if(ot!=null)switch(u){case"name":p=ot;break;case"type":S=ot;break;case"checked":Y=ot;break;case"defaultChecked":tt=ot;break;case"value":y=ot;break;case"defaultValue":N=ot;break;case"children":case"dangerouslySetInnerHTML":if(ot!=null)throw Error(o(137,r));break;default:Zt(e,r,u,ot,a,null)}}Tl(e,y,N,Y,tt,S,p,!1);return;case"select":zt("invalid",e),u=S=y=null;for(p in a)if(a.hasOwnProperty(p)&&(N=a[p],N!=null))switch(p){case"value":y=N;break;case"defaultValue":S=N;break;case"multiple":u=N;default:Zt(e,r,p,N,a,null)}r=y,a=S,e.multiple=!!u,r!=null?ai(e,!!u,r,!1):a!=null&&ai(e,!!u,a,!0);return;case"textarea":zt("invalid",e),y=p=u=null;for(S in a)if(a.hasOwnProperty(S)&&(N=a[S],N!=null))switch(S){case"value":u=N;break;case"defaultValue":p=N;break;case"children":y=N;break;case"dangerouslySetInnerHTML":if(N!=null)throw Error(o(91));break;default:Zt(e,r,S,N,a,null)}Ym(e,u,p,y);return;case"option":for(Y in a)a.hasOwnProperty(Y)&&(u=a[Y],u!=null)&&(Y==="selected"?e.selected=u&&typeof u!="function"&&typeof u!="symbol":Zt(e,r,Y,u,a,null));return;case"dialog":zt("beforetoggle",e),zt("toggle",e),zt("cancel",e),zt("close",e);break;case"iframe":case"object":zt("load",e);break;case"video":case"audio":for(u=0;u<os.length;u++)zt(os[u],e);break;case"image":zt("error",e),zt("load",e);break;case"details":zt("toggle",e);break;case"embed":case"source":case"link":zt("error",e),zt("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(tt in a)if(a.hasOwnProperty(tt)&&(u=a[tt],u!=null))switch(tt){case"children":case"dangerouslySetInnerHTML":throw Error(o(137,r));default:Zt(e,r,tt,u,a,null)}return;default:if(df(r)){for(ot in a)a.hasOwnProperty(ot)&&(u=a[ot],u!==void 0&&Jd(e,r,ot,u,a,void 0));return}}for(N in a)a.hasOwnProperty(N)&&(u=a[N],u!=null&&Zt(e,r,N,u,a,null))}function tC(e,r,a,u){switch(r){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var p=null,y=null,S=null,N=null,Y=null,tt=null,ot=null;for(rt in a){var st=a[rt];if(a.hasOwnProperty(rt)&&st!=null)switch(rt){case"checked":break;case"value":break;case"defaultValue":Y=st;default:u.hasOwnProperty(rt)||Zt(e,r,rt,null,u,st)}}for(var nt in u){var rt=u[nt];if(st=a[nt],u.hasOwnProperty(nt)&&(rt!=null||st!=null))switch(nt){case"type":y=rt;break;case"name":p=rt;break;case"checked":tt=rt;break;case"defaultChecked":ot=rt;break;case"value":S=rt;break;case"defaultValue":N=rt;break;case"children":case"dangerouslySetInnerHTML":if(rt!=null)throw Error(o(137,r));break;default:rt!==st&&Zt(e,r,nt,rt,u,st)}}wr(e,S,N,Y,tt,ot,y,p);return;case"select":rt=S=N=nt=null;for(y in a)if(Y=a[y],a.hasOwnProperty(y)&&Y!=null)switch(y){case"value":break;case"multiple":rt=Y;default:u.hasOwnProperty(y)||Zt(e,r,y,null,u,Y)}for(p in u)if(y=u[p],Y=a[p],u.hasOwnProperty(p)&&(y!=null||Y!=null))switch(p){case"value":nt=y;break;case"defaultValue":N=y;break;case"multiple":S=y;default:y!==Y&&Zt(e,r,p,y,u,Y)}r=N,a=S,u=rt,nt!=null?ai(e,!!a,nt,!1):!!u!=!!a&&(r!=null?ai(e,!!a,r,!0):ai(e,!!a,a?[]:"",!1));return;case"textarea":rt=nt=null;for(N in a)if(p=a[N],a.hasOwnProperty(N)&&p!=null&&!u.hasOwnProperty(N))switch(N){case"value":break;case"children":break;default:Zt(e,r,N,null,u,p)}for(S in u)if(p=u[S],y=a[S],u.hasOwnProperty(S)&&(p!=null||y!=null))switch(S){case"value":nt=p;break;case"defaultValue":rt=p;break;case"children":break;case"dangerouslySetInnerHTML":if(p!=null)throw Error(o(91));break;default:p!==y&&Zt(e,r,S,p,u,y)}Fm(e,nt,rt);return;case"option":for(var mt in a)nt=a[mt],a.hasOwnProperty(mt)&&nt!=null&&!u.hasOwnProperty(mt)&&(mt==="selected"?e.selected=!1:Zt(e,r,mt,null,u,nt));for(Y in u)nt=u[Y],rt=a[Y],u.hasOwnProperty(Y)&&nt!==rt&&(nt!=null||rt!=null)&&(Y==="selected"?e.selected=nt&&typeof nt!="function"&&typeof nt!="symbol":Zt(e,r,Y,nt,u,rt));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 _t in a)nt=a[_t],a.hasOwnProperty(_t)&&nt!=null&&!u.hasOwnProperty(_t)&&Zt(e,r,_t,null,u,nt);for(tt in u)if(nt=u[tt],rt=a[tt],u.hasOwnProperty(tt)&&nt!==rt&&(nt!=null||rt!=null))switch(tt){case"children":case"dangerouslySetInnerHTML":if(nt!=null)throw Error(o(137,r));break;default:Zt(e,r,tt,nt,u,rt)}return;default:if(df(r)){for(var Kt in a)nt=a[Kt],a.hasOwnProperty(Kt)&&nt!==void 0&&!u.hasOwnProperty(Kt)&&Jd(e,r,Kt,void 0,u,nt);for(ot in u)nt=u[ot],rt=a[ot],!u.hasOwnProperty(ot)||nt===rt||nt===void 0&&rt===void 0||Jd(e,r,ot,nt,u,rt);return}}for(var Z in a)nt=a[Z],a.hasOwnProperty(Z)&&nt!=null&&!u.hasOwnProperty(Z)&&Zt(e,r,Z,null,u,nt);for(st in u)nt=u[st],rt=a[st],!u.hasOwnProperty(st)||nt===rt||nt==null&&rt==null||Zt(e,r,st,nt,u,rt)}function Q0(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function eC(){if(typeof performance.getEntriesByType=="function"){for(var e=0,r=0,a=performance.getEntriesByType("resource"),u=0;u<a.length;u++){var p=a[u],y=p.transferSize,S=p.initiatorType,N=p.duration;if(y&&N&&Q0(S)){for(S=0,N=p.responseEnd,u+=1;u<a.length;u++){var Y=a[u],tt=Y.startTime;if(tt>N)break;var ot=Y.transferSize,st=Y.initiatorType;ot&&Q0(st)&&(Y=Y.responseEnd,S+=ot*(Y<N?1:(N-tt)/(Y-tt)))}if(--u,r+=8*(y+S)/(p.duration/1e3),e++,10<e)break}}if(0<e)return r/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var Wd=null,th=null;function wu(e){return e.nodeType===9?e:e.ownerDocument}function $0(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Z0(e,r){if(e===0)switch(r){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&r==="foreignObject"?0:e}function eh(e,r){return e==="textarea"||e==="noscript"||typeof r.children=="string"||typeof r.children=="number"||typeof r.children=="bigint"||typeof r.dangerouslySetInnerHTML=="object"&&r.dangerouslySetInnerHTML!==null&&r.dangerouslySetInnerHTML.__html!=null}var nh=null;function nC(){var e=window.event;return e&&e.type==="popstate"?e===nh?!1:(nh=e,!0):(nh=null,!1)}var K0=typeof setTimeout=="function"?setTimeout:void 0,iC=typeof clearTimeout=="function"?clearTimeout:void 0,J0=typeof Promise=="function"?Promise:void 0,rC=typeof queueMicrotask=="function"?queueMicrotask:typeof J0<"u"?function(e){return J0.resolve(null).then(e).catch(oC)}:K0;function oC(e){setTimeout(function(){throw e})}function tr(e){return e==="head"}function W0(e,r){var a=r,u=0;do{var p=a.nextSibling;if(e.removeChild(a),p&&p.nodeType===8)if(a=p.data,a==="/$"||a==="/&"){if(u===0){e.removeChild(p),Yo(r);return}u--}else if(a==="$"||a==="$?"||a==="$~"||a==="$!"||a==="&")u++;else if(a==="html")ss(e.ownerDocument.documentElement);else if(a==="head"){a=e.ownerDocument.head,ss(a);for(var y=a.firstChild;y;){var S=y.nextSibling,N=y.nodeName;y[br]||N==="SCRIPT"||N==="STYLE"||N==="LINK"&&y.rel.toLowerCase()==="stylesheet"||a.removeChild(y),y=S}}else a==="body"&&ss(e.ownerDocument.body);a=p}while(a);Yo(r)}function tv(e,r){var a=e;e=0;do{var u=a.nextSibling;if(a.nodeType===1?r?(a._stashedDisplay=a.style.display,a.style.display="none"):(a.style.display=a._stashedDisplay||"",a.getAttribute("style")===""&&a.removeAttribute("style")):a.nodeType===3&&(r?(a._stashedText=a.nodeValue,a.nodeValue=""):a.nodeValue=a._stashedText||""),u&&u.nodeType===8)if(a=u.data,a==="/$"){if(e===0)break;e--}else a!=="$"&&a!=="$?"&&a!=="$~"&&a!=="$!"||e++;a=u}while(a)}function ih(e){var r=e.firstChild;for(r&&r.nodeType===10&&(r=r.nextSibling);r;){var a=r;switch(r=r.nextSibling,a.nodeName){case"HTML":case"HEAD":case"BODY":ih(a),_a(a);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(a.rel.toLowerCase()==="stylesheet")continue}e.removeChild(a)}}function aC(e,r,a,u){for(;e.nodeType===1;){var p=a;if(e.nodeName.toLowerCase()!==r.toLowerCase()){if(!u&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(u){if(!e[br])switch(r){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(y=e.getAttribute("rel"),y==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(y!==p.rel||e.getAttribute("href")!==(p.href==null||p.href===""?null:p.href)||e.getAttribute("crossorigin")!==(p.crossOrigin==null?null:p.crossOrigin)||e.getAttribute("title")!==(p.title==null?null:p.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(y=e.getAttribute("src"),(y!==(p.src==null?null:p.src)||e.getAttribute("type")!==(p.type==null?null:p.type)||e.getAttribute("crossorigin")!==(p.crossOrigin==null?null:p.crossOrigin))&&y&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(r==="input"&&e.type==="hidden"){var y=p.name==null?null:""+p.name;if(p.type==="hidden"&&e.getAttribute("name")===y)return e}else return e;if(e=_n(e.nextSibling),e===null)break}return null}function sC(e,r,a){if(r==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!a||(e=_n(e.nextSibling),e===null))return null;return e}function ev(e,r){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!r||(e=_n(e.nextSibling),e===null))return null;return e}function rh(e){return e.data==="$?"||e.data==="$~"}function oh(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function lC(e,r){var a=e.ownerDocument;if(e.data==="$~")e._reactRetry=r;else if(e.data!=="$?"||a.readyState!=="loading")r();else{var u=function(){r(),a.removeEventListener("DOMContentLoaded",u)};a.addEventListener("DOMContentLoaded",u),e._reactRetry=u}}function _n(e){for(;e!=null;e=e.nextSibling){var r=e.nodeType;if(r===1||r===3)break;if(r===8){if(r=e.data,r==="$"||r==="$!"||r==="$?"||r==="$~"||r==="&"||r==="F!"||r==="F")break;if(r==="/$"||r==="/&")return null}}return e}var ah=null;function nv(e){e=e.nextSibling;for(var r=0;e;){if(e.nodeType===8){var a=e.data;if(a==="/$"||a==="/&"){if(r===0)return _n(e.nextSibling);r--}else a!=="$"&&a!=="$!"&&a!=="$?"&&a!=="$~"&&a!=="&"||r++}e=e.nextSibling}return null}function iv(e){e=e.previousSibling;for(var r=0;e;){if(e.nodeType===8){var a=e.data;if(a==="$"||a==="$!"||a==="$?"||a==="$~"||a==="&"){if(r===0)return e;r--}else a!=="/$"&&a!=="/&"||r++}e=e.previousSibling}return null}function rv(e,r,a){switch(r=wu(a),e){case"html":if(e=r.documentElement,!e)throw Error(o(452));return e;case"head":if(e=r.head,!e)throw Error(o(453));return e;case"body":if(e=r.body,!e)throw Error(o(454));return e;default:throw Error(o(451))}}function ss(e){for(var r=e.attributes;r.length;)e.removeAttributeNode(r[0]);_a(e)}var Cn=new Map,ov=new Set;function Eu(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Ei=U.d;U.d={f:uC,r:cC,D:fC,C:dC,L:hC,m:pC,X:gC,S:mC,M:yC};function uC(){var e=Ei.f(),r=pu();return e||r}function cC(e){var r=zi(e);r!==null&&r.tag===5&&r.type==="form"?wy(r):Ei.r(e)}var Vo=typeof document>"u"?null:document;function av(e,r,a){var u=Vo;if(u&&typeof r=="string"&&r){var p=Pe(r);p='link[rel="'+e+'"][href="'+p+'"]',typeof a=="string"&&(p+='[crossorigin="'+a+'"]'),ov.has(p)||(ov.add(p),e={rel:e,crossOrigin:a,href:r},u.querySelector(p)===null&&(r=u.createElement("link"),Ne(r,"link",e),he(r),u.head.appendChild(r)))}}function fC(e){Ei.D(e),av("dns-prefetch",e,null)}function dC(e,r){Ei.C(e,r),av("preconnect",e,r)}function hC(e,r,a){Ei.L(e,r,a);var u=Vo;if(u&&e&&r){var p='link[rel="preload"][as="'+Pe(r)+'"]';r==="image"&&a&&a.imageSrcSet?(p+='[imagesrcset="'+Pe(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(p+='[imagesizes="'+Pe(a.imageSizes)+'"]')):p+='[href="'+Pe(e)+'"]';var y=p;switch(r){case"style":y=qo(e);break;case"script":y=Fo(e)}Cn.has(y)||(e=g({rel:"preload",href:r==="image"&&a&&a.imageSrcSet?void 0:e,as:r},a),Cn.set(y,e),u.querySelector(p)!==null||r==="style"&&u.querySelector(ls(y))||r==="script"&&u.querySelector(us(y))||(r=u.createElement("link"),Ne(r,"link",e),he(r),u.head.appendChild(r)))}}function pC(e,r){Ei.m(e,r);var a=Vo;if(a&&e){var u=r&&typeof r.as=="string"?r.as:"script",p='link[rel="modulepreload"][as="'+Pe(u)+'"][href="'+Pe(e)+'"]',y=p;switch(u){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":y=Fo(e)}if(!Cn.has(y)&&(e=g({rel:"modulepreload",href:e},r),Cn.set(y,e),a.querySelector(p)===null)){switch(u){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(us(y)))return}u=a.createElement("link"),Ne(u,"link",e),he(u),a.head.appendChild(u)}}}function mC(e,r,a){Ei.S(e,r,a);var u=Vo;if(u&&e){var p=Li(u).hoistableStyles,y=qo(e);r=r||"default";var S=p.get(y);if(!S){var N={loading:0,preload:null};if(S=u.querySelector(ls(y)))N.loading=5;else{e=g({rel:"stylesheet",href:e,"data-precedence":r},a),(a=Cn.get(y))&&sh(e,a);var Y=S=u.createElement("link");he(Y),Ne(Y,"link",e),Y._p=new Promise(function(tt,ot){Y.onload=tt,Y.onerror=ot}),Y.addEventListener("load",function(){N.loading|=1}),Y.addEventListener("error",function(){N.loading|=2}),N.loading|=4,_u(S,r,u)}S={type:"stylesheet",instance:S,count:1,state:N},p.set(y,S)}}}function gC(e,r){Ei.X(e,r);var a=Vo;if(a&&e){var u=Li(a).hoistableScripts,p=Fo(e),y=u.get(p);y||(y=a.querySelector(us(p)),y||(e=g({src:e,async:!0},r),(r=Cn.get(p))&&lh(e,r),y=a.createElement("script"),he(y),Ne(y,"link",e),a.head.appendChild(y)),y={type:"script",instance:y,count:1,state:null},u.set(p,y))}}function yC(e,r){Ei.M(e,r);var a=Vo;if(a&&e){var u=Li(a).hoistableScripts,p=Fo(e),y=u.get(p);y||(y=a.querySelector(us(p)),y||(e=g({src:e,async:!0,type:"module"},r),(r=Cn.get(p))&&lh(e,r),y=a.createElement("script"),he(y),Ne(y,"link",e),a.head.appendChild(y)),y={type:"script",instance:y,count:1,state:null},u.set(p,y))}}function sv(e,r,a,u){var p=(p=ft.current)?Eu(p):null;if(!p)throw Error(o(446));switch(e){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(r=qo(a.href),a=Li(p).hoistableStyles,u=a.get(r),u||(u={type:"style",instance:null,count:0,state:null},a.set(r,u)),u):{type:"void",instance:null,count:0,state:null};case"link":if(a.rel==="stylesheet"&&typeof a.href=="string"&&typeof a.precedence=="string"){e=qo(a.href);var y=Li(p).hoistableStyles,S=y.get(e);if(S||(p=p.ownerDocument||p,S={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},y.set(e,S),(y=p.querySelector(ls(e)))&&!y._p&&(S.instance=y,S.state.loading=5),Cn.has(e)||(a={rel:"preload",as:"style",href:a.href,crossOrigin:a.crossOrigin,integrity:a.integrity,media:a.media,hrefLang:a.hrefLang,referrerPolicy:a.referrerPolicy},Cn.set(e,a),y||vC(p,e,a,S.state))),r&&u===null)throw Error(o(528,""));return S}if(r&&u!==null)throw Error(o(529,""));return null;case"script":return r=a.async,a=a.src,typeof a=="string"&&r&&typeof r!="function"&&typeof r!="symbol"?(r=Fo(a),a=Li(p).hoistableScripts,u=a.get(r),u||(u={type:"script",instance:null,count:0,state:null},a.set(r,u)),u):{type:"void",instance:null,count:0,state:null};default:throw Error(o(444,e))}}function qo(e){return'href="'+Pe(e)+'"'}function ls(e){return'link[rel="stylesheet"]['+e+"]"}function lv(e){return g({},e,{"data-precedence":e.precedence,precedence:null})}function vC(e,r,a,u){e.querySelector('link[rel="preload"][as="style"]['+r+"]")?u.loading=1:(r=e.createElement("link"),u.preload=r,r.addEventListener("load",function(){return u.loading|=1}),r.addEventListener("error",function(){return u.loading|=2}),Ne(r,"link",a),he(r),e.head.appendChild(r))}function Fo(e){return'[src="'+Pe(e)+'"]'}function us(e){return"script[async]"+e}function uv(e,r,a){if(r.count++,r.instance===null)switch(r.type){case"style":var u=e.querySelector('style[data-href~="'+Pe(a.href)+'"]');if(u)return r.instance=u,he(u),u;var p=g({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return u=(e.ownerDocument||e).createElement("style"),he(u),Ne(u,"style",p),_u(u,a.precedence,e),r.instance=u;case"stylesheet":p=qo(a.href);var y=e.querySelector(ls(p));if(y)return r.state.loading|=4,r.instance=y,he(y),y;u=lv(a),(p=Cn.get(p))&&sh(u,p),y=(e.ownerDocument||e).createElement("link"),he(y);var S=y;return S._p=new Promise(function(N,Y){S.onload=N,S.onerror=Y}),Ne(y,"link",u),r.state.loading|=4,_u(y,a.precedence,e),r.instance=y;case"script":return y=Fo(a.src),(p=e.querySelector(us(y)))?(r.instance=p,he(p),p):(u=a,(p=Cn.get(y))&&(u=g({},a),lh(u,p)),e=e.ownerDocument||e,p=e.createElement("script"),he(p),Ne(p,"link",u),e.head.appendChild(p),r.instance=p);case"void":return null;default:throw Error(o(443,r.type))}else r.type==="stylesheet"&&(r.state.loading&4)===0&&(u=r.instance,r.state.loading|=4,_u(u,a.precedence,e));return r.instance}function _u(e,r,a){for(var u=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),p=u.length?u[u.length-1]:null,y=p,S=0;S<u.length;S++){var N=u[S];if(N.dataset.precedence===r)y=N;else if(y!==p)break}y?y.parentNode.insertBefore(e,y.nextSibling):(r=a.nodeType===9?a.head:a,r.insertBefore(e,r.firstChild))}function sh(e,r){e.crossOrigin==null&&(e.crossOrigin=r.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=r.referrerPolicy),e.title==null&&(e.title=r.title)}function lh(e,r){e.crossOrigin==null&&(e.crossOrigin=r.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=r.referrerPolicy),e.integrity==null&&(e.integrity=r.integrity)}var Cu=null;function cv(e,r,a){if(Cu===null){var u=new Map,p=Cu=new Map;p.set(a,u)}else p=Cu,u=p.get(a),u||(u=new Map,p.set(a,u));if(u.has(e))return u;for(u.set(e,null),a=a.getElementsByTagName(e),p=0;p<a.length;p++){var y=a[p];if(!(y[br]||y[be]||e==="link"&&y.getAttribute("rel")==="stylesheet")&&y.namespaceURI!=="http://www.w3.org/2000/svg"){var S=y.getAttribute(r)||"";S=e+S;var N=u.get(S);N?N.push(y):u.set(S,[y])}}return u}function fv(e,r,a){e=e.ownerDocument||e,e.head.insertBefore(a,r==="title"?e.querySelector("head > title"):null)}function xC(e,r,a){if(a===1||r.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof r.precedence!="string"||typeof r.href!="string"||r.href==="")break;return!0;case"link":if(typeof r.rel!="string"||typeof r.href!="string"||r.href===""||r.onLoad||r.onError)break;return r.rel==="stylesheet"?(e=r.disabled,typeof r.precedence=="string"&&e==null):!0;case"script":if(r.async&&typeof r.async!="function"&&typeof r.async!="symbol"&&!r.onLoad&&!r.onError&&r.src&&typeof r.src=="string")return!0}return!1}function dv(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function bC(e,r,a,u){if(a.type==="stylesheet"&&(typeof u.media!="string"||matchMedia(u.media).matches!==!1)&&(a.state.loading&4)===0){if(a.instance===null){var p=qo(u.href),y=r.querySelector(ls(p));if(y){r=y._p,r!==null&&typeof r=="object"&&typeof r.then=="function"&&(e.count++,e=Tu.bind(e),r.then(e,e)),a.state.loading|=4,a.instance=y,he(y);return}y=r.ownerDocument||r,u=lv(u),(p=Cn.get(p))&&sh(u,p),y=y.createElement("link"),he(y);var S=y;S._p=new Promise(function(N,Y){S.onload=N,S.onerror=Y}),Ne(y,"link",u),a.instance=y}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(a,r),(r=a.state.preload)&&(a.state.loading&3)===0&&(e.count++,a=Tu.bind(e),r.addEventListener("load",a),r.addEventListener("error",a))}}var uh=0;function SC(e,r){return e.stylesheets&&e.count===0&&Nu(e,e.stylesheets),0<e.count||0<e.imgCount?function(a){var u=setTimeout(function(){if(e.stylesheets&&Nu(e,e.stylesheets),e.unsuspend){var y=e.unsuspend;e.unsuspend=null,y()}},6e4+r);0<e.imgBytes&&uh===0&&(uh=62500*eC());var p=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Nu(e,e.stylesheets),e.unsuspend)){var y=e.unsuspend;e.unsuspend=null,y()}},(e.imgBytes>uh?50:800)+r);return e.unsuspend=a,function(){e.unsuspend=null,clearTimeout(u),clearTimeout(p)}}:null}function Tu(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Nu(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Mu=null;function Nu(e,r){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Mu=new Map,r.forEach(wC,e),Mu=null,Tu.call(e))}function wC(e,r){if(!(r.state.loading&4)){var a=Mu.get(e);if(a)var u=a.get(null);else{a=new Map,Mu.set(e,a);for(var p=e.querySelectorAll("link[data-precedence],style[data-precedence]"),y=0;y<p.length;y++){var S=p[y];(S.nodeName==="LINK"||S.getAttribute("media")!=="not all")&&(a.set(S.dataset.precedence,S),u=S)}u&&a.set(null,u)}p=r.instance,S=p.getAttribute("data-precedence"),y=a.get(S)||u,y===u&&a.set(null,p),a.set(S,p),this.count++,u=Tu.bind(this),p.addEventListener("load",u),p.addEventListener("error",u),y?y.parentNode.insertBefore(p,y.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(p,e.firstChild)),r.state.loading|=4}}var cs={$$typeof:E,Provider:null,Consumer:null,_currentValue:G,_currentValue2:G,_threadCount:0};function EC(e,r,a,u,p,y,S,N,Y){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Sa(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Sa(0),this.hiddenUpdates=Sa(null),this.identifierPrefix=u,this.onUncaughtError=p,this.onCaughtError=y,this.onRecoverableError=S,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=Y,this.incompleteTransitions=new Map}function hv(e,r,a,u,p,y,S,N,Y,tt,ot,st){return e=new EC(e,r,a,S,Y,tt,ot,st,N),r=1,y===!0&&(r|=24),y=en(3,null,null,r),e.current=y,y.stateNode=e,r=Vf(),r.refCount++,e.pooledCache=r,r.refCount++,y.memoizedState={element:u,isDehydrated:a,cache:r},Xf(y),e}function pv(e){return e?(e=So,e):So}function mv(e,r,a,u,p,y){p=pv(p),u.context===null?u.context=p:u.pendingContext=p,u=qi(r),u.payload={element:a},y=y===void 0?null:y,y!==null&&(u.callback=y),a=Fi(e,u,r),a!==null&&(Ye(a,e,r),Va(a,e,r))}function gv(e,r){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var a=e.retryLane;e.retryLane=a!==0&&a<r?a:r}}function ch(e,r){gv(e,r),(e=e.alternate)&&gv(e,r)}function yv(e){if(e.tag===13||e.tag===31){var r=Tr(e,67108864);r!==null&&Ye(r,e,67108864),ch(e,67108864)}}function vv(e){if(e.tag===13||e.tag===31){var r=sn();r=wa(r);var a=Tr(e,r);a!==null&&Ye(a,e,r),ch(e,r)}}var ku=!0;function _C(e,r,a,u){var p=O.T;O.T=null;var y=U.p;try{U.p=2,fh(e,r,a,u)}finally{U.p=y,O.T=p}}function CC(e,r,a,u){var p=O.T;O.T=null;var y=U.p;try{U.p=8,fh(e,r,a,u)}finally{U.p=y,O.T=p}}function fh(e,r,a,u){if(ku){var p=dh(u);if(p===null)Kd(e,r,u,Au,a),bv(e,u);else if(MC(p,e,r,a,u))u.stopPropagation();else if(bv(e,u),r&4&&-1<TC.indexOf(e)){for(;p!==null;){var y=zi(p);if(y!==null)switch(y.tag){case 3:if(y=y.stateNode,y.current.memoizedState.isDehydrated){var S=ii(y.pendingLanes);if(S!==0){var N=y;for(N.pendingLanes|=2,N.entangledLanes|=2;S;){var Y=1<<31-Yt(S);N.entanglements[1]|=Y,S&=~Y}Gn(y),(qt&6)===0&&(du=ue()+500,rs(0))}}break;case 31:case 13:N=Tr(y,2),N!==null&&Ye(N,y,2),pu(),ch(y,2)}if(y=dh(u),y===null&&Kd(e,r,u,Au,a),y===p)break;p=y}p!==null&&u.stopPropagation()}else Kd(e,r,u,null,a)}}function dh(e){return e=pf(e),hh(e)}var Au=null;function hh(e){if(Au=null,e=Oi(e),e!==null){var r=l(e);if(r===null)e=null;else{var a=r.tag;if(a===13){if(e=c(r),e!==null)return e;e=null}else if(a===31){if(e=f(r),e!==null)return e;e=null}else if(a===3){if(r.stateNode.current.memoizedState.isDehydrated)return r.tag===3?r.stateNode.containerInfo:null;e=null}else r!==e&&(e=null)}}return Au=e,null}function xv(e){switch(e){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(Un()){case et:return 2;case ut:return 8;case gt:case Mt:return 32;case Pt:return 268435456;default:return 32}default:return 32}}var ph=!1,er=null,nr=null,ir=null,fs=new Map,ds=new Map,rr=[],TC="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 bv(e,r){switch(e){case"focusin":case"focusout":er=null;break;case"dragenter":case"dragleave":nr=null;break;case"mouseover":case"mouseout":ir=null;break;case"pointerover":case"pointerout":fs.delete(r.pointerId);break;case"gotpointercapture":case"lostpointercapture":ds.delete(r.pointerId)}}function hs(e,r,a,u,p,y){return e===null||e.nativeEvent!==y?(e={blockedOn:r,domEventName:a,eventSystemFlags:u,nativeEvent:y,targetContainers:[p]},r!==null&&(r=zi(r),r!==null&&yv(r)),e):(e.eventSystemFlags|=u,r=e.targetContainers,p!==null&&r.indexOf(p)===-1&&r.push(p),e)}function MC(e,r,a,u,p){switch(r){case"focusin":return er=hs(er,e,r,a,u,p),!0;case"dragenter":return nr=hs(nr,e,r,a,u,p),!0;case"mouseover":return ir=hs(ir,e,r,a,u,p),!0;case"pointerover":var y=p.pointerId;return fs.set(y,hs(fs.get(y)||null,e,r,a,u,p)),!0;case"gotpointercapture":return y=p.pointerId,ds.set(y,hs(ds.get(y)||null,e,r,a,u,p)),!0}return!1}function Sv(e){var r=Oi(e.target);if(r!==null){var a=l(r);if(a!==null){if(r=a.tag,r===13){if(r=c(a),r!==null){e.blockedOn=r,vl(e.priority,function(){vv(a)});return}}else if(r===31){if(r=f(a),r!==null){e.blockedOn=r,vl(e.priority,function(){vv(a)});return}}else if(r===3&&a.stateNode.current.memoizedState.isDehydrated){e.blockedOn=a.tag===3?a.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Ru(e){if(e.blockedOn!==null)return!1;for(var r=e.targetContainers;0<r.length;){var a=dh(e.nativeEvent);if(a===null){a=e.nativeEvent;var u=new a.constructor(a.type,a);hf=u,a.target.dispatchEvent(u),hf=null}else return r=zi(a),r!==null&&yv(r),e.blockedOn=a,!1;r.shift()}return!0}function wv(e,r,a){Ru(e)&&a.delete(r)}function NC(){ph=!1,er!==null&&Ru(er)&&(er=null),nr!==null&&Ru(nr)&&(nr=null),ir!==null&&Ru(ir)&&(ir=null),fs.forEach(wv),ds.forEach(wv)}function Ou(e,r){e.blockedOn===r&&(e.blockedOn=null,ph||(ph=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,NC)))}var zu=null;function Ev(e){zu!==e&&(zu=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){zu===e&&(zu=null);for(var r=0;r<e.length;r+=3){var a=e[r],u=e[r+1],p=e[r+2];if(typeof u!="function"){if(hh(u||a)===null)continue;break}var y=zi(a);y!==null&&(e.splice(r,3),r-=3,dd(y,{pending:!0,data:p,method:a.method,action:u},u,p))}}))}function Yo(e){function r(Y){return Ou(Y,e)}er!==null&&Ou(er,e),nr!==null&&Ou(nr,e),ir!==null&&Ou(ir,e),fs.forEach(r),ds.forEach(r);for(var a=0;a<rr.length;a++){var u=rr[a];u.blockedOn===e&&(u.blockedOn=null)}for(;0<rr.length&&(a=rr[0],a.blockedOn===null);)Sv(a),a.blockedOn===null&&rr.shift();if(a=(e.ownerDocument||e).$$reactFormReplay,a!=null)for(u=0;u<a.length;u+=3){var p=a[u],y=a[u+1],S=p[Oe]||null;if(typeof y=="function")S||Ev(a);else if(S){var N=null;if(y&&y.hasAttribute("formAction")){if(p=y,S=y[Oe]||null)N=S.formAction;else if(hh(p)!==null)continue}else N=S.action;typeof N=="function"?a[u+1]=N:(a.splice(u,3),u-=3),Ev(a)}}}function _v(){function e(y){y.canIntercept&&y.info==="react-transition"&&y.intercept({handler:function(){return new Promise(function(S){return p=S})},focusReset:"manual",scroll:"manual"})}function r(){p!==null&&(p(),p=null),u||setTimeout(a,20)}function a(){if(!u&&!navigation.transition){var y=navigation.currentEntry;y&&y.url!=null&&navigation.navigate(y.url,{state:y.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var u=!1,p=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",r),navigation.addEventListener("navigateerror",r),setTimeout(a,100),function(){u=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",r),navigation.removeEventListener("navigateerror",r),p!==null&&(p(),p=null)}}}function mh(e){this._internalRoot=e}Du.prototype.render=mh.prototype.render=function(e){var r=this._internalRoot;if(r===null)throw Error(o(409));var a=r.current,u=sn();mv(a,u,e,r,null,null)},Du.prototype.unmount=mh.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var r=e.containerInfo;mv(e.current,2,null,e,null,null),pu(),r[ri]=null}};function Du(e){this._internalRoot=e}Du.prototype.unstable_scheduleHydration=function(e){if(e){var r=yl();e={blockedOn:null,target:e,priority:r};for(var a=0;a<rr.length&&r!==0&&r<rr[a].priority;a++);rr.splice(a,0,e),a===0&&Sv(e)}};var Cv=n.version;if(Cv!=="19.2.4")throw Error(o(527,Cv,"19.2.4"));U.findDOMNode=function(e){var r=e._reactInternals;if(r===void 0)throw typeof e.render=="function"?Error(o(188)):(e=Object.keys(e).join(","),Error(o(268,e)));return e=h(r),e=e!==null?m(e):null,e=e===null?null:e.stateNode,e};var kC={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:O,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Lu=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Lu.isDisabled&&Lu.supportsFiber)try{_e=Lu.inject(kC),ce=Lu}catch{}}return ms.createRoot=function(e,r){if(!s(e))throw Error(o(299));var a=!1,u="",p=Oy,y=zy,S=Dy;return r!=null&&(r.unstable_strictMode===!0&&(a=!0),r.identifierPrefix!==void 0&&(u=r.identifierPrefix),r.onUncaughtError!==void 0&&(p=r.onUncaughtError),r.onCaughtError!==void 0&&(y=r.onCaughtError),r.onRecoverableError!==void 0&&(S=r.onRecoverableError)),r=hv(e,1,!1,null,null,a,u,null,p,y,S,_v),e[ri]=r.current,Zd(e),new mh(r)},ms.hydrateRoot=function(e,r,a){if(!s(e))throw Error(o(299));var u=!1,p="",y=Oy,S=zy,N=Dy,Y=null;return a!=null&&(a.unstable_strictMode===!0&&(u=!0),a.identifierPrefix!==void 0&&(p=a.identifierPrefix),a.onUncaughtError!==void 0&&(y=a.onUncaughtError),a.onCaughtError!==void 0&&(S=a.onCaughtError),a.onRecoverableError!==void 0&&(N=a.onRecoverableError),a.formState!==void 0&&(Y=a.formState)),r=hv(e,1,!0,r,a??null,u,p,Y,y,S,N,_v),r.context=pv(null),a=r.current,u=sn(),u=wa(u),p=qi(u),p.callback=null,Fi(a,p,u),a=u,r.current.lanes=a,xr(r,a),Gn(r),e[ri]=r.current,Zd(e),new Du(r)},ms.version="19.2.4",ms}var Lv;function HC(){if(Lv)return vh.exports;Lv=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(n){console.error(n)}}return t(),vh.exports=BC(),vh.exports}var PC=HC(),il=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(t){return this.listeners.add(t),this.onSubscribe(),()=>{this.listeners.delete(t),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},IC={setTimeout:(t,n)=>setTimeout(t,n),clearTimeout:t=>clearTimeout(t),setInterval:(t,n)=>setInterval(t,n),clearInterval:t=>clearInterval(t)},UC=class{#t=IC;#e=!1;setTimeoutProvider(t){this.#t=t}setTimeout(t,n){return this.#t.setTimeout(t,n)}clearTimeout(t){this.#t.clearTimeout(t)}setInterval(t,n){return this.#t.setInterval(t,n)}clearInterval(t){this.#t.clearInterval(t)}},Ir=new UC;function VC(t){setTimeout(t,0)}var $r=typeof window>"u"||"Deno"in globalThis;function Ge(){}function qC(t,n){return typeof t=="function"?t(n):t}function lp(t){return typeof t=="number"&&t>=0&&t!==1/0}function h1(t,n){return Math.max(t+(n||0)-Date.now(),0)}function pr(t,n){return typeof t=="function"?t(n):t}function Tn(t,n){return typeof t=="function"?t(n):t}function jv(t,n){const{type:i="all",exact:o,fetchStatus:s,predicate:l,queryKey:c,stale:f}=t;if(c){if(o){if(n.queryHash!==Fp(c,n.options))return!1}else if(!Ps(n.queryKey,c))return!1}if(i!=="all"){const d=n.isActive();if(i==="active"&&!d||i==="inactive"&&d)return!1}return!(typeof f=="boolean"&&n.isStale()!==f||s&&s!==n.state.fetchStatus||l&&!l(n))}function Bv(t,n){const{exact:i,status:o,predicate:s,mutationKey:l}=t;if(l){if(!n.options.mutationKey)return!1;if(i){if(Hs(n.options.mutationKey)!==Hs(l))return!1}else if(!Ps(n.options.mutationKey,l))return!1}return!(o&&n.state.status!==o||s&&!s(n))}function Fp(t,n){return(n?.queryKeyHashFn||Hs)(t)}function Hs(t){return JSON.stringify(t,(n,i)=>cp(i)?Object.keys(i).sort().reduce((o,s)=>(o[s]=i[s],o),{}):i)}function Ps(t,n){return t===n?!0:typeof t!=typeof n?!1:t&&n&&typeof t=="object"&&typeof n=="object"?Object.keys(n).every(i=>Ps(t[i],n[i])):!1}var FC=Object.prototype.hasOwnProperty;function p1(t,n,i=0){if(t===n)return t;if(i>500)return n;const o=Hv(t)&&Hv(n);if(!o&&!(cp(t)&&cp(n)))return n;const l=(o?t:Object.keys(t)).length,c=o?n:Object.keys(n),f=c.length,d=o?new Array(f):{};let h=0;for(let m=0;m<f;m++){const g=o?m:c[m],v=t[g],x=n[g];if(v===x){d[g]=v,(o?m<l:FC.call(t,g))&&h++;continue}if(v===null||x===null||typeof v!="object"||typeof x!="object"){d[g]=x;continue}const b=p1(v,x,i+1);d[g]=b,b===v&&h++}return l===f&&h===l?t:d}function up(t,n){if(!n||Object.keys(t).length!==Object.keys(n).length)return!1;for(const i in t)if(t[i]!==n[i])return!1;return!0}function Hv(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function cp(t){if(!Pv(t))return!1;const n=t.constructor;if(n===void 0)return!0;const i=n.prototype;return!(!Pv(i)||!i.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(t)!==Object.prototype)}function Pv(t){return Object.prototype.toString.call(t)==="[object Object]"}function YC(t){return new Promise(n=>{Ir.setTimeout(n,t)})}function fp(t,n,i){return typeof i.structuralSharing=="function"?i.structuralSharing(t,n):i.structuralSharing!==!1?p1(t,n):n}function XC(t,n,i=0){const o=[...t,n];return i&&o.length>i?o.slice(1):o}function GC(t,n,i=0){const o=[n,...t];return i&&o.length>i?o.slice(0,-1):o}var Yp=Symbol();function m1(t,n){return!t.queryFn&&n?.initialPromise?()=>n.initialPromise:!t.queryFn||t.queryFn===Yp?()=>Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)):t.queryFn}function g1(t,n){return typeof t=="function"?t(...n):!!t}function QC(t,n,i){let o=!1,s;return Object.defineProperty(t,"signal",{enumerable:!0,get:()=>(s??=n(),o||(o=!0,s.aborted?i():s.addEventListener("abort",i,{once:!0})),s)}),t}var $C=class extends il{#t;#e;#n;constructor(){super(),this.#n=t=>{if(!$r&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}}}onSubscribe(){this.#e||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#e?.(),this.#e=void 0)}setEventListener(t){this.#n=t,this.#e?.(),this.#e=t(n=>{typeof n=="boolean"?this.setFocused(n):this.onFocus()})}setFocused(t){this.#t!==t&&(this.#t=t,this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){return typeof this.#t=="boolean"?this.#t:globalThis.document?.visibilityState!=="hidden"}},Xp=new $C;function dp(){let t,n;const i=new Promise((s,l)=>{t=s,n=l});i.status="pending",i.catch(()=>{});function o(s){Object.assign(i,s),delete i.resolve,delete i.reject}return i.resolve=s=>{o({status:"fulfilled",value:s}),t(s)},i.reject=s=>{o({status:"rejected",reason:s}),n(s)},i}var ZC=VC;function KC(){let t=[],n=0,i=f=>{f()},o=f=>{f()},s=ZC;const l=f=>{n?t.push(f):s(()=>{i(f)})},c=()=>{const f=t;t=[],f.length&&s(()=>{o(()=>{f.forEach(d=>{i(d)})})})};return{batch:f=>{let d;n++;try{d=f()}finally{n--,n||c()}return d},batchCalls:f=>(...d)=>{l(()=>{f(...d)})},schedule:l,setNotifyFunction:f=>{i=f},setBatchNotifyFunction:f=>{o=f},setScheduler:f=>{s=f}}}var ke=KC(),JC=class extends il{#t=!0;#e;#n;constructor(){super(),this.#n=t=>{if(!$r&&window.addEventListener){const n=()=>t(!0),i=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",i,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",i)}}}}onSubscribe(){this.#e||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#e?.(),this.#e=void 0)}setEventListener(t){this.#n=t,this.#e?.(),this.#e=t(this.setOnline.bind(this))}setOnline(t){this.#t!==t&&(this.#t=t,this.listeners.forEach(i=>{i(t)}))}isOnline(){return this.#t}},fc=new JC;function WC(t){return Math.min(1e3*2**t,3e4)}function y1(t){return(t??"online")==="online"?fc.isOnline():!0}var hp=class extends Error{constructor(t){super("CancelledError"),this.revert=t?.revert,this.silent=t?.silent}};function v1(t){let n=!1,i=0,o;const s=dp(),l=()=>s.status!=="pending",c=_=>{if(!l()){const T=new hp(_);v(T),t.onCancel?.(T)}},f=()=>{n=!0},d=()=>{n=!1},h=()=>Xp.isFocused()&&(t.networkMode==="always"||fc.isOnline())&&t.canRun(),m=()=>y1(t.networkMode)&&t.canRun(),g=_=>{l()||(o?.(),s.resolve(_))},v=_=>{l()||(o?.(),s.reject(_))},x=()=>new Promise(_=>{o=T=>{(l()||h())&&_(T)},t.onPause?.()}).then(()=>{o=void 0,l()||t.onContinue?.()}),b=()=>{if(l())return;let _;const T=i===0?t.initialPromise:void 0;try{_=T??t.fn()}catch(C){_=Promise.reject(C)}Promise.resolve(_).then(g).catch(C=>{if(l())return;const z=t.retry??($r?0:3),E=t.retryDelay??WC,M=typeof E=="function"?E(i,C):E,H=z===!0||typeof z=="number"&&i<z||typeof z=="function"&&z(i,C);if(n||!H){v(C);return}i++,t.onFail?.(i,C),YC(M).then(()=>h()?void 0:x()).then(()=>{n?v(C):b()})})};return{promise:s,status:()=>s.status,cancel:c,continue:()=>(o?.(),s),cancelRetry:f,continueRetry:d,canStart:m,start:()=>(m()?b():x().then(b),s)}}var x1=class{#t;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),lp(this.gcTime)&&(this.#t=Ir.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,t??($r?1/0:300*1e3))}clearGcTimeout(){this.#t&&(Ir.clearTimeout(this.#t),this.#t=void 0)}},t2=class extends x1{#t;#e;#n;#r;#i;#s;#a;constructor(t){super(),this.#a=!1,this.#s=t.defaultOptions,this.setOptions(t.options),this.observers=[],this.#r=t.client,this.#n=this.#r.getQueryCache(),this.queryKey=t.queryKey,this.queryHash=t.queryHash,this.#t=Uv(this.options),this.state=t.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#i?.promise}setOptions(t){if(this.options={...this.#s,...t},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=Uv(this.options);n.data!==void 0&&(this.setState(Iv(n.data,n.dataUpdatedAt)),this.#t=n)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#n.remove(this)}setData(t,n){const i=fp(this.state.data,t,this.options);return this.#o({data:i,type:"success",dataUpdatedAt:n?.updatedAt,manual:n?.manual}),i}setState(t,n){this.#o({type:"setState",state:t,setStateOptions:n})}cancel(t){const n=this.#i?.promise;return this.#i?.cancel(t),n?n.then(Ge).catch(Ge):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#t)}isActive(){return this.observers.some(t=>Tn(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Yp||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>pr(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!h1(this.state.dataUpdatedAt,t)}onFocus(){this.observers.find(n=>n.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#i?.continue()}onOnline(){this.observers.find(n=>n.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#i?.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(this.#i&&(this.#a?this.#i.cancel({revert:!0}):this.#i.cancelRetry()),this.scheduleGc()),this.#n.notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#o({type:"invalidate"})}async fetch(t,n){if(this.state.fetchStatus!=="idle"&&this.#i?.status()!=="rejected"){if(this.state.data!==void 0&&n?.cancelRefetch)this.cancel({silent:!0});else if(this.#i)return this.#i.continueRetry(),this.#i.promise}if(t&&this.setOptions(t),!this.options.queryFn){const f=this.observers.find(d=>d.options.queryFn);f&&this.setOptions(f.options)}const i=new AbortController,o=f=>{Object.defineProperty(f,"signal",{enumerable:!0,get:()=>(this.#a=!0,i.signal)})},s=()=>{const f=m1(this.options,n),h=(()=>{const m={client:this.#r,queryKey:this.queryKey,meta:this.meta};return o(m),m})();return this.#a=!1,this.options.persister?this.options.persister(f,h,this):f(h)},c=(()=>{const f={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:this.#r,state:this.state,fetchFn:s};return o(f),f})();this.options.behavior?.onFetch(c,this),this.#e=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==c.fetchOptions?.meta)&&this.#o({type:"fetch",meta:c.fetchOptions?.meta}),this.#i=v1({initialPromise:n?.initialPromise,fn:c.fetchFn,onCancel:f=>{f instanceof hp&&f.revert&&this.setState({...this.#e,fetchStatus:"idle"}),i.abort()},onFail:(f,d)=>{this.#o({type:"failed",failureCount:f,error:d})},onPause:()=>{this.#o({type:"pause"})},onContinue:()=>{this.#o({type:"continue"})},retry:c.options.retry,retryDelay:c.options.retryDelay,networkMode:c.options.networkMode,canRun:()=>!0});try{const f=await this.#i.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 hp){if(f.silent)return this.#i.promise;if(f.revert){if(this.state.data===void 0)throw f;return this.state.data}}throw this.#o({type:"error",error:f}),this.#n.config.onError?.(f,this),this.#n.config.onSettled?.(this.state.data,f,this),f}finally{this.scheduleGc()}}#o(t){const n=i=>{switch(t.type){case"failed":return{...i,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...i,fetchStatus:"paused"};case"continue":return{...i,fetchStatus:"fetching"};case"fetch":return{...i,...b1(i.data,this.options),fetchMeta:t.meta??null};case"success":const o={...i,...Iv(t.data,t.dataUpdatedAt),dataUpdateCount:i.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#e=t.manual?o:void 0,o;case"error":const s=t.error;return{...i,error:s,errorUpdateCount:i.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:i.fetchFailureCount+1,fetchFailureReason:s,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...i,isInvalidated:!0};case"setState":return{...i,...t.state}}};this.state=n(this.state),ke.batch(()=>{this.observers.forEach(i=>{i.onQueryUpdate()}),this.#n.notify({query:this,type:"updated",action:t})})}};function b1(t,n){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:y1(n.networkMode)?"fetching":"paused",...t===void 0&&{error:null,status:"pending"}}}function Iv(t,n){return{data:t,dataUpdatedAt:n??Date.now(),error:null,isInvalidated:!1,status:"success"}}function Uv(t){const n=typeof t.initialData=="function"?t.initialData():t.initialData,i=n!==void 0,o=i?typeof t.initialDataUpdatedAt=="function"?t.initialDataUpdatedAt():t.initialDataUpdatedAt:0;return{data:n,dataUpdateCount:0,dataUpdatedAt:i?o??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:i?"success":"pending",fetchStatus:"idle"}}var e2=class extends il{constructor(t,n){super(),this.options=n,this.#t=t,this.#o=null,this.#a=dp(),this.bindMethods(),this.setOptions(n)}#t;#e=void 0;#n=void 0;#r=void 0;#i;#s;#a;#o;#m;#d;#h;#u;#c;#l;#p=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#e.addObserver(this),Vv(this.#e,this.options)?this.#f():this.updateResult(),this.#x())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return pp(this.#e,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return pp(this.#e,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#S(),this.#e.removeObserver(this)}setOptions(t){const n=this.options,i=this.#e;if(this.options=this.#t.defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Tn(this.options.enabled,this.#e)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#w(),this.#e.setOptions(this.options),n._defaulted&&!up(this.options,n)&&this.#t.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#e,observer:this});const o=this.hasListeners();o&&qv(this.#e,i,this.options,n)&&this.#f(),this.updateResult(),o&&(this.#e!==i||Tn(this.options.enabled,this.#e)!==Tn(n.enabled,this.#e)||pr(this.options.staleTime,this.#e)!==pr(n.staleTime,this.#e))&&this.#g();const s=this.#y();o&&(this.#e!==i||Tn(this.options.enabled,this.#e)!==Tn(n.enabled,this.#e)||s!==this.#l)&&this.#v(s)}getOptimisticResult(t){const n=this.#t.getQueryCache().build(this.#t,t),i=this.createResult(n,t);return i2(this,i)&&(this.#r=i,this.#s=this.options,this.#i=this.#e.state),i}getCurrentResult(){return this.#r}trackResult(t,n){return new Proxy(t,{get:(i,o)=>(this.trackProp(o),n?.(o),o==="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(i,o))})}trackProp(t){this.#p.add(t)}getCurrentQuery(){return this.#e}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=this.#t.defaultQueryOptions(t),i=this.#t.getQueryCache().build(this.#t,n);return i.fetch().then(()=>this.createResult(i,n))}fetch(t){return this.#f({...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#f(t){this.#w();let n=this.#e.fetch(this.options,t);return t?.throwOnError||(n=n.catch(Ge)),n}#g(){this.#b();const t=pr(this.options.staleTime,this.#e);if($r||this.#r.isStale||!lp(t))return;const i=h1(this.#r.dataUpdatedAt,t)+1;this.#u=Ir.setTimeout(()=>{this.#r.isStale||this.updateResult()},i)}#y(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#e):this.options.refetchInterval)??!1}#v(t){this.#S(),this.#l=t,!($r||Tn(this.options.enabled,this.#e)===!1||!lp(this.#l)||this.#l===0)&&(this.#c=Ir.setInterval(()=>{(this.options.refetchIntervalInBackground||Xp.isFocused())&&this.#f()},this.#l))}#x(){this.#g(),this.#v(this.#y())}#b(){this.#u&&(Ir.clearTimeout(this.#u),this.#u=void 0)}#S(){this.#c&&(Ir.clearInterval(this.#c),this.#c=void 0)}createResult(t,n){const i=this.#e,o=this.options,s=this.#r,l=this.#i,c=this.#s,d=t!==i?t.state:this.#n,{state:h}=t;let m={...h},g=!1,v;if(n._optimisticResults){const P=this.hasListeners(),q=!P&&Vv(t,n),J=P&&qv(t,i,n,o);(q||J)&&(m={...m,...b1(h.data,t.options)}),n._optimisticResults==="isRestoring"&&(m.fetchStatus="idle")}let{error:x,errorUpdatedAt:b,status:_}=m;v=m.data;let T=!1;if(n.placeholderData!==void 0&&v===void 0&&_==="pending"){let P;s?.isPlaceholderData&&n.placeholderData===c?.placeholderData?(P=s.data,T=!0):P=typeof n.placeholderData=="function"?n.placeholderData(this.#h?.state.data,this.#h):n.placeholderData,P!==void 0&&(_="success",v=fp(s?.data,P,n),g=!0)}if(n.select&&v!==void 0&&!T)if(s&&v===l?.data&&n.select===this.#m)v=this.#d;else try{this.#m=n.select,v=n.select(v),v=fp(s?.data,v,n),this.#d=v,this.#o=null}catch(P){this.#o=P}this.#o&&(x=this.#o,v=this.#d,b=Date.now(),_="error");const C=m.fetchStatus==="fetching",z=_==="pending",E=_==="error",M=z&&C,H=v!==void 0,B={status:_,fetchStatus:m.fetchStatus,isPending:z,isSuccess:_==="success",isError:E,isInitialLoading:M,isLoading:M,data:v,dataUpdatedAt:m.dataUpdatedAt,error:x,errorUpdatedAt:b,failureCount:m.fetchFailureCount,failureReason:m.fetchFailureReason,errorUpdateCount:m.errorUpdateCount,isFetched:m.dataUpdateCount>0||m.errorUpdateCount>0,isFetchedAfterMount:m.dataUpdateCount>d.dataUpdateCount||m.errorUpdateCount>d.errorUpdateCount,isFetching:C,isRefetching:C&&!z,isLoadingError:E&&!H,isPaused:m.fetchStatus==="paused",isPlaceholderData:g,isRefetchError:E&&H,isStale:Gp(t,n),refetch:this.refetch,promise:this.#a,isEnabled:Tn(n.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const P=B.data!==void 0,q=B.status==="error"&&!P,J=K=>{q?K.reject(B.error):P&&K.resolve(B.data)},j=()=>{const K=this.#a=B.promise=dp();J(K)},V=this.#a;switch(V.status){case"pending":t.queryHash===i.queryHash&&J(V);break;case"fulfilled":(q||B.data!==V.value)&&j();break;case"rejected":(!q||B.error!==V.reason)&&j();break}}return B}updateResult(){const t=this.#r,n=this.createResult(this.#e,this.options);if(this.#i=this.#e.state,this.#s=this.options,this.#i.data!==void 0&&(this.#h=this.#e),up(n,t))return;this.#r=n;const i=()=>{if(!t)return!0;const{notifyOnChangeProps:o}=this.options,s=typeof o=="function"?o():o;if(s==="all"||!s&&!this.#p.size)return!0;const l=new Set(s??this.#p);return this.options.throwOnError&&l.add("error"),Object.keys(this.#r).some(c=>{const f=c;return this.#r[f]!==t[f]&&l.has(f)})};this.#E({listeners:i()})}#w(){const t=this.#t.getQueryCache().build(this.#t,this.options);if(t===this.#e)return;const n=this.#e;this.#e=t,this.#n=t.state,this.hasListeners()&&(n?.removeObserver(this),t.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#x()}#E(t){ke.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(this.#r)}),this.#t.getQueryCache().notify({query:this.#e,type:"observerResultsUpdated"})})}};function n2(t,n){return Tn(n.enabled,t)!==!1&&t.state.data===void 0&&!(t.state.status==="error"&&n.retryOnMount===!1)}function Vv(t,n){return n2(t,n)||t.state.data!==void 0&&pp(t,n,n.refetchOnMount)}function pp(t,n,i){if(Tn(n.enabled,t)!==!1&&pr(n.staleTime,t)!=="static"){const o=typeof i=="function"?i(t):i;return o==="always"||o!==!1&&Gp(t,n)}return!1}function qv(t,n,i,o){return(t!==n||Tn(o.enabled,t)===!1)&&(!i.suspense||t.state.status!=="error")&&Gp(t,i)}function Gp(t,n){return Tn(n.enabled,t)!==!1&&t.isStaleByTime(pr(n.staleTime,t))}function i2(t,n){return!up(t.getCurrentResult(),n)}function Fv(t){return{onFetch:(n,i)=>{const o=n.options,s=n.fetchOptions?.meta?.fetchMore?.direction,l=n.state.data?.pages||[],c=n.state.data?.pageParams||[];let f={pages:[],pageParams:[]},d=0;const h=async()=>{let m=!1;const g=b=>{QC(b,()=>n.signal,()=>m=!0)},v=m1(n.options,n.fetchOptions),x=async(b,_,T)=>{if(m)return Promise.reject();if(_==null&&b.pages.length)return Promise.resolve(b);const z=(()=>{const R={client:n.client,queryKey:n.queryKey,pageParam:_,direction:T?"backward":"forward",meta:n.options.meta};return g(R),R})(),E=await v(z),{maxPages:M}=n.options,H=T?GC:XC;return{pages:H(b.pages,E,M),pageParams:H(b.pageParams,_,M)}};if(s&&l.length){const b=s==="backward",_=b?r2:Yv,T={pages:l,pageParams:c},C=_(o,T);f=await x(T,C,b)}else{const b=t??l.length;do{const _=d===0?c[0]??o.initialPageParam:Yv(o,f);if(d>0&&_==null)break;f=await x(f,_),d++}while(d<b)}return f};n.options.persister?n.fetchFn=()=>n.options.persister?.(h,{client:n.client,queryKey:n.queryKey,meta:n.options.meta,signal:n.signal},i):n.fetchFn=h}}}function Yv(t,{pages:n,pageParams:i}){const o=n.length-1;return n.length>0?t.getNextPageParam(n[o],n,i[o],i):void 0}function r2(t,{pages:n,pageParams:i}){return n.length>0?t.getPreviousPageParam?.(n[0],n,i[0],i):void 0}var o2=class extends x1{#t;#e;#n;#r;constructor(t){super(),this.#t=t.client,this.mutationId=t.mutationId,this.#n=t.mutationCache,this.#e=[],this.state=t.state||a2(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){this.#e.includes(t)||(this.#e.push(t),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){this.#e=this.#e.filter(n=>n!==t),this.scheduleGc(),this.#n.notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){this.#e.length||(this.state.status==="pending"?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??this.execute(this.state.variables)}async execute(t){const n=()=>{this.#i({type:"continue"})},i={client:this.#t,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#r=v1({fn:()=>this.options.mutationFn?this.options.mutationFn(t,i):Promise.reject(new Error("No mutationFn found")),onFail:(l,c)=>{this.#i({type:"failed",failureCount:l,error:c})},onPause:()=>{this.#i({type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});const o=this.state.status==="pending",s=!this.#r.canStart();try{if(o)n();else{this.#i({type:"pending",variables:t,isPaused:s}),this.#n.config.onMutate&&await this.#n.config.onMutate(t,this,i);const c=await this.options.onMutate?.(t,i);c!==this.state.context&&this.#i({type:"pending",context:c,variables:t,isPaused:s})}const l=await this.#r.start();return await this.#n.config.onSuccess?.(l,t,this.state.context,this,i),await this.options.onSuccess?.(l,t,this.state.context,i),await this.#n.config.onSettled?.(l,null,this.state.variables,this.state.context,this,i),await this.options.onSettled?.(l,null,t,this.state.context,i),this.#i({type:"success",data:l}),l}catch(l){try{await this.#n.config.onError?.(l,t,this.state.context,this,i)}catch(c){Promise.reject(c)}try{await this.options.onError?.(l,t,this.state.context,i)}catch(c){Promise.reject(c)}try{await this.#n.config.onSettled?.(void 0,l,this.state.variables,this.state.context,this,i)}catch(c){Promise.reject(c)}try{await this.options.onSettled?.(void 0,l,t,this.state.context,i)}catch(c){Promise.reject(c)}throw this.#i({type:"error",error:l}),l}finally{this.#n.runNext(this)}}#i(t){const n=i=>{switch(t.type){case"failed":return{...i,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...i,isPaused:!0};case"continue":return{...i,isPaused:!1};case"pending":return{...i,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...i,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...i,data:void 0,error:t.error,failureCount:i.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),ke.batch(()=>{this.#e.forEach(i=>{i.onMutationUpdate(t)}),this.#n.notify({mutation:this,type:"updated",action:t})})}};function a2(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var s2=class extends il{constructor(t={}){super(),this.config=t,this.#t=new Set,this.#e=new Map,this.#n=0}#t;#e;#n;build(t,n,i){const o=new o2({client:t,mutationCache:this,mutationId:++this.#n,options:t.defaultMutationOptions(n),state:i});return this.add(o),o}add(t){this.#t.add(t);const n=ju(t);if(typeof n=="string"){const i=this.#e.get(n);i?i.push(t):this.#e.set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(this.#t.delete(t)){const n=ju(t);if(typeof n=="string"){const i=this.#e.get(n);if(i)if(i.length>1){const o=i.indexOf(t);o!==-1&&i.splice(o,1)}else i[0]===t&&this.#e.delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=ju(t);if(typeof n=="string"){const o=this.#e.get(n)?.find(s=>s.state.status==="pending");return!o||o===t}else return!0}runNext(t){const n=ju(t);return typeof n=="string"?this.#e.get(n)?.find(o=>o!==t&&o.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){ke.batch(()=>{this.#t.forEach(t=>{this.notify({type:"removed",mutation:t})}),this.#t.clear(),this.#e.clear()})}getAll(){return Array.from(this.#t)}find(t){const n={exact:!0,...t};return this.getAll().find(i=>Bv(n,i))}findAll(t={}){return this.getAll().filter(n=>Bv(t,n))}notify(t){ke.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return ke.batch(()=>Promise.all(t.map(n=>n.continue().catch(Ge))))}};function ju(t){return t.options.scope?.id}var l2=class extends il{constructor(t={}){super(),this.config=t,this.#t=new Map}#t;build(t,n,i){const o=n.queryKey,s=n.queryHash??Fp(o,n);let l=this.get(s);return l||(l=new t2({client:t,queryKey:o,queryHash:s,options:t.defaultQueryOptions(n),state:i,defaultOptions:t.getQueryDefaults(o)}),this.add(l)),l}add(t){this.#t.has(t.queryHash)||(this.#t.set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=this.#t.get(t.queryHash);n&&(t.destroy(),n===t&&this.#t.delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){ke.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return this.#t.get(t)}getAll(){return[...this.#t.values()]}find(t){const n={exact:!0,...t};return this.getAll().find(i=>jv(n,i))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(i=>jv(t,i)):n}notify(t){ke.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){ke.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){ke.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},u2=class{#t;#e;#n;#r;#i;#s;#a;#o;constructor(t={}){this.#t=t.queryCache||new l2,this.#e=t.mutationCache||new s2,this.#n=t.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#s=0}mount(){this.#s++,this.#s===1&&(this.#a=Xp.subscribe(async t=>{t&&(await this.resumePausedMutations(),this.#t.onFocus())}),this.#o=fc.subscribe(async t=>{t&&(await this.resumePausedMutations(),this.#t.onOnline())}))}unmount(){this.#s--,this.#s===0&&(this.#a?.(),this.#a=void 0,this.#o?.(),this.#o=void 0)}isFetching(t){return this.#t.findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return this.#e.findAll({...t,status:"pending"}).length}getQueryData(t){const n=this.defaultQueryOptions({queryKey:t});return this.#t.get(n.queryHash)?.state.data}ensureQueryData(t){const n=this.defaultQueryOptions(t),i=this.#t.build(this,n),o=i.state.data;return o===void 0?this.fetchQuery(t):(t.revalidateIfStale&&i.isStaleByTime(pr(n.staleTime,i))&&this.prefetchQuery(n),Promise.resolve(o))}getQueriesData(t){return this.#t.findAll(t).map(({queryKey:n,state:i})=>{const o=i.data;return[n,o]})}setQueryData(t,n,i){const o=this.defaultQueryOptions({queryKey:t}),l=this.#t.get(o.queryHash)?.state.data,c=qC(n,l);if(c!==void 0)return this.#t.build(this,o).setData(c,{...i,manual:!0})}setQueriesData(t,n,i){return ke.batch(()=>this.#t.findAll(t).map(({queryKey:o})=>[o,this.setQueryData(o,n,i)]))}getQueryState(t){const n=this.defaultQueryOptions({queryKey:t});return this.#t.get(n.queryHash)?.state}removeQueries(t){const n=this.#t;ke.batch(()=>{n.findAll(t).forEach(i=>{n.remove(i)})})}resetQueries(t,n){const i=this.#t;return ke.batch(()=>(i.findAll(t).forEach(o=>{o.reset()}),this.refetchQueries({type:"active",...t},n)))}cancelQueries(t,n={}){const i={revert:!0,...n},o=ke.batch(()=>this.#t.findAll(t).map(s=>s.cancel(i)));return Promise.all(o).then(Ge).catch(Ge)}invalidateQueries(t,n={}){return ke.batch(()=>(this.#t.findAll(t).forEach(i=>{i.invalidate()}),t?.refetchType==="none"?Promise.resolve():this.refetchQueries({...t,type:t?.refetchType??t?.type??"active"},n)))}refetchQueries(t,n={}){const i={...n,cancelRefetch:n.cancelRefetch??!0},o=ke.batch(()=>this.#t.findAll(t).filter(s=>!s.isDisabled()&&!s.isStatic()).map(s=>{let l=s.fetch(void 0,i);return i.throwOnError||(l=l.catch(Ge)),s.state.fetchStatus==="paused"?Promise.resolve():l}));return Promise.all(o).then(Ge)}fetchQuery(t){const n=this.defaultQueryOptions(t);n.retry===void 0&&(n.retry=!1);const i=this.#t.build(this,n);return i.isStaleByTime(pr(n.staleTime,i))?i.fetch(n):Promise.resolve(i.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(Ge).catch(Ge)}fetchInfiniteQuery(t){return t.behavior=Fv(t.pages),this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(Ge).catch(Ge)}ensureInfiniteQueryData(t){return t.behavior=Fv(t.pages),this.ensureQueryData(t)}resumePausedMutations(){return fc.isOnline()?this.#e.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#t}getMutationCache(){return this.#e}getDefaultOptions(){return this.#n}setDefaultOptions(t){this.#n=t}setQueryDefaults(t,n){this.#r.set(Hs(t),{queryKey:t,defaultOptions:n})}getQueryDefaults(t){const n=[...this.#r.values()],i={};return n.forEach(o=>{Ps(t,o.queryKey)&&Object.assign(i,o.defaultOptions)}),i}setMutationDefaults(t,n){this.#i.set(Hs(t),{mutationKey:t,defaultOptions:n})}getMutationDefaults(t){const n=[...this.#i.values()],i={};return n.forEach(o=>{Ps(t,o.mutationKey)&&Object.assign(i,o.defaultOptions)}),i}defaultQueryOptions(t){if(t._defaulted)return t;const n={...this.#n.queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return n.queryHash||(n.queryHash=Fp(n.queryKey,n)),n.refetchOnReconnect===void 0&&(n.refetchOnReconnect=n.networkMode!=="always"),n.throwOnError===void 0&&(n.throwOnError=!!n.suspense),!n.networkMode&&n.persister&&(n.networkMode="offlineFirst"),n.queryFn===Yp&&(n.enabled=!1),n}defaultMutationOptions(t){return t?._defaulted?t:{...this.#n.mutations,...t?.mutationKey&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){this.#t.clear(),this.#e.clear()}},S1=F.createContext(void 0),w1=t=>{const n=F.useContext(S1);if(!n)throw new Error("No QueryClient set, use QueryClientProvider to set one");return n},c2=({client:t,children:n})=>(F.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]),w.jsx(S1.Provider,{value:t,children:n})),E1=F.createContext(!1),f2=()=>F.useContext(E1);E1.Provider;function d2(){let t=!1;return{clearReset:()=>{t=!1},reset:()=>{t=!0},isReset:()=>t}}var h2=F.createContext(d2()),p2=()=>F.useContext(h2),m2=(t,n,i)=>{const o=i?.state.error&&typeof t.throwOnError=="function"?g1(t.throwOnError,[i.state.error,i]):t.throwOnError;(t.suspense||t.experimental_prefetchInRender||o)&&(n.isReset()||(t.retryOnMount=!1))},g2=t=>{F.useEffect(()=>{t.clearReset()},[t])},y2=({result:t,errorResetBoundary:n,throwOnError:i,query:o,suspense:s})=>t.isError&&!n.isReset()&&!t.isFetching&&o&&(s&&t.data===void 0||g1(i,[t.error,o])),v2=t=>{if(t.suspense){const i=s=>s==="static"?s:Math.max(s??1e3,1e3),o=t.staleTime;t.staleTime=typeof o=="function"?(...s)=>i(o(...s)):i(o),typeof t.gcTime=="number"&&(t.gcTime=Math.max(t.gcTime,1e3))}},x2=(t,n)=>t.isLoading&&t.isFetching&&!n,b2=(t,n)=>t?.suspense&&n.isPending,Xv=(t,n,i)=>n.fetchOptimistic(t).catch(()=>{i.clearReset()});function S2(t,n,i){const o=f2(),s=p2(),l=w1(),c=l.defaultQueryOptions(t);l.getDefaultOptions().queries?._experimental_beforeQuery?.(c);const f=l.getQueryCache().get(c.queryHash);c._optimisticResults=o?"isRestoring":"optimistic",v2(c),m2(c,s,f),g2(s);const d=!l.getQueryCache().get(c.queryHash),[h]=F.useState(()=>new n(l,c)),m=h.getOptimisticResult(c),g=!o&&t.subscribed!==!1;if(F.useSyncExternalStore(F.useCallback(v=>{const x=g?h.subscribe(ke.batchCalls(v)):Ge;return h.updateResult(),x},[h,g]),()=>h.getCurrentResult(),()=>h.getCurrentResult()),F.useEffect(()=>{h.setOptions(c)},[c,h]),b2(c,m))throw Xv(c,h,s);if(y2({result:m,errorResetBoundary:s,throwOnError:c.throwOnError,query:f,suspense:c.suspense}))throw m.error;return l.getDefaultOptions().queries?._experimental_afterQuery?.(c,m),c.experimental_prefetchInRender&&!$r&&x2(m,o)&&(d?Xv(c,h,s):f?.promise)?.catch(Ge).finally(()=>{h.updateResult()}),c.notifyOnChangeProps?m:h.trackResult(m)}function Lc(t,n){return S2(t,e2)}const Wo=new WeakMap,tc=new WeakMap,dc={current:[]};let wh=!1,Rs=0;const Ms=new Set,Bu=new Map;function _1(t){const n=Array.from(t).sort((i,o)=>i instanceof ta&&i.options.deps.includes(o)?1:o instanceof ta&&o.options.deps.includes(i)?-1:0);for(const i of n){if(dc.current.includes(i))continue;dc.current.push(i),i.recompute();const o=tc.get(i);if(o)for(const s of o){const l=Wo.get(s);l&&_1(l)}}}function w2(t){const n={prevVal:t.prevState,currentVal:t.state};for(const i of t.listeners)i(n)}function E2(t){const n={prevVal:t.prevState,currentVal:t.state};for(const i of t.listeners)i(n)}function C1(t){if(Rs>0&&!Bu.has(t)&&Bu.set(t,t.prevState),Ms.add(t),!(Rs>0)&&!wh)try{for(wh=!0;Ms.size>0;){const n=Array.from(Ms);Ms.clear();for(const i of n){const o=Bu.get(i)??i.prevState;i.prevState=o,w2(i)}for(const i of n){const o=Wo.get(i);o&&(dc.current.push(i),_1(o))}for(const i of n){const o=Wo.get(i);if(o)for(const s of o)E2(s)}}}finally{wh=!1,dc.current=[],Bu.clear()}}function _2(t){Rs++;try{t()}finally{if(Rs--,Rs===0){const n=Ms.values().next().value;n&&C1(n)}}}function C2(t){return typeof t=="function"}class mp{constructor(n,i){this.listeners=new Set,this.subscribe=o=>{var s,l;this.listeners.add(o);const c=(l=(s=this.options)==null?void 0:s.onSubscribe)==null?void 0:l.call(s,o,this);return()=>{this.listeners.delete(o),c?.()}},this.prevState=n,this.state=n,this.options=i}setState(n){var i,o,s;this.prevState=this.state,(i=this.options)!=null&&i.updateFn?this.state=this.options.updateFn(this.prevState)(n):C2(n)?this.state=n(this.prevState):this.state=n,(s=(o=this.options)==null?void 0:o.onUpdate)==null||s.call(o),C1(this)}}class ta{constructor(n){this.listeners=new Set,this._subscriptions=[],this.lastSeenDepValues=[],this.getDepVals=()=>{const i=this.options.deps.length,o=new Array(i),s=new Array(i);for(let l=0;l<i;l++){const c=this.options.deps[l];o[l]=c.prevState,s[l]=c.state}return this.lastSeenDepValues=s,{prevDepVals:o,currDepVals:s,prevVal:this.prevState??void 0}},this.recompute=()=>{var i,o;this.prevState=this.state;const s=this.getDepVals();this.state=this.options.fn(s),(o=(i=this.options).onUpdate)==null||o.call(i)},this.checkIfRecalculationNeededDeeply=()=>{for(const l of this.options.deps)l instanceof ta&&l.checkIfRecalculationNeededDeeply();let i=!1;const o=this.lastSeenDepValues,{currDepVals:s}=this.getDepVals();for(let l=0;l<s.length;l++)if(s[l]!==o[l]){i=!0;break}i&&this.recompute()},this.mount=()=>(this.registerOnGraph(),this.checkIfRecalculationNeededDeeply(),()=>{this.unregisterFromGraph();for(const i of this._subscriptions)i()}),this.subscribe=i=>{var o,s;this.listeners.add(i);const l=(s=(o=this.options).onSubscribe)==null?void 0:s.call(o,i,this);return()=>{this.listeners.delete(i),l?.()}},this.options=n,this.state=n.fn({prevDepVals:void 0,prevVal:void 0,currDepVals:this.getDepVals().currDepVals})}registerOnGraph(n=this.options.deps){for(const i of n)if(i instanceof ta)i.registerOnGraph(),this.registerOnGraph(i.options.deps);else if(i instanceof mp){let o=Wo.get(i);o||(o=new Set,Wo.set(i,o)),o.add(this);let s=tc.get(this);s||(s=new Set,tc.set(this,s)),s.add(i)}}unregisterFromGraph(n=this.options.deps){for(const i of n)if(i instanceof ta)this.unregisterFromGraph(i.options.deps);else if(i instanceof mp){const o=Wo.get(i);o&&o.delete(this);const s=tc.get(this);s&&s.delete(i)}}}const mr="__TSR_index",Gv="popstate",Qv="beforeunload";function T2(t){let n=t.getLocation();const i=new Set,o=c=>{n=t.getLocation(),i.forEach(f=>f({location:n,action:c}))},s=c=>{t.notifyOnIndexChange??!0?o(c):n=t.getLocation()},l=async({task:c,navigateOpts:f,...d})=>{if(f?.ignoreBlocker??!1){c();return}const m=t.getBlockers?.()??[],g=d.type==="PUSH"||d.type==="REPLACE";if(typeof document<"u"&&m.length&&g)for(const v of m){const x=Is(d.path,d.state);if(await v.blockerFn({currentLocation:n,nextLocation:x,action:d.type})){t.onBlocked?.();return}}c()};return{get location(){return n},get length(){return t.getLength()},subscribers:i,subscribe:c=>(i.add(c),()=>{i.delete(c)}),push:(c,f,d)=>{const h=n.state[mr];f=$v(h+1,f),l({task:()=>{t.pushState(c,f),o({type:"PUSH"})},navigateOpts:d,type:"PUSH",path:c,state:f})},replace:(c,f,d)=>{const h=n.state[mr];f=$v(h,f),l({task:()=>{t.replaceState(c,f),o({type:"REPLACE"})},navigateOpts:d,type:"REPLACE",path:c,state:f})},go:(c,f)=>{l({task:()=>{t.go(c),s({type:"GO",index:c})},navigateOpts:f,type:"GO"})},back:c=>{l({task:()=>{t.back(c?.ignoreBlocker??!1),s({type:"BACK"})},navigateOpts:c,type:"BACK"})},forward:c=>{l({task:()=>{t.forward(c?.ignoreBlocker??!1),s({type:"FORWARD"})},navigateOpts:c,type:"FORWARD"})},canGoBack:()=>n.state[mr]!==0,createHref:c=>t.createHref(c),block:c=>{if(!t.setBlockers)return()=>{};const f=t.getBlockers?.()??[];return t.setBlockers([...f,c]),()=>{const d=t.getBlockers?.()??[];t.setBlockers?.(d.filter(h=>h!==c))}},flush:()=>t.flush?.(),destroy:()=>t.destroy?.(),notify:o}}function $v(t,n){n||(n={});const i=Qp();return{...n,key:i,__TSR_key:i,[mr]:t}}function T1(t){const n=t?.window??(typeof document<"u"?window:void 0),i=n.history.pushState,o=n.history.replaceState;let s=[];const l=()=>s,c=P=>s=P,f=t?.createHref??(P=>P),d=t?.parseLocation??(()=>Is(`${n.location.pathname}${n.location.search}${n.location.hash}`,n.history.state));if(!n.history.state?.__TSR_key&&!n.history.state?.key){const P=Qp();n.history.replaceState({[mr]:0,key:P,__TSR_key:P},"")}let h=d(),m,g=!1,v=!1,x=!1,b=!1;const _=()=>h;let T,C;const z=()=>{T&&(B._ignoreSubscribers=!0,(T.isPush?n.history.pushState:n.history.replaceState)(T.state,"",T.href),B._ignoreSubscribers=!1,T=void 0,C=void 0,m=void 0)},E=(P,q,J)=>{const j=f(q);C||(m=h),h=Is(q,J),T={href:j,state:J,isPush:T?.isPush||P==="push"},C||(C=Promise.resolve().then(()=>z()))},M=P=>{h=d(),B.notify({type:P})},H=async()=>{if(v){v=!1;return}const P=d(),q=P.state[mr]-h.state[mr],J=q===1,j=q===-1,V=!J&&!j||g;g=!1;const K=V?"GO":j?"BACK":"FORWARD",D=V?{type:"GO",index:q}:{type:j?"BACK":"FORWARD"};if(x)x=!1;else{const I=l();if(typeof document<"u"&&I.length){for(const O of I)if(await O.blockerFn({currentLocation:h,nextLocation:P,action:K})){v=!0,n.history.go(1),B.notify(D);return}}}h=d(),B.notify(D)},R=P=>{if(b){b=!1;return}let q=!1;const J=l();if(typeof document<"u"&&J.length)for(const j of J){const V=j.enableBeforeUnload??!0;if(V===!0){q=!0;break}if(typeof V=="function"&&V()===!0){q=!0;break}}if(q)return P.preventDefault(),P.returnValue=""},B=T2({getLocation:_,getLength:()=>n.history.length,pushState:(P,q)=>E("push",P,q),replaceState:(P,q)=>E("replace",P,q),back:P=>(P&&(x=!0),b=!0,n.history.back()),forward:P=>{P&&(x=!0),b=!0,n.history.forward()},go:P=>{g=!0,n.history.go(P)},createHref:P=>f(P),flush:z,destroy:()=>{n.history.pushState=i,n.history.replaceState=o,n.removeEventListener(Qv,R,{capture:!0}),n.removeEventListener(Gv,H)},onBlocked:()=>{m&&h!==m&&(h=m)},getBlockers:l,setBlockers:c,notifyOnIndexChange:!1});return n.addEventListener(Qv,R,{capture:!0}),n.addEventListener(Gv,H),n.history.pushState=function(...P){const q=i.apply(n.history,P);return B._ignoreSubscribers||M("PUSH"),q},n.history.replaceState=function(...P){const q=o.apply(n.history,P);return B._ignoreSubscribers||M("REPLACE"),q},B}function M2(t){const n=typeof document<"u"?window:void 0;return T1({window:n,parseLocation:()=>{const i=n.location.hash.split("#").slice(1),o=i[0]??"/",s=n.location.search,l=i.slice(1),c=l.length===0?"":`#${l.join("#")}`,f=`${o}${s}${c}`;return Is(f,n.history.state)},createHref:i=>`${n.location.pathname}${n.location.search}#${i}`})}function N2(t){let n=t.replace(/[\x00-\x1f\x7f]/g,"");return n.startsWith("//")&&(n="/"+n.replace(/^\/+/,"")),n}function Is(t,n){const i=N2(t),o=i.indexOf("#"),s=i.indexOf("?"),l=Qp();return{href:i,pathname:i.substring(0,o>0?s>0?Math.min(o,s):o:s>0?s:i.length),hash:o>-1?i.substring(o):"",search:s>-1?i.slice(s,o===-1?void 0:o):"",state:n||{[mr]:0,key:l,__TSR_key:l}}}function Qp(){return(Math.random()+1).toString(36).substring(7)}const k2=!1;function Os(t){let n;return _2(()=>{n=t()}),n}function Us(t){return t[t.length-1]}function A2(t){return typeof t=="function"}function fr(t,n){return A2(t)?t(n):t}const R2=Object.prototype.hasOwnProperty,Zv=Object.prototype.propertyIsEnumerable;function un(t,n,i=0){if(t===n)return t;if(i>500)return n;const o=n,s=Wv(t)&&Wv(o);if(!s&&!(hc(t)&&hc(o)))return o;const l=s?t:Kv(t);if(!l)return o;const c=s?o:Kv(o);if(!c)return o;const f=l.length,d=c.length,h=s?new Array(d):{};let m=0;for(let g=0;g<d;g++){const v=s?g:c[g],x=t[v],b=o[v];if(x===b){h[v]=x,(s?g<f:R2.call(t,v))&&m++;continue}if(x===null||b===null||typeof x!="object"||typeof b!="object"){h[v]=b;continue}const _=un(x,b,i+1);h[v]=_,_===x&&m++}return f===d&&m===f?t:h}function Kv(t){const n=Object.getOwnPropertyNames(t);for(const s of n)if(!Zv.call(t,s))return!1;const i=Object.getOwnPropertySymbols(t);if(i.length===0)return n;const o=n;for(const s of i){if(!Zv.call(t,s))return!1;o.push(s)}return o}function hc(t){if(!Jv(t))return!1;const n=t.constructor;if(typeof n>"u")return!0;const i=n.prototype;return!(!Jv(i)||!i.hasOwnProperty("isPrototypeOf"))}function Jv(t){return Object.prototype.toString.call(t)==="[object Object]"}function Wv(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function Fr(t,n,i){if(t===n)return!0;if(typeof t!=typeof n)return!1;if(Array.isArray(t)&&Array.isArray(n)){if(t.length!==n.length)return!1;for(let o=0,s=t.length;o<s;o++)if(!Fr(t[o],n[o],i))return!1;return!0}if(hc(t)&&hc(n)){const o=i?.ignoreUndefined??!0;if(i?.partial){for(const c in n)if((!o||n[c]!==void 0)&&!Fr(t[c],n[c],i))return!1;return!0}let s=0;if(!o)s=Object.keys(t).length;else for(const c in t)t[c]!==void 0&&s++;let l=0;for(const c in n)if((!o||n[c]!==void 0)&&(l++,l>s||!Fr(t[c],n[c],i)))return!1;return s===l}return!1}function la(t){let n,i;const o=new Promise((s,l)=>{n=s,i=l});return o.status="pending",o.resolve=s=>{o.status="resolved",o.value=s,n(s),t?.(s)},o.reject=s=>{o.status="rejected",i(s)},o}function ea(t){return!!(t&&typeof t=="object"&&typeof t.then=="function")}function O2(t){return t.replace(/[\x00-\x1f\x7f]/g,"")}function tx(t){let n;try{n=decodeURI(t)}catch{n=t.replaceAll(/%[0-9A-F]{2}/gi,i=>{try{return decodeURI(i)}catch{return i}})}return O2(n)}const z2=["http:","https:","mailto:","tel:"];function pc(t,n){if(!t)return!1;try{const i=new URL(t);return!n.has(i.protocol)}catch{return!1}}function gs(t){if(!t)return{path:t,handledProtocolRelativeURL:!1};if(!/[%\\\x00-\x1f\x7f]/.test(t)&&!t.startsWith("//"))return{path:t,handledProtocolRelativeURL:!1};const n=/%25|%5C/gi;let i=0,o="",s;for(;(s=n.exec(t))!==null;)o+=tx(t.slice(i,s.index))+s[0],i=n.lastIndex;o=o+tx(i?t.slice(i):t);let l=!1;return o.startsWith("//")&&(l=!0,o="/"+o.replace(/^\/+/,"")),{path:o,handledProtocolRelativeURL:l}}function D2(t){return/\s|[^\u0000-\u007F]/.test(t)?t.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):t}var L2="Invariant failed";function ki(t,n){if(!t)throw new Error(L2)}function mc(t){const n=new Map;let i,o;const s=l=>{l.next&&(l.prev?(l.prev.next=l.next,l.next.prev=l.prev,l.next=void 0,o&&(o.next=l,l.prev=o)):(l.next.prev=void 0,i=l.next,l.next=void 0,o&&(l.prev=o,o.next=l)),o=l)};return{get(l){const c=n.get(l);if(c)return s(c),c.value},set(l,c){if(n.size>=t&&i){const d=i;n.delete(d.key),d.next&&(i=d.next,d.next.prev=void 0),d===o&&(o=void 0)}const f=n.get(l);if(f)f.value=c,s(f);else{const d={key:l,value:c,prev:o};o&&(o.next=d),o=d,i||(i=d),n.set(l,d)}},clear(){n.clear(),i=void 0,o=void 0}}}const ua=0,Zr=1,Kr=2,Vs=3,Ur=4,M1=5;function j2(t){const n=t.indexOf("{");if(n===-1)return null;const i=t.indexOf("}",n);return i===-1||n+1>=t.length?null:[n,i]}function $p(t,n,i=new Uint16Array(6)){const o=t.indexOf("/",n),s=o===-1?t.length:o,l=t.substring(n,s);if(!l||!l.includes("$"))return i[0]=ua,i[1]=n,i[2]=n,i[3]=s,i[4]=s,i[5]=s,i;if(l==="$"){const f=t.length;return i[0]=Kr,i[1]=n,i[2]=n,i[3]=f,i[4]=f,i[5]=f,i}if(l.charCodeAt(0)===36)return i[0]=Zr,i[1]=n,i[2]=n+1,i[3]=s,i[4]=s,i[5]=s,i;const c=j2(l);if(c){const[f,d]=c,h=l.charCodeAt(f+1);if(h===45){if(f+2<l.length&&l.charCodeAt(f+2)===36){const m=f+3,g=d;if(m<g)return i[0]=Vs,i[1]=n+f,i[2]=n+m,i[3]=n+g,i[4]=n+d+1,i[5]=s,i}}else if(h===36){const m=f+1,g=f+2;return g===d?(i[0]=Kr,i[1]=n+f,i[2]=n+m,i[3]=n+g,i[4]=n+d+1,i[5]=t.length,i):(i[0]=Zr,i[1]=n+f,i[2]=n+g,i[3]=n+d,i[4]=n+d+1,i[5]=s,i)}}return i[0]=ua,i[1]=n,i[2]=n,i[3]=s,i[4]=s,i[5]=s,i}function jc(t,n,i,o,s,l,c){c?.(i);let f=o;{const d=i.fullPath??i.from,h=d.length,m=i.options?.caseSensitive??t,g=!!(i.options?.params?.parse&&i.options?.skipRouteOnParseError?.params);for(;f<h;){const x=$p(d,f,n);let b;const _=f,T=x[5];switch(f=T+1,l++,x[0]){case ua:{const z=d.substring(x[2],x[3]);if(m){const E=s.static?.get(z);if(E)b=E;else{s.static??=new Map;const M=Vr(i.fullPath??i.from);M.parent=s,M.depth=l,b=M,s.static.set(z,M)}}else{const E=z.toLowerCase(),M=s.staticInsensitive?.get(E);if(M)b=M;else{s.staticInsensitive??=new Map;const H=Vr(i.fullPath??i.from);H.parent=s,H.depth=l,b=H,s.staticInsensitive.set(E,H)}}break}case Zr:{const z=d.substring(_,x[1]),E=d.substring(x[4],T),M=m&&!!(z||E),H=z?M?z:z.toLowerCase():void 0,R=E?M?E:E.toLowerCase():void 0,B=!g&&s.dynamic?.find(P=>!P.skipOnParamError&&P.caseSensitive===M&&P.prefix===H&&P.suffix===R);if(B)b=B;else{const P=_h(Zr,i.fullPath??i.from,M,H,R);b=P,P.depth=l,P.parent=s,s.dynamic??=[],s.dynamic.push(P)}break}case Vs:{const z=d.substring(_,x[1]),E=d.substring(x[4],T),M=m&&!!(z||E),H=z?M?z:z.toLowerCase():void 0,R=E?M?E:E.toLowerCase():void 0,B=!g&&s.optional?.find(P=>!P.skipOnParamError&&P.caseSensitive===M&&P.prefix===H&&P.suffix===R);if(B)b=B;else{const P=_h(Vs,i.fullPath??i.from,M,H,R);b=P,P.parent=s,P.depth=l,s.optional??=[],s.optional.push(P)}break}case Kr:{const z=d.substring(_,x[1]),E=d.substring(x[4],T),M=m&&!!(z||E),H=z?M?z:z.toLowerCase():void 0,R=E?M?E:E.toLowerCase():void 0,B=_h(Kr,i.fullPath??i.from,M,H,R);b=B,B.parent=s,B.depth=l,s.wildcard??=[],s.wildcard.push(B)}}s=b}if(g&&i.children&&!i.isRoot&&i.id&&i.id.charCodeAt(i.id.lastIndexOf("/")+1)===95){const x=Vr(i.fullPath??i.from);x.kind=M1,x.parent=s,l++,x.depth=l,s.pathless??=[],s.pathless.push(x),s=x}const v=(i.path||!i.children)&&!i.isRoot;if(v&&d.endsWith("/")){const x=Vr(i.fullPath??i.from);x.kind=Ur,x.parent=s,l++,x.depth=l,s.index=x,s=x}s.parse=i.options?.params?.parse??null,s.skipOnParamError=g,s.parsingPriority=i.options?.skipRouteOnParseError?.priority??0,v&&!s.route&&(s.route=i,s.fullPath=i.fullPath??i.from)}if(i.children)for(const d of i.children)jc(t,n,d,f,s,l,c)}function Eh(t,n){if(t.skipOnParamError&&!n.skipOnParamError)return-1;if(!t.skipOnParamError&&n.skipOnParamError)return 1;if(t.skipOnParamError&&n.skipOnParamError&&(t.parsingPriority||n.parsingPriority))return n.parsingPriority-t.parsingPriority;if(t.prefix&&n.prefix&&t.prefix!==n.prefix){if(t.prefix.startsWith(n.prefix))return-1;if(n.prefix.startsWith(t.prefix))return 1}if(t.suffix&&n.suffix&&t.suffix!==n.suffix){if(t.suffix.endsWith(n.suffix))return-1;if(n.suffix.endsWith(t.suffix))return 1}return t.prefix&&!n.prefix?-1:!t.prefix&&n.prefix?1:t.suffix&&!n.suffix?-1:!t.suffix&&n.suffix?1:t.caseSensitive&&!n.caseSensitive?-1:!t.caseSensitive&&n.caseSensitive?1:0}function ur(t){if(t.pathless)for(const n of t.pathless)ur(n);if(t.static)for(const n of t.static.values())ur(n);if(t.staticInsensitive)for(const n of t.staticInsensitive.values())ur(n);if(t.dynamic?.length){t.dynamic.sort(Eh);for(const n of t.dynamic)ur(n)}if(t.optional?.length){t.optional.sort(Eh);for(const n of t.optional)ur(n)}if(t.wildcard?.length){t.wildcard.sort(Eh);for(const n of t.wildcard)ur(n)}}function Vr(t){return{kind:ua,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}}function _h(t,n,i,o,s){return{kind:t,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:n,parent:null,parse:null,skipOnParamError:!1,parsingPriority:0,caseSensitive:i,prefix:o,suffix:s}}function B2(t,n){const i=Vr("/"),o=new Uint16Array(6);for(const s of t)jc(!1,o,s,1,i,0);ur(i),n.masksTree=i,n.flatCache=mc(1e3)}function H2(t,n){t||="/";const i=n.flatCache.get(t);if(i)return i;const o=Zp(t,n.masksTree);return n.flatCache.set(t,o),o}function P2(t,n,i,o,s){t||="/",o||="/";const l=n?`case\0${t}`:t;let c=s.singleCache.get(l);if(!c){c=Vr("/");const f=new Uint16Array(6);jc(n,f,{from:t},1,c,0),s.singleCache.set(l,c)}return Zp(o,c,i)}function I2(t,n,i=!1){const o=i?t:`nofuzz\0${t}`,s=n.matchCache.get(o);if(s!==void 0)return s;t||="/";let l;try{l=Zp(t,n.segmentTree,i)}catch(c){if(c instanceof URIError)l=null;else throw c}return l&&(l.branch=q2(l.route)),n.matchCache.set(o,l),l}function U2(t){return t==="/"?t:t.replace(/\/{1,}$/,"")}function V2(t,n=!1,i){const o=Vr(t.fullPath),s=new Uint16Array(6),l={},c={};let f=0;return jc(n,s,t,1,o,0,h=>{if(i?.(h,f),ki(!(h.id in l),`Duplicate routes found with id: ${String(h.id)}`),l[h.id]=h,f!==0&&h.path){const m=U2(h.fullPath);(!c[m]||h.fullPath.endsWith("/"))&&(c[m]=h)}f++}),ur(o),{processedTree:{segmentTree:o,singleCache:mc(1e3),matchCache:mc(1e3),flatCache:null,masksTree:null},routesById:l,routesByPath:c}}function Zp(t,n,i=!1){const o=t.split("/"),s=Y2(t,o,n,i);if(!s)return null;const[l]=N1(t,o,s);return{route:s.node.route,rawParams:l,parsedParams:s.parsedParams}}function N1(t,n,i){const o=F2(i.node);let s=null;const l={};let c=i.extract?.part??0,f=i.extract?.node??0,d=i.extract?.path??0,h=i.extract?.segment??0;for(;f<o.length;c++,f++,d++,h++){const m=o[f];if(m.kind===Ur)break;if(m.kind===M1){h--,c--,d--;continue}const g=n[c],v=d;if(g&&(d+=g.length),m.kind===Zr){s??=i.node.fullPath.split("/");const x=s[h],b=m.prefix?.length??0;if(x.charCodeAt(b)===123){const T=m.suffix?.length??0,C=x.substring(b+2,x.length-T-1),z=g.substring(b,g.length-T);l[C]=decodeURIComponent(z)}else{const T=x.substring(1);l[T]=decodeURIComponent(g)}}else if(m.kind===Vs){if(i.skipped&1<<f){c--,d=v-1;continue}s??=i.node.fullPath.split("/");const x=s[h],b=m.prefix?.length??0,_=m.suffix?.length??0,T=x.substring(b+3,x.length-_-1),C=m.suffix||m.prefix?g.substring(b,g.length-_):g;C&&(l[T]=decodeURIComponent(C))}else if(m.kind===Kr){const x=m,b=t.substring(v+(x.prefix?.length??0),t.length-(x.suffix?.length??0)),_=decodeURIComponent(b);l["*"]=_,l._splat=_;break}}return i.rawParams&&Object.assign(l,i.rawParams),[l,{part:c,node:f,path:d,segment:h}]}function q2(t){const n=[t];for(;t.parentRoute;)t=t.parentRoute,n.push(t);return n.reverse(),n}function F2(t){const n=Array(t.depth+1);do n[t.depth]=t,t=t.parent;while(t);return n}function Y2(t,n,i,o){if(t==="/"&&i.index)return{node:i.index,skipped:0};const s=!Us(n),l=s&&t!=="/",c=n.length-(s?1:0),f=[{node:i,index:1,skipped:0,depth:1,statics:1,dynamics:0,optionals:0}];let d=null,h=null,m=null;for(;f.length;){const g=f.pop(),{node:v,index:x,skipped:b,depth:_,statics:T,dynamics:C,optionals:z}=g;let{extract:E,rawParams:M,parsedParams:H}=g;if(v.skipOnParamError){if(!Ch(t,n,g))continue;M=g.rawParams,E=g.extract,H=g.parsedParams}o&&v.route&&v.kind!==Ur&&ys(h,g)&&(h=g);const R=x===c;if(R&&(v.route&&!l&&ys(m,g)&&(m=g),!v.optional&&!v.wildcard&&!v.index&&!v.pathless))continue;const B=R?void 0:n[x];let P;if(R&&v.index){const q={node:v.index,index:x,skipped:b,depth:_+1,statics:T,dynamics:C,optionals:z,extract:E,rawParams:M,parsedParams:H};let J=!0;if(v.index.skipOnParamError&&(Ch(t,n,q)||(J=!1)),J){if(T===c&&!C&&!z&&!b)return q;ys(m,q)&&(m=q)}}if(v.wildcard&&ys(d,g))for(const q of v.wildcard){const{prefix:J,suffix:j}=q;if(J&&(R||!(q.caseSensitive?B:P??=B.toLowerCase()).startsWith(J)))continue;if(j){if(R)continue;const K=n.slice(x).join("/").slice(-j.length);if((q.caseSensitive?K:K.toLowerCase())!==j)continue}const V={node:q,index:c,skipped:b,depth:_,statics:T,dynamics:C,optionals:z,extract:E,rawParams:M,parsedParams:H};if(!(q.skipOnParamError&&!Ch(t,n,V))){d=V;break}}if(v.optional){const q=b|1<<_,J=_+1;for(let j=v.optional.length-1;j>=0;j--){const V=v.optional[j];f.push({node:V,index:x,skipped:q,depth:J,statics:T,dynamics:C,optionals:z,extract:E,rawParams:M,parsedParams:H})}if(!R)for(let j=v.optional.length-1;j>=0;j--){const V=v.optional[j],{prefix:K,suffix:D}=V;if(K||D){const I=V.caseSensitive?B:P??=B.toLowerCase();if(K&&!I.startsWith(K)||D&&!I.endsWith(D))continue}f.push({node:V,index:x+1,skipped:b,depth:J,statics:T,dynamics:C,optionals:z+1,extract:E,rawParams:M,parsedParams:H})}}if(!R&&v.dynamic&&B)for(let q=v.dynamic.length-1;q>=0;q--){const J=v.dynamic[q],{prefix:j,suffix:V}=J;if(j||V){const K=J.caseSensitive?B:P??=B.toLowerCase();if(j&&!K.startsWith(j)||V&&!K.endsWith(V))continue}f.push({node:J,index:x+1,skipped:b,depth:_+1,statics:T,dynamics:C+1,optionals:z,extract:E,rawParams:M,parsedParams:H})}if(!R&&v.staticInsensitive){const q=v.staticInsensitive.get(P??=B.toLowerCase());q&&f.push({node:q,index:x+1,skipped:b,depth:_+1,statics:T+1,dynamics:C,optionals:z,extract:E,rawParams:M,parsedParams:H})}if(!R&&v.static){const q=v.static.get(B);q&&f.push({node:q,index:x+1,skipped:b,depth:_+1,statics:T+1,dynamics:C,optionals:z,extract:E,rawParams:M,parsedParams:H})}if(v.pathless){const q=_+1;for(let J=v.pathless.length-1;J>=0;J--){const j=v.pathless[J];f.push({node:j,index:x,skipped:b,depth:q,statics:T,dynamics:C,optionals:z,extract:E,rawParams:M,parsedParams:H})}}}if(m&&d)return ys(d,m)?m:d;if(m)return m;if(d)return d;if(o&&h){let g=h.index;for(let x=0;x<h.index;x++)g+=n[x].length;const v=g===t.length?"/":t.slice(g);return h.rawParams??={},h.rawParams["**"]=decodeURIComponent(v),h}return null}function Ch(t,n,i){try{const[o,s]=N1(t,n,i);i.rawParams=o,i.extract=s;const l=i.node.parse(o);return i.parsedParams=Object.assign({},i.parsedParams,l),!0}catch{return null}}function ys(t,n){return t?n.statics>t.statics||n.statics===t.statics&&(n.dynamics>t.dynamics||n.dynamics===t.dynamics&&(n.optionals>t.optionals||n.optionals===t.optionals&&((n.node.kind===Ur)>(t.node.kind===Ur)||n.node.kind===Ur==(t.node.kind===Ur)&&n.depth>t.depth))):!0}function ec(t){return Kp(t.filter(n=>n!==void 0).join("/"))}function Kp(t){return t.replace(/\/{2,}/g,"/")}function k1(t){return t==="/"?t:t.replace(/^\/{1,}/,"")}function Ti(t){const n=t.length;return n>1&&t[n-1]==="/"?t.replace(/\/{1,}$/,""):t}function A1(t){return Ti(k1(t))}function gc(t,n){return t?.endsWith("/")&&t!=="/"&&t!==`${n}/`?t.slice(0,-1):t}function X2(t,n,i){return gc(t,i)===gc(n,i)}function G2({base:t,to:n,trailingSlash:i="never",cache:o}){const s=n.startsWith("/"),l=!s&&n===".";let c;if(o){c=s?n:l?t:t+"\0"+n;const g=o.get(c);if(g)return g}let f;if(l)f=t.split("/");else if(s)f=n.split("/");else{for(f=t.split("/");f.length>1&&Us(f)==="";)f.pop();const g=n.split("/");for(let v=0,x=g.length;v<x;v++){const b=g[v];b===""?v?v===x-1&&f.push(b):f=[b]:b===".."?f.pop():b==="."||f.push(b)}}f.length>1&&(Us(f)===""?i==="never"&&f.pop():i==="always"&&f.push(""));let d,h="";for(let g=0;g<f.length;g++){g>0&&(h+="/");const v=f[g];if(!v)continue;d=$p(v,0,d);const x=d[0];if(x===ua){h+=v;continue}const b=d[5],_=v.substring(0,d[1]),T=v.substring(d[4],b),C=v.substring(d[2],d[3]);x===Zr?h+=_||T?`${_}{$${C}}${T}`:`$${C}`:x===Kr?h+=_||T?`${_}{$}${T}`:"$":h+=`${_}{-$${C}}${T}`}h=Kp(h);const m=h||"/";return c&&o&&o.set(c,m),m}function Q2(t){const n=new Map(t.map(s=>[encodeURIComponent(s),s])),i=Array.from(n.keys()).map(s=>s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|"),o=new RegExp(i,"g");return s=>s.replace(o,l=>n.get(l)??l)}function Th(t,n,i){const o=n[t];return typeof o!="string"?o:t==="_splat"?/^[a-zA-Z0-9\-._~!/]*$/.test(o)?o:o.split("/").map(s=>ex(s,i)).join("/"):ex(o,i)}function Mh({path:t,params:n,decoder:i,...o}){let s=!1;const l={};if(!t||t==="/")return{interpolatedPath:"/",usedParams:l,isMissingParams:s};if(!t.includes("$"))return{interpolatedPath:t,usedParams:l,isMissingParams:s};const c=t.length;let f=0,d,h="";for(;f<c;){const g=f;d=$p(t,g,d);const v=d[5];if(f=v+1,g===v)continue;const x=d[0];if(x===ua){h+="/"+t.substring(g,v);continue}if(x===Kr){const b=n._splat;l._splat=b,l["*"]=b;const _=t.substring(g,d[1]),T=t.substring(d[4],v);if(!b){s=!0,(_||T)&&(h+="/"+_+T);continue}const C=Th("_splat",n,i);h+="/"+_+C+T;continue}if(x===Zr){const b=t.substring(d[2],d[3]);!s&&!(b in n)&&(s=!0),l[b]=n[b];const _=t.substring(g,d[1]),T=t.substring(d[4],v),C=Th(b,n,i)??"undefined";h+="/"+_+C+T;continue}if(x===Vs){const b=t.substring(d[2],d[3]),_=n[b];if(_==null)continue;l[b]=_;const T=t.substring(g,d[1]),C=t.substring(d[4],v),z=Th(b,n,i)??"";h+="/"+T+z+C;continue}}return t.endsWith("/")&&(h+="/"),{usedParams:l,interpolatedPath:h||"/",isMissingParams:s}}function ex(t,n){const i=encodeURIComponent(t);return n?.(i)??i}function hn(t){return!!t?.isNotFound}function $2(){try{if(typeof window<"u"&&typeof window.sessionStorage=="object")return window.sessionStorage}catch{}}const gp="tsr-scroll-restoration-v1_3",Z2=(t,n)=>{let i;return(...o)=>{i||(i=setTimeout(()=>{t(...o),i=null},n))}};function K2(){const t=$2();if(!t)return null;const n=t.getItem(gp);let i=n?JSON.parse(n):{};return{state:i,set:o=>{i=fr(o,i)||i;try{t.setItem(gp,JSON.stringify(i))}catch{console.warn("[ts-router] Could not persist scroll restoration state to sessionStorage.")}}}}const Hu=K2(),J2=t=>t.state.__TSR_key||t.href;function W2(t){const n=[];let i;for(;i=t.parentNode;)n.push(`${t.tagName}:nth-child(${Array.prototype.indexOf.call(i.children,t)+1})`),t=i;return`${n.reverse().join(" > ")}`.toLowerCase()}let yc=!1;function tT({storageKey:t,key:n,behavior:i,shouldScrollRestoration:o,scrollToTopSelectors:s,location:l}){let c;try{c=JSON.parse(sessionStorage.getItem(t)||"{}")}catch(h){console.error(h);return}const f=n||window.history.state?.__TSR_key,d=c[f];yc=!0;t:{if(o&&d&&Object.keys(d).length>0){for(const g in d){const v=d[g];if(g==="window")window.scrollTo({top:v.scrollY,left:v.scrollX,behavior:i});else if(g){const x=document.querySelector(g);x&&(x.scrollLeft=v.scrollX,x.scrollTop=v.scrollY)}}break t}const h=(l??window.location).hash.split("#",2)[1];if(h){const g=window.history.state?.__hashScrollIntoViewOptions??!0;if(g){const v=document.getElementById(h);v&&v.scrollIntoView(g)}break t}const m={top:0,left:0,behavior:i};if(window.scrollTo(m),s)for(const g of s){if(g==="window")continue;const v=typeof g=="function"?g():document.querySelector(g);v&&v.scrollTo(m)}}yc=!1}function eT(t,n){if(!Hu||((t.options.scrollRestoration??!1)&&(t.isScrollRestoring=!0),t.isScrollRestorationSetup||!Hu))return;t.isScrollRestorationSetup=!0,yc=!1;const o=t.options.getScrollRestorationKey||J2;window.history.scrollRestoration="manual";const s=l=>{if(yc||!t.isScrollRestoring)return;let c="";if(l.target===document||l.target===window)c="window";else{const d=l.target.getAttribute("data-scroll-restoration-id");d?c=`[data-scroll-restoration-id="${d}"]`:c=W2(l.target)}const f=o(t.state.location);Hu.set(d=>{const h=d[f]||={},m=h[c]||={};if(c==="window")m.scrollX=window.scrollX||0,m.scrollY=window.scrollY||0;else if(c){const g=document.querySelector(c);g&&(m.scrollX=g.scrollLeft||0,m.scrollY=g.scrollTop||0)}return d})};typeof document<"u"&&document.addEventListener("scroll",Z2(s,100),!0),t.subscribe("onRendered",l=>{const c=o(l.toLocation);if(!t.resetNextScroll){t.resetNextScroll=!0;return}typeof t.options.scrollRestoration=="function"&&!t.options.scrollRestoration({location:t.latestLocation})||(tT({storageKey:gp,key:c,behavior:t.options.scrollRestorationBehavior,shouldScrollRestoration:t.isScrollRestoring,scrollToTopSelectors:t.options.scrollToTopSelectors,location:t.history.location}),t.isScrollRestoring&&Hu.set(f=>(f[c]||={},f)))})}function nT(t){if(typeof document<"u"&&document.querySelector){const n=t.state.location.state.__hashScrollIntoViewOptions??!0;if(n&&t.state.location.hash!==""){const i=document.getElementById(t.state.location.hash);i&&i.scrollIntoView(n)}}}function iT(t,n=String){const i=new URLSearchParams;for(const o in t){const s=t[o];s!==void 0&&i.set(o,n(s))}return i.toString()}function Nh(t){return t?t==="false"?!1:t==="true"?!0:+t*0===0&&+t+""===t?+t:t:""}function rT(t){const n=new URLSearchParams(t),i={};for(const[o,s]of n.entries()){const l=i[o];l==null?i[o]=Nh(s):Array.isArray(l)?l.push(Nh(s)):i[o]=[l,Nh(s)]}return i}const oT=sT(JSON.parse),aT=lT(JSON.stringify,JSON.parse);function sT(t){return n=>{n[0]==="?"&&(n=n.substring(1));const i=rT(n);for(const o in i){const s=i[o];if(typeof s=="string")try{i[o]=t(s)}catch{}}return i}}function lT(t,n){const i=typeof n=="function";function o(s){if(typeof s=="object"&&s!==null)try{return t(s)}catch{}else if(i&&typeof s=="string")try{return n(s),t(s)}catch{}return s}return s=>{const l=iT(s,o);return l?`?${l}`:""}}const Mn="__root__";function uT(t){if(t.statusCode=t.statusCode||t.code||307,!t._builtLocation&&!t.reloadDocument&&typeof t.href=="string")try{new URL(t.href),t.reloadDocument=!0}catch{}const n=new Headers(t.headers);t.href&&n.get("Location")===null&&n.set("Location",t.href);const i=new Response(null,{status:t.statusCode,headers:n});if(i.options=t,t.throw)throw i;return i}function kn(t){return t instanceof Response&&!!t.options}const nc=t=>{if(!t.rendered)return t.rendered=!0,t.onReady?.()},Bc=(t,n)=>!!(t.preload&&!t.router.state.matches.some(i=>i.id===n)),na=(t,n,i=!0)=>{const o={...t.router.options.context??{}},s=i?n:n-1;for(let l=0;l<=s;l++){const c=t.matches[l];if(!c)continue;const f=t.router.getMatch(c.id);f&&Object.assign(o,f.__routeContext,f.__beforeLoadContext)}return o},R1=(t,n,i)=>{const o=t.router.routesById[n.routeId??""]??t.router.routeTree;!o.options.notFoundComponent&&t.router.options?.defaultNotFoundComponent&&(o.options.notFoundComponent=t.router.options.defaultNotFoundComponent);const s=i==="BEFORE_LOAD"&&o.parentRoute;s||ki(o.options.notFoundComponent);const l=t.matches.find(c=>c.routeId===o.id);ki(l,"Could not find match for route: "+o.id),t.updateMatch(l.id,c=>({...c,status:"notFound",error:n,isFetching:!1})),s&&(n.routeId=o.parentRoute.id,R1(t,n,i))},dr=(t,n,i,o)=>{if(!(!kn(i)&&!hn(i))){if(kn(i)&&i.redirectHandled&&!i.options.reloadDocument)throw i;if(n){n._nonReactive.beforeLoadPromise?.resolve(),n._nonReactive.loaderPromise?.resolve(),n._nonReactive.beforeLoadPromise=void 0,n._nonReactive.loaderPromise=void 0;const s=kn(i)?"redirected":"notFound";n._nonReactive.error=i,t.updateMatch(n.id,l=>({...l,status:s,context:na(t,n.index),isFetching:!1,error:i})),hn(i)&&!i.routeId&&(i.routeId=n.routeId),n._nonReactive.loadPromise?.resolve()}throw kn(i)?(t.rendered=!0,i.options._fromLocation=t.location,i.redirectHandled=!0,i=t.router.resolveRedirect(i),i):(R1(t,i,o),i)}},O1=(t,n)=>!!t.router.getMatch(n)._nonReactive.dehydrated,vs=(t,n,i,o)=>{const{id:s,routeId:l}=t.matches[n],c=t.router.looseRoutesById[l];if(i instanceof Promise)throw i;i.routerCode=o,t.firstBadMatchIndex??=n,dr(t,t.router.getMatch(s),i,o);try{c.options.onError?.(i)}catch(f){i=f,dr(t,t.router.getMatch(s),i,o)}t.updateMatch(s,f=>(f._nonReactive.beforeLoadPromise?.resolve(),f._nonReactive.beforeLoadPromise=void 0,f._nonReactive.loadPromise?.resolve(),{...f,error:i,status:"error",isFetching:!1,updatedAt:Date.now(),abortController:new AbortController}))},z1=(t,n,i,o)=>{if(o._nonReactive.pendingTimeout!==void 0)return;const s=i.options.pendingMs??t.router.options.defaultPendingMs;if(!!(t.onReady&&!Bc(t,n)&&(i.options.loader||i.options.beforeLoad||j1(i))&&typeof s=="number"&&s!==1/0&&(i.options.pendingComponent??t.router.options?.defaultPendingComponent))){const c=setTimeout(()=>{nc(t)},s);o._nonReactive.pendingTimeout=c}},cT=(t,n,i)=>{const o=t.router.getMatch(n);if(!o._nonReactive.beforeLoadPromise&&!o._nonReactive.loaderPromise)return;z1(t,n,i,o);const s=()=>{const l=t.router.getMatch(n);l.preload&&(l.status==="redirected"||l.status==="notFound")&&dr(t,l,l.error)};return o._nonReactive.beforeLoadPromise?o._nonReactive.beforeLoadPromise.then(s):s()},fT=(t,n,i,o)=>{const s=t.router.getMatch(n),l=s._nonReactive.loadPromise;s._nonReactive.loadPromise=la(()=>{l?.resolve()});const{paramsError:c,searchError:f}=s;c&&vs(t,i,c,"PARSE_PARAMS"),f&&vs(t,i,f,"VALIDATE_SEARCH"),z1(t,n,o,s);const d=new AbortController;let h=!1;const m=()=>{h||(h=!0,t.updateMatch(n,M=>({...M,isFetching:"beforeLoad",fetchCount:M.fetchCount+1,abortController:d})))},g=()=>{s._nonReactive.beforeLoadPromise?.resolve(),s._nonReactive.beforeLoadPromise=void 0,t.updateMatch(n,M=>({...M,isFetching:!1}))};if(!o.options.beforeLoad){Os(()=>{m(),g()});return}s._nonReactive.beforeLoadPromise=la();const v={...na(t,i,!1),...s.__routeContext},{search:x,params:b,cause:_}=s,T=Bc(t,n),C={search:x,abortController:d,params:b,preload:T,context:v,location:t.location,navigate:M=>t.router.navigate({...M,_fromLocation:t.location}),buildLocation:t.router.buildLocation,cause:T?"preload":_,matches:t.matches,routeId:o.id,...t.router.options.additionalContext},z=M=>{if(M===void 0){Os(()=>{m(),g()});return}(kn(M)||hn(M))&&(m(),vs(t,i,M,"BEFORE_LOAD")),Os(()=>{m(),t.updateMatch(n,H=>({...H,__beforeLoadContext:M})),g()})};let E;try{if(E=o.options.beforeLoad(C),ea(E))return m(),E.catch(M=>{vs(t,i,M,"BEFORE_LOAD")}).then(z)}catch(M){m(),vs(t,i,M,"BEFORE_LOAD")}z(E)},dT=(t,n)=>{const{id:i,routeId:o}=t.matches[n],s=t.router.looseRoutesById[o],l=()=>f(),c=()=>fT(t,i,n,s),f=()=>{if(O1(t,i))return;const d=cT(t,i,s);return ea(d)?d.then(c):c()};return l()},hT=(t,n,i)=>{const o=t.router.getMatch(n);if(!o||!i.options.head&&!i.options.scripts&&!i.options.headers)return;const s={ssr:t.router.options.ssr,matches:t.matches,match:o,params:o.params,loaderData:o.loaderData};return Promise.all([i.options.head?.(s),i.options.scripts?.(s),i.options.headers?.(s)]).then(([l,c,f])=>{const d=l?.meta,h=l?.links,m=l?.scripts,g=l?.styles;return{meta:d,links:h,headScripts:m,headers:f,scripts:c,styles:g}})},D1=(t,n,i,o)=>{const s=t.matchPromises[i-1],{params:l,loaderDeps:c,abortController:f,cause:d}=t.router.getMatch(n),h=na(t,i),m=Bc(t,n);return{params:l,deps:c,preload:!!m,parentMatchPromise:s,abortController:f,context:h,location:t.location,navigate:g=>t.router.navigate({...g,_fromLocation:t.location}),cause:m?"preload":d,route:o,...t.router.options.additionalContext}},nx=async(t,n,i,o)=>{try{const s=t.router.getMatch(n);try{(!(k2??t.router.isServer)||s.ssr===!0)&&L1(o);const l=o.options.loader?.(D1(t,n,i,o)),c=o.options.loader&&ea(l);if((c||o._lazyPromise||o._componentsPromise||o.options.head||o.options.scripts||o.options.headers||s._nonReactive.minPendingPromise)&&t.updateMatch(n,h=>({...h,isFetching:"loader"})),o.options.loader){const h=c?await l:l;dr(t,t.router.getMatch(n),h),h!==void 0&&t.updateMatch(n,m=>({...m,loaderData:h}))}o._lazyPromise&&await o._lazyPromise;const d=s._nonReactive.minPendingPromise;d&&await d,o._componentsPromise&&await o._componentsPromise,t.updateMatch(n,h=>({...h,error:void 0,context:na(t,i),status:"success",isFetching:!1,updatedAt:Date.now()}))}catch(l){let c=l;if(c?.name==="AbortError"){if(s.abortController.signal.aborted){s._nonReactive.loaderPromise?.resolve(),s._nonReactive.loaderPromise=void 0;return}t.updateMatch(n,d=>({...d,status:d.status==="pending"?"success":d.status,isFetching:!1,context:na(t,i)}));return}const f=s._nonReactive.minPendingPromise;f&&await f,hn(l)&&await o.options.notFoundComponent?.preload?.(),dr(t,t.router.getMatch(n),l);try{o.options.onError?.(l)}catch(d){c=d,dr(t,t.router.getMatch(n),d)}t.updateMatch(n,d=>({...d,error:c,context:na(t,i),status:"error",isFetching:!1}))}}catch(s){const l=t.router.getMatch(n);l&&(l._nonReactive.loaderPromise=void 0),dr(t,l,s)}},pT=async(t,n)=>{async function i(m,g,v,x){const b=Date.now()-g.updatedAt,_=m?x.options.preloadStaleTime??t.router.options.defaultPreloadStaleTime??3e4:x.options.staleTime??t.router.options.defaultStaleTime??0,T=x.options.shouldReload,C=typeof T=="function"?T(D1(t,o,n,x)):T,{status:z,invalid:E}=v;l=z==="success"&&(E||(C??b>_)),m&&x.options.preload===!1||(l&&!t.sync?(c=!0,(async()=>{try{await nx(t,o,n,x);const M=t.router.getMatch(o);M._nonReactive.loaderPromise?.resolve(),M._nonReactive.loadPromise?.resolve(),M._nonReactive.loaderPromise=void 0}catch(M){kn(M)&&await t.router.navigate(M.options)}})()):(z!=="success"||l&&t.sync)&&await nx(t,o,n,x))}const{id:o,routeId:s}=t.matches[n];let l=!1,c=!1;const f=t.router.looseRoutesById[s];if(!O1(t,o)){const m=t.router.getMatch(o),g=Bc(t,o);if(m._nonReactive.loaderPromise){if(m.status==="success"&&!t.sync&&!m.preload)return m;await m._nonReactive.loaderPromise;const v=t.router.getMatch(o),x=v._nonReactive.error||v.error;x&&dr(t,v,x),v.status==="pending"&&await i(g,m,v,f)}else{const v=g&&!t.router.state.matches.some(b=>b.id===o),x=t.router.getMatch(o);x._nonReactive.loaderPromise=la(),v!==x.preload&&t.updateMatch(o,b=>({...b,preload:v})),await i(g,m,x,f)}}const d=t.router.getMatch(o);c||(d._nonReactive.loaderPromise?.resolve(),d._nonReactive.loadPromise?.resolve()),clearTimeout(d._nonReactive.pendingTimeout),d._nonReactive.pendingTimeout=void 0,c||(d._nonReactive.loaderPromise=void 0),d._nonReactive.dehydrated=void 0;const h=c?d.isFetching:!1;return h!==d.isFetching||d.invalid!==!1?(t.updateMatch(o,m=>({...m,isFetching:h,invalid:!1})),t.router.getMatch(o)):d};async function ix(t){const n=Object.assign(t,{matchPromises:[]});n.router.state.matches.some(i=>i._forcePending)&&nc(n);try{for(let f=0;f<n.matches.length;f++){const d=dT(n,f);ea(d)&&await d}const i=n.firstBadMatchIndex??n.matches.length;for(let f=0;f<i;f++)n.matchPromises.push(pT(n,f));const s=(await Promise.allSettled(n.matchPromises)).filter(f=>f.status==="rejected").map(f=>f.reason);let l;for(const f of s){if(kn(f))throw f;!l&&hn(f)&&(l=f)}for(const f of n.matches){const{id:d,routeId:h}=f,m=n.router.looseRoutesById[h];try{const g=hT(n,d,m);if(g){const v=await g;n.updateMatch(d,x=>({...x,...v}))}}catch(g){console.error(`Error executing head for route ${h}:`,g)}}if(l)throw l;const c=nc(n);ea(c)&&await c}catch(i){if(hn(i)&&!n.preload){const o=nc(n);throw ea(o)&&await o,i}if(kn(i))throw i}return n.matches}async function L1(t){if(!t._lazyLoaded&&t._lazyPromise===void 0&&(t.lazyFn?t._lazyPromise=t.lazyFn().then(n=>{const{id:i,...o}=n.options;Object.assign(t.options,o),t._lazyLoaded=!0,t._lazyPromise=void 0}):t._lazyLoaded=!0),!t._componentsLoaded&&t._componentsPromise===void 0){const n=()=>{const i=[];for(const o of B1){const s=t.options[o]?.preload;s&&i.push(s())}if(i.length)return Promise.all(i).then(()=>{t._componentsLoaded=!0,t._componentsPromise=void 0});t._componentsLoaded=!0,t._componentsPromise=void 0};t._componentsPromise=t._lazyPromise?t._lazyPromise.then(n):n()}return t._componentsPromise}function j1(t){for(const n of B1)if(t.options[n]?.preload)return!0;return!1}const B1=["component","errorComponent","pendingComponent","notFoundComponent"];function mT(t){return{input:({url:n})=>{for(const i of t)n=yp(i,n);return n},output:({url:n})=>{for(let i=t.length-1;i>=0;i--)n=H1(t[i],n);return n}}}function gT(t){const n=A1(t.basepath),i=`/${n}`,o=`${i}/`,s=t.caseSensitive?i:i.toLowerCase(),l=t.caseSensitive?o:o.toLowerCase();return{input:({url:c})=>{const f=t.caseSensitive?c.pathname:c.pathname.toLowerCase();return f===s?c.pathname="/":f.startsWith(l)&&(c.pathname=c.pathname.slice(i.length)),c},output:({url:c})=>(c.pathname=ec(["/",n,c.pathname]),c)}}function yp(t,n){const i=t?.input?.({url:n});if(i){if(typeof i=="string")return new URL(i);if(i instanceof URL)return i}return n}function H1(t,n){const i=t?.output?.({url:n});if(i){if(typeof i=="string")return new URL(i);if(i instanceof URL)return i}return n}function Yr(t){const n=t.resolvedLocation,i=t.location,o=n?.pathname!==i.pathname,s=n?.href!==i.href,l=n?.hash!==i.hash;return{fromLocation:n,toLocation:i,pathChanged:o,hrefChanged:s,hashChanged:l}}class yT{constructor(n){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=i=>i(),this.update=i=>{i.notFoundRoute&&console.warn("The notFoundRoute API is deprecated and will be removed in the next major version. See https://tanstack.com/router/v1/docs/framework/react/guide/not-found-errors#migrating-from-notfoundroute for more info.");const o=this.options,s=this.basepath??o?.basepath??"/",l=this.basepath===void 0,c=o?.rewrite;if(this.options={...o,...i},this.isServer=this.options.isServer??typeof document>"u",this.protocolAllowlist=new Set(this.options.protocolAllowlist),this.options.pathParamsAllowedCharacters&&(this.pathParamsDecoder=Q2(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=T1()),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 v;this.resolvePathCache=mc(1e3),v=this.buildRouteTree(),this.setRoutes(v)}!this.__store&&this.latestLocation&&(this.__store=new mp(xT(this.latestLocation),{onUpdate:()=>{this.__store.state={...this.state,cachedMatches:this.state.cachedMatches.filter(v=>!["redirected"].includes(v.status))}}}),eT(this));let f=!1;const d=this.options.basepath??"/",h=this.options.rewrite;if(l||s!==d||c!==h){this.basepath=d;const v=[],x=A1(d);x&&x!=="/"&&v.push(gT({basepath:d})),h&&v.push(h),this.rewrite=v.length===0?void 0:v.length===1?v[0]:mT(v),this.history&&this.updateLatestLocation(),f=!0}f&&this.__store&&(this.__store.state={...this.state,location: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 i=V2(this.routeTree,this.options.caseSensitive,(o,s)=>{o.init({originalIndex:s})});return this.options.routeMasks&&B2(this.options.routeMasks,i.processedTree),i},this.subscribe=(i,o)=>{const s={eventType:i,fn:o};return this.subscribers.add(s),()=>{this.subscribers.delete(s)}},this.emit=i=>{this.subscribers.forEach(o=>{o.eventType===i.type&&o.fn(i)})},this.parseLocation=(i,o)=>{const s=({pathname:d,search:h,hash:m,href:g,state:v})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(d)){const z=this.options.parseSearch(h),E=this.options.stringifySearch(z);return{href:d+E+m,publicHref:g,pathname:gs(d).path,external:!1,searchStr:E,search:un(o?.search,z),hash:gs(m.slice(1)).path,state:un(o?.state,v)}}const x=new URL(g,this.origin),b=yp(this.rewrite,x),_=this.options.parseSearch(b.search),T=this.options.stringifySearch(_);return b.search=T,{href:b.href.replace(b.origin,""),publicHref:g,pathname:gs(b.pathname).path,external:!!this.rewrite&&b.origin!==this.origin,searchStr:T,search:un(o?.search,_),hash:gs(b.hash.slice(1)).path,state:un(o?.state,v)}},l=s(i),{__tempLocation:c,__tempKey:f}=l.state;if(c&&(!f||f===this.tempLocationKey)){const d=s(c);return d.state.key=l.state.key,d.state.__TSR_key=l.state.__TSR_key,delete d.state.__tempLocation,{...d,maskedLocation:l}}return l},this.resolvePathWithBase=(i,o)=>G2({base:i,to:Kp(o),trailingSlash:this.options.trailingSlash,cache:this.resolvePathCache}),this.matchRoutes=(i,o,s)=>typeof i=="string"?this.matchRoutesInternal({pathname:i,search:o},s):this.matchRoutesInternal(i,o),this.getMatchedRoutes=i=>bT({pathname:i,routesById:this.routesById,processedTree:this.processedTree}),this.cancelMatch=i=>{const o=this.getMatch(i);o&&(o.abortController.abort(),clearTimeout(o._nonReactive.pendingTimeout),o._nonReactive.pendingTimeout=void 0)},this.cancelMatches=()=>{const i=this.state.matches.filter(l=>l.status==="pending"),o=this.state.matches.filter(l=>l.isFetching==="loader");new Set([...this.state.pendingMatches??[],...i,...o]).forEach(l=>{this.cancelMatch(l.id)})},this.buildLocation=i=>{const o=(l={})=>{const c=l._fromLocation||this.pendingBuiltLocation||this.latestLocation,f=this.matchRoutesLightweight(c);l.from;const d=l.unsafeRelative==="path"?c.pathname:l.from??f.fullPath,h=this.resolvePathWithBase(d,"."),m=f.search,g={...f.params},v=l.to?this.resolvePathWithBase(h,`${l.to}`):this.resolvePathWithBase(h,"."),x=l.params===!1||l.params===null?{}:(l.params??!0)===!0?g:Object.assign(g,fr(l.params,g)),b=Mh({path:v,params:x,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath,_=this.getMatchedRoutes(b);let T=_.matchedRoutes;(_.foundRoute?_.foundRoute.path!=="/"&&_.routeParams["**"]:Ti(b))&&this.options.notFoundRoute&&(T=[...T,this.options.notFoundRoute]);let z=!1;if(Object.keys(x).length>0)for(const K of T){const D=K.options.params?.stringify??K.options.stringifyParams;D&&(z=!0,Object.assign(x,D(x)))}const E=i.leaveParams?v:gs(z?Mh({path:v,params:x,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath:b).path;let M=m;if(i._includeValidateSearch&&this.options.search?.strict){const K={};T.forEach(D=>{if(D.options.validateSearch)try{Object.assign(K,ic(D.options.validateSearch,{...K,...M}))}catch{}}),M=K}M=ST({search:M,dest:l,destRoutes:T,_includeValidateSearch:i._includeValidateSearch}),M=un(m,M);const H=this.options.stringifySearch(M),R=l.hash===!0?c.hash:l.hash?fr(l.hash,c.hash):void 0,B=R?`#${R}`:"";let P=l.state===!0?c.state:l.state?fr(l.state,c.state):{};P=un(c.state,P);const q=`${E}${H}${B}`;let J,j,V=!1;if(this.rewrite){const K=new URL(q,this.origin),D=H1(this.rewrite,K);J=K.href.replace(K.origin,""),D.origin!==this.origin?(j=D.href,V=!0):j=D.pathname+D.search+D.hash}else J=D2(q),j=J;return{publicHref:j,href:J,pathname:E,search:M,searchStr:H,state:P,hash:R??"",external:V,unmaskOnReload:l.unmaskOnReload}},s=(l={},c)=>{const f=o(l);let d=c?o(c):void 0;if(!d){const h={};if(this.options.routeMasks){const m=H2(f.pathname,this.processedTree);if(m){Object.assign(h,m.rawParams);const{from:g,params:v,...x}=m.route,b=v===!1||v===null?{}:(v??!0)===!0?h:Object.assign(h,fr(v,h));c={from:i.from,...x,params:b},d=o(c)}}}return d&&(f.maskedLocation=d),f};return i.mask?s(i,{from:i.from,...i.mask}):s(i)},this.commitLocation=async({viewTransition:i,ignoreBlocker:o,...s})=>{const l=()=>{const d=["key","__TSR_key","__TSR_index","__hashScrollIntoViewOptions"];d.forEach(m=>{s.state[m]=this.latestLocation.state[m]});const h=Fr(s.state,this.latestLocation.state);return d.forEach(m=>{delete s.state[m]}),h},c=Ti(this.latestLocation.href)===Ti(s.href),f=this.commitLocationPromise;if(this.commitLocationPromise=la(()=>{f?.resolve()}),c&&l())this.load();else{let{maskedLocation:d,hashScrollIntoView:h,...m}=s;d&&(m={...d,state:{...d.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=h??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=i,this.history[s.replace?"replace":"push"](m.publicHref,m.state,{ignoreBlocker:o})}return this.resetNextScroll=s.resetScroll??!0,this.history.subscribers.size||this.load(),this.commitLocationPromise},this.buildAndCommitLocation=({replace:i,resetScroll:o,hashScrollIntoView:s,viewTransition:l,ignoreBlocker:c,href:f,...d}={})=>{if(f){const g=this.history.location.state.__TSR_index,v=Is(f,{__TSR_index:i?g:g+1}),x=new URL(v.pathname,this.origin),b=yp(this.rewrite,x);d.to=b.pathname,d.search=this.options.parseSearch(v.search),d.hash=v.hash.slice(1)}const h=this.buildLocation({...d,_includeValidateSearch:!0});this.pendingBuiltLocation=h;const m=this.commitLocation({...h,viewTransition:l,replace:i,resetScroll:o,hashScrollIntoView:s,ignoreBlocker:c});return Promise.resolve().then(()=>{this.pendingBuiltLocation===h&&(this.pendingBuiltLocation=void 0)}),m},this.navigate=async({to:i,reloadDocument:o,href:s,publicHref:l,...c})=>{let f=!1;if(s)try{new URL(`${s}`),f=!0}catch{}if(f&&!o&&(o=!0),o){if(i!==void 0||!s){const h=this.buildLocation({to:i,...c});s=s??h.publicHref,l=l??h.publicHref}const d=!f&&l?l:s;if(pc(d,this.protocolAllowlist))return Promise.resolve();if(!c.ignoreBlocker){const m=this.history.getBlockers?.()??[];for(const g of m)if(g?.blockerFn&&await g.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:"PUSH"}))return Promise.resolve()}return c.replace?window.location.replace(d):window.location.href=d,Promise.resolve()}return this.buildAndCommitLocation({...c,href:s,to:i,_isNavigate:!0})},this.beforeLoad=()=>{this.cancelMatches(),this.updateLatestLocation();const i=this.matchRoutes(this.latestLocation);this.__store.setState(o=>({...o,status:"pending",statusCode:200,isLoading:!0,location:this.latestLocation,pendingMatches:i,cachedMatches:o.cachedMatches.filter(s=>!i.some(l=>l.id===s.id))}))},this.load=async i=>{let o,s,l;for(l=new Promise(f=>{this.startTransition(async()=>{try{this.beforeLoad();const d=this.latestLocation,h=this.state.resolvedLocation;this.state.redirect||this.emit({type:"onBeforeNavigate",...Yr({resolvedLocation:h,location:d})}),this.emit({type:"onBeforeLoad",...Yr({resolvedLocation:h,location:d})}),await ix({router:this,sync:i?.sync,matches:this.state.pendingMatches,location:d,updateMatch:this.updateMatch,onReady:async()=>{this.startTransition(()=>{this.startViewTransition(async()=>{let m=[],g=[],v=[];Os(()=>{this.__store.setState(x=>{const b=x.matches,_=x.pendingMatches||x.matches;return m=b.filter(T=>!_.some(C=>C.id===T.id)),g=_.filter(T=>!b.some(C=>C.id===T.id)),v=_.filter(T=>b.some(C=>C.id===T.id)),{...x,isLoading:!1,loadedAt:Date.now(),matches:_,pendingMatches:void 0,cachedMatches:[...x.cachedMatches,...m.filter(T=>T.status!=="error"&&T.status!=="notFound")]}}),this.clearExpiredCache()}),[[m,"onLeave"],[g,"onEnter"],[v,"onStay"]].forEach(([x,b])=>{x.forEach(_=>{this.looseRoutesById[_.routeId].options[b]?.(_)})})})})}})}catch(d){kn(d)?(o=d,this.navigate({...o.options,replace:!0,ignoreBlocker:!0})):hn(d)&&(s=d),this.__store.setState(h=>({...h,statusCode:o?o.status:s?404:h.matches.some(m=>m.status==="error")?500:200,redirect:o}))}this.latestLoadPromise===l&&(this.commitLocationPromise?.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),f()})}),this.latestLoadPromise=l,await l;this.latestLoadPromise&&l!==this.latestLoadPromise;)await this.latestLoadPromise;let c;this.hasNotFoundMatch()?c=404:this.__store.state.matches.some(f=>f.status==="error")&&(c=500),c!==void 0&&this.__store.setState(f=>({...f,statusCode:c}))},this.startViewTransition=i=>{const o=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,o&&typeof document<"u"&&"startViewTransition"in document&&typeof document.startViewTransition=="function"){let s;if(typeof o=="object"&&this.isViewTransitionTypesSupported){const l=this.latestLocation,c=this.state.resolvedLocation,f=typeof o.types=="function"?o.types(Yr({resolvedLocation:c,location:l})):o.types;if(f===!1){i();return}s={update:i,types:f}}else s=i;document.startViewTransition(s)}else i()},this.updateMatch=(i,o)=>{this.startTransition(()=>{const s=this.state.pendingMatches?.some(l=>l.id===i)?"pendingMatches":this.state.matches.some(l=>l.id===i)?"matches":this.state.cachedMatches.some(l=>l.id===i)?"cachedMatches":"";s&&this.__store.setState(l=>({...l,[s]:l[s]?.map(c=>c.id===i?o(c):c)}))})},this.getMatch=i=>{const o=s=>s.id===i;return this.state.cachedMatches.find(o)??this.state.pendingMatches?.find(o)??this.state.matches.find(o)},this.invalidate=i=>{const o=s=>i?.filter?.(s)??!0?{...s,invalid:!0,...i?.forcePending||s.status==="error"||s.status==="notFound"?{status:"pending",error:void 0}:void 0}:s;return this.__store.setState(s=>({...s,matches:s.matches.map(o),cachedMatches:s.cachedMatches.map(o),pendingMatches:s.pendingMatches?.map(o)})),this.shouldViewTransition=!1,this.load({sync:i?.sync})},this.getParsedLocationHref=i=>i.publicHref||"/",this.resolveRedirect=i=>{const o=i.headers.get("Location");if(!i.options.href||i.options._builtLocation){const s=i.options._builtLocation??this.buildLocation(i.options),l=this.getParsedLocationHref(s);i.options.href=l,i.headers.set("Location",l)}else if(o)try{const s=new URL(o);if(this.origin&&s.origin===this.origin){const l=s.pathname+s.search+s.hash;i.options.href=l,i.headers.set("Location",l)}}catch{}if(i.options.href&&!i.options._builtLocation&&pc(i.options.href,this.protocolAllowlist))throw new Error(`Redirect blocked: unsafe protocol in href "${i.options.href}". Allowed protocols: ${Array.from(this.protocolAllowlist).join(", ")}.`);return i.headers.get("Location")||i.headers.set("Location",i.options.href),i},this.clearCache=i=>{const o=i?.filter;o!==void 0?this.__store.setState(s=>({...s,cachedMatches:s.cachedMatches.filter(l=>!o(l))})):this.__store.setState(s=>({...s,cachedMatches:[]}))},this.clearExpiredCache=()=>{const i=o=>{const s=this.looseRoutesById[o.routeId];if(!s.options.loader)return!0;const l=(o.preload?s.options.preloadGcTime??this.options.defaultPreloadGcTime:s.options.gcTime??this.options.defaultGcTime)??300*1e3;return o.status==="error"?!0:Date.now()-o.updatedAt>=l};this.clearCache({filter:i})},this.loadRouteChunk=L1,this.preloadRoute=async i=>{const o=i._builtLocation??this.buildLocation(i);let s=this.matchRoutes(o,{throwOnError:!0,preload:!0,dest:i});const l=new Set([...this.state.matches,...this.state.pendingMatches??[]].map(f=>f.id)),c=new Set([...l,...this.state.cachedMatches.map(f=>f.id)]);Os(()=>{s.forEach(f=>{c.has(f.id)||this.__store.setState(d=>({...d,cachedMatches:[...d.cachedMatches,f]}))})});try{return s=await ix({router:this,matches:s,location:o,preload:!0,updateMatch:(f,d)=>{l.has(f)?s=s.map(h=>h.id===f?d(h):h):this.updateMatch(f,d)}}),s}catch(f){if(kn(f))return f.options.reloadDocument?void 0:await this.preloadRoute({...f.options,_fromLocation:o});hn(f)||console.error(f);return}},this.matchRoute=(i,o)=>{const s={...i,to:i.to?this.resolvePathWithBase(i.from||"",i.to):void 0,params:i.params||{},leaveParams:!0},l=this.buildLocation(s);if(o?.pending&&this.state.status!=="pending")return!1;const f=(o?.pending===void 0?!this.state.isLoading:o.pending)?this.latestLocation:this.state.resolvedLocation||this.state.location,d=P2(l.pathname,o?.caseSensitive??!1,o?.fuzzy??!1,f.pathname,this.processedTree);return!d||i.params&&!Fr(d.rawParams,i.params,{partial:!0})?!1:o?.includeSearch??!0?Fr(f.search,l.search,{partial:!0})?d.rawParams:!1:d.rawParams},this.hasNotFoundMatch=()=>this.__store.state.matches.some(i=>i.status==="notFound"||i.globalNotFound),this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...n,caseSensitive:n.caseSensitive??!1,notFoundMode:n.notFoundMode??"fuzzy",stringifySearch:n.stringifySearch??aT,parseSearch:n.parseSearch??oT,protocolAllowlist:n.protocolAllowlist??z2}),typeof document<"u"&&(self.__TSR_ROUTER__=this)}isShell(){return!!this.options.isShell}isPrerendering(){return!!this.options.isPrerendering}get state(){return this.__store.state}setRoutes({routesById:n,routesByPath:i,processedTree:o}){this.routesById=n,this.routesByPath=i,this.processedTree=o;const s=this.options.notFoundRoute;s&&(s.init({originalIndex:99999999999}),this.routesById[s.id]=s)}get looseRoutesById(){return this.routesById}getParentContext(n){return n?.id?n.context??this.options.context??void 0:this.options.context??void 0}matchRoutesInternal(n,i){const o=this.getMatchedRoutes(n.pathname),{foundRoute:s,routeParams:l,parsedParams:c}=o;let{matchedRoutes:f}=o,d=!1;(s?s.path!=="/"&&l["**"]:Ti(n.pathname))&&(this.options.notFoundRoute?f=[...f,this.options.notFoundRoute]:d=!0);const h=d?ET(this.options.notFoundMode,f):void 0,m=new Array(f.length),g=new Map(this.state.matches.map(v=>[v.routeId,v]));for(let v=0;v<f.length;v++){const x=f[v],b=m[v-1];let _,T,C;{const D=b?.search??n.search,I=b?._strictSearch??void 0;try{const O=ic(x.options.validateSearch,{...D})??void 0;_={...D,...O},T={...I,...O},C=void 0}catch(O){let U=O;if(O instanceof vc||(U=new vc(O.message,{cause:O})),i?.throwOnError)throw U;_=D,T={},C=U}}const z=x.options.loaderDeps?.({search:_})??"",E=z?JSON.stringify(z):"",{interpolatedPath:M,usedParams:H}=Mh({path:x.fullPath,params:l,decoder:this.pathParamsDecoder,server:this.isServer}),R=x.id+M+E,B=this.getMatch(R),P=g.get(x.id),q=B?._strictParams??H;let J;if(!B)try{rx(x,H,c,q)}catch(D){if(hn(D)||kn(D)?J=D:J=new vT(D.message,{cause:D}),i?.throwOnError)throw J}Object.assign(l,q);const j=P?"stay":"enter";let V;if(B)V={...B,cause:j,params:P?.params??l,_strictParams:q,search:un(P?P.search:B.search,_),_strictSearch:T};else{const D=x.options.loader||x.options.beforeLoad||x.lazyFn||j1(x)?"pending":"success";V={id:R,ssr:x.options.ssr,index:v,routeId:x.id,params:P?.params??l,_strictParams:q,pathname:M,updatedAt:Date.now(),search:P?un(P.search,_):_,_strictSearch:T,searchError:void 0,status:D,isFetching:!1,error:void 0,paramsError:J,__routeContext:void 0,_nonReactive:{loadPromise:la()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:j,loaderDeps:P?un(P.loaderDeps,z):z,invalid:!1,preload:!1,links:void 0,scripts:void 0,headScripts:void 0,meta:void 0,staticData:x.options.staticData||{},fullPath:x.fullPath}}i?.preload||(V.globalNotFound=h===x.id),V.searchError=C;const K=this.getParentContext(b);V.context={...K,...V.__routeContext,...V.__beforeLoadContext},m[v]=V}for(let v=0;v<m.length;v++){const x=m[v],b=this.looseRoutesById[x.routeId],_=this.getMatch(x.id),T=g.get(x.routeId);if(x.params=T?un(T.params,l):l,!_){const C=m[v-1],z=this.getParentContext(C);if(b.options.context){const E={deps:x.loaderDeps,params:x.params,context:z??{},location:n,navigate:M=>this.navigate({...M,_fromLocation:n}),buildLocation:this.buildLocation,cause:x.cause,abortController:x.abortController,preload:!!x.preload,matches:m,routeId:b.id};x.__routeContext=b.options.context(E)??void 0}x.context={...z,...x.__routeContext,...x.__beforeLoadContext}}}return m}matchRoutesLightweight(n){const{matchedRoutes:i,routeParams:o,parsedParams:s}=this.getMatchedRoutes(n.pathname),l=Us(i),c={...n.search};for(const m of i)try{Object.assign(c,ic(m.options.validateSearch,c))}catch{}const f=Us(this.state.matches),d=f&&f.routeId===l.id&&n.pathname===this.state.location.pathname;let h;if(d)h=f.params;else{const m={...o};for(const g of i)try{rx(g,o,s??{},m)}catch{}h=m}return{matchedRoutes:i,fullPath:l.fullPath,search:c,params:h}}}class vc extends Error{}class vT extends Error{}function xT(t){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:"idle",resolvedLocation:void 0,location:t,matches:[],pendingMatches:[],cachedMatches:[],statusCode:200}}function ic(t,n){if(t==null)return{};if("~standard"in t){const i=t["~standard"].validate(n);if(i instanceof Promise)throw new vc("Async validation not supported");if(i.issues)throw new vc(JSON.stringify(i.issues,void 0,2),{cause:i});return i.value}return"parse"in t?t.parse(n):typeof t=="function"?t(n):{}}function bT({pathname:t,routesById:n,processedTree:i}){const o={},s=Ti(t);let l,c;const f=I2(s,i,!0);return f&&(l=f.route,Object.assign(o,f.rawParams),c=Object.assign({},f.parsedParams)),{matchedRoutes:f?.branch||[n[Mn]],routeParams:o,foundRoute:l,parsedParams:c}}function ST({search:t,dest:n,destRoutes:i,_includeValidateSearch:o}){return wT(i)(t,n,o??!1)}function wT(t){const n={dest:null,_includeValidateSearch:!1,middlewares:[]};for(const s of t){if("search"in s.options)s.options.search?.middlewares&&n.middlewares.push(...s.options.search.middlewares);else if(s.options.preSearchFilters||s.options.postSearchFilters){const l=({search:c,next:f})=>{let d=c;"preSearchFilters"in s.options&&s.options.preSearchFilters&&(d=s.options.preSearchFilters.reduce((m,g)=>g(m),c));const h=f(d);return"postSearchFilters"in s.options&&s.options.postSearchFilters?s.options.postSearchFilters.reduce((m,g)=>g(m),h):h};n.middlewares.push(l)}if(s.options.validateSearch){const l=({search:c,next:f})=>{const d=f(c);if(!n._includeValidateSearch)return d;try{return{...d,...ic(s.options.validateSearch,d)??void 0}}catch{return d}};n.middlewares.push(l)}}const i=({search:s})=>{const l=n.dest;return l.search?l.search===!0?s:fr(l.search,s):{}};n.middlewares.push(i);const o=(s,l,c)=>{if(s>=c.length)return l;const f=c[s];return f({search:l,next:h=>o(s+1,h,c)})};return function(l,c,f){return n.dest=c,n._includeValidateSearch=f,o(0,l,n.middlewares)}}function ET(t,n){if(t!=="root")for(let i=n.length-1;i>=0;i--){const o=n[i];if(o.children)return o.id}return Mn}function rx(t,n,i,o){const s=t.options.params?.parse??t.options.parseParams;if(s)if(t.options.skipRouteOnParseError)for(const l in n)l in i&&(o[l]=i[l]);else{const l=s(o);Object.assign(o,l)}}const _T="Error preloading route! ☝️";class P1{constructor(n){if(this.init=i=>{this.originalIndex=i.originalIndex;const o=this.options,s=!o?.path&&!o?.id;this.parentRoute=this.options.getParentRoute?.(),s?this._path=Mn:this.parentRoute||ki(!1);let l=s?Mn:o?.path;l&&l!=="/"&&(l=k1(l));const c=o?.id||l;let f=s?Mn:ec([this.parentRoute.id===Mn?"":this.parentRoute.id,c]);l===Mn&&(l="/"),f!==Mn&&(f=ec(["/",f]));const d=f===Mn?"/":ec([this.parentRoute.fullPath,l]);this._path=l,this._id=f,this._fullPath=d,this._to=Ti(d)},this.addChildren=i=>this._addFileChildren(i),this._addFileChildren=i=>(Array.isArray(i)&&(this.children=i),typeof i=="object"&&i!==null&&(this.children=Object.values(i)),this),this._addFileTypes=()=>this,this.updateLoader=i=>(Object.assign(this.options,i),this),this.update=i=>(Object.assign(this.options,i),this),this.lazy=i=>(this.lazyFn=i,this),this.redirect=i=>uT({from:this.fullPath,...i}),this.options=n||{},this.isRoot=!n?.getParentRoute,n?.id&&n?.path)throw new Error("Route cannot have both an 'id' and a 'path' option.")}get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}}class CT extends P1{constructor(n){super(n)}}const Pu=typeof window<"u"?F.useLayoutEffect:F.useEffect;function kh(t){const n=F.useRef({value:t,prev:null}),i=n.current.value;return t!==i&&(n.current={value:t,prev:i}),n.current.prev}function TT(t,n,i={},o={}){F.useEffect(()=>{if(!t.current||o.disabled||typeof IntersectionObserver!="function")return;const s=new IntersectionObserver(([l])=>{n(l)},i);return s.observe(t.current),()=>{s.disconnect()}},[n,i,o.disabled,t])}function MT(t){const n=F.useRef(null);return F.useImperativeHandle(t,()=>n.current,[]),n}function Jp(t){const n=t.errorComponent??Wp;return w.jsx(NT,{getResetKey:t.getResetKey,onCatch:t.onCatch,children:({error:i,reset:o})=>i?F.createElement(n,{error:i,reset:o}):t.children})}class NT extends F.Component{constructor(){super(...arguments),this.state={error:null}}static getDerivedStateFromProps(n){return{resetKey:n.getResetKey()}}static getDerivedStateFromError(n){return{error:n}}reset(){this.setState({error:null})}componentDidUpdate(n,i){i.error&&i.resetKey!==this.state.resetKey&&this.reset()}componentDidCatch(n,i){this.props.onCatch&&this.props.onCatch(n,i)}render(){return this.props.children({error:this.state.resetKey!==this.props.getResetKey()?null:this.state.error,reset:()=>{this.reset()}})}}function Wp({error:t}){const[n,i]=F.useState(!1);return w.jsxs("div",{style:{padding:".5rem",maxWidth:"100%"},children:[w.jsxs("div",{style:{display:"flex",alignItems:"center",gap:".5rem"},children:[w.jsx("strong",{style:{fontSize:"1rem"},children:"Something went wrong!"}),w.jsx("button",{style:{appearance:"none",fontSize:".6em",border:"1px solid currentColor",padding:".1rem .2rem",fontWeight:"bold",borderRadius:".25rem"},onClick:()=>i(o=>!o),children:n?"Hide Error":"Show Error"})]}),w.jsx("div",{style:{height:".25rem"}}),n?w.jsx("div",{children:w.jsx("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"},children:t.message?w.jsx("code",{children:t.message}):null})}):null]})}function kT({children:t,fallback:n=null}){return I1()?w.jsx(sa.Fragment,{children:t}):w.jsx(sa.Fragment,{children:n})}function I1(){return sa.useSyncExternalStore(AT,()=>!0,()=>!1)}function AT(){return()=>{}}var Ah={exports:{}},Rh={},Oh={exports:{}},zh={};var ox;function RT(){if(ox)return zh;ox=1;var t=nl();function n(g,v){return g===v&&(g!==0||1/g===1/v)||g!==g&&v!==v}var i=typeof Object.is=="function"?Object.is:n,o=t.useState,s=t.useEffect,l=t.useLayoutEffect,c=t.useDebugValue;function f(g,v){var x=v(),b=o({inst:{value:x,getSnapshot:v}}),_=b[0].inst,T=b[1];return l(function(){_.value=x,_.getSnapshot=v,d(_)&&T({inst:_})},[g,x,v]),s(function(){return d(_)&&T({inst:_}),g(function(){d(_)&&T({inst:_})})},[g]),c(x),x}function d(g){var v=g.getSnapshot;g=g.value;try{var x=v();return!i(g,x)}catch{return!0}}function h(g,v){return v()}var m=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?h:f;return zh.useSyncExternalStore=t.useSyncExternalStore!==void 0?t.useSyncExternalStore:m,zh}var ax;function OT(){return ax||(ax=1,Oh.exports=RT()),Oh.exports}var sx;function zT(){if(sx)return Rh;sx=1;var t=nl(),n=OT();function i(h,m){return h===m&&(h!==0||1/h===1/m)||h!==h&&m!==m}var o=typeof Object.is=="function"?Object.is:i,s=n.useSyncExternalStore,l=t.useRef,c=t.useEffect,f=t.useMemo,d=t.useDebugValue;return Rh.useSyncExternalStoreWithSelector=function(h,m,g,v,x){var b=l(null);if(b.current===null){var _={hasValue:!1,value:null};b.current=_}else _=b.current;b=f(function(){function C(R){if(!z){if(z=!0,E=R,R=v(R),x!==void 0&&_.hasValue){var B=_.value;if(x(B,R))return M=B}return M=R}if(B=M,o(E,R))return B;var P=v(R);return x!==void 0&&x(B,P)?(E=R,B):(E=R,M=P)}var z=!1,E,M,H=g===void 0?null:g;return[function(){return C(m())},H===null?void 0:function(){return C(H())}]},[m,g,v,x]);var T=s(h,b[0],b[1]);return c(function(){_.hasValue=!0,_.value=T},[T]),d(T),T},Rh}var lx;function DT(){return lx||(lx=1,Ah.exports=zT()),Ah.exports}var U1=DT();const LT=Dc(U1);function jT(t,n=o=>o,i={}){const o=i.equal??BT;return U1.useSyncExternalStoreWithSelector(t.subscribe,()=>t.state,()=>t.state,n,o)}function BT(t,n){if(Object.is(t,n))return!0;if(typeof t!="object"||t===null||typeof n!="object"||n===null)return!1;if(t instanceof Map&&n instanceof Map){if(t.size!==n.size)return!1;for(const[o,s]of t)if(!n.has(o)||!Object.is(s,n.get(o)))return!1;return!0}if(t instanceof Set&&n instanceof Set){if(t.size!==n.size)return!1;for(const o of t)if(!n.has(o))return!1;return!0}if(t instanceof Date&&n instanceof Date)return t.getTime()===n.getTime();const i=ux(t);if(i.length!==ux(n).length)return!1;for(let o=0;o<i.length;o++)if(!Object.prototype.hasOwnProperty.call(n,i[o])||!Object.is(t[i[o]],n[i[o]]))return!1;return!0}function ux(t){return Object.keys(t).concat(Object.getOwnPropertySymbols(t))}const Dh=F.createContext(null);function V1(){return typeof document>"u"?Dh:window.__TSR_ROUTER_CONTEXT__?window.__TSR_ROUTER_CONTEXT__:(window.__TSR_ROUTER_CONTEXT__=Dh,Dh)}function gn(t){const n=F.useContext(V1());return t?.warn,n}function pn(t){const n=gn({warn:t?.router===void 0}),i=t?.router||n,o=F.useRef(void 0);return jT(i.__store,s=>{if(t?.select){if(t.structuralSharing??i.options.defaultStructuralSharing){const l=un(o.current,t.select(s));return o.current=l,l}return t.select(s)}return s})}const Hc=F.createContext(void 0),HT=F.createContext(void 0);function Wn(t){const n=F.useContext(t.from?HT:Hc);return pn({select:o=>{const s=o.matches.find(l=>t.from?t.from===l.routeId:l.id===n);if(ki(!((t.shouldThrow??!0)&&!s),`Could not find ${t.from?`an active match from "${t.from}"`:"a nearest match!"}`),s!==void 0)return t.select?t.select(s):s},structuralSharing:t.structuralSharing})}function tm(t){return Wn({from:t.from,strict:t.strict,structuralSharing:t.structuralSharing,select:n=>t.select?t.select(n.loaderData):n.loaderData})}function em(t){const{select:n,...i}=t;return Wn({...i,select:o=>n?n(o.loaderDeps):o.loaderDeps})}function nm(t){return Wn({from:t.from,shouldThrow:t.shouldThrow,structuralSharing:t.structuralSharing,strict:t.strict,select:n=>{const i=t.strict===!1?n.params:n._strictParams;return t.select?t.select(i):i}})}function im(t){return Wn({from:t.from,strict:t.strict,shouldThrow:t.shouldThrow,structuralSharing:t.structuralSharing,select:n=>t.select?t.select(n.search):n.search})}function rl(t){const n=gn();return F.useCallback(i=>n.navigate({...i,from:i.from??t?.from}),[t?.from,n])}var PT=d1();function IT(t,n){const i=gn(),o=MT(n),{activeProps:s,inactiveProps:l,activeOptions:c,to:f,preload:d,preloadDelay:h,hashScrollIntoView:m,replace:g,startTransition:v,resetScroll:x,viewTransition:b,children:_,target:T,disabled:C,style:z,className:E,onClick:M,onFocus:H,onMouseEnter:R,onMouseLeave:B,onTouchStart:P,ignoreBlocker:q,params:J,search:j,hash:V,state:K,mask:D,reloadDocument:I,unsafeRelative:O,from:U,_fromLocation:G,...$}=t,k=I1(),L=pn({select:et=>{const ut=et.matches[et.matches.length-1];return{search:ut?.search,hash:et.location.hash,path:ut?.pathname}},structuralSharing:!0}),X=t.from,A=F.useMemo(()=>({...t,from:X}),[i,L,X,t._fromLocation,t.hash,t.to,t.search,t.params,t.state,t.mask,t.unsafeRelative]),it=F.useMemo(()=>i.buildLocation({...A}),[i,A]),ct=it.maskedLocation?it.maskedLocation.publicHref:it.publicHref,ft=it.maskedLocation?it.maskedLocation.external:it.external,dt=F.useMemo(()=>XT(ct,ft,i.history,C),[C,ft,ct,i.history]),lt=F.useMemo(()=>{if(dt?.external)return pc(dt.href,i.protocolAllowlist)?void 0:dt.href;if(!GT(f)&&!(typeof f!="string"||f.indexOf(":")===-1))try{return new URL(f),pc(f,i.protocolAllowlist)?void 0:f}catch{}},[f,dt,i.protocolAllowlist]),pt=pn({select:et=>{if(lt)return!1;if(c?.exact){if(!X2(et.location.pathname,it.pathname,i.basepath))return!1}else{const ut=gc(et.location.pathname,i.basepath),gt=gc(it.pathname,i.basepath);if(!(ut.startsWith(gt)&&(ut.length===gt.length||ut[gt.length]==="/")))return!1}return(c?.includeSearch??!0)&&!Fr(et.location.search,it.search,{partial:!c?.exact,ignoreUndefined:!c?.explicitUndefined})?!1:c?.includeHash?k&&et.location.hash===it.hash:!0}}),St=pt?fr(s,{})??UT:Lh,wt=pt?Lh:fr(l,{})??Lh,vt=[E,St.className,wt.className].filter(Boolean).join(" "),Et=(z||St.style||wt.style)&&{...z,...St.style,...wt.style},[Rt,Ht]=F.useState(!1),jt=F.useRef(!1),Qt=t.reloadDocument||lt?!1:d??i.options.defaultPreload,Ee=h??i.options.defaultPreloadDelay??0,ie=F.useCallback(()=>{i.preloadRoute({...A,_builtLocation:it}).catch(et=>{console.warn(et),console.warn(_T)})},[i,A,it]),Ae=F.useCallback(et=>{et?.isIntersecting&&ie()},[ie]);TT(o,Ae,YT,{disabled:!!C||Qt!=="viewport"}),F.useEffect(()=>{jt.current||!C&&Qt==="render"&&(ie(),jt.current=!0)},[C,ie,Qt]);const Je=et=>{const ut=et.currentTarget.getAttribute("target"),gt=T!==void 0?T:ut;if(!C&&!QT(et)&&!et.defaultPrevented&&(!gt||gt==="_self")&&et.button===0){et.preventDefault(),PT.flushSync(()=>{Ht(!0)});const Mt=i.subscribe("onResolved",()=>{Mt(),Ht(!1)});i.navigate({...A,replace:g,resetScroll:x,hashScrollIntoView:m,startTransition:v,viewTransition:b,ignoreBlocker:q})}};if(lt)return{...$,ref:o,href:lt,..._&&{children:_},...T&&{target:T},...C&&{disabled:C},...z&&{style:z},...E&&{className:E},...M&&{onClick:M},...H&&{onFocus:H},...R&&{onMouseEnter:R},...B&&{onMouseLeave:B},...P&&{onTouchStart:P}};const yn=et=>{C||Qt&&ie()},An=yn,ue=et=>{if(!(C||!Qt))if(!Ee)ie();else{const ut=et.target;if(xs.has(ut))return;const gt=setTimeout(()=>{xs.delete(ut),ie()},Ee);xs.set(ut,gt)}},Un=et=>{if(C||!Qt||!Ee)return;const ut=et.target,gt=xs.get(ut);gt&&(clearTimeout(gt),xs.delete(ut))};return{...$,...St,...wt,href:dt?.href,ref:o,onClick:bs([M,Je]),onFocus:bs([H,yn]),onMouseEnter:bs([R,ue]),onMouseLeave:bs([B,Un]),onTouchStart:bs([P,An]),disabled:!!C,target:T,...Et&&{style:Et},...vt&&{className:vt},...C&&VT,...pt&&qT,...k&&Rt&&FT}}const Lh={},UT={className:"active"},VT={role:"link","aria-disabled":!0},qT={"data-status":"active","aria-current":"page"},FT={"data-transitioning":"transitioning"},xs=new WeakMap,YT={rootMargin:"100px"},bs=t=>n=>{for(const i of t)if(i){if(n.defaultPrevented)return;i(n)}};function XT(t,n,i,o){if(!o)return n?{href:t,external:!0}:{href:i.createHref(t)||"/",external:!1}}function GT(t){if(typeof t!="string")return!1;const n=t.charCodeAt(0);return n===47?t.charCodeAt(1)!==47:n===46}const q1=F.forwardRef((t,n)=>{const{_asChild:i,...o}=t,{type:s,...l}=IT(o,n),c=typeof o.children=="function"?o.children({isActive:l["data-status"]==="active"}):o.children;if(!i){const{disabled:f,...d}=l;return F.createElement("a",d,c)}return F.createElement(i,l,c)});function QT(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}class $T extends P1{constructor(n){super(n),this.useMatch=i=>Wn({select:i?.select,from:this.id,structuralSharing:i?.structuralSharing}),this.useRouteContext=i=>Wn({...i,from:this.id,select:o=>i?.select?i.select(o.context):o.context}),this.useSearch=i=>im({select:i?.select,structuralSharing:i?.structuralSharing,from:this.id}),this.useParams=i=>nm({select:i?.select,structuralSharing:i?.structuralSharing,from:this.id}),this.useLoaderDeps=i=>em({...i,from:this.id}),this.useLoaderData=i=>tm({...i,from:this.id}),this.useNavigate=()=>rl({from:this.fullPath}),this.Link=sa.forwardRef((i,o)=>w.jsx(q1,{ref:o,from:this.fullPath,...i})),this.$$typeof=Symbol.for("react.memo")}}function rm(t){return new $T(t)}class ZT extends CT{constructor(n){super(n),this.useMatch=i=>Wn({select:i?.select,from:this.id,structuralSharing:i?.structuralSharing}),this.useRouteContext=i=>Wn({...i,from:this.id,select:o=>i?.select?i.select(o.context):o.context}),this.useSearch=i=>im({select:i?.select,structuralSharing:i?.structuralSharing,from:this.id}),this.useParams=i=>nm({select:i?.select,structuralSharing:i?.structuralSharing,from:this.id}),this.useLoaderDeps=i=>em({...i,from:this.id}),this.useLoaderData=i=>tm({...i,from:this.id}),this.useNavigate=()=>rl({from:this.fullPath}),this.Link=sa.forwardRef((i,o)=>w.jsx(q1,{ref:o,from:this.fullPath,...i})),this.$$typeof=Symbol.for("react.memo")}}function KT(t){return new ZT(t)}function cx(t){return typeof t=="object"?new fx(t,{silent:!0}).createRoute(t):new fx(t,{silent:!0}).createRoute}class fx{constructor(n,i){this.path=n,this.createRoute=o=>{this.silent;const s=rm(o);return s.isRoot=!1,s},this.silent=i?.silent}}class dx{constructor(n){this.useMatch=i=>Wn({select:i?.select,from:this.options.id,structuralSharing:i?.structuralSharing}),this.useRouteContext=i=>Wn({from:this.options.id,select:o=>i?.select?i.select(o.context):o.context}),this.useSearch=i=>im({select:i?.select,structuralSharing:i?.structuralSharing,from:this.options.id}),this.useParams=i=>nm({select:i?.select,structuralSharing:i?.structuralSharing,from:this.options.id}),this.useLoaderDeps=i=>em({...i,from:this.options.id}),this.useLoaderData=i=>tm({...i,from:this.options.id}),this.useNavigate=()=>{const i=gn();return rl({from:i.routesById[this.options.id].fullPath})},this.options=n,this.$$typeof=Symbol.for("react.memo")}}function hx(t){return typeof t=="object"?new dx(t):n=>new dx({id:t,...n})}function JT(){const t=gn(),n=F.useRef({router:t,mounted:!1}),[i,o]=F.useState(!1),{hasPendingMatches:s,isLoading:l}=pn({select:g=>({isLoading:g.isLoading,hasPendingMatches:g.matches.some(v=>v.status==="pending")}),structuralSharing:!0}),c=kh(l),f=l||i||s,d=kh(f),h=l||s,m=kh(h);return t.startTransition=g=>{o(!0),F.startTransition(()=>{g(),o(!1)})},F.useEffect(()=>{const g=t.history.subscribe(t.load),v=t.buildLocation({to:t.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return Ti(t.latestLocation.publicHref)!==Ti(v.publicHref)&&t.commitLocation({...v,replace:!0}),()=>{g()}},[t,t.history]),Pu(()=>{if(typeof window<"u"&&t.ssr||n.current.router===t&&n.current.mounted)return;n.current={router:t,mounted:!0},(async()=>{try{await t.load()}catch(v){console.error(v)}})()},[t]),Pu(()=>{c&&!l&&t.emit({type:"onLoad",...Yr(t.state)})},[c,t,l]),Pu(()=>{m&&!h&&t.emit({type:"onBeforeRouteMount",...Yr(t.state)})},[h,m,t]),Pu(()=>{if(d&&!f){const g=Yr(t.state);t.emit({type:"onResolved",...g}),t.__store.setState(v=>({...v,status:"idle",resolvedLocation:v.location})),g.hrefChanged&&nT(t)}},[f,d,t]),null}function WT(t){const n=pn({select:i=>`not-found-${i.location.pathname}-${i.status}`});return w.jsx(Jp,{getResetKey:()=>n,onCatch:(i,o)=>{if(hn(i))t.onCatch?.(i,o);else throw i},errorComponent:({error:i})=>{if(hn(i))return t.fallback?.(i);throw i},children:t.children})}function tM(){return w.jsx("p",{children:"Not Found"})}function $o(t){return w.jsx(w.Fragment,{children:t.children})}function F1(t,n,i){return n.options.notFoundComponent?w.jsx(n.options.notFoundComponent,{...i}):t.options.defaultNotFoundComponent?w.jsx(t.options.defaultNotFoundComponent,{...i}):w.jsx(tM,{})}function eM(){return gn().isScrollRestoring,null}const Y1=F.memo(function({matchId:n}){const i=gn(),o=pn({select:_=>{const T=_.matches.findIndex(z=>z.id===n),C=_.matches[T];return ki(C),{routeId:C.routeId,ssr:C.ssr,_displayPending:C._displayPending,resetKey:_.loadedAt,parentRouteId:_.matches[T-1]?.routeId}},structuralSharing:!0}),s=i.routesById[o.routeId],l=s.options.pendingComponent??i.options.defaultPendingComponent,c=l?w.jsx(l,{}):null,f=s.options.errorComponent??i.options.defaultErrorComponent,d=s.options.onCatch??i.options.defaultOnCatch,h=s.isRoot?s.options.notFoundComponent??i.options.notFoundRoute?.options.component:s.options.notFoundComponent,m=o.ssr===!1||o.ssr==="data-only",g=(!s.isRoot||s.options.wrapInSuspense||m)&&(s.options.wrapInSuspense??l??(s.options.errorComponent?.preload||m))?F.Suspense:$o,v=f?Jp:$o,x=h?WT:$o,b=s.isRoot?s.options.shellComponent??$o:$o;return w.jsxs(b,{children:[w.jsx(Hc.Provider,{value:n,children:w.jsx(g,{fallback:c,children:w.jsx(v,{getResetKey:()=>o.resetKey,errorComponent:f||Wp,onCatch:(_,T)=>{if(hn(_))throw _;d?.(_,T)},children:w.jsx(x,{fallback:_=>{if(!h||_.routeId&&_.routeId!==o.routeId||!_.routeId&&!s.isRoot)throw _;return F.createElement(h,_)},children:m||o._displayPending?w.jsx(kT,{fallback:c,children:w.jsx(px,{matchId:n})}):w.jsx(px,{matchId:n})})})})}),o.parentRouteId===Mn&&i.options.scrollRestoration?w.jsxs(w.Fragment,{children:[w.jsx(nM,{}),w.jsx(eM,{})]}):null]})});function nM(){const t=gn(),n=F.useRef(void 0);return w.jsx("script",{suppressHydrationWarning:!0,ref:i=>{i&&(n.current===void 0||n.current.href!==t.latestLocation.href)&&(t.emit({type:"onRendered",...Yr(t.state)}),n.current=t.latestLocation)}},t.latestLocation.state.__TSR_key)}const px=F.memo(function({matchId:n}){const i=gn(),{match:o,key:s,routeId:l}=pn({select:d=>{const h=d.matches.find(b=>b.id===n),m=h.routeId,v=(i.routesById[m].options.remountDeps??i.options.defaultRemountDeps)?.({routeId:m,loaderDeps:h.loaderDeps,params:h._strictParams,search:h._strictSearch});return{key:v?JSON.stringify(v):void 0,routeId:m,match:{id:h.id,status:h.status,error:h.error,invalid:h.invalid,_forcePending:h._forcePending,_displayPending:h._displayPending}}},structuralSharing:!0}),c=i.routesById[l],f=F.useMemo(()=>{const d=c.options.component??i.options.defaultComponent;return d?w.jsx(d,{},s):w.jsx(iM,{})},[s,c.options.component,i.options.defaultComponent]);if(o._displayPending)throw i.getMatch(o.id)?._nonReactive.displayPendingPromise;if(o._forcePending)throw i.getMatch(o.id)?._nonReactive.minPendingPromise;if(o.status==="pending"){const d=c.options.pendingMinMs??i.options.defaultPendingMinMs;if(d){const h=i.getMatch(o.id);if(h&&!h._nonReactive.minPendingPromise){const m=la();h._nonReactive.minPendingPromise=m,setTimeout(()=>{m.resolve(),h._nonReactive.minPendingPromise=void 0},d)}}throw i.getMatch(o.id)?._nonReactive.loadPromise}if(o.status==="notFound")return ki(hn(o.error)),F1(i,c,o.error);if(o.status==="redirected")throw ki(kn(o.error)),i.getMatch(o.id)?._nonReactive.loadPromise;if(o.status==="error")throw o.error;return f}),iM=F.memo(function(){const n=gn(),i=F.useContext(Hc),o=pn({select:h=>h.matches.find(m=>m.id===i)?.routeId}),s=n.routesById[o],l=pn({select:h=>{const g=h.matches.find(v=>v.id===i);return ki(g),g.globalNotFound}}),c=pn({select:h=>{const m=h.matches,g=m.findIndex(v=>v.id===i);return m[g+1]?.id}}),f=n.options.defaultPendingComponent?w.jsx(n.options.defaultPendingComponent,{}):null;if(l)return F1(n,s,void 0);if(!c)return null;const d=w.jsx(Y1,{matchId:c});return o===Mn?w.jsx(F.Suspense,{fallback:f,children:d}):d});function rM(){const t=gn(),i=t.routesById[Mn].options.pendingComponent??t.options.defaultPendingComponent,o=i?w.jsx(i,{}):null,s=typeof document<"u"&&t.ssr?$o:F.Suspense,l=w.jsxs(s,{fallback:o,children:[w.jsx(JT,{}),w.jsx(oM,{})]});return t.options.InnerWrap?w.jsx(t.options.InnerWrap,{children:l}):l}function oM(){const t=gn(),n=pn({select:s=>s.matches[0]?.id}),i=pn({select:s=>s.loadedAt}),o=n?w.jsx(Y1,{matchId:n}):null;return w.jsx(Hc.Provider,{value:n,children:t.options.disableGlobalCatchBoundary?o:w.jsx(Jp,{getResetKey:()=>i,errorComponent:Wp,onCatch:s=>{s.message||s.toString()},children:o})})}function aM(){const t=gn();return pn({select:n=>[n.location.href,n.resolvedLocation?.href,n.status],structuralSharing:!0}),F.useCallback(n=>{const{pending:i,caseSensitive:o,fuzzy:s,includeSearch:l,...c}=n;return t.matchRoute(c,{pending:i,caseSensitive:o,fuzzy:s,includeSearch:l})},[t])}const sM=t=>new lM(t);class lM extends yT{constructor(n){super(n)}}typeof globalThis<"u"?(globalThis.createFileRoute=cx,globalThis.createLazyFileRoute=hx):typeof window<"u"&&(window.createFileRoute=cx,window.createLazyFileRoute=hx);function uM({router:t,children:n,...i}){Object.keys(i).length>0&&t.update({...t.options,...i,context:{...t.options.context,...i.context}});const o=V1(),s=w.jsx(o.Provider,{value:t,children:n});return t.options.Wrap?w.jsx(t.options.Wrap,{children:s}):s}function cM({router:t,...n}){return w.jsx(uM,{router:t,...n,children:w.jsx(rM,{})})}const vp=new Set,De=new WeakMap,Jr=new WeakMap,fn=new WeakMap,qs=new WeakMap,jh=new WeakMap,Ns=new WeakMap,Xr=new WeakMap,hr=new WeakMap,Zo=new WeakSet;let Qe,om=0,am=0;const Mi="__aa_tgt",Fs="__aa_del",xc="__aa_new",X1=t=>{const n=pM(t);n&&n.forEach(i=>mM(i))},fM=t=>{t.forEach(n=>{n.target===Qe&&dM(),De.has(n.target)&&io(n.target)})};function G1(t){const n=t.getBoundingClientRect(),i=Qe?.clientWidth||0,o=Qe?.clientHeight||0;return n.bottom<0||n.top>o||n.right<0||n.left>i}function sm(t){const n=qs.get(t);n?.disconnect();let i=De.get(t),o=0;const s=5;i||(i=ca(t),De.set(t,i));const{offsetWidth:l,offsetHeight:c}=Qe,d=[i.top-s,l-(i.left+s+i.width),c-(i.top+s+i.height),i.left-s].map(m=>`${-1*Math.floor(m)}px`).join(" "),h=new IntersectionObserver(()=>{++o>1&&io(t)},{root:Qe,threshold:1,rootMargin:d});h.observe(t),qs.set(t,h)}function io(t,n=!0){clearTimeout(hr.get(t));const i=Pc(t),o=n?Ys(i)?500:i.duration:0;hr.set(t,setTimeout(async()=>{const s=fn.get(t);try{await s?.finished,De.set(t,ca(t)),sm(t)}catch{}},o))}function dM(){clearTimeout(hr.get(Qe)),hr.set(Qe,setTimeout(()=>{vp.forEach(t=>rc(t,n=>Q1(()=>io(n))))},100))}function hM(t){setTimeout(()=>{Ns.set(t,setInterval(()=>Q1(io.bind(null,t)),2e3))},Math.round(2e3*Math.random()))}function Q1(t){typeof requestIdleCallback=="function"?requestIdleCallback(()=>t()):requestAnimationFrame(()=>t())}let Ci;const $1=typeof window<"u"&&"ResizeObserver"in window;$1&&(Qe=document.documentElement,new MutationObserver(X1),Ci=new ResizeObserver(fM),window.addEventListener("scroll",()=>{am=window.scrollY,om=window.scrollX}),Ci.observe(Qe));function pM(t){return t.reduce((o,s)=>[...o,...Array.from(s.addedNodes),...Array.from(s.removedNodes)],[]).every(o=>o.nodeName==="#comment")?!1:t.reduce((o,s)=>{if(o===!1)return!1;if(s.target instanceof Element){if(Bh(s.target),!o.has(s.target)){o.add(s.target);for(let l=0;l<s.target.children.length;l++){const c=s.target.children.item(l);if(c){if(Fs in c)return!1;Bh(s.target,c),o.add(c)}}}if(s.removedNodes.length)for(let l=0;l<s.removedNodes.length;l++){const c=s.removedNodes[l];if(Fs in c)return!1;c instanceof Element&&(o.add(c),Bh(s.target,c),Jr.set(c,[s.previousSibling,s.nextSibling]))}}return o},new Set)}function Bh(t,n){!n&&!(Mi in t)?Object.defineProperty(t,Mi,{value:t}):n&&!(Mi in n)&&Object.defineProperty(n,Mi,{value:t})}function mM(t){var n,i;const o=t.isConnected,s=De.has(t);o&&Jr.has(t)&&Jr.delete(t),((n=fn.get(t))===null||n===void 0?void 0:n.playState)!=="finished"&&((i=fn.get(t))===null||i===void 0||i.cancel()),xc in t?mx(t):s&&o?yM(t):s&&!o?vM(t):mx(t)}function Qn(t){return Number(t.replace(/[^0-9.\-]/g,""))}function gM(t){let n=t.parentElement;for(;n;){if(n.scrollLeft||n.scrollTop)return{x:n.scrollLeft,y:n.scrollTop};n=n.parentElement}return{x:0,y:0}}function ca(t){const n=t.getBoundingClientRect(),{x:i,y:o}=gM(t);return{top:n.top+o,left:n.left+i,width:n.width,height:n.height}}function Z1(t,n,i){let o=n.width,s=n.height,l=i.width,c=i.height;const f=getComputedStyle(t);if(f.getPropertyValue("box-sizing")==="content-box"){const h=Qn(f.paddingTop)+Qn(f.paddingBottom)+Qn(f.borderTopWidth)+Qn(f.borderBottomWidth),m=Qn(f.paddingLeft)+Qn(f.paddingRight)+Qn(f.borderRightWidth)+Qn(f.borderLeftWidth);o-=m,l-=m,s-=h,c-=h}return[o,l,s,c].map(Math.round)}function Pc(t){return Mi in t&&Xr.has(t[Mi])?Xr.get(t[Mi]):{duration:250,easing:"ease-in-out"}}function K1(t){if(Mi in t)return t[Mi]}function lm(t){const n=K1(t);return n?Zo.has(n):!1}function rc(t,...n){n.forEach(i=>i(t,Xr.has(t)));for(let i=0;i<t.children.length;i++){const o=t.children.item(i);o&&n.forEach(s=>s(o,Xr.has(o)))}}function um(t){return Array.isArray(t)?t:[t]}function Ys(t){return typeof t=="function"}function yM(t){const n=De.get(t),i=ca(t);if(!lm(t))return De.set(t,i);if(G1(t)){De.set(t,i),sm(t);return}let o;if(!n)return;const s=Pc(t);if(typeof s!="function"){let l=n.left-i.left,c=n.top-i.top;const f=n.left+n.width-(i.left+i.width);n.top+n.height-(i.top+i.height)==0&&(c=0),f==0&&(l=0);const[h,m,g,v]=Z1(t,n,i),x={transform:`translate(${l}px, ${c}px)`},b={transform:"translate(0, 0)"};h!==m&&(x.width=`${h}px`,b.width=`${m}px`),g!==v&&(x.height=`${g}px`,b.height=`${v}px`),o=t.animate([x,b],{duration:s.duration,easing:s.easing})}else{const[l]=um(s(t,"remain",n,i));o=new Animation(l),o.play()}fn.set(t,o),De.set(t,i),o.addEventListener("finish",io.bind(null,t,!1),{once:!0})}function mx(t){xc in t&&delete t[xc];const n=ca(t);De.set(t,n);const i=Pc(t);if(!lm(t))return;if(G1(t)){sm(t);return}let o;if(typeof i!="function")o=t.animate([{transform:"scale(.98)",opacity:0},{transform:"scale(0.98)",opacity:0,offset:.5},{transform:"scale(1)",opacity:1}],{duration:i.duration*1.5,easing:"ease-in"});else{const[s]=um(i(t,"add",n));o=new Animation(s),o.play()}fn.set(t,o),o.addEventListener("finish",io.bind(null,t,!1),{once:!0})}function gx(t,n){var i;t.remove(),De.delete(t),Jr.delete(t),fn.delete(t),(i=qs.get(t))===null||i===void 0||i.disconnect(),setTimeout(()=>{if(Fs in t&&delete t[Fs],Object.defineProperty(t,xc,{value:!0,configurable:!0}),n&&t instanceof HTMLElement)for(const o in n)t.style[o]=""},0)}function vM(t){var n;if(!Jr.has(t)||!De.has(t))return;const[i,o]=Jr.get(t);Object.defineProperty(t,Fs,{value:!0,configurable:!0});const s=window.scrollX,l=window.scrollY;if(o&&o.parentNode&&o.parentNode instanceof Element?o.parentNode.insertBefore(t,o):i&&i.parentNode?i.parentNode.appendChild(t):(n=K1(t))===null||n===void 0||n.appendChild(t),!lm(t))return gx(t);const[c,f,d,h]=bM(t),m=Pc(t),g=De.get(t);(s!==om||l!==am)&&xM(t,s,l,m);let v,x={position:"absolute",top:`${c}px`,left:`${f}px`,width:`${d}px`,height:`${h}px`,margin:"0",pointerEvents:"none",transformOrigin:"center",zIndex:"100"};if(!Ys(m))Object.assign(t.style,x),v=t.animate([{transform:"scale(1)",opacity:1},{transform:"scale(.98)",opacity:0}],{duration:m.duration,easing:"ease-out"});else{const[b,_]=um(m(t,"remove",g));_?.styleReset!==!1&&(x=_?.styleReset||x,Object.assign(t.style,x)),v=new Animation(b),v.play()}fn.set(t,v),v.addEventListener("finish",()=>gx(t,x),{once:!0})}function xM(t,n,i,o){const s=om-n,l=am-i,c=document.documentElement.style.scrollBehavior;if(getComputedStyle(Qe).scrollBehavior==="smooth"&&(document.documentElement.style.scrollBehavior="auto"),window.scrollTo(window.scrollX+s,window.scrollY+l),!t.parentElement)return;const d=t.parentElement;let h=d.clientHeight,m=d.clientWidth;const g=performance.now();function v(){requestAnimationFrame(()=>{if(!Ys(o)){const x=h-d.clientHeight,b=m-d.clientWidth;g+o.duration>performance.now()?(window.scrollTo({left:window.scrollX-b,top:window.scrollY-x}),h=d.clientHeight,m=d.clientWidth,v()):document.documentElement.style.scrollBehavior=c}})}v()}function bM(t){var n;const i=De.get(t),[o,,s]=Z1(t,i,ca(t));let l=t.parentElement;for(;l&&(getComputedStyle(l).position==="static"||l instanceof HTMLBodyElement);)l=l.parentElement;l||(l=document.body);const c=getComputedStyle(l),f=!fn.has(t)||((n=fn.get(t))===null||n===void 0?void 0:n.playState)==="finished"?ca(l):De.get(l),d=Math.round(i.top-f.top)-Qn(c.borderTopWidth),h=Math.round(i.left-f.left)-Qn(c.borderLeftWidth);return[d,h,o,s]}function SM(t,n={}){if($1&&Ci&&!(window.matchMedia("(prefers-reduced-motion: reduce)").matches&&!Ys(n)&&!n.disrespectUserMotionPreference)){Zo.add(t),getComputedStyle(t).position==="static"&&Object.assign(t.style,{position:"relative"}),rc(t,io,hM,c=>Ci?.observe(c)),Ys(n)?Xr.set(t,n):Xr.set(t,{duration:250,easing:"ease-in-out",...n});const l=new MutationObserver(X1);l.observe(t,{childList:!0}),jh.set(t,l),vp.add(t)}return Object.freeze({parent:t,enable:()=>{Zo.add(t)},disable:()=>{Zo.delete(t),rc(t,o=>{const s=fn.get(o);try{s?.cancel()}catch{}fn.delete(o);const l=hr.get(o);l&&clearTimeout(l),hr.delete(o);const c=Ns.get(o);c&&clearInterval(c),Ns.delete(o)})},isEnabled:()=>Zo.has(t),destroy:()=>{Zo.delete(t),vp.delete(t),Xr.delete(t);const o=jh.get(t);o?.disconnect(),jh.delete(t),rc(t,s=>{Ci?.unobserve(s);const l=fn.get(s);try{l?.cancel()}catch{}fn.delete(s);const c=qs.get(s);c?.disconnect(),qs.delete(s);const f=Ns.get(s);f&&clearInterval(f),Ns.delete(s);const d=hr.get(s);d&&clearTimeout(d),hr.delete(s),De.delete(s),Jr.delete(s)})}})}function J1(t){const[n,i]=F.useState(),o=F.useMemo(()=>t,[]),s=F.useCallback(c=>{c instanceof HTMLElement?i(SM(c,o)):i(void 0)},[o]),l=F.useCallback(c=>{n&&(c?n.enable():n.disable())},[n]);return F.useEffect(()=>()=>{var c;(c=n?.destroy)===null||c===void 0||c.call(n)},[n]),[s,l]}async function Ic(t){const n=await fetch(t);if(!n.ok)throw new Error(`HTTP ${n.status}: ${n.statusText}`);const i=await n.json();if(!i.success||!i.data)throw new Error(i.error??"Unknown error");return i.data}function W1(){return Lc({queryKey:["sessions"],queryFn:()=>Ic("/api/v2/sessions"),refetchInterval:3e4,staleTime:25e3})}function wM(t){return Lc({queryKey:["session",t],queryFn:()=>Ic(`/api/v2/sessions/${t}`),enabled:!!t,refetchInterval:5e3,refetchIntervalInBackground:!1,staleTime:3e3})}function EM(t,n){return Lc({queryKey:["node",t,n],queryFn:()=>Ic(`/api/v2/sessions/${t}/nodes/${n}`),enabled:!!n})}function _M(){return Lc({queryKey:["worktrees"],queryFn:()=>Ic("/api/v2/worktrees"),refetchInterval:3e4,staleTime:2e4})}function CM(){const t=w1();F.useEffect(()=>{let n=null,i=null;function o(){n=new EventSource("/api/v2/workspace/events"),n.onmessage=s=>{try{JSON.parse(s.data).type==="change"&&(t.invalidateQueries({queryKey:["sessions"]}),t.invalidateQueries({queryKey:["worktrees"]}))}catch{}},n.onerror=()=>{n?.close(),n=null,i=setTimeout(o,5e3)}}return o(),()=>{i!==null&&clearTimeout(i),n?.close()}},[t])}const TM={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 tS({status:t}){const n=TM[t];return w.jsx("span",{className:"inline-flex items-center px-2 py-0.5 rounded text-xs font-medium",style:{backgroundColor:`color-mix(in srgb, ${n.color} 12%, transparent)`,color:n.color},children:n.label})}function eS({health:t}){return t==="healthy"?null:w.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 Uc(t){const n=Date.now()-t;if(n<0)return"just now";const i=Math.floor(n/1e3);if(i<60)return"just now";const o=Math.floor(i/60);if(o<60)return`${o}m ago`;const s=Math.floor(o/60);if(s<24)return`${s}h ago`;const l=Math.floor(s/24);if(l<7)return`${l}d ago`;const c=Math.floor(l/7);return c<5?`${c}w ago`:`${Math.floor(l/30)}mo ago`}const MM=[{value:"recent",label:"Recent"},{value:"status",label:"Status"},{value:"workflow",label:"Workflow"},{value:"nodes",label:"Node count"}],NM=[{value:"none",label:"No grouping"},{value:"workflow",label:"Workflow"},{value:"status",label:"Status"},{value:"branch",label:"Branch"}],kM=[{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"}],Hh=25,yx={in_progress:0,blocked:1,dormant:2,complete_with_gaps:3,complete:4};function AM(t,n,i,o){let s=[...t];if(i!=="all"&&(s=s.filter(l=>l.status===i)),o!==null&&(s=s.filter(l=>l.repoRoot===o||l.repoRoot===null)),n.trim()){const l=n.toLowerCase();s=s.filter(c=>(c.sessionTitle??"").toLowerCase().includes(l)||(c.workflowName??"").toLowerCase().includes(l)||(c.workflowId??"").toLowerCase().includes(l)||c.sessionId.toLowerCase().includes(l)||(c.gitBranch??"").toLowerCase().includes(l))}return s}function RM(t,n){const i=[...t];switch(n){case"recent":i.sort((o,s)=>s.lastModifiedMs-o.lastModifiedMs);break;case"status":i.sort((o,s)=>yx[o.status]-yx[s.status]||s.lastModifiedMs-o.lastModifiedMs);break;case"workflow":i.sort((o,s)=>(o.workflowName??o.workflowId??"").localeCompare(s.workflowName??s.workflowId??"")||s.lastModifiedMs-o.lastModifiedMs);break;case"nodes":i.sort((o,s)=>s.nodeCount-o.nodeCount||s.lastModifiedMs-o.lastModifiedMs);break}return i}function OM(t,n){if(n==="none")return[{label:"",sessions:t}];const i=new Map;for(const o of t){let s;switch(n){case"workflow":s=o.workflowName??o.workflowId??"Unknown workflow";break;case"status":s=o.status;break;case"branch":s=o.gitBranch??"No branch";break}const l=i.get(s)??[];l.push(o),i.set(s,l)}return Array.from(i.entries()).sort(([o],[s])=>o.localeCompare(s)).map(([o,s])=>({label:o,sessions:s}))}function zM({onSelectSession:t,initialSearch:n="",initialRepoRoot:i=null}){const{data:o,isLoading:s,error:l}=W1(),[c,f]=F.useState(n),[d]=F.useState(i),[h,m]=F.useState("recent"),[g,v]=F.useState("none"),[x,b]=F.useState("all"),[_,T]=F.useState(0),C=F.useCallback(j=>{f(j),T(0)},[]),z=F.useCallback(j=>{m(j),T(0)},[]),E=F.useCallback(j=>{v(j),T(0)},[]),M=F.useCallback(j=>{b(j),T(0)},[]),H=F.useMemo(()=>{if(!o)return{groups:[],total:0,filtered:0};const j=AM(o.sessions,c,x,d),V=RM(j,h);return{groups:OM(V,g),total:o.sessions.length,filtered:j.length}},[o,c,x,d,h,g]),R=F.useMemo(()=>{if(!o)return{};const j={all:o.sessions.length};for(const V of o.sessions)j[V.status]=(j[V.status]??0)+1;return j},[o]);if(s)return w.jsx("div",{className:"flex items-center justify-center py-20",children:w.jsx("div",{className:"text-[var(--text-secondary)] text-sm",children:"Loading sessions..."})});if(l)return w.jsxs("div",{className:"text-[var(--error)] bg-[var(--bg-card)] rounded-lg p-4",children:["Failed to load sessions: ",l.message]});if(!o||o.sessions.length===0)return w.jsxs("div",{className:"text-center py-16",children:[w.jsx("p",{className:"text-[var(--text-secondary)] text-lg",children:"No v2 sessions found"}),w.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 B=g!=="none",P=_*Hh,q=P+Hh,J=Math.ceil(H.filtered/Hh);return w.jsxs("div",{className:"space-y-4",children:[w.jsx("div",{className:"flex items-center justify-between",children:w.jsxs("h2",{className:"text-lg font-medium text-[var(--text-primary)]",children:["Sessions",w.jsx("span",{className:"text-[var(--text-muted)] font-normal ml-2 text-sm",children:H.filtered===H.total?H.total:`${H.filtered} / ${H.total}`})]})}),w.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[w.jsxs("div",{className:"relative flex-1 min-w-[200px] max-w-[360px]",children:[w.jsx("input",{type:"text",value:c,onChange:j=>C(j.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"}),c&&w.jsx("button",{onClick:()=>C(""),className:"absolute right-2 top-1/2 -translate-y-1/2 text-[var(--text-muted)] hover:text-[var(--text-primary)] text-xs",children:"clear"})]}),w.jsx(vx,{label:"Sort",value:h,options:MM,onChange:z}),w.jsx(vx,{label:"Group",value:g,options:NM,onChange:E})]}),w.jsx("div",{className:"flex flex-wrap gap-1.5",children:kM.map(j=>{const V=R[j.value]??0;if(j.value!=="all"&&V===0)return null;const K=x===j.value;return w.jsxs("button",{onClick:()=>M(j.value),className:`px-2.5 py-1 rounded-full text-xs font-medium transition-colors cursor-pointer ${K?"bg-[var(--accent)] text-white":"bg-[var(--bg-secondary)] text-[var(--text-secondary)] hover:bg-[var(--bg-card)] hover:text-[var(--text-primary)]"}`,children:[j.label,w.jsx("span",{className:"ml-1 opacity-70",children:V})]},j.value)})}),H.filtered===0?w.jsx("div",{className:"text-center py-12 text-[var(--text-muted)] text-sm",children:"No sessions match the current filters"}):B?w.jsx("div",{className:"space-y-6",children:H.groups.map(j=>w.jsx(DM,{label:j.label,sessions:j.sessions,onSelectSession:t},j.label))}):w.jsxs(w.Fragment,{children:[w.jsx("div",{className:"space-y-2",children:H.groups[0]?.sessions.slice(P,q).map(j=>w.jsx(nS,{session:j,onClick:()=>t(j.sessionId)},j.sessionId))}),J>1&&w.jsx(LM,{page:_,totalPages:J,onPageChange:T})]})]})}function vx({label:t,value:n,options:i,onChange:o}){return w.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-[var(--text-muted)]",children:[t,w.jsx("select",{value:n,onChange:s=>o(s.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:i.map(s=>w.jsx("option",{value:s.value,children:s.label},s.value))})]})}function DM({label:t,sessions:n,onSelectSession:i}){const[o,s]=F.useState(!1);return w.jsxs("div",{children:[w.jsxs("button",{onClick:()=>s(!o),className:"flex items-center gap-2 mb-2 cursor-pointer group",children:[w.jsx("span",{className:"text-[var(--text-muted)] text-xs transition-transform duration-150",style:{transform:o?"rotate(-90deg)":"rotate(0deg)"},children:"▼"}),w.jsx("span",{className:"text-sm font-medium text-[var(--text-secondary)] group-hover:text-[var(--text-primary)] transition-colors",children:t}),w.jsxs("span",{className:"text-xs text-[var(--text-muted)]",children:["(",n.length,")"]})]}),!o&&w.jsx("div",{className:"space-y-2 ml-4",children:n.map(l=>w.jsx(nS,{session:l,onClick:()=>i(l.sessionId)},l.sessionId))})]})}function LM({page:t,totalPages:n,onPageChange:i}){return w.jsxs("div",{className:"flex items-center justify-center gap-2 pt-2",children:[w.jsx("button",{onClick:()=>i(t-1),disabled:t===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"}),w.jsxs("span",{className:"text-xs text-[var(--text-muted)]",children:[t+1," / ",n]}),w.jsx("button",{onClick:()=>i(t+1),disabled:t>=n-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 nS({session:t,onClick:n}){const i=t.sessionTitle,o=t.workflowName??t.workflowId,s=Uc(t.lastModifiedMs);return w.jsxs("button",{onClick:n,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:[w.jsxs("div",{className:"flex items-start justify-between gap-3",children:[w.jsx("div",{className:"min-w-0 flex-1",children:w.jsx("div",{className:"text-sm font-medium text-[var(--text-primary)] line-clamp-1 group-hover:text-[var(--accent)] transition-colors",children:i??o??"Unnamed session"})}),w.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[w.jsx("span",{className:"text-[10px] text-[var(--text-muted)] tabular-nums",children:s}),w.jsx(eS,{health:t.health}),w.jsx(tS,{status:t.status})]})]}),w.jsxs("div",{className:"flex items-center gap-2 mt-1.5 flex-wrap",children:[i&&o&&w.jsx(Iu,{children:o}),t.gitBranch&&w.jsx(Iu,{icon:"branch",children:t.gitBranch}),w.jsxs(Iu,{icon:"graph",children:[t.nodeCount,"N / ",t.edgeCount,"E"]}),t.tipCount>1&&w.jsxs(Iu,{icon:"fork",children:[t.tipCount," tips"]}),t.hasUnresolvedGaps&&w.jsx("span",{className:"inline-flex items-center gap-1 text-[10px] text-[var(--warning)]",children:"⚠ gaps"})]}),w.jsx("div",{className:"mt-1.5 font-mono text-[10px] text-[var(--text-muted)] opacity-60 group-hover:opacity-100 transition-opacity truncate",children:t.sessionId})]})}const jM={branch:w.jsx("svg",{width:"10",height:"10",viewBox:"0 0 16 16",fill:"currentColor",className:"shrink-0",children:w.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:w.jsx("svg",{width:"10",height:"10",viewBox:"0 0 16 16",fill:"currentColor",className:"shrink-0",children:w.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:w.jsx("svg",{width:"10",height:"10",viewBox:"0 0 16 16",fill:"currentColor",className:"shrink-0",children:w.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 Iu({children:t,icon:n}){return w.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:[n&&jM[n],t]})}const BM=720*60*60*1e3,xx={in_progress:0,dormant:0,blocked:1,complete_with_gaps:2,complete:3};function HM(t){if(t.length!==0)return[...t].sort((n,i)=>{const o=xx[n.status]-xx[i.status];return o!==0?o:i.lastModifiedMs-n.lastModifiedMs})[0]}function PM(t,n,i){const o=t.primarySession?.status;if(o==="in_progress"||o==="dormant"||o==="blocked")return"visible";const s=(t.worktree?.changedCount??0)>0,l=(t.worktree?.aheadCount??0)>0;return s||l||i-t.activityMs<BM||n==="all"?"visible":"hidden"}function bx(t){switch(t.primarySession?.status){case"in_progress":return 0;case"blocked":return 1;case"dormant":return 2;default:return(t.worktree?.changedCount??0)>0||(t.worktree?.aheadCount??0)>0?3:4}}function IM(t,n,i){return[...t].filter(o=>PM(o,n,i)==="visible").sort((o,s)=>{const l=bx(o)-bx(s);return l!==0?l:s.activityMs-o.activityMs})}function UM(t,n){const i=new Map;for(const d of n)for(const h of d.worktrees)h.branch!==null&&i.set(`${h.branch}\0${d.repoRoot}`,{wt:h,repoName:d.repoName});const o=new Map;for(const d of n)for(const h of d.worktrees)o.set(h.path,d.repoRoot);const s=new Map;for(const d of t){if(d.repoRoot===null||d.gitBranch===null)continue;const h=o.get(d.repoRoot)??d.repoRoot,m=`${d.gitBranch}\0${h}`,g=s.get(m);g?g.push(d):s.set(m,[d])}const l=new Map;for(const d of n)l.set(d.repoRoot,d.repoName);const c=[],f=new Set;for(const[d,h]of s){const[m,g]=d.split("\0"),v=i.get(d),x=HM(h),b=Math.max(x?.lastModifiedMs??0,v?.wt.headTimestampMs??0),_=v?.repoName??l.get(g)??g.split("/").at(-1)??g;c.push({branch:m,repoRoot:g,repoName:_,worktree:v?.wt,primarySession:x,allSessions:h,activityMs:b}),f.add(d)}for(const[d,{wt:h,repoName:m}]of i){if(f.has(d))continue;const[g,v]=d.split("\0");c.push({branch:g,repoRoot:v,repoName:m,worktree:h,primarySession:void 0,allSessions:[],activityMs:h.headTimestampMs})}return c}function VM(t){return t.reduce((n,i)=>{const o=i.primarySession?.status;return o==="blocked"||o==="dormant"?n+1:n},0)}const qM={blocked:"var(--blocked)",dormant:"var(--text-muted)",complete_with_gaps:"var(--warning)",in_progress:"var(--accent)",complete:"var(--success)"},Sx={in_progress:"In progress",dormant:"Dormant",blocked:"Blocked",complete_with_gaps:"Complete with gaps",complete:"Complete"},iS=[{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"}],Ph=["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 FM(t){return t[Math.floor(Math.random()*t.length)]}function YM(t){return t.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 XM(t,n=220){const i=YM(t);if(i.length<=n)return i;const o=i.lastIndexOf(" ",n);return i.slice(0,o>0?o:n)+"…"}function GM({hidden:t=!1}){const n=rl(),{data:i,isLoading:o,error:s,refetch:l}=W1(),{data:c,isFetching:f}=_M();CM();const[d,h]=F.useState("active"),[m,g]=F.useState(-1),[v,x]=F.useState(!1),[b,_]=F.useState(null),T=F.useRef(0),C=F.useRef(!0),z=F.useRef(new Map),E=F.useCallback(J=>{T.current=window.scrollY,n({to:"/session/$sessionId",params:{sessionId:J}})},[n]);F.useEffect(()=>{if(C.current){C.current=!1;return}if(!t){const J=requestAnimationFrame(()=>{window.scrollTo({top:T.current})});return()=>cancelAnimationFrame(J)}},[t]);const{repoGroups:M,orderedItems:H,needsAttentionCount:R,archiveRepos:B}=F.useMemo(()=>{const J=Date.now(),j={repoGroups:[],orderedItems:[],needsAttentionCount:0,archiveRepos:[]};if(!i)return j;const V=c?.repos??[],K=UM(i.sessions,V),D=new Map;for(const $ of K)D.has($.repoRoot)||D.set($.repoRoot,$.repoName);const I=v?K.filter($=>{const k=$.primarySession?.status;return k==="blocked"||k==="dormant"}):K,O=new Map;for(const $ of I){const k=O.get($.repoRoot);k?k.push($):O.set($.repoRoot,[$])}const U=[...O.entries()].map(([$,k])=>({repoRoot:$,repoName:k[0].repoName,sortedItems:IM(k,d,J)})).filter($=>$.sortedItems.length>0).sort(($,k)=>{const L=$.sortedItems.some(A=>A.primarySession?.status==="in_progress"||A.primarySession?.status==="blocked")?0:1,X=k.sortedItems.some(A=>A.primarySession?.status==="in_progress"||A.primarySession?.status==="blocked")?0:1;return L!==X?L-X:$.repoName.localeCompare(k.repoName)}),G=U.flatMap($=>$.sortedItems);return{repoGroups:U,orderedItems:G,needsAttentionCount:VM(K),archiveRepos:[...D.entries()]}},[i,c,d,v]);F.useEffect(()=>{g(-1)},[H.length]);const P=F.useCallback(()=>{x(J=>{const j=!J;return h(j?"all":"active"),j})},[]);aN({items:H,focusedIndex:m,setFocusedIndex:g,onSelectSession:E,scope:d,setScope:h,refetch:l,archive:b,setArchive:_,disabled:t});const q=(i?.totalCount??0)>0;return o?w.jsx("div",{className:`flex items-center justify-center py-32 ${t?"hidden":""}`,children:w.jsx("div",{className:"text-[var(--text-muted)] text-sm",children:"Loading workspace..."})}):s?w.jsxs("div",{className:`text-[var(--error)] bg-[var(--bg-card)] border border-[var(--border)] rounded-lg p-4 text-sm ${t?"hidden":""}`,children:["Failed to load workspace: ",s.message]}):b!==null?w.jsxs("div",{className:`space-y-4 ${t?"hidden":""}`,children:[w.jsxs("div",{className:"flex items-center gap-3",children:[w.jsx("button",{onClick:()=>_(null),className:"text-[var(--text-secondary)] hover:text-[var(--text-primary)] transition-colors text-sm",children:"← Back to Workspace"}),b.repoName&&w.jsx("span",{className:"text-sm text-[var(--text-muted)] font-mono",children:b.repoName})]}),w.jsx(zM,{onSelectSession:E,initialRepoRoot:b.repoRoot??null})]}):w.jsxs("div",{className:`space-y-5 ${t?"hidden":""}`,children:[q?w.jsxs(w.Fragment,{children:[R>0&&w.jsx(iN,{count:R,active:v,onFocusAttention:P}),w.jsx(nN,{scope:d,onChange:h}),M.length===0?w.jsx("div",{className:"text-sm text-[var(--text-muted)] py-8 text-center",children:"No branches match the current filter."}):w.jsx("div",{className:"space-y-6",children:M.map((J,j)=>{const V=M.slice(0,j).reduce((K,D)=>K+D.sortedItems.length,0);return w.jsx(QM,{group:J,showHeader:M.length>1,focusedIndex:m,groupOffset:V,worktreesFetching:f,onSelectSession:E,expandStateRef:z},J.repoRoot)})}),w.jsx(rN,{repos:B,onOpen:(J,j)=>_({repoName:J,repoRoot:j})})]}):w.jsxs(w.Fragment,{children:[w.jsx(oN,{prompt:FM(iS)}),w.jsx(Ex,{})]}),w.jsx(Ex,{})]})}const wx=12;function QM({group:t,showHeader:n,focusedIndex:i,groupOffset:o,worktreesFetching:s,onSelectSession:l,expandStateRef:c}){const[f,d]=F.useState(!1),h=f?t.sortedItems:t.sortedItems.slice(0,wx),m=t.sortedItems.length-wx,g=t.sortedItems.filter(x=>x.primarySession?.status==="in_progress"||x.primarySession?.status==="blocked").length,v=t.sortedItems.filter(x=>(x.worktree?.changedCount??0)>0).length;return w.jsxs("section",{children:[n&&w.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:[w.jsx("h3",{className:"text-sm font-semibold text-[var(--text-primary)] font-mono",children:t.repoName}),g>0&&w.jsxs("span",{className:"text-xs font-medium text-[var(--accent)]",children:["● ",g," active"]}),v>0&&w.jsxs("span",{className:"text-xs font-medium text-orange-400",children:["· ",v," uncommitted"]})]}),w.jsxs("div",{className:"space-y-px",children:[h.map((x,b)=>{const _=o+b,T=i===_;if(x.allSessions.length===0)return w.jsx(JM,{item:x,isFocused:T,worktreesFetching:s,expandStateRef:c},`${x.branch}\0${x.repoRoot}`);if(x.allSessions.length>1)return w.jsx(ZM,{item:x,isFocused:T,worktreesFetching:s,onSelectSession:l,expandStateRef:c},`${x.branch}\0${x.repoRoot}`);const C=x.allSessions[0];return w.jsx("div",{className:T?"ring-2 ring-[var(--accent)] ring-offset-1 rounded":"",children:w.jsx(xp,{session:C,item:x,showBranch:!0,onSelect:()=>l(C.sessionId)})},`${x.branch}\0${x.repoRoot}`)}),!f&&m>0&&w.jsxs("button",{type:"button",onClick:()=>d(!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 $M=(t,n)=>{const i=s=>s.status==="in_progress"||s.status==="dormant"?0:s.status==="blocked"?1:2,o=i(t)-i(n);return o!==0?o:n.lastModifiedMs-t.lastModifiedMs};function ZM({item:t,isFocused:n,worktreesFetching:i,onSelectSession:o,expandStateRef:s}){const l=`${t.branch}\0${t.repoRoot}`,c=()=>s.current?.get(l)??{filesExpanded:!1,unpushedExpanded:!1},[f,d]=F.useState(!1),[h,m]=F.useState(()=>c().filesExpanded),[g,v]=F.useState(()=>c().unpushedExpanded),[x]=J1(),b=[...t.allSessions].sort($M),_=F.useCallback(()=>{m(E=>{const M=!E,H=s.current?.get(l)??{filesExpanded:!1,unpushedExpanded:!1};return s.current?.set(l,{...H,filesExpanded:M}),M})},[l,s]),T=F.useCallback(()=>{v(E=>{const M=!E,H=s.current?.get(l)??{filesExpanded:!1,unpushedExpanded:!1};return s.current?.set(l,{...H,unpushedExpanded:M}),M})},[l,s]),C=b.filter(E=>E.status==="in_progress"||E.status==="blocked"||E.status==="dormant"),z=b.filter(E=>E.status!=="in_progress"&&E.status!=="blocked"&&E.status!=="dormant");return w.jsxs("div",{ref:x,className:n?"ring-2 ring-[var(--accent)] ring-offset-1 rounded":"",children:[w.jsx(KM,{item:t,worktreesFetching:i,filesExpanded:h,onToggleFiles:_,unpushedExpanded:g,onToggleUnpushed:T}),h&&t.worktree&&t.worktree.changedFiles.length>0&&w.jsx(oS,{files:t.worktree.changedFiles}),g&&t.worktree&&w.jsx(aS,{commits:t.worktree.unpushedCommits,count:t.worktree.aheadCount}),C.map(E=>w.jsx(xp,{session:E,showBranch:!1,onSelect:()=>o(E.sessionId)},E.sessionId)),z.length>0&&w.jsxs(w.Fragment,{children:[f&&z.map(E=>w.jsx(xp,{session:E,showBranch:!1,onSelect:()=>o(E.sessionId)},E.sessionId)),w.jsx("button",{type:"button",onClick:()=>d(E=>!E),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 ▴":`${z.length} completed workflow${z.length!==1?"s":""} ▾`})]})]})}function xp({session:t,item:n,showBranch:i,onSelect:o}){const s=qM[t.status],l=t.status==="dormant",c=t.workflowName??t.workflowId??null,f=Uc(t.lastModifiedMs),d=t.sessionTitle?.trim()||c||t.sessionId.slice(0,8),h=t.recapSnippet&&!t.sessionTitle?XM(t.recapSnippet,100):null;return w.jsxs("button",{type:"button",onClick:o,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?w.jsx("div",{className:"w-1.5 h-1.5 rounded-full shrink-0 mt-[3px] border-2 bg-transparent",style:{borderColor:s},title:Sx.dormant}):w.jsx("div",{className:"w-1.5 h-1.5 rounded-full shrink-0 mt-[3px]",style:{backgroundColor:s},title:Sx[t.status]}),w.jsxs("div",{className:"flex-1 min-w-0",children:[w.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:d}),w.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[i&&n&&w.jsx("span",{className:"font-mono text-xs text-[var(--text-muted)] truncate flex-1",children:n.branch}),i&&n?.worktree?.isMerged&&n.worktree.branch!==null&&n.worktree.branch!=="main"&&w.jsx(cm,{}),!i&&c&&w.jsx("span",{className:"text-[10px] text-[var(--text-muted)] shrink-0",children:c}),t.hasUnresolvedGaps&&w.jsx("span",{title:"Unresolved gaps",className:"text-[10px] text-[var(--warning)] shrink-0",children:"⚠"}),w.jsx("span",{className:"text-[10px] text-[var(--text-muted)] tabular-nums shrink-0 ml-auto",children:f})]}),h&&w.jsx("p",{className:"text-xs text-[var(--text-muted)] truncate leading-snug",children:h})]})]})}function KM({item:t,worktreesFetching:n,filesExpanded:i,onToggleFiles:o,unpushedExpanded:s,onToggleUnpushed:l}){const c=Uc(t.activityMs);return w.jsxs("div",{className:"flex items-center gap-2 px-3 pt-2 pb-1",children:[w.jsx("span",{className:"font-mono text-xs font-medium text-[var(--text-secondary)] truncate flex-1",children:t.branch}),t.worktree?.isMerged&&t.worktree.branch!==null&&t.worktree.branch!=="main"&&w.jsx(cm,{}),w.jsx(rS,{item:t,fetching:n,compact:!0,filesExpanded:i,onToggleFiles:o,unpushedExpanded:s,onToggleUnpushed:l}),w.jsx("span",{className:"text-[10px] text-[var(--text-muted)] tabular-nums shrink-0",children:c})]})}function JM({item:t,isFocused:n,worktreesFetching:i,expandStateRef:o}){const s=`${t.branch}\0${t.repoRoot}`,l=()=>o.current?.get(s)??{filesExpanded:!1,unpushedExpanded:!1},[c,f]=F.useState(()=>l().filesExpanded),[d,h]=F.useState(()=>l().unpushedExpanded),[m]=J1(),g=Uc(t.activityMs),v=F.useCallback(()=>{f(b=>{const _=!b,T=o.current?.get(s)??{filesExpanded:!1,unpushedExpanded:!1};return o.current?.set(s,{...T,filesExpanded:_}),_})},[s,o]),x=F.useCallback(()=>{h(b=>{const _=!b,T=o.current?.get(s)??{filesExpanded:!1,unpushedExpanded:!1};return o.current?.set(s,{...T,unpushedExpanded:_}),_})},[s,o]);return w.jsxs("div",{ref:m,children:[w.jsxs("div",{className:`flex items-center gap-3 px-3 py-2 rounded ${n?"ring-2 ring-[var(--accent)] ring-offset-1":""}`,children:[w.jsx("div",{className:"w-1.5 h-1.5 rounded-full shrink-0 bg-[var(--border)]",title:"No sessions"}),w.jsx("span",{className:"font-mono text-xs text-[var(--text-muted)] truncate flex-1",children:t.branch}),t.worktree?.isMerged&&t.worktree.branch!==null&&t.worktree.branch!=="main"&&w.jsx(cm,{}),w.jsx(rS,{item:t,fetching:i,compact:!0,filesExpanded:c,onToggleFiles:v,unpushedExpanded:d,onToggleUnpushed:x}),t.worktree?.headMessage&&w.jsx("span",{className:"text-[10px] text-[var(--text-muted)] truncate hidden sm:block max-w-[200px] opacity-60",children:t.worktree.headMessage}),w.jsx("span",{className:"text-[10px] text-[var(--text-muted)] tabular-nums shrink-0",children:g})]}),c&&t.worktree&&t.worktree.changedFiles.length>0&&w.jsx(oS,{files:t.worktree.changedFiles}),d&&t.worktree&&w.jsx(aS,{commits:t.worktree.unpushedCommits,count:t.worktree.aheadCount})]})}function rS({item:t,fetching:n,compact:i=!1,filesExpanded:o,onToggleFiles:s,unpushedExpanded:l,onToggleUnpushed:c}){if(n&&t.worktree===void 0)return w.jsx("span",{className:"flex gap-1",children:w.jsx(eN,{})});const f=t.worktree;if(!f)return null;const d=f.changedCount,h=f.aheadCount;if(d===0&&h===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${i?" text-[10px]":""}`;return w.jsxs("span",{className:"flex items-center gap-1",children:[d>0&&(s?w.jsxs("button",{type:"button","aria-expanded":o??!1,"aria-label":`Show ${d} uncommitted file${d===1?"":"s"}`,title:`${d} file${d===1?"":"s"} edited but not yet committed — click to expand`,onClick:s,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${o?" ring-1 ring-orange-500/40":""}`,children:[d," uncommitted"]}):w.jsxs("span",{title:`${d} file${d===1?"":"s"} edited but not yet committed`,className:m,children:[d," uncommitted"]})),h>0&&(c?w.jsxs("button",{type:"button","aria-expanded":l??!1,"aria-label":`Show ${h} unpushed commit${h===1?"":"s"}`,title:`${h} commit${h===1?"":"s"} not yet pushed -- click to expand`,onClick:c,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${i?" text-[10px]":""}${l?" ring-1 ring-blue-500/40":""}`,children:[h," unpushed"]}):w.jsxs("span",{title:`${h} commit${h===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${i?" text-[10px]":""}`,children:[h," unpushed"]}))]})}const WM={modified:"var(--warning)",added:"var(--success)",deleted:"var(--error)",untracked:"#a0a0a0",renamed:"var(--accent)",other:"#a0a0a0"},tN={modified:"M",added:"A",deleted:"D",untracked:"?",renamed:"R",other:"~"};function oS({files:t}){return w.jsx("div",{className:"mx-3 mb-1 max-h-48 overflow-y-auto rounded border border-[var(--border)] bg-[var(--bg-card)]",children:t.map((n,i)=>w.jsxs("div",{className:"flex items-center gap-2 px-2 py-0.5 hover:bg-[var(--bg-tertiary)]",children:[w.jsx("span",{className:"text-[10px] font-mono font-semibold w-3 shrink-0 tabular-nums",style:{color:WM[n.status]},title:n.status,children:tN[n.status]}),w.jsx("span",{className:"font-mono text-[11px] text-[var(--text-secondary)] truncate",children:n.path})]},i))})}function aS({commits:t,count:n}){return t.length===0?w.jsx("div",{className:"mx-3 mb-1 px-2 py-1.5 rounded border border-[var(--border)] bg-[var(--bg-card)]",children:w.jsx("span",{className:"text-[11px] text-[var(--text-muted)] italic",children:n!==void 0&&n>0?`${n} commit${n===1?"":"s"} ahead -- details unavailable`:"No unpushed commits"})}):w.jsx("div",{className:"mx-3 mb-1 max-h-48 overflow-y-auto rounded border border-[var(--border)] bg-[var(--bg-card)]",children:t.map((i,o)=>w.jsxs("div",{className:"flex items-center gap-2 px-2 py-0.5 hover:bg-[var(--bg-tertiary)]",children:[w.jsx("span",{className:"font-mono text-[10px] text-[var(--text-muted)] shrink-0 tabular-nums w-14",children:i.hash}),w.jsx("span",{className:"font-mono text-[11px] text-[var(--text-secondary)] truncate",children:i.message})]},o))})}function cm(){return w.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 eN(){return w.jsx("span",{className:"inline-block h-5 w-20 rounded bg-[var(--bg-tertiary)] animate-pulse"})}function nN({scope:t,onChange:n}){return w.jsx("div",{className:"flex items-center gap-1",children:["active","all"].map(i=>w.jsx("button",{type:"button",onClick:()=>n(i),className:`px-3 py-1 rounded-full text-xs font-medium transition-colors capitalize ${t===i?"bg-[var(--bg-tertiary)] text-[var(--text-primary)]":"text-[var(--text-muted)] hover:text-[var(--text-secondary)]"}`,children:i==="active"?"Active":"All"},i))})}function iN({count:t,active:n,onFocusAttention:i}){return w.jsxs("button",{type:"button",onClick:i,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)] ${n?"border-[var(--blocked)]":"border-[var(--border)]"}`,style:{borderLeftColor:"var(--blocked)",borderLeftWidth:"3px"},title:n?"Click to show all branches":"Click to focus on sessions needing attention",children:[w.jsxs("span",{className:"text-sm font-medium",style:{color:"var(--blocked)"},children:[t," session",t!==1?"s":""," ",t!==1?"need":"needs"," attention"]}),w.jsx("span",{className:"text-xs text-[var(--text-muted)]",children:n?"-- click to clear filter":"-- click to focus"})]})}function rN({repos:t,onOpen:n}){return w.jsxs("div",{className:"flex flex-col gap-1 pt-2 border-t border-[var(--border)]",children:[t.map(([i,o])=>w.jsxs("button",{type:"button",onClick:()=>n(o,i),className:"text-xs text-[var(--text-muted)] hover:text-[var(--text-secondary)] transition-colors text-left",children:["All ",o," sessions →"]},i)),t.length!==1&&w.jsx("button",{type:"button",onClick:()=>n(void 0,void 0),className:"text-xs text-[var(--text-muted)] hover:text-[var(--text-secondary)] transition-colors text-left",children:"All sessions →"})]})}function oN({prompt:t}){return w.jsxs("div",{className:"flex flex-col items-center gap-8 py-20 text-center",children:[w.jsxs("div",{children:[w.jsx("h2",{className:"text-xl font-semibold text-[var(--text-primary)] mb-3",children:"Ready when you are"}),w.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:"})]}),w.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:[w.jsx("p",{className:"text-xs font-medium text-[var(--text-muted)] uppercase tracking-wider mb-2",children:"Try this prompt"}),w.jsxs("p",{className:"text-[var(--text-primary)] text-sm leading-relaxed",children:['"Use the'," ",w.jsx("span",{className:"text-[var(--accent)] font-medium",children:t.workflow})," ","to ",t.task,'"']})]}),w.jsxs("p",{className:"text-xs text-[var(--text-muted)]",children:["Prompts rotate each visit -- there are ",iS.length," to discover."]})]})}function Ex(){const[t,n]=F.useState(()=>Math.floor(Math.random()*Ph.length)),[i,o]=F.useState(!1);return F.useEffect(()=>{let s=null;const l=setInterval(()=>{o(!0),s=setTimeout(()=>{n(c=>(c+1)%Ph.length),o(!1),s=null},300)},6e4);return()=>{clearInterval(l),s!==null&&clearTimeout(s)}},[]),w.jsxs("div",{className:"flex items-start gap-3 bg-[var(--bg-card)] border border-[var(--border)] rounded-lg px-4 py-3",children:[w.jsx("div",{className:"w-0.5 shrink-0 self-stretch rounded-full",style:{backgroundColor:"var(--accent)"}}),w.jsxs("div",{style:{opacity:i?0:1,transition:"opacity 300ms"},children:[w.jsx("span",{className:"text-[10px] font-semibold text-[var(--accent)] uppercase tracking-widest",children:"Tip"}),w.jsx("p",{className:"text-sm text-[var(--text-secondary)] mt-1 leading-relaxed",children:Ph[t]})]})]})}function aN({items:t,focusedIndex:n,setFocusedIndex:i,onSelectSession:o,scope:s,setScope:l,refetch:c,archive:f,setArchive:d,disabled:h}){const m=F.useRef(t);m.current=t;const g=F.useRef(o);g.current=o;const v=F.useRef(s);v.current=s;const x=F.useRef(n);x.current=n;const b=F.useRef(f);b.current=f;const _=F.useRef(h);_.current=h,F.useEffect(()=>{function T(C){if(_.current||C.metaKey||C.ctrlKey||C.altKey)return;const z=document.activeElement;if(z instanceof HTMLInputElement||z instanceof HTMLTextAreaElement||z instanceof HTMLSelectElement)return;if(C.key==="Escape"&&b.current!==null){d(null);return}const E=m.current,M=x.current;switch(C.key){case"j":case"ArrowDown":{C.preventDefault();const H=Math.min(M+1,E.length-1);i(H);break}case"k":case"ArrowUp":{C.preventDefault();const H=Math.max(M-1,0);i(H);break}case"Enter":case" ":{if(C.preventDefault(),M>=0&&M<E.length){const R=E[M].primarySession?.sessionId;R&&g.current(R)}break}case"Escape":break;case"/":{C.preventDefault(),d({repoName:void 0,repoRoot:void 0});break}case"r":{C.preventDefault(),c();break}case"a":{C.preventDefault(),l(v.current==="active"?"all":"active");break}}}return document.addEventListener("keydown",T),()=>document.removeEventListener("keydown",T)},[i,l,c,d])}function xe(t){if(typeof t=="string"||typeof t=="number")return""+t;let n="";if(Array.isArray(t))for(let i=0,o;i<t.length;i++)(o=xe(t[i]))!==""&&(n+=(n&&" ")+o);else for(let i in t)t[i]&&(n+=(n&&" ")+i);return n}var sN={value:()=>{}};function Vc(){for(var t=0,n=arguments.length,i={},o;t<n;++t){if(!(o=arguments[t]+"")||o in i||/[\s.]/.test(o))throw new Error("illegal type: "+o);i[o]=[]}return new oc(i)}function oc(t){this._=t}function lN(t,n){return t.trim().split(/^|\s+/).map(function(i){var o="",s=i.indexOf(".");if(s>=0&&(o=i.slice(s+1),i=i.slice(0,s)),i&&!n.hasOwnProperty(i))throw new Error("unknown type: "+i);return{type:i,name:o}})}oc.prototype=Vc.prototype={constructor:oc,on:function(t,n){var i=this._,o=lN(t+"",i),s,l=-1,c=o.length;if(arguments.length<2){for(;++l<c;)if((s=(t=o[l]).type)&&(s=uN(i[s],t.name)))return s;return}if(n!=null&&typeof n!="function")throw new Error("invalid callback: "+n);for(;++l<c;)if(s=(t=o[l]).type)i[s]=_x(i[s],t.name,n);else if(n==null)for(s in i)i[s]=_x(i[s],t.name,null);return this},copy:function(){var t={},n=this._;for(var i in n)t[i]=n[i].slice();return new oc(t)},call:function(t,n){if((s=arguments.length-2)>0)for(var i=new Array(s),o=0,s,l;o<s;++o)i[o]=arguments[o+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(l=this._[t],o=0,s=l.length;o<s;++o)l[o].value.apply(n,i)},apply:function(t,n,i){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var o=this._[t],s=0,l=o.length;s<l;++s)o[s].value.apply(n,i)}};function uN(t,n){for(var i=0,o=t.length,s;i<o;++i)if((s=t[i]).name===n)return s.value}function _x(t,n,i){for(var o=0,s=t.length;o<s;++o)if(t[o].name===n){t[o]=sN,t=t.slice(0,o).concat(t.slice(o+1));break}return i!=null&&t.push({name:n,value:i}),t}var bp="http://www.w3.org/1999/xhtml";const Cx={svg:"http://www.w3.org/2000/svg",xhtml:bp,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function qc(t){var n=t+="",i=n.indexOf(":");return i>=0&&(n=t.slice(0,i))!=="xmlns"&&(t=t.slice(i+1)),Cx.hasOwnProperty(n)?{space:Cx[n],local:t}:t}function cN(t){return function(){var n=this.ownerDocument,i=this.namespaceURI;return i===bp&&n.documentElement.namespaceURI===bp?n.createElement(t):n.createElementNS(i,t)}}function fN(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function sS(t){var n=qc(t);return(n.local?fN:cN)(n)}function dN(){}function fm(t){return t==null?dN:function(){return this.querySelector(t)}}function hN(t){typeof t!="function"&&(t=fm(t));for(var n=this._groups,i=n.length,o=new Array(i),s=0;s<i;++s)for(var l=n[s],c=l.length,f=o[s]=new Array(c),d,h,m=0;m<c;++m)(d=l[m])&&(h=t.call(d,d.__data__,m,l))&&("__data__"in d&&(h.__data__=d.__data__),f[m]=h);return new mn(o,this._parents)}function pN(t){return t==null?[]:Array.isArray(t)?t:Array.from(t)}function mN(){return[]}function lS(t){return t==null?mN:function(){return this.querySelectorAll(t)}}function gN(t){return function(){return pN(t.apply(this,arguments))}}function yN(t){typeof t=="function"?t=gN(t):t=lS(t);for(var n=this._groups,i=n.length,o=[],s=[],l=0;l<i;++l)for(var c=n[l],f=c.length,d,h=0;h<f;++h)(d=c[h])&&(o.push(t.call(d,d.__data__,h,c)),s.push(d));return new mn(o,s)}function uS(t){return function(){return this.matches(t)}}function cS(t){return function(n){return n.matches(t)}}var vN=Array.prototype.find;function xN(t){return function(){return vN.call(this.children,t)}}function bN(){return this.firstElementChild}function SN(t){return this.select(t==null?bN:xN(typeof t=="function"?t:cS(t)))}var wN=Array.prototype.filter;function EN(){return Array.from(this.children)}function _N(t){return function(){return wN.call(this.children,t)}}function CN(t){return this.selectAll(t==null?EN:_N(typeof t=="function"?t:cS(t)))}function TN(t){typeof t!="function"&&(t=uS(t));for(var n=this._groups,i=n.length,o=new Array(i),s=0;s<i;++s)for(var l=n[s],c=l.length,f=o[s]=[],d,h=0;h<c;++h)(d=l[h])&&t.call(d,d.__data__,h,l)&&f.push(d);return new mn(o,this._parents)}function fS(t){return new Array(t.length)}function MN(){return new mn(this._enter||this._groups.map(fS),this._parents)}function bc(t,n){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=n}bc.prototype={constructor:bc,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,n){return this._parent.insertBefore(t,n)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};function NN(t){return function(){return t}}function kN(t,n,i,o,s,l){for(var c=0,f,d=n.length,h=l.length;c<h;++c)(f=n[c])?(f.__data__=l[c],o[c]=f):i[c]=new bc(t,l[c]);for(;c<d;++c)(f=n[c])&&(s[c]=f)}function AN(t,n,i,o,s,l,c){var f,d,h=new Map,m=n.length,g=l.length,v=new Array(m),x;for(f=0;f<m;++f)(d=n[f])&&(v[f]=x=c.call(d,d.__data__,f,n)+"",h.has(x)?s[f]=d:h.set(x,d));for(f=0;f<g;++f)x=c.call(t,l[f],f,l)+"",(d=h.get(x))?(o[f]=d,d.__data__=l[f],h.delete(x)):i[f]=new bc(t,l[f]);for(f=0;f<m;++f)(d=n[f])&&h.get(v[f])===d&&(s[f]=d)}function RN(t){return t.__data__}function ON(t,n){if(!arguments.length)return Array.from(this,RN);var i=n?AN:kN,o=this._parents,s=this._groups;typeof t!="function"&&(t=NN(t));for(var l=s.length,c=new Array(l),f=new Array(l),d=new Array(l),h=0;h<l;++h){var m=o[h],g=s[h],v=g.length,x=zN(t.call(m,m&&m.__data__,h,o)),b=x.length,_=f[h]=new Array(b),T=c[h]=new Array(b),C=d[h]=new Array(v);i(m,g,_,T,C,x,n);for(var z=0,E=0,M,H;z<b;++z)if(M=_[z]){for(z>=E&&(E=z+1);!(H=T[E])&&++E<b;);M._next=H||null}}return c=new mn(c,o),c._enter=f,c._exit=d,c}function zN(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function DN(){return new mn(this._exit||this._groups.map(fS),this._parents)}function LN(t,n,i){var o=this.enter(),s=this,l=this.exit();return typeof t=="function"?(o=t(o),o&&(o=o.selection())):o=o.append(t+""),n!=null&&(s=n(s),s&&(s=s.selection())),i==null?l.remove():i(l),o&&s?o.merge(s).order():s}function jN(t){for(var n=t.selection?t.selection():t,i=this._groups,o=n._groups,s=i.length,l=o.length,c=Math.min(s,l),f=new Array(s),d=0;d<c;++d)for(var h=i[d],m=o[d],g=h.length,v=f[d]=new Array(g),x,b=0;b<g;++b)(x=h[b]||m[b])&&(v[b]=x);for(;d<s;++d)f[d]=i[d];return new mn(f,this._parents)}function BN(){for(var t=this._groups,n=-1,i=t.length;++n<i;)for(var o=t[n],s=o.length-1,l=o[s],c;--s>=0;)(c=o[s])&&(l&&c.compareDocumentPosition(l)^4&&l.parentNode.insertBefore(c,l),l=c);return this}function HN(t){t||(t=PN);function n(g,v){return g&&v?t(g.__data__,v.__data__):!g-!v}for(var i=this._groups,o=i.length,s=new Array(o),l=0;l<o;++l){for(var c=i[l],f=c.length,d=s[l]=new Array(f),h,m=0;m<f;++m)(h=c[m])&&(d[m]=h);d.sort(n)}return new mn(s,this._parents).order()}function PN(t,n){return t<n?-1:t>n?1:t>=n?0:NaN}function IN(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function UN(){return Array.from(this)}function VN(){for(var t=this._groups,n=0,i=t.length;n<i;++n)for(var o=t[n],s=0,l=o.length;s<l;++s){var c=o[s];if(c)return c}return null}function qN(){let t=0;for(const n of this)++t;return t}function FN(){return!this.node()}function YN(t){for(var n=this._groups,i=0,o=n.length;i<o;++i)for(var s=n[i],l=0,c=s.length,f;l<c;++l)(f=s[l])&&t.call(f,f.__data__,l,s);return this}function XN(t){return function(){this.removeAttribute(t)}}function GN(t){return function(){this.removeAttributeNS(t.space,t.local)}}function QN(t,n){return function(){this.setAttribute(t,n)}}function $N(t,n){return function(){this.setAttributeNS(t.space,t.local,n)}}function ZN(t,n){return function(){var i=n.apply(this,arguments);i==null?this.removeAttribute(t):this.setAttribute(t,i)}}function KN(t,n){return function(){var i=n.apply(this,arguments);i==null?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,i)}}function JN(t,n){var i=qc(t);if(arguments.length<2){var o=this.node();return i.local?o.getAttributeNS(i.space,i.local):o.getAttribute(i)}return this.each((n==null?i.local?GN:XN:typeof n=="function"?i.local?KN:ZN:i.local?$N:QN)(i,n))}function dS(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function WN(t){return function(){this.style.removeProperty(t)}}function tk(t,n,i){return function(){this.style.setProperty(t,n,i)}}function ek(t,n,i){return function(){var o=n.apply(this,arguments);o==null?this.style.removeProperty(t):this.style.setProperty(t,o,i)}}function nk(t,n,i){return arguments.length>1?this.each((n==null?WN:typeof n=="function"?ek:tk)(t,n,i??"")):fa(this.node(),t)}function fa(t,n){return t.style.getPropertyValue(n)||dS(t).getComputedStyle(t,null).getPropertyValue(n)}function ik(t){return function(){delete this[t]}}function rk(t,n){return function(){this[t]=n}}function ok(t,n){return function(){var i=n.apply(this,arguments);i==null?delete this[t]:this[t]=i}}function ak(t,n){return arguments.length>1?this.each((n==null?ik:typeof n=="function"?ok:rk)(t,n)):this.node()[t]}function hS(t){return t.trim().split(/^|\s+/)}function dm(t){return t.classList||new pS(t)}function pS(t){this._node=t,this._names=hS(t.getAttribute("class")||"")}pS.prototype={add:function(t){var n=this._names.indexOf(t);n<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var n=this._names.indexOf(t);n>=0&&(this._names.splice(n,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};function mS(t,n){for(var i=dm(t),o=-1,s=n.length;++o<s;)i.add(n[o])}function gS(t,n){for(var i=dm(t),o=-1,s=n.length;++o<s;)i.remove(n[o])}function sk(t){return function(){mS(this,t)}}function lk(t){return function(){gS(this,t)}}function uk(t,n){return function(){(n.apply(this,arguments)?mS:gS)(this,t)}}function ck(t,n){var i=hS(t+"");if(arguments.length<2){for(var o=dm(this.node()),s=-1,l=i.length;++s<l;)if(!o.contains(i[s]))return!1;return!0}return this.each((typeof n=="function"?uk:n?sk:lk)(i,n))}function fk(){this.textContent=""}function dk(t){return function(){this.textContent=t}}function hk(t){return function(){var n=t.apply(this,arguments);this.textContent=n??""}}function pk(t){return arguments.length?this.each(t==null?fk:(typeof t=="function"?hk:dk)(t)):this.node().textContent}function mk(){this.innerHTML=""}function gk(t){return function(){this.innerHTML=t}}function yk(t){return function(){var n=t.apply(this,arguments);this.innerHTML=n??""}}function vk(t){return arguments.length?this.each(t==null?mk:(typeof t=="function"?yk:gk)(t)):this.node().innerHTML}function xk(){this.nextSibling&&this.parentNode.appendChild(this)}function bk(){return this.each(xk)}function Sk(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function wk(){return this.each(Sk)}function Ek(t){var n=typeof t=="function"?t:sS(t);return this.select(function(){return this.appendChild(n.apply(this,arguments))})}function _k(){return null}function Ck(t,n){var i=typeof t=="function"?t:sS(t),o=n==null?_k:typeof n=="function"?n:fm(n);return this.select(function(){return this.insertBefore(i.apply(this,arguments),o.apply(this,arguments)||null)})}function Tk(){var t=this.parentNode;t&&t.removeChild(this)}function Mk(){return this.each(Tk)}function Nk(){var t=this.cloneNode(!1),n=this.parentNode;return n?n.insertBefore(t,this.nextSibling):t}function kk(){var t=this.cloneNode(!0),n=this.parentNode;return n?n.insertBefore(t,this.nextSibling):t}function Ak(t){return this.select(t?kk:Nk)}function Rk(t){return arguments.length?this.property("__data__",t):this.node().__data__}function Ok(t){return function(n){t.call(this,n,this.__data__)}}function zk(t){return t.trim().split(/^|\s+/).map(function(n){var i="",o=n.indexOf(".");return o>=0&&(i=n.slice(o+1),n=n.slice(0,o)),{type:n,name:i}})}function Dk(t){return function(){var n=this.__on;if(n){for(var i=0,o=-1,s=n.length,l;i<s;++i)l=n[i],(!t.type||l.type===t.type)&&l.name===t.name?this.removeEventListener(l.type,l.listener,l.options):n[++o]=l;++o?n.length=o:delete this.__on}}}function Lk(t,n,i){return function(){var o=this.__on,s,l=Ok(n);if(o){for(var c=0,f=o.length;c<f;++c)if((s=o[c]).type===t.type&&s.name===t.name){this.removeEventListener(s.type,s.listener,s.options),this.addEventListener(s.type,s.listener=l,s.options=i),s.value=n;return}}this.addEventListener(t.type,l,i),s={type:t.type,name:t.name,value:n,listener:l,options:i},o?o.push(s):this.__on=[s]}}function jk(t,n,i){var o=zk(t+""),s,l=o.length,c;if(arguments.length<2){var f=this.node().__on;if(f){for(var d=0,h=f.length,m;d<h;++d)for(s=0,m=f[d];s<l;++s)if((c=o[s]).type===m.type&&c.name===m.name)return m.value}return}for(f=n?Lk:Dk,s=0;s<l;++s)this.each(f(o[s],n,i));return this}function yS(t,n,i){var o=dS(t),s=o.CustomEvent;typeof s=="function"?s=new s(n,i):(s=o.document.createEvent("Event"),i?(s.initEvent(n,i.bubbles,i.cancelable),s.detail=i.detail):s.initEvent(n,!1,!1)),t.dispatchEvent(s)}function Bk(t,n){return function(){return yS(this,t,n)}}function Hk(t,n){return function(){return yS(this,t,n.apply(this,arguments))}}function Pk(t,n){return this.each((typeof n=="function"?Hk:Bk)(t,n))}function*Ik(){for(var t=this._groups,n=0,i=t.length;n<i;++n)for(var o=t[n],s=0,l=o.length,c;s<l;++s)(c=o[s])&&(yield c)}var vS=[null];function mn(t,n){this._groups=t,this._parents=n}function ol(){return new mn([[document.documentElement]],vS)}function Uk(){return this}mn.prototype=ol.prototype={constructor:mn,select:hN,selectAll:yN,selectChild:SN,selectChildren:CN,filter:TN,data:ON,enter:MN,exit:DN,join:LN,merge:jN,selection:Uk,order:BN,sort:HN,call:IN,nodes:UN,node:VN,size:qN,empty:FN,each:YN,attr:JN,style:nk,property:ak,classed:ck,text:pk,html:vk,raise:bk,lower:wk,append:Ek,insert:Ck,remove:Mk,clone:Ak,datum:Rk,on:jk,dispatch:Pk,[Symbol.iterator]:Ik};function cn(t){return typeof t=="string"?new mn([[document.querySelector(t)]],[document.documentElement]):new mn([[t]],vS)}function Vk(t){let n;for(;n=t.sourceEvent;)t=n;return t}function jn(t,n){if(t=Vk(t),n===void 0&&(n=t.currentTarget),n){var i=n.ownerSVGElement||n;if(i.createSVGPoint){var o=i.createSVGPoint();return o.x=t.clientX,o.y=t.clientY,o=o.matrixTransform(n.getScreenCTM().inverse()),[o.x,o.y]}if(n.getBoundingClientRect){var s=n.getBoundingClientRect();return[t.clientX-s.left-n.clientLeft,t.clientY-s.top-n.clientTop]}}return[t.pageX,t.pageY]}const qk={passive:!1},Xs={capture:!0,passive:!1};function Ih(t){t.stopImmediatePropagation()}function ia(t){t.preventDefault(),t.stopImmediatePropagation()}function xS(t){var n=t.document.documentElement,i=cn(t).on("dragstart.drag",ia,Xs);"onselectstart"in n?i.on("selectstart.drag",ia,Xs):(n.__noselect=n.style.MozUserSelect,n.style.MozUserSelect="none")}function bS(t,n){var i=t.document.documentElement,o=cn(t).on("dragstart.drag",null);n&&(o.on("click.drag",ia,Xs),setTimeout(function(){o.on("click.drag",null)},0)),"onselectstart"in i?o.on("selectstart.drag",null):(i.style.MozUserSelect=i.__noselect,delete i.__noselect)}const Uu=t=>()=>t;function Sp(t,{sourceEvent:n,subject:i,target:o,identifier:s,active:l,x:c,y:f,dx:d,dy:h,dispatch:m}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:n,enumerable:!0,configurable:!0},subject:{value:i,enumerable:!0,configurable:!0},target:{value:o,enumerable:!0,configurable:!0},identifier:{value:s,enumerable:!0,configurable:!0},active:{value:l,enumerable:!0,configurable:!0},x:{value:c,enumerable:!0,configurable:!0},y:{value:f,enumerable:!0,configurable:!0},dx:{value:d,enumerable:!0,configurable:!0},dy:{value:h,enumerable:!0,configurable:!0},_:{value:m}})}Sp.prototype.on=function(){var t=this._.on.apply(this._,arguments);return t===this._?this:t};function Fk(t){return!t.ctrlKey&&!t.button}function Yk(){return this.parentNode}function Xk(t,n){return n??{x:t.x,y:t.y}}function Gk(){return navigator.maxTouchPoints||"ontouchstart"in this}function SS(){var t=Fk,n=Yk,i=Xk,o=Gk,s={},l=Vc("start","drag","end"),c=0,f,d,h,m,g=0;function v(M){M.on("mousedown.drag",x).filter(o).on("touchstart.drag",T).on("touchmove.drag",C,qk).on("touchend.drag touchcancel.drag",z).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function x(M,H){if(!(m||!t.call(this,M,H))){var R=E(this,n.call(this,M,H),M,H,"mouse");R&&(cn(M.view).on("mousemove.drag",b,Xs).on("mouseup.drag",_,Xs),xS(M.view),Ih(M),h=!1,f=M.clientX,d=M.clientY,R("start",M))}}function b(M){if(ia(M),!h){var H=M.clientX-f,R=M.clientY-d;h=H*H+R*R>g}s.mouse("drag",M)}function _(M){cn(M.view).on("mousemove.drag mouseup.drag",null),bS(M.view,h),ia(M),s.mouse("end",M)}function T(M,H){if(t.call(this,M,H)){var R=M.changedTouches,B=n.call(this,M,H),P=R.length,q,J;for(q=0;q<P;++q)(J=E(this,B,M,H,R[q].identifier,R[q]))&&(Ih(M),J("start",M,R[q]))}}function C(M){var H=M.changedTouches,R=H.length,B,P;for(B=0;B<R;++B)(P=s[H[B].identifier])&&(ia(M),P("drag",M,H[B]))}function z(M){var H=M.changedTouches,R=H.length,B,P;for(m&&clearTimeout(m),m=setTimeout(function(){m=null},500),B=0;B<R;++B)(P=s[H[B].identifier])&&(Ih(M),P("end",M,H[B]))}function E(M,H,R,B,P,q){var J=l.copy(),j=jn(q||R,H),V,K,D;if((D=i.call(M,new Sp("beforestart",{sourceEvent:R,target:v,identifier:P,active:c,x:j[0],y:j[1],dx:0,dy:0,dispatch:J}),B))!=null)return V=D.x-j[0]||0,K=D.y-j[1]||0,function I(O,U,G){var $=j,k;switch(O){case"start":s[P]=I,k=c++;break;case"end":delete s[P],--c;case"drag":j=jn(G||U,H),k=c;break}J.call(O,M,new Sp(O,{sourceEvent:U,subject:D,target:v,identifier:P,active:k,x:j[0]+V,y:j[1]+K,dx:j[0]-$[0],dy:j[1]-$[1],dispatch:J}),B)}}return v.filter=function(M){return arguments.length?(t=typeof M=="function"?M:Uu(!!M),v):t},v.container=function(M){return arguments.length?(n=typeof M=="function"?M:Uu(M),v):n},v.subject=function(M){return arguments.length?(i=typeof M=="function"?M:Uu(M),v):i},v.touchable=function(M){return arguments.length?(o=typeof M=="function"?M:Uu(!!M),v):o},v.on=function(){var M=l.on.apply(l,arguments);return M===l?v:M},v.clickDistance=function(M){return arguments.length?(g=(M=+M)*M,v):Math.sqrt(g)},v}function hm(t,n,i){t.prototype=n.prototype=i,i.constructor=t}function wS(t,n){var i=Object.create(t.prototype);for(var o in n)i[o]=n[o];return i}function al(){}var Gs=.7,Sc=1/Gs,ra="\\s*([+-]?\\d+)\\s*",Qs="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Jn="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Qk=/^#([0-9a-f]{3,8})$/,$k=new RegExp(`^rgb\\(${ra},${ra},${ra}\\)$`),Zk=new RegExp(`^rgb\\(${Jn},${Jn},${Jn}\\)$`),Kk=new RegExp(`^rgba\\(${ra},${ra},${ra},${Qs}\\)$`),Jk=new RegExp(`^rgba\\(${Jn},${Jn},${Jn},${Qs}\\)$`),Wk=new RegExp(`^hsl\\(${Qs},${Jn},${Jn}\\)$`),tA=new RegExp(`^hsla\\(${Qs},${Jn},${Jn},${Qs}\\)$`),Tx={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};hm(al,Wr,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:Mx,formatHex:Mx,formatHex8:eA,formatHsl:nA,formatRgb:Nx,toString:Nx});function Mx(){return this.rgb().formatHex()}function eA(){return this.rgb().formatHex8()}function nA(){return ES(this).formatHsl()}function Nx(){return this.rgb().formatRgb()}function Wr(t){var n,i;return t=(t+"").trim().toLowerCase(),(n=Qk.exec(t))?(i=n[1].length,n=parseInt(n[1],16),i===6?kx(n):i===3?new $e(n>>8&15|n>>4&240,n>>4&15|n&240,(n&15)<<4|n&15,1):i===8?Vu(n>>24&255,n>>16&255,n>>8&255,(n&255)/255):i===4?Vu(n>>12&15|n>>8&240,n>>8&15|n>>4&240,n>>4&15|n&240,((n&15)<<4|n&15)/255):null):(n=$k.exec(t))?new $e(n[1],n[2],n[3],1):(n=Zk.exec(t))?new $e(n[1]*255/100,n[2]*255/100,n[3]*255/100,1):(n=Kk.exec(t))?Vu(n[1],n[2],n[3],n[4]):(n=Jk.exec(t))?Vu(n[1]*255/100,n[2]*255/100,n[3]*255/100,n[4]):(n=Wk.exec(t))?Ox(n[1],n[2]/100,n[3]/100,1):(n=tA.exec(t))?Ox(n[1],n[2]/100,n[3]/100,n[4]):Tx.hasOwnProperty(t)?kx(Tx[t]):t==="transparent"?new $e(NaN,NaN,NaN,0):null}function kx(t){return new $e(t>>16&255,t>>8&255,t&255,1)}function Vu(t,n,i,o){return o<=0&&(t=n=i=NaN),new $e(t,n,i,o)}function iA(t){return t instanceof al||(t=Wr(t)),t?(t=t.rgb(),new $e(t.r,t.g,t.b,t.opacity)):new $e}function wp(t,n,i,o){return arguments.length===1?iA(t):new $e(t,n,i,o??1)}function $e(t,n,i,o){this.r=+t,this.g=+n,this.b=+i,this.opacity=+o}hm($e,wp,wS(al,{brighter(t){return t=t==null?Sc:Math.pow(Sc,t),new $e(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?Gs:Math.pow(Gs,t),new $e(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new $e(Gr(this.r),Gr(this.g),Gr(this.b),wc(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:Ax,formatHex:Ax,formatHex8:rA,formatRgb:Rx,toString:Rx}));function Ax(){return`#${qr(this.r)}${qr(this.g)}${qr(this.b)}`}function rA(){return`#${qr(this.r)}${qr(this.g)}${qr(this.b)}${qr((isNaN(this.opacity)?1:this.opacity)*255)}`}function Rx(){const t=wc(this.opacity);return`${t===1?"rgb(":"rgba("}${Gr(this.r)}, ${Gr(this.g)}, ${Gr(this.b)}${t===1?")":`, ${t})`}`}function wc(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function Gr(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function qr(t){return t=Gr(t),(t<16?"0":"")+t.toString(16)}function Ox(t,n,i,o){return o<=0?t=n=i=NaN:i<=0||i>=1?t=n=NaN:n<=0&&(t=NaN),new Bn(t,n,i,o)}function ES(t){if(t instanceof Bn)return new Bn(t.h,t.s,t.l,t.opacity);if(t instanceof al||(t=Wr(t)),!t)return new Bn;if(t instanceof Bn)return t;t=t.rgb();var n=t.r/255,i=t.g/255,o=t.b/255,s=Math.min(n,i,o),l=Math.max(n,i,o),c=NaN,f=l-s,d=(l+s)/2;return f?(n===l?c=(i-o)/f+(i<o)*6:i===l?c=(o-n)/f+2:c=(n-i)/f+4,f/=d<.5?l+s:2-l-s,c*=60):f=d>0&&d<1?0:c,new Bn(c,f,d,t.opacity)}function oA(t,n,i,o){return arguments.length===1?ES(t):new Bn(t,n,i,o??1)}function Bn(t,n,i,o){this.h=+t,this.s=+n,this.l=+i,this.opacity=+o}hm(Bn,oA,wS(al,{brighter(t){return t=t==null?Sc:Math.pow(Sc,t),new Bn(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?Gs:Math.pow(Gs,t),new Bn(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,n=isNaN(t)||isNaN(this.s)?0:this.s,i=this.l,o=i+(i<.5?i:1-i)*n,s=2*i-o;return new $e(Uh(t>=240?t-240:t+120,s,o),Uh(t,s,o),Uh(t<120?t+240:t-120,s,o),this.opacity)},clamp(){return new Bn(zx(this.h),qu(this.s),qu(this.l),wc(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 t=wc(this.opacity);return`${t===1?"hsl(":"hsla("}${zx(this.h)}, ${qu(this.s)*100}%, ${qu(this.l)*100}%${t===1?")":`, ${t})`}`}}));function zx(t){return t=(t||0)%360,t<0?t+360:t}function qu(t){return Math.max(0,Math.min(1,t||0))}function Uh(t,n,i){return(t<60?n+(i-n)*t/60:t<180?i:t<240?n+(i-n)*(240-t)/60:n)*255}const pm=t=>()=>t;function aA(t,n){return function(i){return t+i*n}}function sA(t,n,i){return t=Math.pow(t,i),n=Math.pow(n,i)-t,i=1/i,function(o){return Math.pow(t+o*n,i)}}function lA(t){return(t=+t)==1?_S:function(n,i){return i-n?sA(n,i,t):pm(isNaN(n)?i:n)}}function _S(t,n){var i=n-t;return i?aA(t,i):pm(isNaN(t)?n:t)}const Ec=(function t(n){var i=lA(n);function o(s,l){var c=i((s=wp(s)).r,(l=wp(l)).r),f=i(s.g,l.g),d=i(s.b,l.b),h=_S(s.opacity,l.opacity);return function(m){return s.r=c(m),s.g=f(m),s.b=d(m),s.opacity=h(m),s+""}}return o.gamma=t,o})(1);function uA(t,n){n||(n=[]);var i=t?Math.min(n.length,t.length):0,o=n.slice(),s;return function(l){for(s=0;s<i;++s)o[s]=t[s]*(1-l)+n[s]*l;return o}}function cA(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function fA(t,n){var i=n?n.length:0,o=t?Math.min(i,t.length):0,s=new Array(o),l=new Array(i),c;for(c=0;c<o;++c)s[c]=zs(t[c],n[c]);for(;c<i;++c)l[c]=n[c];return function(f){for(c=0;c<o;++c)l[c]=s[c](f);return l}}function dA(t,n){var i=new Date;return t=+t,n=+n,function(o){return i.setTime(t*(1-o)+n*o),i}}function Zn(t,n){return t=+t,n=+n,function(i){return t*(1-i)+n*i}}function hA(t,n){var i={},o={},s;(t===null||typeof t!="object")&&(t={}),(n===null||typeof n!="object")&&(n={});for(s in n)s in t?i[s]=zs(t[s],n[s]):o[s]=n[s];return function(l){for(s in i)o[s]=i[s](l);return o}}var Ep=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Vh=new RegExp(Ep.source,"g");function pA(t){return function(){return t}}function mA(t){return function(n){return t(n)+""}}function CS(t,n){var i=Ep.lastIndex=Vh.lastIndex=0,o,s,l,c=-1,f=[],d=[];for(t=t+"",n=n+"";(o=Ep.exec(t))&&(s=Vh.exec(n));)(l=s.index)>i&&(l=n.slice(i,l),f[c]?f[c]+=l:f[++c]=l),(o=o[0])===(s=s[0])?f[c]?f[c]+=s:f[++c]=s:(f[++c]=null,d.push({i:c,x:Zn(o,s)})),i=Vh.lastIndex;return i<n.length&&(l=n.slice(i),f[c]?f[c]+=l:f[++c]=l),f.length<2?d[0]?mA(d[0].x):pA(n):(n=d.length,function(h){for(var m=0,g;m<n;++m)f[(g=d[m]).i]=g.x(h);return f.join("")})}function zs(t,n){var i=typeof n,o;return n==null||i==="boolean"?pm(n):(i==="number"?Zn:i==="string"?(o=Wr(n))?(n=o,Ec):CS:n instanceof Wr?Ec:n instanceof Date?dA:cA(n)?uA:Array.isArray(n)?fA:typeof n.valueOf!="function"&&typeof n.toString!="function"||isNaN(n)?hA:Zn)(t,n)}var Dx=180/Math.PI,_p={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function TS(t,n,i,o,s,l){var c,f,d;return(c=Math.sqrt(t*t+n*n))&&(t/=c,n/=c),(d=t*i+n*o)&&(i-=t*d,o-=n*d),(f=Math.sqrt(i*i+o*o))&&(i/=f,o/=f,d/=f),t*o<n*i&&(t=-t,n=-n,d=-d,c=-c),{translateX:s,translateY:l,rotate:Math.atan2(n,t)*Dx,skewX:Math.atan(d)*Dx,scaleX:c,scaleY:f}}var Fu;function gA(t){const n=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(t+"");return n.isIdentity?_p:TS(n.a,n.b,n.c,n.d,n.e,n.f)}function yA(t){return t==null||(Fu||(Fu=document.createElementNS("http://www.w3.org/2000/svg","g")),Fu.setAttribute("transform",t),!(t=Fu.transform.baseVal.consolidate()))?_p:(t=t.matrix,TS(t.a,t.b,t.c,t.d,t.e,t.f))}function MS(t,n,i,o){function s(h){return h.length?h.pop()+" ":""}function l(h,m,g,v,x,b){if(h!==g||m!==v){var _=x.push("translate(",null,n,null,i);b.push({i:_-4,x:Zn(h,g)},{i:_-2,x:Zn(m,v)})}else(g||v)&&x.push("translate("+g+n+v+i)}function c(h,m,g,v){h!==m?(h-m>180?m+=360:m-h>180&&(h+=360),v.push({i:g.push(s(g)+"rotate(",null,o)-2,x:Zn(h,m)})):m&&g.push(s(g)+"rotate("+m+o)}function f(h,m,g,v){h!==m?v.push({i:g.push(s(g)+"skewX(",null,o)-2,x:Zn(h,m)}):m&&g.push(s(g)+"skewX("+m+o)}function d(h,m,g,v,x,b){if(h!==g||m!==v){var _=x.push(s(x)+"scale(",null,",",null,")");b.push({i:_-4,x:Zn(h,g)},{i:_-2,x:Zn(m,v)})}else(g!==1||v!==1)&&x.push(s(x)+"scale("+g+","+v+")")}return function(h,m){var g=[],v=[];return h=t(h),m=t(m),l(h.translateX,h.translateY,m.translateX,m.translateY,g,v),c(h.rotate,m.rotate,g,v),f(h.skewX,m.skewX,g,v),d(h.scaleX,h.scaleY,m.scaleX,m.scaleY,g,v),h=m=null,function(x){for(var b=-1,_=v.length,T;++b<_;)g[(T=v[b]).i]=T.x(x);return g.join("")}}}var vA=MS(gA,"px, ","px)","deg)"),xA=MS(yA,", ",")",")"),bA=1e-12;function Lx(t){return((t=Math.exp(t))+1/t)/2}function SA(t){return((t=Math.exp(t))-1/t)/2}function wA(t){return((t=Math.exp(2*t))-1)/(t+1)}const ac=(function t(n,i,o){function s(l,c){var f=l[0],d=l[1],h=l[2],m=c[0],g=c[1],v=c[2],x=m-f,b=g-d,_=x*x+b*b,T,C;if(_<bA)C=Math.log(v/h)/n,T=function(B){return[f+B*x,d+B*b,h*Math.exp(n*B*C)]};else{var z=Math.sqrt(_),E=(v*v-h*h+o*_)/(2*h*i*z),M=(v*v-h*h-o*_)/(2*v*i*z),H=Math.log(Math.sqrt(E*E+1)-E),R=Math.log(Math.sqrt(M*M+1)-M);C=(R-H)/n,T=function(B){var P=B*C,q=Lx(H),J=h/(i*z)*(q*wA(n*P+H)-SA(H));return[f+J*x,d+J*b,h*q/Lx(n*P+H)]}}return T.duration=C*1e3*n/Math.SQRT2,T}return s.rho=function(l){var c=Math.max(.001,+l),f=c*c,d=f*f;return t(c,f,d)},s})(Math.SQRT2,2,4);var da=0,ks=0,Ss=0,NS=1e3,_c,As,Cc=0,to=0,Fc=0,$s=typeof performance=="object"&&performance.now?performance:Date,kS=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function mm(){return to||(kS(EA),to=$s.now()+Fc)}function EA(){to=0}function Tc(){this._call=this._time=this._next=null}Tc.prototype=AS.prototype={constructor:Tc,restart:function(t,n,i){if(typeof t!="function")throw new TypeError("callback is not a function");i=(i==null?mm():+i)+(n==null?0:+n),!this._next&&As!==this&&(As?As._next=this:_c=this,As=this),this._call=t,this._time=i,Cp()},stop:function(){this._call&&(this._call=null,this._time=1/0,Cp())}};function AS(t,n,i){var o=new Tc;return o.restart(t,n,i),o}function _A(){mm(),++da;for(var t=_c,n;t;)(n=to-t._time)>=0&&t._call.call(void 0,n),t=t._next;--da}function jx(){to=(Cc=$s.now())+Fc,da=ks=0;try{_A()}finally{da=0,TA(),to=0}}function CA(){var t=$s.now(),n=t-Cc;n>NS&&(Fc-=n,Cc=t)}function TA(){for(var t,n=_c,i,o=1/0;n;)n._call?(o>n._time&&(o=n._time),t=n,n=n._next):(i=n._next,n._next=null,n=t?t._next=i:_c=i);As=t,Cp(o)}function Cp(t){if(!da){ks&&(ks=clearTimeout(ks));var n=t-to;n>24?(t<1/0&&(ks=setTimeout(jx,t-$s.now()-Fc)),Ss&&(Ss=clearInterval(Ss))):(Ss||(Cc=$s.now(),Ss=setInterval(CA,NS)),da=1,kS(jx))}}function Bx(t,n,i){var o=new Tc;return n=n==null?0:+n,o.restart(s=>{o.stop(),t(s+n)},n,i),o}var MA=Vc("start","end","cancel","interrupt"),NA=[],RS=0,Hx=1,Tp=2,sc=3,Px=4,Mp=5,lc=6;function Yc(t,n,i,o,s,l){var c=t.__transition;if(!c)t.__transition={};else if(i in c)return;kA(t,i,{name:n,index:o,group:s,on:MA,tween:NA,time:l.time,delay:l.delay,duration:l.duration,ease:l.ease,timer:null,state:RS})}function gm(t,n){var i=In(t,n);if(i.state>RS)throw new Error("too late; already scheduled");return i}function ni(t,n){var i=In(t,n);if(i.state>sc)throw new Error("too late; already running");return i}function In(t,n){var i=t.__transition;if(!i||!(i=i[n]))throw new Error("transition not found");return i}function kA(t,n,i){var o=t.__transition,s;o[n]=i,i.timer=AS(l,0,i.time);function l(h){i.state=Hx,i.timer.restart(c,i.delay,i.time),i.delay<=h&&c(h-i.delay)}function c(h){var m,g,v,x;if(i.state!==Hx)return d();for(m in o)if(x=o[m],x.name===i.name){if(x.state===sc)return Bx(c);x.state===Px?(x.state=lc,x.timer.stop(),x.on.call("interrupt",t,t.__data__,x.index,x.group),delete o[m]):+m<n&&(x.state=lc,x.timer.stop(),x.on.call("cancel",t,t.__data__,x.index,x.group),delete o[m])}if(Bx(function(){i.state===sc&&(i.state=Px,i.timer.restart(f,i.delay,i.time),f(h))}),i.state=Tp,i.on.call("start",t,t.__data__,i.index,i.group),i.state===Tp){for(i.state=sc,s=new Array(v=i.tween.length),m=0,g=-1;m<v;++m)(x=i.tween[m].value.call(t,t.__data__,i.index,i.group))&&(s[++g]=x);s.length=g+1}}function f(h){for(var m=h<i.duration?i.ease.call(null,h/i.duration):(i.timer.restart(d),i.state=Mp,1),g=-1,v=s.length;++g<v;)s[g].call(t,m);i.state===Mp&&(i.on.call("end",t,t.__data__,i.index,i.group),d())}function d(){i.state=lc,i.timer.stop(),delete o[n];for(var h in o)return;delete t.__transition}}function uc(t,n){var i=t.__transition,o,s,l=!0,c;if(i){n=n==null?null:n+"";for(c in i){if((o=i[c]).name!==n){l=!1;continue}s=o.state>Tp&&o.state<Mp,o.state=lc,o.timer.stop(),o.on.call(s?"interrupt":"cancel",t,t.__data__,o.index,o.group),delete i[c]}l&&delete t.__transition}}function AA(t){return this.each(function(){uc(this,t)})}function RA(t,n){var i,o;return function(){var s=ni(this,t),l=s.tween;if(l!==i){o=i=l;for(var c=0,f=o.length;c<f;++c)if(o[c].name===n){o=o.slice(),o.splice(c,1);break}}s.tween=o}}function OA(t,n,i){var o,s;if(typeof i!="function")throw new Error;return function(){var l=ni(this,t),c=l.tween;if(c!==o){s=(o=c).slice();for(var f={name:n,value:i},d=0,h=s.length;d<h;++d)if(s[d].name===n){s[d]=f;break}d===h&&s.push(f)}l.tween=s}}function zA(t,n){var i=this._id;if(t+="",arguments.length<2){for(var o=In(this.node(),i).tween,s=0,l=o.length,c;s<l;++s)if((c=o[s]).name===t)return c.value;return null}return this.each((n==null?RA:OA)(i,t,n))}function ym(t,n,i){var o=t._id;return t.each(function(){var s=ni(this,o);(s.value||(s.value={}))[n]=i.apply(this,arguments)}),function(s){return In(s,o).value[n]}}function OS(t,n){var i;return(typeof n=="number"?Zn:n instanceof Wr?Ec:(i=Wr(n))?(n=i,Ec):CS)(t,n)}function DA(t){return function(){this.removeAttribute(t)}}function LA(t){return function(){this.removeAttributeNS(t.space,t.local)}}function jA(t,n,i){var o,s=i+"",l;return function(){var c=this.getAttribute(t);return c===s?null:c===o?l:l=n(o=c,i)}}function BA(t,n,i){var o,s=i+"",l;return function(){var c=this.getAttributeNS(t.space,t.local);return c===s?null:c===o?l:l=n(o=c,i)}}function HA(t,n,i){var o,s,l;return function(){var c,f=i(this),d;return f==null?void this.removeAttribute(t):(c=this.getAttribute(t),d=f+"",c===d?null:c===o&&d===s?l:(s=d,l=n(o=c,f)))}}function PA(t,n,i){var o,s,l;return function(){var c,f=i(this),d;return f==null?void this.removeAttributeNS(t.space,t.local):(c=this.getAttributeNS(t.space,t.local),d=f+"",c===d?null:c===o&&d===s?l:(s=d,l=n(o=c,f)))}}function IA(t,n){var i=qc(t),o=i==="transform"?xA:OS;return this.attrTween(t,typeof n=="function"?(i.local?PA:HA)(i,o,ym(this,"attr."+t,n)):n==null?(i.local?LA:DA)(i):(i.local?BA:jA)(i,o,n))}function UA(t,n){return function(i){this.setAttribute(t,n.call(this,i))}}function VA(t,n){return function(i){this.setAttributeNS(t.space,t.local,n.call(this,i))}}function qA(t,n){var i,o;function s(){var l=n.apply(this,arguments);return l!==o&&(i=(o=l)&&VA(t,l)),i}return s._value=n,s}function FA(t,n){var i,o;function s(){var l=n.apply(this,arguments);return l!==o&&(i=(o=l)&&UA(t,l)),i}return s._value=n,s}function YA(t,n){var i="attr."+t;if(arguments.length<2)return(i=this.tween(i))&&i._value;if(n==null)return this.tween(i,null);if(typeof n!="function")throw new Error;var o=qc(t);return this.tween(i,(o.local?qA:FA)(o,n))}function XA(t,n){return function(){gm(this,t).delay=+n.apply(this,arguments)}}function GA(t,n){return n=+n,function(){gm(this,t).delay=n}}function QA(t){var n=this._id;return arguments.length?this.each((typeof t=="function"?XA:GA)(n,t)):In(this.node(),n).delay}function $A(t,n){return function(){ni(this,t).duration=+n.apply(this,arguments)}}function ZA(t,n){return n=+n,function(){ni(this,t).duration=n}}function KA(t){var n=this._id;return arguments.length?this.each((typeof t=="function"?$A:ZA)(n,t)):In(this.node(),n).duration}function JA(t,n){if(typeof n!="function")throw new Error;return function(){ni(this,t).ease=n}}function WA(t){var n=this._id;return arguments.length?this.each(JA(n,t)):In(this.node(),n).ease}function tR(t,n){return function(){var i=n.apply(this,arguments);if(typeof i!="function")throw new Error;ni(this,t).ease=i}}function eR(t){if(typeof t!="function")throw new Error;return this.each(tR(this._id,t))}function nR(t){typeof t!="function"&&(t=uS(t));for(var n=this._groups,i=n.length,o=new Array(i),s=0;s<i;++s)for(var l=n[s],c=l.length,f=o[s]=[],d,h=0;h<c;++h)(d=l[h])&&t.call(d,d.__data__,h,l)&&f.push(d);return new Ai(o,this._parents,this._name,this._id)}function iR(t){if(t._id!==this._id)throw new Error;for(var n=this._groups,i=t._groups,o=n.length,s=i.length,l=Math.min(o,s),c=new Array(o),f=0;f<l;++f)for(var d=n[f],h=i[f],m=d.length,g=c[f]=new Array(m),v,x=0;x<m;++x)(v=d[x]||h[x])&&(g[x]=v);for(;f<o;++f)c[f]=n[f];return new Ai(c,this._parents,this._name,this._id)}function rR(t){return(t+"").trim().split(/^|\s+/).every(function(n){var i=n.indexOf(".");return i>=0&&(n=n.slice(0,i)),!n||n==="start"})}function oR(t,n,i){var o,s,l=rR(n)?gm:ni;return function(){var c=l(this,t),f=c.on;f!==o&&(s=(o=f).copy()).on(n,i),c.on=s}}function aR(t,n){var i=this._id;return arguments.length<2?In(this.node(),i).on.on(t):this.each(oR(i,t,n))}function sR(t){return function(){var n=this.parentNode;for(var i in this.__transition)if(+i!==t)return;n&&n.removeChild(this)}}function lR(){return this.on("end.remove",sR(this._id))}function uR(t){var n=this._name,i=this._id;typeof t!="function"&&(t=fm(t));for(var o=this._groups,s=o.length,l=new Array(s),c=0;c<s;++c)for(var f=o[c],d=f.length,h=l[c]=new Array(d),m,g,v=0;v<d;++v)(m=f[v])&&(g=t.call(m,m.__data__,v,f))&&("__data__"in m&&(g.__data__=m.__data__),h[v]=g,Yc(h[v],n,i,v,h,In(m,i)));return new Ai(l,this._parents,n,i)}function cR(t){var n=this._name,i=this._id;typeof t!="function"&&(t=lS(t));for(var o=this._groups,s=o.length,l=[],c=[],f=0;f<s;++f)for(var d=o[f],h=d.length,m,g=0;g<h;++g)if(m=d[g]){for(var v=t.call(m,m.__data__,g,d),x,b=In(m,i),_=0,T=v.length;_<T;++_)(x=v[_])&&Yc(x,n,i,_,v,b);l.push(v),c.push(m)}return new Ai(l,c,n,i)}var fR=ol.prototype.constructor;function dR(){return new fR(this._groups,this._parents)}function hR(t,n){var i,o,s;return function(){var l=fa(this,t),c=(this.style.removeProperty(t),fa(this,t));return l===c?null:l===i&&c===o?s:s=n(i=l,o=c)}}function zS(t){return function(){this.style.removeProperty(t)}}function pR(t,n,i){var o,s=i+"",l;return function(){var c=fa(this,t);return c===s?null:c===o?l:l=n(o=c,i)}}function mR(t,n,i){var o,s,l;return function(){var c=fa(this,t),f=i(this),d=f+"";return f==null&&(d=f=(this.style.removeProperty(t),fa(this,t))),c===d?null:c===o&&d===s?l:(s=d,l=n(o=c,f))}}function gR(t,n){var i,o,s,l="style."+n,c="end."+l,f;return function(){var d=ni(this,t),h=d.on,m=d.value[l]==null?f||(f=zS(n)):void 0;(h!==i||s!==m)&&(o=(i=h).copy()).on(c,s=m),d.on=o}}function yR(t,n,i){var o=(t+="")=="transform"?vA:OS;return n==null?this.styleTween(t,hR(t,o)).on("end.style."+t,zS(t)):typeof n=="function"?this.styleTween(t,mR(t,o,ym(this,"style."+t,n))).each(gR(this._id,t)):this.styleTween(t,pR(t,o,n),i).on("end.style."+t,null)}function vR(t,n,i){return function(o){this.style.setProperty(t,n.call(this,o),i)}}function xR(t,n,i){var o,s;function l(){var c=n.apply(this,arguments);return c!==s&&(o=(s=c)&&vR(t,c,i)),o}return l._value=n,l}function bR(t,n,i){var o="style."+(t+="");if(arguments.length<2)return(o=this.tween(o))&&o._value;if(n==null)return this.tween(o,null);if(typeof n!="function")throw new Error;return this.tween(o,xR(t,n,i??""))}function SR(t){return function(){this.textContent=t}}function wR(t){return function(){var n=t(this);this.textContent=n??""}}function ER(t){return this.tween("text",typeof t=="function"?wR(ym(this,"text",t)):SR(t==null?"":t+""))}function _R(t){return function(n){this.textContent=t.call(this,n)}}function CR(t){var n,i;function o(){var s=t.apply(this,arguments);return s!==i&&(n=(i=s)&&_R(s)),n}return o._value=t,o}function TR(t){var n="text";if(arguments.length<1)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!="function")throw new Error;return this.tween(n,CR(t))}function MR(){for(var t=this._name,n=this._id,i=DS(),o=this._groups,s=o.length,l=0;l<s;++l)for(var c=o[l],f=c.length,d,h=0;h<f;++h)if(d=c[h]){var m=In(d,n);Yc(d,t,i,h,c,{time:m.time+m.delay+m.duration,delay:0,duration:m.duration,ease:m.ease})}return new Ai(o,this._parents,t,i)}function NR(){var t,n,i=this,o=i._id,s=i.size();return new Promise(function(l,c){var f={value:c},d={value:function(){--s===0&&l()}};i.each(function(){var h=ni(this,o),m=h.on;m!==t&&(n=(t=m).copy(),n._.cancel.push(f),n._.interrupt.push(f),n._.end.push(d)),h.on=n}),s===0&&l()})}var kR=0;function Ai(t,n,i,o){this._groups=t,this._parents=n,this._name=i,this._id=o}function DS(){return++kR}var _i=ol.prototype;Ai.prototype={constructor:Ai,select:uR,selectAll:cR,selectChild:_i.selectChild,selectChildren:_i.selectChildren,filter:nR,merge:iR,selection:dR,transition:MR,call:_i.call,nodes:_i.nodes,node:_i.node,size:_i.size,empty:_i.empty,each:_i.each,on:aR,attr:IA,attrTween:YA,style:yR,styleTween:bR,text:ER,textTween:TR,remove:lR,tween:zA,delay:QA,duration:KA,ease:WA,easeVarying:eR,end:NR,[Symbol.iterator]:_i[Symbol.iterator]};function AR(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}var RR={time:null,delay:0,duration:250,ease:AR};function OR(t,n){for(var i;!(i=t.__transition)||!(i=i[n]);)if(!(t=t.parentNode))throw new Error(`transition ${n} not found`);return i}function zR(t){var n,i;t instanceof Ai?(n=t._id,t=t._name):(n=DS(),(i=RR).time=mm(),t=t==null?null:t+"");for(var o=this._groups,s=o.length,l=0;l<s;++l)for(var c=o[l],f=c.length,d,h=0;h<f;++h)(d=c[h])&&Yc(d,t,n,h,c,i||OR(d,n));return new Ai(o,this._parents,t,n)}ol.prototype.interrupt=AA;ol.prototype.transition=zR;const Yu=t=>()=>t;function DR(t,{sourceEvent:n,target:i,transform:o,dispatch:s}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:n,enumerable:!0,configurable:!0},target:{value:i,enumerable:!0,configurable:!0},transform:{value:o,enumerable:!0,configurable:!0},_:{value:s}})}function Ni(t,n,i){this.k=t,this.x=n,this.y=i}Ni.prototype={constructor:Ni,scale:function(t){return t===1?this:new Ni(this.k*t,this.x,this.y)},translate:function(t,n){return t===0&n===0?this:new Ni(this.k,this.x+this.k*t,this.y+this.k*n)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var Xc=new Ni(1,0,0);LS.prototype=Ni.prototype;function LS(t){for(;!t.__zoom;)if(!(t=t.parentNode))return Xc;return t.__zoom}function qh(t){t.stopImmediatePropagation()}function ws(t){t.preventDefault(),t.stopImmediatePropagation()}function LR(t){return(!t.ctrlKey||t.type==="wheel")&&!t.button}function jR(){var t=this;return t instanceof SVGElement?(t=t.ownerSVGElement||t,t.hasAttribute("viewBox")?(t=t.viewBox.baseVal,[[t.x,t.y],[t.x+t.width,t.y+t.height]]):[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]):[[0,0],[t.clientWidth,t.clientHeight]]}function Ix(){return this.__zoom||Xc}function BR(t){return-t.deltaY*(t.deltaMode===1?.05:t.deltaMode?1:.002)*(t.ctrlKey?10:1)}function HR(){return navigator.maxTouchPoints||"ontouchstart"in this}function PR(t,n,i){var o=t.invertX(n[0][0])-i[0][0],s=t.invertX(n[1][0])-i[1][0],l=t.invertY(n[0][1])-i[0][1],c=t.invertY(n[1][1])-i[1][1];return t.translate(s>o?(o+s)/2:Math.min(0,o)||Math.max(0,s),c>l?(l+c)/2:Math.min(0,l)||Math.max(0,c))}function jS(){var t=LR,n=jR,i=PR,o=BR,s=HR,l=[0,1/0],c=[[-1/0,-1/0],[1/0,1/0]],f=250,d=ac,h=Vc("start","zoom","end"),m,g,v,x=500,b=150,_=0,T=10;function C(D){D.property("__zoom",Ix).on("wheel.zoom",P,{passive:!1}).on("mousedown.zoom",q).on("dblclick.zoom",J).filter(s).on("touchstart.zoom",j).on("touchmove.zoom",V).on("touchend.zoom touchcancel.zoom",K).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}C.transform=function(D,I,O,U){var G=D.selection?D.selection():D;G.property("__zoom",Ix),D!==G?H(D,I,O,U):G.interrupt().each(function(){R(this,arguments).event(U).start().zoom(null,typeof I=="function"?I.apply(this,arguments):I).end()})},C.scaleBy=function(D,I,O,U){C.scaleTo(D,function(){var G=this.__zoom.k,$=typeof I=="function"?I.apply(this,arguments):I;return G*$},O,U)},C.scaleTo=function(D,I,O,U){C.transform(D,function(){var G=n.apply(this,arguments),$=this.__zoom,k=O==null?M(G):typeof O=="function"?O.apply(this,arguments):O,L=$.invert(k),X=typeof I=="function"?I.apply(this,arguments):I;return i(E(z($,X),k,L),G,c)},O,U)},C.translateBy=function(D,I,O,U){C.transform(D,function(){return i(this.__zoom.translate(typeof I=="function"?I.apply(this,arguments):I,typeof O=="function"?O.apply(this,arguments):O),n.apply(this,arguments),c)},null,U)},C.translateTo=function(D,I,O,U,G){C.transform(D,function(){var $=n.apply(this,arguments),k=this.__zoom,L=U==null?M($):typeof U=="function"?U.apply(this,arguments):U;return i(Xc.translate(L[0],L[1]).scale(k.k).translate(typeof I=="function"?-I.apply(this,arguments):-I,typeof O=="function"?-O.apply(this,arguments):-O),$,c)},U,G)};function z(D,I){return I=Math.max(l[0],Math.min(l[1],I)),I===D.k?D:new Ni(I,D.x,D.y)}function E(D,I,O){var U=I[0]-O[0]*D.k,G=I[1]-O[1]*D.k;return U===D.x&&G===D.y?D:new Ni(D.k,U,G)}function M(D){return[(+D[0][0]+ +D[1][0])/2,(+D[0][1]+ +D[1][1])/2]}function H(D,I,O,U){D.on("start.zoom",function(){R(this,arguments).event(U).start()}).on("interrupt.zoom end.zoom",function(){R(this,arguments).event(U).end()}).tween("zoom",function(){var G=this,$=arguments,k=R(G,$).event(U),L=n.apply(G,$),X=O==null?M(L):typeof O=="function"?O.apply(G,$):O,A=Math.max(L[1][0]-L[0][0],L[1][1]-L[0][1]),it=G.__zoom,ct=typeof I=="function"?I.apply(G,$):I,ft=d(it.invert(X).concat(A/it.k),ct.invert(X).concat(A/ct.k));return function(dt){if(dt===1)dt=ct;else{var lt=ft(dt),pt=A/lt[2];dt=new Ni(pt,X[0]-lt[0]*pt,X[1]-lt[1]*pt)}k.zoom(null,dt)}})}function R(D,I,O){return!O&&D.__zooming||new B(D,I)}function B(D,I){this.that=D,this.args=I,this.active=0,this.sourceEvent=null,this.extent=n.apply(D,I),this.taps=0}B.prototype={event:function(D){return D&&(this.sourceEvent=D),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(D,I){return this.mouse&&D!=="mouse"&&(this.mouse[1]=I.invert(this.mouse[0])),this.touch0&&D!=="touch"&&(this.touch0[1]=I.invert(this.touch0[0])),this.touch1&&D!=="touch"&&(this.touch1[1]=I.invert(this.touch1[0])),this.that.__zoom=I,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(D){var I=cn(this.that).datum();h.call(D,this.that,new DR(D,{sourceEvent:this.sourceEvent,target:C,transform:this.that.__zoom,dispatch:h}),I)}};function P(D,...I){if(!t.apply(this,arguments))return;var O=R(this,I).event(D),U=this.__zoom,G=Math.max(l[0],Math.min(l[1],U.k*Math.pow(2,o.apply(this,arguments)))),$=jn(D);if(O.wheel)(O.mouse[0][0]!==$[0]||O.mouse[0][1]!==$[1])&&(O.mouse[1]=U.invert(O.mouse[0]=$)),clearTimeout(O.wheel);else{if(U.k===G)return;O.mouse=[$,U.invert($)],uc(this),O.start()}ws(D),O.wheel=setTimeout(k,b),O.zoom("mouse",i(E(z(U,G),O.mouse[0],O.mouse[1]),O.extent,c));function k(){O.wheel=null,O.end()}}function q(D,...I){if(v||!t.apply(this,arguments))return;var O=D.currentTarget,U=R(this,I,!0).event(D),G=cn(D.view).on("mousemove.zoom",X,!0).on("mouseup.zoom",A,!0),$=jn(D,O),k=D.clientX,L=D.clientY;xS(D.view),qh(D),U.mouse=[$,this.__zoom.invert($)],uc(this),U.start();function X(it){if(ws(it),!U.moved){var ct=it.clientX-k,ft=it.clientY-L;U.moved=ct*ct+ft*ft>_}U.event(it).zoom("mouse",i(E(U.that.__zoom,U.mouse[0]=jn(it,O),U.mouse[1]),U.extent,c))}function A(it){G.on("mousemove.zoom mouseup.zoom",null),bS(it.view,U.moved),ws(it),U.event(it).end()}}function J(D,...I){if(t.apply(this,arguments)){var O=this.__zoom,U=jn(D.changedTouches?D.changedTouches[0]:D,this),G=O.invert(U),$=O.k*(D.shiftKey?.5:2),k=i(E(z(O,$),U,G),n.apply(this,I),c);ws(D),f>0?cn(this).transition().duration(f).call(H,k,U,D):cn(this).call(C.transform,k,U,D)}}function j(D,...I){if(t.apply(this,arguments)){var O=D.touches,U=O.length,G=R(this,I,D.changedTouches.length===U).event(D),$,k,L,X;for(qh(D),k=0;k<U;++k)L=O[k],X=jn(L,this),X=[X,this.__zoom.invert(X),L.identifier],G.touch0?!G.touch1&&G.touch0[2]!==X[2]&&(G.touch1=X,G.taps=0):(G.touch0=X,$=!0,G.taps=1+!!m);m&&(m=clearTimeout(m)),$&&(G.taps<2&&(g=X[0],m=setTimeout(function(){m=null},x)),uc(this),G.start())}}function V(D,...I){if(this.__zooming){var O=R(this,I).event(D),U=D.changedTouches,G=U.length,$,k,L,X;for(ws(D),$=0;$<G;++$)k=U[$],L=jn(k,this),O.touch0&&O.touch0[2]===k.identifier?O.touch0[0]=L:O.touch1&&O.touch1[2]===k.identifier&&(O.touch1[0]=L);if(k=O.that.__zoom,O.touch1){var A=O.touch0[0],it=O.touch0[1],ct=O.touch1[0],ft=O.touch1[1],dt=(dt=ct[0]-A[0])*dt+(dt=ct[1]-A[1])*dt,lt=(lt=ft[0]-it[0])*lt+(lt=ft[1]-it[1])*lt;k=z(k,Math.sqrt(dt/lt)),L=[(A[0]+ct[0])/2,(A[1]+ct[1])/2],X=[(it[0]+ft[0])/2,(it[1]+ft[1])/2]}else if(O.touch0)L=O.touch0[0],X=O.touch0[1];else return;O.zoom("touch",i(E(k,L,X),O.extent,c))}}function K(D,...I){if(this.__zooming){var O=R(this,I).event(D),U=D.changedTouches,G=U.length,$,k;for(qh(D),v&&clearTimeout(v),v=setTimeout(function(){v=null},x),$=0;$<G;++$)k=U[$],O.touch0&&O.touch0[2]===k.identifier?delete O.touch0:O.touch1&&O.touch1[2]===k.identifier&&delete O.touch1;if(O.touch1&&!O.touch0&&(O.touch0=O.touch1,delete O.touch1),O.touch0)O.touch0[1]=this.__zoom.invert(O.touch0[0]);else if(O.end(),O.taps===2&&(k=jn(k,this),Math.hypot(g[0]-k[0],g[1]-k[1])<T)){var L=cn(this).on("dblclick.zoom");L&&L.apply(this,arguments)}}}return C.wheelDelta=function(D){return arguments.length?(o=typeof D=="function"?D:Yu(+D),C):o},C.filter=function(D){return arguments.length?(t=typeof D=="function"?D:Yu(!!D),C):t},C.touchable=function(D){return arguments.length?(s=typeof D=="function"?D:Yu(!!D),C):s},C.extent=function(D){return arguments.length?(n=typeof D=="function"?D:Yu([[+D[0][0],+D[0][1]],[+D[1][0],+D[1][1]]]),C):n},C.scaleExtent=function(D){return arguments.length?(l[0]=+D[0],l[1]=+D[1],C):[l[0],l[1]]},C.translateExtent=function(D){return arguments.length?(c[0][0]=+D[0][0],c[1][0]=+D[1][0],c[0][1]=+D[0][1],c[1][1]=+D[1][1],C):[[c[0][0],c[0][1]],[c[1][0],c[1][1]]]},C.constrain=function(D){return arguments.length?(i=D,C):i},C.duration=function(D){return arguments.length?(f=+D,C):f},C.interpolate=function(D){return arguments.length?(d=D,C):d},C.on=function(){var D=h.on.apply(h,arguments);return D===h?C:D},C.clickDistance=function(D){return arguments.length?(_=(D=+D)*D,C):Math.sqrt(_)},C.tapDistance=function(D){return arguments.length?(T=+D,C):T},C}const ti={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:t=>`Node type "${t}" 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:t=>`The old edge with id=${t} does not exist.`,error009:t=>`Marker type "${t}" doesn't exist.`,error008:(t,{id:n,sourceHandle:i,targetHandle:o})=>`Couldn't create edge for ${t} handle id: "${t==="source"?i:o}", edge id: ${n}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:t=>`Edge type "${t}" not found. Using fallback type "default".`,error012:t=>`Node with id "${t}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(t="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${t}/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."},Zs=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],BS=["Enter"," ","Escape"],HS={"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:t,x:n,y:i})=>`Moved selected node ${t}. New position, x: ${n}, y: ${i}`,"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 ha;(function(t){t.Strict="strict",t.Loose="loose"})(ha||(ha={}));var Qr;(function(t){t.Free="free",t.Vertical="vertical",t.Horizontal="horizontal"})(Qr||(Qr={}));var Ks;(function(t){t.Partial="partial",t.Full="full"})(Ks||(Ks={}));const PS={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var cr;(function(t){t.Bezier="default",t.Straight="straight",t.Step="step",t.SmoothStep="smoothstep",t.SimpleBezier="simplebezier"})(cr||(cr={}));var Mc;(function(t){t.Arrow="arrow",t.ArrowClosed="arrowclosed"})(Mc||(Mc={}));var bt;(function(t){t.Left="left",t.Top="top",t.Right="right",t.Bottom="bottom"})(bt||(bt={}));const Ux={[bt.Left]:bt.Right,[bt.Right]:bt.Left,[bt.Top]:bt.Bottom,[bt.Bottom]:bt.Top};function IS(t){return t===null?null:t?"valid":"invalid"}const US=t=>"id"in t&&"source"in t&&"target"in t,IR=t=>"id"in t&&"position"in t&&!("source"in t)&&!("target"in t),vm=t=>"id"in t&&"internals"in t&&!("source"in t)&&!("target"in t),sl=(t,n=[0,0])=>{const{width:i,height:o}=Ri(t),s=t.origin??n,l=i*s[0],c=o*s[1];return{x:t.position.x-l,y:t.position.y-c}},UR=(t,n={nodeOrigin:[0,0]})=>{if(t.length===0)return{x:0,y:0,width:0,height:0};const i=t.reduce((o,s)=>{const l=typeof s=="string";let c=!n.nodeLookup&&!l?s:void 0;n.nodeLookup&&(c=l?n.nodeLookup.get(s):vm(s)?s:n.nodeLookup.get(s.id));const f=c?Nc(c,n.nodeOrigin):{x:0,y:0,x2:0,y2:0};return Gc(o,f)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return Qc(i)},ll=(t,n={})=>{let i={x:1/0,y:1/0,x2:-1/0,y2:-1/0},o=!1;return t.forEach(s=>{(n.filter===void 0||n.filter(s))&&(i=Gc(i,Nc(s)),o=!0)}),o?Qc(i):{x:0,y:0,width:0,height:0}},xm=(t,n,[i,o,s]=[0,0,1],l=!1,c=!1)=>{const f={...cl(n,[i,o,s]),width:n.width/s,height:n.height/s},d=[];for(const h of t.values()){const{measured:m,selectable:g=!0,hidden:v=!1}=h;if(c&&!g||v)continue;const x=m.width??h.width??h.initialWidth??null,b=m.height??h.height??h.initialHeight??null,_=Js(f,ma(h)),T=(x??0)*(b??0),C=l&&_>0;(!h.internals.handleBounds||C||_>=T||h.dragging)&&d.push(h)}return d},VR=(t,n)=>{const i=new Set;return t.forEach(o=>{i.add(o.id)}),n.filter(o=>i.has(o.source)||i.has(o.target))};function qR(t,n){const i=new Map,o=n?.nodes?new Set(n.nodes.map(s=>s.id)):null;return t.forEach(s=>{s.measured.width&&s.measured.height&&(n?.includeHiddenNodes||!s.hidden)&&(!o||o.has(s.id))&&i.set(s.id,s)}),i}async function FR({nodes:t,width:n,height:i,panZoom:o,minZoom:s,maxZoom:l},c){if(t.size===0)return Promise.resolve(!0);const f=qR(t,c),d=ll(f),h=bm(d,n,i,c?.minZoom??s,c?.maxZoom??l,c?.padding??.1);return await o.setViewport(h,{duration:c?.duration,ease:c?.ease,interpolate:c?.interpolate}),Promise.resolve(!0)}function VS({nodeId:t,nextPosition:n,nodeLookup:i,nodeOrigin:o=[0,0],nodeExtent:s,onError:l}){const c=i.get(t),f=c.parentId?i.get(c.parentId):void 0,{x:d,y:h}=f?f.internals.positionAbsolute:{x:0,y:0},m=c.origin??o;let g=c.extent||s;if(c.extent==="parent"&&!c.expandParent)if(!f)l?.("005",ti.error005());else{const x=f.measured.width,b=f.measured.height;x&&b&&(g=[[d,h],[d+x,h+b]])}else f&&ga(c.extent)&&(g=[[c.extent[0][0]+d,c.extent[0][1]+h],[c.extent[1][0]+d,c.extent[1][1]+h]]);const v=ga(g)?eo(n,g,c.measured):n;return(c.measured.width===void 0||c.measured.height===void 0)&&l?.("015",ti.error015()),{position:{x:v.x-d+(c.measured.width??0)*m[0],y:v.y-h+(c.measured.height??0)*m[1]},positionAbsolute:v}}async function YR({nodesToRemove:t=[],edgesToRemove:n=[],nodes:i,edges:o,onBeforeDelete:s}){const l=new Set(t.map(v=>v.id)),c=[];for(const v of i){if(v.deletable===!1)continue;const x=l.has(v.id),b=!x&&v.parentId&&c.find(_=>_.id===v.parentId);(x||b)&&c.push(v)}const f=new Set(n.map(v=>v.id)),d=o.filter(v=>v.deletable!==!1),m=VR(c,d);for(const v of d)f.has(v.id)&&!m.find(b=>b.id===v.id)&&m.push(v);if(!s)return{edges:m,nodes:c};const g=await s({nodes:c,edges:m});return typeof g=="boolean"?g?{edges:m,nodes:c}:{edges:[],nodes:[]}:g}const pa=(t,n=0,i=1)=>Math.min(Math.max(t,n),i),eo=(t={x:0,y:0},n,i)=>({x:pa(t.x,n[0][0],n[1][0]-(i?.width??0)),y:pa(t.y,n[0][1],n[1][1]-(i?.height??0))});function qS(t,n,i){const{width:o,height:s}=Ri(i),{x:l,y:c}=i.internals.positionAbsolute;return eo(t,[[l,c],[l+o,c+s]],n)}const Vx=(t,n,i)=>t<n?pa(Math.abs(t-n),1,n)/n:t>i?-pa(Math.abs(t-i),1,n)/n:0,FS=(t,n,i=15,o=40)=>{const s=Vx(t.x,o,n.width-o)*i,l=Vx(t.y,o,n.height-o)*i;return[s,l]},Gc=(t,n)=>({x:Math.min(t.x,n.x),y:Math.min(t.y,n.y),x2:Math.max(t.x2,n.x2),y2:Math.max(t.y2,n.y2)}),Np=({x:t,y:n,width:i,height:o})=>({x:t,y:n,x2:t+i,y2:n+o}),Qc=({x:t,y:n,x2:i,y2:o})=>({x:t,y:n,width:i-t,height:o-n}),ma=(t,n=[0,0])=>{const{x:i,y:o}=vm(t)?t.internals.positionAbsolute:sl(t,n);return{x:i,y:o,width:t.measured?.width??t.width??t.initialWidth??0,height:t.measured?.height??t.height??t.initialHeight??0}},Nc=(t,n=[0,0])=>{const{x:i,y:o}=vm(t)?t.internals.positionAbsolute:sl(t,n);return{x:i,y:o,x2:i+(t.measured?.width??t.width??t.initialWidth??0),y2:o+(t.measured?.height??t.height??t.initialHeight??0)}},YS=(t,n)=>Qc(Gc(Np(t),Np(n))),Js=(t,n)=>{const i=Math.max(0,Math.min(t.x+t.width,n.x+n.width)-Math.max(t.x,n.x)),o=Math.max(0,Math.min(t.y+t.height,n.y+n.height)-Math.max(t.y,n.y));return Math.ceil(i*o)},qx=t=>Hn(t.width)&&Hn(t.height)&&Hn(t.x)&&Hn(t.y),Hn=t=>!isNaN(t)&&isFinite(t),XR=(t,n)=>{},ul=(t,n=[1,1])=>({x:n[0]*Math.round(t.x/n[0]),y:n[1]*Math.round(t.y/n[1])}),cl=({x:t,y:n},[i,o,s],l=!1,c=[1,1])=>{const f={x:(t-i)/s,y:(n-o)/s};return l?ul(f,c):f},kc=({x:t,y:n},[i,o,s])=>({x:t*s+i,y:n*s+o});function Xo(t,n){if(typeof t=="number")return Math.floor((n-n/(1+t))*.5);if(typeof t=="string"&&t.endsWith("px")){const i=parseFloat(t);if(!Number.isNaN(i))return Math.floor(i)}if(typeof t=="string"&&t.endsWith("%")){const i=parseFloat(t);if(!Number.isNaN(i))return Math.floor(n*i*.01)}return console.error(`[React Flow] The padding value "${t}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function GR(t,n,i){if(typeof t=="string"||typeof t=="number"){const o=Xo(t,i),s=Xo(t,n);return{top:o,right:s,bottom:o,left:s,x:s*2,y:o*2}}if(typeof t=="object"){const o=Xo(t.top??t.y??0,i),s=Xo(t.bottom??t.y??0,i),l=Xo(t.left??t.x??0,n),c=Xo(t.right??t.x??0,n);return{top:o,right:c,bottom:s,left:l,x:l+c,y:o+s}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function QR(t,n,i,o,s,l){const{x:c,y:f}=kc(t,[n,i,o]),{x:d,y:h}=kc({x:t.x+t.width,y:t.y+t.height},[n,i,o]),m=s-d,g=l-h;return{left:Math.floor(c),top:Math.floor(f),right:Math.floor(m),bottom:Math.floor(g)}}const bm=(t,n,i,o,s,l)=>{const c=GR(l,n,i),f=(n-c.x)/t.width,d=(i-c.y)/t.height,h=Math.min(f,d),m=pa(h,o,s),g=t.x+t.width/2,v=t.y+t.height/2,x=n/2-g*m,b=i/2-v*m,_=QR(t,x,b,m,n,i),T={left:Math.min(_.left-c.left,0),top:Math.min(_.top-c.top,0),right:Math.min(_.right-c.right,0),bottom:Math.min(_.bottom-c.bottom,0)};return{x:x-T.left+T.right,y:b-T.top+T.bottom,zoom:m}},Ws=()=>typeof navigator<"u"&&navigator?.userAgent?.indexOf("Mac")>=0;function ga(t){return t!=null&&t!=="parent"}function Ri(t){return{width:t.measured?.width??t.width??t.initialWidth??0,height:t.measured?.height??t.height??t.initialHeight??0}}function XS(t){return(t.measured?.width??t.width??t.initialWidth)!==void 0&&(t.measured?.height??t.height??t.initialHeight)!==void 0}function GS(t,n={width:0,height:0},i,o,s){const l={...t},c=o.get(i);if(c){const f=c.origin||s;l.x+=c.internals.positionAbsolute.x-(n.width??0)*f[0],l.y+=c.internals.positionAbsolute.y-(n.height??0)*f[1]}return l}function Fx(t,n){if(t.size!==n.size)return!1;for(const i of t)if(!n.has(i))return!1;return!0}function $R(){let t,n;return{promise:new Promise((o,s)=>{t=o,n=s}),resolve:t,reject:n}}function ZR(t){return{...HS,...t||{}}}function Ds(t,{snapGrid:n=[0,0],snapToGrid:i=!1,transform:o,containerBounds:s}){const{x:l,y:c}=Pn(t),f=cl({x:l-(s?.left??0),y:c-(s?.top??0)},o),{x:d,y:h}=i?ul(f,n):f;return{xSnapped:d,ySnapped:h,...f}}const Sm=t=>({width:t.offsetWidth,height:t.offsetHeight}),QS=t=>t?.getRootNode?.()||window?.document,KR=["INPUT","SELECT","TEXTAREA"];function $S(t){const n=t.composedPath?.()?.[0]||t.target;return n?.nodeType!==1?!1:KR.includes(n.nodeName)||n.hasAttribute("contenteditable")||!!n.closest(".nokey")}const ZS=t=>"clientX"in t,Pn=(t,n)=>{const i=ZS(t),o=i?t.clientX:t.touches?.[0].clientX,s=i?t.clientY:t.touches?.[0].clientY;return{x:o-(n?.left??0),y:s-(n?.top??0)}},Yx=(t,n,i,o,s)=>{const l=n.querySelectorAll(`.${t}`);return!l||!l.length?null:Array.from(l).map(c=>{const f=c.getBoundingClientRect();return{id:c.getAttribute("data-handleid"),type:t,nodeId:s,position:c.getAttribute("data-handlepos"),x:(f.left-i.left)/o,y:(f.top-i.top)/o,...Sm(c)}})};function KS({sourceX:t,sourceY:n,targetX:i,targetY:o,sourceControlX:s,sourceControlY:l,targetControlX:c,targetControlY:f}){const d=t*.125+s*.375+c*.375+i*.125,h=n*.125+l*.375+f*.375+o*.125,m=Math.abs(d-t),g=Math.abs(h-n);return[d,h,m,g]}function Xu(t,n){return t>=0?.5*t:n*25*Math.sqrt(-t)}function Xx({pos:t,x1:n,y1:i,x2:o,y2:s,c:l}){switch(t){case bt.Left:return[n-Xu(n-o,l),i];case bt.Right:return[n+Xu(o-n,l),i];case bt.Top:return[n,i-Xu(i-s,l)];case bt.Bottom:return[n,i+Xu(s-i,l)]}}function JS({sourceX:t,sourceY:n,sourcePosition:i=bt.Bottom,targetX:o,targetY:s,targetPosition:l=bt.Top,curvature:c=.25}){const[f,d]=Xx({pos:i,x1:t,y1:n,x2:o,y2:s,c}),[h,m]=Xx({pos:l,x1:o,y1:s,x2:t,y2:n,c}),[g,v,x,b]=KS({sourceX:t,sourceY:n,targetX:o,targetY:s,sourceControlX:f,sourceControlY:d,targetControlX:h,targetControlY:m});return[`M${t},${n} C${f},${d} ${h},${m} ${o},${s}`,g,v,x,b]}function WS({sourceX:t,sourceY:n,targetX:i,targetY:o}){const s=Math.abs(i-t)/2,l=i<t?i+s:i-s,c=Math.abs(o-n)/2,f=o<n?o+c:o-c;return[l,f,s,c]}function JR({sourceNode:t,targetNode:n,selected:i=!1,zIndex:o=0,elevateOnSelect:s=!1,zIndexMode:l="basic"}){if(l==="manual")return o;const c=s&&i?o+1e3:o,f=Math.max(t.parentId||s&&t.selected?t.internals.z:0,n.parentId||s&&n.selected?n.internals.z:0);return c+f}function WR({sourceNode:t,targetNode:n,width:i,height:o,transform:s}){const l=Gc(Nc(t),Nc(n));l.x===l.x2&&(l.x2+=1),l.y===l.y2&&(l.y2+=1);const c={x:-s[0]/s[2],y:-s[1]/s[2],width:i/s[2],height:o/s[2]};return Js(c,Qc(l))>0}const tO=({source:t,sourceHandle:n,target:i,targetHandle:o})=>`xy-edge__${t}${n||""}-${i}${o||""}`,eO=(t,n)=>n.some(i=>i.source===t.source&&i.target===t.target&&(i.sourceHandle===t.sourceHandle||!i.sourceHandle&&!t.sourceHandle)&&(i.targetHandle===t.targetHandle||!i.targetHandle&&!t.targetHandle)),nO=(t,n,i={})=>{if(!t.source||!t.target)return n;const o=i.getEdgeId||tO;let s;return US(t)?s={...t}:s={...t,id:o(t)},eO(s,n)?n:(s.sourceHandle===null&&delete s.sourceHandle,s.targetHandle===null&&delete s.targetHandle,n.concat(s))};function tw({sourceX:t,sourceY:n,targetX:i,targetY:o}){const[s,l,c,f]=WS({sourceX:t,sourceY:n,targetX:i,targetY:o});return[`M ${t},${n}L ${i},${o}`,s,l,c,f]}const Gx={[bt.Left]:{x:-1,y:0},[bt.Right]:{x:1,y:0},[bt.Top]:{x:0,y:-1},[bt.Bottom]:{x:0,y:1}},iO=({source:t,sourcePosition:n=bt.Bottom,target:i})=>n===bt.Left||n===bt.Right?t.x<i.x?{x:1,y:0}:{x:-1,y:0}:t.y<i.y?{x:0,y:1}:{x:0,y:-1},Qx=(t,n)=>Math.sqrt(Math.pow(n.x-t.x,2)+Math.pow(n.y-t.y,2));function rO({source:t,sourcePosition:n=bt.Bottom,target:i,targetPosition:o=bt.Top,center:s,offset:l,stepPosition:c}){const f=Gx[n],d=Gx[o],h={x:t.x+f.x*l,y:t.y+f.y*l},m={x:i.x+d.x*l,y:i.y+d.y*l},g=iO({source:h,sourcePosition:n,target:m}),v=g.x!==0?"x":"y",x=g[v];let b=[],_,T;const C={x:0,y:0},z={x:0,y:0},[,,E,M]=WS({sourceX:t.x,sourceY:t.y,targetX:i.x,targetY:i.y});if(f[v]*d[v]===-1){v==="x"?(_=s.x??h.x+(m.x-h.x)*c,T=s.y??(h.y+m.y)/2):(_=s.x??(h.x+m.x)/2,T=s.y??h.y+(m.y-h.y)*c);const R=[{x:_,y:h.y},{x:_,y:m.y}],B=[{x:h.x,y:T},{x:m.x,y:T}];f[v]===x?b=v==="x"?R:B:b=v==="x"?B:R}else{const R=[{x:h.x,y:m.y}],B=[{x:m.x,y:h.y}];if(v==="x"?b=f.x===x?B:R:b=f.y===x?R:B,n===o){const V=Math.abs(t[v]-i[v]);if(V<=l){const K=Math.min(l-1,l-V);f[v]===x?C[v]=(h[v]>t[v]?-1:1)*K:z[v]=(m[v]>i[v]?-1:1)*K}}if(n!==o){const V=v==="x"?"y":"x",K=f[v]===d[V],D=h[V]>m[V],I=h[V]<m[V];(f[v]===1&&(!K&&D||K&&I)||f[v]!==1&&(!K&&I||K&&D))&&(b=v==="x"?R:B)}const P={x:h.x+C.x,y:h.y+C.y},q={x:m.x+z.x,y:m.y+z.y},J=Math.max(Math.abs(P.x-b[0].x),Math.abs(q.x-b[0].x)),j=Math.max(Math.abs(P.y-b[0].y),Math.abs(q.y-b[0].y));J>=j?(_=(P.x+q.x)/2,T=b[0].y):(_=b[0].x,T=(P.y+q.y)/2)}return[[t,{x:h.x+C.x,y:h.y+C.y},...b,{x:m.x+z.x,y:m.y+z.y},i],_,T,E,M]}function oO(t,n,i,o){const s=Math.min(Qx(t,n)/2,Qx(n,i)/2,o),{x:l,y:c}=n;if(t.x===l&&l===i.x||t.y===c&&c===i.y)return`L${l} ${c}`;if(t.y===c){const h=t.x<i.x?-1:1,m=t.y<i.y?1:-1;return`L ${l+s*h},${c}Q ${l},${c} ${l},${c+s*m}`}const f=t.x<i.x?1:-1,d=t.y<i.y?-1:1;return`L ${l},${c+s*d}Q ${l},${c} ${l+s*f},${c}`}function kp({sourceX:t,sourceY:n,sourcePosition:i=bt.Bottom,targetX:o,targetY:s,targetPosition:l=bt.Top,borderRadius:c=5,centerX:f,centerY:d,offset:h=20,stepPosition:m=.5}){const[g,v,x,b,_]=rO({source:{x:t,y:n},sourcePosition:i,target:{x:o,y:s},targetPosition:l,center:{x:f,y:d},offset:h,stepPosition:m});return[g.reduce((C,z,E)=>{let M="";return E>0&&E<g.length-1?M=oO(g[E-1],z,g[E+1],c):M=`${E===0?"M":"L"}${z.x} ${z.y}`,C+=M,C},""),v,x,b,_]}function $x(t){return t&&!!(t.internals.handleBounds||t.handles?.length)&&!!(t.measured.width||t.width||t.initialWidth)}function aO(t){const{sourceNode:n,targetNode:i}=t;if(!$x(n)||!$x(i))return null;const o=n.internals.handleBounds||Zx(n.handles),s=i.internals.handleBounds||Zx(i.handles),l=Kx(o?.source??[],t.sourceHandle),c=Kx(t.connectionMode===ha.Strict?s?.target??[]:(s?.target??[]).concat(s?.source??[]),t.targetHandle);if(!l||!c)return t.onError?.("008",ti.error008(l?"target":"source",{id:t.id,sourceHandle:t.sourceHandle,targetHandle:t.targetHandle})),null;const f=l?.position||bt.Bottom,d=c?.position||bt.Top,h=no(n,l,f),m=no(i,c,d);return{sourceX:h.x,sourceY:h.y,targetX:m.x,targetY:m.y,sourcePosition:f,targetPosition:d}}function Zx(t){if(!t)return null;const n=[],i=[];for(const o of t)o.width=o.width??1,o.height=o.height??1,o.type==="source"?n.push(o):o.type==="target"&&i.push(o);return{source:n,target:i}}function no(t,n,i=bt.Left,o=!1){const s=(n?.x??0)+t.internals.positionAbsolute.x,l=(n?.y??0)+t.internals.positionAbsolute.y,{width:c,height:f}=n??Ri(t);if(o)return{x:s+c/2,y:l+f/2};switch(n?.position??i){case bt.Top:return{x:s+c/2,y:l};case bt.Right:return{x:s+c,y:l+f/2};case bt.Bottom:return{x:s+c/2,y:l+f};case bt.Left:return{x:s,y:l+f/2}}}function Kx(t,n){return t&&(n?t.find(i=>i.id===n):t[0])||null}function Ap(t,n){return t?typeof t=="string"?t:`${n?`${n}__`:""}${Object.keys(t).sort().map(o=>`${o}=${t[o]}`).join("&")}`:""}function sO(t,{id:n,defaultColor:i,defaultMarkerStart:o,defaultMarkerEnd:s}){const l=new Set;return t.reduce((c,f)=>([f.markerStart||o,f.markerEnd||s].forEach(d=>{if(d&&typeof d=="object"){const h=Ap(d,n);l.has(h)||(c.push({id:h,color:d.color||i,...d}),l.add(h))}}),c),[]).sort((c,f)=>c.id.localeCompare(f.id))}const ew=1e3,lO=10,wm={nodeOrigin:[0,0],nodeExtent:Zs,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},uO={...wm,checkEquality:!0};function Em(t,n){const i={...t};for(const o in n)n[o]!==void 0&&(i[o]=n[o]);return i}function cO(t,n,i){const o=Em(wm,i);for(const s of t.values())if(s.parentId)Cm(s,t,n,o);else{const l=sl(s,o.nodeOrigin),c=ga(s.extent)?s.extent:o.nodeExtent,f=eo(l,c,Ri(s));s.internals.positionAbsolute=f}}function fO(t,n){if(!t.handles)return t.measured?n?.internals.handleBounds:void 0;const i=[],o=[];for(const s of t.handles){const l={id:s.id,width:s.width??1,height:s.height??1,nodeId:t.id,x:s.x,y:s.y,position:s.position,type:s.type};s.type==="source"?i.push(l):s.type==="target"&&o.push(l)}return{source:i,target:o}}function _m(t){return t==="manual"}function Rp(t,n,i,o={}){const s=Em(uO,o),l={i:0},c=new Map(n),f=s?.elevateNodesOnSelect&&!_m(s.zIndexMode)?ew:0;let d=t.length>0;n.clear(),i.clear();for(const h of t){let m=c.get(h.id);if(s.checkEquality&&h===m?.internals.userNode)n.set(h.id,m);else{const g=sl(h,s.nodeOrigin),v=ga(h.extent)?h.extent:s.nodeExtent,x=eo(g,v,Ri(h));m={...s.defaults,...h,measured:{width:h.measured?.width,height:h.measured?.height},internals:{positionAbsolute:x,handleBounds:fO(h,m),z:nw(h,f,s.zIndexMode),userNode:h}},n.set(h.id,m)}(m.measured===void 0||m.measured.width===void 0||m.measured.height===void 0)&&!m.hidden&&(d=!1),h.parentId&&Cm(m,n,i,o,l)}return d}function dO(t,n){if(!t.parentId)return;const i=n.get(t.parentId);i?i.set(t.id,t):n.set(t.parentId,new Map([[t.id,t]]))}function Cm(t,n,i,o,s){const{elevateNodesOnSelect:l,nodeOrigin:c,nodeExtent:f,zIndexMode:d}=Em(wm,o),h=t.parentId,m=n.get(h);if(!m){console.warn(`Parent node ${h} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}dO(t,i),s&&!m.parentId&&m.internals.rootParentIndex===void 0&&d==="auto"&&(m.internals.rootParentIndex=++s.i,m.internals.z=m.internals.z+s.i*lO),s&&m.internals.rootParentIndex!==void 0&&(s.i=m.internals.rootParentIndex);const g=l&&!_m(d)?ew:0,{x:v,y:x,z:b}=hO(t,m,c,f,g,d),{positionAbsolute:_}=t.internals,T=v!==_.x||x!==_.y;(T||b!==t.internals.z)&&n.set(t.id,{...t,internals:{...t.internals,positionAbsolute:T?{x:v,y:x}:_,z:b}})}function nw(t,n,i){const o=Hn(t.zIndex)?t.zIndex:0;return _m(i)?o:o+(t.selected?n:0)}function hO(t,n,i,o,s,l){const{x:c,y:f}=n.internals.positionAbsolute,d=Ri(t),h=sl(t,i),m=ga(t.extent)?eo(h,t.extent,d):h;let g=eo({x:c+m.x,y:f+m.y},o,d);t.extent==="parent"&&(g=qS(g,d,n));const v=nw(t,s,l),x=n.internals.z??0;return{x:g.x,y:g.y,z:x>=v?x+1:v}}function Tm(t,n,i,o=[0,0]){const s=[],l=new Map;for(const c of t){const f=n.get(c.parentId);if(!f)continue;const d=l.get(c.parentId)?.expandedRect??ma(f),h=YS(d,c.rect);l.set(c.parentId,{expandedRect:h,parent:f})}return l.size>0&&l.forEach(({expandedRect:c,parent:f},d)=>{const h=f.internals.positionAbsolute,m=Ri(f),g=f.origin??o,v=c.x<h.x?Math.round(Math.abs(h.x-c.x)):0,x=c.y<h.y?Math.round(Math.abs(h.y-c.y)):0,b=Math.max(m.width,Math.round(c.width)),_=Math.max(m.height,Math.round(c.height)),T=(b-m.width)*g[0],C=(_-m.height)*g[1];(v>0||x>0||T||C)&&(s.push({id:d,type:"position",position:{x:f.position.x-v+T,y:f.position.y-x+C}}),i.get(d)?.forEach(z=>{t.some(E=>E.id===z.id)||s.push({id:z.id,type:"position",position:{x:z.position.x+v,y:z.position.y+x}})})),(m.width<c.width||m.height<c.height||v||x)&&s.push({id:d,type:"dimensions",setAttributes:!0,dimensions:{width:b+(v?g[0]*v-T:0),height:_+(x?g[1]*x-C:0)}})}),s}function pO(t,n,i,o,s,l,c){const f=o?.querySelector(".xyflow__viewport");let d=!1;if(!f)return{changes:[],updatedInternals:d};const h=[],m=window.getComputedStyle(f),{m22:g}=new window.DOMMatrixReadOnly(m.transform),v=[];for(const x of t.values()){const b=n.get(x.id);if(!b)continue;if(b.hidden){n.set(b.id,{...b,internals:{...b.internals,handleBounds:void 0}}),d=!0;continue}const _=Sm(x.nodeElement),T=b.measured.width!==_.width||b.measured.height!==_.height;if(!!(_.width&&_.height&&(T||!b.internals.handleBounds||x.force))){const z=x.nodeElement.getBoundingClientRect(),E=ga(b.extent)?b.extent:l;let{positionAbsolute:M}=b.internals;b.parentId&&b.extent==="parent"?M=qS(M,_,n.get(b.parentId)):E&&(M=eo(M,E,_));const H={...b,measured:_,internals:{...b.internals,positionAbsolute:M,handleBounds:{source:Yx("source",x.nodeElement,z,g,b.id),target:Yx("target",x.nodeElement,z,g,b.id)}}};n.set(b.id,H),b.parentId&&Cm(H,n,i,{nodeOrigin:s,zIndexMode:c}),d=!0,T&&(h.push({id:b.id,type:"dimensions",dimensions:_}),b.expandParent&&b.parentId&&v.push({id:b.id,parentId:b.parentId,rect:ma(H,s)}))}}if(v.length>0){const x=Tm(v,n,i,s);h.push(...x)}return{changes:h,updatedInternals:d}}async function mO({delta:t,panZoom:n,transform:i,translateExtent:o,width:s,height:l}){if(!n||!t.x&&!t.y)return Promise.resolve(!1);const c=await n.setViewportConstrained({x:i[0]+t.x,y:i[1]+t.y,zoom:i[2]},[[0,0],[s,l]],o),f=!!c&&(c.x!==i[0]||c.y!==i[1]||c.k!==i[2]);return Promise.resolve(f)}function Jx(t,n,i,o,s,l){let c=s;const f=o.get(c)||new Map;o.set(c,f.set(i,n)),c=`${s}-${t}`;const d=o.get(c)||new Map;if(o.set(c,d.set(i,n)),l){c=`${s}-${t}-${l}`;const h=o.get(c)||new Map;o.set(c,h.set(i,n))}}function iw(t,n,i){t.clear(),n.clear();for(const o of i){const{source:s,target:l,sourceHandle:c=null,targetHandle:f=null}=o,d={edgeId:o.id,source:s,target:l,sourceHandle:c,targetHandle:f},h=`${s}-${c}--${l}-${f}`,m=`${l}-${f}--${s}-${c}`;Jx("source",d,m,t,s,c),Jx("target",d,h,t,l,f),n.set(o.id,o)}}function rw(t,n){if(!t.parentId)return!1;const i=n.get(t.parentId);return i?i.selected?!0:rw(i,n):!1}function Wx(t,n,i){let o=t;do{if(o?.matches?.(n))return!0;if(o===i)return!1;o=o?.parentElement}while(o);return!1}function gO(t,n,i,o){const s=new Map;for(const[l,c]of t)if((c.selected||c.id===o)&&(!c.parentId||!rw(c,t))&&(c.draggable||n&&typeof c.draggable>"u")){const f=t.get(l);f&&s.set(l,{id:l,position:f.position||{x:0,y:0},distance:{x:i.x-f.internals.positionAbsolute.x,y:i.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 s}function Fh({nodeId:t,dragItems:n,nodeLookup:i,dragging:o=!0}){const s=[];for(const[c,f]of n){const d=i.get(c)?.internals.userNode;d&&s.push({...d,position:f.position,dragging:o})}if(!t)return[s[0],s];const l=i.get(t)?.internals.userNode;return[l?{...l,position:n.get(t)?.position||l.position,dragging:o}:s[0],s]}function yO({dragItems:t,snapGrid:n,x:i,y:o}){const s=t.values().next().value;if(!s)return null;const l={x:i-s.distance.x,y:o-s.distance.y},c=ul(l,n);return{x:c.x-l.x,y:c.y-l.y}}function vO({onNodeMouseDown:t,getStoreItems:n,onDragStart:i,onDrag:o,onDragStop:s}){let l={x:null,y:null},c=0,f=new Map,d=!1,h={x:0,y:0},m=null,g=!1,v=null,x=!1,b=!1,_=null;function T({noDragClassName:z,handleSelector:E,domNode:M,isSelectable:H,nodeId:R,nodeClickDistance:B=0}){v=cn(M);function P({x:V,y:K}){const{nodeLookup:D,nodeExtent:I,snapGrid:O,snapToGrid:U,nodeOrigin:G,onNodeDrag:$,onSelectionDrag:k,onError:L,updateNodePositions:X}=n();l={x:V,y:K};let A=!1;const it=f.size>1,ct=it&&I?Np(ll(f)):null,ft=it&&U?yO({dragItems:f,snapGrid:O,x:V,y:K}):null;for(const[dt,lt]of f){if(!D.has(dt))continue;let pt={x:V-lt.distance.x,y:K-lt.distance.y};U&&(pt=ft?{x:Math.round(pt.x+ft.x),y:Math.round(pt.y+ft.y)}:ul(pt,O));let St=null;if(it&&I&&!lt.extent&&ct){const{positionAbsolute:Et}=lt.internals,Rt=Et.x-ct.x+I[0][0],Ht=Et.x+lt.measured.width-ct.x2+I[1][0],jt=Et.y-ct.y+I[0][1],Qt=Et.y+lt.measured.height-ct.y2+I[1][1];St=[[Rt,jt],[Ht,Qt]]}const{position:wt,positionAbsolute:vt}=VS({nodeId:dt,nextPosition:pt,nodeLookup:D,nodeExtent:St||I,nodeOrigin:G,onError:L});A=A||lt.position.x!==wt.x||lt.position.y!==wt.y,lt.position=wt,lt.internals.positionAbsolute=vt}if(b=b||A,!!A&&(X(f,!0),_&&(o||$||!R&&k))){const[dt,lt]=Fh({nodeId:R,dragItems:f,nodeLookup:D});o?.(_,f,dt,lt),$?.(_,dt,lt),R||k?.(_,lt)}}async function q(){if(!m)return;const{transform:V,panBy:K,autoPanSpeed:D,autoPanOnNodeDrag:I}=n();if(!I){d=!1,cancelAnimationFrame(c);return}const[O,U]=FS(h,m,D);(O!==0||U!==0)&&(l.x=(l.x??0)-O/V[2],l.y=(l.y??0)-U/V[2],await K({x:O,y:U})&&P(l)),c=requestAnimationFrame(q)}function J(V){const{nodeLookup:K,multiSelectionActive:D,nodesDraggable:I,transform:O,snapGrid:U,snapToGrid:G,selectNodesOnDrag:$,onNodeDragStart:k,onSelectionDragStart:L,unselectNodesAndEdges:X}=n();g=!0,(!$||!H)&&!D&&R&&(K.get(R)?.selected||X()),H&&$&&R&&t?.(R);const A=Ds(V.sourceEvent,{transform:O,snapGrid:U,snapToGrid:G,containerBounds:m});if(l=A,f=gO(K,I,A,R),f.size>0&&(i||k||!R&&L)){const[it,ct]=Fh({nodeId:R,dragItems:f,nodeLookup:K});i?.(V.sourceEvent,f,it,ct),k?.(V.sourceEvent,it,ct),R||L?.(V.sourceEvent,ct)}}const j=SS().clickDistance(B).on("start",V=>{const{domNode:K,nodeDragThreshold:D,transform:I,snapGrid:O,snapToGrid:U}=n();m=K?.getBoundingClientRect()||null,x=!1,b=!1,_=V.sourceEvent,D===0&&J(V),l=Ds(V.sourceEvent,{transform:I,snapGrid:O,snapToGrid:U,containerBounds:m}),h=Pn(V.sourceEvent,m)}).on("drag",V=>{const{autoPanOnNodeDrag:K,transform:D,snapGrid:I,snapToGrid:O,nodeDragThreshold:U,nodeLookup:G}=n(),$=Ds(V.sourceEvent,{transform:D,snapGrid:I,snapToGrid:O,containerBounds:m});if(_=V.sourceEvent,(V.sourceEvent.type==="touchmove"&&V.sourceEvent.touches.length>1||R&&!G.has(R))&&(x=!0),!x){if(!d&&K&&g&&(d=!0,q()),!g){const k=Pn(V.sourceEvent,m),L=k.x-h.x,X=k.y-h.y;Math.sqrt(L*L+X*X)>U&&J(V)}(l.x!==$.xSnapped||l.y!==$.ySnapped)&&f&&g&&(h=Pn(V.sourceEvent,m),P($))}}).on("end",V=>{if(!(!g||x)&&(d=!1,g=!1,cancelAnimationFrame(c),f.size>0)){const{nodeLookup:K,updateNodePositions:D,onNodeDragStop:I,onSelectionDragStop:O}=n();if(b&&(D(f,!1),b=!1),s||I||!R&&O){const[U,G]=Fh({nodeId:R,dragItems:f,nodeLookup:K,dragging:!1});s?.(V.sourceEvent,f,U,G),I?.(V.sourceEvent,U,G),R||O?.(V.sourceEvent,G)}}}).filter(V=>{const K=V.target;return!V.button&&(!z||!Wx(K,`.${z}`,M))&&(!E||Wx(K,E,M))});v.call(j)}function C(){v?.on(".drag",null)}return{update:T,destroy:C}}function xO(t,n,i){const o=[],s={x:t.x-i,y:t.y-i,width:i*2,height:i*2};for(const l of n.values())Js(s,ma(l))>0&&o.push(l);return o}const bO=250;function SO(t,n,i,o){let s=[],l=1/0;const c=xO(t,i,n+bO);for(const f of c){const d=[...f.internals.handleBounds?.source??[],...f.internals.handleBounds?.target??[]];for(const h of d){if(o.nodeId===h.nodeId&&o.type===h.type&&o.id===h.id)continue;const{x:m,y:g}=no(f,h,h.position,!0),v=Math.sqrt(Math.pow(m-t.x,2)+Math.pow(g-t.y,2));v>n||(v<l?(s=[{...h,x:m,y:g}],l=v):v===l&&s.push({...h,x:m,y:g}))}}if(!s.length)return null;if(s.length>1){const f=o.type==="source"?"target":"source";return s.find(d=>d.type===f)??s[0]}return s[0]}function ow(t,n,i,o,s,l=!1){const c=o.get(t);if(!c)return null;const f=s==="strict"?c.internals.handleBounds?.[n]:[...c.internals.handleBounds?.source??[],...c.internals.handleBounds?.target??[]],d=(i?f?.find(h=>h.id===i):f?.[0])??null;return d&&l?{...d,...no(c,d,d.position,!0)}:d}function aw(t,n){return t||(n?.classList.contains("target")?"target":n?.classList.contains("source")?"source":null)}function wO(t,n){let i=null;return n?i=!0:t&&!n&&(i=!1),i}const sw=()=>!0;function EO(t,{connectionMode:n,connectionRadius:i,handleId:o,nodeId:s,edgeUpdaterType:l,isTarget:c,domNode:f,nodeLookup:d,lib:h,autoPanOnConnect:m,flowId:g,panBy:v,cancelConnection:x,onConnectStart:b,onConnect:_,onConnectEnd:T,isValidConnection:C=sw,onReconnectEnd:z,updateConnection:E,getTransform:M,getFromHandle:H,autoPanSpeed:R,dragThreshold:B=1,handleDomNode:P}){const q=QS(t.target);let J=0,j;const{x:V,y:K}=Pn(t),D=aw(l,P),I=f?.getBoundingClientRect();let O=!1;if(!I||!D)return;const U=ow(s,D,o,d,n);if(!U)return;let G=Pn(t,I),$=!1,k=null,L=!1,X=null;function A(){if(!m||!I)return;const[wt,vt]=FS(G,I,R);v({x:wt,y:vt}),J=requestAnimationFrame(A)}const it={...U,nodeId:s,type:D,position:U.position},ct=d.get(s);let dt={inProgress:!0,isValid:null,from:no(ct,it,bt.Left,!0),fromHandle:it,fromPosition:it.position,fromNode:ct,to:G,toHandle:null,toPosition:Ux[it.position],toNode:null,pointer:G};function lt(){O=!0,E(dt),b?.(t,{nodeId:s,handleId:o,handleType:D})}B===0&&lt();function pt(wt){if(!O){const{x:Qt,y:Ee}=Pn(wt),ie=Qt-V,Ae=Ee-K;if(!(ie*ie+Ae*Ae>B*B))return;lt()}if(!H()||!it){St(wt);return}const vt=M();G=Pn(wt,I),j=SO(cl(G,vt,!1,[1,1]),i,d,it),$||(A(),$=!0);const Et=lw(wt,{handle:j,connectionMode:n,fromNodeId:s,fromHandleId:o,fromType:c?"target":"source",isValidConnection:C,doc:q,lib:h,flowId:g,nodeLookup:d});X=Et.handleDomNode,k=Et.connection,L=wO(!!j,Et.isValid);const Rt=d.get(s),Ht=Rt?no(Rt,it,bt.Left,!0):dt.from,jt={...dt,from:Ht,isValid:L,to:Et.toHandle&&L?kc({x:Et.toHandle.x,y:Et.toHandle.y},vt):G,toHandle:Et.toHandle,toPosition:L&&Et.toHandle?Et.toHandle.position:Ux[it.position],toNode:Et.toHandle?d.get(Et.toHandle.nodeId):null,pointer:G};E(jt),dt=jt}function St(wt){if(!("touches"in wt&&wt.touches.length>0)){if(O){(j||X)&&k&&L&&_?.(k);const{inProgress:vt,...Et}=dt,Rt={...Et,toPosition:dt.toHandle?dt.toPosition:null};T?.(wt,Rt),l&&z?.(wt,Rt)}x(),cancelAnimationFrame(J),$=!1,L=!1,k=null,X=null,q.removeEventListener("mousemove",pt),q.removeEventListener("mouseup",St),q.removeEventListener("touchmove",pt),q.removeEventListener("touchend",St)}}q.addEventListener("mousemove",pt),q.addEventListener("mouseup",St),q.addEventListener("touchmove",pt),q.addEventListener("touchend",St)}function lw(t,{handle:n,connectionMode:i,fromNodeId:o,fromHandleId:s,fromType:l,doc:c,lib:f,flowId:d,isValidConnection:h=sw,nodeLookup:m}){const g=l==="target",v=n?c.querySelector(`.${f}-flow__handle[data-id="${d}-${n?.nodeId}-${n?.id}-${n?.type}"]`):null,{x,y:b}=Pn(t),_=c.elementFromPoint(x,b),T=_?.classList.contains(`${f}-flow__handle`)?_:v,C={handleDomNode:T,isValid:!1,connection:null,toHandle:null};if(T){const z=aw(void 0,T),E=T.getAttribute("data-nodeid"),M=T.getAttribute("data-handleid"),H=T.classList.contains("connectable"),R=T.classList.contains("connectableend");if(!E||!z)return C;const B={source:g?E:o,sourceHandle:g?M:s,target:g?o:E,targetHandle:g?s:M};C.connection=B;const q=H&&R&&(i===ha.Strict?g&&z==="source"||!g&&z==="target":E!==o||M!==s);C.isValid=q&&h(B),C.toHandle=ow(E,z,M,m,i,!0)}return C}const Op={onPointerDown:EO,isValid:lw};function _O({domNode:t,panZoom:n,getTransform:i,getViewScale:o}){const s=cn(t);function l({translateExtent:f,width:d,height:h,zoomStep:m=1,pannable:g=!0,zoomable:v=!0,inversePan:x=!1}){const b=E=>{if(E.sourceEvent.type!=="wheel"||!n)return;const M=i(),H=E.sourceEvent.ctrlKey&&Ws()?10:1,R=-E.sourceEvent.deltaY*(E.sourceEvent.deltaMode===1?.05:E.sourceEvent.deltaMode?1:.002)*m,B=M[2]*Math.pow(2,R*H);n.scaleTo(B)};let _=[0,0];const T=E=>{(E.sourceEvent.type==="mousedown"||E.sourceEvent.type==="touchstart")&&(_=[E.sourceEvent.clientX??E.sourceEvent.touches[0].clientX,E.sourceEvent.clientY??E.sourceEvent.touches[0].clientY])},C=E=>{const M=i();if(E.sourceEvent.type!=="mousemove"&&E.sourceEvent.type!=="touchmove"||!n)return;const H=[E.sourceEvent.clientX??E.sourceEvent.touches[0].clientX,E.sourceEvent.clientY??E.sourceEvent.touches[0].clientY],R=[H[0]-_[0],H[1]-_[1]];_=H;const B=o()*Math.max(M[2],Math.log(M[2]))*(x?-1:1),P={x:M[0]-R[0]*B,y:M[1]-R[1]*B},q=[[0,0],[d,h]];n.setViewportConstrained({x:P.x,y:P.y,zoom:M[2]},q,f)},z=jS().on("start",T).on("zoom",g?C:null).on("zoom.wheel",v?b:null);s.call(z,{})}function c(){s.on("zoom",null)}return{update:l,destroy:c,pointer:jn}}const $c=t=>({x:t.x,y:t.y,zoom:t.k}),Yh=({x:t,y:n,zoom:i})=>Xc.translate(t,n).scale(i),Ko=(t,n)=>t.target.closest(`.${n}`),uw=(t,n)=>n===2&&Array.isArray(t)&&t.includes(2),CO=t=>((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2,Xh=(t,n=0,i=CO,o=()=>{})=>{const s=typeof n=="number"&&n>0;return s||o(),s?t.transition().duration(n).ease(i).on("end",o):t},cw=t=>{const n=t.ctrlKey&&Ws()?10:1;return-t.deltaY*(t.deltaMode===1?.05:t.deltaMode?1:.002)*n};function TO({zoomPanValues:t,noWheelClassName:n,d3Selection:i,d3Zoom:o,panOnScrollMode:s,panOnScrollSpeed:l,zoomOnPinch:c,onPanZoomStart:f,onPanZoom:d,onPanZoomEnd:h}){return m=>{if(Ko(m,n))return m.ctrlKey&&m.preventDefault(),!1;m.preventDefault(),m.stopImmediatePropagation();const g=i.property("__zoom").k||1;if(m.ctrlKey&&c){const T=jn(m),C=cw(m),z=g*Math.pow(2,C);o.scaleTo(i,z,T,m);return}const v=m.deltaMode===1?20:1;let x=s===Qr.Vertical?0:m.deltaX*v,b=s===Qr.Horizontal?0:m.deltaY*v;!Ws()&&m.shiftKey&&s!==Qr.Vertical&&(x=m.deltaY*v,b=0),o.translateBy(i,-(x/g)*l,-(b/g)*l,{internal:!0});const _=$c(i.property("__zoom"));clearTimeout(t.panScrollTimeout),t.isPanScrolling?(d?.(m,_),t.panScrollTimeout=setTimeout(()=>{h?.(m,_),t.isPanScrolling=!1},150)):(t.isPanScrolling=!0,f?.(m,_))}}function MO({noWheelClassName:t,preventScrolling:n,d3ZoomHandler:i}){return function(o,s){const l=o.type==="wheel",c=!n&&l&&!o.ctrlKey,f=Ko(o,t);if(o.ctrlKey&&l&&f&&o.preventDefault(),c||f)return null;o.preventDefault(),i.call(this,o,s)}}function NO({zoomPanValues:t,onDraggingChange:n,onPanZoomStart:i}){return o=>{if(o.sourceEvent?.internal)return;const s=$c(o.transform);t.mouseButton=o.sourceEvent?.button||0,t.isZoomingOrPanning=!0,t.prevViewport=s,o.sourceEvent?.type==="mousedown"&&n(!0),i&&i?.(o.sourceEvent,s)}}function kO({zoomPanValues:t,panOnDrag:n,onPaneContextMenu:i,onTransformChange:o,onPanZoom:s}){return l=>{t.usedRightMouseButton=!!(i&&uw(n,t.mouseButton??0)),l.sourceEvent?.sync||o([l.transform.x,l.transform.y,l.transform.k]),s&&!l.sourceEvent?.internal&&s?.(l.sourceEvent,$c(l.transform))}}function AO({zoomPanValues:t,panOnDrag:n,panOnScroll:i,onDraggingChange:o,onPanZoomEnd:s,onPaneContextMenu:l}){return c=>{if(!c.sourceEvent?.internal&&(t.isZoomingOrPanning=!1,l&&uw(n,t.mouseButton??0)&&!t.usedRightMouseButton&&c.sourceEvent&&l(c.sourceEvent),t.usedRightMouseButton=!1,o(!1),s)){const f=$c(c.transform);t.prevViewport=f,clearTimeout(t.timerId),t.timerId=setTimeout(()=>{s?.(c.sourceEvent,f)},i?150:0)}}}function RO({zoomActivationKeyPressed:t,zoomOnScroll:n,zoomOnPinch:i,panOnDrag:o,panOnScroll:s,zoomOnDoubleClick:l,userSelectionActive:c,noWheelClassName:f,noPanClassName:d,lib:h,connectionInProgress:m}){return g=>{const v=t||n,x=i&&g.ctrlKey,b=g.type==="wheel";if(g.button===1&&g.type==="mousedown"&&(Ko(g,`${h}-flow__node`)||Ko(g,`${h}-flow__edge`)))return!0;if(!o&&!v&&!s&&!l&&!i||c||m&&!b||Ko(g,f)&&b||Ko(g,d)&&(!b||s&&b&&!t)||!i&&g.ctrlKey&&b)return!1;if(!i&&g.type==="touchstart"&&g.touches?.length>1)return g.preventDefault(),!1;if(!v&&!s&&!x&&b||!o&&(g.type==="mousedown"||g.type==="touchstart")||Array.isArray(o)&&!o.includes(g.button)&&g.type==="mousedown")return!1;const _=Array.isArray(o)&&o.includes(g.button)||!g.button||g.button<=1;return(!g.ctrlKey||b)&&_}}function OO({domNode:t,minZoom:n,maxZoom:i,translateExtent:o,viewport:s,onPanZoom:l,onPanZoomStart:c,onPanZoomEnd:f,onDraggingChange:d}){const h={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},m=t.getBoundingClientRect(),g=jS().scaleExtent([n,i]).translateExtent(o),v=cn(t).call(g);z({x:s.x,y:s.y,zoom:pa(s.zoom,n,i)},[[0,0],[m.width,m.height]],o);const x=v.on("wheel.zoom"),b=v.on("dblclick.zoom");g.wheelDelta(cw);function _(j,V){return v?new Promise(K=>{g?.interpolate(V?.interpolate==="linear"?zs:ac).transform(Xh(v,V?.duration,V?.ease,()=>K(!0)),j)}):Promise.resolve(!1)}function T({noWheelClassName:j,noPanClassName:V,onPaneContextMenu:K,userSelectionActive:D,panOnScroll:I,panOnDrag:O,panOnScrollMode:U,panOnScrollSpeed:G,preventScrolling:$,zoomOnPinch:k,zoomOnScroll:L,zoomOnDoubleClick:X,zoomActivationKeyPressed:A,lib:it,onTransformChange:ct,connectionInProgress:ft,paneClickDistance:dt,selectionOnDrag:lt}){D&&!h.isZoomingOrPanning&&C();const pt=I&&!A&&!D;g.clickDistance(lt?1/0:!Hn(dt)||dt<0?0:dt);const St=pt?TO({zoomPanValues:h,noWheelClassName:j,d3Selection:v,d3Zoom:g,panOnScrollMode:U,panOnScrollSpeed:G,zoomOnPinch:k,onPanZoomStart:c,onPanZoom:l,onPanZoomEnd:f}):MO({noWheelClassName:j,preventScrolling:$,d3ZoomHandler:x});if(v.on("wheel.zoom",St,{passive:!1}),!D){const vt=NO({zoomPanValues:h,onDraggingChange:d,onPanZoomStart:c});g.on("start",vt);const Et=kO({zoomPanValues:h,panOnDrag:O,onPaneContextMenu:!!K,onPanZoom:l,onTransformChange:ct});g.on("zoom",Et);const Rt=AO({zoomPanValues:h,panOnDrag:O,panOnScroll:I,onPaneContextMenu:K,onPanZoomEnd:f,onDraggingChange:d});g.on("end",Rt)}const wt=RO({zoomActivationKeyPressed:A,panOnDrag:O,zoomOnScroll:L,panOnScroll:I,zoomOnDoubleClick:X,zoomOnPinch:k,userSelectionActive:D,noPanClassName:V,noWheelClassName:j,lib:it,connectionInProgress:ft});g.filter(wt),X?v.on("dblclick.zoom",b):v.on("dblclick.zoom",null)}function C(){g.on("zoom",null)}async function z(j,V,K){const D=Yh(j),I=g?.constrain()(D,V,K);return I&&await _(I),new Promise(O=>O(I))}async function E(j,V){const K=Yh(j);return await _(K,V),new Promise(D=>D(K))}function M(j){if(v){const V=Yh(j),K=v.property("__zoom");(K.k!==j.zoom||K.x!==j.x||K.y!==j.y)&&g?.transform(v,V,null,{sync:!0})}}function H(){const j=v?LS(v.node()):{x:0,y:0,k:1};return{x:j.x,y:j.y,zoom:j.k}}function R(j,V){return v?new Promise(K=>{g?.interpolate(V?.interpolate==="linear"?zs:ac).scaleTo(Xh(v,V?.duration,V?.ease,()=>K(!0)),j)}):Promise.resolve(!1)}function B(j,V){return v?new Promise(K=>{g?.interpolate(V?.interpolate==="linear"?zs:ac).scaleBy(Xh(v,V?.duration,V?.ease,()=>K(!0)),j)}):Promise.resolve(!1)}function P(j){g?.scaleExtent(j)}function q(j){g?.translateExtent(j)}function J(j){const V=!Hn(j)||j<0?0:j;g?.clickDistance(V)}return{update:T,destroy:C,setViewport:E,setViewportConstrained:z,getViewport:H,scaleTo:R,scaleBy:B,setScaleExtent:P,setTranslateExtent:q,syncViewport:M,setClickDistance:J}}var ya;(function(t){t.Line="line",t.Handle="handle"})(ya||(ya={}));function zO({width:t,prevWidth:n,height:i,prevHeight:o,affectsX:s,affectsY:l}){const c=t-n,f=i-o,d=[c>0?1:c<0?-1:0,f>0?1:f<0?-1:0];return c&&s&&(d[0]=d[0]*-1),f&&l&&(d[1]=d[1]*-1),d}function tb(t){const n=t.includes("right")||t.includes("left"),i=t.includes("bottom")||t.includes("top"),o=t.includes("left"),s=t.includes("top");return{isHorizontal:n,isVertical:i,affectsX:o,affectsY:s}}function ar(t,n){return Math.max(0,n-t)}function sr(t,n){return Math.max(0,t-n)}function Gu(t,n,i){return Math.max(0,n-t,t-i)}function eb(t,n){return t?!n:n}function DO(t,n,i,o,s,l,c,f){let{affectsX:d,affectsY:h}=n;const{isHorizontal:m,isVertical:g}=n,v=m&&g,{xSnapped:x,ySnapped:b}=i,{minWidth:_,maxWidth:T,minHeight:C,maxHeight:z}=o,{x:E,y:M,width:H,height:R,aspectRatio:B}=t;let P=Math.floor(m?x-t.pointerX:0),q=Math.floor(g?b-t.pointerY:0);const J=H+(d?-P:P),j=R+(h?-q:q),V=-l[0]*H,K=-l[1]*R;let D=Gu(J,_,T),I=Gu(j,C,z);if(c){let G=0,$=0;d&&P<0?G=ar(E+P+V,c[0][0]):!d&&P>0&&(G=sr(E+J+V,c[1][0])),h&&q<0?$=ar(M+q+K,c[0][1]):!h&&q>0&&($=sr(M+j+K,c[1][1])),D=Math.max(D,G),I=Math.max(I,$)}if(f){let G=0,$=0;d&&P>0?G=sr(E+P,f[0][0]):!d&&P<0&&(G=ar(E+J,f[1][0])),h&&q>0?$=sr(M+q,f[0][1]):!h&&q<0&&($=ar(M+j,f[1][1])),D=Math.max(D,G),I=Math.max(I,$)}if(s){if(m){const G=Gu(J/B,C,z)*B;if(D=Math.max(D,G),c){let $=0;!d&&!h||d&&!h&&v?$=sr(M+K+J/B,c[1][1])*B:$=ar(M+K+(d?P:-P)/B,c[0][1])*B,D=Math.max(D,$)}if(f){let $=0;!d&&!h||d&&!h&&v?$=ar(M+J/B,f[1][1])*B:$=sr(M+(d?P:-P)/B,f[0][1])*B,D=Math.max(D,$)}}if(g){const G=Gu(j*B,_,T)/B;if(I=Math.max(I,G),c){let $=0;!d&&!h||h&&!d&&v?$=sr(E+j*B+V,c[1][0])/B:$=ar(E+(h?q:-q)*B+V,c[0][0])/B,I=Math.max(I,$)}if(f){let $=0;!d&&!h||h&&!d&&v?$=ar(E+j*B,f[1][0])/B:$=sr(E+(h?q:-q)*B,f[0][0])/B,I=Math.max(I,$)}}}q=q+(q<0?I:-I),P=P+(P<0?D:-D),s&&(v?J>j*B?q=(eb(d,h)?-P:P)/B:P=(eb(d,h)?-q:q)*B:m?(q=P/B,h=d):(P=q*B,d=h));const O=d?E+P:E,U=h?M+q:M;return{width:H+(d?-P:P),height:R+(h?-q:q),x:l[0]*P*(d?-1:1)+O,y:l[1]*q*(h?-1:1)+U}}const fw={width:0,height:0,x:0,y:0},LO={...fw,pointerX:0,pointerY:0,aspectRatio:1};function jO(t){return[[0,0],[t.measured.width,t.measured.height]]}function BO(t,n,i){const o=n.position.x+t.position.x,s=n.position.y+t.position.y,l=t.measured.width??0,c=t.measured.height??0,f=i[0]*l,d=i[1]*c;return[[o-f,s-d],[o+l-f,s+c-d]]}function HO({domNode:t,nodeId:n,getStoreItems:i,onChange:o,onEnd:s}){const l=cn(t);let c={controlDirection:tb("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function f({controlPosition:h,boundaries:m,keepAspectRatio:g,resizeDirection:v,onResizeStart:x,onResize:b,onResizeEnd:_,shouldResize:T}){let C={...fw},z={...LO};c={boundaries:m,resizeDirection:v,keepAspectRatio:g,controlDirection:tb(h)};let E,M=null,H=[],R,B,P,q=!1;const J=SS().on("start",j=>{const{nodeLookup:V,transform:K,snapGrid:D,snapToGrid:I,nodeOrigin:O,paneDomNode:U}=i();if(E=V.get(n),!E)return;M=U?.getBoundingClientRect()??null;const{xSnapped:G,ySnapped:$}=Ds(j.sourceEvent,{transform:K,snapGrid:D,snapToGrid:I,containerBounds:M});C={width:E.measured.width??0,height:E.measured.height??0,x:E.position.x??0,y:E.position.y??0},z={...C,pointerX:G,pointerY:$,aspectRatio:C.width/C.height},R=void 0,E.parentId&&(E.extent==="parent"||E.expandParent)&&(R=V.get(E.parentId),B=R&&E.extent==="parent"?jO(R):void 0),H=[],P=void 0;for(const[k,L]of V)if(L.parentId===n&&(H.push({id:k,position:{...L.position},extent:L.extent}),L.extent==="parent"||L.expandParent)){const X=BO(L,E,L.origin??O);P?P=[[Math.min(X[0][0],P[0][0]),Math.min(X[0][1],P[0][1])],[Math.max(X[1][0],P[1][0]),Math.max(X[1][1],P[1][1])]]:P=X}x?.(j,{...C})}).on("drag",j=>{const{transform:V,snapGrid:K,snapToGrid:D,nodeOrigin:I}=i(),O=Ds(j.sourceEvent,{transform:V,snapGrid:K,snapToGrid:D,containerBounds:M}),U=[];if(!E)return;const{x:G,y:$,width:k,height:L}=C,X={},A=E.origin??I,{width:it,height:ct,x:ft,y:dt}=DO(z,c.controlDirection,O,c.boundaries,c.keepAspectRatio,A,B,P),lt=it!==k,pt=ct!==L,St=ft!==G&&lt,wt=dt!==$&&pt;if(!St&&!wt&&!lt&&!pt)return;if((St||wt||A[0]===1||A[1]===1)&&(X.x=St?ft:C.x,X.y=wt?dt:C.y,C.x=X.x,C.y=X.y,H.length>0)){const Ht=ft-G,jt=dt-$;for(const Qt of H)Qt.position={x:Qt.position.x-Ht+A[0]*(it-k),y:Qt.position.y-jt+A[1]*(ct-L)},U.push(Qt)}if((lt||pt)&&(X.width=lt&&(!c.resizeDirection||c.resizeDirection==="horizontal")?it:C.width,X.height=pt&&(!c.resizeDirection||c.resizeDirection==="vertical")?ct:C.height,C.width=X.width,C.height=X.height),R&&E.expandParent){const Ht=A[0]*(X.width??0);X.x&&X.x<Ht&&(C.x=Ht,z.x=z.x-(X.x-Ht));const jt=A[1]*(X.height??0);X.y&&X.y<jt&&(C.y=jt,z.y=z.y-(X.y-jt))}const vt=zO({width:C.width,prevWidth:k,height:C.height,prevHeight:L,affectsX:c.controlDirection.affectsX,affectsY:c.controlDirection.affectsY}),Et={...C,direction:vt};T?.(j,Et)!==!1&&(q=!0,b?.(j,Et),o(X,U))}).on("end",j=>{q&&(_?.(j,{...C}),s?.({...C}),q=!1)});l.call(J)}function d(){l.on(".drag",null)}return{update:f,destroy:d}}const PO={},nb=t=>{let n;const i=new Set,o=(m,g)=>{const v=typeof m=="function"?m(n):m;if(!Object.is(v,n)){const x=n;n=g??(typeof v!="object"||v===null)?v:Object.assign({},n,v),i.forEach(b=>b(n,x))}},s=()=>n,d={setState:o,getState:s,getInitialState:()=>h,subscribe:m=>(i.add(m),()=>i.delete(m)),destroy:()=>{(PO?"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."),i.clear()}},h=n=t(o,s,d);return d},IO=t=>t?nb(t):nb,{useDebugValue:UO}=sa,{useSyncExternalStoreWithSelector:VO}=LT,qO=t=>t;function dw(t,n=qO,i){const o=VO(t.subscribe,t.getState,t.getServerState||t.getInitialState,n,i);return UO(o),o}const ib=(t,n)=>{const i=IO(t),o=(s,l=n)=>dw(i,s,l);return Object.assign(o,i),o},FO=(t,n)=>t?ib(t,n):ib;function oe(t,n){if(Object.is(t,n))return!0;if(typeof t!="object"||t===null||typeof n!="object"||n===null)return!1;if(t instanceof Map&&n instanceof Map){if(t.size!==n.size)return!1;for(const[o,s]of t)if(!Object.is(s,n.get(o)))return!1;return!0}if(t instanceof Set&&n instanceof Set){if(t.size!==n.size)return!1;for(const o of t)if(!n.has(o))return!1;return!0}const i=Object.keys(t);if(i.length!==Object.keys(n).length)return!1;for(const o of i)if(!Object.prototype.hasOwnProperty.call(n,o)||!Object.is(t[o],n[o]))return!1;return!0}const Zc=F.createContext(null),YO=Zc.Provider,hw=ti.error001();function It(t,n){const i=F.useContext(Zc);if(i===null)throw new Error(hw);return dw(i,t,n)}function ae(){const t=F.useContext(Zc);if(t===null)throw new Error(hw);return F.useMemo(()=>({getState:t.getState,setState:t.setState,subscribe:t.subscribe}),[t])}const rb={display:"none"},XO={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},pw="react-flow__node-desc",mw="react-flow__edge-desc",GO="react-flow__aria-live",QO=t=>t.ariaLiveMessage,$O=t=>t.ariaLabelConfig;function ZO({rfId:t}){const n=It(QO);return w.jsx("div",{id:`${GO}-${t}`,"aria-live":"assertive","aria-atomic":"true",style:XO,children:n})}function KO({rfId:t,disableKeyboardA11y:n}){const i=It($O);return w.jsxs(w.Fragment,{children:[w.jsx("div",{id:`${pw}-${t}`,style:rb,children:n?i["node.a11yDescription.default"]:i["node.a11yDescription.keyboardDisabled"]}),w.jsx("div",{id:`${mw}-${t}`,style:rb,children:i["edge.a11yDescription.default"]}),!n&&w.jsx(ZO,{rfId:t})]})}const Kc=F.forwardRef(({position:t="top-left",children:n,className:i,style:o,...s},l)=>{const c=`${t}`.split("-");return w.jsx("div",{className:xe(["react-flow__panel",i,...c]),style:o,ref:l,...s,children:n})});Kc.displayName="Panel";function JO({proOptions:t,position:n="bottom-right"}){return t?.hideAttribution?null:w.jsx(Kc,{position:n,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://pro.reactflow.dev",children:w.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const WO=t=>{const n=[],i=[];for(const[,o]of t.nodeLookup)o.selected&&n.push(o.internals.userNode);for(const[,o]of t.edgeLookup)o.selected&&i.push(o);return{selectedNodes:n,selectedEdges:i}},Qu=t=>t.id;function tz(t,n){return oe(t.selectedNodes.map(Qu),n.selectedNodes.map(Qu))&&oe(t.selectedEdges.map(Qu),n.selectedEdges.map(Qu))}function ez({onSelectionChange:t}){const n=ae(),{selectedNodes:i,selectedEdges:o}=It(WO,tz);return F.useEffect(()=>{const s={nodes:i,edges:o};t?.(s),n.getState().onSelectionChangeHandlers.forEach(l=>l(s))},[i,o,t]),null}const nz=t=>!!t.onSelectionChangeHandlers;function iz({onSelectionChange:t}){const n=It(nz);return t||n?w.jsx(ez,{onSelectionChange:t}):null}const gw=[0,0],rz={x:0,y:0,zoom:1},oz=["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"],ob=[...oz,"rfId"],az=t=>({setNodes:t.setNodes,setEdges:t.setEdges,setMinZoom:t.setMinZoom,setMaxZoom:t.setMaxZoom,setTranslateExtent:t.setTranslateExtent,setNodeExtent:t.setNodeExtent,reset:t.reset,setDefaultNodesAndEdges:t.setDefaultNodesAndEdges}),ab={translateExtent:Zs,nodeOrigin:gw,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function sz(t){const{setNodes:n,setEdges:i,setMinZoom:o,setMaxZoom:s,setTranslateExtent:l,setNodeExtent:c,reset:f,setDefaultNodesAndEdges:d}=It(az,oe),h=ae();F.useEffect(()=>(d(t.defaultNodes,t.defaultEdges),()=>{m.current=ab,f()}),[]);const m=F.useRef(ab);return F.useEffect(()=>{for(const g of ob){const v=t[g],x=m.current[g];v!==x&&(typeof t[g]>"u"||(g==="nodes"?n(v):g==="edges"?i(v):g==="minZoom"?o(v):g==="maxZoom"?s(v):g==="translateExtent"?l(v):g==="nodeExtent"?c(v):g==="ariaLabelConfig"?h.setState({ariaLabelConfig:ZR(v)}):g==="fitView"?h.setState({fitViewQueued:v}):g==="fitViewOptions"?h.setState({fitViewOptions:v}):h.setState({[g]:v})))}m.current=t},ob.map(g=>t[g])),null}function sb(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function lz(t){const[n,i]=F.useState(t==="system"?null:t);return F.useEffect(()=>{if(t!=="system"){i(t);return}const o=sb(),s=()=>i(o?.matches?"dark":"light");return s(),o?.addEventListener("change",s),()=>{o?.removeEventListener("change",s)}},[t]),n!==null?n:sb()?.matches?"dark":"light"}const lb=typeof document<"u"?document:null;function tl(t=null,n={target:lb,actInsideInputWithModifier:!0}){const[i,o]=F.useState(!1),s=F.useRef(!1),l=F.useRef(new Set([])),[c,f]=F.useMemo(()=>{if(t!==null){const h=(Array.isArray(t)?t:[t]).filter(g=>typeof g=="string").map(g=>g.replace("+",`
10
+ `).replace(`
11
+
12
+ `,`
13
+ +`).split(`
14
+ `)),m=h.reduce((g,v)=>g.concat(...v),[]);return[h,m]}return[[],[]]},[t]);return F.useEffect(()=>{const d=n?.target??lb,h=n?.actInsideInputWithModifier??!0;if(t!==null){const m=x=>{if(s.current=x.ctrlKey||x.metaKey||x.shiftKey||x.altKey,(!s.current||s.current&&!h)&&$S(x))return!1;const _=cb(x.code,f);if(l.current.add(x[_]),ub(c,l.current,!1)){const T=x.composedPath?.()?.[0]||x.target,C=T?.nodeName==="BUTTON"||T?.nodeName==="A";n.preventDefault!==!1&&(s.current||!C)&&x.preventDefault(),o(!0)}},g=x=>{const b=cb(x.code,f);ub(c,l.current,!0)?(o(!1),l.current.clear()):l.current.delete(x[b]),x.key==="Meta"&&l.current.clear(),s.current=!1},v=()=>{l.current.clear(),o(!1)};return d?.addEventListener("keydown",m),d?.addEventListener("keyup",g),window.addEventListener("blur",v),window.addEventListener("contextmenu",v),()=>{d?.removeEventListener("keydown",m),d?.removeEventListener("keyup",g),window.removeEventListener("blur",v),window.removeEventListener("contextmenu",v)}}},[t,o]),i}function ub(t,n,i){return t.filter(o=>i||o.length===n.size).some(o=>o.every(s=>n.has(s)))}function cb(t,n){return n.includes(t)?"code":"key"}const uz=()=>{const t=ae();return F.useMemo(()=>({zoomIn:n=>{const{panZoom:i}=t.getState();return i?i.scaleBy(1.2,{duration:n?.duration}):Promise.resolve(!1)},zoomOut:n=>{const{panZoom:i}=t.getState();return i?i.scaleBy(1/1.2,{duration:n?.duration}):Promise.resolve(!1)},zoomTo:(n,i)=>{const{panZoom:o}=t.getState();return o?o.scaleTo(n,{duration:i?.duration}):Promise.resolve(!1)},getZoom:()=>t.getState().transform[2],setViewport:async(n,i)=>{const{transform:[o,s,l],panZoom:c}=t.getState();return c?(await c.setViewport({x:n.x??o,y:n.y??s,zoom:n.zoom??l},i),Promise.resolve(!0)):Promise.resolve(!1)},getViewport:()=>{const[n,i,o]=t.getState().transform;return{x:n,y:i,zoom:o}},setCenter:async(n,i,o)=>t.getState().setCenter(n,i,o),fitBounds:async(n,i)=>{const{width:o,height:s,minZoom:l,maxZoom:c,panZoom:f}=t.getState(),d=bm(n,o,s,l,c,i?.padding??.1);return f?(await f.setViewport(d,{duration:i?.duration,ease:i?.ease,interpolate:i?.interpolate}),Promise.resolve(!0)):Promise.resolve(!1)},screenToFlowPosition:(n,i={})=>{const{transform:o,snapGrid:s,snapToGrid:l,domNode:c}=t.getState();if(!c)return n;const{x:f,y:d}=c.getBoundingClientRect(),h={x:n.x-f,y:n.y-d},m=i.snapGrid??s,g=i.snapToGrid??l;return cl(h,o,g,m)},flowToScreenPosition:n=>{const{transform:i,domNode:o}=t.getState();if(!o)return n;const{x:s,y:l}=o.getBoundingClientRect(),c=kc(n,i);return{x:c.x+s,y:c.y+l}}}),[])};function yw(t,n){const i=[],o=new Map,s=[];for(const l of t)if(l.type==="add"){s.push(l);continue}else if(l.type==="remove"||l.type==="replace")o.set(l.id,[l]);else{const c=o.get(l.id);c?c.push(l):o.set(l.id,[l])}for(const l of n){const c=o.get(l.id);if(!c){i.push(l);continue}if(c[0].type==="remove")continue;if(c[0].type==="replace"){i.push({...c[0].item});continue}const f={...l};for(const d of c)cz(d,f);i.push(f)}return s.length&&s.forEach(l=>{l.index!==void 0?i.splice(l.index,0,{...l.item}):i.push({...l.item})}),i}function cz(t,n){switch(t.type){case"select":{n.selected=t.selected;break}case"position":{typeof t.position<"u"&&(n.position=t.position),typeof t.dragging<"u"&&(n.dragging=t.dragging);break}case"dimensions":{typeof t.dimensions<"u"&&(n.measured={...t.dimensions},t.setAttributes&&((t.setAttributes===!0||t.setAttributes==="width")&&(n.width=t.dimensions.width),(t.setAttributes===!0||t.setAttributes==="height")&&(n.height=t.dimensions.height))),typeof t.resizing=="boolean"&&(n.resizing=t.resizing);break}}}function fz(t,n){return yw(t,n)}function dz(t,n){return yw(t,n)}function Pr(t,n){return{id:t,type:"select",selected:n}}function Jo(t,n=new Set,i=!1){const o=[];for(const[s,l]of t){const c=n.has(s);!(l.selected===void 0&&!c)&&l.selected!==c&&(i&&(l.selected=c),o.push(Pr(l.id,c)))}return o}function fb({items:t=[],lookup:n}){const i=[],o=new Map(t.map(s=>[s.id,s]));for(const[s,l]of t.entries()){const c=n.get(l.id),f=c?.internals?.userNode??c;f!==void 0&&f!==l&&i.push({id:l.id,item:l,type:"replace"}),f===void 0&&i.push({item:l,type:"add",index:s})}for(const[s]of n)o.get(s)===void 0&&i.push({id:s,type:"remove"});return i}function db(t){return{id:t.id,type:"remove"}}const hb=t=>IR(t),hz=t=>US(t);function vw(t){return F.forwardRef(t)}const pz=typeof window<"u"?F.useLayoutEffect:F.useEffect;function pb(t){const[n,i]=F.useState(BigInt(0)),[o]=F.useState(()=>mz(()=>i(s=>s+BigInt(1))));return pz(()=>{const s=o.get();s.length&&(t(s),o.reset())},[n]),o}function mz(t){let n=[];return{get:()=>n,reset:()=>{n=[]},push:i=>{n.push(i),t()}}}const xw=F.createContext(null);function gz({children:t}){const n=ae(),i=F.useCallback(f=>{const{nodes:d=[],setNodes:h,hasDefaultNodes:m,onNodesChange:g,nodeLookup:v,fitViewQueued:x,onNodesChangeMiddlewareMap:b}=n.getState();let _=d;for(const C of f)_=typeof C=="function"?C(_):C;let T=fb({items:_,lookup:v});for(const C of b.values())T=C(T);m&&h(_),T.length>0?g?.(T):x&&window.requestAnimationFrame(()=>{const{fitViewQueued:C,nodes:z,setNodes:E}=n.getState();C&&E(z)})},[]),o=pb(i),s=F.useCallback(f=>{const{edges:d=[],setEdges:h,hasDefaultEdges:m,onEdgesChange:g,edgeLookup:v}=n.getState();let x=d;for(const b of f)x=typeof b=="function"?b(x):b;m?h(x):g&&g(fb({items:x,lookup:v}))},[]),l=pb(s),c=F.useMemo(()=>({nodeQueue:o,edgeQueue:l}),[]);return w.jsx(xw.Provider,{value:c,children:t})}function yz(){const t=F.useContext(xw);if(!t)throw new Error("useBatchContext must be used within a BatchProvider");return t}const vz=t=>!!t.panZoom;function Mm(){const t=uz(),n=ae(),i=yz(),o=It(vz),s=F.useMemo(()=>{const l=g=>n.getState().nodeLookup.get(g),c=g=>{i.nodeQueue.push(g)},f=g=>{i.edgeQueue.push(g)},d=g=>{const{nodeLookup:v,nodeOrigin:x}=n.getState(),b=hb(g)?g:v.get(g.id),_=b.parentId?GS(b.position,b.measured,b.parentId,v,x):b.position,T={...b,position:_,width:b.measured?.width??b.width,height:b.measured?.height??b.height};return ma(T)},h=(g,v,x={replace:!1})=>{c(b=>b.map(_=>{if(_.id===g){const T=typeof v=="function"?v(_):v;return x.replace&&hb(T)?T:{..._,...T}}return _}))},m=(g,v,x={replace:!1})=>{f(b=>b.map(_=>{if(_.id===g){const T=typeof v=="function"?v(_):v;return x.replace&&hz(T)?T:{..._,...T}}return _}))};return{getNodes:()=>n.getState().nodes.map(g=>({...g})),getNode:g=>l(g)?.internals.userNode,getInternalNode:l,getEdges:()=>{const{edges:g=[]}=n.getState();return g.map(v=>({...v}))},getEdge:g=>n.getState().edgeLookup.get(g),setNodes:c,setEdges:f,addNodes:g=>{const v=Array.isArray(g)?g:[g];i.nodeQueue.push(x=>[...x,...v])},addEdges:g=>{const v=Array.isArray(g)?g:[g];i.edgeQueue.push(x=>[...x,...v])},toObject:()=>{const{nodes:g=[],edges:v=[],transform:x}=n.getState(),[b,_,T]=x;return{nodes:g.map(C=>({...C})),edges:v.map(C=>({...C})),viewport:{x:b,y:_,zoom:T}}},deleteElements:async({nodes:g=[],edges:v=[]})=>{const{nodes:x,edges:b,onNodesDelete:_,onEdgesDelete:T,triggerNodeChanges:C,triggerEdgeChanges:z,onDelete:E,onBeforeDelete:M}=n.getState(),{nodes:H,edges:R}=await YR({nodesToRemove:g,edgesToRemove:v,nodes:x,edges:b,onBeforeDelete:M}),B=R.length>0,P=H.length>0;if(B){const q=R.map(db);T?.(R),z(q)}if(P){const q=H.map(db);_?.(H),C(q)}return(P||B)&&E?.({nodes:H,edges:R}),{deletedNodes:H,deletedEdges:R}},getIntersectingNodes:(g,v=!0,x)=>{const b=qx(g),_=b?g:d(g),T=x!==void 0;return _?(x||n.getState().nodes).filter(C=>{const z=n.getState().nodeLookup.get(C.id);if(z&&!b&&(C.id===g.id||!z.internals.positionAbsolute))return!1;const E=ma(T?C:z),M=Js(E,_);return v&&M>0||M>=E.width*E.height||M>=_.width*_.height}):[]},isNodeIntersecting:(g,v,x=!0)=>{const _=qx(g)?g:d(g);if(!_)return!1;const T=Js(_,v);return x&&T>0||T>=v.width*v.height||T>=_.width*_.height},updateNode:h,updateNodeData:(g,v,x={replace:!1})=>{h(g,b=>{const _=typeof v=="function"?v(b):v;return x.replace?{...b,data:_}:{...b,data:{...b.data,..._}}},x)},updateEdge:m,updateEdgeData:(g,v,x={replace:!1})=>{m(g,b=>{const _=typeof v=="function"?v(b):v;return x.replace?{...b,data:_}:{...b,data:{...b.data,..._}}},x)},getNodesBounds:g=>{const{nodeLookup:v,nodeOrigin:x}=n.getState();return UR(g,{nodeLookup:v,nodeOrigin:x})},getHandleConnections:({type:g,id:v,nodeId:x})=>Array.from(n.getState().connectionLookup.get(`${x}-${g}${v?`-${v}`:""}`)?.values()??[]),getNodeConnections:({type:g,handleId:v,nodeId:x})=>Array.from(n.getState().connectionLookup.get(`${x}${g?v?`-${g}-${v}`:`-${g}`:""}`)?.values()??[]),fitView:async g=>{const v=n.getState().fitViewResolver??$R();return n.setState({fitViewQueued:!0,fitViewOptions:g,fitViewResolver:v}),i.nodeQueue.push(x=>[...x]),v.promise}}},[]);return F.useMemo(()=>({...s,...t,viewportInitialized:o}),[o])}const mb=t=>t.selected,xz=typeof window<"u"?window:void 0;function bz({deleteKeyCode:t,multiSelectionKeyCode:n}){const i=ae(),{deleteElements:o}=Mm(),s=tl(t,{actInsideInputWithModifier:!1}),l=tl(n,{target:xz});F.useEffect(()=>{if(s){const{edges:c,nodes:f}=i.getState();o({nodes:f.filter(mb),edges:c.filter(mb)}),i.setState({nodesSelectionActive:!1})}},[s]),F.useEffect(()=>{i.setState({multiSelectionActive:l})},[l])}function Sz(t){const n=ae();F.useEffect(()=>{const i=()=>{if(!t.current||!(t.current.checkVisibility?.()??!0))return!1;const o=Sm(t.current);(o.height===0||o.width===0)&&n.getState().onError?.("004",ti.error004()),n.setState({width:o.width||500,height:o.height||500})};if(t.current){i(),window.addEventListener("resize",i);const o=new ResizeObserver(()=>i());return o.observe(t.current),()=>{window.removeEventListener("resize",i),o&&t.current&&o.unobserve(t.current)}}},[])}const Jc={position:"absolute",width:"100%",height:"100%",top:0,left:0},wz=t=>({userSelectionActive:t.userSelectionActive,lib:t.lib,connectionInProgress:t.connection.inProgress});function Ez({onPaneContextMenu:t,zoomOnScroll:n=!0,zoomOnPinch:i=!0,panOnScroll:o=!1,panOnScrollSpeed:s=.5,panOnScrollMode:l=Qr.Free,zoomOnDoubleClick:c=!0,panOnDrag:f=!0,defaultViewport:d,translateExtent:h,minZoom:m,maxZoom:g,zoomActivationKeyCode:v,preventScrolling:x=!0,children:b,noWheelClassName:_,noPanClassName:T,onViewportChange:C,isControlledViewport:z,paneClickDistance:E,selectionOnDrag:M}){const H=ae(),R=F.useRef(null),{userSelectionActive:B,lib:P,connectionInProgress:q}=It(wz,oe),J=tl(v),j=F.useRef();Sz(R);const V=F.useCallback(K=>{C?.({x:K[0],y:K[1],zoom:K[2]}),z||H.setState({transform:K})},[C,z]);return F.useEffect(()=>{if(R.current){j.current=OO({domNode:R.current,minZoom:m,maxZoom:g,translateExtent:h,viewport:d,onDraggingChange:O=>H.setState(U=>U.paneDragging===O?U:{paneDragging:O}),onPanZoomStart:(O,U)=>{const{onViewportChangeStart:G,onMoveStart:$}=H.getState();$?.(O,U),G?.(U)},onPanZoom:(O,U)=>{const{onViewportChange:G,onMove:$}=H.getState();$?.(O,U),G?.(U)},onPanZoomEnd:(O,U)=>{const{onViewportChangeEnd:G,onMoveEnd:$}=H.getState();$?.(O,U),G?.(U)}});const{x:K,y:D,zoom:I}=j.current.getViewport();return H.setState({panZoom:j.current,transform:[K,D,I],domNode:R.current.closest(".react-flow")}),()=>{j.current?.destroy()}}},[]),F.useEffect(()=>{j.current?.update({onPaneContextMenu:t,zoomOnScroll:n,zoomOnPinch:i,panOnScroll:o,panOnScrollSpeed:s,panOnScrollMode:l,zoomOnDoubleClick:c,panOnDrag:f,zoomActivationKeyPressed:J,preventScrolling:x,noPanClassName:T,userSelectionActive:B,noWheelClassName:_,lib:P,onTransformChange:V,connectionInProgress:q,selectionOnDrag:M,paneClickDistance:E})},[t,n,i,o,s,l,c,f,J,x,T,B,_,P,V,q,M,E]),w.jsx("div",{className:"react-flow__renderer",ref:R,style:Jc,children:b})}const _z=t=>({userSelectionActive:t.userSelectionActive,userSelectionRect:t.userSelectionRect});function Cz(){const{userSelectionActive:t,userSelectionRect:n}=It(_z,oe);return t&&n?w.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:n.width,height:n.height,transform:`translate(${n.x}px, ${n.y}px)`}}):null}const Gh=(t,n)=>i=>{i.target===n.current&&t?.(i)},Tz=t=>({userSelectionActive:t.userSelectionActive,elementsSelectable:t.elementsSelectable,connectionInProgress:t.connection.inProgress,dragging:t.paneDragging});function Mz({isSelecting:t,selectionKeyPressed:n,selectionMode:i=Ks.Full,panOnDrag:o,paneClickDistance:s,selectionOnDrag:l,onSelectionStart:c,onSelectionEnd:f,onPaneClick:d,onPaneContextMenu:h,onPaneScroll:m,onPaneMouseEnter:g,onPaneMouseMove:v,onPaneMouseLeave:x,children:b}){const _=ae(),{userSelectionActive:T,elementsSelectable:C,dragging:z,connectionInProgress:E}=It(Tz,oe),M=C&&(t||T),H=F.useRef(null),R=F.useRef(),B=F.useRef(new Set),P=F.useRef(new Set),q=F.useRef(!1),J=G=>{if(q.current||E){q.current=!1;return}d?.(G),_.getState().resetSelectedElements(),_.setState({nodesSelectionActive:!1})},j=G=>{if(Array.isArray(o)&&o?.includes(2)){G.preventDefault();return}h?.(G)},V=m?G=>m(G):void 0,K=G=>{q.current&&(G.stopPropagation(),q.current=!1)},D=G=>{const{domNode:$}=_.getState();if(R.current=$?.getBoundingClientRect(),!R.current)return;const k=G.target===H.current;if(!k&&!!G.target.closest(".nokey")||!t||!(l&&k||n)||G.button!==0||!G.isPrimary)return;G.target?.setPointerCapture?.(G.pointerId),q.current=!1;const{x:A,y:it}=Pn(G.nativeEvent,R.current);_.setState({userSelectionRect:{width:0,height:0,startX:A,startY:it,x:A,y:it}}),k||(G.stopPropagation(),G.preventDefault())},I=G=>{const{userSelectionRect:$,transform:k,nodeLookup:L,edgeLookup:X,connectionLookup:A,triggerNodeChanges:it,triggerEdgeChanges:ct,defaultEdgeOptions:ft,resetSelectedElements:dt}=_.getState();if(!R.current||!$)return;const{x:lt,y:pt}=Pn(G.nativeEvent,R.current),{startX:St,startY:wt}=$;if(!q.current){const jt=n?0:s;if(Math.hypot(lt-St,pt-wt)<=jt)return;dt(),c?.(G)}q.current=!0;const vt={startX:St,startY:wt,x:lt<St?lt:St,y:pt<wt?pt:wt,width:Math.abs(lt-St),height:Math.abs(pt-wt)},Et=B.current,Rt=P.current;B.current=new Set(xm(L,vt,k,i===Ks.Partial,!0).map(jt=>jt.id)),P.current=new Set;const Ht=ft?.selectable??!0;for(const jt of B.current){const Qt=A.get(jt);if(Qt)for(const{edgeId:Ee}of Qt.values()){const ie=X.get(Ee);ie&&(ie.selectable??Ht)&&P.current.add(Ee)}}if(!Fx(Et,B.current)){const jt=Jo(L,B.current,!0);it(jt)}if(!Fx(Rt,P.current)){const jt=Jo(X,P.current);ct(jt)}_.setState({userSelectionRect:vt,userSelectionActive:!0,nodesSelectionActive:!1})},O=G=>{G.button===0&&(G.target?.releasePointerCapture?.(G.pointerId),!T&&G.target===H.current&&_.getState().userSelectionRect&&J?.(G),_.setState({userSelectionActive:!1,userSelectionRect:null}),q.current&&(f?.(G),_.setState({nodesSelectionActive:B.current.size>0})))},U=o===!0||Array.isArray(o)&&o.includes(0);return w.jsxs("div",{className:xe(["react-flow__pane",{draggable:U,dragging:z,selection:t}]),onClick:M?void 0:Gh(J,H),onContextMenu:Gh(j,H),onWheel:Gh(V,H),onPointerEnter:M?void 0:g,onPointerMove:M?I:v,onPointerUp:M?O:void 0,onPointerDownCapture:M?D:void 0,onClickCapture:M?K:void 0,onPointerLeave:x,ref:H,style:Jc,children:[b,w.jsx(Cz,{})]})}function zp({id:t,store:n,unselect:i=!1,nodeRef:o}){const{addSelectedNodes:s,unselectNodesAndEdges:l,multiSelectionActive:c,nodeLookup:f,onError:d}=n.getState(),h=f.get(t);if(!h){d?.("012",ti.error012(t));return}n.setState({nodesSelectionActive:!1}),h.selected?(i||h.selected&&c)&&(l({nodes:[h],edges:[]}),requestAnimationFrame(()=>o?.current?.blur())):s([t])}function bw({nodeRef:t,disabled:n=!1,noDragClassName:i,handleSelector:o,nodeId:s,isSelectable:l,nodeClickDistance:c}){const f=ae(),[d,h]=F.useState(!1),m=F.useRef();return F.useEffect(()=>{m.current=vO({getStoreItems:()=>f.getState(),onNodeMouseDown:g=>{zp({id:g,store:f,nodeRef:t})},onDragStart:()=>{h(!0)},onDragStop:()=>{h(!1)}})},[]),F.useEffect(()=>{if(!(n||!t.current||!m.current))return m.current.update({noDragClassName:i,handleSelector:o,domNode:t.current,isSelectable:l,nodeId:s,nodeClickDistance:c}),()=>{m.current?.destroy()}},[i,o,n,l,t,s,c]),d}const Nz=t=>n=>n.selected&&(n.draggable||t&&typeof n.draggable>"u");function Sw(){const t=ae();return F.useCallback(i=>{const{nodeExtent:o,snapToGrid:s,snapGrid:l,nodesDraggable:c,onError:f,updateNodePositions:d,nodeLookup:h,nodeOrigin:m}=t.getState(),g=new Map,v=Nz(c),x=s?l[0]:5,b=s?l[1]:5,_=i.direction.x*x*i.factor,T=i.direction.y*b*i.factor;for(const[,C]of h){if(!v(C))continue;let z={x:C.internals.positionAbsolute.x+_,y:C.internals.positionAbsolute.y+T};s&&(z=ul(z,l));const{position:E,positionAbsolute:M}=VS({nodeId:C.id,nextPosition:z,nodeLookup:h,nodeExtent:o,nodeOrigin:m,onError:f});C.position=E,C.internals.positionAbsolute=M,g.set(C.id,C)}d(g)},[])}const Nm=F.createContext(null),kz=Nm.Provider;Nm.Consumer;const ww=()=>F.useContext(Nm),Az=t=>({connectOnClick:t.connectOnClick,noPanClassName:t.noPanClassName,rfId:t.rfId}),Rz=(t,n,i)=>o=>{const{connectionClickStartHandle:s,connectionMode:l,connection:c}=o,{fromHandle:f,toHandle:d,isValid:h}=c,m=d?.nodeId===t&&d?.id===n&&d?.type===i;return{connectingFrom:f?.nodeId===t&&f?.id===n&&f?.type===i,connectingTo:m,clickConnecting:s?.nodeId===t&&s?.id===n&&s?.type===i,isPossibleEndHandle:l===ha.Strict?f?.type!==i:t!==f?.nodeId||n!==f?.id,connectionInProcess:!!f,clickConnectionInProcess:!!s,valid:m&&h}};function Oz({type:t="source",position:n=bt.Top,isValidConnection:i,isConnectable:o=!0,isConnectableStart:s=!0,isConnectableEnd:l=!0,id:c,onConnect:f,children:d,className:h,onMouseDown:m,onTouchStart:g,...v},x){const b=c||null,_=t==="target",T=ae(),C=ww(),{connectOnClick:z,noPanClassName:E,rfId:M}=It(Az,oe),{connectingFrom:H,connectingTo:R,clickConnecting:B,isPossibleEndHandle:P,connectionInProcess:q,clickConnectionInProcess:J,valid:j}=It(Rz(C,b,t),oe);C||T.getState().onError?.("010",ti.error010());const V=I=>{const{defaultEdgeOptions:O,onConnect:U,hasDefaultEdges:G}=T.getState(),$={...O,...I};if(G){const{edges:k,setEdges:L}=T.getState();L(nO($,k))}U?.($),f?.($)},K=I=>{if(!C)return;const O=ZS(I.nativeEvent);if(s&&(O&&I.button===0||!O)){const U=T.getState();Op.onPointerDown(I.nativeEvent,{handleDomNode:I.currentTarget,autoPanOnConnect:U.autoPanOnConnect,connectionMode:U.connectionMode,connectionRadius:U.connectionRadius,domNode:U.domNode,nodeLookup:U.nodeLookup,lib:U.lib,isTarget:_,handleId:b,nodeId:C,flowId:U.rfId,panBy:U.panBy,cancelConnection:U.cancelConnection,onConnectStart:U.onConnectStart,onConnectEnd:(...G)=>T.getState().onConnectEnd?.(...G),updateConnection:U.updateConnection,onConnect:V,isValidConnection:i||((...G)=>T.getState().isValidConnection?.(...G)??!0),getTransform:()=>T.getState().transform,getFromHandle:()=>T.getState().connection.fromHandle,autoPanSpeed:U.autoPanSpeed,dragThreshold:U.connectionDragThreshold})}O?m?.(I):g?.(I)},D=I=>{const{onClickConnectStart:O,onClickConnectEnd:U,connectionClickStartHandle:G,connectionMode:$,isValidConnection:k,lib:L,rfId:X,nodeLookup:A,connection:it}=T.getState();if(!C||!G&&!s)return;if(!G){O?.(I.nativeEvent,{nodeId:C,handleId:b,handleType:t}),T.setState({connectionClickStartHandle:{nodeId:C,type:t,id:b}});return}const ct=QS(I.target),ft=i||k,{connection:dt,isValid:lt}=Op.isValid(I.nativeEvent,{handle:{nodeId:C,id:b,type:t},connectionMode:$,fromNodeId:G.nodeId,fromHandleId:G.id||null,fromType:G.type,isValidConnection:ft,flowId:X,doc:ct,lib:L,nodeLookup:A});lt&&dt&&V(dt);const pt=structuredClone(it);delete pt.inProgress,pt.toPosition=pt.toHandle?pt.toHandle.position:null,U?.(I,pt),T.setState({connectionClickStartHandle:null})};return w.jsx("div",{"data-handleid":b,"data-nodeid":C,"data-handlepos":n,"data-id":`${M}-${C}-${b}-${t}`,className:xe(["react-flow__handle",`react-flow__handle-${n}`,"nodrag",E,h,{source:!_,target:_,connectable:o,connectablestart:s,connectableend:l,clickconnecting:B,connectingfrom:H,connectingto:R,valid:j,connectionindicator:o&&(!q||P)&&(q||J?l:s)}]),onMouseDown:K,onTouchStart:K,onClick:z?D:void 0,ref:x,...v,children:d})}const Ac=F.memo(vw(Oz));function zz({data:t,isConnectable:n,sourcePosition:i=bt.Bottom}){return w.jsxs(w.Fragment,{children:[t?.label,w.jsx(Ac,{type:"source",position:i,isConnectable:n})]})}function Dz({data:t,isConnectable:n,targetPosition:i=bt.Top,sourcePosition:o=bt.Bottom}){return w.jsxs(w.Fragment,{children:[w.jsx(Ac,{type:"target",position:i,isConnectable:n}),t?.label,w.jsx(Ac,{type:"source",position:o,isConnectable:n})]})}function Lz(){return null}function jz({data:t,isConnectable:n,targetPosition:i=bt.Top}){return w.jsxs(w.Fragment,{children:[w.jsx(Ac,{type:"target",position:i,isConnectable:n}),t?.label]})}const Rc={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},gb={input:zz,default:Dz,output:jz,group:Lz};function Bz(t){return t.internals.handleBounds===void 0?{width:t.width??t.initialWidth??t.style?.width,height:t.height??t.initialHeight??t.style?.height}:{width:t.width??t.style?.width,height:t.height??t.style?.height}}const Hz=t=>{const{width:n,height:i,x:o,y:s}=ll(t.nodeLookup,{filter:l=>!!l.selected});return{width:Hn(n)?n:null,height:Hn(i)?i:null,userSelectionActive:t.userSelectionActive,transformString:`translate(${t.transform[0]}px,${t.transform[1]}px) scale(${t.transform[2]}) translate(${o}px,${s}px)`}};function Pz({onSelectionContextMenu:t,noPanClassName:n,disableKeyboardA11y:i}){const o=ae(),{width:s,height:l,transformString:c,userSelectionActive:f}=It(Hz,oe),d=Sw(),h=F.useRef(null);F.useEffect(()=>{i||h.current?.focus({preventScroll:!0})},[i]);const m=!f&&s!==null&&l!==null;if(bw({nodeRef:h,disabled:!m}),!m)return null;const g=t?x=>{const b=o.getState().nodes.filter(_=>_.selected);t(x,b)}:void 0,v=x=>{Object.prototype.hasOwnProperty.call(Rc,x.key)&&(x.preventDefault(),d({direction:Rc[x.key],factor:x.shiftKey?4:1}))};return w.jsx("div",{className:xe(["react-flow__nodesselection","react-flow__container",n]),style:{transform:c},children:w.jsx("div",{ref:h,className:"react-flow__nodesselection-rect",onContextMenu:g,tabIndex:i?void 0:-1,onKeyDown:i?void 0:v,style:{width:s,height:l}})})}const yb=typeof window<"u"?window:void 0,Iz=t=>({nodesSelectionActive:t.nodesSelectionActive,userSelectionActive:t.userSelectionActive});function Ew({children:t,onPaneClick:n,onPaneMouseEnter:i,onPaneMouseMove:o,onPaneMouseLeave:s,onPaneContextMenu:l,onPaneScroll:c,paneClickDistance:f,deleteKeyCode:d,selectionKeyCode:h,selectionOnDrag:m,selectionMode:g,onSelectionStart:v,onSelectionEnd:x,multiSelectionKeyCode:b,panActivationKeyCode:_,zoomActivationKeyCode:T,elementsSelectable:C,zoomOnScroll:z,zoomOnPinch:E,panOnScroll:M,panOnScrollSpeed:H,panOnScrollMode:R,zoomOnDoubleClick:B,panOnDrag:P,defaultViewport:q,translateExtent:J,minZoom:j,maxZoom:V,preventScrolling:K,onSelectionContextMenu:D,noWheelClassName:I,noPanClassName:O,disableKeyboardA11y:U,onViewportChange:G,isControlledViewport:$}){const{nodesSelectionActive:k,userSelectionActive:L}=It(Iz,oe),X=tl(h,{target:yb}),A=tl(_,{target:yb}),it=A||P,ct=A||M,ft=m&&it!==!0,dt=X||L||ft;return bz({deleteKeyCode:d,multiSelectionKeyCode:b}),w.jsx(Ez,{onPaneContextMenu:l,elementsSelectable:C,zoomOnScroll:z,zoomOnPinch:E,panOnScroll:ct,panOnScrollSpeed:H,panOnScrollMode:R,zoomOnDoubleClick:B,panOnDrag:!X&&it,defaultViewport:q,translateExtent:J,minZoom:j,maxZoom:V,zoomActivationKeyCode:T,preventScrolling:K,noWheelClassName:I,noPanClassName:O,onViewportChange:G,isControlledViewport:$,paneClickDistance:f,selectionOnDrag:ft,children:w.jsxs(Mz,{onSelectionStart:v,onSelectionEnd:x,onPaneClick:n,onPaneMouseEnter:i,onPaneMouseMove:o,onPaneMouseLeave:s,onPaneContextMenu:l,onPaneScroll:c,panOnDrag:it,isSelecting:!!dt,selectionMode:g,selectionKeyPressed:X,paneClickDistance:f,selectionOnDrag:ft,children:[t,k&&w.jsx(Pz,{onSelectionContextMenu:D,noPanClassName:O,disableKeyboardA11y:U})]})})}Ew.displayName="FlowRenderer";const Uz=F.memo(Ew),Vz=t=>n=>t?xm(n.nodeLookup,{x:0,y:0,width:n.width,height:n.height},n.transform,!0).map(i=>i.id):Array.from(n.nodeLookup.keys());function qz(t){return It(F.useCallback(Vz(t),[t]),oe)}const Fz=t=>t.updateNodeInternals;function Yz(){const t=It(Fz),[n]=F.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(i=>{const o=new Map;i.forEach(s=>{const l=s.target.getAttribute("data-id");o.set(l,{id:l,nodeElement:s.target,force:!0})}),t(o)}));return F.useEffect(()=>()=>{n?.disconnect()},[n]),n}function Xz({node:t,nodeType:n,hasDimensions:i,resizeObserver:o}){const s=ae(),l=F.useRef(null),c=F.useRef(null),f=F.useRef(t.sourcePosition),d=F.useRef(t.targetPosition),h=F.useRef(n),m=i&&!!t.internals.handleBounds;return F.useEffect(()=>{l.current&&!t.hidden&&(!m||c.current!==l.current)&&(c.current&&o?.unobserve(c.current),o?.observe(l.current),c.current=l.current)},[m,t.hidden]),F.useEffect(()=>()=>{c.current&&(o?.unobserve(c.current),c.current=null)},[]),F.useEffect(()=>{if(l.current){const g=h.current!==n,v=f.current!==t.sourcePosition,x=d.current!==t.targetPosition;(g||v||x)&&(h.current=n,f.current=t.sourcePosition,d.current=t.targetPosition,s.getState().updateNodeInternals(new Map([[t.id,{id:t.id,nodeElement:l.current,force:!0}]])))}},[t.id,n,t.sourcePosition,t.targetPosition]),l}function Gz({id:t,onClick:n,onMouseEnter:i,onMouseMove:o,onMouseLeave:s,onContextMenu:l,onDoubleClick:c,nodesDraggable:f,elementsSelectable:d,nodesConnectable:h,nodesFocusable:m,resizeObserver:g,noDragClassName:v,noPanClassName:x,disableKeyboardA11y:b,rfId:_,nodeTypes:T,nodeClickDistance:C,onError:z}){const{node:E,internals:M,isParent:H}=It(lt=>{const pt=lt.nodeLookup.get(t),St=lt.parentLookup.has(t);return{node:pt,internals:pt.internals,isParent:St}},oe);let R=E.type||"default",B=T?.[R]||gb[R];B===void 0&&(z?.("003",ti.error003(R)),R="default",B=T?.default||gb.default);const P=!!(E.draggable||f&&typeof E.draggable>"u"),q=!!(E.selectable||d&&typeof E.selectable>"u"),J=!!(E.connectable||h&&typeof E.connectable>"u"),j=!!(E.focusable||m&&typeof E.focusable>"u"),V=ae(),K=XS(E),D=Xz({node:E,nodeType:R,hasDimensions:K,resizeObserver:g}),I=bw({nodeRef:D,disabled:E.hidden||!P,noDragClassName:v,handleSelector:E.dragHandle,nodeId:t,isSelectable:q,nodeClickDistance:C}),O=Sw();if(E.hidden)return null;const U=Ri(E),G=Bz(E),$=q||P||n||i||o||s,k=i?lt=>i(lt,{...M.userNode}):void 0,L=o?lt=>o(lt,{...M.userNode}):void 0,X=s?lt=>s(lt,{...M.userNode}):void 0,A=l?lt=>l(lt,{...M.userNode}):void 0,it=c?lt=>c(lt,{...M.userNode}):void 0,ct=lt=>{const{selectNodesOnDrag:pt,nodeDragThreshold:St}=V.getState();q&&(!pt||!P||St>0)&&zp({id:t,store:V,nodeRef:D}),n&&n(lt,{...M.userNode})},ft=lt=>{if(!($S(lt.nativeEvent)||b)){if(BS.includes(lt.key)&&q){const pt=lt.key==="Escape";zp({id:t,store:V,unselect:pt,nodeRef:D})}else if(P&&E.selected&&Object.prototype.hasOwnProperty.call(Rc,lt.key)){lt.preventDefault();const{ariaLabelConfig:pt}=V.getState();V.setState({ariaLiveMessage:pt["node.a11yDescription.ariaLiveMessage"]({direction:lt.key.replace("Arrow","").toLowerCase(),x:~~M.positionAbsolute.x,y:~~M.positionAbsolute.y})}),O({direction:Rc[lt.key],factor:lt.shiftKey?4:1})}}},dt=()=>{if(b||!D.current?.matches(":focus-visible"))return;const{transform:lt,width:pt,height:St,autoPanOnNodeFocus:wt,setCenter:vt}=V.getState();if(!wt)return;xm(new Map([[t,E]]),{x:0,y:0,width:pt,height:St},lt,!0).length>0||vt(E.position.x+U.width/2,E.position.y+U.height/2,{zoom:lt[2]})};return w.jsx("div",{className:xe(["react-flow__node",`react-flow__node-${R}`,{[x]:P},E.className,{selected:E.selected,selectable:q,parent:H,draggable:P,dragging:I}]),ref:D,style:{zIndex:M.z,transform:`translate(${M.positionAbsolute.x}px,${M.positionAbsolute.y}px)`,pointerEvents:$?"all":"none",visibility:K?"visible":"hidden",...E.style,...G},"data-id":t,"data-testid":`rf__node-${t}`,onMouseEnter:k,onMouseMove:L,onMouseLeave:X,onContextMenu:A,onClick:ct,onDoubleClick:it,onKeyDown:j?ft:void 0,tabIndex:j?0:void 0,onFocus:j?dt:void 0,role:E.ariaRole??(j?"group":void 0),"aria-roledescription":"node","aria-describedby":b?void 0:`${pw}-${_}`,"aria-label":E.ariaLabel,...E.domAttributes,children:w.jsx(kz,{value:t,children:w.jsx(B,{id:t,data:E.data,type:R,positionAbsoluteX:M.positionAbsolute.x,positionAbsoluteY:M.positionAbsolute.y,selected:E.selected??!1,selectable:q,draggable:P,deletable:E.deletable??!0,isConnectable:J,sourcePosition:E.sourcePosition,targetPosition:E.targetPosition,dragging:I,dragHandle:E.dragHandle,zIndex:M.z,parentId:E.parentId,...U})})})}var Qz=F.memo(Gz);const $z=t=>({nodesDraggable:t.nodesDraggable,nodesConnectable:t.nodesConnectable,nodesFocusable:t.nodesFocusable,elementsSelectable:t.elementsSelectable,onError:t.onError});function _w(t){const{nodesDraggable:n,nodesConnectable:i,nodesFocusable:o,elementsSelectable:s,onError:l}=It($z,oe),c=qz(t.onlyRenderVisibleElements),f=Yz();return w.jsx("div",{className:"react-flow__nodes",style:Jc,children:c.map(d=>w.jsx(Qz,{id:d,nodeTypes:t.nodeTypes,nodeExtent:t.nodeExtent,onClick:t.onNodeClick,onMouseEnter:t.onNodeMouseEnter,onMouseMove:t.onNodeMouseMove,onMouseLeave:t.onNodeMouseLeave,onContextMenu:t.onNodeContextMenu,onDoubleClick:t.onNodeDoubleClick,noDragClassName:t.noDragClassName,noPanClassName:t.noPanClassName,rfId:t.rfId,disableKeyboardA11y:t.disableKeyboardA11y,resizeObserver:f,nodesDraggable:n,nodesConnectable:i,nodesFocusable:o,elementsSelectable:s,nodeClickDistance:t.nodeClickDistance,onError:l},d))})}_w.displayName="NodeRenderer";const Zz=F.memo(_w);function Kz(t){return It(F.useCallback(i=>{if(!t)return i.edges.map(s=>s.id);const o=[];if(i.width&&i.height)for(const s of i.edges){const l=i.nodeLookup.get(s.source),c=i.nodeLookup.get(s.target);l&&c&&WR({sourceNode:l,targetNode:c,width:i.width,height:i.height,transform:i.transform})&&o.push(s.id)}return o},[t]),oe)}const Jz=({color:t="none",strokeWidth:n=1})=>{const i={strokeWidth:n,...t&&{stroke:t}};return w.jsx("polyline",{className:"arrow",style:i,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},Wz=({color:t="none",strokeWidth:n=1})=>{const i={strokeWidth:n,...t&&{stroke:t,fill:t}};return w.jsx("polyline",{className:"arrowclosed",style:i,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},vb={[Mc.Arrow]:Jz,[Mc.ArrowClosed]:Wz};function t3(t){const n=ae();return F.useMemo(()=>Object.prototype.hasOwnProperty.call(vb,t)?vb[t]:(n.getState().onError?.("009",ti.error009(t)),null),[t])}const e3=({id:t,type:n,color:i,width:o=12.5,height:s=12.5,markerUnits:l="strokeWidth",strokeWidth:c,orient:f="auto-start-reverse"})=>{const d=t3(n);return d?w.jsx("marker",{className:"react-flow__arrowhead",id:t,markerWidth:`${o}`,markerHeight:`${s}`,viewBox:"-10 -10 20 20",markerUnits:l,orient:f,refX:"0",refY:"0",children:w.jsx(d,{color:i,strokeWidth:c})}):null},Cw=({defaultColor:t,rfId:n})=>{const i=It(l=>l.edges),o=It(l=>l.defaultEdgeOptions),s=F.useMemo(()=>sO(i,{id:n,defaultColor:t,defaultMarkerStart:o?.markerStart,defaultMarkerEnd:o?.markerEnd}),[i,o,n,t]);return s.length?w.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:w.jsx("defs",{children:s.map(l=>w.jsx(e3,{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};Cw.displayName="MarkerDefinitions";var n3=F.memo(Cw);function Tw({x:t,y:n,label:i,labelStyle:o,labelShowBg:s=!0,labelBgStyle:l,labelBgPadding:c=[2,4],labelBgBorderRadius:f=2,children:d,className:h,...m}){const[g,v]=F.useState({x:1,y:0,width:0,height:0}),x=xe(["react-flow__edge-textwrapper",h]),b=F.useRef(null);return F.useEffect(()=>{if(b.current){const _=b.current.getBBox();v({x:_.x,y:_.y,width:_.width,height:_.height})}},[i]),i?w.jsxs("g",{transform:`translate(${t-g.width/2} ${n-g.height/2})`,className:x,visibility:g.width?"visible":"hidden",...m,children:[s&&w.jsx("rect",{width:g.width+2*c[0],x:-c[0],y:-c[1],height:g.height+2*c[1],className:"react-flow__edge-textbg",style:l,rx:f,ry:f}),w.jsx("text",{className:"react-flow__edge-text",y:g.height/2,dy:"0.3em",ref:b,style:o,children:i}),d]}):null}Tw.displayName="EdgeText";const i3=F.memo(Tw);function Wc({path:t,labelX:n,labelY:i,label:o,labelStyle:s,labelShowBg:l,labelBgStyle:c,labelBgPadding:f,labelBgBorderRadius:d,interactionWidth:h=20,...m}){return w.jsxs(w.Fragment,{children:[w.jsx("path",{...m,d:t,fill:"none",className:xe(["react-flow__edge-path",m.className])}),h?w.jsx("path",{d:t,fill:"none",strokeOpacity:0,strokeWidth:h,className:"react-flow__edge-interaction"}):null,o&&Hn(n)&&Hn(i)?w.jsx(i3,{x:n,y:i,label:o,labelStyle:s,labelShowBg:l,labelBgStyle:c,labelBgPadding:f,labelBgBorderRadius:d}):null]})}function xb({pos:t,x1:n,y1:i,x2:o,y2:s}){return t===bt.Left||t===bt.Right?[.5*(n+o),i]:[n,.5*(i+s)]}function Mw({sourceX:t,sourceY:n,sourcePosition:i=bt.Bottom,targetX:o,targetY:s,targetPosition:l=bt.Top}){const[c,f]=xb({pos:i,x1:t,y1:n,x2:o,y2:s}),[d,h]=xb({pos:l,x1:o,y1:s,x2:t,y2:n}),[m,g,v,x]=KS({sourceX:t,sourceY:n,targetX:o,targetY:s,sourceControlX:c,sourceControlY:f,targetControlX:d,targetControlY:h});return[`M${t},${n} C${c},${f} ${d},${h} ${o},${s}`,m,g,v,x]}function Nw(t){return F.memo(({id:n,sourceX:i,sourceY:o,targetX:s,targetY:l,sourcePosition:c,targetPosition:f,label:d,labelStyle:h,labelShowBg:m,labelBgStyle:g,labelBgPadding:v,labelBgBorderRadius:x,style:b,markerEnd:_,markerStart:T,interactionWidth:C})=>{const[z,E,M]=Mw({sourceX:i,sourceY:o,sourcePosition:c,targetX:s,targetY:l,targetPosition:f}),H=t.isInternal?void 0:n;return w.jsx(Wc,{id:H,path:z,labelX:E,labelY:M,label:d,labelStyle:h,labelShowBg:m,labelBgStyle:g,labelBgPadding:v,labelBgBorderRadius:x,style:b,markerEnd:_,markerStart:T,interactionWidth:C})})}const r3=Nw({isInternal:!1}),kw=Nw({isInternal:!0});r3.displayName="SimpleBezierEdge";kw.displayName="SimpleBezierEdgeInternal";function Aw(t){return F.memo(({id:n,sourceX:i,sourceY:o,targetX:s,targetY:l,label:c,labelStyle:f,labelShowBg:d,labelBgStyle:h,labelBgPadding:m,labelBgBorderRadius:g,style:v,sourcePosition:x=bt.Bottom,targetPosition:b=bt.Top,markerEnd:_,markerStart:T,pathOptions:C,interactionWidth:z})=>{const[E,M,H]=kp({sourceX:i,sourceY:o,sourcePosition:x,targetX:s,targetY:l,targetPosition:b,borderRadius:C?.borderRadius,offset:C?.offset,stepPosition:C?.stepPosition}),R=t.isInternal?void 0:n;return w.jsx(Wc,{id:R,path:E,labelX:M,labelY:H,label:c,labelStyle:f,labelShowBg:d,labelBgStyle:h,labelBgPadding:m,labelBgBorderRadius:g,style:v,markerEnd:_,markerStart:T,interactionWidth:z})})}const Rw=Aw({isInternal:!1}),Ow=Aw({isInternal:!0});Rw.displayName="SmoothStepEdge";Ow.displayName="SmoothStepEdgeInternal";function zw(t){return F.memo(({id:n,...i})=>{const o=t.isInternal?void 0:n;return w.jsx(Rw,{...i,id:o,pathOptions:F.useMemo(()=>({borderRadius:0,offset:i.pathOptions?.offset}),[i.pathOptions?.offset])})})}const o3=zw({isInternal:!1}),Dw=zw({isInternal:!0});o3.displayName="StepEdge";Dw.displayName="StepEdgeInternal";function Lw(t){return F.memo(({id:n,sourceX:i,sourceY:o,targetX:s,targetY:l,label:c,labelStyle:f,labelShowBg:d,labelBgStyle:h,labelBgPadding:m,labelBgBorderRadius:g,style:v,markerEnd:x,markerStart:b,interactionWidth:_})=>{const[T,C,z]=tw({sourceX:i,sourceY:o,targetX:s,targetY:l}),E=t.isInternal?void 0:n;return w.jsx(Wc,{id:E,path:T,labelX:C,labelY:z,label:c,labelStyle:f,labelShowBg:d,labelBgStyle:h,labelBgPadding:m,labelBgBorderRadius:g,style:v,markerEnd:x,markerStart:b,interactionWidth:_})})}const a3=Lw({isInternal:!1}),jw=Lw({isInternal:!0});a3.displayName="StraightEdge";jw.displayName="StraightEdgeInternal";function Bw(t){return F.memo(({id:n,sourceX:i,sourceY:o,targetX:s,targetY:l,sourcePosition:c=bt.Bottom,targetPosition:f=bt.Top,label:d,labelStyle:h,labelShowBg:m,labelBgStyle:g,labelBgPadding:v,labelBgBorderRadius:x,style:b,markerEnd:_,markerStart:T,pathOptions:C,interactionWidth:z})=>{const[E,M,H]=JS({sourceX:i,sourceY:o,sourcePosition:c,targetX:s,targetY:l,targetPosition:f,curvature:C?.curvature}),R=t.isInternal?void 0:n;return w.jsx(Wc,{id:R,path:E,labelX:M,labelY:H,label:d,labelStyle:h,labelShowBg:m,labelBgStyle:g,labelBgPadding:v,labelBgBorderRadius:x,style:b,markerEnd:_,markerStart:T,interactionWidth:z})})}const s3=Bw({isInternal:!1}),Hw=Bw({isInternal:!0});s3.displayName="BezierEdge";Hw.displayName="BezierEdgeInternal";const bb={default:Hw,straight:jw,step:Dw,smoothstep:Ow,simplebezier:kw},Sb={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},l3=(t,n,i)=>i===bt.Left?t-n:i===bt.Right?t+n:t,u3=(t,n,i)=>i===bt.Top?t-n:i===bt.Bottom?t+n:t,wb="react-flow__edgeupdater";function Eb({position:t,centerX:n,centerY:i,radius:o=10,onMouseDown:s,onMouseEnter:l,onMouseOut:c,type:f}){return w.jsx("circle",{onMouseDown:s,onMouseEnter:l,onMouseOut:c,className:xe([wb,`${wb}-${f}`]),cx:l3(n,o,t),cy:u3(i,o,t),r:o,stroke:"transparent",fill:"transparent"})}function c3({isReconnectable:t,reconnectRadius:n,edge:i,sourceX:o,sourceY:s,targetX:l,targetY:c,sourcePosition:f,targetPosition:d,onReconnect:h,onReconnectStart:m,onReconnectEnd:g,setReconnecting:v,setUpdateHover:x}){const b=ae(),_=(M,H)=>{if(M.button!==0)return;const{autoPanOnConnect:R,domNode:B,connectionMode:P,connectionRadius:q,lib:J,onConnectStart:j,cancelConnection:V,nodeLookup:K,rfId:D,panBy:I,updateConnection:O}=b.getState(),U=H.type==="target",G=(L,X)=>{v(!1),g?.(L,i,H.type,X)},$=L=>h?.(i,L),k=(L,X)=>{v(!0),m?.(M,i,H.type),j?.(L,X)};Op.onPointerDown(M.nativeEvent,{autoPanOnConnect:R,connectionMode:P,connectionRadius:q,domNode:B,handleId:H.id,nodeId:H.nodeId,nodeLookup:K,isTarget:U,edgeUpdaterType:H.type,lib:J,flowId:D,cancelConnection:V,panBy:I,isValidConnection:(...L)=>b.getState().isValidConnection?.(...L)??!0,onConnect:$,onConnectStart:k,onConnectEnd:(...L)=>b.getState().onConnectEnd?.(...L),onReconnectEnd:G,updateConnection:O,getTransform:()=>b.getState().transform,getFromHandle:()=>b.getState().connection.fromHandle,dragThreshold:b.getState().connectionDragThreshold,handleDomNode:M.currentTarget})},T=M=>_(M,{nodeId:i.target,id:i.targetHandle??null,type:"target"}),C=M=>_(M,{nodeId:i.source,id:i.sourceHandle??null,type:"source"}),z=()=>x(!0),E=()=>x(!1);return w.jsxs(w.Fragment,{children:[(t===!0||t==="source")&&w.jsx(Eb,{position:f,centerX:o,centerY:s,radius:n,onMouseDown:T,onMouseEnter:z,onMouseOut:E,type:"source"}),(t===!0||t==="target")&&w.jsx(Eb,{position:d,centerX:l,centerY:c,radius:n,onMouseDown:C,onMouseEnter:z,onMouseOut:E,type:"target"})]})}function f3({id:t,edgesFocusable:n,edgesReconnectable:i,elementsSelectable:o,onClick:s,onDoubleClick:l,onContextMenu:c,onMouseEnter:f,onMouseMove:d,onMouseLeave:h,reconnectRadius:m,onReconnect:g,onReconnectStart:v,onReconnectEnd:x,rfId:b,edgeTypes:_,noPanClassName:T,onError:C,disableKeyboardA11y:z}){let E=It(vt=>vt.edgeLookup.get(t));const M=It(vt=>vt.defaultEdgeOptions);E=M?{...M,...E}:E;let H=E.type||"default",R=_?.[H]||bb[H];R===void 0&&(C?.("011",ti.error011(H)),H="default",R=_?.default||bb.default);const B=!!(E.focusable||n&&typeof E.focusable>"u"),P=typeof g<"u"&&(E.reconnectable||i&&typeof E.reconnectable>"u"),q=!!(E.selectable||o&&typeof E.selectable>"u"),J=F.useRef(null),[j,V]=F.useState(!1),[K,D]=F.useState(!1),I=ae(),{zIndex:O,sourceX:U,sourceY:G,targetX:$,targetY:k,sourcePosition:L,targetPosition:X}=It(F.useCallback(vt=>{const Et=vt.nodeLookup.get(E.source),Rt=vt.nodeLookup.get(E.target);if(!Et||!Rt)return{zIndex:E.zIndex,...Sb};const Ht=aO({id:t,sourceNode:Et,targetNode:Rt,sourceHandle:E.sourceHandle||null,targetHandle:E.targetHandle||null,connectionMode:vt.connectionMode,onError:C});return{zIndex:JR({selected:E.selected,zIndex:E.zIndex,sourceNode:Et,targetNode:Rt,elevateOnSelect:vt.elevateEdgesOnSelect,zIndexMode:vt.zIndexMode}),...Ht||Sb}},[E.source,E.target,E.sourceHandle,E.targetHandle,E.selected,E.zIndex]),oe),A=F.useMemo(()=>E.markerStart?`url('#${Ap(E.markerStart,b)}')`:void 0,[E.markerStart,b]),it=F.useMemo(()=>E.markerEnd?`url('#${Ap(E.markerEnd,b)}')`:void 0,[E.markerEnd,b]);if(E.hidden||U===null||G===null||$===null||k===null)return null;const ct=vt=>{const{addSelectedEdges:Et,unselectNodesAndEdges:Rt,multiSelectionActive:Ht}=I.getState();q&&(I.setState({nodesSelectionActive:!1}),E.selected&&Ht?(Rt({nodes:[],edges:[E]}),J.current?.blur()):Et([t])),s&&s(vt,E)},ft=l?vt=>{l(vt,{...E})}:void 0,dt=c?vt=>{c(vt,{...E})}:void 0,lt=f?vt=>{f(vt,{...E})}:void 0,pt=d?vt=>{d(vt,{...E})}:void 0,St=h?vt=>{h(vt,{...E})}:void 0,wt=vt=>{if(!z&&BS.includes(vt.key)&&q){const{unselectNodesAndEdges:Et,addSelectedEdges:Rt}=I.getState();vt.key==="Escape"?(J.current?.blur(),Et({edges:[E]})):Rt([t])}};return w.jsx("svg",{style:{zIndex:O},children:w.jsxs("g",{className:xe(["react-flow__edge",`react-flow__edge-${H}`,E.className,T,{selected:E.selected,animated:E.animated,inactive:!q&&!s,updating:j,selectable:q}]),onClick:ct,onDoubleClick:ft,onContextMenu:dt,onMouseEnter:lt,onMouseMove:pt,onMouseLeave:St,onKeyDown:B?wt:void 0,tabIndex:B?0:void 0,role:E.ariaRole??(B?"group":"img"),"aria-roledescription":"edge","data-id":t,"data-testid":`rf__edge-${t}`,"aria-label":E.ariaLabel===null?void 0:E.ariaLabel||`Edge from ${E.source} to ${E.target}`,"aria-describedby":B?`${mw}-${b}`:void 0,ref:J,...E.domAttributes,children:[!K&&w.jsx(R,{id:t,source:E.source,target:E.target,type:E.type,selected:E.selected,animated:E.animated,selectable:q,deletable:E.deletable??!0,label:E.label,labelStyle:E.labelStyle,labelShowBg:E.labelShowBg,labelBgStyle:E.labelBgStyle,labelBgPadding:E.labelBgPadding,labelBgBorderRadius:E.labelBgBorderRadius,sourceX:U,sourceY:G,targetX:$,targetY:k,sourcePosition:L,targetPosition:X,data:E.data,style:E.style,sourceHandleId:E.sourceHandle,targetHandleId:E.targetHandle,markerStart:A,markerEnd:it,pathOptions:"pathOptions"in E?E.pathOptions:void 0,interactionWidth:E.interactionWidth}),P&&w.jsx(c3,{edge:E,isReconnectable:P,reconnectRadius:m,onReconnect:g,onReconnectStart:v,onReconnectEnd:x,sourceX:U,sourceY:G,targetX:$,targetY:k,sourcePosition:L,targetPosition:X,setUpdateHover:V,setReconnecting:D})]})})}var d3=F.memo(f3);const h3=t=>({edgesFocusable:t.edgesFocusable,edgesReconnectable:t.edgesReconnectable,elementsSelectable:t.elementsSelectable,connectionMode:t.connectionMode,onError:t.onError});function Pw({defaultMarkerColor:t,onlyRenderVisibleElements:n,rfId:i,edgeTypes:o,noPanClassName:s,onReconnect:l,onEdgeContextMenu:c,onEdgeMouseEnter:f,onEdgeMouseMove:d,onEdgeMouseLeave:h,onEdgeClick:m,reconnectRadius:g,onEdgeDoubleClick:v,onReconnectStart:x,onReconnectEnd:b,disableKeyboardA11y:_}){const{edgesFocusable:T,edgesReconnectable:C,elementsSelectable:z,onError:E}=It(h3,oe),M=Kz(n);return w.jsxs("div",{className:"react-flow__edges",children:[w.jsx(n3,{defaultColor:t,rfId:i}),M.map(H=>w.jsx(d3,{id:H,edgesFocusable:T,edgesReconnectable:C,elementsSelectable:z,noPanClassName:s,onReconnect:l,onContextMenu:c,onMouseEnter:f,onMouseMove:d,onMouseLeave:h,onClick:m,reconnectRadius:g,onDoubleClick:v,onReconnectStart:x,onReconnectEnd:b,rfId:i,onError:E,edgeTypes:o,disableKeyboardA11y:_},H))]})}Pw.displayName="EdgeRenderer";const p3=F.memo(Pw),m3=t=>`translate(${t.transform[0]}px,${t.transform[1]}px) scale(${t.transform[2]})`;function g3({children:t}){const n=It(m3);return w.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:n},children:t})}function y3(t){const n=Mm(),i=F.useRef(!1);F.useEffect(()=>{!i.current&&n.viewportInitialized&&t&&(setTimeout(()=>t(n),1),i.current=!0)},[t,n.viewportInitialized])}const v3=t=>t.panZoom?.syncViewport;function x3(t){const n=It(v3),i=ae();return F.useEffect(()=>{t&&(n?.(t),i.setState({transform:[t.x,t.y,t.zoom]}))},[t,n]),null}function b3(t){return t.connection.inProgress?{...t.connection,to:cl(t.connection.to,t.transform)}:{...t.connection}}function S3(t){return b3}function w3(t){const n=S3();return It(n,oe)}const E3=t=>({nodesConnectable:t.nodesConnectable,isValid:t.connection.isValid,inProgress:t.connection.inProgress,width:t.width,height:t.height});function _3({containerStyle:t,style:n,type:i,component:o}){const{nodesConnectable:s,width:l,height:c,isValid:f,inProgress:d}=It(E3,oe);return!(l&&s&&d)?null:w.jsx("svg",{style:t,width:l,height:c,className:"react-flow__connectionline react-flow__container",children:w.jsx("g",{className:xe(["react-flow__connection",IS(f)]),children:w.jsx(Iw,{style:n,type:i,CustomComponent:o,isValid:f})})})}const Iw=({style:t,type:n=cr.Bezier,CustomComponent:i,isValid:o})=>{const{inProgress:s,from:l,fromNode:c,fromHandle:f,fromPosition:d,to:h,toNode:m,toHandle:g,toPosition:v,pointer:x}=w3();if(!s)return;if(i)return w.jsx(i,{connectionLineType:n,connectionLineStyle:t,fromNode:c,fromHandle:f,fromX:l.x,fromY:l.y,toX:h.x,toY:h.y,fromPosition:d,toPosition:v,connectionStatus:IS(o),toNode:m,toHandle:g,pointer:x});let b="";const _={sourceX:l.x,sourceY:l.y,sourcePosition:d,targetX:h.x,targetY:h.y,targetPosition:v};switch(n){case cr.Bezier:[b]=JS(_);break;case cr.SimpleBezier:[b]=Mw(_);break;case cr.Step:[b]=kp({..._,borderRadius:0});break;case cr.SmoothStep:[b]=kp(_);break;default:[b]=tw(_)}return w.jsx("path",{d:b,fill:"none",className:"react-flow__connection-path",style:t})};Iw.displayName="ConnectionLine";const C3={};function _b(t=C3){F.useRef(t),ae(),F.useEffect(()=>{},[t])}function T3(){ae(),F.useRef(!1),F.useEffect(()=>{},[])}function Uw({nodeTypes:t,edgeTypes:n,onInit:i,onNodeClick:o,onEdgeClick:s,onNodeDoubleClick:l,onEdgeDoubleClick:c,onNodeMouseEnter:f,onNodeMouseMove:d,onNodeMouseLeave:h,onNodeContextMenu:m,onSelectionContextMenu:g,onSelectionStart:v,onSelectionEnd:x,connectionLineType:b,connectionLineStyle:_,connectionLineComponent:T,connectionLineContainerStyle:C,selectionKeyCode:z,selectionOnDrag:E,selectionMode:M,multiSelectionKeyCode:H,panActivationKeyCode:R,zoomActivationKeyCode:B,deleteKeyCode:P,onlyRenderVisibleElements:q,elementsSelectable:J,defaultViewport:j,translateExtent:V,minZoom:K,maxZoom:D,preventScrolling:I,defaultMarkerColor:O,zoomOnScroll:U,zoomOnPinch:G,panOnScroll:$,panOnScrollSpeed:k,panOnScrollMode:L,zoomOnDoubleClick:X,panOnDrag:A,onPaneClick:it,onPaneMouseEnter:ct,onPaneMouseMove:ft,onPaneMouseLeave:dt,onPaneScroll:lt,onPaneContextMenu:pt,paneClickDistance:St,nodeClickDistance:wt,onEdgeContextMenu:vt,onEdgeMouseEnter:Et,onEdgeMouseMove:Rt,onEdgeMouseLeave:Ht,reconnectRadius:jt,onReconnect:Qt,onReconnectStart:Ee,onReconnectEnd:ie,noDragClassName:Ae,noWheelClassName:Je,noPanClassName:yn,disableKeyboardA11y:An,nodeExtent:ue,rfId:Un,viewport:et,onViewportChange:ut}){return _b(t),_b(n),T3(),y3(i),x3(et),w.jsx(Uz,{onPaneClick:it,onPaneMouseEnter:ct,onPaneMouseMove:ft,onPaneMouseLeave:dt,onPaneContextMenu:pt,onPaneScroll:lt,paneClickDistance:St,deleteKeyCode:P,selectionKeyCode:z,selectionOnDrag:E,selectionMode:M,onSelectionStart:v,onSelectionEnd:x,multiSelectionKeyCode:H,panActivationKeyCode:R,zoomActivationKeyCode:B,elementsSelectable:J,zoomOnScroll:U,zoomOnPinch:G,zoomOnDoubleClick:X,panOnScroll:$,panOnScrollSpeed:k,panOnScrollMode:L,panOnDrag:A,defaultViewport:j,translateExtent:V,minZoom:K,maxZoom:D,onSelectionContextMenu:g,preventScrolling:I,noDragClassName:Ae,noWheelClassName:Je,noPanClassName:yn,disableKeyboardA11y:An,onViewportChange:ut,isControlledViewport:!!et,children:w.jsxs(g3,{children:[w.jsx(p3,{edgeTypes:n,onEdgeClick:s,onEdgeDoubleClick:c,onReconnect:Qt,onReconnectStart:Ee,onReconnectEnd:ie,onlyRenderVisibleElements:q,onEdgeContextMenu:vt,onEdgeMouseEnter:Et,onEdgeMouseMove:Rt,onEdgeMouseLeave:Ht,reconnectRadius:jt,defaultMarkerColor:O,noPanClassName:yn,disableKeyboardA11y:An,rfId:Un}),w.jsx(_3,{style:_,type:b,component:T,containerStyle:C}),w.jsx("div",{className:"react-flow__edgelabel-renderer"}),w.jsx(Zz,{nodeTypes:t,onNodeClick:o,onNodeDoubleClick:l,onNodeMouseEnter:f,onNodeMouseMove:d,onNodeMouseLeave:h,onNodeContextMenu:m,nodeClickDistance:wt,onlyRenderVisibleElements:q,noPanClassName:yn,noDragClassName:Ae,disableKeyboardA11y:An,nodeExtent:ue,rfId:Un}),w.jsx("div",{className:"react-flow__viewport-portal"})]})})}Uw.displayName="GraphView";const M3=F.memo(Uw),Cb=({nodes:t,edges:n,defaultNodes:i,defaultEdges:o,width:s,height:l,fitView:c,fitViewOptions:f,minZoom:d=.5,maxZoom:h=2,nodeOrigin:m,nodeExtent:g,zIndexMode:v="basic"}={})=>{const x=new Map,b=new Map,_=new Map,T=new Map,C=o??n??[],z=i??t??[],E=m??[0,0],M=g??Zs;iw(_,T,C);const H=Rp(z,x,b,{nodeOrigin:E,nodeExtent:M,zIndexMode:v});let R=[0,0,1];if(c&&s&&l){const B=ll(x,{filter:j=>!!((j.width||j.initialWidth)&&(j.height||j.initialHeight))}),{x:P,y:q,zoom:J}=bm(B,s,l,d,h,f?.padding??.1);R=[P,q,J]}return{rfId:"1",width:s??0,height:l??0,transform:R,nodes:z,nodesInitialized:H,nodeLookup:x,parentLookup:b,edges:C,edgeLookup:T,connectionLookup:_,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:i!==void 0,hasDefaultEdges:o!==void 0,panZoom:null,minZoom:d,maxZoom:h,translateExtent:Zs,nodeExtent:M,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:ha.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:E,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:c??!1,fitViewOptions:f,fitViewResolver:null,connection:{...PS},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:XR,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:HS,zIndexMode:v,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},N3=({nodes:t,edges:n,defaultNodes:i,defaultEdges:o,width:s,height:l,fitView:c,fitViewOptions:f,minZoom:d,maxZoom:h,nodeOrigin:m,nodeExtent:g,zIndexMode:v})=>FO((x,b)=>{async function _(){const{nodeLookup:T,panZoom:C,fitViewOptions:z,fitViewResolver:E,width:M,height:H,minZoom:R,maxZoom:B}=b();C&&(await FR({nodes:T,width:M,height:H,panZoom:C,minZoom:R,maxZoom:B},z),E?.resolve(!0),x({fitViewResolver:null}))}return{...Cb({nodes:t,edges:n,width:s,height:l,fitView:c,fitViewOptions:f,minZoom:d,maxZoom:h,nodeOrigin:m,nodeExtent:g,defaultNodes:i,defaultEdges:o,zIndexMode:v}),setNodes:T=>{const{nodeLookup:C,parentLookup:z,nodeOrigin:E,elevateNodesOnSelect:M,fitViewQueued:H,zIndexMode:R}=b(),B=Rp(T,C,z,{nodeOrigin:E,nodeExtent:g,elevateNodesOnSelect:M,checkEquality:!0,zIndexMode:R});H&&B?(_(),x({nodes:T,nodesInitialized:B,fitViewQueued:!1,fitViewOptions:void 0})):x({nodes:T,nodesInitialized:B})},setEdges:T=>{const{connectionLookup:C,edgeLookup:z}=b();iw(C,z,T),x({edges:T})},setDefaultNodesAndEdges:(T,C)=>{if(T){const{setNodes:z}=b();z(T),x({hasDefaultNodes:!0})}if(C){const{setEdges:z}=b();z(C),x({hasDefaultEdges:!0})}},updateNodeInternals:T=>{const{triggerNodeChanges:C,nodeLookup:z,parentLookup:E,domNode:M,nodeOrigin:H,nodeExtent:R,debug:B,fitViewQueued:P,zIndexMode:q}=b(),{changes:J,updatedInternals:j}=pO(T,z,E,M,H,R,q);j&&(cO(z,E,{nodeOrigin:H,nodeExtent:R,zIndexMode:q}),P?(_(),x({fitViewQueued:!1,fitViewOptions:void 0})):x({}),J?.length>0&&(B&&console.log("React Flow: trigger node changes",J),C?.(J)))},updateNodePositions:(T,C=!1)=>{const z=[];let E=[];const{nodeLookup:M,triggerNodeChanges:H,connection:R,updateConnection:B,onNodesChangeMiddlewareMap:P}=b();for(const[q,J]of T){const j=M.get(q),V=!!(j?.expandParent&&j?.parentId&&J?.position),K={id:q,type:"position",position:V?{x:Math.max(0,J.position.x),y:Math.max(0,J.position.y)}:J.position,dragging:C};if(j&&R.inProgress&&R.fromNode.id===j.id){const D=no(j,R.fromHandle,bt.Left,!0);B({...R,from:D})}V&&j.parentId&&z.push({id:q,parentId:j.parentId,rect:{...J.internals.positionAbsolute,width:J.measured.width??0,height:J.measured.height??0}}),E.push(K)}if(z.length>0){const{parentLookup:q,nodeOrigin:J}=b(),j=Tm(z,M,q,J);E.push(...j)}for(const q of P.values())E=q(E);H(E)},triggerNodeChanges:T=>{const{onNodesChange:C,setNodes:z,nodes:E,hasDefaultNodes:M,debug:H}=b();if(T?.length){if(M){const R=fz(T,E);z(R)}H&&console.log("React Flow: trigger node changes",T),C?.(T)}},triggerEdgeChanges:T=>{const{onEdgesChange:C,setEdges:z,edges:E,hasDefaultEdges:M,debug:H}=b();if(T?.length){if(M){const R=dz(T,E);z(R)}H&&console.log("React Flow: trigger edge changes",T),C?.(T)}},addSelectedNodes:T=>{const{multiSelectionActive:C,edgeLookup:z,nodeLookup:E,triggerNodeChanges:M,triggerEdgeChanges:H}=b();if(C){const R=T.map(B=>Pr(B,!0));M(R);return}M(Jo(E,new Set([...T]),!0)),H(Jo(z))},addSelectedEdges:T=>{const{multiSelectionActive:C,edgeLookup:z,nodeLookup:E,triggerNodeChanges:M,triggerEdgeChanges:H}=b();if(C){const R=T.map(B=>Pr(B,!0));H(R);return}H(Jo(z,new Set([...T]))),M(Jo(E,new Set,!0))},unselectNodesAndEdges:({nodes:T,edges:C}={})=>{const{edges:z,nodes:E,nodeLookup:M,triggerNodeChanges:H,triggerEdgeChanges:R}=b(),B=T||E,P=C||z,q=[];for(const j of B){if(!j.selected)continue;const V=M.get(j.id);V&&(V.selected=!1),q.push(Pr(j.id,!1))}const J=[];for(const j of P)j.selected&&J.push(Pr(j.id,!1));H(q),R(J)},setMinZoom:T=>{const{panZoom:C,maxZoom:z}=b();C?.setScaleExtent([T,z]),x({minZoom:T})},setMaxZoom:T=>{const{panZoom:C,minZoom:z}=b();C?.setScaleExtent([z,T]),x({maxZoom:T})},setTranslateExtent:T=>{b().panZoom?.setTranslateExtent(T),x({translateExtent:T})},resetSelectedElements:()=>{const{edges:T,nodes:C,triggerNodeChanges:z,triggerEdgeChanges:E,elementsSelectable:M}=b();if(!M)return;const H=C.reduce((B,P)=>P.selected?[...B,Pr(P.id,!1)]:B,[]),R=T.reduce((B,P)=>P.selected?[...B,Pr(P.id,!1)]:B,[]);z(H),E(R)},setNodeExtent:T=>{const{nodes:C,nodeLookup:z,parentLookup:E,nodeOrigin:M,elevateNodesOnSelect:H,nodeExtent:R,zIndexMode:B}=b();T[0][0]===R[0][0]&&T[0][1]===R[0][1]&&T[1][0]===R[1][0]&&T[1][1]===R[1][1]||(Rp(C,z,E,{nodeOrigin:M,nodeExtent:T,elevateNodesOnSelect:H,checkEquality:!1,zIndexMode:B}),x({nodeExtent:T}))},panBy:T=>{const{transform:C,width:z,height:E,panZoom:M,translateExtent:H}=b();return mO({delta:T,panZoom:M,transform:C,translateExtent:H,width:z,height:E})},setCenter:async(T,C,z)=>{const{width:E,height:M,maxZoom:H,panZoom:R}=b();if(!R)return Promise.resolve(!1);const B=typeof z?.zoom<"u"?z.zoom:H;return await R.setViewport({x:E/2-T*B,y:M/2-C*B,zoom:B},{duration:z?.duration,ease:z?.ease,interpolate:z?.interpolate}),Promise.resolve(!0)},cancelConnection:()=>{x({connection:{...PS}})},updateConnection:T=>{x({connection:T})},reset:()=>x({...Cb()})}},Object.is);function k3({initialNodes:t,initialEdges:n,defaultNodes:i,defaultEdges:o,initialWidth:s,initialHeight:l,initialMinZoom:c,initialMaxZoom:f,initialFitViewOptions:d,fitView:h,nodeOrigin:m,nodeExtent:g,zIndexMode:v,children:x}){const[b]=F.useState(()=>N3({nodes:t,edges:n,defaultNodes:i,defaultEdges:o,width:s,height:l,fitView:h,minZoom:c,maxZoom:f,fitViewOptions:d,nodeOrigin:m,nodeExtent:g,zIndexMode:v}));return w.jsx(YO,{value:b,children:w.jsx(gz,{children:x})})}function A3({children:t,nodes:n,edges:i,defaultNodes:o,defaultEdges:s,width:l,height:c,fitView:f,fitViewOptions:d,minZoom:h,maxZoom:m,nodeOrigin:g,nodeExtent:v,zIndexMode:x}){return F.useContext(Zc)?w.jsx(w.Fragment,{children:t}):w.jsx(k3,{initialNodes:n,initialEdges:i,defaultNodes:o,defaultEdges:s,initialWidth:l,initialHeight:c,fitView:f,initialFitViewOptions:d,initialMinZoom:h,initialMaxZoom:m,nodeOrigin:g,nodeExtent:v,zIndexMode:x,children:t})}const R3={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function O3({nodes:t,edges:n,defaultNodes:i,defaultEdges:o,className:s,nodeTypes:l,edgeTypes:c,onNodeClick:f,onEdgeClick:d,onInit:h,onMove:m,onMoveStart:g,onMoveEnd:v,onConnect:x,onConnectStart:b,onConnectEnd:_,onClickConnectStart:T,onClickConnectEnd:C,onNodeMouseEnter:z,onNodeMouseMove:E,onNodeMouseLeave:M,onNodeContextMenu:H,onNodeDoubleClick:R,onNodeDragStart:B,onNodeDrag:P,onNodeDragStop:q,onNodesDelete:J,onEdgesDelete:j,onDelete:V,onSelectionChange:K,onSelectionDragStart:D,onSelectionDrag:I,onSelectionDragStop:O,onSelectionContextMenu:U,onSelectionStart:G,onSelectionEnd:$,onBeforeDelete:k,connectionMode:L,connectionLineType:X=cr.Bezier,connectionLineStyle:A,connectionLineComponent:it,connectionLineContainerStyle:ct,deleteKeyCode:ft="Backspace",selectionKeyCode:dt="Shift",selectionOnDrag:lt=!1,selectionMode:pt=Ks.Full,panActivationKeyCode:St="Space",multiSelectionKeyCode:wt=Ws()?"Meta":"Control",zoomActivationKeyCode:vt=Ws()?"Meta":"Control",snapToGrid:Et,snapGrid:Rt,onlyRenderVisibleElements:Ht=!1,selectNodesOnDrag:jt,nodesDraggable:Qt,autoPanOnNodeFocus:Ee,nodesConnectable:ie,nodesFocusable:Ae,nodeOrigin:Je=gw,edgesFocusable:yn,edgesReconnectable:An,elementsSelectable:ue=!0,defaultViewport:Un=rz,minZoom:et=.5,maxZoom:ut=2,translateExtent:gt=Zs,preventScrolling:Mt=!0,nodeExtent:Pt,defaultMarkerColor:je="#b1b1b7",zoomOnScroll:Rn=!0,zoomOnPinch:_e=!0,panOnScroll:ce=!1,panOnScrollSpeed:Re=.5,panOnScrollMode:Yt=Qr.Free,zoomOnDoubleClick:Vn=!0,panOnDrag:We=!0,onPaneClick:rf,onPaneMouseEnter:oo,onPaneMouseMove:ao,onPaneMouseLeave:so,onPaneScroll:ii,onPaneContextMenu:lo,paneClickDistance:vr=1,nodeClickDistance:of=0,children:hl,onReconnect:Sa,onReconnectStart:xr,onReconnectEnd:af,onEdgeContextMenu:pl,onEdgeDoubleClick:ml,onEdgeMouseEnter:gl,onEdgeMouseMove:wa,onEdgeMouseLeave:Ea,reconnectRadius:yl=10,onNodesChange:vl,onEdgesChange:qn,noDragClassName:be="nodrag",noWheelClassName:Oe="nowheel",noPanClassName:ri="nopan",fitView:uo,fitViewOptions:xl,connectOnClick:sf,attributionPosition:bl,proOptions:br,defaultEdgeOptions:_a,elevateNodesOnSelect:Oi=!0,elevateEdgesOnSelect:zi=!1,disableKeyboardA11y:Di=!1,autoPanOnConnect:Li,autoPanOnNodeDrag:he,autoPanSpeed:Sl,connectionRadius:wl,isValidConnection:oi,onError:ji,style:lf,id:Ca,nodeDragThreshold:El,connectionDragThreshold:uf,viewport:co,onViewportChange:fo,width:On,height:He,colorMode:_l="light",debug:cf,onScroll:ho,ariaLabelConfig:Cl,zIndexMode:Sr="basic",...ff},Pe){const wr=Ca||"1",Tl=lz(_l),Ta=F.useCallback(ai=>{ai.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),ho?.(ai)},[ho]);return w.jsx("div",{"data-testid":"rf__wrapper",...ff,onScroll:Ta,style:{...lf,...R3},ref:Pe,className:xe(["react-flow",s,Tl]),id:Ca,role:"application",children:w.jsxs(A3,{nodes:t,edges:n,width:On,height:He,fitView:uo,fitViewOptions:xl,minZoom:et,maxZoom:ut,nodeOrigin:Je,nodeExtent:Pt,zIndexMode:Sr,children:[w.jsx(M3,{onInit:h,onNodeClick:f,onEdgeClick:d,onNodeMouseEnter:z,onNodeMouseMove:E,onNodeMouseLeave:M,onNodeContextMenu:H,onNodeDoubleClick:R,nodeTypes:l,edgeTypes:c,connectionLineType:X,connectionLineStyle:A,connectionLineComponent:it,connectionLineContainerStyle:ct,selectionKeyCode:dt,selectionOnDrag:lt,selectionMode:pt,deleteKeyCode:ft,multiSelectionKeyCode:wt,panActivationKeyCode:St,zoomActivationKeyCode:vt,onlyRenderVisibleElements:Ht,defaultViewport:Un,translateExtent:gt,minZoom:et,maxZoom:ut,preventScrolling:Mt,zoomOnScroll:Rn,zoomOnPinch:_e,zoomOnDoubleClick:Vn,panOnScroll:ce,panOnScrollSpeed:Re,panOnScrollMode:Yt,panOnDrag:We,onPaneClick:rf,onPaneMouseEnter:oo,onPaneMouseMove:ao,onPaneMouseLeave:so,onPaneScroll:ii,onPaneContextMenu:lo,paneClickDistance:vr,nodeClickDistance:of,onSelectionContextMenu:U,onSelectionStart:G,onSelectionEnd:$,onReconnect:Sa,onReconnectStart:xr,onReconnectEnd:af,onEdgeContextMenu:pl,onEdgeDoubleClick:ml,onEdgeMouseEnter:gl,onEdgeMouseMove:wa,onEdgeMouseLeave:Ea,reconnectRadius:yl,defaultMarkerColor:je,noDragClassName:be,noWheelClassName:Oe,noPanClassName:ri,rfId:wr,disableKeyboardA11y:Di,nodeExtent:Pt,viewport:co,onViewportChange:fo}),w.jsx(sz,{nodes:t,edges:n,defaultNodes:i,defaultEdges:o,onConnect:x,onConnectStart:b,onConnectEnd:_,onClickConnectStart:T,onClickConnectEnd:C,nodesDraggable:Qt,autoPanOnNodeFocus:Ee,nodesConnectable:ie,nodesFocusable:Ae,edgesFocusable:yn,edgesReconnectable:An,elementsSelectable:ue,elevateNodesOnSelect:Oi,elevateEdgesOnSelect:zi,minZoom:et,maxZoom:ut,nodeExtent:Pt,onNodesChange:vl,onEdgesChange:qn,snapToGrid:Et,snapGrid:Rt,connectionMode:L,translateExtent:gt,connectOnClick:sf,defaultEdgeOptions:_a,fitView:uo,fitViewOptions:xl,onNodesDelete:J,onEdgesDelete:j,onDelete:V,onNodeDragStart:B,onNodeDrag:P,onNodeDragStop:q,onSelectionDrag:I,onSelectionDragStart:D,onSelectionDragStop:O,onMove:m,onMoveStart:g,onMoveEnd:v,noPanClassName:ri,nodeOrigin:Je,rfId:wr,autoPanOnConnect:Li,autoPanOnNodeDrag:he,autoPanSpeed:Sl,onError:ji,connectionRadius:wl,isValidConnection:oi,selectNodesOnDrag:jt,nodeDragThreshold:El,connectionDragThreshold:uf,onBeforeDelete:k,debug:cf,ariaLabelConfig:Cl,zIndexMode:Sr}),w.jsx(iz,{onSelectionChange:K}),hl,w.jsx(JO,{proOptions:br,position:bl}),w.jsx(KO,{rfId:wr,disableKeyboardA11y:Di})]})})}var z3=vw(O3);function D3({dimensions:t,lineWidth:n,variant:i,className:o}){return w.jsx("path",{strokeWidth:n,d:`M${t[0]/2} 0 V${t[1]} M0 ${t[1]/2} H${t[0]}`,className:xe(["react-flow__background-pattern",i,o])})}function L3({radius:t,className:n}){return w.jsx("circle",{cx:t,cy:t,r:t,className:xe(["react-flow__background-pattern","dots",n])})}var gr;(function(t){t.Lines="lines",t.Dots="dots",t.Cross="cross"})(gr||(gr={}));const j3={[gr.Dots]:1,[gr.Lines]:1,[gr.Cross]:6},B3=t=>({transform:t.transform,patternId:`pattern-${t.rfId}`});function Vw({id:t,variant:n=gr.Dots,gap:i=20,size:o,lineWidth:s=1,offset:l=0,color:c,bgColor:f,style:d,className:h,patternClassName:m}){const g=F.useRef(null),{transform:v,patternId:x}=It(B3,oe),b=o||j3[n],_=n===gr.Dots,T=n===gr.Cross,C=Array.isArray(i)?i:[i,i],z=[C[0]*v[2]||1,C[1]*v[2]||1],E=b*v[2],M=Array.isArray(l)?l:[l,l],H=T?[E,E]:z,R=[M[0]*v[2]||1+H[0]/2,M[1]*v[2]||1+H[1]/2],B=`${x}${t||""}`;return w.jsxs("svg",{className:xe(["react-flow__background",h]),style:{...d,...Jc,"--xy-background-color-props":f,"--xy-background-pattern-color-props":c},ref:g,"data-testid":"rf__background",children:[w.jsx("pattern",{id:B,x:v[0]%z[0],y:v[1]%z[1],width:z[0],height:z[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${R[0]},-${R[1]})`,children:_?w.jsx(L3,{radius:E/2,className:m}):w.jsx(D3,{dimensions:H,lineWidth:s,variant:n,className:m})}),w.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${B})`})]})}Vw.displayName="Background";const H3=F.memo(Vw);function P3(){return w.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:w.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function I3(){return w.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:w.jsx("path",{d:"M0 0h32v4.2H0z"})})}function U3(){return w.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:w.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 V3(){return w.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:w.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 q3(){return w.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:w.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 $u({children:t,className:n,...i}){return w.jsx("button",{type:"button",className:xe(["react-flow__controls-button",n]),...i,children:t})}const F3=t=>({isInteractive:t.nodesDraggable||t.nodesConnectable||t.elementsSelectable,minZoomReached:t.transform[2]<=t.minZoom,maxZoomReached:t.transform[2]>=t.maxZoom,ariaLabelConfig:t.ariaLabelConfig});function qw({style:t,showZoom:n=!0,showFitView:i=!0,showInteractive:o=!0,fitViewOptions:s,onZoomIn:l,onZoomOut:c,onFitView:f,onInteractiveChange:d,className:h,children:m,position:g="bottom-left",orientation:v="vertical","aria-label":x}){const b=ae(),{isInteractive:_,minZoomReached:T,maxZoomReached:C,ariaLabelConfig:z}=It(F3,oe),{zoomIn:E,zoomOut:M,fitView:H}=Mm(),R=()=>{E(),l?.()},B=()=>{M(),c?.()},P=()=>{H(s),f?.()},q=()=>{b.setState({nodesDraggable:!_,nodesConnectable:!_,elementsSelectable:!_}),d?.(!_)},J=v==="horizontal"?"horizontal":"vertical";return w.jsxs(Kc,{className:xe(["react-flow__controls",J,h]),position:g,style:t,"data-testid":"rf__controls","aria-label":x??z["controls.ariaLabel"],children:[n&&w.jsxs(w.Fragment,{children:[w.jsx($u,{onClick:R,className:"react-flow__controls-zoomin",title:z["controls.zoomIn.ariaLabel"],"aria-label":z["controls.zoomIn.ariaLabel"],disabled:C,children:w.jsx(P3,{})}),w.jsx($u,{onClick:B,className:"react-flow__controls-zoomout",title:z["controls.zoomOut.ariaLabel"],"aria-label":z["controls.zoomOut.ariaLabel"],disabled:T,children:w.jsx(I3,{})})]}),i&&w.jsx($u,{className:"react-flow__controls-fitview",onClick:P,title:z["controls.fitView.ariaLabel"],"aria-label":z["controls.fitView.ariaLabel"],children:w.jsx(U3,{})}),o&&w.jsx($u,{className:"react-flow__controls-interactive",onClick:q,title:z["controls.interactive.ariaLabel"],"aria-label":z["controls.interactive.ariaLabel"],children:_?w.jsx(q3,{}):w.jsx(V3,{})}),m]})}qw.displayName="Controls";const Y3=F.memo(qw);function X3({id:t,x:n,y:i,width:o,height:s,style:l,color:c,strokeColor:f,strokeWidth:d,className:h,borderRadius:m,shapeRendering:g,selected:v,onClick:x}){const{background:b,backgroundColor:_}=l||{},T=c||b||_;return w.jsx("rect",{className:xe(["react-flow__minimap-node",{selected:v},h]),x:n,y:i,rx:m,ry:m,width:o,height:s,style:{fill:T,stroke:f,strokeWidth:d},shapeRendering:g,onClick:x?C=>x(C,t):void 0})}const G3=F.memo(X3),Q3=t=>t.nodes.map(n=>n.id),Qh=t=>t instanceof Function?t:()=>t;function $3({nodeStrokeColor:t,nodeColor:n,nodeClassName:i="",nodeBorderRadius:o=5,nodeStrokeWidth:s,nodeComponent:l=G3,onClick:c}){const f=It(Q3,oe),d=Qh(n),h=Qh(t),m=Qh(i),g=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return w.jsx(w.Fragment,{children:f.map(v=>w.jsx(K3,{id:v,nodeColorFunc:d,nodeStrokeColorFunc:h,nodeClassNameFunc:m,nodeBorderRadius:o,nodeStrokeWidth:s,NodeComponent:l,onClick:c,shapeRendering:g},v))})}function Z3({id:t,nodeColorFunc:n,nodeStrokeColorFunc:i,nodeClassNameFunc:o,nodeBorderRadius:s,nodeStrokeWidth:l,shapeRendering:c,NodeComponent:f,onClick:d}){const{node:h,x:m,y:g,width:v,height:x}=It(b=>{const _=b.nodeLookup.get(t);if(!_)return{node:void 0,x:0,y:0,width:0,height:0};const T=_.internals.userNode,{x:C,y:z}=_.internals.positionAbsolute,{width:E,height:M}=Ri(T);return{node:T,x:C,y:z,width:E,height:M}},oe);return!h||h.hidden||!XS(h)?null:w.jsx(f,{x:m,y:g,width:v,height:x,style:h.style,selected:!!h.selected,className:o(h),color:n(h),borderRadius:s,strokeColor:i(h),strokeWidth:l,shapeRendering:c,onClick:d,id:h.id})}const K3=F.memo(Z3);var J3=F.memo($3);const W3=200,tD=150,eD=t=>!t.hidden,nD=t=>{const n={x:-t.transform[0]/t.transform[2],y:-t.transform[1]/t.transform[2],width:t.width/t.transform[2],height:t.height/t.transform[2]};return{viewBB:n,boundingRect:t.nodeLookup.size>0?YS(ll(t.nodeLookup,{filter:eD}),n):n,rfId:t.rfId,panZoom:t.panZoom,translateExtent:t.translateExtent,flowWidth:t.width,flowHeight:t.height,ariaLabelConfig:t.ariaLabelConfig}},iD="react-flow__minimap-desc";function Fw({style:t,className:n,nodeStrokeColor:i,nodeColor:o,nodeClassName:s="",nodeBorderRadius:l=5,nodeStrokeWidth:c,nodeComponent:f,bgColor:d,maskColor:h,maskStrokeColor:m,maskStrokeWidth:g,position:v="bottom-right",onClick:x,onNodeClick:b,pannable:_=!1,zoomable:T=!1,ariaLabel:C,inversePan:z,zoomStep:E=1,offsetScale:M=5}){const H=ae(),R=F.useRef(null),{boundingRect:B,viewBB:P,rfId:q,panZoom:J,translateExtent:j,flowWidth:V,flowHeight:K,ariaLabelConfig:D}=It(nD,oe),I=t?.width??W3,O=t?.height??tD,U=B.width/I,G=B.height/O,$=Math.max(U,G),k=$*I,L=$*O,X=M*$,A=B.x-(k-B.width)/2-X,it=B.y-(L-B.height)/2-X,ct=k+X*2,ft=L+X*2,dt=`${iD}-${q}`,lt=F.useRef(0),pt=F.useRef();lt.current=$,F.useEffect(()=>{if(R.current&&J)return pt.current=_O({domNode:R.current,panZoom:J,getTransform:()=>H.getState().transform,getViewScale:()=>lt.current}),()=>{pt.current?.destroy()}},[J]),F.useEffect(()=>{pt.current?.update({translateExtent:j,width:V,height:K,inversePan:z,pannable:_,zoomStep:E,zoomable:T})},[_,T,z,E,j,V,K]);const St=x?Et=>{const[Rt,Ht]=pt.current?.pointer(Et)||[0,0];x(Et,{x:Rt,y:Ht})}:void 0,wt=b?F.useCallback((Et,Rt)=>{const Ht=H.getState().nodeLookup.get(Rt).internals.userNode;b(Et,Ht)},[]):void 0,vt=C??D["minimap.ariaLabel"];return w.jsx(Kc,{position:v,style:{...t,"--xy-minimap-background-color-props":typeof d=="string"?d:void 0,"--xy-minimap-mask-background-color-props":typeof h=="string"?h:void 0,"--xy-minimap-mask-stroke-color-props":typeof m=="string"?m:void 0,"--xy-minimap-mask-stroke-width-props":typeof g=="number"?g*$:void 0,"--xy-minimap-node-background-color-props":typeof o=="string"?o:void 0,"--xy-minimap-node-stroke-color-props":typeof i=="string"?i:void 0,"--xy-minimap-node-stroke-width-props":typeof c=="number"?c:void 0},className:xe(["react-flow__minimap",n]),"data-testid":"rf__minimap",children:w.jsxs("svg",{width:I,height:O,viewBox:`${A} ${it} ${ct} ${ft}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":dt,ref:R,onClick:St,children:[vt&&w.jsx("title",{id:dt,children:vt}),w.jsx(J3,{onClick:wt,nodeColor:o,nodeStrokeColor:i,nodeBorderRadius:l,nodeClassName:s,nodeStrokeWidth:c,nodeComponent:f}),w.jsx("path",{className:"react-flow__minimap-mask",d:`M${A-X},${it-X}h${ct+X*2}v${ft+X*2}h${-ct-X*2}z
15
+ M${P.x},${P.y}h${P.width}v${P.height}h${-P.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}Fw.displayName="MiniMap";F.memo(Fw);const rD=t=>n=>t?`${Math.max(1/n.transform[2],1)}`:void 0,oD={[ya.Line]:"right",[ya.Handle]:"bottom-right"};function aD({nodeId:t,position:n,variant:i=ya.Handle,className:o,style:s=void 0,children:l,color:c,minWidth:f=10,minHeight:d=10,maxWidth:h=Number.MAX_VALUE,maxHeight:m=Number.MAX_VALUE,keepAspectRatio:g=!1,resizeDirection:v,autoScale:x=!0,shouldResize:b,onResizeStart:_,onResize:T,onResizeEnd:C}){const z=ww(),E=typeof t=="string"?t:z,M=ae(),H=F.useRef(null),R=i===ya.Handle,B=It(F.useCallback(rD(R&&x),[R,x]),oe),P=F.useRef(null),q=n??oD[i];F.useEffect(()=>{if(!(!H.current||!E))return P.current||(P.current=HO({domNode:H.current,nodeId:E,getStoreItems:()=>{const{nodeLookup:j,transform:V,snapGrid:K,snapToGrid:D,nodeOrigin:I,domNode:O}=M.getState();return{nodeLookup:j,transform:V,snapGrid:K,snapToGrid:D,nodeOrigin:I,paneDomNode:O}},onChange:(j,V)=>{const{triggerNodeChanges:K,nodeLookup:D,parentLookup:I,nodeOrigin:O}=M.getState(),U=[],G={x:j.x,y:j.y},$=D.get(E);if($&&$.expandParent&&$.parentId){const k=$.origin??O,L=j.width??$.measured.width??0,X=j.height??$.measured.height??0,A={id:$.id,parentId:$.parentId,rect:{width:L,height:X,...GS({x:j.x??$.position.x,y:j.y??$.position.y},{width:L,height:X},$.parentId,D,k)}},it=Tm([A],D,I,O);U.push(...it),G.x=j.x?Math.max(k[0]*L,j.x):void 0,G.y=j.y?Math.max(k[1]*X,j.y):void 0}if(G.x!==void 0&&G.y!==void 0){const k={id:E,type:"position",position:{...G}};U.push(k)}if(j.width!==void 0&&j.height!==void 0){const L={id:E,type:"dimensions",resizing:!0,setAttributes:v?v==="horizontal"?"width":"height":!0,dimensions:{width:j.width,height:j.height}};U.push(L)}for(const k of V){const L={...k,type:"position"};U.push(L)}K(U)},onEnd:({width:j,height:V})=>{const K={id:E,type:"dimensions",resizing:!1,dimensions:{width:j,height:V}};M.getState().triggerNodeChanges([K])}})),P.current.update({controlPosition:q,boundaries:{minWidth:f,minHeight:d,maxWidth:h,maxHeight:m},keepAspectRatio:g,resizeDirection:v,onResizeStart:_,onResize:T,onResizeEnd:C,shouldResize:b}),()=>{P.current?.destroy()}},[q,f,d,h,m,g,_,T,C,b]);const J=q.split("-");return w.jsx("div",{className:xe(["react-flow__resize-control","nodrag",...J,i,o]),ref:H,style:{...s,scale:B,...c&&{[R?"backgroundColor":"borderColor"]:c}},children:l})}F.memo(aD);const Tb=200,sD=60,Mb=40,lD=40;function uD(t,n){if(t.length===0)return{};const i={},o={};for(const m of t)o[m.nodeId]=m,i[m.nodeId]||(i[m.nodeId]=[]);for(const m of t)m.parentNodeId&&i[m.parentNodeId]&&i[m.parentNodeId].push(m.nodeId);const s=t.filter(m=>!m.parentNodeId||!o[m.parentNodeId]),l={},c=[];for(const m of s)l[m.nodeId]=0,c.push(m.nodeId);for(;c.length>0;){const m=c.shift(),g=i[m]??[];for(const v of g)v in l||(l[v]=l[m]+1,c.push(v))}for(const m of t)m.nodeId in l||(l[m.nodeId]=0);const f={};let d=0;for(const[m,g]of Object.entries(l))f[g]||(f[g]=[]),f[g].push(m),g>d&&(d=g);for(const m of Object.keys(f))f[Number(m)].sort((g,v)=>{const x=o[g],b=o[v];return(x?.createdAtEventIndex??0)-(b?.createdAtEventIndex??0)});const h={};for(let m=0;m<=d;m++){const g=f[m]??[],x=-(g.length*Tb+(g.length-1)*Mb)/2;for(let b=0;b<g.length;b++)h[g[b]]={x:x+b*(Tb+Mb),y:m*(sD+lD)}}return h}const cD={step:{bg:"#1e3a5f",border:"#3b82f6"},checkpoint:{bg:"#1a3d2e",border:"#22c55e"},blocked_attempt:{bg:"#3d1a1a",border:"#ef4444"}};function fD({run:t,onNodeClick:n}){const{nodes:i,edges:o}=F.useMemo(()=>{const l=uD(t.nodes,t.edges),c=t.nodes.map(d=>{const h=cD[d.nodeKind],m=l[d.nodeId]??{x:0,y:0},g=!!d.stepLabel;return{id:d.nodeId,position:m,data:{label:dD(d)},style:{background:h.bg,border:`2px solid ${d.isPreferredTip?"#fbbf24":h.border}`,borderRadius:d.nodeKind==="checkpoint"?"50%":"8px",color:"#fafafa",padding:g?"6px 10px":"8px 12px",fontSize:g?"10px":"11px",fontFamily:g?"system-ui, sans-serif":"monospace",width:d.nodeKind==="checkpoint"?40:void 0,maxWidth:g?180:void 0,height:d.nodeKind==="checkpoint"?40:void 0,display:"flex",alignItems:"center",justifyContent:"center",textAlign:"center",boxShadow:d.isPreferredTip?"0 0 12px rgba(251, 191, 36, 0.4)":"none",cursor:"pointer",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"normal",lineHeight:"1.3",wordBreak:"break-word"}}}),f=t.edges.map((d,h)=>({id:`e-${h}`,source:d.fromNodeId,target:d.toNodeId,style:{stroke:d.edgeKind==="checkpoint"?"#22c55e":"#3b82f6",strokeWidth:2},animated:d.edgeKind==="acked_step"}));return{nodes:c,edges:f}},[t]),s=F.useCallback((l,c)=>n?.(c.id),[n]);return w.jsxs(z3,{nodes:i,edges:o,fitView:!0,proOptions:{hideAttribution:!0},nodesDraggable:!1,nodesConnectable:!1,colorMode:"dark",onNodeClick:s,children:[w.jsx(H3,{color:"#333",gap:20}),w.jsx(Y3,{})]})}function dD(t){const n=t.stepLabel??t.nodeId.slice(-8);return t.isPreferredTip?`* ${n}`:t.isTip?`> ${n}`:n}function hD(t,n){const i={};return(t[t.length-1]===""?[...t,""]:t).join((i.padRight?" ":"")+","+(i.padLeft===!1?"":" ")).trim()}const pD=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,mD=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,gD={};function Nb(t,n){return(gD.jsx?mD:pD).test(t)}const yD=/[ \t\n\f\r]/g;function vD(t){return typeof t=="object"?t.type==="text"?kb(t.value):!1:kb(t)}function kb(t){return t.replace(yD,"")===""}class fl{constructor(n,i,o){this.normal=i,this.property=n,o&&(this.space=o)}}fl.prototype.normal={};fl.prototype.property={};fl.prototype.space=void 0;function Yw(t,n){const i={},o={};for(const s of t)Object.assign(i,s.property),Object.assign(o,s.normal);return new fl(i,o,n)}function Dp(t){return t.toLowerCase()}class Ke{constructor(n,i){this.attribute=i,this.property=n}}Ke.prototype.attribute="";Ke.prototype.booleanish=!1;Ke.prototype.boolean=!1;Ke.prototype.commaOrSpaceSeparated=!1;Ke.prototype.commaSeparated=!1;Ke.prototype.defined=!1;Ke.prototype.mustUseProperty=!1;Ke.prototype.number=!1;Ke.prototype.overloadedBoolean=!1;Ke.prototype.property="";Ke.prototype.spaceSeparated=!1;Ke.prototype.space=void 0;let xD=0;const At=ro(),ve=ro(),Lp=ro(),ht=ro(),Wt=ro(),oa=ro(),ln=ro();function ro(){return 2**++xD}const jp=Object.freeze(Object.defineProperty({__proto__:null,boolean:At,booleanish:ve,commaOrSpaceSeparated:ln,commaSeparated:oa,number:ht,overloadedBoolean:Lp,spaceSeparated:Wt},Symbol.toStringTag,{value:"Module"})),$h=Object.keys(jp);class km extends Ke{constructor(n,i,o,s){let l=-1;if(super(n,i),Ab(this,"space",s),typeof o=="number")for(;++l<$h.length;){const c=$h[l];Ab(this,$h[l],(o&jp[c])===jp[c])}}}km.prototype.defined=!0;function Ab(t,n,i){i&&(t[n]=i)}function va(t){const n={},i={};for(const[o,s]of Object.entries(t.properties)){const l=new km(o,t.transform(t.attributes||{},o),s,t.space);t.mustUseProperty&&t.mustUseProperty.includes(o)&&(l.mustUseProperty=!0),n[o]=l,i[Dp(o)]=o,i[Dp(l.attribute)]=o}return new fl(n,i,t.space)}const Xw=va({properties:{ariaActiveDescendant:null,ariaAtomic:ve,ariaAutoComplete:null,ariaBusy:ve,ariaChecked:ve,ariaColCount:ht,ariaColIndex:ht,ariaColSpan:ht,ariaControls:Wt,ariaCurrent:null,ariaDescribedBy:Wt,ariaDetails:null,ariaDisabled:ve,ariaDropEffect:Wt,ariaErrorMessage:null,ariaExpanded:ve,ariaFlowTo:Wt,ariaGrabbed:ve,ariaHasPopup:null,ariaHidden:ve,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Wt,ariaLevel:ht,ariaLive:null,ariaModal:ve,ariaMultiLine:ve,ariaMultiSelectable:ve,ariaOrientation:null,ariaOwns:Wt,ariaPlaceholder:null,ariaPosInSet:ht,ariaPressed:ve,ariaReadOnly:ve,ariaRelevant:null,ariaRequired:ve,ariaRoleDescription:Wt,ariaRowCount:ht,ariaRowIndex:ht,ariaRowSpan:ht,ariaSelected:ve,ariaSetSize:ht,ariaSort:null,ariaValueMax:ht,ariaValueMin:ht,ariaValueNow:ht,ariaValueText:null,role:null},transform(t,n){return n==="role"?n:"aria-"+n.slice(4).toLowerCase()}});function Gw(t,n){return n in t?t[n]:n}function Qw(t,n){return Gw(t,n.toLowerCase())}const bD=va({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:oa,acceptCharset:Wt,accessKey:Wt,action:null,allow:null,allowFullScreen:At,allowPaymentRequest:At,allowUserMedia:At,alt:null,as:null,async:At,autoCapitalize:null,autoComplete:Wt,autoFocus:At,autoPlay:At,blocking:Wt,capture:null,charSet:null,checked:At,cite:null,className:Wt,cols:ht,colSpan:null,content:null,contentEditable:ve,controls:At,controlsList:Wt,coords:ht|oa,crossOrigin:null,data:null,dateTime:null,decoding:null,default:At,defer:At,dir:null,dirName:null,disabled:At,download:Lp,draggable:ve,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:At,formTarget:null,headers:Wt,height:ht,hidden:Lp,high:ht,href:null,hrefLang:null,htmlFor:Wt,httpEquiv:Wt,id:null,imageSizes:null,imageSrcSet:null,inert:At,inputMode:null,integrity:null,is:null,isMap:At,itemId:null,itemProp:Wt,itemRef:Wt,itemScope:At,itemType:Wt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:At,low:ht,manifest:null,max:null,maxLength:ht,media:null,method:null,min:null,minLength:ht,multiple:At,muted:At,name:null,nonce:null,noModule:At,noValidate:At,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:At,optimum:ht,pattern:null,ping:Wt,placeholder:null,playsInline:At,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:At,referrerPolicy:null,rel:Wt,required:At,reversed:At,rows:ht,rowSpan:ht,sandbox:Wt,scope:null,scoped:At,seamless:At,selected:At,shadowRootClonable:At,shadowRootDelegatesFocus:At,shadowRootMode:null,shape:null,size:ht,sizes:null,slot:null,span:ht,spellCheck:ve,src:null,srcDoc:null,srcLang:null,srcSet:null,start:ht,step:null,style:null,tabIndex:ht,target:null,title:null,translate:null,type:null,typeMustMatch:At,useMap:null,value:ve,width:ht,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Wt,axis:null,background:null,bgColor:null,border:ht,borderColor:null,bottomMargin:ht,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:At,declare:At,event:null,face:null,frame:null,frameBorder:null,hSpace:ht,leftMargin:ht,link:null,longDesc:null,lowSrc:null,marginHeight:ht,marginWidth:ht,noResize:At,noHref:At,noShade:At,noWrap:At,object:null,profile:null,prompt:null,rev:null,rightMargin:ht,rules:null,scheme:null,scrolling:ve,standby:null,summary:null,text:null,topMargin:ht,valueType:null,version:null,vAlign:null,vLink:null,vSpace:ht,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:At,disableRemotePlayback:At,prefix:null,property:null,results:ht,security:null,unselectable:null},space:"html",transform:Qw}),SD=va({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:ln,accentHeight:ht,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:ht,amplitude:ht,arabicForm:null,ascent:ht,attributeName:null,attributeType:null,azimuth:ht,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:ht,by:null,calcMode:null,capHeight:ht,className:Wt,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:ht,diffuseConstant:ht,direction:null,display:null,dur:null,divisor:ht,dominantBaseline:null,download:At,dx:null,dy:null,edgeMode:null,editable:null,elevation:ht,enableBackground:null,end:null,event:null,exponent:ht,externalResourcesRequired:null,fill:null,fillOpacity:ht,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:oa,g2:oa,glyphName:oa,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:ht,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:ht,horizOriginX:ht,horizOriginY:ht,id:null,ideographic:ht,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:ht,k:ht,k1:ht,k2:ht,k3:ht,k4:ht,kernelMatrix:ln,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:ht,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:ht,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:ht,overlineThickness:ht,paintOrder:null,panose1:null,path:null,pathLength:ht,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Wt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:ht,pointsAtY:ht,pointsAtZ:ht,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:ln,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:ln,rev:ln,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:ln,requiredFeatures:ln,requiredFonts:ln,requiredFormats:ln,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:ht,specularExponent:ht,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:ht,strikethroughThickness:ht,string:null,stroke:null,strokeDashArray:ln,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:ht,strokeOpacity:ht,strokeWidth:null,style:null,surfaceScale:ht,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:ln,tabIndex:ht,tableValues:null,target:null,targetX:ht,targetY:ht,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:ln,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:ht,underlineThickness:ht,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:ht,values:null,vAlphabetic:ht,vMathematical:ht,vectorEffect:null,vHanging:ht,vIdeographic:ht,version:null,vertAdvY:ht,vertOriginX:ht,vertOriginY:ht,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:ht,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Gw}),$w=va({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(t,n){return"xlink:"+n.slice(5).toLowerCase()}}),Zw=va({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Qw}),Kw=va({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(t,n){return"xml:"+n.slice(3).toLowerCase()}}),wD={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"},ED=/[A-Z]/g,Rb=/-[a-z]/g,_D=/^data[-\w.:]+$/i;function CD(t,n){const i=Dp(n);let o=n,s=Ke;if(i in t.normal)return t.property[t.normal[i]];if(i.length>4&&i.slice(0,4)==="data"&&_D.test(n)){if(n.charAt(4)==="-"){const l=n.slice(5).replace(Rb,MD);o="data"+l.charAt(0).toUpperCase()+l.slice(1)}else{const l=n.slice(4);if(!Rb.test(l)){let c=l.replace(ED,TD);c.charAt(0)!=="-"&&(c="-"+c),n="data"+c}}s=km}return new s(o,n)}function TD(t){return"-"+t.toLowerCase()}function MD(t){return t.charAt(1).toUpperCase()}const ND=Yw([Xw,bD,$w,Zw,Kw],"html"),Am=Yw([Xw,SD,$w,Zw,Kw],"svg");function kD(t){return t.join(" ").trim()}var Go={},Zh,Ob;function AD(){if(Ob)return Zh;Ob=1;var t=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,n=/\n/g,i=/^\s*/,o=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,s=/^:\s*/,l=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,c=/^[;\s]*/,f=/^\s+|\s+$/g,d=`
16
+ `,h="/",m="*",g="",v="comment",x="declaration";function b(T,C){if(typeof T!="string")throw new TypeError("First argument must be a string");if(!T)return[];C=C||{};var z=1,E=1;function M(D){var I=D.match(n);I&&(z+=I.length);var O=D.lastIndexOf(d);E=~O?D.length-O:E+D.length}function H(){var D={line:z,column:E};return function(I){return I.position=new R(D),q(),I}}function R(D){this.start=D,this.end={line:z,column:E},this.source=C.source}R.prototype.content=T;function B(D){var I=new Error(C.source+":"+z+":"+E+": "+D);if(I.reason=D,I.filename=C.source,I.line=z,I.column=E,I.source=T,!C.silent)throw I}function P(D){var I=D.exec(T);if(I){var O=I[0];return M(O),T=T.slice(O.length),I}}function q(){P(i)}function J(D){var I;for(D=D||[];I=j();)I!==!1&&D.push(I);return D}function j(){var D=H();if(!(h!=T.charAt(0)||m!=T.charAt(1))){for(var I=2;g!=T.charAt(I)&&(m!=T.charAt(I)||h!=T.charAt(I+1));)++I;if(I+=2,g===T.charAt(I-1))return B("End of comment missing");var O=T.slice(2,I-2);return E+=2,M(O),T=T.slice(I),E+=2,D({type:v,comment:O})}}function V(){var D=H(),I=P(o);if(I){if(j(),!P(s))return B("property missing ':'");var O=P(l),U=D({type:x,property:_(I[0].replace(t,g)),value:O?_(O[0].replace(t,g)):g});return P(c),U}}function K(){var D=[];J(D);for(var I;I=V();)I!==!1&&(D.push(I),J(D));return D}return q(),K()}function _(T){return T?T.replace(f,g):g}return Zh=b,Zh}var zb;function RD(){if(zb)return Go;zb=1;var t=Go&&Go.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(Go,"__esModule",{value:!0}),Go.default=i;const n=t(AD());function i(o,s){let l=null;if(!o||typeof o!="string")return l;const c=(0,n.default)(o),f=typeof s=="function";return c.forEach(d=>{if(d.type!=="declaration")return;const{property:h,value:m}=d;f?s(h,m,d):m&&(l=l||{},l[h]=m)}),l}return Go}var Es={},Db;function OD(){if(Db)return Es;Db=1,Object.defineProperty(Es,"__esModule",{value:!0}),Es.camelCase=void 0;var t=/^--[a-zA-Z0-9_-]+$/,n=/-([a-z])/g,i=/^[^-]+$/,o=/^-(webkit|moz|ms|o|khtml)-/,s=/^-(ms)-/,l=function(h){return!h||i.test(h)||t.test(h)},c=function(h,m){return m.toUpperCase()},f=function(h,m){return"".concat(m,"-")},d=function(h,m){return m===void 0&&(m={}),l(h)?h:(h=h.toLowerCase(),m.reactCompat?h=h.replace(s,f):h=h.replace(o,f),h.replace(n,c))};return Es.camelCase=d,Es}var _s,Lb;function zD(){if(Lb)return _s;Lb=1;var t=_s&&_s.__importDefault||function(s){return s&&s.__esModule?s:{default:s}},n=t(RD()),i=OD();function o(s,l){var c={};return!s||typeof s!="string"||(0,n.default)(s,function(f,d){f&&d&&(c[(0,i.camelCase)(f,l)]=d)}),c}return o.default=o,_s=o,_s}var DD=zD();const LD=Dc(DD),Jw=Ww("end"),Rm=Ww("start");function Ww(t){return n;function n(i){const o=i&&i.position&&i.position[t]||{};if(typeof o.line=="number"&&o.line>0&&typeof o.column=="number"&&o.column>0)return{line:o.line,column:o.column,offset:typeof o.offset=="number"&&o.offset>-1?o.offset:void 0}}}function jD(t){const n=Rm(t),i=Jw(t);if(n&&i)return{start:n,end:i}}function Ls(t){return!t||typeof t!="object"?"":"position"in t||"type"in t?jb(t.position):"start"in t||"end"in t?jb(t):"line"in t||"column"in t?Bp(t):""}function Bp(t){return Bb(t&&t.line)+":"+Bb(t&&t.column)}function jb(t){return Bp(t&&t.start)+"-"+Bp(t&&t.end)}function Bb(t){return t&&typeof t=="number"?t:1}class Le extends Error{constructor(n,i,o){super(),typeof i=="string"&&(o=i,i=void 0);let s="",l={},c=!1;if(i&&("line"in i&&"column"in i?l={place:i}:"start"in i&&"end"in i?l={place:i}:"type"in i?l={ancestors:[i],place:i.position}:l={...i}),typeof n=="string"?s=n:!l.cause&&n&&(c=!0,s=n.message,l.cause=n),!l.ruleId&&!l.source&&typeof o=="string"){const d=o.indexOf(":");d===-1?l.ruleId=o:(l.source=o.slice(0,d),l.ruleId=o.slice(d+1))}if(!l.place&&l.ancestors&&l.ancestors){const d=l.ancestors[l.ancestors.length-1];d&&(l.place=d.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=s,this.line=f?f.line:void 0,this.name=Ls(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=c&&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}}Le.prototype.file="";Le.prototype.name="";Le.prototype.reason="";Le.prototype.message="";Le.prototype.stack="";Le.prototype.column=void 0;Le.prototype.line=void 0;Le.prototype.ancestors=void 0;Le.prototype.cause=void 0;Le.prototype.fatal=void 0;Le.prototype.place=void 0;Le.prototype.ruleId=void 0;Le.prototype.source=void 0;const Om={}.hasOwnProperty,BD=new Map,HD=/[A-Z]/g,PD=new Set(["table","tbody","thead","tfoot","tr"]),ID=new Set(["td","th"]),tE="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function UD(t,n){if(!n||n.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const i=n.filePath||void 0;let o;if(n.development){if(typeof n.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");o=$D(i,n.jsxDEV)}else{if(typeof n.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof n.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");o=QD(i,n.jsx,n.jsxs)}const s={Fragment:n.Fragment,ancestors:[],components:n.components||{},create:o,elementAttributeNameCase:n.elementAttributeNameCase||"react",evaluater:n.createEvaluater?n.createEvaluater():void 0,filePath:i,ignoreInvalidStyle:n.ignoreInvalidStyle||!1,passKeys:n.passKeys!==!1,passNode:n.passNode||!1,schema:n.space==="svg"?Am:ND,stylePropertyNameCase:n.stylePropertyNameCase||"dom",tableCellAlignToStyle:n.tableCellAlignToStyle!==!1},l=eE(s,t,void 0);return l&&typeof l!="string"?l:s.create(t,s.Fragment,{children:l||void 0},void 0)}function eE(t,n,i){if(n.type==="element")return VD(t,n,i);if(n.type==="mdxFlowExpression"||n.type==="mdxTextExpression")return qD(t,n);if(n.type==="mdxJsxFlowElement"||n.type==="mdxJsxTextElement")return YD(t,n,i);if(n.type==="mdxjsEsm")return FD(t,n);if(n.type==="root")return XD(t,n,i);if(n.type==="text")return GD(t,n)}function VD(t,n,i){const o=t.schema;let s=o;n.tagName.toLowerCase()==="svg"&&o.space==="html"&&(s=Am,t.schema=s),t.ancestors.push(n);const l=iE(t,n.tagName,!1),c=ZD(t,n);let f=Dm(t,n);return PD.has(n.tagName)&&(f=f.filter(function(d){return typeof d=="string"?!vD(d):!0})),nE(t,c,l,n),zm(c,f),t.ancestors.pop(),t.schema=o,t.create(n,l,c,i)}function qD(t,n){if(n.data&&n.data.estree&&t.evaluater){const o=n.data.estree.body[0];return o.type,t.evaluater.evaluateExpression(o.expression)}el(t,n.position)}function FD(t,n){if(n.data&&n.data.estree&&t.evaluater)return t.evaluater.evaluateProgram(n.data.estree);el(t,n.position)}function YD(t,n,i){const o=t.schema;let s=o;n.name==="svg"&&o.space==="html"&&(s=Am,t.schema=s),t.ancestors.push(n);const l=n.name===null?t.Fragment:iE(t,n.name,!0),c=KD(t,n),f=Dm(t,n);return nE(t,c,l,n),zm(c,f),t.ancestors.pop(),t.schema=o,t.create(n,l,c,i)}function XD(t,n,i){const o={};return zm(o,Dm(t,n)),t.create(n,t.Fragment,o,i)}function GD(t,n){return n.value}function nE(t,n,i,o){typeof i!="string"&&i!==t.Fragment&&t.passNode&&(n.node=o)}function zm(t,n){if(n.length>0){const i=n.length>1?n:n[0];i&&(t.children=i)}}function QD(t,n,i){return o;function o(s,l,c,f){const h=Array.isArray(c.children)?i:n;return f?h(l,c,f):h(l,c)}}function $D(t,n){return i;function i(o,s,l,c){const f=Array.isArray(l.children),d=Rm(o);return n(s,l,c,f,{columnNumber:d?d.column-1:void 0,fileName:t,lineNumber:d?d.line:void 0},void 0)}}function ZD(t,n){const i={};let o,s;for(s in n.properties)if(s!=="children"&&Om.call(n.properties,s)){const l=JD(t,s,n.properties[s]);if(l){const[c,f]=l;t.tableCellAlignToStyle&&c==="align"&&typeof f=="string"&&ID.has(n.tagName)?o=f:i[c]=f}}if(o){const l=i.style||(i.style={});l[t.stylePropertyNameCase==="css"?"text-align":"textAlign"]=o}return i}function KD(t,n){const i={};for(const o of n.attributes)if(o.type==="mdxJsxExpressionAttribute")if(o.data&&o.data.estree&&t.evaluater){const l=o.data.estree.body[0];l.type;const c=l.expression;c.type;const f=c.properties[0];f.type,Object.assign(i,t.evaluater.evaluateExpression(f.argument))}else el(t,n.position);else{const s=o.name;let l;if(o.value&&typeof o.value=="object")if(o.value.data&&o.value.data.estree&&t.evaluater){const f=o.value.data.estree.body[0];f.type,l=t.evaluater.evaluateExpression(f.expression)}else el(t,n.position);else l=o.value===null?!0:o.value;i[s]=l}return i}function Dm(t,n){const i=[];let o=-1;const s=t.passKeys?new Map:BD;for(;++o<n.children.length;){const l=n.children[o];let c;if(t.passKeys){const d=l.type==="element"?l.tagName:l.type==="mdxJsxFlowElement"||l.type==="mdxJsxTextElement"?l.name:void 0;if(d){const h=s.get(d)||0;c=d+"-"+h,s.set(d,h+1)}}const f=eE(t,l,c);f!==void 0&&i.push(f)}return i}function JD(t,n,i){const o=CD(t.schema,n);if(!(i==null||typeof i=="number"&&Number.isNaN(i))){if(Array.isArray(i)&&(i=o.commaSeparated?hD(i):kD(i)),o.property==="style"){let s=typeof i=="object"?i:WD(t,String(i));return t.stylePropertyNameCase==="css"&&(s=t5(s)),["style",s]}return[t.elementAttributeNameCase==="react"&&o.space?wD[o.property]||o.property:o.attribute,i]}}function WD(t,n){try{return LD(n,{reactCompat:!0})}catch(i){if(t.ignoreInvalidStyle)return{};const o=i,s=new Le("Cannot parse `style` attribute",{ancestors:t.ancestors,cause:o,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw s.file=t.filePath||void 0,s.url=tE+"#cannot-parse-style-attribute",s}}function iE(t,n,i){let o;if(!i)o={type:"Literal",value:n};else if(n.includes(".")){const s=n.split(".");let l=-1,c;for(;++l<s.length;){const f=Nb(s[l])?{type:"Identifier",name:s[l]}:{type:"Literal",value:s[l]};c=c?{type:"MemberExpression",object:c,property:f,computed:!!(l&&f.type==="Literal"),optional:!1}:f}o=c}else o=Nb(n)&&!/^[a-z]/.test(n)?{type:"Identifier",name:n}:{type:"Literal",value:n};if(o.type==="Literal"){const s=o.value;return Om.call(t.components,s)?t.components[s]:s}if(t.evaluater)return t.evaluater.evaluateExpression(o);el(t)}function el(t,n){const i=new Le("Cannot handle MDX estrees without `createEvaluater`",{ancestors:t.ancestors,place:n,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw i.file=t.filePath||void 0,i.url=tE+"#cannot-handle-mdx-estrees-without-createevaluater",i}function t5(t){const n={};let i;for(i in t)Om.call(t,i)&&(n[e5(i)]=t[i]);return n}function e5(t){let n=t.replace(HD,n5);return n.slice(0,3)==="ms-"&&(n="-"+n),n}function n5(t){return"-"+t.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"]},i5={};function r5(t,n){const i=i5,o=typeof i.includeImageAlt=="boolean"?i.includeImageAlt:!0,s=typeof i.includeHtml=="boolean"?i.includeHtml:!0;return rE(t,o,s)}function rE(t,n,i){if(o5(t)){if("value"in t)return t.type==="html"&&!i?"":t.value;if(n&&"alt"in t&&t.alt)return t.alt;if("children"in t)return Hb(t.children,n,i)}return Array.isArray(t)?Hb(t,n,i):""}function Hb(t,n,i){const o=[];let s=-1;for(;++s<t.length;)o[s]=rE(t[s],n,i);return o.join("")}function o5(t){return!!(t&&typeof t=="object")}const Pb=document.createElement("i");function Lm(t){const n="&"+t+";";Pb.innerHTML=n;const i=Pb.textContent;return i.charCodeAt(i.length-1)===59&&t!=="semi"||i===n?!1:i}function ei(t,n,i,o){const s=t.length;let l=0,c;if(n<0?n=-n>s?0:s+n:n=n>s?s:n,i=i>0?i:0,o.length<1e4)c=Array.from(o),c.unshift(n,i),t.splice(...c);else for(i&&t.splice(n,i);l<o.length;)c=o.slice(l,l+1e4),c.unshift(n,0),t.splice(...c),l+=1e4,n+=1e4}function Nn(t,n){return t.length>0?(ei(t,t.length,0,n),t):n}const Ib={}.hasOwnProperty;function a5(t){const n={};let i=-1;for(;++i<t.length;)s5(n,t[i]);return n}function s5(t,n){let i;for(i in n){const s=(Ib.call(t,i)?t[i]:void 0)||(t[i]={}),l=n[i];let c;if(l)for(c in l){Ib.call(s,c)||(s[c]=[]);const f=l[c];l5(s[c],Array.isArray(f)?f:f?[f]:[])}}}function l5(t,n){let i=-1;const o=[];for(;++i<n.length;)(n[i].add==="after"?t:o).push(n[i]);ei(t,0,0,o)}function oE(t,n){const i=Number.parseInt(t,n);return i<9||i===11||i>13&&i<32||i>126&&i<160||i>55295&&i<57344||i>64975&&i<65008||(i&65535)===65535||(i&65535)===65534||i>1114111?"�":String.fromCodePoint(i)}function aa(t){return t.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Kn=yr(/[A-Za-z]/),dn=yr(/[\dA-Za-z]/),u5=yr(/[#-'*+\--9=?A-Z^-~]/);function Hp(t){return t!==null&&(t<32||t===127)}const Pp=yr(/\d/),c5=yr(/[\dA-Fa-f]/),f5=yr(/[!-/:-@[-`{-~]/);function Ct(t){return t!==null&&t<-2}function Ze(t){return t!==null&&(t<0||t===32)}function Ft(t){return t===-2||t===-1||t===32}const d5=yr(new RegExp("\\p{P}|\\p{S}","u")),h5=yr(/\s/);function yr(t){return n;function n(i){return i!==null&&i>-1&&t.test(String.fromCharCode(i))}}function xa(t){const n=[];let i=-1,o=0,s=0;for(;++i<t.length;){const l=t.charCodeAt(i);let c="";if(l===37&&dn(t.charCodeAt(i+1))&&dn(t.charCodeAt(i+2)))s=2;else if(l<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(l))||(c=String.fromCharCode(l));else if(l>55295&&l<57344){const f=t.charCodeAt(i+1);l<56320&&f>56319&&f<57344?(c=String.fromCharCode(l,f),s=1):c="�"}else c=String.fromCharCode(l);c&&(n.push(t.slice(o,i),encodeURIComponent(c)),o=i+s+1,c=""),s&&(i+=s,s=0)}return n.join("")+t.slice(o)}function te(t,n,i,o){const s=o?o-1:Number.POSITIVE_INFINITY;let l=0;return c;function c(d){return Ft(d)?(t.enter(i),f(d)):n(d)}function f(d){return Ft(d)&&l++<s?(t.consume(d),f):(t.exit(i),n(d))}}const p5={tokenize:m5};function m5(t){const n=t.attempt(this.parser.constructs.contentInitial,o,s);let i;return n;function o(f){if(f===null){t.consume(f);return}return t.enter("lineEnding"),t.consume(f),t.exit("lineEnding"),te(t,n,"linePrefix")}function s(f){return t.enter("paragraph"),l(f)}function l(f){const d=t.enter("chunkText",{contentType:"text",previous:i});return i&&(i.next=d),i=d,c(f)}function c(f){if(f===null){t.exit("chunkText"),t.exit("paragraph"),t.consume(f);return}return Ct(f)?(t.consume(f),t.exit("chunkText"),l):(t.consume(f),c)}}const g5={tokenize:y5},Ub={tokenize:v5};function y5(t){const n=this,i=[];let o=0,s,l,c;return f;function f(E){if(o<i.length){const M=i[o];return n.containerState=M[1],t.attempt(M[0].continuation,d,h)(E)}return h(E)}function d(E){if(o++,n.containerState._closeFlow){n.containerState._closeFlow=void 0,s&&z();const M=n.events.length;let H=M,R;for(;H--;)if(n.events[H][0]==="exit"&&n.events[H][1].type==="chunkFlow"){R=n.events[H][1].end;break}C(o);let B=M;for(;B<n.events.length;)n.events[B][1].end={...R},B++;return ei(n.events,H+1,0,n.events.slice(M)),n.events.length=B,h(E)}return f(E)}function h(E){if(o===i.length){if(!s)return v(E);if(s.currentConstruct&&s.currentConstruct.concrete)return b(E);n.interrupt=!!(s.currentConstruct&&!s._gfmTableDynamicInterruptHack)}return n.containerState={},t.check(Ub,m,g)(E)}function m(E){return s&&z(),C(o),v(E)}function g(E){return n.parser.lazy[n.now().line]=o!==i.length,c=n.now().offset,b(E)}function v(E){return n.containerState={},t.attempt(Ub,x,b)(E)}function x(E){return o++,i.push([n.currentConstruct,n.containerState]),v(E)}function b(E){if(E===null){s&&z(),C(0),t.consume(E);return}return s=s||n.parser.flow(n.now()),t.enter("chunkFlow",{_tokenizer:s,contentType:"flow",previous:l}),_(E)}function _(E){if(E===null){T(t.exit("chunkFlow"),!0),C(0),t.consume(E);return}return Ct(E)?(t.consume(E),T(t.exit("chunkFlow")),o=0,n.interrupt=void 0,f):(t.consume(E),_)}function T(E,M){const H=n.sliceStream(E);if(M&&H.push(null),E.previous=l,l&&(l.next=E),l=E,s.defineSkip(E.start),s.write(H),n.parser.lazy[E.start.line]){let R=s.events.length;for(;R--;)if(s.events[R][1].start.offset<c&&(!s.events[R][1].end||s.events[R][1].end.offset>c))return;const B=n.events.length;let P=B,q,J;for(;P--;)if(n.events[P][0]==="exit"&&n.events[P][1].type==="chunkFlow"){if(q){J=n.events[P][1].end;break}q=!0}for(C(o),R=B;R<n.events.length;)n.events[R][1].end={...J},R++;ei(n.events,P+1,0,n.events.slice(B)),n.events.length=R}}function C(E){let M=i.length;for(;M-- >E;){const H=i[M];n.containerState=H[1],H[0].exit.call(n,t)}i.length=E}function z(){s.write([null]),l=void 0,s=void 0,n.containerState._closeFlow=void 0}}function v5(t,n,i){return te(t,t.attempt(this.parser.constructs.document,n,i),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Vb(t){if(t===null||Ze(t)||h5(t))return 1;if(d5(t))return 2}function jm(t,n,i){const o=[];let s=-1;for(;++s<t.length;){const l=t[s].resolveAll;l&&!o.includes(l)&&(n=l(n,i),o.push(l))}return n}const Ip={name:"attention",resolveAll:x5,tokenize:b5};function x5(t,n){let i=-1,o,s,l,c,f,d,h,m;for(;++i<t.length;)if(t[i][0]==="enter"&&t[i][1].type==="attentionSequence"&&t[i][1]._close){for(o=i;o--;)if(t[o][0]==="exit"&&t[o][1].type==="attentionSequence"&&t[o][1]._open&&n.sliceSerialize(t[o][1]).charCodeAt(0)===n.sliceSerialize(t[i][1]).charCodeAt(0)){if((t[o][1]._close||t[i][1]._open)&&(t[i][1].end.offset-t[i][1].start.offset)%3&&!((t[o][1].end.offset-t[o][1].start.offset+t[i][1].end.offset-t[i][1].start.offset)%3))continue;d=t[o][1].end.offset-t[o][1].start.offset>1&&t[i][1].end.offset-t[i][1].start.offset>1?2:1;const g={...t[o][1].end},v={...t[i][1].start};qb(g,-d),qb(v,d),c={type:d>1?"strongSequence":"emphasisSequence",start:g,end:{...t[o][1].end}},f={type:d>1?"strongSequence":"emphasisSequence",start:{...t[i][1].start},end:v},l={type:d>1?"strongText":"emphasisText",start:{...t[o][1].end},end:{...t[i][1].start}},s={type:d>1?"strong":"emphasis",start:{...c.start},end:{...f.end}},t[o][1].end={...c.start},t[i][1].start={...f.end},h=[],t[o][1].end.offset-t[o][1].start.offset&&(h=Nn(h,[["enter",t[o][1],n],["exit",t[o][1],n]])),h=Nn(h,[["enter",s,n],["enter",c,n],["exit",c,n],["enter",l,n]]),h=Nn(h,jm(n.parser.constructs.insideSpan.null,t.slice(o+1,i),n)),h=Nn(h,[["exit",l,n],["enter",f,n],["exit",f,n],["exit",s,n]]),t[i][1].end.offset-t[i][1].start.offset?(m=2,h=Nn(h,[["enter",t[i][1],n],["exit",t[i][1],n]])):m=0,ei(t,o-1,i-o+3,h),i=o+h.length-m-2;break}}for(i=-1;++i<t.length;)t[i][1].type==="attentionSequence"&&(t[i][1].type="data");return t}function b5(t,n){const i=this.parser.constructs.attentionMarkers.null,o=this.previous,s=Vb(o);let l;return c;function c(d){return l=d,t.enter("attentionSequence"),f(d)}function f(d){if(d===l)return t.consume(d),f;const h=t.exit("attentionSequence"),m=Vb(d),g=!m||m===2&&s||i.includes(d),v=!s||s===2&&m||i.includes(o);return h._open=!!(l===42?g:g&&(s||!v)),h._close=!!(l===42?v:v&&(m||!g)),n(d)}}function qb(t,n){t.column+=n,t.offset+=n,t._bufferIndex+=n}const S5={name:"autolink",tokenize:w5};function w5(t,n,i){let o=0;return s;function s(x){return t.enter("autolink"),t.enter("autolinkMarker"),t.consume(x),t.exit("autolinkMarker"),t.enter("autolinkProtocol"),l}function l(x){return Kn(x)?(t.consume(x),c):x===64?i(x):h(x)}function c(x){return x===43||x===45||x===46||dn(x)?(o=1,f(x)):h(x)}function f(x){return x===58?(t.consume(x),o=0,d):(x===43||x===45||x===46||dn(x))&&o++<32?(t.consume(x),f):(o=0,h(x))}function d(x){return x===62?(t.exit("autolinkProtocol"),t.enter("autolinkMarker"),t.consume(x),t.exit("autolinkMarker"),t.exit("autolink"),n):x===null||x===32||x===60||Hp(x)?i(x):(t.consume(x),d)}function h(x){return x===64?(t.consume(x),m):u5(x)?(t.consume(x),h):i(x)}function m(x){return dn(x)?g(x):i(x)}function g(x){return x===46?(t.consume(x),o=0,m):x===62?(t.exit("autolinkProtocol").type="autolinkEmail",t.enter("autolinkMarker"),t.consume(x),t.exit("autolinkMarker"),t.exit("autolink"),n):v(x)}function v(x){if((x===45||dn(x))&&o++<63){const b=x===45?v:g;return t.consume(x),b}return i(x)}}const tf={partial:!0,tokenize:E5};function E5(t,n,i){return o;function o(l){return Ft(l)?te(t,s,"linePrefix")(l):s(l)}function s(l){return l===null||Ct(l)?n(l):i(l)}}const aE={continuation:{tokenize:C5},exit:T5,name:"blockQuote",tokenize:_5};function _5(t,n,i){const o=this;return s;function s(c){if(c===62){const f=o.containerState;return f.open||(t.enter("blockQuote",{_container:!0}),f.open=!0),t.enter("blockQuotePrefix"),t.enter("blockQuoteMarker"),t.consume(c),t.exit("blockQuoteMarker"),l}return i(c)}function l(c){return Ft(c)?(t.enter("blockQuotePrefixWhitespace"),t.consume(c),t.exit("blockQuotePrefixWhitespace"),t.exit("blockQuotePrefix"),n):(t.exit("blockQuotePrefix"),n(c))}}function C5(t,n,i){const o=this;return s;function s(c){return Ft(c)?te(t,l,"linePrefix",o.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(c):l(c)}function l(c){return t.attempt(aE,n,i)(c)}}function T5(t){t.exit("blockQuote")}const sE={name:"characterEscape",tokenize:M5};function M5(t,n,i){return o;function o(l){return t.enter("characterEscape"),t.enter("escapeMarker"),t.consume(l),t.exit("escapeMarker"),s}function s(l){return f5(l)?(t.enter("characterEscapeValue"),t.consume(l),t.exit("characterEscapeValue"),t.exit("characterEscape"),n):i(l)}}const lE={name:"characterReference",tokenize:N5};function N5(t,n,i){const o=this;let s=0,l,c;return f;function f(g){return t.enter("characterReference"),t.enter("characterReferenceMarker"),t.consume(g),t.exit("characterReferenceMarker"),d}function d(g){return g===35?(t.enter("characterReferenceMarkerNumeric"),t.consume(g),t.exit("characterReferenceMarkerNumeric"),h):(t.enter("characterReferenceValue"),l=31,c=dn,m(g))}function h(g){return g===88||g===120?(t.enter("characterReferenceMarkerHexadecimal"),t.consume(g),t.exit("characterReferenceMarkerHexadecimal"),t.enter("characterReferenceValue"),l=6,c=c5,m):(t.enter("characterReferenceValue"),l=7,c=Pp,m(g))}function m(g){if(g===59&&s){const v=t.exit("characterReferenceValue");return c===dn&&!Lm(o.sliceSerialize(v))?i(g):(t.enter("characterReferenceMarker"),t.consume(g),t.exit("characterReferenceMarker"),t.exit("characterReference"),n)}return c(g)&&s++<l?(t.consume(g),m):i(g)}}const Fb={partial:!0,tokenize:A5},Yb={concrete:!0,name:"codeFenced",tokenize:k5};function k5(t,n,i){const o=this,s={partial:!0,tokenize:H};let l=0,c=0,f;return d;function d(R){return h(R)}function h(R){const B=o.events[o.events.length-1];return l=B&&B[1].type==="linePrefix"?B[2].sliceSerialize(B[1],!0).length:0,f=R,t.enter("codeFenced"),t.enter("codeFencedFence"),t.enter("codeFencedFenceSequence"),m(R)}function m(R){return R===f?(c++,t.consume(R),m):c<3?i(R):(t.exit("codeFencedFenceSequence"),Ft(R)?te(t,g,"whitespace")(R):g(R))}function g(R){return R===null||Ct(R)?(t.exit("codeFencedFence"),o.interrupt?n(R):t.check(Fb,_,M)(R)):(t.enter("codeFencedFenceInfo"),t.enter("chunkString",{contentType:"string"}),v(R))}function v(R){return R===null||Ct(R)?(t.exit("chunkString"),t.exit("codeFencedFenceInfo"),g(R)):Ft(R)?(t.exit("chunkString"),t.exit("codeFencedFenceInfo"),te(t,x,"whitespace")(R)):R===96&&R===f?i(R):(t.consume(R),v)}function x(R){return R===null||Ct(R)?g(R):(t.enter("codeFencedFenceMeta"),t.enter("chunkString",{contentType:"string"}),b(R))}function b(R){return R===null||Ct(R)?(t.exit("chunkString"),t.exit("codeFencedFenceMeta"),g(R)):R===96&&R===f?i(R):(t.consume(R),b)}function _(R){return t.attempt(s,M,T)(R)}function T(R){return t.enter("lineEnding"),t.consume(R),t.exit("lineEnding"),C}function C(R){return l>0&&Ft(R)?te(t,z,"linePrefix",l+1)(R):z(R)}function z(R){return R===null||Ct(R)?t.check(Fb,_,M)(R):(t.enter("codeFlowValue"),E(R))}function E(R){return R===null||Ct(R)?(t.exit("codeFlowValue"),z(R)):(t.consume(R),E)}function M(R){return t.exit("codeFenced"),n(R)}function H(R,B,P){let q=0;return J;function J(I){return R.enter("lineEnding"),R.consume(I),R.exit("lineEnding"),j}function j(I){return R.enter("codeFencedFence"),Ft(I)?te(R,V,"linePrefix",o.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(I):V(I)}function V(I){return I===f?(R.enter("codeFencedFenceSequence"),K(I)):P(I)}function K(I){return I===f?(q++,R.consume(I),K):q>=c?(R.exit("codeFencedFenceSequence"),Ft(I)?te(R,D,"whitespace")(I):D(I)):P(I)}function D(I){return I===null||Ct(I)?(R.exit("codeFencedFence"),B(I)):P(I)}}}function A5(t,n,i){const o=this;return s;function s(c){return c===null?i(c):(t.enter("lineEnding"),t.consume(c),t.exit("lineEnding"),l)}function l(c){return o.parser.lazy[o.now().line]?i(c):n(c)}}const Jh={name:"codeIndented",tokenize:O5},R5={partial:!0,tokenize:z5};function O5(t,n,i){const o=this;return s;function s(h){return t.enter("codeIndented"),te(t,l,"linePrefix",5)(h)}function l(h){const m=o.events[o.events.length-1];return m&&m[1].type==="linePrefix"&&m[2].sliceSerialize(m[1],!0).length>=4?c(h):i(h)}function c(h){return h===null?d(h):Ct(h)?t.attempt(R5,c,d)(h):(t.enter("codeFlowValue"),f(h))}function f(h){return h===null||Ct(h)?(t.exit("codeFlowValue"),c(h)):(t.consume(h),f)}function d(h){return t.exit("codeIndented"),n(h)}}function z5(t,n,i){const o=this;return s;function s(c){return o.parser.lazy[o.now().line]?i(c):Ct(c)?(t.enter("lineEnding"),t.consume(c),t.exit("lineEnding"),s):te(t,l,"linePrefix",5)(c)}function l(c){const f=o.events[o.events.length-1];return f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?n(c):Ct(c)?s(c):i(c)}}const D5={name:"codeText",previous:j5,resolve:L5,tokenize:B5};function L5(t){let n=t.length-4,i=3,o,s;if((t[i][1].type==="lineEnding"||t[i][1].type==="space")&&(t[n][1].type==="lineEnding"||t[n][1].type==="space")){for(o=i;++o<n;)if(t[o][1].type==="codeTextData"){t[i][1].type="codeTextPadding",t[n][1].type="codeTextPadding",i+=2,n-=2;break}}for(o=i-1,n++;++o<=n;)s===void 0?o!==n&&t[o][1].type!=="lineEnding"&&(s=o):(o===n||t[o][1].type==="lineEnding")&&(t[s][1].type="codeTextData",o!==s+2&&(t[s][1].end=t[o-1][1].end,t.splice(s+2,o-s-2),n-=o-s-2,o=s+2),s=void 0);return t}function j5(t){return t!==96||this.events[this.events.length-1][1].type==="characterEscape"}function B5(t,n,i){let o=0,s,l;return c;function c(g){return t.enter("codeText"),t.enter("codeTextSequence"),f(g)}function f(g){return g===96?(t.consume(g),o++,f):(t.exit("codeTextSequence"),d(g))}function d(g){return g===null?i(g):g===32?(t.enter("space"),t.consume(g),t.exit("space"),d):g===96?(l=t.enter("codeTextSequence"),s=0,m(g)):Ct(g)?(t.enter("lineEnding"),t.consume(g),t.exit("lineEnding"),d):(t.enter("codeTextData"),h(g))}function h(g){return g===null||g===32||g===96||Ct(g)?(t.exit("codeTextData"),d(g)):(t.consume(g),h)}function m(g){return g===96?(t.consume(g),s++,m):s===o?(t.exit("codeTextSequence"),t.exit("codeText"),n(g)):(l.type="codeTextData",h(g))}}class H5{constructor(n){this.left=n?[...n]:[],this.right=[]}get(n){if(n<0||n>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+n+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return n<this.left.length?this.left[n]:this.right[this.right.length-n+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(n,i){const o=i??Number.POSITIVE_INFINITY;return o<this.left.length?this.left.slice(n,o):n>this.left.length?this.right.slice(this.right.length-o+this.left.length,this.right.length-n+this.left.length).reverse():this.left.slice(n).concat(this.right.slice(this.right.length-o+this.left.length).reverse())}splice(n,i,o){const s=i||0;this.setCursor(Math.trunc(n));const l=this.right.splice(this.right.length-s,Number.POSITIVE_INFINITY);return o&&Cs(this.left,o),l.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(n){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(n)}pushMany(n){this.setCursor(Number.POSITIVE_INFINITY),Cs(this.left,n)}unshift(n){this.setCursor(0),this.right.push(n)}unshiftMany(n){this.setCursor(0),Cs(this.right,n.reverse())}setCursor(n){if(!(n===this.left.length||n>this.left.length&&this.right.length===0||n<0&&this.left.length===0))if(n<this.left.length){const i=this.left.splice(n,Number.POSITIVE_INFINITY);Cs(this.right,i.reverse())}else{const i=this.right.splice(this.left.length+this.right.length-n,Number.POSITIVE_INFINITY);Cs(this.left,i.reverse())}}}function Cs(t,n){let i=0;if(n.length<1e4)t.push(...n);else for(;i<n.length;)t.push(...n.slice(i,i+1e4)),i+=1e4}function uE(t){const n={};let i=-1,o,s,l,c,f,d,h;const m=new H5(t);for(;++i<m.length;){for(;i in n;)i=n[i];if(o=m.get(i),i&&o[1].type==="chunkFlow"&&m.get(i-1)[1].type==="listItemPrefix"&&(d=o[1]._tokenizer.events,l=0,l<d.length&&d[l][1].type==="lineEndingBlank"&&(l+=2),l<d.length&&d[l][1].type==="content"))for(;++l<d.length&&d[l][1].type!=="content";)d[l][1].type==="chunkText"&&(d[l][1]._isInFirstContentOfListItem=!0,l++);if(o[0]==="enter")o[1].contentType&&(Object.assign(n,P5(m,i)),i=n[i],h=!0);else if(o[1]._container){for(l=i,s=void 0;l--;)if(c=m.get(l),c[1].type==="lineEnding"||c[1].type==="lineEndingBlank")c[0]==="enter"&&(s&&(m.get(s)[1].type="lineEndingBlank"),c[1].type="lineEnding",s=l);else if(!(c[1].type==="linePrefix"||c[1].type==="listItemIndent"))break;s&&(o[1].end={...m.get(s)[1].start},f=m.slice(s,i),f.unshift(o),m.splice(s,i-s+1,f))}}return ei(t,0,Number.POSITIVE_INFINITY,m.slice(0)),!h}function P5(t,n){const i=t.get(n)[1],o=t.get(n)[2];let s=n-1;const l=[];let c=i._tokenizer;c||(c=o.parser[i.contentType](i.start),i._contentTypeTextTrailing&&(c._contentTypeTextTrailing=!0));const f=c.events,d=[],h={};let m,g,v=-1,x=i,b=0,_=0;const T=[_];for(;x;){for(;t.get(++s)[1]!==x;);l.push(s),x._tokenizer||(m=o.sliceStream(x),x.next||m.push(null),g&&c.defineSkip(x.start),x._isInFirstContentOfListItem&&(c._gfmTasklistFirstContentOfListItem=!0),c.write(m),x._isInFirstContentOfListItem&&(c._gfmTasklistFirstContentOfListItem=void 0)),g=x,x=x.next}for(x=i;++v<f.length;)f[v][0]==="exit"&&f[v-1][0]==="enter"&&f[v][1].type===f[v-1][1].type&&f[v][1].start.line!==f[v][1].end.line&&(_=v+1,T.push(_),x._tokenizer=void 0,x.previous=void 0,x=x.next);for(c.events=[],x?(x._tokenizer=void 0,x.previous=void 0):T.pop(),v=T.length;v--;){const C=f.slice(T[v],T[v+1]),z=l.pop();d.push([z,z+C.length-1]),t.splice(z,2,C)}for(d.reverse(),v=-1;++v<d.length;)h[b+d[v][0]]=b+d[v][1],b+=d[v][1]-d[v][0]-1;return h}const I5={resolve:V5,tokenize:q5},U5={partial:!0,tokenize:F5};function V5(t){return uE(t),t}function q5(t,n){let i;return o;function o(f){return t.enter("content"),i=t.enter("chunkContent",{contentType:"content"}),s(f)}function s(f){return f===null?l(f):Ct(f)?t.check(U5,c,l)(f):(t.consume(f),s)}function l(f){return t.exit("chunkContent"),t.exit("content"),n(f)}function c(f){return t.consume(f),t.exit("chunkContent"),i.next=t.enter("chunkContent",{contentType:"content",previous:i}),i=i.next,s}}function F5(t,n,i){const o=this;return s;function s(c){return t.exit("chunkContent"),t.enter("lineEnding"),t.consume(c),t.exit("lineEnding"),te(t,l,"linePrefix")}function l(c){if(c===null||Ct(c))return i(c);const f=o.events[o.events.length-1];return!o.parser.constructs.disable.null.includes("codeIndented")&&f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?n(c):t.interrupt(o.parser.constructs.flow,i,n)(c)}}function cE(t,n,i,o,s,l,c,f,d){const h=d||Number.POSITIVE_INFINITY;let m=0;return g;function g(C){return C===60?(t.enter(o),t.enter(s),t.enter(l),t.consume(C),t.exit(l),v):C===null||C===32||C===41||Hp(C)?i(C):(t.enter(o),t.enter(c),t.enter(f),t.enter("chunkString",{contentType:"string"}),_(C))}function v(C){return C===62?(t.enter(l),t.consume(C),t.exit(l),t.exit(s),t.exit(o),n):(t.enter(f),t.enter("chunkString",{contentType:"string"}),x(C))}function x(C){return C===62?(t.exit("chunkString"),t.exit(f),v(C)):C===null||C===60||Ct(C)?i(C):(t.consume(C),C===92?b:x)}function b(C){return C===60||C===62||C===92?(t.consume(C),x):x(C)}function _(C){return!m&&(C===null||C===41||Ze(C))?(t.exit("chunkString"),t.exit(f),t.exit(c),t.exit(o),n(C)):m<h&&C===40?(t.consume(C),m++,_):C===41?(t.consume(C),m--,_):C===null||C===32||C===40||Hp(C)?i(C):(t.consume(C),C===92?T:_)}function T(C){return C===40||C===41||C===92?(t.consume(C),_):_(C)}}function fE(t,n,i,o,s,l){const c=this;let f=0,d;return h;function h(x){return t.enter(o),t.enter(s),t.consume(x),t.exit(s),t.enter(l),m}function m(x){return f>999||x===null||x===91||x===93&&!d||x===94&&!f&&"_hiddenFootnoteSupport"in c.parser.constructs?i(x):x===93?(t.exit(l),t.enter(s),t.consume(x),t.exit(s),t.exit(o),n):Ct(x)?(t.enter("lineEnding"),t.consume(x),t.exit("lineEnding"),m):(t.enter("chunkString",{contentType:"string"}),g(x))}function g(x){return x===null||x===91||x===93||Ct(x)||f++>999?(t.exit("chunkString"),m(x)):(t.consume(x),d||(d=!Ft(x)),x===92?v:g)}function v(x){return x===91||x===92||x===93?(t.consume(x),f++,g):g(x)}}function dE(t,n,i,o,s,l){let c;return f;function f(v){return v===34||v===39||v===40?(t.enter(o),t.enter(s),t.consume(v),t.exit(s),c=v===40?41:v,d):i(v)}function d(v){return v===c?(t.enter(s),t.consume(v),t.exit(s),t.exit(o),n):(t.enter(l),h(v))}function h(v){return v===c?(t.exit(l),d(c)):v===null?i(v):Ct(v)?(t.enter("lineEnding"),t.consume(v),t.exit("lineEnding"),te(t,h,"linePrefix")):(t.enter("chunkString",{contentType:"string"}),m(v))}function m(v){return v===c||v===null||Ct(v)?(t.exit("chunkString"),h(v)):(t.consume(v),v===92?g:m)}function g(v){return v===c||v===92?(t.consume(v),m):m(v)}}function js(t,n){let i;return o;function o(s){return Ct(s)?(t.enter("lineEnding"),t.consume(s),t.exit("lineEnding"),i=!0,o):Ft(s)?te(t,o,i?"linePrefix":"lineSuffix")(s):n(s)}}const Y5={name:"definition",tokenize:G5},X5={partial:!0,tokenize:Q5};function G5(t,n,i){const o=this;let s;return l;function l(x){return t.enter("definition"),c(x)}function c(x){return fE.call(o,t,f,i,"definitionLabel","definitionLabelMarker","definitionLabelString")(x)}function f(x){return s=aa(o.sliceSerialize(o.events[o.events.length-1][1]).slice(1,-1)),x===58?(t.enter("definitionMarker"),t.consume(x),t.exit("definitionMarker"),d):i(x)}function d(x){return Ze(x)?js(t,h)(x):h(x)}function h(x){return cE(t,m,i,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(x)}function m(x){return t.attempt(X5,g,g)(x)}function g(x){return Ft(x)?te(t,v,"whitespace")(x):v(x)}function v(x){return x===null||Ct(x)?(t.exit("definition"),o.parser.defined.push(s),n(x)):i(x)}}function Q5(t,n,i){return o;function o(f){return Ze(f)?js(t,s)(f):i(f)}function s(f){return dE(t,l,i,"definitionTitle","definitionTitleMarker","definitionTitleString")(f)}function l(f){return Ft(f)?te(t,c,"whitespace")(f):c(f)}function c(f){return f===null||Ct(f)?n(f):i(f)}}const $5={name:"hardBreakEscape",tokenize:Z5};function Z5(t,n,i){return o;function o(l){return t.enter("hardBreakEscape"),t.consume(l),s}function s(l){return Ct(l)?(t.exit("hardBreakEscape"),n(l)):i(l)}}const K5={name:"headingAtx",resolve:J5,tokenize:W5};function J5(t,n){let i=t.length-2,o=3,s,l;return t[o][1].type==="whitespace"&&(o+=2),i-2>o&&t[i][1].type==="whitespace"&&(i-=2),t[i][1].type==="atxHeadingSequence"&&(o===i-1||i-4>o&&t[i-2][1].type==="whitespace")&&(i-=o+1===i?2:4),i>o&&(s={type:"atxHeadingText",start:t[o][1].start,end:t[i][1].end},l={type:"chunkText",start:t[o][1].start,end:t[i][1].end,contentType:"text"},ei(t,o,i-o+1,[["enter",s,n],["enter",l,n],["exit",l,n],["exit",s,n]])),t}function W5(t,n,i){let o=0;return s;function s(m){return t.enter("atxHeading"),l(m)}function l(m){return t.enter("atxHeadingSequence"),c(m)}function c(m){return m===35&&o++<6?(t.consume(m),c):m===null||Ze(m)?(t.exit("atxHeadingSequence"),f(m)):i(m)}function f(m){return m===35?(t.enter("atxHeadingSequence"),d(m)):m===null||Ct(m)?(t.exit("atxHeading"),n(m)):Ft(m)?te(t,f,"whitespace")(m):(t.enter("atxHeadingText"),h(m))}function d(m){return m===35?(t.consume(m),d):(t.exit("atxHeadingSequence"),f(m))}function h(m){return m===null||m===35||Ze(m)?(t.exit("atxHeadingText"),f(m)):(t.consume(m),h)}}const tL=["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"],Xb=["pre","script","style","textarea"],eL={concrete:!0,name:"htmlFlow",resolveTo:rL,tokenize:oL},nL={partial:!0,tokenize:sL},iL={partial:!0,tokenize:aL};function rL(t){let n=t.length;for(;n--&&!(t[n][0]==="enter"&&t[n][1].type==="htmlFlow"););return n>1&&t[n-2][1].type==="linePrefix"&&(t[n][1].start=t[n-2][1].start,t[n+1][1].start=t[n-2][1].start,t.splice(n-2,2)),t}function oL(t,n,i){const o=this;let s,l,c,f,d;return h;function h(A){return m(A)}function m(A){return t.enter("htmlFlow"),t.enter("htmlFlowData"),t.consume(A),g}function g(A){return A===33?(t.consume(A),v):A===47?(t.consume(A),l=!0,_):A===63?(t.consume(A),s=3,o.interrupt?n:k):Kn(A)?(t.consume(A),c=String.fromCharCode(A),T):i(A)}function v(A){return A===45?(t.consume(A),s=2,x):A===91?(t.consume(A),s=5,f=0,b):Kn(A)?(t.consume(A),s=4,o.interrupt?n:k):i(A)}function x(A){return A===45?(t.consume(A),o.interrupt?n:k):i(A)}function b(A){const it="CDATA[";return A===it.charCodeAt(f++)?(t.consume(A),f===it.length?o.interrupt?n:V:b):i(A)}function _(A){return Kn(A)?(t.consume(A),c=String.fromCharCode(A),T):i(A)}function T(A){if(A===null||A===47||A===62||Ze(A)){const it=A===47,ct=c.toLowerCase();return!it&&!l&&Xb.includes(ct)?(s=1,o.interrupt?n(A):V(A)):tL.includes(c.toLowerCase())?(s=6,it?(t.consume(A),C):o.interrupt?n(A):V(A)):(s=7,o.interrupt&&!o.parser.lazy[o.now().line]?i(A):l?z(A):E(A))}return A===45||dn(A)?(t.consume(A),c+=String.fromCharCode(A),T):i(A)}function C(A){return A===62?(t.consume(A),o.interrupt?n:V):i(A)}function z(A){return Ft(A)?(t.consume(A),z):J(A)}function E(A){return A===47?(t.consume(A),J):A===58||A===95||Kn(A)?(t.consume(A),M):Ft(A)?(t.consume(A),E):J(A)}function M(A){return A===45||A===46||A===58||A===95||dn(A)?(t.consume(A),M):H(A)}function H(A){return A===61?(t.consume(A),R):Ft(A)?(t.consume(A),H):E(A)}function R(A){return A===null||A===60||A===61||A===62||A===96?i(A):A===34||A===39?(t.consume(A),d=A,B):Ft(A)?(t.consume(A),R):P(A)}function B(A){return A===d?(t.consume(A),d=null,q):A===null||Ct(A)?i(A):(t.consume(A),B)}function P(A){return A===null||A===34||A===39||A===47||A===60||A===61||A===62||A===96||Ze(A)?H(A):(t.consume(A),P)}function q(A){return A===47||A===62||Ft(A)?E(A):i(A)}function J(A){return A===62?(t.consume(A),j):i(A)}function j(A){return A===null||Ct(A)?V(A):Ft(A)?(t.consume(A),j):i(A)}function V(A){return A===45&&s===2?(t.consume(A),O):A===60&&s===1?(t.consume(A),U):A===62&&s===4?(t.consume(A),L):A===63&&s===3?(t.consume(A),k):A===93&&s===5?(t.consume(A),$):Ct(A)&&(s===6||s===7)?(t.exit("htmlFlowData"),t.check(nL,X,K)(A)):A===null||Ct(A)?(t.exit("htmlFlowData"),K(A)):(t.consume(A),V)}function K(A){return t.check(iL,D,X)(A)}function D(A){return t.enter("lineEnding"),t.consume(A),t.exit("lineEnding"),I}function I(A){return A===null||Ct(A)?K(A):(t.enter("htmlFlowData"),V(A))}function O(A){return A===45?(t.consume(A),k):V(A)}function U(A){return A===47?(t.consume(A),c="",G):V(A)}function G(A){if(A===62){const it=c.toLowerCase();return Xb.includes(it)?(t.consume(A),L):V(A)}return Kn(A)&&c.length<8?(t.consume(A),c+=String.fromCharCode(A),G):V(A)}function $(A){return A===93?(t.consume(A),k):V(A)}function k(A){return A===62?(t.consume(A),L):A===45&&s===2?(t.consume(A),k):V(A)}function L(A){return A===null||Ct(A)?(t.exit("htmlFlowData"),X(A)):(t.consume(A),L)}function X(A){return t.exit("htmlFlow"),n(A)}}function aL(t,n,i){const o=this;return s;function s(c){return Ct(c)?(t.enter("lineEnding"),t.consume(c),t.exit("lineEnding"),l):i(c)}function l(c){return o.parser.lazy[o.now().line]?i(c):n(c)}}function sL(t,n,i){return o;function o(s){return t.enter("lineEnding"),t.consume(s),t.exit("lineEnding"),t.attempt(tf,n,i)}}const lL={name:"htmlText",tokenize:uL};function uL(t,n,i){const o=this;let s,l,c;return f;function f(k){return t.enter("htmlText"),t.enter("htmlTextData"),t.consume(k),d}function d(k){return k===33?(t.consume(k),h):k===47?(t.consume(k),H):k===63?(t.consume(k),E):Kn(k)?(t.consume(k),P):i(k)}function h(k){return k===45?(t.consume(k),m):k===91?(t.consume(k),l=0,b):Kn(k)?(t.consume(k),z):i(k)}function m(k){return k===45?(t.consume(k),x):i(k)}function g(k){return k===null?i(k):k===45?(t.consume(k),v):Ct(k)?(c=g,U(k)):(t.consume(k),g)}function v(k){return k===45?(t.consume(k),x):g(k)}function x(k){return k===62?O(k):k===45?v(k):g(k)}function b(k){const L="CDATA[";return k===L.charCodeAt(l++)?(t.consume(k),l===L.length?_:b):i(k)}function _(k){return k===null?i(k):k===93?(t.consume(k),T):Ct(k)?(c=_,U(k)):(t.consume(k),_)}function T(k){return k===93?(t.consume(k),C):_(k)}function C(k){return k===62?O(k):k===93?(t.consume(k),C):_(k)}function z(k){return k===null||k===62?O(k):Ct(k)?(c=z,U(k)):(t.consume(k),z)}function E(k){return k===null?i(k):k===63?(t.consume(k),M):Ct(k)?(c=E,U(k)):(t.consume(k),E)}function M(k){return k===62?O(k):E(k)}function H(k){return Kn(k)?(t.consume(k),R):i(k)}function R(k){return k===45||dn(k)?(t.consume(k),R):B(k)}function B(k){return Ct(k)?(c=B,U(k)):Ft(k)?(t.consume(k),B):O(k)}function P(k){return k===45||dn(k)?(t.consume(k),P):k===47||k===62||Ze(k)?q(k):i(k)}function q(k){return k===47?(t.consume(k),O):k===58||k===95||Kn(k)?(t.consume(k),J):Ct(k)?(c=q,U(k)):Ft(k)?(t.consume(k),q):O(k)}function J(k){return k===45||k===46||k===58||k===95||dn(k)?(t.consume(k),J):j(k)}function j(k){return k===61?(t.consume(k),V):Ct(k)?(c=j,U(k)):Ft(k)?(t.consume(k),j):q(k)}function V(k){return k===null||k===60||k===61||k===62||k===96?i(k):k===34||k===39?(t.consume(k),s=k,K):Ct(k)?(c=V,U(k)):Ft(k)?(t.consume(k),V):(t.consume(k),D)}function K(k){return k===s?(t.consume(k),s=void 0,I):k===null?i(k):Ct(k)?(c=K,U(k)):(t.consume(k),K)}function D(k){return k===null||k===34||k===39||k===60||k===61||k===96?i(k):k===47||k===62||Ze(k)?q(k):(t.consume(k),D)}function I(k){return k===47||k===62||Ze(k)?q(k):i(k)}function O(k){return k===62?(t.consume(k),t.exit("htmlTextData"),t.exit("htmlText"),n):i(k)}function U(k){return t.exit("htmlTextData"),t.enter("lineEnding"),t.consume(k),t.exit("lineEnding"),G}function G(k){return Ft(k)?te(t,$,"linePrefix",o.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(k):$(k)}function $(k){return t.enter("htmlTextData"),c(k)}}const Bm={name:"labelEnd",resolveAll:hL,resolveTo:pL,tokenize:mL},cL={tokenize:gL},fL={tokenize:yL},dL={tokenize:vL};function hL(t){let n=-1;const i=[];for(;++n<t.length;){const o=t[n][1];if(i.push(t[n]),o.type==="labelImage"||o.type==="labelLink"||o.type==="labelEnd"){const s=o.type==="labelImage"?4:2;o.type="data",n+=s}}return t.length!==i.length&&ei(t,0,t.length,i),t}function pL(t,n){let i=t.length,o=0,s,l,c,f;for(;i--;)if(s=t[i][1],l){if(s.type==="link"||s.type==="labelLink"&&s._inactive)break;t[i][0]==="enter"&&s.type==="labelLink"&&(s._inactive=!0)}else if(c){if(t[i][0]==="enter"&&(s.type==="labelImage"||s.type==="labelLink")&&!s._balanced&&(l=i,s.type!=="labelLink")){o=2;break}}else s.type==="labelEnd"&&(c=i);const d={type:t[l][1].type==="labelLink"?"link":"image",start:{...t[l][1].start},end:{...t[t.length-1][1].end}},h={type:"label",start:{...t[l][1].start},end:{...t[c][1].end}},m={type:"labelText",start:{...t[l+o+2][1].end},end:{...t[c-2][1].start}};return f=[["enter",d,n],["enter",h,n]],f=Nn(f,t.slice(l+1,l+o+3)),f=Nn(f,[["enter",m,n]]),f=Nn(f,jm(n.parser.constructs.insideSpan.null,t.slice(l+o+4,c-3),n)),f=Nn(f,[["exit",m,n],t[c-2],t[c-1],["exit",h,n]]),f=Nn(f,t.slice(c+1)),f=Nn(f,[["exit",d,n]]),ei(t,l,t.length,f),t}function mL(t,n,i){const o=this;let s=o.events.length,l,c;for(;s--;)if((o.events[s][1].type==="labelImage"||o.events[s][1].type==="labelLink")&&!o.events[s][1]._balanced){l=o.events[s][1];break}return f;function f(v){return l?l._inactive?g(v):(c=o.parser.defined.includes(aa(o.sliceSerialize({start:l.end,end:o.now()}))),t.enter("labelEnd"),t.enter("labelMarker"),t.consume(v),t.exit("labelMarker"),t.exit("labelEnd"),d):i(v)}function d(v){return v===40?t.attempt(cL,m,c?m:g)(v):v===91?t.attempt(fL,m,c?h:g)(v):c?m(v):g(v)}function h(v){return t.attempt(dL,m,g)(v)}function m(v){return n(v)}function g(v){return l._balanced=!0,i(v)}}function gL(t,n,i){return o;function o(g){return t.enter("resource"),t.enter("resourceMarker"),t.consume(g),t.exit("resourceMarker"),s}function s(g){return Ze(g)?js(t,l)(g):l(g)}function l(g){return g===41?m(g):cE(t,c,f,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(g)}function c(g){return Ze(g)?js(t,d)(g):m(g)}function f(g){return i(g)}function d(g){return g===34||g===39||g===40?dE(t,h,i,"resourceTitle","resourceTitleMarker","resourceTitleString")(g):m(g)}function h(g){return Ze(g)?js(t,m)(g):m(g)}function m(g){return g===41?(t.enter("resourceMarker"),t.consume(g),t.exit("resourceMarker"),t.exit("resource"),n):i(g)}}function yL(t,n,i){const o=this;return s;function s(f){return fE.call(o,t,l,c,"reference","referenceMarker","referenceString")(f)}function l(f){return o.parser.defined.includes(aa(o.sliceSerialize(o.events[o.events.length-1][1]).slice(1,-1)))?n(f):i(f)}function c(f){return i(f)}}function vL(t,n,i){return o;function o(l){return t.enter("reference"),t.enter("referenceMarker"),t.consume(l),t.exit("referenceMarker"),s}function s(l){return l===93?(t.enter("referenceMarker"),t.consume(l),t.exit("referenceMarker"),t.exit("reference"),n):i(l)}}const xL={name:"labelStartImage",resolveAll:Bm.resolveAll,tokenize:bL};function bL(t,n,i){const o=this;return s;function s(f){return t.enter("labelImage"),t.enter("labelImageMarker"),t.consume(f),t.exit("labelImageMarker"),l}function l(f){return f===91?(t.enter("labelMarker"),t.consume(f),t.exit("labelMarker"),t.exit("labelImage"),c):i(f)}function c(f){return f===94&&"_hiddenFootnoteSupport"in o.parser.constructs?i(f):n(f)}}const SL={name:"labelStartLink",resolveAll:Bm.resolveAll,tokenize:wL};function wL(t,n,i){const o=this;return s;function s(c){return t.enter("labelLink"),t.enter("labelMarker"),t.consume(c),t.exit("labelMarker"),t.exit("labelLink"),l}function l(c){return c===94&&"_hiddenFootnoteSupport"in o.parser.constructs?i(c):n(c)}}const Wh={name:"lineEnding",tokenize:EL};function EL(t,n){return i;function i(o){return t.enter("lineEnding"),t.consume(o),t.exit("lineEnding"),te(t,n,"linePrefix")}}const cc={name:"thematicBreak",tokenize:_L};function _L(t,n,i){let o=0,s;return l;function l(h){return t.enter("thematicBreak"),c(h)}function c(h){return s=h,f(h)}function f(h){return h===s?(t.enter("thematicBreakSequence"),d(h)):o>=3&&(h===null||Ct(h))?(t.exit("thematicBreak"),n(h)):i(h)}function d(h){return h===s?(t.consume(h),o++,d):(t.exit("thematicBreakSequence"),Ft(h)?te(t,f,"whitespace")(h):f(h))}}const Xe={continuation:{tokenize:NL},exit:AL,name:"list",tokenize:ML},CL={partial:!0,tokenize:RL},TL={partial:!0,tokenize:kL};function ML(t,n,i){const o=this,s=o.events[o.events.length-1];let l=s&&s[1].type==="linePrefix"?s[2].sliceSerialize(s[1],!0).length:0,c=0;return f;function f(x){const b=o.containerState.type||(x===42||x===43||x===45?"listUnordered":"listOrdered");if(b==="listUnordered"?!o.containerState.marker||x===o.containerState.marker:Pp(x)){if(o.containerState.type||(o.containerState.type=b,t.enter(b,{_container:!0})),b==="listUnordered")return t.enter("listItemPrefix"),x===42||x===45?t.check(cc,i,h)(x):h(x);if(!o.interrupt||x===49)return t.enter("listItemPrefix"),t.enter("listItemValue"),d(x)}return i(x)}function d(x){return Pp(x)&&++c<10?(t.consume(x),d):(!o.interrupt||c<2)&&(o.containerState.marker?x===o.containerState.marker:x===41||x===46)?(t.exit("listItemValue"),h(x)):i(x)}function h(x){return t.enter("listItemMarker"),t.consume(x),t.exit("listItemMarker"),o.containerState.marker=o.containerState.marker||x,t.check(tf,o.interrupt?i:m,t.attempt(CL,v,g))}function m(x){return o.containerState.initialBlankLine=!0,l++,v(x)}function g(x){return Ft(x)?(t.enter("listItemPrefixWhitespace"),t.consume(x),t.exit("listItemPrefixWhitespace"),v):i(x)}function v(x){return o.containerState.size=l+o.sliceSerialize(t.exit("listItemPrefix"),!0).length,n(x)}}function NL(t,n,i){const o=this;return o.containerState._closeFlow=void 0,t.check(tf,s,l);function s(f){return o.containerState.furtherBlankLines=o.containerState.furtherBlankLines||o.containerState.initialBlankLine,te(t,n,"listItemIndent",o.containerState.size+1)(f)}function l(f){return o.containerState.furtherBlankLines||!Ft(f)?(o.containerState.furtherBlankLines=void 0,o.containerState.initialBlankLine=void 0,c(f)):(o.containerState.furtherBlankLines=void 0,o.containerState.initialBlankLine=void 0,t.attempt(TL,n,c)(f))}function c(f){return o.containerState._closeFlow=!0,o.interrupt=void 0,te(t,t.attempt(Xe,n,i),"linePrefix",o.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(f)}}function kL(t,n,i){const o=this;return te(t,s,"listItemIndent",o.containerState.size+1);function s(l){const c=o.events[o.events.length-1];return c&&c[1].type==="listItemIndent"&&c[2].sliceSerialize(c[1],!0).length===o.containerState.size?n(l):i(l)}}function AL(t){t.exit(this.containerState.type)}function RL(t,n,i){const o=this;return te(t,s,"listItemPrefixWhitespace",o.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function s(l){const c=o.events[o.events.length-1];return!Ft(l)&&c&&c[1].type==="listItemPrefixWhitespace"?n(l):i(l)}}const Gb={name:"setextUnderline",resolveTo:OL,tokenize:zL};function OL(t,n){let i=t.length,o,s,l;for(;i--;)if(t[i][0]==="enter"){if(t[i][1].type==="content"){o=i;break}t[i][1].type==="paragraph"&&(s=i)}else t[i][1].type==="content"&&t.splice(i,1),!l&&t[i][1].type==="definition"&&(l=i);const c={type:"setextHeading",start:{...t[o][1].start},end:{...t[t.length-1][1].end}};return t[s][1].type="setextHeadingText",l?(t.splice(s,0,["enter",c,n]),t.splice(l+1,0,["exit",t[o][1],n]),t[o][1].end={...t[l][1].end}):t[o][1]=c,t.push(["exit",c,n]),t}function zL(t,n,i){const o=this;let s;return l;function l(h){let m=o.events.length,g;for(;m--;)if(o.events[m][1].type!=="lineEnding"&&o.events[m][1].type!=="linePrefix"&&o.events[m][1].type!=="content"){g=o.events[m][1].type==="paragraph";break}return!o.parser.lazy[o.now().line]&&(o.interrupt||g)?(t.enter("setextHeadingLine"),s=h,c(h)):i(h)}function c(h){return t.enter("setextHeadingLineSequence"),f(h)}function f(h){return h===s?(t.consume(h),f):(t.exit("setextHeadingLineSequence"),Ft(h)?te(t,d,"lineSuffix")(h):d(h))}function d(h){return h===null||Ct(h)?(t.exit("setextHeadingLine"),n(h)):i(h)}}const DL={tokenize:LL};function LL(t){const n=this,i=t.attempt(tf,o,t.attempt(this.parser.constructs.flowInitial,s,te(t,t.attempt(this.parser.constructs.flow,s,t.attempt(I5,s)),"linePrefix")));return i;function o(l){if(l===null){t.consume(l);return}return t.enter("lineEndingBlank"),t.consume(l),t.exit("lineEndingBlank"),n.currentConstruct=void 0,i}function s(l){if(l===null){t.consume(l);return}return t.enter("lineEnding"),t.consume(l),t.exit("lineEnding"),n.currentConstruct=void 0,i}}const jL={resolveAll:pE()},BL=hE("string"),HL=hE("text");function hE(t){return{resolveAll:pE(t==="text"?PL:void 0),tokenize:n};function n(i){const o=this,s=this.parser.constructs[t],l=i.attempt(s,c,f);return c;function c(m){return h(m)?l(m):f(m)}function f(m){if(m===null){i.consume(m);return}return i.enter("data"),i.consume(m),d}function d(m){return h(m)?(i.exit("data"),l(m)):(i.consume(m),d)}function h(m){if(m===null)return!0;const g=s[m];let v=-1;if(g)for(;++v<g.length;){const x=g[v];if(!x.previous||x.previous.call(o,o.previous))return!0}return!1}}}function pE(t){return n;function n(i,o){let s=-1,l;for(;++s<=i.length;)l===void 0?i[s]&&i[s][1].type==="data"&&(l=s,s++):(!i[s]||i[s][1].type!=="data")&&(s!==l+2&&(i[l][1].end=i[s-1][1].end,i.splice(l+2,s-l-2),s=l+2),l=void 0);return t?t(i,o):i}}function PL(t,n){let i=0;for(;++i<=t.length;)if((i===t.length||t[i][1].type==="lineEnding")&&t[i-1][1].type==="data"){const o=t[i-1][1],s=n.sliceStream(o);let l=s.length,c=-1,f=0,d;for(;l--;){const h=s[l];if(typeof h=="string"){for(c=h.length;h.charCodeAt(c-1)===32;)f++,c--;if(c)break;c=-1}else if(h===-2)d=!0,f++;else if(h!==-1){l++;break}}if(n._contentTypeTextTrailing&&i===t.length&&(f=0),f){const h={type:i===t.length||d||f<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:l?c:o.start._bufferIndex+c,_index:o.start._index+l,line:o.end.line,column:o.end.column-f,offset:o.end.offset-f},end:{...o.end}};o.end={...h.start},o.start.offset===o.end.offset?Object.assign(o,h):(t.splice(i,0,["enter",h,n],["exit",h,n]),i+=2)}i++}return t}const IL={42:Xe,43:Xe,45:Xe,48:Xe,49:Xe,50:Xe,51:Xe,52:Xe,53:Xe,54:Xe,55:Xe,56:Xe,57:Xe,62:aE},UL={91:Y5},VL={[-2]:Jh,[-1]:Jh,32:Jh},qL={35:K5,42:cc,45:[Gb,cc],60:eL,61:Gb,95:cc,96:Yb,126:Yb},FL={38:lE,92:sE},YL={[-5]:Wh,[-4]:Wh,[-3]:Wh,33:xL,38:lE,42:Ip,60:[S5,lL],91:SL,92:[$5,sE],93:Bm,95:Ip,96:D5},XL={null:[Ip,jL]},GL={null:[42,95]},QL={null:[]},$L=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:GL,contentInitial:UL,disable:QL,document:IL,flow:qL,flowInitial:VL,insideSpan:XL,string:FL,text:YL},Symbol.toStringTag,{value:"Module"}));function ZL(t,n,i){let o={_bufferIndex:-1,_index:0,line:i&&i.line||1,column:i&&i.column||1,offset:i&&i.offset||0};const s={},l=[];let c=[],f=[];const d={attempt:B(H),check:B(R),consume:z,enter:E,exit:M,interrupt:B(R,{interrupt:!0})},h={code:null,containerState:{},defineSkip:_,events:[],now:b,parser:t,previous:null,sliceSerialize:v,sliceStream:x,write:g};let m=n.tokenize.call(h,d);return n.resolveAll&&l.push(n),h;function g(j){return c=Nn(c,j),T(),c[c.length-1]!==null?[]:(P(n,0),h.events=jm(l,h.events,h),h.events)}function v(j,V){return JL(x(j),V)}function x(j){return KL(c,j)}function b(){const{_bufferIndex:j,_index:V,line:K,column:D,offset:I}=o;return{_bufferIndex:j,_index:V,line:K,column:D,offset:I}}function _(j){s[j.line]=j.column,J()}function T(){let j;for(;o._index<c.length;){const V=c[o._index];if(typeof V=="string")for(j=o._index,o._bufferIndex<0&&(o._bufferIndex=0);o._index===j&&o._bufferIndex<V.length;)C(V.charCodeAt(o._bufferIndex));else C(V)}}function C(j){m=m(j)}function z(j){Ct(j)?(o.line++,o.column=1,o.offset+=j===-3?2:1,J()):j!==-1&&(o.column++,o.offset++),o._bufferIndex<0?o._index++:(o._bufferIndex++,o._bufferIndex===c[o._index].length&&(o._bufferIndex=-1,o._index++)),h.previous=j}function E(j,V){const K=V||{};return K.type=j,K.start=b(),h.events.push(["enter",K,h]),f.push(K),K}function M(j){const V=f.pop();return V.end=b(),h.events.push(["exit",V,h]),V}function H(j,V){P(j,V.from)}function R(j,V){V.restore()}function B(j,V){return K;function K(D,I,O){let U,G,$,k;return Array.isArray(D)?X(D):"tokenize"in D?X([D]):L(D);function L(ft){return dt;function dt(lt){const pt=lt!==null&&ft[lt],St=lt!==null&&ft.null,wt=[...Array.isArray(pt)?pt:pt?[pt]:[],...Array.isArray(St)?St:St?[St]:[]];return X(wt)(lt)}}function X(ft){return U=ft,G=0,ft.length===0?O:A(ft[G])}function A(ft){return dt;function dt(lt){return k=q(),$=ft,ft.partial||(h.currentConstruct=ft),ft.name&&h.parser.constructs.disable.null.includes(ft.name)?ct():ft.tokenize.call(V?Object.assign(Object.create(h),V):h,d,it,ct)(lt)}}function it(ft){return j($,k),I}function ct(ft){return k.restore(),++G<U.length?A(U[G]):O}}}function P(j,V){j.resolveAll&&!l.includes(j)&&l.push(j),j.resolve&&ei(h.events,V,h.events.length-V,j.resolve(h.events.slice(V),h)),j.resolveTo&&(h.events=j.resolveTo(h.events,h))}function q(){const j=b(),V=h.previous,K=h.currentConstruct,D=h.events.length,I=Array.from(f);return{from:D,restore:O};function O(){o=j,h.previous=V,h.currentConstruct=K,h.events.length=D,f=I,J()}}function J(){o.line in s&&o.column<2&&(o.column=s[o.line],o.offset+=s[o.line]-1)}}function KL(t,n){const i=n.start._index,o=n.start._bufferIndex,s=n.end._index,l=n.end._bufferIndex;let c;if(i===s)c=[t[i].slice(o,l)];else{if(c=t.slice(i,s),o>-1){const f=c[0];typeof f=="string"?c[0]=f.slice(o):c.shift()}l>0&&c.push(t[s].slice(0,l))}return c}function JL(t,n){let i=-1;const o=[];let s;for(;++i<t.length;){const l=t[i];let c;if(typeof l=="string")c=l;else switch(l){case-5:{c="\r";break}case-4:{c=`
17
+ `;break}case-3:{c=`\r
18
+ `;break}case-2:{c=n?" ":" ";break}case-1:{if(!n&&s)continue;c=" ";break}default:c=String.fromCharCode(l)}s=l===-2,o.push(c)}return o.join("")}function WL(t){const o={constructs:a5([$L,...(t||{}).extensions||[]]),content:s(p5),defined:[],document:s(g5),flow:s(DL),lazy:{},string:s(BL),text:s(HL)};return o;function s(l){return c;function c(f){return ZL(o,l,f)}}}function t4(t){for(;!uE(t););return t}const Qb=/[\0\t\n\r]/g;function e4(){let t=1,n="",i=!0,o;return s;function s(l,c,f){const d=[];let h,m,g,v,x;for(l=n+(typeof l=="string"?l.toString():new TextDecoder(c||void 0).decode(l)),g=0,n="",i&&(l.charCodeAt(0)===65279&&g++,i=void 0);g<l.length;){if(Qb.lastIndex=g,h=Qb.exec(l),v=h&&h.index!==void 0?h.index:l.length,x=l.charCodeAt(v),!h){n=l.slice(g);break}if(x===10&&g===v&&o)d.push(-3),o=void 0;else switch(o&&(d.push(-5),o=void 0),g<v&&(d.push(l.slice(g,v)),t+=v-g),x){case 0:{d.push(65533),t++;break}case 9:{for(m=Math.ceil(t/4)*4,d.push(-2);t++<m;)d.push(-1);break}case 10:{d.push(-4),t=1;break}default:o=!0,t=1}g=v+1}return f&&(o&&d.push(-5),n&&d.push(n),d.push(null)),d}}const n4=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function i4(t){return t.replace(n4,r4)}function r4(t,n,i){if(n)return n;if(i.charCodeAt(0)===35){const s=i.charCodeAt(1),l=s===120||s===88;return oE(i.slice(l?2:1),l?16:10)}return Lm(i)||t}const mE={}.hasOwnProperty;function o4(t,n,i){return typeof n!="string"&&(i=n,n=void 0),a4(i)(t4(WL(i).document().write(e4()(t,n,!0))))}function a4(t){const n={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:l(ie),autolinkProtocol:q,autolinkEmail:q,atxHeading:l(Ht),blockQuote:l(St),characterEscape:q,characterReference:q,codeFenced:l(wt),codeFencedFenceInfo:c,codeFencedFenceMeta:c,codeIndented:l(wt,c),codeText:l(vt,c),codeTextData:q,data:q,codeFlowValue:q,definition:l(Et),definitionDestinationString:c,definitionLabelString:c,definitionTitleString:c,emphasis:l(Rt),hardBreakEscape:l(jt),hardBreakTrailing:l(jt),htmlFlow:l(Qt,c),htmlFlowData:q,htmlText:l(Qt,c),htmlTextData:q,image:l(Ee),label:c,link:l(ie),listItem:l(Je),listItemValue:v,listOrdered:l(Ae,g),listUnordered:l(Ae),paragraph:l(yn),reference:A,referenceString:c,resourceDestinationString:c,resourceTitleString:c,setextHeading:l(Ht),strong:l(An),thematicBreak:l(Un)},exit:{atxHeading:d(),atxHeadingSequence:H,autolink:d(),autolinkEmail:pt,autolinkProtocol:lt,blockQuote:d(),characterEscapeValue:J,characterReferenceMarkerHexadecimal:ct,characterReferenceMarkerNumeric:ct,characterReferenceValue:ft,characterReference:dt,codeFenced:d(T),codeFencedFence:_,codeFencedFenceInfo:x,codeFencedFenceMeta:b,codeFlowValue:J,codeIndented:d(C),codeText:d(I),codeTextData:J,data:J,definition:d(),definitionDestinationString:M,definitionLabelString:z,definitionTitleString:E,emphasis:d(),hardBreakEscape:d(V),hardBreakTrailing:d(V),htmlFlow:d(K),htmlFlowData:J,htmlText:d(D),htmlTextData:J,image:d(U),label:$,labelText:G,lineEnding:j,link:d(O),listItem:d(),listOrdered:d(),listUnordered:d(),paragraph:d(),referenceString:it,resourceDestinationString:k,resourceTitleString:L,resource:X,setextHeading:d(P),setextHeadingLineSequence:B,setextHeadingText:R,strong:d(),thematicBreak:d()}};gE(n,(t||{}).mdastExtensions||[]);const i={};return o;function o(et){let ut={type:"root",children:[]};const gt={stack:[ut],tokenStack:[],config:n,enter:f,exit:h,buffer:c,resume:m,data:i},Mt=[];let Pt=-1;for(;++Pt<et.length;)if(et[Pt][1].type==="listOrdered"||et[Pt][1].type==="listUnordered")if(et[Pt][0]==="enter")Mt.push(Pt);else{const je=Mt.pop();Pt=s(et,je,Pt)}for(Pt=-1;++Pt<et.length;){const je=n[et[Pt][0]];mE.call(je,et[Pt][1].type)&&je[et[Pt][1].type].call(Object.assign({sliceSerialize:et[Pt][2].sliceSerialize},gt),et[Pt][1])}if(gt.tokenStack.length>0){const je=gt.tokenStack[gt.tokenStack.length-1];(je[1]||$b).call(gt,void 0,je[0])}for(ut.position={start:lr(et.length>0?et[0][1].start:{line:1,column:1,offset:0}),end:lr(et.length>0?et[et.length-2][1].end:{line:1,column:1,offset:0})},Pt=-1;++Pt<n.transforms.length;)ut=n.transforms[Pt](ut)||ut;return ut}function s(et,ut,gt){let Mt=ut-1,Pt=-1,je=!1,Rn,_e,ce,Re;for(;++Mt<=gt;){const Yt=et[Mt];switch(Yt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Yt[0]==="enter"?Pt++:Pt--,Re=void 0;break}case"lineEndingBlank":{Yt[0]==="enter"&&(Rn&&!Re&&!Pt&&!ce&&(ce=Mt),Re=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Re=void 0}if(!Pt&&Yt[0]==="enter"&&Yt[1].type==="listItemPrefix"||Pt===-1&&Yt[0]==="exit"&&(Yt[1].type==="listUnordered"||Yt[1].type==="listOrdered")){if(Rn){let Vn=Mt;for(_e=void 0;Vn--;){const We=et[Vn];if(We[1].type==="lineEnding"||We[1].type==="lineEndingBlank"){if(We[0]==="exit")continue;_e&&(et[_e][1].type="lineEndingBlank",je=!0),We[1].type="lineEnding",_e=Vn}else if(!(We[1].type==="linePrefix"||We[1].type==="blockQuotePrefix"||We[1].type==="blockQuotePrefixWhitespace"||We[1].type==="blockQuoteMarker"||We[1].type==="listItemIndent"))break}ce&&(!_e||ce<_e)&&(Rn._spread=!0),Rn.end=Object.assign({},_e?et[_e][1].start:Yt[1].end),et.splice(_e||Mt,0,["exit",Rn,Yt[2]]),Mt++,gt++}if(Yt[1].type==="listItemPrefix"){const Vn={type:"listItem",_spread:!1,start:Object.assign({},Yt[1].start),end:void 0};Rn=Vn,et.splice(Mt,0,["enter",Vn,Yt[2]]),Mt++,gt++,ce=void 0,Re=!0}}}return et[ut][1]._spread=je,gt}function l(et,ut){return gt;function gt(Mt){f.call(this,et(Mt),Mt),ut&&ut.call(this,Mt)}}function c(){this.stack.push({type:"fragment",children:[]})}function f(et,ut,gt){this.stack[this.stack.length-1].children.push(et),this.stack.push(et),this.tokenStack.push([ut,gt||void 0]),et.position={start:lr(ut.start),end:void 0}}function d(et){return ut;function ut(gt){et&&et.call(this,gt),h.call(this,gt)}}function h(et,ut){const gt=this.stack.pop(),Mt=this.tokenStack.pop();if(Mt)Mt[0].type!==et.type&&(ut?ut.call(this,et,Mt[0]):(Mt[1]||$b).call(this,et,Mt[0]));else throw new Error("Cannot close `"+et.type+"` ("+Ls({start:et.start,end:et.end})+"): it’s not open");gt.position.end=lr(et.end)}function m(){return r5(this.stack.pop())}function g(){this.data.expectingFirstListItemValue=!0}function v(et){if(this.data.expectingFirstListItemValue){const ut=this.stack[this.stack.length-2];ut.start=Number.parseInt(this.sliceSerialize(et),10),this.data.expectingFirstListItemValue=void 0}}function x(){const et=this.resume(),ut=this.stack[this.stack.length-1];ut.lang=et}function b(){const et=this.resume(),ut=this.stack[this.stack.length-1];ut.meta=et}function _(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function T(){const et=this.resume(),ut=this.stack[this.stack.length-1];ut.value=et.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function C(){const et=this.resume(),ut=this.stack[this.stack.length-1];ut.value=et.replace(/(\r?\n|\r)$/g,"")}function z(et){const ut=this.resume(),gt=this.stack[this.stack.length-1];gt.label=ut,gt.identifier=aa(this.sliceSerialize(et)).toLowerCase()}function E(){const et=this.resume(),ut=this.stack[this.stack.length-1];ut.title=et}function M(){const et=this.resume(),ut=this.stack[this.stack.length-1];ut.url=et}function H(et){const ut=this.stack[this.stack.length-1];if(!ut.depth){const gt=this.sliceSerialize(et).length;ut.depth=gt}}function R(){this.data.setextHeadingSlurpLineEnding=!0}function B(et){const ut=this.stack[this.stack.length-1];ut.depth=this.sliceSerialize(et).codePointAt(0)===61?1:2}function P(){this.data.setextHeadingSlurpLineEnding=void 0}function q(et){const gt=this.stack[this.stack.length-1].children;let Mt=gt[gt.length-1];(!Mt||Mt.type!=="text")&&(Mt=ue(),Mt.position={start:lr(et.start),end:void 0},gt.push(Mt)),this.stack.push(Mt)}function J(et){const ut=this.stack.pop();ut.value+=this.sliceSerialize(et),ut.position.end=lr(et.end)}function j(et){const ut=this.stack[this.stack.length-1];if(this.data.atHardBreak){const gt=ut.children[ut.children.length-1];gt.position.end=lr(et.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&n.canContainEols.includes(ut.type)&&(q.call(this,et),J.call(this,et))}function V(){this.data.atHardBreak=!0}function K(){const et=this.resume(),ut=this.stack[this.stack.length-1];ut.value=et}function D(){const et=this.resume(),ut=this.stack[this.stack.length-1];ut.value=et}function I(){const et=this.resume(),ut=this.stack[this.stack.length-1];ut.value=et}function O(){const et=this.stack[this.stack.length-1];if(this.data.inReference){const ut=this.data.referenceType||"shortcut";et.type+="Reference",et.referenceType=ut,delete et.url,delete et.title}else delete et.identifier,delete et.label;this.data.referenceType=void 0}function U(){const et=this.stack[this.stack.length-1];if(this.data.inReference){const ut=this.data.referenceType||"shortcut";et.type+="Reference",et.referenceType=ut,delete et.url,delete et.title}else delete et.identifier,delete et.label;this.data.referenceType=void 0}function G(et){const ut=this.sliceSerialize(et),gt=this.stack[this.stack.length-2];gt.label=i4(ut),gt.identifier=aa(ut).toLowerCase()}function $(){const et=this.stack[this.stack.length-1],ut=this.resume(),gt=this.stack[this.stack.length-1];if(this.data.inReference=!0,gt.type==="link"){const Mt=et.children;gt.children=Mt}else gt.alt=ut}function k(){const et=this.resume(),ut=this.stack[this.stack.length-1];ut.url=et}function L(){const et=this.resume(),ut=this.stack[this.stack.length-1];ut.title=et}function X(){this.data.inReference=void 0}function A(){this.data.referenceType="collapsed"}function it(et){const ut=this.resume(),gt=this.stack[this.stack.length-1];gt.label=ut,gt.identifier=aa(this.sliceSerialize(et)).toLowerCase(),this.data.referenceType="full"}function ct(et){this.data.characterReferenceType=et.type}function ft(et){const ut=this.sliceSerialize(et),gt=this.data.characterReferenceType;let Mt;gt?(Mt=oE(ut,gt==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Mt=Lm(ut);const Pt=this.stack[this.stack.length-1];Pt.value+=Mt}function dt(et){const ut=this.stack.pop();ut.position.end=lr(et.end)}function lt(et){J.call(this,et);const ut=this.stack[this.stack.length-1];ut.url=this.sliceSerialize(et)}function pt(et){J.call(this,et);const ut=this.stack[this.stack.length-1];ut.url="mailto:"+this.sliceSerialize(et)}function St(){return{type:"blockquote",children:[]}}function wt(){return{type:"code",lang:null,meta:null,value:""}}function vt(){return{type:"inlineCode",value:""}}function Et(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Rt(){return{type:"emphasis",children:[]}}function Ht(){return{type:"heading",depth:0,children:[]}}function jt(){return{type:"break"}}function Qt(){return{type:"html",value:""}}function Ee(){return{type:"image",title:null,url:"",alt:null}}function ie(){return{type:"link",title:null,url:"",children:[]}}function Ae(et){return{type:"list",ordered:et.type==="listOrdered",start:null,spread:et._spread,children:[]}}function Je(et){return{type:"listItem",spread:et._spread,checked:null,children:[]}}function yn(){return{type:"paragraph",children:[]}}function An(){return{type:"strong",children:[]}}function ue(){return{type:"text",value:""}}function Un(){return{type:"thematicBreak"}}}function lr(t){return{line:t.line,column:t.column,offset:t.offset}}function gE(t,n){let i=-1;for(;++i<n.length;){const o=n[i];Array.isArray(o)?gE(t,o):s4(t,o)}}function s4(t,n){let i;for(i in n)if(mE.call(n,i))switch(i){case"canContainEols":{const o=n[i];o&&t[i].push(...o);break}case"transforms":{const o=n[i];o&&t[i].push(...o);break}case"enter":case"exit":{const o=n[i];o&&Object.assign(t[i],o);break}}}function $b(t,n){throw t?new Error("Cannot close `"+t.type+"` ("+Ls({start:t.start,end:t.end})+"): a different token (`"+n.type+"`, "+Ls({start:n.start,end:n.end})+") is open"):new Error("Cannot close document, a token (`"+n.type+"`, "+Ls({start:n.start,end:n.end})+") is still open")}function l4(t){const n=this;n.parser=i;function i(o){return o4(o,{...n.data("settings"),...t,extensions:n.data("micromarkExtensions")||[],mdastExtensions:n.data("fromMarkdownExtensions")||[]})}}function u4(t,n){const i={type:"element",tagName:"blockquote",properties:{},children:t.wrap(t.all(n),!0)};return t.patch(n,i),t.applyData(n,i)}function c4(t,n){const i={type:"element",tagName:"br",properties:{},children:[]};return t.patch(n,i),[t.applyData(n,i),{type:"text",value:`
19
+ `}]}function f4(t,n){const i=n.value?n.value+`
20
+ `:"",o={},s=n.lang?n.lang.split(/\s+/):[];s.length>0&&(o.className=["language-"+s[0]]);let l={type:"element",tagName:"code",properties:o,children:[{type:"text",value:i}]};return n.meta&&(l.data={meta:n.meta}),t.patch(n,l),l=t.applyData(n,l),l={type:"element",tagName:"pre",properties:{},children:[l]},t.patch(n,l),l}function d4(t,n){const i={type:"element",tagName:"del",properties:{},children:t.all(n)};return t.patch(n,i),t.applyData(n,i)}function h4(t,n){const i={type:"element",tagName:"em",properties:{},children:t.all(n)};return t.patch(n,i),t.applyData(n,i)}function p4(t,n){const i=typeof t.options.clobberPrefix=="string"?t.options.clobberPrefix:"user-content-",o=String(n.identifier).toUpperCase(),s=xa(o.toLowerCase()),l=t.footnoteOrder.indexOf(o);let c,f=t.footnoteCounts.get(o);f===void 0?(f=0,t.footnoteOrder.push(o),c=t.footnoteOrder.length):c=l+1,f+=1,t.footnoteCounts.set(o,f);const d={type:"element",tagName:"a",properties:{href:"#"+i+"fn-"+s,id:i+"fnref-"+s+(f>1?"-"+f:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(c)}]};t.patch(n,d);const h={type:"element",tagName:"sup",properties:{},children:[d]};return t.patch(n,h),t.applyData(n,h)}function m4(t,n){const i={type:"element",tagName:"h"+n.depth,properties:{},children:t.all(n)};return t.patch(n,i),t.applyData(n,i)}function g4(t,n){if(t.options.allowDangerousHtml){const i={type:"raw",value:n.value};return t.patch(n,i),t.applyData(n,i)}}function yE(t,n){const i=n.referenceType;let o="]";if(i==="collapsed"?o+="[]":i==="full"&&(o+="["+(n.label||n.identifier)+"]"),n.type==="imageReference")return[{type:"text",value:"!["+n.alt+o}];const s=t.all(n),l=s[0];l&&l.type==="text"?l.value="["+l.value:s.unshift({type:"text",value:"["});const c=s[s.length-1];return c&&c.type==="text"?c.value+=o:s.push({type:"text",value:o}),s}function y4(t,n){const i=String(n.identifier).toUpperCase(),o=t.definitionById.get(i);if(!o)return yE(t,n);const s={src:xa(o.url||""),alt:n.alt};o.title!==null&&o.title!==void 0&&(s.title=o.title);const l={type:"element",tagName:"img",properties:s,children:[]};return t.patch(n,l),t.applyData(n,l)}function v4(t,n){const i={src:xa(n.url)};n.alt!==null&&n.alt!==void 0&&(i.alt=n.alt),n.title!==null&&n.title!==void 0&&(i.title=n.title);const o={type:"element",tagName:"img",properties:i,children:[]};return t.patch(n,o),t.applyData(n,o)}function x4(t,n){const i={type:"text",value:n.value.replace(/\r?\n|\r/g," ")};t.patch(n,i);const o={type:"element",tagName:"code",properties:{},children:[i]};return t.patch(n,o),t.applyData(n,o)}function b4(t,n){const i=String(n.identifier).toUpperCase(),o=t.definitionById.get(i);if(!o)return yE(t,n);const s={href:xa(o.url||"")};o.title!==null&&o.title!==void 0&&(s.title=o.title);const l={type:"element",tagName:"a",properties:s,children:t.all(n)};return t.patch(n,l),t.applyData(n,l)}function S4(t,n){const i={href:xa(n.url)};n.title!==null&&n.title!==void 0&&(i.title=n.title);const o={type:"element",tagName:"a",properties:i,children:t.all(n)};return t.patch(n,o),t.applyData(n,o)}function w4(t,n,i){const o=t.all(n),s=i?E4(i):vE(n),l={},c=[];if(typeof n.checked=="boolean"){const m=o[0];let g;m&&m.type==="element"&&m.tagName==="p"?g=m:(g={type:"element",tagName:"p",properties:{},children:[]},o.unshift(g)),g.children.length>0&&g.children.unshift({type:"text",value:" "}),g.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:n.checked,disabled:!0},children:[]}),l.className=["task-list-item"]}let f=-1;for(;++f<o.length;){const m=o[f];(s||f!==0||m.type!=="element"||m.tagName!=="p")&&c.push({type:"text",value:`
21
+ `}),m.type==="element"&&m.tagName==="p"&&!s?c.push(...m.children):c.push(m)}const d=o[o.length-1];d&&(s||d.type!=="element"||d.tagName!=="p")&&c.push({type:"text",value:`
22
+ `});const h={type:"element",tagName:"li",properties:l,children:c};return t.patch(n,h),t.applyData(n,h)}function E4(t){let n=!1;if(t.type==="list"){n=t.spread||!1;const i=t.children;let o=-1;for(;!n&&++o<i.length;)n=vE(i[o])}return n}function vE(t){const n=t.spread;return n??t.children.length>1}function _4(t,n){const i={},o=t.all(n);let s=-1;for(typeof n.start=="number"&&n.start!==1&&(i.start=n.start);++s<o.length;){const c=o[s];if(c.type==="element"&&c.tagName==="li"&&c.properties&&Array.isArray(c.properties.className)&&c.properties.className.includes("task-list-item")){i.className=["contains-task-list"];break}}const l={type:"element",tagName:n.ordered?"ol":"ul",properties:i,children:t.wrap(o,!0)};return t.patch(n,l),t.applyData(n,l)}function C4(t,n){const i={type:"element",tagName:"p",properties:{},children:t.all(n)};return t.patch(n,i),t.applyData(n,i)}function T4(t,n){const i={type:"root",children:t.wrap(t.all(n))};return t.patch(n,i),t.applyData(n,i)}function M4(t,n){const i={type:"element",tagName:"strong",properties:{},children:t.all(n)};return t.patch(n,i),t.applyData(n,i)}function N4(t,n){const i=t.all(n),o=i.shift(),s=[];if(o){const c={type:"element",tagName:"thead",properties:{},children:t.wrap([o],!0)};t.patch(n.children[0],c),s.push(c)}if(i.length>0){const c={type:"element",tagName:"tbody",properties:{},children:t.wrap(i,!0)},f=Rm(n.children[1]),d=Jw(n.children[n.children.length-1]);f&&d&&(c.position={start:f,end:d}),s.push(c)}const l={type:"element",tagName:"table",properties:{},children:t.wrap(s,!0)};return t.patch(n,l),t.applyData(n,l)}function k4(t,n,i){const o=i?i.children:void 0,l=(o?o.indexOf(n):1)===0?"th":"td",c=i&&i.type==="table"?i.align:void 0,f=c?c.length:n.children.length;let d=-1;const h=[];for(;++d<f;){const g=n.children[d],v={},x=c?c[d]:void 0;x&&(v.align=x);let b={type:"element",tagName:l,properties:v,children:[]};g&&(b.children=t.all(g),t.patch(g,b),b=t.applyData(g,b)),h.push(b)}const m={type:"element",tagName:"tr",properties:{},children:t.wrap(h,!0)};return t.patch(n,m),t.applyData(n,m)}function A4(t,n){const i={type:"element",tagName:"td",properties:{},children:t.all(n)};return t.patch(n,i),t.applyData(n,i)}const Zb=9,Kb=32;function R4(t){const n=String(t),i=/\r?\n|\r/g;let o=i.exec(n),s=0;const l=[];for(;o;)l.push(Jb(n.slice(s,o.index),s>0,!0),o[0]),s=o.index+o[0].length,o=i.exec(n);return l.push(Jb(n.slice(s),s>0,!1)),l.join("")}function Jb(t,n,i){let o=0,s=t.length;if(n){let l=t.codePointAt(o);for(;l===Zb||l===Kb;)o++,l=t.codePointAt(o)}if(i){let l=t.codePointAt(s-1);for(;l===Zb||l===Kb;)s--,l=t.codePointAt(s-1)}return s>o?t.slice(o,s):""}function O4(t,n){const i={type:"text",value:R4(String(n.value))};return t.patch(n,i),t.applyData(n,i)}function z4(t,n){const i={type:"element",tagName:"hr",properties:{},children:[]};return t.patch(n,i),t.applyData(n,i)}const D4={blockquote:u4,break:c4,code:f4,delete:d4,emphasis:h4,footnoteReference:p4,heading:m4,html:g4,imageReference:y4,image:v4,inlineCode:x4,linkReference:b4,link:S4,listItem:w4,list:_4,paragraph:C4,root:T4,strong:M4,table:N4,tableCell:A4,tableRow:k4,text:O4,thematicBreak:z4,toml:Zu,yaml:Zu,definition:Zu,footnoteDefinition:Zu};function Zu(){}const xE=-1,ef=0,Bs=1,Oc=2,Hm=3,Pm=4,Im=5,Um=6,bE=7,SE=8,Wb=typeof self=="object"?self:globalThis,L4=(t,n)=>{const i=(s,l)=>(t.set(l,s),s),o=s=>{if(t.has(s))return t.get(s);const[l,c]=n[s];switch(l){case ef:case xE:return i(c,s);case Bs:{const f=i([],s);for(const d of c)f.push(o(d));return f}case Oc:{const f=i({},s);for(const[d,h]of c)f[o(d)]=o(h);return f}case Hm:return i(new Date(c),s);case Pm:{const{source:f,flags:d}=c;return i(new RegExp(f,d),s)}case Im:{const f=i(new Map,s);for(const[d,h]of c)f.set(o(d),o(h));return f}case Um:{const f=i(new Set,s);for(const d of c)f.add(o(d));return f}case bE:{const{name:f,message:d}=c;return i(new Wb[f](d),s)}case SE:return i(BigInt(c),s);case"BigInt":return i(Object(BigInt(c)),s);case"ArrayBuffer":return i(new Uint8Array(c).buffer,c);case"DataView":{const{buffer:f}=new Uint8Array(c);return i(new DataView(f),c)}}return i(new Wb[l](c),s)};return o},t1=t=>L4(new Map,t)(0),Qo="",{toString:j4}={},{keys:B4}=Object,Ts=t=>{const n=typeof t;if(n!=="object"||!t)return[ef,n];const i=j4.call(t).slice(8,-1);switch(i){case"Array":return[Bs,Qo];case"Object":return[Oc,Qo];case"Date":return[Hm,Qo];case"RegExp":return[Pm,Qo];case"Map":return[Im,Qo];case"Set":return[Um,Qo];case"DataView":return[Bs,i]}return i.includes("Array")?[Bs,i]:i.includes("Error")?[bE,i]:[Oc,i]},Ku=([t,n])=>t===ef&&(n==="function"||n==="symbol"),H4=(t,n,i,o)=>{const s=(c,f)=>{const d=o.push(c)-1;return i.set(f,d),d},l=c=>{if(i.has(c))return i.get(c);let[f,d]=Ts(c);switch(f){case ef:{let m=c;switch(d){case"bigint":f=SE,m=c.toString();break;case"function":case"symbol":if(t)throw new TypeError("unable to serialize "+d);m=null;break;case"undefined":return s([xE],c)}return s([f,m],c)}case Bs:{if(d){let v=c;return d==="DataView"?v=new Uint8Array(c.buffer):d==="ArrayBuffer"&&(v=new Uint8Array(c)),s([d,[...v]],c)}const m=[],g=s([f,m],c);for(const v of c)m.push(l(v));return g}case Oc:{if(d)switch(d){case"BigInt":return s([d,c.toString()],c);case"Boolean":case"Number":case"String":return s([d,c.valueOf()],c)}if(n&&"toJSON"in c)return l(c.toJSON());const m=[],g=s([f,m],c);for(const v of B4(c))(t||!Ku(Ts(c[v])))&&m.push([l(v),l(c[v])]);return g}case Hm:return s([f,c.toISOString()],c);case Pm:{const{source:m,flags:g}=c;return s([f,{source:m,flags:g}],c)}case Im:{const m=[],g=s([f,m],c);for(const[v,x]of c)(t||!(Ku(Ts(v))||Ku(Ts(x))))&&m.push([l(v),l(x)]);return g}case Um:{const m=[],g=s([f,m],c);for(const v of c)(t||!Ku(Ts(v)))&&m.push(l(v));return g}}const{message:h}=c;return s([f,{name:d,message:h}],c)};return l},e1=(t,{json:n,lossy:i}={})=>{const o=[];return H4(!(n||i),!!n,new Map,o)(t),o},zc=typeof structuredClone=="function"?(t,n)=>n&&("json"in n||"lossy"in n)?t1(e1(t,n)):structuredClone(t):(t,n)=>t1(e1(t,n));function P4(t,n){const i=[{type:"text",value:"↩"}];return n>1&&i.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(n)}]}),i}function I4(t,n){return"Back to reference "+(t+1)+(n>1?"-"+n:"")}function U4(t){const n=typeof t.options.clobberPrefix=="string"?t.options.clobberPrefix:"user-content-",i=t.options.footnoteBackContent||P4,o=t.options.footnoteBackLabel||I4,s=t.options.footnoteLabel||"Footnotes",l=t.options.footnoteLabelTagName||"h2",c=t.options.footnoteLabelProperties||{className:["sr-only"]},f=[];let d=-1;for(;++d<t.footnoteOrder.length;){const h=t.footnoteById.get(t.footnoteOrder[d]);if(!h)continue;const m=t.all(h),g=String(h.identifier).toUpperCase(),v=xa(g.toLowerCase());let x=0;const b=[],_=t.footnoteCounts.get(g);for(;_!==void 0&&++x<=_;){b.length>0&&b.push({type:"text",value:" "});let z=typeof i=="string"?i:i(d,x);typeof z=="string"&&(z={type:"text",value:z}),b.push({type:"element",tagName:"a",properties:{href:"#"+n+"fnref-"+v+(x>1?"-"+x:""),dataFootnoteBackref:"",ariaLabel:typeof o=="string"?o:o(d,x),className:["data-footnote-backref"]},children:Array.isArray(z)?z:[z]})}const T=m[m.length-1];if(T&&T.type==="element"&&T.tagName==="p"){const z=T.children[T.children.length-1];z&&z.type==="text"?z.value+=" ":T.children.push({type:"text",value:" "}),T.children.push(...b)}else m.push(...b);const C={type:"element",tagName:"li",properties:{id:n+"fn-"+v},children:t.wrap(m,!0)};t.patch(h,C),f.push(C)}if(f.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:l,properties:{...zc(c),id:"footnote-label"},children:[{type:"text",value:s}]},{type:"text",value:`
23
+ `},{type:"element",tagName:"ol",properties:{},children:t.wrap(f,!0)},{type:"text",value:`
24
+ `}]}}const wE=(function(t){if(t==null)return Y4;if(typeof t=="function")return nf(t);if(typeof t=="object")return Array.isArray(t)?V4(t):q4(t);if(typeof t=="string")return F4(t);throw new Error("Expected function, string, or object as test")});function V4(t){const n=[];let i=-1;for(;++i<t.length;)n[i]=wE(t[i]);return nf(o);function o(...s){let l=-1;for(;++l<n.length;)if(n[l].apply(this,s))return!0;return!1}}function q4(t){const n=t;return nf(i);function i(o){const s=o;let l;for(l in t)if(s[l]!==n[l])return!1;return!0}}function F4(t){return nf(n);function n(i){return i&&i.type===t}}function nf(t){return n;function n(i,o,s){return!!(X4(i)&&t.call(this,i,typeof o=="number"?o:void 0,s||void 0))}}function Y4(){return!0}function X4(t){return t!==null&&typeof t=="object"&&"type"in t}const EE=[],G4=!0,n1=!1,Q4="skip";function $4(t,n,i,o){let s;typeof n=="function"&&typeof i!="function"?(o=i,i=n):s=n;const l=wE(s),c=o?-1:1;f(t,void 0,[])();function f(d,h,m){const g=d&&typeof d=="object"?d:{};if(typeof g.type=="string"){const x=typeof g.tagName=="string"?g.tagName:typeof g.name=="string"?g.name:void 0;Object.defineProperty(v,"name",{value:"node ("+(d.type+(x?"<"+x+">":""))+")"})}return v;function v(){let x=EE,b,_,T;if((!n||l(d,h,m[m.length-1]||void 0))&&(x=Z4(i(d,m)),x[0]===n1))return x;if("children"in d&&d.children){const C=d;if(C.children&&x[0]!==Q4)for(_=(o?C.children.length:-1)+c,T=m.concat(C);_>-1&&_<C.children.length;){const z=C.children[_];if(b=f(z,_,T)(),b[0]===n1)return b;_=typeof b[1]=="number"?b[1]:_+c}}return x}}}function Z4(t){return Array.isArray(t)?t:typeof t=="number"?[G4,t]:t==null?EE:[t]}function _E(t,n,i,o){let s,l,c;typeof n=="function"&&typeof i!="function"?(l=void 0,c=n,s=i):(l=n,c=i,s=o),$4(t,l,f,s);function f(d,h){const m=h[h.length-1],g=m?m.children.indexOf(d):void 0;return c(d,g,m)}}const Up={}.hasOwnProperty,K4={};function J4(t,n){const i=n||K4,o=new Map,s=new Map,l=new Map,c={...D4,...i.handlers},f={all:h,applyData:tj,definitionById:o,footnoteById:s,footnoteCounts:l,footnoteOrder:[],handlers:c,one:d,options:i,patch:W4,wrap:nj};return _E(t,function(m){if(m.type==="definition"||m.type==="footnoteDefinition"){const g=m.type==="definition"?o:s,v=String(m.identifier).toUpperCase();g.has(v)||g.set(v,m)}}),f;function d(m,g){const v=m.type,x=f.handlers[v];if(Up.call(f.handlers,v)&&x)return x(f,m,g);if(f.options.passThrough&&f.options.passThrough.includes(v)){if("children"in m){const{children:_,...T}=m,C=zc(T);return C.children=f.all(m),C}return zc(m)}return(f.options.unknownHandler||ej)(f,m,g)}function h(m){const g=[];if("children"in m){const v=m.children;let x=-1;for(;++x<v.length;){const b=f.one(v[x],m);if(b){if(x&&v[x-1].type==="break"&&(!Array.isArray(b)&&b.type==="text"&&(b.value=i1(b.value)),!Array.isArray(b)&&b.type==="element")){const _=b.children[0];_&&_.type==="text"&&(_.value=i1(_.value))}Array.isArray(b)?g.push(...b):g.push(b)}}}return g}}function W4(t,n){t.position&&(n.position=jD(t))}function tj(t,n){let i=n;if(t&&t.data){const o=t.data.hName,s=t.data.hChildren,l=t.data.hProperties;if(typeof o=="string")if(i.type==="element")i.tagName=o;else{const c="children"in i?i.children:[i];i={type:"element",tagName:o,properties:{},children:c}}i.type==="element"&&l&&Object.assign(i.properties,zc(l)),"children"in i&&i.children&&s!==null&&s!==void 0&&(i.children=s)}return i}function ej(t,n){const i=n.data||{},o="value"in n&&!(Up.call(i,"hProperties")||Up.call(i,"hChildren"))?{type:"text",value:n.value}:{type:"element",tagName:"div",properties:{},children:t.all(n)};return t.patch(n,o),t.applyData(n,o)}function nj(t,n){const i=[];let o=-1;for(n&&i.push({type:"text",value:`
25
+ `});++o<t.length;)o&&i.push({type:"text",value:`
26
+ `}),i.push(t[o]);return n&&t.length>0&&i.push({type:"text",value:`
27
+ `}),i}function i1(t){let n=0,i=t.charCodeAt(n);for(;i===9||i===32;)n++,i=t.charCodeAt(n);return t.slice(n)}function r1(t,n){const i=J4(t,n),o=i.one(t,void 0),s=U4(i),l=Array.isArray(o)?{type:"root",children:o}:o||{type:"root",children:[]};return s&&l.children.push({type:"text",value:`
28
+ `},s),l}function ij(t,n){return t&&"run"in t?async function(i,o){const s=r1(i,{file:o,...n});await t.run(s,o)}:function(i,o){return r1(i,{file:o,...t||n})}}function o1(t){if(t)throw t}var tp,a1;function rj(){if(a1)return tp;a1=1;var t=Object.prototype.hasOwnProperty,n=Object.prototype.toString,i=Object.defineProperty,o=Object.getOwnPropertyDescriptor,s=function(h){return typeof Array.isArray=="function"?Array.isArray(h):n.call(h)==="[object Array]"},l=function(h){if(!h||n.call(h)!=="[object Object]")return!1;var m=t.call(h,"constructor"),g=h.constructor&&h.constructor.prototype&&t.call(h.constructor.prototype,"isPrototypeOf");if(h.constructor&&!m&&!g)return!1;var v;for(v in h);return typeof v>"u"||t.call(h,v)},c=function(h,m){i&&m.name==="__proto__"?i(h,m.name,{enumerable:!0,configurable:!0,value:m.newValue,writable:!0}):h[m.name]=m.newValue},f=function(h,m){if(m==="__proto__")if(t.call(h,m)){if(o)return o(h,m).value}else return;return h[m]};return tp=function d(){var h,m,g,v,x,b,_=arguments[0],T=1,C=arguments.length,z=!1;for(typeof _=="boolean"&&(z=_,_=arguments[1]||{},T=2),(_==null||typeof _!="object"&&typeof _!="function")&&(_={});T<C;++T)if(h=arguments[T],h!=null)for(m in h)g=f(_,m),v=f(h,m),_!==v&&(z&&v&&(l(v)||(x=s(v)))?(x?(x=!1,b=g&&s(g)?g:[]):b=g&&l(g)?g:{},c(_,{name:m,newValue:d(z,b,v)})):typeof v<"u"&&c(_,{name:m,newValue:v}));return _},tp}var oj=rj();const ep=Dc(oj);function Vp(t){if(typeof t!="object"||t===null)return!1;const n=Object.getPrototypeOf(t);return(n===null||n===Object.prototype||Object.getPrototypeOf(n)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)}function aj(){const t=[],n={run:i,use:o};return n;function i(...s){let l=-1;const c=s.pop();if(typeof c!="function")throw new TypeError("Expected function as last argument, not "+c);f(null,...s);function f(d,...h){const m=t[++l];let g=-1;if(d){c(d);return}for(;++g<s.length;)(h[g]===null||h[g]===void 0)&&(h[g]=s[g]);s=h,m?sj(m,f)(...h):c(null,...h)}}function o(s){if(typeof s!="function")throw new TypeError("Expected `middelware` to be a function, not "+s);return t.push(s),n}}function sj(t,n){let i;return o;function o(...c){const f=t.length>c.length;let d;f&&c.push(s);try{d=t.apply(this,c)}catch(h){const m=h;if(f&&i)throw m;return s(m)}f||(d&&d.then&&typeof d.then=="function"?d.then(l,s):d instanceof Error?s(d):l(d))}function s(c,...f){i||(i=!0,n(c,...f))}function l(c){s(null,c)}}const $n={basename:lj,dirname:uj,extname:cj,join:fj,sep:"/"};function lj(t,n){if(n!==void 0&&typeof n!="string")throw new TypeError('"ext" argument must be a string');dl(t);let i=0,o=-1,s=t.length,l;if(n===void 0||n.length===0||n.length>t.length){for(;s--;)if(t.codePointAt(s)===47){if(l){i=s+1;break}}else o<0&&(l=!0,o=s+1);return o<0?"":t.slice(i,o)}if(n===t)return"";let c=-1,f=n.length-1;for(;s--;)if(t.codePointAt(s)===47){if(l){i=s+1;break}}else c<0&&(l=!0,c=s+1),f>-1&&(t.codePointAt(s)===n.codePointAt(f--)?f<0&&(o=s):(f=-1,o=c));return i===o?o=c:o<0&&(o=t.length),t.slice(i,o)}function uj(t){if(dl(t),t.length===0)return".";let n=-1,i=t.length,o;for(;--i;)if(t.codePointAt(i)===47){if(o){n=i;break}}else o||(o=!0);return n<0?t.codePointAt(0)===47?"/":".":n===1&&t.codePointAt(0)===47?"//":t.slice(0,n)}function cj(t){dl(t);let n=t.length,i=-1,o=0,s=-1,l=0,c;for(;n--;){const f=t.codePointAt(n);if(f===47){if(c){o=n+1;break}continue}i<0&&(c=!0,i=n+1),f===46?s<0?s=n:l!==1&&(l=1):s>-1&&(l=-1)}return s<0||i<0||l===0||l===1&&s===i-1&&s===o+1?"":t.slice(s,i)}function fj(...t){let n=-1,i;for(;++n<t.length;)dl(t[n]),t[n]&&(i=i===void 0?t[n]:i+"/"+t[n]);return i===void 0?".":dj(i)}function dj(t){dl(t);const n=t.codePointAt(0)===47;let i=hj(t,!n);return i.length===0&&!n&&(i="."),i.length>0&&t.codePointAt(t.length-1)===47&&(i+="/"),n?"/"+i:i}function hj(t,n){let i="",o=0,s=-1,l=0,c=-1,f,d;for(;++c<=t.length;){if(c<t.length)f=t.codePointAt(c);else{if(f===47)break;f=47}if(f===47){if(!(s===c-1||l===1))if(s!==c-1&&l===2){if(i.length<2||o!==2||i.codePointAt(i.length-1)!==46||i.codePointAt(i.length-2)!==46){if(i.length>2){if(d=i.lastIndexOf("/"),d!==i.length-1){d<0?(i="",o=0):(i=i.slice(0,d),o=i.length-1-i.lastIndexOf("/")),s=c,l=0;continue}}else if(i.length>0){i="",o=0,s=c,l=0;continue}}n&&(i=i.length>0?i+"/..":"..",o=2)}else i.length>0?i+="/"+t.slice(s+1,c):i=t.slice(s+1,c),o=c-s-1;s=c,l=0}else f===46&&l>-1?l++:l=-1}return i}function dl(t){if(typeof t!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(t))}const pj={cwd:mj};function mj(){return"/"}function qp(t){return!!(t!==null&&typeof t=="object"&&"href"in t&&t.href&&"protocol"in t&&t.protocol&&t.auth===void 0)}function gj(t){if(typeof t=="string")t=new URL(t);else if(!qp(t)){const n=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+t+"`");throw n.code="ERR_INVALID_ARG_TYPE",n}if(t.protocol!=="file:"){const n=new TypeError("The URL must be of scheme file");throw n.code="ERR_INVALID_URL_SCHEME",n}return yj(t)}function yj(t){if(t.hostname!==""){const o=new TypeError('File URL host must be "localhost" or empty on darwin');throw o.code="ERR_INVALID_FILE_URL_HOST",o}const n=t.pathname;let i=-1;for(;++i<n.length;)if(n.codePointAt(i)===37&&n.codePointAt(i+1)===50){const o=n.codePointAt(i+2);if(o===70||o===102){const s=new TypeError("File URL path must not include encoded / characters");throw s.code="ERR_INVALID_FILE_URL_PATH",s}}return decodeURIComponent(n)}const np=["history","path","basename","stem","extname","dirname"];class CE{constructor(n){let i;n?qp(n)?i={path:n}:typeof n=="string"||vj(n)?i={value:n}:i=n:i={},this.cwd="cwd"in i?"":pj.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let o=-1;for(;++o<np.length;){const l=np[o];l in i&&i[l]!==void 0&&i[l]!==null&&(this[l]=l==="history"?[...i[l]]:i[l])}let s;for(s in i)np.includes(s)||(this[s]=i[s])}get basename(){return typeof this.path=="string"?$n.basename(this.path):void 0}set basename(n){rp(n,"basename"),ip(n,"basename"),this.path=$n.join(this.dirname||"",n)}get dirname(){return typeof this.path=="string"?$n.dirname(this.path):void 0}set dirname(n){s1(this.basename,"dirname"),this.path=$n.join(n||"",this.basename)}get extname(){return typeof this.path=="string"?$n.extname(this.path):void 0}set extname(n){if(ip(n,"extname"),s1(this.dirname,"extname"),n){if(n.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(n.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=$n.join(this.dirname,this.stem+(n||""))}get path(){return this.history[this.history.length-1]}set path(n){qp(n)&&(n=gj(n)),rp(n,"path"),this.path!==n&&this.history.push(n)}get stem(){return typeof this.path=="string"?$n.basename(this.path,this.extname):void 0}set stem(n){rp(n,"stem"),ip(n,"stem"),this.path=$n.join(this.dirname||"",n+(this.extname||""))}fail(n,i,o){const s=this.message(n,i,o);throw s.fatal=!0,s}info(n,i,o){const s=this.message(n,i,o);return s.fatal=void 0,s}message(n,i,o){const s=new Le(n,i,o);return this.path&&(s.name=this.path+":"+s.name,s.file=this.path),s.fatal=!1,this.messages.push(s),s}toString(n){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(n||void 0).decode(this.value)}}function ip(t,n){if(t&&t.includes($n.sep))throw new Error("`"+n+"` cannot be a path: did not expect `"+$n.sep+"`")}function rp(t,n){if(!t)throw new Error("`"+n+"` cannot be empty")}function s1(t,n){if(!t)throw new Error("Setting `"+n+"` requires `path` to be set too")}function vj(t){return!!(t&&typeof t=="object"&&"byteLength"in t&&"byteOffset"in t)}const xj=(function(t){const o=this.constructor.prototype,s=o[t],l=function(){return s.apply(l,arguments)};return Object.setPrototypeOf(l,o),l}),bj={}.hasOwnProperty;class Vm extends xj{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=aj()}copy(){const n=new Vm;let i=-1;for(;++i<this.attachers.length;){const o=this.attachers[i];n.use(...o)}return n.data(ep(!0,{},this.namespace)),n}data(n,i){return typeof n=="string"?arguments.length===2?(sp("data",this.frozen),this.namespace[n]=i,this):bj.call(this.namespace,n)&&this.namespace[n]||void 0:n?(sp("data",this.frozen),this.namespace=n,this):this.namespace}freeze(){if(this.frozen)return this;const n=this;for(;++this.freezeIndex<this.attachers.length;){const[i,...o]=this.attachers[this.freezeIndex];if(o[0]===!1)continue;o[0]===!0&&(o[0]=void 0);const s=i.call(n,...o);typeof s=="function"&&this.transformers.use(s)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(n){this.freeze();const i=Ju(n),o=this.parser||this.Parser;return op("parse",o),o(String(i),i)}process(n,i){const o=this;return this.freeze(),op("process",this.parser||this.Parser),ap("process",this.compiler||this.Compiler),i?s(void 0,i):new Promise(s);function s(l,c){const f=Ju(n),d=o.parse(f);o.run(d,f,function(m,g,v){if(m||!g||!v)return h(m);const x=g,b=o.stringify(x,v);Ej(b)?v.value=b:v.result=b,h(m,v)});function h(m,g){m||!g?c(m):l?l(g):i(void 0,g)}}}processSync(n){let i=!1,o;return this.freeze(),op("processSync",this.parser||this.Parser),ap("processSync",this.compiler||this.Compiler),this.process(n,s),u1("processSync","process",i),o;function s(l,c){i=!0,o1(l),o=c}}run(n,i,o){l1(n),this.freeze();const s=this.transformers;return!o&&typeof i=="function"&&(o=i,i=void 0),o?l(void 0,o):new Promise(l);function l(c,f){const d=Ju(i);s.run(n,d,h);function h(m,g,v){const x=g||n;m?f(m):c?c(x):o(void 0,x,v)}}}runSync(n,i){let o=!1,s;return this.run(n,i,l),u1("runSync","run",o),s;function l(c,f){o1(c),s=f,o=!0}}stringify(n,i){this.freeze();const o=Ju(i),s=this.compiler||this.Compiler;return ap("stringify",s),l1(n),s(n,o)}use(n,...i){const o=this.attachers,s=this.namespace;if(sp("use",this.frozen),n!=null)if(typeof n=="function")d(n,i);else if(typeof n=="object")Array.isArray(n)?f(n):c(n);else throw new TypeError("Expected usable value, not `"+n+"`");return this;function l(h){if(typeof h=="function")d(h,[]);else if(typeof h=="object")if(Array.isArray(h)){const[m,...g]=h;d(m,g)}else c(h);else throw new TypeError("Expected usable value, not `"+h+"`")}function c(h){if(!("plugins"in h)&&!("settings"in h))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(h.plugins),h.settings&&(s.settings=ep(!0,s.settings,h.settings))}function f(h){let m=-1;if(h!=null)if(Array.isArray(h))for(;++m<h.length;){const g=h[m];l(g)}else throw new TypeError("Expected a list of plugins, not `"+h+"`")}function d(h,m){let g=-1,v=-1;for(;++g<o.length;)if(o[g][0]===h){v=g;break}if(v===-1)o.push([h,...m]);else if(m.length>0){let[x,...b]=m;const _=o[v][1];Vp(_)&&Vp(x)&&(x=ep(!0,_,x)),o[v]=[h,x,...b]}}}}const Sj=new Vm().freeze();function op(t,n){if(typeof n!="function")throw new TypeError("Cannot `"+t+"` without `parser`")}function ap(t,n){if(typeof n!="function")throw new TypeError("Cannot `"+t+"` without `compiler`")}function sp(t,n){if(n)throw new Error("Cannot call `"+t+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function l1(t){if(!Vp(t)||typeof t.type!="string")throw new TypeError("Expected node, got `"+t+"`")}function u1(t,n,i){if(!i)throw new Error("`"+t+"` finished async. Use `"+n+"` instead")}function Ju(t){return wj(t)?t:new CE(t)}function wj(t){return!!(t&&typeof t=="object"&&"message"in t&&"messages"in t)}function Ej(t){return typeof t=="string"||_j(t)}function _j(t){return!!(t&&typeof t=="object"&&"byteLength"in t&&"byteOffset"in t)}const Cj="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",c1=[],f1={allowDangerousHtml:!0},Tj=/^(https?|ircs?|mailto|xmpp)$/i,Mj=[{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 Nj(t){const n=kj(t),i=Aj(t);return Rj(n.runSync(n.parse(i),i),t)}function kj(t){const n=t.rehypePlugins||c1,i=t.remarkPlugins||c1,o=t.remarkRehypeOptions?{...t.remarkRehypeOptions,...f1}:f1;return Sj().use(l4).use(i).use(ij,o).use(n)}function Aj(t){const n=t.children||"",i=new CE;return typeof n=="string"&&(i.value=n),i}function Rj(t,n){const i=n.allowedElements,o=n.allowElement,s=n.components,l=n.disallowedElements,c=n.skipHtml,f=n.unwrapDisallowed,d=n.urlTransform||Oj;for(const m of Mj)Object.hasOwn(n,m.from)&&(""+m.from+(m.to?"use `"+m.to+"` instead":"remove it")+Cj+m.id,void 0);return _E(t,h),UD(t,{Fragment:w.Fragment,components:s,ignoreInvalidStyle:!0,jsx:w.jsx,jsxs:w.jsxs,passKeys:!0,passNode:!0});function h(m,g,v){if(m.type==="raw"&&v&&typeof g=="number")return c?v.children.splice(g,1):v.children[g]={type:"text",value:m.value},g;if(m.type==="element"){let x;for(x in Kh)if(Object.hasOwn(Kh,x)&&Object.hasOwn(m.properties,x)){const b=m.properties[x],_=Kh[x];(_===null||_.includes(m.tagName))&&(m.properties[x]=d(String(b||""),x,m))}}if(m.type==="element"){let x=i?!i.includes(m.tagName):l?l.includes(m.tagName):!1;if(!x&&o&&typeof g=="number"&&(x=!o(m,g,v)),x&&v&&typeof g=="number")return f&&m.children?v.children.splice(g,1,...m.children):v.children.splice(g,1),g}}}function Oj(t){const n=t.indexOf(":"),i=t.indexOf("?"),o=t.indexOf("#"),s=t.indexOf("/");return n===-1||s!==-1&&n>s||i!==-1&&n>i||o!==-1&&n>o||Tj.test(t.slice(0,n))?t:""}function zj({children:t,className:n}){return w.jsx("div",{className:`markdown-view ${n??""}`,children:w.jsx(Nj,{children:t})})}function Dj({sessionId:t,nodeId:n,onClose:i}){const{data:o,isLoading:s,error:l}=EM(t,n);return w.jsxs("div",{className:"fixed inset-y-0 right-0 w-[420px] bg-[var(--bg-secondary)] border-l border-[var(--border)] flex flex-col z-50",children:[w.jsx(Lj,{stepLabel:o?.stepLabel??null,nodeId:n,onClose:i}),w.jsxs("div",{className:"flex-1 overflow-y-auto p-4 space-y-4",children:[s&&w.jsx("div",{className:"text-[var(--text-secondary)] text-sm",children:"Loading..."}),l&&w.jsx("div",{className:"text-[var(--error)] text-sm bg-[var(--bg-card)] rounded p-3",children:l.message}),o&&w.jsx(jj,{detail:o})]})]})}function Lj({stepLabel:t,nodeId:n,onClose:i}){return w.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-[var(--border)] shrink-0 gap-2",children:[w.jsxs("div",{className:"min-w-0",children:[t&&w.jsx("div",{className:"text-sm font-medium text-[var(--text-primary)] truncate",children:t}),w.jsx("div",{className:"font-mono text-xs text-[var(--text-muted)] truncate",children:n})]}),w.jsx("button",{onClick:i,className:"shrink-0 text-[var(--text-muted)] hover:text-[var(--text-primary)] transition-colors text-lg leading-none cursor-pointer",children:"✕"})]})}function jj({detail:t}){return w.jsxs(w.Fragment,{children:[w.jsx(Bj,{detail:t}),t.recapMarkdown&&w.jsx(Hj,{markdown:t.recapMarkdown}),t.advanceOutcome&&w.jsx(Pj,{outcome:t.advanceOutcome}),t.validations.length>0&&w.jsx(Ij,{validations:t.validations}),t.gaps.length>0&&w.jsx(Vj,{gaps:t.gaps}),t.artifacts.length>0&&w.jsx(qj,{artifacts:t.artifacts})]})}function Bj({detail:t}){return w.jsx(ba,{title:"Node",children:w.jsxs("dl",{className:"grid grid-cols-[auto_1fr] gap-x-3 gap-y-1 text-xs",children:[w.jsx(Wu,{label:"Kind",value:w.jsx(Yj,{kind:t.nodeKind})}),w.jsx(Wu,{label:"Event Index",value:String(t.createdAtEventIndex)}),t.parentNodeId&&w.jsx(Wu,{label:"Parent",value:t.parentNodeId,mono:!0}),t.isTip&&w.jsx(Wu,{label:"Tip",value:t.isPreferredTip?"Preferred tip":"Tip"})]})})}function Hj({markdown:t}){return w.jsx(ba,{title:"Recap",children:w.jsx(zj,{children:t})})}function Pj({outcome:t}){const n=t.kind==="advanced";return w.jsx(ba,{title:"Advance Outcome",children:w.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[w.jsx("span",{className:"inline-flex items-center px-2 py-0.5 rounded font-medium",style:{backgroundColor:n?"var(--success)20":"var(--blocked)20",color:n?"var(--success)":"var(--blocked)"},children:n?"Advanced":"Blocked"}),w.jsxs("span",{className:"text-[var(--text-muted)]",children:["attempt ",t.attemptId.slice(-8)," at event #",t.recordedAtEventIndex]})]})})}function Ij({validations:t}){return w.jsx(ba,{title:`Validations (${t.length})`,children:w.jsx("div",{className:"space-y-2",children:t.map(n=>w.jsx(Uj,{validation:n},n.validationId))})})}function Uj({validation:t}){const n=t.outcome==="pass";return w.jsxs("div",{className:"bg-[var(--bg-primary)] rounded p-3 text-xs space-y-2",children:[w.jsxs("div",{className:"flex items-center gap-2",children:[w.jsx("span",{className:"inline-flex items-center px-1.5 py-0.5 rounded font-medium",style:{backgroundColor:n?"var(--success)20":"var(--error)20",color:n?"var(--success)":"var(--error)"},children:n?"Pass":"Fail"}),w.jsx("span",{className:"text-[var(--text-muted)] font-mono",children:t.contractRef})]}),t.issues.length>0&&w.jsxs("div",{children:[w.jsx("div",{className:"text-[var(--text-muted)] mb-1",children:"Issues:"}),w.jsx("ul",{className:"list-disc list-inside text-[var(--error)] space-y-0.5",children:t.issues.map((i,o)=>w.jsx("li",{children:i},o))})]}),t.suggestions.length>0&&w.jsxs("div",{children:[w.jsx("div",{className:"text-[var(--text-muted)] mb-1",children:"Suggestions:"}),w.jsx("ul",{className:"list-disc list-inside text-[var(--text-secondary)] space-y-0.5",children:t.suggestions.map((i,o)=>w.jsx("li",{children:i},o))})]})]})}function Vj({gaps:t}){return w.jsx(ba,{title:`Gaps (${t.length})`,children:w.jsx("div",{className:"space-y-1.5",children:t.map(n=>w.jsxs("div",{className:"flex items-start gap-2 text-xs bg-[var(--bg-primary)] rounded p-2",children:[w.jsx("span",{className:"shrink-0 mt-0.5 inline-flex items-center px-1.5 py-0.5 rounded font-medium",style:{backgroundColor:n.isResolved?"var(--success)20":n.severity==="critical"?"var(--error)20":"var(--warning)20",color:n.isResolved?"var(--success)":n.severity==="critical"?"var(--error)":"var(--warning)"},children:n.isResolved?"Resolved":n.severity==="critical"?"Critical":"Non-critical"}),w.jsx("span",{className:"text-[var(--text-secondary)]",children:n.summary})]},n.gapId))})})}function qj({artifacts:t}){return w.jsx(ba,{title:`Artifacts (${t.length})`,children:w.jsx("div",{className:"space-y-2",children:t.map(n=>w.jsxs("div",{className:"bg-[var(--bg-primary)] rounded p-3 text-xs space-y-1",children:[w.jsxs("div",{className:"flex items-center gap-2 text-[var(--text-muted)]",children:[w.jsx("span",{children:n.contentType}),w.jsx("span",{children:"·"}),w.jsx("span",{children:Xj(n.byteLength)})]}),w.jsx("pre",{className:"text-[var(--text-secondary)] whitespace-pre-wrap break-words font-mono max-h-48 overflow-y-auto",children:typeof n.content=="string"?n.content:JSON.stringify(n.content,null,2)})]},n.sha256))})})}function ba({title:t,children:n}){return w.jsxs("div",{className:"bg-[var(--bg-card)] border border-[var(--border)] rounded-lg overflow-hidden",children:[w.jsx("div",{className:"px-3 py-2 border-b border-[var(--border)]",children:w.jsx("h3",{className:"text-xs font-medium text-[var(--text-muted)] uppercase tracking-wide",children:t})}),w.jsx("div",{className:"p-3",children:n})]})}function Wu({label:t,value:n,mono:i}){return w.jsxs(w.Fragment,{children:[w.jsx("dt",{className:"text-[var(--text-muted)]",children:t}),w.jsx("dd",{className:i?"font-mono text-[var(--text-secondary)] truncate":"text-[var(--text-primary)]",children:n})]})}const Fj={step:{label:"Step",color:"var(--accent)"},checkpoint:{label:"Checkpoint",color:"var(--success)"},blocked_attempt:{label:"Blocked",color:"var(--error)"}};function Yj({kind:t}){const n=Fj[t];return w.jsx("span",{className:"inline-flex items-center px-1.5 py-0.5 rounded font-medium",style:{backgroundColor:`${n.color}20`,color:n.color},children:n.label})}function Xj(t){return t<1024?`${t} B`:t<1024*1024?`${(t/1024).toFixed(1)} KB`:`${(t/(1024*1024)).toFixed(1)} MB`}function Gj({sessionId:t}){const{data:n,isLoading:i,error:o}=wM(t),[s,l]=F.useState(null),c=F.useCallback(d=>{l(h=>h===d?null:d)},[]),f=F.useCallback(()=>l(null),[]);return i?w.jsx("div",{className:"text-[var(--text-secondary)]",children:"Loading session..."}):o?w.jsxs("div",{className:"text-[var(--error)] bg-[var(--bg-card)] rounded-lg p-4",children:["Failed to load session: ",o.message]}):n?w.jsxs("div",{className:s?"mr-[420px] transition-[margin] duration-200":"transition-[margin] duration-200",children:[n.sessionTitle&&w.jsx("h2",{className:"text-base font-medium text-[var(--text-primary)] mb-2",children:n.sessionTitle}),w.jsxs("div",{className:"flex items-center gap-3 mb-6",children:[w.jsx(eS,{health:n.health}),w.jsxs("span",{className:"text-sm text-[var(--text-muted)]",children:[n.runs.length," run",n.runs.length!==1?"s":""]})]}),n.runs.length===0?w.jsx("div",{className:"text-center py-16 text-[var(--text-secondary)]",children:"No runs in this session"}):w.jsx("div",{className:"space-y-6",children:n.runs.map(d=>w.jsxs("div",{className:"bg-[var(--bg-card)] border border-[var(--border)] rounded-lg overflow-hidden",children:[w.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-[var(--border)]",children:[w.jsxs("div",{className:"flex items-center gap-3",children:[w.jsx("span",{className:"text-sm font-medium text-[var(--text-primary)]",children:d.workflowName??d.workflowId??"Run"}),w.jsx("span",{className:"font-mono text-xs text-[var(--text-muted)]",children:d.runId})]}),w.jsxs("div",{className:"flex items-center gap-2",children:[d.hasUnresolvedCriticalGaps&&w.jsx("span",{className:"text-xs text-[var(--warning)]",children:"Critical gaps"}),w.jsx(tS,{status:d.status})]})]}),w.jsx("div",{className:"h-[500px]",children:w.jsx(fD,{run:d,onNodeClick:c})})]},d.runId))}),s&&w.jsx(Dj,{sessionId:t,nodeId:s,onClose:f})]}):null}function Qj(){const t=rl(),i=aM()({to:"/session/$sessionId"}),o=i!==!1,s=o?i.sessionId:null,l=()=>{t({to:"/"})};return w.jsxs("div",{className:"min-h-screen bg-[var(--bg-primary)]",style:{"--app-header-height":"61px"},children:[w.jsx("header",{className:"sticky top-0 z-20 border-b border-[var(--border)] px-6 py-4 bg-[var(--bg-primary)]",children:w.jsxs("div",{className:"flex items-center gap-4",children:[o&&w.jsx("button",{onClick:l,className:"text-[var(--text-secondary)] hover:text-[var(--text-primary)] transition-colors",children:"← Back"}),w.jsx("h1",{className:"text-lg font-semibold text-[var(--text-primary)]",children:"WorkRail Console"}),o&&s&&w.jsx("span",{className:"text-sm text-[var(--text-muted)] font-mono",children:s})]})}),w.jsxs("main",{className:"p-6",children:[w.jsx(GM,{hidden:o}),o&&s&&w.jsx(Gj,{sessionId:s})]})]})}const qm=KT({component:Qj}),$j=rm({getParentRoute:()=>qm,path:"/",component:()=>null}),Zj=rm({getParentRoute:()=>qm,path:"/session/$sessionId",component:()=>null}),Kj=qm.addChildren([$j,Zj]),Jj=sM({routeTree:Kj,history:M2()}),Wj=new u2({defaultOptions:{queries:{refetchInterval:5e3,staleTime:2e3}}});PC.createRoot(document.getElementById("root")).render(w.jsx(F.StrictMode,{children:w.jsx(c2,{client:Wj,children:w.jsx(cM,{router:Jj})})}));