agent-tower 0.3.7 → 0.3.9

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 (48) hide show
  1. package/dist/executors/cursor-agent.executor.d.ts +1 -1
  2. package/dist/executors/cursor-agent.executor.d.ts.map +1 -1
  3. package/dist/output/__tests__/claude-code-parser-token.test.js +98 -0
  4. package/dist/output/__tests__/claude-code-parser-token.test.js.map +1 -1
  5. package/dist/output/__tests__/cursor-agent-parser-user.test.d.ts +2 -0
  6. package/dist/output/__tests__/cursor-agent-parser-user.test.d.ts.map +1 -0
  7. package/dist/output/__tests__/cursor-agent-parser-user.test.js +109 -0
  8. package/dist/output/__tests__/cursor-agent-parser-user.test.js.map +1 -0
  9. package/dist/output/claude-code-parser.d.ts.map +1 -1
  10. package/dist/output/claude-code-parser.js +12 -9
  11. package/dist/output/claude-code-parser.js.map +1 -1
  12. package/dist/output/cursor-agent-parser.d.ts +33 -1
  13. package/dist/output/cursor-agent-parser.d.ts.map +1 -1
  14. package/dist/output/cursor-agent-parser.js +140 -24
  15. package/dist/output/cursor-agent-parser.js.map +1 -1
  16. package/dist/routes/system.d.ts +5 -0
  17. package/dist/routes/system.d.ts.map +1 -1
  18. package/dist/routes/system.js +51 -0
  19. package/dist/routes/system.js.map +1 -1
  20. package/dist/web/assets/{AgentDemoPage-CCHa9x-c.js → AgentDemoPage-CzND8Y0f.js} +1 -1
  21. package/dist/web/assets/{DemoPage-CdT6VXkX.js → DemoPage-CmUJ0dvS.js} +1 -1
  22. package/dist/web/assets/{NotificationSettingsPage-CqZPABEG.js → NotificationSettingsPage-B1SDsL68.js} +1 -1
  23. package/dist/web/assets/{ProfileSettingsPage-CSgX4NOe.js → ProfileSettingsPage-Z42bsJop.js} +1 -1
  24. package/dist/web/assets/{ProjectKanbanPage-Pk7nnDcc.js → ProjectKanbanPage-BsRLM_To.js} +3 -3
  25. package/dist/web/assets/{ProjectSettingsPage-COrzQUwG.js → ProjectSettingsPage-DizbsdCH.js} +1 -1
  26. package/dist/web/assets/ProviderSettingsPage-BnLCrZgD.js +54 -0
  27. package/dist/web/assets/{api-client-DUkeyNRB.js → api-client-CgvcCTaj.js} +1 -1
  28. package/dist/web/assets/{chevron-down-jKHLtCQs.js → chevron-down-DrP9EgY9.js} +1 -1
  29. package/dist/web/assets/{circle-alert-DggTOwqB.js → circle-alert-wdB5gDUz.js} +1 -1
  30. package/dist/web/assets/{circle-check-38jFi9hD.js → circle-check-DilG10OC.js} +1 -1
  31. package/dist/web/assets/{code-block-OCS4YCEC-BhBg2bzT.js → code-block-OCS4YCEC-BQpzSGnw.js} +1 -1
  32. package/dist/web/assets/{confirm-dialog-CUtMe44J.js → confirm-dialog-zLKSUa6j.js} +1 -1
  33. package/dist/web/assets/{folder-picker-BTgXPrUp.js → folder-picker-CmgJx3lM.js} +1 -1
  34. package/dist/web/assets/{index-2lw92znX.js → index-B-QFtMnj.js} +2 -2
  35. package/dist/web/assets/index-DX47RnmN.css +1 -0
  36. package/dist/web/assets/{loader-circle-eX5KttSb.js → loader-circle-B8Hk0gt3.js} +1 -1
  37. package/dist/web/assets/{mermaid-NOHMQCX5-CQgpbmIW.js → mermaid-NOHMQCX5-BvevrkjG.js} +3 -3
  38. package/dist/web/assets/{modal-DpSqKQgt.js → modal-CCInxYr_.js} +1 -1
  39. package/dist/web/assets/{pencil-BaroHDtz.js → pencil-u5vhUMho.js} +1 -1
  40. package/dist/web/assets/{query-keys-DpgVNQA1.js → query-keys-BGgDKleg.js} +1 -1
  41. package/dist/web/assets/{select-5Ta6iqIf.js → select-CinUO48b.js} +1 -1
  42. package/dist/web/assets/{use-profiles-BHlH-mYH.js → use-profiles-DJwSheDq.js} +1 -1
  43. package/dist/web/assets/{use-projects-DC5whFow.js → use-projects-OFs5uSW6.js} +1 -1
  44. package/dist/web/assets/{x-_SSVUTap.js → x-Bz9Stptu.js} +1 -1
  45. package/dist/web/index.html +2 -2
  46. package/package.json +1 -1
  47. package/dist/web/assets/ProviderSettingsPage-CzRDghu7.js +0 -54
  48. package/dist/web/assets/index-Br9066ZX.css +0 -1
@@ -1,4 +1,4 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ProjectKanbanPage-Pk7nnDcc.js","assets/query-keys-DpgVNQA1.js","assets/mermaid-NOHMQCX5-CQgpbmIW.js","assets/log-adapter-50wgehrc.js","assets/chevron-down-jKHLtCQs.js","assets/api-client-DUkeyNRB.js","assets/mermaid-NOHMQCX5-lI9o3AWT.css","assets/x-_SSVUTap.js","assets/confirm-dialog-CUtMe44J.js","assets/modal-DpSqKQgt.js","assets/use-projects-DC5whFow.js","assets/loader-circle-eX5KttSb.js","assets/select-5Ta6iqIf.js","assets/ProjectKanbanPage-G5OQeJvU.css","assets/DemoPage-CdT6VXkX.js","assets/AgentDemoPage-CCHa9x-c.js","assets/use-profiles-BHlH-mYH.js","assets/ProfileSettingsPage-CSgX4NOe.js","assets/pencil-BaroHDtz.js","assets/ProviderSettingsPage-CzRDghu7.js","assets/circle-check-38jFi9hD.js","assets/NotificationSettingsPage-CqZPABEG.js","assets/circle-alert-DggTOwqB.js","assets/ProjectSettingsPage-COrzQUwG.js"])))=>i.map(i=>d[i]);
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ProjectKanbanPage-BsRLM_To.js","assets/query-keys-BGgDKleg.js","assets/mermaid-NOHMQCX5-BvevrkjG.js","assets/log-adapter-50wgehrc.js","assets/chevron-down-DrP9EgY9.js","assets/api-client-CgvcCTaj.js","assets/mermaid-NOHMQCX5-lI9o3AWT.css","assets/x-Bz9Stptu.js","assets/confirm-dialog-zLKSUa6j.js","assets/modal-CCInxYr_.js","assets/use-projects-OFs5uSW6.js","assets/loader-circle-B8Hk0gt3.js","assets/select-CinUO48b.js","assets/ProjectKanbanPage-G5OQeJvU.css","assets/DemoPage-CmUJ0dvS.js","assets/AgentDemoPage-CzND8Y0f.js","assets/use-profiles-DJwSheDq.js","assets/ProfileSettingsPage-Z42bsJop.js","assets/pencil-u5vhUMho.js","assets/ProviderSettingsPage-BnLCrZgD.js","assets/circle-check-DilG10OC.js","assets/NotificationSettingsPage-B1SDsL68.js","assets/circle-alert-wdB5gDUz.js","assets/ProjectSettingsPage-DizbsdCH.js"])))=>i.map(i=>d[i]);
2
2
  function l0(a,i){for(var r=0;r<i.length;r++){const u=i[r];if(typeof u!="string"&&!Array.isArray(u)){for(const c in u)if(c!=="default"&&!(c in a)){const f=Object.getOwnPropertyDescriptor(u,c);f&&Object.defineProperty(a,c,f.get?f:{enumerable:!0,get:()=>u[c]})}}}return Object.freeze(Object.defineProperty(a,Symbol.toStringTag,{value:"Module"}))}(function(){const i=document.createElement("link").relList;if(i&&i.supports&&i.supports("modulepreload"))return;for(const c of document.querySelectorAll('link[rel="modulepreload"]'))u(c);new MutationObserver(c=>{for(const f of c)if(f.type==="childList")for(const h of f.addedNodes)h.tagName==="LINK"&&h.rel==="modulepreload"&&u(h)}).observe(document,{childList:!0,subtree:!0});function r(c){const f={};return c.integrity&&(f.integrity=c.integrity),c.referrerPolicy&&(f.referrerPolicy=c.referrerPolicy),c.crossOrigin==="use-credentials"?f.credentials="include":c.crossOrigin==="anonymous"?f.credentials="omit":f.credentials="same-origin",f}function u(c){if(c.ep)return;c.ep=!0;const f=r(c);fetch(c.href,f)}})();function Zy(a){return a&&a.__esModule&&Object.prototype.hasOwnProperty.call(a,"default")?a.default:a}var fc={exports:{}},tr={};var Km;function i0(){if(Km)return tr;Km=1;var a=Symbol.for("react.transitional.element"),i=Symbol.for("react.fragment");function r(u,c,f){var h=null;if(f!==void 0&&(h=""+f),c.key!==void 0&&(h=""+c.key),"key"in c){f={};for(var m in c)m!=="key"&&(f[m]=c[m])}else f=c;return c=f.ref,{$$typeof:a,type:u,key:h,ref:c!==void 0?c:null,props:f}}return tr.Fragment=i,tr.jsx=r,tr.jsxs=r,tr}var Zm;function r0(){return Zm||(Zm=1,fc.exports=i0()),fc.exports}var he=r0(),dc={exports:{}},Te={};var Jm;function s0(){if(Jm)return Te;Jm=1;var a=Symbol.for("react.transitional.element"),i=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),u=Symbol.for("react.strict_mode"),c=Symbol.for("react.profiler"),f=Symbol.for("react.consumer"),h=Symbol.for("react.context"),m=Symbol.for("react.forward_ref"),g=Symbol.for("react.suspense"),y=Symbol.for("react.memo"),E=Symbol.for("react.lazy"),p=Symbol.for("react.activity"),R=Symbol.iterator;function D(_){return _===null||typeof _!="object"?null:(_=R&&_[R]||_["@@iterator"],typeof _=="function"?_:null)}var H={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},V=Object.assign,K={};function G(_,B,q){this.props=_,this.context=B,this.refs=K,this.updater=q||H}G.prototype.isReactComponent={},G.prototype.setState=function(_,B){if(typeof _!="object"&&typeof _!="function"&&_!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,_,B,"setState")},G.prototype.forceUpdate=function(_){this.updater.enqueueForceUpdate(this,_,"forceUpdate")};function Z(){}Z.prototype=G.prototype;function W(_,B,q){this.props=_,this.context=B,this.refs=K,this.updater=q||H}var be=W.prototype=new Z;be.constructor=W,V(be,G.prototype),be.isPureReactComponent=!0;var ve=Array.isArray;function pe(){}var A={H:null,A:null,T:null,S:null},ae=Object.prototype.hasOwnProperty;function Ee(_,B,q){var J=q.ref;return{$$typeof:a,type:_,key:B,ref:J!==void 0?J:null,props:q}}function ze(_,B){return Ee(_.type,B,_.props)}function Oe(_){return typeof _=="object"&&_!==null&&_.$$typeof===a}function Ae(_){var B={"=":"=0",":":"=2"};return"$"+_.replace(/[=:]/g,function(q){return B[q]})}var Ke=/\/+/g;function Qe(_,B){return typeof _=="object"&&_!==null&&_.key!=null?Ae(""+_.key):B.toString(36)}function _e(_){switch(_.status){case"fulfilled":return _.value;case"rejected":throw _.reason;default:switch(typeof _.status=="string"?_.then(pe,pe):(_.status="pending",_.then(function(B){_.status==="pending"&&(_.status="fulfilled",_.value=B)},function(B){_.status==="pending"&&(_.status="rejected",_.reason=B)})),_.status){case"fulfilled":return _.value;case"rejected":throw _.reason}}throw _}function O(_,B,q,J,I){var ue=typeof _;(ue==="undefined"||ue==="boolean")&&(_=null);var we=!1;if(_===null)we=!0;else switch(ue){case"bigint":case"string":case"number":we=!0;break;case"object":switch(_.$$typeof){case a:case i:we=!0;break;case E:return we=_._init,O(we(_._payload),B,q,J,I)}}if(we)return I=I(_),we=J===""?"."+Qe(_,0):J,ve(I)?(q="",we!=null&&(q=we.replace(Ke,"$&/")+"/"),O(I,B,q,"",function(hn){return hn})):I!=null&&(Oe(I)&&(I=ze(I,q+(I.key==null||_&&_.key===I.key?"":(""+I.key).replace(Ke,"$&/")+"/")+we)),B.push(I)),1;we=0;var Se=J===""?".":J+":";if(ve(_))for(var Ze=0;Ze<_.length;Ze++)J=_[Ze],ue=Se+Qe(J,Ze),we+=O(J,B,q,ue,I);else if(Ze=D(_),typeof Ze=="function")for(_=Ze.call(_),Ze=0;!(J=_.next()).done;)J=J.value,ue=Se+Qe(J,Ze++),we+=O(J,B,q,ue,I);else if(ue==="object"){if(typeof _.then=="function")return O(_e(_),B,q,J,I);throw B=String(_),Error("Objects are not valid as a React child (found: "+(B==="[object Object]"?"object with keys {"+Object.keys(_).join(", ")+"}":B)+"). If you meant to render a collection of children, use an array instead.")}return we}function X(_,B,q){if(_==null)return _;var J=[],I=0;return O(_,J,"","",function(ue){return B.call(q,ue,I++)}),J}function F(_){if(_._status===-1){var B=_._result;B=B(),B.then(function(q){(_._status===0||_._status===-1)&&(_._status=1,_._result=q)},function(q){(_._status===0||_._status===-1)&&(_._status=2,_._result=q)}),_._status===-1&&(_._status=0,_._result=B)}if(_._status===1)return _._result.default;throw _._result}var ce=typeof reportError=="function"?reportError:function(_){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var B=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof _=="object"&&_!==null&&typeof _.message=="string"?String(_.message):String(_),error:_});if(!window.dispatchEvent(B))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",_);return}console.error(_)},de={map:X,forEach:function(_,B,q){X(_,function(){B.apply(this,arguments)},q)},count:function(_){var B=0;return X(_,function(){B++}),B},toArray:function(_){return X(_,function(B){return B})||[]},only:function(_){if(!Oe(_))throw Error("React.Children.only expected to receive a single React element child.");return _}};return Te.Activity=p,Te.Children=de,Te.Component=G,Te.Fragment=r,Te.Profiler=c,Te.PureComponent=W,Te.StrictMode=u,Te.Suspense=g,Te.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=A,Te.__COMPILER_RUNTIME={__proto__:null,c:function(_){return A.H.useMemoCache(_)}},Te.cache=function(_){return function(){return _.apply(null,arguments)}},Te.cacheSignal=function(){return null},Te.cloneElement=function(_,B,q){if(_==null)throw Error("The argument must be a React element, but you passed "+_+".");var J=V({},_.props),I=_.key;if(B!=null)for(ue in B.key!==void 0&&(I=""+B.key),B)!ae.call(B,ue)||ue==="key"||ue==="__self"||ue==="__source"||ue==="ref"&&B.ref===void 0||(J[ue]=B[ue]);var ue=arguments.length-2;if(ue===1)J.children=q;else if(1<ue){for(var we=Array(ue),Se=0;Se<ue;Se++)we[Se]=arguments[Se+2];J.children=we}return Ee(_.type,I,J)},Te.createContext=function(_){return _={$$typeof:h,_currentValue:_,_currentValue2:_,_threadCount:0,Provider:null,Consumer:null},_.Provider=_,_.Consumer={$$typeof:f,_context:_},_},Te.createElement=function(_,B,q){var J,I={},ue=null;if(B!=null)for(J in B.key!==void 0&&(ue=""+B.key),B)ae.call(B,J)&&J!=="key"&&J!=="__self"&&J!=="__source"&&(I[J]=B[J]);var we=arguments.length-2;if(we===1)I.children=q;else if(1<we){for(var Se=Array(we),Ze=0;Ze<we;Ze++)Se[Ze]=arguments[Ze+2];I.children=Se}if(_&&_.defaultProps)for(J in we=_.defaultProps,we)I[J]===void 0&&(I[J]=we[J]);return Ee(_,ue,I)},Te.createRef=function(){return{current:null}},Te.forwardRef=function(_){return{$$typeof:m,render:_}},Te.isValidElement=Oe,Te.lazy=function(_){return{$$typeof:E,_payload:{_status:-1,_result:_},_init:F}},Te.memo=function(_,B){return{$$typeof:y,type:_,compare:B===void 0?null:B}},Te.startTransition=function(_){var B=A.T,q={};A.T=q;try{var J=_(),I=A.S;I!==null&&I(q,J),typeof J=="object"&&J!==null&&typeof J.then=="function"&&J.then(pe,ce)}catch(ue){ce(ue)}finally{B!==null&&q.types!==null&&(B.types=q.types),A.T=B}},Te.unstable_useCacheRefresh=function(){return A.H.useCacheRefresh()},Te.use=function(_){return A.H.use(_)},Te.useActionState=function(_,B,q){return A.H.useActionState(_,B,q)},Te.useCallback=function(_,B){return A.H.useCallback(_,B)},Te.useContext=function(_){return A.H.useContext(_)},Te.useDebugValue=function(){},Te.useDeferredValue=function(_,B){return A.H.useDeferredValue(_,B)},Te.useEffect=function(_,B){return A.H.useEffect(_,B)},Te.useEffectEvent=function(_){return A.H.useEffectEvent(_)},Te.useId=function(){return A.H.useId()},Te.useImperativeHandle=function(_,B,q){return A.H.useImperativeHandle(_,B,q)},Te.useInsertionEffect=function(_,B){return A.H.useInsertionEffect(_,B)},Te.useLayoutEffect=function(_,B){return A.H.useLayoutEffect(_,B)},Te.useMemo=function(_,B){return A.H.useMemo(_,B)},Te.useOptimistic=function(_,B){return A.H.useOptimistic(_,B)},Te.useReducer=function(_,B,q){return A.H.useReducer(_,B,q)},Te.useRef=function(_){return A.H.useRef(_)},Te.useState=function(_){return A.H.useState(_)},Te.useSyncExternalStore=function(_,B,q){return A.H.useSyncExternalStore(_,B,q)},Te.useTransition=function(){return A.H.useTransition()},Te.version="19.2.4",Te}var Fm;function Vc(){return Fm||(Fm=1,dc.exports=s0()),dc.exports}var M=Vc();const P=Zy(M),u0=l0({__proto__:null,default:P},[M]);var hc={exports:{}},nr={},mc={exports:{}},yc={};var $m;function o0(){return $m||($m=1,(function(a){function i(O,X){var F=O.length;O.push(X);e:for(;0<F;){var ce=F-1>>>1,de=O[ce];if(0<c(de,X))O[ce]=X,O[F]=de,F=ce;else break e}}function r(O){return O.length===0?null:O[0]}function u(O){if(O.length===0)return null;var X=O[0],F=O.pop();if(F!==X){O[0]=F;e:for(var ce=0,de=O.length,_=de>>>1;ce<_;){var B=2*(ce+1)-1,q=O[B],J=B+1,I=O[J];if(0>c(q,F))J<de&&0>c(I,q)?(O[ce]=I,O[J]=F,ce=J):(O[ce]=q,O[B]=F,ce=B);else if(J<de&&0>c(I,F))O[ce]=I,O[J]=F,ce=J;else break e}}return X}function c(O,X){var F=O.sortIndex-X.sortIndex;return F!==0?F:O.id-X.id}if(a.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var f=performance;a.unstable_now=function(){return f.now()}}else{var h=Date,m=h.now();a.unstable_now=function(){return h.now()-m}}var g=[],y=[],E=1,p=null,R=3,D=!1,H=!1,V=!1,K=!1,G=typeof setTimeout=="function"?setTimeout:null,Z=typeof clearTimeout=="function"?clearTimeout:null,W=typeof setImmediate<"u"?setImmediate:null;function be(O){for(var X=r(y);X!==null;){if(X.callback===null)u(y);else if(X.startTime<=O)u(y),X.sortIndex=X.expirationTime,i(g,X);else break;X=r(y)}}function ve(O){if(V=!1,be(O),!H)if(r(g)!==null)H=!0,pe||(pe=!0,Ae());else{var X=r(y);X!==null&&_e(ve,X.startTime-O)}}var pe=!1,A=-1,ae=5,Ee=-1;function ze(){return K?!0:!(a.unstable_now()-Ee<ae)}function Oe(){if(K=!1,pe){var O=a.unstable_now();Ee=O;var X=!0;try{e:{H=!1,V&&(V=!1,Z(A),A=-1),D=!0;var F=R;try{t:{for(be(O),p=r(g);p!==null&&!(p.expirationTime>O&&ze());){var ce=p.callback;if(typeof ce=="function"){p.callback=null,R=p.priorityLevel;var de=ce(p.expirationTime<=O);if(O=a.unstable_now(),typeof de=="function"){p.callback=de,be(O),X=!0;break t}p===r(g)&&u(g),be(O)}else u(g);p=r(g)}if(p!==null)X=!0;else{var _=r(y);_!==null&&_e(ve,_.startTime-O),X=!1}}break e}finally{p=null,R=F,D=!1}X=void 0}}finally{X?Ae():pe=!1}}}var Ae;if(typeof W=="function")Ae=function(){W(Oe)};else if(typeof MessageChannel<"u"){var Ke=new MessageChannel,Qe=Ke.port2;Ke.port1.onmessage=Oe,Ae=function(){Qe.postMessage(null)}}else Ae=function(){G(Oe,0)};function _e(O,X){A=G(function(){O(a.unstable_now())},X)}a.unstable_IdlePriority=5,a.unstable_ImmediatePriority=1,a.unstable_LowPriority=4,a.unstable_NormalPriority=3,a.unstable_Profiling=null,a.unstable_UserBlockingPriority=2,a.unstable_cancelCallback=function(O){O.callback=null},a.unstable_forceFrameRate=function(O){0>O||125<O?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):ae=0<O?Math.floor(1e3/O):5},a.unstable_getCurrentPriorityLevel=function(){return R},a.unstable_next=function(O){switch(R){case 1:case 2:case 3:var X=3;break;default:X=R}var F=R;R=X;try{return O()}finally{R=F}},a.unstable_requestPaint=function(){K=!0},a.unstable_runWithPriority=function(O,X){switch(O){case 1:case 2:case 3:case 4:case 5:break;default:O=3}var F=R;R=O;try{return X()}finally{R=F}},a.unstable_scheduleCallback=function(O,X,F){var ce=a.unstable_now();switch(typeof F=="object"&&F!==null?(F=F.delay,F=typeof F=="number"&&0<F?ce+F:ce):F=ce,O){case 1:var de=-1;break;case 2:de=250;break;case 5:de=1073741823;break;case 4:de=1e4;break;default:de=5e3}return de=F+de,O={id:E++,callback:X,priorityLevel:O,startTime:F,expirationTime:de,sortIndex:-1},F>ce?(O.sortIndex=F,i(y,O),r(g)===null&&O===r(y)&&(V?(Z(A),A=-1):V=!0,_e(ve,F-ce))):(O.sortIndex=de,i(g,O),H||D||(H=!0,pe||(pe=!0,Ae()))),O},a.unstable_shouldYield=ze,a.unstable_wrapCallback=function(O){var X=R;return function(){var F=R;R=X;try{return O.apply(this,arguments)}finally{R=F}}}})(yc)),yc}var Pm;function c0(){return Pm||(Pm=1,mc.exports=o0()),mc.exports}var pc={exports:{}},jt={};var Wm;function f0(){if(Wm)return jt;Wm=1;var a=Vc();function i(g){var y="https://react.dev/errors/"+g;if(1<arguments.length){y+="?args[]="+encodeURIComponent(arguments[1]);for(var E=2;E<arguments.length;E++)y+="&args[]="+encodeURIComponent(arguments[E])}return"Minified React error #"+g+"; visit "+y+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function r(){}var u={d:{f:r,r:function(){throw Error(i(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},c=Symbol.for("react.portal");function f(g,y,E){var p=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:c,key:p==null?null:""+p,children:g,containerInfo:y,implementation:E}}var h=a.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function m(g,y){if(g==="font")return"";if(typeof y=="string")return y==="use-credentials"?y:""}return jt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=u,jt.createPortal=function(g,y){var E=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!y||y.nodeType!==1&&y.nodeType!==9&&y.nodeType!==11)throw Error(i(299));return f(g,y,null,E)},jt.flushSync=function(g){var y=h.T,E=u.p;try{if(h.T=null,u.p=2,g)return g()}finally{h.T=y,u.p=E,u.d.f()}},jt.preconnect=function(g,y){typeof g=="string"&&(y?(y=y.crossOrigin,y=typeof y=="string"?y==="use-credentials"?y:"":void 0):y=null,u.d.C(g,y))},jt.prefetchDNS=function(g){typeof g=="string"&&u.d.D(g)},jt.preinit=function(g,y){if(typeof g=="string"&&y&&typeof y.as=="string"){var E=y.as,p=m(E,y.crossOrigin),R=typeof y.integrity=="string"?y.integrity:void 0,D=typeof y.fetchPriority=="string"?y.fetchPriority:void 0;E==="style"?u.d.S(g,typeof y.precedence=="string"?y.precedence:void 0,{crossOrigin:p,integrity:R,fetchPriority:D}):E==="script"&&u.d.X(g,{crossOrigin:p,integrity:R,fetchPriority:D,nonce:typeof y.nonce=="string"?y.nonce:void 0})}},jt.preinitModule=function(g,y){if(typeof g=="string")if(typeof y=="object"&&y!==null){if(y.as==null||y.as==="script"){var E=m(y.as,y.crossOrigin);u.d.M(g,{crossOrigin:E,integrity:typeof y.integrity=="string"?y.integrity:void 0,nonce:typeof y.nonce=="string"?y.nonce:void 0})}}else y==null&&u.d.M(g)},jt.preload=function(g,y){if(typeof g=="string"&&typeof y=="object"&&y!==null&&typeof y.as=="string"){var E=y.as,p=m(E,y.crossOrigin);u.d.L(g,E,{crossOrigin:p,integrity:typeof y.integrity=="string"?y.integrity:void 0,nonce:typeof y.nonce=="string"?y.nonce:void 0,type:typeof y.type=="string"?y.type:void 0,fetchPriority:typeof y.fetchPriority=="string"?y.fetchPriority:void 0,referrerPolicy:typeof y.referrerPolicy=="string"?y.referrerPolicy:void 0,imageSrcSet:typeof y.imageSrcSet=="string"?y.imageSrcSet:void 0,imageSizes:typeof y.imageSizes=="string"?y.imageSizes:void 0,media:typeof y.media=="string"?y.media:void 0})}},jt.preloadModule=function(g,y){if(typeof g=="string")if(y){var E=m(y.as,y.crossOrigin);u.d.m(g,{as:typeof y.as=="string"&&y.as!=="script"?y.as:void 0,crossOrigin:E,integrity:typeof y.integrity=="string"?y.integrity:void 0})}else u.d.m(g)},jt.requestFormReset=function(g){u.d.r(g)},jt.unstable_batchedUpdates=function(g,y){return g(y)},jt.useFormState=function(g,y,E){return h.H.useFormState(g,y,E)},jt.useFormStatus=function(){return h.H.useHostTransitionStatus()},jt.version="19.2.4",jt}var Im;function Jy(){if(Im)return pc.exports;Im=1;function a(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(a)}catch(i){console.error(i)}}return a(),pc.exports=f0(),pc.exports}var ey;function d0(){if(ey)return nr;ey=1;var a=c0(),i=Vc(),r=Jy();function u(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function c(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function f(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function h(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function m(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function g(e){if(f(e)!==e)throw Error(u(188))}function y(e){var t=e.alternate;if(!t){if(t=f(e),t===null)throw Error(u(188));return t!==e?null:e}for(var n=e,l=t;;){var s=n.return;if(s===null)break;var o=s.alternate;if(o===null){if(l=s.return,l!==null){n=l;continue}break}if(s.child===o.child){for(o=s.child;o;){if(o===n)return g(s),e;if(o===l)return g(s),t;o=o.sibling}throw Error(u(188))}if(n.return!==l.return)n=s,l=o;else{for(var d=!1,v=s.child;v;){if(v===n){d=!0,n=s,l=o;break}if(v===l){d=!0,l=s,n=o;break}v=v.sibling}if(!d){for(v=o.child;v;){if(v===n){d=!0,n=o,l=s;break}if(v===l){d=!0,l=o,n=s;break}v=v.sibling}if(!d)throw Error(u(189))}}if(n.alternate!==l)throw Error(u(190))}if(n.tag!==3)throw Error(u(188));return n.stateNode.current===n?e:t}function E(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=E(e),t!==null)return t;e=e.sibling}return null}var p=Object.assign,R=Symbol.for("react.element"),D=Symbol.for("react.transitional.element"),H=Symbol.for("react.portal"),V=Symbol.for("react.fragment"),K=Symbol.for("react.strict_mode"),G=Symbol.for("react.profiler"),Z=Symbol.for("react.consumer"),W=Symbol.for("react.context"),be=Symbol.for("react.forward_ref"),ve=Symbol.for("react.suspense"),pe=Symbol.for("react.suspense_list"),A=Symbol.for("react.memo"),ae=Symbol.for("react.lazy"),Ee=Symbol.for("react.activity"),ze=Symbol.for("react.memo_cache_sentinel"),Oe=Symbol.iterator;function Ae(e){return e===null||typeof e!="object"?null:(e=Oe&&e[Oe]||e["@@iterator"],typeof e=="function"?e:null)}var Ke=Symbol.for("react.client.reference");function Qe(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===Ke?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case V:return"Fragment";case G:return"Profiler";case K:return"StrictMode";case ve:return"Suspense";case pe:return"SuspenseList";case Ee:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case H:return"Portal";case W:return e.displayName||"Context";case Z:return(e._context.displayName||"Context")+".Consumer";case be:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case A:return t=e.displayName||null,t!==null?t:Qe(e.type)||"Memo";case ae:t=e._payload,e=e._init;try{return Qe(e(t))}catch{}}return null}var _e=Array.isArray,O=i.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,X=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,F={pending:!1,data:null,method:null,action:null},ce=[],de=-1;function _(e){return{current:e}}function B(e){0>de||(e.current=ce[de],ce[de]=null,de--)}function q(e,t){de++,ce[de]=e.current,e.current=t}var J=_(null),I=_(null),ue=_(null),we=_(null);function Se(e,t){switch(q(ue,t),q(I,e),q(J,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?ym(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=ym(t),e=pm(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}B(J),q(J,e)}function Ze(){B(J),B(I),B(ue)}function hn(e){e.memoizedState!==null&&q(we,e);var t=J.current,n=pm(t,e.type);t!==n&&(q(I,e),q(J,n))}function Dn(e){I.current===e&&(B(J),B(I)),we.current===e&&(B(we),Pi._currentValue=F)}var Ie,Cn;function Gt(e){if(Ie===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);Ie=t&&t[1]||"",Cn=-1<n.stack.indexOf(`
3
3
  at`)?" (<anonymous>)":-1<n.stack.indexOf("@")?"@unknown:0:0":""}return`
4
4
  `+Ie+e+Cn}var Ia=!1;function kt(e,t){if(!e||Ia)return"";Ia=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var l={DetermineComponentFrameRoot:function(){try{if(t){var Q=function(){throw Error()};if(Object.defineProperty(Q.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Q,[])}catch(L){var N=L}Reflect.construct(e,[],Q)}else{try{Q.call()}catch(L){N=L}e.call(Q.prototype)}}else{try{throw Error()}catch(L){N=L}(Q=e())&&typeof Q.catch=="function"&&Q.catch(function(){})}}catch(L){if(L&&N&&typeof L.stack=="string")return[L.stack,N.stack]}return[null,null]}};l.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var s=Object.getOwnPropertyDescriptor(l.DetermineComponentFrameRoot,"name");s&&s.configurable&&Object.defineProperty(l.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var o=l.DetermineComponentFrameRoot(),d=o[0],v=o[1];if(d&&v){var S=d.split(`
@@ -10,4 +10,4 @@ Error generating stack: `+l.message+`
10
10
  `).replace(xg,"")}function hm(e,t){return t=dm(t),dm(e)===t}function Pe(e,t,n,l,s,o){switch(n){case"children":typeof l=="string"?t==="body"||t==="textarea"&&l===""||Ml(e,l):(typeof l=="number"||typeof l=="bigint")&&t!=="body"&&Ml(e,""+l);break;case"className":Bn(e,"class",l);break;case"tabIndex":Bn(e,"tabindex",l);break;case"dir":case"role":case"viewBox":case"width":case"height":Bn(e,n,l);break;case"style":hf(e,l,o);break;case"data":if(t!=="object"){Bn(e,"data",l);break}case"src":case"href":if(l===""&&(t!=="a"||n!=="href")){e.removeAttribute(n);break}if(l==null||typeof l=="function"||typeof l=="symbol"||typeof l=="boolean"){e.removeAttribute(n);break}l=_r(""+l),e.setAttribute(n,l);break;case"action":case"formAction":if(typeof l=="function"){e.setAttribute(n,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof o=="function"&&(n==="formAction"?(t!=="input"&&Pe(e,t,"name",s.name,s,null),Pe(e,t,"formEncType",s.formEncType,s,null),Pe(e,t,"formMethod",s.formMethod,s,null),Pe(e,t,"formTarget",s.formTarget,s,null)):(Pe(e,t,"encType",s.encType,s,null),Pe(e,t,"method",s.method,s,null),Pe(e,t,"target",s.target,s,null)));if(l==null||typeof l=="symbol"||typeof l=="boolean"){e.removeAttribute(n);break}l=_r(""+l),e.setAttribute(n,l);break;case"onClick":l!=null&&(e.onclick=ia);break;case"onScroll":l!=null&&Ce("scroll",e);break;case"onScrollEnd":l!=null&&Ce("scrollend",e);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(u(61));if(n=l.__html,n!=null){if(s.children!=null)throw Error(u(60));e.innerHTML=n}}break;case"multiple":e.multiple=l&&typeof l!="function"&&typeof l!="symbol";break;case"muted":e.muted=l&&typeof l!="function"&&typeof l!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(l==null||typeof l=="function"||typeof l=="boolean"||typeof l=="symbol"){e.removeAttribute("xlink:href");break}n=_r(""+l),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",n);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":l!=null&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(n,""+l):e.removeAttribute(n);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":l&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(n,""):e.removeAttribute(n);break;case"capture":case"download":l===!0?e.setAttribute(n,""):l!==!1&&l!=null&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(n,l):e.removeAttribute(n);break;case"cols":case"rows":case"size":case"span":l!=null&&typeof l!="function"&&typeof l!="symbol"&&!isNaN(l)&&1<=l?e.setAttribute(n,l):e.removeAttribute(n);break;case"rowSpan":case"start":l==null||typeof l=="function"||typeof l=="symbol"||isNaN(l)?e.removeAttribute(n):e.setAttribute(n,l);break;case"popover":Ce("beforetoggle",e),Ce("toggle",e),pt(e,"popover",l);break;case"xlinkActuate":Ct(e,"http://www.w3.org/1999/xlink","xlink:actuate",l);break;case"xlinkArcrole":Ct(e,"http://www.w3.org/1999/xlink","xlink:arcrole",l);break;case"xlinkRole":Ct(e,"http://www.w3.org/1999/xlink","xlink:role",l);break;case"xlinkShow":Ct(e,"http://www.w3.org/1999/xlink","xlink:show",l);break;case"xlinkTitle":Ct(e,"http://www.w3.org/1999/xlink","xlink:title",l);break;case"xlinkType":Ct(e,"http://www.w3.org/1999/xlink","xlink:type",l);break;case"xmlBase":Ct(e,"http://www.w3.org/XML/1998/namespace","xml:base",l);break;case"xmlLang":Ct(e,"http://www.w3.org/XML/1998/namespace","xml:lang",l);break;case"xmlSpace":Ct(e,"http://www.w3.org/XML/1998/namespace","xml:space",l);break;case"is":pt(e,"is",l);break;case"innerText":case"textContent":break;default:(!(2<n.length)||n[0]!=="o"&&n[0]!=="O"||n[1]!=="n"&&n[1]!=="N")&&(n=ev.get(n)||n,pt(e,n,l))}}function Zo(e,t,n,l,s,o){switch(n){case"style":hf(e,l,o);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(u(61));if(n=l.__html,n!=null){if(s.children!=null)throw Error(u(60));e.innerHTML=n}}break;case"children":typeof l=="string"?Ml(e,l):(typeof l=="number"||typeof l=="bigint")&&Ml(e,""+l);break;case"onScroll":l!=null&&Ce("scroll",e);break;case"onScrollEnd":l!=null&&Ce("scrollend",e);break;case"onClick":l!=null&&(e.onclick=ia);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!nn.hasOwnProperty(n))e:{if(n[0]==="o"&&n[1]==="n"&&(s=n.endsWith("Capture"),t=n.slice(2,s?n.length-7:void 0),o=e[ne]||null,o=o!=null?o[n]:null,typeof o=="function"&&e.removeEventListener(t,o,s),typeof l=="function")){typeof o!="function"&&o!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,l,s);break e}n in e?e[n]=l:l===!0?e.setAttribute(n,""):pt(e,n,l)}}}function Lt(e,t,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Ce("error",e),Ce("load",e);var l=!1,s=!1,o;for(o in n)if(n.hasOwnProperty(o)){var d=n[o];if(d!=null)switch(o){case"src":l=!0;break;case"srcSet":s=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(u(137,t));default:Pe(e,t,o,d,n,null)}}s&&Pe(e,t,"srcSet",n.srcSet,n,null),l&&Pe(e,t,"src",n.src,n,null);return;case"input":Ce("invalid",e);var v=o=d=s=null,S=null,z=null;for(l in n)if(n.hasOwnProperty(l)){var j=n[l];if(j!=null)switch(l){case"name":s=j;break;case"type":d=j;break;case"checked":S=j;break;case"defaultChecked":z=j;break;case"value":o=j;break;case"defaultValue":v=j;break;case"children":case"dangerouslySetInnerHTML":if(j!=null)throw Error(u(137,t));break;default:Pe(e,t,l,j,n,null)}}of(e,o,v,S,z,d,s,!1);return;case"select":Ce("invalid",e),l=d=o=null;for(s in n)if(n.hasOwnProperty(s)&&(v=n[s],v!=null))switch(s){case"value":o=v;break;case"defaultValue":d=v;break;case"multiple":l=v;default:Pe(e,t,s,v,n,null)}t=o,n=d,e.multiple=!!l,t!=null?Al(e,!!l,t,!1):n!=null&&Al(e,!!l,n,!0);return;case"textarea":Ce("invalid",e),o=s=l=null;for(d in n)if(n.hasOwnProperty(d)&&(v=n[d],v!=null))switch(d){case"value":l=v;break;case"defaultValue":s=v;break;case"children":o=v;break;case"dangerouslySetInnerHTML":if(v!=null)throw Error(u(91));break;default:Pe(e,t,d,v,n,null)}ff(e,l,s,o);return;case"option":for(S in n)n.hasOwnProperty(S)&&(l=n[S],l!=null)&&(S==="selected"?e.selected=l&&typeof l!="function"&&typeof l!="symbol":Pe(e,t,S,l,n,null));return;case"dialog":Ce("beforetoggle",e),Ce("toggle",e),Ce("cancel",e),Ce("close",e);break;case"iframe":case"object":Ce("load",e);break;case"video":case"audio":for(l=0;l<Ki.length;l++)Ce(Ki[l],e);break;case"image":Ce("error",e),Ce("load",e);break;case"details":Ce("toggle",e);break;case"embed":case"source":case"link":Ce("error",e),Ce("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(z in n)if(n.hasOwnProperty(z)&&(l=n[z],l!=null))switch(z){case"children":case"dangerouslySetInnerHTML":throw Error(u(137,t));default:Pe(e,t,z,l,n,null)}return;default:if(ru(t)){for(j in n)n.hasOwnProperty(j)&&(l=n[j],l!==void 0&&Zo(e,t,j,l,n,void 0));return}}for(v in n)n.hasOwnProperty(v)&&(l=n[v],l!=null&&Pe(e,t,v,l,n,null))}function Og(e,t,n,l){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var s=null,o=null,d=null,v=null,S=null,z=null,j=null;for(L in n){var Q=n[L];if(n.hasOwnProperty(L)&&Q!=null)switch(L){case"checked":break;case"value":break;case"defaultValue":S=Q;default:l.hasOwnProperty(L)||Pe(e,t,L,null,l,Q)}}for(var N in l){var L=l[N];if(Q=n[N],l.hasOwnProperty(N)&&(L!=null||Q!=null))switch(N){case"type":o=L;break;case"name":s=L;break;case"checked":z=L;break;case"defaultChecked":j=L;break;case"value":d=L;break;case"defaultValue":v=L;break;case"children":case"dangerouslySetInnerHTML":if(L!=null)throw Error(u(137,t));break;default:L!==Q&&Pe(e,t,N,L,l,Q)}}lu(e,d,v,S,z,j,o,s);return;case"select":L=d=v=N=null;for(o in n)if(S=n[o],n.hasOwnProperty(o)&&S!=null)switch(o){case"value":break;case"multiple":L=S;default:l.hasOwnProperty(o)||Pe(e,t,o,null,l,S)}for(s in l)if(o=l[s],S=n[s],l.hasOwnProperty(s)&&(o!=null||S!=null))switch(s){case"value":N=o;break;case"defaultValue":v=o;break;case"multiple":d=o;default:o!==S&&Pe(e,t,s,o,l,S)}t=v,n=d,l=L,N!=null?Al(e,!!n,N,!1):!!l!=!!n&&(t!=null?Al(e,!!n,t,!0):Al(e,!!n,n?[]:"",!1));return;case"textarea":L=N=null;for(v in n)if(s=n[v],n.hasOwnProperty(v)&&s!=null&&!l.hasOwnProperty(v))switch(v){case"value":break;case"children":break;default:Pe(e,t,v,null,l,s)}for(d in l)if(s=l[d],o=n[d],l.hasOwnProperty(d)&&(s!=null||o!=null))switch(d){case"value":N=s;break;case"defaultValue":L=s;break;case"children":break;case"dangerouslySetInnerHTML":if(s!=null)throw Error(u(91));break;default:s!==o&&Pe(e,t,d,s,l,o)}cf(e,N,L);return;case"option":for(var le in n)N=n[le],n.hasOwnProperty(le)&&N!=null&&!l.hasOwnProperty(le)&&(le==="selected"?e.selected=!1:Pe(e,t,le,null,l,N));for(S in l)N=l[S],L=n[S],l.hasOwnProperty(S)&&N!==L&&(N!=null||L!=null)&&(S==="selected"?e.selected=N&&typeof N!="function"&&typeof N!="symbol":Pe(e,t,S,N,l,L));return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var ye in n)N=n[ye],n.hasOwnProperty(ye)&&N!=null&&!l.hasOwnProperty(ye)&&Pe(e,t,ye,null,l,N);for(z in l)if(N=l[z],L=n[z],l.hasOwnProperty(z)&&N!==L&&(N!=null||L!=null))switch(z){case"children":case"dangerouslySetInnerHTML":if(N!=null)throw Error(u(137,t));break;default:Pe(e,t,z,N,l,L)}return;default:if(ru(t)){for(var We in n)N=n[We],n.hasOwnProperty(We)&&N!==void 0&&!l.hasOwnProperty(We)&&Zo(e,t,We,void 0,l,N);for(j in l)N=l[j],L=n[j],!l.hasOwnProperty(j)||N===L||N===void 0&&L===void 0||Zo(e,t,j,N,l,L);return}}for(var x in n)N=n[x],n.hasOwnProperty(x)&&N!=null&&!l.hasOwnProperty(x)&&Pe(e,t,x,null,l,N);for(Q in l)N=l[Q],L=n[Q],!l.hasOwnProperty(Q)||N===L||N==null&&L==null||Pe(e,t,Q,N,l,L)}function mm(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Ag(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,n=performance.getEntriesByType("resource"),l=0;l<n.length;l++){var s=n[l],o=s.transferSize,d=s.initiatorType,v=s.duration;if(o&&v&&mm(d)){for(d=0,v=s.responseEnd,l+=1;l<n.length;l++){var S=n[l],z=S.startTime;if(z>v)break;var j=S.transferSize,Q=S.initiatorType;j&&mm(Q)&&(S=S.responseEnd,d+=j*(S<v?1:(v-z)/(S-z)))}if(--l,t+=8*(o+d)/(s.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var Jo=null,Fo=null;function vs(e){return e.nodeType===9?e:e.ownerDocument}function ym(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function pm(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function $o(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Po=null;function Mg(){var e=window.event;return e&&e.type==="popstate"?e===Po?!1:(Po=e,!0):(Po=null,!1)}var vm=typeof setTimeout=="function"?setTimeout:void 0,Dg=typeof clearTimeout=="function"?clearTimeout:void 0,gm=typeof Promise=="function"?Promise:void 0,Cg=typeof queueMicrotask=="function"?queueMicrotask:typeof gm<"u"?function(e){return gm.resolve(null).then(e).catch(zg)}:vm;function zg(e){setTimeout(function(){throw e})}function Qa(e){return e==="head"}function bm(e,t){var n=t,l=0;do{var s=n.nextSibling;if(e.removeChild(n),s&&s.nodeType===8)if(n=s.data,n==="/$"||n==="/&"){if(l===0){e.removeChild(s),ri(t);return}l--}else if(n==="$"||n==="$?"||n==="$~"||n==="$!"||n==="&")l++;else if(n==="html")Ji(e.ownerDocument.documentElement);else if(n==="head"){n=e.ownerDocument.head,Ji(n);for(var o=n.firstChild;o;){var d=o.nextSibling,v=o.nodeName;o[ot]||v==="SCRIPT"||v==="STYLE"||v==="LINK"&&o.rel.toLowerCase()==="stylesheet"||n.removeChild(o),o=d}}else n==="body"&&Ji(e.ownerDocument.body);n=s}while(n);ri(t)}function Sm(e,t){var n=e;e=0;do{var l=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display="none"):(n.style.display=n._stashedDisplay||"",n.getAttribute("style")===""&&n.removeAttribute("style")):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=""):n.nodeValue=n._stashedText||""),l&&l.nodeType===8)if(n=l.data,n==="/$"){if(e===0)break;e--}else n!=="$"&&n!=="$?"&&n!=="$~"&&n!=="$!"||e++;n=l}while(n)}function Wo(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case"HTML":case"HEAD":case"BODY":Wo(n),ct(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(n.rel.toLowerCase()==="stylesheet")continue}e.removeChild(n)}}function Ng(e,t,n,l){for(;e.nodeType===1;){var s=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!l&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(l){if(!e[ot])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(o=e.getAttribute("rel"),o==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(o!==s.rel||e.getAttribute("href")!==(s.href==null||s.href===""?null:s.href)||e.getAttribute("crossorigin")!==(s.crossOrigin==null?null:s.crossOrigin)||e.getAttribute("title")!==(s.title==null?null:s.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(o=e.getAttribute("src"),(o!==(s.src==null?null:s.src)||e.getAttribute("type")!==(s.type==null?null:s.type)||e.getAttribute("crossorigin")!==(s.crossOrigin==null?null:s.crossOrigin))&&o&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var o=s.name==null?null:""+s.name;if(s.type==="hidden"&&e.getAttribute("name")===o)return e}else return e;if(e=Rn(e.nextSibling),e===null)break}return null}function Ug(e,t,n){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=Rn(e.nextSibling),e===null))return null;return e}function Em(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=Rn(e.nextSibling),e===null))return null;return e}function Io(e){return e.data==="$?"||e.data==="$~"}function ec(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function Lg(e,t){var n=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||n.readyState!=="loading")t();else{var l=function(){t(),n.removeEventListener("DOMContentLoaded",l)};n.addEventListener("DOMContentLoaded",l),e._reactRetry=l}}function Rn(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?"||t==="$~"||t==="&"||t==="F!"||t==="F")break;if(t==="/$"||t==="/&")return null}}return e}var tc=null;function _m(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"||n==="/&"){if(t===0)return Rn(e.nextSibling);t--}else n!=="$"&&n!=="$!"&&n!=="$?"&&n!=="$~"&&n!=="&"||t++}e=e.nextSibling}return null}function Tm(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"||n==="$~"||n==="&"){if(t===0)return e;t--}else n!=="/$"&&n!=="/&"||t++}e=e.previousSibling}return null}function wm(e,t,n){switch(t=vs(n),e){case"html":if(e=t.documentElement,!e)throw Error(u(452));return e;case"head":if(e=t.head,!e)throw Error(u(453));return e;case"body":if(e=t.body,!e)throw Error(u(454));return e;default:throw Error(u(451))}}function Ji(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);ct(e)}var xn=new Map,Rm=new Set;function gs(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Ea=X.d;X.d={f:Bg,r:Hg,D:jg,C:qg,L:Yg,m:Qg,X:Gg,S:Vg,M:kg};function Bg(){var e=Ea.f(),t=os();return e||t}function Hg(e){var t=Be(e);t!==null&&t.tag===5&&t.type==="form"?Vd(t):Ea.r(e)}var ai=typeof document>"u"?null:document;function xm(e,t,n){var l=ai;if(l&&typeof t=="string"&&t){var s=gn(t);s='link[rel="'+e+'"][href="'+s+'"]',typeof n=="string"&&(s+='[crossorigin="'+n+'"]'),Rm.has(s)||(Rm.add(s),e={rel:e,crossOrigin:n,href:t},l.querySelector(s)===null&&(t=l.createElement("link"),Lt(t,"link",e),rt(t),l.head.appendChild(t)))}}function jg(e){Ea.D(e),xm("dns-prefetch",e,null)}function qg(e,t){Ea.C(e,t),xm("preconnect",e,t)}function Yg(e,t,n){Ea.L(e,t,n);var l=ai;if(l&&e&&t){var s='link[rel="preload"][as="'+gn(t)+'"]';t==="image"&&n&&n.imageSrcSet?(s+='[imagesrcset="'+gn(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(s+='[imagesizes="'+gn(n.imageSizes)+'"]')):s+='[href="'+gn(e)+'"]';var o=s;switch(t){case"style":o=li(e);break;case"script":o=ii(e)}xn.has(o)||(e=p({rel:"preload",href:t==="image"&&n&&n.imageSrcSet?void 0:e,as:t},n),xn.set(o,e),l.querySelector(s)!==null||t==="style"&&l.querySelector(Fi(o))||t==="script"&&l.querySelector($i(o))||(t=l.createElement("link"),Lt(t,"link",e),rt(t),l.head.appendChild(t)))}}function Qg(e,t){Ea.m(e,t);var n=ai;if(n&&e){var l=t&&typeof t.as=="string"?t.as:"script",s='link[rel="modulepreload"][as="'+gn(l)+'"][href="'+gn(e)+'"]',o=s;switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":o=ii(e)}if(!xn.has(o)&&(e=p({rel:"modulepreload",href:e},t),xn.set(o,e),n.querySelector(s)===null)){switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector($i(o)))return}l=n.createElement("link"),Lt(l,"link",e),rt(l),n.head.appendChild(l)}}}function Vg(e,t,n){Ea.S(e,t,n);var l=ai;if(l&&e){var s=Kt(l).hoistableStyles,o=li(e);t=t||"default";var d=s.get(o);if(!d){var v={loading:0,preload:null};if(d=l.querySelector(Fi(o)))v.loading=5;else{e=p({rel:"stylesheet",href:e,"data-precedence":t},n),(n=xn.get(o))&&nc(e,n);var S=d=l.createElement("link");rt(S),Lt(S,"link",e),S._p=new Promise(function(z,j){S.onload=z,S.onerror=j}),S.addEventListener("load",function(){v.loading|=1}),S.addEventListener("error",function(){v.loading|=2}),v.loading|=4,bs(d,t,l)}d={type:"stylesheet",instance:d,count:1,state:v},s.set(o,d)}}}function Gg(e,t){Ea.X(e,t);var n=ai;if(n&&e){var l=Kt(n).hoistableScripts,s=ii(e),o=l.get(s);o||(o=n.querySelector($i(s)),o||(e=p({src:e,async:!0},t),(t=xn.get(s))&&ac(e,t),o=n.createElement("script"),rt(o),Lt(o,"link",e),n.head.appendChild(o)),o={type:"script",instance:o,count:1,state:null},l.set(s,o))}}function kg(e,t){Ea.M(e,t);var n=ai;if(n&&e){var l=Kt(n).hoistableScripts,s=ii(e),o=l.get(s);o||(o=n.querySelector($i(s)),o||(e=p({src:e,async:!0,type:"module"},t),(t=xn.get(s))&&ac(e,t),o=n.createElement("script"),rt(o),Lt(o,"link",e),n.head.appendChild(o)),o={type:"script",instance:o,count:1,state:null},l.set(s,o))}}function Om(e,t,n,l){var s=(s=ue.current)?gs(s):null;if(!s)throw Error(u(446));switch(e){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(t=li(n.href),n=Kt(s).hoistableStyles,l=n.get(t),l||(l={type:"style",instance:null,count:0,state:null},n.set(t,l)),l):{type:"void",instance:null,count:0,state:null};case"link":if(n.rel==="stylesheet"&&typeof n.href=="string"&&typeof n.precedence=="string"){e=li(n.href);var o=Kt(s).hoistableStyles,d=o.get(e);if(d||(s=s.ownerDocument||s,d={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},o.set(e,d),(o=s.querySelector(Fi(e)))&&!o._p&&(d.instance=o,d.state.loading=5),xn.has(e)||(n={rel:"preload",as:"style",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},xn.set(e,n),o||Xg(s,e,n,d.state))),t&&l===null)throw Error(u(528,""));return d}if(t&&l!==null)throw Error(u(529,""));return null;case"script":return t=n.async,n=n.src,typeof n=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=ii(n),n=Kt(s).hoistableScripts,l=n.get(t),l||(l={type:"script",instance:null,count:0,state:null},n.set(t,l)),l):{type:"void",instance:null,count:0,state:null};default:throw Error(u(444,e))}}function li(e){return'href="'+gn(e)+'"'}function Fi(e){return'link[rel="stylesheet"]['+e+"]"}function Am(e){return p({},e,{"data-precedence":e.precedence,precedence:null})}function Xg(e,t,n,l){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?l.loading=1:(t=e.createElement("link"),l.preload=t,t.addEventListener("load",function(){return l.loading|=1}),t.addEventListener("error",function(){return l.loading|=2}),Lt(t,"link",n),rt(t),e.head.appendChild(t))}function ii(e){return'[src="'+gn(e)+'"]'}function $i(e){return"script[async]"+e}function Mm(e,t,n){if(t.count++,t.instance===null)switch(t.type){case"style":var l=e.querySelector('style[data-href~="'+gn(n.href)+'"]');if(l)return t.instance=l,rt(l),l;var s=p({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return l=(e.ownerDocument||e).createElement("style"),rt(l),Lt(l,"style",s),bs(l,n.precedence,e),t.instance=l;case"stylesheet":s=li(n.href);var o=e.querySelector(Fi(s));if(o)return t.state.loading|=4,t.instance=o,rt(o),o;l=Am(n),(s=xn.get(s))&&nc(l,s),o=(e.ownerDocument||e).createElement("link"),rt(o);var d=o;return d._p=new Promise(function(v,S){d.onload=v,d.onerror=S}),Lt(o,"link",l),t.state.loading|=4,bs(o,n.precedence,e),t.instance=o;case"script":return o=ii(n.src),(s=e.querySelector($i(o)))?(t.instance=s,rt(s),s):(l=n,(s=xn.get(o))&&(l=p({},n),ac(l,s)),e=e.ownerDocument||e,s=e.createElement("script"),rt(s),Lt(s,"link",l),e.head.appendChild(s),t.instance=s);case"void":return null;default:throw Error(u(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(l=t.instance,t.state.loading|=4,bs(l,n.precedence,e));return t.instance}function bs(e,t,n){for(var l=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),s=l.length?l[l.length-1]:null,o=s,d=0;d<l.length;d++){var v=l[d];if(v.dataset.precedence===t)o=v;else if(o!==s)break}o?o.parentNode.insertBefore(e,o.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function nc(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function ac(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var Ss=null;function Dm(e,t,n){if(Ss===null){var l=new Map,s=Ss=new Map;s.set(n,l)}else s=Ss,l=s.get(n),l||(l=new Map,s.set(n,l));if(l.has(e))return l;for(l.set(e,null),n=n.getElementsByTagName(e),s=0;s<n.length;s++){var o=n[s];if(!(o[ot]||o[ee]||e==="link"&&o.getAttribute("rel")==="stylesheet")&&o.namespaceURI!=="http://www.w3.org/2000/svg"){var d=o.getAttribute(t)||"";d=e+d;var v=l.get(d);v?v.push(o):l.set(d,[o])}}return l}function Cm(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t==="title"?e.querySelector("head > title"):null)}function Kg(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;return t.rel==="stylesheet"?(e=t.disabled,typeof t.precedence=="string"&&e==null):!0;case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function zm(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function Zg(e,t,n,l){if(n.type==="stylesheet"&&(typeof l.media!="string"||matchMedia(l.media).matches!==!1)&&(n.state.loading&4)===0){if(n.instance===null){var s=li(l.href),o=t.querySelector(Fi(s));if(o){t=o._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=Es.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=o,rt(o);return}o=t.ownerDocument||t,l=Am(l),(s=xn.get(s))&&nc(l,s),o=o.createElement("link"),rt(o);var d=o;d._p=new Promise(function(v,S){d.onload=v,d.onerror=S}),Lt(o,"link",l),n.instance=o}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&(n.state.loading&3)===0&&(e.count++,n=Es.bind(e),t.addEventListener("load",n),t.addEventListener("error",n))}}var lc=0;function Jg(e,t){return e.stylesheets&&e.count===0&&Ts(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var l=setTimeout(function(){if(e.stylesheets&&Ts(e,e.stylesheets),e.unsuspend){var o=e.unsuspend;e.unsuspend=null,o()}},6e4+t);0<e.imgBytes&&lc===0&&(lc=62500*Ag());var s=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Ts(e,e.stylesheets),e.unsuspend)){var o=e.unsuspend;e.unsuspend=null,o()}},(e.imgBytes>lc?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(l),clearTimeout(s)}}:null}function Es(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Ts(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var _s=null;function Ts(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,_s=new Map,t.forEach(Fg,e),_s=null,Es.call(e))}function Fg(e,t){if(!(t.state.loading&4)){var n=_s.get(e);if(n)var l=n.get(null);else{n=new Map,_s.set(e,n);for(var s=e.querySelectorAll("link[data-precedence],style[data-precedence]"),o=0;o<s.length;o++){var d=s[o];(d.nodeName==="LINK"||d.getAttribute("media")!=="not all")&&(n.set(d.dataset.precedence,d),l=d)}l&&n.set(null,l)}s=t.instance,d=s.getAttribute("data-precedence"),o=n.get(d)||l,o===l&&n.set(null,s),n.set(d,s),this.count++,l=Es.bind(this),s.addEventListener("load",l),s.addEventListener("error",l),o?o.parentNode.insertBefore(s,o.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(s,e.firstChild)),t.state.loading|=4}}var Pi={$$typeof:W,Provider:null,Consumer:null,_currentValue:F,_currentValue2:F,_threadCount:0};function $g(e,t,n,l,s,o,d,v,S){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=tn(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=tn(0),this.hiddenUpdates=tn(null),this.identifierPrefix=l,this.onUncaughtError=s,this.onCaughtError=o,this.onRecoverableError=d,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=S,this.incompleteTransitions=new Map}function Nm(e,t,n,l,s,o,d,v,S,z,j,Q){return e=new $g(e,t,n,d,S,z,j,Q,v),t=1,o===!0&&(t|=24),o=ln(3,null,null,t),e.current=o,o.stateNode=e,t=Bu(),t.refCount++,e.pooledCache=t,t.refCount++,o.memoizedState={element:l,isDehydrated:n,cache:t},Yu(o),e}function Um(e){return e?(e=Bl,e):Bl}function Lm(e,t,n,l,s,o){s=Um(s),l.context===null?l.context=s:l.pendingContext=s,l=Da(t),l.payload={element:n},o=o===void 0?null:o,o!==null&&(l.callback=o),n=Ca(e,l,t),n!==null&&(Wt(n,e,t),Mi(n,e,t))}function Bm(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function ic(e,t){Bm(e,t),(e=e.alternate)&&Bm(e,t)}function Hm(e){if(e.tag===13||e.tag===31){var t=cl(e,67108864);t!==null&&Wt(t,e,67108864),ic(e,67108864)}}function jm(e){if(e.tag===13||e.tag===31){var t=cn();t=U(t);var n=cl(e,t);n!==null&&Wt(n,e,t),ic(e,t)}}var ws=!0;function Pg(e,t,n,l){var s=O.T;O.T=null;var o=X.p;try{X.p=2,rc(e,t,n,l)}finally{X.p=o,O.T=s}}function Wg(e,t,n,l){var s=O.T;O.T=null;var o=X.p;try{X.p=8,rc(e,t,n,l)}finally{X.p=o,O.T=s}}function rc(e,t,n,l){if(ws){var s=sc(l);if(s===null)Ko(e,t,l,Rs,n),Ym(e,l);else if(e0(s,e,t,n,l))l.stopPropagation();else if(Ym(e,l),t&4&&-1<Ig.indexOf(e)){for(;s!==null;){var o=Be(s);if(o!==null)switch(o.tag){case 3:if(o=o.stateNode,o.current.memoizedState.isDehydrated){var d=pn(o.pendingLanes);if(d!==0){var v=o;for(v.pendingLanes|=2,v.entangledLanes|=2;d;){var S=1<<31-Rt(d);v.entanglements[1]|=S,d&=~S}Jn(o),(Xe&6)===0&&(ss=ut()+500,Xi(0))}}break;case 31:case 13:v=cl(o,2),v!==null&&Wt(v,o,2),os(),ic(o,2)}if(o=sc(l),o===null&&Ko(e,t,l,Rs,n),o===s)break;s=o}s!==null&&l.stopPropagation()}else Ko(e,t,l,null,n)}}function sc(e){return e=uu(e),uc(e)}var Rs=null;function uc(e){if(Rs=null,e=ft(e),e!==null){var t=f(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=h(t),e!==null)return e;e=null}else if(n===31){if(e=m(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Rs=e,null}function qm(e){switch(e){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(ea()){case kn:return 2;case Ta:return 8;case Dt:case Yt:return 32;case mn:return 268435456;default:return 32}default:return 32}}var oc=!1,Va=null,Ga=null,ka=null,Wi=new Map,Ii=new Map,Xa=[],Ig="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function Ym(e,t){switch(e){case"focusin":case"focusout":Va=null;break;case"dragenter":case"dragleave":Ga=null;break;case"mouseover":case"mouseout":ka=null;break;case"pointerover":case"pointerout":Wi.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ii.delete(t.pointerId)}}function er(e,t,n,l,s,o){return e===null||e.nativeEvent!==o?(e={blockedOn:t,domEventName:n,eventSystemFlags:l,nativeEvent:o,targetContainers:[s]},t!==null&&(t=Be(t),t!==null&&Hm(t)),e):(e.eventSystemFlags|=l,t=e.targetContainers,s!==null&&t.indexOf(s)===-1&&t.push(s),e)}function e0(e,t,n,l,s){switch(t){case"focusin":return Va=er(Va,e,t,n,l,s),!0;case"dragenter":return Ga=er(Ga,e,t,n,l,s),!0;case"mouseover":return ka=er(ka,e,t,n,l,s),!0;case"pointerover":var o=s.pointerId;return Wi.set(o,er(Wi.get(o)||null,e,t,n,l,s)),!0;case"gotpointercapture":return o=s.pointerId,Ii.set(o,er(Ii.get(o)||null,e,t,n,l,s)),!0}return!1}function Qm(e){var t=ft(e.target);if(t!==null){var n=f(t);if(n!==null){if(t=n.tag,t===13){if(t=h(n),t!==null){e.blockedOn=t,se(e.priority,function(){jm(n)});return}}else if(t===31){if(t=m(n),t!==null){e.blockedOn=t,se(e.priority,function(){jm(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function xs(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=sc(e.nativeEvent);if(n===null){n=e.nativeEvent;var l=new n.constructor(n.type,n);su=l,n.target.dispatchEvent(l),su=null}else return t=Be(n),t!==null&&Hm(t),e.blockedOn=n,!1;t.shift()}return!0}function Vm(e,t,n){xs(e)&&n.delete(t)}function t0(){oc=!1,Va!==null&&xs(Va)&&(Va=null),Ga!==null&&xs(Ga)&&(Ga=null),ka!==null&&xs(ka)&&(ka=null),Wi.forEach(Vm),Ii.forEach(Vm)}function Os(e,t){e.blockedOn===t&&(e.blockedOn=null,oc||(oc=!0,a.unstable_scheduleCallback(a.unstable_NormalPriority,t0)))}var As=null;function Gm(e){As!==e&&(As=e,a.unstable_scheduleCallback(a.unstable_NormalPriority,function(){As===e&&(As=null);for(var t=0;t<e.length;t+=3){var n=e[t],l=e[t+1],s=e[t+2];if(typeof l!="function"){if(uc(l||n)===null)continue;break}var o=Be(n);o!==null&&(e.splice(t,3),t-=3,ro(o,{pending:!0,data:s,method:n.method,action:l},l,s))}}))}function ri(e){function t(S){return Os(S,e)}Va!==null&&Os(Va,e),Ga!==null&&Os(Ga,e),ka!==null&&Os(ka,e),Wi.forEach(t),Ii.forEach(t);for(var n=0;n<Xa.length;n++){var l=Xa[n];l.blockedOn===e&&(l.blockedOn=null)}for(;0<Xa.length&&(n=Xa[0],n.blockedOn===null);)Qm(n),n.blockedOn===null&&Xa.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(l=0;l<n.length;l+=3){var s=n[l],o=n[l+1],d=s[ne]||null;if(typeof o=="function")d||Gm(n);else if(d){var v=null;if(o&&o.hasAttribute("formAction")){if(s=o,d=o[ne]||null)v=d.formAction;else if(uc(s)!==null)continue}else v=d.action;typeof v=="function"?n[l+1]=v:(n.splice(l,3),l-=3),Gm(n)}}}function km(){function e(o){o.canIntercept&&o.info==="react-transition"&&o.intercept({handler:function(){return new Promise(function(d){return s=d})},focusReset:"manual",scroll:"manual"})}function t(){s!==null&&(s(),s=null),l||setTimeout(n,20)}function n(){if(!l&&!navigation.transition){var o=navigation.currentEntry;o&&o.url!=null&&navigation.navigate(o.url,{state:o.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var l=!1,s=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(n,100),function(){l=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),s!==null&&(s(),s=null)}}}function cc(e){this._internalRoot=e}Ms.prototype.render=cc.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(u(409));var n=t.current,l=cn();Lm(n,l,e,t,null,null)},Ms.prototype.unmount=cc.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Lm(e.current,2,null,e,null,null),os(),t[re]=null}};function Ms(e){this._internalRoot=e}Ms.prototype.unstable_scheduleHydration=function(e){if(e){var t=$();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Xa.length&&t!==0&&t<Xa[n].priority;n++);Xa.splice(n,0,e),n===0&&Qm(e)}};var Xm=i.version;if(Xm!=="19.2.4")throw Error(u(527,Xm,"19.2.4"));X.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(u(188)):(e=Object.keys(e).join(","),Error(u(268,e)));return e=y(t),e=e!==null?E(e):null,e=e===null?null:e.stateNode,e};var n0={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:O,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Ds=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Ds.isDisabled&&Ds.supportsFiber)try{ta=Ds.inject(n0),at=Ds}catch{}}return nr.createRoot=function(e,t){if(!c(e))throw Error(u(299));var n=!1,l="",s=Wd,o=Id,d=eh;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(l=t.identifierPrefix),t.onUncaughtError!==void 0&&(s=t.onUncaughtError),t.onCaughtError!==void 0&&(o=t.onCaughtError),t.onRecoverableError!==void 0&&(d=t.onRecoverableError)),t=Nm(e,1,!1,null,null,n,l,null,s,o,d,km),e[re]=t.current,Xo(e),new cc(t)},nr.hydrateRoot=function(e,t,n){if(!c(e))throw Error(u(299));var l=!1,s="",o=Wd,d=Id,v=eh,S=null;return n!=null&&(n.unstable_strictMode===!0&&(l=!0),n.identifierPrefix!==void 0&&(s=n.identifierPrefix),n.onUncaughtError!==void 0&&(o=n.onUncaughtError),n.onCaughtError!==void 0&&(d=n.onCaughtError),n.onRecoverableError!==void 0&&(v=n.onRecoverableError),n.formState!==void 0&&(S=n.formState)),t=Nm(e,1,!0,t,n??null,l,s,S,o,d,v,km),t.context=Um(null),n=t.current,l=cn(),l=U(l),s=Da(l),s.callback=null,Ca(n,s,l),n=l,t.current.lanes=n,nt(t,n),Jn(t),e[re]=t.current,Xo(e),new Ms(t)},nr.version="19.2.4",nr}var ty;function h0(){if(ty)return hc.exports;ty=1;function a(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(a)}catch(i){console.error(i)}}return a(),hc.exports=d0(),hc.exports}var m0=h0(),Fs=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(a){return this.listeners.add(a),this.onSubscribe(),()=>{this.listeners.delete(a),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},y0={setTimeout:(a,i)=>setTimeout(a,i),clearTimeout:a=>clearTimeout(a),setInterval:(a,i)=>setInterval(a,i),clearInterval:a=>clearInterval(a)},p0=class{#e=y0;#n=!1;setTimeoutProvider(a){this.#e=a}setTimeout(a,i){return this.#e.setTimeout(a,i)}clearTimeout(a){this.#e.clearTimeout(a)}setInterval(a,i){return this.#e.setInterval(a,i)}clearInterval(a){this.#e.clearInterval(a)}},xc=new p0;function v0(a){setTimeout(a,0)}var $s=typeof window>"u"||"Deno"in globalThis;function Yn(){}function g0(a,i){return typeof a=="function"?a(i):a}function b0(a){return typeof a=="number"&&a>=0&&a!==1/0}function S0(a,i){return Math.max(a+(i||0)-Date.now(),0)}function Oc(a,i){return typeof a=="function"?a(i):a}function E0(a,i){return typeof a=="function"?a(i):a}function ny(a,i){const{type:r="all",exact:u,fetchStatus:c,predicate:f,queryKey:h,stale:m}=a;if(h){if(u){if(i.queryHash!==Gc(h,i.options))return!1}else if(!dr(i.queryKey,h))return!1}if(r!=="all"){const g=i.isActive();if(r==="active"&&!g||r==="inactive"&&g)return!1}return!(typeof m=="boolean"&&i.isStale()!==m||c&&c!==i.state.fetchStatus||f&&!f(i))}function ay(a,i){const{exact:r,status:u,predicate:c,mutationKey:f}=a;if(f){if(!i.options.mutationKey)return!1;if(r){if(fr(i.options.mutationKey)!==fr(f))return!1}else if(!dr(i.options.mutationKey,f))return!1}return!(u&&i.state.status!==u||c&&!c(i))}function Gc(a,i){return(i?.queryKeyHashFn||fr)(a)}function fr(a){return JSON.stringify(a,(i,r)=>Ac(r)?Object.keys(r).sort().reduce((u,c)=>(u[c]=r[c],u),{}):r)}function dr(a,i){return a===i?!0:typeof a!=typeof i?!1:a&&i&&typeof a=="object"&&typeof i=="object"?Object.keys(i).every(r=>dr(a[r],i[r])):!1}var _0=Object.prototype.hasOwnProperty;function Fy(a,i,r=0){if(a===i)return a;if(r>500)return i;const u=ly(a)&&ly(i);if(!u&&!(Ac(a)&&Ac(i)))return i;const f=(u?a:Object.keys(a)).length,h=u?i:Object.keys(i),m=h.length,g=u?new Array(m):{};let y=0;for(let E=0;E<m;E++){const p=u?E:h[E],R=a[p],D=i[p];if(R===D){g[p]=R,(u?E<f:_0.call(a,p))&&y++;continue}if(R===null||D===null||typeof R!="object"||typeof D!="object"){g[p]=D;continue}const H=Fy(R,D,r+1);g[p]=H,H===R&&y++}return f===m&&y===f?a:g}function h2(a,i){if(!i||Object.keys(a).length!==Object.keys(i).length)return!1;for(const r in a)if(a[r]!==i[r])return!1;return!0}function ly(a){return Array.isArray(a)&&a.length===Object.keys(a).length}function Ac(a){if(!iy(a))return!1;const i=a.constructor;if(i===void 0)return!0;const r=i.prototype;return!(!iy(r)||!r.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(a)!==Object.prototype)}function iy(a){return Object.prototype.toString.call(a)==="[object Object]"}function T0(a){return new Promise(i=>{xc.setTimeout(i,a)})}function w0(a,i,r){return typeof r.structuralSharing=="function"?r.structuralSharing(a,i):r.structuralSharing!==!1?Fy(a,i):i}function R0(a,i,r=0){const u=[...a,i];return r&&u.length>r?u.slice(1):u}function x0(a,i,r=0){const u=[i,...a];return r&&u.length>r?u.slice(0,-1):u}var kc=Symbol();function $y(a,i){return!a.queryFn&&i?.initialPromise?()=>i.initialPromise:!a.queryFn||a.queryFn===kc?()=>Promise.reject(new Error(`Missing queryFn: '${a.queryHash}'`)):a.queryFn}function m2(a,i){return typeof a=="function"?a(...i):!!a}function O0(a,i,r){let u=!1,c;return Object.defineProperty(a,"signal",{enumerable:!0,get:()=>(c??=i(),u||(u=!0,c.aborted?r():c.addEventListener("abort",r,{once:!0})),c)}),a}var A0=class extends Fs{#e;#n;#t;constructor(){super(),this.#t=a=>{if(!$s&&window.addEventListener){const i=()=>a();return window.addEventListener("visibilitychange",i,!1),()=>{window.removeEventListener("visibilitychange",i)}}}}onSubscribe(){this.#n||this.setEventListener(this.#t)}onUnsubscribe(){this.hasListeners()||(this.#n?.(),this.#n=void 0)}setEventListener(a){this.#t=a,this.#n?.(),this.#n=a(i=>{typeof i=="boolean"?this.setFocused(i):this.onFocus()})}setFocused(a){this.#e!==a&&(this.#e=a,this.onFocus())}onFocus(){const a=this.isFocused();this.listeners.forEach(i=>{i(a)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}},Py=new A0;function M0(){let a,i;const r=new Promise((c,f)=>{a=c,i=f});r.status="pending",r.catch(()=>{});function u(c){Object.assign(r,c),delete r.resolve,delete r.reject}return r.resolve=c=>{u({status:"fulfilled",value:c}),a(c)},r.reject=c=>{u({status:"rejected",reason:c}),i(c)},r}var D0=v0;function C0(){let a=[],i=0,r=m=>{m()},u=m=>{m()},c=D0;const f=m=>{i?a.push(m):c(()=>{r(m)})},h=()=>{const m=a;a=[],m.length&&c(()=>{u(()=>{m.forEach(g=>{r(g)})})})};return{batch:m=>{let g;i++;try{g=m()}finally{i--,i||h()}return g},batchCalls:m=>(...g)=>{f(()=>{m(...g)})},schedule:f,setNotifyFunction:m=>{r=m},setBatchNotifyFunction:m=>{u=m},setScheduler:m=>{c=m}}}var Vt=C0(),z0=class extends Fs{#e=!0;#n;#t;constructor(){super(),this.#t=a=>{if(!$s&&window.addEventListener){const i=()=>a(!0),r=()=>a(!1);return window.addEventListener("online",i,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",i),window.removeEventListener("offline",r)}}}}onSubscribe(){this.#n||this.setEventListener(this.#t)}onUnsubscribe(){this.hasListeners()||(this.#n?.(),this.#n=void 0)}setEventListener(a){this.#t=a,this.#n?.(),this.#n=a(this.setOnline.bind(this))}setOnline(a){this.#e!==a&&(this.#e=a,this.listeners.forEach(r=>{r(a)}))}isOnline(){return this.#e}},Zs=new z0;function N0(a){return Math.min(1e3*2**a,3e4)}function Wy(a){return(a??"online")==="online"?Zs.isOnline():!0}var Mc=class extends Error{constructor(a){super("CancelledError"),this.revert=a?.revert,this.silent=a?.silent}};function Iy(a){let i=!1,r=0,u;const c=M0(),f=()=>c.status!=="pending",h=V=>{if(!f()){const K=new Mc(V);R(K),a.onCancel?.(K)}},m=()=>{i=!0},g=()=>{i=!1},y=()=>Py.isFocused()&&(a.networkMode==="always"||Zs.isOnline())&&a.canRun(),E=()=>Wy(a.networkMode)&&a.canRun(),p=V=>{f()||(u?.(),c.resolve(V))},R=V=>{f()||(u?.(),c.reject(V))},D=()=>new Promise(V=>{u=K=>{(f()||y())&&V(K)},a.onPause?.()}).then(()=>{u=void 0,f()||a.onContinue?.()}),H=()=>{if(f())return;let V;const K=r===0?a.initialPromise:void 0;try{V=K??a.fn()}catch(G){V=Promise.reject(G)}Promise.resolve(V).then(p).catch(G=>{if(f())return;const Z=a.retry??($s?0:3),W=a.retryDelay??N0,be=typeof W=="function"?W(r,G):W,ve=Z===!0||typeof Z=="number"&&r<Z||typeof Z=="function"&&Z(r,G);if(i||!ve){R(G);return}r++,a.onFail?.(r,G),T0(be).then(()=>y()?void 0:D()).then(()=>{i?R(G):H()})})};return{promise:c,status:()=>c.status,cancel:h,continue:()=>(u?.(),c),cancelRetry:m,continueRetry:g,canStart:E,start:()=>(E()?H():D().then(H),c)}}var ep=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),b0(this.gcTime)&&(this.#e=xc.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(a){this.gcTime=Math.max(this.gcTime||0,a??($s?1/0:300*1e3))}clearGcTimeout(){this.#e&&(xc.clearTimeout(this.#e),this.#e=void 0)}},U0=class extends ep{#e;#n;#t;#l;#a;#r;#s;constructor(a){super(),this.#s=!1,this.#r=a.defaultOptions,this.setOptions(a.options),this.observers=[],this.#l=a.client,this.#t=this.#l.getQueryCache(),this.queryKey=a.queryKey,this.queryHash=a.queryHash,this.#e=sy(this.options),this.state=a.state??this.#e,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#a?.promise}setOptions(a){if(this.options={...this.#r,...a},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const i=sy(this.options);i.data!==void 0&&(this.setState(ry(i.data,i.dataUpdatedAt)),this.#e=i)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#t.remove(this)}setData(a,i){const r=w0(this.state.data,a,this.options);return this.#i({data:r,type:"success",dataUpdatedAt:i?.updatedAt,manual:i?.manual}),r}setState(a,i){this.#i({type:"setState",state:a,setStateOptions:i})}cancel(a){const i=this.#a?.promise;return this.#a?.cancel(a),i?i.then(Yn).catch(Yn):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#e)}isActive(){return this.observers.some(a=>E0(a.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===kc||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(a=>Oc(a.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(a=>a.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(a=0){return this.state.data===void 0?!0:a==="static"?!1:this.state.isInvalidated?!0:!S0(this.state.dataUpdatedAt,a)}onFocus(){this.observers.find(i=>i.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#a?.continue()}onOnline(){this.observers.find(i=>i.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#a?.continue()}addObserver(a){this.observers.includes(a)||(this.observers.push(a),this.clearGcTimeout(),this.#t.notify({type:"observerAdded",query:this,observer:a}))}removeObserver(a){this.observers.includes(a)&&(this.observers=this.observers.filter(i=>i!==a),this.observers.length||(this.#a&&(this.#s?this.#a.cancel({revert:!0}):this.#a.cancelRetry()),this.scheduleGc()),this.#t.notify({type:"observerRemoved",query:this,observer:a}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#i({type:"invalidate"})}async fetch(a,i){if(this.state.fetchStatus!=="idle"&&this.#a?.status()!=="rejected"){if(this.state.data!==void 0&&i?.cancelRefetch)this.cancel({silent:!0});else if(this.#a)return this.#a.continueRetry(),this.#a.promise}if(a&&this.setOptions(a),!this.options.queryFn){const m=this.observers.find(g=>g.options.queryFn);m&&this.setOptions(m.options)}const r=new AbortController,u=m=>{Object.defineProperty(m,"signal",{enumerable:!0,get:()=>(this.#s=!0,r.signal)})},c=()=>{const m=$y(this.options,i),y=(()=>{const E={client:this.#l,queryKey:this.queryKey,meta:this.meta};return u(E),E})();return this.#s=!1,this.options.persister?this.options.persister(m,y,this):m(y)},h=(()=>{const m={fetchOptions:i,options:this.options,queryKey:this.queryKey,client:this.#l,state:this.state,fetchFn:c};return u(m),m})();this.options.behavior?.onFetch(h,this),this.#n=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==h.fetchOptions?.meta)&&this.#i({type:"fetch",meta:h.fetchOptions?.meta}),this.#a=Iy({initialPromise:i?.initialPromise,fn:h.fetchFn,onCancel:m=>{m instanceof Mc&&m.revert&&this.setState({...this.#n,fetchStatus:"idle"}),r.abort()},onFail:(m,g)=>{this.#i({type:"failed",failureCount:m,error:g})},onPause:()=>{this.#i({type:"pause"})},onContinue:()=>{this.#i({type:"continue"})},retry:h.options.retry,retryDelay:h.options.retryDelay,networkMode:h.options.networkMode,canRun:()=>!0});try{const m=await this.#a.start();if(m===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(m),this.#t.config.onSuccess?.(m,this),this.#t.config.onSettled?.(m,this.state.error,this),m}catch(m){if(m instanceof Mc){if(m.silent)return this.#a.promise;if(m.revert){if(this.state.data===void 0)throw m;return this.state.data}}throw this.#i({type:"error",error:m}),this.#t.config.onError?.(m,this),this.#t.config.onSettled?.(this.state.data,m,this),m}finally{this.scheduleGc()}}#i(a){const i=r=>{switch(a.type){case"failed":return{...r,fetchFailureCount:a.failureCount,fetchFailureReason:a.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...L0(r.data,this.options),fetchMeta:a.meta??null};case"success":const u={...r,...ry(a.data,a.dataUpdatedAt),dataUpdateCount:r.dataUpdateCount+1,...!a.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#n=a.manual?u:void 0,u;case"error":const c=a.error;return{...r,error:c,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:c,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...a.state}}};this.state=i(this.state),Vt.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),this.#t.notify({query:this,type:"updated",action:a})})}};function L0(a,i){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Wy(i.networkMode)?"fetching":"paused",...a===void 0&&{error:null,status:"pending"}}}function ry(a,i){return{data:a,dataUpdatedAt:i??Date.now(),error:null,isInvalidated:!1,status:"success"}}function sy(a){const i=typeof a.initialData=="function"?a.initialData():a.initialData,r=i!==void 0,u=r?typeof a.initialDataUpdatedAt=="function"?a.initialDataUpdatedAt():a.initialDataUpdatedAt:0;return{data:i,dataUpdateCount:0,dataUpdatedAt:r?u??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}function uy(a){return{onFetch:(i,r)=>{const u=i.options,c=i.fetchOptions?.meta?.fetchMore?.direction,f=i.state.data?.pages||[],h=i.state.data?.pageParams||[];let m={pages:[],pageParams:[]},g=0;const y=async()=>{let E=!1;const p=H=>{O0(H,()=>i.signal,()=>E=!0)},R=$y(i.options,i.fetchOptions),D=async(H,V,K)=>{if(E)return Promise.reject();if(V==null&&H.pages.length)return Promise.resolve(H);const Z=(()=>{const pe={client:i.client,queryKey:i.queryKey,pageParam:V,direction:K?"backward":"forward",meta:i.options.meta};return p(pe),pe})(),W=await R(Z),{maxPages:be}=i.options,ve=K?x0:R0;return{pages:ve(H.pages,W,be),pageParams:ve(H.pageParams,V,be)}};if(c&&f.length){const H=c==="backward",V=H?tp:Dc,K={pages:f,pageParams:h},G=V(u,K);m=await D(K,G,H)}else{const H=a??f.length;do{const V=g===0?h[0]??u.initialPageParam:Dc(u,m);if(g>0&&V==null)break;m=await D(m,V),g++}while(g<H)}return m};i.options.persister?i.fetchFn=()=>i.options.persister?.(y,{client:i.client,queryKey:i.queryKey,meta:i.options.meta,signal:i.signal},r):i.fetchFn=y}}}function Dc(a,{pages:i,pageParams:r}){const u=i.length-1;return i.length>0?a.getNextPageParam(i[u],i,r[u],r):void 0}function tp(a,{pages:i,pageParams:r}){return i.length>0?a.getPreviousPageParam?.(i[0],i,r[0],r):void 0}function y2(a,i){return i?Dc(a,i)!=null:!1}function p2(a,i){return!i||!a.getPreviousPageParam?!1:tp(a,i)!=null}var B0=class extends ep{#e;#n;#t;#l;constructor(a){super(),this.#e=a.client,this.mutationId=a.mutationId,this.#t=a.mutationCache,this.#n=[],this.state=a.state||H0(),this.setOptions(a.options),this.scheduleGc()}setOptions(a){this.options=a,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(a){this.#n.includes(a)||(this.#n.push(a),this.clearGcTimeout(),this.#t.notify({type:"observerAdded",mutation:this,observer:a}))}removeObserver(a){this.#n=this.#n.filter(i=>i!==a),this.scheduleGc(),this.#t.notify({type:"observerRemoved",mutation:this,observer:a})}optionalRemove(){this.#n.length||(this.state.status==="pending"?this.scheduleGc():this.#t.remove(this))}continue(){return this.#l?.continue()??this.execute(this.state.variables)}async execute(a){const i=()=>{this.#a({type:"continue"})},r={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#l=Iy({fn:()=>this.options.mutationFn?this.options.mutationFn(a,r):Promise.reject(new Error("No mutationFn found")),onFail:(f,h)=>{this.#a({type:"failed",failureCount:f,error:h})},onPause:()=>{this.#a({type:"pause"})},onContinue:i,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#t.canRun(this)});const u=this.state.status==="pending",c=!this.#l.canStart();try{if(u)i();else{this.#a({type:"pending",variables:a,isPaused:c}),this.#t.config.onMutate&&await this.#t.config.onMutate(a,this,r);const h=await this.options.onMutate?.(a,r);h!==this.state.context&&this.#a({type:"pending",context:h,variables:a,isPaused:c})}const f=await this.#l.start();return await this.#t.config.onSuccess?.(f,a,this.state.context,this,r),await this.options.onSuccess?.(f,a,this.state.context,r),await this.#t.config.onSettled?.(f,null,this.state.variables,this.state.context,this,r),await this.options.onSettled?.(f,null,a,this.state.context,r),this.#a({type:"success",data:f}),f}catch(f){try{await this.#t.config.onError?.(f,a,this.state.context,this,r)}catch(h){Promise.reject(h)}try{await this.options.onError?.(f,a,this.state.context,r)}catch(h){Promise.reject(h)}try{await this.#t.config.onSettled?.(void 0,f,this.state.variables,this.state.context,this,r)}catch(h){Promise.reject(h)}try{await this.options.onSettled?.(void 0,f,a,this.state.context,r)}catch(h){Promise.reject(h)}throw this.#a({type:"error",error:f}),f}finally{this.#t.runNext(this)}}#a(a){const i=r=>{switch(a.type){case"failed":return{...r,failureCount:a.failureCount,failureReason:a.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:a.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:a.isPaused,status:"pending",variables:a.variables,submittedAt:Date.now()};case"success":return{...r,data:a.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:a.error,failureCount:r.failureCount+1,failureReason:a.error,isPaused:!1,status:"error"}}};this.state=i(this.state),Vt.batch(()=>{this.#n.forEach(r=>{r.onMutationUpdate(a)}),this.#t.notify({mutation:this,type:"updated",action:a})})}};function H0(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var j0=class extends Fs{constructor(a={}){super(),this.config=a,this.#e=new Set,this.#n=new Map,this.#t=0}#e;#n;#t;build(a,i,r){const u=new B0({client:a,mutationCache:this,mutationId:++this.#t,options:a.defaultMutationOptions(i),state:r});return this.add(u),u}add(a){this.#e.add(a);const i=Cs(a);if(typeof i=="string"){const r=this.#n.get(i);r?r.push(a):this.#n.set(i,[a])}this.notify({type:"added",mutation:a})}remove(a){if(this.#e.delete(a)){const i=Cs(a);if(typeof i=="string"){const r=this.#n.get(i);if(r)if(r.length>1){const u=r.indexOf(a);u!==-1&&r.splice(u,1)}else r[0]===a&&this.#n.delete(i)}}this.notify({type:"removed",mutation:a})}canRun(a){const i=Cs(a);if(typeof i=="string"){const u=this.#n.get(i)?.find(c=>c.state.status==="pending");return!u||u===a}else return!0}runNext(a){const i=Cs(a);return typeof i=="string"?this.#n.get(i)?.find(u=>u!==a&&u.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){Vt.batch(()=>{this.#e.forEach(a=>{this.notify({type:"removed",mutation:a})}),this.#e.clear(),this.#n.clear()})}getAll(){return Array.from(this.#e)}find(a){const i={exact:!0,...a};return this.getAll().find(r=>ay(i,r))}findAll(a={}){return this.getAll().filter(i=>ay(a,i))}notify(a){Vt.batch(()=>{this.listeners.forEach(i=>{i(a)})})}resumePausedMutations(){const a=this.getAll().filter(i=>i.state.isPaused);return Vt.batch(()=>Promise.all(a.map(i=>i.continue().catch(Yn))))}};function Cs(a){return a.options.scope?.id}var q0=class extends Fs{constructor(a={}){super(),this.config=a,this.#e=new Map}#e;build(a,i,r){const u=i.queryKey,c=i.queryHash??Gc(u,i);let f=this.get(c);return f||(f=new U0({client:a,queryKey:u,queryHash:c,options:a.defaultQueryOptions(i),state:r,defaultOptions:a.getQueryDefaults(u)}),this.add(f)),f}add(a){this.#e.has(a.queryHash)||(this.#e.set(a.queryHash,a),this.notify({type:"added",query:a}))}remove(a){const i=this.#e.get(a.queryHash);i&&(a.destroy(),i===a&&this.#e.delete(a.queryHash),this.notify({type:"removed",query:a}))}clear(){Vt.batch(()=>{this.getAll().forEach(a=>{this.remove(a)})})}get(a){return this.#e.get(a)}getAll(){return[...this.#e.values()]}find(a){const i={exact:!0,...a};return this.getAll().find(r=>ny(i,r))}findAll(a={}){const i=this.getAll();return Object.keys(a).length>0?i.filter(r=>ny(a,r)):i}notify(a){Vt.batch(()=>{this.listeners.forEach(i=>{i(a)})})}onFocus(){Vt.batch(()=>{this.getAll().forEach(a=>{a.onFocus()})})}onOnline(){Vt.batch(()=>{this.getAll().forEach(a=>{a.onOnline()})})}},Y0=class{#e;#n;#t;#l;#a;#r;#s;#i;constructor(a={}){this.#e=a.queryCache||new q0,this.#n=a.mutationCache||new j0,this.#t=a.defaultOptions||{},this.#l=new Map,this.#a=new Map,this.#r=0}mount(){this.#r++,this.#r===1&&(this.#s=Py.subscribe(async a=>{a&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#i=Zs.subscribe(async a=>{a&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#r--,this.#r===0&&(this.#s?.(),this.#s=void 0,this.#i?.(),this.#i=void 0)}isFetching(a){return this.#e.findAll({...a,fetchStatus:"fetching"}).length}isMutating(a){return this.#n.findAll({...a,status:"pending"}).length}getQueryData(a){const i=this.defaultQueryOptions({queryKey:a});return this.#e.get(i.queryHash)?.state.data}ensureQueryData(a){const i=this.defaultQueryOptions(a),r=this.#e.build(this,i),u=r.state.data;return u===void 0?this.fetchQuery(a):(a.revalidateIfStale&&r.isStaleByTime(Oc(i.staleTime,r))&&this.prefetchQuery(i),Promise.resolve(u))}getQueriesData(a){return this.#e.findAll(a).map(({queryKey:i,state:r})=>{const u=r.data;return[i,u]})}setQueryData(a,i,r){const u=this.defaultQueryOptions({queryKey:a}),f=this.#e.get(u.queryHash)?.state.data,h=g0(i,f);if(h!==void 0)return this.#e.build(this,u).setData(h,{...r,manual:!0})}setQueriesData(a,i,r){return Vt.batch(()=>this.#e.findAll(a).map(({queryKey:u})=>[u,this.setQueryData(u,i,r)]))}getQueryState(a){const i=this.defaultQueryOptions({queryKey:a});return this.#e.get(i.queryHash)?.state}removeQueries(a){const i=this.#e;Vt.batch(()=>{i.findAll(a).forEach(r=>{i.remove(r)})})}resetQueries(a,i){const r=this.#e;return Vt.batch(()=>(r.findAll(a).forEach(u=>{u.reset()}),this.refetchQueries({type:"active",...a},i)))}cancelQueries(a,i={}){const r={revert:!0,...i},u=Vt.batch(()=>this.#e.findAll(a).map(c=>c.cancel(r)));return Promise.all(u).then(Yn).catch(Yn)}invalidateQueries(a,i={}){return Vt.batch(()=>(this.#e.findAll(a).forEach(r=>{r.invalidate()}),a?.refetchType==="none"?Promise.resolve():this.refetchQueries({...a,type:a?.refetchType??a?.type??"active"},i)))}refetchQueries(a,i={}){const r={...i,cancelRefetch:i.cancelRefetch??!0},u=Vt.batch(()=>this.#e.findAll(a).filter(c=>!c.isDisabled()&&!c.isStatic()).map(c=>{let f=c.fetch(void 0,r);return r.throwOnError||(f=f.catch(Yn)),c.state.fetchStatus==="paused"?Promise.resolve():f}));return Promise.all(u).then(Yn)}fetchQuery(a){const i=this.defaultQueryOptions(a);i.retry===void 0&&(i.retry=!1);const r=this.#e.build(this,i);return r.isStaleByTime(Oc(i.staleTime,r))?r.fetch(i):Promise.resolve(r.state.data)}prefetchQuery(a){return this.fetchQuery(a).then(Yn).catch(Yn)}fetchInfiniteQuery(a){return a.behavior=uy(a.pages),this.fetchQuery(a)}prefetchInfiniteQuery(a){return this.fetchInfiniteQuery(a).then(Yn).catch(Yn)}ensureInfiniteQueryData(a){return a.behavior=uy(a.pages),this.ensureQueryData(a)}resumePausedMutations(){return Zs.isOnline()?this.#n.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#n}getDefaultOptions(){return this.#t}setDefaultOptions(a){this.#t=a}setQueryDefaults(a,i){this.#l.set(fr(a),{queryKey:a,defaultOptions:i})}getQueryDefaults(a){const i=[...this.#l.values()],r={};return i.forEach(u=>{dr(a,u.queryKey)&&Object.assign(r,u.defaultOptions)}),r}setMutationDefaults(a,i){this.#a.set(fr(a),{mutationKey:a,defaultOptions:i})}getMutationDefaults(a){const i=[...this.#a.values()],r={};return i.forEach(u=>{dr(a,u.mutationKey)&&Object.assign(r,u.defaultOptions)}),r}defaultQueryOptions(a){if(a._defaulted)return a;const i={...this.#t.queries,...this.getQueryDefaults(a.queryKey),...a,_defaulted:!0};return i.queryHash||(i.queryHash=Gc(i.queryKey,i)),i.refetchOnReconnect===void 0&&(i.refetchOnReconnect=i.networkMode!=="always"),i.throwOnError===void 0&&(i.throwOnError=!!i.suspense),!i.networkMode&&i.persister&&(i.networkMode="offlineFirst"),i.queryFn===kc&&(i.enabled=!1),i}defaultMutationOptions(a){return a?._defaulted?a:{...this.#t.mutations,...a?.mutationKey&&this.getMutationDefaults(a.mutationKey),...a,_defaulted:!0}}clear(){this.#e.clear(),this.#n.clear()}},np=M.createContext(void 0),v2=a=>{const i=M.useContext(np);if(!i)throw new Error("No QueryClient set, use QueryClientProvider to set one");return i},Q0=({client:a,children:i})=>(M.useEffect(()=>(a.mount(),()=>{a.unmount()}),[a]),he.jsx(np.Provider,{value:a,children:i})),ap=Jy();const V0=Zy(ap);function G0(a){if(typeof document>"u")return;let i=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",i.appendChild(r),r.styleSheet?r.styleSheet.cssText=a:r.appendChild(document.createTextNode(a))}const k0=a=>{switch(a){case"success":return Z0;case"info":return F0;case"warning":return J0;case"error":return $0;default:return null}},X0=Array(12).fill(0),K0=({visible:a,className:i})=>P.createElement("div",{className:["sonner-loading-wrapper",i].filter(Boolean).join(" "),"data-visible":a},P.createElement("div",{className:"sonner-spinner"},X0.map((r,u)=>P.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${u}`})))),Z0=P.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},P.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),J0=P.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},P.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),F0=P.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},P.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),$0=P.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},P.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),P0=P.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},P.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),P.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),W0=()=>{const[a,i]=P.useState(document.hidden);return P.useEffect(()=>{const r=()=>{i(document.hidden)};return document.addEventListener("visibilitychange",r),()=>window.removeEventListener("visibilitychange",r)},[]),a};let Cc=1;class I0{constructor(){this.subscribe=i=>(this.subscribers.push(i),()=>{const r=this.subscribers.indexOf(i);this.subscribers.splice(r,1)}),this.publish=i=>{this.subscribers.forEach(r=>r(i))},this.addToast=i=>{this.publish(i),this.toasts=[...this.toasts,i]},this.create=i=>{var r;const{message:u,...c}=i,f=typeof i?.id=="number"||((r=i.id)==null?void 0:r.length)>0?i.id:Cc++,h=this.toasts.find(g=>g.id===f),m=i.dismissible===void 0?!0:i.dismissible;return this.dismissedToasts.has(f)&&this.dismissedToasts.delete(f),h?this.toasts=this.toasts.map(g=>g.id===f?(this.publish({...g,...i,id:f,title:u}),{...g,...i,id:f,dismissible:m,title:u}):g):this.addToast({title:u,...c,dismissible:m,id:f}),f},this.dismiss=i=>(i?(this.dismissedToasts.add(i),requestAnimationFrame(()=>this.subscribers.forEach(r=>r({id:i,dismiss:!0})))):this.toasts.forEach(r=>{this.subscribers.forEach(u=>u({id:r.id,dismiss:!0}))}),i),this.message=(i,r)=>this.create({...r,message:i}),this.error=(i,r)=>this.create({...r,message:i,type:"error"}),this.success=(i,r)=>this.create({...r,type:"success",message:i}),this.info=(i,r)=>this.create({...r,type:"info",message:i}),this.warning=(i,r)=>this.create({...r,type:"warning",message:i}),this.loading=(i,r)=>this.create({...r,type:"loading",message:i}),this.promise=(i,r)=>{if(!r)return;let u;r.loading!==void 0&&(u=this.create({...r,promise:i,type:"loading",message:r.loading,description:typeof r.description!="function"?r.description:void 0}));const c=Promise.resolve(i instanceof Function?i():i);let f=u!==void 0,h;const m=c.then(async y=>{if(h=["resolve",y],P.isValidElement(y))f=!1,this.create({id:u,type:"default",message:y});else if(tb(y)&&!y.ok){f=!1;const p=typeof r.error=="function"?await r.error(`HTTP error! status: ${y.status}`):r.error,R=typeof r.description=="function"?await r.description(`HTTP error! status: ${y.status}`):r.description,H=typeof p=="object"&&!P.isValidElement(p)?p:{message:p};this.create({id:u,type:"error",description:R,...H})}else if(y instanceof Error){f=!1;const p=typeof r.error=="function"?await r.error(y):r.error,R=typeof r.description=="function"?await r.description(y):r.description,H=typeof p=="object"&&!P.isValidElement(p)?p:{message:p};this.create({id:u,type:"error",description:R,...H})}else if(r.success!==void 0){f=!1;const p=typeof r.success=="function"?await r.success(y):r.success,R=typeof r.description=="function"?await r.description(y):r.description,H=typeof p=="object"&&!P.isValidElement(p)?p:{message:p};this.create({id:u,type:"success",description:R,...H})}}).catch(async y=>{if(h=["reject",y],r.error!==void 0){f=!1;const E=typeof r.error=="function"?await r.error(y):r.error,p=typeof r.description=="function"?await r.description(y):r.description,D=typeof E=="object"&&!P.isValidElement(E)?E:{message:E};this.create({id:u,type:"error",description:p,...D})}}).finally(()=>{f&&(this.dismiss(u),u=void 0),r.finally==null||r.finally.call(r)}),g=()=>new Promise((y,E)=>m.then(()=>h[0]==="reject"?E(h[1]):y(h[1])).catch(E));return typeof u!="string"&&typeof u!="number"?{unwrap:g}:Object.assign(u,{unwrap:g})},this.custom=(i,r)=>{const u=r?.id||Cc++;return this.create({jsx:i(u),id:u,...r}),u},this.getActiveToasts=()=>this.toasts.filter(i=>!this.dismissedToasts.has(i.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const It=new I0,eb=(a,i)=>{const r=i?.id||Cc++;return It.addToast({title:a,...i,id:r}),r},tb=a=>a&&typeof a=="object"&&"ok"in a&&typeof a.ok=="boolean"&&"status"in a&&typeof a.status=="number",nb=eb,ab=()=>It.toasts,lb=()=>It.getActiveToasts(),g2=Object.assign(nb,{success:It.success,info:It.info,warning:It.warning,error:It.error,custom:It.custom,message:It.message,promise:It.promise,dismiss:It.dismiss,loading:It.loading},{getHistory:ab,getToasts:lb});G0("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function zs(a){return a.label!==void 0}const ib=3,rb="24px",sb="16px",oy=4e3,ub=356,ob=14,cb=45,fb=200;function Fn(...a){return a.filter(Boolean).join(" ")}function db(a){const[i,r]=a.split("-"),u=[];return i&&u.push(i),r&&u.push(r),u}const hb=a=>{var i,r,u,c,f,h,m,g,y;const{invert:E,toast:p,unstyled:R,interacting:D,setHeights:H,visibleToasts:V,heights:K,index:G,toasts:Z,expanded:W,removeToast:be,defaultRichColors:ve,closeButton:pe,style:A,cancelButtonStyle:ae,actionButtonStyle:Ee,className:ze="",descriptionClassName:Oe="",duration:Ae,position:Ke,gap:Qe,expandByDefault:_e,classNames:O,icons:X,closeButtonAriaLabel:F="Close toast"}=a,[ce,de]=P.useState(null),[_,B]=P.useState(null),[q,J]=P.useState(!1),[I,ue]=P.useState(!1),[we,Se]=P.useState(!1),[Ze,hn]=P.useState(!1),[Dn,Ie]=P.useState(!1),[Cn,Gt]=P.useState(0),[Ia,kt]=P.useState(0),In=P.useRef(p.duration||Ae||oy),el=P.useRef(null),Bt=P.useRef(null),tl=G===0,nl=G+1<=V,Mt=p.type,Gn=p.dismissible!==!1,ut=p.className||"",ea=p.descriptionClassName||"",kn=P.useMemo(()=>K.findIndex(ge=>ge.toastId===p.id)||0,[K,p.id]),Ta=P.useMemo(()=>{var ge;return(ge=p.closeButton)!=null?ge:pe},[p.closeButton,pe]),Dt=P.useMemo(()=>p.duration||Ae||oy,[p.duration,Ae]),Yt=P.useRef(0),mn=P.useRef(0),xl=P.useRef(0),yn=P.useRef(null),[ta,at]=Ke.split("-"),Xt=P.useMemo(()=>K.reduce((ge,tt,mt)=>mt>=kn?ge:ge+tt.height,0),[K,kn]),Rt=W0(),Ol=p.invert||E,al=Mt==="loading";mn.current=P.useMemo(()=>kn*Qe+Xt,[kn,Xt]),P.useEffect(()=>{In.current=Dt},[Dt]),P.useEffect(()=>{J(!0)},[]),P.useEffect(()=>{const ge=Bt.current;if(ge){const tt=ge.getBoundingClientRect().height;return kt(tt),H(mt=>[{toastId:p.id,height:tt,position:p.position},...mt]),()=>H(mt=>mt.filter(yt=>yt.toastId!==p.id))}},[H,p.id]),P.useLayoutEffect(()=>{if(!q)return;const ge=Bt.current,tt=ge.style.height;ge.style.height="auto";const mt=ge.getBoundingClientRect().height;ge.style.height=tt,kt(mt),H(yt=>yt.find(nt=>nt.toastId===p.id)?yt.map(nt=>nt.toastId===p.id?{...nt,height:mt}:nt):[{toastId:p.id,height:mt,position:p.position},...yt])},[q,p.title,p.description,H,p.id,p.jsx,p.action,p.cancel]);const en=P.useCallback(()=>{ue(!0),Gt(mn.current),H(ge=>ge.filter(tt=>tt.toastId!==p.id)),setTimeout(()=>{be(p)},fb)},[p,be,H,mn]);P.useEffect(()=>{if(p.promise&&Mt==="loading"||p.duration===1/0||p.type==="loading")return;let ge;return W||D||Rt?(()=>{if(xl.current<Yt.current){const yt=new Date().getTime()-Yt.current;In.current=In.current-yt}xl.current=new Date().getTime()})():In.current!==1/0&&(Yt.current=new Date().getTime(),ge=setTimeout(()=>{p.onAutoClose==null||p.onAutoClose.call(p,p),en()},In.current)),()=>clearTimeout(ge)},[W,D,p,Mt,Rt,en]),P.useEffect(()=>{p.delete&&(en(),p.onDismiss==null||p.onDismiss.call(p,p))},[en,p.delete]);function zn(){var ge;if(X?.loading){var tt;return P.createElement("div",{className:Fn(O?.loader,p==null||(tt=p.classNames)==null?void 0:tt.loader,"sonner-loader"),"data-visible":Mt==="loading"},X.loading)}return P.createElement(K0,{className:Fn(O?.loader,p==null||(ge=p.classNames)==null?void 0:ge.loader),visible:Mt==="loading"})}const na=p.icon||X?.[Mt]||k0(Mt);var Nn,pn;return P.createElement("li",{tabIndex:0,ref:Bt,className:Fn(ze,ut,O?.toast,p==null||(i=p.classNames)==null?void 0:i.toast,O?.default,O?.[Mt],p==null||(r=p.classNames)==null?void 0:r[Mt]),"data-sonner-toast":"","data-rich-colors":(Nn=p.richColors)!=null?Nn:ve,"data-styled":!(p.jsx||p.unstyled||R),"data-mounted":q,"data-promise":!!p.promise,"data-swiped":Dn,"data-removed":I,"data-visible":nl,"data-y-position":ta,"data-x-position":at,"data-index":G,"data-front":tl,"data-swiping":we,"data-dismissible":Gn,"data-type":Mt,"data-invert":Ol,"data-swipe-out":Ze,"data-swipe-direction":_,"data-expanded":!!(W||_e&&q),"data-testid":p.testId,style:{"--index":G,"--toasts-before":G,"--z-index":Z.length-G,"--offset":`${I?Cn:mn.current}px`,"--initial-height":_e?"auto":`${Ia}px`,...A,...p.style},onDragEnd:()=>{Se(!1),de(null),yn.current=null},onPointerDown:ge=>{ge.button!==2&&(al||!Gn||(el.current=new Date,Gt(mn.current),ge.target.setPointerCapture(ge.pointerId),ge.target.tagName!=="BUTTON"&&(Se(!0),yn.current={x:ge.clientX,y:ge.clientY})))},onPointerUp:()=>{var ge,tt,mt;if(Ze||!Gn)return;yn.current=null;const yt=Number(((ge=Bt.current)==null?void 0:ge.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),tn=Number(((tt=Bt.current)==null?void 0:tt.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),nt=new Date().getTime()-((mt=el.current)==null?void 0:mt.getTime()),Ht=ce==="x"?yt:tn,aa=Math.abs(Ht)/nt;if(Math.abs(Ht)>=cb||aa>.11){Gt(mn.current),p.onDismiss==null||p.onDismiss.call(p,p),B(ce==="x"?yt>0?"right":"left":tn>0?"down":"up"),en(),hn(!0);return}else{var b,w;(b=Bt.current)==null||b.style.setProperty("--swipe-amount-x","0px"),(w=Bt.current)==null||w.style.setProperty("--swipe-amount-y","0px")}Ie(!1),Se(!1),de(null)},onPointerMove:ge=>{var tt,mt,yt;if(!yn.current||!Gn||((tt=window.getSelection())==null?void 0:tt.toString().length)>0)return;const nt=ge.clientY-yn.current.y,Ht=ge.clientX-yn.current.x;var aa;const b=(aa=a.swipeDirections)!=null?aa:db(Ke);!ce&&(Math.abs(Ht)>1||Math.abs(nt)>1)&&de(Math.abs(Ht)>Math.abs(nt)?"x":"y");let w={x:0,y:0};const U=k=>1/(1.5+Math.abs(k)/20);if(ce==="y"){if(b.includes("top")||b.includes("bottom"))if(b.includes("top")&&nt<0||b.includes("bottom")&&nt>0)w.y=nt;else{const k=nt*U(nt);w.y=Math.abs(k)<Math.abs(nt)?k:nt}}else if(ce==="x"&&(b.includes("left")||b.includes("right")))if(b.includes("left")&&Ht<0||b.includes("right")&&Ht>0)w.x=Ht;else{const k=Ht*U(Ht);w.x=Math.abs(k)<Math.abs(Ht)?k:Ht}(Math.abs(w.x)>0||Math.abs(w.y)>0)&&Ie(!0),(mt=Bt.current)==null||mt.style.setProperty("--swipe-amount-x",`${w.x}px`),(yt=Bt.current)==null||yt.style.setProperty("--swipe-amount-y",`${w.y}px`)}},Ta&&!p.jsx&&Mt!=="loading"?P.createElement("button",{"aria-label":F,"data-disabled":al,"data-close-button":!0,onClick:al||!Gn?()=>{}:()=>{en(),p.onDismiss==null||p.onDismiss.call(p,p)},className:Fn(O?.closeButton,p==null||(u=p.classNames)==null?void 0:u.closeButton)},(pn=X?.close)!=null?pn:P0):null,(Mt||p.icon||p.promise)&&p.icon!==null&&(X?.[Mt]!==null||p.icon)?P.createElement("div",{"data-icon":"",className:Fn(O?.icon,p==null||(c=p.classNames)==null?void 0:c.icon)},p.promise||p.type==="loading"&&!p.icon?p.icon||zn():null,p.type!=="loading"?na:null):null,P.createElement("div",{"data-content":"",className:Fn(O?.content,p==null||(f=p.classNames)==null?void 0:f.content)},P.createElement("div",{"data-title":"",className:Fn(O?.title,p==null||(h=p.classNames)==null?void 0:h.title)},p.jsx?p.jsx:typeof p.title=="function"?p.title():p.title),p.description?P.createElement("div",{"data-description":"",className:Fn(Oe,ea,O?.description,p==null||(m=p.classNames)==null?void 0:m.description)},typeof p.description=="function"?p.description():p.description):null),P.isValidElement(p.cancel)?p.cancel:p.cancel&&zs(p.cancel)?P.createElement("button",{"data-button":!0,"data-cancel":!0,style:p.cancelButtonStyle||ae,onClick:ge=>{zs(p.cancel)&&Gn&&(p.cancel.onClick==null||p.cancel.onClick.call(p.cancel,ge),en())},className:Fn(O?.cancelButton,p==null||(g=p.classNames)==null?void 0:g.cancelButton)},p.cancel.label):null,P.isValidElement(p.action)?p.action:p.action&&zs(p.action)?P.createElement("button",{"data-button":!0,"data-action":!0,style:p.actionButtonStyle||Ee,onClick:ge=>{zs(p.action)&&(p.action.onClick==null||p.action.onClick.call(p.action,ge),!ge.defaultPrevented&&en())},className:Fn(O?.actionButton,p==null||(y=p.classNames)==null?void 0:y.actionButton)},p.action.label):null)};function cy(){if(typeof window>"u"||typeof document>"u")return"ltr";const a=document.documentElement.getAttribute("dir");return a==="auto"||!a?window.getComputedStyle(document.documentElement).direction:a}function mb(a,i){const r={};return[a,i].forEach((u,c)=>{const f=c===1,h=f?"--mobile-offset":"--offset",m=f?sb:rb;function g(y){["top","right","bottom","left"].forEach(E=>{r[`${h}-${E}`]=typeof y=="number"?`${y}px`:y})}typeof u=="number"||typeof u=="string"?g(u):typeof u=="object"?["top","right","bottom","left"].forEach(y=>{u[y]===void 0?r[`${h}-${y}`]=m:r[`${h}-${y}`]=typeof u[y]=="number"?`${u[y]}px`:u[y]}):g(m)}),r}const yb=P.forwardRef(function(i,r){const{id:u,invert:c,position:f="bottom-right",hotkey:h=["altKey","KeyT"],expand:m,closeButton:g,className:y,offset:E,mobileOffset:p,theme:R="light",richColors:D,duration:H,style:V,visibleToasts:K=ib,toastOptions:G,dir:Z=cy(),gap:W=ob,icons:be,containerAriaLabel:ve="Notifications"}=i,[pe,A]=P.useState([]),ae=P.useMemo(()=>u?pe.filter(q=>q.toasterId===u):pe.filter(q=>!q.toasterId),[pe,u]),Ee=P.useMemo(()=>Array.from(new Set([f].concat(ae.filter(q=>q.position).map(q=>q.position)))),[ae,f]),[ze,Oe]=P.useState([]),[Ae,Ke]=P.useState(!1),[Qe,_e]=P.useState(!1),[O,X]=P.useState(R!=="system"?R:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),F=P.useRef(null),ce=h.join("+").replace(/Key/g,"").replace(/Digit/g,""),de=P.useRef(null),_=P.useRef(!1),B=P.useCallback(q=>{A(J=>{var I;return(I=J.find(ue=>ue.id===q.id))!=null&&I.delete||It.dismiss(q.id),J.filter(({id:ue})=>ue!==q.id)})},[]);return P.useEffect(()=>It.subscribe(q=>{if(q.dismiss){requestAnimationFrame(()=>{A(J=>J.map(I=>I.id===q.id?{...I,delete:!0}:I))});return}setTimeout(()=>{V0.flushSync(()=>{A(J=>{const I=J.findIndex(ue=>ue.id===q.id);return I!==-1?[...J.slice(0,I),{...J[I],...q},...J.slice(I+1)]:[q,...J]})})})}),[pe]),P.useEffect(()=>{if(R!=="system"){X(R);return}if(R==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?X("dark"):X("light")),typeof window>"u")return;const q=window.matchMedia("(prefers-color-scheme: dark)");try{q.addEventListener("change",({matches:J})=>{X(J?"dark":"light")})}catch{q.addListener(({matches:I})=>{try{X(I?"dark":"light")}catch(ue){console.error(ue)}})}},[R]),P.useEffect(()=>{pe.length<=1&&Ke(!1)},[pe]),P.useEffect(()=>{const q=J=>{var I;if(h.every(Se=>J[Se]||J.code===Se)){var we;Ke(!0),(we=F.current)==null||we.focus()}J.code==="Escape"&&(document.activeElement===F.current||(I=F.current)!=null&&I.contains(document.activeElement))&&Ke(!1)};return document.addEventListener("keydown",q),()=>document.removeEventListener("keydown",q)},[h]),P.useEffect(()=>{if(F.current)return()=>{de.current&&(de.current.focus({preventScroll:!0}),de.current=null,_.current=!1)}},[F.current]),P.createElement("section",{ref:r,"aria-label":`${ve} ${ce}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},Ee.map((q,J)=>{var I;const[ue,we]=q.split("-");return ae.length?P.createElement("ol",{key:q,dir:Z==="auto"?cy():Z,tabIndex:-1,ref:F,className:y,"data-sonner-toaster":!0,"data-sonner-theme":O,"data-y-position":ue,"data-x-position":we,style:{"--front-toast-height":`${((I=ze[0])==null?void 0:I.height)||0}px`,"--width":`${ub}px`,"--gap":`${W}px`,...V,...mb(E,p)},onBlur:Se=>{_.current&&!Se.currentTarget.contains(Se.relatedTarget)&&(_.current=!1,de.current&&(de.current.focus({preventScroll:!0}),de.current=null))},onFocus:Se=>{Se.target instanceof HTMLElement&&Se.target.dataset.dismissible==="false"||_.current||(_.current=!0,de.current=Se.relatedTarget)},onMouseEnter:()=>Ke(!0),onMouseMove:()=>Ke(!0),onMouseLeave:()=>{Qe||Ke(!1)},onDragEnd:()=>Ke(!1),onPointerDown:Se=>{Se.target instanceof HTMLElement&&Se.target.dataset.dismissible==="false"||_e(!0)},onPointerUp:()=>_e(!1)},ae.filter(Se=>!Se.position&&J===0||Se.position===q).map((Se,Ze)=>{var hn,Dn;return P.createElement(hb,{key:Se.id,icons:be,index:Ze,toast:Se,defaultRichColors:D,duration:(hn=G?.duration)!=null?hn:H,className:G?.className,descriptionClassName:G?.descriptionClassName,invert:c,visibleToasts:K,closeButton:(Dn=G?.closeButton)!=null?Dn:g,interacting:Qe,position:q,style:G?.style,unstyled:G?.unstyled,classNames:G?.classNames,cancelButtonStyle:G?.cancelButtonStyle,actionButtonStyle:G?.actionButtonStyle,closeButtonAriaLabel:G?.closeButtonAriaLabel,removeToast:B,toasts:ae.filter(Ie=>Ie.position==Se.position),heights:ze.filter(Ie=>Ie.position==Se.position),setHeights:Oe,expandByDefault:m,gap:W,expanded:Ae,swipeDirections:i.swipeDirections})})):null}))}),pb=new Y0({defaultOptions:{queries:{staleTime:1e3*60,retry:1,refetchOnWindowFocus:!1}}}),vb="modulepreload",gb=function(a){return"/"+a},fy={},wl=function(i,r,u){let c=Promise.resolve();if(r&&r.length>0){let g=function(y){return Promise.all(y.map(E=>Promise.resolve(E).then(p=>({status:"fulfilled",value:p}),p=>({status:"rejected",reason:p}))))};document.getElementsByTagName("link");const h=document.querySelector("meta[property=csp-nonce]"),m=h?.nonce||h?.getAttribute("nonce");c=g(r.map(y=>{if(y=gb(y),y in fy)return;fy[y]=!0;const E=y.endsWith(".css"),p=E?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${y}"]${p}`))return;const R=document.createElement("link");if(R.rel=E?"stylesheet":vb,E||(R.as="script"),R.crossOrigin="",R.href=y,m&&R.setAttribute("nonce",m),document.head.appendChild(R),E)return new Promise((D,H)=>{R.addEventListener("load",D),R.addEventListener("error",()=>H(new Error(`Unable to preload CSS for ${y}`)))})}))}function f(h){const m=new Event("vite:preloadError",{cancelable:!0});if(m.payload=h,window.dispatchEvent(m),!m.defaultPrevented)throw h}return c.then(h=>{for(const m of h||[])m.status==="rejected"&&f(m.reason);return i().catch(f)})};var lp=a=>{throw TypeError(a)},bb=(a,i,r)=>i.has(a)||lp("Cannot "+r),vc=(a,i,r)=>(bb(a,i,"read from private field"),r?r.call(a):i.get(a)),Sb=(a,i,r)=>i.has(a)?lp("Cannot add the same private member more than once"):i instanceof WeakSet?i.add(a):i.set(a,r),dy="popstate";function Eb(a={}){function i(u,c){let{pathname:f,search:h,hash:m}=u.location;return hr("",{pathname:f,search:h,hash:m},c.state&&c.state.usr||null,c.state&&c.state.key||"default")}function r(u,c){return typeof c=="string"?c:Pn(c)}return Tb(i,r,null,a)}function Me(a,i){if(a===!1||a===null||typeof a>"u")throw new Error(i)}function bt(a,i){if(!a){typeof console<"u"&&console.warn(i);try{throw new Error(i)}catch{}}}function _b(){return Math.random().toString(36).substring(2,10)}function hy(a,i){return{usr:a.state,key:a.key,idx:i}}function hr(a,i,r=null,u){return{pathname:typeof a=="string"?a:a.pathname,search:"",hash:"",...typeof i=="string"?Pa(i):i,state:r,key:i&&i.key||u||_b()}}function Pn({pathname:a="/",search:i="",hash:r=""}){return i&&i!=="?"&&(a+=i.charAt(0)==="?"?i:"?"+i),r&&r!=="#"&&(a+=r.charAt(0)==="#"?r:"#"+r),a}function Pa(a){let i={};if(a){let r=a.indexOf("#");r>=0&&(i.hash=a.substring(r),a=a.substring(0,r));let u=a.indexOf("?");u>=0&&(i.search=a.substring(u),a=a.substring(0,u)),a&&(i.pathname=a)}return i}function Tb(a,i,r,u={}){let{window:c=document.defaultView,v5Compat:f=!1}=u,h=c.history,m="POP",g=null,y=E();y==null&&(y=0,h.replaceState({...h.state,idx:y},""));function E(){return(h.state||{idx:null}).idx}function p(){m="POP";let K=E(),G=K==null?null:K-y;y=K,g&&g({action:m,location:V.location,delta:G})}function R(K,G){m="PUSH";let Z=hr(V.location,K,G);y=E()+1;let W=hy(Z,y),be=V.createHref(Z);try{h.pushState(W,"",be)}catch(ve){if(ve instanceof DOMException&&ve.name==="DataCloneError")throw ve;c.location.assign(be)}f&&g&&g({action:m,location:V.location,delta:1})}function D(K,G){m="REPLACE";let Z=hr(V.location,K,G);y=E();let W=hy(Z,y),be=V.createHref(Z);h.replaceState(W,"",be),f&&g&&g({action:m,location:V.location,delta:0})}function H(K){return ip(K)}let V={get action(){return m},get location(){return a(c,h)},listen(K){if(g)throw new Error("A history only accepts one active listener");return c.addEventListener(dy,p),g=K,()=>{c.removeEventListener(dy,p),g=null}},createHref(K){return i(c,K)},createURL:H,encodeLocation(K){let G=H(K);return{pathname:G.pathname,search:G.search,hash:G.hash}},push:R,replace:D,go(K){return h.go(K)}};return V}function ip(a,i=!1){let r="http://localhost";typeof window<"u"&&(r=window.location.origin!=="null"?window.location.origin:window.location.href),Me(r,"No window.location.(origin|href) available to create URL");let u=typeof a=="string"?a:Pn(a);return u=u.replace(/ $/,"%20"),!i&&u.startsWith("//")&&(u=r+u),new URL(u,r)}var sr,my=class{constructor(a){if(Sb(this,sr,new Map),a)for(let[i,r]of a)this.set(i,r)}get(a){if(vc(this,sr).has(a))return vc(this,sr).get(a);if(a.defaultValue!==void 0)return a.defaultValue;throw new Error("No value found for context")}set(a,i){vc(this,sr).set(a,i)}};sr=new WeakMap;var wb=new Set(["lazy","caseSensitive","path","id","index","children"]);function Rb(a){return wb.has(a)}var xb=new Set(["lazy","caseSensitive","path","id","index","middleware","children"]);function Ob(a){return xb.has(a)}function Ab(a){return a.index===!0}function mr(a,i,r=[],u={},c=!1){return a.map((f,h)=>{let m=[...r,String(h)],g=typeof f.id=="string"?f.id:m.join("-");if(Me(f.index!==!0||!f.children,"Cannot specify children on an index route"),Me(c||!u[g],`Found a route id collision on id "${g}". Route id's must be globally unique within Data Router usages`),Ab(f)){let y={...f,id:g};return u[g]=yy(y,i(y)),y}else{let y={...f,id:g,children:void 0};return u[g]=yy(y,i(y)),f.children&&(y.children=mr(f.children,i,m,u,c)),y}})}function yy(a,i){return Object.assign(a,{...i,...typeof i.lazy=="object"&&i.lazy!=null?{lazy:{...a.lazy,...i.lazy}}:{}})}function Za(a,i,r="/"){return ur(a,i,r,!1)}function ur(a,i,r,u){let c=typeof i=="string"?Pa(i):i,f=Mn(c.pathname||"/",r);if(f==null)return null;let h=rp(a);Db(h);let m=null;for(let g=0;m==null&&g<h.length;++g){let y=Qb(f);m=qb(h[g],y,u)}return m}function Mb(a,i){let{route:r,pathname:u,params:c}=a;return{id:r.id,pathname:u,params:c,data:i[r.id],loaderData:i[r.id],handle:r.handle}}function rp(a,i=[],r=[],u="",c=!1){let f=(h,m,g=c,y)=>{let E={relativePath:y===void 0?h.path||"":y,caseSensitive:h.caseSensitive===!0,childrenIndex:m,route:h};if(E.relativePath.startsWith("/")){if(!E.relativePath.startsWith(u)&&g)return;Me(E.relativePath.startsWith(u),`Absolute route path "${E.relativePath}" nested under path "${u}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),E.relativePath=E.relativePath.slice(u.length)}let p=$n([u,E.relativePath]),R=r.concat(E);h.children&&h.children.length>0&&(Me(h.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${p}".`),rp(h.children,i,R,p,g)),!(h.path==null&&!h.index)&&i.push({path:p,score:Hb(p,h.index),routesMeta:R})};return a.forEach((h,m)=>{if(h.path===""||!h.path?.includes("?"))f(h,m);else for(let g of sp(h.path))f(h,m,!0,g)}),i}function sp(a){let i=a.split("/");if(i.length===0)return[];let[r,...u]=i,c=r.endsWith("?"),f=r.replace(/\?$/,"");if(u.length===0)return c?[f,""]:[f];let h=sp(u.join("/")),m=[];return m.push(...h.map(g=>g===""?f:[f,g].join("/"))),c&&m.push(...h),m.map(g=>a.startsWith("/")&&g===""?"/":g)}function Db(a){a.sort((i,r)=>i.score!==r.score?r.score-i.score:jb(i.routesMeta.map(u=>u.childrenIndex),r.routesMeta.map(u=>u.childrenIndex)))}var Cb=/^:[\w-]+$/,zb=3,Nb=2,Ub=1,Lb=10,Bb=-2,py=a=>a==="*";function Hb(a,i){let r=a.split("/"),u=r.length;return r.some(py)&&(u+=Bb),i&&(u+=Nb),r.filter(c=>!py(c)).reduce((c,f)=>c+(Cb.test(f)?zb:f===""?Ub:Lb),u)}function jb(a,i){return a.length===i.length&&a.slice(0,-1).every((u,c)=>u===i[c])?a[a.length-1]-i[i.length-1]:0}function qb(a,i,r=!1){let{routesMeta:u}=a,c={},f="/",h=[];for(let m=0;m<u.length;++m){let g=u[m],y=m===u.length-1,E=f==="/"?i:i.slice(f.length)||"/",p=Js({path:g.relativePath,caseSensitive:g.caseSensitive,end:y},E),R=g.route;if(!p&&y&&r&&!u[u.length-1].route.index&&(p=Js({path:g.relativePath,caseSensitive:g.caseSensitive,end:!1},E)),!p)return null;Object.assign(c,p.params),h.push({params:c,pathname:$n([f,p.pathname]),pathnameBase:kb($n([f,p.pathnameBase])),route:R}),p.pathnameBase!=="/"&&(f=$n([f,p.pathnameBase]))}return h}function Js(a,i){typeof a=="string"&&(a={path:a,caseSensitive:!1,end:!0});let[r,u]=Yb(a.path,a.caseSensitive,a.end),c=i.match(r);if(!c)return null;let f=c[0],h=f.replace(/(.)\/+$/,"$1"),m=c.slice(1);return{params:u.reduce((y,{paramName:E,isOptional:p},R)=>{if(E==="*"){let H=m[R]||"";h=f.slice(0,f.length-H.length).replace(/(.)\/+$/,"$1")}const D=m[R];return p&&!D?y[E]=void 0:y[E]=(D||"").replace(/%2F/g,"/"),y},{}),pathname:f,pathnameBase:h,pattern:a}}function Yb(a,i=!1,r=!0){bt(a==="*"||!a.endsWith("*")||a.endsWith("/*"),`Route path "${a}" will be treated as if it were "${a.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${a.replace(/\*$/,"/*")}".`);let u=[],c="^"+a.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(h,m,g)=>(u.push({paramName:m,isOptional:g!=null}),g?"/?([^\\/]+)?":"/([^\\/]+)")).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return a.endsWith("*")?(u.push({paramName:"*"}),c+=a==="*"||a==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?c+="\\/*$":a!==""&&a!=="/"&&(c+="(?:(?=\\/|$))"),[new RegExp(c,i?void 0:"i"),u]}function Qb(a){try{return a.split("/").map(i=>decodeURIComponent(i).replace(/\//g,"%2F")).join("/")}catch(i){return bt(!1,`The URL path "${a}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${i}).`),a}}function Mn(a,i){if(i==="/")return a;if(!a.toLowerCase().startsWith(i.toLowerCase()))return null;let r=i.endsWith("/")?i.length-1:i.length,u=a.charAt(r);return u&&u!=="/"?null:a.slice(r)||"/"}function Vb({basename:a,pathname:i}){return i==="/"?a:$n([a,i])}var up=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Xc=a=>up.test(a);function Gb(a,i="/"){let{pathname:r,search:u="",hash:c=""}=typeof a=="string"?Pa(a):a,f;return r?(r=r.replace(/\/\/+/g,"/"),r.startsWith("/")?f=vy(r.substring(1),"/"):f=vy(r,i)):f=i,{pathname:f,search:Xb(u),hash:Kb(c)}}function vy(a,i){let r=i.replace(/\/+$/,"").split("/");return a.split("/").forEach(c=>{c===".."?r.length>1&&r.pop():c!=="."&&r.push(c)}),r.length>1?r.join("/"):"/"}function gc(a,i,r,u){return`Cannot include a '${a}' character in a manually specified \`to.${i}\` field [${JSON.stringify(u)}]. Please separate it out to the \`to.${r}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function op(a){return a.filter((i,r)=>r===0||i.route.path&&i.route.path.length>0)}function Ps(a){let i=op(a);return i.map((r,u)=>u===i.length-1?r.pathname:r.pathnameBase)}function Ws(a,i,r,u=!1){let c;typeof a=="string"?c=Pa(a):(c={...a},Me(!c.pathname||!c.pathname.includes("?"),gc("?","pathname","search",c)),Me(!c.pathname||!c.pathname.includes("#"),gc("#","pathname","hash",c)),Me(!c.search||!c.search.includes("#"),gc("#","search","hash",c)));let f=a===""||c.pathname==="",h=f?"/":c.pathname,m;if(h==null)m=r;else{let p=i.length-1;if(!u&&h.startsWith("..")){let R=h.split("/");for(;R[0]==="..";)R.shift(),p-=1;c.pathname=R.join("/")}m=p>=0?i[p]:"/"}let g=Gb(c,m),y=h&&h!=="/"&&h.endsWith("/"),E=(f||h===".")&&r.endsWith("/");return!g.pathname.endsWith("/")&&(y||E)&&(g.pathname+="/"),g}var $n=a=>a.join("/").replace(/\/\/+/g,"/"),kb=a=>a.replace(/\/+$/,"").replace(/^\/*/,"/"),Xb=a=>!a||a==="?"?"":a.startsWith("?")?a:"?"+a,Kb=a=>!a||a==="#"?"":a.startsWith("#")?a:"#"+a,pr=class{constructor(a,i,r,u=!1){this.status=a,this.statusText=i||"",this.internal=u,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}};function yr(a){return a!=null&&typeof a.status=="number"&&typeof a.statusText=="string"&&typeof a.internal=="boolean"&&"data"in a}function vr(a){return a.map(i=>i.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var cp=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function fp(a,i){let r=a;if(typeof r!="string"||!up.test(r))return{absoluteURL:void 0,isExternal:!1,to:r};let u=r,c=!1;if(cp)try{let f=new URL(window.location.href),h=r.startsWith("//")?new URL(f.protocol+r):new URL(r),m=Mn(h.pathname,i);h.origin===f.origin&&m!=null?r=m+h.search+h.hash:c=!0}catch{bt(!1,`<Link to="${r}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:u,isExternal:c,to:r}}var Fa=Symbol("Uninstrumented");function Zb(a,i){let r={lazy:[],"lazy.loader":[],"lazy.action":[],"lazy.middleware":[],middleware:[],loader:[],action:[]};a.forEach(c=>c({id:i.id,index:i.index,path:i.path,instrument(f){let h=Object.keys(r);for(let m of h)f[m]&&r[m].push(f[m])}}));let u={};if(typeof i.lazy=="function"&&r.lazy.length>0){let c=ui(r.lazy,i.lazy,()=>{});c&&(u.lazy=c)}if(typeof i.lazy=="object"){let c=i.lazy;["middleware","loader","action"].forEach(f=>{let h=c[f],m=r[`lazy.${f}`];if(typeof h=="function"&&m.length>0){let g=ui(m,h,()=>{});g&&(u.lazy=Object.assign(u.lazy||{},{[f]:g}))}})}return["loader","action"].forEach(c=>{let f=i[c];if(typeof f=="function"&&r[c].length>0){let h=f[Fa]??f,m=ui(r[c],h,(...g)=>gy(g[0]));m&&(c==="loader"&&h.hydrate===!0&&(m.hydrate=!0),m[Fa]=h,u[c]=m)}}),i.middleware&&i.middleware.length>0&&r.middleware.length>0&&(u.middleware=i.middleware.map(c=>{let f=c[Fa]??c,h=ui(r.middleware,f,(...m)=>gy(m[0]));return h?(h[Fa]=f,h):c})),u}function Jb(a,i){let r={navigate:[],fetch:[]};if(i.forEach(u=>u({instrument(c){let f=Object.keys(c);for(let h of f)c[h]&&r[h].push(c[h])}})),r.navigate.length>0){let u=a.navigate[Fa]??a.navigate,c=ui(r.navigate,u,(...f)=>{let[h,m]=f;return{to:typeof h=="number"||typeof h=="string"?h:h?Pn(h):".",...by(a,m??{})}});c&&(c[Fa]=u,a.navigate=c)}if(r.fetch.length>0){let u=a.fetch[Fa]??a.fetch,c=ui(r.fetch,u,(...f)=>{let[h,,m,g]=f;return{href:m??".",fetcherKey:h,...by(a,g??{})}});c&&(c[Fa]=u,a.fetch=c)}return a}function ui(a,i,r){return a.length===0?null:async(...u)=>{let c=await dp(a,r(...u),()=>i(...u),a.length-1);if(c.type==="error")throw c.value;return c.value}}async function dp(a,i,r,u){let c=a[u],f;if(c){let h,m=async()=>(h?console.error("You cannot call instrumented handlers more than once"):h=dp(a,i,r,u-1),f=await h,Me(f,"Expected a result"),f.type==="error"&&f.value instanceof Error?{status:"error",error:f.value}:{status:"success",error:void 0});try{await c(m,i)}catch(g){console.error("An instrumentation function threw an error:",g)}h||await m(),await h}else try{f={type:"success",value:await r()}}catch(h){f={type:"error",value:h}}return f||{type:"error",value:new Error("No result assigned in instrumentation chain.")}}function gy(a){let{request:i,context:r,params:u,unstable_pattern:c}=a;return{request:Fb(i),params:{...u},unstable_pattern:c,context:$b(r)}}function by(a,i){return{currentUrl:Pn(a.state.location),..."formMethod"in i?{formMethod:i.formMethod}:{},..."formEncType"in i?{formEncType:i.formEncType}:{},..."formData"in i?{formData:i.formData}:{},..."body"in i?{body:i.body}:{}}}function Fb(a){return{method:a.method,url:a.url,headers:{get:(...i)=>a.headers.get(...i)}}}function $b(a){if(Wb(a)){let i={...a};return Object.freeze(i),i}else return{get:i=>a.get(i)}}var Pb=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function Wb(a){if(a===null||typeof a!="object")return!1;const i=Object.getPrototypeOf(a);return i===Object.prototype||i===null||Object.getOwnPropertyNames(i).sort().join("\0")===Pb}var hp=["POST","PUT","PATCH","DELETE"],Ib=new Set(hp),e1=["GET",...hp],t1=new Set(e1),mp=new Set([301,302,303,307,308]),n1=new Set([307,308]),bc={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},a1={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},ar={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},l1=a=>({hasErrorBoundary:!!a.hasErrorBoundary}),yp="remix-router-transitions",pp=Symbol("ResetLoaderData");function i1(a){const i=a.window?a.window:typeof window<"u"?window:void 0,r=typeof i<"u"&&typeof i.document<"u"&&typeof i.document.createElement<"u";Me(a.routes.length>0,"You must provide a non-empty routes array to createRouter");let u=a.hydrationRouteProperties||[],c=a.mapRouteProperties||l1,f=c;if(a.unstable_instrumentations){let b=a.unstable_instrumentations;f=w=>({...c(w),...Zb(b.map(U=>U.route).filter(Boolean),w)})}let h={},m=mr(a.routes,f,void 0,h),g,y=a.basename||"/";y.startsWith("/")||(y=`/${y}`);let E=a.dataStrategy||c1,p={...a.future},R=null,D=new Set,H=null,V=null,K=null,G=a.hydrationData!=null,Z=Za(m,a.history.location,y),W=!1,be=null,ve;if(Z==null&&!a.patchRoutesOnNavigation){let b=On(404,{pathname:a.history.location.pathname}),{matches:w,route:U}=Ns(m);ve=!0,Z=w,be={[U.id]:b}}else if(Z&&!a.hydrationData&&yt(Z,m,a.history.location.pathname).active&&(Z=null),Z)if(Z.some(b=>b.route.lazy))ve=!1;else if(!Z.some(b=>Kc(b.route)))ve=!0;else{let b=a.hydrationData?a.hydrationData.loaderData:null,w=a.hydrationData?a.hydrationData.errors:null;if(w){let U=Z.findIndex(k=>w[k.route.id]!==void 0);ve=Z.slice(0,U+1).every(k=>!Nc(k.route,b,w))}else ve=Z.every(U=>!Nc(U.route,b,w))}else{ve=!1,Z=[];let b=yt(null,m,a.history.location.pathname);b.active&&b.matches&&(W=!0,Z=b.matches)}let pe,A={historyAction:a.history.action,location:a.history.location,matches:Z,initialized:ve,navigation:bc,restoreScrollPosition:a.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:a.hydrationData&&a.hydrationData.loaderData||{},actionData:a.hydrationData&&a.hydrationData.actionData||null,errors:a.hydrationData&&a.hydrationData.errors||be,fetchers:new Map,blockers:new Map},ae="POP",Ee=null,ze=!1,Oe,Ae=!1,Ke=new Map,Qe=null,_e=!1,O=!1,X=new Set,F=new Map,ce=0,de=-1,_=new Map,B=new Set,q=new Map,J=new Map,I=new Set,ue=new Map,we,Se=null;function Ze(){if(R=a.history.listen(({action:b,location:w,delta:U})=>{if(we){we(),we=void 0;return}bt(ue.size===0||U!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let k=na({currentLocation:A.location,nextLocation:w,historyAction:b});if(k&&U!=null){let $=new Promise(se=>{we=se});a.history.go(U*-1),zn(k,{state:"blocked",location:w,proceed(){zn(k,{state:"proceeding",proceed:void 0,reset:void 0,location:w}),$.then(()=>a.history.go(U))},reset(){let se=new Map(A.blockers);se.set(k,ar),Ie({blockers:se})}}),Ee?.resolve(),Ee=null;return}return kt(b,w)}),r){A1(i,Ke);let b=()=>M1(i,Ke);i.addEventListener("pagehide",b),Qe=()=>i.removeEventListener("pagehide",b)}return A.initialized||kt("POP",A.location,{initialHydration:!0}),pe}function hn(){R&&R(),Qe&&Qe(),D.clear(),Oe&&Oe.abort(),A.fetchers.forEach((b,w)=>yn(w)),A.blockers.forEach((b,w)=>en(w))}function Dn(b){return D.add(b),()=>D.delete(b)}function Ie(b,w={}){b.matches&&(b.matches=b.matches.map($=>{let se=h[$.route.id],te=$.route;return te.element!==se.element||te.errorElement!==se.errorElement||te.hydrateFallbackElement!==se.hydrateFallbackElement?{...$,route:se}:$})),A={...A,...b};let U=[],k=[];A.fetchers.forEach(($,se)=>{$.state==="idle"&&(I.has(se)?U.push(se):k.push(se))}),I.forEach($=>{!A.fetchers.has($)&&!F.has($)&&U.push($)}),[...D].forEach($=>$(A,{deletedFetchers:U,newErrors:b.errors??null,viewTransitionOpts:w.viewTransitionOpts,flushSync:w.flushSync===!0})),U.forEach($=>yn($)),k.forEach($=>A.fetchers.delete($))}function Cn(b,w,{flushSync:U}={}){let k=A.actionData!=null&&A.navigation.formMethod!=null&&qt(A.navigation.formMethod)&&A.navigation.state==="loading"&&b.state?._isRedirect!==!0,$;w.actionData?Object.keys(w.actionData).length>0?$=w.actionData:$=null:k?$=A.actionData:$=null;let se=w.loaderData?My(A.loaderData,w.loaderData,w.matches||[],w.errors):A.loaderData,te=A.blockers;te.size>0&&(te=new Map(te),te.forEach((me,oe)=>te.set(oe,ar)));let ee=_e?!1:mt(b,w.matches||A.matches),ne=ze===!0||A.navigation.formMethod!=null&&qt(A.navigation.formMethod)&&b.state?._isRedirect!==!0;g&&(m=g,g=void 0),_e||ae==="POP"||(ae==="PUSH"?a.history.push(b,b.state):ae==="REPLACE"&&a.history.replace(b,b.state));let re;if(ae==="POP"){let me=Ke.get(A.location.pathname);me&&me.has(b.pathname)?re={currentLocation:A.location,nextLocation:b}:Ke.has(b.pathname)&&(re={currentLocation:b,nextLocation:A.location})}else if(Ae){let me=Ke.get(A.location.pathname);me?me.add(b.pathname):(me=new Set([b.pathname]),Ke.set(A.location.pathname,me)),re={currentLocation:A.location,nextLocation:b}}Ie({...w,actionData:$,loaderData:se,historyAction:ae,location:b,initialized:!0,navigation:bc,revalidation:"idle",restoreScrollPosition:ee,preventScrollReset:ne,blockers:te},{viewTransitionOpts:re,flushSync:U===!0}),ae="POP",ze=!1,Ae=!1,_e=!1,O=!1,Ee?.resolve(),Ee=null,Se?.resolve(),Se=null}async function Gt(b,w){if(Ee?.resolve(),Ee=null,typeof b=="number"){Ee||(Ee=Ny());let Le=Ee.promise;return a.history.go(b),Le}let U=zc(A.location,A.matches,y,b,w?.fromRouteId,w?.relative),{path:k,submission:$,error:se}=Sy(!1,U,w),te=A.location,ee=hr(A.location,k,w&&w.state);ee={...ee,...a.history.encodeLocation(ee)};let ne=w&&w.replace!=null?w.replace:void 0,re="PUSH";ne===!0?re="REPLACE":ne===!1||$!=null&&qt($.formMethod)&&$.formAction===A.location.pathname+A.location.search&&(re="REPLACE");let me=w&&"preventScrollReset"in w?w.preventScrollReset===!0:void 0,oe=(w&&w.flushSync)===!0,Ve=na({currentLocation:te,nextLocation:ee,historyAction:re});if(Ve){zn(Ve,{state:"blocked",location:ee,proceed(){zn(Ve,{state:"proceeding",proceed:void 0,reset:void 0,location:ee}),Gt(b,w)},reset(){let Le=new Map(A.blockers);Le.set(Ve,ar),Ie({blockers:Le})}});return}await kt(re,ee,{submission:$,pendingError:se,preventScrollReset:me,replace:w&&w.replace,enableViewTransition:w&&w.viewTransition,flushSync:oe,callSiteDefaultShouldRevalidate:w&&w.unstable_defaultShouldRevalidate})}function Ia(){Se||(Se=Ny()),Ta(),Ie({revalidation:"loading"});let b=Se.promise;return A.navigation.state==="submitting"?b:A.navigation.state==="idle"?(kt(A.historyAction,A.location,{startUninterruptedRevalidation:!0}),b):(kt(ae||A.historyAction,A.navigation.location,{overrideNavigation:A.navigation,enableViewTransition:Ae===!0}),b)}async function kt(b,w,U){Oe&&Oe.abort(),Oe=null,ae=b,_e=(U&&U.startUninterruptedRevalidation)===!0,tt(A.location,A.matches),ze=(U&&U.preventScrollReset)===!0,Ae=(U&&U.enableViewTransition)===!0;let k=g||m,$=U&&U.overrideNavigation,se=U?.initialHydration&&A.matches&&A.matches.length>0&&!W?A.matches:Za(k,w,y),te=(U&&U.flushSync)===!0;if(se&&A.initialized&&!O&&g1(A.location,w)&&!(U&&U.submission&&qt(U.submission.formMethod))){Cn(w,{matches:se},{flushSync:te});return}let ee=yt(se,k,w.pathname);if(ee.active&&ee.matches&&(se=ee.matches),!se){let{error:ct,notFoundMatches:ft,route:Be}=Nn(w.pathname);Cn(w,{matches:ft,loaderData:{},errors:{[Be.id]:ct}},{flushSync:te});return}Oe=new AbortController;let ne=si(a.history,w,Oe.signal,U&&U.submission),re=a.getContext?await a.getContext():new my,me;if(U&&U.pendingError)me=[Ja(se).route.id,{type:"error",error:U.pendingError}];else if(U&&U.submission&&qt(U.submission.formMethod)){let ct=await In(ne,w,U.submission,se,re,ee.active,U&&U.initialHydration===!0,{replace:U.replace,flushSync:te});if(ct.shortCircuited)return;if(ct.pendingActionResult){let[ft,Be]=ct.pendingActionResult;if(fn(Be)&&yr(Be.error)&&Be.error.status===404){Oe=null,Cn(w,{matches:ct.matches,loaderData:{},errors:{[ft]:Be.error}});return}}se=ct.matches||se,me=ct.pendingActionResult,$=Sc(w,U.submission),te=!1,ee.active=!1,ne=si(a.history,ne.url,ne.signal)}let{shortCircuited:oe,matches:Ve,loaderData:Le,errors:ot}=await el(ne,w,se,re,ee.active,$,U&&U.submission,U&&U.fetcherSubmission,U&&U.replace,U&&U.initialHydration===!0,te,me,U&&U.callSiteDefaultShouldRevalidate);oe||(Oe=null,Cn(w,{matches:Ve||se,...Dy(me),loaderData:Le,errors:ot}))}async function In(b,w,U,k,$,se,te,ee={}){Ta();let ne=x1(w,U);if(Ie({navigation:ne},{flushSync:ee.flushSync===!0}),se){let oe=await tn(k,w.pathname,b.signal);if(oe.type==="aborted")return{shortCircuited:!0};if(oe.type==="error"){if(oe.partialMatches.length===0){let{matches:Le,route:ot}=Ns(m);return{matches:Le,pendingActionResult:[ot.id,{type:"error",error:oe.error}]}}let Ve=Ja(oe.partialMatches).route.id;return{matches:oe.partialMatches,pendingActionResult:[Ve,{type:"error",error:oe.error}]}}else if(oe.matches)k=oe.matches;else{let{notFoundMatches:Ve,error:Le,route:ot}=Nn(w.pathname);return{matches:Ve,pendingActionResult:[ot.id,{type:"error",error:Le}]}}}let re,me=qs(k,w);if(!me.route.action&&!me.route.lazy)re={type:"error",error:On(405,{method:b.method,pathname:w.pathname,routeId:me.route.id})};else{let oe=oi(f,h,b,k,me,te?[]:u,$),Ve=await ea(b,oe,$,null);if(re=Ve[me.route.id],!re){for(let Le of k)if(Ve[Le.route.id]){re=Ve[Le.route.id];break}}if(b.signal.aborted)return{shortCircuited:!0}}if(Tl(re)){let oe;return ee&&ee.replace!=null?oe=ee.replace:oe=xy(re.response.headers.get("Location"),new URL(b.url),y,a.history)===A.location.pathname+A.location.search,await ut(b,re,!0,{submission:U,replace:oe}),{shortCircuited:!0}}if(fn(re)){let oe=Ja(k,me.route.id);return(ee&&ee.replace)!==!0&&(ae="PUSH"),{matches:k,pendingActionResult:[oe.route.id,re,me.route.id]}}return{matches:k,pendingActionResult:[me.route.id,re]}}async function el(b,w,U,k,$,se,te,ee,ne,re,me,oe,Ve){let Le=se||Sc(w,te),ot=te||ee||zy(Le),ct=!_e&&!re;if($){if(ct){let pt=Bt(oe);Ie({navigation:Le,...pt!==void 0?{actionData:pt}:{}},{flushSync:me})}let He=await tn(U,w.pathname,b.signal);if(He.type==="aborted")return{shortCircuited:!0};if(He.type==="error"){if(He.partialMatches.length===0){let{matches:Bn,route:Ct}=Ns(m);return{matches:Bn,loaderData:{},errors:{[Ct.id]:He.error}}}let pt=Ja(He.partialMatches).route.id;return{matches:He.partialMatches,loaderData:{},errors:{[pt]:He.error}}}else if(He.matches)U=He.matches;else{let{error:pt,notFoundMatches:Bn,route:Ct}=Nn(w.pathname);return{matches:Bn,loaderData:{},errors:{[Ct.id]:pt}}}}let ft=g||m,{dsMatches:Be,revalidatingFetchers:Ot}=Ey(b,k,f,h,a.history,A,U,ot,w,re?[]:u,re===!0,O,X,I,q,B,ft,y,a.patchRoutesOnNavigation!=null,oe,Ve);if(de=++ce,!a.dataStrategy&&!Be.some(He=>He.shouldLoad)&&!Be.some(He=>He.route.middleware&&He.route.middleware.length>0)&&Ot.length===0){let He=Rt();return Cn(w,{matches:U,loaderData:{},errors:oe&&fn(oe[1])?{[oe[0]]:oe[1].error}:null,...Dy(oe),...He?{fetchers:new Map(A.fetchers)}:{}},{flushSync:me}),{shortCircuited:!0}}if(ct){let He={};if(!$){He.navigation=Le;let pt=Bt(oe);pt!==void 0&&(He.actionData=pt)}Ot.length>0&&(He.fetchers=tl(Ot)),Ie(He,{flushSync:me})}Ot.forEach(He=>{at(He.key),He.controller&&F.set(He.key,He.controller)});let Kt=()=>Ot.forEach(He=>at(He.key));Oe&&Oe.signal.addEventListener("abort",Kt);let{loaderResults:rt,fetcherResults:Un}=await kn(Be,Ot,b,k);if(b.signal.aborted)return{shortCircuited:!0};Oe&&Oe.signal.removeEventListener("abort",Kt),Ot.forEach(He=>F.delete(He.key));let nn=Us(rt);if(nn)return await ut(b,nn.result,!0,{replace:ne}),{shortCircuited:!0};if(nn=Us(Un),nn)return B.add(nn.key),await ut(b,nn.result,!0,{replace:ne}),{shortCircuited:!0};let{loaderData:Ln,errors:vn}=Ay(A,U,rt,oe,Ot,Un);re&&A.errors&&(vn={...A.errors,...vn});let la=Rt(),ll=Ol(de),il=la||ll||Ot.length>0;return{matches:U,loaderData:Ln,errors:vn,...il?{fetchers:new Map(A.fetchers)}:{}}}function Bt(b){if(b&&!fn(b[1]))return{[b[0]]:b[1].data};if(A.actionData)return Object.keys(A.actionData).length===0?null:A.actionData}function tl(b){return b.forEach(w=>{let U=A.fetchers.get(w.key),k=lr(void 0,U?U.data:void 0);A.fetchers.set(w.key,k)}),new Map(A.fetchers)}async function nl(b,w,U,k){at(b);let $=(k&&k.flushSync)===!0,se=g||m,te=zc(A.location,A.matches,y,U,w,k?.relative),ee=Za(se,te,y),ne=yt(ee,se,te);if(ne.active&&ne.matches&&(ee=ne.matches),!ee){Yt(b,w,On(404,{pathname:te}),{flushSync:$});return}let{path:re,submission:me,error:oe}=Sy(!0,te,k);if(oe){Yt(b,w,oe,{flushSync:$});return}let Ve=a.getContext?await a.getContext():new my,Le=(k&&k.preventScrollReset)===!0;if(me&&qt(me.formMethod)){await Mt(b,w,re,ee,Ve,ne.active,$,Le,me,k&&k.unstable_defaultShouldRevalidate);return}q.set(b,{routeId:w,path:re}),await Gn(b,w,re,ee,Ve,ne.active,$,Le,me)}async function Mt(b,w,U,k,$,se,te,ee,ne,re){Ta(),q.delete(b);let me=A.fetchers.get(b);Dt(b,O1(ne,me),{flushSync:te});let oe=new AbortController,Ve=si(a.history,U,oe.signal,ne);if(se){let je=await tn(k,new URL(Ve.url).pathname,Ve.signal,b);if(je.type==="aborted")return;if(je.type==="error"){Yt(b,w,je.error,{flushSync:te});return}else if(je.matches)k=je.matches;else{Yt(b,w,On(404,{pathname:U}),{flushSync:te});return}}let Le=qs(k,U);if(!Le.route.action&&!Le.route.lazy){let je=On(405,{method:ne.formMethod,pathname:U,routeId:w});Yt(b,w,je,{flushSync:te});return}F.set(b,oe);let ot=ce,ct=oi(f,h,Ve,k,Le,u,$),ft=await ea(Ve,ct,$,b),Be=ft[Le.route.id];if(!Be){for(let je of ct)if(ft[je.route.id]){Be=ft[je.route.id];break}}if(Ve.signal.aborted){F.get(b)===oe&&F.delete(b);return}if(I.has(b)){if(Tl(Be)||fn(Be)){Dt(b,_a(void 0));return}}else{if(Tl(Be))if(F.delete(b),de>ot){Dt(b,_a(void 0));return}else return B.add(b),Dt(b,lr(ne)),ut(Ve,Be,!1,{fetcherSubmission:ne,preventScrollReset:ee});if(fn(Be)){Yt(b,w,Be.error);return}}let Ot=A.navigation.location||A.location,Kt=si(a.history,Ot,oe.signal),rt=g||m,Un=A.navigation.state!=="idle"?Za(rt,A.navigation.location,y):A.matches;Me(Un,"Didn't find any matches after fetcher action");let nn=++ce;_.set(b,nn);let Ln=lr(ne,Be.data);A.fetchers.set(b,Ln);let{dsMatches:vn,revalidatingFetchers:la}=Ey(Kt,$,f,h,a.history,A,Un,ne,Ot,u,!1,O,X,I,q,B,rt,y,a.patchRoutesOnNavigation!=null,[Le.route.id,Be],re);la.filter(je=>je.key!==b).forEach(je=>{let rl=je.key,Sr=A.fetchers.get(rl),hi=lr(void 0,Sr?Sr.data:void 0);A.fetchers.set(rl,hi),at(rl),je.controller&&F.set(rl,je.controller)}),Ie({fetchers:new Map(A.fetchers)});let ll=()=>la.forEach(je=>at(je.key));oe.signal.addEventListener("abort",ll);let{loaderResults:il,fetcherResults:He}=await kn(vn,la,Kt,$);if(oe.signal.aborted)return;if(oe.signal.removeEventListener("abort",ll),_.delete(b),F.delete(b),la.forEach(je=>F.delete(je.key)),A.fetchers.has(b)){let je=_a(Be.data);A.fetchers.set(b,je)}let pt=Us(il);if(pt)return ut(Kt,pt.result,!1,{preventScrollReset:ee});if(pt=Us(He),pt)return B.add(pt.key),ut(Kt,pt.result,!1,{preventScrollReset:ee});let{loaderData:Bn,errors:Ct}=Ay(A,Un,il,void 0,la,He);Ol(nn),A.navigation.state==="loading"&&nn>de?(Me(ae,"Expected pending action"),Oe&&Oe.abort(),Cn(A.navigation.location,{matches:Un,loaderData:Bn,errors:Ct,fetchers:new Map(A.fetchers)})):(Ie({errors:Ct,loaderData:My(A.loaderData,Bn,Un,Ct),fetchers:new Map(A.fetchers)}),O=!1)}async function Gn(b,w,U,k,$,se,te,ee,ne){let re=A.fetchers.get(b);Dt(b,lr(ne,re?re.data:void 0),{flushSync:te});let me=new AbortController,oe=si(a.history,U,me.signal);if(se){let Be=await tn(k,new URL(oe.url).pathname,oe.signal,b);if(Be.type==="aborted")return;if(Be.type==="error"){Yt(b,w,Be.error,{flushSync:te});return}else if(Be.matches)k=Be.matches;else{Yt(b,w,On(404,{pathname:U}),{flushSync:te});return}}let Ve=qs(k,U);F.set(b,me);let Le=ce,ot=oi(f,h,oe,k,Ve,u,$),ft=(await ea(oe,ot,$,b))[Ve.route.id];if(F.get(b)===me&&F.delete(b),!oe.signal.aborted){if(I.has(b)){Dt(b,_a(void 0));return}if(Tl(ft))if(de>Le){Dt(b,_a(void 0));return}else{B.add(b),await ut(oe,ft,!1,{preventScrollReset:ee});return}if(fn(ft)){Yt(b,w,ft.error);return}Dt(b,_a(ft.data))}}async function ut(b,w,U,{submission:k,fetcherSubmission:$,preventScrollReset:se,replace:te}={}){U||(Ee?.resolve(),Ee=null),w.response.headers.has("X-Remix-Revalidate")&&(O=!0);let ee=w.response.headers.get("Location");Me(ee,"Expected a Location header on the redirect Response"),ee=xy(ee,new URL(b.url),y,a.history);let ne=hr(A.location,ee,{_isRedirect:!0});if(r){let ot=!1;if(w.response.headers.has("X-Remix-Reload-Document"))ot=!0;else if(Xc(ee)){const ct=ip(ee,!0);ot=ct.origin!==i.location.origin||Mn(ct.pathname,y)==null}if(ot){te?i.location.replace(ee):i.location.assign(ee);return}}Oe=null;let re=te===!0||w.response.headers.has("X-Remix-Replace")?"REPLACE":"PUSH",{formMethod:me,formAction:oe,formEncType:Ve}=A.navigation;!k&&!$&&me&&oe&&Ve&&(k=zy(A.navigation));let Le=k||$;if(n1.has(w.response.status)&&Le&&qt(Le.formMethod))await kt(re,ne,{submission:{...Le,formAction:ee},preventScrollReset:se||ze,enableViewTransition:U?Ae:void 0});else{let ot=Sc(ne,k);await kt(re,ne,{overrideNavigation:ot,fetcherSubmission:$,preventScrollReset:se||ze,enableViewTransition:U?Ae:void 0})}}async function ea(b,w,U,k){let $,se={};try{$=await d1(E,b,w,k,U,!1)}catch(te){return w.filter(ee=>ee.shouldLoad).forEach(ee=>{se[ee.route.id]={type:"error",error:te}}),se}if(b.signal.aborted)return se;if(!qt(b.method))for(let te of w){if($[te.route.id]?.type==="error")break;!$.hasOwnProperty(te.route.id)&&!A.loaderData.hasOwnProperty(te.route.id)&&(!A.errors||!A.errors.hasOwnProperty(te.route.id))&&te.shouldCallHandler()&&($[te.route.id]={type:"error",result:new Error(`No result returned from dataStrategy for route ${te.route.id}`)})}for(let[te,ee]of Object.entries($))if(_1(ee)){let ne=ee.result;se[te]={type:"redirect",response:p1(ne,b,te,w,y)}}else se[te]=await y1(ee);return se}async function kn(b,w,U,k){let $=ea(U,b,k,null),se=Promise.all(w.map(async ne=>{if(ne.matches&&ne.match&&ne.request&&ne.controller){let me=(await ea(ne.request,ne.matches,k,ne.key))[ne.match.route.id];return{[ne.key]:me}}else return Promise.resolve({[ne.key]:{type:"error",error:On(404,{pathname:ne.path})}})})),te=await $,ee=(await se).reduce((ne,re)=>Object.assign(ne,re),{});return{loaderResults:te,fetcherResults:ee}}function Ta(){O=!0,q.forEach((b,w)=>{F.has(w)&&X.add(w),at(w)})}function Dt(b,w,U={}){A.fetchers.set(b,w),Ie({fetchers:new Map(A.fetchers)},{flushSync:(U&&U.flushSync)===!0})}function Yt(b,w,U,k={}){let $=Ja(A.matches,w);yn(b),Ie({errors:{[$.route.id]:U},fetchers:new Map(A.fetchers)},{flushSync:(k&&k.flushSync)===!0})}function mn(b){return J.set(b,(J.get(b)||0)+1),I.has(b)&&I.delete(b),A.fetchers.get(b)||a1}function xl(b,w){at(b,w?.reason),Dt(b,_a(null))}function yn(b){let w=A.fetchers.get(b);F.has(b)&&!(w&&w.state==="loading"&&_.has(b))&&at(b),q.delete(b),_.delete(b),B.delete(b),I.delete(b),X.delete(b),A.fetchers.delete(b)}function ta(b){let w=(J.get(b)||0)-1;w<=0?(J.delete(b),I.add(b)):J.set(b,w),Ie({fetchers:new Map(A.fetchers)})}function at(b,w){let U=F.get(b);U&&(U.abort(w),F.delete(b))}function Xt(b){for(let w of b){let U=mn(w),k=_a(U.data);A.fetchers.set(w,k)}}function Rt(){let b=[],w=!1;for(let U of B){let k=A.fetchers.get(U);Me(k,`Expected fetcher: ${U}`),k.state==="loading"&&(B.delete(U),b.push(U),w=!0)}return Xt(b),w}function Ol(b){let w=[];for(let[U,k]of _)if(k<b){let $=A.fetchers.get(U);Me($,`Expected fetcher: ${U}`),$.state==="loading"&&(at(U),_.delete(U),w.push(U))}return Xt(w),w.length>0}function al(b,w){let U=A.blockers.get(b)||ar;return ue.get(b)!==w&&ue.set(b,w),U}function en(b){A.blockers.delete(b),ue.delete(b)}function zn(b,w){let U=A.blockers.get(b)||ar;Me(U.state==="unblocked"&&w.state==="blocked"||U.state==="blocked"&&w.state==="blocked"||U.state==="blocked"&&w.state==="proceeding"||U.state==="blocked"&&w.state==="unblocked"||U.state==="proceeding"&&w.state==="unblocked",`Invalid blocker state transition: ${U.state} -> ${w.state}`);let k=new Map(A.blockers);k.set(b,w),Ie({blockers:k})}function na({currentLocation:b,nextLocation:w,historyAction:U}){if(ue.size===0)return;ue.size>1&&bt(!1,"A router only supports one blocker at a time");let k=Array.from(ue.entries()),[$,se]=k[k.length-1],te=A.blockers.get($);if(!(te&&te.state==="proceeding")&&se({currentLocation:b,nextLocation:w,historyAction:U}))return $}function Nn(b){let w=On(404,{pathname:b}),U=g||m,{matches:k,route:$}=Ns(U);return{notFoundMatches:k,route:$,error:w}}function pn(b,w,U){if(H=b,K=w,V=U||null,!G&&A.navigation===bc){G=!0;let k=mt(A.location,A.matches);k!=null&&Ie({restoreScrollPosition:k})}return()=>{H=null,K=null,V=null}}function ge(b,w){return V&&V(b,w.map(k=>Mb(k,A.loaderData)))||b.key}function tt(b,w){if(H&&K){let U=ge(b,w);H[U]=K()}}function mt(b,w){if(H){let U=ge(b,w),k=H[U];if(typeof k=="number")return k}return null}function yt(b,w,U){if(a.patchRoutesOnNavigation)if(b){if(Object.keys(b[0].params).length>0)return{active:!0,matches:ur(w,U,y,!0)}}else return{active:!0,matches:ur(w,U,y,!0)||[]};return{active:!1,matches:null}}async function tn(b,w,U,k){if(!a.patchRoutesOnNavigation)return{type:"success",matches:b};let $=b;for(;;){let se=g==null,te=g||m,ee=h;try{await a.patchRoutesOnNavigation({signal:U,path:w,matches:$,fetcherKey:k,patch:(me,oe)=>{U.aborted||_y(me,oe,te,ee,f,!1)}})}catch(me){return{type:"error",error:me,partialMatches:$}}finally{se&&!U.aborted&&(m=[...m])}if(U.aborted)return{type:"aborted"};let ne=Za(te,w,y),re=null;if(ne){if(Object.keys(ne[0].params).length===0)return{type:"success",matches:ne};if(re=ur(te,w,y,!0),!(re&&$.length<re.length&&nt($,re.slice(0,$.length))))return{type:"success",matches:ne}}if(re||(re=ur(te,w,y,!0)),!re||nt($,re))return{type:"success",matches:null};$=re}}function nt(b,w){return b.length===w.length&&b.every((U,k)=>U.route.id===w[k].route.id)}function Ht(b){h={},g=mr(b,f,void 0,h)}function aa(b,w,U=!1){let k=g==null;_y(b,w,g||m,h,f,U),k&&(m=[...m],Ie({}))}return pe={get basename(){return y},get future(){return p},get state(){return A},get routes(){return m},get window(){return i},initialize:Ze,subscribe:Dn,enableScrollRestoration:pn,navigate:Gt,fetch:nl,revalidate:Ia,createHref:b=>a.history.createHref(b),encodeLocation:b=>a.history.encodeLocation(b),getFetcher:mn,resetFetcher:xl,deleteFetcher:ta,dispose:hn,getBlocker:al,deleteBlocker:en,patchRoutes:aa,_internalFetchControllers:F,_internalSetRoutes:Ht,_internalSetStateDoNotUseOrYouWillBreakYourApp(b){Ie(b)}},a.unstable_instrumentations&&(pe=Jb(pe,a.unstable_instrumentations.map(b=>b.router).filter(Boolean))),pe}function r1(a){return a!=null&&("formData"in a&&a.formData!=null||"body"in a&&a.body!==void 0)}function zc(a,i,r,u,c,f){let h,m;if(c){h=[];for(let y of i)if(h.push(y),y.route.id===c){m=y;break}}else h=i,m=i[i.length-1];let g=Ws(u||".",Ps(h),Mn(a.pathname,r)||a.pathname,f==="path");if(u==null&&(g.search=a.search,g.hash=a.hash),(u==null||u===""||u===".")&&m){let y=Jc(g.search);if(m.route.index&&!y)g.search=g.search?g.search.replace(/^\?/,"?index&"):"?index";else if(!m.route.index&&y){let E=new URLSearchParams(g.search),p=E.getAll("index");E.delete("index"),p.filter(D=>D).forEach(D=>E.append("index",D));let R=E.toString();g.search=R?`?${R}`:""}}return r!=="/"&&(g.pathname=Vb({basename:r,pathname:g.pathname})),Pn(g)}function Sy(a,i,r){if(!r||!r1(r))return{path:i};if(r.formMethod&&!R1(r.formMethod))return{path:i,error:On(405,{method:r.formMethod})};let u=()=>({path:i,error:On(400,{type:"invalid-body"})}),f=(r.formMethod||"get").toUpperCase(),h=_p(i);if(r.body!==void 0){if(r.formEncType==="text/plain"){if(!qt(f))return u();let p=typeof r.body=="string"?r.body:r.body instanceof FormData||r.body instanceof URLSearchParams?Array.from(r.body.entries()).reduce((R,[D,H])=>`${R}${D}=${H}
11
11
  `,""):String(r.body);return{path:i,submission:{formMethod:f,formAction:h,formEncType:r.formEncType,formData:void 0,json:void 0,text:p}}}else if(r.formEncType==="application/json"){if(!qt(f))return u();try{let p=typeof r.body=="string"?JSON.parse(r.body):r.body;return{path:i,submission:{formMethod:f,formAction:h,formEncType:r.formEncType,formData:void 0,json:p,text:void 0}}}catch{return u()}}}Me(typeof FormData=="function","FormData is not available in this environment");let m,g;if(r.formData)m=Lc(r.formData),g=r.formData;else if(r.body instanceof FormData)m=Lc(r.body),g=r.body;else if(r.body instanceof URLSearchParams)m=r.body,g=Oy(m);else if(r.body==null)m=new URLSearchParams,g=new FormData;else try{m=new URLSearchParams(r.body),g=Oy(m)}catch{return u()}let y={formMethod:f,formAction:h,formEncType:r&&r.formEncType||"application/x-www-form-urlencoded",formData:g,json:void 0,text:void 0};if(qt(y.formMethod))return{path:i,submission:y};let E=Pa(i);return a&&E.search&&Jc(E.search)&&m.append("index",""),E.search=`?${m}`,{path:Pn(E),submission:y}}function Ey(a,i,r,u,c,f,h,m,g,y,E,p,R,D,H,V,K,G,Z,W,be){let ve=W?fn(W[1])?W[1].error:W[1].data:void 0,pe=c.createURL(f.location),A=c.createURL(g),ae;if(E&&f.errors){let _e=Object.keys(f.errors)[0];ae=h.findIndex(O=>O.route.id===_e)}else if(W&&fn(W[1])){let _e=W[0];ae=h.findIndex(O=>O.route.id===_e)-1}let Ee=W?W[1].statusCode:void 0,ze=Ee&&Ee>=400,Oe={currentUrl:pe,currentParams:f.matches[0]?.params||{},nextUrl:A,nextParams:h[0].params,...m,actionResult:ve,actionStatus:Ee},Ae=vr(h),Ke=h.map((_e,O)=>{let{route:X}=_e,F=null;if(ae!=null&&O>ae?F=!1:X.lazy?F=!0:Kc(X)?E?F=Nc(X,f.loaderData,f.errors):s1(f.loaderData,f.matches[O],_e)&&(F=!0):F=!1,F!==null)return Uc(r,u,a,Ae,_e,y,i,F);let ce=!1;typeof be=="boolean"?ce=be:ze?ce=!1:(p||pe.pathname+pe.search===A.pathname+A.search||pe.search!==A.search||u1(f.matches[O],_e))&&(ce=!0);let de={...Oe,defaultShouldRevalidate:ce},_=cr(_e,de);return Uc(r,u,a,Ae,_e,y,i,_,de,be)}),Qe=[];return H.forEach((_e,O)=>{if(E||!h.some(J=>J.route.id===_e.routeId)||D.has(O))return;let X=f.fetchers.get(O),F=X&&X.state!=="idle"&&X.data===void 0,ce=Za(K,_e.path,G);if(!ce){if(Z&&F)return;Qe.push({key:O,routeId:_e.routeId,path:_e.path,matches:null,match:null,request:null,controller:null});return}if(V.has(O))return;let de=qs(ce,_e.path),_=new AbortController,B=si(c,_e.path,_.signal),q=null;if(R.has(O))R.delete(O),q=oi(r,u,B,ce,de,y,i);else if(F)p&&(q=oi(r,u,B,ce,de,y,i));else{let J;typeof be=="boolean"?J=be:ze?J=!1:J=p;let I={...Oe,defaultShouldRevalidate:J};cr(de,I)&&(q=oi(r,u,B,ce,de,y,i,I))}q&&Qe.push({key:O,routeId:_e.routeId,path:_e.path,matches:q,match:de,request:B,controller:_})}),{dsMatches:Ke,revalidatingFetchers:Qe}}function Kc(a){return a.loader!=null||a.middleware!=null&&a.middleware.length>0}function Nc(a,i,r){if(a.lazy)return!0;if(!Kc(a))return!1;let u=i!=null&&a.id in i,c=r!=null&&r[a.id]!==void 0;return!u&&c?!1:typeof a.loader=="function"&&a.loader.hydrate===!0?!0:!u&&!c}function s1(a,i,r){let u=!i||r.route.id!==i.route.id,c=!a.hasOwnProperty(r.route.id);return u||c}function u1(a,i){let r=a.route.path;return a.pathname!==i.pathname||r!=null&&r.endsWith("*")&&a.params["*"]!==i.params["*"]}function cr(a,i){if(a.route.shouldRevalidate){let r=a.route.shouldRevalidate(i);if(typeof r=="boolean")return r}return i.defaultShouldRevalidate}function _y(a,i,r,u,c,f){let h;if(a){let y=u[a];Me(y,`No route found to patch children into: routeId = ${a}`),y.children||(y.children=[]),h=y.children}else h=r;let m=[],g=[];if(i.forEach(y=>{let E=h.find(p=>vp(y,p));E?g.push({existingRoute:E,newRoute:y}):m.push(y)}),m.length>0){let y=mr(m,c,[a||"_","patch",String(h?.length||"0")],u);h.push(...y)}if(f&&g.length>0)for(let y=0;y<g.length;y++){let{existingRoute:E,newRoute:p}=g[y],R=E,[D]=mr([p],c,[],{},!0);Object.assign(R,{element:D.element?D.element:R.element,errorElement:D.errorElement?D.errorElement:R.errorElement,hydrateFallbackElement:D.hydrateFallbackElement?D.hydrateFallbackElement:R.hydrateFallbackElement})}}function vp(a,i){return"id"in a&&"id"in i&&a.id===i.id?!0:a.index===i.index&&a.path===i.path&&a.caseSensitive===i.caseSensitive?(!a.children||a.children.length===0)&&(!i.children||i.children.length===0)?!0:a.children.every((r,u)=>i.children?.some(c=>vp(r,c))):!1}var Ty=new WeakMap,gp=({key:a,route:i,manifest:r,mapRouteProperties:u})=>{let c=r[i.id];if(Me(c,"No route found in manifest"),!c.lazy||typeof c.lazy!="object")return;let f=c.lazy[a];if(!f)return;let h=Ty.get(c);h||(h={},Ty.set(c,h));let m=h[a];if(m)return m;let g=(async()=>{let y=Rb(a),p=c[a]!==void 0&&a!=="hasErrorBoundary";if(y)bt(!y,"Route property "+a+" is not a supported lazy route property. This property will be ignored."),h[a]=Promise.resolve();else if(p)bt(!1,`Route "${c.id}" has a static property "${a}" defined. The lazy property will be ignored.`);else{let R=await f();R!=null&&(Object.assign(c,{[a]:R}),Object.assign(c,u(c)))}typeof c.lazy=="object"&&(c.lazy[a]=void 0,Object.values(c.lazy).every(R=>R===void 0)&&(c.lazy=void 0))})();return h[a]=g,g},wy=new WeakMap;function o1(a,i,r,u,c){let f=r[a.id];if(Me(f,"No route found in manifest"),!a.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof a.lazy=="function"){let E=wy.get(f);if(E)return{lazyRoutePromise:E,lazyHandlerPromise:E};let p=(async()=>{Me(typeof a.lazy=="function","No lazy route function found");let R=await a.lazy(),D={};for(let H in R){let V=R[H];if(V===void 0)continue;let K=Ob(H),Z=f[H]!==void 0&&H!=="hasErrorBoundary";K?bt(!K,"Route property "+H+" is not a supported property to be returned from a lazy route function. This property will be ignored."):Z?bt(!Z,`Route "${f.id}" has a static property "${H}" defined but its lazy function is also returning a value for this property. The lazy route property "${H}" will be ignored.`):D[H]=V}Object.assign(f,D),Object.assign(f,{...u(f),lazy:void 0})})();return wy.set(f,p),p.catch(()=>{}),{lazyRoutePromise:p,lazyHandlerPromise:p}}let h=Object.keys(a.lazy),m=[],g;for(let E of h){if(c&&c.includes(E))continue;let p=gp({key:E,route:a,manifest:r,mapRouteProperties:u});p&&(m.push(p),E===i&&(g=p))}let y=m.length>0?Promise.all(m).then(()=>{}):void 0;return y?.catch(()=>{}),g?.catch(()=>{}),{lazyRoutePromise:y,lazyHandlerPromise:g}}async function Ry(a){let i=a.matches.filter(c=>c.shouldLoad),r={};return(await Promise.all(i.map(c=>c.resolve()))).forEach((c,f)=>{r[i[f].route.id]=c}),r}async function c1(a){return a.matches.some(i=>i.route.middleware)?bp(a,()=>Ry(a)):Ry(a)}function bp(a,i){return f1(a,i,u=>{if(w1(u))throw u;return u},S1,r);function r(u,c,f){if(f)return Promise.resolve(Object.assign(f.value,{[c]:{type:"error",result:u}}));{let{matches:h}=a,m=Math.min(Math.max(h.findIndex(y=>y.route.id===c),0),Math.max(h.findIndex(y=>y.shouldCallHandler()),0)),g=Ja(h,h[m].route.id).route.id;return Promise.resolve({[g]:{type:"error",result:u}})}}}async function f1(a,i,r,u,c){let{matches:f,request:h,params:m,context:g,unstable_pattern:y}=a,E=f.flatMap(R=>R.route.middleware?R.route.middleware.map(D=>[R.route.id,D]):[]);return await Sp({request:h,params:m,context:g,unstable_pattern:y},E,i,r,u,c)}async function Sp(a,i,r,u,c,f,h=0){let{request:m}=a;if(m.signal.aborted)throw m.signal.reason??new Error(`Request aborted: ${m.method} ${m.url}`);let g=i[h];if(!g)return await r();let[y,E]=g,p,R=async()=>{if(p)throw new Error("You may only call `next()` once per middleware");try{return p={value:await Sp(a,i,r,u,c,f,h+1)},p.value}catch(D){return p={value:await f(D,y,p)},p.value}};try{let D=await E(a,R),H=D!=null?u(D):void 0;return c(H)?H:p?H??p.value:(p={value:await R()},p.value)}catch(D){return await f(D,y,p)}}function Ep(a,i,r,u,c){let f=gp({key:"middleware",route:u.route,manifest:i,mapRouteProperties:a}),h=o1(u.route,qt(r.method)?"action":"loader",i,a,c);return{middleware:f,route:h.lazyRoutePromise,handler:h.lazyHandlerPromise}}function Uc(a,i,r,u,c,f,h,m,g=null,y){let E=!1,p=Ep(a,i,r,c,f);return{...c,_lazyPromises:p,shouldLoad:m,shouldRevalidateArgs:g,shouldCallHandler(R){return E=!0,g?typeof y=="boolean"?cr(c,{...g,defaultShouldRevalidate:y}):typeof R=="boolean"?cr(c,{...g,defaultShouldRevalidate:R}):cr(c,g):m},resolve(R){let{lazy:D,loader:H,middleware:V}=c.route,K=E||m||R&&!qt(r.method)&&(D||H),G=V&&V.length>0&&!H&&!D;return K&&(qt(r.method)||!G)?h1({request:r,unstable_pattern:u,match:c,lazyHandlerPromise:p?.handler,lazyRoutePromise:p?.route,handlerOverride:R,scopedContext:h}):Promise.resolve({type:"data",result:void 0})}}}function oi(a,i,r,u,c,f,h,m=null){return u.map(g=>g.route.id!==c.route.id?{...g,shouldLoad:!1,shouldRevalidateArgs:m,shouldCallHandler:()=>!1,_lazyPromises:Ep(a,i,r,g,f),resolve:()=>Promise.resolve({type:"data",result:void 0})}:Uc(a,i,r,vr(u),g,f,h,!0,m))}async function d1(a,i,r,u,c,f){r.some(y=>y._lazyPromises?.middleware)&&await Promise.all(r.map(y=>y._lazyPromises?.middleware));let h={request:i,unstable_pattern:vr(r),params:r[0].params,context:c,matches:r},g=await a({...h,fetcherKey:u,runClientMiddleware:y=>{let E=h;return bp(E,()=>y({...E,fetcherKey:u,runClientMiddleware:()=>{throw new Error("Cannot call `runClientMiddleware()` from within an `runClientMiddleware` handler")}}))}});try{await Promise.all(r.flatMap(y=>[y._lazyPromises?.handler,y._lazyPromises?.route]))}catch{}return g}async function h1({request:a,unstable_pattern:i,match:r,lazyHandlerPromise:u,lazyRoutePromise:c,handlerOverride:f,scopedContext:h}){let m,g,y=qt(a.method),E=y?"action":"loader",p=R=>{let D,H=new Promise((G,Z)=>D=Z);g=()=>D(),a.signal.addEventListener("abort",g);let V=G=>typeof R!="function"?Promise.reject(new Error(`You cannot call the handler for a route which defines a boolean "${E}" [routeId: ${r.route.id}]`)):R({request:a,unstable_pattern:i,params:r.params,context:h},...G!==void 0?[G]:[]),K=(async()=>{try{return{type:"data",result:await(f?f(Z=>V(Z)):V())}}catch(G){return{type:"error",result:G}}})();return Promise.race([K,H])};try{let R=y?r.route.action:r.route.loader;if(u||c)if(R){let D,[H]=await Promise.all([p(R).catch(V=>{D=V}),u,c]);if(D!==void 0)throw D;m=H}else{await u;let D=y?r.route.action:r.route.loader;if(D)[m]=await Promise.all([p(D),c]);else if(E==="action"){let H=new URL(a.url),V=H.pathname+H.search;throw On(405,{method:a.method,pathname:V,routeId:r.route.id})}else return{type:"data",result:void 0}}else if(R)m=await p(R);else{let D=new URL(a.url),H=D.pathname+D.search;throw On(404,{pathname:H})}}catch(R){return{type:"error",result:R}}finally{g&&a.signal.removeEventListener("abort",g)}return m}async function m1(a){let i=a.headers.get("Content-Type");return i&&/\bapplication\/json\b/.test(i)?a.body==null?null:a.json():a.text()}async function y1(a){let{result:i,type:r}=a;if(Zc(i)){let u;try{u=await m1(i)}catch(c){return{type:"error",error:c}}return r==="error"?{type:"error",error:new pr(i.status,i.statusText,u),statusCode:i.status,headers:i.headers}:{type:"data",data:u,statusCode:i.status,headers:i.headers}}return r==="error"?Cy(i)?i.data instanceof Error?{type:"error",error:i.data,statusCode:i.init?.status,headers:i.init?.headers?new Headers(i.init.headers):void 0}:{type:"error",error:b1(i),statusCode:yr(i)?i.status:void 0,headers:i.init?.headers?new Headers(i.init.headers):void 0}:{type:"error",error:i,statusCode:yr(i)?i.status:void 0}:Cy(i)?{type:"data",data:i.data,statusCode:i.init?.status,headers:i.init?.headers?new Headers(i.init.headers):void 0}:{type:"data",data:i}}function p1(a,i,r,u,c){let f=a.headers.get("Location");if(Me(f,"Redirects returned/thrown from loaders/actions must have a Location header"),!Xc(f)){let h=u.slice(0,u.findIndex(m=>m.route.id===r)+1);f=zc(new URL(i.url),h,c,f),a.headers.set("Location",f)}return a}function xy(a,i,r,u){let c=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];if(Xc(a)){let f=a,h=f.startsWith("//")?new URL(i.protocol+f):new URL(f);if(c.includes(h.protocol))throw new Error("Invalid redirect location");let m=Mn(h.pathname,r)!=null;if(h.origin===i.origin&&m)return h.pathname+h.search+h.hash}try{let f=u.createURL(a);if(c.includes(f.protocol))throw new Error("Invalid redirect location")}catch{}return a}function si(a,i,r,u){let c=a.createURL(_p(i)).toString(),f={signal:r};if(u&&qt(u.formMethod)){let{formMethod:h,formEncType:m}=u;f.method=h.toUpperCase(),m==="application/json"?(f.headers=new Headers({"Content-Type":m}),f.body=JSON.stringify(u.json)):m==="text/plain"?f.body=u.text:m==="application/x-www-form-urlencoded"&&u.formData?f.body=Lc(u.formData):f.body=u.formData}return new Request(c,f)}function Lc(a){let i=new URLSearchParams;for(let[r,u]of a.entries())i.append(r,typeof u=="string"?u:u.name);return i}function Oy(a){let i=new FormData;for(let[r,u]of a.entries())i.append(r,u);return i}function v1(a,i,r,u=!1,c=!1){let f={},h=null,m,g=!1,y={},E=r&&fn(r[1])?r[1].error:void 0;return a.forEach(p=>{if(!(p.route.id in i))return;let R=p.route.id,D=i[R];if(Me(!Tl(D),"Cannot handle redirect results in processLoaderData"),fn(D)){let H=D.error;if(E!==void 0&&(H=E,E=void 0),h=h||{},c)h[R]=H;else{let V=Ja(a,R);h[V.route.id]==null&&(h[V.route.id]=H)}u||(f[R]=pp),g||(g=!0,m=yr(D.error)?D.error.status:500),D.headers&&(y[R]=D.headers)}else f[R]=D.data,D.statusCode&&D.statusCode!==200&&!g&&(m=D.statusCode),D.headers&&(y[R]=D.headers)}),E!==void 0&&r&&(h={[r[0]]:E},r[2]&&(f[r[2]]=void 0)),{loaderData:f,errors:h,statusCode:m||200,loaderHeaders:y}}function Ay(a,i,r,u,c,f){let{loaderData:h,errors:m}=v1(i,r,u);return c.filter(g=>!g.matches||g.matches.some(y=>y.shouldLoad)).forEach(g=>{let{key:y,match:E,controller:p}=g;if(p&&p.signal.aborted)return;let R=f[y];if(Me(R,"Did not find corresponding fetcher result"),fn(R)){let D=Ja(a.matches,E?.route.id);m&&m[D.route.id]||(m={...m,[D.route.id]:R.error}),a.fetchers.delete(y)}else if(Tl(R))Me(!1,"Unhandled fetcher revalidation redirect");else{let D=_a(R.data);a.fetchers.set(y,D)}}),{loaderData:h,errors:m}}function My(a,i,r,u){let c=Object.entries(i).filter(([,f])=>f!==pp).reduce((f,[h,m])=>(f[h]=m,f),{});for(let f of r){let h=f.route.id;if(!i.hasOwnProperty(h)&&a.hasOwnProperty(h)&&f.route.loader&&(c[h]=a[h]),u&&u.hasOwnProperty(h))break}return c}function Dy(a){return a?fn(a[1])?{actionData:{}}:{actionData:{[a[0]]:a[1].data}}:{}}function Ja(a,i){return(i?a.slice(0,a.findIndex(u=>u.route.id===i)+1):[...a]).reverse().find(u=>u.route.hasErrorBoundary===!0)||a[0]}function Ns(a){let i=a.length===1?a[0]:a.find(r=>r.index||!r.path||r.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:i}],route:i}}function On(a,{pathname:i,routeId:r,method:u,type:c,message:f}={}){let h="Unknown Server Error",m="Unknown @remix-run/router error";return a===400?(h="Bad Request",u&&i&&r?m=`You made a ${u} request to "${i}" but did not provide a \`loader\` for route "${r}", so there is no way to handle the request.`:c==="invalid-body"&&(m="Unable to encode submission body")):a===403?(h="Forbidden",m=`Route "${r}" does not match URL "${i}"`):a===404?(h="Not Found",m=`No route matches URL "${i}"`):a===405&&(h="Method Not Allowed",u&&i&&r?m=`You made a ${u.toUpperCase()} request to "${i}" but did not provide an \`action\` for route "${r}", so there is no way to handle the request.`:u&&(m=`Invalid request method "${u.toUpperCase()}"`)),new pr(a||500,h,new Error(m),!0)}function Us(a){let i=Object.entries(a);for(let r=i.length-1;r>=0;r--){let[u,c]=i[r];if(Tl(c))return{key:u,result:c}}}function _p(a){let i=typeof a=="string"?Pa(a):a;return Pn({...i,hash:""})}function g1(a,i){return a.pathname!==i.pathname||a.search!==i.search?!1:a.hash===""?i.hash!=="":a.hash===i.hash?!0:i.hash!==""}function b1(a){return new pr(a.init?.status??500,a.init?.statusText??"Internal Server Error",a.data)}function S1(a){return a!=null&&typeof a=="object"&&Object.entries(a).every(([i,r])=>typeof i=="string"&&E1(r))}function E1(a){return a!=null&&typeof a=="object"&&"type"in a&&"result"in a&&(a.type==="data"||a.type==="error")}function _1(a){return Zc(a.result)&&mp.has(a.result.status)}function fn(a){return a.type==="error"}function Tl(a){return(a&&a.type)==="redirect"}function Cy(a){return typeof a=="object"&&a!=null&&"type"in a&&"data"in a&&"init"in a&&a.type==="DataWithResponseInit"}function Zc(a){return a!=null&&typeof a.status=="number"&&typeof a.statusText=="string"&&typeof a.headers=="object"&&typeof a.body<"u"}function T1(a){return mp.has(a)}function w1(a){return Zc(a)&&T1(a.status)&&a.headers.has("Location")}function R1(a){return t1.has(a.toUpperCase())}function qt(a){return Ib.has(a.toUpperCase())}function Jc(a){return new URLSearchParams(a).getAll("index").some(i=>i==="")}function qs(a,i){let r=typeof i=="string"?Pa(i).search:i.search;if(a[a.length-1].route.index&&Jc(r||""))return a[a.length-1];let u=op(a);return u[u.length-1]}function zy(a){let{formMethod:i,formAction:r,formEncType:u,text:c,formData:f,json:h}=a;if(!(!i||!r||!u)){if(c!=null)return{formMethod:i,formAction:r,formEncType:u,formData:void 0,json:void 0,text:c};if(f!=null)return{formMethod:i,formAction:r,formEncType:u,formData:f,json:void 0,text:void 0};if(h!==void 0)return{formMethod:i,formAction:r,formEncType:u,formData:void 0,json:h,text:void 0}}}function Sc(a,i){return i?{state:"loading",location:a,formMethod:i.formMethod,formAction:i.formAction,formEncType:i.formEncType,formData:i.formData,json:i.json,text:i.text}:{state:"loading",location:a,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function x1(a,i){return{state:"submitting",location:a,formMethod:i.formMethod,formAction:i.formAction,formEncType:i.formEncType,formData:i.formData,json:i.json,text:i.text}}function lr(a,i){return a?{state:"loading",formMethod:a.formMethod,formAction:a.formAction,formEncType:a.formEncType,formData:a.formData,json:a.json,text:a.text,data:i}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:i}}function O1(a,i){return{state:"submitting",formMethod:a.formMethod,formAction:a.formAction,formEncType:a.formEncType,formData:a.formData,json:a.json,text:a.text,data:i?i.data:void 0}}function _a(a){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:a}}function A1(a,i){try{let r=a.sessionStorage.getItem(yp);if(r){let u=JSON.parse(r);for(let[c,f]of Object.entries(u||{}))f&&Array.isArray(f)&&i.set(c,new Set(f||[]))}}catch{}}function M1(a,i){if(i.size>0){let r={};for(let[u,c]of i)r[u]=[...c];try{a.sessionStorage.setItem(yp,JSON.stringify(r))}catch(u){bt(!1,`Failed to save applied view transitions in sessionStorage (${u}).`)}}}function Ny(){let a,i,r=new Promise((u,c)=>{a=async f=>{u(f);try{await r}catch{}},i=async f=>{c(f);try{await r}catch{}}});return{promise:r,resolve:a,reject:i}}var Rl=M.createContext(null);Rl.displayName="DataRouter";var gr=M.createContext(null);gr.displayName="DataRouterState";var Tp=M.createContext(!1);function D1(){return M.useContext(Tp)}var Fc=M.createContext({isTransitioning:!1});Fc.displayName="ViewTransition";var wp=M.createContext(new Map);wp.displayName="Fetchers";var C1=M.createContext(null);C1.displayName="Await";var dn=M.createContext(null);dn.displayName="Navigation";var Is=M.createContext(null);Is.displayName="Location";var Vn=M.createContext({outlet:null,matches:[],isDataRoute:!1});Vn.displayName="Route";var $c=M.createContext(null);$c.displayName="RouteError";var Rp="REACT_ROUTER_ERROR",z1="REDIRECT",N1="ROUTE_ERROR_RESPONSE";function U1(a){if(a.startsWith(`${Rp}:${z1}:{`))try{let i=JSON.parse(a.slice(28));if(typeof i=="object"&&i&&typeof i.status=="number"&&typeof i.statusText=="string"&&typeof i.location=="string"&&typeof i.reloadDocument=="boolean"&&typeof i.replace=="boolean")return i}catch{}}function L1(a){if(a.startsWith(`${Rp}:${N1}:{`))try{let i=JSON.parse(a.slice(40));if(typeof i=="object"&&i&&typeof i.status=="number"&&typeof i.statusText=="string")return new pr(i.status,i.statusText,i.data)}catch{}}function B1(a,{relative:i}={}){Me(fi(),"useHref() may be used only in the context of a <Router> component.");let{basename:r,navigator:u}=M.useContext(dn),{hash:c,pathname:f,search:h}=br(a,{relative:i}),m=f;return r!=="/"&&(m=f==="/"?r:$n([r,f])),u.createHref({pathname:m,search:h,hash:c})}function fi(){return M.useContext(Is)!=null}function Wa(){return Me(fi(),"useLocation() may be used only in the context of a <Router> component."),M.useContext(Is).location}var xp="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Op(a){M.useContext(dn).static||M.useLayoutEffect(a)}function Pc(){let{isDataRoute:a}=M.useContext(Vn);return a?P1():H1()}function H1(){Me(fi(),"useNavigate() may be used only in the context of a <Router> component.");let a=M.useContext(Rl),{basename:i,navigator:r}=M.useContext(dn),{matches:u}=M.useContext(Vn),{pathname:c}=Wa(),f=JSON.stringify(Ps(u)),h=M.useRef(!1);return Op(()=>{h.current=!0}),M.useCallback((g,y={})=>{if(bt(h.current,xp),!h.current)return;if(typeof g=="number"){r.go(g);return}let E=Ws(g,JSON.parse(f),c,y.relative==="path");a==null&&i!=="/"&&(E.pathname=E.pathname==="/"?i:$n([i,E.pathname])),(y.replace?r.replace:r.push)(E,y.state,y)},[i,r,f,c,a])}var j1=M.createContext(null);function q1(a){let i=M.useContext(Vn).outlet;return M.useMemo(()=>i&&M.createElement(j1.Provider,{value:a},i),[i,a])}function br(a,{relative:i}={}){let{matches:r}=M.useContext(Vn),{pathname:u}=Wa(),c=JSON.stringify(Ps(r));return M.useMemo(()=>Ws(a,JSON.parse(c),u,i==="path"),[a,c,u,i])}function Y1(a,i,r,u,c){Me(fi(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:f}=M.useContext(dn),{matches:h}=M.useContext(Vn),m=h[h.length-1],g=m?m.params:{},y=m?m.pathname:"/",E=m?m.pathnameBase:"/",p=m&&m.route;{let Z=p&&p.path||"";Mp(y,!p||Z.endsWith("*")||Z.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${y}" (under <Route path="${Z}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
12
12
 
13
- Please change the parent <Route path="${Z}"> to <Route path="${Z==="/"?"*":`${Z}/*`}">.`)}let R=Wa(),D;D=R;let H=D.pathname||"/",V=H;if(E!=="/"){let Z=E.replace(/^\//,"").split("/");V="/"+H.replace(/^\//,"").split("/").slice(Z.length).join("/")}let K=Za(a,{pathname:V});return bt(p||K!=null,`No routes matched location "${D.pathname}${D.search}${D.hash}" `),bt(K==null||K[K.length-1].route.element!==void 0||K[K.length-1].route.Component!==void 0||K[K.length-1].route.lazy!==void 0,`Matched leaf route at location "${D.pathname}${D.search}${D.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`),X1(K&&K.map(Z=>Object.assign({},Z,{params:Object.assign({},g,Z.params),pathname:$n([E,f.encodeLocation?f.encodeLocation(Z.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:Z.pathname]),pathnameBase:Z.pathnameBase==="/"?E:$n([E,f.encodeLocation?f.encodeLocation(Z.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:Z.pathnameBase])})),h,r,u,c)}function Q1(){let a=$1(),i=yr(a)?`${a.status} ${a.statusText}`:a instanceof Error?a.message:JSON.stringify(a),r=a instanceof Error?a.stack:null,u="rgba(200,200,200, 0.5)",c={padding:"0.5rem",backgroundColor:u},f={padding:"2px 4px",backgroundColor:u},h=null;return console.error("Error handled by React Router default ErrorBoundary:",a),h=M.createElement(M.Fragment,null,M.createElement("p",null,"💿 Hey developer 👋"),M.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",M.createElement("code",{style:f},"ErrorBoundary")," or"," ",M.createElement("code",{style:f},"errorElement")," prop on your route.")),M.createElement(M.Fragment,null,M.createElement("h2",null,"Unexpected Application Error!"),M.createElement("h3",{style:{fontStyle:"italic"}},i),r?M.createElement("pre",{style:c},r):null,h)}var V1=M.createElement(Q1,null),Ap=class extends M.Component{constructor(a){super(a),this.state={location:a.location,revalidation:a.revalidation,error:a.error}}static getDerivedStateFromError(a){return{error:a}}static getDerivedStateFromProps(a,i){return i.location!==a.location||i.revalidation!=="idle"&&a.revalidation==="idle"?{error:a.error,location:a.location,revalidation:a.revalidation}:{error:a.error!==void 0?a.error:i.error,location:i.location,revalidation:a.revalidation||i.revalidation}}componentDidCatch(a,i){this.props.onError?this.props.onError(a,i):console.error("React Router caught the following error during render",a)}render(){let a=this.state.error;if(this.context&&typeof a=="object"&&a&&"digest"in a&&typeof a.digest=="string"){const r=L1(a.digest);r&&(a=r)}let i=a!==void 0?M.createElement(Vn.Provider,{value:this.props.routeContext},M.createElement($c.Provider,{value:a,children:this.props.component})):this.props.children;return this.context?M.createElement(G1,{error:a},i):i}};Ap.contextType=Tp;var Ec=new WeakMap;function G1({children:a,error:i}){let{basename:r}=M.useContext(dn);if(typeof i=="object"&&i&&"digest"in i&&typeof i.digest=="string"){let u=U1(i.digest);if(u){let c=Ec.get(i);if(c)throw c;let f=fp(u.location,r);if(cp&&!Ec.get(i))if(f.isExternal||u.reloadDocument)window.location.href=f.absoluteURL||f.to;else{const h=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(f.to,{replace:u.replace}));throw Ec.set(i,h),h}return M.createElement("meta",{httpEquiv:"refresh",content:`0;url=${f.absoluteURL||f.to}`})}}return a}function k1({routeContext:a,match:i,children:r}){let u=M.useContext(Rl);return u&&u.static&&u.staticContext&&(i.route.errorElement||i.route.ErrorBoundary)&&(u.staticContext._deepestRenderedBoundaryId=i.route.id),M.createElement(Vn.Provider,{value:a},r)}function X1(a,i=[],r=null,u=null,c=null){if(a==null){if(!r)return null;if(r.errors)a=r.matches;else if(i.length===0&&!r.initialized&&r.matches.length>0)a=r.matches;else return null}let f=a,h=r?.errors;if(h!=null){let E=f.findIndex(p=>p.route.id&&h?.[p.route.id]!==void 0);Me(E>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(h).join(",")}`),f=f.slice(0,Math.min(f.length,E+1))}let m=!1,g=-1;if(r)for(let E=0;E<f.length;E++){let p=f[E];if((p.route.HydrateFallback||p.route.hydrateFallbackElement)&&(g=E),p.route.id){let{loaderData:R,errors:D}=r,H=p.route.loader&&!R.hasOwnProperty(p.route.id)&&(!D||D[p.route.id]===void 0);if(p.route.lazy||H){m=!0,g>=0?f=f.slice(0,g+1):f=[f[0]];break}}}let y=r&&u?(E,p)=>{u(E,{location:r.location,params:r.matches?.[0]?.params??{},unstable_pattern:vr(r.matches),errorInfo:p})}:void 0;return f.reduceRight((E,p,R)=>{let D,H=!1,V=null,K=null;r&&(D=h&&p.route.id?h[p.route.id]:void 0,V=p.route.errorElement||V1,m&&(g<0&&R===0?(Mp("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),H=!0,K=null):g===R&&(H=!0,K=p.route.hydrateFallbackElement||null)));let G=i.concat(f.slice(0,R+1)),Z=()=>{let W;return D?W=V:H?W=K:p.route.Component?W=M.createElement(p.route.Component,null):p.route.element?W=p.route.element:W=E,M.createElement(k1,{match:p,routeContext:{outlet:E,matches:G,isDataRoute:r!=null},children:W})};return r&&(p.route.ErrorBoundary||p.route.errorElement||R===0)?M.createElement(Ap,{location:r.location,revalidation:r.revalidation,component:V,error:D,children:Z(),routeContext:{outlet:null,matches:G,isDataRoute:!0},onError:y}):Z()},null)}function Wc(a){return`${a} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function K1(a){let i=M.useContext(Rl);return Me(i,Wc(a)),i}function Z1(a){let i=M.useContext(gr);return Me(i,Wc(a)),i}function J1(a){let i=M.useContext(Vn);return Me(i,Wc(a)),i}function Ic(a){let i=J1(a),r=i.matches[i.matches.length-1];return Me(r.route.id,`${a} can only be used on routes that contain a unique "id"`),r.route.id}function F1(){return Ic("useRouteId")}function $1(){let a=M.useContext($c),i=Z1("useRouteError"),r=Ic("useRouteError");return a!==void 0?a:i.errors?.[r]}function P1(){let{router:a}=K1("useNavigate"),i=Ic("useNavigate"),r=M.useRef(!1);return Op(()=>{r.current=!0}),M.useCallback(async(c,f={})=>{bt(r.current,xp),r.current&&(typeof c=="number"?await a.navigate(c):await a.navigate(c,{fromRouteId:i,...f}))},[a,i])}var Uy={};function Mp(a,i,r){!i&&!Uy[a]&&(Uy[a]=!0,bt(!1,r))}var Ly={};function By(a,i){!a&&!Ly[i]&&(Ly[i]=!0,console.warn(i))}var W1="useOptimistic",Hy=u0[W1],I1=()=>{};function eS(a){return Hy?Hy(a):[a,I1]}function tS(a){let i={hasErrorBoundary:a.hasErrorBoundary||a.ErrorBoundary!=null||a.errorElement!=null};return a.Component&&(a.element&&bt(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(i,{element:M.createElement(a.Component),Component:void 0})),a.HydrateFallback&&(a.hydrateFallbackElement&&bt(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(i,{hydrateFallbackElement:M.createElement(a.HydrateFallback),HydrateFallback:void 0})),a.ErrorBoundary&&(a.errorElement&&bt(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(i,{errorElement:M.createElement(a.ErrorBoundary),ErrorBoundary:void 0})),i}var nS=["HydrateFallback","hydrateFallbackElement"],aS=class{constructor(){this.status="pending",this.promise=new Promise((a,i)=>{this.resolve=r=>{this.status==="pending"&&(this.status="resolved",a(r))},this.reject=r=>{this.status==="pending"&&(this.status="rejected",i(r))}})}};function lS({router:a,flushSync:i,onError:r,unstable_useTransitions:u}){u=D1()||u;let[f,h]=M.useState(a.state),[m,g]=eS(f),[y,E]=M.useState(),[p,R]=M.useState({isTransitioning:!1}),[D,H]=M.useState(),[V,K]=M.useState(),[G,Z]=M.useState(),W=M.useRef(new Map),be=M.useCallback((ae,{deletedFetchers:Ee,newErrors:ze,flushSync:Oe,viewTransitionOpts:Ae})=>{ze&&r&&Object.values(ze).forEach(Qe=>r(Qe,{location:ae.location,params:ae.matches[0]?.params??{},unstable_pattern:vr(ae.matches)})),ae.fetchers.forEach((Qe,_e)=>{Qe.data!==void 0&&W.current.set(_e,Qe.data)}),Ee.forEach(Qe=>W.current.delete(Qe)),By(Oe===!1||i!=null,'You provided the `flushSync` option to a router update, but you are not using the `<RouterProvider>` from `react-router/dom` so `ReactDOM.flushSync()` is unavailable. Please update your app to `import { RouterProvider } from "react-router/dom"` and ensure you have `react-dom` installed as a dependency to use the `flushSync` option.');let Ke=a.window!=null&&a.window.document!=null&&typeof a.window.document.startViewTransition=="function";if(By(Ae==null||Ke,"You provided the `viewTransition` option to a router update, but you do not appear to be running in a DOM environment as `window.startViewTransition` is not available."),!Ae||!Ke){i&&Oe?i(()=>h(ae)):u===!1?h(ae):M.startTransition(()=>{u===!0&&g(Qe=>jy(Qe,ae)),h(ae)});return}if(i&&Oe){i(()=>{V&&(D?.resolve(),V.skipTransition()),R({isTransitioning:!0,flushSync:!0,currentLocation:Ae.currentLocation,nextLocation:Ae.nextLocation})});let Qe=a.window.document.startViewTransition(()=>{i(()=>h(ae))});Qe.finished.finally(()=>{i(()=>{H(void 0),K(void 0),E(void 0),R({isTransitioning:!1})})}),i(()=>K(Qe));return}V?(D?.resolve(),V.skipTransition(),Z({state:ae,currentLocation:Ae.currentLocation,nextLocation:Ae.nextLocation})):(E(ae),R({isTransitioning:!0,flushSync:!1,currentLocation:Ae.currentLocation,nextLocation:Ae.nextLocation}))},[a.window,i,V,D,u,g,r]);M.useLayoutEffect(()=>a.subscribe(be),[a,be]),M.useEffect(()=>{p.isTransitioning&&!p.flushSync&&H(new aS)},[p]),M.useEffect(()=>{if(D&&y&&a.window){let ae=y,Ee=D.promise,ze=a.window.document.startViewTransition(async()=>{u===!1?h(ae):M.startTransition(()=>{u===!0&&g(Oe=>jy(Oe,ae)),h(ae)}),await Ee});ze.finished.finally(()=>{H(void 0),K(void 0),E(void 0),R({isTransitioning:!1})}),K(ze)}},[y,D,a.window,u,g]),M.useEffect(()=>{D&&y&&m.location.key===y.location.key&&D.resolve()},[D,V,m.location,y]),M.useEffect(()=>{!p.isTransitioning&&G&&(E(G.state),R({isTransitioning:!0,flushSync:!1,currentLocation:G.currentLocation,nextLocation:G.nextLocation}),Z(void 0))},[p.isTransitioning,G]);let ve=M.useMemo(()=>({createHref:a.createHref,encodeLocation:a.encodeLocation,go:ae=>a.navigate(ae),push:(ae,Ee,ze)=>a.navigate(ae,{state:Ee,preventScrollReset:ze?.preventScrollReset}),replace:(ae,Ee,ze)=>a.navigate(ae,{replace:!0,state:Ee,preventScrollReset:ze?.preventScrollReset})}),[a]),pe=a.basename||"/",A=M.useMemo(()=>({router:a,navigator:ve,static:!1,basename:pe,onError:r}),[a,ve,pe,r]);return M.createElement(M.Fragment,null,M.createElement(Rl.Provider,{value:A},M.createElement(gr.Provider,{value:m},M.createElement(wp.Provider,{value:W.current},M.createElement(Fc.Provider,{value:p},M.createElement(uS,{basename:pe,location:m.location,navigationType:m.historyAction,navigator:ve,unstable_useTransitions:u},M.createElement(iS,{routes:a.routes,future:a.future,state:m,onError:r})))))),null)}function jy(a,i){return{...a,navigation:i.navigation.state!=="idle"?i.navigation:a.navigation,revalidation:i.revalidation!=="idle"?i.revalidation:a.revalidation,actionData:i.navigation.state!=="submitting"?i.actionData:a.actionData,fetchers:i.fetchers}}var iS=M.memo(rS);function rS({routes:a,future:i,state:r,onError:u}){return Y1(a,void 0,r,u,i)}function sS({to:a,replace:i,state:r,relative:u}){Me(fi(),"<Navigate> may be used only in the context of a <Router> component.");let{static:c}=M.useContext(dn);bt(!c,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:f}=M.useContext(Vn),{pathname:h}=Wa(),m=Pc(),g=Ws(a,Ps(f),h,u==="path"),y=JSON.stringify(g);return M.useEffect(()=>{m(JSON.parse(y),{replace:i,state:r,relative:u})},[m,y,u,i,r]),null}function Dp(a){return q1(a.context)}function uS({basename:a="/",children:i=null,location:r,navigationType:u="POP",navigator:c,static:f=!1,unstable_useTransitions:h}){Me(!fi(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let m=a.replace(/^\/*/,"/"),g=M.useMemo(()=>({basename:m,navigator:c,static:f,unstable_useTransitions:h,future:{}}),[m,c,f,h]);typeof r=="string"&&(r=Pa(r));let{pathname:y="/",search:E="",hash:p="",state:R=null,key:D="default"}=r,H=M.useMemo(()=>{let V=Mn(y,m);return V==null?null:{location:{pathname:V,search:E,hash:p,state:R,key:D},navigationType:u}},[m,y,E,p,R,D,u]);return bt(H!=null,`<Router basename="${m}"> is not able to match the URL "${y}${E}${p}" because it does not start with the basename, so the <Router> won't render anything.`),H==null?null:M.createElement(dn.Provider,{value:g},M.createElement(Is.Provider,{children:i,value:H}))}var Ys="get",Qs="application/x-www-form-urlencoded";function eu(a){return typeof HTMLElement<"u"&&a instanceof HTMLElement}function oS(a){return eu(a)&&a.tagName.toLowerCase()==="button"}function cS(a){return eu(a)&&a.tagName.toLowerCase()==="form"}function fS(a){return eu(a)&&a.tagName.toLowerCase()==="input"}function dS(a){return!!(a.metaKey||a.altKey||a.ctrlKey||a.shiftKey)}function hS(a,i){return a.button===0&&(!i||i==="_self")&&!dS(a)}var Ls=null;function mS(){if(Ls===null)try{new FormData(document.createElement("form"),0),Ls=!1}catch{Ls=!0}return Ls}var yS=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function _c(a){return a!=null&&!yS.has(a)?(bt(!1,`"${a}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Qs}"`),null):a}function pS(a,i){let r,u,c,f,h;if(cS(a)){let m=a.getAttribute("action");u=m?Mn(m,i):null,r=a.getAttribute("method")||Ys,c=_c(a.getAttribute("enctype"))||Qs,f=new FormData(a)}else if(oS(a)||fS(a)&&(a.type==="submit"||a.type==="image")){let m=a.form;if(m==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let g=a.getAttribute("formaction")||m.getAttribute("action");if(u=g?Mn(g,i):null,r=a.getAttribute("formmethod")||m.getAttribute("method")||Ys,c=_c(a.getAttribute("formenctype"))||_c(m.getAttribute("enctype"))||Qs,f=new FormData(m,a),!mS()){let{name:y,type:E,value:p}=a;if(E==="image"){let R=y?`${y}.`:"";f.append(`${R}x`,"0"),f.append(`${R}y`,"0")}else y&&f.append(y,p)}}else{if(eu(a))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');r=Ys,u=null,c=Qs,h=a}return f&&c==="text/plain"&&(h=f,f=void 0),{action:u,method:r.toLowerCase(),encType:c,formData:f,body:h}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function ef(a,i){if(a===!1||a===null||typeof a>"u")throw new Error(i)}function vS(a,i,r,u){let c=typeof a=="string"?new URL(a,typeof window>"u"?"server://singlefetch/":window.location.origin):a;return r?c.pathname.endsWith("/")?c.pathname=`${c.pathname}_.${u}`:c.pathname=`${c.pathname}.${u}`:c.pathname==="/"?c.pathname=`_root.${u}`:i&&Mn(c.pathname,i)==="/"?c.pathname=`${i.replace(/\/$/,"")}/_root.${u}`:c.pathname=`${c.pathname.replace(/\/$/,"")}.${u}`,c}async function gS(a,i){if(a.id in i)return i[a.id];try{let r=await import(a.module);return i[a.id]=r,r}catch(r){return console.error(`Error loading route module \`${a.module}\`, reloading page...`),console.error(r),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function bS(a){return a==null?!1:a.href==null?a.rel==="preload"&&typeof a.imageSrcSet=="string"&&typeof a.imageSizes=="string":typeof a.rel=="string"&&typeof a.href=="string"}async function SS(a,i,r){let u=await Promise.all(a.map(async c=>{let f=i.routes[c.route.id];if(f){let h=await gS(f,r);return h.links?h.links():[]}return[]}));return wS(u.flat(1).filter(bS).filter(c=>c.rel==="stylesheet"||c.rel==="preload").map(c=>c.rel==="stylesheet"?{...c,rel:"prefetch",as:"style"}:{...c,rel:"prefetch"}))}function qy(a,i,r,u,c,f){let h=(g,y)=>r[y]?g.route.id!==r[y].route.id:!0,m=(g,y)=>r[y].pathname!==g.pathname||r[y].route.path?.endsWith("*")&&r[y].params["*"]!==g.params["*"];return f==="assets"?i.filter((g,y)=>h(g,y)||m(g,y)):f==="data"?i.filter((g,y)=>{let E=u.routes[g.route.id];if(!E||!E.hasLoader)return!1;if(h(g,y)||m(g,y))return!0;if(g.route.shouldRevalidate){let p=g.route.shouldRevalidate({currentUrl:new URL(c.pathname+c.search+c.hash,window.origin),currentParams:r[0]?.params||{},nextUrl:new URL(a,window.origin),nextParams:g.params,defaultShouldRevalidate:!0});if(typeof p=="boolean")return p}return!0}):[]}function ES(a,i,{includeHydrateFallback:r}={}){return _S(a.map(u=>{let c=i.routes[u.route.id];if(!c)return[];let f=[c.module];return c.clientActionModule&&(f=f.concat(c.clientActionModule)),c.clientLoaderModule&&(f=f.concat(c.clientLoaderModule)),r&&c.hydrateFallbackModule&&(f=f.concat(c.hydrateFallbackModule)),c.imports&&(f=f.concat(c.imports)),f}).flat(1))}function _S(a){return[...new Set(a)]}function TS(a){let i={},r=Object.keys(a).sort();for(let u of r)i[u]=a[u];return i}function wS(a,i){let r=new Set;return new Set(i),a.reduce((u,c)=>{let f=JSON.stringify(TS(c));return r.has(f)||(r.add(f),u.push({key:f,link:c})),u},[])}function Cp(){let a=M.useContext(Rl);return ef(a,"You must render this element inside a <DataRouterContext.Provider> element"),a}function RS(){let a=M.useContext(gr);return ef(a,"You must render this element inside a <DataRouterStateContext.Provider> element"),a}var tf=M.createContext(void 0);tf.displayName="FrameworkContext";function zp(){let a=M.useContext(tf);return ef(a,"You must render this element inside a <HydratedRouter> element"),a}function xS(a,i){let r=M.useContext(tf),[u,c]=M.useState(!1),[f,h]=M.useState(!1),{onFocus:m,onBlur:g,onMouseEnter:y,onMouseLeave:E,onTouchStart:p}=i,R=M.useRef(null);M.useEffect(()=>{if(a==="render"&&h(!0),a==="viewport"){let V=G=>{G.forEach(Z=>{h(Z.isIntersecting)})},K=new IntersectionObserver(V,{threshold:.5});return R.current&&K.observe(R.current),()=>{K.disconnect()}}},[a]),M.useEffect(()=>{if(u){let V=setTimeout(()=>{h(!0)},100);return()=>{clearTimeout(V)}}},[u]);let D=()=>{c(!0)},H=()=>{c(!1),h(!1)};return r?a!=="intent"?[f,R,{}]:[f,R,{onFocus:ir(m,D),onBlur:ir(g,H),onMouseEnter:ir(y,D),onMouseLeave:ir(E,H),onTouchStart:ir(p,D)}]:[!1,R,{}]}function ir(a,i){return r=>{a&&a(r),r.defaultPrevented||i(r)}}function OS({page:a,...i}){let{router:r}=Cp(),u=M.useMemo(()=>Za(r.routes,a,r.basename),[r.routes,a,r.basename]);return u?M.createElement(MS,{page:a,matches:u,...i}):null}function AS(a){let{manifest:i,routeModules:r}=zp(),[u,c]=M.useState([]);return M.useEffect(()=>{let f=!1;return SS(a,i,r).then(h=>{f||c(h)}),()=>{f=!0}},[a,i,r]),u}function MS({page:a,matches:i,...r}){let u=Wa(),{future:c,manifest:f,routeModules:h}=zp(),{basename:m}=Cp(),{loaderData:g,matches:y}=RS(),E=M.useMemo(()=>qy(a,i,y,f,u,"data"),[a,i,y,f,u]),p=M.useMemo(()=>qy(a,i,y,f,u,"assets"),[a,i,y,f,u]),R=M.useMemo(()=>{if(a===u.pathname+u.search+u.hash)return[];let V=new Set,K=!1;if(i.forEach(Z=>{let W=f.routes[Z.route.id];!W||!W.hasLoader||(!E.some(be=>be.route.id===Z.route.id)&&Z.route.id in g&&h[Z.route.id]?.shouldRevalidate||W.hasClientLoader?K=!0:V.add(Z.route.id))}),V.size===0)return[];let G=vS(a,m,c.unstable_trailingSlashAwareDataRequests,"data");return K&&V.size>0&&G.searchParams.set("_routes",i.filter(Z=>V.has(Z.route.id)).map(Z=>Z.route.id).join(",")),[G.pathname+G.search]},[m,c.unstable_trailingSlashAwareDataRequests,g,u,f,E,i,a,h]),D=M.useMemo(()=>ES(p,f),[p,f]),H=AS(p);return M.createElement(M.Fragment,null,R.map(V=>M.createElement("link",{key:V,rel:"prefetch",as:"fetch",href:V,...r})),D.map(V=>M.createElement("link",{key:V,rel:"modulepreload",href:V,...r})),H.map(({key:V,link:K})=>M.createElement("link",{key:V,nonce:r.nonce,...K,crossOrigin:K.crossOrigin??r.crossOrigin})))}function DS(...a){return i=>{a.forEach(r=>{typeof r=="function"?r(i):r!=null&&(r.current=i)})}}var CS=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{CS&&(window.__reactRouterVersion="7.13.0")}catch{}function zS(a,i){return i1({basename:i?.basename,getContext:i?.getContext,future:i?.future,history:Eb({window:i?.window}),hydrationData:NS(),routes:a,mapRouteProperties:tS,hydrationRouteProperties:nS,dataStrategy:i?.dataStrategy,patchRoutesOnNavigation:i?.patchRoutesOnNavigation,window:i?.window,unstable_instrumentations:i?.unstable_instrumentations}).initialize()}function NS(){let a=window?.__staticRouterHydrationData;return a&&a.errors&&(a={...a,errors:US(a.errors)}),a}function US(a){if(!a)return null;let i=Object.entries(a),r={};for(let[u,c]of i)if(c&&c.__type==="RouteErrorResponse")r[u]=new pr(c.status,c.statusText,c.data,c.internal===!0);else if(c&&c.__type==="Error"){if(c.__subType){let f=window[c.__subType];if(typeof f=="function")try{let h=new f(c.message);h.stack="",r[u]=h}catch{}}if(r[u]==null){let f=new Error(c.message);f.stack="",r[u]=f}}else r[u]=c;return r}var Np=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Up=M.forwardRef(function({onClick:i,discover:r="render",prefetch:u="none",relative:c,reloadDocument:f,replace:h,state:m,target:g,to:y,preventScrollReset:E,viewTransition:p,unstable_defaultShouldRevalidate:R,...D},H){let{basename:V,unstable_useTransitions:K}=M.useContext(dn),G=typeof y=="string"&&Np.test(y),Z=fp(y,V);y=Z.to;let W=B1(y,{relative:c}),[be,ve,pe]=xS(u,D),A=HS(y,{replace:h,state:m,target:g,preventScrollReset:E,relative:c,viewTransition:p,unstable_defaultShouldRevalidate:R,unstable_useTransitions:K});function ae(ze){i&&i(ze),ze.defaultPrevented||A(ze)}let Ee=M.createElement("a",{...D,...pe,href:Z.absoluteURL||W,onClick:Z.isExternal||f?i:ae,ref:DS(H,ve),target:g,"data-discover":!G&&r==="render"?"true":void 0});return be&&!G?M.createElement(M.Fragment,null,Ee,M.createElement(OS,{page:W})):Ee});Up.displayName="Link";var Lp=M.forwardRef(function({"aria-current":i="page",caseSensitive:r=!1,className:u="",end:c=!1,style:f,to:h,viewTransition:m,children:g,...y},E){let p=br(h,{relative:y.relative}),R=Wa(),D=M.useContext(gr),{navigator:H,basename:V}=M.useContext(dn),K=D!=null&&VS(p)&&m===!0,G=H.encodeLocation?H.encodeLocation(p).pathname:p.pathname,Z=R.pathname,W=D&&D.navigation&&D.navigation.location?D.navigation.location.pathname:null;r||(Z=Z.toLowerCase(),W=W?W.toLowerCase():null,G=G.toLowerCase()),W&&V&&(W=Mn(W,V)||W);const be=G!=="/"&&G.endsWith("/")?G.length-1:G.length;let ve=Z===G||!c&&Z.startsWith(G)&&Z.charAt(be)==="/",pe=W!=null&&(W===G||!c&&W.startsWith(G)&&W.charAt(G.length)==="/"),A={isActive:ve,isPending:pe,isTransitioning:K},ae=ve?i:void 0,Ee;typeof u=="function"?Ee=u(A):Ee=[u,ve?"active":null,pe?"pending":null,K?"transitioning":null].filter(Boolean).join(" ");let ze=typeof f=="function"?f(A):f;return M.createElement(Up,{...y,"aria-current":ae,className:Ee,ref:E,style:ze,to:h,viewTransition:m},typeof g=="function"?g(A):g)});Lp.displayName="NavLink";var LS=M.forwardRef(({discover:a="render",fetcherKey:i,navigate:r,reloadDocument:u,replace:c,state:f,method:h=Ys,action:m,onSubmit:g,relative:y,preventScrollReset:E,viewTransition:p,unstable_defaultShouldRevalidate:R,...D},H)=>{let{unstable_useTransitions:V}=M.useContext(dn),K=YS(),G=QS(m,{relative:y}),Z=h.toLowerCase()==="get"?"get":"post",W=typeof m=="string"&&Np.test(m),be=ve=>{if(g&&g(ve),ve.defaultPrevented)return;ve.preventDefault();let pe=ve.nativeEvent.submitter,A=pe?.getAttribute("formmethod")||h,ae=()=>K(pe||ve.currentTarget,{fetcherKey:i,method:A,navigate:r,replace:c,state:f,relative:y,preventScrollReset:E,viewTransition:p,unstable_defaultShouldRevalidate:R});V&&r!==!1?M.startTransition(()=>ae()):ae()};return M.createElement("form",{ref:H,method:Z,action:G,onSubmit:u?g:be,...D,"data-discover":!W&&a==="render"?"true":void 0})});LS.displayName="Form";function BS(a){return`${a} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Bp(a){let i=M.useContext(Rl);return Me(i,BS(a)),i}function HS(a,{target:i,replace:r,state:u,preventScrollReset:c,relative:f,viewTransition:h,unstable_defaultShouldRevalidate:m,unstable_useTransitions:g}={}){let y=Pc(),E=Wa(),p=br(a,{relative:f});return M.useCallback(R=>{if(hS(R,i)){R.preventDefault();let D=r!==void 0?r:Pn(E)===Pn(p),H=()=>y(a,{replace:D,state:u,preventScrollReset:c,relative:f,viewTransition:h,unstable_defaultShouldRevalidate:m});g?M.startTransition(()=>H()):H()}},[E,y,p,r,u,i,a,c,f,h,m,g])}var jS=0,qS=()=>`__${String(++jS)}__`;function YS(){let{router:a}=Bp("useSubmit"),{basename:i}=M.useContext(dn),r=F1(),u=a.fetch,c=a.navigate;return M.useCallback(async(f,h={})=>{let{action:m,method:g,encType:y,formData:E,body:p}=pS(f,i);if(h.navigate===!1){let R=h.fetcherKey||qS();await u(R,r,h.action||m,{unstable_defaultShouldRevalidate:h.unstable_defaultShouldRevalidate,preventScrollReset:h.preventScrollReset,formData:E,body:p,formMethod:h.method||g,formEncType:h.encType||y,flushSync:h.flushSync})}else await c(h.action||m,{unstable_defaultShouldRevalidate:h.unstable_defaultShouldRevalidate,preventScrollReset:h.preventScrollReset,formData:E,body:p,formMethod:h.method||g,formEncType:h.encType||y,replace:h.replace,state:h.state,fromRouteId:r,flushSync:h.flushSync,viewTransition:h.viewTransition})},[u,c,i,r])}function QS(a,{relative:i}={}){let{basename:r}=M.useContext(dn),u=M.useContext(Vn);Me(u,"useFormAction must be used inside a RouteContext");let[c]=u.matches.slice(-1),f={...br(a||".",{relative:i})},h=Wa();if(a==null){f.search=h.search;let m=new URLSearchParams(f.search),g=m.getAll("index");if(g.some(E=>E==="")){m.delete("index"),g.filter(p=>p).forEach(p=>m.append("index",p));let E=m.toString();f.search=E?`?${E}`:""}}return(!a||a===".")&&c.route.index&&(f.search=f.search?f.search.replace(/^\?/,"?index&"):"?index"),r!=="/"&&(f.pathname=f.pathname==="/"?r:$n([r,f.pathname])),Pn(f)}function VS(a,{relative:i}={}){let r=M.useContext(Fc);Me(r!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:u}=Bp("useViewTransitionState"),c=br(a,{relative:i});if(!r.isTransitioning)return!1;let f=Mn(r.currentLocation.pathname,u)||r.currentLocation.pathname,h=Mn(r.nextLocation.pathname,u)||r.nextLocation.pathname;return Js(c.pathname,h)!=null||Js(c.pathname,f)!=null}function GS(a){return M.createElement(lS,{flushSync:ap.flushSync,...a})}function kS(){return he.jsx("div",{className:"min-h-screen bg-background text-foreground",children:he.jsx(Dp,{})})}const Hp=(...a)=>a.filter((i,r,u)=>!!i&&i.trim()!==""&&u.indexOf(i)===r).join(" ").trim();const XS=a=>a.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const KS=a=>a.replace(/^([A-Z])|[\s-_]+(\w)/g,(i,r,u)=>u?u.toUpperCase():r.toLowerCase());const Yy=a=>{const i=KS(a);return i.charAt(0).toUpperCase()+i.slice(1)};var ZS={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const JS=a=>{for(const i in a)if(i.startsWith("aria-")||i==="role"||i==="title")return!0;return!1};const FS=M.forwardRef(({color:a="currentColor",size:i=24,strokeWidth:r=2,absoluteStrokeWidth:u,className:c="",children:f,iconNode:h,...m},g)=>M.createElement("svg",{ref:g,...ZS,width:i,height:i,stroke:a,strokeWidth:u?Number(r)*24/Number(i):r,className:Hp("lucide",c),...!f&&!JS(m)&&{"aria-hidden":"true"},...m},[...h.map(([y,E])=>M.createElement(y,E)),...Array.isArray(f)?f:[f]]));const tu=(a,i)=>{const r=M.forwardRef(({className:u,...c},f)=>M.createElement(FS,{ref:f,iconNode:i,className:Hp(`lucide-${XS(Yy(a))}`,`lucide-${a}`,u),...c}));return r.displayName=Yy(a),r};const $S=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],PS=tu("arrow-left",$S);const WS=[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]],IS=tu("bell",WS);const eE=[["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M17 20v2",key:"1rnc9c"}],["path",{d:"M17 2v2",key:"11trls"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M2 17h2",key:"7oei6x"}],["path",{d:"M2 7h2",key:"asdhe0"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"M20 17h2",key:"1fpfkl"}],["path",{d:"M20 7h2",key:"1o8tra"}],["path",{d:"M7 20v2",key:"4gnj0m"}],["path",{d:"M7 2v2",key:"1i4yhu"}],["rect",{x:"4",y:"4",width:"16",height:"16",rx:"2",key:"1vbyd7"}],["rect",{x:"8",y:"8",width:"8",height:"8",rx:"1",key:"z9xiuo"}]],tE=tu("cpu",eE);const nE=[["path",{d:"M18 19a5 5 0 0 1-5-5v8",key:"sz5oeg"}],["path",{d:"M9 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v5",key:"1w6njk"}],["circle",{cx:"13",cy:"12",r:"2",key:"1j92g6"}],["circle",{cx:"20",cy:"19",r:"2",key:"1obnsp"}]],aE=tu("folder-git-2",nE),lE=[{to:"/settings/agents",label:"Agent 配置",icon:tE},{to:"/settings/projects",label:"项目配置",icon:aE},{to:"/settings/notifications",label:"通知",icon:IS}],iE=he.jsxs("svg",{width:"22",height:"22",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"text-neutral-900",children:[he.jsx("path",{d:"M12 2L2 7L12 12L22 7L12 2Z",fill:"currentColor"}),he.jsx("path",{d:"M2 17L12 22L22 17",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),he.jsx("path",{d:"M2 12L12 17L22 12",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]});function rE(){const a=Pc();return he.jsxs("div",{className:"h-screen flex flex-col bg-white",children:[he.jsxs("header",{className:"h-12 flex items-center justify-between px-4 border-b border-neutral-100 bg-white shrink-0 z-30",children:[he.jsxs("div",{className:"flex items-center gap-2.5",children:[iE,he.jsx("span",{className:"text-sm font-bold tracking-tight text-neutral-900",children:"Agent Tower"}),he.jsx("span",{className:"text-neutral-200 text-sm",children:"/"}),he.jsx("span",{className:"text-sm text-neutral-500",children:"设置"})]}),he.jsxs("button",{onClick:()=>a("/"),className:"flex items-center gap-1.5 text-xs text-neutral-400 hover:text-neutral-900 transition-colors",children:[he.jsx(PS,{size:14}),he.jsx("span",{children:"返回"})]})]}),he.jsxs("div",{className:"flex-1 flex overflow-hidden",children:[he.jsx("nav",{className:"w-48 border-r border-neutral-100 pt-3 px-2 shrink-0",children:lE.map(i=>he.jsxs(Lp,{to:i.to,className:({isActive:r})=>`flex items-center gap-2 px-3 py-1.5 rounded-md text-[13px] transition-colors ${r?"bg-neutral-100 text-neutral-900 font-medium":"text-neutral-500 hover:text-neutral-900 hover:bg-neutral-50"}`,children:[he.jsx(i.icon,{size:14}),he.jsx("span",{children:i.label})]},i.to))}),he.jsx("div",{className:"flex-1 overflow-y-auto",children:he.jsx(Dp,{})})]})]})}const sE=M.lazy(()=>wl(()=>import("./ProjectKanbanPage-Pk7nnDcc.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13])).then(a=>({default:a.ProjectKanbanPage}))),uE=M.lazy(()=>wl(()=>import("./DemoPage-CdT6VXkX.js"),__vite__mapDeps([14,5])).then(a=>({default:a.DemoPage}))),oE=M.lazy(()=>wl(()=>import("./AgentDemoPage-CCHa9x-c.js"),__vite__mapDeps([15,5,2,3,4,6,16,1])).then(a=>({default:a.AgentDemoPage}))),cE=M.lazy(()=>wl(()=>import("./ProfileSettingsPage-CSgX4NOe.js"),__vite__mapDeps([17,16,1,5,9,7,18])).then(a=>({default:a.ProfileSettingsPage}))),fE=M.lazy(()=>wl(()=>import("./ProviderSettingsPage-CzRDghu7.js"),__vite__mapDeps([19,8,1,5,9,7,12,4,3,18,20])).then(a=>({default:a.ProviderSettingsPage}))),dE=M.lazy(()=>wl(()=>import("./NotificationSettingsPage-CqZPABEG.js"),__vite__mapDeps([21,1,5,12,4,11,20,22])).then(a=>({default:a.NotificationSettingsPage}))),hE=M.lazy(()=>wl(()=>import("./ProjectSettingsPage-COrzQUwG.js"),__vite__mapDeps([23,10,1,5,12,4,7])).then(a=>({default:a.ProjectSettingsPage}))),mE=zS([{path:"/",element:he.jsx(kS,{}),children:[{index:!0,element:he.jsx(M.Suspense,{fallback:he.jsx("div",{className:"p-8",children:"Loading..."}),children:he.jsx(sE,{})})},{path:"demo",element:he.jsx(M.Suspense,{fallback:he.jsx("div",{className:"p-8",children:"Loading..."}),children:he.jsx(uE,{})})},{path:"agent-demo",element:he.jsx(M.Suspense,{fallback:he.jsx("div",{className:"p-8",children:"Loading..."}),children:he.jsx(oE,{})})},{path:"settings",element:he.jsx(rE,{}),children:[{index:!0,element:he.jsx(sS,{to:"agents",replace:!0})},{path:"agents",element:he.jsx(M.Suspense,{fallback:he.jsx("div",{className:"p-8",children:"Loading..."}),children:he.jsx(fE,{})})},{path:"agents-legacy",element:he.jsx(M.Suspense,{fallback:he.jsx("div",{className:"p-8",children:"Loading..."}),children:he.jsx(cE,{})})},{path:"notifications",element:he.jsx(M.Suspense,{fallback:he.jsx("div",{className:"p-8",children:"Loading..."}),children:he.jsx(dE,{})})},{path:"projects",element:he.jsx(M.Suspense,{fallback:he.jsx("div",{className:"p-8",children:"Loading..."}),children:he.jsx(hE,{})})}]}]}]);function yE(){return he.jsx(GS,{router:mE})}const Wn=Object.create(null);Wn.open="0";Wn.close="1";Wn.ping="2";Wn.pong="3";Wn.message="4";Wn.upgrade="5";Wn.noop="6";const Vs=Object.create(null);Object.keys(Wn).forEach(a=>{Vs[Wn[a]]=a});const Bc={type:"error",data:"parser error"},jp=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",qp=typeof ArrayBuffer=="function",Yp=a=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(a):a&&a.buffer instanceof ArrayBuffer,nf=({type:a,data:i},r,u)=>jp&&i instanceof Blob?r?u(i):Qy(i,u):qp&&(i instanceof ArrayBuffer||Yp(i))?r?u(i):Qy(new Blob([i]),u):u(Wn[a]+(i||"")),Qy=(a,i)=>{const r=new FileReader;return r.onload=function(){const u=r.result.split(",")[1];i("b"+(u||""))},r.readAsDataURL(a)};function Vy(a){return a instanceof Uint8Array?a:a instanceof ArrayBuffer?new Uint8Array(a):new Uint8Array(a.buffer,a.byteOffset,a.byteLength)}let Tc;function pE(a,i){if(jp&&a.data instanceof Blob)return a.data.arrayBuffer().then(Vy).then(i);if(qp&&(a.data instanceof ArrayBuffer||Yp(a.data)))return i(Vy(a.data));nf(a,!1,r=>{Tc||(Tc=new TextEncoder),i(Tc.encode(r))})}const Gy="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",or=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let a=0;a<Gy.length;a++)or[Gy.charCodeAt(a)]=a;const vE=a=>{let i=a.length*.75,r=a.length,u,c=0,f,h,m,g;a[a.length-1]==="="&&(i--,a[a.length-2]==="="&&i--);const y=new ArrayBuffer(i),E=new Uint8Array(y);for(u=0;u<r;u+=4)f=or[a.charCodeAt(u)],h=or[a.charCodeAt(u+1)],m=or[a.charCodeAt(u+2)],g=or[a.charCodeAt(u+3)],E[c++]=f<<2|h>>4,E[c++]=(h&15)<<4|m>>2,E[c++]=(m&3)<<6|g&63;return y},gE=typeof ArrayBuffer=="function",af=(a,i)=>{if(typeof a!="string")return{type:"message",data:Qp(a,i)};const r=a.charAt(0);return r==="b"?{type:"message",data:bE(a.substring(1),i)}:Vs[r]?a.length>1?{type:Vs[r],data:a.substring(1)}:{type:Vs[r]}:Bc},bE=(a,i)=>{if(gE){const r=vE(a);return Qp(r,i)}else return{base64:!0,data:a}},Qp=(a,i)=>i==="blob"?a instanceof Blob?a:new Blob([a]):a instanceof ArrayBuffer?a:a.buffer,Vp="",SE=(a,i)=>{const r=a.length,u=new Array(r);let c=0;a.forEach((f,h)=>{nf(f,!1,m=>{u[h]=m,++c===r&&i(u.join(Vp))})})},EE=(a,i)=>{const r=a.split(Vp),u=[];for(let c=0;c<r.length;c++){const f=af(r[c],i);if(u.push(f),f.type==="error")break}return u};function _E(){return new TransformStream({transform(a,i){pE(a,r=>{const u=r.length;let c;if(u<126)c=new Uint8Array(1),new DataView(c.buffer).setUint8(0,u);else if(u<65536){c=new Uint8Array(3);const f=new DataView(c.buffer);f.setUint8(0,126),f.setUint16(1,u)}else{c=new Uint8Array(9);const f=new DataView(c.buffer);f.setUint8(0,127),f.setBigUint64(1,BigInt(u))}a.data&&typeof a.data!="string"&&(c[0]|=128),i.enqueue(c),i.enqueue(r)})}})}let wc;function Bs(a){return a.reduce((i,r)=>i+r.length,0)}function Hs(a,i){if(a[0].length===i)return a.shift();const r=new Uint8Array(i);let u=0;for(let c=0;c<i;c++)r[c]=a[0][u++],u===a[0].length&&(a.shift(),u=0);return a.length&&u<a[0].length&&(a[0]=a[0].slice(u)),r}function TE(a,i){wc||(wc=new TextDecoder);const r=[];let u=0,c=-1,f=!1;return new TransformStream({transform(h,m){for(r.push(h);;){if(u===0){if(Bs(r)<1)break;const g=Hs(r,1);f=(g[0]&128)===128,c=g[0]&127,c<126?u=3:c===126?u=1:u=2}else if(u===1){if(Bs(r)<2)break;const g=Hs(r,2);c=new DataView(g.buffer,g.byteOffset,g.length).getUint16(0),u=3}else if(u===2){if(Bs(r)<8)break;const g=Hs(r,8),y=new DataView(g.buffer,g.byteOffset,g.length),E=y.getUint32(0);if(E>Math.pow(2,21)-1){m.enqueue(Bc);break}c=E*Math.pow(2,32)+y.getUint32(4),u=3}else{if(Bs(r)<c)break;const g=Hs(r,c);m.enqueue(af(f?g:wc.decode(g),i)),u=0}if(c===0||c>a){m.enqueue(Bc);break}}}})}const Gp=4;function wt(a){if(a)return wE(a)}function wE(a){for(var i in wt.prototype)a[i]=wt.prototype[i];return a}wt.prototype.on=wt.prototype.addEventListener=function(a,i){return this._callbacks=this._callbacks||{},(this._callbacks["$"+a]=this._callbacks["$"+a]||[]).push(i),this};wt.prototype.once=function(a,i){function r(){this.off(a,r),i.apply(this,arguments)}return r.fn=i,this.on(a,r),this};wt.prototype.off=wt.prototype.removeListener=wt.prototype.removeAllListeners=wt.prototype.removeEventListener=function(a,i){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var r=this._callbacks["$"+a];if(!r)return this;if(arguments.length==1)return delete this._callbacks["$"+a],this;for(var u,c=0;c<r.length;c++)if(u=r[c],u===i||u.fn===i){r.splice(c,1);break}return r.length===0&&delete this._callbacks["$"+a],this};wt.prototype.emit=function(a){this._callbacks=this._callbacks||{};for(var i=new Array(arguments.length-1),r=this._callbacks["$"+a],u=1;u<arguments.length;u++)i[u-1]=arguments[u];if(r){r=r.slice(0);for(var u=0,c=r.length;u<c;++u)r[u].apply(this,i)}return this};wt.prototype.emitReserved=wt.prototype.emit;wt.prototype.listeners=function(a){return this._callbacks=this._callbacks||{},this._callbacks["$"+a]||[]};wt.prototype.hasListeners=function(a){return!!this.listeners(a).length};const nu=typeof Promise=="function"&&typeof Promise.resolve=="function"?i=>Promise.resolve().then(i):(i,r)=>r(i,0),An=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),RE="arraybuffer";function kp(a,...i){return i.reduce((r,u)=>(a.hasOwnProperty(u)&&(r[u]=a[u]),r),{})}const xE=An.setTimeout,OE=An.clearTimeout;function au(a,i){i.useNativeTimers?(a.setTimeoutFn=xE.bind(An),a.clearTimeoutFn=OE.bind(An)):(a.setTimeoutFn=An.setTimeout.bind(An),a.clearTimeoutFn=An.clearTimeout.bind(An))}const AE=1.33;function ME(a){return typeof a=="string"?DE(a):Math.ceil((a.byteLength||a.size)*AE)}function DE(a){let i=0,r=0;for(let u=0,c=a.length;u<c;u++)i=a.charCodeAt(u),i<128?r+=1:i<2048?r+=2:i<55296||i>=57344?r+=3:(u++,r+=4);return r}function Xp(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function CE(a){let i="";for(let r in a)a.hasOwnProperty(r)&&(i.length&&(i+="&"),i+=encodeURIComponent(r)+"="+encodeURIComponent(a[r]));return i}function zE(a){let i={},r=a.split("&");for(let u=0,c=r.length;u<c;u++){let f=r[u].split("=");i[decodeURIComponent(f[0])]=decodeURIComponent(f[1])}return i}class NE extends Error{constructor(i,r,u){super(i),this.description=r,this.context=u,this.type="TransportError"}}class lf extends wt{constructor(i){super(),this.writable=!1,au(this,i),this.opts=i,this.query=i.query,this.socket=i.socket,this.supportsBinary=!i.forceBase64}onError(i,r,u){return super.emitReserved("error",new NE(i,r,u)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(i){this.readyState==="open"&&this.write(i)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(i){const r=af(i,this.socket.binaryType);this.onPacket(r)}onPacket(i){super.emitReserved("packet",i)}onClose(i){this.readyState="closed",super.emitReserved("close",i)}pause(i){}createUri(i,r={}){return i+"://"+this._hostname()+this._port()+this.opts.path+this._query(r)}_hostname(){const i=this.opts.hostname;return i.indexOf(":")===-1?i:"["+i+"]"}_port(){return this.opts.port&&(this.opts.secure&&Number(this.opts.port)!==443||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(i){const r=CE(i);return r.length?"?"+r:""}}class UE extends lf{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(i){this.readyState="pausing";const r=()=>{this.readyState="paused",i()};if(this._polling||!this.writable){let u=0;this._polling&&(u++,this.once("pollComplete",function(){--u||r()})),this.writable||(u++,this.once("drain",function(){--u||r()}))}else r()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(i){const r=u=>{if(this.readyState==="opening"&&u.type==="open"&&this.onOpen(),u.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(u)};EE(i,this.socket.binaryType).forEach(r),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){const i=()=>{this.write([{type:"close"}])};this.readyState==="open"?i():this.once("open",i)}write(i){this.writable=!1,SE(i,r=>{this.doWrite(r,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const i=this.opts.secure?"https":"http",r=this.query||{};return this.opts.timestampRequests!==!1&&(r[this.opts.timestampParam]=Xp()),!this.supportsBinary&&!r.sid&&(r.b64=1),this.createUri(i,r)}}let Kp=!1;try{Kp=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const LE=Kp;function BE(){}class HE extends UE{constructor(i){if(super(i),typeof location<"u"){const r=location.protocol==="https:";let u=location.port;u||(u=r?"443":"80"),this.xd=typeof location<"u"&&i.hostname!==location.hostname||u!==i.port}}doWrite(i,r){const u=this.request({method:"POST",data:i});u.on("success",r),u.on("error",(c,f)=>{this.onError("xhr post error",c,f)})}doPoll(){const i=this.request();i.on("data",this.onData.bind(this)),i.on("error",(r,u)=>{this.onError("xhr poll error",r,u)}),this.pollXhr=i}}let ci=class Gs extends wt{constructor(i,r,u){super(),this.createRequest=i,au(this,u),this._opts=u,this._method=u.method||"GET",this._uri=r,this._data=u.data!==void 0?u.data:null,this._create()}_create(){var i;const r=kp(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");r.xdomain=!!this._opts.xd;const u=this._xhr=this.createRequest(r);try{u.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){u.setDisableHeaderCheck&&u.setDisableHeaderCheck(!0);for(let c in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(c)&&u.setRequestHeader(c,this._opts.extraHeaders[c])}}catch{}if(this._method==="POST")try{u.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{u.setRequestHeader("Accept","*/*")}catch{}(i=this._opts.cookieJar)===null||i===void 0||i.addCookies(u),"withCredentials"in u&&(u.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(u.timeout=this._opts.requestTimeout),u.onreadystatechange=()=>{var c;u.readyState===3&&((c=this._opts.cookieJar)===null||c===void 0||c.parseCookies(u.getResponseHeader("set-cookie"))),u.readyState===4&&(u.status===200||u.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof u.status=="number"?u.status:0)},0))},u.send(this._data)}catch(c){this.setTimeoutFn(()=>{this._onError(c)},0);return}typeof document<"u"&&(this._index=Gs.requestsCount++,Gs.requests[this._index]=this)}_onError(i){this.emitReserved("error",i,this._xhr),this._cleanup(!0)}_cleanup(i){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=BE,i)try{this._xhr.abort()}catch{}typeof document<"u"&&delete Gs.requests[this._index],this._xhr=null}}_onLoad(){const i=this._xhr.responseText;i!==null&&(this.emitReserved("data",i),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}};ci.requestsCount=0;ci.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",ky);else if(typeof addEventListener=="function"){const a="onpagehide"in An?"pagehide":"unload";addEventListener(a,ky,!1)}}function ky(){for(let a in ci.requests)ci.requests.hasOwnProperty(a)&&ci.requests[a].abort()}const jE=(function(){const a=Zp({xdomain:!1});return a&&a.responseType!==null})();class qE extends HE{constructor(i){super(i);const r=i&&i.forceBase64;this.supportsBinary=jE&&!r}request(i={}){return Object.assign(i,{xd:this.xd},this.opts),new ci(Zp,this.uri(),i)}}function Zp(a){const i=a.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!i||LE))return new XMLHttpRequest}catch{}if(!i)try{return new An[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const Jp=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class YE extends lf{get name(){return"websocket"}doOpen(){const i=this.uri(),r=this.opts.protocols,u=Jp?{}:kp(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(u.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(i,r,u)}catch(c){return this.emitReserved("error",c)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=i=>this.onClose({description:"websocket connection closed",context:i}),this.ws.onmessage=i=>this.onData(i.data),this.ws.onerror=i=>this.onError("websocket error",i)}write(i){this.writable=!1;for(let r=0;r<i.length;r++){const u=i[r],c=r===i.length-1;nf(u,this.supportsBinary,f=>{try{this.doWrite(u,f)}catch{}c&&nu(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){const i=this.opts.secure?"wss":"ws",r=this.query||{};return this.opts.timestampRequests&&(r[this.opts.timestampParam]=Xp()),this.supportsBinary||(r.b64=1),this.createUri(i,r)}}const Rc=An.WebSocket||An.MozWebSocket;class QE extends YE{createSocket(i,r,u){return Jp?new Rc(i,r,u):r?new Rc(i,r):new Rc(i)}doWrite(i,r){this.ws.send(r)}}class VE extends lf{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(i){return this.emitReserved("error",i)}this._transport.closed.then(()=>{this.onClose()}).catch(i=>{this.onError("webtransport error",i)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(i=>{const r=TE(Number.MAX_SAFE_INTEGER,this.socket.binaryType),u=i.readable.pipeThrough(r).getReader(),c=_E();c.readable.pipeTo(i.writable),this._writer=c.writable.getWriter();const f=()=>{u.read().then(({done:m,value:g})=>{m||(this.onPacket(g),f())}).catch(m=>{})};f();const h={type:"open"};this.query.sid&&(h.data=`{"sid":"${this.query.sid}"}`),this._writer.write(h).then(()=>this.onOpen())})})}write(i){this.writable=!1;for(let r=0;r<i.length;r++){const u=i[r],c=r===i.length-1;this._writer.write(u).then(()=>{c&&nu(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var i;(i=this._transport)===null||i===void 0||i.close()}}const GE={websocket:QE,webtransport:VE,polling:qE},kE=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,XE=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function Hc(a){if(a.length>8e3)throw"URI too long";const i=a,r=a.indexOf("["),u=a.indexOf("]");r!=-1&&u!=-1&&(a=a.substring(0,r)+a.substring(r,u).replace(/:/g,";")+a.substring(u,a.length));let c=kE.exec(a||""),f={},h=14;for(;h--;)f[XE[h]]=c[h]||"";return r!=-1&&u!=-1&&(f.source=i,f.host=f.host.substring(1,f.host.length-1).replace(/;/g,":"),f.authority=f.authority.replace("[","").replace("]","").replace(/;/g,":"),f.ipv6uri=!0),f.pathNames=KE(f,f.path),f.queryKey=ZE(f,f.query),f}function KE(a,i){const r=/\/{2,9}/g,u=i.replace(r,"/").split("/");return(i.slice(0,1)=="/"||i.length===0)&&u.splice(0,1),i.slice(-1)=="/"&&u.splice(u.length-1,1),u}function ZE(a,i){const r={};return i.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(u,c,f){c&&(r[c]=f)}),r}const jc=typeof addEventListener=="function"&&typeof removeEventListener=="function",ks=[];jc&&addEventListener("offline",()=>{ks.forEach(a=>a())},!1);class $a extends wt{constructor(i,r){if(super(),this.binaryType=RE,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,i&&typeof i=="object"&&(r=i,i=null),i){const u=Hc(i);r.hostname=u.host,r.secure=u.protocol==="https"||u.protocol==="wss",r.port=u.port,u.query&&(r.query=u.query)}else r.host&&(r.hostname=Hc(r.host).host);au(this,r),this.secure=r.secure!=null?r.secure:typeof location<"u"&&location.protocol==="https:",r.hostname&&!r.port&&(r.port=this.secure?"443":"80"),this.hostname=r.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=r.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},r.transports.forEach(u=>{const c=u.prototype.name;this.transports.push(c),this._transportsByName[c]=u}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},r),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=zE(this.opts.query)),jc&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},ks.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(i){const r=Object.assign({},this.opts.query);r.EIO=Gp,r.transport=i,this.id&&(r.sid=this.id);const u=Object.assign({},this.opts,{query:r,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[i]);return new this._transportsByName[i](u)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const i=this.opts.rememberUpgrade&&$a.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const r=this.createTransport(i);r.open(),this.setTransport(r)}setTransport(i){this.transport&&this.transport.removeAllListeners(),this.transport=i,i.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",r=>this._onClose("transport close",r))}onOpen(){this.readyState="open",$a.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(i){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",i),this.emitReserved("heartbeat"),i.type){case"open":this.onHandshake(JSON.parse(i.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const r=new Error("server error");r.code=i.data,this._onError(r);break;case"message":this.emitReserved("data",i.data),this.emitReserved("message",i.data);break}}onHandshake(i){this.emitReserved("handshake",i),this.id=i.sid,this.transport.query.sid=i.sid,this._pingInterval=i.pingInterval,this._pingTimeout=i.pingTimeout,this._maxPayload=i.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const i=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+i,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},i),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const i=this._getWritablePackets();this.transport.send(i),this._prevBufferLen=i.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let r=1;for(let u=0;u<this.writeBuffer.length;u++){const c=this.writeBuffer[u].data;if(c&&(r+=ME(c)),u>0&&r>this._maxPayload)return this.writeBuffer.slice(0,u);r+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const i=Date.now()>this._pingTimeoutTime;return i&&(this._pingTimeoutTime=0,nu(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),i}write(i,r,u){return this._sendPacket("message",i,r,u),this}send(i,r,u){return this._sendPacket("message",i,r,u),this}_sendPacket(i,r,u,c){if(typeof r=="function"&&(c=r,r=void 0),typeof u=="function"&&(c=u,u=null),this.readyState==="closing"||this.readyState==="closed")return;u=u||{},u.compress=u.compress!==!1;const f={type:i,data:r,options:u};this.emitReserved("packetCreate",f),this.writeBuffer.push(f),c&&this.once("flush",c),this.flush()}close(){const i=()=>{this._onClose("forced close"),this.transport.close()},r=()=>{this.off("upgrade",r),this.off("upgradeError",r),i()},u=()=>{this.once("upgrade",r),this.once("upgradeError",r)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?u():i()}):this.upgrading?u():i()),this}_onError(i){if($a.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",i),this._onClose("transport error",i)}_onClose(i,r){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),jc&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const u=ks.indexOf(this._offlineEventListener);u!==-1&&ks.splice(u,1)}this.readyState="closed",this.id=null,this.emitReserved("close",i,r),this.writeBuffer=[],this._prevBufferLen=0}}}$a.protocol=Gp;class JE extends $a{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let i=0;i<this._upgrades.length;i++)this._probe(this._upgrades[i])}_probe(i){let r=this.createTransport(i),u=!1;$a.priorWebsocketSuccess=!1;const c=()=>{u||(r.send([{type:"ping",data:"probe"}]),r.once("packet",p=>{if(!u)if(p.type==="pong"&&p.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",r),!r)return;$a.priorWebsocketSuccess=r.name==="websocket",this.transport.pause(()=>{u||this.readyState!=="closed"&&(E(),this.setTransport(r),r.send([{type:"upgrade"}]),this.emitReserved("upgrade",r),r=null,this.upgrading=!1,this.flush())})}else{const R=new Error("probe error");R.transport=r.name,this.emitReserved("upgradeError",R)}}))};function f(){u||(u=!0,E(),r.close(),r=null)}const h=p=>{const R=new Error("probe error: "+p);R.transport=r.name,f(),this.emitReserved("upgradeError",R)};function m(){h("transport closed")}function g(){h("socket closed")}function y(p){r&&p.name!==r.name&&f()}const E=()=>{r.removeListener("open",c),r.removeListener("error",h),r.removeListener("close",m),this.off("close",g),this.off("upgrading",y)};r.once("open",c),r.once("error",h),r.once("close",m),this.once("close",g),this.once("upgrading",y),this._upgrades.indexOf("webtransport")!==-1&&i!=="webtransport"?this.setTimeoutFn(()=>{u||r.open()},200):r.open()}onHandshake(i){this._upgrades=this._filterUpgrades(i.upgrades),super.onHandshake(i)}_filterUpgrades(i){const r=[];for(let u=0;u<i.length;u++)~this.transports.indexOf(i[u])&&r.push(i[u]);return r}}let FE=class extends JE{constructor(i,r={}){const u=typeof i=="object"?i:r;(!u.transports||u.transports&&typeof u.transports[0]=="string")&&(u.transports=(u.transports||["polling","websocket","webtransport"]).map(c=>GE[c]).filter(c=>!!c)),super(i,u)}};function $E(a,i="",r){let u=a;r=r||typeof location<"u"&&location,a==null&&(a=r.protocol+"//"+r.host),typeof a=="string"&&(a.charAt(0)==="/"&&(a.charAt(1)==="/"?a=r.protocol+a:a=r.host+a),/^(https?|wss?):\/\//.test(a)||(typeof r<"u"?a=r.protocol+"//"+a:a="https://"+a),u=Hc(a)),u.port||(/^(http|ws)$/.test(u.protocol)?u.port="80":/^(http|ws)s$/.test(u.protocol)&&(u.port="443")),u.path=u.path||"/";const f=u.host.indexOf(":")!==-1?"["+u.host+"]":u.host;return u.id=u.protocol+"://"+f+":"+u.port+i,u.href=u.protocol+"://"+f+(r&&r.port===u.port?"":":"+u.port),u}const PE=typeof ArrayBuffer=="function",WE=a=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(a):a.buffer instanceof ArrayBuffer,Fp=Object.prototype.toString,IE=typeof Blob=="function"||typeof Blob<"u"&&Fp.call(Blob)==="[object BlobConstructor]",e2=typeof File=="function"||typeof File<"u"&&Fp.call(File)==="[object FileConstructor]";function rf(a){return PE&&(a instanceof ArrayBuffer||WE(a))||IE&&a instanceof Blob||e2&&a instanceof File}function Xs(a,i){if(!a||typeof a!="object")return!1;if(Array.isArray(a)){for(let r=0,u=a.length;r<u;r++)if(Xs(a[r]))return!0;return!1}if(rf(a))return!0;if(a.toJSON&&typeof a.toJSON=="function"&&arguments.length===1)return Xs(a.toJSON(),!0);for(const r in a)if(Object.prototype.hasOwnProperty.call(a,r)&&Xs(a[r]))return!0;return!1}function t2(a){const i=[],r=a.data,u=a;return u.data=qc(r,i),u.attachments=i.length,{packet:u,buffers:i}}function qc(a,i){if(!a)return a;if(rf(a)){const r={_placeholder:!0,num:i.length};return i.push(a),r}else if(Array.isArray(a)){const r=new Array(a.length);for(let u=0;u<a.length;u++)r[u]=qc(a[u],i);return r}else if(typeof a=="object"&&!(a instanceof Date)){const r={};for(const u in a)Object.prototype.hasOwnProperty.call(a,u)&&(r[u]=qc(a[u],i));return r}return a}function n2(a,i){return a.data=Yc(a.data,i),delete a.attachments,a}function Yc(a,i){if(!a)return a;if(a&&a._placeholder===!0){if(typeof a.num=="number"&&a.num>=0&&a.num<i.length)return i[a.num];throw new Error("illegal attachments")}else if(Array.isArray(a))for(let r=0;r<a.length;r++)a[r]=Yc(a[r],i);else if(typeof a=="object")for(const r in a)Object.prototype.hasOwnProperty.call(a,r)&&(a[r]=Yc(a[r],i));return a}const a2=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"];var Ye;(function(a){a[a.CONNECT=0]="CONNECT",a[a.DISCONNECT=1]="DISCONNECT",a[a.EVENT=2]="EVENT",a[a.ACK=3]="ACK",a[a.CONNECT_ERROR=4]="CONNECT_ERROR",a[a.BINARY_EVENT=5]="BINARY_EVENT",a[a.BINARY_ACK=6]="BINARY_ACK"})(Ye||(Ye={}));class l2{constructor(i){this.replacer=i}encode(i){return(i.type===Ye.EVENT||i.type===Ye.ACK)&&Xs(i)?this.encodeAsBinary({type:i.type===Ye.EVENT?Ye.BINARY_EVENT:Ye.BINARY_ACK,nsp:i.nsp,data:i.data,id:i.id}):[this.encodeAsString(i)]}encodeAsString(i){let r=""+i.type;return(i.type===Ye.BINARY_EVENT||i.type===Ye.BINARY_ACK)&&(r+=i.attachments+"-"),i.nsp&&i.nsp!=="/"&&(r+=i.nsp+","),i.id!=null&&(r+=i.id),i.data!=null&&(r+=JSON.stringify(i.data,this.replacer)),r}encodeAsBinary(i){const r=t2(i),u=this.encodeAsString(r.packet),c=r.buffers;return c.unshift(u),c}}class sf extends wt{constructor(i){super(),this.reviver=i}add(i){let r;if(typeof i=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");r=this.decodeString(i);const u=r.type===Ye.BINARY_EVENT;u||r.type===Ye.BINARY_ACK?(r.type=u?Ye.EVENT:Ye.ACK,this.reconstructor=new i2(r),r.attachments===0&&super.emitReserved("decoded",r)):super.emitReserved("decoded",r)}else if(rf(i)||i.base64)if(this.reconstructor)r=this.reconstructor.takeBinaryData(i),r&&(this.reconstructor=null,super.emitReserved("decoded",r));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+i)}decodeString(i){let r=0;const u={type:Number(i.charAt(0))};if(Ye[u.type]===void 0)throw new Error("unknown packet type "+u.type);if(u.type===Ye.BINARY_EVENT||u.type===Ye.BINARY_ACK){const f=r+1;for(;i.charAt(++r)!=="-"&&r!=i.length;);const h=i.substring(f,r);if(h!=Number(h)||i.charAt(r)!=="-")throw new Error("Illegal attachments");u.attachments=Number(h)}if(i.charAt(r+1)==="/"){const f=r+1;for(;++r&&!(i.charAt(r)===","||r===i.length););u.nsp=i.substring(f,r)}else u.nsp="/";const c=i.charAt(r+1);if(c!==""&&Number(c)==c){const f=r+1;for(;++r;){const h=i.charAt(r);if(h==null||Number(h)!=h){--r;break}if(r===i.length)break}u.id=Number(i.substring(f,r+1))}if(i.charAt(++r)){const f=this.tryParse(i.substr(r));if(sf.isPayloadValid(u.type,f))u.data=f;else throw new Error("invalid payload")}return u}tryParse(i){try{return JSON.parse(i,this.reviver)}catch{return!1}}static isPayloadValid(i,r){switch(i){case Ye.CONNECT:return Xy(r);case Ye.DISCONNECT:return r===void 0;case Ye.CONNECT_ERROR:return typeof r=="string"||Xy(r);case Ye.EVENT:case Ye.BINARY_EVENT:return Array.isArray(r)&&(typeof r[0]=="number"||typeof r[0]=="string"&&a2.indexOf(r[0])===-1);case Ye.ACK:case Ye.BINARY_ACK:return Array.isArray(r)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class i2{constructor(i){this.packet=i,this.buffers=[],this.reconPack=i}takeBinaryData(i){if(this.buffers.push(i),this.buffers.length===this.reconPack.attachments){const r=n2(this.reconPack,this.buffers);return this.finishedReconstruction(),r}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}function Xy(a){return Object.prototype.toString.call(a)==="[object Object]"}const r2=Object.freeze(Object.defineProperty({__proto__:null,Decoder:sf,Encoder:l2,get PacketType(){return Ye}},Symbol.toStringTag,{value:"Module"}));function Qn(a,i,r){return a.on(i,r),function(){a.off(i,r)}}const s2=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class $p extends wt{constructor(i,r,u){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=i,this.nsp=r,u&&u.auth&&(this.auth=u.auth),this._opts=Object.assign({},u),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const i=this.io;this.subs=[Qn(i,"open",this.onopen.bind(this)),Qn(i,"packet",this.onpacket.bind(this)),Qn(i,"error",this.onerror.bind(this)),Qn(i,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...i){return i.unshift("message"),this.emit.apply(this,i),this}emit(i,...r){var u,c,f;if(s2.hasOwnProperty(i))throw new Error('"'+i.toString()+'" is a reserved event name');if(r.unshift(i),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(r),this;const h={type:Ye.EVENT,data:r};if(h.options={},h.options.compress=this.flags.compress!==!1,typeof r[r.length-1]=="function"){const E=this.ids++,p=r.pop();this._registerAckCallback(E,p),h.id=E}const m=(c=(u=this.io.engine)===null||u===void 0?void 0:u.transport)===null||c===void 0?void 0:c.writable,g=this.connected&&!(!((f=this.io.engine)===null||f===void 0)&&f._hasPingExpired());return this.flags.volatile&&!m||(g?(this.notifyOutgoingListeners(h),this.packet(h)):this.sendBuffer.push(h)),this.flags={},this}_registerAckCallback(i,r){var u;const c=(u=this.flags.timeout)!==null&&u!==void 0?u:this._opts.ackTimeout;if(c===void 0){this.acks[i]=r;return}const f=this.io.setTimeoutFn(()=>{delete this.acks[i];for(let m=0;m<this.sendBuffer.length;m++)this.sendBuffer[m].id===i&&this.sendBuffer.splice(m,1);r.call(this,new Error("operation has timed out"))},c),h=(...m)=>{this.io.clearTimeoutFn(f),r.apply(this,m)};h.withError=!0,this.acks[i]=h}emitWithAck(i,...r){return new Promise((u,c)=>{const f=(h,m)=>h?c(h):u(m);f.withError=!0,r.push(f),this.emit(i,...r)})}_addToQueue(i){let r;typeof i[i.length-1]=="function"&&(r=i.pop());const u={id:this._queueSeq++,tryCount:0,pending:!1,args:i,flags:Object.assign({fromQueue:!0},this.flags)};i.push((c,...f)=>(this._queue[0],c!==null?u.tryCount>this._opts.retries&&(this._queue.shift(),r&&r(c)):(this._queue.shift(),r&&r(null,...f)),u.pending=!1,this._drainQueue())),this._queue.push(u),this._drainQueue()}_drainQueue(i=!1){if(!this.connected||this._queue.length===0)return;const r=this._queue[0];r.pending&&!i||(r.pending=!0,r.tryCount++,this.flags=r.flags,this.emit.apply(this,r.args))}packet(i){i.nsp=this.nsp,this.io._packet(i)}onopen(){typeof this.auth=="function"?this.auth(i=>{this._sendConnectPacket(i)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(i){this.packet({type:Ye.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},i):i})}onerror(i){this.connected||this.emitReserved("connect_error",i)}onclose(i,r){this.connected=!1,delete this.id,this.emitReserved("disconnect",i,r),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(i=>{if(!this.sendBuffer.some(u=>String(u.id)===i)){const u=this.acks[i];delete this.acks[i],u.withError&&u.call(this,new Error("socket has been disconnected"))}})}onpacket(i){if(i.nsp===this.nsp)switch(i.type){case Ye.CONNECT:i.data&&i.data.sid?this.onconnect(i.data.sid,i.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case Ye.EVENT:case Ye.BINARY_EVENT:this.onevent(i);break;case Ye.ACK:case Ye.BINARY_ACK:this.onack(i);break;case Ye.DISCONNECT:this.ondisconnect();break;case Ye.CONNECT_ERROR:this.destroy();const u=new Error(i.data.message);u.data=i.data.data,this.emitReserved("connect_error",u);break}}onevent(i){const r=i.data||[];i.id!=null&&r.push(this.ack(i.id)),this.connected?this.emitEvent(r):this.receiveBuffer.push(Object.freeze(r))}emitEvent(i){if(this._anyListeners&&this._anyListeners.length){const r=this._anyListeners.slice();for(const u of r)u.apply(this,i)}super.emit.apply(this,i),this._pid&&i.length&&typeof i[i.length-1]=="string"&&(this._lastOffset=i[i.length-1])}ack(i){const r=this;let u=!1;return function(...c){u||(u=!0,r.packet({type:Ye.ACK,id:i,data:c}))}}onack(i){const r=this.acks[i.id];typeof r=="function"&&(delete this.acks[i.id],r.withError&&i.data.unshift(null),r.apply(this,i.data))}onconnect(i,r){this.id=i,this.recovered=r&&this._pid===r,this._pid=r,this.connected=!0,this.emitBuffered(),this._drainQueue(!0),this.emitReserved("connect")}emitBuffered(){this.receiveBuffer.forEach(i=>this.emitEvent(i)),this.receiveBuffer=[],this.sendBuffer.forEach(i=>{this.notifyOutgoingListeners(i),this.packet(i)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(i=>i()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:Ye.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(i){return this.flags.compress=i,this}get volatile(){return this.flags.volatile=!0,this}timeout(i){return this.flags.timeout=i,this}onAny(i){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(i),this}prependAny(i){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(i),this}offAny(i){if(!this._anyListeners)return this;if(i){const r=this._anyListeners;for(let u=0;u<r.length;u++)if(i===r[u])return r.splice(u,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(i){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(i),this}prependAnyOutgoing(i){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(i),this}offAnyOutgoing(i){if(!this._anyOutgoingListeners)return this;if(i){const r=this._anyOutgoingListeners;for(let u=0;u<r.length;u++)if(i===r[u])return r.splice(u,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(i){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const r=this._anyOutgoingListeners.slice();for(const u of r)u.apply(this,i.data)}}}function di(a){a=a||{},this.ms=a.min||100,this.max=a.max||1e4,this.factor=a.factor||2,this.jitter=a.jitter>0&&a.jitter<=1?a.jitter:0,this.attempts=0}di.prototype.duration=function(){var a=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var i=Math.random(),r=Math.floor(i*this.jitter*a);a=(Math.floor(i*10)&1)==0?a-r:a+r}return Math.min(a,this.max)|0};di.prototype.reset=function(){this.attempts=0};di.prototype.setMin=function(a){this.ms=a};di.prototype.setMax=function(a){this.max=a};di.prototype.setJitter=function(a){this.jitter=a};class Qc extends wt{constructor(i,r){var u;super(),this.nsps={},this.subs=[],i&&typeof i=="object"&&(r=i,i=void 0),r=r||{},r.path=r.path||"/socket.io",this.opts=r,au(this,r),this.reconnection(r.reconnection!==!1),this.reconnectionAttempts(r.reconnectionAttempts||1/0),this.reconnectionDelay(r.reconnectionDelay||1e3),this.reconnectionDelayMax(r.reconnectionDelayMax||5e3),this.randomizationFactor((u=r.randomizationFactor)!==null&&u!==void 0?u:.5),this.backoff=new di({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(r.timeout==null?2e4:r.timeout),this._readyState="closed",this.uri=i;const c=r.parser||r2;this.encoder=new c.Encoder,this.decoder=new c.Decoder,this._autoConnect=r.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(i){return arguments.length?(this._reconnection=!!i,i||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(i){return i===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=i,this)}reconnectionDelay(i){var r;return i===void 0?this._reconnectionDelay:(this._reconnectionDelay=i,(r=this.backoff)===null||r===void 0||r.setMin(i),this)}randomizationFactor(i){var r;return i===void 0?this._randomizationFactor:(this._randomizationFactor=i,(r=this.backoff)===null||r===void 0||r.setJitter(i),this)}reconnectionDelayMax(i){var r;return i===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=i,(r=this.backoff)===null||r===void 0||r.setMax(i),this)}timeout(i){return arguments.length?(this._timeout=i,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(i){if(~this._readyState.indexOf("open"))return this;this.engine=new FE(this.uri,this.opts);const r=this.engine,u=this;this._readyState="opening",this.skipReconnect=!1;const c=Qn(r,"open",function(){u.onopen(),i&&i()}),f=m=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",m),i?i(m):this.maybeReconnectOnOpen()},h=Qn(r,"error",f);if(this._timeout!==!1){const m=this._timeout,g=this.setTimeoutFn(()=>{c(),f(new Error("timeout")),r.close()},m);this.opts.autoUnref&&g.unref(),this.subs.push(()=>{this.clearTimeoutFn(g)})}return this.subs.push(c),this.subs.push(h),this}connect(i){return this.open(i)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const i=this.engine;this.subs.push(Qn(i,"ping",this.onping.bind(this)),Qn(i,"data",this.ondata.bind(this)),Qn(i,"error",this.onerror.bind(this)),Qn(i,"close",this.onclose.bind(this)),Qn(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(i){try{this.decoder.add(i)}catch(r){this.onclose("parse error",r)}}ondecoded(i){nu(()=>{this.emitReserved("packet",i)},this.setTimeoutFn)}onerror(i){this.emitReserved("error",i)}socket(i,r){let u=this.nsps[i];return u?this._autoConnect&&!u.active&&u.connect():(u=new $p(this,i,r),this.nsps[i]=u),u}_destroy(i){const r=Object.keys(this.nsps);for(const u of r)if(this.nsps[u].active)return;this._close()}_packet(i){const r=this.encoder.encode(i);for(let u=0;u<r.length;u++)this.engine.write(r[u],i.options)}cleanup(){this.subs.forEach(i=>i()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(i,r){var u;this.cleanup(),(u=this.engine)===null||u===void 0||u.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",i,r),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const i=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const r=this.backoff.duration();this._reconnecting=!0;const u=this.setTimeoutFn(()=>{i.skipReconnect||(this.emitReserved("reconnect_attempt",i.backoff.attempts),!i.skipReconnect&&i.open(c=>{c?(i._reconnecting=!1,i.reconnect(),this.emitReserved("reconnect_error",c)):i.onreconnect()}))},r);this.opts.autoUnref&&u.unref(),this.subs.push(()=>{this.clearTimeoutFn(u)})}}onreconnect(){const i=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",i)}}const rr={};function Ks(a,i){typeof a=="object"&&(i=a,a=void 0),i=i||{};const r=$E(a,i.path||"/socket.io"),u=r.source,c=r.id,f=r.path,h=rr[c]&&f in rr[c].nsps,m=i.forceNew||i["force new connection"]||i.multiplex===!1||h;let g;return m?g=new Qc(u,i):(rr[c]||(rr[c]=new Qc(u,i)),g=rr[c]),r.query&&!i.query&&(i.query=r.queryKey),g.socket(r.path,i)}Object.assign(Ks,{Manager:Qc,Socket:$p,io:Ks,connect:Ks});const js="/events",S2={SUBSCRIBE:"subscribe",UNSUBSCRIBE:"unsubscribe",INPUT:"input",RESIZE:"resize",TERMINAL_INPUT:"terminal:input",TERMINAL_RESIZE:"terminal:resize"},E2={SESSION_SUBSCRIBED:"session:subscribed",SESSION_UNSUBSCRIBED:"session:unsubscribed",SESSION_STDOUT:"session:stdout",SESSION_PATCH:"session:patch",SESSION_EXIT:"session:exit",SESSION_COMPLETED:"session:completed",SESSION_ID:"session:sessionId",SESSION_ERROR:"session:error",TASK_UPDATED:"task:updated",TASK_DELETED:"task:deleted",TERMINAL_STDOUT:"terminal:stdout",TERMINAL_EXIT:"terminal:exit",TERMINAL_SUBSCRIBED:"terminal:subscribed",TERMINAL_UNSUBSCRIBED:"terminal:unsubscribed",WORKSPACE_SETUP_PROGRESS:"workspace:setup_progress",WORKSPACE_COMMIT_MESSAGE_UPDATED:"workspace:commit_message_updated"},Pp="agent-tower-tunnel-token";function u2(){const i=new URLSearchParams(window.location.search).get("token");if(i){sessionStorage.setItem(Pp,i);const r=new URL(window.location.href);r.searchParams.delete("token"),window.history.replaceState({},"",r.toString())}}function o2(){return sessionStorage.getItem(Pp)}function c2(){const a=window.location.hostname;return a!=="localhost"&&a!=="127.0.0.1"}class f2{socket=null;baseUrl;visibilityHandler=null;constructor(){this.baseUrl=""}getSocket(){if(!this.socket){const i={};if(c2()){const r=o2();r&&(i.token=r)}this.socket=Ks(`${this.baseUrl}${js}`,{auth:i,autoConnect:!1,transports:["websocket"],reconnection:!0,reconnectionAttempts:1/0,reconnectionDelay:1e3,reconnectionDelayMax:1e4}),this.socket.on("connect",()=>{console.log(`[Socket] Connected to ${js} t=${Date.now()}`)}),this.socket.on("disconnect",r=>{console.log(`[Socket] Disconnected from ${js}: t=${Date.now()}`,r)}),this.socket.on("connect_error",r=>{console.error(`[Socket] Connection error on ${js}: t=${Date.now()}`,r.message)})}return this.socket}connect(){const i=this.getSocket();return i.connected||i.connect(),this.visibilityHandler||(this.visibilityHandler=()=>{document.visibilityState==="visible"&&this.socket&&!this.socket.connected&&(console.log("[Socket] Page became visible, socket disconnected — reconnecting"),this.socket.connect())},document.addEventListener("visibilitychange",this.visibilityHandler)),i}disconnect(){this.visibilityHandler&&(document.removeEventListener("visibilitychange",this.visibilityHandler),this.visibilityHandler=null),this.socket&&(this.socket.disconnect(),this.socket=null)}isConnected(){return this.socket?.connected??!1}}const Ky=new f2;function d2(){return M.useEffect(()=>(Ky.connect(),()=>Ky.disconnect()),[]),he.jsxs(Q0,{client:pb,children:[he.jsx(yE,{}),he.jsx(yb,{position:"top-center",toastOptions:{className:"text-sm",style:{fontFamily:"inherit"},classNames:{error:"!bg-neutral-900 !text-neutral-100 !border-neutral-800 !shadow-lg",success:"!bg-neutral-900 !text-neutral-100 !border-neutral-800 !shadow-lg",default:"!bg-neutral-900 !text-neutral-100 !border-neutral-800 !shadow-lg"}}})]})}u2();m0.createRoot(document.getElementById("root")).render(he.jsx(M.StrictMode,{children:he.jsx(d2,{})}));export{p2 as A,y2 as B,S2 as C,Fy as D,ap as E,aE as F,tE as G,PS as H,Zy as I,Up as L,P as R,E2 as S,wl as _,Fs as a,E0 as b,tu as c,h2 as d,Oc as e,$s as f,o2 as g,b0 as h,c2 as i,he as j,xc as k,Py as l,L0 as m,Yn as n,w0 as o,M0 as p,Vt as q,M as r,Ky as s,S0 as t,v2 as u,fr as v,H0 as w,m2 as x,g2 as y,uy as z};
13
+ Please change the parent <Route path="${Z}"> to <Route path="${Z==="/"?"*":`${Z}/*`}">.`)}let R=Wa(),D;D=R;let H=D.pathname||"/",V=H;if(E!=="/"){let Z=E.replace(/^\//,"").split("/");V="/"+H.replace(/^\//,"").split("/").slice(Z.length).join("/")}let K=Za(a,{pathname:V});return bt(p||K!=null,`No routes matched location "${D.pathname}${D.search}${D.hash}" `),bt(K==null||K[K.length-1].route.element!==void 0||K[K.length-1].route.Component!==void 0||K[K.length-1].route.lazy!==void 0,`Matched leaf route at location "${D.pathname}${D.search}${D.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`),X1(K&&K.map(Z=>Object.assign({},Z,{params:Object.assign({},g,Z.params),pathname:$n([E,f.encodeLocation?f.encodeLocation(Z.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:Z.pathname]),pathnameBase:Z.pathnameBase==="/"?E:$n([E,f.encodeLocation?f.encodeLocation(Z.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:Z.pathnameBase])})),h,r,u,c)}function Q1(){let a=$1(),i=yr(a)?`${a.status} ${a.statusText}`:a instanceof Error?a.message:JSON.stringify(a),r=a instanceof Error?a.stack:null,u="rgba(200,200,200, 0.5)",c={padding:"0.5rem",backgroundColor:u},f={padding:"2px 4px",backgroundColor:u},h=null;return console.error("Error handled by React Router default ErrorBoundary:",a),h=M.createElement(M.Fragment,null,M.createElement("p",null,"💿 Hey developer 👋"),M.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",M.createElement("code",{style:f},"ErrorBoundary")," or"," ",M.createElement("code",{style:f},"errorElement")," prop on your route.")),M.createElement(M.Fragment,null,M.createElement("h2",null,"Unexpected Application Error!"),M.createElement("h3",{style:{fontStyle:"italic"}},i),r?M.createElement("pre",{style:c},r):null,h)}var V1=M.createElement(Q1,null),Ap=class extends M.Component{constructor(a){super(a),this.state={location:a.location,revalidation:a.revalidation,error:a.error}}static getDerivedStateFromError(a){return{error:a}}static getDerivedStateFromProps(a,i){return i.location!==a.location||i.revalidation!=="idle"&&a.revalidation==="idle"?{error:a.error,location:a.location,revalidation:a.revalidation}:{error:a.error!==void 0?a.error:i.error,location:i.location,revalidation:a.revalidation||i.revalidation}}componentDidCatch(a,i){this.props.onError?this.props.onError(a,i):console.error("React Router caught the following error during render",a)}render(){let a=this.state.error;if(this.context&&typeof a=="object"&&a&&"digest"in a&&typeof a.digest=="string"){const r=L1(a.digest);r&&(a=r)}let i=a!==void 0?M.createElement(Vn.Provider,{value:this.props.routeContext},M.createElement($c.Provider,{value:a,children:this.props.component})):this.props.children;return this.context?M.createElement(G1,{error:a},i):i}};Ap.contextType=Tp;var Ec=new WeakMap;function G1({children:a,error:i}){let{basename:r}=M.useContext(dn);if(typeof i=="object"&&i&&"digest"in i&&typeof i.digest=="string"){let u=U1(i.digest);if(u){let c=Ec.get(i);if(c)throw c;let f=fp(u.location,r);if(cp&&!Ec.get(i))if(f.isExternal||u.reloadDocument)window.location.href=f.absoluteURL||f.to;else{const h=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(f.to,{replace:u.replace}));throw Ec.set(i,h),h}return M.createElement("meta",{httpEquiv:"refresh",content:`0;url=${f.absoluteURL||f.to}`})}}return a}function k1({routeContext:a,match:i,children:r}){let u=M.useContext(Rl);return u&&u.static&&u.staticContext&&(i.route.errorElement||i.route.ErrorBoundary)&&(u.staticContext._deepestRenderedBoundaryId=i.route.id),M.createElement(Vn.Provider,{value:a},r)}function X1(a,i=[],r=null,u=null,c=null){if(a==null){if(!r)return null;if(r.errors)a=r.matches;else if(i.length===0&&!r.initialized&&r.matches.length>0)a=r.matches;else return null}let f=a,h=r?.errors;if(h!=null){let E=f.findIndex(p=>p.route.id&&h?.[p.route.id]!==void 0);Me(E>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(h).join(",")}`),f=f.slice(0,Math.min(f.length,E+1))}let m=!1,g=-1;if(r)for(let E=0;E<f.length;E++){let p=f[E];if((p.route.HydrateFallback||p.route.hydrateFallbackElement)&&(g=E),p.route.id){let{loaderData:R,errors:D}=r,H=p.route.loader&&!R.hasOwnProperty(p.route.id)&&(!D||D[p.route.id]===void 0);if(p.route.lazy||H){m=!0,g>=0?f=f.slice(0,g+1):f=[f[0]];break}}}let y=r&&u?(E,p)=>{u(E,{location:r.location,params:r.matches?.[0]?.params??{},unstable_pattern:vr(r.matches),errorInfo:p})}:void 0;return f.reduceRight((E,p,R)=>{let D,H=!1,V=null,K=null;r&&(D=h&&p.route.id?h[p.route.id]:void 0,V=p.route.errorElement||V1,m&&(g<0&&R===0?(Mp("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),H=!0,K=null):g===R&&(H=!0,K=p.route.hydrateFallbackElement||null)));let G=i.concat(f.slice(0,R+1)),Z=()=>{let W;return D?W=V:H?W=K:p.route.Component?W=M.createElement(p.route.Component,null):p.route.element?W=p.route.element:W=E,M.createElement(k1,{match:p,routeContext:{outlet:E,matches:G,isDataRoute:r!=null},children:W})};return r&&(p.route.ErrorBoundary||p.route.errorElement||R===0)?M.createElement(Ap,{location:r.location,revalidation:r.revalidation,component:V,error:D,children:Z(),routeContext:{outlet:null,matches:G,isDataRoute:!0},onError:y}):Z()},null)}function Wc(a){return`${a} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function K1(a){let i=M.useContext(Rl);return Me(i,Wc(a)),i}function Z1(a){let i=M.useContext(gr);return Me(i,Wc(a)),i}function J1(a){let i=M.useContext(Vn);return Me(i,Wc(a)),i}function Ic(a){let i=J1(a),r=i.matches[i.matches.length-1];return Me(r.route.id,`${a} can only be used on routes that contain a unique "id"`),r.route.id}function F1(){return Ic("useRouteId")}function $1(){let a=M.useContext($c),i=Z1("useRouteError"),r=Ic("useRouteError");return a!==void 0?a:i.errors?.[r]}function P1(){let{router:a}=K1("useNavigate"),i=Ic("useNavigate"),r=M.useRef(!1);return Op(()=>{r.current=!0}),M.useCallback(async(c,f={})=>{bt(r.current,xp),r.current&&(typeof c=="number"?await a.navigate(c):await a.navigate(c,{fromRouteId:i,...f}))},[a,i])}var Uy={};function Mp(a,i,r){!i&&!Uy[a]&&(Uy[a]=!0,bt(!1,r))}var Ly={};function By(a,i){!a&&!Ly[i]&&(Ly[i]=!0,console.warn(i))}var W1="useOptimistic",Hy=u0[W1],I1=()=>{};function eS(a){return Hy?Hy(a):[a,I1]}function tS(a){let i={hasErrorBoundary:a.hasErrorBoundary||a.ErrorBoundary!=null||a.errorElement!=null};return a.Component&&(a.element&&bt(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(i,{element:M.createElement(a.Component),Component:void 0})),a.HydrateFallback&&(a.hydrateFallbackElement&&bt(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(i,{hydrateFallbackElement:M.createElement(a.HydrateFallback),HydrateFallback:void 0})),a.ErrorBoundary&&(a.errorElement&&bt(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(i,{errorElement:M.createElement(a.ErrorBoundary),ErrorBoundary:void 0})),i}var nS=["HydrateFallback","hydrateFallbackElement"],aS=class{constructor(){this.status="pending",this.promise=new Promise((a,i)=>{this.resolve=r=>{this.status==="pending"&&(this.status="resolved",a(r))},this.reject=r=>{this.status==="pending"&&(this.status="rejected",i(r))}})}};function lS({router:a,flushSync:i,onError:r,unstable_useTransitions:u}){u=D1()||u;let[f,h]=M.useState(a.state),[m,g]=eS(f),[y,E]=M.useState(),[p,R]=M.useState({isTransitioning:!1}),[D,H]=M.useState(),[V,K]=M.useState(),[G,Z]=M.useState(),W=M.useRef(new Map),be=M.useCallback((ae,{deletedFetchers:Ee,newErrors:ze,flushSync:Oe,viewTransitionOpts:Ae})=>{ze&&r&&Object.values(ze).forEach(Qe=>r(Qe,{location:ae.location,params:ae.matches[0]?.params??{},unstable_pattern:vr(ae.matches)})),ae.fetchers.forEach((Qe,_e)=>{Qe.data!==void 0&&W.current.set(_e,Qe.data)}),Ee.forEach(Qe=>W.current.delete(Qe)),By(Oe===!1||i!=null,'You provided the `flushSync` option to a router update, but you are not using the `<RouterProvider>` from `react-router/dom` so `ReactDOM.flushSync()` is unavailable. Please update your app to `import { RouterProvider } from "react-router/dom"` and ensure you have `react-dom` installed as a dependency to use the `flushSync` option.');let Ke=a.window!=null&&a.window.document!=null&&typeof a.window.document.startViewTransition=="function";if(By(Ae==null||Ke,"You provided the `viewTransition` option to a router update, but you do not appear to be running in a DOM environment as `window.startViewTransition` is not available."),!Ae||!Ke){i&&Oe?i(()=>h(ae)):u===!1?h(ae):M.startTransition(()=>{u===!0&&g(Qe=>jy(Qe,ae)),h(ae)});return}if(i&&Oe){i(()=>{V&&(D?.resolve(),V.skipTransition()),R({isTransitioning:!0,flushSync:!0,currentLocation:Ae.currentLocation,nextLocation:Ae.nextLocation})});let Qe=a.window.document.startViewTransition(()=>{i(()=>h(ae))});Qe.finished.finally(()=>{i(()=>{H(void 0),K(void 0),E(void 0),R({isTransitioning:!1})})}),i(()=>K(Qe));return}V?(D?.resolve(),V.skipTransition(),Z({state:ae,currentLocation:Ae.currentLocation,nextLocation:Ae.nextLocation})):(E(ae),R({isTransitioning:!0,flushSync:!1,currentLocation:Ae.currentLocation,nextLocation:Ae.nextLocation}))},[a.window,i,V,D,u,g,r]);M.useLayoutEffect(()=>a.subscribe(be),[a,be]),M.useEffect(()=>{p.isTransitioning&&!p.flushSync&&H(new aS)},[p]),M.useEffect(()=>{if(D&&y&&a.window){let ae=y,Ee=D.promise,ze=a.window.document.startViewTransition(async()=>{u===!1?h(ae):M.startTransition(()=>{u===!0&&g(Oe=>jy(Oe,ae)),h(ae)}),await Ee});ze.finished.finally(()=>{H(void 0),K(void 0),E(void 0),R({isTransitioning:!1})}),K(ze)}},[y,D,a.window,u,g]),M.useEffect(()=>{D&&y&&m.location.key===y.location.key&&D.resolve()},[D,V,m.location,y]),M.useEffect(()=>{!p.isTransitioning&&G&&(E(G.state),R({isTransitioning:!0,flushSync:!1,currentLocation:G.currentLocation,nextLocation:G.nextLocation}),Z(void 0))},[p.isTransitioning,G]);let ve=M.useMemo(()=>({createHref:a.createHref,encodeLocation:a.encodeLocation,go:ae=>a.navigate(ae),push:(ae,Ee,ze)=>a.navigate(ae,{state:Ee,preventScrollReset:ze?.preventScrollReset}),replace:(ae,Ee,ze)=>a.navigate(ae,{replace:!0,state:Ee,preventScrollReset:ze?.preventScrollReset})}),[a]),pe=a.basename||"/",A=M.useMemo(()=>({router:a,navigator:ve,static:!1,basename:pe,onError:r}),[a,ve,pe,r]);return M.createElement(M.Fragment,null,M.createElement(Rl.Provider,{value:A},M.createElement(gr.Provider,{value:m},M.createElement(wp.Provider,{value:W.current},M.createElement(Fc.Provider,{value:p},M.createElement(uS,{basename:pe,location:m.location,navigationType:m.historyAction,navigator:ve,unstable_useTransitions:u},M.createElement(iS,{routes:a.routes,future:a.future,state:m,onError:r})))))),null)}function jy(a,i){return{...a,navigation:i.navigation.state!=="idle"?i.navigation:a.navigation,revalidation:i.revalidation!=="idle"?i.revalidation:a.revalidation,actionData:i.navigation.state!=="submitting"?i.actionData:a.actionData,fetchers:i.fetchers}}var iS=M.memo(rS);function rS({routes:a,future:i,state:r,onError:u}){return Y1(a,void 0,r,u,i)}function sS({to:a,replace:i,state:r,relative:u}){Me(fi(),"<Navigate> may be used only in the context of a <Router> component.");let{static:c}=M.useContext(dn);bt(!c,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:f}=M.useContext(Vn),{pathname:h}=Wa(),m=Pc(),g=Ws(a,Ps(f),h,u==="path"),y=JSON.stringify(g);return M.useEffect(()=>{m(JSON.parse(y),{replace:i,state:r,relative:u})},[m,y,u,i,r]),null}function Dp(a){return q1(a.context)}function uS({basename:a="/",children:i=null,location:r,navigationType:u="POP",navigator:c,static:f=!1,unstable_useTransitions:h}){Me(!fi(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let m=a.replace(/^\/*/,"/"),g=M.useMemo(()=>({basename:m,navigator:c,static:f,unstable_useTransitions:h,future:{}}),[m,c,f,h]);typeof r=="string"&&(r=Pa(r));let{pathname:y="/",search:E="",hash:p="",state:R=null,key:D="default"}=r,H=M.useMemo(()=>{let V=Mn(y,m);return V==null?null:{location:{pathname:V,search:E,hash:p,state:R,key:D},navigationType:u}},[m,y,E,p,R,D,u]);return bt(H!=null,`<Router basename="${m}"> is not able to match the URL "${y}${E}${p}" because it does not start with the basename, so the <Router> won't render anything.`),H==null?null:M.createElement(dn.Provider,{value:g},M.createElement(Is.Provider,{children:i,value:H}))}var Ys="get",Qs="application/x-www-form-urlencoded";function eu(a){return typeof HTMLElement<"u"&&a instanceof HTMLElement}function oS(a){return eu(a)&&a.tagName.toLowerCase()==="button"}function cS(a){return eu(a)&&a.tagName.toLowerCase()==="form"}function fS(a){return eu(a)&&a.tagName.toLowerCase()==="input"}function dS(a){return!!(a.metaKey||a.altKey||a.ctrlKey||a.shiftKey)}function hS(a,i){return a.button===0&&(!i||i==="_self")&&!dS(a)}var Ls=null;function mS(){if(Ls===null)try{new FormData(document.createElement("form"),0),Ls=!1}catch{Ls=!0}return Ls}var yS=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function _c(a){return a!=null&&!yS.has(a)?(bt(!1,`"${a}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Qs}"`),null):a}function pS(a,i){let r,u,c,f,h;if(cS(a)){let m=a.getAttribute("action");u=m?Mn(m,i):null,r=a.getAttribute("method")||Ys,c=_c(a.getAttribute("enctype"))||Qs,f=new FormData(a)}else if(oS(a)||fS(a)&&(a.type==="submit"||a.type==="image")){let m=a.form;if(m==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let g=a.getAttribute("formaction")||m.getAttribute("action");if(u=g?Mn(g,i):null,r=a.getAttribute("formmethod")||m.getAttribute("method")||Ys,c=_c(a.getAttribute("formenctype"))||_c(m.getAttribute("enctype"))||Qs,f=new FormData(m,a),!mS()){let{name:y,type:E,value:p}=a;if(E==="image"){let R=y?`${y}.`:"";f.append(`${R}x`,"0"),f.append(`${R}y`,"0")}else y&&f.append(y,p)}}else{if(eu(a))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');r=Ys,u=null,c=Qs,h=a}return f&&c==="text/plain"&&(h=f,f=void 0),{action:u,method:r.toLowerCase(),encType:c,formData:f,body:h}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function ef(a,i){if(a===!1||a===null||typeof a>"u")throw new Error(i)}function vS(a,i,r,u){let c=typeof a=="string"?new URL(a,typeof window>"u"?"server://singlefetch/":window.location.origin):a;return r?c.pathname.endsWith("/")?c.pathname=`${c.pathname}_.${u}`:c.pathname=`${c.pathname}.${u}`:c.pathname==="/"?c.pathname=`_root.${u}`:i&&Mn(c.pathname,i)==="/"?c.pathname=`${i.replace(/\/$/,"")}/_root.${u}`:c.pathname=`${c.pathname.replace(/\/$/,"")}.${u}`,c}async function gS(a,i){if(a.id in i)return i[a.id];try{let r=await import(a.module);return i[a.id]=r,r}catch(r){return console.error(`Error loading route module \`${a.module}\`, reloading page...`),console.error(r),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function bS(a){return a==null?!1:a.href==null?a.rel==="preload"&&typeof a.imageSrcSet=="string"&&typeof a.imageSizes=="string":typeof a.rel=="string"&&typeof a.href=="string"}async function SS(a,i,r){let u=await Promise.all(a.map(async c=>{let f=i.routes[c.route.id];if(f){let h=await gS(f,r);return h.links?h.links():[]}return[]}));return wS(u.flat(1).filter(bS).filter(c=>c.rel==="stylesheet"||c.rel==="preload").map(c=>c.rel==="stylesheet"?{...c,rel:"prefetch",as:"style"}:{...c,rel:"prefetch"}))}function qy(a,i,r,u,c,f){let h=(g,y)=>r[y]?g.route.id!==r[y].route.id:!0,m=(g,y)=>r[y].pathname!==g.pathname||r[y].route.path?.endsWith("*")&&r[y].params["*"]!==g.params["*"];return f==="assets"?i.filter((g,y)=>h(g,y)||m(g,y)):f==="data"?i.filter((g,y)=>{let E=u.routes[g.route.id];if(!E||!E.hasLoader)return!1;if(h(g,y)||m(g,y))return!0;if(g.route.shouldRevalidate){let p=g.route.shouldRevalidate({currentUrl:new URL(c.pathname+c.search+c.hash,window.origin),currentParams:r[0]?.params||{},nextUrl:new URL(a,window.origin),nextParams:g.params,defaultShouldRevalidate:!0});if(typeof p=="boolean")return p}return!0}):[]}function ES(a,i,{includeHydrateFallback:r}={}){return _S(a.map(u=>{let c=i.routes[u.route.id];if(!c)return[];let f=[c.module];return c.clientActionModule&&(f=f.concat(c.clientActionModule)),c.clientLoaderModule&&(f=f.concat(c.clientLoaderModule)),r&&c.hydrateFallbackModule&&(f=f.concat(c.hydrateFallbackModule)),c.imports&&(f=f.concat(c.imports)),f}).flat(1))}function _S(a){return[...new Set(a)]}function TS(a){let i={},r=Object.keys(a).sort();for(let u of r)i[u]=a[u];return i}function wS(a,i){let r=new Set;return new Set(i),a.reduce((u,c)=>{let f=JSON.stringify(TS(c));return r.has(f)||(r.add(f),u.push({key:f,link:c})),u},[])}function Cp(){let a=M.useContext(Rl);return ef(a,"You must render this element inside a <DataRouterContext.Provider> element"),a}function RS(){let a=M.useContext(gr);return ef(a,"You must render this element inside a <DataRouterStateContext.Provider> element"),a}var tf=M.createContext(void 0);tf.displayName="FrameworkContext";function zp(){let a=M.useContext(tf);return ef(a,"You must render this element inside a <HydratedRouter> element"),a}function xS(a,i){let r=M.useContext(tf),[u,c]=M.useState(!1),[f,h]=M.useState(!1),{onFocus:m,onBlur:g,onMouseEnter:y,onMouseLeave:E,onTouchStart:p}=i,R=M.useRef(null);M.useEffect(()=>{if(a==="render"&&h(!0),a==="viewport"){let V=G=>{G.forEach(Z=>{h(Z.isIntersecting)})},K=new IntersectionObserver(V,{threshold:.5});return R.current&&K.observe(R.current),()=>{K.disconnect()}}},[a]),M.useEffect(()=>{if(u){let V=setTimeout(()=>{h(!0)},100);return()=>{clearTimeout(V)}}},[u]);let D=()=>{c(!0)},H=()=>{c(!1),h(!1)};return r?a!=="intent"?[f,R,{}]:[f,R,{onFocus:ir(m,D),onBlur:ir(g,H),onMouseEnter:ir(y,D),onMouseLeave:ir(E,H),onTouchStart:ir(p,D)}]:[!1,R,{}]}function ir(a,i){return r=>{a&&a(r),r.defaultPrevented||i(r)}}function OS({page:a,...i}){let{router:r}=Cp(),u=M.useMemo(()=>Za(r.routes,a,r.basename),[r.routes,a,r.basename]);return u?M.createElement(MS,{page:a,matches:u,...i}):null}function AS(a){let{manifest:i,routeModules:r}=zp(),[u,c]=M.useState([]);return M.useEffect(()=>{let f=!1;return SS(a,i,r).then(h=>{f||c(h)}),()=>{f=!0}},[a,i,r]),u}function MS({page:a,matches:i,...r}){let u=Wa(),{future:c,manifest:f,routeModules:h}=zp(),{basename:m}=Cp(),{loaderData:g,matches:y}=RS(),E=M.useMemo(()=>qy(a,i,y,f,u,"data"),[a,i,y,f,u]),p=M.useMemo(()=>qy(a,i,y,f,u,"assets"),[a,i,y,f,u]),R=M.useMemo(()=>{if(a===u.pathname+u.search+u.hash)return[];let V=new Set,K=!1;if(i.forEach(Z=>{let W=f.routes[Z.route.id];!W||!W.hasLoader||(!E.some(be=>be.route.id===Z.route.id)&&Z.route.id in g&&h[Z.route.id]?.shouldRevalidate||W.hasClientLoader?K=!0:V.add(Z.route.id))}),V.size===0)return[];let G=vS(a,m,c.unstable_trailingSlashAwareDataRequests,"data");return K&&V.size>0&&G.searchParams.set("_routes",i.filter(Z=>V.has(Z.route.id)).map(Z=>Z.route.id).join(",")),[G.pathname+G.search]},[m,c.unstable_trailingSlashAwareDataRequests,g,u,f,E,i,a,h]),D=M.useMemo(()=>ES(p,f),[p,f]),H=AS(p);return M.createElement(M.Fragment,null,R.map(V=>M.createElement("link",{key:V,rel:"prefetch",as:"fetch",href:V,...r})),D.map(V=>M.createElement("link",{key:V,rel:"modulepreload",href:V,...r})),H.map(({key:V,link:K})=>M.createElement("link",{key:V,nonce:r.nonce,...K,crossOrigin:K.crossOrigin??r.crossOrigin})))}function DS(...a){return i=>{a.forEach(r=>{typeof r=="function"?r(i):r!=null&&(r.current=i)})}}var CS=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{CS&&(window.__reactRouterVersion="7.13.0")}catch{}function zS(a,i){return i1({basename:i?.basename,getContext:i?.getContext,future:i?.future,history:Eb({window:i?.window}),hydrationData:NS(),routes:a,mapRouteProperties:tS,hydrationRouteProperties:nS,dataStrategy:i?.dataStrategy,patchRoutesOnNavigation:i?.patchRoutesOnNavigation,window:i?.window,unstable_instrumentations:i?.unstable_instrumentations}).initialize()}function NS(){let a=window?.__staticRouterHydrationData;return a&&a.errors&&(a={...a,errors:US(a.errors)}),a}function US(a){if(!a)return null;let i=Object.entries(a),r={};for(let[u,c]of i)if(c&&c.__type==="RouteErrorResponse")r[u]=new pr(c.status,c.statusText,c.data,c.internal===!0);else if(c&&c.__type==="Error"){if(c.__subType){let f=window[c.__subType];if(typeof f=="function")try{let h=new f(c.message);h.stack="",r[u]=h}catch{}}if(r[u]==null){let f=new Error(c.message);f.stack="",r[u]=f}}else r[u]=c;return r}var Np=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Up=M.forwardRef(function({onClick:i,discover:r="render",prefetch:u="none",relative:c,reloadDocument:f,replace:h,state:m,target:g,to:y,preventScrollReset:E,viewTransition:p,unstable_defaultShouldRevalidate:R,...D},H){let{basename:V,unstable_useTransitions:K}=M.useContext(dn),G=typeof y=="string"&&Np.test(y),Z=fp(y,V);y=Z.to;let W=B1(y,{relative:c}),[be,ve,pe]=xS(u,D),A=HS(y,{replace:h,state:m,target:g,preventScrollReset:E,relative:c,viewTransition:p,unstable_defaultShouldRevalidate:R,unstable_useTransitions:K});function ae(ze){i&&i(ze),ze.defaultPrevented||A(ze)}let Ee=M.createElement("a",{...D,...pe,href:Z.absoluteURL||W,onClick:Z.isExternal||f?i:ae,ref:DS(H,ve),target:g,"data-discover":!G&&r==="render"?"true":void 0});return be&&!G?M.createElement(M.Fragment,null,Ee,M.createElement(OS,{page:W})):Ee});Up.displayName="Link";var Lp=M.forwardRef(function({"aria-current":i="page",caseSensitive:r=!1,className:u="",end:c=!1,style:f,to:h,viewTransition:m,children:g,...y},E){let p=br(h,{relative:y.relative}),R=Wa(),D=M.useContext(gr),{navigator:H,basename:V}=M.useContext(dn),K=D!=null&&VS(p)&&m===!0,G=H.encodeLocation?H.encodeLocation(p).pathname:p.pathname,Z=R.pathname,W=D&&D.navigation&&D.navigation.location?D.navigation.location.pathname:null;r||(Z=Z.toLowerCase(),W=W?W.toLowerCase():null,G=G.toLowerCase()),W&&V&&(W=Mn(W,V)||W);const be=G!=="/"&&G.endsWith("/")?G.length-1:G.length;let ve=Z===G||!c&&Z.startsWith(G)&&Z.charAt(be)==="/",pe=W!=null&&(W===G||!c&&W.startsWith(G)&&W.charAt(G.length)==="/"),A={isActive:ve,isPending:pe,isTransitioning:K},ae=ve?i:void 0,Ee;typeof u=="function"?Ee=u(A):Ee=[u,ve?"active":null,pe?"pending":null,K?"transitioning":null].filter(Boolean).join(" ");let ze=typeof f=="function"?f(A):f;return M.createElement(Up,{...y,"aria-current":ae,className:Ee,ref:E,style:ze,to:h,viewTransition:m},typeof g=="function"?g(A):g)});Lp.displayName="NavLink";var LS=M.forwardRef(({discover:a="render",fetcherKey:i,navigate:r,reloadDocument:u,replace:c,state:f,method:h=Ys,action:m,onSubmit:g,relative:y,preventScrollReset:E,viewTransition:p,unstable_defaultShouldRevalidate:R,...D},H)=>{let{unstable_useTransitions:V}=M.useContext(dn),K=YS(),G=QS(m,{relative:y}),Z=h.toLowerCase()==="get"?"get":"post",W=typeof m=="string"&&Np.test(m),be=ve=>{if(g&&g(ve),ve.defaultPrevented)return;ve.preventDefault();let pe=ve.nativeEvent.submitter,A=pe?.getAttribute("formmethod")||h,ae=()=>K(pe||ve.currentTarget,{fetcherKey:i,method:A,navigate:r,replace:c,state:f,relative:y,preventScrollReset:E,viewTransition:p,unstable_defaultShouldRevalidate:R});V&&r!==!1?M.startTransition(()=>ae()):ae()};return M.createElement("form",{ref:H,method:Z,action:G,onSubmit:u?g:be,...D,"data-discover":!W&&a==="render"?"true":void 0})});LS.displayName="Form";function BS(a){return`${a} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Bp(a){let i=M.useContext(Rl);return Me(i,BS(a)),i}function HS(a,{target:i,replace:r,state:u,preventScrollReset:c,relative:f,viewTransition:h,unstable_defaultShouldRevalidate:m,unstable_useTransitions:g}={}){let y=Pc(),E=Wa(),p=br(a,{relative:f});return M.useCallback(R=>{if(hS(R,i)){R.preventDefault();let D=r!==void 0?r:Pn(E)===Pn(p),H=()=>y(a,{replace:D,state:u,preventScrollReset:c,relative:f,viewTransition:h,unstable_defaultShouldRevalidate:m});g?M.startTransition(()=>H()):H()}},[E,y,p,r,u,i,a,c,f,h,m,g])}var jS=0,qS=()=>`__${String(++jS)}__`;function YS(){let{router:a}=Bp("useSubmit"),{basename:i}=M.useContext(dn),r=F1(),u=a.fetch,c=a.navigate;return M.useCallback(async(f,h={})=>{let{action:m,method:g,encType:y,formData:E,body:p}=pS(f,i);if(h.navigate===!1){let R=h.fetcherKey||qS();await u(R,r,h.action||m,{unstable_defaultShouldRevalidate:h.unstable_defaultShouldRevalidate,preventScrollReset:h.preventScrollReset,formData:E,body:p,formMethod:h.method||g,formEncType:h.encType||y,flushSync:h.flushSync})}else await c(h.action||m,{unstable_defaultShouldRevalidate:h.unstable_defaultShouldRevalidate,preventScrollReset:h.preventScrollReset,formData:E,body:p,formMethod:h.method||g,formEncType:h.encType||y,replace:h.replace,state:h.state,fromRouteId:r,flushSync:h.flushSync,viewTransition:h.viewTransition})},[u,c,i,r])}function QS(a,{relative:i}={}){let{basename:r}=M.useContext(dn),u=M.useContext(Vn);Me(u,"useFormAction must be used inside a RouteContext");let[c]=u.matches.slice(-1),f={...br(a||".",{relative:i})},h=Wa();if(a==null){f.search=h.search;let m=new URLSearchParams(f.search),g=m.getAll("index");if(g.some(E=>E==="")){m.delete("index"),g.filter(p=>p).forEach(p=>m.append("index",p));let E=m.toString();f.search=E?`?${E}`:""}}return(!a||a===".")&&c.route.index&&(f.search=f.search?f.search.replace(/^\?/,"?index&"):"?index"),r!=="/"&&(f.pathname=f.pathname==="/"?r:$n([r,f.pathname])),Pn(f)}function VS(a,{relative:i}={}){let r=M.useContext(Fc);Me(r!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:u}=Bp("useViewTransitionState"),c=br(a,{relative:i});if(!r.isTransitioning)return!1;let f=Mn(r.currentLocation.pathname,u)||r.currentLocation.pathname,h=Mn(r.nextLocation.pathname,u)||r.nextLocation.pathname;return Js(c.pathname,h)!=null||Js(c.pathname,f)!=null}function GS(a){return M.createElement(lS,{flushSync:ap.flushSync,...a})}function kS(){return he.jsx("div",{className:"min-h-screen bg-background text-foreground",children:he.jsx(Dp,{})})}const Hp=(...a)=>a.filter((i,r,u)=>!!i&&i.trim()!==""&&u.indexOf(i)===r).join(" ").trim();const XS=a=>a.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const KS=a=>a.replace(/^([A-Z])|[\s-_]+(\w)/g,(i,r,u)=>u?u.toUpperCase():r.toLowerCase());const Yy=a=>{const i=KS(a);return i.charAt(0).toUpperCase()+i.slice(1)};var ZS={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const JS=a=>{for(const i in a)if(i.startsWith("aria-")||i==="role"||i==="title")return!0;return!1};const FS=M.forwardRef(({color:a="currentColor",size:i=24,strokeWidth:r=2,absoluteStrokeWidth:u,className:c="",children:f,iconNode:h,...m},g)=>M.createElement("svg",{ref:g,...ZS,width:i,height:i,stroke:a,strokeWidth:u?Number(r)*24/Number(i):r,className:Hp("lucide",c),...!f&&!JS(m)&&{"aria-hidden":"true"},...m},[...h.map(([y,E])=>M.createElement(y,E)),...Array.isArray(f)?f:[f]]));const tu=(a,i)=>{const r=M.forwardRef(({className:u,...c},f)=>M.createElement(FS,{ref:f,iconNode:i,className:Hp(`lucide-${XS(Yy(a))}`,`lucide-${a}`,u),...c}));return r.displayName=Yy(a),r};const $S=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],PS=tu("arrow-left",$S);const WS=[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]],IS=tu("bell",WS);const eE=[["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M17 20v2",key:"1rnc9c"}],["path",{d:"M17 2v2",key:"11trls"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M2 17h2",key:"7oei6x"}],["path",{d:"M2 7h2",key:"asdhe0"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"M20 17h2",key:"1fpfkl"}],["path",{d:"M20 7h2",key:"1o8tra"}],["path",{d:"M7 20v2",key:"4gnj0m"}],["path",{d:"M7 2v2",key:"1i4yhu"}],["rect",{x:"4",y:"4",width:"16",height:"16",rx:"2",key:"1vbyd7"}],["rect",{x:"8",y:"8",width:"8",height:"8",rx:"1",key:"z9xiuo"}]],tE=tu("cpu",eE);const nE=[["path",{d:"M18 19a5 5 0 0 1-5-5v8",key:"sz5oeg"}],["path",{d:"M9 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v5",key:"1w6njk"}],["circle",{cx:"13",cy:"12",r:"2",key:"1j92g6"}],["circle",{cx:"20",cy:"19",r:"2",key:"1obnsp"}]],aE=tu("folder-git-2",nE),lE=[{to:"/settings/agents",label:"Agent 配置",icon:tE},{to:"/settings/projects",label:"项目配置",icon:aE},{to:"/settings/notifications",label:"通知",icon:IS}],iE=he.jsxs("svg",{width:"22",height:"22",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"text-neutral-900",children:[he.jsx("path",{d:"M12 2L2 7L12 12L22 7L12 2Z",fill:"currentColor"}),he.jsx("path",{d:"M2 17L12 22L22 17",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),he.jsx("path",{d:"M2 12L12 17L22 12",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]});function rE(){const a=Pc();return he.jsxs("div",{className:"h-screen flex flex-col bg-white",children:[he.jsxs("header",{className:"h-12 flex items-center justify-between px-4 border-b border-neutral-100 bg-white shrink-0 z-30",children:[he.jsxs("div",{className:"flex items-center gap-2.5",children:[iE,he.jsx("span",{className:"text-sm font-bold tracking-tight text-neutral-900",children:"Agent Tower"}),he.jsx("span",{className:"text-neutral-200 text-sm",children:"/"}),he.jsx("span",{className:"text-sm text-neutral-500",children:"设置"})]}),he.jsxs("button",{onClick:()=>a("/"),className:"flex items-center gap-1.5 text-xs text-neutral-400 hover:text-neutral-900 transition-colors",children:[he.jsx(PS,{size:14}),he.jsx("span",{children:"返回"})]})]}),he.jsxs("div",{className:"flex-1 flex overflow-hidden",children:[he.jsx("nav",{className:"w-48 border-r border-neutral-100 pt-3 px-2 shrink-0",children:lE.map(i=>he.jsxs(Lp,{to:i.to,className:({isActive:r})=>`flex items-center gap-2 px-3 py-1.5 rounded-md text-[13px] transition-colors ${r?"bg-neutral-100 text-neutral-900 font-medium":"text-neutral-500 hover:text-neutral-900 hover:bg-neutral-50"}`,children:[he.jsx(i.icon,{size:14}),he.jsx("span",{children:i.label})]},i.to))}),he.jsx("div",{className:"flex-1 overflow-y-auto",children:he.jsx(Dp,{})})]})]})}const sE=M.lazy(()=>wl(()=>import("./ProjectKanbanPage-BsRLM_To.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13])).then(a=>({default:a.ProjectKanbanPage}))),uE=M.lazy(()=>wl(()=>import("./DemoPage-CmUJ0dvS.js"),__vite__mapDeps([14,5])).then(a=>({default:a.DemoPage}))),oE=M.lazy(()=>wl(()=>import("./AgentDemoPage-CzND8Y0f.js"),__vite__mapDeps([15,5,2,3,4,6,16,1])).then(a=>({default:a.AgentDemoPage}))),cE=M.lazy(()=>wl(()=>import("./ProfileSettingsPage-Z42bsJop.js"),__vite__mapDeps([17,16,1,5,9,7,18])).then(a=>({default:a.ProfileSettingsPage}))),fE=M.lazy(()=>wl(()=>import("./ProviderSettingsPage-BnLCrZgD.js"),__vite__mapDeps([19,8,1,5,9,7,12,4,3,18,20])).then(a=>({default:a.ProviderSettingsPage}))),dE=M.lazy(()=>wl(()=>import("./NotificationSettingsPage-B1SDsL68.js"),__vite__mapDeps([21,1,5,12,4,11,20,22])).then(a=>({default:a.NotificationSettingsPage}))),hE=M.lazy(()=>wl(()=>import("./ProjectSettingsPage-DizbsdCH.js"),__vite__mapDeps([23,10,1,5,12,4,7])).then(a=>({default:a.ProjectSettingsPage}))),mE=zS([{path:"/",element:he.jsx(kS,{}),children:[{index:!0,element:he.jsx(M.Suspense,{fallback:he.jsx("div",{className:"p-8",children:"Loading..."}),children:he.jsx(sE,{})})},{path:"demo",element:he.jsx(M.Suspense,{fallback:he.jsx("div",{className:"p-8",children:"Loading..."}),children:he.jsx(uE,{})})},{path:"agent-demo",element:he.jsx(M.Suspense,{fallback:he.jsx("div",{className:"p-8",children:"Loading..."}),children:he.jsx(oE,{})})},{path:"settings",element:he.jsx(rE,{}),children:[{index:!0,element:he.jsx(sS,{to:"agents",replace:!0})},{path:"agents",element:he.jsx(M.Suspense,{fallback:he.jsx("div",{className:"p-8",children:"Loading..."}),children:he.jsx(fE,{})})},{path:"agents-legacy",element:he.jsx(M.Suspense,{fallback:he.jsx("div",{className:"p-8",children:"Loading..."}),children:he.jsx(cE,{})})},{path:"notifications",element:he.jsx(M.Suspense,{fallback:he.jsx("div",{className:"p-8",children:"Loading..."}),children:he.jsx(dE,{})})},{path:"projects",element:he.jsx(M.Suspense,{fallback:he.jsx("div",{className:"p-8",children:"Loading..."}),children:he.jsx(hE,{})})}]}]}]);function yE(){return he.jsx(GS,{router:mE})}const Wn=Object.create(null);Wn.open="0";Wn.close="1";Wn.ping="2";Wn.pong="3";Wn.message="4";Wn.upgrade="5";Wn.noop="6";const Vs=Object.create(null);Object.keys(Wn).forEach(a=>{Vs[Wn[a]]=a});const Bc={type:"error",data:"parser error"},jp=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",qp=typeof ArrayBuffer=="function",Yp=a=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(a):a&&a.buffer instanceof ArrayBuffer,nf=({type:a,data:i},r,u)=>jp&&i instanceof Blob?r?u(i):Qy(i,u):qp&&(i instanceof ArrayBuffer||Yp(i))?r?u(i):Qy(new Blob([i]),u):u(Wn[a]+(i||"")),Qy=(a,i)=>{const r=new FileReader;return r.onload=function(){const u=r.result.split(",")[1];i("b"+(u||""))},r.readAsDataURL(a)};function Vy(a){return a instanceof Uint8Array?a:a instanceof ArrayBuffer?new Uint8Array(a):new Uint8Array(a.buffer,a.byteOffset,a.byteLength)}let Tc;function pE(a,i){if(jp&&a.data instanceof Blob)return a.data.arrayBuffer().then(Vy).then(i);if(qp&&(a.data instanceof ArrayBuffer||Yp(a.data)))return i(Vy(a.data));nf(a,!1,r=>{Tc||(Tc=new TextEncoder),i(Tc.encode(r))})}const Gy="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",or=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let a=0;a<Gy.length;a++)or[Gy.charCodeAt(a)]=a;const vE=a=>{let i=a.length*.75,r=a.length,u,c=0,f,h,m,g;a[a.length-1]==="="&&(i--,a[a.length-2]==="="&&i--);const y=new ArrayBuffer(i),E=new Uint8Array(y);for(u=0;u<r;u+=4)f=or[a.charCodeAt(u)],h=or[a.charCodeAt(u+1)],m=or[a.charCodeAt(u+2)],g=or[a.charCodeAt(u+3)],E[c++]=f<<2|h>>4,E[c++]=(h&15)<<4|m>>2,E[c++]=(m&3)<<6|g&63;return y},gE=typeof ArrayBuffer=="function",af=(a,i)=>{if(typeof a!="string")return{type:"message",data:Qp(a,i)};const r=a.charAt(0);return r==="b"?{type:"message",data:bE(a.substring(1),i)}:Vs[r]?a.length>1?{type:Vs[r],data:a.substring(1)}:{type:Vs[r]}:Bc},bE=(a,i)=>{if(gE){const r=vE(a);return Qp(r,i)}else return{base64:!0,data:a}},Qp=(a,i)=>i==="blob"?a instanceof Blob?a:new Blob([a]):a instanceof ArrayBuffer?a:a.buffer,Vp="",SE=(a,i)=>{const r=a.length,u=new Array(r);let c=0;a.forEach((f,h)=>{nf(f,!1,m=>{u[h]=m,++c===r&&i(u.join(Vp))})})},EE=(a,i)=>{const r=a.split(Vp),u=[];for(let c=0;c<r.length;c++){const f=af(r[c],i);if(u.push(f),f.type==="error")break}return u};function _E(){return new TransformStream({transform(a,i){pE(a,r=>{const u=r.length;let c;if(u<126)c=new Uint8Array(1),new DataView(c.buffer).setUint8(0,u);else if(u<65536){c=new Uint8Array(3);const f=new DataView(c.buffer);f.setUint8(0,126),f.setUint16(1,u)}else{c=new Uint8Array(9);const f=new DataView(c.buffer);f.setUint8(0,127),f.setBigUint64(1,BigInt(u))}a.data&&typeof a.data!="string"&&(c[0]|=128),i.enqueue(c),i.enqueue(r)})}})}let wc;function Bs(a){return a.reduce((i,r)=>i+r.length,0)}function Hs(a,i){if(a[0].length===i)return a.shift();const r=new Uint8Array(i);let u=0;for(let c=0;c<i;c++)r[c]=a[0][u++],u===a[0].length&&(a.shift(),u=0);return a.length&&u<a[0].length&&(a[0]=a[0].slice(u)),r}function TE(a,i){wc||(wc=new TextDecoder);const r=[];let u=0,c=-1,f=!1;return new TransformStream({transform(h,m){for(r.push(h);;){if(u===0){if(Bs(r)<1)break;const g=Hs(r,1);f=(g[0]&128)===128,c=g[0]&127,c<126?u=3:c===126?u=1:u=2}else if(u===1){if(Bs(r)<2)break;const g=Hs(r,2);c=new DataView(g.buffer,g.byteOffset,g.length).getUint16(0),u=3}else if(u===2){if(Bs(r)<8)break;const g=Hs(r,8),y=new DataView(g.buffer,g.byteOffset,g.length),E=y.getUint32(0);if(E>Math.pow(2,21)-1){m.enqueue(Bc);break}c=E*Math.pow(2,32)+y.getUint32(4),u=3}else{if(Bs(r)<c)break;const g=Hs(r,c);m.enqueue(af(f?g:wc.decode(g),i)),u=0}if(c===0||c>a){m.enqueue(Bc);break}}}})}const Gp=4;function wt(a){if(a)return wE(a)}function wE(a){for(var i in wt.prototype)a[i]=wt.prototype[i];return a}wt.prototype.on=wt.prototype.addEventListener=function(a,i){return this._callbacks=this._callbacks||{},(this._callbacks["$"+a]=this._callbacks["$"+a]||[]).push(i),this};wt.prototype.once=function(a,i){function r(){this.off(a,r),i.apply(this,arguments)}return r.fn=i,this.on(a,r),this};wt.prototype.off=wt.prototype.removeListener=wt.prototype.removeAllListeners=wt.prototype.removeEventListener=function(a,i){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var r=this._callbacks["$"+a];if(!r)return this;if(arguments.length==1)return delete this._callbacks["$"+a],this;for(var u,c=0;c<r.length;c++)if(u=r[c],u===i||u.fn===i){r.splice(c,1);break}return r.length===0&&delete this._callbacks["$"+a],this};wt.prototype.emit=function(a){this._callbacks=this._callbacks||{};for(var i=new Array(arguments.length-1),r=this._callbacks["$"+a],u=1;u<arguments.length;u++)i[u-1]=arguments[u];if(r){r=r.slice(0);for(var u=0,c=r.length;u<c;++u)r[u].apply(this,i)}return this};wt.prototype.emitReserved=wt.prototype.emit;wt.prototype.listeners=function(a){return this._callbacks=this._callbacks||{},this._callbacks["$"+a]||[]};wt.prototype.hasListeners=function(a){return!!this.listeners(a).length};const nu=typeof Promise=="function"&&typeof Promise.resolve=="function"?i=>Promise.resolve().then(i):(i,r)=>r(i,0),An=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),RE="arraybuffer";function kp(a,...i){return i.reduce((r,u)=>(a.hasOwnProperty(u)&&(r[u]=a[u]),r),{})}const xE=An.setTimeout,OE=An.clearTimeout;function au(a,i){i.useNativeTimers?(a.setTimeoutFn=xE.bind(An),a.clearTimeoutFn=OE.bind(An)):(a.setTimeoutFn=An.setTimeout.bind(An),a.clearTimeoutFn=An.clearTimeout.bind(An))}const AE=1.33;function ME(a){return typeof a=="string"?DE(a):Math.ceil((a.byteLength||a.size)*AE)}function DE(a){let i=0,r=0;for(let u=0,c=a.length;u<c;u++)i=a.charCodeAt(u),i<128?r+=1:i<2048?r+=2:i<55296||i>=57344?r+=3:(u++,r+=4);return r}function Xp(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function CE(a){let i="";for(let r in a)a.hasOwnProperty(r)&&(i.length&&(i+="&"),i+=encodeURIComponent(r)+"="+encodeURIComponent(a[r]));return i}function zE(a){let i={},r=a.split("&");for(let u=0,c=r.length;u<c;u++){let f=r[u].split("=");i[decodeURIComponent(f[0])]=decodeURIComponent(f[1])}return i}class NE extends Error{constructor(i,r,u){super(i),this.description=r,this.context=u,this.type="TransportError"}}class lf extends wt{constructor(i){super(),this.writable=!1,au(this,i),this.opts=i,this.query=i.query,this.socket=i.socket,this.supportsBinary=!i.forceBase64}onError(i,r,u){return super.emitReserved("error",new NE(i,r,u)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(i){this.readyState==="open"&&this.write(i)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(i){const r=af(i,this.socket.binaryType);this.onPacket(r)}onPacket(i){super.emitReserved("packet",i)}onClose(i){this.readyState="closed",super.emitReserved("close",i)}pause(i){}createUri(i,r={}){return i+"://"+this._hostname()+this._port()+this.opts.path+this._query(r)}_hostname(){const i=this.opts.hostname;return i.indexOf(":")===-1?i:"["+i+"]"}_port(){return this.opts.port&&(this.opts.secure&&Number(this.opts.port)!==443||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(i){const r=CE(i);return r.length?"?"+r:""}}class UE extends lf{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(i){this.readyState="pausing";const r=()=>{this.readyState="paused",i()};if(this._polling||!this.writable){let u=0;this._polling&&(u++,this.once("pollComplete",function(){--u||r()})),this.writable||(u++,this.once("drain",function(){--u||r()}))}else r()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(i){const r=u=>{if(this.readyState==="opening"&&u.type==="open"&&this.onOpen(),u.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(u)};EE(i,this.socket.binaryType).forEach(r),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){const i=()=>{this.write([{type:"close"}])};this.readyState==="open"?i():this.once("open",i)}write(i){this.writable=!1,SE(i,r=>{this.doWrite(r,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const i=this.opts.secure?"https":"http",r=this.query||{};return this.opts.timestampRequests!==!1&&(r[this.opts.timestampParam]=Xp()),!this.supportsBinary&&!r.sid&&(r.b64=1),this.createUri(i,r)}}let Kp=!1;try{Kp=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const LE=Kp;function BE(){}class HE extends UE{constructor(i){if(super(i),typeof location<"u"){const r=location.protocol==="https:";let u=location.port;u||(u=r?"443":"80"),this.xd=typeof location<"u"&&i.hostname!==location.hostname||u!==i.port}}doWrite(i,r){const u=this.request({method:"POST",data:i});u.on("success",r),u.on("error",(c,f)=>{this.onError("xhr post error",c,f)})}doPoll(){const i=this.request();i.on("data",this.onData.bind(this)),i.on("error",(r,u)=>{this.onError("xhr poll error",r,u)}),this.pollXhr=i}}let ci=class Gs extends wt{constructor(i,r,u){super(),this.createRequest=i,au(this,u),this._opts=u,this._method=u.method||"GET",this._uri=r,this._data=u.data!==void 0?u.data:null,this._create()}_create(){var i;const r=kp(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");r.xdomain=!!this._opts.xd;const u=this._xhr=this.createRequest(r);try{u.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){u.setDisableHeaderCheck&&u.setDisableHeaderCheck(!0);for(let c in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(c)&&u.setRequestHeader(c,this._opts.extraHeaders[c])}}catch{}if(this._method==="POST")try{u.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{u.setRequestHeader("Accept","*/*")}catch{}(i=this._opts.cookieJar)===null||i===void 0||i.addCookies(u),"withCredentials"in u&&(u.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(u.timeout=this._opts.requestTimeout),u.onreadystatechange=()=>{var c;u.readyState===3&&((c=this._opts.cookieJar)===null||c===void 0||c.parseCookies(u.getResponseHeader("set-cookie"))),u.readyState===4&&(u.status===200||u.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof u.status=="number"?u.status:0)},0))},u.send(this._data)}catch(c){this.setTimeoutFn(()=>{this._onError(c)},0);return}typeof document<"u"&&(this._index=Gs.requestsCount++,Gs.requests[this._index]=this)}_onError(i){this.emitReserved("error",i,this._xhr),this._cleanup(!0)}_cleanup(i){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=BE,i)try{this._xhr.abort()}catch{}typeof document<"u"&&delete Gs.requests[this._index],this._xhr=null}}_onLoad(){const i=this._xhr.responseText;i!==null&&(this.emitReserved("data",i),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}};ci.requestsCount=0;ci.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",ky);else if(typeof addEventListener=="function"){const a="onpagehide"in An?"pagehide":"unload";addEventListener(a,ky,!1)}}function ky(){for(let a in ci.requests)ci.requests.hasOwnProperty(a)&&ci.requests[a].abort()}const jE=(function(){const a=Zp({xdomain:!1});return a&&a.responseType!==null})();class qE extends HE{constructor(i){super(i);const r=i&&i.forceBase64;this.supportsBinary=jE&&!r}request(i={}){return Object.assign(i,{xd:this.xd},this.opts),new ci(Zp,this.uri(),i)}}function Zp(a){const i=a.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!i||LE))return new XMLHttpRequest}catch{}if(!i)try{return new An[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const Jp=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class YE extends lf{get name(){return"websocket"}doOpen(){const i=this.uri(),r=this.opts.protocols,u=Jp?{}:kp(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(u.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(i,r,u)}catch(c){return this.emitReserved("error",c)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=i=>this.onClose({description:"websocket connection closed",context:i}),this.ws.onmessage=i=>this.onData(i.data),this.ws.onerror=i=>this.onError("websocket error",i)}write(i){this.writable=!1;for(let r=0;r<i.length;r++){const u=i[r],c=r===i.length-1;nf(u,this.supportsBinary,f=>{try{this.doWrite(u,f)}catch{}c&&nu(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){const i=this.opts.secure?"wss":"ws",r=this.query||{};return this.opts.timestampRequests&&(r[this.opts.timestampParam]=Xp()),this.supportsBinary||(r.b64=1),this.createUri(i,r)}}const Rc=An.WebSocket||An.MozWebSocket;class QE extends YE{createSocket(i,r,u){return Jp?new Rc(i,r,u):r?new Rc(i,r):new Rc(i)}doWrite(i,r){this.ws.send(r)}}class VE extends lf{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(i){return this.emitReserved("error",i)}this._transport.closed.then(()=>{this.onClose()}).catch(i=>{this.onError("webtransport error",i)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(i=>{const r=TE(Number.MAX_SAFE_INTEGER,this.socket.binaryType),u=i.readable.pipeThrough(r).getReader(),c=_E();c.readable.pipeTo(i.writable),this._writer=c.writable.getWriter();const f=()=>{u.read().then(({done:m,value:g})=>{m||(this.onPacket(g),f())}).catch(m=>{})};f();const h={type:"open"};this.query.sid&&(h.data=`{"sid":"${this.query.sid}"}`),this._writer.write(h).then(()=>this.onOpen())})})}write(i){this.writable=!1;for(let r=0;r<i.length;r++){const u=i[r],c=r===i.length-1;this._writer.write(u).then(()=>{c&&nu(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var i;(i=this._transport)===null||i===void 0||i.close()}}const GE={websocket:QE,webtransport:VE,polling:qE},kE=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,XE=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function Hc(a){if(a.length>8e3)throw"URI too long";const i=a,r=a.indexOf("["),u=a.indexOf("]");r!=-1&&u!=-1&&(a=a.substring(0,r)+a.substring(r,u).replace(/:/g,";")+a.substring(u,a.length));let c=kE.exec(a||""),f={},h=14;for(;h--;)f[XE[h]]=c[h]||"";return r!=-1&&u!=-1&&(f.source=i,f.host=f.host.substring(1,f.host.length-1).replace(/;/g,":"),f.authority=f.authority.replace("[","").replace("]","").replace(/;/g,":"),f.ipv6uri=!0),f.pathNames=KE(f,f.path),f.queryKey=ZE(f,f.query),f}function KE(a,i){const r=/\/{2,9}/g,u=i.replace(r,"/").split("/");return(i.slice(0,1)=="/"||i.length===0)&&u.splice(0,1),i.slice(-1)=="/"&&u.splice(u.length-1,1),u}function ZE(a,i){const r={};return i.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(u,c,f){c&&(r[c]=f)}),r}const jc=typeof addEventListener=="function"&&typeof removeEventListener=="function",ks=[];jc&&addEventListener("offline",()=>{ks.forEach(a=>a())},!1);class $a extends wt{constructor(i,r){if(super(),this.binaryType=RE,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,i&&typeof i=="object"&&(r=i,i=null),i){const u=Hc(i);r.hostname=u.host,r.secure=u.protocol==="https"||u.protocol==="wss",r.port=u.port,u.query&&(r.query=u.query)}else r.host&&(r.hostname=Hc(r.host).host);au(this,r),this.secure=r.secure!=null?r.secure:typeof location<"u"&&location.protocol==="https:",r.hostname&&!r.port&&(r.port=this.secure?"443":"80"),this.hostname=r.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=r.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},r.transports.forEach(u=>{const c=u.prototype.name;this.transports.push(c),this._transportsByName[c]=u}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},r),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=zE(this.opts.query)),jc&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},ks.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(i){const r=Object.assign({},this.opts.query);r.EIO=Gp,r.transport=i,this.id&&(r.sid=this.id);const u=Object.assign({},this.opts,{query:r,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[i]);return new this._transportsByName[i](u)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const i=this.opts.rememberUpgrade&&$a.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const r=this.createTransport(i);r.open(),this.setTransport(r)}setTransport(i){this.transport&&this.transport.removeAllListeners(),this.transport=i,i.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",r=>this._onClose("transport close",r))}onOpen(){this.readyState="open",$a.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(i){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",i),this.emitReserved("heartbeat"),i.type){case"open":this.onHandshake(JSON.parse(i.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const r=new Error("server error");r.code=i.data,this._onError(r);break;case"message":this.emitReserved("data",i.data),this.emitReserved("message",i.data);break}}onHandshake(i){this.emitReserved("handshake",i),this.id=i.sid,this.transport.query.sid=i.sid,this._pingInterval=i.pingInterval,this._pingTimeout=i.pingTimeout,this._maxPayload=i.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const i=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+i,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},i),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const i=this._getWritablePackets();this.transport.send(i),this._prevBufferLen=i.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let r=1;for(let u=0;u<this.writeBuffer.length;u++){const c=this.writeBuffer[u].data;if(c&&(r+=ME(c)),u>0&&r>this._maxPayload)return this.writeBuffer.slice(0,u);r+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const i=Date.now()>this._pingTimeoutTime;return i&&(this._pingTimeoutTime=0,nu(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),i}write(i,r,u){return this._sendPacket("message",i,r,u),this}send(i,r,u){return this._sendPacket("message",i,r,u),this}_sendPacket(i,r,u,c){if(typeof r=="function"&&(c=r,r=void 0),typeof u=="function"&&(c=u,u=null),this.readyState==="closing"||this.readyState==="closed")return;u=u||{},u.compress=u.compress!==!1;const f={type:i,data:r,options:u};this.emitReserved("packetCreate",f),this.writeBuffer.push(f),c&&this.once("flush",c),this.flush()}close(){const i=()=>{this._onClose("forced close"),this.transport.close()},r=()=>{this.off("upgrade",r),this.off("upgradeError",r),i()},u=()=>{this.once("upgrade",r),this.once("upgradeError",r)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?u():i()}):this.upgrading?u():i()),this}_onError(i){if($a.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",i),this._onClose("transport error",i)}_onClose(i,r){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),jc&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const u=ks.indexOf(this._offlineEventListener);u!==-1&&ks.splice(u,1)}this.readyState="closed",this.id=null,this.emitReserved("close",i,r),this.writeBuffer=[],this._prevBufferLen=0}}}$a.protocol=Gp;class JE extends $a{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let i=0;i<this._upgrades.length;i++)this._probe(this._upgrades[i])}_probe(i){let r=this.createTransport(i),u=!1;$a.priorWebsocketSuccess=!1;const c=()=>{u||(r.send([{type:"ping",data:"probe"}]),r.once("packet",p=>{if(!u)if(p.type==="pong"&&p.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",r),!r)return;$a.priorWebsocketSuccess=r.name==="websocket",this.transport.pause(()=>{u||this.readyState!=="closed"&&(E(),this.setTransport(r),r.send([{type:"upgrade"}]),this.emitReserved("upgrade",r),r=null,this.upgrading=!1,this.flush())})}else{const R=new Error("probe error");R.transport=r.name,this.emitReserved("upgradeError",R)}}))};function f(){u||(u=!0,E(),r.close(),r=null)}const h=p=>{const R=new Error("probe error: "+p);R.transport=r.name,f(),this.emitReserved("upgradeError",R)};function m(){h("transport closed")}function g(){h("socket closed")}function y(p){r&&p.name!==r.name&&f()}const E=()=>{r.removeListener("open",c),r.removeListener("error",h),r.removeListener("close",m),this.off("close",g),this.off("upgrading",y)};r.once("open",c),r.once("error",h),r.once("close",m),this.once("close",g),this.once("upgrading",y),this._upgrades.indexOf("webtransport")!==-1&&i!=="webtransport"?this.setTimeoutFn(()=>{u||r.open()},200):r.open()}onHandshake(i){this._upgrades=this._filterUpgrades(i.upgrades),super.onHandshake(i)}_filterUpgrades(i){const r=[];for(let u=0;u<i.length;u++)~this.transports.indexOf(i[u])&&r.push(i[u]);return r}}let FE=class extends JE{constructor(i,r={}){const u=typeof i=="object"?i:r;(!u.transports||u.transports&&typeof u.transports[0]=="string")&&(u.transports=(u.transports||["polling","websocket","webtransport"]).map(c=>GE[c]).filter(c=>!!c)),super(i,u)}};function $E(a,i="",r){let u=a;r=r||typeof location<"u"&&location,a==null&&(a=r.protocol+"//"+r.host),typeof a=="string"&&(a.charAt(0)==="/"&&(a.charAt(1)==="/"?a=r.protocol+a:a=r.host+a),/^(https?|wss?):\/\//.test(a)||(typeof r<"u"?a=r.protocol+"//"+a:a="https://"+a),u=Hc(a)),u.port||(/^(http|ws)$/.test(u.protocol)?u.port="80":/^(http|ws)s$/.test(u.protocol)&&(u.port="443")),u.path=u.path||"/";const f=u.host.indexOf(":")!==-1?"["+u.host+"]":u.host;return u.id=u.protocol+"://"+f+":"+u.port+i,u.href=u.protocol+"://"+f+(r&&r.port===u.port?"":":"+u.port),u}const PE=typeof ArrayBuffer=="function",WE=a=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(a):a.buffer instanceof ArrayBuffer,Fp=Object.prototype.toString,IE=typeof Blob=="function"||typeof Blob<"u"&&Fp.call(Blob)==="[object BlobConstructor]",e2=typeof File=="function"||typeof File<"u"&&Fp.call(File)==="[object FileConstructor]";function rf(a){return PE&&(a instanceof ArrayBuffer||WE(a))||IE&&a instanceof Blob||e2&&a instanceof File}function Xs(a,i){if(!a||typeof a!="object")return!1;if(Array.isArray(a)){for(let r=0,u=a.length;r<u;r++)if(Xs(a[r]))return!0;return!1}if(rf(a))return!0;if(a.toJSON&&typeof a.toJSON=="function"&&arguments.length===1)return Xs(a.toJSON(),!0);for(const r in a)if(Object.prototype.hasOwnProperty.call(a,r)&&Xs(a[r]))return!0;return!1}function t2(a){const i=[],r=a.data,u=a;return u.data=qc(r,i),u.attachments=i.length,{packet:u,buffers:i}}function qc(a,i){if(!a)return a;if(rf(a)){const r={_placeholder:!0,num:i.length};return i.push(a),r}else if(Array.isArray(a)){const r=new Array(a.length);for(let u=0;u<a.length;u++)r[u]=qc(a[u],i);return r}else if(typeof a=="object"&&!(a instanceof Date)){const r={};for(const u in a)Object.prototype.hasOwnProperty.call(a,u)&&(r[u]=qc(a[u],i));return r}return a}function n2(a,i){return a.data=Yc(a.data,i),delete a.attachments,a}function Yc(a,i){if(!a)return a;if(a&&a._placeholder===!0){if(typeof a.num=="number"&&a.num>=0&&a.num<i.length)return i[a.num];throw new Error("illegal attachments")}else if(Array.isArray(a))for(let r=0;r<a.length;r++)a[r]=Yc(a[r],i);else if(typeof a=="object")for(const r in a)Object.prototype.hasOwnProperty.call(a,r)&&(a[r]=Yc(a[r],i));return a}const a2=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"];var Ye;(function(a){a[a.CONNECT=0]="CONNECT",a[a.DISCONNECT=1]="DISCONNECT",a[a.EVENT=2]="EVENT",a[a.ACK=3]="ACK",a[a.CONNECT_ERROR=4]="CONNECT_ERROR",a[a.BINARY_EVENT=5]="BINARY_EVENT",a[a.BINARY_ACK=6]="BINARY_ACK"})(Ye||(Ye={}));class l2{constructor(i){this.replacer=i}encode(i){return(i.type===Ye.EVENT||i.type===Ye.ACK)&&Xs(i)?this.encodeAsBinary({type:i.type===Ye.EVENT?Ye.BINARY_EVENT:Ye.BINARY_ACK,nsp:i.nsp,data:i.data,id:i.id}):[this.encodeAsString(i)]}encodeAsString(i){let r=""+i.type;return(i.type===Ye.BINARY_EVENT||i.type===Ye.BINARY_ACK)&&(r+=i.attachments+"-"),i.nsp&&i.nsp!=="/"&&(r+=i.nsp+","),i.id!=null&&(r+=i.id),i.data!=null&&(r+=JSON.stringify(i.data,this.replacer)),r}encodeAsBinary(i){const r=t2(i),u=this.encodeAsString(r.packet),c=r.buffers;return c.unshift(u),c}}class sf extends wt{constructor(i){super(),this.reviver=i}add(i){let r;if(typeof i=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");r=this.decodeString(i);const u=r.type===Ye.BINARY_EVENT;u||r.type===Ye.BINARY_ACK?(r.type=u?Ye.EVENT:Ye.ACK,this.reconstructor=new i2(r),r.attachments===0&&super.emitReserved("decoded",r)):super.emitReserved("decoded",r)}else if(rf(i)||i.base64)if(this.reconstructor)r=this.reconstructor.takeBinaryData(i),r&&(this.reconstructor=null,super.emitReserved("decoded",r));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+i)}decodeString(i){let r=0;const u={type:Number(i.charAt(0))};if(Ye[u.type]===void 0)throw new Error("unknown packet type "+u.type);if(u.type===Ye.BINARY_EVENT||u.type===Ye.BINARY_ACK){const f=r+1;for(;i.charAt(++r)!=="-"&&r!=i.length;);const h=i.substring(f,r);if(h!=Number(h)||i.charAt(r)!=="-")throw new Error("Illegal attachments");u.attachments=Number(h)}if(i.charAt(r+1)==="/"){const f=r+1;for(;++r&&!(i.charAt(r)===","||r===i.length););u.nsp=i.substring(f,r)}else u.nsp="/";const c=i.charAt(r+1);if(c!==""&&Number(c)==c){const f=r+1;for(;++r;){const h=i.charAt(r);if(h==null||Number(h)!=h){--r;break}if(r===i.length)break}u.id=Number(i.substring(f,r+1))}if(i.charAt(++r)){const f=this.tryParse(i.substr(r));if(sf.isPayloadValid(u.type,f))u.data=f;else throw new Error("invalid payload")}return u}tryParse(i){try{return JSON.parse(i,this.reviver)}catch{return!1}}static isPayloadValid(i,r){switch(i){case Ye.CONNECT:return Xy(r);case Ye.DISCONNECT:return r===void 0;case Ye.CONNECT_ERROR:return typeof r=="string"||Xy(r);case Ye.EVENT:case Ye.BINARY_EVENT:return Array.isArray(r)&&(typeof r[0]=="number"||typeof r[0]=="string"&&a2.indexOf(r[0])===-1);case Ye.ACK:case Ye.BINARY_ACK:return Array.isArray(r)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class i2{constructor(i){this.packet=i,this.buffers=[],this.reconPack=i}takeBinaryData(i){if(this.buffers.push(i),this.buffers.length===this.reconPack.attachments){const r=n2(this.reconPack,this.buffers);return this.finishedReconstruction(),r}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}function Xy(a){return Object.prototype.toString.call(a)==="[object Object]"}const r2=Object.freeze(Object.defineProperty({__proto__:null,Decoder:sf,Encoder:l2,get PacketType(){return Ye}},Symbol.toStringTag,{value:"Module"}));function Qn(a,i,r){return a.on(i,r),function(){a.off(i,r)}}const s2=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class $p extends wt{constructor(i,r,u){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=i,this.nsp=r,u&&u.auth&&(this.auth=u.auth),this._opts=Object.assign({},u),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const i=this.io;this.subs=[Qn(i,"open",this.onopen.bind(this)),Qn(i,"packet",this.onpacket.bind(this)),Qn(i,"error",this.onerror.bind(this)),Qn(i,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...i){return i.unshift("message"),this.emit.apply(this,i),this}emit(i,...r){var u,c,f;if(s2.hasOwnProperty(i))throw new Error('"'+i.toString()+'" is a reserved event name');if(r.unshift(i),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(r),this;const h={type:Ye.EVENT,data:r};if(h.options={},h.options.compress=this.flags.compress!==!1,typeof r[r.length-1]=="function"){const E=this.ids++,p=r.pop();this._registerAckCallback(E,p),h.id=E}const m=(c=(u=this.io.engine)===null||u===void 0?void 0:u.transport)===null||c===void 0?void 0:c.writable,g=this.connected&&!(!((f=this.io.engine)===null||f===void 0)&&f._hasPingExpired());return this.flags.volatile&&!m||(g?(this.notifyOutgoingListeners(h),this.packet(h)):this.sendBuffer.push(h)),this.flags={},this}_registerAckCallback(i,r){var u;const c=(u=this.flags.timeout)!==null&&u!==void 0?u:this._opts.ackTimeout;if(c===void 0){this.acks[i]=r;return}const f=this.io.setTimeoutFn(()=>{delete this.acks[i];for(let m=0;m<this.sendBuffer.length;m++)this.sendBuffer[m].id===i&&this.sendBuffer.splice(m,1);r.call(this,new Error("operation has timed out"))},c),h=(...m)=>{this.io.clearTimeoutFn(f),r.apply(this,m)};h.withError=!0,this.acks[i]=h}emitWithAck(i,...r){return new Promise((u,c)=>{const f=(h,m)=>h?c(h):u(m);f.withError=!0,r.push(f),this.emit(i,...r)})}_addToQueue(i){let r;typeof i[i.length-1]=="function"&&(r=i.pop());const u={id:this._queueSeq++,tryCount:0,pending:!1,args:i,flags:Object.assign({fromQueue:!0},this.flags)};i.push((c,...f)=>(this._queue[0],c!==null?u.tryCount>this._opts.retries&&(this._queue.shift(),r&&r(c)):(this._queue.shift(),r&&r(null,...f)),u.pending=!1,this._drainQueue())),this._queue.push(u),this._drainQueue()}_drainQueue(i=!1){if(!this.connected||this._queue.length===0)return;const r=this._queue[0];r.pending&&!i||(r.pending=!0,r.tryCount++,this.flags=r.flags,this.emit.apply(this,r.args))}packet(i){i.nsp=this.nsp,this.io._packet(i)}onopen(){typeof this.auth=="function"?this.auth(i=>{this._sendConnectPacket(i)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(i){this.packet({type:Ye.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},i):i})}onerror(i){this.connected||this.emitReserved("connect_error",i)}onclose(i,r){this.connected=!1,delete this.id,this.emitReserved("disconnect",i,r),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(i=>{if(!this.sendBuffer.some(u=>String(u.id)===i)){const u=this.acks[i];delete this.acks[i],u.withError&&u.call(this,new Error("socket has been disconnected"))}})}onpacket(i){if(i.nsp===this.nsp)switch(i.type){case Ye.CONNECT:i.data&&i.data.sid?this.onconnect(i.data.sid,i.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case Ye.EVENT:case Ye.BINARY_EVENT:this.onevent(i);break;case Ye.ACK:case Ye.BINARY_ACK:this.onack(i);break;case Ye.DISCONNECT:this.ondisconnect();break;case Ye.CONNECT_ERROR:this.destroy();const u=new Error(i.data.message);u.data=i.data.data,this.emitReserved("connect_error",u);break}}onevent(i){const r=i.data||[];i.id!=null&&r.push(this.ack(i.id)),this.connected?this.emitEvent(r):this.receiveBuffer.push(Object.freeze(r))}emitEvent(i){if(this._anyListeners&&this._anyListeners.length){const r=this._anyListeners.slice();for(const u of r)u.apply(this,i)}super.emit.apply(this,i),this._pid&&i.length&&typeof i[i.length-1]=="string"&&(this._lastOffset=i[i.length-1])}ack(i){const r=this;let u=!1;return function(...c){u||(u=!0,r.packet({type:Ye.ACK,id:i,data:c}))}}onack(i){const r=this.acks[i.id];typeof r=="function"&&(delete this.acks[i.id],r.withError&&i.data.unshift(null),r.apply(this,i.data))}onconnect(i,r){this.id=i,this.recovered=r&&this._pid===r,this._pid=r,this.connected=!0,this.emitBuffered(),this._drainQueue(!0),this.emitReserved("connect")}emitBuffered(){this.receiveBuffer.forEach(i=>this.emitEvent(i)),this.receiveBuffer=[],this.sendBuffer.forEach(i=>{this.notifyOutgoingListeners(i),this.packet(i)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(i=>i()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:Ye.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(i){return this.flags.compress=i,this}get volatile(){return this.flags.volatile=!0,this}timeout(i){return this.flags.timeout=i,this}onAny(i){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(i),this}prependAny(i){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(i),this}offAny(i){if(!this._anyListeners)return this;if(i){const r=this._anyListeners;for(let u=0;u<r.length;u++)if(i===r[u])return r.splice(u,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(i){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(i),this}prependAnyOutgoing(i){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(i),this}offAnyOutgoing(i){if(!this._anyOutgoingListeners)return this;if(i){const r=this._anyOutgoingListeners;for(let u=0;u<r.length;u++)if(i===r[u])return r.splice(u,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(i){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const r=this._anyOutgoingListeners.slice();for(const u of r)u.apply(this,i.data)}}}function di(a){a=a||{},this.ms=a.min||100,this.max=a.max||1e4,this.factor=a.factor||2,this.jitter=a.jitter>0&&a.jitter<=1?a.jitter:0,this.attempts=0}di.prototype.duration=function(){var a=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var i=Math.random(),r=Math.floor(i*this.jitter*a);a=(Math.floor(i*10)&1)==0?a-r:a+r}return Math.min(a,this.max)|0};di.prototype.reset=function(){this.attempts=0};di.prototype.setMin=function(a){this.ms=a};di.prototype.setMax=function(a){this.max=a};di.prototype.setJitter=function(a){this.jitter=a};class Qc extends wt{constructor(i,r){var u;super(),this.nsps={},this.subs=[],i&&typeof i=="object"&&(r=i,i=void 0),r=r||{},r.path=r.path||"/socket.io",this.opts=r,au(this,r),this.reconnection(r.reconnection!==!1),this.reconnectionAttempts(r.reconnectionAttempts||1/0),this.reconnectionDelay(r.reconnectionDelay||1e3),this.reconnectionDelayMax(r.reconnectionDelayMax||5e3),this.randomizationFactor((u=r.randomizationFactor)!==null&&u!==void 0?u:.5),this.backoff=new di({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(r.timeout==null?2e4:r.timeout),this._readyState="closed",this.uri=i;const c=r.parser||r2;this.encoder=new c.Encoder,this.decoder=new c.Decoder,this._autoConnect=r.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(i){return arguments.length?(this._reconnection=!!i,i||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(i){return i===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=i,this)}reconnectionDelay(i){var r;return i===void 0?this._reconnectionDelay:(this._reconnectionDelay=i,(r=this.backoff)===null||r===void 0||r.setMin(i),this)}randomizationFactor(i){var r;return i===void 0?this._randomizationFactor:(this._randomizationFactor=i,(r=this.backoff)===null||r===void 0||r.setJitter(i),this)}reconnectionDelayMax(i){var r;return i===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=i,(r=this.backoff)===null||r===void 0||r.setMax(i),this)}timeout(i){return arguments.length?(this._timeout=i,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(i){if(~this._readyState.indexOf("open"))return this;this.engine=new FE(this.uri,this.opts);const r=this.engine,u=this;this._readyState="opening",this.skipReconnect=!1;const c=Qn(r,"open",function(){u.onopen(),i&&i()}),f=m=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",m),i?i(m):this.maybeReconnectOnOpen()},h=Qn(r,"error",f);if(this._timeout!==!1){const m=this._timeout,g=this.setTimeoutFn(()=>{c(),f(new Error("timeout")),r.close()},m);this.opts.autoUnref&&g.unref(),this.subs.push(()=>{this.clearTimeoutFn(g)})}return this.subs.push(c),this.subs.push(h),this}connect(i){return this.open(i)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const i=this.engine;this.subs.push(Qn(i,"ping",this.onping.bind(this)),Qn(i,"data",this.ondata.bind(this)),Qn(i,"error",this.onerror.bind(this)),Qn(i,"close",this.onclose.bind(this)),Qn(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(i){try{this.decoder.add(i)}catch(r){this.onclose("parse error",r)}}ondecoded(i){nu(()=>{this.emitReserved("packet",i)},this.setTimeoutFn)}onerror(i){this.emitReserved("error",i)}socket(i,r){let u=this.nsps[i];return u?this._autoConnect&&!u.active&&u.connect():(u=new $p(this,i,r),this.nsps[i]=u),u}_destroy(i){const r=Object.keys(this.nsps);for(const u of r)if(this.nsps[u].active)return;this._close()}_packet(i){const r=this.encoder.encode(i);for(let u=0;u<r.length;u++)this.engine.write(r[u],i.options)}cleanup(){this.subs.forEach(i=>i()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(i,r){var u;this.cleanup(),(u=this.engine)===null||u===void 0||u.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",i,r),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const i=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const r=this.backoff.duration();this._reconnecting=!0;const u=this.setTimeoutFn(()=>{i.skipReconnect||(this.emitReserved("reconnect_attempt",i.backoff.attempts),!i.skipReconnect&&i.open(c=>{c?(i._reconnecting=!1,i.reconnect(),this.emitReserved("reconnect_error",c)):i.onreconnect()}))},r);this.opts.autoUnref&&u.unref(),this.subs.push(()=>{this.clearTimeoutFn(u)})}}onreconnect(){const i=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",i)}}const rr={};function Ks(a,i){typeof a=="object"&&(i=a,a=void 0),i=i||{};const r=$E(a,i.path||"/socket.io"),u=r.source,c=r.id,f=r.path,h=rr[c]&&f in rr[c].nsps,m=i.forceNew||i["force new connection"]||i.multiplex===!1||h;let g;return m?g=new Qc(u,i):(rr[c]||(rr[c]=new Qc(u,i)),g=rr[c]),r.query&&!i.query&&(i.query=r.queryKey),g.socket(r.path,i)}Object.assign(Ks,{Manager:Qc,Socket:$p,io:Ks,connect:Ks});const js="/events",S2={SUBSCRIBE:"subscribe",UNSUBSCRIBE:"unsubscribe",INPUT:"input",RESIZE:"resize",TERMINAL_INPUT:"terminal:input",TERMINAL_RESIZE:"terminal:resize"},E2={SESSION_SUBSCRIBED:"session:subscribed",SESSION_UNSUBSCRIBED:"session:unsubscribed",SESSION_STDOUT:"session:stdout",SESSION_PATCH:"session:patch",SESSION_EXIT:"session:exit",SESSION_COMPLETED:"session:completed",SESSION_ID:"session:sessionId",SESSION_ERROR:"session:error",TASK_UPDATED:"task:updated",TASK_DELETED:"task:deleted",TERMINAL_STDOUT:"terminal:stdout",TERMINAL_EXIT:"terminal:exit",TERMINAL_SUBSCRIBED:"terminal:subscribed",TERMINAL_UNSUBSCRIBED:"terminal:unsubscribed",WORKSPACE_SETUP_PROGRESS:"workspace:setup_progress",WORKSPACE_COMMIT_MESSAGE_UPDATED:"workspace:commit_message_updated"},Pp="agent-tower-tunnel-token";function u2(){const i=new URLSearchParams(window.location.search).get("token");if(i){sessionStorage.setItem(Pp,i);const r=new URL(window.location.href);r.searchParams.delete("token"),window.history.replaceState({},"",r.toString())}}function o2(){return sessionStorage.getItem(Pp)}function c2(){const a=window.location.hostname;return a!=="localhost"&&a!=="127.0.0.1"}class f2{socket=null;baseUrl;visibilityHandler=null;constructor(){this.baseUrl=""}getSocket(){if(!this.socket){const i={};if(c2()){const r=o2();r&&(i.token=r)}this.socket=Ks(`${this.baseUrl}${js}`,{auth:i,autoConnect:!1,transports:["websocket"],reconnection:!0,reconnectionAttempts:1/0,reconnectionDelay:1e3,reconnectionDelayMax:1e4}),this.socket.on("connect",()=>{console.log(`[Socket] Connected to ${js} t=${Date.now()}`)}),this.socket.on("disconnect",r=>{console.log(`[Socket] Disconnected from ${js}: t=${Date.now()}`,r)}),this.socket.on("connect_error",r=>{console.error(`[Socket] Connection error on ${js}: t=${Date.now()}`,r.message)})}return this.socket}connect(){const i=this.getSocket();return i.connected||i.connect(),this.visibilityHandler||(this.visibilityHandler=()=>{document.visibilityState==="visible"&&this.socket&&!this.socket.connected&&(console.log("[Socket] Page became visible, socket disconnected — reconnecting"),this.socket.connect())},document.addEventListener("visibilitychange",this.visibilityHandler)),i}disconnect(){this.visibilityHandler&&(document.removeEventListener("visibilitychange",this.visibilityHandler),this.visibilityHandler=null),this.socket&&(this.socket.disconnect(),this.socket=null)}isConnected(){return this.socket?.connected??!1}}const Ky=new f2;function d2(){return M.useEffect(()=>(Ky.connect(),()=>Ky.disconnect()),[]),he.jsxs(Q0,{client:pb,children:[he.jsx(yE,{}),he.jsx(yb,{position:"top-center",toastOptions:{className:"text-sm",style:{fontFamily:"inherit"},classNames:{error:"!bg-neutral-900 !text-neutral-100 !border-neutral-800 !shadow-lg",success:"!bg-neutral-900 !text-neutral-100 !border-neutral-800 !shadow-lg",default:"!bg-neutral-900 !text-neutral-100 !border-neutral-800 !shadow-lg"}}})]})}u2();m0.createRoot(document.getElementById("root")).render(he.jsx(M.StrictMode,{children:he.jsx(d2,{})}));export{p2 as A,y2 as B,S2 as C,Fy as D,ap as E,aE as F,tE as G,PS as H,Zy as I,Up as L,P as R,E2 as S,wl as _,Fs as a,E0 as b,tu as c,h2 as d,Oc as e,$s as f,o2 as g,b0 as h,c2 as i,he as j,xc as k,Py as l,L0 as m,Yn as n,w0 as o,M0 as p,Vt as q,M as r,Ky as s,S0 as t,v2 as u,fr as v,H0 as w,m2 as x,g2 as y,uy as z};