stemtrace 0.1.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (72) hide show
  1. stemtrace/__init__.py +173 -0
  2. stemtrace/core/__init__.py +15 -0
  3. stemtrace/core/events.py +67 -0
  4. stemtrace/core/exceptions.py +25 -0
  5. stemtrace/core/graph.py +348 -0
  6. stemtrace/core/ports.py +42 -0
  7. stemtrace/library/__init__.py +1 -0
  8. stemtrace/library/bootsteps.py +169 -0
  9. stemtrace/library/config.py +55 -0
  10. stemtrace/library/scrubbing.py +195 -0
  11. stemtrace/library/signals.py +434 -0
  12. stemtrace/library/transports/__init__.py +36 -0
  13. stemtrace/library/transports/memory.py +33 -0
  14. stemtrace/library/transports/redis.py +92 -0
  15. stemtrace/py.typed +0 -0
  16. stemtrace/server/__init__.py +24 -0
  17. stemtrace/server/__main__.py +136 -0
  18. stemtrace/server/api/__init__.py +29 -0
  19. stemtrace/server/api/routes.py +270 -0
  20. stemtrace/server/api/schemas.py +136 -0
  21. stemtrace/server/api/websocket.py +28 -0
  22. stemtrace/server/consumer.py +133 -0
  23. stemtrace/server/fastapi/__init__.py +13 -0
  24. stemtrace/server/fastapi/auth.py +77 -0
  25. stemtrace/server/fastapi/extension.py +121 -0
  26. stemtrace/server/fastapi/router.py +42 -0
  27. stemtrace/server/store.py +260 -0
  28. stemtrace/server/ui/__init__.py +5 -0
  29. stemtrace/server/ui/frontend/biome.json +58 -0
  30. stemtrace/server/ui/frontend/dist/assets/index-CCs7iO1n.css +1 -0
  31. stemtrace/server/ui/frontend/dist/assets/index-Dao0_Q6x.js +14 -0
  32. stemtrace/server/ui/frontend/dist/index.html +17 -0
  33. stemtrace/server/ui/frontend/index.html +16 -0
  34. stemtrace/server/ui/frontend/package-lock.json +4049 -0
  35. stemtrace/server/ui/frontend/package.json +46 -0
  36. stemtrace/server/ui/frontend/playwright.config.ts +40 -0
  37. stemtrace/server/ui/frontend/postcss.config.js +5 -0
  38. stemtrace/server/ui/frontend/src/api/client.ts +173 -0
  39. stemtrace/server/ui/frontend/src/api/queries.ts +151 -0
  40. stemtrace/server/ui/frontend/src/components/DateRangePicker.tsx +244 -0
  41. stemtrace/server/ui/frontend/src/components/Filters.tsx +116 -0
  42. stemtrace/server/ui/frontend/src/components/TaskGraph.tsx +453 -0
  43. stemtrace/server/ui/frontend/src/components/TaskList.tsx +172 -0
  44. stemtrace/server/ui/frontend/src/components/TaskStateBadge.tsx +27 -0
  45. stemtrace/server/ui/frontend/src/components/TaskTimeline.tsx +144 -0
  46. stemtrace/server/ui/frontend/src/components/TimelineBar.tsx +224 -0
  47. stemtrace/server/ui/frontend/src/components/Tooltip.tsx +54 -0
  48. stemtrace/server/ui/frontend/src/hooks/WebSocketContext.tsx +143 -0
  49. stemtrace/server/ui/frontend/src/hooks/useInfiniteScroll.ts +56 -0
  50. stemtrace/server/ui/frontend/src/index.css +104 -0
  51. stemtrace/server/ui/frontend/src/main.tsx +44 -0
  52. stemtrace/server/ui/frontend/src/routes/__root.tsx +103 -0
  53. stemtrace/server/ui/frontend/src/routes/graph.$rootId.tsx +51 -0
  54. stemtrace/server/ui/frontend/src/routes/graphs.tsx +186 -0
  55. stemtrace/server/ui/frontend/src/routes/index.tsx +119 -0
  56. stemtrace/server/ui/frontend/src/routes/registry.tsx +211 -0
  57. stemtrace/server/ui/frontend/src/routes/tasks.$taskId.tsx +313 -0
  58. stemtrace/server/ui/frontend/src/utils/format.ts +38 -0
  59. stemtrace/server/ui/frontend/tests/graphs.spec.ts +485 -0
  60. stemtrace/server/ui/frontend/tests/registry.spec.ts +117 -0
  61. stemtrace/server/ui/frontend/tests/task-detail.spec.ts +147 -0
  62. stemtrace/server/ui/frontend/tests/tasks.spec.ts +92 -0
  63. stemtrace/server/ui/frontend/tsconfig.json +32 -0
  64. stemtrace/server/ui/frontend/tsconfig.tsbuildinfo +1 -0
  65. stemtrace/server/ui/frontend/vite.config.ts +30 -0
  66. stemtrace/server/ui/static.py +56 -0
  67. stemtrace/server/websocket.py +99 -0
  68. stemtrace-0.1.0.dist-info/METADATA +428 -0
  69. stemtrace-0.1.0.dist-info/RECORD +72 -0
  70. stemtrace-0.1.0.dist-info/WHEEL +4 -0
  71. stemtrace-0.1.0.dist-info/entry_points.txt +2 -0
  72. stemtrace-0.1.0.dist-info/licenses/LICENSE +21 -0
@@ -0,0 +1,14 @@
1
+ (function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))s(i);new MutationObserver(i=>{for(const l of i)if(l.type==="childList")for(const u of l.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&s(u)}).observe(document,{childList:!0,subtree:!0});function n(i){const l={};return i.integrity&&(l.integrity=i.integrity),i.referrerPolicy&&(l.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?l.credentials="include":i.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function s(i){if(i.ep)return;i.ep=!0;const l=n(i);fetch(i.href,l)}})();function Xy(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ed={exports:{}},hi={},Nd={exports:{}},De={};var Um;function A1(){if(Um)return De;Um=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),l=Symbol.for("react.provider"),u=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),p=Symbol.iterator;function g(D){return D===null||typeof D!="object"?null:(D=p&&D[p]||D["@@iterator"],typeof D=="function"?D:null)}var w={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},S=Object.assign,_={};function C(D,$,ne){this.props=D,this.context=$,this.refs=_,this.updater=ne||w}C.prototype.isReactComponent={},C.prototype.setState=function(D,$){if(typeof D!="object"&&typeof D!="function"&&D!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,D,$,"setState")},C.prototype.forceUpdate=function(D){this.updater.enqueueForceUpdate(this,D,"forceUpdate")};function N(){}N.prototype=C.prototype;function P(D,$,ne){this.props=D,this.context=$,this.refs=_,this.updater=ne||w}var k=P.prototype=new N;k.constructor=P,S(k,C.prototype),k.isPureReactComponent=!0;var b=Array.isArray,T=Object.prototype.hasOwnProperty,M={current:null},R={key:!0,ref:!0,__self:!0,__source:!0};function O(D,$,ne){var te,ie={},ce=null,ue=null;if($!=null)for(te in $.ref!==void 0&&(ue=$.ref),$.key!==void 0&&(ce=""+$.key),$)T.call($,te)&&!R.hasOwnProperty(te)&&(ie[te]=$[te]);var ee=arguments.length-2;if(ee===1)ie.children=ne;else if(1<ee){for(var ae=Array(ee),xe=0;xe<ee;xe++)ae[xe]=arguments[xe+2];ie.children=ae}if(D&&D.defaultProps)for(te in ee=D.defaultProps,ee)ie[te]===void 0&&(ie[te]=ee[te]);return{$$typeof:e,type:D,key:ce,ref:ue,props:ie,_owner:M.current}}function A(D,$){return{$$typeof:e,type:D.type,key:$,ref:D.ref,props:D.props,_owner:D._owner}}function G(D){return typeof D=="object"&&D!==null&&D.$$typeof===e}function W(D){var $={"=":"=0",":":"=2"};return"$"+D.replace(/[=:]/g,function(ne){return $[ne]})}var K=/\/+/g;function J(D,$){return typeof D=="object"&&D!==null&&D.key!=null?W(""+D.key):$.toString(36)}function I(D,$,ne,te,ie){var ce=typeof D;(ce==="undefined"||ce==="boolean")&&(D=null);var ue=!1;if(D===null)ue=!0;else switch(ce){case"string":case"number":ue=!0;break;case"object":switch(D.$$typeof){case e:case t:ue=!0}}if(ue)return ue=D,ie=ie(ue),D=te===""?"."+J(ue,0):te,b(ie)?(ne="",D!=null&&(ne=D.replace(K,"$&/")+"/"),I(ie,$,ne,"",function(xe){return xe})):ie!=null&&(G(ie)&&(ie=A(ie,ne+(!ie.key||ue&&ue.key===ie.key?"":(""+ie.key).replace(K,"$&/")+"/")+D)),$.push(ie)),1;if(ue=0,te=te===""?".":te+":",b(D))for(var ee=0;ee<D.length;ee++){ce=D[ee];var ae=te+J(ce,ee);ue+=I(ce,$,ne,ae,ie)}else if(ae=g(D),typeof ae=="function")for(D=ae.call(D),ee=0;!(ce=D.next()).done;)ce=ce.value,ae=te+J(ce,ee++),ue+=I(ce,$,ne,ae,ie);else if(ce==="object")throw $=String(D),Error("Objects are not valid as a React child (found: "+($==="[object Object]"?"object with keys {"+Object.keys(D).join(", ")+"}":$)+"). If you meant to render a collection of children, use an array instead.");return ue}function Y(D,$,ne){if(D==null)return D;var te=[],ie=0;return I(D,te,"","",function(ce){return $.call(ne,ce,ie++)}),te}function V(D){if(D._status===-1){var $=D._result;$=$(),$.then(function(ne){(D._status===0||D._status===-1)&&(D._status=1,D._result=ne)},function(ne){(D._status===0||D._status===-1)&&(D._status=2,D._result=ne)}),D._status===-1&&(D._status=0,D._result=$)}if(D._status===1)return D._result.default;throw D._result}var Q={current:null},F={transition:null},B={ReactCurrentDispatcher:Q,ReactCurrentBatchConfig:F,ReactCurrentOwner:M};function U(){throw Error("act(...) is not supported in production builds of React.")}return De.Children={map:Y,forEach:function(D,$,ne){Y(D,function(){$.apply(this,arguments)},ne)},count:function(D){var $=0;return Y(D,function(){$++}),$},toArray:function(D){return Y(D,function($){return $})||[]},only:function(D){if(!G(D))throw Error("React.Children.only expected to receive a single React element child.");return D}},De.Component=C,De.Fragment=n,De.Profiler=i,De.PureComponent=P,De.StrictMode=s,De.Suspense=f,De.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=B,De.act=U,De.cloneElement=function(D,$,ne){if(D==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+D+".");var te=S({},D.props),ie=D.key,ce=D.ref,ue=D._owner;if($!=null){if($.ref!==void 0&&(ce=$.ref,ue=M.current),$.key!==void 0&&(ie=""+$.key),D.type&&D.type.defaultProps)var ee=D.type.defaultProps;for(ae in $)T.call($,ae)&&!R.hasOwnProperty(ae)&&(te[ae]=$[ae]===void 0&&ee!==void 0?ee[ae]:$[ae])}var ae=arguments.length-2;if(ae===1)te.children=ne;else if(1<ae){ee=Array(ae);for(var xe=0;xe<ae;xe++)ee[xe]=arguments[xe+2];te.children=ee}return{$$typeof:e,type:D.type,key:ie,ref:ce,props:te,_owner:ue}},De.createContext=function(D){return D={$$typeof:u,_currentValue:D,_currentValue2:D,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},D.Provider={$$typeof:l,_context:D},D.Consumer=D},De.createElement=O,De.createFactory=function(D){var $=O.bind(null,D);return $.type=D,$},De.createRef=function(){return{current:null}},De.forwardRef=function(D){return{$$typeof:c,render:D}},De.isValidElement=G,De.lazy=function(D){return{$$typeof:m,_payload:{_status:-1,_result:D},_init:V}},De.memo=function(D,$){return{$$typeof:h,type:D,compare:$===void 0?null:$}},De.startTransition=function(D){var $=F.transition;F.transition={};try{D()}finally{F.transition=$}},De.unstable_act=U,De.useCallback=function(D,$){return Q.current.useCallback(D,$)},De.useContext=function(D){return Q.current.useContext(D)},De.useDebugValue=function(){},De.useDeferredValue=function(D){return Q.current.useDeferredValue(D)},De.useEffect=function(D,$){return Q.current.useEffect(D,$)},De.useId=function(){return Q.current.useId()},De.useImperativeHandle=function(D,$,ne){return Q.current.useImperativeHandle(D,$,ne)},De.useInsertionEffect=function(D,$){return Q.current.useInsertionEffect(D,$)},De.useLayoutEffect=function(D,$){return Q.current.useLayoutEffect(D,$)},De.useMemo=function(D,$){return Q.current.useMemo(D,$)},De.useReducer=function(D,$,ne){return Q.current.useReducer(D,$,ne)},De.useRef=function(D){return Q.current.useRef(D)},De.useState=function(D){return Q.current.useState(D)},De.useSyncExternalStore=function(D,$,ne){return Q.current.useSyncExternalStore(D,$,ne)},De.useTransition=function(){return Q.current.useTransition()},De.version="18.3.1",De}var Qm;function qi(){return Qm||(Qm=1,Nd.exports=A1()),Nd.exports}var qm;function z1(){if(qm)return hi;qm=1;var e=qi(),t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),s=Object.prototype.hasOwnProperty,i=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,l={key:!0,ref:!0,__self:!0,__source:!0};function u(c,f,h){var m,p={},g=null,w=null;h!==void 0&&(g=""+h),f.key!==void 0&&(g=""+f.key),f.ref!==void 0&&(w=f.ref);for(m in f)s.call(f,m)&&!l.hasOwnProperty(m)&&(p[m]=f[m]);if(c&&c.defaultProps)for(m in f=c.defaultProps,f)p[m]===void 0&&(p[m]=f[m]);return{$$typeof:t,type:c,key:g,ref:w,props:p,_owner:i.current}}return hi.Fragment=n,hi.jsx=u,hi.jsxs=u,hi}var Km;function W1(){return Km||(Km=1,Ed.exports=z1()),Ed.exports}var x=W1(),Ki=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},$1={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},B1=class{#e=$1;#t=!1;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}},oo=new B1;function H1(e){setTimeout(e,0)}var ho=typeof window>"u"||"Deno"in globalThis;function jt(){}function V1(e,t){return typeof e=="function"?e(t):e}function af(e){return typeof e=="number"&&e>=0&&e!==1/0}function Zy(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Dr(e,t){return typeof e=="function"?e(t):e}function sn(e,t){return typeof e=="function"?e(t):e}function Gm(e,t){const{type:n="all",exact:s,fetchStatus:i,predicate:l,queryKey:u,stale:c}=e;if(u){if(s){if(t.queryHash!==jf(u,t.options))return!1}else if(!Ii(t.queryKey,u))return!1}if(n!=="all"){const f=t.isActive();if(n==="active"&&!f||n==="inactive"&&f)return!1}return!(typeof c=="boolean"&&t.isStale()!==c||i&&i!==t.state.fetchStatus||l&&!l(t))}function Xm(e,t){const{exact:n,status:s,predicate:i,mutationKey:l}=e;if(l){if(!t.options.mutationKey)return!1;if(n){if(Oi(t.options.mutationKey)!==Oi(l))return!1}else if(!Ii(t.options.mutationKey,l))return!1}return!(s&&t.state.status!==s||i&&!i(t))}function jf(e,t){return(t?.queryKeyHashFn||Oi)(e)}function Oi(e){return JSON.stringify(e,(t,n)=>uf(n)?Object.keys(n).sort().reduce((s,i)=>(s[i]=n[i],s),{}):n)}function Ii(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>Ii(e[n],t[n])):!1}var Y1=Object.prototype.hasOwnProperty;function Jy(e,t){if(e===t)return e;const n=Zm(e)&&Zm(t);if(!n&&!(uf(e)&&uf(t)))return t;const i=(n?e:Object.keys(e)).length,l=n?t:Object.keys(t),u=l.length,c=n?new Array(u):{};let f=0;for(let h=0;h<u;h++){const m=n?h:l[h],p=e[m],g=t[m];if(p===g){c[m]=p,(n?h<i:Y1.call(e,m))&&f++;continue}if(p===null||g===null||typeof p!="object"||typeof g!="object"){c[m]=g;continue}const w=Jy(p,g);c[m]=w,w===p&&f++}return i===u&&f===i?e:c}function lf(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function Zm(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function uf(e){if(!Jm(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!Jm(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function Jm(e){return Object.prototype.toString.call(e)==="[object Object]"}function U1(e){return new Promise(t=>{oo.setTimeout(t,e)})}function cf(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?Jy(e,t):t}function Q1(e,t,n=0){const s=[...e,t];return n&&s.length>n?s.slice(1):s}function q1(e,t,n=0){const s=[t,...e];return n&&s.length>n?s.slice(0,-1):s}var Lf=Symbol();function e0(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===Lf?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function K1(e,t){return typeof e=="function"?e(...t):!!e}var G1=class extends Ki{#e;#t;#n;constructor(){super(),this.#n=e=>{if(!ho&&window.addEventListener){const t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(t=>{typeof t=="boolean"?this.setFocused(t):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}},Ff=new G1;function df(){let e,t;const n=new Promise((i,l)=>{e=i,t=l});n.status="pending",n.catch(()=>{});function s(i){Object.assign(n,i),delete n.resolve,delete n.reject}return n.resolve=i=>{s({status:"fulfilled",value:i}),e(i)},n.reject=i=>{s({status:"rejected",reason:i}),t(i)},n}var X1=H1;function Z1(){let e=[],t=0,n=c=>{c()},s=c=>{c()},i=X1;const l=c=>{t?e.push(c):i(()=>{n(c)})},u=()=>{const c=e;e=[],c.length&&i(()=>{s(()=>{c.forEach(f=>{n(f)})})})};return{batch:c=>{let f;t++;try{f=c()}finally{t--,t||u()}return f},batchCalls:c=>(...f)=>{l(()=>{c(...f)})},schedule:l,setNotifyFunction:c=>{n=c},setBatchNotifyFunction:c=>{s=c},setScheduler:c=>{i=c}}}var vt=Z1(),J1=class extends Ki{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(!ho&&window.addEventListener){const t=()=>e(!0),n=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(n=>{n(e)}))}isOnline(){return this.#e}},Hl=new J1;function eS(e){return Math.min(1e3*2**e,3e4)}function t0(e){return(e??"online")==="online"?Hl.isOnline():!0}var ff=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function n0(e){let t=!1,n=0,s;const i=df(),l=()=>i.status!=="pending",u=_=>{if(!l()){const C=new ff(_);g(C),e.onCancel?.(C)}},c=()=>{t=!0},f=()=>{t=!1},h=()=>Ff.isFocused()&&(e.networkMode==="always"||Hl.isOnline())&&e.canRun(),m=()=>t0(e.networkMode)&&e.canRun(),p=_=>{l()||(s?.(),i.resolve(_))},g=_=>{l()||(s?.(),i.reject(_))},w=()=>new Promise(_=>{s=C=>{(l()||h())&&_(C)},e.onPause?.()}).then(()=>{s=void 0,l()||e.onContinue?.()}),S=()=>{if(l())return;let _;const C=n===0?e.initialPromise:void 0;try{_=C??e.fn()}catch(N){_=Promise.reject(N)}Promise.resolve(_).then(p).catch(N=>{if(l())return;const P=e.retry??(ho?0:3),k=e.retryDelay??eS,b=typeof k=="function"?k(n,N):k,T=P===!0||typeof P=="number"&&n<P||typeof P=="function"&&P(n,N);if(t||!T){g(N);return}n++,e.onFail?.(n,N),U1(b).then(()=>h()?void 0:w()).then(()=>{t?g(N):S()})})};return{promise:i,status:()=>i.status,cancel:u,continue:()=>(s?.(),i),cancelRetry:c,continueRetry:f,canStart:m,start:()=>(m()?S():w().then(S),i)}}var r0=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),af(this.gcTime)&&(this.#e=oo.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(ho?1/0:300*1e3))}clearGcTimeout(){this.#e&&(oo.clearTimeout(this.#e),this.#e=void 0)}},tS=class extends r0{#e;#t;#n;#o;#r;#a;#i;constructor(e){super(),this.#i=!1,this.#a=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#o=e.client,this.#n=this.#o.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#e=tg(this.options),this.state=e.state??this.#e,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#r?.promise}setOptions(e){if(this.options={...this.#a,...e},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const t=tg(this.options);t.data!==void 0&&(this.setState(eg(t.data,t.dataUpdatedAt)),this.#e=t)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#n.remove(this)}setData(e,t){const n=cf(this.state.data,e,this.options);return this.#s({data:n,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e,t){this.#s({type:"setState",state:e,setStateOptions:t})}cancel(e){const t=this.#r?.promise;return this.#r?.cancel(e),t?t.then(jt).catch(jt):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#e)}isActive(){return this.observers.some(e=>sn(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Lf||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>Dr(e.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e==="static"?!1:this.state.isInvalidated?!0:!Zy(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(t=>t.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#r?.continue()}onOnline(){this.observers.find(t=>t.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#r?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#r&&(this.#i?this.#r.cancel({revert:!0}):this.#r.cancelRetry()),this.scheduleGc()),this.#n.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#s({type:"invalidate"})}async fetch(e,t){if(this.state.fetchStatus!=="idle"&&this.#r?.status()!=="rejected"){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#r)return this.#r.continueRetry(),this.#r.promise}if(e&&this.setOptions(e),!this.options.queryFn){const c=this.observers.find(f=>f.options.queryFn);c&&this.setOptions(c.options)}const n=new AbortController,s=c=>{Object.defineProperty(c,"signal",{enumerable:!0,get:()=>(this.#i=!0,n.signal)})},i=()=>{const c=e0(this.options,t),h=(()=>{const m={client:this.#o,queryKey:this.queryKey,meta:this.meta};return s(m),m})();return this.#i=!1,this.options.persister?this.options.persister(c,h,this):c(h)},u=(()=>{const c={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#o,state:this.state,fetchFn:i};return s(c),c})();this.options.behavior?.onFetch(u,this),this.#t=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==u.fetchOptions?.meta)&&this.#s({type:"fetch",meta:u.fetchOptions?.meta}),this.#r=n0({initialPromise:t?.initialPromise,fn:u.fetchFn,onCancel:c=>{c instanceof ff&&c.revert&&this.setState({...this.#t,fetchStatus:"idle"}),n.abort()},onFail:(c,f)=>{this.#s({type:"failed",failureCount:c,error:f})},onPause:()=>{this.#s({type:"pause"})},onContinue:()=>{this.#s({type:"continue"})},retry:u.options.retry,retryDelay:u.options.retryDelay,networkMode:u.options.networkMode,canRun:()=>!0});try{const c=await this.#r.start();if(c===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(c),this.#n.config.onSuccess?.(c,this),this.#n.config.onSettled?.(c,this.state.error,this),c}catch(c){if(c instanceof ff){if(c.silent)return this.#r.promise;if(c.revert){if(this.state.data===void 0)throw c;return this.state.data}}throw this.#s({type:"error",error:c}),this.#n.config.onError?.(c,this),this.#n.config.onSettled?.(this.state.data,c,this),c}finally{this.scheduleGc()}}#s(e){const t=n=>{switch(e.type){case"failed":return{...n,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...o0(n.data,this.options),fetchMeta:e.meta??null};case"success":const s={...n,...eg(e.data,e.dataUpdatedAt),dataUpdateCount:n.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#t=e.manual?s:void 0,s;case"error":const i=e.error;return{...n,error:i,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error"};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...e.state}}};this.state=t(this.state),vt.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),this.#n.notify({query:this,type:"updated",action:e})})}};function o0(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:t0(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function eg(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function tg(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,s=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?s??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var s0=class extends Ki{constructor(e,t){super(),this.options=t,this.#e=e,this.#s=null,this.#i=df(),this.bindMethods(),this.setOptions(t)}#e;#t=void 0;#n=void 0;#o=void 0;#r;#a;#i;#s;#m;#f;#h;#u;#c;#l;#p=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),ng(this.#t,this.options)?this.#d():this.updateResult(),this.#x())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return hf(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return hf(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#w(),this.#S(),this.#t.removeObserver(this)}setOptions(e){const t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof sn(this.options.enabled,this.#t)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#k(),this.#t.setOptions(this.options),t._defaulted&&!lf(this.options,t)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const s=this.hasListeners();s&&rg(this.#t,n,this.options,t)&&this.#d(),this.updateResult(),s&&(this.#t!==n||sn(this.options.enabled,this.#t)!==sn(t.enabled,this.#t)||Dr(this.options.staleTime,this.#t)!==Dr(t.staleTime,this.#t))&&this.#g();const i=this.#y();s&&(this.#t!==n||sn(this.options.enabled,this.#t)!==sn(t.enabled,this.#t)||i!==this.#l)&&this.#v(i)}getOptimisticResult(e){const t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return rS(this,n)&&(this.#o=n,this.#a=this.options,this.#r=this.#t.state),n}getCurrentResult(){return this.#o}trackResult(e,t){return new Proxy(e,{get:(n,s)=>(this.trackProp(s),t?.(s),s==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&this.#i.status==="pending"&&this.#i.reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(n,s))})}trackProp(e){this.#p.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t);return n.fetch().then(()=>this.createResult(n,t))}fetch(e){return this.#d({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#o))}#d(e){this.#k();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(jt)),t}#g(){this.#w();const e=Dr(this.options.staleTime,this.#t);if(ho||this.#o.isStale||!af(e))return;const n=Zy(this.#o.dataUpdatedAt,e)+1;this.#u=oo.setTimeout(()=>{this.#o.isStale||this.updateResult()},n)}#y(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#v(e){this.#S(),this.#l=e,!(ho||sn(this.options.enabled,this.#t)===!1||!af(this.#l)||this.#l===0)&&(this.#c=oo.setInterval(()=>{(this.options.refetchIntervalInBackground||Ff.isFocused())&&this.#d()},this.#l))}#x(){this.#g(),this.#v(this.#y())}#w(){this.#u&&(oo.clearTimeout(this.#u),this.#u=void 0)}#S(){this.#c&&(oo.clearInterval(this.#c),this.#c=void 0)}createResult(e,t){const n=this.#t,s=this.options,i=this.#o,l=this.#r,u=this.#a,f=e!==n?e.state:this.#n,{state:h}=e;let m={...h},p=!1,g;if(t._optimisticResults){const O=this.hasListeners(),A=!O&&ng(e,t),G=O&&rg(e,n,t,s);(A||G)&&(m={...m,...o0(h.data,e.options)}),t._optimisticResults==="isRestoring"&&(m.fetchStatus="idle")}let{error:w,errorUpdatedAt:S,status:_}=m;g=m.data;let C=!1;if(t.placeholderData!==void 0&&g===void 0&&_==="pending"){let O;i?.isPlaceholderData&&t.placeholderData===u?.placeholderData?(O=i.data,C=!0):O=typeof t.placeholderData=="function"?t.placeholderData(this.#h?.state.data,this.#h):t.placeholderData,O!==void 0&&(_="success",g=cf(i?.data,O,t),p=!0)}if(t.select&&g!==void 0&&!C)if(i&&g===l?.data&&t.select===this.#m)g=this.#f;else try{this.#m=t.select,g=t.select(g),g=cf(i?.data,g,t),this.#f=g,this.#s=null}catch(O){this.#s=O}this.#s&&(w=this.#s,g=this.#f,S=Date.now(),_="error");const N=m.fetchStatus==="fetching",P=_==="pending",k=_==="error",b=P&&N,T=g!==void 0,R={status:_,fetchStatus:m.fetchStatus,isPending:P,isSuccess:_==="success",isError:k,isInitialLoading:b,isLoading:b,data:g,dataUpdatedAt:m.dataUpdatedAt,error:w,errorUpdatedAt:S,failureCount:m.fetchFailureCount,failureReason:m.fetchFailureReason,errorUpdateCount:m.errorUpdateCount,isFetched:m.dataUpdateCount>0||m.errorUpdateCount>0,isFetchedAfterMount:m.dataUpdateCount>f.dataUpdateCount||m.errorUpdateCount>f.errorUpdateCount,isFetching:N,isRefetching:N&&!P,isLoadingError:k&&!T,isPaused:m.fetchStatus==="paused",isPlaceholderData:p,isRefetchError:k&&T,isStale:Af(e,t),refetch:this.refetch,promise:this.#i,isEnabled:sn(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const O=W=>{R.status==="error"?W.reject(R.error):R.data!==void 0&&W.resolve(R.data)},A=()=>{const W=this.#i=R.promise=df();O(W)},G=this.#i;switch(G.status){case"pending":e.queryHash===n.queryHash&&O(G);break;case"fulfilled":(R.status==="error"||R.data!==G.value)&&A();break;case"rejected":(R.status!=="error"||R.error!==G.reason)&&A();break}}return R}updateResult(){const e=this.#o,t=this.createResult(this.#t,this.options);if(this.#r=this.#t.state,this.#a=this.options,this.#r.data!==void 0&&(this.#h=this.#t),lf(t,e))return;this.#o=t;const n=()=>{if(!e)return!0;const{notifyOnChangeProps:s}=this.options,i=typeof s=="function"?s():s;if(i==="all"||!i&&!this.#p.size)return!0;const l=new Set(i??this.#p);return this.options.throwOnError&&l.add("error"),Object.keys(this.#o).some(u=>{const c=u;return this.#o[c]!==e[c]&&l.has(c)})};this.#_({listeners:n()})}#k(){const e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;const t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#x()}#_(e){vt.batch(()=>{e.listeners&&this.listeners.forEach(t=>{t(this.#o)}),this.#e.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}};function nS(e,t){return sn(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function ng(e,t){return nS(e,t)||e.state.data!==void 0&&hf(e,t,t.refetchOnMount)}function hf(e,t,n){if(sn(t.enabled,e)!==!1&&Dr(t.staleTime,e)!=="static"){const s=typeof n=="function"?n(e):n;return s==="always"||s!==!1&&Af(e,t)}return!1}function rg(e,t,n,s){return(e!==t||sn(s.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&Af(e,n)}function Af(e,t){return sn(t.enabled,e)!==!1&&e.isStaleByTime(Dr(t.staleTime,e))}function rS(e,t){return!lf(e.getCurrentResult(),t)}function Vl(e){return{onFetch:(t,n)=>{const s=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,l=t.state.data?.pages||[],u=t.state.data?.pageParams||[];let c={pages:[],pageParams:[]},f=0;const h=async()=>{let m=!1;const p=S=>{Object.defineProperty(S,"signal",{enumerable:!0,get:()=>(t.signal.aborted?m=!0:t.signal.addEventListener("abort",()=>{m=!0}),t.signal)})},g=e0(t.options,t.fetchOptions),w=async(S,_,C)=>{if(m)return Promise.reject();if(_==null&&S.pages.length)return Promise.resolve(S);const P=(()=>{const M={client:t.client,queryKey:t.queryKey,pageParam:_,direction:C?"backward":"forward",meta:t.options.meta};return p(M),M})(),k=await g(P),{maxPages:b}=t.options,T=C?q1:Q1;return{pages:T(S.pages,k,b),pageParams:T(S.pageParams,_,b)}};if(i&&l.length){const S=i==="backward",_=S?i0:pf,C={pages:l,pageParams:u},N=_(s,C);c=await w(C,N,S)}else{const S=e??l.length;do{const _=f===0?u[0]??s.initialPageParam:pf(s,c);if(f>0&&_==null)break;c=await w(c,_),f++}while(f<S)}return c};t.options.persister?t.fetchFn=()=>t.options.persister?.(h,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=h}}}function pf(e,{pages:t,pageParams:n}){const s=t.length-1;return t.length>0?e.getNextPageParam(t[s],t,n[s],n):void 0}function i0(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}function oS(e,t){return t?pf(e,t)!=null:!1}function sS(e,t){return!t||!e.getPreviousPageParam?!1:i0(e,t)!=null}var iS=class extends s0{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){super.setOptions({...e,behavior:Vl()})}getOptimisticResult(e){return e.behavior=Vl(),super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"backward"}}})}createResult(e,t){const{state:n}=e,s=super.createResult(e,t),{isFetching:i,isRefetching:l,isError:u,isRefetchError:c}=s,f=n.fetchMeta?.fetchMore?.direction,h=u&&f==="forward",m=i&&f==="forward",p=u&&f==="backward",g=i&&f==="backward";return{...s,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:oS(t,n.data),hasPreviousPage:sS(t,n.data),isFetchNextPageError:h,isFetchingNextPage:m,isFetchPreviousPageError:p,isFetchingPreviousPage:g,isRefetchError:c&&!h&&!p,isRefetching:l&&!m&&!g}}},aS=class extends r0{#e;#t;#n;#o;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||lS(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status==="pending"?this.scheduleGc():this.#n.remove(this))}continue(){return this.#o?.continue()??this.execute(this.state.variables)}async execute(e){const t=()=>{this.#r({type:"continue"})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#o=n0({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(new Error("No mutationFn found")),onFail:(l,u)=>{this.#r({type:"failed",failureCount:l,error:u})},onPause:()=>{this.#r({type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});const s=this.state.status==="pending",i=!this.#o.canStart();try{if(s)t();else{this.#r({type:"pending",variables:e,isPaused:i}),await this.#n.config.onMutate?.(e,this,n);const u=await this.options.onMutate?.(e,n);u!==this.state.context&&this.#r({type:"pending",context:u,variables:e,isPaused:i})}const l=await this.#o.start();return await this.#n.config.onSuccess?.(l,e,this.state.context,this,n),await this.options.onSuccess?.(l,e,this.state.context,n),await this.#n.config.onSettled?.(l,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(l,null,e,this.state.context,n),this.#r({type:"success",data:l}),l}catch(l){try{throw await this.#n.config.onError?.(l,e,this.state.context,this,n),await this.options.onError?.(l,e,this.state.context,n),await this.#n.config.onSettled?.(void 0,l,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(void 0,l,e,this.state.context,n),l}finally{this.#r({type:"error",error:l})}}finally{this.#n.runNext(this)}}#r(e){const t=n=>{switch(e.type){case"failed":return{...n,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...n,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:e.error,failureCount:n.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=t(this.state),vt.batch(()=>{this.#t.forEach(n=>{n.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:"updated",action:e})})}};function lS(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var uS=class extends Ki{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,t,n){const s=new aS({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(s),s}add(e){this.#e.add(e);const t=gl(e);if(typeof t=="string"){const n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#e.delete(e)){const t=gl(e);if(typeof t=="string"){const n=this.#t.get(t);if(n)if(n.length>1){const s=n.indexOf(e);s!==-1&&n.splice(s,1)}else n[0]===e&&this.#t.delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){const t=gl(e);if(typeof t=="string"){const s=this.#t.get(t)?.find(i=>i.state.status==="pending");return!s||s===e}else return!0}runNext(e){const t=gl(e);return typeof t=="string"?this.#t.get(t)?.find(s=>s!==e&&s.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){vt.batch(()=>{this.#e.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){const t={exact:!0,...e};return this.getAll().find(n=>Xm(t,n))}findAll(e={}){return this.getAll().filter(t=>Xm(e,t))}notify(e){vt.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>t.state.isPaused);return vt.batch(()=>Promise.all(e.map(t=>t.continue().catch(jt))))}};function gl(e){return e.options.scope?.id}var cS=class extends Ki{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){const s=t.queryKey,i=t.queryHash??jf(s,t);let l=this.get(i);return l||(l=new tS({client:e,queryKey:s,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(s)}),this.add(l)),l}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){vt.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){const t={exact:!0,...e};return this.getAll().find(n=>Gm(t,n))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(n=>Gm(e,n)):t}notify(e){vt.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){vt.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){vt.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},dS=class{#e;#t;#n;#o;#r;#a;#i;#s;constructor(e={}){this.#e=e.queryCache||new cS,this.#t=e.mutationCache||new uS,this.#n=e.defaultOptions||{},this.#o=new Map,this.#r=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#i=Ff.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=Hl.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#i?.(),this.#i=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#t.findAll({...e,status:"pending"}).length}getQueryData(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=this.#e.build(this,t),s=n.state.data;return s===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(Dr(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(s))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:t,state:n})=>{const s=n.data;return[t,s]})}setQueryData(e,t,n){const s=this.defaultQueryOptions({queryKey:e}),l=this.#e.get(s.queryHash)?.state.data,u=V1(t,l);if(u!==void 0)return this.#e.build(this,s).setData(u,{...n,manual:!0})}setQueriesData(e,t,n){return vt.batch(()=>this.#e.findAll(e).map(({queryKey:s})=>[s,this.setQueryData(s,t,n)]))}getQueryState(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){const t=this.#e;vt.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=this.#e;return vt.batch(()=>(n.findAll(e).forEach(s=>{s.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},s=vt.batch(()=>this.#e.findAll(e).map(i=>i.cancel(n)));return Promise.all(s).then(jt).catch(jt)}invalidateQueries(e,t={}){return vt.batch(()=>(this.#e.findAll(e).forEach(n=>{n.invalidate()}),e?.refetchType==="none"?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},s=vt.batch(()=>this.#e.findAll(e).filter(i=>!i.isDisabled()&&!i.isStatic()).map(i=>{let l=i.fetch(void 0,n);return n.throwOnError||(l=l.catch(jt)),i.state.fetchStatus==="paused"?Promise.resolve():l}));return Promise.all(s).then(jt)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=this.#e.build(this,t);return n.isStaleByTime(Dr(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(jt).catch(jt)}fetchInfiniteQuery(e){return e.behavior=Vl(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(jt).catch(jt)}ensureInfiniteQueryData(e){return e.behavior=Vl(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Hl.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#o.set(Oi(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#o.values()],n={};return t.forEach(s=>{Ii(e,s.queryKey)&&Object.assign(n,s.defaultOptions)}),n}setMutationDefaults(e,t){this.#r.set(Oi(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#r.values()],n={};return t.forEach(s=>{Ii(e,s.mutationKey)&&Object.assign(n,s.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=jf(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===Lf&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},L=qi();const de=Xy(L);var a0=L.createContext(void 0),l0=e=>{const t=L.useContext(a0);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},fS=({client:e,children:t})=>(L.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),x.jsx(a0.Provider,{value:e,children:t})),u0=L.createContext(!1),hS=()=>L.useContext(u0);u0.Provider;function pS(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var mS=L.createContext(pS()),gS=()=>L.useContext(mS),yS=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},vS=e=>{L.useEffect(()=>{e.clearReset()},[e])},xS=({result:e,errorResetBoundary:t,throwOnError:n,query:s,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&s&&(i&&e.data===void 0||K1(n,[e.error,s])),wS=e=>{if(e.suspense){const n=i=>i==="static"?i:Math.max(i??1e3,1e3),s=e.staleTime;e.staleTime=typeof s=="function"?(...i)=>n(s(...i)):n(s),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},SS=(e,t)=>e.isLoading&&e.isFetching&&!t,kS=(e,t)=>e?.suspense&&t.isPending,og=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function c0(e,t,n){const s=hS(),i=gS(),l=l0(),u=l.defaultQueryOptions(e);l.getDefaultOptions().queries?._experimental_beforeQuery?.(u),u._optimisticResults=s?"isRestoring":"optimistic",wS(u),yS(u,i),vS(i);const c=!l.getQueryCache().get(u.queryHash),[f]=L.useState(()=>new t(l,u)),h=f.getOptimisticResult(u),m=!s&&e.subscribed!==!1;if(L.useSyncExternalStore(L.useCallback(p=>{const g=m?f.subscribe(vt.batchCalls(p)):jt;return f.updateResult(),g},[f,m]),()=>f.getCurrentResult(),()=>f.getCurrentResult()),L.useEffect(()=>{f.setOptions(u)},[u,f]),kS(u,h))throw og(u,f,i);if(xS({result:h,errorResetBoundary:i,throwOnError:u.throwOnError,query:l.getQueryCache().get(u.queryHash),suspense:u.suspense}))throw h.error;return l.getDefaultOptions().queries?._experimental_afterQuery?.(u,h),u.experimental_prefetchInRender&&!ho&&SS(h,s)&&(c?og(u,f,i):l.getQueryCache().get(u.queryHash)?.promise)?.catch(jt).finally(()=>{f.updateResult()}),u.notifyOnChangeProps?h:f.trackResult(h)}function Gi(e,t){return c0(e,s0)}function d0(e,t){return c0(e,iS)}const mf=new WeakMap,_S=new WeakMap,Yl={current:[]};let bd=!1,Mi=0;const Ci=new Set,yl=new Map;function f0(e){for(const t of e){if(Yl.current.includes(t))continue;Yl.current.push(t),t.recompute();const n=_S.get(t);if(n)for(const s of n){const i=mf.get(s);i?.length&&f0(i)}}}function CS(e){const t={prevVal:e.prevState,currentVal:e.state};for(const n of e.listeners)n(t)}function ES(e){const t={prevVal:e.prevState,currentVal:e.state};for(const n of e.listeners)n(t)}function h0(e){if(Mi>0&&!yl.has(e)&&yl.set(e,e.prevState),Ci.add(e),!(Mi>0)&&!bd)try{for(bd=!0;Ci.size>0;){const t=Array.from(Ci);Ci.clear();for(const n of t){const s=yl.get(n)??n.prevState;n.prevState=s,CS(n)}for(const n of t){const s=mf.get(n);s&&(Yl.current.push(n),f0(s))}for(const n of t){const s=mf.get(n);if(s)for(const i of s)ES(i)}}}finally{bd=!1,Yl.current=[],yl.clear()}}function Pi(e){Mi++;try{e()}finally{if(Mi--,Mi===0){const t=Ci.values().next().value;t&&h0(t)}}}function NS(e){return typeof e=="function"}class bS{constructor(t,n){this.listeners=new Set,this.subscribe=s=>{var i,l;this.listeners.add(s);const u=(l=(i=this.options)==null?void 0:i.onSubscribe)==null?void 0:l.call(i,s,this);return()=>{this.listeners.delete(s),u?.()}},this.prevState=t,this.state=t,this.options=n}setState(t){var n,s,i;this.prevState=this.state,(n=this.options)!=null&&n.updateFn?this.state=this.options.updateFn(this.prevState)(t):NS(t)?this.state=t(this.prevState):this.state=t,(i=(s=this.options)==null?void 0:s.onUpdate)==null||i.call(s),h0(this)}}const Tr="__TSR_index",sg="popstate",ig="beforeunload";function MS(e){let t=e.getLocation();const n=new Set,s=u=>{t=e.getLocation(),n.forEach(c=>c({location:t,action:u}))},i=u=>{e.notifyOnIndexChange??!0?s(u):t=e.getLocation()},l=async({task:u,navigateOpts:c,...f})=>{if(c?.ignoreBlocker??!1){u();return}const m=e.getBlockers?.()??[],p=f.type==="PUSH"||f.type==="REPLACE";if(typeof document<"u"&&m.length&&p)for(const g of m){const w=Ul(f.path,f.state);if(await g.blockerFn({currentLocation:t,nextLocation:w,action:f.type})){e.onBlocked?.();return}}u()};return{get location(){return t},get length(){return e.getLength()},subscribers:n,subscribe:u=>(n.add(u),()=>{n.delete(u)}),push:(u,c,f)=>{const h=t.state[Tr];c=ag(h+1,c),l({task:()=>{e.pushState(u,c),s({type:"PUSH"})},navigateOpts:f,type:"PUSH",path:u,state:c})},replace:(u,c,f)=>{const h=t.state[Tr];c=ag(h,c),l({task:()=>{e.replaceState(u,c),s({type:"REPLACE"})},navigateOpts:f,type:"REPLACE",path:u,state:c})},go:(u,c)=>{l({task:()=>{e.go(u),i({type:"GO",index:u})},navigateOpts:c,type:"GO"})},back:u=>{l({task:()=>{e.back(u?.ignoreBlocker??!1),i({type:"BACK"})},navigateOpts:u,type:"BACK"})},forward:u=>{l({task:()=>{e.forward(u?.ignoreBlocker??!1),i({type:"FORWARD"})},navigateOpts:u,type:"FORWARD"})},canGoBack:()=>t.state[Tr]!==0,createHref:u=>e.createHref(u),block:u=>{if(!e.setBlockers)return()=>{};const c=e.getBlockers?.()??[];return e.setBlockers([...c,u]),()=>{const f=e.getBlockers?.()??[];e.setBlockers?.(f.filter(h=>h!==u))}},flush:()=>e.flush?.(),destroy:()=>e.destroy?.(),notify:s}}function ag(e,t){t||(t={});const n=zf();return{...t,key:n,__TSR_key:n,[Tr]:e}}function PS(e){const t=typeof document<"u"?window:void 0,n=t.history.pushState,s=t.history.replaceState;let i=[];const l=()=>i,u=O=>i=O,c=(O=>O),f=(()=>Ul(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){const O=zf();t.history.replaceState({[Tr]:0,key:O,__TSR_key:O},"")}let h=f(),m,p=!1,g=!1,w=!1,S=!1;const _=()=>h;let C,N;const P=()=>{C&&(R._ignoreSubscribers=!0,(C.isPush?t.history.pushState:t.history.replaceState)(C.state,"",C.href),R._ignoreSubscribers=!1,C=void 0,N=void 0,m=void 0)},k=(O,A,G)=>{const W=c(A);N||(m=h),h=Ul(A,G),C={href:W,state:G,isPush:C?.isPush||O==="push"},N||(N=Promise.resolve().then(()=>P()))},b=O=>{h=f(),R.notify({type:O})},T=async()=>{if(g){g=!1;return}const O=f(),A=O.state[Tr]-h.state[Tr],G=A===1,W=A===-1,K=!G&&!W||p;p=!1;const J=K?"GO":W?"BACK":"FORWARD",I=K?{type:"GO",index:A}:{type:W?"BACK":"FORWARD"};if(w)w=!1;else{const Y=l();if(typeof document<"u"&&Y.length){for(const V of Y)if(await V.blockerFn({currentLocation:h,nextLocation:O,action:J})){g=!0,t.history.go(1),R.notify(I);return}}}h=f(),R.notify(I)},M=O=>{if(S){S=!1;return}let A=!1;const G=l();if(typeof document<"u"&&G.length)for(const W of G){const K=W.enableBeforeUnload??!0;if(K===!0){A=!0;break}if(typeof K=="function"&&K()===!0){A=!0;break}}if(A)return O.preventDefault(),O.returnValue=""},R=MS({getLocation:_,getLength:()=>t.history.length,pushState:(O,A)=>k("push",O,A),replaceState:(O,A)=>k("replace",O,A),back:O=>(O&&(w=!0),S=!0,t.history.back()),forward:O=>{O&&(w=!0),S=!0,t.history.forward()},go:O=>{p=!0,t.history.go(O)},createHref:O=>c(O),flush:P,destroy:()=>{t.history.pushState=n,t.history.replaceState=s,t.removeEventListener(ig,M,{capture:!0}),t.removeEventListener(sg,T)},onBlocked:()=>{m&&h!==m&&(h=m)},getBlockers:l,setBlockers:u,notifyOnIndexChange:!1});return t.addEventListener(ig,M,{capture:!0}),t.addEventListener(sg,T),t.history.pushState=function(...O){const A=n.apply(t.history,O);return R._ignoreSubscribers||b("PUSH"),A},t.history.replaceState=function(...O){const A=s.apply(t.history,O);return R._ignoreSubscribers||b("REPLACE"),A},R}function Ul(e,t){const n=e.indexOf("#"),s=e.indexOf("?"),i=zf();return{href:e,pathname:e.substring(0,n>0?s>0?Math.min(n,s):n:s>0?s:e.length),hash:n>-1?e.substring(n):"",search:s>-1?e.slice(s,n===-1?void 0:n):"",state:t||{[Tr]:0,key:i,__TSR_key:i}}}function zf(){return(Math.random()+1).toString(36).substring(7)}function Ql(e){return e[e.length-1]}function RS(e){return typeof e=="function"}function Pr(e,t){return RS(e)?e(t):e}const DS=Object.prototype.hasOwnProperty;function rn(e,t){if(e===t)return e;const n=t,s=cg(e)&&cg(n);if(!s&&!(ql(e)&&ql(n)))return n;const i=s?e:lg(e);if(!i)return n;const l=s?n:lg(n);if(!l)return n;const u=i.length,c=l.length,f=s?new Array(c):{};let h=0;for(let m=0;m<c;m++){const p=s?m:l[m],g=e[p],w=n[p];if(g===w){f[p]=g,(s?m<u:DS.call(e,p))&&h++;continue}if(g===null||w===null||typeof g!="object"||typeof w!="object"){f[p]=w;continue}const S=rn(g,w);f[p]=S,S===g&&h++}return u===c&&h===u?e:f}function lg(e){const t=[],n=Object.getOwnPropertyNames(e);for(const i of n){if(!Object.prototype.propertyIsEnumerable.call(e,i))return!1;t.push(i)}const s=Object.getOwnPropertySymbols(e);for(const i of s){if(!Object.prototype.propertyIsEnumerable.call(e,i))return!1;t.push(i)}return t}function ql(e){if(!ug(e))return!1;const t=e.constructor;if(typeof t>"u")return!0;const n=t.prototype;return!(!ug(n)||!n.hasOwnProperty("isPrototypeOf"))}function ug(e){return Object.prototype.toString.call(e)==="[object Object]"}function cg(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function ao(e,t,n){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let s=0,i=e.length;s<i;s++)if(!ao(e[s],t[s],n))return!1;return!0}if(ql(e)&&ql(t)){const s=n?.ignoreUndefined??!0;if(n?.partial){for(const u in t)if((!s||t[u]!==void 0)&&!ao(e[u],t[u],n))return!1;return!0}let i=0;if(!s)i=Object.keys(e).length;else for(const u in e)e[u]!==void 0&&i++;let l=0;for(const u in t)if((!s||t[u]!==void 0)&&(l++,l>i||!ao(e[u],t[u],n)))return!1;return i===l}return!1}function ms(e){let t,n;const s=new Promise((i,l)=>{t=i,n=l});return s.status="pending",s.resolve=i=>{s.status="resolved",s.value=i,t(i),e?.(i)},s.reject=i=>{s.status="rejected",n(i)},s}function Or(e){return!!(e&&typeof e=="object"&&typeof e.then=="function")}function dg(e){try{return decodeURI(e)}catch{return e.replaceAll(/%[0-9A-F]{2}/gi,t=>{try{return decodeURI(t)}catch{return t}})}}function fg(e,t){if(!e)return e;const n=/%25|%5C/gi;let s=0,i="",l;for(;(l=n.exec(e))!==null;)i+=dg(e.slice(s,l.index))+l[0],s=n.lastIndex;return i+dg(s?e.slice(s):e)}var TS="Invariant failed";function er(e,t){if(!e)throw new Error(TS)}function Kl(e){const t=new Map;let n,s;const i=l=>{l.next&&(l.prev?(l.prev.next=l.next,l.next.prev=l.prev,l.next=void 0,s&&(s.next=l,l.prev=s)):(l.next.prev=void 0,n=l.next,l.next=void 0,s&&(l.prev=s,s.next=l)),s=l)};return{get(l){const u=t.get(l);if(u)return i(u),u.value},set(l,u){if(t.size>=e&&n){const f=n;t.delete(f.key),f.next&&(n=f.next,f.next.prev=void 0),f===s&&(s=void 0)}const c=t.get(l);if(c)c.value=u,i(c);else{const f={key:l,value:u,prev:s};s&&(s.next=f),s=f,n||(n=f),t.set(l,f)}},clear(){t.clear(),n=void 0,s=void 0}}}const gs=0,po=1,mo=2,ji=3,us=4,OS=/^([^{]*)\{\$([a-zA-Z_$][a-zA-Z0-9_$]*)\}([^}]*)$/,IS=/^([^{]*)\{-\$([a-zA-Z_$][a-zA-Z0-9_$]*)\}([^}]*)$/,jS=/^([^{]*)\{\$\}([^}]*)$/;function Wf(e,t,n=new Uint16Array(6)){const s=e.indexOf("/",t),i=s===-1?e.length:s,l=e.substring(t,i);if(!l||!l.includes("$"))return n[0]=gs,n[1]=t,n[2]=t,n[3]=i,n[4]=i,n[5]=i,n;if(l==="$"){const h=e.length;return n[0]=mo,n[1]=t,n[2]=t,n[3]=h,n[4]=h,n[5]=h,n}if(l.charCodeAt(0)===36)return n[0]=po,n[1]=t,n[2]=t+1,n[3]=i,n[4]=i,n[5]=i,n;const u=l.match(jS);if(u){const m=u[1].length;return n[0]=mo,n[1]=t+m,n[2]=t+m+1,n[3]=t+m+2,n[4]=t+m+3,n[5]=e.length,n}const c=l.match(IS);if(c){const h=c[1],m=c[2],p=c[3],g=h.length;return n[0]=ji,n[1]=t+g,n[2]=t+g+3,n[3]=t+g+3+m.length,n[4]=i-p.length,n[5]=i,n}const f=l.match(OS);if(f){const h=f[1],m=f[2],p=f[3],g=h.length;return n[0]=po,n[1]=t+g,n[2]=t+g+2,n[3]=t+g+2+m.length,n[4]=i-p.length,n[5]=i,n}return n[0]=gs,n[1]=t,n[2]=t,n[3]=i,n[4]=i,n[5]=i,n}function gu(e,t,n,s,i,l,u){u?.(n);let c=s;{const f=n.fullPath??n.from,h=f.length,m=n.options?.caseSensitive??e;for(;c<h;){const g=Wf(f,c,t);let w;const S=c,_=g[5];switch(c=_+1,l++,g[0]){case gs:{const N=f.substring(g[2],g[3]);if(m){const P=i.static?.get(N);if(P)w=P;else{i.static??=new Map;const k=fs(n.fullPath??n.from);k.parent=i,k.depth=l,w=k,i.static.set(N,k)}}else{const P=N.toLowerCase(),k=i.staticInsensitive?.get(P);if(k)w=k;else{i.staticInsensitive??=new Map;const b=fs(n.fullPath??n.from);b.parent=i,b.depth=l,w=b,i.staticInsensitive.set(P,b)}}break}case po:{const N=f.substring(S,g[1]),P=f.substring(g[4],_),k=m&&!!(N||P),b=N?k?N:N.toLowerCase():void 0,T=P?k?P:P.toLowerCase():void 0,M=i.dynamic?.find(R=>R.caseSensitive===k&&R.prefix===b&&R.suffix===T);if(M)w=M;else{const R=Pd(po,n.fullPath??n.from,k,b,T);w=R,R.depth=l,R.parent=i,i.dynamic??=[],i.dynamic.push(R)}break}case ji:{const N=f.substring(S,g[1]),P=f.substring(g[4],_),k=m&&!!(N||P),b=N?k?N:N.toLowerCase():void 0,T=P?k?P:P.toLowerCase():void 0,M=i.optional?.find(R=>R.caseSensitive===k&&R.prefix===b&&R.suffix===T);if(M)w=M;else{const R=Pd(ji,n.fullPath??n.from,k,b,T);w=R,R.parent=i,R.depth=l,i.optional??=[],i.optional.push(R)}break}case mo:{const N=f.substring(S,g[1]),P=f.substring(g[4],_),k=m&&!!(N||P),b=N?k?N:N.toLowerCase():void 0,T=P?k?P:P.toLowerCase():void 0,M=Pd(mo,n.fullPath??n.from,k,b,T);w=M,M.parent=i,M.depth=l,i.wildcard??=[],i.wildcard.push(M)}}i=w}const p=(n.path||!n.children)&&!n.isRoot;if(p&&f.endsWith("/")){const g=fs(n.fullPath??n.from);g.kind=us,g.parent=i,l++,g.depth=l,i.index=g,i=g}p&&!i.route&&(i.route=n,i.fullPath=n.fullPath??n.from)}if(n.children)for(const f of n.children)gu(e,t,f,c,i,l,u)}function Md(e,t){if(e.prefix&&t.prefix&&e.prefix!==t.prefix){if(e.prefix.startsWith(t.prefix))return-1;if(t.prefix.startsWith(e.prefix))return 1}if(e.suffix&&t.suffix&&e.suffix!==t.suffix){if(e.suffix.endsWith(t.suffix))return-1;if(t.suffix.endsWith(e.suffix))return 1}return e.prefix&&!t.prefix?-1:!e.prefix&&t.prefix?1:e.suffix&&!t.suffix?-1:!e.suffix&&t.suffix?1:e.caseSensitive&&!t.caseSensitive?-1:!e.caseSensitive&&t.caseSensitive?1:0}function ro(e){if(e.static)for(const t of e.static.values())ro(t);if(e.staticInsensitive)for(const t of e.staticInsensitive.values())ro(t);if(e.dynamic?.length){e.dynamic.sort(Md);for(const t of e.dynamic)ro(t)}if(e.optional?.length){e.optional.sort(Md);for(const t of e.optional)ro(t)}if(e.wildcard?.length){e.wildcard.sort(Md);for(const t of e.wildcard)ro(t)}}function fs(e){return{kind:gs,depth:0,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:e,parent:null}}function Pd(e,t,n,s,i){return{kind:e,depth:0,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:t,parent:null,caseSensitive:n,prefix:s,suffix:i}}function LS(e,t){const n=fs("/"),s=new Uint16Array(6);for(const i of e)gu(!1,s,i,1,n,0);ro(n),t.masksTree=n,t.flatCache=Kl(1e3)}function FS(e,t){e||="/";const n=t.flatCache.get(e);if(n)return n;const s=$f(e,t.masksTree);return t.flatCache.set(e,s),s}function AS(e,t,n,s,i){e||="/",s||="/";const l=t?`case\0${e}`:e;let u=i.singleCache.get(l);if(!u){u=fs("/");const c=new Uint16Array(6);gu(t,c,{from:e},1,u,0),i.singleCache.set(l,u)}return $f(s,u,n)}function zS(e,t,n=!1){const s=n?e:`nofuzz\0${e}`,i=t.matchCache.get(s);if(i!==void 0)return i;e||="/";const l=$f(e,t.segmentTree,n);return l&&(l.branch=HS(l.route)),t.matchCache.set(s,l),l}function WS(e){return e==="/"?e:e.replace(/\/{1,}$/,"")}function $S(e,t=!1,n){const s=fs(e.fullPath),i=new Uint16Array(6),l={},u={};let c=0;return gu(t,i,e,1,s,0,h=>{if(n?.(h,c),er(!(h.id in l),`Duplicate routes found with id: ${String(h.id)}`),l[h.id]=h,c!==0&&h.path){const m=WS(h.fullPath);(!u[m]||h.fullPath.endsWith("/"))&&(u[m]=h)}c++}),ro(s),{processedTree:{segmentTree:s,singleCache:Kl(1e3),matchCache:Kl(1e3),flatCache:null,masksTree:null},routesById:l,routesByPath:u}}function $f(e,t,n=!1){const s=e.split("/"),i=YS(e,s,t,n);if(!i)return null;const l=BS(e,s,i);return"**"in i&&(l["**"]=i["**"]),{route:i.node.route,params:l}}function BS(e,t,n){const s=VS(n.node);let i=null;const l={};for(let u=0,c=0,f=0;c<s.length;u++,c++,f++){const h=s[c],m=t[u],p=f;if(m&&(f+=m.length),h.kind===po){i??=n.node.fullPath.split("/");const g=i[c],w=h.prefix?.length??0;if(g.charCodeAt(w)===123){const _=h.suffix?.length??0,C=g.substring(w+2,g.length-_-1),N=m.substring(w,m.length-_);l[C]=decodeURIComponent(N)}else{const _=g.substring(1);l[_]=decodeURIComponent(m)}}else if(h.kind===ji){if(n.skipped&1<<c){u--;continue}i??=n.node.fullPath.split("/");const g=i[c],w=h.prefix?.length??0,S=h.suffix?.length??0,_=g.substring(w+3,g.length-S-1),C=h.suffix||h.prefix?m.substring(w,m.length-S):m;C&&(l[_]=decodeURIComponent(C))}else if(h.kind===mo){const g=h,w=e.substring(p+(g.prefix?.length??0),e.length-(g.suffix?.length??0)),S=decodeURIComponent(w);l["*"]=S,l._splat=S;break}}return l}function HS(e){const t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function VS(e){const t=Array(e.depth+1);do t[e.depth]=e,e=e.parent;while(e);return t}function YS(e,t,n,s){if(e==="/"&&n.index)return{node:n.index,skipped:0};const i=!Ql(t),l=i&&e!=="/",u=t.length-(i?1:0),c=[{node:n,index:1,skipped:0,depth:1,statics:1,dynamics:0,optionals:0}];let f=null,h=null,m=null;for(;c.length;){const p=c.pop();let{node:g,index:w,skipped:S,depth:_,statics:C,dynamics:N,optionals:P}=p;s&&g.route&&g.kind!==us&&pi(h,p)&&(h=p);const k=w===u;if(k&&(g.route&&!l&&pi(m,p)&&(m=p),!g.optional&&!g.wildcard&&!g.index))continue;const b=k?void 0:t[w];let T;if(k&&g.index){const M={node:g.index,index:w,skipped:S,depth:_+1,statics:C,dynamics:N,optionals:P};if(C===u&&!N&&!P&&!S)return M;pi(m,M)&&(m=M)}if(g.wildcard&&pi(f,p))for(const M of g.wildcard){const{prefix:R,suffix:O}=M;if(!(R&&(k||!(M.caseSensitive?b:T??=b.toLowerCase()).startsWith(R)))){if(O){if(k)continue;const A=t.slice(w).join("/").slice(-O.length);if((M.caseSensitive?A:A.toLowerCase())!==O)continue}f={node:M,index:u,skipped:S,depth:_,statics:C,dynamics:N,optionals:P};break}}if(g.optional){const M=S|1<<_,R=_+1;for(let O=g.optional.length-1;O>=0;O--){const A=g.optional[O];c.push({node:A,index:w,skipped:M,depth:R,statics:C,dynamics:N,optionals:P})}if(!k)for(let O=g.optional.length-1;O>=0;O--){const A=g.optional[O],{prefix:G,suffix:W}=A;if(G||W){const K=A.caseSensitive?b:T??=b.toLowerCase();if(G&&!K.startsWith(G)||W&&!K.endsWith(W))continue}c.push({node:A,index:w+1,skipped:S,depth:R,statics:C,dynamics:N,optionals:P+1})}}if(!k&&g.dynamic&&b)for(let M=g.dynamic.length-1;M>=0;M--){const R=g.dynamic[M],{prefix:O,suffix:A}=R;if(O||A){const G=R.caseSensitive?b:T??=b.toLowerCase();if(O&&!G.startsWith(O)||A&&!G.endsWith(A))continue}c.push({node:R,index:w+1,skipped:S,depth:_+1,statics:C,dynamics:N+1,optionals:P})}if(!k&&g.staticInsensitive){const M=g.staticInsensitive.get(T??=b.toLowerCase());M&&c.push({node:M,index:w+1,skipped:S,depth:_+1,statics:C+1,dynamics:N,optionals:P})}if(!k&&g.static){const M=g.static.get(b);M&&c.push({node:M,index:w+1,skipped:S,depth:_+1,statics:C+1,dynamics:N,optionals:P})}}if(m&&f)return pi(f,m)?m:f;if(m)return m;if(f)return f;if(s&&h){let p=h.index;for(let w=0;w<h.index;w++)p+=t[w].length;const g=p===e.length?"/":e.slice(p);return{node:h.node,skipped:h.skipped,"**":decodeURIComponent(g)}}return null}function pi(e,t){return e?t.statics>e.statics||t.statics===e.statics&&(t.dynamics>e.dynamics||t.dynamics===e.dynamics&&(t.optionals>e.optionals||t.optionals===e.optionals&&((t.node.kind===us)>(e.node.kind===us)||t.node.kind===us==(e.node.kind===us)&&t.depth>e.depth))):!0}function Il(e){return Bf(e.filter(t=>t!==void 0).join("/"))}function Bf(e){return e.replace(/\/{2,}/g,"/")}function p0(e){return e==="/"?e:e.replace(/^\/{1,}/,"")}function lo(e){const t=e.length;return t>1&&e[t-1]==="/"?e.replace(/\/{1,}$/,""):e}function m0(e){return lo(p0(e))}function Gl(e,t){return e?.endsWith("/")&&e!=="/"&&e!==`${t}/`?e.slice(0,-1):e}function US(e,t,n){return Gl(e,n)===Gl(t,n)}function QS({base:e,to:t,trailingSlash:n="never",cache:s}){const i=t.startsWith("/"),l=!i&&t===".";let u;if(s){u=i?t:l?e:e+"\0"+t;const p=s.get(u);if(p)return p}let c;if(l)c=e.split("/");else if(i)c=t.split("/");else{for(c=e.split("/");c.length>1&&Ql(c)==="";)c.pop();const p=t.split("/");for(let g=0,w=p.length;g<w;g++){const S=p[g];S===""?g?g===w-1&&c.push(S):c=[S]:S===".."?c.pop():S==="."||c.push(S)}}c.length>1&&(Ql(c)===""?n==="never"&&c.pop():n==="always"&&c.push(""));let f,h="";for(let p=0;p<c.length;p++){p>0&&(h+="/");const g=c[p];if(!g)continue;f=Wf(g,0,f);const w=f[0];if(w===gs){h+=g;continue}const S=f[5],_=g.substring(0,f[1]),C=g.substring(f[4],S),N=g.substring(f[2],f[3]);w===po?h+=_||C?`${_}{$${N}}${C}`:`$${N}`:w===mo?h+=_||C?`${_}{$}${C}`:"$":h+=`${_}{-$${N}}${C}`}h=Bf(h);const m=h||"/";return u&&s&&s.set(u,m),m}function Rd(e,t,n){const s=t[e];return typeof s!="string"?s:e==="_splat"?encodeURI(s):qS(s,n)}function Dd({path:e,params:t,decodeCharMap:n}){let s=!1;const i={};if(!e||e==="/")return{interpolatedPath:"/",usedParams:i,isMissingParams:s};if(!e.includes("$"))return{interpolatedPath:e,usedParams:i,isMissingParams:s};const l=e.length;let u=0,c,f="";for(;u<l;){const m=u;c=Wf(e,m,c);const p=c[5];if(u=p+1,m===p)continue;const g=c[0];if(g===gs){f+="/"+e.substring(m,p);continue}if(g===mo){const w=t._splat;i._splat=w,i["*"]=w;const S=e.substring(m,c[1]),_=e.substring(c[4],p);if(!w){s=!0,(S||_)&&(f+="/"+S+_);continue}const C=Rd("_splat",t,n);f+="/"+S+C+_;continue}if(g===po){const w=e.substring(c[2],c[3]);!s&&!(w in t)&&(s=!0),i[w]=t[w];const S=e.substring(m,c[1]),_=e.substring(c[4],p),C=Rd(w,t,n)??"undefined";f+="/"+S+C+_;continue}if(g===ji){const w=e.substring(c[2],c[3]),S=t[w];if(S==null)continue;i[w]=S;const _=e.substring(m,c[1]),C=e.substring(c[4],p),N=Rd(w,t,n)??"";f+="/"+_+N+C;continue}}return e.endsWith("/")&&(f+="/"),{usedParams:i,interpolatedPath:f||"/",isMissingParams:s}}function qS(e,t){let n=encodeURIComponent(e);if(t)for(const[s,i]of t)n=n.replaceAll(s,i);return n}function Ut(e){return!!e?.isNotFound}function KS(){try{if(typeof window<"u"&&typeof window.sessionStorage=="object")return window.sessionStorage}catch{}}const Xl="tsr-scroll-restoration-v1_3",GS=(e,t)=>{let n;return(...s)=>{n||(n=setTimeout(()=>{e(...s),n=null},t))}};function XS(){const e=KS();if(!e)return null;const t=e.getItem(Xl);let n=t?JSON.parse(t):{};return{state:n,set:s=>(n=Pr(s,n)||n,e.setItem(Xl,JSON.stringify(n)))}}const vl=XS(),gf=e=>e.state.__TSR_key||e.href;function ZS(e){const t=[];let n;for(;n=e.parentNode;)t.push(`${e.tagName}:nth-child(${Array.prototype.indexOf.call(n.children,e)+1})`),e=n;return`${t.reverse().join(" > ")}`.toLowerCase()}let Zl=!1;function g0({storageKey:e,key:t,behavior:n,shouldScrollRestoration:s,scrollToTopSelectors:i,location:l}){let u;try{u=JSON.parse(sessionStorage.getItem(e)||"{}")}catch(h){console.error(h);return}const c=t||window.history.state?.__TSR_key,f=u[c];Zl=!0;e:{if(s&&f&&Object.keys(f).length>0){for(const p in f){const g=f[p];if(p==="window")window.scrollTo({top:g.scrollY,left:g.scrollX,behavior:n});else if(p){const w=document.querySelector(p);w&&(w.scrollLeft=g.scrollX,w.scrollTop=g.scrollY)}}break e}const h=(l??window.location).hash.split("#",2)[1];if(h){const p=window.history.state?.__hashScrollIntoViewOptions??!0;if(p){const g=document.getElementById(h);g&&g.scrollIntoView(p)}break e}const m={top:0,left:0,behavior:n};if(window.scrollTo(m),i)for(const p of i){if(p==="window")continue;const g=typeof p=="function"?p():document.querySelector(p);g&&g.scrollTo(m)}}Zl=!1}function JS(e,t){if(!vl&&!e.isServer||((e.options.scrollRestoration??!1)&&(e.isScrollRestoring=!0),e.isServer||e.isScrollRestorationSetup||!vl))return;e.isScrollRestorationSetup=!0,Zl=!1;const s=e.options.getScrollRestorationKey||gf;window.history.scrollRestoration="manual";const i=l=>{if(Zl||!e.isScrollRestoring)return;let u="";if(l.target===document||l.target===window)u="window";else{const f=l.target.getAttribute("data-scroll-restoration-id");f?u=`[data-scroll-restoration-id="${f}"]`:u=ZS(l.target)}const c=s(e.state.location);vl.set(f=>{const h=f[c]||={},m=h[u]||={};if(u==="window")m.scrollX=window.scrollX||0,m.scrollY=window.scrollY||0;else if(u){const p=document.querySelector(u);p&&(m.scrollX=p.scrollLeft||0,m.scrollY=p.scrollTop||0)}return f})};typeof document<"u"&&document.addEventListener("scroll",GS(i,100),!0),e.subscribe("onRendered",l=>{const u=s(l.toLocation);if(!e.resetNextScroll){e.resetNextScroll=!0;return}typeof e.options.scrollRestoration=="function"&&!e.options.scrollRestoration({location:e.latestLocation})||(g0({storageKey:Xl,key:u,behavior:e.options.scrollRestorationBehavior,shouldScrollRestoration:e.isScrollRestoring,scrollToTopSelectors:e.options.scrollToTopSelectors,location:e.history.location}),e.isScrollRestoring&&vl.set(c=>(c[u]||={},c)))})}function ek(e){if(typeof document<"u"&&document.querySelector){const t=e.state.location.state.__hashScrollIntoViewOptions??!0;if(t&&e.state.location.hash!==""){const n=document.getElementById(e.state.location.hash);n&&n.scrollIntoView(t)}}}function tk(e,t=String){const n=new URLSearchParams;for(const s in e){const i=e[s];i!==void 0&&n.set(s,t(i))}return n.toString()}function Td(e){return e?e==="false"?!1:e==="true"?!0:+e*0===0&&+e+""===e?+e:e:""}function nk(e){const t=new URLSearchParams(e),n={};for(const[s,i]of t.entries()){const l=n[s];l==null?n[s]=Td(i):Array.isArray(l)?l.push(Td(i)):n[s]=[l,Td(i)]}return n}const rk=sk(JSON.parse),ok=ik(JSON.stringify,JSON.parse);function sk(e){return t=>{t[0]==="?"&&(t=t.substring(1));const n=nk(t);for(const s in n){const i=n[s];if(typeof i=="string")try{n[s]=e(i)}catch{}}return n}}function ik(e,t){const n=typeof t=="function";function s(i){if(typeof i=="object"&&i!==null)try{return e(i)}catch{}else if(n&&typeof i=="string")try{return t(i),e(i)}catch{}return i}return i=>{const l=tk(i,s);return l?`?${l}`:""}}const Vt="__root__";function ak(e){if(e.statusCode=e.statusCode||e.code||307,!e.reloadDocument&&typeof e.href=="string")try{new URL(e.href),e.reloadDocument=!0}catch{}const t=new Headers(e.headers);e.href&&t.get("Location")===null&&t.set("Location",e.href);const n=new Response(null,{status:e.statusCode,headers:t});if(n.options=e,e.throw)throw n;return n}function an(e){return e instanceof Response&&!!e.options}const jl=e=>{if(!e.rendered)return e.rendered=!0,e.onReady?.()},yu=(e,t)=>!!(e.preload&&!e.router.state.matches.some(n=>n.id===t)),Hf=(e,t,n=!0)=>{const s={...e.router.options.context??{}},i=n?t:t-1;for(let l=0;l<=i;l++){const u=e.matches[l];if(!u)continue;const c=e.router.getMatch(u.id);c&&Object.assign(s,c.__routeContext,c.__beforeLoadContext)}return s},y0=(e,t)=>{const n=e.router.routesById[t.routeId??""]??e.router.routeTree;!n.options.notFoundComponent&&e.router.options?.defaultNotFoundComponent&&(n.options.notFoundComponent=e.router.options.defaultNotFoundComponent),er(n.options.notFoundComponent);const s=e.matches.find(i=>i.routeId===n.id);er(s,"Could not find match for route: "+n.id),e.updateMatch(s.id,i=>({...i,status:"notFound",error:t,isFetching:!1})),t.routerCode==="BEFORE_LOAD"&&n.parentRoute&&(t.routeId=n.parentRoute.id,y0(e,t))},Rr=(e,t,n)=>{if(!(!an(n)&&!Ut(n))){if(an(n)&&n.redirectHandled&&!n.options.reloadDocument)throw n;if(t){t._nonReactive.beforeLoadPromise?.resolve(),t._nonReactive.loaderPromise?.resolve(),t._nonReactive.beforeLoadPromise=void 0,t._nonReactive.loaderPromise=void 0;const s=an(n)?"redirected":"notFound";t._nonReactive.error=n,e.updateMatch(t.id,i=>({...i,status:s,isFetching:!1,error:n})),Ut(n)&&!n.routeId&&(n.routeId=t.routeId),t._nonReactive.loadPromise?.resolve()}throw an(n)?(e.rendered=!0,n.options._fromLocation=e.location,n.redirectHandled=!0,n=e.router.resolveRedirect(n),n):(y0(e,n),n)}},v0=(e,t)=>{const n=e.router.getMatch(t);return!!(!e.router.isServer&&n._nonReactive.dehydrated||e.router.isServer&&n.ssr===!1)},mi=(e,t,n,s)=>{const{id:i,routeId:l}=e.matches[t],u=e.router.looseRoutesById[l];if(n instanceof Promise)throw n;n.routerCode=s,e.firstBadMatchIndex??=t,Rr(e,e.router.getMatch(i),n);try{u.options.onError?.(n)}catch(c){n=c,Rr(e,e.router.getMatch(i),n)}e.updateMatch(i,c=>(c._nonReactive.beforeLoadPromise?.resolve(),c._nonReactive.beforeLoadPromise=void 0,c._nonReactive.loadPromise?.resolve(),{...c,error:n,status:"error",isFetching:!1,updatedAt:Date.now(),abortController:new AbortController}))},lk=(e,t,n,s)=>{const i=e.router.getMatch(t),l=e.matches[n-1]?.id,u=l?e.router.getMatch(l):void 0;if(e.router.isShell()){i.ssr=s.id===Vt;return}if(u?.ssr===!1){i.ssr=!1;return}const c=w=>w===!0&&u?.ssr==="data-only"?"data-only":w,f=e.router.options.defaultSsr??!0;if(s.options.ssr===void 0){i.ssr=c(f);return}if(typeof s.options.ssr!="function"){i.ssr=c(s.options.ssr);return}const{search:h,params:m}=i,p={search:xl(h,i.searchError),params:xl(m,i.paramsError),location:e.location,matches:e.matches.map(w=>({index:w.index,pathname:w.pathname,fullPath:w.fullPath,staticData:w.staticData,id:w.id,routeId:w.routeId,search:xl(w.search,w.searchError),params:xl(w.params,w.paramsError),ssr:w.ssr}))},g=s.options.ssr(p);if(Or(g))return g.then(w=>{i.ssr=c(w??f)});i.ssr=c(g??f)},x0=(e,t,n,s)=>{if(s._nonReactive.pendingTimeout!==void 0)return;const i=n.options.pendingMs??e.router.options.defaultPendingMs;if(!!(e.onReady&&!e.router.isServer&&!yu(e,t)&&(n.options.loader||n.options.beforeLoad||k0(n))&&typeof i=="number"&&i!==1/0&&(n.options.pendingComponent??e.router.options?.defaultPendingComponent))){const u=setTimeout(()=>{jl(e)},i);s._nonReactive.pendingTimeout=u}},uk=(e,t,n)=>{const s=e.router.getMatch(t);if(!s._nonReactive.beforeLoadPromise&&!s._nonReactive.loaderPromise)return;x0(e,t,n,s);const i=()=>{const l=e.router.getMatch(t);l.preload&&(l.status==="redirected"||l.status==="notFound")&&Rr(e,l,l.error)};return s._nonReactive.beforeLoadPromise?s._nonReactive.beforeLoadPromise.then(i):i()},ck=(e,t,n,s)=>{const i=e.router.getMatch(t),l=i._nonReactive.loadPromise;i._nonReactive.loadPromise=ms(()=>{l?.resolve()});const{paramsError:u,searchError:c}=i;u&&mi(e,n,u,"PARSE_PARAMS"),c&&mi(e,n,c,"VALIDATE_SEARCH"),x0(e,t,s,i);const f=new AbortController,h=e.matches[n-1]?.id;(h?e.router.getMatch(h):void 0)?.context??e.router.options.context;let p=!1;const g=()=>{p||(p=!0,e.updateMatch(t,M=>({...M,isFetching:"beforeLoad",fetchCount:M.fetchCount+1,abortController:f})))},w=()=>{i._nonReactive.beforeLoadPromise?.resolve(),i._nonReactive.beforeLoadPromise=void 0,e.updateMatch(t,M=>({...M,isFetching:!1}))};if(!s.options.beforeLoad){Pi(()=>{g(),w()});return}i._nonReactive.beforeLoadPromise=ms();const S={...Hf(e,n,!1),...i.__routeContext},{search:_,params:C,cause:N}=i,P=yu(e,t),k={search:_,abortController:f,params:C,preload:P,context:S,location:e.location,navigate:M=>e.router.navigate({...M,_fromLocation:e.location}),buildLocation:e.router.buildLocation,cause:P?"preload":N,matches:e.matches,...e.router.options.additionalContext},b=M=>{if(M===void 0){Pi(()=>{g(),w()});return}(an(M)||Ut(M))&&(g(),mi(e,n,M,"BEFORE_LOAD")),Pi(()=>{g(),e.updateMatch(t,R=>({...R,__beforeLoadContext:M})),w()})};let T;try{if(T=s.options.beforeLoad(k),Or(T))return g(),T.catch(M=>{mi(e,n,M,"BEFORE_LOAD")}).then(b)}catch(M){g(),mi(e,n,M,"BEFORE_LOAD")}b(T)},dk=(e,t)=>{const{id:n,routeId:s}=e.matches[t],i=e.router.looseRoutesById[s],l=()=>{if(e.router.isServer){const f=lk(e,n,t,i);if(Or(f))return f.then(c)}return c()},u=()=>ck(e,n,t,i),c=()=>{if(v0(e,n))return;const f=uk(e,n,i);return Or(f)?f.then(u):u()};return l()},fk=(e,t,n)=>{const s=e.router.getMatch(t);if(!s||!n.options.head&&!n.options.scripts&&!n.options.headers)return;const i={matches:e.matches,match:s,params:s.params,loaderData:s.loaderData};return Promise.all([n.options.head?.(i),n.options.scripts?.(i),n.options.headers?.(i)]).then(([l,u,c])=>{const f=l?.meta,h=l?.links,m=l?.scripts,p=l?.styles;return{meta:f,links:h,headScripts:m,headers:c,scripts:u,styles:p}})},w0=(e,t,n,s)=>{const i=e.matchPromises[n-1],{params:l,loaderDeps:u,abortController:c,cause:f}=e.router.getMatch(t),h=Hf(e,n),m=yu(e,t);return{params:l,deps:u,preload:!!m,parentMatchPromise:i,abortController:c,context:h,location:e.location,navigate:p=>e.router.navigate({...p,_fromLocation:e.location}),cause:m?"preload":f,route:s,...e.router.options.additionalContext}},hg=async(e,t,n,s)=>{try{const i=e.router.getMatch(t);try{(!e.router.isServer||i.ssr===!0)&&S0(s);const l=s.options.loader?.(w0(e,t,n,s)),u=s.options.loader&&Or(l);if((u||s._lazyPromise||s._componentsPromise||s.options.head||s.options.scripts||s.options.headers||i._nonReactive.minPendingPromise)&&e.updateMatch(t,h=>({...h,isFetching:"loader"})),s.options.loader){const h=u?await l:l;Rr(e,e.router.getMatch(t),h),h!==void 0&&e.updateMatch(t,m=>({...m,loaderData:h}))}s._lazyPromise&&await s._lazyPromise;const f=i._nonReactive.minPendingPromise;f&&await f,s._componentsPromise&&await s._componentsPromise,e.updateMatch(t,h=>({...h,error:void 0,status:"success",isFetching:!1,updatedAt:Date.now()}))}catch(l){let u=l;const c=i._nonReactive.minPendingPromise;c&&await c,Ut(l)&&await s.options.notFoundComponent?.preload?.(),Rr(e,e.router.getMatch(t),l);try{s.options.onError?.(l)}catch(f){u=f,Rr(e,e.router.getMatch(t),f)}e.updateMatch(t,f=>({...f,error:u,status:"error",isFetching:!1}))}}catch(i){const l=e.router.getMatch(t);l&&(l._nonReactive.loaderPromise=void 0),Rr(e,l,i)}},hk=async(e,t)=>{const{id:n,routeId:s}=e.matches[t];let i=!1,l=!1;const u=e.router.looseRoutesById[s],c=()=>{e.updateMatch(n,m=>({...m,context:Hf(e,t)}))};if(v0(e,n)){if(e.router.isServer)return e.router.getMatch(n)}else{const m=e.router.getMatch(n);if(m._nonReactive.loaderPromise){if(m.status==="success"&&!e.sync&&!m.preload)return m;await m._nonReactive.loaderPromise;const p=e.router.getMatch(n),g=p._nonReactive.error||p.error;g&&Rr(e,p,g)}else{const p=Date.now()-m.updatedAt,g=yu(e,n),w=g?u.options.preloadStaleTime??e.router.options.defaultPreloadStaleTime??3e4:u.options.staleTime??e.router.options.defaultStaleTime??0,S=u.options.shouldReload,_=typeof S=="function"?S(w0(e,n,t,u)):S,C=!!g&&!e.router.state.matches.some(b=>b.id===n),N=e.router.getMatch(n);N._nonReactive.loaderPromise=ms(),C!==N.preload&&e.updateMatch(n,b=>({...b,preload:C}));const{status:P,invalid:k}=N;i=P==="success"&&(k||(_??p>w)),g&&u.options.preload===!1||(i&&!e.sync?(l=!0,(async()=>{try{await hg(e,n,t,u),c();const b=e.router.getMatch(n);b._nonReactive.loaderPromise?.resolve(),b._nonReactive.loadPromise?.resolve(),b._nonReactive.loaderPromise=void 0}catch(b){an(b)&&await e.router.navigate(b.options)}})()):(P!=="success"||i&&e.sync)&&await hg(e,n,t,u))}}const f=e.router.getMatch(n);l||(f._nonReactive.loaderPromise?.resolve(),f._nonReactive.loadPromise?.resolve()),clearTimeout(f._nonReactive.pendingTimeout),f._nonReactive.pendingTimeout=void 0,l||(f._nonReactive.loaderPromise=void 0),f._nonReactive.dehydrated=void 0,l||c();const h=l?f.isFetching:!1;return h!==f.isFetching||f.invalid!==!1?(e.updateMatch(n,m=>({...m,isFetching:h,invalid:!1})),e.router.getMatch(n)):f};async function pg(e){const t=Object.assign(e,{matchPromises:[]});!t.router.isServer&&t.router.state.matches.some(n=>n._forcePending)&&jl(t);try{for(let c=0;c<t.matches.length;c++){const f=dk(t,c);Or(f)&&await f}const n=t.firstBadMatchIndex??t.matches.length;for(let c=0;c<n;c++)t.matchPromises.push(hk(t,c));const i=(await Promise.allSettled(t.matchPromises)).filter(c=>c.status==="rejected").map(c=>c.reason);let l;for(const c of i){if(an(c))throw c;!l&&Ut(c)&&(l=c)}for(const c of t.matches){const{id:f,routeId:h}=c,m=t.router.looseRoutesById[h];try{const p=fk(t,f,m);if(p){const g=await p;t.updateMatch(f,w=>({...w,...g}))}}catch(p){console.error(`Error executing head for route ${h}:`,p)}}if(l)throw l;const u=jl(t);Or(u)&&await u}catch(n){if(Ut(n)&&!t.preload){const s=jl(t);throw Or(s)&&await s,n}if(an(n))throw n}return t.matches}async function S0(e){if(!e._lazyLoaded&&e._lazyPromise===void 0&&(e.lazyFn?e._lazyPromise=e.lazyFn().then(t=>{const{id:n,...s}=t.options;Object.assign(e.options,s),e._lazyLoaded=!0,e._lazyPromise=void 0}):e._lazyLoaded=!0),!e._componentsLoaded&&e._componentsPromise===void 0){const t=()=>{const n=[];for(const s of _0){const i=e.options[s]?.preload;i&&n.push(i())}if(n.length)return Promise.all(n).then(()=>{e._componentsLoaded=!0,e._componentsPromise=void 0});e._componentsLoaded=!0,e._componentsPromise=void 0};e._componentsPromise=e._lazyPromise?e._lazyPromise.then(t):t()}return e._componentsPromise}function xl(e,t){return t?{status:"error",error:t}:{status:"success",value:e}}function k0(e){for(const t of _0)if(e.options[t]?.preload)return!0;return!1}const _0=["component","errorComponent","pendingComponent","notFoundComponent"];function pk(e){return{input:({url:t})=>{for(const n of e)t=C0(n,t);return t},output:({url:t})=>{for(let n=e.length-1;n>=0;n--)t=E0(e[n],t);return t}}}function mk(e){const t=m0(e.basepath),n=`/${t}`,s=`${n}/`,i=e.caseSensitive?n:n.toLowerCase(),l=e.caseSensitive?s:s.toLowerCase();return{input:({url:u})=>{const c=e.caseSensitive?u.pathname:u.pathname.toLowerCase();return c===i?u.pathname="/":c.startsWith(l)&&(u.pathname=u.pathname.slice(n.length)),u},output:({url:u})=>(u.pathname=Il(["/",t,u.pathname]),u)}}function C0(e,t){const n=e?.input?.({url:t});if(n){if(typeof n=="string")return new URL(n);if(n instanceof URL)return n}return t}function E0(e,t){const n=e?.output?.({url:t});if(n){if(typeof n=="string")return new URL(n);if(n instanceof URL)return n}return t}function uo(e){const t=e.resolvedLocation,n=e.location,s=t?.pathname!==n.pathname,i=t?.href!==n.href,l=t?.hash!==n.hash;return{fromLocation:t,toLocation:n,pathChanged:s,hrefChanged:i,hashChanged:l}}class gk{constructor(t){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this.resetNextScroll=!0,this.shouldViewTransition=void 0,this.isViewTransitionTypesSupported=void 0,this.subscribers=new Set,this.isScrollRestoring=!1,this.isScrollRestorationSetup=!1,this.startTransition=n=>n(),this.update=n=>{n.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 s=this.options,i=this.basepath??s?.basepath??"/",l=this.basepath===void 0,u=s?.rewrite;this.options={...s,...n},this.isServer=this.options.isServer??typeof document>"u",this.pathParamsDecodeCharMap=this.options.pathParamsAllowedCharacters?new Map(this.options.pathParamsAllowedCharacters.map(g=>[encodeURIComponent(g),g])):void 0,(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.isServer||(this.history=PS())),this.origin=this.options.origin,this.origin||(!this.isServer&&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,this.buildRouteTree()),!this.__store&&this.latestLocation&&(this.__store=new bS(vk(this.latestLocation),{onUpdate:()=>{this.__store.state={...this.state,cachedMatches:this.state.cachedMatches.filter(g=>!["redirected"].includes(g.status))}}}),JS(this));let c=!1;const f=this.options.basepath??"/",h=this.options.rewrite;if(l||i!==f||u!==h){this.basepath=f;const g=[];m0(f)!==""&&g.push(mk({basepath:f})),h&&g.push(h),this.rewrite=g.length===0?void 0:g.length===1?g[0]:pk(g),this.history&&this.updateLatestLocation(),c=!0}c&&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{routesById:n,routesByPath:s,processedTree:i}=$S(this.routeTree,this.options.caseSensitive,(u,c)=>{u.init({originalIndex:c})});this.options.routeMasks&&LS(this.options.routeMasks,i),this.routesById=n,this.routesByPath=s,this.processedTree=i;const l=this.options.notFoundRoute;l&&(l.init({originalIndex:99999999999}),this.routesById[l.id]=l)},this.subscribe=(n,s)=>{const i={eventType:n,fn:s};return this.subscribers.add(i),()=>{this.subscribers.delete(i)}},this.emit=n=>{this.subscribers.forEach(s=>{s.eventType===n.type&&s.fn(n)})},this.parseLocation=(n,s)=>{const i=({href:f,state:h})=>{const m=new URL(f,this.origin),p=C0(this.rewrite,m),g=this.options.parseSearch(p.search),w=this.options.stringifySearch(g);return p.search=w,{href:p.href.replace(p.origin,""),publicHref:f,url:p,pathname:fg(p.pathname),searchStr:w,search:rn(s?.search,g),hash:p.hash.split("#").reverse()[0]??"",state:rn(s?.state,h)}},l=i(n),{__tempLocation:u,__tempKey:c}=l.state;if(u&&(!c||c===this.tempLocationKey)){const f=i(u);return f.state.key=l.state.key,f.state.__TSR_key=l.state.__TSR_key,delete f.state.__tempLocation,{...f,maskedLocation:l}}return l},this.resolvePathCache=Kl(1e3),this.resolvePathWithBase=(n,s)=>QS({base:n,to:Bf(s),trailingSlash:this.options.trailingSlash,cache:this.resolvePathCache}),this.matchRoutes=(n,s,i)=>typeof n=="string"?this.matchRoutesInternal({pathname:n,search:s},i):this.matchRoutesInternal(n,s),this.getMatchedRoutes=n=>xk({pathname:n,routesById:this.routesById,processedTree:this.processedTree}),this.cancelMatch=n=>{const s=this.getMatch(n);s&&(s.abortController.abort(),clearTimeout(s._nonReactive.pendingTimeout),s._nonReactive.pendingTimeout=void 0)},this.cancelMatches=()=>{const n=this.state.matches.filter(l=>l.status==="pending"),s=this.state.matches.filter(l=>l.isFetching==="loader");new Set([...this.state.pendingMatches??[],...n,...s]).forEach(l=>{this.cancelMatch(l.id)})},this.buildLocation=n=>{const s=(l={})=>{const u=l._fromLocation||this.pendingBuiltLocation||this.latestLocation,c=this.matchRoutes(u,{_buildLocation:!0}),f=Ql(c);l.from;const h=l.unsafeRelative==="path"?u.pathname:l.from??f.fullPath,m=this.resolvePathWithBase(h,"."),p=f.search,g={...f.params},w=l.to?this.resolvePathWithBase(m,`${l.to}`):this.resolvePathWithBase(m,"."),S=l.params===!1||l.params===null?{}:(l.params??!0)===!0?g:Object.assign(g,Pr(l.params,g)),_=Dd({path:w,params:S}).interpolatedPath,C=this.matchRoutes(_,void 0,{_buildLocation:!0}).map(G=>this.looseRoutesById[G.routeId]);if(Object.keys(S).length>0)for(const G of C){const W=G.options.params?.stringify??G.options.stringifyParams;W&&Object.assign(S,W(S))}const N=n.leaveParams?w:fg(Dd({path:w,params:S,decodeCharMap:this.pathParamsDecodeCharMap}).interpolatedPath);let P=p;if(n._includeValidateSearch&&this.options.search?.strict){const G={};C.forEach(W=>{if(W.options.validateSearch)try{Object.assign(G,yf(W.options.validateSearch,{...G,...P}))}catch{}}),P=G}P=wk({search:P,dest:l,destRoutes:C,_includeValidateSearch:n._includeValidateSearch}),P=rn(p,P);const k=this.options.stringifySearch(P),b=l.hash===!0?u.hash:l.hash?Pr(l.hash,u.hash):void 0,T=b?`#${b}`:"";let M=l.state===!0?u.state:l.state?Pr(l.state,u.state):{};M=rn(u.state,M);const R=`${N}${k}${T}`,O=new URL(R,this.origin),A=E0(this.rewrite,O);return{publicHref:A.pathname+A.search+A.hash,href:R,url:A,pathname:N,search:P,searchStr:k,state:M,hash:b??"",unmaskOnReload:l.unmaskOnReload}},i=(l={},u)=>{const c=s(l);let f=u?s(u):void 0;if(!f){const h={};if(this.options.routeMasks){const m=FS(c.pathname,this.processedTree);if(m){Object.assign(h,m.params);const{from:p,params:g,...w}=m.route,S=g===!1||g===null?{}:(g??!0)===!0?h:Object.assign(h,Pr(g,h));u={from:n.from,...w,params:S},f=s(u)}}}return f&&(c.maskedLocation=f),c};return n.mask?i(n,{from:n.from,...n.mask}):i(n)},this.commitLocation=({viewTransition:n,ignoreBlocker:s,...i})=>{const l=()=>{const f=["key","__TSR_key","__TSR_index","__hashScrollIntoViewOptions"];f.forEach(m=>{i.state[m]=this.latestLocation.state[m]});const h=ao(i.state,this.latestLocation.state);return f.forEach(m=>{delete i.state[m]}),h},u=lo(this.latestLocation.href)===lo(i.href),c=this.commitLocationPromise;if(this.commitLocationPromise=ms(()=>{c?.resolve()}),u&&l())this.load();else{let{maskedLocation:f,hashScrollIntoView:h,url:m,...p}=i;f&&(p={...f,state:{...f.state,__tempKey:void 0,__tempLocation:{...p,search:p.searchStr,state:{...p.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(p.unmaskOnReload??this.options.unmaskOnReload??!1)&&(p.state.__tempKey=this.tempLocationKey)),p.state.__hashScrollIntoViewOptions=h??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=n,this.history[i.replace?"replace":"push"](p.publicHref,p.state,{ignoreBlocker:s})}return this.resetNextScroll=i.resetScroll??!0,this.history.subscribers.size||this.load(),this.commitLocationPromise},this.buildAndCommitLocation=({replace:n,resetScroll:s,hashScrollIntoView:i,viewTransition:l,ignoreBlocker:u,href:c,...f}={})=>{if(c){const p=this.history.location.state.__TSR_index,g=Ul(c,{__TSR_index:n?p:p+1});f.to=g.pathname,f.search=this.options.parseSearch(g.search),f.hash=g.hash.slice(1)}const h=this.buildLocation({...f,_includeValidateSearch:!0});this.pendingBuiltLocation=h;const m=this.commitLocation({...h,viewTransition:l,replace:n,resetScroll:s,hashScrollIntoView:i,ignoreBlocker:u});return Promise.resolve().then(()=>{this.pendingBuiltLocation===h&&(this.pendingBuiltLocation=void 0)}),m},this.navigate=async({to:n,reloadDocument:s,href:i,publicHref:l,...u})=>{let c=!1;if(i)try{new URL(`${i}`),c=!0}catch{}if(c&&!s&&(s=!0),s){if(!i||!l&&!c){const h=this.buildLocation({to:n,...u});i=i??h.url.href,l=l??h.url.href}const f=!c&&l?l:i;if(!u.ignoreBlocker){const m=this.history.getBlockers?.()??[];for(const p of m)if(p?.blockerFn&&await p.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:"PUSH"}))return Promise.resolve()}return u.replace?window.location.replace(f):window.location.href=f,Promise.resolve()}return this.buildAndCommitLocation({...u,href:i,to:n,_isNavigate:!0})},this.beforeLoad=()=>{if(this.cancelMatches(),this.updateLatestLocation(),this.isServer){const s=this.buildLocation({to:this.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});if(this.latestLocation.publicHref!==s.publicHref||s.url.origin!==this.origin){const i=this.getParsedLocationHref(s);throw ak({href:i})}}const n=this.matchRoutes(this.latestLocation);this.__store.setState(s=>({...s,status:"pending",statusCode:200,isLoading:!0,location:this.latestLocation,pendingMatches:n,cachedMatches:s.cachedMatches.filter(i=>!n.some(l=>l.id===i.id))}))},this.load=async n=>{let s,i,l;for(l=new Promise(c=>{this.startTransition(async()=>{try{this.beforeLoad();const f=this.latestLocation,h=this.state.resolvedLocation;this.state.redirect||this.emit({type:"onBeforeNavigate",...uo({resolvedLocation:h,location:f})}),this.emit({type:"onBeforeLoad",...uo({resolvedLocation:h,location:f})}),await pg({router:this,sync:n?.sync,matches:this.state.pendingMatches,location:f,updateMatch:this.updateMatch,onReady:async()=>{this.startTransition(()=>{this.startViewTransition(async()=>{let m=[],p=[],g=[];Pi(()=>{this.__store.setState(w=>{const S=w.matches,_=w.pendingMatches||w.matches;return m=S.filter(C=>!_.some(N=>N.id===C.id)),p=_.filter(C=>!S.some(N=>N.id===C.id)),g=_.filter(C=>S.some(N=>N.id===C.id)),{...w,isLoading:!1,loadedAt:Date.now(),matches:_,pendingMatches:void 0,cachedMatches:[...w.cachedMatches,...m.filter(C=>C.status!=="error"&&C.status!=="notFound")]}}),this.clearExpiredCache()}),[[m,"onLeave"],[p,"onEnter"],[g,"onStay"]].forEach(([w,S])=>{w.forEach(_=>{this.looseRoutesById[_.routeId].options[S]?.(_)})})})})}})}catch(f){an(f)?(s=f,this.isServer||this.navigate({...s.options,replace:!0,ignoreBlocker:!0})):Ut(f)&&(i=f),this.__store.setState(h=>({...h,statusCode:s?s.status:i?404:h.matches.some(m=>m.status==="error")?500:200,redirect:s}))}this.latestLoadPromise===l&&(this.commitLocationPromise?.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),c()})}),this.latestLoadPromise=l,await l;this.latestLoadPromise&&l!==this.latestLoadPromise;)await this.latestLoadPromise;let u;this.hasNotFoundMatch()?u=404:this.__store.state.matches.some(c=>c.status==="error")&&(u=500),u!==void 0&&this.__store.setState(c=>({...c,statusCode:u}))},this.startViewTransition=n=>{const s=this.shouldViewTransition??this.options.defaultViewTransition;if(delete this.shouldViewTransition,s&&typeof document<"u"&&"startViewTransition"in document&&typeof document.startViewTransition=="function"){let i;if(typeof s=="object"&&this.isViewTransitionTypesSupported){const l=this.latestLocation,u=this.state.resolvedLocation,c=typeof s.types=="function"?s.types(uo({resolvedLocation:u,location:l})):s.types;if(c===!1){n();return}i={update:n,types:c}}else i=n;document.startViewTransition(i)}else n()},this.updateMatch=(n,s)=>{this.startTransition(()=>{const i=this.state.pendingMatches?.some(l=>l.id===n)?"pendingMatches":this.state.matches.some(l=>l.id===n)?"matches":this.state.cachedMatches.some(l=>l.id===n)?"cachedMatches":"";i&&this.__store.setState(l=>({...l,[i]:l[i]?.map(u=>u.id===n?s(u):u)}))})},this.getMatch=n=>{const s=i=>i.id===n;return this.state.cachedMatches.find(s)??this.state.pendingMatches?.find(s)??this.state.matches.find(s)},this.invalidate=n=>{const s=i=>n?.filter?.(i)??!0?{...i,invalid:!0,...n?.forcePending||i.status==="error"||i.status==="notFound"?{status:"pending",error:void 0}:void 0}:i;return this.__store.setState(i=>({...i,matches:i.matches.map(s),cachedMatches:i.cachedMatches.map(s),pendingMatches:i.pendingMatches?.map(s)})),this.shouldViewTransition=!1,this.load({sync:n?.sync})},this.getParsedLocationHref=n=>{let s=n.url.href;return this.origin&&n.url.origin===this.origin&&(s=s.replace(this.origin,"")||"/"),s},this.resolveRedirect=n=>{if(!n.options.href){const s=this.buildLocation(n.options),i=this.getParsedLocationHref(s);n.options.href=s.href,n.headers.set("Location",i)}return n.headers.get("Location")||n.headers.set("Location",n.options.href),n},this.clearCache=n=>{const s=n?.filter;s!==void 0?this.__store.setState(i=>({...i,cachedMatches:i.cachedMatches.filter(l=>!s(l))})):this.__store.setState(i=>({...i,cachedMatches:[]}))},this.clearExpiredCache=()=>{const n=s=>{const i=this.looseRoutesById[s.routeId];if(!i.options.loader)return!0;const l=(s.preload?i.options.preloadGcTime??this.options.defaultPreloadGcTime:i.options.gcTime??this.options.defaultGcTime)??300*1e3;return s.status==="error"?!0:Date.now()-s.updatedAt>=l};this.clearCache({filter:n})},this.loadRouteChunk=S0,this.preloadRoute=async n=>{const s=this.buildLocation(n);let i=this.matchRoutes(s,{throwOnError:!0,preload:!0,dest:n});const l=new Set([...this.state.matches,...this.state.pendingMatches??[]].map(c=>c.id)),u=new Set([...l,...this.state.cachedMatches.map(c=>c.id)]);Pi(()=>{i.forEach(c=>{u.has(c.id)||this.__store.setState(f=>({...f,cachedMatches:[...f.cachedMatches,c]}))})});try{return i=await pg({router:this,matches:i,location:s,preload:!0,updateMatch:(c,f)=>{l.has(c)?i=i.map(h=>h.id===c?f(h):h):this.updateMatch(c,f)}}),i}catch(c){if(an(c))return c.options.reloadDocument?void 0:await this.preloadRoute({...c.options,_fromLocation:s});Ut(c)||console.error(c);return}},this.matchRoute=(n,s)=>{const i={...n,to:n.to?this.resolvePathWithBase(n.from||"",n.to):void 0,params:n.params||{},leaveParams:!0},l=this.buildLocation(i);if(s?.pending&&this.state.status!=="pending")return!1;const c=(s?.pending===void 0?!this.state.isLoading:s.pending)?this.latestLocation:this.state.resolvedLocation||this.state.location,f=AS(l.pathname,s?.caseSensitive??!1,s?.fuzzy??!1,c.pathname,this.processedTree);return!f||n.params&&!ao(f.params,n.params,{partial:!0})?!1:s?.includeSearch??!0?ao(c.search,l.search,{partial:!0})?f.params:!1:f.params},this.hasNotFoundMatch=()=>this.__store.state.matches.some(n=>n.status==="notFound"||n.globalNotFound),this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...t,caseSensitive:t.caseSensitive??!1,notFoundMode:t.notFoundMode??"fuzzy",stringifySearch:t.stringifySearch??ok,parseSearch:t.parseSearch??rk}),typeof document<"u"&&(self.__TSR_ROUTER__=this)}isShell(){return!!this.options.isShell}isPrerendering(){return!!this.options.isPrerendering}get state(){return this.__store.state}get looseRoutesById(){return this.routesById}matchRoutesInternal(t,n){const s=this.getMatchedRoutes(t.pathname),{foundRoute:i,routeParams:l}=s;let{matchedRoutes:u}=s,c=!1;(i?i.path!=="/"&&l["**"]:lo(t.pathname))&&(this.options.notFoundRoute?u=[...u,this.options.notFoundRoute]:c=!0);const f=(()=>{if(c){if(this.options.notFoundMode!=="root")for(let p=u.length-1;p>=0;p--){const g=u[p];if(g.children)return g.id}return Vt}})(),h=[],m=p=>p?.id?p.context??this.options.context??void 0:this.options.context??void 0;return u.forEach((p,g)=>{const w=h[g-1],[S,_,C]=(()=>{const J=w?.search??t.search,I=w?._strictSearch??void 0;try{const Y=yf(p.options.validateSearch,{...J})??void 0;return[{...J,...Y},{...I,...Y},void 0]}catch(Y){let V=Y;if(Y instanceof Jl||(V=new Jl(Y.message,{cause:Y})),n?.throwOnError)throw V;return[J,{},V]}})(),N=p.options.loaderDeps?.({search:S})??"",P=N?JSON.stringify(N):"",{interpolatedPath:k,usedParams:b}=Dd({path:p.fullPath,params:l,decodeCharMap:this.pathParamsDecodeCharMap}),T=p.id+k+P,M=this.getMatch(T),R=this.state.matches.find(J=>J.routeId===p.id),O=M?._strictParams??b;let A;if(!M){const J=p.options.params?.parse??p.options.parseParams;if(J)try{Object.assign(O,J(O))}catch(I){if(Ut(I)||an(I)?A=I:A=new yk(I.message,{cause:I}),n?.throwOnError)throw A}}Object.assign(l,O);const G=R?"stay":"enter";let W;if(M)W={...M,cause:G,params:R?rn(R.params,l):l,_strictParams:O,search:rn(R?R.search:M.search,S),_strictSearch:_};else{const J=p.options.loader||p.options.beforeLoad||p.lazyFn||k0(p)?"pending":"success";W={id:T,ssr:this.isServer?void 0:p.options.ssr,index:g,routeId:p.id,params:R?rn(R.params,l):l,_strictParams:O,pathname:k,updatedAt:Date.now(),search:R?rn(R.search,S):S,_strictSearch:_,searchError:void 0,status:J,isFetching:!1,error:void 0,paramsError:A,__routeContext:void 0,_nonReactive:{loadPromise:ms()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:G,loaderDeps:R?rn(R.loaderDeps,N):N,invalid:!1,preload:!1,links:void 0,scripts:void 0,headScripts:void 0,meta:void 0,staticData:p.options.staticData||{},fullPath:p.fullPath}}n?.preload||(W.globalNotFound=f===p.id),W.searchError=C;const K=m(w);W.context={...K,...W.__routeContext,...W.__beforeLoadContext},h.push(W)}),h.forEach((p,g)=>{const w=this.looseRoutesById[p.routeId];if(!this.getMatch(p.id)&&n?._buildLocation!==!0){const _=h[g-1],C=m(_);if(w.options.context){const N={deps:p.loaderDeps,params:p.params,context:C??{},location:t,navigate:P=>this.navigate({...P,_fromLocation:t}),buildLocation:this.buildLocation,cause:p.cause,abortController:p.abortController,preload:!!p.preload,matches:h};p.__routeContext=w.options.context(N)??void 0}p.context={...C,...p.__routeContext,...p.__beforeLoadContext}}}),h}}class Jl extends Error{}class yk extends Error{}function vk(e){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:"idle",resolvedLocation:void 0,location:e,matches:[],pendingMatches:[],cachedMatches:[],statusCode:200}}function yf(e,t){if(e==null)return{};if("~standard"in e){const n=e["~standard"].validate(t);if(n instanceof Promise)throw new Jl("Async validation not supported");if(n.issues)throw new Jl(JSON.stringify(n.issues,void 0,2),{cause:n});return n.value}return"parse"in e?e.parse(t):typeof e=="function"?e(t):{}}function xk({pathname:e,routesById:t,processedTree:n}){const s={},i=lo(e);let l;const u=zS(i,n,!0);return u&&(l=u.route,Object.assign(s,u.params)),{matchedRoutes:u?.branch||[t[Vt]],routeParams:s,foundRoute:l}}function wk({search:e,dest:t,destRoutes:n,_includeValidateSearch:s}){const i=n.reduce((c,f)=>{const h=[];if("search"in f.options)f.options.search?.middlewares&&h.push(...f.options.search.middlewares);else if(f.options.preSearchFilters||f.options.postSearchFilters){const m=({search:p,next:g})=>{let w=p;"preSearchFilters"in f.options&&f.options.preSearchFilters&&(w=f.options.preSearchFilters.reduce((_,C)=>C(_),p));const S=g(w);return"postSearchFilters"in f.options&&f.options.postSearchFilters?f.options.postSearchFilters.reduce((_,C)=>C(_),S):S};h.push(m)}if(s&&f.options.validateSearch){const m=({search:p,next:g})=>{const w=g(p);try{return{...w,...yf(f.options.validateSearch,w)??void 0}}catch{return w}};h.push(m)}return c.concat(h)},[])??[],l=({search:c})=>t.search?t.search===!0?c:Pr(t.search,c):{};i.push(l);const u=(c,f)=>{if(c>=i.length)return f;const h=i[c];return h({search:f,next:p=>u(c+1,p)})};return u(0,e)}const Sk="Error preloading route! ☝️";class N0{constructor(t){if(this.init=n=>{this.originalIndex=n.originalIndex;const s=this.options,i=!s?.path&&!s?.id;this.parentRoute=this.options.getParentRoute?.(),i?this._path=Vt:this.parentRoute||er(!1);let l=i?Vt:s?.path;l&&l!=="/"&&(l=p0(l));const u=s?.id||l;let c=i?Vt:Il([this.parentRoute.id===Vt?"":this.parentRoute.id,u]);l===Vt&&(l="/"),c!==Vt&&(c=Il(["/",c]));const f=c===Vt?"/":Il([this.parentRoute.fullPath,l]);this._path=l,this._id=c,this._fullPath=f,this._to=f},this.addChildren=n=>this._addFileChildren(n),this._addFileChildren=n=>(Array.isArray(n)&&(this.children=n),typeof n=="object"&&n!==null&&(this.children=Object.values(n)),this),this._addFileTypes=()=>this,this.updateLoader=n=>(Object.assign(this.options,n),this),this.update=n=>(Object.assign(this.options,n),this),this.lazy=n=>(this.lazyFn=n,this),this.options=t||{},this.isRoot=!t?.getParentRoute,t?.id&&t?.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 kk extends N0{constructor(t){super(t)}}function Vf(e){const t=e.errorComponent??vu;return x.jsx(_k,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:n,reset:s})=>n?L.createElement(t,{error:n,reset:s}):e.children})}class _k extends L.Component{constructor(){super(...arguments),this.state={error:null}}static getDerivedStateFromProps(t){return{resetKey:t.getResetKey()}}static getDerivedStateFromError(t){return{error:t}}reset(){this.setState({error:null})}componentDidUpdate(t,n){n.error&&n.resetKey!==this.state.resetKey&&this.reset()}componentDidCatch(t,n){this.props.onCatch&&this.props.onCatch(t,n)}render(){return this.props.children({error:this.state.resetKey!==this.props.getResetKey()?null:this.state.error,reset:()=>{this.reset()}})}}function vu({error:e}){const[t,n]=L.useState(!1);return x.jsxs("div",{style:{padding:".5rem",maxWidth:"100%"},children:[x.jsxs("div",{style:{display:"flex",alignItems:"center",gap:".5rem"},children:[x.jsx("strong",{style:{fontSize:"1rem"},children:"Something went wrong!"}),x.jsx("button",{style:{appearance:"none",fontSize:".6em",border:"1px solid currentColor",padding:".1rem .2rem",fontWeight:"bold",borderRadius:".25rem"},onClick:()=>n(s=>!s),children:t?"Hide Error":"Show Error"})]}),x.jsx("div",{style:{height:".25rem"}}),t?x.jsx("div",{children:x.jsx("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"},children:e.message?x.jsx("code",{children:e.message}):null})}):null]})}function Ck({children:e,fallback:t=null}){return Ek()?x.jsx(de.Fragment,{children:e}):x.jsx(de.Fragment,{children:t})}function Ek(){return de.useSyncExternalStore(Nk,()=>!0,()=>!1)}function Nk(){return()=>{}}var Od={exports:{}},Id={},jd={exports:{}},Ld={};var mg;function bk(){if(mg)return Ld;mg=1;var e=qi();function t(p,g){return p===g&&(p!==0||1/p===1/g)||p!==p&&g!==g}var n=typeof Object.is=="function"?Object.is:t,s=e.useState,i=e.useEffect,l=e.useLayoutEffect,u=e.useDebugValue;function c(p,g){var w=g(),S=s({inst:{value:w,getSnapshot:g}}),_=S[0].inst,C=S[1];return l(function(){_.value=w,_.getSnapshot=g,f(_)&&C({inst:_})},[p,w,g]),i(function(){return f(_)&&C({inst:_}),p(function(){f(_)&&C({inst:_})})},[p]),u(w),w}function f(p){var g=p.getSnapshot;p=p.value;try{var w=g();return!n(p,w)}catch{return!0}}function h(p,g){return g()}var m=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?h:c;return Ld.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:m,Ld}var gg;function Mk(){return gg||(gg=1,jd.exports=bk()),jd.exports}var yg;function Pk(){if(yg)return Id;yg=1;var e=qi(),t=Mk();function n(h,m){return h===m&&(h!==0||1/h===1/m)||h!==h&&m!==m}var s=typeof Object.is=="function"?Object.is:n,i=t.useSyncExternalStore,l=e.useRef,u=e.useEffect,c=e.useMemo,f=e.useDebugValue;return Id.useSyncExternalStoreWithSelector=function(h,m,p,g,w){var S=l(null);if(S.current===null){var _={hasValue:!1,value:null};S.current=_}else _=S.current;S=c(function(){function N(M){if(!P){if(P=!0,k=M,M=g(M),w!==void 0&&_.hasValue){var R=_.value;if(w(R,M))return b=R}return b=M}if(R=b,s(k,M))return R;var O=g(M);return w!==void 0&&w(R,O)?(k=M,R):(k=M,b=O)}var P=!1,k,b,T=p===void 0?null:p;return[function(){return N(m())},T===null?void 0:function(){return N(T())}]},[m,p,g,w]);var C=i(h,S[0],S[1]);return u(function(){_.hasValue=!0,_.value=C},[C]),f(C),C},Id}var vg;function Rk(){return vg||(vg=1,Od.exports=Pk()),Od.exports}var b0=Rk();const Dk=Xy(b0);function Tk(e,t=s=>s,n={}){const s=n.equal??Ok;return b0.useSyncExternalStoreWithSelector(e.subscribe,()=>e.state,()=>e.state,t,s)}function Ok(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[s,i]of e)if(!t.has(s)||!Object.is(i,t.get(s)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const s of e)if(!t.has(s))return!1;return!0}if(e instanceof Date&&t instanceof Date)return e.getTime()===t.getTime();const n=xg(e);if(n.length!==xg(t).length)return!1;for(let s=0;s<n.length;s++)if(!Object.prototype.hasOwnProperty.call(t,n[s])||!Object.is(e[n[s]],t[n[s]]))return!1;return!0}function xg(e){return Object.keys(e).concat(Object.getOwnPropertySymbols(e))}const Fd=L.createContext(null);function M0(){return typeof document>"u"?Fd:window.__TSR_ROUTER_CONTEXT__?window.__TSR_ROUTER_CONTEXT__:(window.__TSR_ROUTER_CONTEXT__=Fd,Fd)}function Kt(e){const t=L.useContext(M0());return e?.warn,t}function Ft(e){const t=Kt({warn:e?.router===void 0}),n=e?.router||t,s=L.useRef(void 0);return Tk(n.__store,i=>{if(e?.select){if(e.structuralSharing??n.options.defaultStructuralSharing){const l=rn(s.current,e.select(i));return s.current=l,l}return e.select(i)}return i})}const xu=L.createContext(void 0),Ik=L.createContext(void 0);function On(e){const t=L.useContext(e.from?Ik:xu);return Ft({select:s=>{const i=s.matches.find(l=>e.from?e.from===l.routeId:l.id===t);if(er(!((e.shouldThrow??!0)&&!i),`Could not find ${e.from?`an active match from "${e.from}"`:"a nearest match!"}`),i!==void 0)return e.select?e.select(i):i},structuralSharing:e.structuralSharing})}function Yf(e){return On({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function Uf(e){const{select:t,...n}=e;return On({...n,select:s=>t?t(s.loaderDeps):s.loaderDeps})}function Qf(e){return On({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:t=>{const n=e.strict===!1?t.params:t._strictParams;return e.select?e.select(n):n}})}function qf(e){return On({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}const wl=typeof window<"u"?L.useLayoutEffect:L.useEffect;function Ad(e){const t=L.useRef({value:e,prev:null}),n=t.current.value;return e!==n&&(t.current={value:e,prev:n}),t.current.prev}function jk(e,t,n={},s={}){L.useEffect(()=>{if(!e.current||s.disabled||typeof IntersectionObserver!="function")return;const i=new IntersectionObserver(([l])=>{t(l)},n);return i.observe(e.current),()=>{i.disconnect()}},[t,n,s.disabled,e])}function Lk(e){const t=L.useRef(null);return L.useImperativeHandle(e,()=>t.current,[]),t}function Xi(e){const t=Kt();return L.useCallback(n=>t.navigate({...n,from:n.from??e?.from}),[e?.from,t])}var zd={exports:{}},It={},Wd={exports:{}},$d={};var wg;function Fk(){return wg||(wg=1,(function(e){function t(F,B){var U=F.length;F.push(B);e:for(;0<U;){var D=U-1>>>1,$=F[D];if(0<i($,B))F[D]=B,F[U]=$,U=D;else break e}}function n(F){return F.length===0?null:F[0]}function s(F){if(F.length===0)return null;var B=F[0],U=F.pop();if(U!==B){F[0]=U;e:for(var D=0,$=F.length,ne=$>>>1;D<ne;){var te=2*(D+1)-1,ie=F[te],ce=te+1,ue=F[ce];if(0>i(ie,U))ce<$&&0>i(ue,ie)?(F[D]=ue,F[ce]=U,D=ce):(F[D]=ie,F[te]=U,D=te);else if(ce<$&&0>i(ue,U))F[D]=ue,F[ce]=U,D=ce;else break e}}return B}function i(F,B){var U=F.sortIndex-B.sortIndex;return U!==0?U:F.id-B.id}if(typeof performance=="object"&&typeof performance.now=="function"){var l=performance;e.unstable_now=function(){return l.now()}}else{var u=Date,c=u.now();e.unstable_now=function(){return u.now()-c}}var f=[],h=[],m=1,p=null,g=3,w=!1,S=!1,_=!1,C=typeof setTimeout=="function"?setTimeout:null,N=typeof clearTimeout=="function"?clearTimeout:null,P=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function k(F){for(var B=n(h);B!==null;){if(B.callback===null)s(h);else if(B.startTime<=F)s(h),B.sortIndex=B.expirationTime,t(f,B);else break;B=n(h)}}function b(F){if(_=!1,k(F),!S)if(n(f)!==null)S=!0,V(T);else{var B=n(h);B!==null&&Q(b,B.startTime-F)}}function T(F,B){S=!1,_&&(_=!1,N(O),O=-1),w=!0;var U=g;try{for(k(B),p=n(f);p!==null&&(!(p.expirationTime>B)||F&&!W());){var D=p.callback;if(typeof D=="function"){p.callback=null,g=p.priorityLevel;var $=D(p.expirationTime<=B);B=e.unstable_now(),typeof $=="function"?p.callback=$:p===n(f)&&s(f),k(B)}else s(f);p=n(f)}if(p!==null)var ne=!0;else{var te=n(h);te!==null&&Q(b,te.startTime-B),ne=!1}return ne}finally{p=null,g=U,w=!1}}var M=!1,R=null,O=-1,A=5,G=-1;function W(){return!(e.unstable_now()-G<A)}function K(){if(R!==null){var F=e.unstable_now();G=F;var B=!0;try{B=R(!0,F)}finally{B?J():(M=!1,R=null)}}else M=!1}var J;if(typeof P=="function")J=function(){P(K)};else if(typeof MessageChannel<"u"){var I=new MessageChannel,Y=I.port2;I.port1.onmessage=K,J=function(){Y.postMessage(null)}}else J=function(){C(K,0)};function V(F){R=F,M||(M=!0,J())}function Q(F,B){O=C(function(){F(e.unstable_now())},B)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(F){F.callback=null},e.unstable_continueExecution=function(){S||w||(S=!0,V(T))},e.unstable_forceFrameRate=function(F){0>F||125<F?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):A=0<F?Math.floor(1e3/F):5},e.unstable_getCurrentPriorityLevel=function(){return g},e.unstable_getFirstCallbackNode=function(){return n(f)},e.unstable_next=function(F){switch(g){case 1:case 2:case 3:var B=3;break;default:B=g}var U=g;g=B;try{return F()}finally{g=U}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(F,B){switch(F){case 1:case 2:case 3:case 4:case 5:break;default:F=3}var U=g;g=F;try{return B()}finally{g=U}},e.unstable_scheduleCallback=function(F,B,U){var D=e.unstable_now();switch(typeof U=="object"&&U!==null?(U=U.delay,U=typeof U=="number"&&0<U?D+U:D):U=D,F){case 1:var $=-1;break;case 2:$=250;break;case 5:$=1073741823;break;case 4:$=1e4;break;default:$=5e3}return $=U+$,F={id:m++,callback:B,priorityLevel:F,startTime:U,expirationTime:$,sortIndex:-1},U>D?(F.sortIndex=U,t(h,F),n(f)===null&&F===n(h)&&(_?(N(O),O=-1):_=!0,Q(b,U-D))):(F.sortIndex=$,t(f,F),S||w||(S=!0,V(T))),F},e.unstable_shouldYield=W,e.unstable_wrapCallback=function(F){var B=g;return function(){var U=g;g=B;try{return F.apply(this,arguments)}finally{g=U}}}})($d)),$d}var Sg;function Ak(){return Sg||(Sg=1,Wd.exports=Fk()),Wd.exports}var kg;function zk(){if(kg)return It;kg=1;var e=qi(),t=Ak();function n(r){for(var o="https://reactjs.org/docs/error-decoder.html?invariant="+r,a=1;a<arguments.length;a++)o+="&args[]="+encodeURIComponent(arguments[a]);return"Minified React error #"+r+"; visit "+o+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var s=new Set,i={};function l(r,o){u(r,o),u(r+"Capture",o)}function u(r,o){for(i[r]=o,r=0;r<o.length;r++)s.add(o[r])}var c=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),f=Object.prototype.hasOwnProperty,h=/^[: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]*$/,m={},p={};function g(r){return f.call(p,r)?!0:f.call(m,r)?!1:h.test(r)?p[r]=!0:(m[r]=!0,!1)}function w(r,o,a,d){if(a!==null&&a.type===0)return!1;switch(typeof o){case"function":case"symbol":return!0;case"boolean":return d?!1:a!==null?!a.acceptsBooleans:(r=r.toLowerCase().slice(0,5),r!=="data-"&&r!=="aria-");default:return!1}}function S(r,o,a,d){if(o===null||typeof o>"u"||w(r,o,a,d))return!0;if(d)return!1;if(a!==null)switch(a.type){case 3:return!o;case 4:return o===!1;case 5:return isNaN(o);case 6:return isNaN(o)||1>o}return!1}function _(r,o,a,d,y,v,E){this.acceptsBooleans=o===2||o===3||o===4,this.attributeName=d,this.attributeNamespace=y,this.mustUseProperty=a,this.propertyName=r,this.type=o,this.sanitizeURL=v,this.removeEmptyString=E}var C={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(r){C[r]=new _(r,0,!1,r,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(r){var o=r[0];C[o]=new _(o,1,!1,r[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(r){C[r]=new _(r,2,!1,r.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(r){C[r]=new _(r,2,!1,r,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(r){C[r]=new _(r,3,!1,r.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(r){C[r]=new _(r,3,!0,r,null,!1,!1)}),["capture","download"].forEach(function(r){C[r]=new _(r,4,!1,r,null,!1,!1)}),["cols","rows","size","span"].forEach(function(r){C[r]=new _(r,6,!1,r,null,!1,!1)}),["rowSpan","start"].forEach(function(r){C[r]=new _(r,5,!1,r.toLowerCase(),null,!1,!1)});var N=/[\-:]([a-z])/g;function P(r){return r[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(r){var o=r.replace(N,P);C[o]=new _(o,1,!1,r,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(r){var o=r.replace(N,P);C[o]=new _(o,1,!1,r,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(r){var o=r.replace(N,P);C[o]=new _(o,1,!1,r,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(r){C[r]=new _(r,1,!1,r.toLowerCase(),null,!1,!1)}),C.xlinkHref=new _("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(r){C[r]=new _(r,1,!1,r.toLowerCase(),null,!0,!0)});function k(r,o,a,d){var y=C.hasOwnProperty(o)?C[o]:null;(y!==null?y.type!==0:d||!(2<o.length)||o[0]!=="o"&&o[0]!=="O"||o[1]!=="n"&&o[1]!=="N")&&(S(o,a,y,d)&&(a=null),d||y===null?g(o)&&(a===null?r.removeAttribute(o):r.setAttribute(o,""+a)):y.mustUseProperty?r[y.propertyName]=a===null?y.type===3?!1:"":a:(o=y.attributeName,d=y.attributeNamespace,a===null?r.removeAttribute(o):(y=y.type,a=y===3||y===4&&a===!0?"":""+a,d?r.setAttributeNS(d,o,a):r.setAttribute(o,a))))}var b=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,T=Symbol.for("react.element"),M=Symbol.for("react.portal"),R=Symbol.for("react.fragment"),O=Symbol.for("react.strict_mode"),A=Symbol.for("react.profiler"),G=Symbol.for("react.provider"),W=Symbol.for("react.context"),K=Symbol.for("react.forward_ref"),J=Symbol.for("react.suspense"),I=Symbol.for("react.suspense_list"),Y=Symbol.for("react.memo"),V=Symbol.for("react.lazy"),Q=Symbol.for("react.offscreen"),F=Symbol.iterator;function B(r){return r===null||typeof r!="object"?null:(r=F&&r[F]||r["@@iterator"],typeof r=="function"?r:null)}var U=Object.assign,D;function $(r){if(D===void 0)try{throw Error()}catch(a){var o=a.stack.trim().match(/\n( *(at )?)/);D=o&&o[1]||""}return`
2
+ `+D+r}var ne=!1;function te(r,o){if(!r||ne)return"";ne=!0;var a=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(o)if(o=function(){throw Error()},Object.defineProperty(o.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(o,[])}catch(Z){var d=Z}Reflect.construct(r,[],o)}else{try{o.call()}catch(Z){d=Z}r.call(o.prototype)}else{try{throw Error()}catch(Z){d=Z}r()}}catch(Z){if(Z&&d&&typeof Z.stack=="string"){for(var y=Z.stack.split(`
3
+ `),v=d.stack.split(`
4
+ `),E=y.length-1,j=v.length-1;1<=E&&0<=j&&y[E]!==v[j];)j--;for(;1<=E&&0<=j;E--,j--)if(y[E]!==v[j]){if(E!==1||j!==1)do if(E--,j--,0>j||y[E]!==v[j]){var z=`
5
+ `+y[E].replace(" at new "," at ");return r.displayName&&z.includes("<anonymous>")&&(z=z.replace("<anonymous>",r.displayName)),z}while(1<=E&&0<=j);break}}}finally{ne=!1,Error.prepareStackTrace=a}return(r=r?r.displayName||r.name:"")?$(r):""}function ie(r){switch(r.tag){case 5:return $(r.type);case 16:return $("Lazy");case 13:return $("Suspense");case 19:return $("SuspenseList");case 0:case 2:case 15:return r=te(r.type,!1),r;case 11:return r=te(r.type.render,!1),r;case 1:return r=te(r.type,!0),r;default:return""}}function ce(r){if(r==null)return null;if(typeof r=="function")return r.displayName||r.name||null;if(typeof r=="string")return r;switch(r){case R:return"Fragment";case M:return"Portal";case A:return"Profiler";case O:return"StrictMode";case J:return"Suspense";case I:return"SuspenseList"}if(typeof r=="object")switch(r.$$typeof){case W:return(r.displayName||"Context")+".Consumer";case G:return(r._context.displayName||"Context")+".Provider";case K:var o=r.render;return r=r.displayName,r||(r=o.displayName||o.name||"",r=r!==""?"ForwardRef("+r+")":"ForwardRef"),r;case Y:return o=r.displayName||null,o!==null?o:ce(r.type)||"Memo";case V:o=r._payload,r=r._init;try{return ce(r(o))}catch{}}return null}function ue(r){var o=r.type;switch(r.tag){case 24:return"Cache";case 9:return(o.displayName||"Context")+".Consumer";case 10:return(o._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return r=o.render,r=r.displayName||r.name||"",o.displayName||(r!==""?"ForwardRef("+r+")":"ForwardRef");case 7:return"Fragment";case 5:return o;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return ce(o);case 8:return o===O?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof o=="function")return o.displayName||o.name||null;if(typeof o=="string")return o}return null}function ee(r){switch(typeof r){case"boolean":case"number":case"string":case"undefined":return r;case"object":return r;default:return""}}function ae(r){var o=r.type;return(r=r.nodeName)&&r.toLowerCase()==="input"&&(o==="checkbox"||o==="radio")}function xe(r){var o=ae(r)?"checked":"value",a=Object.getOwnPropertyDescriptor(r.constructor.prototype,o),d=""+r[o];if(!r.hasOwnProperty(o)&&typeof a<"u"&&typeof a.get=="function"&&typeof a.set=="function"){var y=a.get,v=a.set;return Object.defineProperty(r,o,{configurable:!0,get:function(){return y.call(this)},set:function(E){d=""+E,v.call(this,E)}}),Object.defineProperty(r,o,{enumerable:a.enumerable}),{getValue:function(){return d},setValue:function(E){d=""+E},stopTracking:function(){r._valueTracker=null,delete r[o]}}}}function Ee(r){r._valueTracker||(r._valueTracker=xe(r))}function ye(r){if(!r)return!1;var o=r._valueTracker;if(!o)return!0;var a=o.getValue(),d="";return r&&(d=ae(r)?r.checked?"true":"false":r.value),r=d,r!==a?(o.setValue(r),!0):!1}function ke(r){if(r=r||(typeof document<"u"?document:void 0),typeof r>"u")return null;try{return r.activeElement||r.body}catch{return r.body}}function Te(r,o){var a=o.checked;return U({},o,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:a??r._wrapperState.initialChecked})}function je(r,o){var a=o.defaultValue==null?"":o.defaultValue,d=o.checked!=null?o.checked:o.defaultChecked;a=ee(o.value!=null?o.value:a),r._wrapperState={initialChecked:d,initialValue:a,controlled:o.type==="checkbox"||o.type==="radio"?o.checked!=null:o.value!=null}}function Fe(r,o){o=o.checked,o!=null&&k(r,"checked",o,!1)}function Ue(r,o){Fe(r,o);var a=ee(o.value),d=o.type;if(a!=null)d==="number"?(a===0&&r.value===""||r.value!=a)&&(r.value=""+a):r.value!==""+a&&(r.value=""+a);else if(d==="submit"||d==="reset"){r.removeAttribute("value");return}o.hasOwnProperty("value")?rt(r,o.type,a):o.hasOwnProperty("defaultValue")&&rt(r,o.type,ee(o.defaultValue)),o.checked==null&&o.defaultChecked!=null&&(r.defaultChecked=!!o.defaultChecked)}function Ct(r,o,a){if(o.hasOwnProperty("value")||o.hasOwnProperty("defaultValue")){var d=o.type;if(!(d!=="submit"&&d!=="reset"||o.value!==void 0&&o.value!==null))return;o=""+r._wrapperState.initialValue,a||o===r.value||(r.value=o),r.defaultValue=o}a=r.name,a!==""&&(r.name=""),r.defaultChecked=!!r._wrapperState.initialChecked,a!==""&&(r.name=a)}function rt(r,o,a){(o!=="number"||ke(r.ownerDocument)!==r)&&(a==null?r.defaultValue=""+r._wrapperState.initialValue:r.defaultValue!==""+a&&(r.defaultValue=""+a))}var ot=Array.isArray;function mt(r,o,a,d){if(r=r.options,o){o={};for(var y=0;y<a.length;y++)o["$"+a[y]]=!0;for(a=0;a<r.length;a++)y=o.hasOwnProperty("$"+r[a].value),r[a].selected!==y&&(r[a].selected=y),y&&d&&(r[a].defaultSelected=!0)}else{for(a=""+ee(a),o=null,y=0;y<r.length;y++){if(r[y].value===a){r[y].selected=!0,d&&(r[y].defaultSelected=!0);return}o!==null||r[y].disabled||(o=r[y])}o!==null&&(o.selected=!0)}}function bt(r,o){if(o.dangerouslySetInnerHTML!=null)throw Error(n(91));return U({},o,{value:void 0,defaultValue:void 0,children:""+r._wrapperState.initialValue})}function Re(r,o){var a=o.value;if(a==null){if(a=o.children,o=o.defaultValue,a!=null){if(o!=null)throw Error(n(92));if(ot(a)){if(1<a.length)throw Error(n(93));a=a[0]}o=a}o==null&&(o=""),a=o}r._wrapperState={initialValue:ee(a)}}function Be(r,o){var a=ee(o.value),d=ee(o.defaultValue);a!=null&&(a=""+a,a!==r.value&&(r.value=a),o.defaultValue==null&&r.defaultValue!==a&&(r.defaultValue=a)),d!=null&&(r.defaultValue=""+d)}function Ge(r){var o=r.textContent;o===r._wrapperState.initialValue&&o!==""&&o!==null&&(r.value=o)}function Mt(r){switch(r){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function ln(r,o){return r==null||r==="http://www.w3.org/1999/xhtml"?Mt(o):r==="http://www.w3.org/2000/svg"&&o==="foreignObject"?"http://www.w3.org/1999/xhtml":r}var Fn,ko=(function(r){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(o,a,d,y){MSApp.execUnsafeLocalFunction(function(){return r(o,a,d,y)})}:r})(function(r,o){if(r.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in r)r.innerHTML=o;else{for(Fn=Fn||document.createElement("div"),Fn.innerHTML="<svg>"+o.valueOf().toString()+"</svg>",o=Fn.firstChild;r.firstChild;)r.removeChild(r.firstChild);for(;o.firstChild;)r.appendChild(o.firstChild)}});function un(r,o){if(o){var a=r.firstChild;if(a&&a===r.lastChild&&a.nodeType===3){a.nodeValue=o;return}}r.textContent=o}var An={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},bs=["Webkit","ms","Moz","O"];Object.keys(An).forEach(function(r){bs.forEach(function(o){o=o+r.charAt(0).toUpperCase()+r.substring(1),An[o]=An[r]})});function _o(r,o,a){return o==null||typeof o=="boolean"||o===""?"":a||typeof o!="number"||o===0||An.hasOwnProperty(r)&&An[r]?(""+o).trim():o+"px"}function Co(r,o){r=r.style;for(var a in o)if(o.hasOwnProperty(a)){var d=a.indexOf("--")===0,y=_o(a,o[a],d);a==="float"&&(a="cssFloat"),d?r.setProperty(a,y):r[a]=y}}var Ms=U({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Lr(r,o){if(o){if(Ms[r]&&(o.children!=null||o.dangerouslySetInnerHTML!=null))throw Error(n(137,r));if(o.dangerouslySetInnerHTML!=null){if(o.children!=null)throw Error(n(60));if(typeof o.dangerouslySetInnerHTML!="object"||!("__html"in o.dangerouslySetInnerHTML))throw Error(n(61))}if(o.style!=null&&typeof o.style!="object")throw Error(n(62))}}function rr(r,o){if(r.indexOf("-")===-1)return typeof o.is=="string";switch(r){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 Fr=null;function Ne(r){return r=r.target||r.srcElement||window,r.correspondingUseElement&&(r=r.correspondingUseElement),r.nodeType===3?r.parentNode:r}var Oe=null,Se=null,Me=null;function ct(r){if(r=Zs(r)){if(typeof Oe!="function")throw Error(n(280));var o=r.stateNode;o&&(o=Da(o),Oe(r.stateNode,r.type,o))}}function Pe(r){Se?Me?Me.push(r):Me=[r]:Se=r}function Eo(){if(Se){var r=Se,o=Me;if(Me=Se=null,ct(r),o)for(r=0;r<o.length;r++)ct(o[r])}}function No(r,o){return r(o)}function bo(){}var zn=!1;function or(r,o,a){if(zn)return r(o,a);zn=!0;try{return No(r,o,a)}finally{zn=!1,(Se!==null||Me!==null)&&(bo(),Eo())}}function Ar(r,o){var a=r.stateNode;if(a===null)return null;var d=Da(a);if(d===null)return null;a=d[o];e:switch(o){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(d=!d.disabled)||(r=r.type,d=!(r==="button"||r==="input"||r==="select"||r==="textarea")),r=!d;break e;default:r=!1}if(r)return null;if(a&&typeof a!="function")throw Error(n(231,o,typeof a));return a}var Ps=!1;if(c)try{var zr={};Object.defineProperty(zr,"passive",{get:function(){Ps=!0}}),window.addEventListener("test",zr,zr),window.removeEventListener("test",zr,zr)}catch{Ps=!1}function ju(r,o,a,d,y,v,E,j,z){var Z=Array.prototype.slice.call(arguments,3);try{o.apply(a,Z)}catch(oe){this.onError(oe)}}var Wr=!1,Mo=null,Po=!1,Rs=null,Lu={onError:function(r){Wr=!0,Mo=r}};function Fu(r,o,a,d,y,v,E,j,z){Wr=!1,Mo=null,ju.apply(Lu,arguments)}function Au(r,o,a,d,y,v,E,j,z){if(Fu.apply(this,arguments),Wr){if(Wr){var Z=Mo;Wr=!1,Mo=null}else throw Error(n(198));Po||(Po=!0,Rs=Z)}}function Cn(r){var o=r,a=r;if(r.alternate)for(;o.return;)o=o.return;else{r=o;do o=r,(o.flags&4098)!==0&&(a=o.return),r=o.return;while(r)}return o.tag===3?a:null}function Ds(r){if(r.tag===13){var o=r.memoizedState;if(o===null&&(r=r.alternate,r!==null&&(o=r.memoizedState)),o!==null)return o.dehydrated}return null}function Ts(r){if(Cn(r)!==r)throw Error(n(188))}function zu(r){var o=r.alternate;if(!o){if(o=Cn(r),o===null)throw Error(n(188));return o!==r?null:r}for(var a=r,d=o;;){var y=a.return;if(y===null)break;var v=y.alternate;if(v===null){if(d=y.return,d!==null){a=d;continue}break}if(y.child===v.child){for(v=y.child;v;){if(v===a)return Ts(y),r;if(v===d)return Ts(y),o;v=v.sibling}throw Error(n(188))}if(a.return!==d.return)a=y,d=v;else{for(var E=!1,j=y.child;j;){if(j===a){E=!0,a=y,d=v;break}if(j===d){E=!0,d=y,a=v;break}j=j.sibling}if(!E){for(j=v.child;j;){if(j===a){E=!0,a=v,d=y;break}if(j===d){E=!0,d=v,a=y;break}j=j.sibling}if(!E)throw Error(n(189))}}if(a.alternate!==d)throw Error(n(190))}if(a.tag!==3)throw Error(n(188));return a.stateNode.current===a?r:o}function aa(r){return r=zu(r),r!==null?la(r):null}function la(r){if(r.tag===5||r.tag===6)return r;for(r=r.child;r!==null;){var o=la(r);if(o!==null)return o;r=r.sibling}return null}var ua=t.unstable_scheduleCallback,ca=t.unstable_cancelCallback,Wu=t.unstable_shouldYield,da=t.unstable_requestPaint,Xe=t.unstable_now,$u=t.unstable_getCurrentPriorityLevel,Os=t.unstable_ImmediatePriority,fa=t.unstable_UserBlockingPriority,Ro=t.unstable_NormalPriority,Bu=t.unstable_LowPriority,ha=t.unstable_IdlePriority,$r=null,Gt=null;function Hu(r){if(Gt&&typeof Gt.onCommitFiberRoot=="function")try{Gt.onCommitFiberRoot($r,r,void 0,(r.current.flags&128)===128)}catch{}}var At=Math.clz32?Math.clz32:Uu,Vu=Math.log,Yu=Math.LN2;function Uu(r){return r>>>=0,r===0?32:31-(Vu(r)/Yu|0)|0}var Do=64,To=4194304;function sr(r){switch(r&-r){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: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&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return r&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return r}}function Oo(r,o){var a=r.pendingLanes;if(a===0)return 0;var d=0,y=r.suspendedLanes,v=r.pingedLanes,E=a&268435455;if(E!==0){var j=E&~y;j!==0?d=sr(j):(v&=E,v!==0&&(d=sr(v)))}else E=a&~y,E!==0?d=sr(E):v!==0&&(d=sr(v));if(d===0)return 0;if(o!==0&&o!==d&&(o&y)===0&&(y=d&-d,v=o&-o,y>=v||y===16&&(v&4194240)!==0))return o;if((d&4)!==0&&(d|=a&16),o=r.entangledLanes,o!==0)for(r=r.entanglements,o&=d;0<o;)a=31-At(o),y=1<<a,d|=r[a],o&=~y;return d}function pa(r,o){switch(r){case 1:case 2:case 4:return o+250;case 8:case 16:case 32:case 64: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 o+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Qu(r,o){for(var a=r.suspendedLanes,d=r.pingedLanes,y=r.expirationTimes,v=r.pendingLanes;0<v;){var E=31-At(v),j=1<<E,z=y[E];z===-1?((j&a)===0||(j&d)!==0)&&(y[E]=pa(j,o)):z<=o&&(r.expiredLanes|=j),v&=~j}}function Is(r){return r=r.pendingLanes&-1073741825,r!==0?r:r&1073741824?1073741824:0}function Io(){var r=Do;return Do<<=1,(Do&4194240)===0&&(Do=64),r}function js(r){for(var o=[],a=0;31>a;a++)o.push(r);return o}function Br(r,o,a){r.pendingLanes|=o,o!==536870912&&(r.suspendedLanes=0,r.pingedLanes=0),r=r.eventTimes,o=31-At(o),r[o]=a}function ma(r,o){var a=r.pendingLanes&~o;r.pendingLanes=o,r.suspendedLanes=0,r.pingedLanes=0,r.expiredLanes&=o,r.mutableReadLanes&=o,r.entangledLanes&=o,o=r.entanglements;var d=r.eventTimes;for(r=r.expirationTimes;0<a;){var y=31-At(a),v=1<<y;o[y]=0,d[y]=-1,r[y]=-1,a&=~v}}function qu(r,o){var a=r.entangledLanes|=o;for(r=r.entanglements;a;){var d=31-At(a),y=1<<d;y&o|r[d]&o&&(r[d]|=o),a&=~y}}var ze=0;function Ch(r){return r&=-r,1<r?4<r?(r&268435455)!==0?16:536870912:4:1}var Eh,Ku,Nh,bh,Mh,Gu=!1,ga=[],ir=null,ar=null,lr=null,Ls=new Map,Fs=new Map,ur=[],iw="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 submit".split(" ");function Ph(r,o){switch(r){case"focusin":case"focusout":ir=null;break;case"dragenter":case"dragleave":ar=null;break;case"mouseover":case"mouseout":lr=null;break;case"pointerover":case"pointerout":Ls.delete(o.pointerId);break;case"gotpointercapture":case"lostpointercapture":Fs.delete(o.pointerId)}}function As(r,o,a,d,y,v){return r===null||r.nativeEvent!==v?(r={blockedOn:o,domEventName:a,eventSystemFlags:d,nativeEvent:v,targetContainers:[y]},o!==null&&(o=Zs(o),o!==null&&Ku(o)),r):(r.eventSystemFlags|=d,o=r.targetContainers,y!==null&&o.indexOf(y)===-1&&o.push(y),r)}function aw(r,o,a,d,y){switch(o){case"focusin":return ir=As(ir,r,o,a,d,y),!0;case"dragenter":return ar=As(ar,r,o,a,d,y),!0;case"mouseover":return lr=As(lr,r,o,a,d,y),!0;case"pointerover":var v=y.pointerId;return Ls.set(v,As(Ls.get(v)||null,r,o,a,d,y)),!0;case"gotpointercapture":return v=y.pointerId,Fs.set(v,As(Fs.get(v)||null,r,o,a,d,y)),!0}return!1}function Rh(r){var o=Hr(r.target);if(o!==null){var a=Cn(o);if(a!==null){if(o=a.tag,o===13){if(o=Ds(a),o!==null){r.blockedOn=o,Mh(r.priority,function(){Nh(a)});return}}else if(o===3&&a.stateNode.current.memoizedState.isDehydrated){r.blockedOn=a.tag===3?a.stateNode.containerInfo:null;return}}}r.blockedOn=null}function ya(r){if(r.blockedOn!==null)return!1;for(var o=r.targetContainers;0<o.length;){var a=Zu(r.domEventName,r.eventSystemFlags,o[0],r.nativeEvent);if(a===null){a=r.nativeEvent;var d=new a.constructor(a.type,a);Fr=d,a.target.dispatchEvent(d),Fr=null}else return o=Zs(a),o!==null&&Ku(o),r.blockedOn=a,!1;o.shift()}return!0}function Dh(r,o,a){ya(r)&&a.delete(o)}function lw(){Gu=!1,ir!==null&&ya(ir)&&(ir=null),ar!==null&&ya(ar)&&(ar=null),lr!==null&&ya(lr)&&(lr=null),Ls.forEach(Dh),Fs.forEach(Dh)}function zs(r,o){r.blockedOn===o&&(r.blockedOn=null,Gu||(Gu=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,lw)))}function Ws(r){function o(y){return zs(y,r)}if(0<ga.length){zs(ga[0],r);for(var a=1;a<ga.length;a++){var d=ga[a];d.blockedOn===r&&(d.blockedOn=null)}}for(ir!==null&&zs(ir,r),ar!==null&&zs(ar,r),lr!==null&&zs(lr,r),Ls.forEach(o),Fs.forEach(o),a=0;a<ur.length;a++)d=ur[a],d.blockedOn===r&&(d.blockedOn=null);for(;0<ur.length&&(a=ur[0],a.blockedOn===null);)Rh(a),a.blockedOn===null&&ur.shift()}var jo=b.ReactCurrentBatchConfig,va=!0;function uw(r,o,a,d){var y=ze,v=jo.transition;jo.transition=null;try{ze=1,Xu(r,o,a,d)}finally{ze=y,jo.transition=v}}function cw(r,o,a,d){var y=ze,v=jo.transition;jo.transition=null;try{ze=4,Xu(r,o,a,d)}finally{ze=y,jo.transition=v}}function Xu(r,o,a,d){if(va){var y=Zu(r,o,a,d);if(y===null)mc(r,o,d,xa,a),Ph(r,d);else if(aw(y,r,o,a,d))d.stopPropagation();else if(Ph(r,d),o&4&&-1<iw.indexOf(r)){for(;y!==null;){var v=Zs(y);if(v!==null&&Eh(v),v=Zu(r,o,a,d),v===null&&mc(r,o,d,xa,a),v===y)break;y=v}y!==null&&d.stopPropagation()}else mc(r,o,d,null,a)}}var xa=null;function Zu(r,o,a,d){if(xa=null,r=Ne(d),r=Hr(r),r!==null)if(o=Cn(r),o===null)r=null;else if(a=o.tag,a===13){if(r=Ds(o),r!==null)return r;r=null}else if(a===3){if(o.stateNode.current.memoizedState.isDehydrated)return o.tag===3?o.stateNode.containerInfo:null;r=null}else o!==r&&(r=null);return xa=r,null}function Th(r){switch(r){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"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 1;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"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch($u()){case Os:return 1;case fa:return 4;case Ro:case Bu:return 16;case ha:return 536870912;default:return 16}default:return 16}}var cr=null,Ju=null,wa=null;function Oh(){if(wa)return wa;var r,o=Ju,a=o.length,d,y="value"in cr?cr.value:cr.textContent,v=y.length;for(r=0;r<a&&o[r]===y[r];r++);var E=a-r;for(d=1;d<=E&&o[a-d]===y[v-d];d++);return wa=y.slice(r,1<d?1-d:void 0)}function Sa(r){var o=r.keyCode;return"charCode"in r?(r=r.charCode,r===0&&o===13&&(r=13)):r=o,r===10&&(r=13),32<=r||r===13?r:0}function ka(){return!0}function Ih(){return!1}function zt(r){function o(a,d,y,v,E){this._reactName=a,this._targetInst=y,this.type=d,this.nativeEvent=v,this.target=E,this.currentTarget=null;for(var j in r)r.hasOwnProperty(j)&&(a=r[j],this[j]=a?a(v):v[j]);return this.isDefaultPrevented=(v.defaultPrevented!=null?v.defaultPrevented:v.returnValue===!1)?ka:Ih,this.isPropagationStopped=Ih,this}return U(o.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():typeof a.returnValue!="unknown"&&(a.returnValue=!1),this.isDefaultPrevented=ka)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=ka)},persist:function(){},isPersistent:ka}),o}var Lo={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(r){return r.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},ec=zt(Lo),$s=U({},Lo,{view:0,detail:0}),dw=zt($s),tc,nc,Bs,_a=U({},$s,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:oc,button:0,buttons:0,relatedTarget:function(r){return r.relatedTarget===void 0?r.fromElement===r.srcElement?r.toElement:r.fromElement:r.relatedTarget},movementX:function(r){return"movementX"in r?r.movementX:(r!==Bs&&(Bs&&r.type==="mousemove"?(tc=r.screenX-Bs.screenX,nc=r.screenY-Bs.screenY):nc=tc=0,Bs=r),tc)},movementY:function(r){return"movementY"in r?r.movementY:nc}}),jh=zt(_a),fw=U({},_a,{dataTransfer:0}),hw=zt(fw),pw=U({},$s,{relatedTarget:0}),rc=zt(pw),mw=U({},Lo,{animationName:0,elapsedTime:0,pseudoElement:0}),gw=zt(mw),yw=U({},Lo,{clipboardData:function(r){return"clipboardData"in r?r.clipboardData:window.clipboardData}}),vw=zt(yw),xw=U({},Lo,{data:0}),Lh=zt(xw),ww={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Sw={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"},kw={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function _w(r){var o=this.nativeEvent;return o.getModifierState?o.getModifierState(r):(r=kw[r])?!!o[r]:!1}function oc(){return _w}var Cw=U({},$s,{key:function(r){if(r.key){var o=ww[r.key]||r.key;if(o!=="Unidentified")return o}return r.type==="keypress"?(r=Sa(r),r===13?"Enter":String.fromCharCode(r)):r.type==="keydown"||r.type==="keyup"?Sw[r.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:oc,charCode:function(r){return r.type==="keypress"?Sa(r):0},keyCode:function(r){return r.type==="keydown"||r.type==="keyup"?r.keyCode:0},which:function(r){return r.type==="keypress"?Sa(r):r.type==="keydown"||r.type==="keyup"?r.keyCode:0}}),Ew=zt(Cw),Nw=U({},_a,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Fh=zt(Nw),bw=U({},$s,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:oc}),Mw=zt(bw),Pw=U({},Lo,{propertyName:0,elapsedTime:0,pseudoElement:0}),Rw=zt(Pw),Dw=U({},_a,{deltaX:function(r){return"deltaX"in r?r.deltaX:"wheelDeltaX"in r?-r.wheelDeltaX:0},deltaY:function(r){return"deltaY"in r?r.deltaY:"wheelDeltaY"in r?-r.wheelDeltaY:"wheelDelta"in r?-r.wheelDelta:0},deltaZ:0,deltaMode:0}),Tw=zt(Dw),Ow=[9,13,27,32],sc=c&&"CompositionEvent"in window,Hs=null;c&&"documentMode"in document&&(Hs=document.documentMode);var Iw=c&&"TextEvent"in window&&!Hs,Ah=c&&(!sc||Hs&&8<Hs&&11>=Hs),zh=" ",Wh=!1;function $h(r,o){switch(r){case"keyup":return Ow.indexOf(o.keyCode)!==-1;case"keydown":return o.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Bh(r){return r=r.detail,typeof r=="object"&&"data"in r?r.data:null}var Fo=!1;function jw(r,o){switch(r){case"compositionend":return Bh(o);case"keypress":return o.which!==32?null:(Wh=!0,zh);case"textInput":return r=o.data,r===zh&&Wh?null:r;default:return null}}function Lw(r,o){if(Fo)return r==="compositionend"||!sc&&$h(r,o)?(r=Oh(),wa=Ju=cr=null,Fo=!1,r):null;switch(r){case"paste":return null;case"keypress":if(!(o.ctrlKey||o.altKey||o.metaKey)||o.ctrlKey&&o.altKey){if(o.char&&1<o.char.length)return o.char;if(o.which)return String.fromCharCode(o.which)}return null;case"compositionend":return Ah&&o.locale!=="ko"?null:o.data;default:return null}}var Fw={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 Hh(r){var o=r&&r.nodeName&&r.nodeName.toLowerCase();return o==="input"?!!Fw[r.type]:o==="textarea"}function Vh(r,o,a,d){Pe(d),o=Ma(o,"onChange"),0<o.length&&(a=new ec("onChange","change",null,a,d),r.push({event:a,listeners:o}))}var Vs=null,Ys=null;function Aw(r){lp(r,0)}function Ca(r){var o=Bo(r);if(ye(o))return r}function zw(r,o){if(r==="change")return o}var Yh=!1;if(c){var ic;if(c){var ac="oninput"in document;if(!ac){var Uh=document.createElement("div");Uh.setAttribute("oninput","return;"),ac=typeof Uh.oninput=="function"}ic=ac}else ic=!1;Yh=ic&&(!document.documentMode||9<document.documentMode)}function Qh(){Vs&&(Vs.detachEvent("onpropertychange",qh),Ys=Vs=null)}function qh(r){if(r.propertyName==="value"&&Ca(Ys)){var o=[];Vh(o,Ys,r,Ne(r)),or(Aw,o)}}function Ww(r,o,a){r==="focusin"?(Qh(),Vs=o,Ys=a,Vs.attachEvent("onpropertychange",qh)):r==="focusout"&&Qh()}function $w(r){if(r==="selectionchange"||r==="keyup"||r==="keydown")return Ca(Ys)}function Bw(r,o){if(r==="click")return Ca(o)}function Hw(r,o){if(r==="input"||r==="change")return Ca(o)}function Vw(r,o){return r===o&&(r!==0||1/r===1/o)||r!==r&&o!==o}var cn=typeof Object.is=="function"?Object.is:Vw;function Us(r,o){if(cn(r,o))return!0;if(typeof r!="object"||r===null||typeof o!="object"||o===null)return!1;var a=Object.keys(r),d=Object.keys(o);if(a.length!==d.length)return!1;for(d=0;d<a.length;d++){var y=a[d];if(!f.call(o,y)||!cn(r[y],o[y]))return!1}return!0}function Kh(r){for(;r&&r.firstChild;)r=r.firstChild;return r}function Gh(r,o){var a=Kh(r);r=0;for(var d;a;){if(a.nodeType===3){if(d=r+a.textContent.length,r<=o&&d>=o)return{node:a,offset:o-r};r=d}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=Kh(a)}}function Xh(r,o){return r&&o?r===o?!0:r&&r.nodeType===3?!1:o&&o.nodeType===3?Xh(r,o.parentNode):"contains"in r?r.contains(o):r.compareDocumentPosition?!!(r.compareDocumentPosition(o)&16):!1:!1}function Zh(){for(var r=window,o=ke();o instanceof r.HTMLIFrameElement;){try{var a=typeof o.contentWindow.location.href=="string"}catch{a=!1}if(a)r=o.contentWindow;else break;o=ke(r.document)}return o}function lc(r){var o=r&&r.nodeName&&r.nodeName.toLowerCase();return o&&(o==="input"&&(r.type==="text"||r.type==="search"||r.type==="tel"||r.type==="url"||r.type==="password")||o==="textarea"||r.contentEditable==="true")}function Yw(r){var o=Zh(),a=r.focusedElem,d=r.selectionRange;if(o!==a&&a&&a.ownerDocument&&Xh(a.ownerDocument.documentElement,a)){if(d!==null&&lc(a)){if(o=d.start,r=d.end,r===void 0&&(r=o),"selectionStart"in a)a.selectionStart=o,a.selectionEnd=Math.min(r,a.value.length);else if(r=(o=a.ownerDocument||document)&&o.defaultView||window,r.getSelection){r=r.getSelection();var y=a.textContent.length,v=Math.min(d.start,y);d=d.end===void 0?v:Math.min(d.end,y),!r.extend&&v>d&&(y=d,d=v,v=y),y=Gh(a,v);var E=Gh(a,d);y&&E&&(r.rangeCount!==1||r.anchorNode!==y.node||r.anchorOffset!==y.offset||r.focusNode!==E.node||r.focusOffset!==E.offset)&&(o=o.createRange(),o.setStart(y.node,y.offset),r.removeAllRanges(),v>d?(r.addRange(o),r.extend(E.node,E.offset)):(o.setEnd(E.node,E.offset),r.addRange(o)))}}for(o=[],r=a;r=r.parentNode;)r.nodeType===1&&o.push({element:r,left:r.scrollLeft,top:r.scrollTop});for(typeof a.focus=="function"&&a.focus(),a=0;a<o.length;a++)r=o[a],r.element.scrollLeft=r.left,r.element.scrollTop=r.top}}var Uw=c&&"documentMode"in document&&11>=document.documentMode,Ao=null,uc=null,Qs=null,cc=!1;function Jh(r,o,a){var d=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;cc||Ao==null||Ao!==ke(d)||(d=Ao,"selectionStart"in d&&lc(d)?d={start:d.selectionStart,end:d.selectionEnd}:(d=(d.ownerDocument&&d.ownerDocument.defaultView||window).getSelection(),d={anchorNode:d.anchorNode,anchorOffset:d.anchorOffset,focusNode:d.focusNode,focusOffset:d.focusOffset}),Qs&&Us(Qs,d)||(Qs=d,d=Ma(uc,"onSelect"),0<d.length&&(o=new ec("onSelect","select",null,o,a),r.push({event:o,listeners:d}),o.target=Ao)))}function Ea(r,o){var a={};return a[r.toLowerCase()]=o.toLowerCase(),a["Webkit"+r]="webkit"+o,a["Moz"+r]="moz"+o,a}var zo={animationend:Ea("Animation","AnimationEnd"),animationiteration:Ea("Animation","AnimationIteration"),animationstart:Ea("Animation","AnimationStart"),transitionend:Ea("Transition","TransitionEnd")},dc={},ep={};c&&(ep=document.createElement("div").style,"AnimationEvent"in window||(delete zo.animationend.animation,delete zo.animationiteration.animation,delete zo.animationstart.animation),"TransitionEvent"in window||delete zo.transitionend.transition);function Na(r){if(dc[r])return dc[r];if(!zo[r])return r;var o=zo[r],a;for(a in o)if(o.hasOwnProperty(a)&&a in ep)return dc[r]=o[a];return r}var tp=Na("animationend"),np=Na("animationiteration"),rp=Na("animationstart"),op=Na("transitionend"),sp=new Map,ip="abort auxClick 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(" ");function dr(r,o){sp.set(r,o),l(o,[r])}for(var fc=0;fc<ip.length;fc++){var hc=ip[fc],Qw=hc.toLowerCase(),qw=hc[0].toUpperCase()+hc.slice(1);dr(Qw,"on"+qw)}dr(tp,"onAnimationEnd"),dr(np,"onAnimationIteration"),dr(rp,"onAnimationStart"),dr("dblclick","onDoubleClick"),dr("focusin","onFocus"),dr("focusout","onBlur"),dr(op,"onTransitionEnd"),u("onMouseEnter",["mouseout","mouseover"]),u("onMouseLeave",["mouseout","mouseover"]),u("onPointerEnter",["pointerout","pointerover"]),u("onPointerLeave",["pointerout","pointerover"]),l("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),l("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),l("onBeforeInput",["compositionend","keypress","textInput","paste"]),l("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),l("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),l("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var qs="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(" "),Kw=new Set("cancel close invalid load scroll toggle".split(" ").concat(qs));function ap(r,o,a){var d=r.type||"unknown-event";r.currentTarget=a,Au(d,o,void 0,r),r.currentTarget=null}function lp(r,o){o=(o&4)!==0;for(var a=0;a<r.length;a++){var d=r[a],y=d.event;d=d.listeners;e:{var v=void 0;if(o)for(var E=d.length-1;0<=E;E--){var j=d[E],z=j.instance,Z=j.currentTarget;if(j=j.listener,z!==v&&y.isPropagationStopped())break e;ap(y,j,Z),v=z}else for(E=0;E<d.length;E++){if(j=d[E],z=j.instance,Z=j.currentTarget,j=j.listener,z!==v&&y.isPropagationStopped())break e;ap(y,j,Z),v=z}}}if(Po)throw r=Rs,Po=!1,Rs=null,r}function Ve(r,o){var a=o[Sc];a===void 0&&(a=o[Sc]=new Set);var d=r+"__bubble";a.has(d)||(up(o,r,2,!1),a.add(d))}function pc(r,o,a){var d=0;o&&(d|=4),up(a,r,d,o)}var ba="_reactListening"+Math.random().toString(36).slice(2);function Ks(r){if(!r[ba]){r[ba]=!0,s.forEach(function(a){a!=="selectionchange"&&(Kw.has(a)||pc(a,!1,r),pc(a,!0,r))});var o=r.nodeType===9?r:r.ownerDocument;o===null||o[ba]||(o[ba]=!0,pc("selectionchange",!1,o))}}function up(r,o,a,d){switch(Th(o)){case 1:var y=uw;break;case 4:y=cw;break;default:y=Xu}a=y.bind(null,o,a,r),y=void 0,!Ps||o!=="touchstart"&&o!=="touchmove"&&o!=="wheel"||(y=!0),d?y!==void 0?r.addEventListener(o,a,{capture:!0,passive:y}):r.addEventListener(o,a,!0):y!==void 0?r.addEventListener(o,a,{passive:y}):r.addEventListener(o,a,!1)}function mc(r,o,a,d,y){var v=d;if((o&1)===0&&(o&2)===0&&d!==null)e:for(;;){if(d===null)return;var E=d.tag;if(E===3||E===4){var j=d.stateNode.containerInfo;if(j===y||j.nodeType===8&&j.parentNode===y)break;if(E===4)for(E=d.return;E!==null;){var z=E.tag;if((z===3||z===4)&&(z=E.stateNode.containerInfo,z===y||z.nodeType===8&&z.parentNode===y))return;E=E.return}for(;j!==null;){if(E=Hr(j),E===null)return;if(z=E.tag,z===5||z===6){d=v=E;continue e}j=j.parentNode}}d=d.return}or(function(){var Z=v,oe=Ne(a),se=[];e:{var re=sp.get(r);if(re!==void 0){var fe=ec,pe=r;switch(r){case"keypress":if(Sa(a)===0)break e;case"keydown":case"keyup":fe=Ew;break;case"focusin":pe="focus",fe=rc;break;case"focusout":pe="blur",fe=rc;break;case"beforeblur":case"afterblur":fe=rc;break;case"click":if(a.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":fe=jh;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":fe=hw;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":fe=Mw;break;case tp:case np:case rp:fe=gw;break;case op:fe=Rw;break;case"scroll":fe=dw;break;case"wheel":fe=Tw;break;case"copy":case"cut":case"paste":fe=vw;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":fe=Fh}var me=(o&4)!==0,nt=!me&&r==="scroll",q=me?re!==null?re+"Capture":null:re;me=[];for(var H=Z,X;H!==null;){X=H;var le=X.stateNode;if(X.tag===5&&le!==null&&(X=le,q!==null&&(le=Ar(H,q),le!=null&&me.push(Gs(H,le,X)))),nt)break;H=H.return}0<me.length&&(re=new fe(re,pe,null,a,oe),se.push({event:re,listeners:me}))}}if((o&7)===0){e:{if(re=r==="mouseover"||r==="pointerover",fe=r==="mouseout"||r==="pointerout",re&&a!==Fr&&(pe=a.relatedTarget||a.fromElement)&&(Hr(pe)||pe[Wn]))break e;if((fe||re)&&(re=oe.window===oe?oe:(re=oe.ownerDocument)?re.defaultView||re.parentWindow:window,fe?(pe=a.relatedTarget||a.toElement,fe=Z,pe=pe?Hr(pe):null,pe!==null&&(nt=Cn(pe),pe!==nt||pe.tag!==5&&pe.tag!==6)&&(pe=null)):(fe=null,pe=Z),fe!==pe)){if(me=jh,le="onMouseLeave",q="onMouseEnter",H="mouse",(r==="pointerout"||r==="pointerover")&&(me=Fh,le="onPointerLeave",q="onPointerEnter",H="pointer"),nt=fe==null?re:Bo(fe),X=pe==null?re:Bo(pe),re=new me(le,H+"leave",fe,a,oe),re.target=nt,re.relatedTarget=X,le=null,Hr(oe)===Z&&(me=new me(q,H+"enter",pe,a,oe),me.target=X,me.relatedTarget=nt,le=me),nt=le,fe&&pe)t:{for(me=fe,q=pe,H=0,X=me;X;X=Wo(X))H++;for(X=0,le=q;le;le=Wo(le))X++;for(;0<H-X;)me=Wo(me),H--;for(;0<X-H;)q=Wo(q),X--;for(;H--;){if(me===q||q!==null&&me===q.alternate)break t;me=Wo(me),q=Wo(q)}me=null}else me=null;fe!==null&&cp(se,re,fe,me,!1),pe!==null&&nt!==null&&cp(se,nt,pe,me,!0)}}e:{if(re=Z?Bo(Z):window,fe=re.nodeName&&re.nodeName.toLowerCase(),fe==="select"||fe==="input"&&re.type==="file")var ve=zw;else if(Hh(re))if(Yh)ve=Hw;else{ve=$w;var _e=Ww}else(fe=re.nodeName)&&fe.toLowerCase()==="input"&&(re.type==="checkbox"||re.type==="radio")&&(ve=Bw);if(ve&&(ve=ve(r,Z))){Vh(se,ve,a,oe);break e}_e&&_e(r,re,Z),r==="focusout"&&(_e=re._wrapperState)&&_e.controlled&&re.type==="number"&&rt(re,"number",re.value)}switch(_e=Z?Bo(Z):window,r){case"focusin":(Hh(_e)||_e.contentEditable==="true")&&(Ao=_e,uc=Z,Qs=null);break;case"focusout":Qs=uc=Ao=null;break;case"mousedown":cc=!0;break;case"contextmenu":case"mouseup":case"dragend":cc=!1,Jh(se,a,oe);break;case"selectionchange":if(Uw)break;case"keydown":case"keyup":Jh(se,a,oe)}var Ce;if(sc)e:{switch(r){case"compositionstart":var be="onCompositionStart";break e;case"compositionend":be="onCompositionEnd";break e;case"compositionupdate":be="onCompositionUpdate";break e}be=void 0}else Fo?$h(r,a)&&(be="onCompositionEnd"):r==="keydown"&&a.keyCode===229&&(be="onCompositionStart");be&&(Ah&&a.locale!=="ko"&&(Fo||be!=="onCompositionStart"?be==="onCompositionEnd"&&Fo&&(Ce=Oh()):(cr=oe,Ju="value"in cr?cr.value:cr.textContent,Fo=!0)),_e=Ma(Z,be),0<_e.length&&(be=new Lh(be,r,null,a,oe),se.push({event:be,listeners:_e}),Ce?be.data=Ce:(Ce=Bh(a),Ce!==null&&(be.data=Ce)))),(Ce=Iw?jw(r,a):Lw(r,a))&&(Z=Ma(Z,"onBeforeInput"),0<Z.length&&(oe=new Lh("onBeforeInput","beforeinput",null,a,oe),se.push({event:oe,listeners:Z}),oe.data=Ce))}lp(se,o)})}function Gs(r,o,a){return{instance:r,listener:o,currentTarget:a}}function Ma(r,o){for(var a=o+"Capture",d=[];r!==null;){var y=r,v=y.stateNode;y.tag===5&&v!==null&&(y=v,v=Ar(r,a),v!=null&&d.unshift(Gs(r,v,y)),v=Ar(r,o),v!=null&&d.push(Gs(r,v,y))),r=r.return}return d}function Wo(r){if(r===null)return null;do r=r.return;while(r&&r.tag!==5);return r||null}function cp(r,o,a,d,y){for(var v=o._reactName,E=[];a!==null&&a!==d;){var j=a,z=j.alternate,Z=j.stateNode;if(z!==null&&z===d)break;j.tag===5&&Z!==null&&(j=Z,y?(z=Ar(a,v),z!=null&&E.unshift(Gs(a,z,j))):y||(z=Ar(a,v),z!=null&&E.push(Gs(a,z,j)))),a=a.return}E.length!==0&&r.push({event:o,listeners:E})}var Gw=/\r\n?/g,Xw=/\u0000|\uFFFD/g;function dp(r){return(typeof r=="string"?r:""+r).replace(Gw,`
6
+ `).replace(Xw,"")}function Pa(r,o,a){if(o=dp(o),dp(r)!==o&&a)throw Error(n(425))}function Ra(){}var gc=null,yc=null;function vc(r,o){return r==="textarea"||r==="noscript"||typeof o.children=="string"||typeof o.children=="number"||typeof o.dangerouslySetInnerHTML=="object"&&o.dangerouslySetInnerHTML!==null&&o.dangerouslySetInnerHTML.__html!=null}var xc=typeof setTimeout=="function"?setTimeout:void 0,Zw=typeof clearTimeout=="function"?clearTimeout:void 0,fp=typeof Promise=="function"?Promise:void 0,Jw=typeof queueMicrotask=="function"?queueMicrotask:typeof fp<"u"?function(r){return fp.resolve(null).then(r).catch(e1)}:xc;function e1(r){setTimeout(function(){throw r})}function wc(r,o){var a=o,d=0;do{var y=a.nextSibling;if(r.removeChild(a),y&&y.nodeType===8)if(a=y.data,a==="/$"){if(d===0){r.removeChild(y),Ws(o);return}d--}else a!=="$"&&a!=="$?"&&a!=="$!"||d++;a=y}while(a);Ws(o)}function fr(r){for(;r!=null;r=r.nextSibling){var o=r.nodeType;if(o===1||o===3)break;if(o===8){if(o=r.data,o==="$"||o==="$!"||o==="$?")break;if(o==="/$")return null}}return r}function hp(r){r=r.previousSibling;for(var o=0;r;){if(r.nodeType===8){var a=r.data;if(a==="$"||a==="$!"||a==="$?"){if(o===0)return r;o--}else a==="/$"&&o++}r=r.previousSibling}return null}var $o=Math.random().toString(36).slice(2),En="__reactFiber$"+$o,Xs="__reactProps$"+$o,Wn="__reactContainer$"+$o,Sc="__reactEvents$"+$o,t1="__reactListeners$"+$o,n1="__reactHandles$"+$o;function Hr(r){var o=r[En];if(o)return o;for(var a=r.parentNode;a;){if(o=a[Wn]||a[En]){if(a=o.alternate,o.child!==null||a!==null&&a.child!==null)for(r=hp(r);r!==null;){if(a=r[En])return a;r=hp(r)}return o}r=a,a=r.parentNode}return null}function Zs(r){return r=r[En]||r[Wn],!r||r.tag!==5&&r.tag!==6&&r.tag!==13&&r.tag!==3?null:r}function Bo(r){if(r.tag===5||r.tag===6)return r.stateNode;throw Error(n(33))}function Da(r){return r[Xs]||null}var kc=[],Ho=-1;function hr(r){return{current:r}}function Ye(r){0>Ho||(r.current=kc[Ho],kc[Ho]=null,Ho--)}function He(r,o){Ho++,kc[Ho]=r.current,r.current=o}var pr={},xt=hr(pr),Pt=hr(!1),Vr=pr;function Vo(r,o){var a=r.type.contextTypes;if(!a)return pr;var d=r.stateNode;if(d&&d.__reactInternalMemoizedUnmaskedChildContext===o)return d.__reactInternalMemoizedMaskedChildContext;var y={},v;for(v in a)y[v]=o[v];return d&&(r=r.stateNode,r.__reactInternalMemoizedUnmaskedChildContext=o,r.__reactInternalMemoizedMaskedChildContext=y),y}function Rt(r){return r=r.childContextTypes,r!=null}function Ta(){Ye(Pt),Ye(xt)}function pp(r,o,a){if(xt.current!==pr)throw Error(n(168));He(xt,o),He(Pt,a)}function mp(r,o,a){var d=r.stateNode;if(o=o.childContextTypes,typeof d.getChildContext!="function")return a;d=d.getChildContext();for(var y in d)if(!(y in o))throw Error(n(108,ue(r)||"Unknown",y));return U({},a,d)}function Oa(r){return r=(r=r.stateNode)&&r.__reactInternalMemoizedMergedChildContext||pr,Vr=xt.current,He(xt,r),He(Pt,Pt.current),!0}function gp(r,o,a){var d=r.stateNode;if(!d)throw Error(n(169));a?(r=mp(r,o,Vr),d.__reactInternalMemoizedMergedChildContext=r,Ye(Pt),Ye(xt),He(xt,r)):Ye(Pt),He(Pt,a)}var $n=null,Ia=!1,_c=!1;function yp(r){$n===null?$n=[r]:$n.push(r)}function r1(r){Ia=!0,yp(r)}function mr(){if(!_c&&$n!==null){_c=!0;var r=0,o=ze;try{var a=$n;for(ze=1;r<a.length;r++){var d=a[r];do d=d(!0);while(d!==null)}$n=null,Ia=!1}catch(y){throw $n!==null&&($n=$n.slice(r+1)),ua(Os,mr),y}finally{ze=o,_c=!1}}return null}var Yo=[],Uo=0,ja=null,La=0,Xt=[],Zt=0,Yr=null,Bn=1,Hn="";function Ur(r,o){Yo[Uo++]=La,Yo[Uo++]=ja,ja=r,La=o}function vp(r,o,a){Xt[Zt++]=Bn,Xt[Zt++]=Hn,Xt[Zt++]=Yr,Yr=r;var d=Bn;r=Hn;var y=32-At(d)-1;d&=~(1<<y),a+=1;var v=32-At(o)+y;if(30<v){var E=y-y%5;v=(d&(1<<E)-1).toString(32),d>>=E,y-=E,Bn=1<<32-At(o)+y|a<<y|d,Hn=v+r}else Bn=1<<v|a<<y|d,Hn=r}function Cc(r){r.return!==null&&(Ur(r,1),vp(r,1,0))}function Ec(r){for(;r===ja;)ja=Yo[--Uo],Yo[Uo]=null,La=Yo[--Uo],Yo[Uo]=null;for(;r===Yr;)Yr=Xt[--Zt],Xt[Zt]=null,Hn=Xt[--Zt],Xt[Zt]=null,Bn=Xt[--Zt],Xt[Zt]=null}var Wt=null,$t=null,Qe=!1,dn=null;function xp(r,o){var a=nn(5,null,null,0);a.elementType="DELETED",a.stateNode=o,a.return=r,o=r.deletions,o===null?(r.deletions=[a],r.flags|=16):o.push(a)}function wp(r,o){switch(r.tag){case 5:var a=r.type;return o=o.nodeType!==1||a.toLowerCase()!==o.nodeName.toLowerCase()?null:o,o!==null?(r.stateNode=o,Wt=r,$t=fr(o.firstChild),!0):!1;case 6:return o=r.pendingProps===""||o.nodeType!==3?null:o,o!==null?(r.stateNode=o,Wt=r,$t=null,!0):!1;case 13:return o=o.nodeType!==8?null:o,o!==null?(a=Yr!==null?{id:Bn,overflow:Hn}:null,r.memoizedState={dehydrated:o,treeContext:a,retryLane:1073741824},a=nn(18,null,null,0),a.stateNode=o,a.return=r,r.child=a,Wt=r,$t=null,!0):!1;default:return!1}}function Nc(r){return(r.mode&1)!==0&&(r.flags&128)===0}function bc(r){if(Qe){var o=$t;if(o){var a=o;if(!wp(r,o)){if(Nc(r))throw Error(n(418));o=fr(a.nextSibling);var d=Wt;o&&wp(r,o)?xp(d,a):(r.flags=r.flags&-4097|2,Qe=!1,Wt=r)}}else{if(Nc(r))throw Error(n(418));r.flags=r.flags&-4097|2,Qe=!1,Wt=r}}}function Sp(r){for(r=r.return;r!==null&&r.tag!==5&&r.tag!==3&&r.tag!==13;)r=r.return;Wt=r}function Fa(r){if(r!==Wt)return!1;if(!Qe)return Sp(r),Qe=!0,!1;var o;if((o=r.tag!==3)&&!(o=r.tag!==5)&&(o=r.type,o=o!=="head"&&o!=="body"&&!vc(r.type,r.memoizedProps)),o&&(o=$t)){if(Nc(r))throw kp(),Error(n(418));for(;o;)xp(r,o),o=fr(o.nextSibling)}if(Sp(r),r.tag===13){if(r=r.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(n(317));e:{for(r=r.nextSibling,o=0;r;){if(r.nodeType===8){var a=r.data;if(a==="/$"){if(o===0){$t=fr(r.nextSibling);break e}o--}else a!=="$"&&a!=="$!"&&a!=="$?"||o++}r=r.nextSibling}$t=null}}else $t=Wt?fr(r.stateNode.nextSibling):null;return!0}function kp(){for(var r=$t;r;)r=fr(r.nextSibling)}function Qo(){$t=Wt=null,Qe=!1}function Mc(r){dn===null?dn=[r]:dn.push(r)}var o1=b.ReactCurrentBatchConfig;function Js(r,o,a){if(r=a.ref,r!==null&&typeof r!="function"&&typeof r!="object"){if(a._owner){if(a=a._owner,a){if(a.tag!==1)throw Error(n(309));var d=a.stateNode}if(!d)throw Error(n(147,r));var y=d,v=""+r;return o!==null&&o.ref!==null&&typeof o.ref=="function"&&o.ref._stringRef===v?o.ref:(o=function(E){var j=y.refs;E===null?delete j[v]:j[v]=E},o._stringRef=v,o)}if(typeof r!="string")throw Error(n(284));if(!a._owner)throw Error(n(290,r))}return r}function Aa(r,o){throw r=Object.prototype.toString.call(o),Error(n(31,r==="[object Object]"?"object with keys {"+Object.keys(o).join(", ")+"}":r))}function _p(r){var o=r._init;return o(r._payload)}function Cp(r){function o(q,H){if(r){var X=q.deletions;X===null?(q.deletions=[H],q.flags|=16):X.push(H)}}function a(q,H){if(!r)return null;for(;H!==null;)o(q,H),H=H.sibling;return null}function d(q,H){for(q=new Map;H!==null;)H.key!==null?q.set(H.key,H):q.set(H.index,H),H=H.sibling;return q}function y(q,H){return q=_r(q,H),q.index=0,q.sibling=null,q}function v(q,H,X){return q.index=X,r?(X=q.alternate,X!==null?(X=X.index,X<H?(q.flags|=2,H):X):(q.flags|=2,H)):(q.flags|=1048576,H)}function E(q){return r&&q.alternate===null&&(q.flags|=2),q}function j(q,H,X,le){return H===null||H.tag!==6?(H=xd(X,q.mode,le),H.return=q,H):(H=y(H,X),H.return=q,H)}function z(q,H,X,le){var ve=X.type;return ve===R?oe(q,H,X.props.children,le,X.key):H!==null&&(H.elementType===ve||typeof ve=="object"&&ve!==null&&ve.$$typeof===V&&_p(ve)===H.type)?(le=y(H,X.props),le.ref=Js(q,H,X),le.return=q,le):(le=ll(X.type,X.key,X.props,null,q.mode,le),le.ref=Js(q,H,X),le.return=q,le)}function Z(q,H,X,le){return H===null||H.tag!==4||H.stateNode.containerInfo!==X.containerInfo||H.stateNode.implementation!==X.implementation?(H=wd(X,q.mode,le),H.return=q,H):(H=y(H,X.children||[]),H.return=q,H)}function oe(q,H,X,le,ve){return H===null||H.tag!==7?(H=eo(X,q.mode,le,ve),H.return=q,H):(H=y(H,X),H.return=q,H)}function se(q,H,X){if(typeof H=="string"&&H!==""||typeof H=="number")return H=xd(""+H,q.mode,X),H.return=q,H;if(typeof H=="object"&&H!==null){switch(H.$$typeof){case T:return X=ll(H.type,H.key,H.props,null,q.mode,X),X.ref=Js(q,null,H),X.return=q,X;case M:return H=wd(H,q.mode,X),H.return=q,H;case V:var le=H._init;return se(q,le(H._payload),X)}if(ot(H)||B(H))return H=eo(H,q.mode,X,null),H.return=q,H;Aa(q,H)}return null}function re(q,H,X,le){var ve=H!==null?H.key:null;if(typeof X=="string"&&X!==""||typeof X=="number")return ve!==null?null:j(q,H,""+X,le);if(typeof X=="object"&&X!==null){switch(X.$$typeof){case T:return X.key===ve?z(q,H,X,le):null;case M:return X.key===ve?Z(q,H,X,le):null;case V:return ve=X._init,re(q,H,ve(X._payload),le)}if(ot(X)||B(X))return ve!==null?null:oe(q,H,X,le,null);Aa(q,X)}return null}function fe(q,H,X,le,ve){if(typeof le=="string"&&le!==""||typeof le=="number")return q=q.get(X)||null,j(H,q,""+le,ve);if(typeof le=="object"&&le!==null){switch(le.$$typeof){case T:return q=q.get(le.key===null?X:le.key)||null,z(H,q,le,ve);case M:return q=q.get(le.key===null?X:le.key)||null,Z(H,q,le,ve);case V:var _e=le._init;return fe(q,H,X,_e(le._payload),ve)}if(ot(le)||B(le))return q=q.get(X)||null,oe(H,q,le,ve,null);Aa(H,le)}return null}function pe(q,H,X,le){for(var ve=null,_e=null,Ce=H,be=H=0,ht=null;Ce!==null&&be<X.length;be++){Ce.index>be?(ht=Ce,Ce=null):ht=Ce.sibling;var Ae=re(q,Ce,X[be],le);if(Ae===null){Ce===null&&(Ce=ht);break}r&&Ce&&Ae.alternate===null&&o(q,Ce),H=v(Ae,H,be),_e===null?ve=Ae:_e.sibling=Ae,_e=Ae,Ce=ht}if(be===X.length)return a(q,Ce),Qe&&Ur(q,be),ve;if(Ce===null){for(;be<X.length;be++)Ce=se(q,X[be],le),Ce!==null&&(H=v(Ce,H,be),_e===null?ve=Ce:_e.sibling=Ce,_e=Ce);return Qe&&Ur(q,be),ve}for(Ce=d(q,Ce);be<X.length;be++)ht=fe(Ce,q,be,X[be],le),ht!==null&&(r&&ht.alternate!==null&&Ce.delete(ht.key===null?be:ht.key),H=v(ht,H,be),_e===null?ve=ht:_e.sibling=ht,_e=ht);return r&&Ce.forEach(function(Cr){return o(q,Cr)}),Qe&&Ur(q,be),ve}function me(q,H,X,le){var ve=B(X);if(typeof ve!="function")throw Error(n(150));if(X=ve.call(X),X==null)throw Error(n(151));for(var _e=ve=null,Ce=H,be=H=0,ht=null,Ae=X.next();Ce!==null&&!Ae.done;be++,Ae=X.next()){Ce.index>be?(ht=Ce,Ce=null):ht=Ce.sibling;var Cr=re(q,Ce,Ae.value,le);if(Cr===null){Ce===null&&(Ce=ht);break}r&&Ce&&Cr.alternate===null&&o(q,Ce),H=v(Cr,H,be),_e===null?ve=Cr:_e.sibling=Cr,_e=Cr,Ce=ht}if(Ae.done)return a(q,Ce),Qe&&Ur(q,be),ve;if(Ce===null){for(;!Ae.done;be++,Ae=X.next())Ae=se(q,Ae.value,le),Ae!==null&&(H=v(Ae,H,be),_e===null?ve=Ae:_e.sibling=Ae,_e=Ae);return Qe&&Ur(q,be),ve}for(Ce=d(q,Ce);!Ae.done;be++,Ae=X.next())Ae=fe(Ce,q,be,Ae.value,le),Ae!==null&&(r&&Ae.alternate!==null&&Ce.delete(Ae.key===null?be:Ae.key),H=v(Ae,H,be),_e===null?ve=Ae:_e.sibling=Ae,_e=Ae);return r&&Ce.forEach(function(F1){return o(q,F1)}),Qe&&Ur(q,be),ve}function nt(q,H,X,le){if(typeof X=="object"&&X!==null&&X.type===R&&X.key===null&&(X=X.props.children),typeof X=="object"&&X!==null){switch(X.$$typeof){case T:e:{for(var ve=X.key,_e=H;_e!==null;){if(_e.key===ve){if(ve=X.type,ve===R){if(_e.tag===7){a(q,_e.sibling),H=y(_e,X.props.children),H.return=q,q=H;break e}}else if(_e.elementType===ve||typeof ve=="object"&&ve!==null&&ve.$$typeof===V&&_p(ve)===_e.type){a(q,_e.sibling),H=y(_e,X.props),H.ref=Js(q,_e,X),H.return=q,q=H;break e}a(q,_e);break}else o(q,_e);_e=_e.sibling}X.type===R?(H=eo(X.props.children,q.mode,le,X.key),H.return=q,q=H):(le=ll(X.type,X.key,X.props,null,q.mode,le),le.ref=Js(q,H,X),le.return=q,q=le)}return E(q);case M:e:{for(_e=X.key;H!==null;){if(H.key===_e)if(H.tag===4&&H.stateNode.containerInfo===X.containerInfo&&H.stateNode.implementation===X.implementation){a(q,H.sibling),H=y(H,X.children||[]),H.return=q,q=H;break e}else{a(q,H);break}else o(q,H);H=H.sibling}H=wd(X,q.mode,le),H.return=q,q=H}return E(q);case V:return _e=X._init,nt(q,H,_e(X._payload),le)}if(ot(X))return pe(q,H,X,le);if(B(X))return me(q,H,X,le);Aa(q,X)}return typeof X=="string"&&X!==""||typeof X=="number"?(X=""+X,H!==null&&H.tag===6?(a(q,H.sibling),H=y(H,X),H.return=q,q=H):(a(q,H),H=xd(X,q.mode,le),H.return=q,q=H),E(q)):a(q,H)}return nt}var qo=Cp(!0),Ep=Cp(!1),za=hr(null),Wa=null,Ko=null,Pc=null;function Rc(){Pc=Ko=Wa=null}function Dc(r){var o=za.current;Ye(za),r._currentValue=o}function Tc(r,o,a){for(;r!==null;){var d=r.alternate;if((r.childLanes&o)!==o?(r.childLanes|=o,d!==null&&(d.childLanes|=o)):d!==null&&(d.childLanes&o)!==o&&(d.childLanes|=o),r===a)break;r=r.return}}function Go(r,o){Wa=r,Pc=Ko=null,r=r.dependencies,r!==null&&r.firstContext!==null&&((r.lanes&o)!==0&&(Dt=!0),r.firstContext=null)}function Jt(r){var o=r._currentValue;if(Pc!==r)if(r={context:r,memoizedValue:o,next:null},Ko===null){if(Wa===null)throw Error(n(308));Ko=r,Wa.dependencies={lanes:0,firstContext:r}}else Ko=Ko.next=r;return o}var Qr=null;function Oc(r){Qr===null?Qr=[r]:Qr.push(r)}function Np(r,o,a,d){var y=o.interleaved;return y===null?(a.next=a,Oc(o)):(a.next=y.next,y.next=a),o.interleaved=a,Vn(r,d)}function Vn(r,o){r.lanes|=o;var a=r.alternate;for(a!==null&&(a.lanes|=o),a=r,r=r.return;r!==null;)r.childLanes|=o,a=r.alternate,a!==null&&(a.childLanes|=o),a=r,r=r.return;return a.tag===3?a.stateNode:null}var gr=!1;function Ic(r){r.updateQueue={baseState:r.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function bp(r,o){r=r.updateQueue,o.updateQueue===r&&(o.updateQueue={baseState:r.baseState,firstBaseUpdate:r.firstBaseUpdate,lastBaseUpdate:r.lastBaseUpdate,shared:r.shared,effects:r.effects})}function Yn(r,o){return{eventTime:r,lane:o,tag:0,payload:null,callback:null,next:null}}function yr(r,o,a){var d=r.updateQueue;if(d===null)return null;if(d=d.shared,(Le&2)!==0){var y=d.pending;return y===null?o.next=o:(o.next=y.next,y.next=o),d.pending=o,Vn(r,a)}return y=d.interleaved,y===null?(o.next=o,Oc(d)):(o.next=y.next,y.next=o),d.interleaved=o,Vn(r,a)}function $a(r,o,a){if(o=o.updateQueue,o!==null&&(o=o.shared,(a&4194240)!==0)){var d=o.lanes;d&=r.pendingLanes,a|=d,o.lanes=a,qu(r,a)}}function Mp(r,o){var a=r.updateQueue,d=r.alternate;if(d!==null&&(d=d.updateQueue,a===d)){var y=null,v=null;if(a=a.firstBaseUpdate,a!==null){do{var E={eventTime:a.eventTime,lane:a.lane,tag:a.tag,payload:a.payload,callback:a.callback,next:null};v===null?y=v=E:v=v.next=E,a=a.next}while(a!==null);v===null?y=v=o:v=v.next=o}else y=v=o;a={baseState:d.baseState,firstBaseUpdate:y,lastBaseUpdate:v,shared:d.shared,effects:d.effects},r.updateQueue=a;return}r=a.lastBaseUpdate,r===null?a.firstBaseUpdate=o:r.next=o,a.lastBaseUpdate=o}function Ba(r,o,a,d){var y=r.updateQueue;gr=!1;var v=y.firstBaseUpdate,E=y.lastBaseUpdate,j=y.shared.pending;if(j!==null){y.shared.pending=null;var z=j,Z=z.next;z.next=null,E===null?v=Z:E.next=Z,E=z;var oe=r.alternate;oe!==null&&(oe=oe.updateQueue,j=oe.lastBaseUpdate,j!==E&&(j===null?oe.firstBaseUpdate=Z:j.next=Z,oe.lastBaseUpdate=z))}if(v!==null){var se=y.baseState;E=0,oe=Z=z=null,j=v;do{var re=j.lane,fe=j.eventTime;if((d&re)===re){oe!==null&&(oe=oe.next={eventTime:fe,lane:0,tag:j.tag,payload:j.payload,callback:j.callback,next:null});e:{var pe=r,me=j;switch(re=o,fe=a,me.tag){case 1:if(pe=me.payload,typeof pe=="function"){se=pe.call(fe,se,re);break e}se=pe;break e;case 3:pe.flags=pe.flags&-65537|128;case 0:if(pe=me.payload,re=typeof pe=="function"?pe.call(fe,se,re):pe,re==null)break e;se=U({},se,re);break e;case 2:gr=!0}}j.callback!==null&&j.lane!==0&&(r.flags|=64,re=y.effects,re===null?y.effects=[j]:re.push(j))}else fe={eventTime:fe,lane:re,tag:j.tag,payload:j.payload,callback:j.callback,next:null},oe===null?(Z=oe=fe,z=se):oe=oe.next=fe,E|=re;if(j=j.next,j===null){if(j=y.shared.pending,j===null)break;re=j,j=re.next,re.next=null,y.lastBaseUpdate=re,y.shared.pending=null}}while(!0);if(oe===null&&(z=se),y.baseState=z,y.firstBaseUpdate=Z,y.lastBaseUpdate=oe,o=y.shared.interleaved,o!==null){y=o;do E|=y.lane,y=y.next;while(y!==o)}else v===null&&(y.shared.lanes=0);Gr|=E,r.lanes=E,r.memoizedState=se}}function Pp(r,o,a){if(r=o.effects,o.effects=null,r!==null)for(o=0;o<r.length;o++){var d=r[o],y=d.callback;if(y!==null){if(d.callback=null,d=a,typeof y!="function")throw Error(n(191,y));y.call(d)}}}var ei={},Nn=hr(ei),ti=hr(ei),ni=hr(ei);function qr(r){if(r===ei)throw Error(n(174));return r}function jc(r,o){switch(He(ni,o),He(ti,r),He(Nn,ei),r=o.nodeType,r){case 9:case 11:o=(o=o.documentElement)?o.namespaceURI:ln(null,"");break;default:r=r===8?o.parentNode:o,o=r.namespaceURI||null,r=r.tagName,o=ln(o,r)}Ye(Nn),He(Nn,o)}function Xo(){Ye(Nn),Ye(ti),Ye(ni)}function Rp(r){qr(ni.current);var o=qr(Nn.current),a=ln(o,r.type);o!==a&&(He(ti,r),He(Nn,a))}function Lc(r){ti.current===r&&(Ye(Nn),Ye(ti))}var Ze=hr(0);function Ha(r){for(var o=r;o!==null;){if(o.tag===13){var a=o.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||a.data==="$?"||a.data==="$!"))return o}else if(o.tag===19&&o.memoizedProps.revealOrder!==void 0){if((o.flags&128)!==0)return o}else if(o.child!==null){o.child.return=o,o=o.child;continue}if(o===r)break;for(;o.sibling===null;){if(o.return===null||o.return===r)return null;o=o.return}o.sibling.return=o.return,o=o.sibling}return null}var Fc=[];function Ac(){for(var r=0;r<Fc.length;r++)Fc[r]._workInProgressVersionPrimary=null;Fc.length=0}var Va=b.ReactCurrentDispatcher,zc=b.ReactCurrentBatchConfig,Kr=0,Je=null,lt=null,dt=null,Ya=!1,ri=!1,oi=0,s1=0;function wt(){throw Error(n(321))}function Wc(r,o){if(o===null)return!1;for(var a=0;a<o.length&&a<r.length;a++)if(!cn(r[a],o[a]))return!1;return!0}function $c(r,o,a,d,y,v){if(Kr=v,Je=o,o.memoizedState=null,o.updateQueue=null,o.lanes=0,Va.current=r===null||r.memoizedState===null?u1:c1,r=a(d,y),ri){v=0;do{if(ri=!1,oi=0,25<=v)throw Error(n(301));v+=1,dt=lt=null,o.updateQueue=null,Va.current=d1,r=a(d,y)}while(ri)}if(Va.current=qa,o=lt!==null&&lt.next!==null,Kr=0,dt=lt=Je=null,Ya=!1,o)throw Error(n(300));return r}function Bc(){var r=oi!==0;return oi=0,r}function bn(){var r={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return dt===null?Je.memoizedState=dt=r:dt=dt.next=r,dt}function en(){if(lt===null){var r=Je.alternate;r=r!==null?r.memoizedState:null}else r=lt.next;var o=dt===null?Je.memoizedState:dt.next;if(o!==null)dt=o,lt=r;else{if(r===null)throw Error(n(310));lt=r,r={memoizedState:lt.memoizedState,baseState:lt.baseState,baseQueue:lt.baseQueue,queue:lt.queue,next:null},dt===null?Je.memoizedState=dt=r:dt=dt.next=r}return dt}function si(r,o){return typeof o=="function"?o(r):o}function Hc(r){var o=en(),a=o.queue;if(a===null)throw Error(n(311));a.lastRenderedReducer=r;var d=lt,y=d.baseQueue,v=a.pending;if(v!==null){if(y!==null){var E=y.next;y.next=v.next,v.next=E}d.baseQueue=y=v,a.pending=null}if(y!==null){v=y.next,d=d.baseState;var j=E=null,z=null,Z=v;do{var oe=Z.lane;if((Kr&oe)===oe)z!==null&&(z=z.next={lane:0,action:Z.action,hasEagerState:Z.hasEagerState,eagerState:Z.eagerState,next:null}),d=Z.hasEagerState?Z.eagerState:r(d,Z.action);else{var se={lane:oe,action:Z.action,hasEagerState:Z.hasEagerState,eagerState:Z.eagerState,next:null};z===null?(j=z=se,E=d):z=z.next=se,Je.lanes|=oe,Gr|=oe}Z=Z.next}while(Z!==null&&Z!==v);z===null?E=d:z.next=j,cn(d,o.memoizedState)||(Dt=!0),o.memoizedState=d,o.baseState=E,o.baseQueue=z,a.lastRenderedState=d}if(r=a.interleaved,r!==null){y=r;do v=y.lane,Je.lanes|=v,Gr|=v,y=y.next;while(y!==r)}else y===null&&(a.lanes=0);return[o.memoizedState,a.dispatch]}function Vc(r){var o=en(),a=o.queue;if(a===null)throw Error(n(311));a.lastRenderedReducer=r;var d=a.dispatch,y=a.pending,v=o.memoizedState;if(y!==null){a.pending=null;var E=y=y.next;do v=r(v,E.action),E=E.next;while(E!==y);cn(v,o.memoizedState)||(Dt=!0),o.memoizedState=v,o.baseQueue===null&&(o.baseState=v),a.lastRenderedState=v}return[v,d]}function Dp(){}function Tp(r,o){var a=Je,d=en(),y=o(),v=!cn(d.memoizedState,y);if(v&&(d.memoizedState=y,Dt=!0),d=d.queue,Yc(jp.bind(null,a,d,r),[r]),d.getSnapshot!==o||v||dt!==null&&dt.memoizedState.tag&1){if(a.flags|=2048,ii(9,Ip.bind(null,a,d,y,o),void 0,null),ft===null)throw Error(n(349));(Kr&30)!==0||Op(a,o,y)}return y}function Op(r,o,a){r.flags|=16384,r={getSnapshot:o,value:a},o=Je.updateQueue,o===null?(o={lastEffect:null,stores:null},Je.updateQueue=o,o.stores=[r]):(a=o.stores,a===null?o.stores=[r]:a.push(r))}function Ip(r,o,a,d){o.value=a,o.getSnapshot=d,Lp(o)&&Fp(r)}function jp(r,o,a){return a(function(){Lp(o)&&Fp(r)})}function Lp(r){var o=r.getSnapshot;r=r.value;try{var a=o();return!cn(r,a)}catch{return!0}}function Fp(r){var o=Vn(r,1);o!==null&&mn(o,r,1,-1)}function Ap(r){var o=bn();return typeof r=="function"&&(r=r()),o.memoizedState=o.baseState=r,r={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:si,lastRenderedState:r},o.queue=r,r=r.dispatch=l1.bind(null,Je,r),[o.memoizedState,r]}function ii(r,o,a,d){return r={tag:r,create:o,destroy:a,deps:d,next:null},o=Je.updateQueue,o===null?(o={lastEffect:null,stores:null},Je.updateQueue=o,o.lastEffect=r.next=r):(a=o.lastEffect,a===null?o.lastEffect=r.next=r:(d=a.next,a.next=r,r.next=d,o.lastEffect=r)),r}function zp(){return en().memoizedState}function Ua(r,o,a,d){var y=bn();Je.flags|=r,y.memoizedState=ii(1|o,a,void 0,d===void 0?null:d)}function Qa(r,o,a,d){var y=en();d=d===void 0?null:d;var v=void 0;if(lt!==null){var E=lt.memoizedState;if(v=E.destroy,d!==null&&Wc(d,E.deps)){y.memoizedState=ii(o,a,v,d);return}}Je.flags|=r,y.memoizedState=ii(1|o,a,v,d)}function Wp(r,o){return Ua(8390656,8,r,o)}function Yc(r,o){return Qa(2048,8,r,o)}function $p(r,o){return Qa(4,2,r,o)}function Bp(r,o){return Qa(4,4,r,o)}function Hp(r,o){if(typeof o=="function")return r=r(),o(r),function(){o(null)};if(o!=null)return r=r(),o.current=r,function(){o.current=null}}function Vp(r,o,a){return a=a!=null?a.concat([r]):null,Qa(4,4,Hp.bind(null,o,r),a)}function Uc(){}function Yp(r,o){var a=en();o=o===void 0?null:o;var d=a.memoizedState;return d!==null&&o!==null&&Wc(o,d[1])?d[0]:(a.memoizedState=[r,o],r)}function Up(r,o){var a=en();o=o===void 0?null:o;var d=a.memoizedState;return d!==null&&o!==null&&Wc(o,d[1])?d[0]:(r=r(),a.memoizedState=[r,o],r)}function Qp(r,o,a){return(Kr&21)===0?(r.baseState&&(r.baseState=!1,Dt=!0),r.memoizedState=a):(cn(a,o)||(a=Io(),Je.lanes|=a,Gr|=a,r.baseState=!0),o)}function i1(r,o){var a=ze;ze=a!==0&&4>a?a:4,r(!0);var d=zc.transition;zc.transition={};try{r(!1),o()}finally{ze=a,zc.transition=d}}function qp(){return en().memoizedState}function a1(r,o,a){var d=Sr(r);if(a={lane:d,action:a,hasEagerState:!1,eagerState:null,next:null},Kp(r))Gp(o,a);else if(a=Np(r,o,a,d),a!==null){var y=Nt();mn(a,r,d,y),Xp(a,o,d)}}function l1(r,o,a){var d=Sr(r),y={lane:d,action:a,hasEagerState:!1,eagerState:null,next:null};if(Kp(r))Gp(o,y);else{var v=r.alternate;if(r.lanes===0&&(v===null||v.lanes===0)&&(v=o.lastRenderedReducer,v!==null))try{var E=o.lastRenderedState,j=v(E,a);if(y.hasEagerState=!0,y.eagerState=j,cn(j,E)){var z=o.interleaved;z===null?(y.next=y,Oc(o)):(y.next=z.next,z.next=y),o.interleaved=y;return}}catch{}a=Np(r,o,y,d),a!==null&&(y=Nt(),mn(a,r,d,y),Xp(a,o,d))}}function Kp(r){var o=r.alternate;return r===Je||o!==null&&o===Je}function Gp(r,o){ri=Ya=!0;var a=r.pending;a===null?o.next=o:(o.next=a.next,a.next=o),r.pending=o}function Xp(r,o,a){if((a&4194240)!==0){var d=o.lanes;d&=r.pendingLanes,a|=d,o.lanes=a,qu(r,a)}}var qa={readContext:Jt,useCallback:wt,useContext:wt,useEffect:wt,useImperativeHandle:wt,useInsertionEffect:wt,useLayoutEffect:wt,useMemo:wt,useReducer:wt,useRef:wt,useState:wt,useDebugValue:wt,useDeferredValue:wt,useTransition:wt,useMutableSource:wt,useSyncExternalStore:wt,useId:wt,unstable_isNewReconciler:!1},u1={readContext:Jt,useCallback:function(r,o){return bn().memoizedState=[r,o===void 0?null:o],r},useContext:Jt,useEffect:Wp,useImperativeHandle:function(r,o,a){return a=a!=null?a.concat([r]):null,Ua(4194308,4,Hp.bind(null,o,r),a)},useLayoutEffect:function(r,o){return Ua(4194308,4,r,o)},useInsertionEffect:function(r,o){return Ua(4,2,r,o)},useMemo:function(r,o){var a=bn();return o=o===void 0?null:o,r=r(),a.memoizedState=[r,o],r},useReducer:function(r,o,a){var d=bn();return o=a!==void 0?a(o):o,d.memoizedState=d.baseState=o,r={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:r,lastRenderedState:o},d.queue=r,r=r.dispatch=a1.bind(null,Je,r),[d.memoizedState,r]},useRef:function(r){var o=bn();return r={current:r},o.memoizedState=r},useState:Ap,useDebugValue:Uc,useDeferredValue:function(r){return bn().memoizedState=r},useTransition:function(){var r=Ap(!1),o=r[0];return r=i1.bind(null,r[1]),bn().memoizedState=r,[o,r]},useMutableSource:function(){},useSyncExternalStore:function(r,o,a){var d=Je,y=bn();if(Qe){if(a===void 0)throw Error(n(407));a=a()}else{if(a=o(),ft===null)throw Error(n(349));(Kr&30)!==0||Op(d,o,a)}y.memoizedState=a;var v={value:a,getSnapshot:o};return y.queue=v,Wp(jp.bind(null,d,v,r),[r]),d.flags|=2048,ii(9,Ip.bind(null,d,v,a,o),void 0,null),a},useId:function(){var r=bn(),o=ft.identifierPrefix;if(Qe){var a=Hn,d=Bn;a=(d&~(1<<32-At(d)-1)).toString(32)+a,o=":"+o+"R"+a,a=oi++,0<a&&(o+="H"+a.toString(32)),o+=":"}else a=s1++,o=":"+o+"r"+a.toString(32)+":";return r.memoizedState=o},unstable_isNewReconciler:!1},c1={readContext:Jt,useCallback:Yp,useContext:Jt,useEffect:Yc,useImperativeHandle:Vp,useInsertionEffect:$p,useLayoutEffect:Bp,useMemo:Up,useReducer:Hc,useRef:zp,useState:function(){return Hc(si)},useDebugValue:Uc,useDeferredValue:function(r){var o=en();return Qp(o,lt.memoizedState,r)},useTransition:function(){var r=Hc(si)[0],o=en().memoizedState;return[r,o]},useMutableSource:Dp,useSyncExternalStore:Tp,useId:qp,unstable_isNewReconciler:!1},d1={readContext:Jt,useCallback:Yp,useContext:Jt,useEffect:Yc,useImperativeHandle:Vp,useInsertionEffect:$p,useLayoutEffect:Bp,useMemo:Up,useReducer:Vc,useRef:zp,useState:function(){return Vc(si)},useDebugValue:Uc,useDeferredValue:function(r){var o=en();return lt===null?o.memoizedState=r:Qp(o,lt.memoizedState,r)},useTransition:function(){var r=Vc(si)[0],o=en().memoizedState;return[r,o]},useMutableSource:Dp,useSyncExternalStore:Tp,useId:qp,unstable_isNewReconciler:!1};function fn(r,o){if(r&&r.defaultProps){o=U({},o),r=r.defaultProps;for(var a in r)o[a]===void 0&&(o[a]=r[a]);return o}return o}function Qc(r,o,a,d){o=r.memoizedState,a=a(d,o),a=a==null?o:U({},o,a),r.memoizedState=a,r.lanes===0&&(r.updateQueue.baseState=a)}var Ka={isMounted:function(r){return(r=r._reactInternals)?Cn(r)===r:!1},enqueueSetState:function(r,o,a){r=r._reactInternals;var d=Nt(),y=Sr(r),v=Yn(d,y);v.payload=o,a!=null&&(v.callback=a),o=yr(r,v,y),o!==null&&(mn(o,r,y,d),$a(o,r,y))},enqueueReplaceState:function(r,o,a){r=r._reactInternals;var d=Nt(),y=Sr(r),v=Yn(d,y);v.tag=1,v.payload=o,a!=null&&(v.callback=a),o=yr(r,v,y),o!==null&&(mn(o,r,y,d),$a(o,r,y))},enqueueForceUpdate:function(r,o){r=r._reactInternals;var a=Nt(),d=Sr(r),y=Yn(a,d);y.tag=2,o!=null&&(y.callback=o),o=yr(r,y,d),o!==null&&(mn(o,r,d,a),$a(o,r,d))}};function Zp(r,o,a,d,y,v,E){return r=r.stateNode,typeof r.shouldComponentUpdate=="function"?r.shouldComponentUpdate(d,v,E):o.prototype&&o.prototype.isPureReactComponent?!Us(a,d)||!Us(y,v):!0}function Jp(r,o,a){var d=!1,y=pr,v=o.contextType;return typeof v=="object"&&v!==null?v=Jt(v):(y=Rt(o)?Vr:xt.current,d=o.contextTypes,v=(d=d!=null)?Vo(r,y):pr),o=new o(a,v),r.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,o.updater=Ka,r.stateNode=o,o._reactInternals=r,d&&(r=r.stateNode,r.__reactInternalMemoizedUnmaskedChildContext=y,r.__reactInternalMemoizedMaskedChildContext=v),o}function em(r,o,a,d){r=o.state,typeof o.componentWillReceiveProps=="function"&&o.componentWillReceiveProps(a,d),typeof o.UNSAFE_componentWillReceiveProps=="function"&&o.UNSAFE_componentWillReceiveProps(a,d),o.state!==r&&Ka.enqueueReplaceState(o,o.state,null)}function qc(r,o,a,d){var y=r.stateNode;y.props=a,y.state=r.memoizedState,y.refs={},Ic(r);var v=o.contextType;typeof v=="object"&&v!==null?y.context=Jt(v):(v=Rt(o)?Vr:xt.current,y.context=Vo(r,v)),y.state=r.memoizedState,v=o.getDerivedStateFromProps,typeof v=="function"&&(Qc(r,o,v,a),y.state=r.memoizedState),typeof o.getDerivedStateFromProps=="function"||typeof y.getSnapshotBeforeUpdate=="function"||typeof y.UNSAFE_componentWillMount!="function"&&typeof y.componentWillMount!="function"||(o=y.state,typeof y.componentWillMount=="function"&&y.componentWillMount(),typeof y.UNSAFE_componentWillMount=="function"&&y.UNSAFE_componentWillMount(),o!==y.state&&Ka.enqueueReplaceState(y,y.state,null),Ba(r,a,y,d),y.state=r.memoizedState),typeof y.componentDidMount=="function"&&(r.flags|=4194308)}function Zo(r,o){try{var a="",d=o;do a+=ie(d),d=d.return;while(d);var y=a}catch(v){y=`
7
+ Error generating stack: `+v.message+`
8
+ `+v.stack}return{value:r,source:o,stack:y,digest:null}}function Kc(r,o,a){return{value:r,source:null,stack:a??null,digest:o??null}}function Gc(r,o){try{console.error(o.value)}catch(a){setTimeout(function(){throw a})}}var f1=typeof WeakMap=="function"?WeakMap:Map;function tm(r,o,a){a=Yn(-1,a),a.tag=3,a.payload={element:null};var d=o.value;return a.callback=function(){nl||(nl=!0,dd=d),Gc(r,o)},a}function nm(r,o,a){a=Yn(-1,a),a.tag=3;var d=r.type.getDerivedStateFromError;if(typeof d=="function"){var y=o.value;a.payload=function(){return d(y)},a.callback=function(){Gc(r,o)}}var v=r.stateNode;return v!==null&&typeof v.componentDidCatch=="function"&&(a.callback=function(){Gc(r,o),typeof d!="function"&&(xr===null?xr=new Set([this]):xr.add(this));var E=o.stack;this.componentDidCatch(o.value,{componentStack:E!==null?E:""})}),a}function rm(r,o,a){var d=r.pingCache;if(d===null){d=r.pingCache=new f1;var y=new Set;d.set(o,y)}else y=d.get(o),y===void 0&&(y=new Set,d.set(o,y));y.has(a)||(y.add(a),r=N1.bind(null,r,o,a),o.then(r,r))}function om(r){do{var o;if((o=r.tag===13)&&(o=r.memoizedState,o=o!==null?o.dehydrated!==null:!0),o)return r;r=r.return}while(r!==null);return null}function sm(r,o,a,d,y){return(r.mode&1)===0?(r===o?r.flags|=65536:(r.flags|=128,a.flags|=131072,a.flags&=-52805,a.tag===1&&(a.alternate===null?a.tag=17:(o=Yn(-1,1),o.tag=2,yr(a,o,1))),a.lanes|=1),r):(r.flags|=65536,r.lanes=y,r)}var h1=b.ReactCurrentOwner,Dt=!1;function Et(r,o,a,d){o.child=r===null?Ep(o,null,a,d):qo(o,r.child,a,d)}function im(r,o,a,d,y){a=a.render;var v=o.ref;return Go(o,y),d=$c(r,o,a,d,v,y),a=Bc(),r!==null&&!Dt?(o.updateQueue=r.updateQueue,o.flags&=-2053,r.lanes&=~y,Un(r,o,y)):(Qe&&a&&Cc(o),o.flags|=1,Et(r,o,d,y),o.child)}function am(r,o,a,d,y){if(r===null){var v=a.type;return typeof v=="function"&&!vd(v)&&v.defaultProps===void 0&&a.compare===null&&a.defaultProps===void 0?(o.tag=15,o.type=v,lm(r,o,v,d,y)):(r=ll(a.type,null,d,o,o.mode,y),r.ref=o.ref,r.return=o,o.child=r)}if(v=r.child,(r.lanes&y)===0){var E=v.memoizedProps;if(a=a.compare,a=a!==null?a:Us,a(E,d)&&r.ref===o.ref)return Un(r,o,y)}return o.flags|=1,r=_r(v,d),r.ref=o.ref,r.return=o,o.child=r}function lm(r,o,a,d,y){if(r!==null){var v=r.memoizedProps;if(Us(v,d)&&r.ref===o.ref)if(Dt=!1,o.pendingProps=d=v,(r.lanes&y)!==0)(r.flags&131072)!==0&&(Dt=!0);else return o.lanes=r.lanes,Un(r,o,y)}return Xc(r,o,a,d,y)}function um(r,o,a){var d=o.pendingProps,y=d.children,v=r!==null?r.memoizedState:null;if(d.mode==="hidden")if((o.mode&1)===0)o.memoizedState={baseLanes:0,cachePool:null,transitions:null},He(es,Bt),Bt|=a;else{if((a&1073741824)===0)return r=v!==null?v.baseLanes|a:a,o.lanes=o.childLanes=1073741824,o.memoizedState={baseLanes:r,cachePool:null,transitions:null},o.updateQueue=null,He(es,Bt),Bt|=r,null;o.memoizedState={baseLanes:0,cachePool:null,transitions:null},d=v!==null?v.baseLanes:a,He(es,Bt),Bt|=d}else v!==null?(d=v.baseLanes|a,o.memoizedState=null):d=a,He(es,Bt),Bt|=d;return Et(r,o,y,a),o.child}function cm(r,o){var a=o.ref;(r===null&&a!==null||r!==null&&r.ref!==a)&&(o.flags|=512,o.flags|=2097152)}function Xc(r,o,a,d,y){var v=Rt(a)?Vr:xt.current;return v=Vo(o,v),Go(o,y),a=$c(r,o,a,d,v,y),d=Bc(),r!==null&&!Dt?(o.updateQueue=r.updateQueue,o.flags&=-2053,r.lanes&=~y,Un(r,o,y)):(Qe&&d&&Cc(o),o.flags|=1,Et(r,o,a,y),o.child)}function dm(r,o,a,d,y){if(Rt(a)){var v=!0;Oa(o)}else v=!1;if(Go(o,y),o.stateNode===null)Xa(r,o),Jp(o,a,d),qc(o,a,d,y),d=!0;else if(r===null){var E=o.stateNode,j=o.memoizedProps;E.props=j;var z=E.context,Z=a.contextType;typeof Z=="object"&&Z!==null?Z=Jt(Z):(Z=Rt(a)?Vr:xt.current,Z=Vo(o,Z));var oe=a.getDerivedStateFromProps,se=typeof oe=="function"||typeof E.getSnapshotBeforeUpdate=="function";se||typeof E.UNSAFE_componentWillReceiveProps!="function"&&typeof E.componentWillReceiveProps!="function"||(j!==d||z!==Z)&&em(o,E,d,Z),gr=!1;var re=o.memoizedState;E.state=re,Ba(o,d,E,y),z=o.memoizedState,j!==d||re!==z||Pt.current||gr?(typeof oe=="function"&&(Qc(o,a,oe,d),z=o.memoizedState),(j=gr||Zp(o,a,j,d,re,z,Z))?(se||typeof E.UNSAFE_componentWillMount!="function"&&typeof E.componentWillMount!="function"||(typeof E.componentWillMount=="function"&&E.componentWillMount(),typeof E.UNSAFE_componentWillMount=="function"&&E.UNSAFE_componentWillMount()),typeof E.componentDidMount=="function"&&(o.flags|=4194308)):(typeof E.componentDidMount=="function"&&(o.flags|=4194308),o.memoizedProps=d,o.memoizedState=z),E.props=d,E.state=z,E.context=Z,d=j):(typeof E.componentDidMount=="function"&&(o.flags|=4194308),d=!1)}else{E=o.stateNode,bp(r,o),j=o.memoizedProps,Z=o.type===o.elementType?j:fn(o.type,j),E.props=Z,se=o.pendingProps,re=E.context,z=a.contextType,typeof z=="object"&&z!==null?z=Jt(z):(z=Rt(a)?Vr:xt.current,z=Vo(o,z));var fe=a.getDerivedStateFromProps;(oe=typeof fe=="function"||typeof E.getSnapshotBeforeUpdate=="function")||typeof E.UNSAFE_componentWillReceiveProps!="function"&&typeof E.componentWillReceiveProps!="function"||(j!==se||re!==z)&&em(o,E,d,z),gr=!1,re=o.memoizedState,E.state=re,Ba(o,d,E,y);var pe=o.memoizedState;j!==se||re!==pe||Pt.current||gr?(typeof fe=="function"&&(Qc(o,a,fe,d),pe=o.memoizedState),(Z=gr||Zp(o,a,Z,d,re,pe,z)||!1)?(oe||typeof E.UNSAFE_componentWillUpdate!="function"&&typeof E.componentWillUpdate!="function"||(typeof E.componentWillUpdate=="function"&&E.componentWillUpdate(d,pe,z),typeof E.UNSAFE_componentWillUpdate=="function"&&E.UNSAFE_componentWillUpdate(d,pe,z)),typeof E.componentDidUpdate=="function"&&(o.flags|=4),typeof E.getSnapshotBeforeUpdate=="function"&&(o.flags|=1024)):(typeof E.componentDidUpdate!="function"||j===r.memoizedProps&&re===r.memoizedState||(o.flags|=4),typeof E.getSnapshotBeforeUpdate!="function"||j===r.memoizedProps&&re===r.memoizedState||(o.flags|=1024),o.memoizedProps=d,o.memoizedState=pe),E.props=d,E.state=pe,E.context=z,d=Z):(typeof E.componentDidUpdate!="function"||j===r.memoizedProps&&re===r.memoizedState||(o.flags|=4),typeof E.getSnapshotBeforeUpdate!="function"||j===r.memoizedProps&&re===r.memoizedState||(o.flags|=1024),d=!1)}return Zc(r,o,a,d,v,y)}function Zc(r,o,a,d,y,v){cm(r,o);var E=(o.flags&128)!==0;if(!d&&!E)return y&&gp(o,a,!1),Un(r,o,v);d=o.stateNode,h1.current=o;var j=E&&typeof a.getDerivedStateFromError!="function"?null:d.render();return o.flags|=1,r!==null&&E?(o.child=qo(o,r.child,null,v),o.child=qo(o,null,j,v)):Et(r,o,j,v),o.memoizedState=d.state,y&&gp(o,a,!0),o.child}function fm(r){var o=r.stateNode;o.pendingContext?pp(r,o.pendingContext,o.pendingContext!==o.context):o.context&&pp(r,o.context,!1),jc(r,o.containerInfo)}function hm(r,o,a,d,y){return Qo(),Mc(y),o.flags|=256,Et(r,o,a,d),o.child}var Jc={dehydrated:null,treeContext:null,retryLane:0};function ed(r){return{baseLanes:r,cachePool:null,transitions:null}}function pm(r,o,a){var d=o.pendingProps,y=Ze.current,v=!1,E=(o.flags&128)!==0,j;if((j=E)||(j=r!==null&&r.memoizedState===null?!1:(y&2)!==0),j?(v=!0,o.flags&=-129):(r===null||r.memoizedState!==null)&&(y|=1),He(Ze,y&1),r===null)return bc(o),r=o.memoizedState,r!==null&&(r=r.dehydrated,r!==null)?((o.mode&1)===0?o.lanes=1:r.data==="$!"?o.lanes=8:o.lanes=1073741824,null):(E=d.children,r=d.fallback,v?(d=o.mode,v=o.child,E={mode:"hidden",children:E},(d&1)===0&&v!==null?(v.childLanes=0,v.pendingProps=E):v=ul(E,d,0,null),r=eo(r,d,a,null),v.return=o,r.return=o,v.sibling=r,o.child=v,o.child.memoizedState=ed(a),o.memoizedState=Jc,r):td(o,E));if(y=r.memoizedState,y!==null&&(j=y.dehydrated,j!==null))return p1(r,o,E,d,j,y,a);if(v){v=d.fallback,E=o.mode,y=r.child,j=y.sibling;var z={mode:"hidden",children:d.children};return(E&1)===0&&o.child!==y?(d=o.child,d.childLanes=0,d.pendingProps=z,o.deletions=null):(d=_r(y,z),d.subtreeFlags=y.subtreeFlags&14680064),j!==null?v=_r(j,v):(v=eo(v,E,a,null),v.flags|=2),v.return=o,d.return=o,d.sibling=v,o.child=d,d=v,v=o.child,E=r.child.memoizedState,E=E===null?ed(a):{baseLanes:E.baseLanes|a,cachePool:null,transitions:E.transitions},v.memoizedState=E,v.childLanes=r.childLanes&~a,o.memoizedState=Jc,d}return v=r.child,r=v.sibling,d=_r(v,{mode:"visible",children:d.children}),(o.mode&1)===0&&(d.lanes=a),d.return=o,d.sibling=null,r!==null&&(a=o.deletions,a===null?(o.deletions=[r],o.flags|=16):a.push(r)),o.child=d,o.memoizedState=null,d}function td(r,o){return o=ul({mode:"visible",children:o},r.mode,0,null),o.return=r,r.child=o}function Ga(r,o,a,d){return d!==null&&Mc(d),qo(o,r.child,null,a),r=td(o,o.pendingProps.children),r.flags|=2,o.memoizedState=null,r}function p1(r,o,a,d,y,v,E){if(a)return o.flags&256?(o.flags&=-257,d=Kc(Error(n(422))),Ga(r,o,E,d)):o.memoizedState!==null?(o.child=r.child,o.flags|=128,null):(v=d.fallback,y=o.mode,d=ul({mode:"visible",children:d.children},y,0,null),v=eo(v,y,E,null),v.flags|=2,d.return=o,v.return=o,d.sibling=v,o.child=d,(o.mode&1)!==0&&qo(o,r.child,null,E),o.child.memoizedState=ed(E),o.memoizedState=Jc,v);if((o.mode&1)===0)return Ga(r,o,E,null);if(y.data==="$!"){if(d=y.nextSibling&&y.nextSibling.dataset,d)var j=d.dgst;return d=j,v=Error(n(419)),d=Kc(v,d,void 0),Ga(r,o,E,d)}if(j=(E&r.childLanes)!==0,Dt||j){if(d=ft,d!==null){switch(E&-E){case 4:y=2;break;case 16:y=8;break;case 64: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:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:y=32;break;case 536870912:y=268435456;break;default:y=0}y=(y&(d.suspendedLanes|E))!==0?0:y,y!==0&&y!==v.retryLane&&(v.retryLane=y,Vn(r,y),mn(d,r,y,-1))}return yd(),d=Kc(Error(n(421))),Ga(r,o,E,d)}return y.data==="$?"?(o.flags|=128,o.child=r.child,o=b1.bind(null,r),y._reactRetry=o,null):(r=v.treeContext,$t=fr(y.nextSibling),Wt=o,Qe=!0,dn=null,r!==null&&(Xt[Zt++]=Bn,Xt[Zt++]=Hn,Xt[Zt++]=Yr,Bn=r.id,Hn=r.overflow,Yr=o),o=td(o,d.children),o.flags|=4096,o)}function mm(r,o,a){r.lanes|=o;var d=r.alternate;d!==null&&(d.lanes|=o),Tc(r.return,o,a)}function nd(r,o,a,d,y){var v=r.memoizedState;v===null?r.memoizedState={isBackwards:o,rendering:null,renderingStartTime:0,last:d,tail:a,tailMode:y}:(v.isBackwards=o,v.rendering=null,v.renderingStartTime=0,v.last=d,v.tail=a,v.tailMode=y)}function gm(r,o,a){var d=o.pendingProps,y=d.revealOrder,v=d.tail;if(Et(r,o,d.children,a),d=Ze.current,(d&2)!==0)d=d&1|2,o.flags|=128;else{if(r!==null&&(r.flags&128)!==0)e:for(r=o.child;r!==null;){if(r.tag===13)r.memoizedState!==null&&mm(r,a,o);else if(r.tag===19)mm(r,a,o);else if(r.child!==null){r.child.return=r,r=r.child;continue}if(r===o)break e;for(;r.sibling===null;){if(r.return===null||r.return===o)break e;r=r.return}r.sibling.return=r.return,r=r.sibling}d&=1}if(He(Ze,d),(o.mode&1)===0)o.memoizedState=null;else switch(y){case"forwards":for(a=o.child,y=null;a!==null;)r=a.alternate,r!==null&&Ha(r)===null&&(y=a),a=a.sibling;a=y,a===null?(y=o.child,o.child=null):(y=a.sibling,a.sibling=null),nd(o,!1,y,a,v);break;case"backwards":for(a=null,y=o.child,o.child=null;y!==null;){if(r=y.alternate,r!==null&&Ha(r)===null){o.child=y;break}r=y.sibling,y.sibling=a,a=y,y=r}nd(o,!0,a,null,v);break;case"together":nd(o,!1,null,null,void 0);break;default:o.memoizedState=null}return o.child}function Xa(r,o){(o.mode&1)===0&&r!==null&&(r.alternate=null,o.alternate=null,o.flags|=2)}function Un(r,o,a){if(r!==null&&(o.dependencies=r.dependencies),Gr|=o.lanes,(a&o.childLanes)===0)return null;if(r!==null&&o.child!==r.child)throw Error(n(153));if(o.child!==null){for(r=o.child,a=_r(r,r.pendingProps),o.child=a,a.return=o;r.sibling!==null;)r=r.sibling,a=a.sibling=_r(r,r.pendingProps),a.return=o;a.sibling=null}return o.child}function m1(r,o,a){switch(o.tag){case 3:fm(o),Qo();break;case 5:Rp(o);break;case 1:Rt(o.type)&&Oa(o);break;case 4:jc(o,o.stateNode.containerInfo);break;case 10:var d=o.type._context,y=o.memoizedProps.value;He(za,d._currentValue),d._currentValue=y;break;case 13:if(d=o.memoizedState,d!==null)return d.dehydrated!==null?(He(Ze,Ze.current&1),o.flags|=128,null):(a&o.child.childLanes)!==0?pm(r,o,a):(He(Ze,Ze.current&1),r=Un(r,o,a),r!==null?r.sibling:null);He(Ze,Ze.current&1);break;case 19:if(d=(a&o.childLanes)!==0,(r.flags&128)!==0){if(d)return gm(r,o,a);o.flags|=128}if(y=o.memoizedState,y!==null&&(y.rendering=null,y.tail=null,y.lastEffect=null),He(Ze,Ze.current),d)break;return null;case 22:case 23:return o.lanes=0,um(r,o,a)}return Un(r,o,a)}var ym,rd,vm,xm;ym=function(r,o){for(var a=o.child;a!==null;){if(a.tag===5||a.tag===6)r.appendChild(a.stateNode);else if(a.tag!==4&&a.child!==null){a.child.return=a,a=a.child;continue}if(a===o)break;for(;a.sibling===null;){if(a.return===null||a.return===o)return;a=a.return}a.sibling.return=a.return,a=a.sibling}},rd=function(){},vm=function(r,o,a,d){var y=r.memoizedProps;if(y!==d){r=o.stateNode,qr(Nn.current);var v=null;switch(a){case"input":y=Te(r,y),d=Te(r,d),v=[];break;case"select":y=U({},y,{value:void 0}),d=U({},d,{value:void 0}),v=[];break;case"textarea":y=bt(r,y),d=bt(r,d),v=[];break;default:typeof y.onClick!="function"&&typeof d.onClick=="function"&&(r.onclick=Ra)}Lr(a,d);var E;a=null;for(Z in y)if(!d.hasOwnProperty(Z)&&y.hasOwnProperty(Z)&&y[Z]!=null)if(Z==="style"){var j=y[Z];for(E in j)j.hasOwnProperty(E)&&(a||(a={}),a[E]="")}else Z!=="dangerouslySetInnerHTML"&&Z!=="children"&&Z!=="suppressContentEditableWarning"&&Z!=="suppressHydrationWarning"&&Z!=="autoFocus"&&(i.hasOwnProperty(Z)?v||(v=[]):(v=v||[]).push(Z,null));for(Z in d){var z=d[Z];if(j=y?.[Z],d.hasOwnProperty(Z)&&z!==j&&(z!=null||j!=null))if(Z==="style")if(j){for(E in j)!j.hasOwnProperty(E)||z&&z.hasOwnProperty(E)||(a||(a={}),a[E]="");for(E in z)z.hasOwnProperty(E)&&j[E]!==z[E]&&(a||(a={}),a[E]=z[E])}else a||(v||(v=[]),v.push(Z,a)),a=z;else Z==="dangerouslySetInnerHTML"?(z=z?z.__html:void 0,j=j?j.__html:void 0,z!=null&&j!==z&&(v=v||[]).push(Z,z)):Z==="children"?typeof z!="string"&&typeof z!="number"||(v=v||[]).push(Z,""+z):Z!=="suppressContentEditableWarning"&&Z!=="suppressHydrationWarning"&&(i.hasOwnProperty(Z)?(z!=null&&Z==="onScroll"&&Ve("scroll",r),v||j===z||(v=[])):(v=v||[]).push(Z,z))}a&&(v=v||[]).push("style",a);var Z=v;(o.updateQueue=Z)&&(o.flags|=4)}},xm=function(r,o,a,d){a!==d&&(o.flags|=4)};function ai(r,o){if(!Qe)switch(r.tailMode){case"hidden":o=r.tail;for(var a=null;o!==null;)o.alternate!==null&&(a=o),o=o.sibling;a===null?r.tail=null:a.sibling=null;break;case"collapsed":a=r.tail;for(var d=null;a!==null;)a.alternate!==null&&(d=a),a=a.sibling;d===null?o||r.tail===null?r.tail=null:r.tail.sibling=null:d.sibling=null}}function St(r){var o=r.alternate!==null&&r.alternate.child===r.child,a=0,d=0;if(o)for(var y=r.child;y!==null;)a|=y.lanes|y.childLanes,d|=y.subtreeFlags&14680064,d|=y.flags&14680064,y.return=r,y=y.sibling;else for(y=r.child;y!==null;)a|=y.lanes|y.childLanes,d|=y.subtreeFlags,d|=y.flags,y.return=r,y=y.sibling;return r.subtreeFlags|=d,r.childLanes=a,o}function g1(r,o,a){var d=o.pendingProps;switch(Ec(o),o.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return St(o),null;case 1:return Rt(o.type)&&Ta(),St(o),null;case 3:return d=o.stateNode,Xo(),Ye(Pt),Ye(xt),Ac(),d.pendingContext&&(d.context=d.pendingContext,d.pendingContext=null),(r===null||r.child===null)&&(Fa(o)?o.flags|=4:r===null||r.memoizedState.isDehydrated&&(o.flags&256)===0||(o.flags|=1024,dn!==null&&(pd(dn),dn=null))),rd(r,o),St(o),null;case 5:Lc(o);var y=qr(ni.current);if(a=o.type,r!==null&&o.stateNode!=null)vm(r,o,a,d,y),r.ref!==o.ref&&(o.flags|=512,o.flags|=2097152);else{if(!d){if(o.stateNode===null)throw Error(n(166));return St(o),null}if(r=qr(Nn.current),Fa(o)){d=o.stateNode,a=o.type;var v=o.memoizedProps;switch(d[En]=o,d[Xs]=v,r=(o.mode&1)!==0,a){case"dialog":Ve("cancel",d),Ve("close",d);break;case"iframe":case"object":case"embed":Ve("load",d);break;case"video":case"audio":for(y=0;y<qs.length;y++)Ve(qs[y],d);break;case"source":Ve("error",d);break;case"img":case"image":case"link":Ve("error",d),Ve("load",d);break;case"details":Ve("toggle",d);break;case"input":je(d,v),Ve("invalid",d);break;case"select":d._wrapperState={wasMultiple:!!v.multiple},Ve("invalid",d);break;case"textarea":Re(d,v),Ve("invalid",d)}Lr(a,v),y=null;for(var E in v)if(v.hasOwnProperty(E)){var j=v[E];E==="children"?typeof j=="string"?d.textContent!==j&&(v.suppressHydrationWarning!==!0&&Pa(d.textContent,j,r),y=["children",j]):typeof j=="number"&&d.textContent!==""+j&&(v.suppressHydrationWarning!==!0&&Pa(d.textContent,j,r),y=["children",""+j]):i.hasOwnProperty(E)&&j!=null&&E==="onScroll"&&Ve("scroll",d)}switch(a){case"input":Ee(d),Ct(d,v,!0);break;case"textarea":Ee(d),Ge(d);break;case"select":case"option":break;default:typeof v.onClick=="function"&&(d.onclick=Ra)}d=y,o.updateQueue=d,d!==null&&(o.flags|=4)}else{E=y.nodeType===9?y:y.ownerDocument,r==="http://www.w3.org/1999/xhtml"&&(r=Mt(a)),r==="http://www.w3.org/1999/xhtml"?a==="script"?(r=E.createElement("div"),r.innerHTML="<script><\/script>",r=r.removeChild(r.firstChild)):typeof d.is=="string"?r=E.createElement(a,{is:d.is}):(r=E.createElement(a),a==="select"&&(E=r,d.multiple?E.multiple=!0:d.size&&(E.size=d.size))):r=E.createElementNS(r,a),r[En]=o,r[Xs]=d,ym(r,o,!1,!1),o.stateNode=r;e:{switch(E=rr(a,d),a){case"dialog":Ve("cancel",r),Ve("close",r),y=d;break;case"iframe":case"object":case"embed":Ve("load",r),y=d;break;case"video":case"audio":for(y=0;y<qs.length;y++)Ve(qs[y],r);y=d;break;case"source":Ve("error",r),y=d;break;case"img":case"image":case"link":Ve("error",r),Ve("load",r),y=d;break;case"details":Ve("toggle",r),y=d;break;case"input":je(r,d),y=Te(r,d),Ve("invalid",r);break;case"option":y=d;break;case"select":r._wrapperState={wasMultiple:!!d.multiple},y=U({},d,{value:void 0}),Ve("invalid",r);break;case"textarea":Re(r,d),y=bt(r,d),Ve("invalid",r);break;default:y=d}Lr(a,y),j=y;for(v in j)if(j.hasOwnProperty(v)){var z=j[v];v==="style"?Co(r,z):v==="dangerouslySetInnerHTML"?(z=z?z.__html:void 0,z!=null&&ko(r,z)):v==="children"?typeof z=="string"?(a!=="textarea"||z!=="")&&un(r,z):typeof z=="number"&&un(r,""+z):v!=="suppressContentEditableWarning"&&v!=="suppressHydrationWarning"&&v!=="autoFocus"&&(i.hasOwnProperty(v)?z!=null&&v==="onScroll"&&Ve("scroll",r):z!=null&&k(r,v,z,E))}switch(a){case"input":Ee(r),Ct(r,d,!1);break;case"textarea":Ee(r),Ge(r);break;case"option":d.value!=null&&r.setAttribute("value",""+ee(d.value));break;case"select":r.multiple=!!d.multiple,v=d.value,v!=null?mt(r,!!d.multiple,v,!1):d.defaultValue!=null&&mt(r,!!d.multiple,d.defaultValue,!0);break;default:typeof y.onClick=="function"&&(r.onclick=Ra)}switch(a){case"button":case"input":case"select":case"textarea":d=!!d.autoFocus;break e;case"img":d=!0;break e;default:d=!1}}d&&(o.flags|=4)}o.ref!==null&&(o.flags|=512,o.flags|=2097152)}return St(o),null;case 6:if(r&&o.stateNode!=null)xm(r,o,r.memoizedProps,d);else{if(typeof d!="string"&&o.stateNode===null)throw Error(n(166));if(a=qr(ni.current),qr(Nn.current),Fa(o)){if(d=o.stateNode,a=o.memoizedProps,d[En]=o,(v=d.nodeValue!==a)&&(r=Wt,r!==null))switch(r.tag){case 3:Pa(d.nodeValue,a,(r.mode&1)!==0);break;case 5:r.memoizedProps.suppressHydrationWarning!==!0&&Pa(d.nodeValue,a,(r.mode&1)!==0)}v&&(o.flags|=4)}else d=(a.nodeType===9?a:a.ownerDocument).createTextNode(d),d[En]=o,o.stateNode=d}return St(o),null;case 13:if(Ye(Ze),d=o.memoizedState,r===null||r.memoizedState!==null&&r.memoizedState.dehydrated!==null){if(Qe&&$t!==null&&(o.mode&1)!==0&&(o.flags&128)===0)kp(),Qo(),o.flags|=98560,v=!1;else if(v=Fa(o),d!==null&&d.dehydrated!==null){if(r===null){if(!v)throw Error(n(318));if(v=o.memoizedState,v=v!==null?v.dehydrated:null,!v)throw Error(n(317));v[En]=o}else Qo(),(o.flags&128)===0&&(o.memoizedState=null),o.flags|=4;St(o),v=!1}else dn!==null&&(pd(dn),dn=null),v=!0;if(!v)return o.flags&65536?o:null}return(o.flags&128)!==0?(o.lanes=a,o):(d=d!==null,d!==(r!==null&&r.memoizedState!==null)&&d&&(o.child.flags|=8192,(o.mode&1)!==0&&(r===null||(Ze.current&1)!==0?ut===0&&(ut=3):yd())),o.updateQueue!==null&&(o.flags|=4),St(o),null);case 4:return Xo(),rd(r,o),r===null&&Ks(o.stateNode.containerInfo),St(o),null;case 10:return Dc(o.type._context),St(o),null;case 17:return Rt(o.type)&&Ta(),St(o),null;case 19:if(Ye(Ze),v=o.memoizedState,v===null)return St(o),null;if(d=(o.flags&128)!==0,E=v.rendering,E===null)if(d)ai(v,!1);else{if(ut!==0||r!==null&&(r.flags&128)!==0)for(r=o.child;r!==null;){if(E=Ha(r),E!==null){for(o.flags|=128,ai(v,!1),d=E.updateQueue,d!==null&&(o.updateQueue=d,o.flags|=4),o.subtreeFlags=0,d=a,a=o.child;a!==null;)v=a,r=d,v.flags&=14680066,E=v.alternate,E===null?(v.childLanes=0,v.lanes=r,v.child=null,v.subtreeFlags=0,v.memoizedProps=null,v.memoizedState=null,v.updateQueue=null,v.dependencies=null,v.stateNode=null):(v.childLanes=E.childLanes,v.lanes=E.lanes,v.child=E.child,v.subtreeFlags=0,v.deletions=null,v.memoizedProps=E.memoizedProps,v.memoizedState=E.memoizedState,v.updateQueue=E.updateQueue,v.type=E.type,r=E.dependencies,v.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext}),a=a.sibling;return He(Ze,Ze.current&1|2),o.child}r=r.sibling}v.tail!==null&&Xe()>ts&&(o.flags|=128,d=!0,ai(v,!1),o.lanes=4194304)}else{if(!d)if(r=Ha(E),r!==null){if(o.flags|=128,d=!0,a=r.updateQueue,a!==null&&(o.updateQueue=a,o.flags|=4),ai(v,!0),v.tail===null&&v.tailMode==="hidden"&&!E.alternate&&!Qe)return St(o),null}else 2*Xe()-v.renderingStartTime>ts&&a!==1073741824&&(o.flags|=128,d=!0,ai(v,!1),o.lanes=4194304);v.isBackwards?(E.sibling=o.child,o.child=E):(a=v.last,a!==null?a.sibling=E:o.child=E,v.last=E)}return v.tail!==null?(o=v.tail,v.rendering=o,v.tail=o.sibling,v.renderingStartTime=Xe(),o.sibling=null,a=Ze.current,He(Ze,d?a&1|2:a&1),o):(St(o),null);case 22:case 23:return gd(),d=o.memoizedState!==null,r!==null&&r.memoizedState!==null!==d&&(o.flags|=8192),d&&(o.mode&1)!==0?(Bt&1073741824)!==0&&(St(o),o.subtreeFlags&6&&(o.flags|=8192)):St(o),null;case 24:return null;case 25:return null}throw Error(n(156,o.tag))}function y1(r,o){switch(Ec(o),o.tag){case 1:return Rt(o.type)&&Ta(),r=o.flags,r&65536?(o.flags=r&-65537|128,o):null;case 3:return Xo(),Ye(Pt),Ye(xt),Ac(),r=o.flags,(r&65536)!==0&&(r&128)===0?(o.flags=r&-65537|128,o):null;case 5:return Lc(o),null;case 13:if(Ye(Ze),r=o.memoizedState,r!==null&&r.dehydrated!==null){if(o.alternate===null)throw Error(n(340));Qo()}return r=o.flags,r&65536?(o.flags=r&-65537|128,o):null;case 19:return Ye(Ze),null;case 4:return Xo(),null;case 10:return Dc(o.type._context),null;case 22:case 23:return gd(),null;case 24:return null;default:return null}}var Za=!1,kt=!1,v1=typeof WeakSet=="function"?WeakSet:Set,he=null;function Jo(r,o){var a=r.ref;if(a!==null)if(typeof a=="function")try{a(null)}catch(d){tt(r,o,d)}else a.current=null}function od(r,o,a){try{a()}catch(d){tt(r,o,d)}}var wm=!1;function x1(r,o){if(gc=va,r=Zh(),lc(r)){if("selectionStart"in r)var a={start:r.selectionStart,end:r.selectionEnd};else e:{a=(a=r.ownerDocument)&&a.defaultView||window;var d=a.getSelection&&a.getSelection();if(d&&d.rangeCount!==0){a=d.anchorNode;var y=d.anchorOffset,v=d.focusNode;d=d.focusOffset;try{a.nodeType,v.nodeType}catch{a=null;break e}var E=0,j=-1,z=-1,Z=0,oe=0,se=r,re=null;t:for(;;){for(var fe;se!==a||y!==0&&se.nodeType!==3||(j=E+y),se!==v||d!==0&&se.nodeType!==3||(z=E+d),se.nodeType===3&&(E+=se.nodeValue.length),(fe=se.firstChild)!==null;)re=se,se=fe;for(;;){if(se===r)break t;if(re===a&&++Z===y&&(j=E),re===v&&++oe===d&&(z=E),(fe=se.nextSibling)!==null)break;se=re,re=se.parentNode}se=fe}a=j===-1||z===-1?null:{start:j,end:z}}else a=null}a=a||{start:0,end:0}}else a=null;for(yc={focusedElem:r,selectionRange:a},va=!1,he=o;he!==null;)if(o=he,r=o.child,(o.subtreeFlags&1028)!==0&&r!==null)r.return=o,he=r;else for(;he!==null;){o=he;try{var pe=o.alternate;if((o.flags&1024)!==0)switch(o.tag){case 0:case 11:case 15:break;case 1:if(pe!==null){var me=pe.memoizedProps,nt=pe.memoizedState,q=o.stateNode,H=q.getSnapshotBeforeUpdate(o.elementType===o.type?me:fn(o.type,me),nt);q.__reactInternalSnapshotBeforeUpdate=H}break;case 3:var X=o.stateNode.containerInfo;X.nodeType===1?X.textContent="":X.nodeType===9&&X.documentElement&&X.removeChild(X.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(n(163))}}catch(le){tt(o,o.return,le)}if(r=o.sibling,r!==null){r.return=o.return,he=r;break}he=o.return}return pe=wm,wm=!1,pe}function li(r,o,a){var d=o.updateQueue;if(d=d!==null?d.lastEffect:null,d!==null){var y=d=d.next;do{if((y.tag&r)===r){var v=y.destroy;y.destroy=void 0,v!==void 0&&od(o,a,v)}y=y.next}while(y!==d)}}function Ja(r,o){if(o=o.updateQueue,o=o!==null?o.lastEffect:null,o!==null){var a=o=o.next;do{if((a.tag&r)===r){var d=a.create;a.destroy=d()}a=a.next}while(a!==o)}}function sd(r){var o=r.ref;if(o!==null){var a=r.stateNode;r.tag,r=a,typeof o=="function"?o(r):o.current=r}}function Sm(r){var o=r.alternate;o!==null&&(r.alternate=null,Sm(o)),r.child=null,r.deletions=null,r.sibling=null,r.tag===5&&(o=r.stateNode,o!==null&&(delete o[En],delete o[Xs],delete o[Sc],delete o[t1],delete o[n1])),r.stateNode=null,r.return=null,r.dependencies=null,r.memoizedProps=null,r.memoizedState=null,r.pendingProps=null,r.stateNode=null,r.updateQueue=null}function km(r){return r.tag===5||r.tag===3||r.tag===4}function _m(r){e:for(;;){for(;r.sibling===null;){if(r.return===null||km(r.return))return null;r=r.return}for(r.sibling.return=r.return,r=r.sibling;r.tag!==5&&r.tag!==6&&r.tag!==18;){if(r.flags&2||r.child===null||r.tag===4)continue e;r.child.return=r,r=r.child}if(!(r.flags&2))return r.stateNode}}function id(r,o,a){var d=r.tag;if(d===5||d===6)r=r.stateNode,o?a.nodeType===8?a.parentNode.insertBefore(r,o):a.insertBefore(r,o):(a.nodeType===8?(o=a.parentNode,o.insertBefore(r,a)):(o=a,o.appendChild(r)),a=a._reactRootContainer,a!=null||o.onclick!==null||(o.onclick=Ra));else if(d!==4&&(r=r.child,r!==null))for(id(r,o,a),r=r.sibling;r!==null;)id(r,o,a),r=r.sibling}function ad(r,o,a){var d=r.tag;if(d===5||d===6)r=r.stateNode,o?a.insertBefore(r,o):a.appendChild(r);else if(d!==4&&(r=r.child,r!==null))for(ad(r,o,a),r=r.sibling;r!==null;)ad(r,o,a),r=r.sibling}var gt=null,hn=!1;function vr(r,o,a){for(a=a.child;a!==null;)Cm(r,o,a),a=a.sibling}function Cm(r,o,a){if(Gt&&typeof Gt.onCommitFiberUnmount=="function")try{Gt.onCommitFiberUnmount($r,a)}catch{}switch(a.tag){case 5:kt||Jo(a,o);case 6:var d=gt,y=hn;gt=null,vr(r,o,a),gt=d,hn=y,gt!==null&&(hn?(r=gt,a=a.stateNode,r.nodeType===8?r.parentNode.removeChild(a):r.removeChild(a)):gt.removeChild(a.stateNode));break;case 18:gt!==null&&(hn?(r=gt,a=a.stateNode,r.nodeType===8?wc(r.parentNode,a):r.nodeType===1&&wc(r,a),Ws(r)):wc(gt,a.stateNode));break;case 4:d=gt,y=hn,gt=a.stateNode.containerInfo,hn=!0,vr(r,o,a),gt=d,hn=y;break;case 0:case 11:case 14:case 15:if(!kt&&(d=a.updateQueue,d!==null&&(d=d.lastEffect,d!==null))){y=d=d.next;do{var v=y,E=v.destroy;v=v.tag,E!==void 0&&((v&2)!==0||(v&4)!==0)&&od(a,o,E),y=y.next}while(y!==d)}vr(r,o,a);break;case 1:if(!kt&&(Jo(a,o),d=a.stateNode,typeof d.componentWillUnmount=="function"))try{d.props=a.memoizedProps,d.state=a.memoizedState,d.componentWillUnmount()}catch(j){tt(a,o,j)}vr(r,o,a);break;case 21:vr(r,o,a);break;case 22:a.mode&1?(kt=(d=kt)||a.memoizedState!==null,vr(r,o,a),kt=d):vr(r,o,a);break;default:vr(r,o,a)}}function Em(r){var o=r.updateQueue;if(o!==null){r.updateQueue=null;var a=r.stateNode;a===null&&(a=r.stateNode=new v1),o.forEach(function(d){var y=M1.bind(null,r,d);a.has(d)||(a.add(d),d.then(y,y))})}}function pn(r,o){var a=o.deletions;if(a!==null)for(var d=0;d<a.length;d++){var y=a[d];try{var v=r,E=o,j=E;e:for(;j!==null;){switch(j.tag){case 5:gt=j.stateNode,hn=!1;break e;case 3:gt=j.stateNode.containerInfo,hn=!0;break e;case 4:gt=j.stateNode.containerInfo,hn=!0;break e}j=j.return}if(gt===null)throw Error(n(160));Cm(v,E,y),gt=null,hn=!1;var z=y.alternate;z!==null&&(z.return=null),y.return=null}catch(Z){tt(y,o,Z)}}if(o.subtreeFlags&12854)for(o=o.child;o!==null;)Nm(o,r),o=o.sibling}function Nm(r,o){var a=r.alternate,d=r.flags;switch(r.tag){case 0:case 11:case 14:case 15:if(pn(o,r),Mn(r),d&4){try{li(3,r,r.return),Ja(3,r)}catch(me){tt(r,r.return,me)}try{li(5,r,r.return)}catch(me){tt(r,r.return,me)}}break;case 1:pn(o,r),Mn(r),d&512&&a!==null&&Jo(a,a.return);break;case 5:if(pn(o,r),Mn(r),d&512&&a!==null&&Jo(a,a.return),r.flags&32){var y=r.stateNode;try{un(y,"")}catch(me){tt(r,r.return,me)}}if(d&4&&(y=r.stateNode,y!=null)){var v=r.memoizedProps,E=a!==null?a.memoizedProps:v,j=r.type,z=r.updateQueue;if(r.updateQueue=null,z!==null)try{j==="input"&&v.type==="radio"&&v.name!=null&&Fe(y,v),rr(j,E);var Z=rr(j,v);for(E=0;E<z.length;E+=2){var oe=z[E],se=z[E+1];oe==="style"?Co(y,se):oe==="dangerouslySetInnerHTML"?ko(y,se):oe==="children"?un(y,se):k(y,oe,se,Z)}switch(j){case"input":Ue(y,v);break;case"textarea":Be(y,v);break;case"select":var re=y._wrapperState.wasMultiple;y._wrapperState.wasMultiple=!!v.multiple;var fe=v.value;fe!=null?mt(y,!!v.multiple,fe,!1):re!==!!v.multiple&&(v.defaultValue!=null?mt(y,!!v.multiple,v.defaultValue,!0):mt(y,!!v.multiple,v.multiple?[]:"",!1))}y[Xs]=v}catch(me){tt(r,r.return,me)}}break;case 6:if(pn(o,r),Mn(r),d&4){if(r.stateNode===null)throw Error(n(162));y=r.stateNode,v=r.memoizedProps;try{y.nodeValue=v}catch(me){tt(r,r.return,me)}}break;case 3:if(pn(o,r),Mn(r),d&4&&a!==null&&a.memoizedState.isDehydrated)try{Ws(o.containerInfo)}catch(me){tt(r,r.return,me)}break;case 4:pn(o,r),Mn(r);break;case 13:pn(o,r),Mn(r),y=r.child,y.flags&8192&&(v=y.memoizedState!==null,y.stateNode.isHidden=v,!v||y.alternate!==null&&y.alternate.memoizedState!==null||(cd=Xe())),d&4&&Em(r);break;case 22:if(oe=a!==null&&a.memoizedState!==null,r.mode&1?(kt=(Z=kt)||oe,pn(o,r),kt=Z):pn(o,r),Mn(r),d&8192){if(Z=r.memoizedState!==null,(r.stateNode.isHidden=Z)&&!oe&&(r.mode&1)!==0)for(he=r,oe=r.child;oe!==null;){for(se=he=oe;he!==null;){switch(re=he,fe=re.child,re.tag){case 0:case 11:case 14:case 15:li(4,re,re.return);break;case 1:Jo(re,re.return);var pe=re.stateNode;if(typeof pe.componentWillUnmount=="function"){d=re,a=re.return;try{o=d,pe.props=o.memoizedProps,pe.state=o.memoizedState,pe.componentWillUnmount()}catch(me){tt(d,a,me)}}break;case 5:Jo(re,re.return);break;case 22:if(re.memoizedState!==null){Pm(se);continue}}fe!==null?(fe.return=re,he=fe):Pm(se)}oe=oe.sibling}e:for(oe=null,se=r;;){if(se.tag===5){if(oe===null){oe=se;try{y=se.stateNode,Z?(v=y.style,typeof v.setProperty=="function"?v.setProperty("display","none","important"):v.display="none"):(j=se.stateNode,z=se.memoizedProps.style,E=z!=null&&z.hasOwnProperty("display")?z.display:null,j.style.display=_o("display",E))}catch(me){tt(r,r.return,me)}}}else if(se.tag===6){if(oe===null)try{se.stateNode.nodeValue=Z?"":se.memoizedProps}catch(me){tt(r,r.return,me)}}else if((se.tag!==22&&se.tag!==23||se.memoizedState===null||se===r)&&se.child!==null){se.child.return=se,se=se.child;continue}if(se===r)break e;for(;se.sibling===null;){if(se.return===null||se.return===r)break e;oe===se&&(oe=null),se=se.return}oe===se&&(oe=null),se.sibling.return=se.return,se=se.sibling}}break;case 19:pn(o,r),Mn(r),d&4&&Em(r);break;case 21:break;default:pn(o,r),Mn(r)}}function Mn(r){var o=r.flags;if(o&2){try{e:{for(var a=r.return;a!==null;){if(km(a)){var d=a;break e}a=a.return}throw Error(n(160))}switch(d.tag){case 5:var y=d.stateNode;d.flags&32&&(un(y,""),d.flags&=-33);var v=_m(r);ad(r,v,y);break;case 3:case 4:var E=d.stateNode.containerInfo,j=_m(r);id(r,j,E);break;default:throw Error(n(161))}}catch(z){tt(r,r.return,z)}r.flags&=-3}o&4096&&(r.flags&=-4097)}function w1(r,o,a){he=r,bm(r)}function bm(r,o,a){for(var d=(r.mode&1)!==0;he!==null;){var y=he,v=y.child;if(y.tag===22&&d){var E=y.memoizedState!==null||Za;if(!E){var j=y.alternate,z=j!==null&&j.memoizedState!==null||kt;j=Za;var Z=kt;if(Za=E,(kt=z)&&!Z)for(he=y;he!==null;)E=he,z=E.child,E.tag===22&&E.memoizedState!==null?Rm(y):z!==null?(z.return=E,he=z):Rm(y);for(;v!==null;)he=v,bm(v),v=v.sibling;he=y,Za=j,kt=Z}Mm(r)}else(y.subtreeFlags&8772)!==0&&v!==null?(v.return=y,he=v):Mm(r)}}function Mm(r){for(;he!==null;){var o=he;if((o.flags&8772)!==0){var a=o.alternate;try{if((o.flags&8772)!==0)switch(o.tag){case 0:case 11:case 15:kt||Ja(5,o);break;case 1:var d=o.stateNode;if(o.flags&4&&!kt)if(a===null)d.componentDidMount();else{var y=o.elementType===o.type?a.memoizedProps:fn(o.type,a.memoizedProps);d.componentDidUpdate(y,a.memoizedState,d.__reactInternalSnapshotBeforeUpdate)}var v=o.updateQueue;v!==null&&Pp(o,v,d);break;case 3:var E=o.updateQueue;if(E!==null){if(a=null,o.child!==null)switch(o.child.tag){case 5:a=o.child.stateNode;break;case 1:a=o.child.stateNode}Pp(o,E,a)}break;case 5:var j=o.stateNode;if(a===null&&o.flags&4){a=j;var z=o.memoizedProps;switch(o.type){case"button":case"input":case"select":case"textarea":z.autoFocus&&a.focus();break;case"img":z.src&&(a.src=z.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(o.memoizedState===null){var Z=o.alternate;if(Z!==null){var oe=Z.memoizedState;if(oe!==null){var se=oe.dehydrated;se!==null&&Ws(se)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(n(163))}kt||o.flags&512&&sd(o)}catch(re){tt(o,o.return,re)}}if(o===r){he=null;break}if(a=o.sibling,a!==null){a.return=o.return,he=a;break}he=o.return}}function Pm(r){for(;he!==null;){var o=he;if(o===r){he=null;break}var a=o.sibling;if(a!==null){a.return=o.return,he=a;break}he=o.return}}function Rm(r){for(;he!==null;){var o=he;try{switch(o.tag){case 0:case 11:case 15:var a=o.return;try{Ja(4,o)}catch(z){tt(o,a,z)}break;case 1:var d=o.stateNode;if(typeof d.componentDidMount=="function"){var y=o.return;try{d.componentDidMount()}catch(z){tt(o,y,z)}}var v=o.return;try{sd(o)}catch(z){tt(o,v,z)}break;case 5:var E=o.return;try{sd(o)}catch(z){tt(o,E,z)}}}catch(z){tt(o,o.return,z)}if(o===r){he=null;break}var j=o.sibling;if(j!==null){j.return=o.return,he=j;break}he=o.return}}var S1=Math.ceil,el=b.ReactCurrentDispatcher,ld=b.ReactCurrentOwner,tn=b.ReactCurrentBatchConfig,Le=0,ft=null,st=null,yt=0,Bt=0,es=hr(0),ut=0,ui=null,Gr=0,tl=0,ud=0,ci=null,Tt=null,cd=0,ts=1/0,Qn=null,nl=!1,dd=null,xr=null,rl=!1,wr=null,ol=0,di=0,fd=null,sl=-1,il=0;function Nt(){return(Le&6)!==0?Xe():sl!==-1?sl:sl=Xe()}function Sr(r){return(r.mode&1)===0?1:(Le&2)!==0&&yt!==0?yt&-yt:o1.transition!==null?(il===0&&(il=Io()),il):(r=ze,r!==0||(r=window.event,r=r===void 0?16:Th(r.type)),r)}function mn(r,o,a,d){if(50<di)throw di=0,fd=null,Error(n(185));Br(r,a,d),((Le&2)===0||r!==ft)&&(r===ft&&((Le&2)===0&&(tl|=a),ut===4&&kr(r,yt)),Ot(r,d),a===1&&Le===0&&(o.mode&1)===0&&(ts=Xe()+500,Ia&&mr()))}function Ot(r,o){var a=r.callbackNode;Qu(r,o);var d=Oo(r,r===ft?yt:0);if(d===0)a!==null&&ca(a),r.callbackNode=null,r.callbackPriority=0;else if(o=d&-d,r.callbackPriority!==o){if(a!=null&&ca(a),o===1)r.tag===0?r1(Tm.bind(null,r)):yp(Tm.bind(null,r)),Jw(function(){(Le&6)===0&&mr()}),a=null;else{switch(Ch(d)){case 1:a=Os;break;case 4:a=fa;break;case 16:a=Ro;break;case 536870912:a=ha;break;default:a=Ro}a=Wm(a,Dm.bind(null,r))}r.callbackPriority=o,r.callbackNode=a}}function Dm(r,o){if(sl=-1,il=0,(Le&6)!==0)throw Error(n(327));var a=r.callbackNode;if(ns()&&r.callbackNode!==a)return null;var d=Oo(r,r===ft?yt:0);if(d===0)return null;if((d&30)!==0||(d&r.expiredLanes)!==0||o)o=al(r,d);else{o=d;var y=Le;Le|=2;var v=Im();(ft!==r||yt!==o)&&(Qn=null,ts=Xe()+500,Zr(r,o));do try{C1();break}catch(j){Om(r,j)}while(!0);Rc(),el.current=v,Le=y,st!==null?o=0:(ft=null,yt=0,o=ut)}if(o!==0){if(o===2&&(y=Is(r),y!==0&&(d=y,o=hd(r,y))),o===1)throw a=ui,Zr(r,0),kr(r,d),Ot(r,Xe()),a;if(o===6)kr(r,d);else{if(y=r.current.alternate,(d&30)===0&&!k1(y)&&(o=al(r,d),o===2&&(v=Is(r),v!==0&&(d=v,o=hd(r,v))),o===1))throw a=ui,Zr(r,0),kr(r,d),Ot(r,Xe()),a;switch(r.finishedWork=y,r.finishedLanes=d,o){case 0:case 1:throw Error(n(345));case 2:Jr(r,Tt,Qn);break;case 3:if(kr(r,d),(d&130023424)===d&&(o=cd+500-Xe(),10<o)){if(Oo(r,0)!==0)break;if(y=r.suspendedLanes,(y&d)!==d){Nt(),r.pingedLanes|=r.suspendedLanes&y;break}r.timeoutHandle=xc(Jr.bind(null,r,Tt,Qn),o);break}Jr(r,Tt,Qn);break;case 4:if(kr(r,d),(d&4194240)===d)break;for(o=r.eventTimes,y=-1;0<d;){var E=31-At(d);v=1<<E,E=o[E],E>y&&(y=E),d&=~v}if(d=y,d=Xe()-d,d=(120>d?120:480>d?480:1080>d?1080:1920>d?1920:3e3>d?3e3:4320>d?4320:1960*S1(d/1960))-d,10<d){r.timeoutHandle=xc(Jr.bind(null,r,Tt,Qn),d);break}Jr(r,Tt,Qn);break;case 5:Jr(r,Tt,Qn);break;default:throw Error(n(329))}}}return Ot(r,Xe()),r.callbackNode===a?Dm.bind(null,r):null}function hd(r,o){var a=ci;return r.current.memoizedState.isDehydrated&&(Zr(r,o).flags|=256),r=al(r,o),r!==2&&(o=Tt,Tt=a,o!==null&&pd(o)),r}function pd(r){Tt===null?Tt=r:Tt.push.apply(Tt,r)}function k1(r){for(var o=r;;){if(o.flags&16384){var a=o.updateQueue;if(a!==null&&(a=a.stores,a!==null))for(var d=0;d<a.length;d++){var y=a[d],v=y.getSnapshot;y=y.value;try{if(!cn(v(),y))return!1}catch{return!1}}}if(a=o.child,o.subtreeFlags&16384&&a!==null)a.return=o,o=a;else{if(o===r)break;for(;o.sibling===null;){if(o.return===null||o.return===r)return!0;o=o.return}o.sibling.return=o.return,o=o.sibling}}return!0}function kr(r,o){for(o&=~ud,o&=~tl,r.suspendedLanes|=o,r.pingedLanes&=~o,r=r.expirationTimes;0<o;){var a=31-At(o),d=1<<a;r[a]=-1,o&=~d}}function Tm(r){if((Le&6)!==0)throw Error(n(327));ns();var o=Oo(r,0);if((o&1)===0)return Ot(r,Xe()),null;var a=al(r,o);if(r.tag!==0&&a===2){var d=Is(r);d!==0&&(o=d,a=hd(r,d))}if(a===1)throw a=ui,Zr(r,0),kr(r,o),Ot(r,Xe()),a;if(a===6)throw Error(n(345));return r.finishedWork=r.current.alternate,r.finishedLanes=o,Jr(r,Tt,Qn),Ot(r,Xe()),null}function md(r,o){var a=Le;Le|=1;try{return r(o)}finally{Le=a,Le===0&&(ts=Xe()+500,Ia&&mr())}}function Xr(r){wr!==null&&wr.tag===0&&(Le&6)===0&&ns();var o=Le;Le|=1;var a=tn.transition,d=ze;try{if(tn.transition=null,ze=1,r)return r()}finally{ze=d,tn.transition=a,Le=o,(Le&6)===0&&mr()}}function gd(){Bt=es.current,Ye(es)}function Zr(r,o){r.finishedWork=null,r.finishedLanes=0;var a=r.timeoutHandle;if(a!==-1&&(r.timeoutHandle=-1,Zw(a)),st!==null)for(a=st.return;a!==null;){var d=a;switch(Ec(d),d.tag){case 1:d=d.type.childContextTypes,d!=null&&Ta();break;case 3:Xo(),Ye(Pt),Ye(xt),Ac();break;case 5:Lc(d);break;case 4:Xo();break;case 13:Ye(Ze);break;case 19:Ye(Ze);break;case 10:Dc(d.type._context);break;case 22:case 23:gd()}a=a.return}if(ft=r,st=r=_r(r.current,null),yt=Bt=o,ut=0,ui=null,ud=tl=Gr=0,Tt=ci=null,Qr!==null){for(o=0;o<Qr.length;o++)if(a=Qr[o],d=a.interleaved,d!==null){a.interleaved=null;var y=d.next,v=a.pending;if(v!==null){var E=v.next;v.next=y,d.next=E}a.pending=d}Qr=null}return r}function Om(r,o){do{var a=st;try{if(Rc(),Va.current=qa,Ya){for(var d=Je.memoizedState;d!==null;){var y=d.queue;y!==null&&(y.pending=null),d=d.next}Ya=!1}if(Kr=0,dt=lt=Je=null,ri=!1,oi=0,ld.current=null,a===null||a.return===null){ut=1,ui=o,st=null;break}e:{var v=r,E=a.return,j=a,z=o;if(o=yt,j.flags|=32768,z!==null&&typeof z=="object"&&typeof z.then=="function"){var Z=z,oe=j,se=oe.tag;if((oe.mode&1)===0&&(se===0||se===11||se===15)){var re=oe.alternate;re?(oe.updateQueue=re.updateQueue,oe.memoizedState=re.memoizedState,oe.lanes=re.lanes):(oe.updateQueue=null,oe.memoizedState=null)}var fe=om(E);if(fe!==null){fe.flags&=-257,sm(fe,E,j,v,o),fe.mode&1&&rm(v,Z,o),o=fe,z=Z;var pe=o.updateQueue;if(pe===null){var me=new Set;me.add(z),o.updateQueue=me}else pe.add(z);break e}else{if((o&1)===0){rm(v,Z,o),yd();break e}z=Error(n(426))}}else if(Qe&&j.mode&1){var nt=om(E);if(nt!==null){(nt.flags&65536)===0&&(nt.flags|=256),sm(nt,E,j,v,o),Mc(Zo(z,j));break e}}v=z=Zo(z,j),ut!==4&&(ut=2),ci===null?ci=[v]:ci.push(v),v=E;do{switch(v.tag){case 3:v.flags|=65536,o&=-o,v.lanes|=o;var q=tm(v,z,o);Mp(v,q);break e;case 1:j=z;var H=v.type,X=v.stateNode;if((v.flags&128)===0&&(typeof H.getDerivedStateFromError=="function"||X!==null&&typeof X.componentDidCatch=="function"&&(xr===null||!xr.has(X)))){v.flags|=65536,o&=-o,v.lanes|=o;var le=nm(v,j,o);Mp(v,le);break e}}v=v.return}while(v!==null)}Lm(a)}catch(ve){o=ve,st===a&&a!==null&&(st=a=a.return);continue}break}while(!0)}function Im(){var r=el.current;return el.current=qa,r===null?qa:r}function yd(){(ut===0||ut===3||ut===2)&&(ut=4),ft===null||(Gr&268435455)===0&&(tl&268435455)===0||kr(ft,yt)}function al(r,o){var a=Le;Le|=2;var d=Im();(ft!==r||yt!==o)&&(Qn=null,Zr(r,o));do try{_1();break}catch(y){Om(r,y)}while(!0);if(Rc(),Le=a,el.current=d,st!==null)throw Error(n(261));return ft=null,yt=0,ut}function _1(){for(;st!==null;)jm(st)}function C1(){for(;st!==null&&!Wu();)jm(st)}function jm(r){var o=zm(r.alternate,r,Bt);r.memoizedProps=r.pendingProps,o===null?Lm(r):st=o,ld.current=null}function Lm(r){var o=r;do{var a=o.alternate;if(r=o.return,(o.flags&32768)===0){if(a=g1(a,o,Bt),a!==null){st=a;return}}else{if(a=y1(a,o),a!==null){a.flags&=32767,st=a;return}if(r!==null)r.flags|=32768,r.subtreeFlags=0,r.deletions=null;else{ut=6,st=null;return}}if(o=o.sibling,o!==null){st=o;return}st=o=r}while(o!==null);ut===0&&(ut=5)}function Jr(r,o,a){var d=ze,y=tn.transition;try{tn.transition=null,ze=1,E1(r,o,a,d)}finally{tn.transition=y,ze=d}return null}function E1(r,o,a,d){do ns();while(wr!==null);if((Le&6)!==0)throw Error(n(327));a=r.finishedWork;var y=r.finishedLanes;if(a===null)return null;if(r.finishedWork=null,r.finishedLanes=0,a===r.current)throw Error(n(177));r.callbackNode=null,r.callbackPriority=0;var v=a.lanes|a.childLanes;if(ma(r,v),r===ft&&(st=ft=null,yt=0),(a.subtreeFlags&2064)===0&&(a.flags&2064)===0||rl||(rl=!0,Wm(Ro,function(){return ns(),null})),v=(a.flags&15990)!==0,(a.subtreeFlags&15990)!==0||v){v=tn.transition,tn.transition=null;var E=ze;ze=1;var j=Le;Le|=4,ld.current=null,x1(r,a),Nm(a,r),Yw(yc),va=!!gc,yc=gc=null,r.current=a,w1(a),da(),Le=j,ze=E,tn.transition=v}else r.current=a;if(rl&&(rl=!1,wr=r,ol=y),v=r.pendingLanes,v===0&&(xr=null),Hu(a.stateNode),Ot(r,Xe()),o!==null)for(d=r.onRecoverableError,a=0;a<o.length;a++)y=o[a],d(y.value,{componentStack:y.stack,digest:y.digest});if(nl)throw nl=!1,r=dd,dd=null,r;return(ol&1)!==0&&r.tag!==0&&ns(),v=r.pendingLanes,(v&1)!==0?r===fd?di++:(di=0,fd=r):di=0,mr(),null}function ns(){if(wr!==null){var r=Ch(ol),o=tn.transition,a=ze;try{if(tn.transition=null,ze=16>r?16:r,wr===null)var d=!1;else{if(r=wr,wr=null,ol=0,(Le&6)!==0)throw Error(n(331));var y=Le;for(Le|=4,he=r.current;he!==null;){var v=he,E=v.child;if((he.flags&16)!==0){var j=v.deletions;if(j!==null){for(var z=0;z<j.length;z++){var Z=j[z];for(he=Z;he!==null;){var oe=he;switch(oe.tag){case 0:case 11:case 15:li(8,oe,v)}var se=oe.child;if(se!==null)se.return=oe,he=se;else for(;he!==null;){oe=he;var re=oe.sibling,fe=oe.return;if(Sm(oe),oe===Z){he=null;break}if(re!==null){re.return=fe,he=re;break}he=fe}}}var pe=v.alternate;if(pe!==null){var me=pe.child;if(me!==null){pe.child=null;do{var nt=me.sibling;me.sibling=null,me=nt}while(me!==null)}}he=v}}if((v.subtreeFlags&2064)!==0&&E!==null)E.return=v,he=E;else e:for(;he!==null;){if(v=he,(v.flags&2048)!==0)switch(v.tag){case 0:case 11:case 15:li(9,v,v.return)}var q=v.sibling;if(q!==null){q.return=v.return,he=q;break e}he=v.return}}var H=r.current;for(he=H;he!==null;){E=he;var X=E.child;if((E.subtreeFlags&2064)!==0&&X!==null)X.return=E,he=X;else e:for(E=H;he!==null;){if(j=he,(j.flags&2048)!==0)try{switch(j.tag){case 0:case 11:case 15:Ja(9,j)}}catch(ve){tt(j,j.return,ve)}if(j===E){he=null;break e}var le=j.sibling;if(le!==null){le.return=j.return,he=le;break e}he=j.return}}if(Le=y,mr(),Gt&&typeof Gt.onPostCommitFiberRoot=="function")try{Gt.onPostCommitFiberRoot($r,r)}catch{}d=!0}return d}finally{ze=a,tn.transition=o}}return!1}function Fm(r,o,a){o=Zo(a,o),o=tm(r,o,1),r=yr(r,o,1),o=Nt(),r!==null&&(Br(r,1,o),Ot(r,o))}function tt(r,o,a){if(r.tag===3)Fm(r,r,a);else for(;o!==null;){if(o.tag===3){Fm(o,r,a);break}else if(o.tag===1){var d=o.stateNode;if(typeof o.type.getDerivedStateFromError=="function"||typeof d.componentDidCatch=="function"&&(xr===null||!xr.has(d))){r=Zo(a,r),r=nm(o,r,1),o=yr(o,r,1),r=Nt(),o!==null&&(Br(o,1,r),Ot(o,r));break}}o=o.return}}function N1(r,o,a){var d=r.pingCache;d!==null&&d.delete(o),o=Nt(),r.pingedLanes|=r.suspendedLanes&a,ft===r&&(yt&a)===a&&(ut===4||ut===3&&(yt&130023424)===yt&&500>Xe()-cd?Zr(r,0):ud|=a),Ot(r,o)}function Am(r,o){o===0&&((r.mode&1)===0?o=1:(o=To,To<<=1,(To&130023424)===0&&(To=4194304)));var a=Nt();r=Vn(r,o),r!==null&&(Br(r,o,a),Ot(r,a))}function b1(r){var o=r.memoizedState,a=0;o!==null&&(a=o.retryLane),Am(r,a)}function M1(r,o){var a=0;switch(r.tag){case 13:var d=r.stateNode,y=r.memoizedState;y!==null&&(a=y.retryLane);break;case 19:d=r.stateNode;break;default:throw Error(n(314))}d!==null&&d.delete(o),Am(r,a)}var zm;zm=function(r,o,a){if(r!==null)if(r.memoizedProps!==o.pendingProps||Pt.current)Dt=!0;else{if((r.lanes&a)===0&&(o.flags&128)===0)return Dt=!1,m1(r,o,a);Dt=(r.flags&131072)!==0}else Dt=!1,Qe&&(o.flags&1048576)!==0&&vp(o,La,o.index);switch(o.lanes=0,o.tag){case 2:var d=o.type;Xa(r,o),r=o.pendingProps;var y=Vo(o,xt.current);Go(o,a),y=$c(null,o,d,r,y,a);var v=Bc();return o.flags|=1,typeof y=="object"&&y!==null&&typeof y.render=="function"&&y.$$typeof===void 0?(o.tag=1,o.memoizedState=null,o.updateQueue=null,Rt(d)?(v=!0,Oa(o)):v=!1,o.memoizedState=y.state!==null&&y.state!==void 0?y.state:null,Ic(o),y.updater=Ka,o.stateNode=y,y._reactInternals=o,qc(o,d,r,a),o=Zc(null,o,d,!0,v,a)):(o.tag=0,Qe&&v&&Cc(o),Et(null,o,y,a),o=o.child),o;case 16:d=o.elementType;e:{switch(Xa(r,o),r=o.pendingProps,y=d._init,d=y(d._payload),o.type=d,y=o.tag=R1(d),r=fn(d,r),y){case 0:o=Xc(null,o,d,r,a);break e;case 1:o=dm(null,o,d,r,a);break e;case 11:o=im(null,o,d,r,a);break e;case 14:o=am(null,o,d,fn(d.type,r),a);break e}throw Error(n(306,d,""))}return o;case 0:return d=o.type,y=o.pendingProps,y=o.elementType===d?y:fn(d,y),Xc(r,o,d,y,a);case 1:return d=o.type,y=o.pendingProps,y=o.elementType===d?y:fn(d,y),dm(r,o,d,y,a);case 3:e:{if(fm(o),r===null)throw Error(n(387));d=o.pendingProps,v=o.memoizedState,y=v.element,bp(r,o),Ba(o,d,null,a);var E=o.memoizedState;if(d=E.element,v.isDehydrated)if(v={element:d,isDehydrated:!1,cache:E.cache,pendingSuspenseBoundaries:E.pendingSuspenseBoundaries,transitions:E.transitions},o.updateQueue.baseState=v,o.memoizedState=v,o.flags&256){y=Zo(Error(n(423)),o),o=hm(r,o,d,a,y);break e}else if(d!==y){y=Zo(Error(n(424)),o),o=hm(r,o,d,a,y);break e}else for($t=fr(o.stateNode.containerInfo.firstChild),Wt=o,Qe=!0,dn=null,a=Ep(o,null,d,a),o.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling;else{if(Qo(),d===y){o=Un(r,o,a);break e}Et(r,o,d,a)}o=o.child}return o;case 5:return Rp(o),r===null&&bc(o),d=o.type,y=o.pendingProps,v=r!==null?r.memoizedProps:null,E=y.children,vc(d,y)?E=null:v!==null&&vc(d,v)&&(o.flags|=32),cm(r,o),Et(r,o,E,a),o.child;case 6:return r===null&&bc(o),null;case 13:return pm(r,o,a);case 4:return jc(o,o.stateNode.containerInfo),d=o.pendingProps,r===null?o.child=qo(o,null,d,a):Et(r,o,d,a),o.child;case 11:return d=o.type,y=o.pendingProps,y=o.elementType===d?y:fn(d,y),im(r,o,d,y,a);case 7:return Et(r,o,o.pendingProps,a),o.child;case 8:return Et(r,o,o.pendingProps.children,a),o.child;case 12:return Et(r,o,o.pendingProps.children,a),o.child;case 10:e:{if(d=o.type._context,y=o.pendingProps,v=o.memoizedProps,E=y.value,He(za,d._currentValue),d._currentValue=E,v!==null)if(cn(v.value,E)){if(v.children===y.children&&!Pt.current){o=Un(r,o,a);break e}}else for(v=o.child,v!==null&&(v.return=o);v!==null;){var j=v.dependencies;if(j!==null){E=v.child;for(var z=j.firstContext;z!==null;){if(z.context===d){if(v.tag===1){z=Yn(-1,a&-a),z.tag=2;var Z=v.updateQueue;if(Z!==null){Z=Z.shared;var oe=Z.pending;oe===null?z.next=z:(z.next=oe.next,oe.next=z),Z.pending=z}}v.lanes|=a,z=v.alternate,z!==null&&(z.lanes|=a),Tc(v.return,a,o),j.lanes|=a;break}z=z.next}}else if(v.tag===10)E=v.type===o.type?null:v.child;else if(v.tag===18){if(E=v.return,E===null)throw Error(n(341));E.lanes|=a,j=E.alternate,j!==null&&(j.lanes|=a),Tc(E,a,o),E=v.sibling}else E=v.child;if(E!==null)E.return=v;else for(E=v;E!==null;){if(E===o){E=null;break}if(v=E.sibling,v!==null){v.return=E.return,E=v;break}E=E.return}v=E}Et(r,o,y.children,a),o=o.child}return o;case 9:return y=o.type,d=o.pendingProps.children,Go(o,a),y=Jt(y),d=d(y),o.flags|=1,Et(r,o,d,a),o.child;case 14:return d=o.type,y=fn(d,o.pendingProps),y=fn(d.type,y),am(r,o,d,y,a);case 15:return lm(r,o,o.type,o.pendingProps,a);case 17:return d=o.type,y=o.pendingProps,y=o.elementType===d?y:fn(d,y),Xa(r,o),o.tag=1,Rt(d)?(r=!0,Oa(o)):r=!1,Go(o,a),Jp(o,d,y),qc(o,d,y,a),Zc(null,o,d,!0,r,a);case 19:return gm(r,o,a);case 22:return um(r,o,a)}throw Error(n(156,o.tag))};function Wm(r,o){return ua(r,o)}function P1(r,o,a,d){this.tag=r,this.key=a,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=o,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=d,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function nn(r,o,a,d){return new P1(r,o,a,d)}function vd(r){return r=r.prototype,!(!r||!r.isReactComponent)}function R1(r){if(typeof r=="function")return vd(r)?1:0;if(r!=null){if(r=r.$$typeof,r===K)return 11;if(r===Y)return 14}return 2}function _r(r,o){var a=r.alternate;return a===null?(a=nn(r.tag,o,r.key,r.mode),a.elementType=r.elementType,a.type=r.type,a.stateNode=r.stateNode,a.alternate=r,r.alternate=a):(a.pendingProps=o,a.type=r.type,a.flags=0,a.subtreeFlags=0,a.deletions=null),a.flags=r.flags&14680064,a.childLanes=r.childLanes,a.lanes=r.lanes,a.child=r.child,a.memoizedProps=r.memoizedProps,a.memoizedState=r.memoizedState,a.updateQueue=r.updateQueue,o=r.dependencies,a.dependencies=o===null?null:{lanes:o.lanes,firstContext:o.firstContext},a.sibling=r.sibling,a.index=r.index,a.ref=r.ref,a}function ll(r,o,a,d,y,v){var E=2;if(d=r,typeof r=="function")vd(r)&&(E=1);else if(typeof r=="string")E=5;else e:switch(r){case R:return eo(a.children,y,v,o);case O:E=8,y|=8;break;case A:return r=nn(12,a,o,y|2),r.elementType=A,r.lanes=v,r;case J:return r=nn(13,a,o,y),r.elementType=J,r.lanes=v,r;case I:return r=nn(19,a,o,y),r.elementType=I,r.lanes=v,r;case Q:return ul(a,y,v,o);default:if(typeof r=="object"&&r!==null)switch(r.$$typeof){case G:E=10;break e;case W:E=9;break e;case K:E=11;break e;case Y:E=14;break e;case V:E=16,d=null;break e}throw Error(n(130,r==null?r:typeof r,""))}return o=nn(E,a,o,y),o.elementType=r,o.type=d,o.lanes=v,o}function eo(r,o,a,d){return r=nn(7,r,d,o),r.lanes=a,r}function ul(r,o,a,d){return r=nn(22,r,d,o),r.elementType=Q,r.lanes=a,r.stateNode={isHidden:!1},r}function xd(r,o,a){return r=nn(6,r,null,o),r.lanes=a,r}function wd(r,o,a){return o=nn(4,r.children!==null?r.children:[],r.key,o),o.lanes=a,o.stateNode={containerInfo:r.containerInfo,pendingChildren:null,implementation:r.implementation},o}function D1(r,o,a,d,y){this.tag=o,this.containerInfo=r,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=js(0),this.expirationTimes=js(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=js(0),this.identifierPrefix=d,this.onRecoverableError=y,this.mutableSourceEagerHydrationData=null}function Sd(r,o,a,d,y,v,E,j,z){return r=new D1(r,o,a,j,z),o===1?(o=1,v===!0&&(o|=8)):o=0,v=nn(3,null,null,o),r.current=v,v.stateNode=r,v.memoizedState={element:d,isDehydrated:a,cache:null,transitions:null,pendingSuspenseBoundaries:null},Ic(v),r}function T1(r,o,a){var d=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:M,key:d==null?null:""+d,children:r,containerInfo:o,implementation:a}}function $m(r){if(!r)return pr;r=r._reactInternals;e:{if(Cn(r)!==r||r.tag!==1)throw Error(n(170));var o=r;do{switch(o.tag){case 3:o=o.stateNode.context;break e;case 1:if(Rt(o.type)){o=o.stateNode.__reactInternalMemoizedMergedChildContext;break e}}o=o.return}while(o!==null);throw Error(n(171))}if(r.tag===1){var a=r.type;if(Rt(a))return mp(r,a,o)}return o}function Bm(r,o,a,d,y,v,E,j,z){return r=Sd(a,d,!0,r,y,v,E,j,z),r.context=$m(null),a=r.current,d=Nt(),y=Sr(a),v=Yn(d,y),v.callback=o??null,yr(a,v,y),r.current.lanes=y,Br(r,y,d),Ot(r,d),r}function cl(r,o,a,d){var y=o.current,v=Nt(),E=Sr(y);return a=$m(a),o.context===null?o.context=a:o.pendingContext=a,o=Yn(v,E),o.payload={element:r},d=d===void 0?null:d,d!==null&&(o.callback=d),r=yr(y,o,E),r!==null&&(mn(r,y,E,v),$a(r,y,E)),E}function dl(r){return r=r.current,r.child?(r.child.tag===5,r.child.stateNode):null}function Hm(r,o){if(r=r.memoizedState,r!==null&&r.dehydrated!==null){var a=r.retryLane;r.retryLane=a!==0&&a<o?a:o}}function kd(r,o){Hm(r,o),(r=r.alternate)&&Hm(r,o)}function O1(){return null}var Vm=typeof reportError=="function"?reportError:function(r){console.error(r)};function _d(r){this._internalRoot=r}fl.prototype.render=_d.prototype.render=function(r){var o=this._internalRoot;if(o===null)throw Error(n(409));cl(r,o,null,null)},fl.prototype.unmount=_d.prototype.unmount=function(){var r=this._internalRoot;if(r!==null){this._internalRoot=null;var o=r.containerInfo;Xr(function(){cl(null,r,null,null)}),o[Wn]=null}};function fl(r){this._internalRoot=r}fl.prototype.unstable_scheduleHydration=function(r){if(r){var o=bh();r={blockedOn:null,target:r,priority:o};for(var a=0;a<ur.length&&o!==0&&o<ur[a].priority;a++);ur.splice(a,0,r),a===0&&Rh(r)}};function Cd(r){return!(!r||r.nodeType!==1&&r.nodeType!==9&&r.nodeType!==11)}function hl(r){return!(!r||r.nodeType!==1&&r.nodeType!==9&&r.nodeType!==11&&(r.nodeType!==8||r.nodeValue!==" react-mount-point-unstable "))}function Ym(){}function I1(r,o,a,d,y){if(y){if(typeof d=="function"){var v=d;d=function(){var Z=dl(E);v.call(Z)}}var E=Bm(o,d,r,0,null,!1,!1,"",Ym);return r._reactRootContainer=E,r[Wn]=E.current,Ks(r.nodeType===8?r.parentNode:r),Xr(),E}for(;y=r.lastChild;)r.removeChild(y);if(typeof d=="function"){var j=d;d=function(){var Z=dl(z);j.call(Z)}}var z=Sd(r,0,!1,null,null,!1,!1,"",Ym);return r._reactRootContainer=z,r[Wn]=z.current,Ks(r.nodeType===8?r.parentNode:r),Xr(function(){cl(o,z,a,d)}),z}function pl(r,o,a,d,y){var v=a._reactRootContainer;if(v){var E=v;if(typeof y=="function"){var j=y;y=function(){var z=dl(E);j.call(z)}}cl(o,E,r,y)}else E=I1(a,o,r,y,d);return dl(E)}Eh=function(r){switch(r.tag){case 3:var o=r.stateNode;if(o.current.memoizedState.isDehydrated){var a=sr(o.pendingLanes);a!==0&&(qu(o,a|1),Ot(o,Xe()),(Le&6)===0&&(ts=Xe()+500,mr()))}break;case 13:Xr(function(){var d=Vn(r,1);if(d!==null){var y=Nt();mn(d,r,1,y)}}),kd(r,1)}},Ku=function(r){if(r.tag===13){var o=Vn(r,134217728);if(o!==null){var a=Nt();mn(o,r,134217728,a)}kd(r,134217728)}},Nh=function(r){if(r.tag===13){var o=Sr(r),a=Vn(r,o);if(a!==null){var d=Nt();mn(a,r,o,d)}kd(r,o)}},bh=function(){return ze},Mh=function(r,o){var a=ze;try{return ze=r,o()}finally{ze=a}},Oe=function(r,o,a){switch(o){case"input":if(Ue(r,a),o=a.name,a.type==="radio"&&o!=null){for(a=r;a.parentNode;)a=a.parentNode;for(a=a.querySelectorAll("input[name="+JSON.stringify(""+o)+'][type="radio"]'),o=0;o<a.length;o++){var d=a[o];if(d!==r&&d.form===r.form){var y=Da(d);if(!y)throw Error(n(90));ye(d),Ue(d,y)}}}break;case"textarea":Be(r,a);break;case"select":o=a.value,o!=null&&mt(r,!!a.multiple,o,!1)}},No=md,bo=Xr;var j1={usingClientEntryPoint:!1,Events:[Zs,Bo,Da,Pe,Eo,md]},fi={findFiberByHostInstance:Hr,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},L1={bundleType:fi.bundleType,version:fi.version,rendererPackageName:fi.rendererPackageName,rendererConfig:fi.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:b.ReactCurrentDispatcher,findHostInstanceByFiber:function(r){return r=aa(r),r===null?null:r.stateNode},findFiberByHostInstance:fi.findFiberByHostInstance||O1,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var ml=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!ml.isDisabled&&ml.supportsFiber)try{$r=ml.inject(L1),Gt=ml}catch{}}return It.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=j1,It.createPortal=function(r,o){var a=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Cd(o))throw Error(n(200));return T1(r,o,null,a)},It.createRoot=function(r,o){if(!Cd(r))throw Error(n(299));var a=!1,d="",y=Vm;return o!=null&&(o.unstable_strictMode===!0&&(a=!0),o.identifierPrefix!==void 0&&(d=o.identifierPrefix),o.onRecoverableError!==void 0&&(y=o.onRecoverableError)),o=Sd(r,1,!1,null,null,a,!1,d,y),r[Wn]=o.current,Ks(r.nodeType===8?r.parentNode:r),new _d(o)},It.findDOMNode=function(r){if(r==null)return null;if(r.nodeType===1)return r;var o=r._reactInternals;if(o===void 0)throw typeof r.render=="function"?Error(n(188)):(r=Object.keys(r).join(","),Error(n(268,r)));return r=aa(o),r=r===null?null:r.stateNode,r},It.flushSync=function(r){return Xr(r)},It.hydrate=function(r,o,a){if(!hl(o))throw Error(n(200));return pl(null,r,o,!0,a)},It.hydrateRoot=function(r,o,a){if(!Cd(r))throw Error(n(405));var d=a!=null&&a.hydratedSources||null,y=!1,v="",E=Vm;if(a!=null&&(a.unstable_strictMode===!0&&(y=!0),a.identifierPrefix!==void 0&&(v=a.identifierPrefix),a.onRecoverableError!==void 0&&(E=a.onRecoverableError)),o=Bm(o,null,r,1,a??null,y,!1,v,E),r[Wn]=o.current,Ks(r),d)for(r=0;r<d.length;r++)a=d[r],y=a._getVersion,y=y(a._source),o.mutableSourceEagerHydrationData==null?o.mutableSourceEagerHydrationData=[a,y]:o.mutableSourceEagerHydrationData.push(a,y);return new fl(o)},It.render=function(r,o,a){if(!hl(o))throw Error(n(200));return pl(null,r,o,!1,a)},It.unmountComponentAtNode=function(r){if(!hl(r))throw Error(n(40));return r._reactRootContainer?(Xr(function(){pl(null,null,r,!1,function(){r._reactRootContainer=null,r[Wn]=null})}),!0):!1},It.unstable_batchedUpdates=md,It.unstable_renderSubtreeIntoContainer=function(r,o,a,d){if(!hl(a))throw Error(n(200));if(r==null||r._reactInternals===void 0)throw Error(n(38));return pl(r,o,a,!1,d)},It.version="18.3.1-next-f1338f8080-20240426",It}var _g;function P0(){if(_g)return zd.exports;_g=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),zd.exports=zk(),zd.exports}var Wk=P0();function $k(e,t){const n=Kt(),[s,i]=L.useState(!1),l=L.useRef(!1),u=Lk(t),{activeProps:c,inactiveProps:f,activeOptions:h,to:m,preload:p,preloadDelay:g,hashScrollIntoView:w,replace:S,startTransition:_,resetScroll:C,viewTransition:N,children:P,target:k,disabled:b,style:T,className:M,onClick:R,onFocus:O,onMouseEnter:A,onMouseLeave:G,onTouchStart:W,ignoreBlocker:K,params:J,search:I,hash:Y,state:V,mask:Q,reloadDocument:F,unsafeRelative:B,from:U,_fromLocation:D,...$}=e,ne=Ft({select:Re=>Re.location.search,structuralSharing:!0}),te=e.from,ie=L.useMemo(()=>({...e,from:te}),[n,ne,te,e._fromLocation,e.hash,e.to,e.search,e.params,e.state,e.mask,e.unsafeRelative]),ce=L.useMemo(()=>n.buildLocation({...ie}),[n,ie]),ue=L.useMemo(()=>{if(b)return;let Re=ce.maskedLocation?ce.maskedLocation.url.href:ce.url.href,Be=!1;return n.origin&&(Re.startsWith(n.origin)?Re=n.history.createHref(Re.replace(n.origin,""))||"/":Be=!0),{href:Re,external:Be}},[b,ce.maskedLocation,ce.url,n.origin,n.history]),ee=L.useMemo(()=>{if(ue?.external)return ue.href;try{return new URL(m),m}catch{}},[m,ue]),ae=e.reloadDocument||ee?!1:p??n.options.defaultPreload,xe=g??n.options.defaultPreloadDelay??0,Ee=Ft({select:Re=>{if(ee)return!1;if(h?.exact){if(!US(Re.location.pathname,ce.pathname,n.basepath))return!1}else{const Be=Gl(Re.location.pathname,n.basepath),Ge=Gl(ce.pathname,n.basepath);if(!(Be.startsWith(Ge)&&(Be.length===Ge.length||Be[Ge.length]==="/")))return!1}return(h?.includeSearch??!0)&&!ao(Re.location.search,ce.search,{partial:!h?.exact,ignoreUndefined:!h?.explicitUndefined})?!1:h?.includeHash?Re.location.hash===ce.hash:!0}}),ye=L.useCallback(()=>{n.preloadRoute({...ie}).catch(Re=>{console.warn(Re),console.warn(Sk)})},[n,ie]),ke=L.useCallback(Re=>{Re?.isIntersecting&&ye()},[ye]);jk(u,ke,Uk,{disabled:!!b||ae!=="viewport"}),L.useEffect(()=>{l.current||!b&&ae==="render"&&(ye(),l.current=!0)},[b,ye,ae]);const Te=Re=>{const Be=Re.currentTarget.getAttribute("target"),Ge=k!==void 0?k:Be;if(!b&&!Qk(Re)&&!Re.defaultPrevented&&(!Ge||Ge==="_self")&&Re.button===0){Re.preventDefault(),Wk.flushSync(()=>{i(!0)});const Mt=n.subscribe("onResolved",()=>{Mt(),i(!1)});n.navigate({...ie,replace:S,resetScroll:C,hashScrollIntoView:w,startTransition:_,viewTransition:N,ignoreBlocker:K})}};if(ee)return{...$,ref:u,href:ee,...P&&{children:P},...k&&{target:k},...b&&{disabled:b},...T&&{style:T},...M&&{className:M},...R&&{onClick:R},...O&&{onFocus:O},...A&&{onMouseEnter:A},...G&&{onMouseLeave:G},...W&&{onTouchStart:W}};const je=Re=>{b||ae&&ye()},Fe=je,Ue=Re=>{if(!(b||!ae))if(!xe)ye();else{const Be=Re.target;if(gi.has(Be))return;const Ge=setTimeout(()=>{gi.delete(Be),ye()},xe);gi.set(Be,Ge)}},Ct=Re=>{if(b||!ae||!xe)return;const Be=Re.target,Ge=gi.get(Be);Ge&&(clearTimeout(Ge),gi.delete(Be))},rt=Ee?Pr(c,{})??Bk:Bd,ot=Ee?Bd:Pr(f,{})??Bd,mt=[M,rt.className,ot.className].filter(Boolean).join(" "),bt=(T||rt.style||ot.style)&&{...T,...rt.style,...ot.style};return{...$,...rt,...ot,href:ue?.href,ref:u,onClick:yi([R,Te]),onFocus:yi([O,je]),onMouseEnter:yi([A,Ue]),onMouseLeave:yi([G,Ct]),onTouchStart:yi([W,Fe]),disabled:!!b,target:k,...bt&&{style:bt},...mt&&{className:mt},...b&&Hk,...Ee&&Vk,...s&&Yk}}const Bd={},Bk={className:"active"},Hk={role:"link","aria-disabled":!0},Vk={"data-status":"active","aria-current":"page"},Yk={"data-transitioning":"transitioning"},gi=new WeakMap,Uk={rootMargin:"100px"},yi=e=>t=>{for(const n of e)if(n){if(t.defaultPrevented)return;n(t)}},pt=L.forwardRef((e,t)=>{const{_asChild:n,...s}=e,{type:i,ref:l,...u}=$k(s,t),c=typeof s.children=="function"?s.children({isActive:u["data-status"]==="active"}):s.children;return n===void 0&&delete u.disabled,L.createElement(n||"a",{...u,ref:l},c)});function Qk(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}let qk=class extends N0{constructor(t){super(t),this.useMatch=n=>On({select:n?.select,from:this.id,structuralSharing:n?.structuralSharing}),this.useRouteContext=n=>On({...n,from:this.id,select:s=>n?.select?n.select(s.context):s.context}),this.useSearch=n=>qf({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useParams=n=>Qf({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useLoaderDeps=n=>Uf({...n,from:this.id}),this.useLoaderData=n=>Yf({...n,from:this.id}),this.useNavigate=()=>Xi({from:this.fullPath}),this.Link=de.forwardRef((n,s)=>x.jsx(pt,{ref:s,from:this.fullPath,...n})),this.$$typeof=Symbol.for("react.memo")}};function Kk(e){return new qk(e)}function Gk(){return e=>Zk(e)}class Xk extends kk{constructor(t){super(t),this.useMatch=n=>On({select:n?.select,from:this.id,structuralSharing:n?.structuralSharing}),this.useRouteContext=n=>On({...n,from:this.id,select:s=>n?.select?n.select(s.context):s.context}),this.useSearch=n=>qf({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useParams=n=>Qf({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useLoaderDeps=n=>Uf({...n,from:this.id}),this.useLoaderData=n=>Yf({...n,from:this.id}),this.useNavigate=()=>Xi({from:this.fullPath}),this.Link=de.forwardRef((n,s)=>x.jsx(pt,{ref:s,from:this.fullPath,...n})),this.$$typeof=Symbol.for("react.memo")}}function Zk(e){return new Xk(e)}function go(e){return typeof e=="object"?new Cg(e,{silent:!0}).createRoute(e):new Cg(e,{silent:!0}).createRoute}class Cg{constructor(t,n){this.path=t,this.createRoute=s=>{this.silent;const i=Kk(s);return i.isRoot=!1,i},this.silent=n?.silent}}class Eg{constructor(t){this.useMatch=n=>On({select:n?.select,from:this.options.id,structuralSharing:n?.structuralSharing}),this.useRouteContext=n=>On({from:this.options.id,select:s=>n?.select?n.select(s.context):s.context}),this.useSearch=n=>qf({select:n?.select,structuralSharing:n?.structuralSharing,from:this.options.id}),this.useParams=n=>Qf({select:n?.select,structuralSharing:n?.structuralSharing,from:this.options.id}),this.useLoaderDeps=n=>Uf({...n,from:this.options.id}),this.useLoaderData=n=>Yf({...n,from:this.options.id}),this.useNavigate=()=>{const n=Kt();return Xi({from:n.routesById[this.options.id].fullPath})},this.options=t,this.$$typeof=Symbol.for("react.memo")}}function Ng(e){return typeof e=="object"?new Eg(e):t=>new Eg({id:e,...t})}function Jk(){const e=Kt(),t=L.useRef({router:e,mounted:!1}),[n,s]=L.useState(!1),{hasPendingMatches:i,isLoading:l}=Ft({select:p=>({isLoading:p.isLoading,hasPendingMatches:p.matches.some(g=>g.status==="pending")}),structuralSharing:!0}),u=Ad(l),c=l||n||i,f=Ad(c),h=l||i,m=Ad(h);return e.startTransition=p=>{s(!0),L.startTransition(()=>{p(),s(!1)})},L.useEffect(()=>{const p=e.history.subscribe(e.load),g=e.buildLocation({to:e.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return lo(e.latestLocation.publicHref)!==lo(g.publicHref)&&e.commitLocation({...g,replace:!0}),()=>{p()}},[e,e.history]),wl(()=>{if(typeof window<"u"&&e.ssr||t.current.router===e&&t.current.mounted)return;t.current={router:e,mounted:!0},(async()=>{try{await e.load()}catch(g){console.error(g)}})()},[e]),wl(()=>{u&&!l&&e.emit({type:"onLoad",...uo(e.state)})},[u,e,l]),wl(()=>{m&&!h&&e.emit({type:"onBeforeRouteMount",...uo(e.state)})},[h,m,e]),wl(()=>{if(f&&!c){const p=uo(e.state);e.emit({type:"onResolved",...p}),e.__store.setState(g=>({...g,status:"idle",resolvedLocation:g.location})),p.hrefChanged&&ek(e)}},[c,f,e]),null}function e_(e){const t=Ft({select:n=>`not-found-${n.location.pathname}-${n.status}`});return x.jsx(Vf,{getResetKey:()=>t,onCatch:(n,s)=>{if(Ut(n))e.onCatch?.(n,s);else throw n},errorComponent:({error:n})=>{if(Ut(n))return e.fallback?.(n);throw n},children:e.children})}function t_(){return x.jsx("p",{children:"Not Found"})}function as(e){return x.jsx(x.Fragment,{children:e.children})}function R0(e,t,n){return t.options.notFoundComponent?x.jsx(t.options.notFoundComponent,{...n}):e.options.defaultNotFoundComponent?x.jsx(e.options.defaultNotFoundComponent,{...n}):x.jsx(t_,{})}function n_({children:e}){const t=Kt();return t.isServer?x.jsx("script",{nonce:t.options.ssr?.nonce,dangerouslySetInnerHTML:{__html:e+";document.currentScript.remove()"}}):null}function r_(){const e=Kt();if(!e.isScrollRestoring||!e.isServer||typeof e.options.scrollRestoration=="function"&&!e.options.scrollRestoration({location:e.latestLocation}))return null;const n=(e.options.getScrollRestorationKey||gf)(e.latestLocation),s=n!==gf(e.latestLocation)?n:void 0,i={storageKey:Xl,shouldScrollRestoration:!0};return s&&(i.key=s),x.jsx(n_,{children:`(${g0.toString()})(${JSON.stringify(i)})`})}const D0=L.memo(function({matchId:t}){const n=Kt(),s=Ft({select:N=>{const P=N.matches.find(k=>k.id===t);return er(P),{routeId:P.routeId,ssr:P.ssr,_displayPending:P._displayPending}},structuralSharing:!0}),i=n.routesById[s.routeId],l=i.options.pendingComponent??n.options.defaultPendingComponent,u=l?x.jsx(l,{}):null,c=i.options.errorComponent??n.options.defaultErrorComponent,f=i.options.onCatch??n.options.defaultOnCatch,h=i.isRoot?i.options.notFoundComponent??n.options.notFoundRoute?.options.component:i.options.notFoundComponent,m=s.ssr===!1||s.ssr==="data-only",p=(!i.isRoot||i.options.wrapInSuspense||m)&&(i.options.wrapInSuspense??l??(i.options.errorComponent?.preload||m))?L.Suspense:as,g=c?Vf:as,w=h?e_:as,S=Ft({select:N=>N.loadedAt}),_=Ft({select:N=>{const P=N.matches.findIndex(k=>k.id===t);return N.matches[P-1]?.routeId}}),C=i.isRoot?i.options.shellComponent??as:as;return x.jsxs(C,{children:[x.jsx(xu.Provider,{value:t,children:x.jsx(p,{fallback:u,children:x.jsx(g,{getResetKey:()=>S,errorComponent:c||vu,onCatch:(N,P)=>{if(Ut(N))throw N;f?.(N,P)},children:x.jsx(w,{fallback:N=>{if(!h||N.routeId&&N.routeId!==s.routeId||!N.routeId&&!i.isRoot)throw N;return L.createElement(h,N)},children:m||s._displayPending?x.jsx(Ck,{fallback:u,children:x.jsx(bg,{matchId:t})}):x.jsx(bg,{matchId:t})})})})}),_===Vt&&n.options.scrollRestoration?x.jsxs(x.Fragment,{children:[x.jsx(o_,{}),x.jsx(r_,{})]}):null]})});function o_(){const e=Kt(),t=L.useRef(void 0);return x.jsx("script",{suppressHydrationWarning:!0,ref:n=>{n&&(t.current===void 0||t.current.href!==e.latestLocation.href)&&(e.emit({type:"onRendered",...uo(e.state)}),t.current=e.latestLocation)}},e.latestLocation.state.__TSR_key)}const bg=L.memo(function({matchId:t}){const n=Kt(),{match:s,key:i,routeId:l}=Ft({select:f=>{const h=f.matches.find(S=>S.id===t),m=h.routeId,g=(n.routesById[m].options.remountDeps??n.options.defaultRemountDeps)?.({routeId:m,loaderDeps:h.loaderDeps,params:h._strictParams,search:h._strictSearch});return{key:g?JSON.stringify(g):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}),u=n.routesById[l],c=L.useMemo(()=>{const f=u.options.component??n.options.defaultComponent;return f?x.jsx(f,{},i):x.jsx(T0,{})},[i,u.options.component,n.options.defaultComponent]);if(s._displayPending)throw n.getMatch(s.id)?._nonReactive.displayPendingPromise;if(s._forcePending)throw n.getMatch(s.id)?._nonReactive.minPendingPromise;if(s.status==="pending"){const f=u.options.pendingMinMs??n.options.defaultPendingMinMs;if(f){const h=n.getMatch(s.id);if(h&&!h._nonReactive.minPendingPromise&&!n.isServer){const m=ms();h._nonReactive.minPendingPromise=m,setTimeout(()=>{m.resolve(),h._nonReactive.minPendingPromise=void 0},f)}}throw n.getMatch(s.id)?._nonReactive.loadPromise}if(s.status==="notFound")return er(Ut(s.error)),R0(n,u,s.error);if(s.status==="redirected")throw er(an(s.error)),n.getMatch(s.id)?._nonReactive.loadPromise;if(s.status==="error"){if(n.isServer){const f=(u.options.errorComponent??n.options.defaultErrorComponent)||vu;return x.jsx(f,{error:s.error,reset:void 0,info:{componentStack:""}})}throw s.error}return c}),T0=L.memo(function(){const t=Kt(),n=L.useContext(xu),s=Ft({select:h=>h.matches.find(m=>m.id===n)?.routeId}),i=t.routesById[s],l=Ft({select:h=>{const p=h.matches.find(g=>g.id===n);return er(p),p.globalNotFound}}),u=Ft({select:h=>{const m=h.matches,p=m.findIndex(g=>g.id===n);return m[p+1]?.id}}),c=t.options.defaultPendingComponent?x.jsx(t.options.defaultPendingComponent,{}):null;if(l)return R0(t,i,void 0);if(!u)return null;const f=x.jsx(D0,{matchId:u});return s===Vt?x.jsx(L.Suspense,{fallback:c,children:f}):f});function s_(){const e=Kt(),n=e.routesById[Vt].options.pendingComponent??e.options.defaultPendingComponent,s=n?x.jsx(n,{}):null,i=e.isServer||typeof document<"u"&&e.ssr?as:L.Suspense,l=x.jsxs(i,{fallback:s,children:[!e.isServer&&x.jsx(Jk,{}),x.jsx(i_,{})]});return e.options.InnerWrap?x.jsx(e.options.InnerWrap,{children:l}):l}function i_(){const e=Kt(),t=Ft({select:i=>i.matches[0]?.id}),n=Ft({select:i=>i.loadedAt}),s=t?x.jsx(D0,{matchId:t}):null;return x.jsx(xu.Provider,{value:t,children:e.options.disableGlobalCatchBoundary?s:x.jsx(Vf,{getResetKey:()=>n,errorComponent:vu,onCatch:i=>{i.message||i.toString()},children:s})})}const a_=e=>new l_(e);class l_ extends gk{constructor(t){super(t)}}typeof globalThis<"u"?(globalThis.createFileRoute=go,globalThis.createLazyFileRoute=Ng):typeof window<"u"&&(window.createFileRoute=go,window.createLazyFileRoute=Ng);function u_({router:e,children:t,...n}){Object.keys(n).length>0&&e.update({...e.options,...n,context:{...e.options.context,...n.context}});const s=M0(),i=x.jsx(s.Provider,{value:e,children:t});return e.options.Wrap?x.jsx(e.options.Wrap,{children:i}):i}function c_({router:e,...t}){return x.jsx(u_,{router:e,...t,children:x.jsx(s_,{})})}var Sl={},Mg;function d_(){if(Mg)return Sl;Mg=1;var e=P0();return Sl.createRoot=e.createRoot,Sl.hydrateRoot=e.hydrateRoot,Sl}var f_=d_();const O0=L.createContext(null),h_=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/stemtrace/ws`,Pg=3e3;function p_({children:e}){const[t,n]=L.useState("connecting"),[s,i]=L.useState(null),[l,u]=L.useState([]),c=l0(),f=L.useRef(null),h=L.useRef(null),m=L.useCallback(()=>{if(!(f.current?.readyState===WebSocket.OPEN||f.current?.readyState===WebSocket.CONNECTING)){n("connecting");try{const g=new WebSocket(h_);f.current=g,g.onopen=()=>{n("connected"),console.log("[WebSocket] Connected")},g.onmessage=w=>{try{const S=JSON.parse(w.data);i(S),u(_=>[S,..._].slice(0,100)),c.invalidateQueries({queryKey:["tasks"]}),c.invalidateQueries({queryKey:["graphs"]})}catch(S){console.error("[WebSocket] Failed to parse message:",S)}},g.onclose=()=>{n("disconnected"),f.current=null,console.log("[WebSocket] Disconnected, will retry in 3s..."),h.current&&clearTimeout(h.current),h.current=window.setTimeout(()=>{m()},Pg)},g.onerror=()=>{n("error")}}catch(g){n("error"),console.error("[WebSocket] Failed to connect:",g),h.current&&clearTimeout(h.current),h.current=window.setTimeout(()=>{m()},Pg)}}},[c]);L.useEffect(()=>(m(),()=>{h.current&&clearTimeout(h.current),f.current&&f.current.close()}),[m]);const p={connectionStatus:t,isConnected:t==="connected",lastEvent:s,events:l};return x.jsx(O0.Provider,{value:p,children:e})}function jr(){const e=L.useContext(O0);if(!e)throw new Error("useWebSocketContext must be used within a WebSocketProvider");return e}const yo="/stemtrace/api";async function I0(e){const t=new URLSearchParams;e?.limit&&t.set("limit",e.limit.toString()),e?.offset&&t.set("offset",e.offset.toString()),e?.state&&t.set("state",e.state),e?.name&&t.set("name",e.name),e?.from_date&&t.set("from_date",e.from_date),e?.to_date&&t.set("to_date",e.to_date);const n=`${yo}/tasks${t.toString()?`?${t}`:""}`,s=await fetch(n);if(!s.ok)throw new Error("Failed to fetch tasks");return s.json()}async function m_(e){const t=await fetch(`${yo}/tasks/${e}`);if(!t.ok)throw new Error("Failed to fetch task");return t.json()}async function g_(e){const t=new URLSearchParams;e?.limit&&t.set("limit",e.limit.toString()),e?.offset&&t.set("offset",e.offset.toString()),e?.from_date&&t.set("from_date",e.from_date),e?.to_date&&t.set("to_date",e.to_date);const n=`${yo}/graphs${t.toString()?`?${t}`:""}`,s=await fetch(n);if(!s.ok)throw new Error("Failed to fetch graphs");return s.json()}async function y_(e){const t=await fetch(`${yo}/graphs/${e}`);if(!t.ok)throw new Error("Failed to fetch graph");return t.json()}async function v_(){const e=await fetch(`${yo}/health`);if(!e.ok)throw new Error("Failed to fetch health");return e.json()}async function x_(e){const t=e?`${yo}/tasks/registry?query=${encodeURIComponent(e)}`:`${yo}/tasks/registry`,n=await fetch(t);if(!n.ok)throw new Error("Failed to fetch task registry");return n.json()}const Cs=5e3,Kf=50;function w_(e){const{isConnected:t}=jr();return Gi({queryKey:["tasks",e],queryFn:()=>I0({...e,limit:Kf}),refetchInterval:t?!1:Cs})}function S_(e){const{isConnected:t}=jr();return d0({queryKey:["tasks-infinite",e],queryFn:({pageParam:n})=>I0({...e,limit:Kf,offset:n}),initialPageParam:0,getNextPageParam:n=>{const s=n.offset+n.limit;return s<n.total?s:void 0},refetchInterval:t?!1:Cs})}function k_(e){const{isConnected:t}=jr();return Gi({queryKey:["tasks",e],queryFn:()=>m_(e),enabled:!!e,refetchInterval:t?!1:Cs})}function __(e){const{isConnected:t}=jr();return d0({queryKey:["graphs-infinite",e],queryFn:({pageParam:n})=>g_({...e,limit:Kf,offset:n}),initialPageParam:0,getNextPageParam:n=>{const s=n.offset+n.limit;return s<n.total?s:void 0},refetchInterval:t?!1:Cs})}function C_(e){const{isConnected:t}=jr();return Gi({queryKey:["graphs",e],queryFn:()=>y_(e),enabled:!!e,refetchInterval:t?!1:Cs})}function E_(){const{isConnected:e}=jr();return Gi({queryKey:["health"],queryFn:v_,refetchInterval:e?!1:Cs})}function N_(e){const{isConnected:t}=jr();return Gi({queryKey:["taskRegistry",e],queryFn:()=>x_(e),refetchInterval:t?!1:3e4})}const b_={top:{container:"bottom-full left-1/2 -translate-x-1/2 mb-2",arrow:"top-full left-1/2 -translate-x-1/2 border-t-slate-800 border-x-transparent border-b-transparent"},bottom:{container:"top-full left-1/2 -translate-x-1/2 mt-2",arrow:"bottom-full left-1/2 -translate-x-1/2 border-b-slate-800 border-x-transparent border-t-transparent"},left:{container:"right-full top-1/2 -translate-y-1/2 mr-2",arrow:"left-full top-1/2 -translate-y-1/2 border-l-slate-800 border-y-transparent border-r-transparent"},right:{container:"left-full top-1/2 -translate-y-1/2 ml-2",arrow:"right-full top-1/2 -translate-y-1/2 border-r-slate-800 border-y-transparent border-l-transparent"}};function M_({content:e,placement:t="bottom",children:n}){const s=b_[t];return x.jsxs("div",{className:"relative group",children:[n,x.jsxs("div",{className:`absolute ${s.container} px-2 py-1 text-xs text-slate-200 bg-slate-800 rounded shadow-lg whitespace-nowrap opacity-0 invisible group-hover:opacity-100 group-hover:visible transition-opacity duration-150 pointer-events-none z-50`,children:[e,x.jsx("div",{className:`absolute ${s.arrow} border-4`})]})]})}const Es=Gk()({component:P_});function P_(){const{connectionStatus:e,isConnected:t}=jr(),{data:n,isError:s}=E_();let i,l,u;return s?(i="Offline",l="bg-red-500",u="Server is unreachable. Check if stemtrace is running."):t?(i="Live",l="bg-green-500",u="Real-time updates via WebSocket"):e==="connecting"?(i="Connecting",l="bg-amber-500 animate-pulse",u="Connecting to WebSocket..."):(i="Polling",l="bg-amber-500",u="Updates every 5s. For real-time updates, configure WebSocket proxy."),x.jsxs("div",{className:"min-h-screen bg-slate-950",children:[x.jsx("header",{className:"border-b border-slate-800 bg-slate-900/50 backdrop-blur sticky top-0 z-50",children:x.jsx("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:x.jsxs("div",{className:"flex items-center justify-between h-14",children:[x.jsxs(pt,{to:"/",className:"flex items-baseline gap-2",children:[x.jsx("span",{className:"text-lg font-bold bg-gradient-to-r from-green-400 to-emerald-500 bg-clip-text text-transparent",children:"stemtrace"}),n?.version&&x.jsxs("span",{className:"text-xs text-slate-500",children:["v",n.version]})]}),x.jsxs("nav",{className:"flex items-center gap-6",children:[x.jsx(pt,{to:"/",className:"text-sm text-slate-400 hover:text-slate-100 transition-colors [&.active]:text-slate-100",children:"Tasks"}),x.jsx(pt,{to:"/graphs",className:"text-sm text-slate-400 hover:text-slate-100 transition-colors [&.active]:text-slate-100",children:"Graphs"}),x.jsx(pt,{to:"/registry",className:"text-sm text-slate-400 hover:text-slate-100 transition-colors [&.active]:text-slate-100",children:"Registry"})]}),x.jsx(M_,{content:u,placement:"bottom",children:x.jsxs("div",{className:"flex items-center gap-2 cursor-help",children:[x.jsx("span",{className:`w-2 h-2 rounded-full ${l}`}),x.jsx("span",{className:"text-xs text-slate-500",children:i})]})})]})})}),x.jsx("main",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8",children:x.jsx(T0,{})}),!1]})}const R_=go("/registry")({component:D_});function D_(){const[e,t]=L.useState(""),{data:n,isLoading:s,error:i}=N_(e||void 0);return x.jsxs("div",{className:"space-y-6",children:[x.jsx("div",{className:"flex items-center justify-between",children:x.jsxs("div",{children:[x.jsx("h1",{className:"text-2xl font-bold text-slate-100",children:"Task Registry"}),x.jsxs("p",{className:"text-sm text-slate-400 mt-1",children:["All discovered task definitions (",n?.total??0," tasks)"]})]})}),x.jsxs("div",{className:"relative",children:[x.jsx("input",{type:"text",placeholder:"Search tasks...",value:e,onChange:l=>t(l.target.value),className:"w-full bg-slate-900 border border-slate-700 rounded-lg px-4 py-2.5 text-slate-100 placeholder-slate-500 focus:outline-none focus:ring-2 focus:ring-emerald-500/50 focus:border-emerald-500"}),x.jsx("svg",{"aria-hidden":"true",className:"absolute right-3 top-1/2 -translate-y-1/2 w-5 h-5 text-slate-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:x.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})})]}),s&&x.jsx("div",{className:"space-y-3",children:[...Array(5)].map((l,u)=>x.jsxs("div",{className:"bg-slate-900 rounded-xl border border-slate-800 p-4 animate-pulse",children:[x.jsx("div",{className:"h-5 w-64 bg-slate-800 rounded"}),x.jsx("div",{className:"h-4 w-48 bg-slate-800 rounded mt-2"})]},u))}),i&&x.jsx("div",{className:"text-center py-12",children:x.jsx("p",{className:"text-red-400",children:"Failed to load task registry"})}),n&&n.tasks.length>0&&x.jsx("div",{className:"space-y-3",children:n.tasks.map(l=>x.jsx(T_,{task:l},l.name))}),n&&n.tasks.length===0&&x.jsxs("div",{className:"text-center py-12 bg-slate-900 rounded-xl border border-slate-800",children:[x.jsx("svg",{"aria-hidden":"true",className:"w-12 h-12 text-slate-600 mx-auto mb-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:x.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2"})}),x.jsx("p",{className:"text-slate-400",children:e?"No tasks match your search":"No tasks discovered yet"}),x.jsx("p",{className:"text-sm text-slate-500 mt-1",children:"Run some Celery tasks to see them appear here"})]})]})}function T_({task:e}){const[t,n]=L.useState(!1),s=e.name.split(".").pop()||e.name;return x.jsxs("div",{className:"bg-slate-900 rounded-xl border border-slate-800 overflow-hidden",children:[x.jsxs("button",{type:"button",onClick:()=>n(!t),className:"w-full p-4 flex items-center justify-between text-left hover:bg-slate-800/50 transition-colors",children:[x.jsxs("div",{className:"flex items-center gap-3",children:[x.jsx("div",{className:"w-8 h-8 rounded-lg bg-emerald-500/10 flex items-center justify-center",children:x.jsx("svg",{"aria-hidden":"true",className:"w-4 h-4 text-emerald-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:x.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 10V3L4 14h7v7l9-11h-7z"})})}),x.jsxs("div",{children:[x.jsx("h3",{className:"font-medium text-slate-100",children:s}),x.jsx("p",{className:"text-sm text-slate-500 font-mono",children:e.module||"unknown"})]})]}),x.jsxs("div",{className:"flex items-center gap-3",children:[e.bound&&x.jsx("span",{className:"text-xs px-2 py-1 rounded bg-slate-800 text-slate-400",children:"bound"}),x.jsx("svg",{"aria-hidden":"true",className:`w-5 h-5 text-slate-500 transition-transform ${t?"rotate-180":""}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:x.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]})]}),t&&x.jsxs("div",{className:"border-t border-slate-800 p-4 space-y-4",children:[x.jsxs("div",{children:[x.jsx("dt",{className:"text-xs text-slate-500 mb-1",children:"Full Name"}),x.jsx("dd",{className:"font-mono text-sm text-slate-300",children:e.name})]}),e.signature&&x.jsxs("div",{children:[x.jsx("dt",{className:"text-xs text-slate-500 mb-1",children:"Signature"}),x.jsx("dd",{className:"font-mono text-sm text-emerald-400 bg-slate-950 rounded-lg px-3 py-2",children:e.signature})]}),e.docstring&&x.jsxs("div",{children:[x.jsx("dt",{className:"text-xs text-slate-500 mb-1",children:"Documentation"}),x.jsx("dd",{className:"text-sm text-slate-300 whitespace-pre-wrap",children:e.docstring})]}),x.jsx("div",{className:"flex gap-2 pt-2",children:x.jsx(pt,{to:"/",search:{name:s},className:"text-xs px-3 py-1.5 rounded-lg bg-slate-800 text-slate-300 hover:bg-slate-700 transition-colors",children:"View runs →"})})]})]})}const j0=6048e5,O_=864e5,Rg=Symbol.for("constructDateFrom");function it(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&Rg in e?e[Rg](t):e instanceof Date?new e.constructor(t):new Date(t)}function $e(e,t){return it(t||e,e)}function Gf(e,t,n){const s=$e(e,n?.in);return isNaN(t)?it(e,NaN):(t&&s.setDate(s.getDate()+t),s)}function Xf(e,t,n){const s=$e(e,n?.in);if(isNaN(t))return it(e,NaN);if(!t)return s;const i=s.getDate(),l=it(e,s.getTime());l.setMonth(s.getMonth()+t+1,0);const u=l.getDate();return i>=u?l:(s.setFullYear(l.getFullYear(),l.getMonth(),i),s)}let I_={};function Zi(){return I_}function Ir(e,t){const n=Zi(),s=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,i=$e(e,t?.in),l=i.getDay(),u=(l<s?7:0)+l-s;return i.setDate(i.getDate()-u),i.setHours(0,0,0,0),i}function Li(e,t){return Ir(e,{...t,weekStartsOn:1})}function L0(e,t){const n=$e(e,t?.in),s=n.getFullYear(),i=it(n,0);i.setFullYear(s+1,0,4),i.setHours(0,0,0,0);const l=Li(i),u=it(n,0);u.setFullYear(s,0,4),u.setHours(0,0,0,0);const c=Li(u);return n.getTime()>=l.getTime()?s+1:n.getTime()>=c.getTime()?s:s-1}function Dg(e){const t=$e(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function Ns(e,...t){const n=it.bind(null,t.find(s=>typeof s=="object"));return t.map(n)}function Kn(e,t){const n=$e(e,t?.in);return n.setHours(0,0,0,0),n}function Zf(e,t,n){const[s,i]=Ns(n?.in,e,t),l=Kn(s),u=Kn(i),c=+l-Dg(l),f=+u-Dg(u);return Math.round((c-f)/O_)}function j_(e,t){const n=L0(e,t),s=it(e,0);return s.setFullYear(n,0,4),s.setHours(0,0,0,0),Li(s)}function F0(e,t,n){return Gf(e,t*7,n)}function L_(e,t,n){return Xf(e,t*12,n)}function F_(e,t){let n,s=t?.in;return e.forEach(i=>{!s&&typeof i=="object"&&(s=it.bind(null,i));const l=$e(i,s);(!n||n<l||isNaN(+l))&&(n=l)}),it(s,n||NaN)}function A_(e,t){let n,s=t?.in;return e.forEach(i=>{!s&&typeof i=="object"&&(s=it.bind(null,i));const l=$e(i,s);(!n||n>l||isNaN(+l))&&(n=l)}),it(s,n||NaN)}function z_(e,t,n){const[s,i]=Ns(n?.in,e,t);return+Kn(s)==+Kn(i)}function A0(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function W_(e){return!(!A0(e)&&typeof e!="number"||isNaN(+$e(e)))}function z0(e,t,n){const[s,i]=Ns(n?.in,e,t),l=s.getFullYear()-i.getFullYear(),u=s.getMonth()-i.getMonth();return l*12+u}function kl(e,t){const n=$e(e,t?.in);return n.setHours(23,59,59,999),n}function vf(e,t){const n=$e(e,t?.in),s=n.getMonth();return n.setFullYear(n.getFullYear(),s+1,0),n.setHours(23,59,59,999),n}function W0(e,t){const[n,s]=Ns(e,t.start,t.end);return{start:n,end:s}}function $_(e,t){const{start:n,end:s}=W0(t?.in,e);let i=+n>+s;const l=i?+n:+s,u=i?s:n;u.setHours(0,0,0,0),u.setDate(1);let c=1;const f=[];for(;+u<=l;)f.push(it(n,u)),u.setMonth(u.getMonth()+c);return i?f.reverse():f}function xf(e,t){const n=$e(e,t?.in);return n.setDate(1),n.setHours(0,0,0,0),n}function B_(e,t){const n=$e(e,t?.in),s=n.getFullYear();return n.setFullYear(s+1,0,0),n.setHours(23,59,59,999),n}function $0(e,t){const n=$e(e,t?.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}function H_(e,t){const{start:n,end:s}=W0(t?.in,e);let i=+n>+s;const l=i?+n:+s,u=i?s:n;u.setHours(0,0,0,0),u.setMonth(0,1);let c=1;const f=[];for(;+u<=l;)f.push(it(n,u)),u.setFullYear(u.getFullYear()+c);return i?f.reverse():f}function eu(e,t){const n=Zi(),s=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,i=$e(e,t?.in),l=i.getDay(),u=(l<s?-7:0)+6-(l-s);return i.setDate(i.getDate()+u),i.setHours(23,59,59,999),i}function V_(e,t){return eu(e,{...t,weekStartsOn:1})}const Y_={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},U_=(e,t,n)=>{let s;const i=Y_[e];return typeof i=="string"?s=i:t===1?s=i.one:s=i.other.replace("{{count}}",t.toString()),n?.addSuffix?n.comparison&&n.comparison>0?"in "+s:s+" ago":s};function Hd(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const Q_={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},q_={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},K_={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},G_={date:Hd({formats:Q_,defaultWidth:"full"}),time:Hd({formats:q_,defaultWidth:"full"}),dateTime:Hd({formats:K_,defaultWidth:"full"})},X_={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Z_=(e,t,n,s)=>X_[e];function vi(e){return(t,n)=>{const s=n?.context?String(n.context):"standalone";let i;if(s==="formatting"&&e.formattingValues){const u=e.defaultFormattingWidth||e.defaultWidth,c=n?.width?String(n.width):u;i=e.formattingValues[c]||e.formattingValues[u]}else{const u=e.defaultWidth,c=n?.width?String(n.width):e.defaultWidth;i=e.values[c]||e.values[u]}const l=e.argumentCallback?e.argumentCallback(t):t;return i[l]}}const J_={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},eC={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},tC={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},nC={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},rC={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},oC={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},sC=(e,t)=>{const n=Number(e),s=n%100;if(s>20||s<10)switch(s%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},iC={ordinalNumber:sC,era:vi({values:J_,defaultWidth:"wide"}),quarter:vi({values:eC,defaultWidth:"wide",argumentCallback:e=>e-1}),month:vi({values:tC,defaultWidth:"wide"}),day:vi({values:nC,defaultWidth:"wide"}),dayPeriod:vi({values:rC,defaultWidth:"wide",formattingValues:oC,defaultFormattingWidth:"wide"})};function xi(e){return(t,n={})=>{const s=n.width,i=s&&e.matchPatterns[s]||e.matchPatterns[e.defaultMatchWidth],l=t.match(i);if(!l)return null;const u=l[0],c=s&&e.parsePatterns[s]||e.parsePatterns[e.defaultParseWidth],f=Array.isArray(c)?lC(c,p=>p.test(u)):aC(c,p=>p.test(u));let h;h=e.valueCallback?e.valueCallback(f):f,h=n.valueCallback?n.valueCallback(h):h;const m=t.slice(u.length);return{value:h,rest:m}}}function aC(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function lC(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function uC(e){return(t,n={})=>{const s=t.match(e.matchPattern);if(!s)return null;const i=s[0],l=t.match(e.parsePattern);if(!l)return null;let u=e.valueCallback?e.valueCallback(l[0]):l[0];u=n.valueCallback?n.valueCallback(u):u;const c=t.slice(i.length);return{value:u,rest:c}}}const cC=/^(\d+)(th|st|nd|rd)?/i,dC=/\d+/i,fC={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},hC={any:[/^b/i,/^(a|c)/i]},pC={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},mC={any:[/1/i,/2/i,/3/i,/4/i]},gC={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},yC={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},vC={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},xC={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},wC={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},SC={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},kC={ordinalNumber:uC({matchPattern:cC,parsePattern:dC,valueCallback:e=>parseInt(e,10)}),era:xi({matchPatterns:fC,defaultMatchWidth:"wide",parsePatterns:hC,defaultParseWidth:"any"}),quarter:xi({matchPatterns:pC,defaultMatchWidth:"wide",parsePatterns:mC,defaultParseWidth:"any",valueCallback:e=>e+1}),month:xi({matchPatterns:gC,defaultMatchWidth:"wide",parsePatterns:yC,defaultParseWidth:"any"}),day:xi({matchPatterns:vC,defaultMatchWidth:"wide",parsePatterns:xC,defaultParseWidth:"any"}),dayPeriod:xi({matchPatterns:wC,defaultMatchWidth:"any",parsePatterns:SC,defaultParseWidth:"any"})},ls={code:"en-US",formatDistance:U_,formatLong:G_,formatRelative:Z_,localize:iC,match:kC,options:{weekStartsOn:0,firstWeekContainsDate:1}};function _C(e,t){const n=$e(e,t?.in);return Zf(n,$0(n))+1}function Jf(e,t){const n=$e(e,t?.in),s=+Li(n)-+j_(n);return Math.round(s/j0)+1}function B0(e,t){const n=$e(e,t?.in),s=n.getFullYear(),i=Zi(),l=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??i.firstWeekContainsDate??i.locale?.options?.firstWeekContainsDate??1,u=it(t?.in||e,0);u.setFullYear(s+1,0,l),u.setHours(0,0,0,0);const c=Ir(u,t),f=it(t?.in||e,0);f.setFullYear(s,0,l),f.setHours(0,0,0,0);const h=Ir(f,t);return+n>=+c?s+1:+n>=+h?s:s-1}function CC(e,t){const n=Zi(),s=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,i=B0(e,t),l=it(t?.in||e,0);return l.setFullYear(i,0,s),l.setHours(0,0,0,0),Ir(l,t)}function eh(e,t){const n=$e(e,t?.in),s=+Ir(n,t)-+CC(n,t);return Math.round(s/j0)+1}function We(e,t){const n=e<0?"-":"",s=Math.abs(e).toString().padStart(t,"0");return n+s}const Er={y(e,t){const n=e.getFullYear(),s=n>0?n:1-n;return We(t==="yy"?s%100:s,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):We(n+1,2)},d(e,t){return We(e.getDate(),t.length)},a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];default:return n==="am"?"a.m.":"p.m."}},h(e,t){return We(e.getHours()%12||12,t.length)},H(e,t){return We(e.getHours(),t.length)},m(e,t){return We(e.getMinutes(),t.length)},s(e,t){return We(e.getSeconds(),t.length)},S(e,t){const n=t.length,s=e.getMilliseconds(),i=Math.trunc(s*Math.pow(10,n-3));return We(i,t.length)}},rs={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Tg={G:function(e,t,n){const s=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(s,{width:"abbreviated"});case"GGGGG":return n.era(s,{width:"narrow"});default:return n.era(s,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){const s=e.getFullYear(),i=s>0?s:1-s;return n.ordinalNumber(i,{unit:"year"})}return Er.y(e,t)},Y:function(e,t,n,s){const i=B0(e,s),l=i>0?i:1-i;if(t==="YY"){const u=l%100;return We(u,2)}return t==="Yo"?n.ordinalNumber(l,{unit:"year"}):We(l,t.length)},R:function(e,t){const n=L0(e);return We(n,t.length)},u:function(e,t){const n=e.getFullYear();return We(n,t.length)},Q:function(e,t,n){const s=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(s);case"QQ":return We(s,2);case"Qo":return n.ordinalNumber(s,{unit:"quarter"});case"QQQ":return n.quarter(s,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(s,{width:"narrow",context:"formatting"});default:return n.quarter(s,{width:"wide",context:"formatting"})}},q:function(e,t,n){const s=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(s);case"qq":return We(s,2);case"qo":return n.ordinalNumber(s,{unit:"quarter"});case"qqq":return n.quarter(s,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(s,{width:"narrow",context:"standalone"});default:return n.quarter(s,{width:"wide",context:"standalone"})}},M:function(e,t,n){const s=e.getMonth();switch(t){case"M":case"MM":return Er.M(e,t);case"Mo":return n.ordinalNumber(s+1,{unit:"month"});case"MMM":return n.month(s,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(s,{width:"narrow",context:"formatting"});default:return n.month(s,{width:"wide",context:"formatting"})}},L:function(e,t,n){const s=e.getMonth();switch(t){case"L":return String(s+1);case"LL":return We(s+1,2);case"Lo":return n.ordinalNumber(s+1,{unit:"month"});case"LLL":return n.month(s,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(s,{width:"narrow",context:"standalone"});default:return n.month(s,{width:"wide",context:"standalone"})}},w:function(e,t,n,s){const i=eh(e,s);return t==="wo"?n.ordinalNumber(i,{unit:"week"}):We(i,t.length)},I:function(e,t,n){const s=Jf(e);return t==="Io"?n.ordinalNumber(s,{unit:"week"}):We(s,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):Er.d(e,t)},D:function(e,t,n){const s=_C(e);return t==="Do"?n.ordinalNumber(s,{unit:"dayOfYear"}):We(s,t.length)},E:function(e,t,n){const s=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(s,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(s,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(s,{width:"short",context:"formatting"});default:return n.day(s,{width:"wide",context:"formatting"})}},e:function(e,t,n,s){const i=e.getDay(),l=(i-s.weekStartsOn+8)%7||7;switch(t){case"e":return String(l);case"ee":return We(l,2);case"eo":return n.ordinalNumber(l,{unit:"day"});case"eee":return n.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(i,{width:"short",context:"formatting"});default:return n.day(i,{width:"wide",context:"formatting"})}},c:function(e,t,n,s){const i=e.getDay(),l=(i-s.weekStartsOn+8)%7||7;switch(t){case"c":return String(l);case"cc":return We(l,t.length);case"co":return n.ordinalNumber(l,{unit:"day"});case"ccc":return n.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(i,{width:"narrow",context:"standalone"});case"cccccc":return n.day(i,{width:"short",context:"standalone"});default:return n.day(i,{width:"wide",context:"standalone"})}},i:function(e,t,n){const s=e.getDay(),i=s===0?7:s;switch(t){case"i":return String(i);case"ii":return We(i,t.length);case"io":return n.ordinalNumber(i,{unit:"day"});case"iii":return n.day(s,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(s,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(s,{width:"short",context:"formatting"});default:return n.day(s,{width:"wide",context:"formatting"})}},a:function(e,t,n){const i=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(i,{width:"narrow",context:"formatting"});default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(e,t,n){const s=e.getHours();let i;switch(s===12?i=rs.noon:s===0?i=rs.midnight:i=s/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(i,{width:"narrow",context:"formatting"});default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},B:function(e,t,n){const s=e.getHours();let i;switch(s>=17?i=rs.evening:s>=12?i=rs.afternoon:s>=4?i=rs.morning:i=rs.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(i,{width:"narrow",context:"formatting"});default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},h:function(e,t,n){if(t==="ho"){let s=e.getHours()%12;return s===0&&(s=12),n.ordinalNumber(s,{unit:"hour"})}return Er.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):Er.H(e,t)},K:function(e,t,n){const s=e.getHours()%12;return t==="Ko"?n.ordinalNumber(s,{unit:"hour"}):We(s,t.length)},k:function(e,t,n){let s=e.getHours();return s===0&&(s=24),t==="ko"?n.ordinalNumber(s,{unit:"hour"}):We(s,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):Er.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):Er.s(e,t)},S:function(e,t){return Er.S(e,t)},X:function(e,t,n){const s=e.getTimezoneOffset();if(s===0)return"Z";switch(t){case"X":return Ig(s);case"XXXX":case"XX":return to(s);default:return to(s,":")}},x:function(e,t,n){const s=e.getTimezoneOffset();switch(t){case"x":return Ig(s);case"xxxx":case"xx":return to(s);default:return to(s,":")}},O:function(e,t,n){const s=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Og(s,":");default:return"GMT"+to(s,":")}},z:function(e,t,n){const s=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Og(s,":");default:return"GMT"+to(s,":")}},t:function(e,t,n){const s=Math.trunc(+e/1e3);return We(s,t.length)},T:function(e,t,n){return We(+e,t.length)}};function Og(e,t=""){const n=e>0?"-":"+",s=Math.abs(e),i=Math.trunc(s/60),l=s%60;return l===0?n+String(i):n+String(i)+t+We(l,2)}function Ig(e,t){return e%60===0?(e>0?"-":"+")+We(Math.abs(e)/60,2):to(e,t)}function to(e,t=""){const n=e>0?"-":"+",s=Math.abs(e),i=We(Math.trunc(s/60),2),l=We(s%60,2);return n+i+t+l}const jg=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});default:return t.date({width:"full"})}},H0=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});default:return t.time({width:"full"})}},EC=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],s=n[1],i=n[2];if(!i)return jg(e,t);let l;switch(s){case"P":l=t.dateTime({width:"short"});break;case"PP":l=t.dateTime({width:"medium"});break;case"PPP":l=t.dateTime({width:"long"});break;default:l=t.dateTime({width:"full"});break}return l.replace("{{date}}",jg(s,t)).replace("{{time}}",H0(i,t))},NC={p:H0,P:EC},bC=/^D+$/,MC=/^Y+$/,PC=["D","DD","YY","YYYY"];function RC(e){return bC.test(e)}function DC(e){return MC.test(e)}function TC(e,t,n){const s=OC(e,t,n);if(console.warn(s),PC.includes(e))throw new RangeError(s)}function OC(e,t,n){const s=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${s} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const IC=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,jC=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,LC=/^'([^]*?)'?$/,FC=/''/g,AC=/[a-zA-Z]/;function vn(e,t,n){const s=Zi(),i=n?.locale??s.locale??ls,l=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??s.firstWeekContainsDate??s.locale?.options?.firstWeekContainsDate??1,u=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??s.weekStartsOn??s.locale?.options?.weekStartsOn??0,c=$e(e,n?.in);if(!W_(c))throw new RangeError("Invalid time value");let f=t.match(jC).map(m=>{const p=m[0];if(p==="p"||p==="P"){const g=NC[p];return g(m,i.formatLong)}return m}).join("").match(IC).map(m=>{if(m==="''")return{isToken:!1,value:"'"};const p=m[0];if(p==="'")return{isToken:!1,value:zC(m)};if(Tg[p])return{isToken:!0,value:m};if(p.match(AC))throw new RangeError("Format string contains an unescaped latin alphabet character `"+p+"`");return{isToken:!1,value:m}});i.localize.preprocessor&&(f=i.localize.preprocessor(c,f));const h={firstWeekContainsDate:l,weekStartsOn:u,locale:i};return f.map(m=>{if(!m.isToken)return m.value;const p=m.value;(!n?.useAdditionalWeekYearTokens&&DC(p)||!n?.useAdditionalDayOfYearTokens&&RC(p))&&TC(p,t,String(e));const g=Tg[p[0]];return g(c,p,i.localize,h)}).join("")}function zC(e){const t=e.match(LC);return t?t[1].replace(FC,"'"):e}function WC(e,t){const n=$e(e,t?.in),s=n.getFullYear(),i=n.getMonth(),l=it(n,0);return l.setFullYear(s,i+1,0),l.setHours(0,0,0,0),l.getDate()}function $C(e,t){return $e(e,t?.in).getMonth()}function BC(e,t){return $e(e,t?.in).getFullYear()}function HC(e,t){return+$e(e)>+$e(t)}function VC(e,t){return+$e(e)<+$e(t)}function YC(e,t,n){const[s,i]=Ns(n?.in,e,t);return s.getFullYear()===i.getFullYear()&&s.getMonth()===i.getMonth()}function UC(e,t,n){const[s,i]=Ns(n?.in,e,t);return s.getFullYear()===i.getFullYear()}function Vd(e,t,n){return Gf(e,-t,n)}function QC(e,t,n){const s=$e(e,n?.in),i=s.getFullYear(),l=s.getDate(),u=it(e,0);u.setFullYear(i,t,15),u.setHours(0,0,0,0);const c=WC(u);return s.setMonth(t,Math.min(l,c)),s}function qC(e,t,n){const s=$e(e,n?.in);return isNaN(+s)?it(e,NaN):(s.setFullYear(t),s)}function KC(e,t,n){return Xf(e,-1,n)}function GC(e,t,n){return F0(e,-1,n)}function XC(e,t,n="long"){return new Intl.DateTimeFormat("en-US",{hour:"numeric",timeZone:e,timeZoneName:n}).format(t).split(/\s/g).slice(2).join(" ")}const ZC={},Ei={};function so(e,t){try{const s=(ZC[e]||=new Intl.DateTimeFormat("en-US",{timeZone:e,timeZoneName:"longOffset"}).format)(t).split("GMT")[1];return s in Ei?Ei[s]:Lg(s,s.split(":"))}catch{if(e in Ei)return Ei[e];const n=e?.match(JC);return n?Lg(e,n.slice(1)):NaN}}const JC=/([+-]\d\d):?(\d\d)?/;function Lg(e,t){const n=+(t[0]||0),s=+(t[1]||0),i=+(t[2]||0)/60;return Ei[e]=n*60+s>0?n*60+s+i:n*60-s-i}class Dn extends Date{constructor(...t){super(),t.length>1&&typeof t[t.length-1]=="string"&&(this.timeZone=t.pop()),this.internal=new Date,isNaN(so(this.timeZone,this))?this.setTime(NaN):t.length?typeof t[0]=="number"&&(t.length===1||t.length===2&&typeof t[1]!="number")?this.setTime(t[0]):typeof t[0]=="string"?this.setTime(+new Date(t[0])):t[0]instanceof Date?this.setTime(+t[0]):(this.setTime(+new Date(...t)),V0(this),wf(this)):this.setTime(Date.now())}static tz(t,...n){return n.length?new Dn(...n,t):new Dn(Date.now(),t)}withTimeZone(t){return new Dn(+this,t)}getTimezoneOffset(){const t=-so(this.timeZone,this);return t>0?Math.floor(t):Math.ceil(t)}setTime(t){return Date.prototype.setTime.apply(this,arguments),wf(this),+this}[Symbol.for("constructDateFrom")](t){return new Dn(+new Date(t),this.timeZone)}}const Fg=/^(get|set)(?!UTC)/;Object.getOwnPropertyNames(Date.prototype).forEach(e=>{if(!Fg.test(e))return;const t=e.replace(Fg,"$1UTC");Dn.prototype[t]&&(e.startsWith("get")?Dn.prototype[e]=function(){return this.internal[t]()}:(Dn.prototype[e]=function(){return Date.prototype[t].apply(this.internal,arguments),eE(this),+this},Dn.prototype[t]=function(){return Date.prototype[t].apply(this,arguments),wf(this),+this}))});function wf(e){e.internal.setTime(+e),e.internal.setUTCSeconds(e.internal.getUTCSeconds()-Math.round(-so(e.timeZone,e)*60))}function eE(e){Date.prototype.setFullYear.call(e,e.internal.getUTCFullYear(),e.internal.getUTCMonth(),e.internal.getUTCDate()),Date.prototype.setHours.call(e,e.internal.getUTCHours(),e.internal.getUTCMinutes(),e.internal.getUTCSeconds(),e.internal.getUTCMilliseconds()),V0(e)}function V0(e){const t=so(e.timeZone,e),n=t>0?Math.floor(t):Math.ceil(t),s=new Date(+e);s.setUTCHours(s.getUTCHours()-1);const i=-new Date(+e).getTimezoneOffset(),l=-new Date(+s).getTimezoneOffset(),u=i-l,c=Date.prototype.getHours.apply(e)!==e.internal.getUTCHours();u&&c&&e.internal.setUTCMinutes(e.internal.getUTCMinutes()+u);const f=i-n;f&&Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+f);const h=new Date(+e);h.setUTCSeconds(0);const m=i>0?h.getSeconds():(h.getSeconds()-60)%60,p=Math.round(-(so(e.timeZone,e)*60))%60;(p||m)&&(e.internal.setUTCSeconds(e.internal.getUTCSeconds()+p),Date.prototype.setUTCSeconds.call(e,Date.prototype.getUTCSeconds.call(e)+p+m));const g=so(e.timeZone,e),w=g>0?Math.floor(g):Math.ceil(g),_=-new Date(+e).getTimezoneOffset()-w,C=w!==n,N=_-f;if(C&&N){Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+N);const P=so(e.timeZone,e),k=P>0?Math.floor(P):Math.ceil(P),b=w-k;b&&(e.internal.setUTCMinutes(e.internal.getUTCMinutes()+b),Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+b))}}class _t extends Dn{static tz(t,...n){return n.length?new _t(...n,t):new _t(Date.now(),t)}toISOString(){const[t,n,s]=this.tzComponents(),i=`${t}${n}:${s}`;return this.internal.toISOString().slice(0,-1)+i}toString(){return`${this.toDateString()} ${this.toTimeString()}`}toDateString(){const[t,n,s,i]=this.internal.toUTCString().split(" ");return`${t?.slice(0,-1)} ${s} ${n} ${i}`}toTimeString(){const t=this.internal.toUTCString().split(" ")[4],[n,s,i]=this.tzComponents();return`${t} GMT${n}${s}${i} (${XC(this.timeZone,this)})`}toLocaleString(t,n){return Date.prototype.toLocaleString.call(this,t,{...n,timeZone:n?.timeZone||this.timeZone})}toLocaleDateString(t,n){return Date.prototype.toLocaleDateString.call(this,t,{...n,timeZone:n?.timeZone||this.timeZone})}toLocaleTimeString(t,n){return Date.prototype.toLocaleTimeString.call(this,t,{...n,timeZone:n?.timeZone||this.timeZone})}tzComponents(){const t=this.getTimezoneOffset(),n=t>0?"-":"+",s=String(Math.floor(Math.abs(t)/60)).padStart(2,"0"),i=String(Math.abs(t)%60).padStart(2,"0");return[n,s,i]}withTimeZone(t){return new _t(+this,t)}[Symbol.for("constructDateFrom")](t){return new _t(+new Date(t),this.timeZone)}}const Ag=5,tE=4;function nE(e,t){const n=t.startOfMonth(e),s=n.getDay()>0?n.getDay():7,i=t.addDays(e,-s+1),l=t.addDays(i,Ag*7-1);return t.getMonth(e)===t.getMonth(l)?Ag:tE}function Y0(e,t){const n=t.startOfMonth(e),s=n.getDay();return s===1?n:s===0?t.addDays(n,-6):t.addDays(n,-1*(s-1))}function rE(e,t){const n=Y0(e,t),s=nE(e,t);return t.addDays(n,s*7-1)}const U0={...ls,labels:{labelDayButton:(e,t,n,s)=>{let i;s&&typeof s.format=="function"?i=s.format.bind(s):i=(u,c)=>vn(u,c,{locale:ls,...n});let l=i(e,"PPPP");return t.today&&(l=`Today, ${l}`),t.selected&&(l=`${l}, selected`),l},labelMonthDropdown:"Choose the Month",labelNext:"Go to the Next Month",labelPrevious:"Go to the Previous Month",labelWeekNumber:e=>`Week ${e}`,labelYearDropdown:"Choose the Year",labelGrid:(e,t,n)=>{let s;return n&&typeof n.format=="function"?s=n.format.bind(n):s=(i,l)=>vn(i,l,{locale:ls,...t}),s(e,"LLLL yyyy")},labelGridcell:(e,t,n,s)=>{let i;s&&typeof s.format=="function"?i=s.format.bind(s):i=(u,c)=>vn(u,c,{locale:ls,...n});let l=i(e,"PPPP");return t?.today&&(l=`Today, ${l}`),l},labelNav:"Navigation bar",labelWeekNumberHeader:"Week Number",labelWeekday:(e,t,n)=>{let s;return n&&typeof n.format=="function"?s=n.format.bind(n):s=(i,l)=>vn(i,l,{locale:ls,...t}),s(e,"cccc")}}};class Qt{constructor(t,n){this.Date=Date,this.today=()=>this.overrides?.today?this.overrides.today():this.options.timeZone?_t.tz(this.options.timeZone):new this.Date,this.newDate=(s,i,l)=>this.overrides?.newDate?this.overrides.newDate(s,i,l):this.options.timeZone?new _t(s,i,l,this.options.timeZone):new Date(s,i,l),this.addDays=(s,i)=>this.overrides?.addDays?this.overrides.addDays(s,i):Gf(s,i),this.addMonths=(s,i)=>this.overrides?.addMonths?this.overrides.addMonths(s,i):Xf(s,i),this.addWeeks=(s,i)=>this.overrides?.addWeeks?this.overrides.addWeeks(s,i):F0(s,i),this.addYears=(s,i)=>this.overrides?.addYears?this.overrides.addYears(s,i):L_(s,i),this.differenceInCalendarDays=(s,i)=>this.overrides?.differenceInCalendarDays?this.overrides.differenceInCalendarDays(s,i):Zf(s,i),this.differenceInCalendarMonths=(s,i)=>this.overrides?.differenceInCalendarMonths?this.overrides.differenceInCalendarMonths(s,i):z0(s,i),this.eachMonthOfInterval=s=>this.overrides?.eachMonthOfInterval?this.overrides.eachMonthOfInterval(s):$_(s),this.eachYearOfInterval=s=>{const i=this.overrides?.eachYearOfInterval?this.overrides.eachYearOfInterval(s):H_(s),l=new Set(i.map(c=>this.getYear(c)));if(l.size===i.length)return i;const u=[];return l.forEach(c=>{u.push(new Date(c,0,1))}),u},this.endOfBroadcastWeek=s=>this.overrides?.endOfBroadcastWeek?this.overrides.endOfBroadcastWeek(s):rE(s,this),this.endOfISOWeek=s=>this.overrides?.endOfISOWeek?this.overrides.endOfISOWeek(s):V_(s),this.endOfMonth=s=>this.overrides?.endOfMonth?this.overrides.endOfMonth(s):vf(s),this.endOfWeek=(s,i)=>this.overrides?.endOfWeek?this.overrides.endOfWeek(s,i):eu(s,this.options),this.endOfYear=s=>this.overrides?.endOfYear?this.overrides.endOfYear(s):B_(s),this.format=(s,i,l)=>{const u=this.overrides?.format?this.overrides.format(s,i,this.options):vn(s,i,this.options);return this.options.numerals&&this.options.numerals!=="latn"?this.replaceDigits(u):u},this.getISOWeek=s=>this.overrides?.getISOWeek?this.overrides.getISOWeek(s):Jf(s),this.getMonth=(s,i)=>this.overrides?.getMonth?this.overrides.getMonth(s,this.options):$C(s,this.options),this.getYear=(s,i)=>this.overrides?.getYear?this.overrides.getYear(s,this.options):BC(s,this.options),this.getWeek=(s,i)=>this.overrides?.getWeek?this.overrides.getWeek(s,this.options):eh(s,this.options),this.isAfter=(s,i)=>this.overrides?.isAfter?this.overrides.isAfter(s,i):HC(s,i),this.isBefore=(s,i)=>this.overrides?.isBefore?this.overrides.isBefore(s,i):VC(s,i),this.isDate=s=>this.overrides?.isDate?this.overrides.isDate(s):A0(s),this.isSameDay=(s,i)=>this.overrides?.isSameDay?this.overrides.isSameDay(s,i):z_(s,i),this.isSameMonth=(s,i)=>this.overrides?.isSameMonth?this.overrides.isSameMonth(s,i):YC(s,i),this.isSameYear=(s,i)=>this.overrides?.isSameYear?this.overrides.isSameYear(s,i):UC(s,i),this.max=s=>this.overrides?.max?this.overrides.max(s):F_(s),this.min=s=>this.overrides?.min?this.overrides.min(s):A_(s),this.setMonth=(s,i)=>this.overrides?.setMonth?this.overrides.setMonth(s,i):QC(s,i),this.setYear=(s,i)=>this.overrides?.setYear?this.overrides.setYear(s,i):qC(s,i),this.startOfBroadcastWeek=(s,i)=>this.overrides?.startOfBroadcastWeek?this.overrides.startOfBroadcastWeek(s,this):Y0(s,this),this.startOfDay=s=>this.overrides?.startOfDay?this.overrides.startOfDay(s):Kn(s),this.startOfISOWeek=s=>this.overrides?.startOfISOWeek?this.overrides.startOfISOWeek(s):Li(s),this.startOfMonth=s=>this.overrides?.startOfMonth?this.overrides.startOfMonth(s):xf(s),this.startOfWeek=(s,i)=>this.overrides?.startOfWeek?this.overrides.startOfWeek(s,this.options):Ir(s,this.options),this.startOfYear=s=>this.overrides?.startOfYear?this.overrides.startOfYear(s):$0(s),this.options={locale:U0,...t},this.overrides=n}getDigitMap(){const{numerals:t="latn"}=this.options,n=new Intl.NumberFormat("en-US",{numberingSystem:t}),s={};for(let i=0;i<10;i++)s[i.toString()]=n.format(i);return s}replaceDigits(t){const n=this.getDigitMap();return t.replace(/\d/g,s=>n[s]||s)}formatNumber(t){return this.replaceDigits(t.toString())}getMonthYearOrder(){const t=this.options.locale?.code;return t&&Qt.yearFirstLocales.has(t)?"year-first":"month-first"}formatMonthYear(t){const{locale:n,timeZone:s,numerals:i}=this.options,l=n?.code;if(l&&Qt.yearFirstLocales.has(l))try{return new Intl.DateTimeFormat(l,{month:"long",year:"numeric",timeZone:s,numberingSystem:i}).format(t)}catch{}const u=this.getMonthYearOrder()==="year-first"?"y LLLL":"LLLL y";return this.format(t,u)}}Qt.yearFirstLocales=new Set(["eu","hu","ja","ja-Hira","ja-JP","ko","ko-KR","lt","lt-LT","lv","lv-LV","mn","mn-MN","zh","zh-CN","zh-HK","zh-TW"]);const jn=new Qt;class Q0{constructor(t,n,s=jn){this.date=t,this.displayMonth=n,this.outside=!!(n&&!s.isSameMonth(t,n)),this.dateLib=s,this.isoDate=s.format(t,"yyyy-MM-dd"),this.displayMonthId=s.format(n,"yyyy-MM"),this.dateMonthId=s.format(t,"yyyy-MM")}isEqualTo(t){return this.dateLib.isSameDay(t.date,this.date)&&this.dateLib.isSameMonth(t.displayMonth,this.displayMonth)}}class oE{constructor(t,n){this.date=t,this.weeks=n}}class sE{constructor(t,n){this.days=n,this.weekNumber=t}}function iE(e){return de.createElement("button",{...e})}function aE(e){return de.createElement("span",{...e})}function lE(e){const{size:t=24,orientation:n="left",className:s}=e;return de.createElement("svg",{className:s,width:t,height:t,viewBox:"0 0 24 24"},n==="up"&&de.createElement("polygon",{points:"6.77 17 12.5 11.43 18.24 17 20 15.28 12.5 8 5 15.28"}),n==="down"&&de.createElement("polygon",{points:"6.77 8 12.5 13.57 18.24 8 20 9.72 12.5 17 5 9.72"}),n==="left"&&de.createElement("polygon",{points:"16 18.112 9.81111111 12 16 5.87733333 14.0888889 4 6 12 14.0888889 20"}),n==="right"&&de.createElement("polygon",{points:"8 18.112 14.18888889 12 8 5.87733333 9.91111111 4 18 12 9.91111111 20"}))}function uE(e){const{day:t,modifiers:n,...s}=e;return de.createElement("td",{...s})}function cE(e){const{day:t,modifiers:n,...s}=e,i=de.useRef(null);return de.useEffect(()=>{n.focused&&i.current?.focus()},[n.focused]),de.createElement("button",{ref:i,...s})}var we;(function(e){e.Root="root",e.Chevron="chevron",e.Day="day",e.DayButton="day_button",e.CaptionLabel="caption_label",e.Dropdowns="dropdowns",e.Dropdown="dropdown",e.DropdownRoot="dropdown_root",e.Footer="footer",e.MonthGrid="month_grid",e.MonthCaption="month_caption",e.MonthsDropdown="months_dropdown",e.Month="month",e.Months="months",e.Nav="nav",e.NextMonthButton="button_next",e.PreviousMonthButton="button_previous",e.Week="week",e.Weeks="weeks",e.Weekday="weekday",e.Weekdays="weekdays",e.WeekNumber="week_number",e.WeekNumberHeader="week_number_header",e.YearsDropdown="years_dropdown"})(we||(we={}));var et;(function(e){e.disabled="disabled",e.hidden="hidden",e.outside="outside",e.focused="focused",e.today="today"})(et||(et={}));var wn;(function(e){e.range_end="range_end",e.range_middle="range_middle",e.range_start="range_start",e.selected="selected"})(wn||(wn={}));var Ht;(function(e){e.weeks_before_enter="weeks_before_enter",e.weeks_before_exit="weeks_before_exit",e.weeks_after_enter="weeks_after_enter",e.weeks_after_exit="weeks_after_exit",e.caption_after_enter="caption_after_enter",e.caption_after_exit="caption_after_exit",e.caption_before_enter="caption_before_enter",e.caption_before_exit="caption_before_exit"})(Ht||(Ht={}));function dE(e){const{options:t,className:n,components:s,classNames:i,...l}=e,u=[i[we.Dropdown],n].join(" "),c=t?.find(({value:f})=>f===l.value);return de.createElement("span",{"data-disabled":l.disabled,className:i[we.DropdownRoot]},de.createElement(s.Select,{className:u,...l},t?.map(({value:f,label:h,disabled:m})=>de.createElement(s.Option,{key:f,value:f,disabled:m},h))),de.createElement("span",{className:i[we.CaptionLabel],"aria-hidden":!0},c?.label,de.createElement(s.Chevron,{orientation:"down",size:18,className:i[we.Chevron]})))}function fE(e){return de.createElement("div",{...e})}function hE(e){return de.createElement("div",{...e})}function pE(e){const{calendarMonth:t,displayIndex:n,...s}=e;return de.createElement("div",{...s},e.children)}function mE(e){const{calendarMonth:t,displayIndex:n,...s}=e;return de.createElement("div",{...s})}function gE(e){return de.createElement("table",{...e})}function yE(e){return de.createElement("div",{...e})}const q0=L.createContext(void 0);function Ji(){const e=L.useContext(q0);if(e===void 0)throw new Error("useDayPicker() must be used within a custom component.");return e}function vE(e){const{components:t}=Ji();return de.createElement(t.Dropdown,{...e})}function xE(e){const{onPreviousClick:t,onNextClick:n,previousMonth:s,nextMonth:i,...l}=e,{components:u,classNames:c,labels:{labelPrevious:f,labelNext:h}}=Ji(),m=L.useCallback(g=>{i&&n?.(g)},[i,n]),p=L.useCallback(g=>{s&&t?.(g)},[s,t]);return de.createElement("nav",{...l},de.createElement(u.PreviousMonthButton,{type:"button",className:c[we.PreviousMonthButton],tabIndex:s?void 0:-1,"aria-disabled":s?void 0:!0,"aria-label":f(s),onClick:p},de.createElement(u.Chevron,{disabled:s?void 0:!0,className:c[we.Chevron],orientation:"left"})),de.createElement(u.NextMonthButton,{type:"button",className:c[we.NextMonthButton],tabIndex:i?void 0:-1,"aria-disabled":i?void 0:!0,"aria-label":h(i),onClick:m},de.createElement(u.Chevron,{disabled:i?void 0:!0,orientation:"right",className:c[we.Chevron]})))}function wE(e){const{components:t}=Ji();return de.createElement(t.Button,{...e})}function SE(e){return de.createElement("option",{...e})}function kE(e){const{components:t}=Ji();return de.createElement(t.Button,{...e})}function _E(e){const{rootRef:t,...n}=e;return de.createElement("div",{...n,ref:t})}function CE(e){return de.createElement("select",{...e})}function EE(e){const{week:t,...n}=e;return de.createElement("tr",{...n})}function NE(e){return de.createElement("th",{...e})}function bE(e){return de.createElement("thead",{"aria-hidden":!0},de.createElement("tr",{...e}))}function ME(e){const{week:t,...n}=e;return de.createElement("th",{...n})}function PE(e){return de.createElement("th",{...e})}function RE(e){return de.createElement("tbody",{...e})}function DE(e){const{components:t}=Ji();return de.createElement(t.Dropdown,{...e})}const TE=Object.freeze(Object.defineProperty({__proto__:null,Button:iE,CaptionLabel:aE,Chevron:lE,Day:uE,DayButton:cE,Dropdown:dE,DropdownNav:fE,Footer:hE,Month:pE,MonthCaption:mE,MonthGrid:gE,Months:yE,MonthsDropdown:vE,Nav:xE,NextMonthButton:wE,Option:SE,PreviousMonthButton:kE,Root:_E,Select:CE,Week:EE,WeekNumber:ME,WeekNumberHeader:PE,Weekday:NE,Weekdays:bE,Weeks:RE,YearsDropdown:DE},Symbol.toStringTag,{value:"Module"}));function Gn(e,t,n=!1,s=jn){let{from:i,to:l}=e;const{differenceInCalendarDays:u,isSameDay:c}=s;return i&&l?(u(l,i)<0&&([i,l]=[l,i]),u(t,i)>=(n?1:0)&&u(l,t)>=(n?1:0)):!n&&l?c(l,t):!n&&i?c(i,t):!1}function th(e){return!!(e&&typeof e=="object"&&"before"in e&&"after"in e)}function wu(e){return!!(e&&typeof e=="object"&&"from"in e)}function nh(e){return!!(e&&typeof e=="object"&&"after"in e)}function rh(e){return!!(e&&typeof e=="object"&&"before"in e)}function K0(e){return!!(e&&typeof e=="object"&&"dayOfWeek"in e)}function G0(e,t){return Array.isArray(e)&&e.every(t.isDate)}function Xn(e,t,n=jn){const s=Array.isArray(t)?t:[t],{isSameDay:i,differenceInCalendarDays:l,isAfter:u}=n;return s.some(c=>{if(typeof c=="boolean")return c;if(n.isDate(c))return i(e,c);if(G0(c,n))return c.some(f=>i(e,f));if(wu(c))return Gn(c,e,!1,n);if(K0(c))return Array.isArray(c.dayOfWeek)?c.dayOfWeek.includes(e.getDay()):c.dayOfWeek===e.getDay();if(th(c)){const f=l(c.before,e),h=l(c.after,e),m=f>0,p=h<0;return u(c.before,c.after)?p&&m:m||p}return nh(c)?l(e,c.after)>0:rh(c)?l(c.before,e)>0:typeof c=="function"?c(e):!1})}function OE(e,t,n,s,i){const{disabled:l,hidden:u,modifiers:c,showOutsideDays:f,broadcastCalendar:h,today:m=i.today()}=t,{isSameDay:p,isSameMonth:g,startOfMonth:w,isBefore:S,endOfMonth:_,isAfter:C}=i,N=n&&w(n),P=s&&_(s),k={[et.focused]:[],[et.outside]:[],[et.disabled]:[],[et.hidden]:[],[et.today]:[]},b={};for(const T of e){const{date:M,displayMonth:R}=T,O=!!(R&&!g(M,R)),A=!!(N&&S(M,N)),G=!!(P&&C(M,P)),W=!!(l&&Xn(M,l,i)),K=!!(u&&Xn(M,u,i))||A||G||!h&&!f&&O||h&&f===!1&&O,J=p(M,m);O&&k.outside.push(T),W&&k.disabled.push(T),K&&k.hidden.push(T),J&&k.today.push(T),c&&Object.keys(c).forEach(I=>{const Y=c?.[I];Y&&Xn(M,Y,i)&&(b[I]?b[I].push(T):b[I]=[T])})}return T=>{const M={[et.focused]:!1,[et.disabled]:!1,[et.hidden]:!1,[et.outside]:!1,[et.today]:!1},R={};for(const O in k){const A=k[O];M[O]=A.some(G=>G===T)}for(const O in b)R[O]=b[O].some(A=>A===T);return{...M,...R}}}function IE(e,t,n={}){return Object.entries(e).filter(([,i])=>i===!0).reduce((i,[l])=>(n[l]?i.push(n[l]):t[et[l]]?i.push(t[et[l]]):t[wn[l]]&&i.push(t[wn[l]]),i),[t[we.Day]])}function jE(e){return{...TE,...e}}function LE(e){const t={"data-mode":e.mode??void 0,"data-required":"required"in e?e.required:void 0,"data-multiple-months":e.numberOfMonths&&e.numberOfMonths>1||void 0,"data-week-numbers":e.showWeekNumber||void 0,"data-broadcast-calendar":e.broadcastCalendar||void 0,"data-nav-layout":e.navLayout||void 0};return Object.entries(e).forEach(([n,s])=>{n.startsWith("data-")&&(t[n]=s)}),t}function FE(){const e={};for(const t in we)e[we[t]]=`rdp-${we[t]}`;for(const t in et)e[et[t]]=`rdp-${et[t]}`;for(const t in wn)e[wn[t]]=`rdp-${wn[t]}`;for(const t in Ht)e[Ht[t]]=`rdp-${Ht[t]}`;return e}function X0(e,t,n){return(n??new Qt(t)).formatMonthYear(e)}const AE=X0;function zE(e,t,n){return(n??new Qt(t)).format(e,"d")}function WE(e,t=jn){return t.format(e,"LLLL")}function $E(e,t,n){return(n??new Qt(t)).format(e,"cccccc")}function BE(e,t=jn){return e<10?t.formatNumber(`0${e.toLocaleString()}`):t.formatNumber(`${e.toLocaleString()}`)}function HE(){return""}function Z0(e,t=jn){return t.format(e,"yyyy")}const VE=Z0,YE=Object.freeze(Object.defineProperty({__proto__:null,formatCaption:X0,formatDay:zE,formatMonthCaption:AE,formatMonthDropdown:WE,formatWeekNumber:BE,formatWeekNumberHeader:HE,formatWeekdayName:$E,formatYearCaption:VE,formatYearDropdown:Z0},Symbol.toStringTag,{value:"Module"}));function UE(e){return e?.formatMonthCaption&&!e.formatCaption&&(e.formatCaption=e.formatMonthCaption),e?.formatYearCaption&&!e.formatYearDropdown&&(e.formatYearDropdown=e.formatYearCaption),{...YE,...e}}function oh(e,t,n,s){let i=(s??new Qt(n)).format(e,"PPPP");return t.today&&(i=`Today, ${i}`),t.selected&&(i=`${i}, selected`),i}const QE=oh;function sh(e,t,n){return(n??new Qt(t)).formatMonthYear(e)}const qE=sh;function J0(e,t,n,s){let i=(s??new Qt(n)).format(e,"PPPP");return t?.today&&(i=`Today, ${i}`),i}function ev(e){return"Choose the Month"}function tv(){return""}const KE="Go to the Next Month";function nv(e,t){return KE}function rv(e){return"Go to the Previous Month"}function ov(e,t,n){return(n??new Qt(t)).format(e,"cccc")}function sv(e,t){return`Week ${e}`}function iv(e){return"Week Number"}function av(e){return"Choose the Year"}const GE=Object.freeze(Object.defineProperty({__proto__:null,labelCaption:qE,labelDay:QE,labelDayButton:oh,labelGrid:sh,labelGridcell:J0,labelMonthDropdown:ev,labelNav:tv,labelNext:nv,labelPrevious:rv,labelWeekNumber:sv,labelWeekNumberHeader:iv,labelWeekday:ov,labelYearDropdown:av},Symbol.toStringTag,{value:"Module"})),gn=(e,t,n)=>t||(n?typeof n=="function"?n:(...s)=>n:e);function XE(e,t){const n=t.locale?.labels??{};return{...GE,...e??{},labelDayButton:gn(oh,e?.labelDayButton,n.labelDayButton),labelMonthDropdown:gn(ev,e?.labelMonthDropdown,n.labelMonthDropdown),labelNext:gn(nv,e?.labelNext,n.labelNext),labelPrevious:gn(rv,e?.labelPrevious,n.labelPrevious),labelWeekNumber:gn(sv,e?.labelWeekNumber,n.labelWeekNumber),labelYearDropdown:gn(av,e?.labelYearDropdown,n.labelYearDropdown),labelGrid:gn(sh,e?.labelGrid,n.labelGrid),labelGridcell:gn(J0,e?.labelGridcell,n.labelGridcell),labelNav:gn(tv,e?.labelNav,n.labelNav),labelWeekNumberHeader:gn(iv,e?.labelWeekNumberHeader,n.labelWeekNumberHeader),labelWeekday:gn(ov,e?.labelWeekday,n.labelWeekday)}}function ZE(e,t,n,s,i){const{startOfMonth:l,startOfYear:u,endOfYear:c,eachMonthOfInterval:f,getMonth:h}=i;return f({start:u(e),end:c(e)}).map(g=>{const w=s.formatMonthDropdown(g,i),S=h(g),_=t&&g<l(t)||n&&g>l(n)||!1;return{value:S,label:w,disabled:_}})}function JE(e,t={},n={}){let s={...t?.[we.Day]};return Object.entries(e).filter(([,i])=>i===!0).forEach(([i])=>{s={...s,...n?.[i]}}),s}function eN(e,t,n,s){const i=s??e.today(),l=n?e.startOfBroadcastWeek(i,e):t?e.startOfISOWeek(i):e.startOfWeek(i),u=[];for(let c=0;c<7;c++){const f=e.addDays(l,c);u.push(f)}return u}function tN(e,t,n,s,i=!1){if(!e||!t)return;const{startOfYear:l,endOfYear:u,eachYearOfInterval:c,getYear:f}=s,h=l(e),m=u(t),p=c({start:h,end:m});return i&&p.reverse(),p.map(g=>{const w=n.formatYearDropdown(g,s);return{value:f(g),label:w,disabled:!1}})}function nN(e,t={}){const{weekStartsOn:n,locale:s}=t,i=n??s?.options?.weekStartsOn??0,l=c=>{const f=typeof c=="number"||typeof c=="string"?new Date(c):c;return new _t(f.getFullYear(),f.getMonth(),f.getDate(),12,0,0,e)},u=c=>{const f=l(c);return new Date(f.getFullYear(),f.getMonth(),f.getDate(),0,0,0,0)};return{today:()=>l(_t.tz(e)),newDate:(c,f,h)=>new _t(c,f,h,12,0,0,e),startOfDay:c=>l(c),startOfWeek:(c,f)=>{const h=l(c),m=f?.weekStartsOn??i,p=(h.getDay()-m+7)%7;return h.setDate(h.getDate()-p),h},startOfISOWeek:c=>{const f=l(c),h=(f.getDay()-1+7)%7;return f.setDate(f.getDate()-h),f},startOfMonth:c=>{const f=l(c);return f.setDate(1),f},startOfYear:c=>{const f=l(c);return f.setMonth(0,1),f},endOfWeek:(c,f)=>{const h=l(c),g=(((f?.weekStartsOn??i)+6)%7-h.getDay()+7)%7;return h.setDate(h.getDate()+g),h},endOfISOWeek:c=>{const f=l(c),h=(7-f.getDay())%7;return f.setDate(f.getDate()+h),f},endOfMonth:c=>{const f=l(c);return f.setMonth(f.getMonth()+1,0),f},endOfYear:c=>{const f=l(c);return f.setMonth(11,31),f},eachMonthOfInterval:c=>{const f=l(c.start),h=l(c.end),m=[],p=new _t(f.getFullYear(),f.getMonth(),1,12,0,0,e),g=h.getFullYear()*12+h.getMonth();for(;p.getFullYear()*12+p.getMonth()<=g;)m.push(new _t(p,e)),p.setMonth(p.getMonth()+1,1);return m},addDays:(c,f)=>{const h=l(c);return h.setDate(h.getDate()+f),h},addWeeks:(c,f)=>{const h=l(c);return h.setDate(h.getDate()+f*7),h},addMonths:(c,f)=>{const h=l(c);return h.setMonth(h.getMonth()+f),h},addYears:(c,f)=>{const h=l(c);return h.setFullYear(h.getFullYear()+f),h},eachYearOfInterval:c=>{const f=l(c.start),h=l(c.end),m=[],p=new _t(f.getFullYear(),0,1,12,0,0,e);for(;p.getFullYear()<=h.getFullYear();)m.push(new _t(p,e)),p.setFullYear(p.getFullYear()+1,0,1);return m},getWeek:(c,f)=>{const h=u(c);return eh(h,{weekStartsOn:f?.weekStartsOn??i,firstWeekContainsDate:f?.firstWeekContainsDate??s?.options?.firstWeekContainsDate??1})},getISOWeek:c=>{const f=u(c);return Jf(f)},differenceInCalendarDays:(c,f)=>{const h=u(c),m=u(f);return Zf(h,m)},differenceInCalendarMonths:(c,f)=>{const h=u(c),m=u(f);return z0(h,m)}}}const ea=e=>e instanceof HTMLElement?e:null,Yd=e=>[...e.querySelectorAll("[data-animated-month]")??[]],rN=e=>ea(e.querySelector("[data-animated-month]")),Ud=e=>ea(e.querySelector("[data-animated-caption]")),Qd=e=>ea(e.querySelector("[data-animated-weeks]")),oN=e=>ea(e.querySelector("[data-animated-nav]")),sN=e=>ea(e.querySelector("[data-animated-weekdays]"));function iN(e,t,{classNames:n,months:s,focused:i,dateLib:l}){const u=L.useRef(null),c=L.useRef(s),f=L.useRef(!1);L.useLayoutEffect(()=>{const h=c.current;if(c.current=s,!t||!e.current||!(e.current instanceof HTMLElement)||s.length===0||h.length===0||s.length!==h.length)return;const m=l.isSameMonth(s[0].date,h[0].date),p=l.isAfter(s[0].date,h[0].date),g=p?n[Ht.caption_after_enter]:n[Ht.caption_before_enter],w=p?n[Ht.weeks_after_enter]:n[Ht.weeks_before_enter],S=u.current,_=e.current.cloneNode(!0);if(_ instanceof HTMLElement?(Yd(_).forEach(k=>{if(!(k instanceof HTMLElement))return;const b=rN(k);b&&k.contains(b)&&k.removeChild(b);const T=Ud(k);T&&T.classList.remove(g);const M=Qd(k);M&&M.classList.remove(w)}),u.current=_):u.current=null,f.current||m||i)return;const C=S instanceof HTMLElement?Yd(S):[],N=Yd(e.current);if(N?.every(P=>P instanceof HTMLElement)&&C&&C.every(P=>P instanceof HTMLElement)){f.current=!0,e.current.style.isolation="isolate";const P=oN(e.current);P&&(P.style.zIndex="1"),N.forEach((k,b)=>{const T=C[b];if(!T)return;k.style.position="relative",k.style.overflow="hidden";const M=Ud(k);M&&M.classList.add(g);const R=Qd(k);R&&R.classList.add(w);const O=()=>{f.current=!1,e.current&&(e.current.style.isolation=""),P&&(P.style.zIndex=""),M&&M.classList.remove(g),R&&R.classList.remove(w),k.style.position="",k.style.overflow="",k.contains(T)&&k.removeChild(T)};T.style.pointerEvents="none",T.style.position="absolute",T.style.overflow="hidden",T.setAttribute("aria-hidden","true");const A=sN(T);A&&(A.style.opacity="0");const G=Ud(T);G&&(G.classList.add(p?n[Ht.caption_before_exit]:n[Ht.caption_after_exit]),G.addEventListener("animationend",O));const W=Qd(T);W&&W.classList.add(p?n[Ht.weeks_before_exit]:n[Ht.weeks_after_exit]),k.insertBefore(T,k.firstChild)})}})}function aN(e,t,n,s){const i=e[0],l=e[e.length-1],{ISOWeek:u,fixedWeeks:c,broadcastCalendar:f}=n??{},{addDays:h,differenceInCalendarDays:m,differenceInCalendarMonths:p,endOfBroadcastWeek:g,endOfISOWeek:w,endOfMonth:S,endOfWeek:_,isAfter:C,startOfBroadcastWeek:N,startOfISOWeek:P,startOfWeek:k}=s,b=f?N(i,s):u?P(i):k(i),T=f?g(l):u?w(S(l)):_(S(l)),M=t&&(f?g(t):u?w(t):_(t)),R=M&&C(T,M)?M:T,O=m(R,b),A=p(l,i)+1,G=[];for(let J=0;J<=O;J++){const I=h(b,J);G.push(I)}const K=(f?35:42)*A;if(c&&G.length<K){const J=K-G.length;for(let I=0;I<J;I++){const Y=h(G[G.length-1],1);G.push(Y)}}return G}function lN(e){const t=[];return e.reduce((n,s)=>{const i=s.weeks.reduce((l,u)=>l.concat(u.days.slice()),t.slice());return n.concat(i.slice())},t.slice())}function uN(e,t,n,s){const{numberOfMonths:i=1}=n,l=[];for(let u=0;u<i;u++){const c=s.addMonths(e,u);if(t&&c>t)break;l.push(c)}return l}function zg(e,t,n,s){const{month:i,defaultMonth:l,today:u=s.today(),numberOfMonths:c=1}=e;let f=i||l||u;const{differenceInCalendarMonths:h,addMonths:m,startOfMonth:p}=s;if(n&&h(n,f)<c-1){const g=-1*(c-1);f=m(n,g)}return t&&h(f,t)<0&&(f=t),p(f)}function cN(e,t,n,s){const{addDays:i,endOfBroadcastWeek:l,endOfISOWeek:u,endOfMonth:c,endOfWeek:f,getISOWeek:h,getWeek:m,startOfBroadcastWeek:p,startOfISOWeek:g,startOfWeek:w}=s,S=e.reduce((_,C)=>{const N=n.broadcastCalendar?p(C,s):n.ISOWeek?g(C):w(C),P=n.broadcastCalendar?l(C):n.ISOWeek?u(c(C)):f(c(C)),k=t.filter(R=>R>=N&&R<=P),b=n.broadcastCalendar?35:42;if(n.fixedWeeks&&k.length<b){const R=t.filter(O=>{const A=b-k.length;return O>P&&O<=i(P,A)});k.push(...R)}const T=k.reduce((R,O)=>{const A=n.ISOWeek?h(O):m(O),G=R.find(K=>K.weekNumber===A),W=new Q0(O,C,s);return G?G.days.push(W):R.push(new sE(A,[W])),R},[]),M=new oE(C,T);return _.push(M),_},[]);return n.reverseMonths?S.reverse():S}function dN(e,t){let{startMonth:n,endMonth:s}=e;const{startOfYear:i,startOfDay:l,startOfMonth:u,endOfMonth:c,addYears:f,endOfYear:h,newDate:m,today:p}=t,{fromYear:g,toYear:w,fromMonth:S,toMonth:_}=e;!n&&S&&(n=S),!n&&g&&(n=t.newDate(g,0,1)),!s&&_&&(s=_),!s&&w&&(s=m(w,11,31));const C=e.captionLayout==="dropdown"||e.captionLayout==="dropdown-years";return n?n=u(n):g?n=m(g,0,1):!n&&C&&(n=i(f(e.today??p(),-100))),s?s=c(s):w?s=m(w,11,31):!s&&C&&(s=h(e.today??p())),[n&&l(n),s&&l(s)]}function fN(e,t,n,s){if(n.disableNavigation)return;const{pagedNavigation:i,numberOfMonths:l=1}=n,{startOfMonth:u,addMonths:c,differenceInCalendarMonths:f}=s,h=i?l:1,m=u(e);if(!t)return c(m,h);if(!(f(t,e)<l))return c(m,h)}function hN(e,t,n,s){if(n.disableNavigation)return;const{pagedNavigation:i,numberOfMonths:l}=n,{startOfMonth:u,addMonths:c,differenceInCalendarMonths:f}=s,h=i?l??1:1,m=u(e);if(!t)return c(m,-h);if(!(f(m,t)<=0))return c(m,-h)}function pN(e){const t=[];return e.reduce((n,s)=>n.concat(s.weeks.slice()),t.slice())}function Su(e,t){const[n,s]=L.useState(e);return[t===void 0?n:t,s]}function mN(e,t){const[n,s]=dN(e,t),{startOfMonth:i,endOfMonth:l}=t,u=zg(e,n,s,t),[c,f]=Su(u,e.month?u:void 0);L.useEffect(()=>{const b=zg(e,n,s,t);f(b)},[e.timeZone]);const{months:h,weeks:m,days:p,previousMonth:g,nextMonth:w}=L.useMemo(()=>{const b=uN(c,s,{numberOfMonths:e.numberOfMonths},t),T=aN(b,e.endMonth?l(e.endMonth):void 0,{ISOWeek:e.ISOWeek,fixedWeeks:e.fixedWeeks,broadcastCalendar:e.broadcastCalendar},t),M=cN(b,T,{broadcastCalendar:e.broadcastCalendar,fixedWeeks:e.fixedWeeks,ISOWeek:e.ISOWeek,reverseMonths:e.reverseMonths},t),R=pN(M),O=lN(M),A=hN(c,n,e,t),G=fN(c,s,e,t);return{months:M,weeks:R,days:O,previousMonth:A,nextMonth:G}},[t,c.getTime(),s?.getTime(),n?.getTime(),e.disableNavigation,e.broadcastCalendar,e.endMonth?.getTime(),e.fixedWeeks,e.ISOWeek,e.numberOfMonths,e.pagedNavigation,e.reverseMonths]),{disableNavigation:S,onMonthChange:_}=e,C=b=>m.some(T=>T.days.some(M=>M.isEqualTo(b))),N=b=>{if(S)return;let T=i(b);n&&T<i(n)&&(T=i(n)),s&&T>i(s)&&(T=i(s)),f(T),_?.(T)};return{months:h,weeks:m,days:p,navStart:n,navEnd:s,previousMonth:g,nextMonth:w,goToMonth:N,goToDay:b=>{C(b)||N(b.date)}}}var Pn;(function(e){e[e.Today=0]="Today",e[e.Selected=1]="Selected",e[e.LastFocused=2]="LastFocused",e[e.FocusedModifier=3]="FocusedModifier"})(Pn||(Pn={}));function Wg(e){return!e[et.disabled]&&!e[et.hidden]&&!e[et.outside]}function gN(e,t,n,s){let i,l=-1;for(const u of e){const c=t(u);Wg(c)&&(c[et.focused]&&l<Pn.FocusedModifier?(i=u,l=Pn.FocusedModifier):s?.isEqualTo(u)&&l<Pn.LastFocused?(i=u,l=Pn.LastFocused):n(u.date)&&l<Pn.Selected?(i=u,l=Pn.Selected):c[et.today]&&l<Pn.Today&&(i=u,l=Pn.Today))}return i||(i=e.find(u=>Wg(t(u)))),i}function yN(e,t,n,s,i,l,u){const{ISOWeek:c,broadcastCalendar:f}=l,{addDays:h,addMonths:m,addWeeks:p,addYears:g,endOfBroadcastWeek:w,endOfISOWeek:S,endOfWeek:_,max:C,min:N,startOfBroadcastWeek:P,startOfISOWeek:k,startOfWeek:b}=u;let M={day:h,week:p,month:m,year:g,startOfWeek:R=>f?P(R,u):c?k(R):b(R),endOfWeek:R=>f?w(R):c?S(R):_(R)}[e](n,t==="after"?1:-1);return t==="before"&&s?M=C([s,M]):t==="after"&&i&&(M=N([i,M])),M}function lv(e,t,n,s,i,l,u,c=0){if(c>365)return;const f=yN(e,t,n.date,s,i,l,u),h=!!(l.disabled&&Xn(f,l.disabled,u)),m=!!(l.hidden&&Xn(f,l.hidden,u)),p=f,g=new Q0(f,p,u);return!h&&!m?g:lv(e,t,g,s,i,l,u,c+1)}function vN(e,t,n,s,i){const{autoFocus:l}=e,[u,c]=L.useState(),f=gN(t.days,n,s||(()=>!1),u),[h,m]=L.useState(l?f:void 0);return{isFocusTarget:_=>!!f?.isEqualTo(_),setFocused:m,focused:h,blur:()=>{c(h),m(void 0)},moveFocus:(_,C)=>{if(!h)return;const N=lv(_,C,h,t.navStart,t.navEnd,e,i);N&&(e.disableNavigation&&!t.days.some(k=>k.isEqualTo(N))||(t.goToDay(N),m(N)))}}}function xN(e,t){const{selected:n,required:s,onSelect:i}=e,[l,u]=Su(n,i?n:void 0),c=i?n:l,{isSameDay:f}=t,h=w=>c?.some(S=>f(S,w))??!1,{min:m,max:p}=e;return{selected:c,select:(w,S,_)=>{let C=[...c??[]];if(h(w)){if(c?.length===m||s&&c?.length===1)return;C=c?.filter(N=>!f(N,w))}else c?.length===p?C=[w]:C=[...C,w];return i||u(C),i?.(C,w,S,_),C},isSelected:h}}function wN(e,t,n=0,s=0,i=!1,l=jn){const{from:u,to:c}=t||{},{isSameDay:f,isAfter:h,isBefore:m}=l;let p;if(!u&&!c)p={from:e,to:n>0?void 0:e};else if(u&&!c)f(u,e)?n===0?p={from:u,to:e}:i?p={from:u,to:void 0}:p=void 0:m(e,u)?p={from:e,to:u}:p={from:u,to:e};else if(u&&c)if(f(u,e)&&f(c,e))i?p={from:u,to:c}:p=void 0;else if(f(u,e))p={from:u,to:n>0?void 0:e};else if(f(c,e))p={from:e,to:n>0?void 0:e};else if(m(e,u))p={from:e,to:c};else if(h(e,u))p={from:u,to:e};else if(h(e,c))p={from:u,to:e};else throw new Error("Invalid range");if(p?.from&&p?.to){const g=l.differenceInCalendarDays(p.to,p.from);s>0&&g>s?p={from:e,to:void 0}:n>1&&g<n&&(p={from:e,to:void 0})}return p}function SN(e,t,n=jn){const s=Array.isArray(t)?t:[t];let i=e.from;const l=n.differenceInCalendarDays(e.to,e.from),u=Math.min(l,6);for(let c=0;c<=u;c++){if(s.includes(i.getDay()))return!0;i=n.addDays(i,1)}return!1}function $g(e,t,n=jn){return Gn(e,t.from,!1,n)||Gn(e,t.to,!1,n)||Gn(t,e.from,!1,n)||Gn(t,e.to,!1,n)}function kN(e,t,n=jn){const s=Array.isArray(t)?t:[t];if(s.filter(c=>typeof c!="function").some(c=>typeof c=="boolean"?c:n.isDate(c)?Gn(e,c,!1,n):G0(c,n)?c.some(f=>Gn(e,f,!1,n)):wu(c)?c.from&&c.to?$g(e,{from:c.from,to:c.to},n):!1:K0(c)?SN(e,c.dayOfWeek,n):th(c)?n.isAfter(c.before,c.after)?$g(e,{from:n.addDays(c.after,1),to:n.addDays(c.before,-1)},n):Xn(e.from,c,n)||Xn(e.to,c,n):nh(c)||rh(c)?Xn(e.from,c,n)||Xn(e.to,c,n):!1))return!0;const u=s.filter(c=>typeof c=="function");if(u.length){let c=e.from;const f=n.differenceInCalendarDays(e.to,e.from);for(let h=0;h<=f;h++){if(u.some(m=>m(c)))return!0;c=n.addDays(c,1)}}return!1}function _N(e,t){const{disabled:n,excludeDisabled:s,selected:i,required:l,onSelect:u}=e,[c,f]=Su(i,u?i:void 0),h=u?i:c;return{selected:h,select:(g,w,S)=>{const{min:_,max:C}=e,N=g?wN(g,h,_,C,l,t):void 0;return s&&n&&N?.from&&N.to&&kN({from:N.from,to:N.to},n,t)&&(N.from=g,N.to=void 0),u||f(N),u?.(N,g,w,S),N},isSelected:g=>h&&Gn(h,g,!1,t)}}function CN(e,t){const{selected:n,required:s,onSelect:i}=e,[l,u]=Su(n,i?n:void 0),c=i?n:l,{isSameDay:f}=t;return{selected:c,select:(p,g,w)=>{let S=p;return!s&&c&&c&&f(p,c)&&(S=void 0),i||u(S),i?.(S,p,g,w),S},isSelected:p=>c?f(c,p):!1}}function EN(e,t){const n=CN(e,t),s=xN(e,t),i=_N(e,t);switch(e.mode){case"single":return n;case"multiple":return s;case"range":return i;default:return}}function on(e,t){return e instanceof _t&&e.timeZone===t?e:new _t(e,t)}function os(e,t,n){return on(e,t)}function Bg(e,t,n){return typeof e=="boolean"||typeof e=="function"?e:e instanceof Date?os(e,t):Array.isArray(e)?e.map(s=>s instanceof Date?os(s,t):s):wu(e)?{...e,from:e.from?on(e.from,t):e.from,to:e.to?on(e.to,t):e.to}:th(e)?{before:os(e.before,t),after:os(e.after,t)}:nh(e)?{after:os(e.after,t)}:rh(e)?{before:os(e.before,t)}:e}function qd(e,t,n){return e&&(Array.isArray(e)?e.map(s=>Bg(s,t)):Bg(e,t))}function NN(e){let t=e;const n=t.timeZone;if(n&&(t={...e,timeZone:n},t.today&&(t.today=on(t.today,n)),t.month&&(t.month=on(t.month,n)),t.defaultMonth&&(t.defaultMonth=on(t.defaultMonth,n)),t.startMonth&&(t.startMonth=on(t.startMonth,n)),t.endMonth&&(t.endMonth=on(t.endMonth,n)),t.mode==="single"&&t.selected?t.selected=on(t.selected,n):t.mode==="multiple"&&t.selected?t.selected=t.selected?.map(Ne=>on(Ne,n)):t.mode==="range"&&t.selected&&(t.selected={from:t.selected.from?on(t.selected.from,n):t.selected.from,to:t.selected.to?on(t.selected.to,n):t.selected.to}),t.disabled!==void 0&&(t.disabled=qd(t.disabled,n)),t.hidden!==void 0&&(t.hidden=qd(t.hidden,n)),t.modifiers)){const Ne={};Object.keys(t.modifiers).forEach(Oe=>{Ne[Oe]=qd(t.modifiers?.[Oe],n)}),t.modifiers=Ne}const{components:s,formatters:i,labels:l,dateLib:u,locale:c,classNames:f}=L.useMemo(()=>{const Ne={...U0,...t.locale},Oe=t.broadcastCalendar?1:t.weekStartsOn,Se=t.noonSafe&&t.timeZone?nN(t.timeZone,{weekStartsOn:Oe,locale:Ne}):void 0,Me=t.dateLib&&Se?{...Se,...t.dateLib}:t.dateLib??Se,ct=new Qt({locale:Ne,weekStartsOn:Oe,firstWeekContainsDate:t.firstWeekContainsDate,useAdditionalWeekYearTokens:t.useAdditionalWeekYearTokens,useAdditionalDayOfYearTokens:t.useAdditionalDayOfYearTokens,timeZone:t.timeZone,numerals:t.numerals},Me);return{dateLib:ct,components:jE(t.components),formatters:UE(t.formatters),labels:XE(t.labels,ct.options),locale:Ne,classNames:{...FE(),...t.classNames}}},[t.locale,t.broadcastCalendar,t.weekStartsOn,t.firstWeekContainsDate,t.useAdditionalWeekYearTokens,t.useAdditionalDayOfYearTokens,t.timeZone,t.numerals,t.dateLib,t.noonSafe,t.components,t.formatters,t.labels,t.classNames]);t.today||(t={...t,today:u.today()});const{captionLayout:h,mode:m,navLayout:p,numberOfMonths:g=1,onDayBlur:w,onDayClick:S,onDayFocus:_,onDayKeyDown:C,onDayMouseEnter:N,onDayMouseLeave:P,onNextClick:k,onPrevClick:b,showWeekNumber:T,styles:M}=t,{formatCaption:R,formatDay:O,formatMonthDropdown:A,formatWeekNumber:G,formatWeekNumberHeader:W,formatWeekdayName:K,formatYearDropdown:J}=i,I=mN(t,u),{days:Y,months:V,navStart:Q,navEnd:F,previousMonth:B,nextMonth:U,goToMonth:D}=I,$=OE(Y,t,Q,F,u),{isSelected:ne,select:te,selected:ie}=EN(t,u)??{},{blur:ce,focused:ue,isFocusTarget:ee,moveFocus:ae,setFocused:xe}=vN(t,I,$,ne??(()=>!1),u),{labelDayButton:Ee,labelGridcell:ye,labelGrid:ke,labelMonthDropdown:Te,labelNav:je,labelPrevious:Fe,labelNext:Ue,labelWeekday:Ct,labelWeekNumber:rt,labelWeekNumberHeader:ot,labelYearDropdown:mt}=l,bt=L.useMemo(()=>eN(u,t.ISOWeek,t.broadcastCalendar,t.today),[u,t.ISOWeek,t.broadcastCalendar,t.today]),Re=m!==void 0||S!==void 0,Be=L.useCallback(()=>{B&&(D(B),b?.(B))},[B,D,b]),Ge=L.useCallback(()=>{U&&(D(U),k?.(U))},[D,U,k]),Mt=L.useCallback((Ne,Oe)=>Se=>{Se.preventDefault(),Se.stopPropagation(),xe(Ne),!Oe.disabled&&(te?.(Ne.date,Oe,Se),S?.(Ne.date,Oe,Se))},[te,S,xe]),ln=L.useCallback((Ne,Oe)=>Se=>{xe(Ne),_?.(Ne.date,Oe,Se)},[_,xe]),Fn=L.useCallback((Ne,Oe)=>Se=>{ce(),w?.(Ne.date,Oe,Se)},[ce,w]),ko=L.useCallback((Ne,Oe)=>Se=>{const Me={ArrowLeft:[Se.shiftKey?"month":"day",t.dir==="rtl"?"after":"before"],ArrowRight:[Se.shiftKey?"month":"day",t.dir==="rtl"?"before":"after"],ArrowDown:[Se.shiftKey?"year":"week","after"],ArrowUp:[Se.shiftKey?"year":"week","before"],PageUp:[Se.shiftKey?"year":"month","before"],PageDown:[Se.shiftKey?"year":"month","after"],Home:["startOfWeek","before"],End:["endOfWeek","after"]};if(Me[Se.key]){Se.preventDefault(),Se.stopPropagation();const[ct,Pe]=Me[Se.key];ae(ct,Pe)}C?.(Ne.date,Oe,Se)},[ae,C,t.dir]),un=L.useCallback((Ne,Oe)=>Se=>{N?.(Ne.date,Oe,Se)},[N]),An=L.useCallback((Ne,Oe)=>Se=>{P?.(Ne.date,Oe,Se)},[P]),bs=L.useCallback(Ne=>Oe=>{const Se=Number(Oe.target.value),Me=u.setMonth(u.startOfMonth(Ne),Se);D(Me)},[u,D]),_o=L.useCallback(Ne=>Oe=>{const Se=Number(Oe.target.value),Me=u.setYear(u.startOfMonth(Ne),Se);D(Me)},[u,D]),{className:Co,style:Ms}=L.useMemo(()=>({className:[f[we.Root],t.className].filter(Boolean).join(" "),style:{...M?.[we.Root],...t.style}}),[f,t.className,t.style,M]),Lr=LE(t),rr=L.useRef(null);iN(rr,!!t.animate,{classNames:f,months:V,focused:ue,dateLib:u});const Fr={dayPickerProps:t,selected:ie,select:te,isSelected:ne,months:V,nextMonth:U,previousMonth:B,goToMonth:D,getModifiers:$,components:s,classNames:f,styles:M,labels:l,formatters:i};return de.createElement(q0.Provider,{value:Fr},de.createElement(s.Root,{rootRef:t.animate?rr:void 0,className:Co,style:Ms,dir:t.dir,id:t.id,lang:t.lang,nonce:t.nonce,title:t.title,role:t.role,"aria-label":t["aria-label"],"aria-labelledby":t["aria-labelledby"],...Lr},de.createElement(s.Months,{className:f[we.Months],style:M?.[we.Months]},!t.hideNavigation&&!p&&de.createElement(s.Nav,{"data-animated-nav":t.animate?"true":void 0,className:f[we.Nav],style:M?.[we.Nav],"aria-label":je(),onPreviousClick:Be,onNextClick:Ge,previousMonth:B,nextMonth:U}),V.map((Ne,Oe)=>de.createElement(s.Month,{"data-animated-month":t.animate?"true":void 0,className:f[we.Month],style:M?.[we.Month],key:Oe,displayIndex:Oe,calendarMonth:Ne},p==="around"&&!t.hideNavigation&&Oe===0&&de.createElement(s.PreviousMonthButton,{type:"button",className:f[we.PreviousMonthButton],tabIndex:B?void 0:-1,"aria-disabled":B?void 0:!0,"aria-label":Fe(B),onClick:Be,"data-animated-button":t.animate?"true":void 0},de.createElement(s.Chevron,{disabled:B?void 0:!0,className:f[we.Chevron],orientation:t.dir==="rtl"?"right":"left"})),de.createElement(s.MonthCaption,{"data-animated-caption":t.animate?"true":void 0,className:f[we.MonthCaption],style:M?.[we.MonthCaption],calendarMonth:Ne,displayIndex:Oe},h?.startsWith("dropdown")?de.createElement(s.DropdownNav,{className:f[we.Dropdowns],style:M?.[we.Dropdowns]},(()=>{const Se=h==="dropdown"||h==="dropdown-months"?de.createElement(s.MonthsDropdown,{key:"month",className:f[we.MonthsDropdown],"aria-label":Te(),classNames:f,components:s,disabled:!!t.disableNavigation,onChange:bs(Ne.date),options:ZE(Ne.date,Q,F,i,u),style:M?.[we.Dropdown],value:u.getMonth(Ne.date)}):de.createElement("span",{key:"month"},A(Ne.date,u)),Me=h==="dropdown"||h==="dropdown-years"?de.createElement(s.YearsDropdown,{key:"year",className:f[we.YearsDropdown],"aria-label":mt(u.options),classNames:f,components:s,disabled:!!t.disableNavigation,onChange:_o(Ne.date),options:tN(Q,F,i,u,!!t.reverseYears),style:M?.[we.Dropdown],value:u.getYear(Ne.date)}):de.createElement("span",{key:"year"},J(Ne.date,u));return u.getMonthYearOrder()==="year-first"?[Me,Se]:[Se,Me]})(),de.createElement("span",{role:"status","aria-live":"polite",style:{border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",width:"1px",whiteSpace:"nowrap",wordWrap:"normal"}},R(Ne.date,u.options,u))):de.createElement(s.CaptionLabel,{className:f[we.CaptionLabel],role:"status","aria-live":"polite"},R(Ne.date,u.options,u))),p==="around"&&!t.hideNavigation&&Oe===g-1&&de.createElement(s.NextMonthButton,{type:"button",className:f[we.NextMonthButton],tabIndex:U?void 0:-1,"aria-disabled":U?void 0:!0,"aria-label":Ue(U),onClick:Ge,"data-animated-button":t.animate?"true":void 0},de.createElement(s.Chevron,{disabled:U?void 0:!0,className:f[we.Chevron],orientation:t.dir==="rtl"?"left":"right"})),Oe===g-1&&p==="after"&&!t.hideNavigation&&de.createElement(s.Nav,{"data-animated-nav":t.animate?"true":void 0,className:f[we.Nav],style:M?.[we.Nav],"aria-label":je(),onPreviousClick:Be,onNextClick:Ge,previousMonth:B,nextMonth:U}),de.createElement(s.MonthGrid,{role:"grid","aria-multiselectable":m==="multiple"||m==="range","aria-label":ke(Ne.date,u.options,u)||void 0,className:f[we.MonthGrid],style:M?.[we.MonthGrid]},!t.hideWeekdays&&de.createElement(s.Weekdays,{"data-animated-weekdays":t.animate?"true":void 0,className:f[we.Weekdays],style:M?.[we.Weekdays]},T&&de.createElement(s.WeekNumberHeader,{"aria-label":ot(u.options),className:f[we.WeekNumberHeader],style:M?.[we.WeekNumberHeader],scope:"col"},W()),bt.map(Se=>de.createElement(s.Weekday,{"aria-label":Ct(Se,u.options,u),className:f[we.Weekday],key:String(Se),style:M?.[we.Weekday],scope:"col"},K(Se,u.options,u)))),de.createElement(s.Weeks,{"data-animated-weeks":t.animate?"true":void 0,className:f[we.Weeks],style:M?.[we.Weeks]},Ne.weeks.map(Se=>de.createElement(s.Week,{className:f[we.Week],key:Se.weekNumber,style:M?.[we.Week],week:Se},T&&de.createElement(s.WeekNumber,{week:Se,style:M?.[we.WeekNumber],"aria-label":rt(Se.weekNumber,{locale:c}),className:f[we.WeekNumber],scope:"row",role:"rowheader"},G(Se.weekNumber,u)),Se.days.map(Me=>{const{date:ct}=Me,Pe=$(Me);if(Pe[et.focused]=!Pe.hidden&&!!ue?.isEqualTo(Me),Pe[wn.selected]=ne?.(ct)||Pe.selected,wu(ie)){const{from:zn,to:or}=ie;Pe[wn.range_start]=!!(zn&&or&&u.isSameDay(ct,zn)),Pe[wn.range_end]=!!(zn&&or&&u.isSameDay(ct,or)),Pe[wn.range_middle]=Gn(ie,ct,!0,u)}const Eo=JE(Pe,M,t.modifiersStyles),No=IE(Pe,f,t.modifiersClassNames),bo=!Re&&!Pe.hidden?ye(ct,Pe,u.options,u):void 0;return de.createElement(s.Day,{key:`${Me.isoDate}_${Me.displayMonthId}`,day:Me,modifiers:Pe,className:No.join(" "),style:Eo,role:"gridcell","aria-selected":Pe.selected||void 0,"aria-label":bo,"data-day":Me.isoDate,"data-month":Me.outside?Me.dateMonthId:void 0,"data-selected":Pe.selected||void 0,"data-disabled":Pe.disabled||void 0,"data-hidden":Pe.hidden||void 0,"data-outside":Me.outside||void 0,"data-focused":Pe.focused||void 0,"data-today":Pe.today||void 0},!Pe.hidden&&Re?de.createElement(s.DayButton,{className:f[we.DayButton],style:M?.[we.DayButton],type:"button",day:Me,modifiers:Pe,disabled:!Pe.focused&&Pe.disabled||void 0,"aria-disabled":Pe.focused&&Pe.disabled||void 0,tabIndex:ee(Me)?0:-1,"aria-label":Ee(ct,Pe,u.options,u),onClick:Mt(Me,Pe),onBlur:Fn(Me,Pe),onFocus:ln(Me,Pe),onKeyDown:ko(Me,Pe),onMouseEnter:un(Me,Pe),onMouseLeave:An(Me,Pe)},O(ct,u.options,u)):!Pe.hidden&&O(Me.date,u.options,u))})))))))),t.footer&&de.createElement(s.Footer,{className:f[we.Footer],style:M?.[we.Footer],role:"status","aria-live":"polite"},t.footer)))}const bN=[{label:"Today",getValue:()=>({from:Kn(new Date),to:kl(new Date)})},{label:"Yesterday",getValue:()=>{const e=Vd(new Date,1);return{from:Kn(e),to:kl(e)}}},{label:"This Week",getValue:()=>({from:Ir(new Date,{weekStartsOn:1}),to:eu(new Date,{weekStartsOn:1})})},{label:"Last Week",getValue:()=>{const e=GC(new Date);return{from:Ir(e,{weekStartsOn:1}),to:eu(e,{weekStartsOn:1})}}},{label:"Last 7 Days",getValue:()=>({from:Kn(Vd(new Date,6)),to:kl(new Date)})},{label:"Last 30 Days",getValue:()=>({from:Kn(Vd(new Date,29)),to:kl(new Date)})},{label:"This Month",getValue:()=>({from:xf(new Date),to:vf(new Date)})},{label:"Last Month",getValue:()=>{const e=KC(new Date);return{from:xf(e),to:vf(e)}}}];function uv({value:e,onChange:t}){const[n,s]=L.useState(!1),i=L.useRef(null);L.useEffect(()=>{function f(h){i.current&&!i.current.contains(h.target)&&s(!1)}return document.addEventListener("mousedown",f),()=>document.removeEventListener("mousedown",f)},[]);const l=()=>e?.from?!e.to||vn(e.from,"yyyy-MM-dd")===vn(e.to,"yyyy-MM-dd")?vn(e.from,"MMM d, yyyy"):`${vn(e.from,"MMM d")} - ${vn(e.to,"MMM d, yyyy")}`:"Select date range",u=f=>{t(f.getValue()),s(!1)},c=()=>{t(void 0),s(!1)};return x.jsxs("div",{ref:i,className:"relative",children:[x.jsxs("button",{type:"button",onClick:()=>s(!n),className:`flex items-center gap-2 px-3 py-1.5 text-sm rounded-lg border transition-colors whitespace-nowrap ${e?.from?"bg-slate-700 border-slate-600 text-slate-100":"bg-slate-800 border-slate-700 text-slate-400 hover:border-slate-600"}`,children:[x.jsx(MN,{}),x.jsx("span",{children:l()}),e?.from&&x.jsx("button",{type:"button",onClick:f=>{f.stopPropagation(),c()},className:"ml-1 text-slate-500 hover:text-slate-300",children:x.jsx(PN,{})})]}),n&&x.jsxs("div",{className:"absolute top-full mt-2 right-0 z-50 flex bg-slate-900 rounded-xl border border-slate-700 shadow-2xl overflow-hidden",children:[x.jsx("div",{className:"w-36 border-r border-slate-700 py-2",children:bN.map(f=>x.jsx("button",{type:"button",onClick:()=>u(f),className:"w-full px-3 py-1.5 text-left text-sm text-slate-300 hover:bg-slate-800 hover:text-slate-100 transition-colors",children:f.label},f.label))}),x.jsx("div",{className:"p-3 relative",children:x.jsx(NN,{mode:"range",selected:e,onSelect:t,numberOfMonths:2,classNames:{root:"text-slate-200",months:"flex gap-4",month:"space-y-3",month_caption:"flex justify-center items-center h-8",caption_label:"text-sm font-medium text-slate-200",nav:"absolute top-3 left-0 right-0 flex justify-between px-1",button_previous:"p-1 rounded hover:bg-slate-800 text-slate-400 hover:text-slate-200",button_next:"p-1 rounded hover:bg-slate-800 text-slate-400 hover:text-slate-200",weekdays:"flex",weekday:"w-8 text-center text-xs font-medium text-slate-500",week:"flex",day:"w-8 h-8 text-center text-sm p-0",day_button:"w-8 h-8 rounded-md hover:bg-slate-800 transition-colors text-slate-300 hover:text-slate-100 disabled:text-slate-600 disabled:hover:bg-transparent",selected:"bg-emerald-600 text-white hover:bg-emerald-600",range_start:"rounded-l-md",range_end:"rounded-r-md",range_middle:"bg-emerald-600/30 rounded-none",today:"font-bold text-emerald-400",disabled:"text-slate-600"}})})]})]})}function MN(){return x.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","aria-hidden":"true",children:x.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"})})}function PN(){return x.jsx("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","aria-hidden":"true",children:x.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})}function cv(e){var t,n,s="";if(typeof e=="string"||typeof e=="number")s+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=cv(e[t]))&&(s&&(s+=" "),s+=n)}else for(n in e)e[n]&&(s&&(s+=" "),s+=n);return s}function Ri(){for(var e,t,n=0,s="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=cv(e))&&(s&&(s+=" "),s+=t);return s}const RN={PENDING:"task-state-pending",RECEIVED:"task-state-received",STARTED:"task-state-started",SUCCESS:"task-state-success",FAILURE:"task-state-failure",RETRY:"task-state-retry",REVOKED:"task-state-revoked",REJECTED:"task-state-rejected"};function Fi({state:e,className:t}){const n=RN[e]??"task-state-pending";return x.jsx("span",{className:Ri("task-state-badge",n,t),children:e})}function dv({hasNextPage:e,isFetchingNextPage:t,fetchNextPage:n,rootMargin:s="200px"}){const i=L.useRef(null),l=L.useCallback(u=>{t||(i.current&&i.current.disconnect(),i.current=new IntersectionObserver(c=>{c[0].isIntersecting&&e&&n()},{rootMargin:s}),u&&i.current.observe(u))},[t,e,n,s]);return L.useEffect(()=>()=>{i.current&&i.current.disconnect()},[]),{lastElementRef:l}}function Ll(e){return e===null?"":e<1e3?`${e}ms`:e<6e4?`${(e/1e3).toFixed(1)}s`:`${(e/6e4).toFixed(1)}m`}function Fl(e){return e?new Date(e).toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}):""}function tu(e){if(!e)return;const t=e.getFullYear(),n=String(e.getMonth()+1).padStart(2,"0"),s=String(e.getDate()).padStart(2,"0");return`${t}-${n}-${s}`}function nu(e){if(!e)return;const[t,n,s]=e.split("-").map(Number);return new Date(t,n-1,s)}const fv=go("/graphs")({component:DN,validateSearch:e=>({from_date:typeof e.from_date=="string"?e.from_date:void 0,to_date:typeof e.to_date=="string"?e.to_date:void 0})});function DN(){const e=Xi(),{from_date:t,to_date:n}=fv.useSearch(),{data:s,isLoading:i,error:l,hasNextPage:u,isFetchingNextPage:c,fetchNextPage:f}=__({from_date:t,to_date:n}),{lastElementRef:h}=dv({hasNextPage:u,isFetchingNextPage:c,fetchNextPage:f}),m=t||n?{from:nu(t),to:nu(n)}:void 0,p=S=>{e({to:"/graphs",search:{from_date:tu(S?.from),to_date:tu(S?.to)},replace:!0})},g=s?.pages.flatMap(S=>S.graphs)??[],w=s?.pages[0]?.total??0;return x.jsxs("div",{className:"space-y-6",children:[x.jsxs("div",{className:"flex items-start justify-between",children:[x.jsxs("div",{children:[x.jsx("h1",{className:"text-2xl font-bold text-slate-100",children:"Task Graphs"}),x.jsx("p",{className:"text-sm text-slate-500 mt-1",children:"Visualize task execution flows and dependencies"})]}),x.jsx(uv,{value:m,onChange:p})]}),i?x.jsx(IN,{}):l?x.jsx("div",{className:"text-center py-12 text-red-400",children:"Failed to load graphs"}):g.length?x.jsxs("div",{className:"grid gap-4",children:[g.map((S,_)=>{const C=_===g.length-1,N=Fl(S.first_seen),P=Ll(S.duration_ms);return x.jsxs(pt,{ref:C?h:void 0,to:"/graph/$rootId",params:{rootId:S.task_id},className:"bg-slate-900 rounded-xl border border-slate-800 p-6 hover:border-slate-700 transition-colors",children:[x.jsxs("div",{className:"flex items-start justify-between",children:[x.jsxs("div",{children:[x.jsx("h3",{className:"text-lg font-medium text-slate-100",children:S.name}),x.jsx("p",{className:"text-sm text-slate-500 font-mono mt-1",children:S.task_id})]}),x.jsx(Fi,{state:S.state})]}),x.jsxs("div",{className:"flex items-center gap-4 mt-4 text-sm text-slate-400",children:[x.jsxs("span",{children:[S.children.length," child tasks"]}),N&&x.jsxs(x.Fragment,{children:[x.jsx("span",{className:"text-slate-600",children:"·"}),x.jsx("span",{children:N})]}),P&&x.jsxs(x.Fragment,{children:[x.jsx("span",{className:"text-slate-600",children:"·"}),x.jsx("span",{children:P})]})]})]},S.task_id)}),c&&x.jsx(TN,{}),x.jsxs("div",{className:"text-center text-sm text-slate-500 pt-4",children:["Showing ",g.length," of ",w," graphs"]})]}):x.jsx(ON,{})]})}function TN(){return x.jsx("div",{className:"flex justify-center py-4",children:x.jsxs("div",{className:"flex items-center gap-2 text-sm text-slate-400",children:[x.jsxs("svg",{className:"animate-spin h-4 w-4",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true",children:[x.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),x.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),"Loading more..."]})})}function ON(){return x.jsxs("div",{className:"text-center py-16 bg-slate-900/50 rounded-xl border border-slate-800",children:[x.jsx("div",{className:"text-4xl mb-4",children:"🌱"}),x.jsx("h3",{className:"text-lg font-medium text-slate-200",children:"No task graphs yet"}),x.jsx("p",{className:"text-sm text-slate-500 mt-1",children:"Run some Celery tasks to see them appear here"})]})}function IN(){return x.jsx("div",{className:"grid gap-4 animate-pulse",children:[...Array(3)].map((e,t)=>x.jsxs("div",{className:"bg-slate-900 rounded-xl border border-slate-800 p-6",children:[x.jsx("div",{className:"h-5 w-48 bg-slate-800 rounded"}),x.jsx("div",{className:"h-4 w-64 bg-slate-800 rounded mt-2"}),x.jsx("div",{className:"h-4 w-24 bg-slate-800 rounded mt-4"})]},t))})}const jN=[{value:void 0,label:"All"},{value:"PENDING",label:"Pending"},{value:"STARTED",label:"Started"},{value:"SUCCESS",label:"Success"},{value:"FAILURE",label:"Failure"},{value:"RETRY",label:"Retry"},{value:"REVOKED",label:"Revoked"}];function LN({filters:e,onFiltersChange:t}){const n=e.from_date||e.to_date?{from:nu(e.from_date),to:nu(e.to_date)}:void 0,s=l=>{t({...e,from_date:tu(l?.from),to_date:tu(l?.to)})},i=e.state||e.name||e.from_date||e.to_date;return x.jsxs("div",{className:"flex flex-wrap items-center gap-4 p-4 bg-slate-900/50 rounded-lg border border-slate-800",children:[x.jsxs("div",{className:"flex items-center gap-2",children:[x.jsx("span",{className:"text-sm text-slate-400",children:"State:"}),x.jsx("div",{className:"flex gap-1",children:jN.map(l=>x.jsx("button",{type:"button",onClick:()=>t({...e,state:l.value}),className:`px-2 py-1 text-xs rounded transition-colors ${e.state===l.value?"bg-slate-700 text-slate-100":"bg-slate-800 text-slate-400 hover:bg-slate-750 hover:text-slate-300"}`,children:l.label},l.value??"all"))})]}),x.jsxs("div",{className:"flex items-center gap-2",children:[x.jsx("span",{className:"text-sm text-slate-400",children:"Date:"}),x.jsx(uv,{value:n,onChange:s})]}),x.jsxs("div",{className:"flex items-center gap-2 flex-1 min-w-[200px]",children:[x.jsx("label",{htmlFor:"task-search",className:"text-sm text-slate-400",children:"Search:"}),x.jsx("input",{id:"task-search",type:"text",value:e.name,onChange:l=>t({...e,name:l.target.value}),placeholder:"Filter by task name...",className:"flex-1 px-3 py-1.5 text-sm bg-slate-800 border border-slate-700 rounded-lg text-slate-200 placeholder-slate-500 focus:outline-none focus:border-slate-600"})]}),i&&x.jsx("button",{type:"button",onClick:()=>t({state:void 0,name:"",from_date:void 0,to_date:void 0}),className:"text-xs text-slate-500 hover:text-slate-300",children:"Clear"})]})}function FN({filters:e}){const{data:t,isLoading:n,error:s,hasNextPage:i,isFetchingNextPage:l,fetchNextPage:u}=S_({state:e.state,name:e.name||void 0,from_date:e.from_date,to_date:e.to_date}),{lastElementRef:c}=dv({hasNextPage:i,isFetchingNextPage:l,fetchNextPage:u});if(n)return x.jsx($N,{});if(s)return x.jsx("div",{className:"text-center py-12 text-red-400",children:"Failed to load tasks. Is the server running?"});const f=t?.pages.flatMap(m=>m.tasks)??[],h=t?.pages[0]?.total??0;return f.length?x.jsxs("div",{className:"space-y-2",children:[f.map((m,p)=>{const g=p===f.length-1;return x.jsxs(pt,{ref:g?c:void 0,to:"/tasks/$taskId",params:{taskId:m.task_id},className:"flex items-center justify-between p-4 bg-slate-900 rounded-lg border border-slate-800 hover:border-slate-700 transition-colors",children:[x.jsxs("div",{className:"flex items-center gap-4 min-w-0",children:[x.jsx(Fi,{state:m.state}),x.jsxs("div",{className:"min-w-0",children:[x.jsx("p",{className:"text-slate-200 truncate",children:m.name}),x.jsxs("p",{className:"text-xs text-slate-500 font-mono",children:[m.task_id.slice(0,8),"..."]})]})]}),x.jsxs("div",{className:"flex items-center gap-6 text-sm text-slate-400",children:[m.duration_ms!==null&&x.jsxs("span",{className:"font-mono",children:[m.duration_ms,"ms"]}),m.children.length>0&&x.jsxs("span",{className:"text-xs bg-slate-800 px-2 py-0.5 rounded",children:[m.children.length," children"]}),x.jsx("span",{className:"text-xs",children:AN(m.last_updated)})]})]},m.task_id)}),l&&x.jsx(WN,{}),x.jsxs("div",{className:"text-center text-sm text-slate-500 pt-4",children:["Showing ",f.length," of ",h," tasks"]})]}):x.jsx(zN,{})}function AN(e){if(!e)return"";const t=new Date(e),s=new Date().getTime()-t.getTime();return s<6e4?"just now":s<36e5?`${Math.floor(s/6e4)}m ago`:s<864e5?`${Math.floor(s/36e5)}h ago`:t.toLocaleDateString()}function zN(){return x.jsxs("div",{className:"text-center py-16 bg-slate-900/50 rounded-xl border border-slate-800",children:[x.jsx("div",{className:"text-4xl mb-4",children:"📋"}),x.jsx("h3",{className:"text-lg font-medium text-slate-200",children:"No tasks found"}),x.jsx("p",{className:"text-sm text-slate-500 mt-1",children:"Try adjusting your filters or run some Celery tasks"})]})}function WN(){return x.jsx("div",{className:"flex justify-center py-4",children:x.jsxs("div",{className:"flex items-center gap-2 text-sm text-slate-400",children:[x.jsxs("svg",{className:"animate-spin h-4 w-4",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true",children:[x.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),x.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),"Loading more..."]})})}function $N(){return x.jsx("div",{className:"space-y-2 animate-pulse",children:[...Array(5)].map((e,t)=>x.jsxs("div",{className:"flex items-center justify-between p-4 bg-slate-900 rounded-lg border border-slate-800",children:[x.jsxs("div",{className:"flex items-center gap-4",children:[x.jsx("div",{className:"w-16 h-5 bg-slate-800 rounded"}),x.jsxs("div",{children:[x.jsx("div",{className:"w-48 h-4 bg-slate-800 rounded"}),x.jsx("div",{className:"w-24 h-3 bg-slate-800 rounded mt-2"})]})]}),x.jsx("div",{className:"w-16 h-4 bg-slate-800 rounded"})]},t))})}const ru={PENDING:"bg-slate-500",RECEIVED:"bg-slate-400",STARTED:"bg-blue-500",SUCCESS:"bg-emerald-500",FAILURE:"bg-red-500",RETRY:"bg-amber-500",REVOKED:"bg-purple-500",REJECTED:"bg-red-600"},hv=new Set(["SUCCESS","FAILURE","REVOKED","REJECTED"]),Hg={PENDING:0,RECEIVED:1,STARTED:2,RETRY:3,SUCCESS:10,FAILURE:10,REVOKED:10,REJECTED:10},Vg={sm:"h-6",md:"h-8",lg:"h-10"},Yg={SUCCESS:"✓",FAILURE:"×",REVOKED:"⊘",REJECTED:"⊘"};function pv(e){if(!e||e.length===0)return[];let t=!1,n=!1;const i=e.filter(h=>{if(h.state==="PENDING"){if(t)return!1;t=!0}if(h.state==="RECEIVED"){if(n)return!1;n=!0}return!0}).sort((h,m)=>{const p=h.retries??0,g=m.retries??0;if(p!==g)return p-g;const w=Hg[h.state]??5,S=Hg[m.state]??5;return w!==S?w-S:new Date(h.timestamp).getTime()-new Date(m.timestamp).getTime()}),l=new Date(i[0].timestamp).getTime(),c=new Date(i[i.length-1].timestamp).getTime()-l||1,f=[];for(let h=0;h<i.length;h++){const m=i[h],p=new Date(m.timestamp).getTime(),g=hv.has(m.state),w=i[h+1],_=(w?new Date(w.timestamp).getTime():p)-p,C=c>0?_/c*100:100/i.length;f.push({state:m.state,duration:_,timestamp:new Date(m.timestamp),isTerminal:g,widthPct:C})}return f}function ku(e){return e<1e3?`${e}ms`:e<6e4?`${(e/1e3).toFixed(1)}s`:`${(e/6e4).toFixed(1)}m`}function BN(e){return e.toLocaleTimeString()}function mv({events:e,height:t="sm",showLabels:n=!1}){const[s,i]=L.useState(null),[l,u]=L.useState(0),c=L.useRef(null),f=pv(e);if(f.length===0)return x.jsx("div",{className:Vg[t]});const h=f.reduce((m,p)=>m+p.duration,0)||1;return x.jsxs("div",{ref:c,className:Ri("relative overflow-visible flex",Vg[t]),onMouseMove:m=>{if(c.current){const p=c.current.getBoundingClientRect();u(m.clientX-p.left)}},children:[f.map((m,p)=>{const g=h>0?m.duration/h:0,w=s===p,S=p===0,_=p===f.length-1,C=m.isTerminal?"0 0 20px":`${Math.max(1,g*100)} 1 ${Math.max(4,g*100)}%`;return x.jsxs("div",{role:"presentation",className:Ri("h-full flex items-center justify-center cursor-pointer","transition-[filter,transform] duration-75",ru[m.state]??"bg-gray-500",p>0&&"border-l border-slate-900/30",w&&"brightness-125 z-10",S&&"rounded-l",_&&"rounded-r"),style:{flex:C,minWidth:m.isTerminal?"20px":"6px",maxWidth:m.isTerminal?"20px":void 0},onMouseEnter:()=>i(p),onMouseLeave:()=>i(null),children:[n&&x.jsx("span",{className:"text-xs font-semibold text-white/90",children:m.isTerminal?Yg[m.state]??"⊘":g>.15?m.state:m.state[0]}),!n&&m.isTerminal&&x.jsx("span",{className:"text-xs font-semibold text-white/90",children:Yg[m.state]??"⊘"})]},p)}),s!==null&&f[s]&&x.jsxs("div",{className:"absolute -top-12 bg-slate-950 border border-slate-700 text-white text-xs px-3 py-2 rounded-lg shadow-xl whitespace-nowrap z-20 pointer-events-none",style:{left:l,transform:"translateX(-50%)"},children:[x.jsxs("div",{className:"flex items-center gap-2",children:[x.jsx("div",{className:Ri("w-2 h-2 rounded-sm",ru[f[s].state])}),x.jsx("span",{className:"font-medium",children:f[s].state}),x.jsx("span",{className:"text-slate-400",children:"•"}),x.jsx("span",{className:"font-mono",children:ku(f[s].duration)})]}),x.jsx("div",{className:"text-slate-400 mt-1 font-mono text-[10px]",children:BN(f[s].timestamp)})]})]})}function HN({filters:e}){const{data:t,isLoading:n,error:s}=w_({state:e.state,name:e.name||void 0,from_date:e.from_date,to_date:e.to_date});if(n)return x.jsx(YN,{});if(s)return x.jsx("div",{className:"text-center py-12 text-red-400",children:"Failed to load timeline"});if(!t?.tasks.length)return x.jsxs("div",{className:"text-center py-16 bg-slate-900/50 rounded-xl border border-slate-800",children:[x.jsx("div",{className:"text-4xl mb-4",children:"📊"}),x.jsx("h3",{className:"text-lg font-medium text-slate-200",children:"No tasks to display"})]});const i=t.tasks.filter(h=>h.first_seen&&h.last_updated);if(i.length===0)return x.jsx("div",{className:"text-center py-12 text-slate-400",children:"No timing data available"});const l=i.flatMap(h=>[new Date(h.first_seen).getTime(),new Date(h.last_updated).getTime()]),u=Math.min(...l),c=Math.max(...l),f=c-u||1;return x.jsxs("div",{className:"bg-slate-900 rounded-xl border border-slate-800 p-6 overflow-x-auto",children:[x.jsxs("div",{className:"flex justify-between text-xs text-slate-500 mb-4 pl-48",children:[x.jsx("span",{children:Kd(new Date(u))}),x.jsx("span",{children:Kd(new Date(u+f/2))}),x.jsx("span",{children:Kd(new Date(c))})]}),x.jsx("div",{className:"space-y-2",children:i.map(h=>x.jsx(VN,{task:h,minTime:u,range:f},h.task_id))}),x.jsx("div",{className:"flex flex-wrap gap-4 mt-6 pt-4 border-t border-slate-800 text-xs text-slate-400",children:Object.entries(ru).map(([h,m])=>x.jsxs("div",{className:"flex items-center gap-1.5",children:[x.jsx("div",{className:Ri("h-3 rounded",m,hv.has(h)?"w-2":"w-3")}),x.jsx("span",{children:h})]},h))})]})}function VN({task:e,minTime:t,range:n}){const i=((e.first_seen?new Date(e.first_seen).getTime():t)-t)/n*100,l=i>85;return x.jsxs("div",{className:"flex items-center gap-4 h-8 group",children:[x.jsx(pt,{to:"/tasks/$taskId",params:{taskId:e.task_id},className:"w-44 truncate text-sm text-slate-300 hover:text-emerald-400 transition-colors",title:e.name,children:e.name.split(".").pop()}),x.jsxs("div",{className:"flex-1 relative h-6",children:[x.jsx("div",{className:"absolute inset-0 bg-slate-800/50 rounded"}),x.jsx("div",{className:"absolute h-full",style:l?{right:0,minWidth:"80px",maxWidth:"200px"}:{left:`${i}%`,minWidth:"80px",maxWidth:"200px"},children:x.jsx(mv,{events:e.events,height:"sm"})})]}),x.jsx("div",{className:"w-20 text-right text-xs text-slate-500 font-mono",children:e.duration_ms!==null?ku(e.duration_ms):"-"})]})}function Kd(e){return e.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"})}function YN(){return x.jsxs("div",{className:"bg-slate-900 rounded-xl border border-slate-800 p-6 animate-pulse",children:[x.jsx("div",{className:"h-4 w-full bg-slate-800 rounded mb-4"}),x.jsx("div",{className:"space-y-2",children:[...Array(5)].map((e,t)=>x.jsxs("div",{className:"flex items-center gap-4 h-8",children:[x.jsx("div",{className:"w-44 h-4 bg-slate-800 rounded"}),x.jsx("div",{className:"flex-1 h-6 bg-slate-800 rounded"}),x.jsx("div",{className:"w-20 h-4 bg-slate-800 rounded"})]},t))})]})}const gv=go("/")({component:UN,validateSearch:e=>({state:typeof e.state=="string"?e.state:void 0,name:typeof e.name=="string"?e.name:void 0,from_date:typeof e.from_date=="string"?e.from_date:void 0,to_date:typeof e.to_date=="string"?e.to_date:void 0,view:e.view==="list"||e.view==="timeline"?e.view:void 0})});function UN(){const e=Xi(),{state:t,name:n,from_date:s,to_date:i,view:l}=gv.useSearch(),[u,c]=L.useState(l??"list"),f={state:t,name:n??"",from_date:s,to_date:i},h=p=>{e({to:"/",search:{state:p.state,name:p.name||void 0,from_date:p.from_date,to_date:p.to_date,view:u},replace:!0})},m=p=>{c(p),e({to:"/",search:{state:t,name:n||void 0,from_date:s,to_date:i,view:p},replace:!0})};return x.jsxs("div",{className:"space-y-6",children:[x.jsxs("div",{className:"flex items-center justify-between",children:[x.jsxs("div",{children:[x.jsx("h1",{className:"text-2xl font-bold text-slate-100",children:"Tasks"}),x.jsx("p",{className:"text-sm text-slate-500 mt-1",children:"Monitor your Celery task execution in real-time"})]}),x.jsxs("div",{className:"flex items-center gap-2 bg-slate-800 rounded-lg p-1",children:[x.jsx("button",{type:"button",onClick:()=>m("list"),className:`px-3 py-1.5 text-sm rounded-md transition-colors ${u==="list"?"bg-slate-700 text-slate-100":"text-slate-400 hover:text-slate-200"}`,children:"List"}),x.jsx("button",{type:"button",onClick:()=>m("timeline"),className:`px-3 py-1.5 text-sm rounded-md transition-colors ${u==="timeline"?"bg-slate-700 text-slate-100":"text-slate-400 hover:text-slate-200"}`,children:"Timeline"})]})]}),x.jsx(LN,{filters:f,onFiltersChange:h}),u==="list"?x.jsx(FN,{filters:f}):x.jsx(HN,{filters:f})]})}const yv=go("/tasks/$taskId")({component:QN});function QN(){const{taskId:e}=yv.useParams(),{data:t,isLoading:n,error:s}=k_(e);if(n)return x.jsx(XN,{});if(s||!t)return x.jsxs("div",{className:"text-center py-12",children:[x.jsx("p",{className:"text-red-400",children:"Failed to load task"}),x.jsx(pt,{to:"/",className:"text-blue-400 hover:underline mt-2 inline-block",children:"Back to tasks"})]});const{task:i,children:l}=t,u=i.events.find(m=>m.state==="STARTED"),c=u?.args||u?.kwargs,f=i.events.find(m=>m.state==="SUCCESS"),h=f?.result!==null&&f?.result!==void 0;return x.jsxs("div",{className:"space-y-6",children:[x.jsxs("nav",{className:"flex items-center gap-2 text-sm",children:[x.jsx(pt,{to:"/",className:"text-slate-400 hover:text-slate-200",children:"Tasks"}),x.jsx("span",{className:"text-slate-600",children:"/"}),x.jsx("span",{className:"text-slate-200 font-mono",children:e.slice(0,8)})]}),x.jsxs("div",{className:"bg-slate-900 rounded-xl border border-slate-800 p-6",children:[x.jsxs("div",{className:"flex items-start justify-between",children:[x.jsxs("div",{children:[x.jsx("h1",{className:"text-xl font-semibold text-slate-100",children:i.name}),x.jsx("p",{className:"text-sm text-slate-500 font-mono mt-1",children:i.task_id})]}),x.jsx(Fi,{state:i.state})]}),x.jsxs("dl",{className:"grid grid-cols-4 gap-4 mt-6",children:[x.jsx(_l,{label:"Duration",value:ku(i.duration_ms??0)}),x.jsx(_l,{label:"First seen",value:Ai(i.first_seen)}),x.jsx(_l,{label:"Last update",value:Ai(i.last_updated)}),x.jsx(_l,{label:"Children",value:String(l.length)})]})]}),c&&x.jsxs("div",{className:"bg-slate-900 rounded-xl border border-slate-800 p-6",children:[x.jsx("h2",{className:"text-lg font-semibold text-slate-100 mb-4",children:"Parameters"}),u?.args&&x.jsxs("div",{className:"mb-4",children:[x.jsx("span",{className:"text-xs text-slate-500",children:"args"}),x.jsx("div",{className:"bg-slate-950 rounded-lg p-3 mt-1 font-mono text-sm text-slate-300 overflow-x-auto",children:x.jsx("pre",{children:JSON.stringify(u.args,null,2)})})]}),u?.kwargs&&Object.keys(u.kwargs).length>0&&x.jsxs("div",{children:[x.jsx("span",{className:"text-xs text-slate-500",children:"kwargs"}),x.jsx("div",{className:"bg-slate-950 rounded-lg p-3 mt-1 font-mono text-sm text-slate-300 overflow-x-auto",children:x.jsx("pre",{children:JSON.stringify(u.kwargs,null,2)})})]})]}),h&&x.jsxs("div",{className:"bg-slate-900 rounded-xl border border-slate-800 p-6",children:[x.jsx("h2",{className:"text-lg font-semibold text-slate-100 mb-4",children:"Result"}),x.jsx("div",{className:"bg-slate-950 rounded-lg p-3 font-mono text-sm text-emerald-400 overflow-x-auto",children:x.jsx("pre",{children:JSON.stringify(f?.result,null,2)})})]}),i.events.length>1&&x.jsxs("div",{className:"bg-slate-900 rounded-xl border border-slate-800 p-6",children:[x.jsx("h2",{className:"text-lg font-semibold text-slate-100 mb-4",children:"Execution Timeline"}),x.jsx(GN,{events:i.events})]}),x.jsxs("div",{className:"bg-slate-900 rounded-xl border border-slate-800 p-6",children:[x.jsx("h2",{className:"text-lg font-semibold text-slate-100 mb-4",children:"Event History"}),x.jsx("div",{className:"space-y-2",children:KN(i.events).map((m,p)=>x.jsx(qN,{event:m},p))})]}),l.length>0&&x.jsxs("div",{className:"bg-slate-900 rounded-xl border border-slate-800 p-6",children:[x.jsx("h2",{className:"text-lg font-semibold text-slate-100 mb-4",children:"Child Tasks"}),x.jsx("div",{className:"space-y-2",children:l.map(m=>x.jsxs(pt,{to:"/tasks/$taskId",params:{taskId:m.task_id},className:"flex items-center justify-between p-3 bg-slate-800/50 rounded-lg hover:bg-slate-800 transition-colors",children:[x.jsxs("div",{className:"flex-1 truncate",children:[x.jsx("span",{className:"text-slate-200",children:m.name.split(".").pop()}),x.jsx("span",{className:"text-slate-500 text-xs ml-2",children:m.task_id.slice(0,8)})]}),x.jsx(Fi,{state:m.state})]},m.task_id))})]})]})}function qN({event:e}){const[t,n]=L.useState(!1),s=e.state==="FAILURE"||e.state==="RETRY",i=s&&e.exception,l=x.jsxs(x.Fragment,{children:[x.jsx("span",{className:"text-slate-500 font-mono text-xs",children:Ai(e.timestamp)}),x.jsx(Fi,{state:e.state}),e.retries>0&&x.jsxs("span",{className:"text-xs text-slate-500",children:["retry #",e.retries]}),i&&x.jsx("span",{className:"text-xs text-red-400 truncate flex-1",children:e.exception}),s&&e.traceback&&x.jsx("span",{className:"text-xs text-slate-500 ml-auto",children:t?"▲ collapse":"▼ expand"})]});return x.jsxs("div",{className:"border-l-2 border-slate-700 pl-4 py-1",children:[s&&e.traceback?x.jsx("button",{type:"button",className:"flex items-center gap-4 text-sm cursor-pointer w-full text-left hover:bg-slate-800/30 rounded -ml-1 pl-1 py-0.5 transition-colors",onClick:()=>n(!t),children:l}):x.jsx("div",{className:"flex items-center gap-4 text-sm",children:l}),t&&e.traceback&&x.jsx("div",{className:"mt-2 bg-slate-950 rounded-lg p-3 font-mono text-xs text-red-300 overflow-x-auto whitespace-pre",children:e.traceback})]})}function _l({label:e,value:t}){return x.jsxs("div",{children:[x.jsx("dt",{className:"text-xs text-slate-500",children:e}),x.jsx("dd",{className:"text-sm text-slate-200 font-mono mt-1",children:t})]})}function Ai(e){return e?new Date(e).toLocaleTimeString():"-"}const Ug={PENDING:0,RECEIVED:1,STARTED:2,RETRY:3,SUCCESS:10,FAILURE:10,REVOKED:10,REJECTED:10};function KN(e){let t=!1,n=!1;return e.filter(i=>{if(i.state==="PENDING"){if(t)return!1;t=!0}if(i.state==="RECEIVED"){if(n)return!1;n=!0}return!0}).sort((i,l)=>{const u=i.retries??0,c=l.retries??0;if(u!==c)return u-c;const f=Ug[i.state]??5,h=Ug[l.state]??5;return f!==h?f-h:new Date(i.timestamp).getTime()-new Date(l.timestamp).getTime()})}function GN({events:e}){const[t,n]=L.useState(null),s=L.useMemo(()=>pv(e),[e]);if(s.length===0)return null;const i=[...e].sort((l,u)=>new Date(l.timestamp).getTime()-new Date(u.timestamp).getTime());return x.jsxs("div",{className:"space-y-4",children:[x.jsx("div",{className:"bg-slate-800/50 rounded h-10",children:x.jsx(mv,{events:e,height:"lg",showLabels:!0})}),x.jsxs("div",{className:"flex justify-between text-xs text-slate-500",children:[x.jsx("span",{children:Ai(i[0].timestamp)}),x.jsx("span",{children:Ai(i[i.length-1].timestamp)})]}),x.jsx("div",{className:"flex flex-wrap gap-4 text-sm",children:s.map((l,u)=>{const c=t===u;return x.jsxs("div",{role:"presentation",className:`flex items-center gap-2 transition-opacity cursor-default ${t!==null&&!c?"opacity-50":""}`,onMouseEnter:()=>n(u),onMouseLeave:()=>n(null),children:[x.jsx("div",{className:`rounded transition-transform ${ru[l.state]??"bg-gray-500"} ${l.isTerminal?"w-2 h-4":"w-4 h-4"} ${c?"scale-110":""}`}),x.jsx("span",{className:"text-slate-400",children:l.state}),x.jsx("span",{className:"text-slate-200 font-mono font-medium",children:ku(l.duration)})]},u)})})]})}function XN(){return x.jsxs("div",{className:"space-y-6 animate-pulse",children:[x.jsx("div",{className:"h-4 w-32 bg-slate-800 rounded"}),x.jsxs("div",{className:"bg-slate-900 rounded-xl border border-slate-800 p-6",children:[x.jsx("div",{className:"h-6 w-64 bg-slate-800 rounded"}),x.jsx("div",{className:"h-4 w-48 bg-slate-800 rounded mt-2"}),x.jsx("div",{className:"grid grid-cols-4 gap-4 mt-6",children:[...Array(4)].map((e,t)=>x.jsxs("div",{children:[x.jsx("div",{className:"h-3 w-16 bg-slate-800 rounded"}),x.jsx("div",{className:"h-4 w-24 bg-slate-800 rounded mt-2"})]},t))})]})]})}function at(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let n=0,s;n<e.length;n++)(s=at(e[n]))!==""&&(t+=(t&&" ")+s);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}var ZN={value:()=>{}};function _u(){for(var e=0,t=arguments.length,n={},s;e<t;++e){if(!(s=arguments[e]+"")||s in n||/[\s.]/.test(s))throw new Error("illegal type: "+s);n[s]=[]}return new Al(n)}function Al(e){this._=e}function JN(e,t){return e.trim().split(/^|\s+/).map(function(n){var s="",i=n.indexOf(".");if(i>=0&&(s=n.slice(i+1),n=n.slice(0,i)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:s}})}Al.prototype=_u.prototype={constructor:Al,on:function(e,t){var n=this._,s=JN(e+"",n),i,l=-1,u=s.length;if(arguments.length<2){for(;++l<u;)if((i=(e=s[l]).type)&&(i=eb(n[i],e.name)))return i;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++l<u;)if(i=(e=s[l]).type)n[i]=Qg(n[i],e.name,t);else if(t==null)for(i in n)n[i]=Qg(n[i],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new Al(e)},call:function(e,t){if((i=arguments.length-2)>0)for(var n=new Array(i),s=0,i,l;s<i;++s)n[s]=arguments[s+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(l=this._[e],s=0,i=l.length;s<i;++s)l[s].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var s=this._[e],i=0,l=s.length;i<l;++i)s[i].value.apply(t,n)}};function eb(e,t){for(var n=0,s=e.length,i;n<s;++n)if((i=e[n]).name===t)return i.value}function Qg(e,t,n){for(var s=0,i=e.length;s<i;++s)if(e[s].name===t){e[s]=ZN,e=e.slice(0,s).concat(e.slice(s+1));break}return n!=null&&e.push({name:t,value:n}),e}var Sf="http://www.w3.org/1999/xhtml";const qg={svg:"http://www.w3.org/2000/svg",xhtml:Sf,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Cu(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),qg.hasOwnProperty(t)?{space:qg[t],local:e}:e}function tb(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===Sf&&t.documentElement.namespaceURI===Sf?t.createElement(e):t.createElementNS(n,e)}}function nb(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function vv(e){var t=Cu(e);return(t.local?nb:tb)(t)}function rb(){}function ih(e){return e==null?rb:function(){return this.querySelector(e)}}function ob(e){typeof e!="function"&&(e=ih(e));for(var t=this._groups,n=t.length,s=new Array(n),i=0;i<n;++i)for(var l=t[i],u=l.length,c=s[i]=new Array(u),f,h,m=0;m<u;++m)(f=l[m])&&(h=e.call(f,f.__data__,m,l))&&("__data__"in f&&(h.__data__=f.__data__),c[m]=h);return new qt(s,this._parents)}function sb(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function ib(){return[]}function xv(e){return e==null?ib:function(){return this.querySelectorAll(e)}}function ab(e){return function(){return sb(e.apply(this,arguments))}}function lb(e){typeof e=="function"?e=ab(e):e=xv(e);for(var t=this._groups,n=t.length,s=[],i=[],l=0;l<n;++l)for(var u=t[l],c=u.length,f,h=0;h<c;++h)(f=u[h])&&(s.push(e.call(f,f.__data__,h,u)),i.push(f));return new qt(s,i)}function wv(e){return function(){return this.matches(e)}}function Sv(e){return function(t){return t.matches(e)}}var ub=Array.prototype.find;function cb(e){return function(){return ub.call(this.children,e)}}function db(){return this.firstElementChild}function fb(e){return this.select(e==null?db:cb(typeof e=="function"?e:Sv(e)))}var hb=Array.prototype.filter;function pb(){return Array.from(this.children)}function mb(e){return function(){return hb.call(this.children,e)}}function gb(e){return this.selectAll(e==null?pb:mb(typeof e=="function"?e:Sv(e)))}function yb(e){typeof e!="function"&&(e=wv(e));for(var t=this._groups,n=t.length,s=new Array(n),i=0;i<n;++i)for(var l=t[i],u=l.length,c=s[i]=[],f,h=0;h<u;++h)(f=l[h])&&e.call(f,f.__data__,h,l)&&c.push(f);return new qt(s,this._parents)}function kv(e){return new Array(e.length)}function vb(){return new qt(this._enter||this._groups.map(kv),this._parents)}function ou(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}ou.prototype={constructor:ou,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function xb(e){return function(){return e}}function wb(e,t,n,s,i,l){for(var u=0,c,f=t.length,h=l.length;u<h;++u)(c=t[u])?(c.__data__=l[u],s[u]=c):n[u]=new ou(e,l[u]);for(;u<f;++u)(c=t[u])&&(i[u]=c)}function Sb(e,t,n,s,i,l,u){var c,f,h=new Map,m=t.length,p=l.length,g=new Array(m),w;for(c=0;c<m;++c)(f=t[c])&&(g[c]=w=u.call(f,f.__data__,c,t)+"",h.has(w)?i[c]=f:h.set(w,f));for(c=0;c<p;++c)w=u.call(e,l[c],c,l)+"",(f=h.get(w))?(s[c]=f,f.__data__=l[c],h.delete(w)):n[c]=new ou(e,l[c]);for(c=0;c<m;++c)(f=t[c])&&h.get(g[c])===f&&(i[c]=f)}function kb(e){return e.__data__}function _b(e,t){if(!arguments.length)return Array.from(this,kb);var n=t?Sb:wb,s=this._parents,i=this._groups;typeof e!="function"&&(e=xb(e));for(var l=i.length,u=new Array(l),c=new Array(l),f=new Array(l),h=0;h<l;++h){var m=s[h],p=i[h],g=p.length,w=Cb(e.call(m,m&&m.__data__,h,s)),S=w.length,_=c[h]=new Array(S),C=u[h]=new Array(S),N=f[h]=new Array(g);n(m,p,_,C,N,w,t);for(var P=0,k=0,b,T;P<S;++P)if(b=_[P]){for(P>=k&&(k=P+1);!(T=C[k])&&++k<S;);b._next=T||null}}return u=new qt(u,s),u._enter=c,u._exit=f,u}function Cb(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Eb(){return new qt(this._exit||this._groups.map(kv),this._parents)}function Nb(e,t,n){var s=this.enter(),i=this,l=this.exit();return typeof e=="function"?(s=e(s),s&&(s=s.selection())):s=s.append(e+""),t!=null&&(i=t(i),i&&(i=i.selection())),n==null?l.remove():n(l),s&&i?s.merge(i).order():i}function bb(e){for(var t=e.selection?e.selection():e,n=this._groups,s=t._groups,i=n.length,l=s.length,u=Math.min(i,l),c=new Array(i),f=0;f<u;++f)for(var h=n[f],m=s[f],p=h.length,g=c[f]=new Array(p),w,S=0;S<p;++S)(w=h[S]||m[S])&&(g[S]=w);for(;f<i;++f)c[f]=n[f];return new qt(c,this._parents)}function Mb(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var s=e[t],i=s.length-1,l=s[i],u;--i>=0;)(u=s[i])&&(l&&u.compareDocumentPosition(l)^4&&l.parentNode.insertBefore(u,l),l=u);return this}function Pb(e){e||(e=Rb);function t(p,g){return p&&g?e(p.__data__,g.__data__):!p-!g}for(var n=this._groups,s=n.length,i=new Array(s),l=0;l<s;++l){for(var u=n[l],c=u.length,f=i[l]=new Array(c),h,m=0;m<c;++m)(h=u[m])&&(f[m]=h);f.sort(t)}return new qt(i,this._parents).order()}function Rb(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function Db(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function Tb(){return Array.from(this)}function Ob(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var s=e[t],i=0,l=s.length;i<l;++i){var u=s[i];if(u)return u}return null}function Ib(){let e=0;for(const t of this)++e;return e}function jb(){return!this.node()}function Lb(e){for(var t=this._groups,n=0,s=t.length;n<s;++n)for(var i=t[n],l=0,u=i.length,c;l<u;++l)(c=i[l])&&e.call(c,c.__data__,l,i);return this}function Fb(e){return function(){this.removeAttribute(e)}}function Ab(e){return function(){this.removeAttributeNS(e.space,e.local)}}function zb(e,t){return function(){this.setAttribute(e,t)}}function Wb(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function $b(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function Bb(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function Hb(e,t){var n=Cu(e);if(arguments.length<2){var s=this.node();return n.local?s.getAttributeNS(n.space,n.local):s.getAttribute(n)}return this.each((t==null?n.local?Ab:Fb:typeof t=="function"?n.local?Bb:$b:n.local?Wb:zb)(n,t))}function _v(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function Vb(e){return function(){this.style.removeProperty(e)}}function Yb(e,t,n){return function(){this.style.setProperty(e,t,n)}}function Ub(e,t,n){return function(){var s=t.apply(this,arguments);s==null?this.style.removeProperty(e):this.style.setProperty(e,s,n)}}function Qb(e,t,n){return arguments.length>1?this.each((t==null?Vb:typeof t=="function"?Ub:Yb)(e,t,n??"")):ys(this.node(),e)}function ys(e,t){return e.style.getPropertyValue(t)||_v(e).getComputedStyle(e,null).getPropertyValue(t)}function qb(e){return function(){delete this[e]}}function Kb(e,t){return function(){this[e]=t}}function Gb(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function Xb(e,t){return arguments.length>1?this.each((t==null?qb:typeof t=="function"?Gb:Kb)(e,t)):this.node()[e]}function Cv(e){return e.trim().split(/^|\s+/)}function ah(e){return e.classList||new Ev(e)}function Ev(e){this._node=e,this._names=Cv(e.getAttribute("class")||"")}Ev.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function Nv(e,t){for(var n=ah(e),s=-1,i=t.length;++s<i;)n.add(t[s])}function bv(e,t){for(var n=ah(e),s=-1,i=t.length;++s<i;)n.remove(t[s])}function Zb(e){return function(){Nv(this,e)}}function Jb(e){return function(){bv(this,e)}}function eM(e,t){return function(){(t.apply(this,arguments)?Nv:bv)(this,e)}}function tM(e,t){var n=Cv(e+"");if(arguments.length<2){for(var s=ah(this.node()),i=-1,l=n.length;++i<l;)if(!s.contains(n[i]))return!1;return!0}return this.each((typeof t=="function"?eM:t?Zb:Jb)(n,t))}function nM(){this.textContent=""}function rM(e){return function(){this.textContent=e}}function oM(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function sM(e){return arguments.length?this.each(e==null?nM:(typeof e=="function"?oM:rM)(e)):this.node().textContent}function iM(){this.innerHTML=""}function aM(e){return function(){this.innerHTML=e}}function lM(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function uM(e){return arguments.length?this.each(e==null?iM:(typeof e=="function"?lM:aM)(e)):this.node().innerHTML}function cM(){this.nextSibling&&this.parentNode.appendChild(this)}function dM(){return this.each(cM)}function fM(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function hM(){return this.each(fM)}function pM(e){var t=typeof e=="function"?e:vv(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function mM(){return null}function gM(e,t){var n=typeof e=="function"?e:vv(e),s=t==null?mM:typeof t=="function"?t:ih(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),s.apply(this,arguments)||null)})}function yM(){var e=this.parentNode;e&&e.removeChild(this)}function vM(){return this.each(yM)}function xM(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function wM(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function SM(e){return this.select(e?wM:xM)}function kM(e){return arguments.length?this.property("__data__",e):this.node().__data__}function _M(e){return function(t){e.call(this,t,this.__data__)}}function CM(e){return e.trim().split(/^|\s+/).map(function(t){var n="",s=t.indexOf(".");return s>=0&&(n=t.slice(s+1),t=t.slice(0,s)),{type:t,name:n}})}function EM(e){return function(){var t=this.__on;if(t){for(var n=0,s=-1,i=t.length,l;n<i;++n)l=t[n],(!e.type||l.type===e.type)&&l.name===e.name?this.removeEventListener(l.type,l.listener,l.options):t[++s]=l;++s?t.length=s:delete this.__on}}}function NM(e,t,n){return function(){var s=this.__on,i,l=_M(t);if(s){for(var u=0,c=s.length;u<c;++u)if((i=s[u]).type===e.type&&i.name===e.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=l,i.options=n),i.value=t;return}}this.addEventListener(e.type,l,n),i={type:e.type,name:e.name,value:t,listener:l,options:n},s?s.push(i):this.__on=[i]}}function bM(e,t,n){var s=CM(e+""),i,l=s.length,u;if(arguments.length<2){var c=this.node().__on;if(c){for(var f=0,h=c.length,m;f<h;++f)for(i=0,m=c[f];i<l;++i)if((u=s[i]).type===m.type&&u.name===m.name)return m.value}return}for(c=t?NM:EM,i=0;i<l;++i)this.each(c(s[i],t,n));return this}function Mv(e,t,n){var s=_v(e),i=s.CustomEvent;typeof i=="function"?i=new i(t,n):(i=s.document.createEvent("Event"),n?(i.initEvent(t,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(t,!1,!1)),e.dispatchEvent(i)}function MM(e,t){return function(){return Mv(this,e,t)}}function PM(e,t){return function(){return Mv(this,e,t.apply(this,arguments))}}function RM(e,t){return this.each((typeof t=="function"?PM:MM)(e,t))}function*DM(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var s=e[t],i=0,l=s.length,u;i<l;++i)(u=s[i])&&(yield u)}var Pv=[null];function qt(e,t){this._groups=e,this._parents=t}function ta(){return new qt([[document.documentElement]],Pv)}function TM(){return this}qt.prototype=ta.prototype={constructor:qt,select:ob,selectAll:lb,selectChild:fb,selectChildren:gb,filter:yb,data:_b,enter:vb,exit:Eb,join:Nb,merge:bb,selection:TM,order:Mb,sort:Pb,call:Db,nodes:Tb,node:Ob,size:Ib,empty:jb,each:Lb,attr:Hb,style:Qb,property:Xb,classed:tM,text:sM,html:uM,raise:dM,lower:hM,append:pM,insert:gM,remove:vM,clone:SM,datum:kM,on:bM,dispatch:RM,[Symbol.iterator]:DM};function Yt(e){return typeof e=="string"?new qt([[document.querySelector(e)]],[document.documentElement]):new qt([[e]],Pv)}function OM(e){let t;for(;t=e.sourceEvent;)e=t;return e}function yn(e,t){if(e=OM(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var s=n.createSVGPoint();return s.x=e.clientX,s.y=e.clientY,s=s.matrixTransform(t.getScreenCTM().inverse()),[s.x,s.y]}if(t.getBoundingClientRect){var i=t.getBoundingClientRect();return[e.clientX-i.left-t.clientLeft,e.clientY-i.top-t.clientTop]}}return[e.pageX,e.pageY]}const IM={passive:!1},zi={capture:!0,passive:!1};function Gd(e){e.stopImmediatePropagation()}function hs(e){e.preventDefault(),e.stopImmediatePropagation()}function Rv(e){var t=e.document.documentElement,n=Yt(e).on("dragstart.drag",hs,zi);"onselectstart"in t?n.on("selectstart.drag",hs,zi):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function Dv(e,t){var n=e.document.documentElement,s=Yt(e).on("dragstart.drag",null);t&&(s.on("click.drag",hs,zi),setTimeout(function(){s.on("click.drag",null)},0)),"onselectstart"in n?s.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}const Cl=e=>()=>e;function kf(e,{sourceEvent:t,subject:n,target:s,identifier:i,active:l,x:u,y:c,dx:f,dy:h,dispatch:m}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:s,enumerable:!0,configurable:!0},identifier:{value:i,enumerable:!0,configurable:!0},active:{value:l,enumerable:!0,configurable:!0},x:{value:u,enumerable:!0,configurable:!0},y:{value:c,enumerable:!0,configurable:!0},dx:{value:f,enumerable:!0,configurable:!0},dy:{value:h,enumerable:!0,configurable:!0},_:{value:m}})}kf.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function jM(e){return!e.ctrlKey&&!e.button}function LM(){return this.parentNode}function FM(e,t){return t??{x:e.x,y:e.y}}function AM(){return navigator.maxTouchPoints||"ontouchstart"in this}function Tv(){var e=jM,t=LM,n=FM,s=AM,i={},l=_u("start","drag","end"),u=0,c,f,h,m,p=0;function g(b){b.on("mousedown.drag",w).filter(s).on("touchstart.drag",C).on("touchmove.drag",N,IM).on("touchend.drag touchcancel.drag",P).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function w(b,T){if(!(m||!e.call(this,b,T))){var M=k(this,t.call(this,b,T),b,T,"mouse");M&&(Yt(b.view).on("mousemove.drag",S,zi).on("mouseup.drag",_,zi),Rv(b.view),Gd(b),h=!1,c=b.clientX,f=b.clientY,M("start",b))}}function S(b){if(hs(b),!h){var T=b.clientX-c,M=b.clientY-f;h=T*T+M*M>p}i.mouse("drag",b)}function _(b){Yt(b.view).on("mousemove.drag mouseup.drag",null),Dv(b.view,h),hs(b),i.mouse("end",b)}function C(b,T){if(e.call(this,b,T)){var M=b.changedTouches,R=t.call(this,b,T),O=M.length,A,G;for(A=0;A<O;++A)(G=k(this,R,b,T,M[A].identifier,M[A]))&&(Gd(b),G("start",b,M[A]))}}function N(b){var T=b.changedTouches,M=T.length,R,O;for(R=0;R<M;++R)(O=i[T[R].identifier])&&(hs(b),O("drag",b,T[R]))}function P(b){var T=b.changedTouches,M=T.length,R,O;for(m&&clearTimeout(m),m=setTimeout(function(){m=null},500),R=0;R<M;++R)(O=i[T[R].identifier])&&(Gd(b),O("end",b,T[R]))}function k(b,T,M,R,O,A){var G=l.copy(),W=yn(A||M,T),K,J,I;if((I=n.call(b,new kf("beforestart",{sourceEvent:M,target:g,identifier:O,active:u,x:W[0],y:W[1],dx:0,dy:0,dispatch:G}),R))!=null)return K=I.x-W[0]||0,J=I.y-W[1]||0,function Y(V,Q,F){var B=W,U;switch(V){case"start":i[O]=Y,U=u++;break;case"end":delete i[O],--u;case"drag":W=yn(F||Q,T),U=u;break}G.call(V,b,new kf(V,{sourceEvent:Q,subject:I,target:g,identifier:O,active:U,x:W[0]+K,y:W[1]+J,dx:W[0]-B[0],dy:W[1]-B[1],dispatch:G}),R)}}return g.filter=function(b){return arguments.length?(e=typeof b=="function"?b:Cl(!!b),g):e},g.container=function(b){return arguments.length?(t=typeof b=="function"?b:Cl(b),g):t},g.subject=function(b){return arguments.length?(n=typeof b=="function"?b:Cl(b),g):n},g.touchable=function(b){return arguments.length?(s=typeof b=="function"?b:Cl(!!b),g):s},g.on=function(){var b=l.on.apply(l,arguments);return b===l?g:b},g.clickDistance=function(b){return arguments.length?(p=(b=+b)*b,g):Math.sqrt(p)},g}function lh(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function Ov(e,t){var n=Object.create(e.prototype);for(var s in t)n[s]=t[s];return n}function na(){}var Wi=.7,su=1/Wi,ps="\\s*([+-]?\\d+)\\s*",$i="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Tn="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",zM=/^#([0-9a-f]{3,8})$/,WM=new RegExp(`^rgb\\(${ps},${ps},${ps}\\)$`),$M=new RegExp(`^rgb\\(${Tn},${Tn},${Tn}\\)$`),BM=new RegExp(`^rgba\\(${ps},${ps},${ps},${$i}\\)$`),HM=new RegExp(`^rgba\\(${Tn},${Tn},${Tn},${$i}\\)$`),VM=new RegExp(`^hsl\\(${$i},${Tn},${Tn}\\)$`),YM=new RegExp(`^hsla\\(${$i},${Tn},${Tn},${$i}\\)$`),Kg={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};lh(na,vo,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Gg,formatHex:Gg,formatHex8:UM,formatHsl:QM,formatRgb:Xg,toString:Xg});function Gg(){return this.rgb().formatHex()}function UM(){return this.rgb().formatHex8()}function QM(){return Iv(this).formatHsl()}function Xg(){return this.rgb().formatRgb()}function vo(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=zM.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?Zg(t):n===3?new Lt(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?El(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?El(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=WM.exec(e))?new Lt(t[1],t[2],t[3],1):(t=$M.exec(e))?new Lt(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=BM.exec(e))?El(t[1],t[2],t[3],t[4]):(t=HM.exec(e))?El(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=VM.exec(e))?ty(t[1],t[2]/100,t[3]/100,1):(t=YM.exec(e))?ty(t[1],t[2]/100,t[3]/100,t[4]):Kg.hasOwnProperty(e)?Zg(Kg[e]):e==="transparent"?new Lt(NaN,NaN,NaN,0):null}function Zg(e){return new Lt(e>>16&255,e>>8&255,e&255,1)}function El(e,t,n,s){return s<=0&&(e=t=n=NaN),new Lt(e,t,n,s)}function qM(e){return e instanceof na||(e=vo(e)),e?(e=e.rgb(),new Lt(e.r,e.g,e.b,e.opacity)):new Lt}function _f(e,t,n,s){return arguments.length===1?qM(e):new Lt(e,t,n,s??1)}function Lt(e,t,n,s){this.r=+e,this.g=+t,this.b=+n,this.opacity=+s}lh(Lt,_f,Ov(na,{brighter(e){return e=e==null?su:Math.pow(su,e),new Lt(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Wi:Math.pow(Wi,e),new Lt(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Lt(co(this.r),co(this.g),co(this.b),iu(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:Jg,formatHex:Jg,formatHex8:KM,formatRgb:ey,toString:ey}));function Jg(){return`#${io(this.r)}${io(this.g)}${io(this.b)}`}function KM(){return`#${io(this.r)}${io(this.g)}${io(this.b)}${io((isNaN(this.opacity)?1:this.opacity)*255)}`}function ey(){const e=iu(this.opacity);return`${e===1?"rgb(":"rgba("}${co(this.r)}, ${co(this.g)}, ${co(this.b)}${e===1?")":`, ${e})`}`}function iu(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function co(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function io(e){return e=co(e),(e<16?"0":"")+e.toString(16)}function ty(e,t,n,s){return s<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new xn(e,t,n,s)}function Iv(e){if(e instanceof xn)return new xn(e.h,e.s,e.l,e.opacity);if(e instanceof na||(e=vo(e)),!e)return new xn;if(e instanceof xn)return e;e=e.rgb();var t=e.r/255,n=e.g/255,s=e.b/255,i=Math.min(t,n,s),l=Math.max(t,n,s),u=NaN,c=l-i,f=(l+i)/2;return c?(t===l?u=(n-s)/c+(n<s)*6:n===l?u=(s-t)/c+2:u=(t-n)/c+4,c/=f<.5?l+i:2-l-i,u*=60):c=f>0&&f<1?0:u,new xn(u,c,f,e.opacity)}function GM(e,t,n,s){return arguments.length===1?Iv(e):new xn(e,t,n,s??1)}function xn(e,t,n,s){this.h=+e,this.s=+t,this.l=+n,this.opacity=+s}lh(xn,GM,Ov(na,{brighter(e){return e=e==null?su:Math.pow(su,e),new xn(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Wi:Math.pow(Wi,e),new xn(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,s=n+(n<.5?n:1-n)*t,i=2*n-s;return new Lt(Xd(e>=240?e-240:e+120,i,s),Xd(e,i,s),Xd(e<120?e+240:e-120,i,s),this.opacity)},clamp(){return new xn(ny(this.h),Nl(this.s),Nl(this.l),iu(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=iu(this.opacity);return`${e===1?"hsl(":"hsla("}${ny(this.h)}, ${Nl(this.s)*100}%, ${Nl(this.l)*100}%${e===1?")":`, ${e})`}`}}));function ny(e){return e=(e||0)%360,e<0?e+360:e}function Nl(e){return Math.max(0,Math.min(1,e||0))}function Xd(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const uh=e=>()=>e;function XM(e,t){return function(n){return e+n*t}}function ZM(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(s){return Math.pow(e+s*t,n)}}function JM(e){return(e=+e)==1?jv:function(t,n){return n-t?ZM(t,n,e):uh(isNaN(t)?n:t)}}function jv(e,t){var n=t-e;return n?XM(e,n):uh(isNaN(e)?t:e)}const au=(function e(t){var n=JM(t);function s(i,l){var u=n((i=_f(i)).r,(l=_f(l)).r),c=n(i.g,l.g),f=n(i.b,l.b),h=jv(i.opacity,l.opacity);return function(m){return i.r=u(m),i.g=c(m),i.b=f(m),i.opacity=h(m),i+""}}return s.gamma=e,s})(1);function eP(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,s=t.slice(),i;return function(l){for(i=0;i<n;++i)s[i]=e[i]*(1-l)+t[i]*l;return s}}function tP(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function nP(e,t){var n=t?t.length:0,s=e?Math.min(n,e.length):0,i=new Array(s),l=new Array(n),u;for(u=0;u<s;++u)i[u]=Di(e[u],t[u]);for(;u<n;++u)l[u]=t[u];return function(c){for(u=0;u<s;++u)l[u]=i[u](c);return l}}function rP(e,t){var n=new Date;return e=+e,t=+t,function(s){return n.setTime(e*(1-s)+t*s),n}}function Rn(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function oP(e,t){var n={},s={},i;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(i in t)i in e?n[i]=Di(e[i],t[i]):s[i]=t[i];return function(l){for(i in n)s[i]=n[i](l);return s}}var Cf=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Zd=new RegExp(Cf.source,"g");function sP(e){return function(){return e}}function iP(e){return function(t){return e(t)+""}}function Lv(e,t){var n=Cf.lastIndex=Zd.lastIndex=0,s,i,l,u=-1,c=[],f=[];for(e=e+"",t=t+"";(s=Cf.exec(e))&&(i=Zd.exec(t));)(l=i.index)>n&&(l=t.slice(n,l),c[u]?c[u]+=l:c[++u]=l),(s=s[0])===(i=i[0])?c[u]?c[u]+=i:c[++u]=i:(c[++u]=null,f.push({i:u,x:Rn(s,i)})),n=Zd.lastIndex;return n<t.length&&(l=t.slice(n),c[u]?c[u]+=l:c[++u]=l),c.length<2?f[0]?iP(f[0].x):sP(t):(t=f.length,function(h){for(var m=0,p;m<t;++m)c[(p=f[m]).i]=p.x(h);return c.join("")})}function Di(e,t){var n=typeof t,s;return t==null||n==="boolean"?uh(t):(n==="number"?Rn:n==="string"?(s=vo(t))?(t=s,au):Lv:t instanceof vo?au:t instanceof Date?rP:tP(t)?eP:Array.isArray(t)?nP:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?oP:Rn)(e,t)}var ry=180/Math.PI,Ef={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Fv(e,t,n,s,i,l){var u,c,f;return(u=Math.sqrt(e*e+t*t))&&(e/=u,t/=u),(f=e*n+t*s)&&(n-=e*f,s-=t*f),(c=Math.sqrt(n*n+s*s))&&(n/=c,s/=c,f/=c),e*s<t*n&&(e=-e,t=-t,f=-f,u=-u),{translateX:i,translateY:l,rotate:Math.atan2(t,e)*ry,skewX:Math.atan(f)*ry,scaleX:u,scaleY:c}}var bl;function aP(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?Ef:Fv(t.a,t.b,t.c,t.d,t.e,t.f)}function lP(e){return e==null||(bl||(bl=document.createElementNS("http://www.w3.org/2000/svg","g")),bl.setAttribute("transform",e),!(e=bl.transform.baseVal.consolidate()))?Ef:(e=e.matrix,Fv(e.a,e.b,e.c,e.d,e.e,e.f))}function Av(e,t,n,s){function i(h){return h.length?h.pop()+" ":""}function l(h,m,p,g,w,S){if(h!==p||m!==g){var _=w.push("translate(",null,t,null,n);S.push({i:_-4,x:Rn(h,p)},{i:_-2,x:Rn(m,g)})}else(p||g)&&w.push("translate("+p+t+g+n)}function u(h,m,p,g){h!==m?(h-m>180?m+=360:m-h>180&&(h+=360),g.push({i:p.push(i(p)+"rotate(",null,s)-2,x:Rn(h,m)})):m&&p.push(i(p)+"rotate("+m+s)}function c(h,m,p,g){h!==m?g.push({i:p.push(i(p)+"skewX(",null,s)-2,x:Rn(h,m)}):m&&p.push(i(p)+"skewX("+m+s)}function f(h,m,p,g,w,S){if(h!==p||m!==g){var _=w.push(i(w)+"scale(",null,",",null,")");S.push({i:_-4,x:Rn(h,p)},{i:_-2,x:Rn(m,g)})}else(p!==1||g!==1)&&w.push(i(w)+"scale("+p+","+g+")")}return function(h,m){var p=[],g=[];return h=e(h),m=e(m),l(h.translateX,h.translateY,m.translateX,m.translateY,p,g),u(h.rotate,m.rotate,p,g),c(h.skewX,m.skewX,p,g),f(h.scaleX,h.scaleY,m.scaleX,m.scaleY,p,g),h=m=null,function(w){for(var S=-1,_=g.length,C;++S<_;)p[(C=g[S]).i]=C.x(w);return p.join("")}}}var uP=Av(aP,"px, ","px)","deg)"),cP=Av(lP,", ",")",")"),dP=1e-12;function oy(e){return((e=Math.exp(e))+1/e)/2}function fP(e){return((e=Math.exp(e))-1/e)/2}function hP(e){return((e=Math.exp(2*e))-1)/(e+1)}const zl=(function e(t,n,s){function i(l,u){var c=l[0],f=l[1],h=l[2],m=u[0],p=u[1],g=u[2],w=m-c,S=p-f,_=w*w+S*S,C,N;if(_<dP)N=Math.log(g/h)/t,C=function(R){return[c+R*w,f+R*S,h*Math.exp(t*R*N)]};else{var P=Math.sqrt(_),k=(g*g-h*h+s*_)/(2*h*n*P),b=(g*g-h*h-s*_)/(2*g*n*P),T=Math.log(Math.sqrt(k*k+1)-k),M=Math.log(Math.sqrt(b*b+1)-b);N=(M-T)/t,C=function(R){var O=R*N,A=oy(T),G=h/(n*P)*(A*hP(t*O+T)-fP(T));return[c+G*w,f+G*S,h*A/oy(t*O+T)]}}return C.duration=N*1e3*t/Math.SQRT2,C}return i.rho=function(l){var u=Math.max(.001,+l),c=u*u,f=c*c;return e(u,c,f)},i})(Math.SQRT2,2,4);var vs=0,Ni=0,wi=0,zv=1e3,lu,bi,uu=0,xo=0,Eu=0,Bi=typeof performance=="object"&&performance.now?performance:Date,Wv=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function ch(){return xo||(Wv(pP),xo=Bi.now()+Eu)}function pP(){xo=0}function cu(){this._call=this._time=this._next=null}cu.prototype=$v.prototype={constructor:cu,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?ch():+n)+(t==null?0:+t),!this._next&&bi!==this&&(bi?bi._next=this:lu=this,bi=this),this._call=e,this._time=n,Nf()},stop:function(){this._call&&(this._call=null,this._time=1/0,Nf())}};function $v(e,t,n){var s=new cu;return s.restart(e,t,n),s}function mP(){ch(),++vs;for(var e=lu,t;e;)(t=xo-e._time)>=0&&e._call.call(void 0,t),e=e._next;--vs}function sy(){xo=(uu=Bi.now())+Eu,vs=Ni=0;try{mP()}finally{vs=0,yP(),xo=0}}function gP(){var e=Bi.now(),t=e-uu;t>zv&&(Eu-=t,uu=e)}function yP(){for(var e,t=lu,n,s=1/0;t;)t._call?(s>t._time&&(s=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:lu=n);bi=e,Nf(s)}function Nf(e){if(!vs){Ni&&(Ni=clearTimeout(Ni));var t=e-xo;t>24?(e<1/0&&(Ni=setTimeout(sy,e-Bi.now()-Eu)),wi&&(wi=clearInterval(wi))):(wi||(uu=Bi.now(),wi=setInterval(gP,zv)),vs=1,Wv(sy))}}function iy(e,t,n){var s=new cu;return t=t==null?0:+t,s.restart(i=>{s.stop(),e(i+t)},t,n),s}var vP=_u("start","end","cancel","interrupt"),xP=[],Bv=0,ay=1,bf=2,Wl=3,ly=4,Mf=5,$l=6;function Nu(e,t,n,s,i,l){var u=e.__transition;if(!u)e.__transition={};else if(n in u)return;wP(e,n,{name:t,index:s,group:i,on:vP,tween:xP,time:l.time,delay:l.delay,duration:l.duration,ease:l.ease,timer:null,state:Bv})}function dh(e,t){var n=_n(e,t);if(n.state>Bv)throw new Error("too late; already scheduled");return n}function Ln(e,t){var n=_n(e,t);if(n.state>Wl)throw new Error("too late; already running");return n}function _n(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function wP(e,t,n){var s=e.__transition,i;s[t]=n,n.timer=$v(l,0,n.time);function l(h){n.state=ay,n.timer.restart(u,n.delay,n.time),n.delay<=h&&u(h-n.delay)}function u(h){var m,p,g,w;if(n.state!==ay)return f();for(m in s)if(w=s[m],w.name===n.name){if(w.state===Wl)return iy(u);w.state===ly?(w.state=$l,w.timer.stop(),w.on.call("interrupt",e,e.__data__,w.index,w.group),delete s[m]):+m<t&&(w.state=$l,w.timer.stop(),w.on.call("cancel",e,e.__data__,w.index,w.group),delete s[m])}if(iy(function(){n.state===Wl&&(n.state=ly,n.timer.restart(c,n.delay,n.time),c(h))}),n.state=bf,n.on.call("start",e,e.__data__,n.index,n.group),n.state===bf){for(n.state=Wl,i=new Array(g=n.tween.length),m=0,p=-1;m<g;++m)(w=n.tween[m].value.call(e,e.__data__,n.index,n.group))&&(i[++p]=w);i.length=p+1}}function c(h){for(var m=h<n.duration?n.ease.call(null,h/n.duration):(n.timer.restart(f),n.state=Mf,1),p=-1,g=i.length;++p<g;)i[p].call(e,m);n.state===Mf&&(n.on.call("end",e,e.__data__,n.index,n.group),f())}function f(){n.state=$l,n.timer.stop(),delete s[t];for(var h in s)return;delete e.__transition}}function Bl(e,t){var n=e.__transition,s,i,l=!0,u;if(n){t=t==null?null:t+"";for(u in n){if((s=n[u]).name!==t){l=!1;continue}i=s.state>bf&&s.state<Mf,s.state=$l,s.timer.stop(),s.on.call(i?"interrupt":"cancel",e,e.__data__,s.index,s.group),delete n[u]}l&&delete e.__transition}}function SP(e){return this.each(function(){Bl(this,e)})}function kP(e,t){var n,s;return function(){var i=Ln(this,e),l=i.tween;if(l!==n){s=n=l;for(var u=0,c=s.length;u<c;++u)if(s[u].name===t){s=s.slice(),s.splice(u,1);break}}i.tween=s}}function _P(e,t,n){var s,i;if(typeof n!="function")throw new Error;return function(){var l=Ln(this,e),u=l.tween;if(u!==s){i=(s=u).slice();for(var c={name:t,value:n},f=0,h=i.length;f<h;++f)if(i[f].name===t){i[f]=c;break}f===h&&i.push(c)}l.tween=i}}function CP(e,t){var n=this._id;if(e+="",arguments.length<2){for(var s=_n(this.node(),n).tween,i=0,l=s.length,u;i<l;++i)if((u=s[i]).name===e)return u.value;return null}return this.each((t==null?kP:_P)(n,e,t))}function fh(e,t,n){var s=e._id;return e.each(function(){var i=Ln(this,s);(i.value||(i.value={}))[t]=n.apply(this,arguments)}),function(i){return _n(i,s).value[t]}}function Hv(e,t){var n;return(typeof t=="number"?Rn:t instanceof vo?au:(n=vo(t))?(t=n,au):Lv)(e,t)}function EP(e){return function(){this.removeAttribute(e)}}function NP(e){return function(){this.removeAttributeNS(e.space,e.local)}}function bP(e,t,n){var s,i=n+"",l;return function(){var u=this.getAttribute(e);return u===i?null:u===s?l:l=t(s=u,n)}}function MP(e,t,n){var s,i=n+"",l;return function(){var u=this.getAttributeNS(e.space,e.local);return u===i?null:u===s?l:l=t(s=u,n)}}function PP(e,t,n){var s,i,l;return function(){var u,c=n(this),f;return c==null?void this.removeAttribute(e):(u=this.getAttribute(e),f=c+"",u===f?null:u===s&&f===i?l:(i=f,l=t(s=u,c)))}}function RP(e,t,n){var s,i,l;return function(){var u,c=n(this),f;return c==null?void this.removeAttributeNS(e.space,e.local):(u=this.getAttributeNS(e.space,e.local),f=c+"",u===f?null:u===s&&f===i?l:(i=f,l=t(s=u,c)))}}function DP(e,t){var n=Cu(e),s=n==="transform"?cP:Hv;return this.attrTween(e,typeof t=="function"?(n.local?RP:PP)(n,s,fh(this,"attr."+e,t)):t==null?(n.local?NP:EP)(n):(n.local?MP:bP)(n,s,t))}function TP(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function OP(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function IP(e,t){var n,s;function i(){var l=t.apply(this,arguments);return l!==s&&(n=(s=l)&&OP(e,l)),n}return i._value=t,i}function jP(e,t){var n,s;function i(){var l=t.apply(this,arguments);return l!==s&&(n=(s=l)&&TP(e,l)),n}return i._value=t,i}function LP(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!="function")throw new Error;var s=Cu(e);return this.tween(n,(s.local?IP:jP)(s,t))}function FP(e,t){return function(){dh(this,e).delay=+t.apply(this,arguments)}}function AP(e,t){return t=+t,function(){dh(this,e).delay=t}}function zP(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?FP:AP)(t,e)):_n(this.node(),t).delay}function WP(e,t){return function(){Ln(this,e).duration=+t.apply(this,arguments)}}function $P(e,t){return t=+t,function(){Ln(this,e).duration=t}}function BP(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?WP:$P)(t,e)):_n(this.node(),t).duration}function HP(e,t){if(typeof t!="function")throw new Error;return function(){Ln(this,e).ease=t}}function VP(e){var t=this._id;return arguments.length?this.each(HP(t,e)):_n(this.node(),t).ease}function YP(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;Ln(this,e).ease=n}}function UP(e){if(typeof e!="function")throw new Error;return this.each(YP(this._id,e))}function QP(e){typeof e!="function"&&(e=wv(e));for(var t=this._groups,n=t.length,s=new Array(n),i=0;i<n;++i)for(var l=t[i],u=l.length,c=s[i]=[],f,h=0;h<u;++h)(f=l[h])&&e.call(f,f.__data__,h,l)&&c.push(f);return new tr(s,this._parents,this._name,this._id)}function qP(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,s=t.length,i=n.length,l=Math.min(s,i),u=new Array(s),c=0;c<l;++c)for(var f=t[c],h=n[c],m=f.length,p=u[c]=new Array(m),g,w=0;w<m;++w)(g=f[w]||h[w])&&(p[w]=g);for(;c<s;++c)u[c]=t[c];return new tr(u,this._parents,this._name,this._id)}function KP(e){return(e+"").trim().split(/^|\s+/).every(function(t){var n=t.indexOf(".");return n>=0&&(t=t.slice(0,n)),!t||t==="start"})}function GP(e,t,n){var s,i,l=KP(t)?dh:Ln;return function(){var u=l(this,e),c=u.on;c!==s&&(i=(s=c).copy()).on(t,n),u.on=i}}function XP(e,t){var n=this._id;return arguments.length<2?_n(this.node(),n).on.on(e):this.each(GP(n,e,t))}function ZP(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function JP(){return this.on("end.remove",ZP(this._id))}function e2(e){var t=this._name,n=this._id;typeof e!="function"&&(e=ih(e));for(var s=this._groups,i=s.length,l=new Array(i),u=0;u<i;++u)for(var c=s[u],f=c.length,h=l[u]=new Array(f),m,p,g=0;g<f;++g)(m=c[g])&&(p=e.call(m,m.__data__,g,c))&&("__data__"in m&&(p.__data__=m.__data__),h[g]=p,Nu(h[g],t,n,g,h,_n(m,n)));return new tr(l,this._parents,t,n)}function t2(e){var t=this._name,n=this._id;typeof e!="function"&&(e=xv(e));for(var s=this._groups,i=s.length,l=[],u=[],c=0;c<i;++c)for(var f=s[c],h=f.length,m,p=0;p<h;++p)if(m=f[p]){for(var g=e.call(m,m.__data__,p,f),w,S=_n(m,n),_=0,C=g.length;_<C;++_)(w=g[_])&&Nu(w,t,n,_,g,S);l.push(g),u.push(m)}return new tr(l,u,t,n)}var n2=ta.prototype.constructor;function r2(){return new n2(this._groups,this._parents)}function o2(e,t){var n,s,i;return function(){var l=ys(this,e),u=(this.style.removeProperty(e),ys(this,e));return l===u?null:l===n&&u===s?i:i=t(n=l,s=u)}}function Vv(e){return function(){this.style.removeProperty(e)}}function s2(e,t,n){var s,i=n+"",l;return function(){var u=ys(this,e);return u===i?null:u===s?l:l=t(s=u,n)}}function i2(e,t,n){var s,i,l;return function(){var u=ys(this,e),c=n(this),f=c+"";return c==null&&(f=c=(this.style.removeProperty(e),ys(this,e))),u===f?null:u===s&&f===i?l:(i=f,l=t(s=u,c))}}function a2(e,t){var n,s,i,l="style."+t,u="end."+l,c;return function(){var f=Ln(this,e),h=f.on,m=f.value[l]==null?c||(c=Vv(t)):void 0;(h!==n||i!==m)&&(s=(n=h).copy()).on(u,i=m),f.on=s}}function l2(e,t,n){var s=(e+="")=="transform"?uP:Hv;return t==null?this.styleTween(e,o2(e,s)).on("end.style."+e,Vv(e)):typeof t=="function"?this.styleTween(e,i2(e,s,fh(this,"style."+e,t))).each(a2(this._id,e)):this.styleTween(e,s2(e,s,t),n).on("end.style."+e,null)}function u2(e,t,n){return function(s){this.style.setProperty(e,t.call(this,s),n)}}function c2(e,t,n){var s,i;function l(){var u=t.apply(this,arguments);return u!==i&&(s=(i=u)&&u2(e,u,n)),s}return l._value=t,l}function d2(e,t,n){var s="style."+(e+="");if(arguments.length<2)return(s=this.tween(s))&&s._value;if(t==null)return this.tween(s,null);if(typeof t!="function")throw new Error;return this.tween(s,c2(e,t,n??""))}function f2(e){return function(){this.textContent=e}}function h2(e){return function(){var t=e(this);this.textContent=t??""}}function p2(e){return this.tween("text",typeof e=="function"?h2(fh(this,"text",e)):f2(e==null?"":e+""))}function m2(e){return function(t){this.textContent=e.call(this,t)}}function g2(e){var t,n;function s(){var i=e.apply(this,arguments);return i!==n&&(t=(n=i)&&m2(i)),t}return s._value=e,s}function y2(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!="function")throw new Error;return this.tween(t,g2(e))}function v2(){for(var e=this._name,t=this._id,n=Yv(),s=this._groups,i=s.length,l=0;l<i;++l)for(var u=s[l],c=u.length,f,h=0;h<c;++h)if(f=u[h]){var m=_n(f,t);Nu(f,e,n,h,u,{time:m.time+m.delay+m.duration,delay:0,duration:m.duration,ease:m.ease})}return new tr(s,this._parents,e,n)}function x2(){var e,t,n=this,s=n._id,i=n.size();return new Promise(function(l,u){var c={value:u},f={value:function(){--i===0&&l()}};n.each(function(){var h=Ln(this,s),m=h.on;m!==e&&(t=(e=m).copy(),t._.cancel.push(c),t._.interrupt.push(c),t._.end.push(f)),h.on=t}),i===0&&l()})}var w2=0;function tr(e,t,n,s){this._groups=e,this._parents=t,this._name=n,this._id=s}function Yv(){return++w2}var qn=ta.prototype;tr.prototype={constructor:tr,select:e2,selectAll:t2,selectChild:qn.selectChild,selectChildren:qn.selectChildren,filter:QP,merge:qP,selection:r2,transition:v2,call:qn.call,nodes:qn.nodes,node:qn.node,size:qn.size,empty:qn.empty,each:qn.each,on:XP,attr:DP,attrTween:LP,style:l2,styleTween:d2,text:p2,textTween:y2,remove:JP,tween:CP,delay:zP,duration:BP,ease:VP,easeVarying:UP,end:x2,[Symbol.iterator]:qn[Symbol.iterator]};function S2(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var k2={time:null,delay:0,duration:250,ease:S2};function _2(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return n}function C2(e){var t,n;e instanceof tr?(t=e._id,e=e._name):(t=Yv(),(n=k2).time=ch(),e=e==null?null:e+"");for(var s=this._groups,i=s.length,l=0;l<i;++l)for(var u=s[l],c=u.length,f,h=0;h<c;++h)(f=u[h])&&Nu(f,e,t,h,u,n||_2(f,t));return new tr(s,this._parents,e,t)}ta.prototype.interrupt=SP;ta.prototype.transition=C2;const Ml=e=>()=>e;function E2(e,{sourceEvent:t,target:n,transform:s,dispatch:i}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:s,enumerable:!0,configurable:!0},_:{value:i}})}function Zn(e,t,n){this.k=e,this.x=t,this.y=n}Zn.prototype={constructor:Zn,scale:function(e){return e===1?this:new Zn(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Zn(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var bu=new Zn(1,0,0);Uv.prototype=Zn.prototype;function Uv(e){for(;!e.__zoom;)if(!(e=e.parentNode))return bu;return e.__zoom}function Jd(e){e.stopImmediatePropagation()}function Si(e){e.preventDefault(),e.stopImmediatePropagation()}function N2(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function b2(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function uy(){return this.__zoom||bu}function M2(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function P2(){return navigator.maxTouchPoints||"ontouchstart"in this}function R2(e,t,n){var s=e.invertX(t[0][0])-n[0][0],i=e.invertX(t[1][0])-n[1][0],l=e.invertY(t[0][1])-n[0][1],u=e.invertY(t[1][1])-n[1][1];return e.translate(i>s?(s+i)/2:Math.min(0,s)||Math.max(0,i),u>l?(l+u)/2:Math.min(0,l)||Math.max(0,u))}function Qv(){var e=N2,t=b2,n=R2,s=M2,i=P2,l=[0,1/0],u=[[-1/0,-1/0],[1/0,1/0]],c=250,f=zl,h=_u("start","zoom","end"),m,p,g,w=500,S=150,_=0,C=10;function N(I){I.property("__zoom",uy).on("wheel.zoom",O,{passive:!1}).on("mousedown.zoom",A).on("dblclick.zoom",G).filter(i).on("touchstart.zoom",W).on("touchmove.zoom",K).on("touchend.zoom touchcancel.zoom",J).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}N.transform=function(I,Y,V,Q){var F=I.selection?I.selection():I;F.property("__zoom",uy),I!==F?T(I,Y,V,Q):F.interrupt().each(function(){M(this,arguments).event(Q).start().zoom(null,typeof Y=="function"?Y.apply(this,arguments):Y).end()})},N.scaleBy=function(I,Y,V,Q){N.scaleTo(I,function(){var F=this.__zoom.k,B=typeof Y=="function"?Y.apply(this,arguments):Y;return F*B},V,Q)},N.scaleTo=function(I,Y,V,Q){N.transform(I,function(){var F=t.apply(this,arguments),B=this.__zoom,U=V==null?b(F):typeof V=="function"?V.apply(this,arguments):V,D=B.invert(U),$=typeof Y=="function"?Y.apply(this,arguments):Y;return n(k(P(B,$),U,D),F,u)},V,Q)},N.translateBy=function(I,Y,V,Q){N.transform(I,function(){return n(this.__zoom.translate(typeof Y=="function"?Y.apply(this,arguments):Y,typeof V=="function"?V.apply(this,arguments):V),t.apply(this,arguments),u)},null,Q)},N.translateTo=function(I,Y,V,Q,F){N.transform(I,function(){var B=t.apply(this,arguments),U=this.__zoom,D=Q==null?b(B):typeof Q=="function"?Q.apply(this,arguments):Q;return n(bu.translate(D[0],D[1]).scale(U.k).translate(typeof Y=="function"?-Y.apply(this,arguments):-Y,typeof V=="function"?-V.apply(this,arguments):-V),B,u)},Q,F)};function P(I,Y){return Y=Math.max(l[0],Math.min(l[1],Y)),Y===I.k?I:new Zn(Y,I.x,I.y)}function k(I,Y,V){var Q=Y[0]-V[0]*I.k,F=Y[1]-V[1]*I.k;return Q===I.x&&F===I.y?I:new Zn(I.k,Q,F)}function b(I){return[(+I[0][0]+ +I[1][0])/2,(+I[0][1]+ +I[1][1])/2]}function T(I,Y,V,Q){I.on("start.zoom",function(){M(this,arguments).event(Q).start()}).on("interrupt.zoom end.zoom",function(){M(this,arguments).event(Q).end()}).tween("zoom",function(){var F=this,B=arguments,U=M(F,B).event(Q),D=t.apply(F,B),$=V==null?b(D):typeof V=="function"?V.apply(F,B):V,ne=Math.max(D[1][0]-D[0][0],D[1][1]-D[0][1]),te=F.__zoom,ie=typeof Y=="function"?Y.apply(F,B):Y,ce=f(te.invert($).concat(ne/te.k),ie.invert($).concat(ne/ie.k));return function(ue){if(ue===1)ue=ie;else{var ee=ce(ue),ae=ne/ee[2];ue=new Zn(ae,$[0]-ee[0]*ae,$[1]-ee[1]*ae)}U.zoom(null,ue)}})}function M(I,Y,V){return!V&&I.__zooming||new R(I,Y)}function R(I,Y){this.that=I,this.args=Y,this.active=0,this.sourceEvent=null,this.extent=t.apply(I,Y),this.taps=0}R.prototype={event:function(I){return I&&(this.sourceEvent=I),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(I,Y){return this.mouse&&I!=="mouse"&&(this.mouse[1]=Y.invert(this.mouse[0])),this.touch0&&I!=="touch"&&(this.touch0[1]=Y.invert(this.touch0[0])),this.touch1&&I!=="touch"&&(this.touch1[1]=Y.invert(this.touch1[0])),this.that.__zoom=Y,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(I){var Y=Yt(this.that).datum();h.call(I,this.that,new E2(I,{sourceEvent:this.sourceEvent,target:N,transform:this.that.__zoom,dispatch:h}),Y)}};function O(I,...Y){if(!e.apply(this,arguments))return;var V=M(this,Y).event(I),Q=this.__zoom,F=Math.max(l[0],Math.min(l[1],Q.k*Math.pow(2,s.apply(this,arguments)))),B=yn(I);if(V.wheel)(V.mouse[0][0]!==B[0]||V.mouse[0][1]!==B[1])&&(V.mouse[1]=Q.invert(V.mouse[0]=B)),clearTimeout(V.wheel);else{if(Q.k===F)return;V.mouse=[B,Q.invert(B)],Bl(this),V.start()}Si(I),V.wheel=setTimeout(U,S),V.zoom("mouse",n(k(P(Q,F),V.mouse[0],V.mouse[1]),V.extent,u));function U(){V.wheel=null,V.end()}}function A(I,...Y){if(g||!e.apply(this,arguments))return;var V=I.currentTarget,Q=M(this,Y,!0).event(I),F=Yt(I.view).on("mousemove.zoom",$,!0).on("mouseup.zoom",ne,!0),B=yn(I,V),U=I.clientX,D=I.clientY;Rv(I.view),Jd(I),Q.mouse=[B,this.__zoom.invert(B)],Bl(this),Q.start();function $(te){if(Si(te),!Q.moved){var ie=te.clientX-U,ce=te.clientY-D;Q.moved=ie*ie+ce*ce>_}Q.event(te).zoom("mouse",n(k(Q.that.__zoom,Q.mouse[0]=yn(te,V),Q.mouse[1]),Q.extent,u))}function ne(te){F.on("mousemove.zoom mouseup.zoom",null),Dv(te.view,Q.moved),Si(te),Q.event(te).end()}}function G(I,...Y){if(e.apply(this,arguments)){var V=this.__zoom,Q=yn(I.changedTouches?I.changedTouches[0]:I,this),F=V.invert(Q),B=V.k*(I.shiftKey?.5:2),U=n(k(P(V,B),Q,F),t.apply(this,Y),u);Si(I),c>0?Yt(this).transition().duration(c).call(T,U,Q,I):Yt(this).call(N.transform,U,Q,I)}}function W(I,...Y){if(e.apply(this,arguments)){var V=I.touches,Q=V.length,F=M(this,Y,I.changedTouches.length===Q).event(I),B,U,D,$;for(Jd(I),U=0;U<Q;++U)D=V[U],$=yn(D,this),$=[$,this.__zoom.invert($),D.identifier],F.touch0?!F.touch1&&F.touch0[2]!==$[2]&&(F.touch1=$,F.taps=0):(F.touch0=$,B=!0,F.taps=1+!!m);m&&(m=clearTimeout(m)),B&&(F.taps<2&&(p=$[0],m=setTimeout(function(){m=null},w)),Bl(this),F.start())}}function K(I,...Y){if(this.__zooming){var V=M(this,Y).event(I),Q=I.changedTouches,F=Q.length,B,U,D,$;for(Si(I),B=0;B<F;++B)U=Q[B],D=yn(U,this),V.touch0&&V.touch0[2]===U.identifier?V.touch0[0]=D:V.touch1&&V.touch1[2]===U.identifier&&(V.touch1[0]=D);if(U=V.that.__zoom,V.touch1){var ne=V.touch0[0],te=V.touch0[1],ie=V.touch1[0],ce=V.touch1[1],ue=(ue=ie[0]-ne[0])*ue+(ue=ie[1]-ne[1])*ue,ee=(ee=ce[0]-te[0])*ee+(ee=ce[1]-te[1])*ee;U=P(U,Math.sqrt(ue/ee)),D=[(ne[0]+ie[0])/2,(ne[1]+ie[1])/2],$=[(te[0]+ce[0])/2,(te[1]+ce[1])/2]}else if(V.touch0)D=V.touch0[0],$=V.touch0[1];else return;V.zoom("touch",n(k(U,D,$),V.extent,u))}}function J(I,...Y){if(this.__zooming){var V=M(this,Y).event(I),Q=I.changedTouches,F=Q.length,B,U;for(Jd(I),g&&clearTimeout(g),g=setTimeout(function(){g=null},w),B=0;B<F;++B)U=Q[B],V.touch0&&V.touch0[2]===U.identifier?delete V.touch0:V.touch1&&V.touch1[2]===U.identifier&&delete V.touch1;if(V.touch1&&!V.touch0&&(V.touch0=V.touch1,delete V.touch1),V.touch0)V.touch0[1]=this.__zoom.invert(V.touch0[0]);else if(V.end(),V.taps===2&&(U=yn(U,this),Math.hypot(p[0]-U[0],p[1]-U[1])<C)){var D=Yt(this).on("dblclick.zoom");D&&D.apply(this,arguments)}}}return N.wheelDelta=function(I){return arguments.length?(s=typeof I=="function"?I:Ml(+I),N):s},N.filter=function(I){return arguments.length?(e=typeof I=="function"?I:Ml(!!I),N):e},N.touchable=function(I){return arguments.length?(i=typeof I=="function"?I:Ml(!!I),N):i},N.extent=function(I){return arguments.length?(t=typeof I=="function"?I:Ml([[+I[0][0],+I[0][1]],[+I[1][0],+I[1][1]]]),N):t},N.scaleExtent=function(I){return arguments.length?(l[0]=+I[0],l[1]=+I[1],N):[l[0],l[1]]},N.translateExtent=function(I){return arguments.length?(u[0][0]=+I[0][0],u[1][0]=+I[1][0],u[0][1]=+I[0][1],u[1][1]=+I[1][1],N):[[u[0][0],u[0][1]],[u[1][0],u[1][1]]]},N.constrain=function(I){return arguments.length?(n=I,N):n},N.duration=function(I){return arguments.length?(c=+I,N):c},N.interpolate=function(I){return arguments.length?(f=I,N):f},N.on=function(){var I=h.on.apply(h,arguments);return I===h?N:I},N.clickDistance=function(I){return arguments.length?(_=(I=+I)*I,N):Math.sqrt(_)},N.tapDistance=function(I){return arguments.length?(C=+I,N):C},N}const In={error001:()=>"[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001",error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>"The React Flow parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,{id:t,sourceHandle:n,targetHandle:s})=>`Couldn't create edge for ${e} handle id: "${e==="source"?n:s}", edge id: ${t}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(e="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${e}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.",error015:()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs."},Hi=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],qv=["Enter"," ","Escape"],Kv={"node.a11yDescription.default":"Press enter or space to select a node. Press delete to remove it and escape to cancel.","node.a11yDescription.keyboardDisabled":"Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.","node.a11yDescription.ariaLiveMessage":({direction:e,x:t,y:n})=>`Moved selected node ${e}. New position, x: ${t}, y: ${n}`,"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 xs;(function(e){e.Strict="strict",e.Loose="loose"})(xs||(xs={}));var fo;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(fo||(fo={}));var Vi;(function(e){e.Partial="partial",e.Full="full"})(Vi||(Vi={}));const Gv={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var Mr;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(Mr||(Mr={}));var du;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(du||(du={}));var ge;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(ge||(ge={}));const cy={[ge.Left]:ge.Right,[ge.Right]:ge.Left,[ge.Top]:ge.Bottom,[ge.Bottom]:ge.Top};function Xv(e){return e===null?null:e?"valid":"invalid"}const Zv=e=>"id"in e&&"source"in e&&"target"in e,D2=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),hh=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),ra=(e,t=[0,0])=>{const{width:n,height:s}=nr(e),i=e.origin??t,l=n*i[0],u=s*i[1];return{x:e.position.x-l,y:e.position.y-u}},T2=(e,t={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const n=e.reduce((s,i)=>{const l=typeof i=="string";let u=!t.nodeLookup&&!l?i:void 0;t.nodeLookup&&(u=l?t.nodeLookup.get(i):hh(i)?i:t.nodeLookup.get(i.id));const c=u?fu(u,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return Mu(s,c)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return Pu(n)},oa=(e,t={})=>{let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0},s=!1;return e.forEach(i=>{(t.filter===void 0||t.filter(i))&&(n=Mu(n,fu(i)),s=!0)}),s?Pu(n):{x:0,y:0,width:0,height:0}},ph=(e,t,[n,s,i]=[0,0,1],l=!1,u=!1)=>{const c={...ia(t,[n,s,i]),width:t.width/i,height:t.height/i},f=[];for(const h of e.values()){const{measured:m,selectable:p=!0,hidden:g=!1}=h;if(u&&!p||g)continue;const w=m.width??h.width??h.initialWidth??null,S=m.height??h.height??h.initialHeight??null,_=Yi(c,Ss(h)),C=(w??0)*(S??0),N=l&&_>0;(!h.internals.handleBounds||N||_>=C||h.dragging)&&f.push(h)}return f},O2=(e,t)=>{const n=new Set;return e.forEach(s=>{n.add(s.id)}),t.filter(s=>n.has(s.source)||n.has(s.target))};function I2(e,t){const n=new Map,s=t?.nodes?new Set(t.nodes.map(i=>i.id)):null;return e.forEach(i=>{i.measured.width&&i.measured.height&&(t?.includeHiddenNodes||!i.hidden)&&(!s||s.has(i.id))&&n.set(i.id,i)}),n}async function j2({nodes:e,width:t,height:n,panZoom:s,minZoom:i,maxZoom:l},u){if(e.size===0)return Promise.resolve(!0);const c=I2(e,u),f=oa(c),h=mh(f,t,n,u?.minZoom??i,u?.maxZoom??l,u?.padding??.1);return await s.setViewport(h,{duration:u?.duration,ease:u?.ease,interpolate:u?.interpolate}),Promise.resolve(!0)}function Jv({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:s=[0,0],nodeExtent:i,onError:l}){const u=n.get(e),c=u.parentId?n.get(u.parentId):void 0,{x:f,y:h}=c?c.internals.positionAbsolute:{x:0,y:0},m=u.origin??s;let p=u.extent||i;if(u.extent==="parent"&&!u.expandParent)if(!c)l?.("005",In.error005());else{const w=c.measured.width,S=c.measured.height;w&&S&&(p=[[f,h],[f+w,h+S]])}else c&&ks(u.extent)&&(p=[[u.extent[0][0]+f,u.extent[0][1]+h],[u.extent[1][0]+f,u.extent[1][1]+h]]);const g=ks(p)?wo(t,p,u.measured):t;return(u.measured.width===void 0||u.measured.height===void 0)&&l?.("015",In.error015()),{position:{x:g.x-f+(u.measured.width??0)*m[0],y:g.y-h+(u.measured.height??0)*m[1]},positionAbsolute:g}}async function L2({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:s,onBeforeDelete:i}){const l=new Set(e.map(g=>g.id)),u=[];for(const g of n){if(g.deletable===!1)continue;const w=l.has(g.id),S=!w&&g.parentId&&u.find(_=>_.id===g.parentId);(w||S)&&u.push(g)}const c=new Set(t.map(g=>g.id)),f=s.filter(g=>g.deletable!==!1),m=O2(u,f);for(const g of f)c.has(g.id)&&!m.find(S=>S.id===g.id)&&m.push(g);if(!i)return{edges:m,nodes:u};const p=await i({nodes:u,edges:m});return typeof p=="boolean"?p?{edges:m,nodes:u}:{edges:[],nodes:[]}:p}const ws=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),wo=(e={x:0,y:0},t,n)=>({x:ws(e.x,t[0][0],t[1][0]-(n?.width??0)),y:ws(e.y,t[0][1],t[1][1]-(n?.height??0))});function ex(e,t,n){const{width:s,height:i}=nr(n),{x:l,y:u}=n.internals.positionAbsolute;return wo(e,[[l,u],[l+s,u+i]],t)}const dy=(e,t,n)=>e<t?ws(Math.abs(e-t),1,t)/t:e>n?-ws(Math.abs(e-n),1,t)/t:0,tx=(e,t,n=15,s=40)=>{const i=dy(e.x,s,t.width-s)*n,l=dy(e.y,s,t.height-s)*n;return[i,l]},Mu=(e,t)=>({x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}),Pf=({x:e,y:t,width:n,height:s})=>({x:e,y:t,x2:e+n,y2:t+s}),Pu=({x:e,y:t,x2:n,y2:s})=>({x:e,y:t,width:n-e,height:s-t}),Ss=(e,t=[0,0])=>{const{x:n,y:s}=hh(e)?e.internals.positionAbsolute:ra(e,t);return{x:n,y:s,width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}},fu=(e,t=[0,0])=>{const{x:n,y:s}=hh(e)?e.internals.positionAbsolute:ra(e,t);return{x:n,y:s,x2:n+(e.measured?.width??e.width??e.initialWidth??0),y2:s+(e.measured?.height??e.height??e.initialHeight??0)}},nx=(e,t)=>Pu(Mu(Pf(e),Pf(t))),Yi=(e,t)=>{const n=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),s=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(n*s)},fy=e=>Sn(e.width)&&Sn(e.height)&&Sn(e.x)&&Sn(e.y),Sn=e=>!isNaN(e)&&isFinite(e),F2=(e,t)=>{},sa=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),ia=({x:e,y:t},[n,s,i],l=!1,u=[1,1])=>{const c={x:(e-n)/i,y:(t-s)/i};return l?sa(c,u):c},hu=({x:e,y:t},[n,s,i])=>({x:e*i+n,y:t*i+s});function ss(e,t){if(typeof e=="number")return Math.floor((t-t/(1+e))*.5);if(typeof e=="string"&&e.endsWith("px")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(n)}if(typeof e=="string"&&e.endsWith("%")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(t*n*.01)}return console.error(`[React Flow] The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function A2(e,t,n){if(typeof e=="string"||typeof e=="number"){const s=ss(e,n),i=ss(e,t);return{top:s,right:i,bottom:s,left:i,x:i*2,y:s*2}}if(typeof e=="object"){const s=ss(e.top??e.y??0,n),i=ss(e.bottom??e.y??0,n),l=ss(e.left??e.x??0,t),u=ss(e.right??e.x??0,t);return{top:s,right:u,bottom:i,left:l,x:l+u,y:s+i}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function z2(e,t,n,s,i,l){const{x:u,y:c}=hu(e,[t,n,s]),{x:f,y:h}=hu({x:e.x+e.width,y:e.y+e.height},[t,n,s]),m=i-f,p=l-h;return{left:Math.floor(u),top:Math.floor(c),right:Math.floor(m),bottom:Math.floor(p)}}const mh=(e,t,n,s,i,l)=>{const u=A2(l,t,n),c=(t-u.x)/e.width,f=(n-u.y)/e.height,h=Math.min(c,f),m=ws(h,s,i),p=e.x+e.width/2,g=e.y+e.height/2,w=t/2-p*m,S=n/2-g*m,_=z2(e,w,S,m,t,n),C={left:Math.min(_.left-u.left,0),top:Math.min(_.top-u.top,0),right:Math.min(_.right-u.right,0),bottom:Math.min(_.bottom-u.bottom,0)};return{x:w-C.left+C.right,y:S-C.top+C.bottom,zoom:m}},Ui=()=>typeof navigator<"u"&&navigator?.userAgent?.indexOf("Mac")>=0;function ks(e){return e!=null&&e!=="parent"}function nr(e){return{width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}}function rx(e){return(e.measured?.width??e.width??e.initialWidth)!==void 0&&(e.measured?.height??e.height??e.initialHeight)!==void 0}function ox(e,t={width:0,height:0},n,s,i){const l={...e},u=s.get(n);if(u){const c=u.origin||i;l.x+=u.internals.positionAbsolute.x-(t.width??0)*c[0],l.y+=u.internals.positionAbsolute.y-(t.height??0)*c[1]}return l}function hy(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function W2(){let e,t;return{promise:new Promise((s,i)=>{e=s,t=i}),resolve:e,reject:t}}function $2(e){return{...Kv,...e||{}}}function Ti(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:s,containerBounds:i}){const{x:l,y:u}=kn(e),c=ia({x:l-(i?.left??0),y:u-(i?.top??0)},s),{x:f,y:h}=n?sa(c,t):c;return{xSnapped:f,ySnapped:h,...c}}const gh=e=>({width:e.offsetWidth,height:e.offsetHeight}),sx=e=>e?.getRootNode?.()||window?.document,B2=["INPUT","SELECT","TEXTAREA"];function ix(e){const t=e.composedPath?.()?.[0]||e.target;return t?.nodeType!==1?!1:B2.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}const ax=e=>"clientX"in e,kn=(e,t)=>{const n=ax(e),s=n?e.clientX:e.touches?.[0].clientX,i=n?e.clientY:e.touches?.[0].clientY;return{x:s-(t?.left??0),y:i-(t?.top??0)}},py=(e,t,n,s,i)=>{const l=t.querySelectorAll(`.${e}`);return!l||!l.length?null:Array.from(l).map(u=>{const c=u.getBoundingClientRect();return{id:u.getAttribute("data-handleid"),type:e,nodeId:i,position:u.getAttribute("data-handlepos"),x:(c.left-n.left)/s,y:(c.top-n.top)/s,...gh(u)}})};function lx({sourceX:e,sourceY:t,targetX:n,targetY:s,sourceControlX:i,sourceControlY:l,targetControlX:u,targetControlY:c}){const f=e*.125+i*.375+u*.375+n*.125,h=t*.125+l*.375+c*.375+s*.125,m=Math.abs(f-e),p=Math.abs(h-t);return[f,h,m,p]}function Pl(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function my({pos:e,x1:t,y1:n,x2:s,y2:i,c:l}){switch(e){case ge.Left:return[t-Pl(t-s,l),n];case ge.Right:return[t+Pl(s-t,l),n];case ge.Top:return[t,n-Pl(n-i,l)];case ge.Bottom:return[t,n+Pl(i-n,l)]}}function ux({sourceX:e,sourceY:t,sourcePosition:n=ge.Bottom,targetX:s,targetY:i,targetPosition:l=ge.Top,curvature:u=.25}){const[c,f]=my({pos:n,x1:e,y1:t,x2:s,y2:i,c:u}),[h,m]=my({pos:l,x1:s,y1:i,x2:e,y2:t,c:u}),[p,g,w,S]=lx({sourceX:e,sourceY:t,targetX:s,targetY:i,sourceControlX:c,sourceControlY:f,targetControlX:h,targetControlY:m});return[`M${e},${t} C${c},${f} ${h},${m} ${s},${i}`,p,g,w,S]}function cx({sourceX:e,sourceY:t,targetX:n,targetY:s}){const i=Math.abs(n-e)/2,l=n<e?n+i:n-i,u=Math.abs(s-t)/2,c=s<t?s+u:s-u;return[l,c,i,u]}function H2({sourceNode:e,targetNode:t,selected:n=!1,zIndex:s=0,elevateOnSelect:i=!1,zIndexMode:l="basic"}){if(l==="manual")return s;const u=i&&n?s+1e3:s,c=Math.max(e.parentId||i&&e.selected?e.internals.z:0,t.parentId||i&&t.selected?t.internals.z:0);return u+c}function V2({sourceNode:e,targetNode:t,width:n,height:s,transform:i}){const l=Mu(fu(e),fu(t));l.x===l.x2&&(l.x2+=1),l.y===l.y2&&(l.y2+=1);const u={x:-i[0]/i[2],y:-i[1]/i[2],width:n/i[2],height:s/i[2]};return Yi(u,Pu(l))>0}const Y2=({source:e,sourceHandle:t,target:n,targetHandle:s})=>`xy-edge__${e}${t||""}-${n}${s||""}`,U2=(e,t)=>t.some(n=>n.source===e.source&&n.target===e.target&&(n.sourceHandle===e.sourceHandle||!n.sourceHandle&&!e.sourceHandle)&&(n.targetHandle===e.targetHandle||!n.targetHandle&&!e.targetHandle)),Q2=(e,t,n={})=>{if(!e.source||!e.target)return t;const s=n.getEdgeId||Y2;let i;return Zv(e)?i={...e}:i={...e,id:s(e)},U2(i,t)?t:(i.sourceHandle===null&&delete i.sourceHandle,i.targetHandle===null&&delete i.targetHandle,t.concat(i))};function dx({sourceX:e,sourceY:t,targetX:n,targetY:s}){const[i,l,u,c]=cx({sourceX:e,sourceY:t,targetX:n,targetY:s});return[`M ${e},${t}L ${n},${s}`,i,l,u,c]}const gy={[ge.Left]:{x:-1,y:0},[ge.Right]:{x:1,y:0},[ge.Top]:{x:0,y:-1},[ge.Bottom]:{x:0,y:1}},q2=({source:e,sourcePosition:t=ge.Bottom,target:n})=>t===ge.Left||t===ge.Right?e.x<n.x?{x:1,y:0}:{x:-1,y:0}:e.y<n.y?{x:0,y:1}:{x:0,y:-1},yy=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function K2({source:e,sourcePosition:t=ge.Bottom,target:n,targetPosition:s=ge.Top,center:i,offset:l,stepPosition:u}){const c=gy[t],f=gy[s],h={x:e.x+c.x*l,y:e.y+c.y*l},m={x:n.x+f.x*l,y:n.y+f.y*l},p=q2({source:h,sourcePosition:t,target:m}),g=p.x!==0?"x":"y",w=p[g];let S=[],_,C;const N={x:0,y:0},P={x:0,y:0},[,,k,b]=cx({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(c[g]*f[g]===-1){g==="x"?(_=i.x??h.x+(m.x-h.x)*u,C=i.y??(h.y+m.y)/2):(_=i.x??(h.x+m.x)/2,C=i.y??h.y+(m.y-h.y)*u);const M=[{x:_,y:h.y},{x:_,y:m.y}],R=[{x:h.x,y:C},{x:m.x,y:C}];c[g]===w?S=g==="x"?M:R:S=g==="x"?R:M}else{const M=[{x:h.x,y:m.y}],R=[{x:m.x,y:h.y}];if(g==="x"?S=c.x===w?R:M:S=c.y===w?M:R,t===s){const K=Math.abs(e[g]-n[g]);if(K<=l){const J=Math.min(l-1,l-K);c[g]===w?N[g]=(h[g]>e[g]?-1:1)*J:P[g]=(m[g]>n[g]?-1:1)*J}}if(t!==s){const K=g==="x"?"y":"x",J=c[g]===f[K],I=h[K]>m[K],Y=h[K]<m[K];(c[g]===1&&(!J&&I||J&&Y)||c[g]!==1&&(!J&&Y||J&&I))&&(S=g==="x"?M:R)}const O={x:h.x+N.x,y:h.y+N.y},A={x:m.x+P.x,y:m.y+P.y},G=Math.max(Math.abs(O.x-S[0].x),Math.abs(A.x-S[0].x)),W=Math.max(Math.abs(O.y-S[0].y),Math.abs(A.y-S[0].y));G>=W?(_=(O.x+A.x)/2,C=S[0].y):(_=S[0].x,C=(O.y+A.y)/2)}return[[e,{x:h.x+N.x,y:h.y+N.y},...S,{x:m.x+P.x,y:m.y+P.y},n],_,C,k,b]}function G2(e,t,n,s){const i=Math.min(yy(e,t)/2,yy(t,n)/2,s),{x:l,y:u}=t;if(e.x===l&&l===n.x||e.y===u&&u===n.y)return`L${l} ${u}`;if(e.y===u){const h=e.x<n.x?-1:1,m=e.y<n.y?1:-1;return`L ${l+i*h},${u}Q ${l},${u} ${l},${u+i*m}`}const c=e.x<n.x?1:-1,f=e.y<n.y?-1:1;return`L ${l},${u+i*f}Q ${l},${u} ${l+i*c},${u}`}function Rf({sourceX:e,sourceY:t,sourcePosition:n=ge.Bottom,targetX:s,targetY:i,targetPosition:l=ge.Top,borderRadius:u=5,centerX:c,centerY:f,offset:h=20,stepPosition:m=.5}){const[p,g,w,S,_]=K2({source:{x:e,y:t},sourcePosition:n,target:{x:s,y:i},targetPosition:l,center:{x:c,y:f},offset:h,stepPosition:m});return[p.reduce((N,P,k)=>{let b="";return k>0&&k<p.length-1?b=G2(p[k-1],P,p[k+1],u):b=`${k===0?"M":"L"}${P.x} ${P.y}`,N+=b,N},""),g,w,S,_]}function vy(e){return e&&!!(e.internals.handleBounds||e.handles?.length)&&!!(e.measured.width||e.width||e.initialWidth)}function X2(e){const{sourceNode:t,targetNode:n}=e;if(!vy(t)||!vy(n))return null;const s=t.internals.handleBounds||xy(t.handles),i=n.internals.handleBounds||xy(n.handles),l=wy(s?.source??[],e.sourceHandle),u=wy(e.connectionMode===xs.Strict?i?.target??[]:(i?.target??[]).concat(i?.source??[]),e.targetHandle);if(!l||!u)return e.onError?.("008",In.error008(l?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;const c=l?.position||ge.Bottom,f=u?.position||ge.Top,h=So(t,l,c),m=So(n,u,f);return{sourceX:h.x,sourceY:h.y,targetX:m.x,targetY:m.y,sourcePosition:c,targetPosition:f}}function xy(e){if(!e)return null;const t=[],n=[];for(const s of e)s.width=s.width??1,s.height=s.height??1,s.type==="source"?t.push(s):s.type==="target"&&n.push(s);return{source:t,target:n}}function So(e,t,n=ge.Left,s=!1){const i=(t?.x??0)+e.internals.positionAbsolute.x,l=(t?.y??0)+e.internals.positionAbsolute.y,{width:u,height:c}=t??nr(e);if(s)return{x:i+u/2,y:l+c/2};switch(t?.position??n){case ge.Top:return{x:i+u/2,y:l};case ge.Right:return{x:i+u,y:l+c/2};case ge.Bottom:return{x:i+u/2,y:l+c};case ge.Left:return{x:i,y:l+c/2}}}function wy(e,t){return e&&(t?e.find(n=>n.id===t):e[0])||null}function Df(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(s=>`${s}=${e[s]}`).join("&")}`:""}function Z2(e,{id:t,defaultColor:n,defaultMarkerStart:s,defaultMarkerEnd:i}){const l=new Set;return e.reduce((u,c)=>([c.markerStart||s,c.markerEnd||i].forEach(f=>{if(f&&typeof f=="object"){const h=Df(f,t);l.has(h)||(u.push({id:h,color:f.color||n,...f}),l.add(h))}}),u),[]).sort((u,c)=>u.id.localeCompare(c.id))}const fx=1e3,J2=10,yh={nodeOrigin:[0,0],nodeExtent:Hi,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},eR={...yh,checkEquality:!0};function vh(e,t){const n={...e};for(const s in t)t[s]!==void 0&&(n[s]=t[s]);return n}function tR(e,t,n){const s=vh(yh,n);for(const i of e.values())if(i.parentId)wh(i,e,t,s);else{const l=ra(i,s.nodeOrigin),u=ks(i.extent)?i.extent:s.nodeExtent,c=wo(l,u,nr(i));i.internals.positionAbsolute=c}}function nR(e,t){if(!e.handles)return e.measured?t?.internals.handleBounds:void 0;const n=[],s=[];for(const i of e.handles){const l={id:i.id,width:i.width??1,height:i.height??1,nodeId:e.id,x:i.x,y:i.y,position:i.position,type:i.type};i.type==="source"?n.push(l):i.type==="target"&&s.push(l)}return{source:n,target:s}}function xh(e){return e==="manual"}function Tf(e,t,n,s={}){const i=vh(eR,s),l={i:0},u=new Map(t),c=i?.elevateNodesOnSelect&&!xh(i.zIndexMode)?fx:0;let f=e.length>0;t.clear(),n.clear();for(const h of e){let m=u.get(h.id);if(i.checkEquality&&h===m?.internals.userNode)t.set(h.id,m);else{const p=ra(h,i.nodeOrigin),g=ks(h.extent)?h.extent:i.nodeExtent,w=wo(p,g,nr(h));m={...i.defaults,...h,measured:{width:h.measured?.width,height:h.measured?.height},internals:{positionAbsolute:w,handleBounds:nR(h,m),z:hx(h,c,i.zIndexMode),userNode:h}},t.set(h.id,m)}(m.measured===void 0||m.measured.width===void 0||m.measured.height===void 0)&&!m.hidden&&(f=!1),h.parentId&&wh(m,t,n,s,l)}return f}function rR(e,t){if(!e.parentId)return;const n=t.get(e.parentId);n?n.set(e.id,e):t.set(e.parentId,new Map([[e.id,e]]))}function wh(e,t,n,s,i){const{elevateNodesOnSelect:l,nodeOrigin:u,nodeExtent:c,zIndexMode:f}=vh(yh,s),h=e.parentId,m=t.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}rR(e,n),i&&!m.parentId&&m.internals.rootParentIndex===void 0&&f==="auto"&&(m.internals.rootParentIndex=++i.i,m.internals.z=m.internals.z+i.i*J2),i&&m.internals.rootParentIndex!==void 0&&(i.i=m.internals.rootParentIndex);const p=l&&!xh(f)?fx:0,{x:g,y:w,z:S}=oR(e,m,u,c,p,f),{positionAbsolute:_}=e.internals,C=g!==_.x||w!==_.y;(C||S!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:C?{x:g,y:w}:_,z:S}})}function hx(e,t,n){const s=Sn(e.zIndex)?e.zIndex:0;return xh(n)?s:s+(e.selected?t:0)}function oR(e,t,n,s,i,l){const{x:u,y:c}=t.internals.positionAbsolute,f=nr(e),h=ra(e,n),m=ks(e.extent)?wo(h,e.extent,f):h;let p=wo({x:u+m.x,y:c+m.y},s,f);e.extent==="parent"&&(p=ex(p,f,t));const g=hx(e,i,l),w=t.internals.z??0;return{x:p.x,y:p.y,z:w>=g?w+1:g}}function Sh(e,t,n,s=[0,0]){const i=[],l=new Map;for(const u of e){const c=t.get(u.parentId);if(!c)continue;const f=l.get(u.parentId)?.expandedRect??Ss(c),h=nx(f,u.rect);l.set(u.parentId,{expandedRect:h,parent:c})}return l.size>0&&l.forEach(({expandedRect:u,parent:c},f)=>{const h=c.internals.positionAbsolute,m=nr(c),p=c.origin??s,g=u.x<h.x?Math.round(Math.abs(h.x-u.x)):0,w=u.y<h.y?Math.round(Math.abs(h.y-u.y)):0,S=Math.max(m.width,Math.round(u.width)),_=Math.max(m.height,Math.round(u.height)),C=(S-m.width)*p[0],N=(_-m.height)*p[1];(g>0||w>0||C||N)&&(i.push({id:f,type:"position",position:{x:c.position.x-g+C,y:c.position.y-w+N}}),n.get(f)?.forEach(P=>{e.some(k=>k.id===P.id)||i.push({id:P.id,type:"position",position:{x:P.position.x+g,y:P.position.y+w}})})),(m.width<u.width||m.height<u.height||g||w)&&i.push({id:f,type:"dimensions",setAttributes:!0,dimensions:{width:S+(g?p[0]*g-C:0),height:_+(w?p[1]*w-N:0)}})}),i}function sR(e,t,n,s,i,l,u){const c=s?.querySelector(".xyflow__viewport");let f=!1;if(!c)return{changes:[],updatedInternals:f};const h=[],m=window.getComputedStyle(c),{m22:p}=new window.DOMMatrixReadOnly(m.transform),g=[];for(const w of e.values()){const S=t.get(w.id);if(!S)continue;if(S.hidden){t.set(S.id,{...S,internals:{...S.internals,handleBounds:void 0}}),f=!0;continue}const _=gh(w.nodeElement),C=S.measured.width!==_.width||S.measured.height!==_.height;if(!!(_.width&&_.height&&(C||!S.internals.handleBounds||w.force))){const P=w.nodeElement.getBoundingClientRect(),k=ks(S.extent)?S.extent:l;let{positionAbsolute:b}=S.internals;S.parentId&&S.extent==="parent"?b=ex(b,_,t.get(S.parentId)):k&&(b=wo(b,k,_));const T={...S,measured:_,internals:{...S.internals,positionAbsolute:b,handleBounds:{source:py("source",w.nodeElement,P,p,S.id),target:py("target",w.nodeElement,P,p,S.id)}}};t.set(S.id,T),S.parentId&&wh(T,t,n,{nodeOrigin:i,zIndexMode:u}),f=!0,C&&(h.push({id:S.id,type:"dimensions",dimensions:_}),S.expandParent&&S.parentId&&g.push({id:S.id,parentId:S.parentId,rect:Ss(T,i)}))}}if(g.length>0){const w=Sh(g,t,n,i);h.push(...w)}return{changes:h,updatedInternals:f}}async function iR({delta:e,panZoom:t,transform:n,translateExtent:s,width:i,height:l}){if(!t||!e.x&&!e.y)return Promise.resolve(!1);const u=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[i,l]],s),c=!!u&&(u.x!==n[0]||u.y!==n[1]||u.k!==n[2]);return Promise.resolve(c)}function Sy(e,t,n,s,i,l){let u=i;const c=s.get(u)||new Map;s.set(u,c.set(n,t)),u=`${i}-${e}`;const f=s.get(u)||new Map;if(s.set(u,f.set(n,t)),l){u=`${i}-${e}-${l}`;const h=s.get(u)||new Map;s.set(u,h.set(n,t))}}function px(e,t,n){e.clear(),t.clear();for(const s of n){const{source:i,target:l,sourceHandle:u=null,targetHandle:c=null}=s,f={edgeId:s.id,source:i,target:l,sourceHandle:u,targetHandle:c},h=`${i}-${u}--${l}-${c}`,m=`${l}-${c}--${i}-${u}`;Sy("source",f,m,e,i,u),Sy("target",f,h,e,l,c),t.set(s.id,s)}}function mx(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:mx(n,t):!1}function ky(e,t,n){let s=e;do{if(s?.matches?.(t))return!0;if(s===n)return!1;s=s?.parentElement}while(s);return!1}function aR(e,t,n,s){const i=new Map;for(const[l,u]of e)if((u.selected||u.id===s)&&(!u.parentId||!mx(u,e))&&(u.draggable||t&&typeof u.draggable>"u")){const c=e.get(l);c&&i.set(l,{id:l,position:c.position||{x:0,y:0},distance:{x:n.x-c.internals.positionAbsolute.x,y:n.y-c.internals.positionAbsolute.y},extent:c.extent,parentId:c.parentId,origin:c.origin,expandParent:c.expandParent,internals:{positionAbsolute:c.internals.positionAbsolute||{x:0,y:0}},measured:{width:c.measured.width??0,height:c.measured.height??0}})}return i}function ef({nodeId:e,dragItems:t,nodeLookup:n,dragging:s=!0}){const i=[];for(const[u,c]of t){const f=n.get(u)?.internals.userNode;f&&i.push({...f,position:c.position,dragging:s})}if(!e)return[i[0],i];const l=n.get(e)?.internals.userNode;return[l?{...l,position:t.get(e)?.position||l.position,dragging:s}:i[0],i]}function lR({dragItems:e,snapGrid:t,x:n,y:s}){const i=e.values().next().value;if(!i)return null;const l={x:n-i.distance.x,y:s-i.distance.y},u=sa(l,t);return{x:u.x-l.x,y:u.y-l.y}}function uR({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:s,onDragStop:i}){let l={x:null,y:null},u=0,c=new Map,f=!1,h={x:0,y:0},m=null,p=!1,g=null,w=!1,S=!1,_=null;function C({noDragClassName:P,handleSelector:k,domNode:b,isSelectable:T,nodeId:M,nodeClickDistance:R=0}){g=Yt(b);function O({x:K,y:J}){const{nodeLookup:I,nodeExtent:Y,snapGrid:V,snapToGrid:Q,nodeOrigin:F,onNodeDrag:B,onSelectionDrag:U,onError:D,updateNodePositions:$}=t();l={x:K,y:J};let ne=!1;const te=c.size>1,ie=te&&Y?Pf(oa(c)):null,ce=te&&Q?lR({dragItems:c,snapGrid:V,x:K,y:J}):null;for(const[ue,ee]of c){if(!I.has(ue))continue;let ae={x:K-ee.distance.x,y:J-ee.distance.y};Q&&(ae=ce?{x:Math.round(ae.x+ce.x),y:Math.round(ae.y+ce.y)}:sa(ae,V));let xe=null;if(te&&Y&&!ee.extent&&ie){const{positionAbsolute:ke}=ee.internals,Te=ke.x-ie.x+Y[0][0],je=ke.x+ee.measured.width-ie.x2+Y[1][0],Fe=ke.y-ie.y+Y[0][1],Ue=ke.y+ee.measured.height-ie.y2+Y[1][1];xe=[[Te,Fe],[je,Ue]]}const{position:Ee,positionAbsolute:ye}=Jv({nodeId:ue,nextPosition:ae,nodeLookup:I,nodeExtent:xe||Y,nodeOrigin:F,onError:D});ne=ne||ee.position.x!==Ee.x||ee.position.y!==Ee.y,ee.position=Ee,ee.internals.positionAbsolute=ye}if(S=S||ne,!!ne&&($(c,!0),_&&(s||B||!M&&U))){const[ue,ee]=ef({nodeId:M,dragItems:c,nodeLookup:I});s?.(_,c,ue,ee),B?.(_,ue,ee),M||U?.(_,ee)}}async function A(){if(!m)return;const{transform:K,panBy:J,autoPanSpeed:I,autoPanOnNodeDrag:Y}=t();if(!Y){f=!1,cancelAnimationFrame(u);return}const[V,Q]=tx(h,m,I);(V!==0||Q!==0)&&(l.x=(l.x??0)-V/K[2],l.y=(l.y??0)-Q/K[2],await J({x:V,y:Q})&&O(l)),u=requestAnimationFrame(A)}function G(K){const{nodeLookup:J,multiSelectionActive:I,nodesDraggable:Y,transform:V,snapGrid:Q,snapToGrid:F,selectNodesOnDrag:B,onNodeDragStart:U,onSelectionDragStart:D,unselectNodesAndEdges:$}=t();p=!0,(!B||!T)&&!I&&M&&(J.get(M)?.selected||$()),T&&B&&M&&e?.(M);const ne=Ti(K.sourceEvent,{transform:V,snapGrid:Q,snapToGrid:F,containerBounds:m});if(l=ne,c=aR(J,Y,ne,M),c.size>0&&(n||U||!M&&D)){const[te,ie]=ef({nodeId:M,dragItems:c,nodeLookup:J});n?.(K.sourceEvent,c,te,ie),U?.(K.sourceEvent,te,ie),M||D?.(K.sourceEvent,ie)}}const W=Tv().clickDistance(R).on("start",K=>{const{domNode:J,nodeDragThreshold:I,transform:Y,snapGrid:V,snapToGrid:Q}=t();m=J?.getBoundingClientRect()||null,w=!1,S=!1,_=K.sourceEvent,I===0&&G(K),l=Ti(K.sourceEvent,{transform:Y,snapGrid:V,snapToGrid:Q,containerBounds:m}),h=kn(K.sourceEvent,m)}).on("drag",K=>{const{autoPanOnNodeDrag:J,transform:I,snapGrid:Y,snapToGrid:V,nodeDragThreshold:Q,nodeLookup:F}=t(),B=Ti(K.sourceEvent,{transform:I,snapGrid:Y,snapToGrid:V,containerBounds:m});if(_=K.sourceEvent,(K.sourceEvent.type==="touchmove"&&K.sourceEvent.touches.length>1||M&&!F.has(M))&&(w=!0),!w){if(!f&&J&&p&&(f=!0,A()),!p){const U=kn(K.sourceEvent,m),D=U.x-h.x,$=U.y-h.y;Math.sqrt(D*D+$*$)>Q&&G(K)}(l.x!==B.xSnapped||l.y!==B.ySnapped)&&c&&p&&(h=kn(K.sourceEvent,m),O(B))}}).on("end",K=>{if(!(!p||w)&&(f=!1,p=!1,cancelAnimationFrame(u),c.size>0)){const{nodeLookup:J,updateNodePositions:I,onNodeDragStop:Y,onSelectionDragStop:V}=t();if(S&&(I(c,!1),S=!1),i||Y||!M&&V){const[Q,F]=ef({nodeId:M,dragItems:c,nodeLookup:J,dragging:!1});i?.(K.sourceEvent,c,Q,F),Y?.(K.sourceEvent,Q,F),M||V?.(K.sourceEvent,F)}}}).filter(K=>{const J=K.target;return!K.button&&(!P||!ky(J,`.${P}`,b))&&(!k||ky(J,k,b))});g.call(W)}function N(){g?.on(".drag",null)}return{update:C,destroy:N}}function cR(e,t,n){const s=[],i={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(const l of t.values())Yi(i,Ss(l))>0&&s.push(l);return s}const dR=250;function fR(e,t,n,s){let i=[],l=1/0;const u=cR(e,n,t+dR);for(const c of u){const f=[...c.internals.handleBounds?.source??[],...c.internals.handleBounds?.target??[]];for(const h of f){if(s.nodeId===h.nodeId&&s.type===h.type&&s.id===h.id)continue;const{x:m,y:p}=So(c,h,h.position,!0),g=Math.sqrt(Math.pow(m-e.x,2)+Math.pow(p-e.y,2));g>t||(g<l?(i=[{...h,x:m,y:p}],l=g):g===l&&i.push({...h,x:m,y:p}))}}if(!i.length)return null;if(i.length>1){const c=s.type==="source"?"target":"source";return i.find(f=>f.type===c)??i[0]}return i[0]}function gx(e,t,n,s,i,l=!1){const u=s.get(e);if(!u)return null;const c=i==="strict"?u.internals.handleBounds?.[t]:[...u.internals.handleBounds?.source??[],...u.internals.handleBounds?.target??[]],f=(n?c?.find(h=>h.id===n):c?.[0])??null;return f&&l?{...f,...So(u,f,f.position,!0)}:f}function yx(e,t){return e||(t?.classList.contains("target")?"target":t?.classList.contains("source")?"source":null)}function hR(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const vx=()=>!0;function pR(e,{connectionMode:t,connectionRadius:n,handleId:s,nodeId:i,edgeUpdaterType:l,isTarget:u,domNode:c,nodeLookup:f,lib:h,autoPanOnConnect:m,flowId:p,panBy:g,cancelConnection:w,onConnectStart:S,onConnect:_,onConnectEnd:C,isValidConnection:N=vx,onReconnectEnd:P,updateConnection:k,getTransform:b,getFromHandle:T,autoPanSpeed:M,dragThreshold:R=1,handleDomNode:O}){const A=sx(e.target);let G=0,W;const{x:K,y:J}=kn(e),I=yx(l,O),Y=c?.getBoundingClientRect();let V=!1;if(!Y||!I)return;const Q=gx(i,I,s,f,t);if(!Q)return;let F=kn(e,Y),B=!1,U=null,D=!1,$=null;function ne(){if(!m||!Y)return;const[Ee,ye]=tx(F,Y,M);g({x:Ee,y:ye}),G=requestAnimationFrame(ne)}const te={...Q,nodeId:i,type:I,position:Q.position},ie=f.get(i);let ue={inProgress:!0,isValid:null,from:So(ie,te,ge.Left,!0),fromHandle:te,fromPosition:te.position,fromNode:ie,to:F,toHandle:null,toPosition:cy[te.position],toNode:null,pointer:F};function ee(){V=!0,k(ue),S?.(e,{nodeId:i,handleId:s,handleType:I})}R===0&&ee();function ae(Ee){if(!V){const{x:Ue,y:Ct}=kn(Ee),rt=Ue-K,ot=Ct-J;if(!(rt*rt+ot*ot>R*R))return;ee()}if(!T()||!te){xe(Ee);return}const ye=b();F=kn(Ee,Y),W=fR(ia(F,ye,!1,[1,1]),n,f,te),B||(ne(),B=!0);const ke=xx(Ee,{handle:W,connectionMode:t,fromNodeId:i,fromHandleId:s,fromType:u?"target":"source",isValidConnection:N,doc:A,lib:h,flowId:p,nodeLookup:f});$=ke.handleDomNode,U=ke.connection,D=hR(!!W,ke.isValid);const Te=f.get(i),je=Te?So(Te,te,ge.Left,!0):ue.from,Fe={...ue,from:je,isValid:D,to:ke.toHandle&&D?hu({x:ke.toHandle.x,y:ke.toHandle.y},ye):F,toHandle:ke.toHandle,toPosition:D&&ke.toHandle?ke.toHandle.position:cy[te.position],toNode:ke.toHandle?f.get(ke.toHandle.nodeId):null,pointer:F};k(Fe),ue=Fe}function xe(Ee){if(!("touches"in Ee&&Ee.touches.length>0)){if(V){(W||$)&&U&&D&&_?.(U);const{inProgress:ye,...ke}=ue,Te={...ke,toPosition:ue.toHandle?ue.toPosition:null};C?.(Ee,Te),l&&P?.(Ee,Te)}w(),cancelAnimationFrame(G),B=!1,D=!1,U=null,$=null,A.removeEventListener("mousemove",ae),A.removeEventListener("mouseup",xe),A.removeEventListener("touchmove",ae),A.removeEventListener("touchend",xe)}}A.addEventListener("mousemove",ae),A.addEventListener("mouseup",xe),A.addEventListener("touchmove",ae),A.addEventListener("touchend",xe)}function xx(e,{handle:t,connectionMode:n,fromNodeId:s,fromHandleId:i,fromType:l,doc:u,lib:c,flowId:f,isValidConnection:h=vx,nodeLookup:m}){const p=l==="target",g=t?u.querySelector(`.${c}-flow__handle[data-id="${f}-${t?.nodeId}-${t?.id}-${t?.type}"]`):null,{x:w,y:S}=kn(e),_=u.elementFromPoint(w,S),C=_?.classList.contains(`${c}-flow__handle`)?_:g,N={handleDomNode:C,isValid:!1,connection:null,toHandle:null};if(C){const P=yx(void 0,C),k=C.getAttribute("data-nodeid"),b=C.getAttribute("data-handleid"),T=C.classList.contains("connectable"),M=C.classList.contains("connectableend");if(!k||!P)return N;const R={source:p?k:s,sourceHandle:p?b:i,target:p?s:k,targetHandle:p?i:b};N.connection=R;const A=T&&M&&(n===xs.Strict?p&&P==="source"||!p&&P==="target":k!==s||b!==i);N.isValid=A&&h(R),N.toHandle=gx(k,P,b,m,n,!0)}return N}const Of={onPointerDown:pR,isValid:xx};function mR({domNode:e,panZoom:t,getTransform:n,getViewScale:s}){const i=Yt(e);function l({translateExtent:c,width:f,height:h,zoomStep:m=1,pannable:p=!0,zoomable:g=!0,inversePan:w=!1}){const S=k=>{if(k.sourceEvent.type!=="wheel"||!t)return;const b=n(),T=k.sourceEvent.ctrlKey&&Ui()?10:1,M=-k.sourceEvent.deltaY*(k.sourceEvent.deltaMode===1?.05:k.sourceEvent.deltaMode?1:.002)*m,R=b[2]*Math.pow(2,M*T);t.scaleTo(R)};let _=[0,0];const C=k=>{(k.sourceEvent.type==="mousedown"||k.sourceEvent.type==="touchstart")&&(_=[k.sourceEvent.clientX??k.sourceEvent.touches[0].clientX,k.sourceEvent.clientY??k.sourceEvent.touches[0].clientY])},N=k=>{const b=n();if(k.sourceEvent.type!=="mousemove"&&k.sourceEvent.type!=="touchmove"||!t)return;const T=[k.sourceEvent.clientX??k.sourceEvent.touches[0].clientX,k.sourceEvent.clientY??k.sourceEvent.touches[0].clientY],M=[T[0]-_[0],T[1]-_[1]];_=T;const R=s()*Math.max(b[2],Math.log(b[2]))*(w?-1:1),O={x:b[0]-M[0]*R,y:b[1]-M[1]*R},A=[[0,0],[f,h]];t.setViewportConstrained({x:O.x,y:O.y,zoom:b[2]},A,c)},P=Qv().on("start",C).on("zoom",p?N:null).on("zoom.wheel",g?S:null);i.call(P,{})}function u(){i.on("zoom",null)}return{update:l,destroy:u,pointer:yn}}const Ru=e=>({x:e.x,y:e.y,zoom:e.k}),tf=({x:e,y:t,zoom:n})=>bu.translate(e,t).scale(n),cs=(e,t)=>e.target.closest(`.${t}`),wx=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),gR=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,nf=(e,t=0,n=gR,s=()=>{})=>{const i=typeof t=="number"&&t>0;return i||s(),i?e.transition().duration(t).ease(n).on("end",s):e},Sx=e=>{const t=e.ctrlKey&&Ui()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function yR({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:s,panOnScrollMode:i,panOnScrollSpeed:l,zoomOnPinch:u,onPanZoomStart:c,onPanZoom:f,onPanZoomEnd:h}){return m=>{if(cs(m,t))return m.ctrlKey&&m.preventDefault(),!1;m.preventDefault(),m.stopImmediatePropagation();const p=n.property("__zoom").k||1;if(m.ctrlKey&&u){const C=yn(m),N=Sx(m),P=p*Math.pow(2,N);s.scaleTo(n,P,C,m);return}const g=m.deltaMode===1?20:1;let w=i===fo.Vertical?0:m.deltaX*g,S=i===fo.Horizontal?0:m.deltaY*g;!Ui()&&m.shiftKey&&i!==fo.Vertical&&(w=m.deltaY*g,S=0),s.translateBy(n,-(w/p)*l,-(S/p)*l,{internal:!0});const _=Ru(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?(f?.(m,_),e.panScrollTimeout=setTimeout(()=>{h?.(m,_),e.isPanScrolling=!1},150)):(e.isPanScrolling=!0,c?.(m,_))}}function vR({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(s,i){const l=s.type==="wheel",u=!t&&l&&!s.ctrlKey,c=cs(s,e);if(s.ctrlKey&&l&&c&&s.preventDefault(),u||c)return null;s.preventDefault(),n.call(this,s,i)}}function xR({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return s=>{if(s.sourceEvent?.internal)return;const i=Ru(s.transform);e.mouseButton=s.sourceEvent?.button||0,e.isZoomingOrPanning=!0,e.prevViewport=i,s.sourceEvent?.type==="mousedown"&&t(!0),n&&n?.(s.sourceEvent,i)}}function wR({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:s,onPanZoom:i}){return l=>{e.usedRightMouseButton=!!(n&&wx(t,e.mouseButton??0)),l.sourceEvent?.sync||s([l.transform.x,l.transform.y,l.transform.k]),i&&!l.sourceEvent?.internal&&i?.(l.sourceEvent,Ru(l.transform))}}function SR({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:s,onPanZoomEnd:i,onPaneContextMenu:l}){return u=>{if(!u.sourceEvent?.internal&&(e.isZoomingOrPanning=!1,l&&wx(t,e.mouseButton??0)&&!e.usedRightMouseButton&&u.sourceEvent&&l(u.sourceEvent),e.usedRightMouseButton=!1,s(!1),i)){const c=Ru(u.transform);e.prevViewport=c,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{i?.(u.sourceEvent,c)},n?150:0)}}}function kR({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:s,panOnScroll:i,zoomOnDoubleClick:l,userSelectionActive:u,noWheelClassName:c,noPanClassName:f,lib:h,connectionInProgress:m}){return p=>{const g=e||t,w=n&&p.ctrlKey,S=p.type==="wheel";if(p.button===1&&p.type==="mousedown"&&(cs(p,`${h}-flow__node`)||cs(p,`${h}-flow__edge`)))return!0;if(!s&&!g&&!i&&!l&&!n||u||m&&!S||cs(p,c)&&S||cs(p,f)&&(!S||i&&S&&!e)||!n&&p.ctrlKey&&S)return!1;if(!n&&p.type==="touchstart"&&p.touches?.length>1)return p.preventDefault(),!1;if(!g&&!i&&!w&&S||!s&&(p.type==="mousedown"||p.type==="touchstart")||Array.isArray(s)&&!s.includes(p.button)&&p.type==="mousedown")return!1;const _=Array.isArray(s)&&s.includes(p.button)||!p.button||p.button<=1;return(!p.ctrlKey||S)&&_}}function _R({domNode:e,minZoom:t,maxZoom:n,translateExtent:s,viewport:i,onPanZoom:l,onPanZoomStart:u,onPanZoomEnd:c,onDraggingChange:f}){const h={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},m=e.getBoundingClientRect(),p=Qv().scaleExtent([t,n]).translateExtent(s),g=Yt(e).call(p);P({x:i.x,y:i.y,zoom:ws(i.zoom,t,n)},[[0,0],[m.width,m.height]],s);const w=g.on("wheel.zoom"),S=g.on("dblclick.zoom");p.wheelDelta(Sx);function _(W,K){return g?new Promise(J=>{p?.interpolate(K?.interpolate==="linear"?Di:zl).transform(nf(g,K?.duration,K?.ease,()=>J(!0)),W)}):Promise.resolve(!1)}function C({noWheelClassName:W,noPanClassName:K,onPaneContextMenu:J,userSelectionActive:I,panOnScroll:Y,panOnDrag:V,panOnScrollMode:Q,panOnScrollSpeed:F,preventScrolling:B,zoomOnPinch:U,zoomOnScroll:D,zoomOnDoubleClick:$,zoomActivationKeyPressed:ne,lib:te,onTransformChange:ie,connectionInProgress:ce,paneClickDistance:ue,selectionOnDrag:ee}){I&&!h.isZoomingOrPanning&&N();const ae=Y&&!ne&&!I;p.clickDistance(ee?1/0:!Sn(ue)||ue<0?0:ue);const xe=ae?yR({zoomPanValues:h,noWheelClassName:W,d3Selection:g,d3Zoom:p,panOnScrollMode:Q,panOnScrollSpeed:F,zoomOnPinch:U,onPanZoomStart:u,onPanZoom:l,onPanZoomEnd:c}):vR({noWheelClassName:W,preventScrolling:B,d3ZoomHandler:w});if(g.on("wheel.zoom",xe,{passive:!1}),!I){const ye=xR({zoomPanValues:h,onDraggingChange:f,onPanZoomStart:u});p.on("start",ye);const ke=wR({zoomPanValues:h,panOnDrag:V,onPaneContextMenu:!!J,onPanZoom:l,onTransformChange:ie});p.on("zoom",ke);const Te=SR({zoomPanValues:h,panOnDrag:V,panOnScroll:Y,onPaneContextMenu:J,onPanZoomEnd:c,onDraggingChange:f});p.on("end",Te)}const Ee=kR({zoomActivationKeyPressed:ne,panOnDrag:V,zoomOnScroll:D,panOnScroll:Y,zoomOnDoubleClick:$,zoomOnPinch:U,userSelectionActive:I,noPanClassName:K,noWheelClassName:W,lib:te,connectionInProgress:ce});p.filter(Ee),$?g.on("dblclick.zoom",S):g.on("dblclick.zoom",null)}function N(){p.on("zoom",null)}async function P(W,K,J){const I=tf(W),Y=p?.constrain()(I,K,J);return Y&&await _(Y),new Promise(V=>V(Y))}async function k(W,K){const J=tf(W);return await _(J,K),new Promise(I=>I(J))}function b(W){if(g){const K=tf(W),J=g.property("__zoom");(J.k!==W.zoom||J.x!==W.x||J.y!==W.y)&&p?.transform(g,K,null,{sync:!0})}}function T(){const W=g?Uv(g.node()):{x:0,y:0,k:1};return{x:W.x,y:W.y,zoom:W.k}}function M(W,K){return g?new Promise(J=>{p?.interpolate(K?.interpolate==="linear"?Di:zl).scaleTo(nf(g,K?.duration,K?.ease,()=>J(!0)),W)}):Promise.resolve(!1)}function R(W,K){return g?new Promise(J=>{p?.interpolate(K?.interpolate==="linear"?Di:zl).scaleBy(nf(g,K?.duration,K?.ease,()=>J(!0)),W)}):Promise.resolve(!1)}function O(W){p?.scaleExtent(W)}function A(W){p?.translateExtent(W)}function G(W){const K=!Sn(W)||W<0?0:W;p?.clickDistance(K)}return{update:C,destroy:N,setViewport:k,setViewportConstrained:P,getViewport:T,scaleTo:M,scaleBy:R,setScaleExtent:O,setTranslateExtent:A,syncViewport:b,setClickDistance:G}}var _s;(function(e){e.Line="line",e.Handle="handle"})(_s||(_s={}));function CR({width:e,prevWidth:t,height:n,prevHeight:s,affectsX:i,affectsY:l}){const u=e-t,c=n-s,f=[u>0?1:u<0?-1:0,c>0?1:c<0?-1:0];return u&&i&&(f[0]=f[0]*-1),c&&l&&(f[1]=f[1]*-1),f}function _y(e){const t=e.includes("right")||e.includes("left"),n=e.includes("bottom")||e.includes("top"),s=e.includes("left"),i=e.includes("top");return{isHorizontal:t,isVertical:n,affectsX:s,affectsY:i}}function Nr(e,t){return Math.max(0,t-e)}function br(e,t){return Math.max(0,e-t)}function Rl(e,t,n){return Math.max(0,t-e,e-n)}function Cy(e,t){return e?!t:t}function ER(e,t,n,s,i,l,u,c){let{affectsX:f,affectsY:h}=t;const{isHorizontal:m,isVertical:p}=t,g=m&&p,{xSnapped:w,ySnapped:S}=n,{minWidth:_,maxWidth:C,minHeight:N,maxHeight:P}=s,{x:k,y:b,width:T,height:M,aspectRatio:R}=e;let O=Math.floor(m?w-e.pointerX:0),A=Math.floor(p?S-e.pointerY:0);const G=T+(f?-O:O),W=M+(h?-A:A),K=-l[0]*T,J=-l[1]*M;let I=Rl(G,_,C),Y=Rl(W,N,P);if(u){let F=0,B=0;f&&O<0?F=Nr(k+O+K,u[0][0]):!f&&O>0&&(F=br(k+G+K,u[1][0])),h&&A<0?B=Nr(b+A+J,u[0][1]):!h&&A>0&&(B=br(b+W+J,u[1][1])),I=Math.max(I,F),Y=Math.max(Y,B)}if(c){let F=0,B=0;f&&O>0?F=br(k+O,c[0][0]):!f&&O<0&&(F=Nr(k+G,c[1][0])),h&&A>0?B=br(b+A,c[0][1]):!h&&A<0&&(B=Nr(b+W,c[1][1])),I=Math.max(I,F),Y=Math.max(Y,B)}if(i){if(m){const F=Rl(G/R,N,P)*R;if(I=Math.max(I,F),u){let B=0;!f&&!h||f&&!h&&g?B=br(b+J+G/R,u[1][1])*R:B=Nr(b+J+(f?O:-O)/R,u[0][1])*R,I=Math.max(I,B)}if(c){let B=0;!f&&!h||f&&!h&&g?B=Nr(b+G/R,c[1][1])*R:B=br(b+(f?O:-O)/R,c[0][1])*R,I=Math.max(I,B)}}if(p){const F=Rl(W*R,_,C)/R;if(Y=Math.max(Y,F),u){let B=0;!f&&!h||h&&!f&&g?B=br(k+W*R+K,u[1][0])/R:B=Nr(k+(h?A:-A)*R+K,u[0][0])/R,Y=Math.max(Y,B)}if(c){let B=0;!f&&!h||h&&!f&&g?B=Nr(k+W*R,c[1][0])/R:B=br(k+(h?A:-A)*R,c[0][0])/R,Y=Math.max(Y,B)}}}A=A+(A<0?Y:-Y),O=O+(O<0?I:-I),i&&(g?G>W*R?A=(Cy(f,h)?-O:O)/R:O=(Cy(f,h)?-A:A)*R:m?(A=O/R,h=f):(O=A*R,f=h));const V=f?k+O:k,Q=h?b+A:b;return{width:T+(f?-O:O),height:M+(h?-A:A),x:l[0]*O*(f?-1:1)+V,y:l[1]*A*(h?-1:1)+Q}}const kx={width:0,height:0,x:0,y:0},NR={...kx,pointerX:0,pointerY:0,aspectRatio:1};function bR(e){return[[0,0],[e.measured.width,e.measured.height]]}function MR(e,t,n){const s=t.position.x+e.position.x,i=t.position.y+e.position.y,l=e.measured.width??0,u=e.measured.height??0,c=n[0]*l,f=n[1]*u;return[[s-c,i-f],[s+l-c,i+u-f]]}function PR({domNode:e,nodeId:t,getStoreItems:n,onChange:s,onEnd:i}){const l=Yt(e);let u={controlDirection:_y("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function c({controlPosition:h,boundaries:m,keepAspectRatio:p,resizeDirection:g,onResizeStart:w,onResize:S,onResizeEnd:_,shouldResize:C}){let N={...kx},P={...NR};u={boundaries:m,resizeDirection:g,keepAspectRatio:p,controlDirection:_y(h)};let k,b=null,T=[],M,R,O,A=!1;const G=Tv().on("start",W=>{const{nodeLookup:K,transform:J,snapGrid:I,snapToGrid:Y,nodeOrigin:V,paneDomNode:Q}=n();if(k=K.get(t),!k)return;b=Q?.getBoundingClientRect()??null;const{xSnapped:F,ySnapped:B}=Ti(W.sourceEvent,{transform:J,snapGrid:I,snapToGrid:Y,containerBounds:b});N={width:k.measured.width??0,height:k.measured.height??0,x:k.position.x??0,y:k.position.y??0},P={...N,pointerX:F,pointerY:B,aspectRatio:N.width/N.height},M=void 0,k.parentId&&(k.extent==="parent"||k.expandParent)&&(M=K.get(k.parentId),R=M&&k.extent==="parent"?bR(M):void 0),T=[],O=void 0;for(const[U,D]of K)if(D.parentId===t&&(T.push({id:U,position:{...D.position},extent:D.extent}),D.extent==="parent"||D.expandParent)){const $=MR(D,k,D.origin??V);O?O=[[Math.min($[0][0],O[0][0]),Math.min($[0][1],O[0][1])],[Math.max($[1][0],O[1][0]),Math.max($[1][1],O[1][1])]]:O=$}w?.(W,{...N})}).on("drag",W=>{const{transform:K,snapGrid:J,snapToGrid:I,nodeOrigin:Y}=n(),V=Ti(W.sourceEvent,{transform:K,snapGrid:J,snapToGrid:I,containerBounds:b}),Q=[];if(!k)return;const{x:F,y:B,width:U,height:D}=N,$={},ne=k.origin??Y,{width:te,height:ie,x:ce,y:ue}=ER(P,u.controlDirection,V,u.boundaries,u.keepAspectRatio,ne,R,O),ee=te!==U,ae=ie!==D,xe=ce!==F&&ee,Ee=ue!==B&&ae;if(!xe&&!Ee&&!ee&&!ae)return;if((xe||Ee||ne[0]===1||ne[1]===1)&&($.x=xe?ce:N.x,$.y=Ee?ue:N.y,N.x=$.x,N.y=$.y,T.length>0)){const je=ce-F,Fe=ue-B;for(const Ue of T)Ue.position={x:Ue.position.x-je+ne[0]*(te-U),y:Ue.position.y-Fe+ne[1]*(ie-D)},Q.push(Ue)}if((ee||ae)&&($.width=ee&&(!u.resizeDirection||u.resizeDirection==="horizontal")?te:N.width,$.height=ae&&(!u.resizeDirection||u.resizeDirection==="vertical")?ie:N.height,N.width=$.width,N.height=$.height),M&&k.expandParent){const je=ne[0]*($.width??0);$.x&&$.x<je&&(N.x=je,P.x=P.x-($.x-je));const Fe=ne[1]*($.height??0);$.y&&$.y<Fe&&(N.y=Fe,P.y=P.y-($.y-Fe))}const ye=CR({width:N.width,prevWidth:U,height:N.height,prevHeight:D,affectsX:u.controlDirection.affectsX,affectsY:u.controlDirection.affectsY}),ke={...N,direction:ye};C?.(W,ke)!==!1&&(A=!0,S?.(W,ke),s($,Q))}).on("end",W=>{A&&(_?.(W,{...N}),i?.({...N}),A=!1)});l.call(G)}function f(){l.on(".drag",null)}return{update:c,destroy:f}}const RR={},Ey=e=>{let t;const n=new Set,s=(m,p)=>{const g=typeof m=="function"?m(t):m;if(!Object.is(g,t)){const w=t;t=p??(typeof g!="object"||g===null)?g:Object.assign({},t,g),n.forEach(S=>S(t,w))}},i=()=>t,f={setState:s,getState:i,getInitialState:()=>h,subscribe:m=>(n.add(m),()=>n.delete(m)),destroy:()=>{(RR?"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."),n.clear()}},h=t=e(s,i,f);return f},DR=e=>e?Ey(e):Ey,{useDebugValue:TR}=de,{useSyncExternalStoreWithSelector:OR}=Dk,IR=e=>e;function _x(e,t=IR,n){const s=OR(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return TR(s),s}const Ny=(e,t)=>{const n=DR(e),s=(i,l=t)=>_x(n,i,l);return Object.assign(s,n),s},jR=(e,t)=>e?Ny(e,t):Ny;function qe(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[s,i]of e)if(!Object.is(i,t.get(s)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const s of e)if(!t.has(s))return!1;return!0}const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(const s of n)if(!Object.prototype.hasOwnProperty.call(t,s)||!Object.is(e[s],t[s]))return!1;return!0}const Du=L.createContext(null),LR=Du.Provider,Cx=In.error001();function Ie(e,t){const n=L.useContext(Du);if(n===null)throw new Error(Cx);return _x(n,e,t)}function Ke(){const e=L.useContext(Du);if(e===null)throw new Error(Cx);return L.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const by={display:"none"},FR={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},Ex="react-flow__node-desc",Nx="react-flow__edge-desc",AR="react-flow__aria-live",zR=e=>e.ariaLiveMessage,WR=e=>e.ariaLabelConfig;function $R({rfId:e}){const t=Ie(zR);return x.jsx("div",{id:`${AR}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:FR,children:t})}function BR({rfId:e,disableKeyboardA11y:t}){const n=Ie(WR);return x.jsxs(x.Fragment,{children:[x.jsx("div",{id:`${Ex}-${e}`,style:by,children:t?n["node.a11yDescription.default"]:n["node.a11yDescription.keyboardDisabled"]}),x.jsx("div",{id:`${Nx}-${e}`,style:by,children:n["edge.a11yDescription.default"]}),!t&&x.jsx($R,{rfId:e})]})}const Tu=L.forwardRef(({position:e="top-left",children:t,className:n,style:s,...i},l)=>{const u=`${e}`.split("-");return x.jsx("div",{className:at(["react-flow__panel",n,...u]),style:s,ref:l,...i,children:t})});Tu.displayName="Panel";function HR({proOptions:e,position:t="bottom-right"}){return e?.hideAttribution?null:x.jsx(Tu,{position:t,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://pro.reactflow.dev",children:x.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const VR=e=>{const t=[],n=[];for(const[,s]of e.nodeLookup)s.selected&&t.push(s.internals.userNode);for(const[,s]of e.edgeLookup)s.selected&&n.push(s);return{selectedNodes:t,selectedEdges:n}},Dl=e=>e.id;function YR(e,t){return qe(e.selectedNodes.map(Dl),t.selectedNodes.map(Dl))&&qe(e.selectedEdges.map(Dl),t.selectedEdges.map(Dl))}function UR({onSelectionChange:e}){const t=Ke(),{selectedNodes:n,selectedEdges:s}=Ie(VR,YR);return L.useEffect(()=>{const i={nodes:n,edges:s};e?.(i),t.getState().onSelectionChangeHandlers.forEach(l=>l(i))},[n,s,e]),null}const QR=e=>!!e.onSelectionChangeHandlers;function qR({onSelectionChange:e}){const t=Ie(QR);return e||t?x.jsx(UR,{onSelectionChange:e}):null}const bx=[0,0],KR={x:0,y:0,zoom:1},GR=["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"],My=[...GR,"rfId"],XR=e=>({setNodes:e.setNodes,setEdges:e.setEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges}),Py={translateExtent:Hi,nodeOrigin:bx,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function ZR(e){const{setNodes:t,setEdges:n,setMinZoom:s,setMaxZoom:i,setTranslateExtent:l,setNodeExtent:u,reset:c,setDefaultNodesAndEdges:f}=Ie(XR,qe),h=Ke();L.useEffect(()=>(f(e.defaultNodes,e.defaultEdges),()=>{m.current=Py,c()}),[]);const m=L.useRef(Py);return L.useEffect(()=>{for(const p of My){const g=e[p],w=m.current[p];g!==w&&(typeof e[p]>"u"||(p==="nodes"?t(g):p==="edges"?n(g):p==="minZoom"?s(g):p==="maxZoom"?i(g):p==="translateExtent"?l(g):p==="nodeExtent"?u(g):p==="ariaLabelConfig"?h.setState({ariaLabelConfig:$2(g)}):p==="fitView"?h.setState({fitViewQueued:g}):p==="fitViewOptions"?h.setState({fitViewOptions:g}):h.setState({[p]:g})))}m.current=e},My.map(p=>e[p])),null}function Ry(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function JR(e){const[t,n]=L.useState(e==="system"?null:e);return L.useEffect(()=>{if(e!=="system"){n(e);return}const s=Ry(),i=()=>n(s?.matches?"dark":"light");return i(),s?.addEventListener("change",i),()=>{s?.removeEventListener("change",i)}},[e]),t!==null?t:Ry()?.matches?"dark":"light"}const Dy=typeof document<"u"?document:null;function Qi(e=null,t={target:Dy,actInsideInputWithModifier:!0}){const[n,s]=L.useState(!1),i=L.useRef(!1),l=L.useRef(new Set([])),[u,c]=L.useMemo(()=>{if(e!==null){const h=(Array.isArray(e)?e:[e]).filter(p=>typeof p=="string").map(p=>p.replace("+",`
9
+ `).replace(`
10
+
11
+ `,`
12
+ +`).split(`
13
+ `)),m=h.reduce((p,g)=>p.concat(...g),[]);return[h,m]}return[[],[]]},[e]);return L.useEffect(()=>{const f=t?.target??Dy,h=t?.actInsideInputWithModifier??!0;if(e!==null){const m=w=>{if(i.current=w.ctrlKey||w.metaKey||w.shiftKey||w.altKey,(!i.current||i.current&&!h)&&ix(w))return!1;const _=Oy(w.code,c);if(l.current.add(w[_]),Ty(u,l.current,!1)){const C=w.composedPath?.()?.[0]||w.target,N=C?.nodeName==="BUTTON"||C?.nodeName==="A";t.preventDefault!==!1&&(i.current||!N)&&w.preventDefault(),s(!0)}},p=w=>{const S=Oy(w.code,c);Ty(u,l.current,!0)?(s(!1),l.current.clear()):l.current.delete(w[S]),w.key==="Meta"&&l.current.clear(),i.current=!1},g=()=>{l.current.clear(),s(!1)};return f?.addEventListener("keydown",m),f?.addEventListener("keyup",p),window.addEventListener("blur",g),window.addEventListener("contextmenu",g),()=>{f?.removeEventListener("keydown",m),f?.removeEventListener("keyup",p),window.removeEventListener("blur",g),window.removeEventListener("contextmenu",g)}}},[e,s]),n}function Ty(e,t,n){return e.filter(s=>n||s.length===t.size).some(s=>s.every(i=>t.has(i)))}function Oy(e,t){return t.includes(e)?"code":"key"}const eD=()=>{const e=Ke();return L.useMemo(()=>({zoomIn:t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1.2,{duration:t?.duration}):Promise.resolve(!1)},zoomOut:t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1/1.2,{duration:t?.duration}):Promise.resolve(!1)},zoomTo:(t,n)=>{const{panZoom:s}=e.getState();return s?s.scaleTo(t,{duration:n?.duration}):Promise.resolve(!1)},getZoom:()=>e.getState().transform[2],setViewport:async(t,n)=>{const{transform:[s,i,l],panZoom:u}=e.getState();return u?(await u.setViewport({x:t.x??s,y:t.y??i,zoom:t.zoom??l},n),Promise.resolve(!0)):Promise.resolve(!1)},getViewport:()=>{const[t,n,s]=e.getState().transform;return{x:t,y:n,zoom:s}},setCenter:async(t,n,s)=>e.getState().setCenter(t,n,s),fitBounds:async(t,n)=>{const{width:s,height:i,minZoom:l,maxZoom:u,panZoom:c}=e.getState(),f=mh(t,s,i,l,u,n?.padding??.1);return c?(await c.setViewport(f,{duration:n?.duration,ease:n?.ease,interpolate:n?.interpolate}),Promise.resolve(!0)):Promise.resolve(!1)},screenToFlowPosition:(t,n={})=>{const{transform:s,snapGrid:i,snapToGrid:l,domNode:u}=e.getState();if(!u)return t;const{x:c,y:f}=u.getBoundingClientRect(),h={x:t.x-c,y:t.y-f},m=n.snapGrid??i,p=n.snapToGrid??l;return ia(h,s,p,m)},flowToScreenPosition:t=>{const{transform:n,domNode:s}=e.getState();if(!s)return t;const{x:i,y:l}=s.getBoundingClientRect(),u=hu(t,n);return{x:u.x+i,y:u.y+l}}}),[])};function Mx(e,t){const n=[],s=new Map,i=[];for(const l of e)if(l.type==="add"){i.push(l);continue}else if(l.type==="remove"||l.type==="replace")s.set(l.id,[l]);else{const u=s.get(l.id);u?u.push(l):s.set(l.id,[l])}for(const l of t){const u=s.get(l.id);if(!u){n.push(l);continue}if(u[0].type==="remove")continue;if(u[0].type==="replace"){n.push({...u[0].item});continue}const c={...l};for(const f of u)tD(f,c);n.push(c)}return i.length&&i.forEach(l=>{l.index!==void 0?n.splice(l.index,0,{...l.item}):n.push({...l.item})}),n}function tD(e,t){switch(e.type){case"select":{t.selected=e.selected;break}case"position":{typeof e.position<"u"&&(t.position=e.position),typeof e.dragging<"u"&&(t.dragging=e.dragging);break}case"dimensions":{typeof e.dimensions<"u"&&(t.measured={...e.dimensions},e.setAttributes&&((e.setAttributes===!0||e.setAttributes==="width")&&(t.width=e.dimensions.width),(e.setAttributes===!0||e.setAttributes==="height")&&(t.height=e.dimensions.height))),typeof e.resizing=="boolean"&&(t.resizing=e.resizing);break}}}function Px(e,t){return Mx(e,t)}function Rx(e,t){return Mx(e,t)}function no(e,t){return{id:e,type:"select",selected:t}}function ds(e,t=new Set,n=!1){const s=[];for(const[i,l]of e){const u=t.has(i);!(l.selected===void 0&&!u)&&l.selected!==u&&(n&&(l.selected=u),s.push(no(l.id,u)))}return s}function Iy({items:e=[],lookup:t}){const n=[],s=new Map(e.map(i=>[i.id,i]));for(const[i,l]of e.entries()){const u=t.get(l.id),c=u?.internals?.userNode??u;c!==void 0&&c!==l&&n.push({id:l.id,item:l,type:"replace"}),c===void 0&&n.push({item:l,type:"add",index:i})}for(const[i]of t)s.get(i)===void 0&&n.push({id:i,type:"remove"});return n}function jy(e){return{id:e.id,type:"remove"}}const Ly=e=>D2(e),nD=e=>Zv(e);function Dx(e){return L.forwardRef(e)}const rD=typeof window<"u"?L.useLayoutEffect:L.useEffect;function Fy(e){const[t,n]=L.useState(BigInt(0)),[s]=L.useState(()=>oD(()=>n(i=>i+BigInt(1))));return rD(()=>{const i=s.get();i.length&&(e(i),s.reset())},[t]),s}function oD(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}const Tx=L.createContext(null);function sD({children:e}){const t=Ke(),n=L.useCallback(c=>{const{nodes:f=[],setNodes:h,hasDefaultNodes:m,onNodesChange:p,nodeLookup:g,fitViewQueued:w,onNodesChangeMiddlewareMap:S}=t.getState();let _=f;for(const N of c)_=typeof N=="function"?N(_):N;let C=Iy({items:_,lookup:g});for(const N of S.values())C=N(C);m&&h(_),C.length>0?p?.(C):w&&window.requestAnimationFrame(()=>{const{fitViewQueued:N,nodes:P,setNodes:k}=t.getState();N&&k(P)})},[]),s=Fy(n),i=L.useCallback(c=>{const{edges:f=[],setEdges:h,hasDefaultEdges:m,onEdgesChange:p,edgeLookup:g}=t.getState();let w=f;for(const S of c)w=typeof S=="function"?S(w):S;m?h(w):p&&p(Iy({items:w,lookup:g}))},[]),l=Fy(i),u=L.useMemo(()=>({nodeQueue:s,edgeQueue:l}),[]);return x.jsx(Tx.Provider,{value:u,children:e})}function iD(){const e=L.useContext(Tx);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const aD=e=>!!e.panZoom;function kh(){const e=eD(),t=Ke(),n=iD(),s=Ie(aD),i=L.useMemo(()=>{const l=p=>t.getState().nodeLookup.get(p),u=p=>{n.nodeQueue.push(p)},c=p=>{n.edgeQueue.push(p)},f=p=>{const{nodeLookup:g,nodeOrigin:w}=t.getState(),S=Ly(p)?p:g.get(p.id),_=S.parentId?ox(S.position,S.measured,S.parentId,g,w):S.position,C={...S,position:_,width:S.measured?.width??S.width,height:S.measured?.height??S.height};return Ss(C)},h=(p,g,w={replace:!1})=>{u(S=>S.map(_=>{if(_.id===p){const C=typeof g=="function"?g(_):g;return w.replace&&Ly(C)?C:{..._,...C}}return _}))},m=(p,g,w={replace:!1})=>{c(S=>S.map(_=>{if(_.id===p){const C=typeof g=="function"?g(_):g;return w.replace&&nD(C)?C:{..._,...C}}return _}))};return{getNodes:()=>t.getState().nodes.map(p=>({...p})),getNode:p=>l(p)?.internals.userNode,getInternalNode:l,getEdges:()=>{const{edges:p=[]}=t.getState();return p.map(g=>({...g}))},getEdge:p=>t.getState().edgeLookup.get(p),setNodes:u,setEdges:c,addNodes:p=>{const g=Array.isArray(p)?p:[p];n.nodeQueue.push(w=>[...w,...g])},addEdges:p=>{const g=Array.isArray(p)?p:[p];n.edgeQueue.push(w=>[...w,...g])},toObject:()=>{const{nodes:p=[],edges:g=[],transform:w}=t.getState(),[S,_,C]=w;return{nodes:p.map(N=>({...N})),edges:g.map(N=>({...N})),viewport:{x:S,y:_,zoom:C}}},deleteElements:async({nodes:p=[],edges:g=[]})=>{const{nodes:w,edges:S,onNodesDelete:_,onEdgesDelete:C,triggerNodeChanges:N,triggerEdgeChanges:P,onDelete:k,onBeforeDelete:b}=t.getState(),{nodes:T,edges:M}=await L2({nodesToRemove:p,edgesToRemove:g,nodes:w,edges:S,onBeforeDelete:b}),R=M.length>0,O=T.length>0;if(R){const A=M.map(jy);C?.(M),P(A)}if(O){const A=T.map(jy);_?.(T),N(A)}return(O||R)&&k?.({nodes:T,edges:M}),{deletedNodes:T,deletedEdges:M}},getIntersectingNodes:(p,g=!0,w)=>{const S=fy(p),_=S?p:f(p),C=w!==void 0;return _?(w||t.getState().nodes).filter(N=>{const P=t.getState().nodeLookup.get(N.id);if(P&&!S&&(N.id===p.id||!P.internals.positionAbsolute))return!1;const k=Ss(C?N:P),b=Yi(k,_);return g&&b>0||b>=k.width*k.height||b>=_.width*_.height}):[]},isNodeIntersecting:(p,g,w=!0)=>{const _=fy(p)?p:f(p);if(!_)return!1;const C=Yi(_,g);return w&&C>0||C>=g.width*g.height||C>=_.width*_.height},updateNode:h,updateNodeData:(p,g,w={replace:!1})=>{h(p,S=>{const _=typeof g=="function"?g(S):g;return w.replace?{...S,data:_}:{...S,data:{...S.data,..._}}},w)},updateEdge:m,updateEdgeData:(p,g,w={replace:!1})=>{m(p,S=>{const _=typeof g=="function"?g(S):g;return w.replace?{...S,data:_}:{...S,data:{...S.data,..._}}},w)},getNodesBounds:p=>{const{nodeLookup:g,nodeOrigin:w}=t.getState();return T2(p,{nodeLookup:g,nodeOrigin:w})},getHandleConnections:({type:p,id:g,nodeId:w})=>Array.from(t.getState().connectionLookup.get(`${w}-${p}${g?`-${g}`:""}`)?.values()??[]),getNodeConnections:({type:p,handleId:g,nodeId:w})=>Array.from(t.getState().connectionLookup.get(`${w}${p?g?`-${p}-${g}`:`-${p}`:""}`)?.values()??[]),fitView:async p=>{const g=t.getState().fitViewResolver??W2();return t.setState({fitViewQueued:!0,fitViewOptions:p,fitViewResolver:g}),n.nodeQueue.push(w=>[...w]),g.promise}}},[]);return L.useMemo(()=>({...i,...e,viewportInitialized:s}),[s])}const Ay=e=>e.selected,lD=typeof window<"u"?window:void 0;function uD({deleteKeyCode:e,multiSelectionKeyCode:t}){const n=Ke(),{deleteElements:s}=kh(),i=Qi(e,{actInsideInputWithModifier:!1}),l=Qi(t,{target:lD});L.useEffect(()=>{if(i){const{edges:u,nodes:c}=n.getState();s({nodes:c.filter(Ay),edges:u.filter(Ay)}),n.setState({nodesSelectionActive:!1})}},[i]),L.useEffect(()=>{n.setState({multiSelectionActive:l})},[l])}function cD(e){const t=Ke();L.useEffect(()=>{const n=()=>{if(!e.current||!(e.current.checkVisibility?.()??!0))return!1;const s=gh(e.current);(s.height===0||s.width===0)&&t.getState().onError?.("004",In.error004()),t.setState({width:s.width||500,height:s.height||500})};if(e.current){n(),window.addEventListener("resize",n);const s=new ResizeObserver(()=>n());return s.observe(e.current),()=>{window.removeEventListener("resize",n),s&&e.current&&s.unobserve(e.current)}}},[])}const Ou={position:"absolute",width:"100%",height:"100%",top:0,left:0},dD=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function fD({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:s=!1,panOnScrollSpeed:i=.5,panOnScrollMode:l=fo.Free,zoomOnDoubleClick:u=!0,panOnDrag:c=!0,defaultViewport:f,translateExtent:h,minZoom:m,maxZoom:p,zoomActivationKeyCode:g,preventScrolling:w=!0,children:S,noWheelClassName:_,noPanClassName:C,onViewportChange:N,isControlledViewport:P,paneClickDistance:k,selectionOnDrag:b}){const T=Ke(),M=L.useRef(null),{userSelectionActive:R,lib:O,connectionInProgress:A}=Ie(dD,qe),G=Qi(g),W=L.useRef();cD(M);const K=L.useCallback(J=>{N?.({x:J[0],y:J[1],zoom:J[2]}),P||T.setState({transform:J})},[N,P]);return L.useEffect(()=>{if(M.current){W.current=_R({domNode:M.current,minZoom:m,maxZoom:p,translateExtent:h,viewport:f,onDraggingChange:V=>T.setState({paneDragging:V}),onPanZoomStart:(V,Q)=>{const{onViewportChangeStart:F,onMoveStart:B}=T.getState();B?.(V,Q),F?.(Q)},onPanZoom:(V,Q)=>{const{onViewportChange:F,onMove:B}=T.getState();B?.(V,Q),F?.(Q)},onPanZoomEnd:(V,Q)=>{const{onViewportChangeEnd:F,onMoveEnd:B}=T.getState();B?.(V,Q),F?.(Q)}});const{x:J,y:I,zoom:Y}=W.current.getViewport();return T.setState({panZoom:W.current,transform:[J,I,Y],domNode:M.current.closest(".react-flow")}),()=>{W.current?.destroy()}}},[]),L.useEffect(()=>{W.current?.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:s,panOnScrollSpeed:i,panOnScrollMode:l,zoomOnDoubleClick:u,panOnDrag:c,zoomActivationKeyPressed:G,preventScrolling:w,noPanClassName:C,userSelectionActive:R,noWheelClassName:_,lib:O,onTransformChange:K,connectionInProgress:A,selectionOnDrag:b,paneClickDistance:k})},[e,t,n,s,i,l,u,c,G,w,C,R,_,O,K,A,b,k]),x.jsx("div",{className:"react-flow__renderer",ref:M,style:Ou,children:S})}const hD=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function pD(){const{userSelectionActive:e,userSelectionRect:t}=Ie(hD,qe);return e&&t?x.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:t.width,height:t.height,transform:`translate(${t.x}px, ${t.y}px)`}}):null}const rf=(e,t)=>n=>{n.target===t.current&&e?.(n)},mD=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,connectionInProgress:e.connection.inProgress,dragging:e.paneDragging});function gD({isSelecting:e,selectionKeyPressed:t,selectionMode:n=Vi.Full,panOnDrag:s,paneClickDistance:i,selectionOnDrag:l,onSelectionStart:u,onSelectionEnd:c,onPaneClick:f,onPaneContextMenu:h,onPaneScroll:m,onPaneMouseEnter:p,onPaneMouseMove:g,onPaneMouseLeave:w,children:S}){const _=Ke(),{userSelectionActive:C,elementsSelectable:N,dragging:P,connectionInProgress:k}=Ie(mD,qe),b=N&&(e||C),T=L.useRef(null),M=L.useRef(),R=L.useRef(new Set),O=L.useRef(new Set),A=L.useRef(!1),G=F=>{if(A.current||k){A.current=!1;return}f?.(F),_.getState().resetSelectedElements(),_.setState({nodesSelectionActive:!1})},W=F=>{if(Array.isArray(s)&&s?.includes(2)){F.preventDefault();return}h?.(F)},K=m?F=>m(F):void 0,J=F=>{A.current&&(F.stopPropagation(),A.current=!1)},I=F=>{const{domNode:B}=_.getState();if(M.current=B?.getBoundingClientRect(),!M.current)return;const U=F.target===T.current;if(!U&&!!F.target.closest(".nokey")||!e||!(l&&U||t)||F.button!==0||!F.isPrimary)return;F.target?.setPointerCapture?.(F.pointerId),A.current=!1;const{x:ne,y:te}=kn(F.nativeEvent,M.current);_.setState({userSelectionRect:{width:0,height:0,startX:ne,startY:te,x:ne,y:te}}),U||(F.stopPropagation(),F.preventDefault())},Y=F=>{const{userSelectionRect:B,transform:U,nodeLookup:D,edgeLookup:$,connectionLookup:ne,triggerNodeChanges:te,triggerEdgeChanges:ie,defaultEdgeOptions:ce,resetSelectedElements:ue}=_.getState();if(!M.current||!B)return;const{x:ee,y:ae}=kn(F.nativeEvent,M.current),{startX:xe,startY:Ee}=B;if(!A.current){const Fe=t?0:i;if(Math.hypot(ee-xe,ae-Ee)<=Fe)return;ue(),u?.(F)}A.current=!0;const ye={startX:xe,startY:Ee,x:ee<xe?ee:xe,y:ae<Ee?ae:Ee,width:Math.abs(ee-xe),height:Math.abs(ae-Ee)},ke=R.current,Te=O.current;R.current=new Set(ph(D,ye,U,n===Vi.Partial,!0).map(Fe=>Fe.id)),O.current=new Set;const je=ce?.selectable??!0;for(const Fe of R.current){const Ue=ne.get(Fe);if(Ue)for(const{edgeId:Ct}of Ue.values()){const rt=$.get(Ct);rt&&(rt.selectable??je)&&O.current.add(Ct)}}if(!hy(ke,R.current)){const Fe=ds(D,R.current,!0);te(Fe)}if(!hy(Te,O.current)){const Fe=ds($,O.current);ie(Fe)}_.setState({userSelectionRect:ye,userSelectionActive:!0,nodesSelectionActive:!1})},V=F=>{F.button===0&&(F.target?.releasePointerCapture?.(F.pointerId),!C&&F.target===T.current&&_.getState().userSelectionRect&&G?.(F),_.setState({userSelectionActive:!1,userSelectionRect:null}),A.current&&(c?.(F),_.setState({nodesSelectionActive:R.current.size>0})))},Q=s===!0||Array.isArray(s)&&s.includes(0);return x.jsxs("div",{className:at(["react-flow__pane",{draggable:Q,dragging:P,selection:e}]),onClick:b?void 0:rf(G,T),onContextMenu:rf(W,T),onWheel:rf(K,T),onPointerEnter:b?void 0:p,onPointerMove:b?Y:g,onPointerUp:b?V:void 0,onPointerDownCapture:b?I:void 0,onClickCapture:b?J:void 0,onPointerLeave:w,ref:T,style:Ou,children:[S,x.jsx(pD,{})]})}function If({id:e,store:t,unselect:n=!1,nodeRef:s}){const{addSelectedNodes:i,unselectNodesAndEdges:l,multiSelectionActive:u,nodeLookup:c,onError:f}=t.getState(),h=c.get(e);if(!h){f?.("012",In.error012(e));return}t.setState({nodesSelectionActive:!1}),h.selected?(n||h.selected&&u)&&(l({nodes:[h],edges:[]}),requestAnimationFrame(()=>s?.current?.blur())):i([e])}function Ox({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:s,nodeId:i,isSelectable:l,nodeClickDistance:u}){const c=Ke(),[f,h]=L.useState(!1),m=L.useRef();return L.useEffect(()=>{m.current=uR({getStoreItems:()=>c.getState(),onNodeMouseDown:p=>{If({id:p,store:c,nodeRef:e})},onDragStart:()=>{h(!0)},onDragStop:()=>{h(!1)}})},[]),L.useEffect(()=>{if(t)m.current?.destroy();else if(e.current)return m.current?.update({noDragClassName:n,handleSelector:s,domNode:e.current,isSelectable:l,nodeId:i,nodeClickDistance:u}),()=>{m.current?.destroy()}},[n,s,t,l,e,i]),f}const yD=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function Ix(){const e=Ke();return L.useCallback(n=>{const{nodeExtent:s,snapToGrid:i,snapGrid:l,nodesDraggable:u,onError:c,updateNodePositions:f,nodeLookup:h,nodeOrigin:m}=e.getState(),p=new Map,g=yD(u),w=i?l[0]:5,S=i?l[1]:5,_=n.direction.x*w*n.factor,C=n.direction.y*S*n.factor;for(const[,N]of h){if(!g(N))continue;let P={x:N.internals.positionAbsolute.x+_,y:N.internals.positionAbsolute.y+C};i&&(P=sa(P,l));const{position:k,positionAbsolute:b}=Jv({nodeId:N.id,nextPosition:P,nodeLookup:h,nodeExtent:s,nodeOrigin:m,onError:c});N.position=k,N.internals.positionAbsolute=b,p.set(N.id,N)}f(p)},[])}const _h=L.createContext(null),vD=_h.Provider;_h.Consumer;const jx=()=>L.useContext(_h),xD=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),wD=(e,t,n)=>s=>{const{connectionClickStartHandle:i,connectionMode:l,connection:u}=s,{fromHandle:c,toHandle:f,isValid:h}=u,m=f?.nodeId===e&&f?.id===t&&f?.type===n;return{connectingFrom:c?.nodeId===e&&c?.id===t&&c?.type===n,connectingTo:m,clickConnecting:i?.nodeId===e&&i?.id===t&&i?.type===n,isPossibleEndHandle:l===xs.Strict?c?.type!==n:e!==c?.nodeId||t!==c?.id,connectionInProcess:!!c,clickConnectionInProcess:!!i,valid:m&&h}};function SD({type:e="source",position:t=ge.Top,isValidConnection:n,isConnectable:s=!0,isConnectableStart:i=!0,isConnectableEnd:l=!0,id:u,onConnect:c,children:f,className:h,onMouseDown:m,onTouchStart:p,...g},w){const S=u||null,_=e==="target",C=Ke(),N=jx(),{connectOnClick:P,noPanClassName:k,rfId:b}=Ie(xD,qe),{connectingFrom:T,connectingTo:M,clickConnecting:R,isPossibleEndHandle:O,connectionInProcess:A,clickConnectionInProcess:G,valid:W}=Ie(wD(N,S,e),qe);N||C.getState().onError?.("010",In.error010());const K=Y=>{const{defaultEdgeOptions:V,onConnect:Q,hasDefaultEdges:F}=C.getState(),B={...V,...Y};if(F){const{edges:U,setEdges:D}=C.getState();D(Q2(B,U))}Q?.(B),c?.(B)},J=Y=>{if(!N)return;const V=ax(Y.nativeEvent);if(i&&(V&&Y.button===0||!V)){const Q=C.getState();Of.onPointerDown(Y.nativeEvent,{handleDomNode:Y.currentTarget,autoPanOnConnect:Q.autoPanOnConnect,connectionMode:Q.connectionMode,connectionRadius:Q.connectionRadius,domNode:Q.domNode,nodeLookup:Q.nodeLookup,lib:Q.lib,isTarget:_,handleId:S,nodeId:N,flowId:Q.rfId,panBy:Q.panBy,cancelConnection:Q.cancelConnection,onConnectStart:Q.onConnectStart,onConnectEnd:Q.onConnectEnd,updateConnection:Q.updateConnection,onConnect:K,isValidConnection:n||Q.isValidConnection,getTransform:()=>C.getState().transform,getFromHandle:()=>C.getState().connection.fromHandle,autoPanSpeed:Q.autoPanSpeed,dragThreshold:Q.connectionDragThreshold})}V?m?.(Y):p?.(Y)},I=Y=>{const{onClickConnectStart:V,onClickConnectEnd:Q,connectionClickStartHandle:F,connectionMode:B,isValidConnection:U,lib:D,rfId:$,nodeLookup:ne,connection:te}=C.getState();if(!N||!F&&!i)return;if(!F){V?.(Y.nativeEvent,{nodeId:N,handleId:S,handleType:e}),C.setState({connectionClickStartHandle:{nodeId:N,type:e,id:S}});return}const ie=sx(Y.target),ce=n||U,{connection:ue,isValid:ee}=Of.isValid(Y.nativeEvent,{handle:{nodeId:N,id:S,type:e},connectionMode:B,fromNodeId:F.nodeId,fromHandleId:F.id||null,fromType:F.type,isValidConnection:ce,flowId:$,doc:ie,lib:D,nodeLookup:ne});ee&&ue&&K(ue);const ae=structuredClone(te);delete ae.inProgress,ae.toPosition=ae.toHandle?ae.toHandle.position:null,Q?.(Y,ae),C.setState({connectionClickStartHandle:null})};return x.jsx("div",{"data-handleid":S,"data-nodeid":N,"data-handlepos":t,"data-id":`${b}-${N}-${S}-${e}`,className:at(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",k,h,{source:!_,target:_,connectable:s,connectablestart:i,connectableend:l,clickconnecting:R,connectingfrom:T,connectingto:M,valid:W,connectionindicator:s&&(!A||O)&&(A||G?l:i)}]),onMouseDown:J,onTouchStart:J,onClick:P?I:void 0,ref:w,...g,children:f})}const pu=L.memo(Dx(SD));function kD({data:e,isConnectable:t,sourcePosition:n=ge.Bottom}){return x.jsxs(x.Fragment,{children:[e?.label,x.jsx(pu,{type:"source",position:n,isConnectable:t})]})}function _D({data:e,isConnectable:t,targetPosition:n=ge.Top,sourcePosition:s=ge.Bottom}){return x.jsxs(x.Fragment,{children:[x.jsx(pu,{type:"target",position:n,isConnectable:t}),e?.label,x.jsx(pu,{type:"source",position:s,isConnectable:t})]})}function CD(){return null}function ED({data:e,isConnectable:t,targetPosition:n=ge.Top}){return x.jsxs(x.Fragment,{children:[x.jsx(pu,{type:"target",position:n,isConnectable:t}),e?.label]})}const mu={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},zy={input:kD,default:_D,output:ED,group:CD};function ND(e){return e.internals.handleBounds===void 0?{width:e.width??e.initialWidth??e.style?.width,height:e.height??e.initialHeight??e.style?.height}:{width:e.width??e.style?.width,height:e.height??e.style?.height}}const bD=e=>{const{width:t,height:n,x:s,y:i}=oa(e.nodeLookup,{filter:l=>!!l.selected});return{width:Sn(t)?t:null,height:Sn(n)?n:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${s}px,${i}px)`}};function MD({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const s=Ke(),{width:i,height:l,transformString:u,userSelectionActive:c}=Ie(bD,qe),f=Ix(),h=L.useRef(null);if(L.useEffect(()=>{n||h.current?.focus({preventScroll:!0})},[n]),Ox({nodeRef:h}),c||!i||!l)return null;const m=e?g=>{const w=s.getState().nodes.filter(S=>S.selected);e(g,w)}:void 0,p=g=>{Object.prototype.hasOwnProperty.call(mu,g.key)&&(g.preventDefault(),f({direction:mu[g.key],factor:g.shiftKey?4:1}))};return x.jsx("div",{className:at(["react-flow__nodesselection","react-flow__container",t]),style:{transform:u},children:x.jsx("div",{ref:h,className:"react-flow__nodesselection-rect",onContextMenu:m,tabIndex:n?void 0:-1,onKeyDown:n?void 0:p,style:{width:i,height:l}})})}const Wy=typeof window<"u"?window:void 0,PD=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function Lx({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:s,onPaneMouseLeave:i,onPaneContextMenu:l,onPaneScroll:u,paneClickDistance:c,deleteKeyCode:f,selectionKeyCode:h,selectionOnDrag:m,selectionMode:p,onSelectionStart:g,onSelectionEnd:w,multiSelectionKeyCode:S,panActivationKeyCode:_,zoomActivationKeyCode:C,elementsSelectable:N,zoomOnScroll:P,zoomOnPinch:k,panOnScroll:b,panOnScrollSpeed:T,panOnScrollMode:M,zoomOnDoubleClick:R,panOnDrag:O,defaultViewport:A,translateExtent:G,minZoom:W,maxZoom:K,preventScrolling:J,onSelectionContextMenu:I,noWheelClassName:Y,noPanClassName:V,disableKeyboardA11y:Q,onViewportChange:F,isControlledViewport:B}){const{nodesSelectionActive:U,userSelectionActive:D}=Ie(PD,qe),$=Qi(h,{target:Wy}),ne=Qi(_,{target:Wy}),te=ne||O,ie=ne||b,ce=m&&te!==!0,ue=$||D||ce;return uD({deleteKeyCode:f,multiSelectionKeyCode:S}),x.jsx(fD,{onPaneContextMenu:l,elementsSelectable:N,zoomOnScroll:P,zoomOnPinch:k,panOnScroll:ie,panOnScrollSpeed:T,panOnScrollMode:M,zoomOnDoubleClick:R,panOnDrag:!$&&te,defaultViewport:A,translateExtent:G,minZoom:W,maxZoom:K,zoomActivationKeyCode:C,preventScrolling:J,noWheelClassName:Y,noPanClassName:V,onViewportChange:F,isControlledViewport:B,paneClickDistance:c,selectionOnDrag:ce,children:x.jsxs(gD,{onSelectionStart:g,onSelectionEnd:w,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:s,onPaneMouseLeave:i,onPaneContextMenu:l,onPaneScroll:u,panOnDrag:te,isSelecting:!!ue,selectionMode:p,selectionKeyPressed:$,paneClickDistance:c,selectionOnDrag:ce,children:[e,U&&x.jsx(MD,{onSelectionContextMenu:I,noPanClassName:V,disableKeyboardA11y:Q})]})})}Lx.displayName="FlowRenderer";const RD=L.memo(Lx),DD=e=>t=>e?ph(t.nodeLookup,{x:0,y:0,width:t.width,height:t.height},t.transform,!0).map(n=>n.id):Array.from(t.nodeLookup.keys());function TD(e){return Ie(L.useCallback(DD(e),[e]),qe)}const OD=e=>e.updateNodeInternals;function ID(){const e=Ie(OD),[t]=L.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(n=>{const s=new Map;n.forEach(i=>{const l=i.target.getAttribute("data-id");s.set(l,{id:l,nodeElement:i.target,force:!0})}),e(s)}));return L.useEffect(()=>()=>{t?.disconnect()},[t]),t}function jD({node:e,nodeType:t,hasDimensions:n,resizeObserver:s}){const i=Ke(),l=L.useRef(null),u=L.useRef(null),c=L.useRef(e.sourcePosition),f=L.useRef(e.targetPosition),h=L.useRef(t),m=n&&!!e.internals.handleBounds;return L.useEffect(()=>{l.current&&!e.hidden&&(!m||u.current!==l.current)&&(u.current&&s?.unobserve(u.current),s?.observe(l.current),u.current=l.current)},[m,e.hidden]),L.useEffect(()=>()=>{u.current&&(s?.unobserve(u.current),u.current=null)},[]),L.useEffect(()=>{if(l.current){const p=h.current!==t,g=c.current!==e.sourcePosition,w=f.current!==e.targetPosition;(p||g||w)&&(h.current=t,c.current=e.sourcePosition,f.current=e.targetPosition,i.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:l.current,force:!0}]])))}},[e.id,t,e.sourcePosition,e.targetPosition]),l}function LD({id:e,onClick:t,onMouseEnter:n,onMouseMove:s,onMouseLeave:i,onContextMenu:l,onDoubleClick:u,nodesDraggable:c,elementsSelectable:f,nodesConnectable:h,nodesFocusable:m,resizeObserver:p,noDragClassName:g,noPanClassName:w,disableKeyboardA11y:S,rfId:_,nodeTypes:C,nodeClickDistance:N,onError:P}){const{node:k,internals:b,isParent:T}=Ie(ee=>{const ae=ee.nodeLookup.get(e),xe=ee.parentLookup.has(e);return{node:ae,internals:ae.internals,isParent:xe}},qe);let M=k.type||"default",R=C?.[M]||zy[M];R===void 0&&(P?.("003",In.error003(M)),M="default",R=C?.default||zy.default);const O=!!(k.draggable||c&&typeof k.draggable>"u"),A=!!(k.selectable||f&&typeof k.selectable>"u"),G=!!(k.connectable||h&&typeof k.connectable>"u"),W=!!(k.focusable||m&&typeof k.focusable>"u"),K=Ke(),J=rx(k),I=jD({node:k,nodeType:M,hasDimensions:J,resizeObserver:p}),Y=Ox({nodeRef:I,disabled:k.hidden||!O,noDragClassName:g,handleSelector:k.dragHandle,nodeId:e,isSelectable:A,nodeClickDistance:N}),V=Ix();if(k.hidden)return null;const Q=nr(k),F=ND(k),B=A||O||t||n||s||i,U=n?ee=>n(ee,{...b.userNode}):void 0,D=s?ee=>s(ee,{...b.userNode}):void 0,$=i?ee=>i(ee,{...b.userNode}):void 0,ne=l?ee=>l(ee,{...b.userNode}):void 0,te=u?ee=>u(ee,{...b.userNode}):void 0,ie=ee=>{const{selectNodesOnDrag:ae,nodeDragThreshold:xe}=K.getState();A&&(!ae||!O||xe>0)&&If({id:e,store:K,nodeRef:I}),t&&t(ee,{...b.userNode})},ce=ee=>{if(!(ix(ee.nativeEvent)||S)){if(qv.includes(ee.key)&&A){const ae=ee.key==="Escape";If({id:e,store:K,unselect:ae,nodeRef:I})}else if(O&&k.selected&&Object.prototype.hasOwnProperty.call(mu,ee.key)){ee.preventDefault();const{ariaLabelConfig:ae}=K.getState();K.setState({ariaLiveMessage:ae["node.a11yDescription.ariaLiveMessage"]({direction:ee.key.replace("Arrow","").toLowerCase(),x:~~b.positionAbsolute.x,y:~~b.positionAbsolute.y})}),V({direction:mu[ee.key],factor:ee.shiftKey?4:1})}}},ue=()=>{if(S||!I.current?.matches(":focus-visible"))return;const{transform:ee,width:ae,height:xe,autoPanOnNodeFocus:Ee,setCenter:ye}=K.getState();if(!Ee)return;ph(new Map([[e,k]]),{x:0,y:0,width:ae,height:xe},ee,!0).length>0||ye(k.position.x+Q.width/2,k.position.y+Q.height/2,{zoom:ee[2]})};return x.jsx("div",{className:at(["react-flow__node",`react-flow__node-${M}`,{[w]:O},k.className,{selected:k.selected,selectable:A,parent:T,draggable:O,dragging:Y}]),ref:I,style:{zIndex:b.z,transform:`translate(${b.positionAbsolute.x}px,${b.positionAbsolute.y}px)`,pointerEvents:B?"all":"none",visibility:J?"visible":"hidden",...k.style,...F},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:U,onMouseMove:D,onMouseLeave:$,onContextMenu:ne,onClick:ie,onDoubleClick:te,onKeyDown:W?ce:void 0,tabIndex:W?0:void 0,onFocus:W?ue:void 0,role:k.ariaRole??(W?"group":void 0),"aria-roledescription":"node","aria-describedby":S?void 0:`${Ex}-${_}`,"aria-label":k.ariaLabel,...k.domAttributes,children:x.jsx(vD,{value:e,children:x.jsx(R,{id:e,data:k.data,type:M,positionAbsoluteX:b.positionAbsolute.x,positionAbsoluteY:b.positionAbsolute.y,selected:k.selected??!1,selectable:A,draggable:O,deletable:k.deletable??!0,isConnectable:G,sourcePosition:k.sourcePosition,targetPosition:k.targetPosition,dragging:Y,dragHandle:k.dragHandle,zIndex:b.z,parentId:k.parentId,...Q})})})}var FD=L.memo(LD);const AD=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function Fx(e){const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:s,elementsSelectable:i,onError:l}=Ie(AD,qe),u=TD(e.onlyRenderVisibleElements),c=ID();return x.jsx("div",{className:"react-flow__nodes",style:Ou,children:u.map(f=>x.jsx(FD,{id:f,nodeTypes:e.nodeTypes,nodeExtent:e.nodeExtent,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,resizeObserver:c,nodesDraggable:t,nodesConnectable:n,nodesFocusable:s,elementsSelectable:i,nodeClickDistance:e.nodeClickDistance,onError:l},f))})}Fx.displayName="NodeRenderer";const zD=L.memo(Fx);function WD(e){return Ie(L.useCallback(n=>{if(!e)return n.edges.map(i=>i.id);const s=[];if(n.width&&n.height)for(const i of n.edges){const l=n.nodeLookup.get(i.source),u=n.nodeLookup.get(i.target);l&&u&&V2({sourceNode:l,targetNode:u,width:n.width,height:n.height,transform:n.transform})&&s.push(i.id)}return s},[e]),qe)}const $D=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e}};return x.jsx("polyline",{className:"arrow",style:n,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},BD=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e,fill:e}};return x.jsx("polyline",{className:"arrowclosed",style:n,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},$y={[du.Arrow]:$D,[du.ArrowClosed]:BD};function HD(e){const t=Ke();return L.useMemo(()=>Object.prototype.hasOwnProperty.call($y,e)?$y[e]:(t.getState().onError?.("009",In.error009(e)),null),[e])}const VD=({id:e,type:t,color:n,width:s=12.5,height:i=12.5,markerUnits:l="strokeWidth",strokeWidth:u,orient:c="auto-start-reverse"})=>{const f=HD(t);return f?x.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${s}`,markerHeight:`${i}`,viewBox:"-10 -10 20 20",markerUnits:l,orient:c,refX:"0",refY:"0",children:x.jsx(f,{color:n,strokeWidth:u})}):null},Ax=({defaultColor:e,rfId:t})=>{const n=Ie(l=>l.edges),s=Ie(l=>l.defaultEdgeOptions),i=L.useMemo(()=>Z2(n,{id:t,defaultColor:e,defaultMarkerStart:s?.markerStart,defaultMarkerEnd:s?.markerEnd}),[n,s,t,e]);return i.length?x.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:x.jsx("defs",{children:i.map(l=>x.jsx(VD,{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};Ax.displayName="MarkerDefinitions";var YD=L.memo(Ax);function zx({x:e,y:t,label:n,labelStyle:s,labelShowBg:i=!0,labelBgStyle:l,labelBgPadding:u=[2,4],labelBgBorderRadius:c=2,children:f,className:h,...m}){const[p,g]=L.useState({x:1,y:0,width:0,height:0}),w=at(["react-flow__edge-textwrapper",h]),S=L.useRef(null);return L.useEffect(()=>{if(S.current){const _=S.current.getBBox();g({x:_.x,y:_.y,width:_.width,height:_.height})}},[n]),n?x.jsxs("g",{transform:`translate(${e-p.width/2} ${t-p.height/2})`,className:w,visibility:p.width?"visible":"hidden",...m,children:[i&&x.jsx("rect",{width:p.width+2*u[0],x:-u[0],y:-u[1],height:p.height+2*u[1],className:"react-flow__edge-textbg",style:l,rx:c,ry:c}),x.jsx("text",{className:"react-flow__edge-text",y:p.height/2,dy:"0.3em",ref:S,style:s,children:n}),f]}):null}zx.displayName="EdgeText";const UD=L.memo(zx);function Iu({path:e,labelX:t,labelY:n,label:s,labelStyle:i,labelShowBg:l,labelBgStyle:u,labelBgPadding:c,labelBgBorderRadius:f,interactionWidth:h=20,...m}){return x.jsxs(x.Fragment,{children:[x.jsx("path",{...m,d:e,fill:"none",className:at(["react-flow__edge-path",m.className])}),h?x.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:h,className:"react-flow__edge-interaction"}):null,s&&Sn(t)&&Sn(n)?x.jsx(UD,{x:t,y:n,label:s,labelStyle:i,labelShowBg:l,labelBgStyle:u,labelBgPadding:c,labelBgBorderRadius:f}):null]})}function By({pos:e,x1:t,y1:n,x2:s,y2:i}){return e===ge.Left||e===ge.Right?[.5*(t+s),n]:[t,.5*(n+i)]}function Wx({sourceX:e,sourceY:t,sourcePosition:n=ge.Bottom,targetX:s,targetY:i,targetPosition:l=ge.Top}){const[u,c]=By({pos:n,x1:e,y1:t,x2:s,y2:i}),[f,h]=By({pos:l,x1:s,y1:i,x2:e,y2:t}),[m,p,g,w]=lx({sourceX:e,sourceY:t,targetX:s,targetY:i,sourceControlX:u,sourceControlY:c,targetControlX:f,targetControlY:h});return[`M${e},${t} C${u},${c} ${f},${h} ${s},${i}`,m,p,g,w]}function $x(e){return L.memo(({id:t,sourceX:n,sourceY:s,targetX:i,targetY:l,sourcePosition:u,targetPosition:c,label:f,labelStyle:h,labelShowBg:m,labelBgStyle:p,labelBgPadding:g,labelBgBorderRadius:w,style:S,markerEnd:_,markerStart:C,interactionWidth:N})=>{const[P,k,b]=Wx({sourceX:n,sourceY:s,sourcePosition:u,targetX:i,targetY:l,targetPosition:c}),T=e.isInternal?void 0:t;return x.jsx(Iu,{id:T,path:P,labelX:k,labelY:b,label:f,labelStyle:h,labelShowBg:m,labelBgStyle:p,labelBgPadding:g,labelBgBorderRadius:w,style:S,markerEnd:_,markerStart:C,interactionWidth:N})})}const QD=$x({isInternal:!1}),Bx=$x({isInternal:!0});QD.displayName="SimpleBezierEdge";Bx.displayName="SimpleBezierEdgeInternal";function Hx(e){return L.memo(({id:t,sourceX:n,sourceY:s,targetX:i,targetY:l,label:u,labelStyle:c,labelShowBg:f,labelBgStyle:h,labelBgPadding:m,labelBgBorderRadius:p,style:g,sourcePosition:w=ge.Bottom,targetPosition:S=ge.Top,markerEnd:_,markerStart:C,pathOptions:N,interactionWidth:P})=>{const[k,b,T]=Rf({sourceX:n,sourceY:s,sourcePosition:w,targetX:i,targetY:l,targetPosition:S,borderRadius:N?.borderRadius,offset:N?.offset,stepPosition:N?.stepPosition}),M=e.isInternal?void 0:t;return x.jsx(Iu,{id:M,path:k,labelX:b,labelY:T,label:u,labelStyle:c,labelShowBg:f,labelBgStyle:h,labelBgPadding:m,labelBgBorderRadius:p,style:g,markerEnd:_,markerStart:C,interactionWidth:P})})}const Vx=Hx({isInternal:!1}),Yx=Hx({isInternal:!0});Vx.displayName="SmoothStepEdge";Yx.displayName="SmoothStepEdgeInternal";function Ux(e){return L.memo(({id:t,...n})=>{const s=e.isInternal?void 0:t;return x.jsx(Vx,{...n,id:s,pathOptions:L.useMemo(()=>({borderRadius:0,offset:n.pathOptions?.offset}),[n.pathOptions?.offset])})})}const qD=Ux({isInternal:!1}),Qx=Ux({isInternal:!0});qD.displayName="StepEdge";Qx.displayName="StepEdgeInternal";function qx(e){return L.memo(({id:t,sourceX:n,sourceY:s,targetX:i,targetY:l,label:u,labelStyle:c,labelShowBg:f,labelBgStyle:h,labelBgPadding:m,labelBgBorderRadius:p,style:g,markerEnd:w,markerStart:S,interactionWidth:_})=>{const[C,N,P]=dx({sourceX:n,sourceY:s,targetX:i,targetY:l}),k=e.isInternal?void 0:t;return x.jsx(Iu,{id:k,path:C,labelX:N,labelY:P,label:u,labelStyle:c,labelShowBg:f,labelBgStyle:h,labelBgPadding:m,labelBgBorderRadius:p,style:g,markerEnd:w,markerStart:S,interactionWidth:_})})}const KD=qx({isInternal:!1}),Kx=qx({isInternal:!0});KD.displayName="StraightEdge";Kx.displayName="StraightEdgeInternal";function Gx(e){return L.memo(({id:t,sourceX:n,sourceY:s,targetX:i,targetY:l,sourcePosition:u=ge.Bottom,targetPosition:c=ge.Top,label:f,labelStyle:h,labelShowBg:m,labelBgStyle:p,labelBgPadding:g,labelBgBorderRadius:w,style:S,markerEnd:_,markerStart:C,pathOptions:N,interactionWidth:P})=>{const[k,b,T]=ux({sourceX:n,sourceY:s,sourcePosition:u,targetX:i,targetY:l,targetPosition:c,curvature:N?.curvature}),M=e.isInternal?void 0:t;return x.jsx(Iu,{id:M,path:k,labelX:b,labelY:T,label:f,labelStyle:h,labelShowBg:m,labelBgStyle:p,labelBgPadding:g,labelBgBorderRadius:w,style:S,markerEnd:_,markerStart:C,interactionWidth:P})})}const GD=Gx({isInternal:!1}),Xx=Gx({isInternal:!0});GD.displayName="BezierEdge";Xx.displayName="BezierEdgeInternal";const Hy={default:Xx,straight:Kx,step:Qx,smoothstep:Yx,simplebezier:Bx},Vy={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},XD=(e,t,n)=>n===ge.Left?e-t:n===ge.Right?e+t:e,ZD=(e,t,n)=>n===ge.Top?e-t:n===ge.Bottom?e+t:e,Yy="react-flow__edgeupdater";function Uy({position:e,centerX:t,centerY:n,radius:s=10,onMouseDown:i,onMouseEnter:l,onMouseOut:u,type:c}){return x.jsx("circle",{onMouseDown:i,onMouseEnter:l,onMouseOut:u,className:at([Yy,`${Yy}-${c}`]),cx:XD(t,s,e),cy:ZD(n,s,e),r:s,stroke:"transparent",fill:"transparent"})}function JD({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:s,sourceY:i,targetX:l,targetY:u,sourcePosition:c,targetPosition:f,onReconnect:h,onReconnectStart:m,onReconnectEnd:p,setReconnecting:g,setUpdateHover:w}){const S=Ke(),_=(b,T)=>{if(b.button!==0)return;const{autoPanOnConnect:M,domNode:R,isValidConnection:O,connectionMode:A,connectionRadius:G,lib:W,onConnectStart:K,onConnectEnd:J,cancelConnection:I,nodeLookup:Y,rfId:V,panBy:Q,updateConnection:F}=S.getState(),B=T.type==="target",U=(ne,te)=>{g(!1),p?.(ne,n,T.type,te)},D=ne=>h?.(n,ne),$=(ne,te)=>{g(!0),m?.(b,n,T.type),K?.(ne,te)};Of.onPointerDown(b.nativeEvent,{autoPanOnConnect:M,connectionMode:A,connectionRadius:G,domNode:R,handleId:T.id,nodeId:T.nodeId,nodeLookup:Y,isTarget:B,edgeUpdaterType:T.type,lib:W,flowId:V,cancelConnection:I,panBy:Q,isValidConnection:O,onConnect:D,onConnectStart:$,onConnectEnd:J,onReconnectEnd:U,updateConnection:F,getTransform:()=>S.getState().transform,getFromHandle:()=>S.getState().connection.fromHandle,dragThreshold:S.getState().connectionDragThreshold,handleDomNode:b.currentTarget})},C=b=>_(b,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),N=b=>_(b,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),P=()=>w(!0),k=()=>w(!1);return x.jsxs(x.Fragment,{children:[(e===!0||e==="source")&&x.jsx(Uy,{position:c,centerX:s,centerY:i,radius:t,onMouseDown:C,onMouseEnter:P,onMouseOut:k,type:"source"}),(e===!0||e==="target")&&x.jsx(Uy,{position:f,centerX:l,centerY:u,radius:t,onMouseDown:N,onMouseEnter:P,onMouseOut:k,type:"target"})]})}function eT({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:s,onClick:i,onDoubleClick:l,onContextMenu:u,onMouseEnter:c,onMouseMove:f,onMouseLeave:h,reconnectRadius:m,onReconnect:p,onReconnectStart:g,onReconnectEnd:w,rfId:S,edgeTypes:_,noPanClassName:C,onError:N,disableKeyboardA11y:P}){let k=Ie(ye=>ye.edgeLookup.get(e));const b=Ie(ye=>ye.defaultEdgeOptions);k=b?{...b,...k}:k;let T=k.type||"default",M=_?.[T]||Hy[T];M===void 0&&(N?.("011",In.error011(T)),T="default",M=_?.default||Hy.default);const R=!!(k.focusable||t&&typeof k.focusable>"u"),O=typeof p<"u"&&(k.reconnectable||n&&typeof k.reconnectable>"u"),A=!!(k.selectable||s&&typeof k.selectable>"u"),G=L.useRef(null),[W,K]=L.useState(!1),[J,I]=L.useState(!1),Y=Ke(),{zIndex:V,sourceX:Q,sourceY:F,targetX:B,targetY:U,sourcePosition:D,targetPosition:$}=Ie(L.useCallback(ye=>{const ke=ye.nodeLookup.get(k.source),Te=ye.nodeLookup.get(k.target);if(!ke||!Te)return{zIndex:k.zIndex,...Vy};const je=X2({id:e,sourceNode:ke,targetNode:Te,sourceHandle:k.sourceHandle||null,targetHandle:k.targetHandle||null,connectionMode:ye.connectionMode,onError:N});return{zIndex:H2({selected:k.selected,zIndex:k.zIndex,sourceNode:ke,targetNode:Te,elevateOnSelect:ye.elevateEdgesOnSelect,zIndexMode:ye.zIndexMode}),...je||Vy}},[k.source,k.target,k.sourceHandle,k.targetHandle,k.selected,k.zIndex]),qe),ne=L.useMemo(()=>k.markerStart?`url('#${Df(k.markerStart,S)}')`:void 0,[k.markerStart,S]),te=L.useMemo(()=>k.markerEnd?`url('#${Df(k.markerEnd,S)}')`:void 0,[k.markerEnd,S]);if(k.hidden||Q===null||F===null||B===null||U===null)return null;const ie=ye=>{const{addSelectedEdges:ke,unselectNodesAndEdges:Te,multiSelectionActive:je}=Y.getState();A&&(Y.setState({nodesSelectionActive:!1}),k.selected&&je?(Te({nodes:[],edges:[k]}),G.current?.blur()):ke([e])),i&&i(ye,k)},ce=l?ye=>{l(ye,{...k})}:void 0,ue=u?ye=>{u(ye,{...k})}:void 0,ee=c?ye=>{c(ye,{...k})}:void 0,ae=f?ye=>{f(ye,{...k})}:void 0,xe=h?ye=>{h(ye,{...k})}:void 0,Ee=ye=>{if(!P&&qv.includes(ye.key)&&A){const{unselectNodesAndEdges:ke,addSelectedEdges:Te}=Y.getState();ye.key==="Escape"?(G.current?.blur(),ke({edges:[k]})):Te([e])}};return x.jsx("svg",{style:{zIndex:V},children:x.jsxs("g",{className:at(["react-flow__edge",`react-flow__edge-${T}`,k.className,C,{selected:k.selected,animated:k.animated,inactive:!A&&!i,updating:W,selectable:A}]),onClick:ie,onDoubleClick:ce,onContextMenu:ue,onMouseEnter:ee,onMouseMove:ae,onMouseLeave:xe,onKeyDown:R?Ee:void 0,tabIndex:R?0:void 0,role:k.ariaRole??(R?"group":"img"),"aria-roledescription":"edge","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":k.ariaLabel===null?void 0:k.ariaLabel||`Edge from ${k.source} to ${k.target}`,"aria-describedby":R?`${Nx}-${S}`:void 0,ref:G,...k.domAttributes,children:[!J&&x.jsx(M,{id:e,source:k.source,target:k.target,type:k.type,selected:k.selected,animated:k.animated,selectable:A,deletable:k.deletable??!0,label:k.label,labelStyle:k.labelStyle,labelShowBg:k.labelShowBg,labelBgStyle:k.labelBgStyle,labelBgPadding:k.labelBgPadding,labelBgBorderRadius:k.labelBgBorderRadius,sourceX:Q,sourceY:F,targetX:B,targetY:U,sourcePosition:D,targetPosition:$,data:k.data,style:k.style,sourceHandleId:k.sourceHandle,targetHandleId:k.targetHandle,markerStart:ne,markerEnd:te,pathOptions:"pathOptions"in k?k.pathOptions:void 0,interactionWidth:k.interactionWidth}),O&&x.jsx(JD,{edge:k,isReconnectable:O,reconnectRadius:m,onReconnect:p,onReconnectStart:g,onReconnectEnd:w,sourceX:Q,sourceY:F,targetX:B,targetY:U,sourcePosition:D,targetPosition:$,setUpdateHover:K,setReconnecting:I})]})})}var tT=L.memo(eT);const nT=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function Zx({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:s,noPanClassName:i,onReconnect:l,onEdgeContextMenu:u,onEdgeMouseEnter:c,onEdgeMouseMove:f,onEdgeMouseLeave:h,onEdgeClick:m,reconnectRadius:p,onEdgeDoubleClick:g,onReconnectStart:w,onReconnectEnd:S,disableKeyboardA11y:_}){const{edgesFocusable:C,edgesReconnectable:N,elementsSelectable:P,onError:k}=Ie(nT,qe),b=WD(t);return x.jsxs("div",{className:"react-flow__edges",children:[x.jsx(YD,{defaultColor:e,rfId:n}),b.map(T=>x.jsx(tT,{id:T,edgesFocusable:C,edgesReconnectable:N,elementsSelectable:P,noPanClassName:i,onReconnect:l,onContextMenu:u,onMouseEnter:c,onMouseMove:f,onMouseLeave:h,onClick:m,reconnectRadius:p,onDoubleClick:g,onReconnectStart:w,onReconnectEnd:S,rfId:n,onError:k,edgeTypes:s,disableKeyboardA11y:_},T))]})}Zx.displayName="EdgeRenderer";const rT=L.memo(Zx),oT=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function sT({children:e}){const t=Ie(oT);return x.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:t},children:e})}function iT(e){const t=kh(),n=L.useRef(!1);L.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const aT=e=>e.panZoom?.syncViewport;function lT(e){const t=Ie(aT),n=Ke();return L.useEffect(()=>{e&&(t?.(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function uT(e){return e.connection.inProgress?{...e.connection,to:ia(e.connection.to,e.transform)}:{...e.connection}}function cT(e){return uT}function dT(e){const t=cT();return Ie(t,qe)}const fT=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function hT({containerStyle:e,style:t,type:n,component:s}){const{nodesConnectable:i,width:l,height:u,isValid:c,inProgress:f}=Ie(fT,qe);return!(l&&i&&f)?null:x.jsx("svg",{style:e,width:l,height:u,className:"react-flow__connectionline react-flow__container",children:x.jsx("g",{className:at(["react-flow__connection",Xv(c)]),children:x.jsx(Jx,{style:t,type:n,CustomComponent:s,isValid:c})})})}const Jx=({style:e,type:t=Mr.Bezier,CustomComponent:n,isValid:s})=>{const{inProgress:i,from:l,fromNode:u,fromHandle:c,fromPosition:f,to:h,toNode:m,toHandle:p,toPosition:g,pointer:w}=dT();if(!i)return;if(n)return x.jsx(n,{connectionLineType:t,connectionLineStyle:e,fromNode:u,fromHandle:c,fromX:l.x,fromY:l.y,toX:h.x,toY:h.y,fromPosition:f,toPosition:g,connectionStatus:Xv(s),toNode:m,toHandle:p,pointer:w});let S="";const _={sourceX:l.x,sourceY:l.y,sourcePosition:f,targetX:h.x,targetY:h.y,targetPosition:g};switch(t){case Mr.Bezier:[S]=ux(_);break;case Mr.SimpleBezier:[S]=Wx(_);break;case Mr.Step:[S]=Rf({..._,borderRadius:0});break;case Mr.SmoothStep:[S]=Rf(_);break;default:[S]=dx(_)}return x.jsx("path",{d:S,fill:"none",className:"react-flow__connection-path",style:e})};Jx.displayName="ConnectionLine";const pT={};function Qy(e=pT){L.useRef(e),Ke(),L.useEffect(()=>{},[e])}function mT(){Ke(),L.useRef(!1),L.useEffect(()=>{},[])}function ew({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:s,onEdgeClick:i,onNodeDoubleClick:l,onEdgeDoubleClick:u,onNodeMouseEnter:c,onNodeMouseMove:f,onNodeMouseLeave:h,onNodeContextMenu:m,onSelectionContextMenu:p,onSelectionStart:g,onSelectionEnd:w,connectionLineType:S,connectionLineStyle:_,connectionLineComponent:C,connectionLineContainerStyle:N,selectionKeyCode:P,selectionOnDrag:k,selectionMode:b,multiSelectionKeyCode:T,panActivationKeyCode:M,zoomActivationKeyCode:R,deleteKeyCode:O,onlyRenderVisibleElements:A,elementsSelectable:G,defaultViewport:W,translateExtent:K,minZoom:J,maxZoom:I,preventScrolling:Y,defaultMarkerColor:V,zoomOnScroll:Q,zoomOnPinch:F,panOnScroll:B,panOnScrollSpeed:U,panOnScrollMode:D,zoomOnDoubleClick:$,panOnDrag:ne,onPaneClick:te,onPaneMouseEnter:ie,onPaneMouseMove:ce,onPaneMouseLeave:ue,onPaneScroll:ee,onPaneContextMenu:ae,paneClickDistance:xe,nodeClickDistance:Ee,onEdgeContextMenu:ye,onEdgeMouseEnter:ke,onEdgeMouseMove:Te,onEdgeMouseLeave:je,reconnectRadius:Fe,onReconnect:Ue,onReconnectStart:Ct,onReconnectEnd:rt,noDragClassName:ot,noWheelClassName:mt,noPanClassName:bt,disableKeyboardA11y:Re,nodeExtent:Be,rfId:Ge,viewport:Mt,onViewportChange:ln}){return Qy(e),Qy(t),mT(),iT(n),lT(Mt),x.jsx(RD,{onPaneClick:te,onPaneMouseEnter:ie,onPaneMouseMove:ce,onPaneMouseLeave:ue,onPaneContextMenu:ae,onPaneScroll:ee,paneClickDistance:xe,deleteKeyCode:O,selectionKeyCode:P,selectionOnDrag:k,selectionMode:b,onSelectionStart:g,onSelectionEnd:w,multiSelectionKeyCode:T,panActivationKeyCode:M,zoomActivationKeyCode:R,elementsSelectable:G,zoomOnScroll:Q,zoomOnPinch:F,zoomOnDoubleClick:$,panOnScroll:B,panOnScrollSpeed:U,panOnScrollMode:D,panOnDrag:ne,defaultViewport:W,translateExtent:K,minZoom:J,maxZoom:I,onSelectionContextMenu:p,preventScrolling:Y,noDragClassName:ot,noWheelClassName:mt,noPanClassName:bt,disableKeyboardA11y:Re,onViewportChange:ln,isControlledViewport:!!Mt,children:x.jsxs(sT,{children:[x.jsx(rT,{edgeTypes:t,onEdgeClick:i,onEdgeDoubleClick:u,onReconnect:Ue,onReconnectStart:Ct,onReconnectEnd:rt,onlyRenderVisibleElements:A,onEdgeContextMenu:ye,onEdgeMouseEnter:ke,onEdgeMouseMove:Te,onEdgeMouseLeave:je,reconnectRadius:Fe,defaultMarkerColor:V,noPanClassName:bt,disableKeyboardA11y:Re,rfId:Ge}),x.jsx(hT,{style:_,type:S,component:C,containerStyle:N}),x.jsx("div",{className:"react-flow__edgelabel-renderer"}),x.jsx(zD,{nodeTypes:e,onNodeClick:s,onNodeDoubleClick:l,onNodeMouseEnter:c,onNodeMouseMove:f,onNodeMouseLeave:h,onNodeContextMenu:m,nodeClickDistance:Ee,onlyRenderVisibleElements:A,noPanClassName:bt,noDragClassName:ot,disableKeyboardA11y:Re,nodeExtent:Be,rfId:Ge}),x.jsx("div",{className:"react-flow__viewport-portal"})]})})}ew.displayName="GraphView";const gT=L.memo(ew),qy=({nodes:e,edges:t,defaultNodes:n,defaultEdges:s,width:i,height:l,fitView:u,fitViewOptions:c,minZoom:f=.5,maxZoom:h=2,nodeOrigin:m,nodeExtent:p,zIndexMode:g="basic"}={})=>{const w=new Map,S=new Map,_=new Map,C=new Map,N=s??t??[],P=n??e??[],k=m??[0,0],b=p??Hi;px(_,C,N);const T=Tf(P,w,S,{nodeOrigin:k,nodeExtent:b,zIndexMode:g});let M=[0,0,1];if(u&&i&&l){const R=oa(w,{filter:W=>!!((W.width||W.initialWidth)&&(W.height||W.initialHeight))}),{x:O,y:A,zoom:G}=mh(R,i,l,f,h,c?.padding??.1);M=[O,A,G]}return{rfId:"1",width:i??0,height:l??0,transform:M,nodes:P,nodesInitialized:T,nodeLookup:w,parentLookup:S,edges:N,edgeLookup:C,connectionLookup:_,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:s!==void 0,panZoom:null,minZoom:f,maxZoom:h,translateExtent:Hi,nodeExtent:b,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:xs.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:k,nodeDragThreshold:1,connectionDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!0,selectNodesOnDrag:!0,multiSelectionActive:!1,fitViewQueued:u??!1,fitViewOptions:c,fitViewResolver:null,connection:{...Gv},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:F2,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:Kv,zIndexMode:g,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},yT=({nodes:e,edges:t,defaultNodes:n,defaultEdges:s,width:i,height:l,fitView:u,fitViewOptions:c,minZoom:f,maxZoom:h,nodeOrigin:m,nodeExtent:p,zIndexMode:g})=>jR((w,S)=>{async function _(){const{nodeLookup:C,panZoom:N,fitViewOptions:P,fitViewResolver:k,width:b,height:T,minZoom:M,maxZoom:R}=S();N&&(await j2({nodes:C,width:b,height:T,panZoom:N,minZoom:M,maxZoom:R},P),k?.resolve(!0),w({fitViewResolver:null}))}return{...qy({nodes:e,edges:t,width:i,height:l,fitView:u,fitViewOptions:c,minZoom:f,maxZoom:h,nodeOrigin:m,nodeExtent:p,defaultNodes:n,defaultEdges:s,zIndexMode:g}),setNodes:C=>{const{nodeLookup:N,parentLookup:P,nodeOrigin:k,elevateNodesOnSelect:b,fitViewQueued:T,zIndexMode:M}=S(),R=Tf(C,N,P,{nodeOrigin:k,nodeExtent:p,elevateNodesOnSelect:b,checkEquality:!0,zIndexMode:M});T&&R?(_(),w({nodes:C,nodesInitialized:R,fitViewQueued:!1,fitViewOptions:void 0})):w({nodes:C,nodesInitialized:R})},setEdges:C=>{const{connectionLookup:N,edgeLookup:P}=S();px(N,P,C),w({edges:C})},setDefaultNodesAndEdges:(C,N)=>{if(C){const{setNodes:P}=S();P(C),w({hasDefaultNodes:!0})}if(N){const{setEdges:P}=S();P(N),w({hasDefaultEdges:!0})}},updateNodeInternals:C=>{const{triggerNodeChanges:N,nodeLookup:P,parentLookup:k,domNode:b,nodeOrigin:T,nodeExtent:M,debug:R,fitViewQueued:O,zIndexMode:A}=S(),{changes:G,updatedInternals:W}=sR(C,P,k,b,T,M,A);W&&(tR(P,k,{nodeOrigin:T,nodeExtent:M,zIndexMode:A}),O?(_(),w({fitViewQueued:!1,fitViewOptions:void 0})):w({}),G?.length>0&&(R&&console.log("React Flow: trigger node changes",G),N?.(G)))},updateNodePositions:(C,N=!1)=>{const P=[];let k=[];const{nodeLookup:b,triggerNodeChanges:T,connection:M,updateConnection:R,onNodesChangeMiddlewareMap:O}=S();for(const[A,G]of C){const W=b.get(A),K=!!(W?.expandParent&&W?.parentId&&G?.position),J={id:A,type:"position",position:K?{x:Math.max(0,G.position.x),y:Math.max(0,G.position.y)}:G.position,dragging:N};if(W&&M.inProgress&&M.fromNode.id===W.id){const I=So(W,M.fromHandle,ge.Left,!0);R({...M,from:I})}K&&W.parentId&&P.push({id:A,parentId:W.parentId,rect:{...G.internals.positionAbsolute,width:G.measured.width??0,height:G.measured.height??0}}),k.push(J)}if(P.length>0){const{parentLookup:A,nodeOrigin:G}=S(),W=Sh(P,b,A,G);k.push(...W)}for(const A of O.values())k=A(k);T(k)},triggerNodeChanges:C=>{const{onNodesChange:N,setNodes:P,nodes:k,hasDefaultNodes:b,debug:T}=S();if(C?.length){if(b){const M=Px(C,k);P(M)}T&&console.log("React Flow: trigger node changes",C),N?.(C)}},triggerEdgeChanges:C=>{const{onEdgesChange:N,setEdges:P,edges:k,hasDefaultEdges:b,debug:T}=S();if(C?.length){if(b){const M=Rx(C,k);P(M)}T&&console.log("React Flow: trigger edge changes",C),N?.(C)}},addSelectedNodes:C=>{const{multiSelectionActive:N,edgeLookup:P,nodeLookup:k,triggerNodeChanges:b,triggerEdgeChanges:T}=S();if(N){const M=C.map(R=>no(R,!0));b(M);return}b(ds(k,new Set([...C]),!0)),T(ds(P))},addSelectedEdges:C=>{const{multiSelectionActive:N,edgeLookup:P,nodeLookup:k,triggerNodeChanges:b,triggerEdgeChanges:T}=S();if(N){const M=C.map(R=>no(R,!0));T(M);return}T(ds(P,new Set([...C]))),b(ds(k,new Set,!0))},unselectNodesAndEdges:({nodes:C,edges:N}={})=>{const{edges:P,nodes:k,nodeLookup:b,triggerNodeChanges:T,triggerEdgeChanges:M}=S(),R=C||k,O=N||P,A=R.map(W=>{const K=b.get(W.id);return K&&(K.selected=!1),no(W.id,!1)}),G=O.map(W=>no(W.id,!1));T(A),M(G)},setMinZoom:C=>{const{panZoom:N,maxZoom:P}=S();N?.setScaleExtent([C,P]),w({minZoom:C})},setMaxZoom:C=>{const{panZoom:N,minZoom:P}=S();N?.setScaleExtent([P,C]),w({maxZoom:C})},setTranslateExtent:C=>{S().panZoom?.setTranslateExtent(C),w({translateExtent:C})},resetSelectedElements:()=>{const{edges:C,nodes:N,triggerNodeChanges:P,triggerEdgeChanges:k,elementsSelectable:b}=S();if(!b)return;const T=N.reduce((R,O)=>O.selected?[...R,no(O.id,!1)]:R,[]),M=C.reduce((R,O)=>O.selected?[...R,no(O.id,!1)]:R,[]);P(T),k(M)},setNodeExtent:C=>{const{nodes:N,nodeLookup:P,parentLookup:k,nodeOrigin:b,elevateNodesOnSelect:T,nodeExtent:M,zIndexMode:R}=S();C[0][0]===M[0][0]&&C[0][1]===M[0][1]&&C[1][0]===M[1][0]&&C[1][1]===M[1][1]||(Tf(N,P,k,{nodeOrigin:b,nodeExtent:C,elevateNodesOnSelect:T,checkEquality:!1,zIndexMode:R}),w({nodeExtent:C}))},panBy:C=>{const{transform:N,width:P,height:k,panZoom:b,translateExtent:T}=S();return iR({delta:C,panZoom:b,transform:N,translateExtent:T,width:P,height:k})},setCenter:async(C,N,P)=>{const{width:k,height:b,maxZoom:T,panZoom:M}=S();if(!M)return Promise.resolve(!1);const R=typeof P?.zoom<"u"?P.zoom:T;return await M.setViewport({x:k/2-C*R,y:b/2-N*R,zoom:R},{duration:P?.duration,ease:P?.ease,interpolate:P?.interpolate}),Promise.resolve(!0)},cancelConnection:()=>{w({connection:{...Gv}})},updateConnection:C=>{w({connection:C})},reset:()=>w({...qy()})}},Object.is);function vT({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:s,initialWidth:i,initialHeight:l,initialMinZoom:u,initialMaxZoom:c,initialFitViewOptions:f,fitView:h,nodeOrigin:m,nodeExtent:p,zIndexMode:g,children:w}){const[S]=L.useState(()=>yT({nodes:e,edges:t,defaultNodes:n,defaultEdges:s,width:i,height:l,fitView:h,minZoom:u,maxZoom:c,fitViewOptions:f,nodeOrigin:m,nodeExtent:p,zIndexMode:g}));return x.jsx(LR,{value:S,children:x.jsx(sD,{children:w})})}function xT({children:e,nodes:t,edges:n,defaultNodes:s,defaultEdges:i,width:l,height:u,fitView:c,fitViewOptions:f,minZoom:h,maxZoom:m,nodeOrigin:p,nodeExtent:g,zIndexMode:w}){return L.useContext(Du)?x.jsx(x.Fragment,{children:e}):x.jsx(vT,{initialNodes:t,initialEdges:n,defaultNodes:s,defaultEdges:i,initialWidth:l,initialHeight:u,fitView:c,initialFitViewOptions:f,initialMinZoom:h,initialMaxZoom:m,nodeOrigin:p,nodeExtent:g,zIndexMode:w,children:e})}const wT={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function ST({nodes:e,edges:t,defaultNodes:n,defaultEdges:s,className:i,nodeTypes:l,edgeTypes:u,onNodeClick:c,onEdgeClick:f,onInit:h,onMove:m,onMoveStart:p,onMoveEnd:g,onConnect:w,onConnectStart:S,onConnectEnd:_,onClickConnectStart:C,onClickConnectEnd:N,onNodeMouseEnter:P,onNodeMouseMove:k,onNodeMouseLeave:b,onNodeContextMenu:T,onNodeDoubleClick:M,onNodeDragStart:R,onNodeDrag:O,onNodeDragStop:A,onNodesDelete:G,onEdgesDelete:W,onDelete:K,onSelectionChange:J,onSelectionDragStart:I,onSelectionDrag:Y,onSelectionDragStop:V,onSelectionContextMenu:Q,onSelectionStart:F,onSelectionEnd:B,onBeforeDelete:U,connectionMode:D,connectionLineType:$=Mr.Bezier,connectionLineStyle:ne,connectionLineComponent:te,connectionLineContainerStyle:ie,deleteKeyCode:ce="Backspace",selectionKeyCode:ue="Shift",selectionOnDrag:ee=!1,selectionMode:ae=Vi.Full,panActivationKeyCode:xe="Space",multiSelectionKeyCode:Ee=Ui()?"Meta":"Control",zoomActivationKeyCode:ye=Ui()?"Meta":"Control",snapToGrid:ke,snapGrid:Te,onlyRenderVisibleElements:je=!1,selectNodesOnDrag:Fe,nodesDraggable:Ue,autoPanOnNodeFocus:Ct,nodesConnectable:rt,nodesFocusable:ot,nodeOrigin:mt=bx,edgesFocusable:bt,edgesReconnectable:Re,elementsSelectable:Be=!0,defaultViewport:Ge=KR,minZoom:Mt=.5,maxZoom:ln=2,translateExtent:Fn=Hi,preventScrolling:ko=!0,nodeExtent:un,defaultMarkerColor:An="#b1b1b7",zoomOnScroll:bs=!0,zoomOnPinch:_o=!0,panOnScroll:Co=!1,panOnScrollSpeed:Ms=.5,panOnScrollMode:Lr=fo.Free,zoomOnDoubleClick:rr=!0,panOnDrag:Fr=!0,onPaneClick:Ne,onPaneMouseEnter:Oe,onPaneMouseMove:Se,onPaneMouseLeave:Me,onPaneScroll:ct,onPaneContextMenu:Pe,paneClickDistance:Eo=1,nodeClickDistance:No=0,children:bo,onReconnect:zn,onReconnectStart:or,onReconnectEnd:Ar,onEdgeContextMenu:Ps,onEdgeDoubleClick:zr,onEdgeMouseEnter:ju,onEdgeMouseMove:Wr,onEdgeMouseLeave:Mo,reconnectRadius:Po=10,onNodesChange:Rs,onEdgesChange:Lu,noDragClassName:Fu="nodrag",noWheelClassName:Au="nowheel",noPanClassName:Cn="nopan",fitView:Ds,fitViewOptions:Ts,connectOnClick:zu,attributionPosition:aa,proOptions:la,defaultEdgeOptions:ua,elevateNodesOnSelect:ca=!0,elevateEdgesOnSelect:Wu=!1,disableKeyboardA11y:da=!1,autoPanOnConnect:Xe,autoPanOnNodeDrag:$u,autoPanSpeed:Os,connectionRadius:fa,isValidConnection:Ro,onError:Bu,style:ha,id:$r,nodeDragThreshold:Gt,connectionDragThreshold:Hu,viewport:At,onViewportChange:Vu,width:Yu,height:Uu,colorMode:Do="light",debug:To,onScroll:sr,ariaLabelConfig:Oo,zIndexMode:pa="basic",...Qu},Is){const Io=$r||"1",js=JR(Do),Br=L.useCallback(ma=>{ma.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),sr?.(ma)},[sr]);return x.jsx("div",{"data-testid":"rf__wrapper",...Qu,onScroll:Br,style:{...ha,...wT},ref:Is,className:at(["react-flow",i,js]),id:$r,role:"application",children:x.jsxs(xT,{nodes:e,edges:t,width:Yu,height:Uu,fitView:Ds,fitViewOptions:Ts,minZoom:Mt,maxZoom:ln,nodeOrigin:mt,nodeExtent:un,zIndexMode:pa,children:[x.jsx(gT,{onInit:h,onNodeClick:c,onEdgeClick:f,onNodeMouseEnter:P,onNodeMouseMove:k,onNodeMouseLeave:b,onNodeContextMenu:T,onNodeDoubleClick:M,nodeTypes:l,edgeTypes:u,connectionLineType:$,connectionLineStyle:ne,connectionLineComponent:te,connectionLineContainerStyle:ie,selectionKeyCode:ue,selectionOnDrag:ee,selectionMode:ae,deleteKeyCode:ce,multiSelectionKeyCode:Ee,panActivationKeyCode:xe,zoomActivationKeyCode:ye,onlyRenderVisibleElements:je,defaultViewport:Ge,translateExtent:Fn,minZoom:Mt,maxZoom:ln,preventScrolling:ko,zoomOnScroll:bs,zoomOnPinch:_o,zoomOnDoubleClick:rr,panOnScroll:Co,panOnScrollSpeed:Ms,panOnScrollMode:Lr,panOnDrag:Fr,onPaneClick:Ne,onPaneMouseEnter:Oe,onPaneMouseMove:Se,onPaneMouseLeave:Me,onPaneScroll:ct,onPaneContextMenu:Pe,paneClickDistance:Eo,nodeClickDistance:No,onSelectionContextMenu:Q,onSelectionStart:F,onSelectionEnd:B,onReconnect:zn,onReconnectStart:or,onReconnectEnd:Ar,onEdgeContextMenu:Ps,onEdgeDoubleClick:zr,onEdgeMouseEnter:ju,onEdgeMouseMove:Wr,onEdgeMouseLeave:Mo,reconnectRadius:Po,defaultMarkerColor:An,noDragClassName:Fu,noWheelClassName:Au,noPanClassName:Cn,rfId:Io,disableKeyboardA11y:da,nodeExtent:un,viewport:At,onViewportChange:Vu}),x.jsx(ZR,{nodes:e,edges:t,defaultNodes:n,defaultEdges:s,onConnect:w,onConnectStart:S,onConnectEnd:_,onClickConnectStart:C,onClickConnectEnd:N,nodesDraggable:Ue,autoPanOnNodeFocus:Ct,nodesConnectable:rt,nodesFocusable:ot,edgesFocusable:bt,edgesReconnectable:Re,elementsSelectable:Be,elevateNodesOnSelect:ca,elevateEdgesOnSelect:Wu,minZoom:Mt,maxZoom:ln,nodeExtent:un,onNodesChange:Rs,onEdgesChange:Lu,snapToGrid:ke,snapGrid:Te,connectionMode:D,translateExtent:Fn,connectOnClick:zu,defaultEdgeOptions:ua,fitView:Ds,fitViewOptions:Ts,onNodesDelete:G,onEdgesDelete:W,onDelete:K,onNodeDragStart:R,onNodeDrag:O,onNodeDragStop:A,onSelectionDrag:Y,onSelectionDragStart:I,onSelectionDragStop:V,onMove:m,onMoveStart:p,onMoveEnd:g,noPanClassName:Cn,nodeOrigin:mt,rfId:Io,autoPanOnConnect:Xe,autoPanOnNodeDrag:$u,autoPanSpeed:Os,onError:Bu,connectionRadius:fa,isValidConnection:Ro,selectNodesOnDrag:Fe,nodeDragThreshold:Gt,connectionDragThreshold:Hu,onBeforeDelete:U,debug:To,ariaLabelConfig:Oo,zIndexMode:pa}),x.jsx(qR,{onSelectionChange:J}),bo,x.jsx(HR,{proOptions:la,position:aa}),x.jsx(BR,{rfId:Io,disableKeyboardA11y:da})]})})}var kT=Dx(ST);function _T(e){const[t,n]=L.useState(e),s=L.useCallback(i=>n(l=>Px(i,l)),[]);return[t,n,s]}function CT(e){const[t,n]=L.useState(e),s=L.useCallback(i=>n(l=>Rx(i,l)),[]);return[t,n,s]}function ET({dimensions:e,lineWidth:t,variant:n,className:s}){return x.jsx("path",{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:at(["react-flow__background-pattern",n,s])})}function NT({radius:e,className:t}){return x.jsx("circle",{cx:e,cy:e,r:e,className:at(["react-flow__background-pattern","dots",t])})}var Jn;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(Jn||(Jn={}));const bT={[Jn.Dots]:1,[Jn.Lines]:1,[Jn.Cross]:6},MT=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function tw({id:e,variant:t=Jn.Dots,gap:n=20,size:s,lineWidth:i=1,offset:l=0,color:u,bgColor:c,style:f,className:h,patternClassName:m}){const p=L.useRef(null),{transform:g,patternId:w}=Ie(MT,qe),S=s||bT[t],_=t===Jn.Dots,C=t===Jn.Cross,N=Array.isArray(n)?n:[n,n],P=[N[0]*g[2]||1,N[1]*g[2]||1],k=S*g[2],b=Array.isArray(l)?l:[l,l],T=C?[k,k]:P,M=[b[0]*g[2]||1+T[0]/2,b[1]*g[2]||1+T[1]/2],R=`${w}${e||""}`;return x.jsxs("svg",{className:at(["react-flow__background",h]),style:{...f,...Ou,"--xy-background-color-props":c,"--xy-background-pattern-color-props":u},ref:p,"data-testid":"rf__background",children:[x.jsx("pattern",{id:R,x:g[0]%P[0],y:g[1]%P[1],width:P[0],height:P[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${M[0]},-${M[1]})`,children:_?x.jsx(NT,{radius:k/2,className:m}):x.jsx(ET,{dimensions:T,lineWidth:i,variant:t,className:m})}),x.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${R})`})]})}tw.displayName="Background";const PT=L.memo(tw);function RT(){return x.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:x.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function DT(){return x.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:x.jsx("path",{d:"M0 0h32v4.2H0z"})})}function TT(){return x.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:x.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 OT(){return x.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:x.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 IT(){return x.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:x.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 Tl({children:e,className:t,...n}){return x.jsx("button",{type:"button",className:at(["react-flow__controls-button",t]),...n,children:e})}const jT=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function nw({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:s=!0,fitViewOptions:i,onZoomIn:l,onZoomOut:u,onFitView:c,onInteractiveChange:f,className:h,children:m,position:p="bottom-left",orientation:g="vertical","aria-label":w}){const S=Ke(),{isInteractive:_,minZoomReached:C,maxZoomReached:N,ariaLabelConfig:P}=Ie(jT,qe),{zoomIn:k,zoomOut:b,fitView:T}=kh(),M=()=>{k(),l?.()},R=()=>{b(),u?.()},O=()=>{T(i),c?.()},A=()=>{S.setState({nodesDraggable:!_,nodesConnectable:!_,elementsSelectable:!_}),f?.(!_)},G=g==="horizontal"?"horizontal":"vertical";return x.jsxs(Tu,{className:at(["react-flow__controls",G,h]),position:p,style:e,"data-testid":"rf__controls","aria-label":w??P["controls.ariaLabel"],children:[t&&x.jsxs(x.Fragment,{children:[x.jsx(Tl,{onClick:M,className:"react-flow__controls-zoomin",title:P["controls.zoomIn.ariaLabel"],"aria-label":P["controls.zoomIn.ariaLabel"],disabled:N,children:x.jsx(RT,{})}),x.jsx(Tl,{onClick:R,className:"react-flow__controls-zoomout",title:P["controls.zoomOut.ariaLabel"],"aria-label":P["controls.zoomOut.ariaLabel"],disabled:C,children:x.jsx(DT,{})})]}),n&&x.jsx(Tl,{className:"react-flow__controls-fitview",onClick:O,title:P["controls.fitView.ariaLabel"],"aria-label":P["controls.fitView.ariaLabel"],children:x.jsx(TT,{})}),s&&x.jsx(Tl,{className:"react-flow__controls-interactive",onClick:A,title:P["controls.interactive.ariaLabel"],"aria-label":P["controls.interactive.ariaLabel"],children:_?x.jsx(IT,{}):x.jsx(OT,{})}),m]})}nw.displayName="Controls";const LT=L.memo(nw);function FT({id:e,x:t,y:n,width:s,height:i,style:l,color:u,strokeColor:c,strokeWidth:f,className:h,borderRadius:m,shapeRendering:p,selected:g,onClick:w}){const{background:S,backgroundColor:_}=l||{},C=u||S||_;return x.jsx("rect",{className:at(["react-flow__minimap-node",{selected:g},h]),x:t,y:n,rx:m,ry:m,width:s,height:i,style:{fill:C,stroke:c,strokeWidth:f},shapeRendering:p,onClick:w?N=>w(N,e):void 0})}const AT=L.memo(FT),zT=e=>e.nodes.map(t=>t.id),of=e=>e instanceof Function?e:()=>e;function WT({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:s=5,nodeStrokeWidth:i,nodeComponent:l=AT,onClick:u}){const c=Ie(zT,qe),f=of(t),h=of(e),m=of(n),p=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return x.jsx(x.Fragment,{children:c.map(g=>x.jsx(BT,{id:g,nodeColorFunc:f,nodeStrokeColorFunc:h,nodeClassNameFunc:m,nodeBorderRadius:s,nodeStrokeWidth:i,NodeComponent:l,onClick:u,shapeRendering:p},g))})}function $T({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:s,nodeBorderRadius:i,nodeStrokeWidth:l,shapeRendering:u,NodeComponent:c,onClick:f}){const{node:h,x:m,y:p,width:g,height:w}=Ie(S=>{const{internals:_}=S.nodeLookup.get(e),C=_.userNode,{x:N,y:P}=_.positionAbsolute,{width:k,height:b}=nr(C);return{node:C,x:N,y:P,width:k,height:b}},qe);return!h||h.hidden||!rx(h)?null:x.jsx(c,{x:m,y:p,width:g,height:w,style:h.style,selected:!!h.selected,className:s(h),color:t(h),borderRadius:i,strokeColor:n(h),strokeWidth:l,shapeRendering:u,onClick:f,id:h.id})}const BT=L.memo($T);var HT=L.memo(WT);const VT=200,YT=150,UT=e=>!e.hidden,QT=e=>{const t={x:-e.transform[0]/e.transform[2],y:-e.transform[1]/e.transform[2],width:e.width/e.transform[2],height:e.height/e.transform[2]};return{viewBB:t,boundingRect:e.nodeLookup.size>0?nx(oa(e.nodeLookup,{filter:UT}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},qT="react-flow__minimap-desc";function rw({style:e,className:t,nodeStrokeColor:n,nodeColor:s,nodeClassName:i="",nodeBorderRadius:l=5,nodeStrokeWidth:u,nodeComponent:c,bgColor:f,maskColor:h,maskStrokeColor:m,maskStrokeWidth:p,position:g="bottom-right",onClick:w,onNodeClick:S,pannable:_=!1,zoomable:C=!1,ariaLabel:N,inversePan:P,zoomStep:k=1,offsetScale:b=5}){const T=Ke(),M=L.useRef(null),{boundingRect:R,viewBB:O,rfId:A,panZoom:G,translateExtent:W,flowWidth:K,flowHeight:J,ariaLabelConfig:I}=Ie(QT,qe),Y=e?.width??VT,V=e?.height??YT,Q=R.width/Y,F=R.height/V,B=Math.max(Q,F),U=B*Y,D=B*V,$=b*B,ne=R.x-(U-R.width)/2-$,te=R.y-(D-R.height)/2-$,ie=U+$*2,ce=D+$*2,ue=`${qT}-${A}`,ee=L.useRef(0),ae=L.useRef();ee.current=B,L.useEffect(()=>{if(M.current&&G)return ae.current=mR({domNode:M.current,panZoom:G,getTransform:()=>T.getState().transform,getViewScale:()=>ee.current}),()=>{ae.current?.destroy()}},[G]),L.useEffect(()=>{ae.current?.update({translateExtent:W,width:K,height:J,inversePan:P,pannable:_,zoomStep:k,zoomable:C})},[_,C,P,k,W,K,J]);const xe=w?ke=>{const[Te,je]=ae.current?.pointer(ke)||[0,0];w(ke,{x:Te,y:je})}:void 0,Ee=S?L.useCallback((ke,Te)=>{const je=T.getState().nodeLookup.get(Te).internals.userNode;S(ke,je)},[]):void 0,ye=N??I["minimap.ariaLabel"];return x.jsx(Tu,{position:g,style:{...e,"--xy-minimap-background-color-props":typeof f=="string"?f: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 p=="number"?p*B:void 0,"--xy-minimap-node-background-color-props":typeof s=="string"?s:void 0,"--xy-minimap-node-stroke-color-props":typeof n=="string"?n:void 0,"--xy-minimap-node-stroke-width-props":typeof u=="number"?u:void 0},className:at(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:x.jsxs("svg",{width:Y,height:V,viewBox:`${ne} ${te} ${ie} ${ce}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":ue,ref:M,onClick:xe,children:[ye&&x.jsx("title",{id:ue,children:ye}),x.jsx(HT,{onClick:Ee,nodeColor:s,nodeStrokeColor:n,nodeBorderRadius:l,nodeClassName:i,nodeStrokeWidth:u,nodeComponent:c}),x.jsx("path",{className:"react-flow__minimap-mask",d:`M${ne-$},${te-$}h${ie+$*2}v${ce+$*2}h${-ie-$*2}z
14
+ M${O.x},${O.y}h${O.width}v${O.height}h${-O.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}rw.displayName="MiniMap";L.memo(rw);const KT=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,GT={[_s.Line]:"right",[_s.Handle]:"bottom-right"};function XT({nodeId:e,position:t,variant:n=_s.Handle,className:s,style:i=void 0,children:l,color:u,minWidth:c=10,minHeight:f=10,maxWidth:h=Number.MAX_VALUE,maxHeight:m=Number.MAX_VALUE,keepAspectRatio:p=!1,resizeDirection:g,autoScale:w=!0,shouldResize:S,onResizeStart:_,onResize:C,onResizeEnd:N}){const P=jx(),k=typeof e=="string"?e:P,b=Ke(),T=L.useRef(null),M=n===_s.Handle,R=Ie(L.useCallback(KT(M&&w),[M,w]),qe),O=L.useRef(null),A=t??GT[n];L.useEffect(()=>{if(!(!T.current||!k))return O.current||(O.current=PR({domNode:T.current,nodeId:k,getStoreItems:()=>{const{nodeLookup:W,transform:K,snapGrid:J,snapToGrid:I,nodeOrigin:Y,domNode:V}=b.getState();return{nodeLookup:W,transform:K,snapGrid:J,snapToGrid:I,nodeOrigin:Y,paneDomNode:V}},onChange:(W,K)=>{const{triggerNodeChanges:J,nodeLookup:I,parentLookup:Y,nodeOrigin:V}=b.getState(),Q=[],F={x:W.x,y:W.y},B=I.get(k);if(B&&B.expandParent&&B.parentId){const U=B.origin??V,D=W.width??B.measured.width??0,$=W.height??B.measured.height??0,ne={id:B.id,parentId:B.parentId,rect:{width:D,height:$,...ox({x:W.x??B.position.x,y:W.y??B.position.y},{width:D,height:$},B.parentId,I,U)}},te=Sh([ne],I,Y,V);Q.push(...te),F.x=W.x?Math.max(U[0]*D,W.x):void 0,F.y=W.y?Math.max(U[1]*$,W.y):void 0}if(F.x!==void 0&&F.y!==void 0){const U={id:k,type:"position",position:{...F}};Q.push(U)}if(W.width!==void 0&&W.height!==void 0){const D={id:k,type:"dimensions",resizing:!0,setAttributes:g?g==="horizontal"?"width":"height":!0,dimensions:{width:W.width,height:W.height}};Q.push(D)}for(const U of K){const D={...U,type:"position"};Q.push(D)}J(Q)},onEnd:({width:W,height:K})=>{const J={id:k,type:"dimensions",resizing:!1,dimensions:{width:W,height:K}};b.getState().triggerNodeChanges([J])}})),O.current.update({controlPosition:A,boundaries:{minWidth:c,minHeight:f,maxWidth:h,maxHeight:m},keepAspectRatio:p,resizeDirection:g,onResizeStart:_,onResize:C,onResizeEnd:N,shouldResize:S}),()=>{O.current?.destroy()}},[A,c,f,h,m,p,_,C,N,S]);const G=A.split("-");return x.jsx("div",{className:at(["react-flow__resize-control","nodrag",...G,n,s]),ref:T,style:{...i,scale:R,...u&&{[M?"backgroundColor":"borderColor"]:u}},children:l})}L.memo(XT);const is={PENDING:{bg:"#374151",border:"#4B5563"},RECEIVED:{bg:"#374151",border:"#4B5563"},STARTED:{bg:"#1E40AF",border:"#3B82F6"},SUCCESS:{bg:"#166534",border:"#22C55E"},FAILURE:{bg:"#991B1B",border:"#EF4444"},RETRY:{bg:"#92400E",border:"#F59E0B"},REVOKED:{bg:"#5B21B6",border:"#8B5CF6"},REJECTED:{bg:"#7F1D1D",border:"#DC2626"}},ZT={TASK:{bg:"#0F172A",border:"#475569"},GROUP:{bg:"#1E1B4B",border:"#6366F1"},CHORD:{bg:"#312E81",border:"#818CF8"}},Ol=160,ki=100,_i=16,Ky=40,Gy=12,sf=320;function JT(e,t){const n=[],s=[],i=new Set,l=new Map,u=new Map,c=new Set,f=new Set;for(const p of Object.values(e)){const g=p.node_type??"TASK";if(g==="GROUP")for(const w of p.children)c.add(w);else if(g==="CHORD")for(const w of p.children)w===p.chord_id?f.add(w):c.add(w)}const h=[{id:t,level:0}];for(;h.length>0;){const{id:p,level:g}=h.shift();if(i.has(p))continue;i.add(p);const w=e[p];if(!w)continue;l.set(p,g);const S=w.node_type??"TASK",_=S==="GROUP"||S==="CHORD";for(const C of w.children)i.has(C)||_&&c.has(C)||h.push({id:C,level:g+1})}i.clear();const m=[t];for(;m.length>0;){const p=m.shift();if(i.has(p))continue;i.add(p);const g=e[p];if(!g||c.has(p))continue;const w=l.get(p)??0,S=g.node_type??"TASK",_=S==="GROUP"||S==="CHORD",C=is[g.state]??is.PENDING,N=ZT[S];if(_){const P=g.children.filter(R=>!f.has(R)),k=P.length,b=Ol+_i*2,T=Ky+_i*2+Math.max(1,k)*ki+Math.max(0,k-1)*Gy,M=u.get(w)??0;if(u.set(w,M+T+40),n.push({id:p,type:"default",position:{x:w*sf,y:M},data:{label:""},style:{width:b,height:T,backgroundColor:N.bg,border:`2px dashed ${N.border}`,borderRadius:"16px",padding:0},sourcePosition:ge.Right,targetPosition:ge.Left,className:"container-node"}),n.push({id:`${p}-header`,type:"default",position:{x:_i,y:8},parentId:p,extent:"parent",draggable:!1,selectable:!1,connectable:!1,data:{label:x.jsxs("div",{className:"flex items-center gap-3",children:[x.jsx("span",{className:"text-xs font-mono text-indigo-300 uppercase",children:S}),x.jsx("span",{className:"text-xs px-1.5 py-0.5 rounded",style:{backgroundColor:C.bg,color:C.border},children:g.state})]})},className:"header-label-node",style:{background:"transparent",border:"none",padding:0,width:"auto",pointerEvents:"none"}}),P.forEach((R,O)=>{const A=e[R];if(!A)return;const G=is[A.state]??is.PENDING,W=Ll(A.duration_ms),K=Fl(A.first_seen);n.push({id:R,position:{x:_i,y:Ky+_i+O*(ki+Gy)},parentId:p,extent:"parent",data:{label:x.jsxs(pt,{to:"/tasks/$taskId",params:{taskId:R},className:"block p-2 text-left h-full",children:[x.jsx("div",{className:"text-xs text-slate-400 font-mono mb-1",children:R.slice(0,8)}),x.jsx("div",{className:"text-sm text-slate-100 font-medium",children:A.name.split(".").pop()}),(K||W)&&x.jsxs("div",{className:"text-xs text-slate-500 mt-1",children:[K&&x.jsx("span",{children:K}),K&&W&&x.jsx("span",{className:"mx-1",children:"·"}),W&&x.jsx("span",{children:W})]}),x.jsx("div",{className:"text-xs mt-1 px-1.5 py-0.5 rounded inline-block",style:{backgroundColor:G.bg,color:G.border},children:A.state})]})},style:{minWidth:Ol,width:"fit-content",height:ki,backgroundColor:"#0F172A",border:`2px solid ${G.border}`,borderRadius:"8px",padding:0},sourcePosition:ge.Right,targetPosition:ge.Left,className:"container-child"}),i.add(R)}),S==="CHORD"){for(const R of g.children)if(f.has(R)){const O=e[R];if(!O)continue;const A=is[O.state]??is.PENDING,G=Ll(O.duration_ms),W=Fl(O.first_seen),K=w*sf+b+60,J=M+(T-ki)/2;n.push({id:R,position:{x:K,y:J},data:{label:x.jsxs(pt,{to:"/tasks/$taskId",params:{taskId:R},className:"block p-2 text-left h-full",children:[x.jsx("div",{className:"text-xs text-slate-400 font-mono mb-1",children:R.slice(0,8)}),x.jsx("div",{className:"text-sm text-slate-100 font-medium",children:O.name.split(".").pop()}),(W||G)&&x.jsxs("div",{className:"text-xs text-slate-500 mt-1",children:[W&&x.jsx("span",{children:W}),W&&G&&x.jsx("span",{className:"mx-1",children:"·"}),G&&x.jsx("span",{children:G})]}),x.jsx("div",{className:"text-xs mt-1 px-1.5 py-0.5 rounded inline-block",style:{backgroundColor:A.bg,color:A.border},children:O.state})]})},style:{minWidth:Ol,width:"fit-content",height:ki,backgroundColor:"#0F172A",border:`2px solid ${A.border}`,borderRadius:"8px",padding:0},sourcePosition:ge.Right,targetPosition:ge.Left});for(const I of P)s.push({id:`${p}-callback-${I}-${R}`,source:I,target:R,animated:O.state==="STARTED",style:{stroke:"#475569"}});i.add(R)}}}else{const P=u.get(w)??0;u.set(w,P+120);const k=Ll(g.duration_ms),b=Fl(g.first_seen);n.push({id:p,position:{x:w*sf,y:P},data:{label:x.jsxs(pt,{to:"/tasks/$taskId",params:{taskId:p},className:"block p-3 text-left",children:[x.jsx("div",{className:"text-xs text-slate-400 font-mono mb-1",children:p.slice(0,8)}),x.jsx("div",{className:"text-sm text-slate-100 font-medium whitespace-nowrap",children:g.name.split(".").pop()}),(b||k)&&x.jsxs("div",{className:"text-xs text-slate-500 mt-1",children:[b&&x.jsx("span",{children:b}),b&&k&&x.jsx("span",{className:"mx-1",children:"·"}),k&&x.jsx("span",{children:k})]}),x.jsx("div",{className:"text-xs mt-2 px-1.5 py-0.5 rounded inline-block",style:{backgroundColor:C.bg,color:C.border},children:g.state})]})},style:{padding:0,borderRadius:"8px",border:`2px solid ${C.border}`,backgroundColor:"#0F172A",minWidth:Ol,width:"fit-content"},sourcePosition:ge.Right,targetPosition:ge.Left});for(const T of g.children){if(c.has(T))continue;const M=e[T];s.push({id:`${p}-${T}`,source:p,target:T,animated:M?.state==="STARTED",style:{stroke:"#475569"}})}}for(const P of g.children)!i.has(P)&&!c.has(P)&&m.push(P)}return{nodes:n,edges:s}}function eO({nodes:e,rootId:t}){const{nodes:n,edges:s}=L.useMemo(()=>JT(e,t),[e,t]),[i,,l]=_T(n),[u,,c]=CT(s);return Object.keys(e).length===0?x.jsx("div",{className:"flex items-center justify-center h-full text-slate-400",children:"No nodes in graph"}):x.jsxs(kT,{nodes:i,edges:u,onNodesChange:l,onEdgesChange:c,fitView:!0,fitViewOptions:{padding:.2},minZoom:.1,maxZoom:2,proOptions:{hideAttribution:!0},children:[x.jsx(LT,{className:"bg-slate-800 border-slate-700"}),x.jsx(PT,{variant:Jn.Dots,gap:16,size:1,color:"#1E293B"})]})}const ow=go("/graph/$rootId")({component:tO});function tO(){const{rootId:e}=ow.useParams(),{data:t,isLoading:n,error:s}=C_(e);return n?x.jsx("div",{className:"flex items-center justify-center h-96",children:x.jsx("div",{className:"animate-spin w-8 h-8 border-2 border-slate-600 border-t-green-500 rounded-full"})}):s||!t?x.jsxs("div",{className:"text-center py-12",children:[x.jsx("p",{className:"text-red-400",children:"Failed to load graph"}),x.jsx(pt,{to:"/graphs",className:"text-blue-400 hover:underline mt-2 inline-block",children:"Back to graphs"})]}):x.jsxs("div",{className:"space-y-6",children:[x.jsxs("nav",{className:"flex items-center gap-2 text-sm",children:[x.jsx(pt,{to:"/graphs",className:"text-slate-400 hover:text-slate-200",children:"Graphs"}),x.jsx("span",{className:"text-slate-600",children:"/"}),x.jsx("span",{className:"text-slate-200 font-mono",children:e.slice(0,8)})]}),x.jsx("div",{className:"bg-slate-900 rounded-xl border border-slate-800 overflow-hidden",children:x.jsx("div",{className:"h-[600px]",children:x.jsx(eO,{nodes:t.nodes,rootId:t.root_id})})})]})}const nO=R_.update({id:"/registry",path:"/registry",getParentRoute:()=>Es}),rO=fv.update({id:"/graphs",path:"/graphs",getParentRoute:()=>Es}),oO=gv.update({id:"/",path:"/",getParentRoute:()=>Es}),sO=yv.update({id:"/tasks/$taskId",path:"/tasks/$taskId",getParentRoute:()=>Es}),iO=ow.update({id:"/graph/$rootId",path:"/graph/$rootId",getParentRoute:()=>Es}),aO={IndexRoute:oO,GraphsRoute:rO,RegistryRoute:nO,GraphRootIdRoute:iO,TasksTaskIdRoute:sO},lO=Es._addFileChildren(aO)._addFileTypes(),sw=new dS({defaultOptions:{queries:{staleTime:5e3,refetchOnWindowFocus:!1}}}),uO=a_({routeTree:lO,context:{queryClient:sw},defaultPreload:"intent"});f_.createRoot(document.getElementById("root")).render(x.jsx(L.StrictMode,{children:x.jsx(fS,{client:sw,children:x.jsx(p_,{children:x.jsx(c_,{router:uO})})})}));