whydid 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (84) hide show
  1. package/README.md +232 -0
  2. package/dashboard/dist/android-chrome-192x192.png +0 -0
  3. package/dashboard/dist/android-chrome-512x512.png +0 -0
  4. package/dashboard/dist/apple-touch-icon.png +0 -0
  5. package/dashboard/dist/assets/index-DImKqodm.js +69 -0
  6. package/dashboard/dist/assets/index-mHXgqqkj.css +1 -0
  7. package/dashboard/dist/favicon-16x16.png +0 -0
  8. package/dashboard/dist/favicon-32x32.png +0 -0
  9. package/dashboard/dist/favicon.ico +0 -0
  10. package/dashboard/dist/index.html +24 -0
  11. package/dashboard/dist/logo-mark.svg +8 -0
  12. package/dashboard/dist/site.webmanifest +11 -0
  13. package/dist/adapters/claude-code.js +168 -0
  14. package/dist/adapters/hook-events.js +86 -0
  15. package/dist/adapters/sync-claude-code.js +85 -0
  16. package/dist/cli/ai-budget-warning.js +19 -0
  17. package/dist/cli/commands/agent-event.js +80 -0
  18. package/dist/cli/commands/checkpoint.js +36 -0
  19. package/dist/cli/commands/context.js +27 -0
  20. package/dist/cli/commands/daemon.js +139 -0
  21. package/dist/cli/commands/export.js +36 -0
  22. package/dist/cli/commands/init.js +63 -0
  23. package/dist/cli/commands/key.js +65 -0
  24. package/dist/cli/commands/license.js +57 -0
  25. package/dist/cli/commands/milestone.js +64 -0
  26. package/dist/cli/commands/prompt.js +75 -0
  27. package/dist/cli/commands/recap.js +48 -0
  28. package/dist/cli/commands/restore-fork.js +101 -0
  29. package/dist/cli/commands/status.js +26 -0
  30. package/dist/cli/commands/test.js +33 -0
  31. package/dist/cli/commands/timeline.js +23 -0
  32. package/dist/cli/commands/why.js +71 -0
  33. package/dist/cli/context.js +48 -0
  34. package/dist/cli/index.js +77 -0
  35. package/dist/cli/license-gate.js +26 -0
  36. package/dist/cli/preflight.js +28 -0
  37. package/dist/core/agent-context.js +46 -0
  38. package/dist/core/agent-hooks.js +68 -0
  39. package/dist/core/ai-budget.js +27 -0
  40. package/dist/core/chat-retrieval.js +36 -0
  41. package/dist/core/context-tree.js +135 -0
  42. package/dist/core/diff.js +30 -0
  43. package/dist/core/engine.js +321 -0
  44. package/dist/core/export.js +98 -0
  45. package/dist/core/file-history.js +31 -0
  46. package/dist/core/manifest.js +102 -0
  47. package/dist/core/recap.js +49 -0
  48. package/dist/core/test-runner.js +23 -0
  49. package/dist/daemon/listen.js +26 -0
  50. package/dist/daemon/pidfile.js +36 -0
  51. package/dist/daemon/server.js +554 -0
  52. package/dist/db/database.js +631 -0
  53. package/dist/db/schema.js +186 -0
  54. package/dist/git/git.js +22 -0
  55. package/dist/licensing/config.js +28 -0
  56. package/dist/licensing/license-client.js +45 -0
  57. package/dist/licensing/license-manager.js +89 -0
  58. package/dist/licensing/license-payload.js +12 -0
  59. package/dist/licensing/license-store.js +96 -0
  60. package/dist/licensing/machine-id.js +78 -0
  61. package/dist/licensing/secret-store.js +102 -0
  62. package/dist/licensing/verify-license.js +20 -0
  63. package/dist/llm/agent-prompt.js +36 -0
  64. package/dist/llm/annotate-checkpoint.js +67 -0
  65. package/dist/llm/annotate.js +11 -0
  66. package/dist/llm/anthropic-provider.js +97 -0
  67. package/dist/llm/chat.js +35 -0
  68. package/dist/llm/community-pricing.js +75 -0
  69. package/dist/llm/factory.js +17 -0
  70. package/dist/llm/http-error.js +25 -0
  71. package/dist/llm/noop-provider.js +19 -0
  72. package/dist/llm/openai-provider.js +85 -0
  73. package/dist/llm/pricing.js +55 -0
  74. package/dist/llm/prompt.js +103 -0
  75. package/dist/llm/provider.js +2 -0
  76. package/dist/llm/schema.js +49 -0
  77. package/dist/llm/social-post.js +49 -0
  78. package/dist/objects/store.js +31 -0
  79. package/dist/shared/config.js +45 -0
  80. package/dist/shared/redaction.js +18 -0
  81. package/dist/shared/types.js +2 -0
  82. package/dist/watcher/ignore-rules.js +92 -0
  83. package/dist/watcher/watcher.js +249 -0
  84. package/package.json +55 -0
@@ -0,0 +1,69 @@
1
+ function xf(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const l in r)if(l!=="default"&&!(l in e)){const s=Object.getOwnPropertyDescriptor(r,l);s&&Object.defineProperty(e,l,s.get?s:{enumerable:!0,get:()=>r[l]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))r(l);new MutationObserver(l=>{for(const s of l)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(l){const s={};return l.integrity&&(s.integrity=l.integrity),l.referrerPolicy&&(s.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?s.credentials="include":l.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(l){if(l.ep)return;l.ep=!0;const s=n(l);fetch(l.href,s)}})();function gf(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Iu={exports:{}},Xl={},_u={exports:{}},U={};/**
2
+ * @license React
3
+ * react.production.min.js
4
+ *
5
+ * Copyright (c) Facebook, Inc. and its affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */var Rr=Symbol.for("react.element"),vf=Symbol.for("react.portal"),yf=Symbol.for("react.fragment"),wf=Symbol.for("react.strict_mode"),jf=Symbol.for("react.profiler"),Nf=Symbol.for("react.provider"),kf=Symbol.for("react.context"),Sf=Symbol.for("react.forward_ref"),Cf=Symbol.for("react.suspense"),bf=Symbol.for("react.memo"),Ef=Symbol.for("react.lazy"),Vo=Symbol.iterator;function Pf(e){return e===null||typeof e!="object"?null:(e=Vo&&e[Vo]||e["@@iterator"],typeof e=="function"?e:null)}var Lu={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Ru=Object.assign,Tu={};function zn(e,t,n){this.props=e,this.context=t,this.refs=Tu,this.updater=n||Lu}zn.prototype.isReactComponent={};zn.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};zn.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Mu(){}Mu.prototype=zn.prototype;function Hi(e,t,n){this.props=e,this.context=t,this.refs=Tu,this.updater=n||Lu}var Ki=Hi.prototype=new Mu;Ki.constructor=Hi;Ru(Ki,zn.prototype);Ki.isPureReactComponent=!0;var Ho=Array.isArray,Ou=Object.prototype.hasOwnProperty,Qi={current:null},$u={key:!0,ref:!0,__self:!0,__source:!0};function Fu(e,t,n){var r,l={},s=null,o=null;if(t!=null)for(r in t.ref!==void 0&&(o=t.ref),t.key!==void 0&&(s=""+t.key),t)Ou.call(t,r)&&!$u.hasOwnProperty(r)&&(l[r]=t[r]);var a=arguments.length-2;if(a===1)l.children=n;else if(1<a){for(var u=Array(a),c=0;c<a;c++)u[c]=arguments[c+2];l.children=u}if(e&&e.defaultProps)for(r in a=e.defaultProps,a)l[r]===void 0&&(l[r]=a[r]);return{$$typeof:Rr,type:e,key:s,ref:o,props:l,_owner:Qi.current}}function If(e,t){return{$$typeof:Rr,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function Yi(e){return typeof e=="object"&&e!==null&&e.$$typeof===Rr}function _f(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var Ko=/\/+/g;function xs(e,t){return typeof e=="object"&&e!==null&&e.key!=null?_f(""+e.key):t.toString(36)}function ul(e,t,n,r,l){var s=typeof e;(s==="undefined"||s==="boolean")&&(e=null);var o=!1;if(e===null)o=!0;else switch(s){case"string":case"number":o=!0;break;case"object":switch(e.$$typeof){case Rr:case vf:o=!0}}if(o)return o=e,l=l(o),e=r===""?"."+xs(o,0):r,Ho(l)?(n="",e!=null&&(n=e.replace(Ko,"$&/")+"/"),ul(l,t,n,"",function(c){return c})):l!=null&&(Yi(l)&&(l=If(l,n+(!l.key||o&&o.key===l.key?"":(""+l.key).replace(Ko,"$&/")+"/")+e)),t.push(l)),1;if(o=0,r=r===""?".":r+":",Ho(e))for(var a=0;a<e.length;a++){s=e[a];var u=r+xs(s,a);o+=ul(s,t,n,u,l)}else if(u=Pf(e),typeof u=="function")for(e=u.call(e),a=0;!(s=e.next()).done;)s=s.value,u=r+xs(s,a++),o+=ul(s,t,n,u,l);else if(s==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return o}function Ar(e,t,n){if(e==null)return e;var r=[],l=0;return ul(e,r,"","",function(s){return t.call(n,s,l++)}),r}function Lf(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var Ce={current:null},cl={transition:null},Rf={ReactCurrentDispatcher:Ce,ReactCurrentBatchConfig:cl,ReactCurrentOwner:Qi};function Du(){throw Error("act(...) is not supported in production builds of React.")}U.Children={map:Ar,forEach:function(e,t,n){Ar(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return Ar(e,function(){t++}),t},toArray:function(e){return Ar(e,function(t){return t})||[]},only:function(e){if(!Yi(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};U.Component=zn;U.Fragment=yf;U.Profiler=jf;U.PureComponent=Hi;U.StrictMode=wf;U.Suspense=Cf;U.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Rf;U.act=Du;U.cloneElement=function(e,t,n){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var r=Ru({},e.props),l=e.key,s=e.ref,o=e._owner;if(t!=null){if(t.ref!==void 0&&(s=t.ref,o=Qi.current),t.key!==void 0&&(l=""+t.key),e.type&&e.type.defaultProps)var a=e.type.defaultProps;for(u in t)Ou.call(t,u)&&!$u.hasOwnProperty(u)&&(r[u]=t[u]===void 0&&a!==void 0?a[u]:t[u])}var u=arguments.length-2;if(u===1)r.children=n;else if(1<u){a=Array(u);for(var c=0;c<u;c++)a[c]=arguments[c+2];r.children=a}return{$$typeof:Rr,type:e.type,key:l,ref:s,props:r,_owner:o}};U.createContext=function(e){return e={$$typeof:kf,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:Nf,_context:e},e.Consumer=e};U.createElement=Fu;U.createFactory=function(e){var t=Fu.bind(null,e);return t.type=e,t};U.createRef=function(){return{current:null}};U.forwardRef=function(e){return{$$typeof:Sf,render:e}};U.isValidElement=Yi;U.lazy=function(e){return{$$typeof:Ef,_payload:{_status:-1,_result:e},_init:Lf}};U.memo=function(e,t){return{$$typeof:bf,type:e,compare:t===void 0?null:t}};U.startTransition=function(e){var t=cl.transition;cl.transition={};try{e()}finally{cl.transition=t}};U.unstable_act=Du;U.useCallback=function(e,t){return Ce.current.useCallback(e,t)};U.useContext=function(e){return Ce.current.useContext(e)};U.useDebugValue=function(){};U.useDeferredValue=function(e){return Ce.current.useDeferredValue(e)};U.useEffect=function(e,t){return Ce.current.useEffect(e,t)};U.useId=function(){return Ce.current.useId()};U.useImperativeHandle=function(e,t,n){return Ce.current.useImperativeHandle(e,t,n)};U.useInsertionEffect=function(e,t){return Ce.current.useInsertionEffect(e,t)};U.useLayoutEffect=function(e,t){return Ce.current.useLayoutEffect(e,t)};U.useMemo=function(e,t){return Ce.current.useMemo(e,t)};U.useReducer=function(e,t,n){return Ce.current.useReducer(e,t,n)};U.useRef=function(e){return Ce.current.useRef(e)};U.useState=function(e){return Ce.current.useState(e)};U.useSyncExternalStore=function(e,t,n){return Ce.current.useSyncExternalStore(e,t,n)};U.useTransition=function(){return Ce.current.useTransition()};U.version="18.3.1";_u.exports=U;var x=_u.exports;const Au=gf(x),Tf=xf({__proto__:null,default:Au},[x]);/**
10
+ * @license React
11
+ * react-jsx-runtime.production.min.js
12
+ *
13
+ * Copyright (c) Facebook, Inc. and its affiliates.
14
+ *
15
+ * This source code is licensed under the MIT license found in the
16
+ * LICENSE file in the root directory of this source tree.
17
+ */var Mf=x,Of=Symbol.for("react.element"),$f=Symbol.for("react.fragment"),Ff=Object.prototype.hasOwnProperty,Df=Mf.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,Af={key:!0,ref:!0,__self:!0,__source:!0};function zu(e,t,n){var r,l={},s=null,o=null;n!==void 0&&(s=""+n),t.key!==void 0&&(s=""+t.key),t.ref!==void 0&&(o=t.ref);for(r in t)Ff.call(t,r)&&!Af.hasOwnProperty(r)&&(l[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)l[r]===void 0&&(l[r]=t[r]);return{$$typeof:Of,type:e,key:s,ref:o,props:l,_owner:Df.current}}Xl.Fragment=$f;Xl.jsx=zu;Xl.jsxs=zu;Iu.exports=Xl;var i=Iu.exports,Qs={},Uu={exports:{}},ze={},Bu={exports:{}},Wu={};/**
18
+ * @license React
19
+ * scheduler.production.min.js
20
+ *
21
+ * Copyright (c) Facebook, Inc. and its affiliates.
22
+ *
23
+ * This source code is licensed under the MIT license found in the
24
+ * LICENSE file in the root directory of this source tree.
25
+ */(function(e){function t(R,O){var D=R.length;R.push(O);e:for(;0<D;){var Y=D-1>>>1,B=R[Y];if(0<l(B,O))R[Y]=O,R[D]=B,D=Y;else break e}}function n(R){return R.length===0?null:R[0]}function r(R){if(R.length===0)return null;var O=R[0],D=R.pop();if(D!==O){R[0]=D;e:for(var Y=0,B=R.length,$=B>>>1;Y<$;){var ce=2*(Y+1)-1,S=R[ce],A=ce+1,Be=R[A];if(0>l(S,D))A<B&&0>l(Be,S)?(R[Y]=Be,R[A]=D,Y=A):(R[Y]=S,R[ce]=D,Y=ce);else if(A<B&&0>l(Be,D))R[Y]=Be,R[A]=D,Y=A;else break e}}return O}function l(R,O){var D=R.sortIndex-O.sortIndex;return D!==0?D:R.id-O.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;e.unstable_now=function(){return s.now()}}else{var o=Date,a=o.now();e.unstable_now=function(){return o.now()-a}}var u=[],c=[],m=1,p=null,g=3,v=!1,y=!1,w=!1,N=typeof setTimeout=="function"?setTimeout:null,f=typeof clearTimeout=="function"?clearTimeout:null,d=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function h(R){for(var O=n(c);O!==null;){if(O.callback===null)r(c);else if(O.startTime<=R)r(c),O.sortIndex=O.expirationTime,t(u,O);else break;O=n(c)}}function j(R){if(w=!1,h(R),!y)if(n(u)!==null)y=!0,Ge(k);else{var O=n(c);O!==null&&ot(j,O.startTime-R)}}function k(R,O){y=!1,w&&(w=!1,f(L),L=-1),v=!0;var D=g;try{for(h(O),p=n(u);p!==null&&(!(p.expirationTime>O)||R&&!z());){var Y=p.callback;if(typeof Y=="function"){p.callback=null,g=p.priorityLevel;var B=Y(p.expirationTime<=O);O=e.unstable_now(),typeof B=="function"?p.callback=B:p===n(u)&&r(u),h(O)}else r(u);p=n(u)}if(p!==null)var $=!0;else{var ce=n(c);ce!==null&&ot(j,ce.startTime-O),$=!1}return $}finally{p=null,g=D,v=!1}}var E=!1,I=null,L=-1,b=5,_=-1;function z(){return!(e.unstable_now()-_<b)}function X(){if(I!==null){var R=e.unstable_now();_=R;var O=!0;try{O=I(!0,R)}finally{O?J():(E=!1,I=null)}}else E=!1}var J;if(typeof d=="function")J=function(){d(X)};else if(typeof MessageChannel<"u"){var Me=new MessageChannel,it=Me.port2;Me.port1.onmessage=X,J=function(){it.postMessage(null)}}else J=function(){N(X,0)};function Ge(R){I=R,E||(E=!0,J())}function ot(R,O){L=N(function(){R(e.unstable_now())},O)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(R){R.callback=null},e.unstable_continueExecution=function(){y||v||(y=!0,Ge(k))},e.unstable_forceFrameRate=function(R){0>R||125<R?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):b=0<R?Math.floor(1e3/R):5},e.unstable_getCurrentPriorityLevel=function(){return g},e.unstable_getFirstCallbackNode=function(){return n(u)},e.unstable_next=function(R){switch(g){case 1:case 2:case 3:var O=3;break;default:O=g}var D=g;g=O;try{return R()}finally{g=D}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(R,O){switch(R){case 1:case 2:case 3:case 4:case 5:break;default:R=3}var D=g;g=R;try{return O()}finally{g=D}},e.unstable_scheduleCallback=function(R,O,D){var Y=e.unstable_now();switch(typeof D=="object"&&D!==null?(D=D.delay,D=typeof D=="number"&&0<D?Y+D:Y):D=Y,R){case 1:var B=-1;break;case 2:B=250;break;case 5:B=1073741823;break;case 4:B=1e4;break;default:B=5e3}return B=D+B,R={id:m++,callback:O,priorityLevel:R,startTime:D,expirationTime:B,sortIndex:-1},D>Y?(R.sortIndex=D,t(c,R),n(u)===null&&R===n(c)&&(w?(f(L),L=-1):w=!0,ot(j,D-Y))):(R.sortIndex=B,t(u,R),y||v||(y=!0,Ge(k))),R},e.unstable_shouldYield=z,e.unstable_wrapCallback=function(R){var O=g;return function(){var D=g;g=O;try{return R.apply(this,arguments)}finally{g=D}}}})(Wu);Bu.exports=Wu;var zf=Bu.exports;/**
26
+ * @license React
27
+ * react-dom.production.min.js
28
+ *
29
+ * Copyright (c) Facebook, Inc. and its affiliates.
30
+ *
31
+ * This source code is licensed under the MIT license found in the
32
+ * LICENSE file in the root directory of this source tree.
33
+ */var Uf=x,Ae=zf;function C(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;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."}var Vu=new Set,pr={};function cn(e,t){Rn(e,t),Rn(e+"Capture",t)}function Rn(e,t){for(pr[e]=t,e=0;e<t.length;e++)Vu.add(t[e])}var wt=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Ys=Object.prototype.hasOwnProperty,Bf=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,Qo={},Yo={};function Wf(e){return Ys.call(Yo,e)?!0:Ys.call(Qo,e)?!1:Bf.test(e)?Yo[e]=!0:(Qo[e]=!0,!1)}function Vf(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function Hf(e,t,n,r){if(t===null||typeof t>"u"||Vf(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function be(e,t,n,r,l,s,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=l,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=s,this.removeEmptyString=o}var ge={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){ge[e]=new be(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];ge[t]=new be(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){ge[e]=new be(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){ge[e]=new be(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){ge[e]=new be(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){ge[e]=new be(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){ge[e]=new be(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){ge[e]=new be(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){ge[e]=new be(e,5,!1,e.toLowerCase(),null,!1,!1)});var Xi=/[\-:]([a-z])/g;function Gi(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(Xi,Gi);ge[t]=new be(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(Xi,Gi);ge[t]=new be(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(Xi,Gi);ge[t]=new be(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){ge[e]=new be(e,1,!1,e.toLowerCase(),null,!1,!1)});ge.xlinkHref=new be("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){ge[e]=new be(e,1,!1,e.toLowerCase(),null,!0,!0)});function Ji(e,t,n,r){var l=ge.hasOwnProperty(t)?ge[t]:null;(l!==null?l.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(Hf(t,n,l,r)&&(n=null),r||l===null?Wf(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):l.mustUseProperty?e[l.propertyName]=n===null?l.type===3?!1:"":n:(t=l.attributeName,r=l.attributeNamespace,n===null?e.removeAttribute(t):(l=l.type,n=l===3||l===4&&n===!0?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var Ct=Uf.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,zr=Symbol.for("react.element"),mn=Symbol.for("react.portal"),hn=Symbol.for("react.fragment"),Zi=Symbol.for("react.strict_mode"),Xs=Symbol.for("react.profiler"),Hu=Symbol.for("react.provider"),Ku=Symbol.for("react.context"),qi=Symbol.for("react.forward_ref"),Gs=Symbol.for("react.suspense"),Js=Symbol.for("react.suspense_list"),eo=Symbol.for("react.memo"),Et=Symbol.for("react.lazy"),Qu=Symbol.for("react.offscreen"),Xo=Symbol.iterator;function Vn(e){return e===null||typeof e!="object"?null:(e=Xo&&e[Xo]||e["@@iterator"],typeof e=="function"?e:null)}var re=Object.assign,gs;function er(e){if(gs===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);gs=t&&t[1]||""}return`
34
+ `+gs+e}var vs=!1;function ys(e,t){if(!e||vs)return"";vs=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(c){var r=c}Reflect.construct(e,[],t)}else{try{t.call()}catch(c){r=c}e.call(t.prototype)}else{try{throw Error()}catch(c){r=c}e()}}catch(c){if(c&&r&&typeof c.stack=="string"){for(var l=c.stack.split(`
35
+ `),s=r.stack.split(`
36
+ `),o=l.length-1,a=s.length-1;1<=o&&0<=a&&l[o]!==s[a];)a--;for(;1<=o&&0<=a;o--,a--)if(l[o]!==s[a]){if(o!==1||a!==1)do if(o--,a--,0>a||l[o]!==s[a]){var u=`
37
+ `+l[o].replace(" at new "," at ");return e.displayName&&u.includes("<anonymous>")&&(u=u.replace("<anonymous>",e.displayName)),u}while(1<=o&&0<=a);break}}}finally{vs=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?er(e):""}function Kf(e){switch(e.tag){case 5:return er(e.type);case 16:return er("Lazy");case 13:return er("Suspense");case 19:return er("SuspenseList");case 0:case 2:case 15:return e=ys(e.type,!1),e;case 11:return e=ys(e.type.render,!1),e;case 1:return e=ys(e.type,!0),e;default:return""}}function Zs(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case hn:return"Fragment";case mn:return"Portal";case Xs:return"Profiler";case Zi:return"StrictMode";case Gs:return"Suspense";case Js:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Ku:return(e.displayName||"Context")+".Consumer";case Hu:return(e._context.displayName||"Context")+".Provider";case qi:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case eo:return t=e.displayName||null,t!==null?t:Zs(e.type)||"Memo";case Et:t=e._payload,e=e._init;try{return Zs(e(t))}catch{}}return null}function Qf(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Zs(t);case 8:return t===Zi?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function Wt(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Yu(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Yf(e){var t=Yu(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var l=n.get,s=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return l.call(this)},set:function(o){r=""+o,s.call(this,o)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(o){r=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Ur(e){e._valueTracker||(e._valueTracker=Yf(e))}function Xu(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=Yu(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function jl(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function qs(e,t){var n=t.checked;return re({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Go(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Wt(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function Gu(e,t){t=t.checked,t!=null&&Ji(e,"checked",t,!1)}function ei(e,t){Gu(e,t);var n=Wt(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?ti(e,t.type,n):t.hasOwnProperty("defaultValue")&&ti(e,t.type,Wt(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Jo(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function ti(e,t,n){(t!=="number"||jl(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var tr=Array.isArray;function bn(e,t,n,r){if(e=e.options,t){t={};for(var l=0;l<n.length;l++)t["$"+n[l]]=!0;for(n=0;n<e.length;n++)l=t.hasOwnProperty("$"+e[n].value),e[n].selected!==l&&(e[n].selected=l),l&&r&&(e[n].defaultSelected=!0)}else{for(n=""+Wt(n),t=null,l=0;l<e.length;l++){if(e[l].value===n){e[l].selected=!0,r&&(e[l].defaultSelected=!0);return}t!==null||e[l].disabled||(t=e[l])}t!==null&&(t.selected=!0)}}function ni(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(C(91));return re({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Zo(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(C(92));if(tr(n)){if(1<n.length)throw Error(C(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:Wt(n)}}function Ju(e,t){var n=Wt(t.value),r=Wt(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),r!=null&&(e.defaultValue=""+r)}function qo(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function Zu(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function ri(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?Zu(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Br,qu=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,r,l){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,l)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(Br=Br||document.createElement("div"),Br.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Br.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function mr(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var lr={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Xf=["Webkit","ms","Moz","O"];Object.keys(lr).forEach(function(e){Xf.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),lr[t]=lr[e]})});function ec(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||lr.hasOwnProperty(e)&&lr[e]?(""+t).trim():t+"px"}function tc(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,l=ec(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,l):e[n]=l}}var Gf=re({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function li(e,t){if(t){if(Gf[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(C(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(C(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(C(61))}if(t.style!=null&&typeof t.style!="object")throw Error(C(62))}}function si(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var ii=null;function to(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var oi=null,En=null,Pn=null;function ea(e){if(e=Or(e)){if(typeof oi!="function")throw Error(C(280));var t=e.stateNode;t&&(t=es(t),oi(e.stateNode,e.type,t))}}function nc(e){En?Pn?Pn.push(e):Pn=[e]:En=e}function rc(){if(En){var e=En,t=Pn;if(Pn=En=null,ea(e),t)for(e=0;e<t.length;e++)ea(t[e])}}function lc(e,t){return e(t)}function sc(){}var ws=!1;function ic(e,t,n){if(ws)return e(t,n);ws=!0;try{return lc(e,t,n)}finally{ws=!1,(En!==null||Pn!==null)&&(sc(),rc())}}function hr(e,t){var n=e.stateNode;if(n===null)return null;var r=es(n);if(r===null)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(C(231,t,typeof n));return n}var ai=!1;if(wt)try{var Hn={};Object.defineProperty(Hn,"passive",{get:function(){ai=!0}}),window.addEventListener("test",Hn,Hn),window.removeEventListener("test",Hn,Hn)}catch{ai=!1}function Jf(e,t,n,r,l,s,o,a,u){var c=Array.prototype.slice.call(arguments,3);try{t.apply(n,c)}catch(m){this.onError(m)}}var sr=!1,Nl=null,kl=!1,ui=null,Zf={onError:function(e){sr=!0,Nl=e}};function qf(e,t,n,r,l,s,o,a,u){sr=!1,Nl=null,Jf.apply(Zf,arguments)}function ep(e,t,n,r,l,s,o,a,u){if(qf.apply(this,arguments),sr){if(sr){var c=Nl;sr=!1,Nl=null}else throw Error(C(198));kl||(kl=!0,ui=c)}}function dn(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function oc(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 ta(e){if(dn(e)!==e)throw Error(C(188))}function tp(e){var t=e.alternate;if(!t){if(t=dn(e),t===null)throw Error(C(188));return t!==e?null:e}for(var n=e,r=t;;){var l=n.return;if(l===null)break;var s=l.alternate;if(s===null){if(r=l.return,r!==null){n=r;continue}break}if(l.child===s.child){for(s=l.child;s;){if(s===n)return ta(l),e;if(s===r)return ta(l),t;s=s.sibling}throw Error(C(188))}if(n.return!==r.return)n=l,r=s;else{for(var o=!1,a=l.child;a;){if(a===n){o=!0,n=l,r=s;break}if(a===r){o=!0,r=l,n=s;break}a=a.sibling}if(!o){for(a=s.child;a;){if(a===n){o=!0,n=s,r=l;break}if(a===r){o=!0,r=s,n=l;break}a=a.sibling}if(!o)throw Error(C(189))}}if(n.alternate!==r)throw Error(C(190))}if(n.tag!==3)throw Error(C(188));return n.stateNode.current===n?e:t}function ac(e){return e=tp(e),e!==null?uc(e):null}function uc(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=uc(e);if(t!==null)return t;e=e.sibling}return null}var cc=Ae.unstable_scheduleCallback,na=Ae.unstable_cancelCallback,np=Ae.unstable_shouldYield,rp=Ae.unstable_requestPaint,ae=Ae.unstable_now,lp=Ae.unstable_getCurrentPriorityLevel,no=Ae.unstable_ImmediatePriority,dc=Ae.unstable_UserBlockingPriority,Sl=Ae.unstable_NormalPriority,sp=Ae.unstable_LowPriority,fc=Ae.unstable_IdlePriority,Gl=null,ft=null;function ip(e){if(ft&&typeof ft.onCommitFiberRoot=="function")try{ft.onCommitFiberRoot(Gl,e,void 0,(e.current.flags&128)===128)}catch{}}var rt=Math.clz32?Math.clz32:up,op=Math.log,ap=Math.LN2;function up(e){return e>>>=0,e===0?32:31-(op(e)/ap|0)|0}var Wr=64,Vr=4194304;function nr(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Cl(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,l=e.suspendedLanes,s=e.pingedLanes,o=n&268435455;if(o!==0){var a=o&~l;a!==0?r=nr(a):(s&=o,s!==0&&(r=nr(s)))}else o=n&~l,o!==0?r=nr(o):s!==0&&(r=nr(s));if(r===0)return 0;if(t!==0&&t!==r&&!(t&l)&&(l=r&-r,s=t&-t,l>=s||l===16&&(s&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)n=31-rt(t),l=1<<n,r|=e[n],t&=~l;return r}function cp(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function dp(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,l=e.expirationTimes,s=e.pendingLanes;0<s;){var o=31-rt(s),a=1<<o,u=l[o];u===-1?(!(a&n)||a&r)&&(l[o]=cp(a,t)):u<=t&&(e.expiredLanes|=a),s&=~a}}function ci(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function pc(){var e=Wr;return Wr<<=1,!(Wr&4194240)&&(Wr=64),e}function js(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Tr(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-rt(t),e[t]=n}function fp(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<n;){var l=31-rt(n),s=1<<l;t[l]=0,r[l]=-1,e[l]=-1,n&=~s}}function ro(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-rt(n),l=1<<r;l&t|e[r]&t&&(e[r]|=t),n&=~l}}var Q=0;function mc(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var hc,lo,xc,gc,vc,di=!1,Hr=[],Mt=null,Ot=null,$t=null,xr=new Map,gr=new Map,It=[],pp="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function ra(e,t){switch(e){case"focusin":case"focusout":Mt=null;break;case"dragenter":case"dragleave":Ot=null;break;case"mouseover":case"mouseout":$t=null;break;case"pointerover":case"pointerout":xr.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":gr.delete(t.pointerId)}}function Kn(e,t,n,r,l,s){return e===null||e.nativeEvent!==s?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:s,targetContainers:[l]},t!==null&&(t=Or(t),t!==null&&lo(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,l!==null&&t.indexOf(l)===-1&&t.push(l),e)}function mp(e,t,n,r,l){switch(t){case"focusin":return Mt=Kn(Mt,e,t,n,r,l),!0;case"dragenter":return Ot=Kn(Ot,e,t,n,r,l),!0;case"mouseover":return $t=Kn($t,e,t,n,r,l),!0;case"pointerover":var s=l.pointerId;return xr.set(s,Kn(xr.get(s)||null,e,t,n,r,l)),!0;case"gotpointercapture":return s=l.pointerId,gr.set(s,Kn(gr.get(s)||null,e,t,n,r,l)),!0}return!1}function yc(e){var t=qt(e.target);if(t!==null){var n=dn(t);if(n!==null){if(t=n.tag,t===13){if(t=oc(n),t!==null){e.blockedOn=t,vc(e.priority,function(){xc(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 dl(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=fi(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);ii=r,n.target.dispatchEvent(r),ii=null}else return t=Or(n),t!==null&&lo(t),e.blockedOn=n,!1;t.shift()}return!0}function la(e,t,n){dl(e)&&n.delete(t)}function hp(){di=!1,Mt!==null&&dl(Mt)&&(Mt=null),Ot!==null&&dl(Ot)&&(Ot=null),$t!==null&&dl($t)&&($t=null),xr.forEach(la),gr.forEach(la)}function Qn(e,t){e.blockedOn===t&&(e.blockedOn=null,di||(di=!0,Ae.unstable_scheduleCallback(Ae.unstable_NormalPriority,hp)))}function vr(e){function t(l){return Qn(l,e)}if(0<Hr.length){Qn(Hr[0],e);for(var n=1;n<Hr.length;n++){var r=Hr[n];r.blockedOn===e&&(r.blockedOn=null)}}for(Mt!==null&&Qn(Mt,e),Ot!==null&&Qn(Ot,e),$t!==null&&Qn($t,e),xr.forEach(t),gr.forEach(t),n=0;n<It.length;n++)r=It[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<It.length&&(n=It[0],n.blockedOn===null);)yc(n),n.blockedOn===null&&It.shift()}var In=Ct.ReactCurrentBatchConfig,bl=!0;function xp(e,t,n,r){var l=Q,s=In.transition;In.transition=null;try{Q=1,so(e,t,n,r)}finally{Q=l,In.transition=s}}function gp(e,t,n,r){var l=Q,s=In.transition;In.transition=null;try{Q=4,so(e,t,n,r)}finally{Q=l,In.transition=s}}function so(e,t,n,r){if(bl){var l=fi(e,t,n,r);if(l===null)Ls(e,t,r,El,n),ra(e,r);else if(mp(l,e,t,n,r))r.stopPropagation();else if(ra(e,r),t&4&&-1<pp.indexOf(e)){for(;l!==null;){var s=Or(l);if(s!==null&&hc(s),s=fi(e,t,n,r),s===null&&Ls(e,t,r,El,n),s===l)break;l=s}l!==null&&r.stopPropagation()}else Ls(e,t,r,null,n)}}var El=null;function fi(e,t,n,r){if(El=null,e=to(r),e=qt(e),e!==null)if(t=dn(e),t===null)e=null;else if(n=t.tag,n===13){if(e=oc(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 El=e,null}function wc(e){switch(e){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(lp()){case no:return 1;case dc:return 4;case Sl:case sp:return 16;case fc:return 536870912;default:return 16}default:return 16}}var Lt=null,io=null,fl=null;function jc(){if(fl)return fl;var e,t=io,n=t.length,r,l="value"in Lt?Lt.value:Lt.textContent,s=l.length;for(e=0;e<n&&t[e]===l[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===l[s-r];r++);return fl=l.slice(e,1<r?1-r:void 0)}function pl(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function Kr(){return!0}function sa(){return!1}function Ue(e){function t(n,r,l,s,o){this._reactName=n,this._targetInst=l,this.type=r,this.nativeEvent=s,this.target=o,this.currentTarget=null;for(var a in e)e.hasOwnProperty(a)&&(n=e[a],this[a]=n?n(s):s[a]);return this.isDefaultPrevented=(s.defaultPrevented!=null?s.defaultPrevented:s.returnValue===!1)?Kr:sa,this.isPropagationStopped=sa,this}return re(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=Kr)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Kr)},persist:function(){},isPersistent:Kr}),t}var Un={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},oo=Ue(Un),Mr=re({},Un,{view:0,detail:0}),vp=Ue(Mr),Ns,ks,Yn,Jl=re({},Mr,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ao,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==Yn&&(Yn&&e.type==="mousemove"?(Ns=e.screenX-Yn.screenX,ks=e.screenY-Yn.screenY):ks=Ns=0,Yn=e),Ns)},movementY:function(e){return"movementY"in e?e.movementY:ks}}),ia=Ue(Jl),yp=re({},Jl,{dataTransfer:0}),wp=Ue(yp),jp=re({},Mr,{relatedTarget:0}),Ss=Ue(jp),Np=re({},Un,{animationName:0,elapsedTime:0,pseudoElement:0}),kp=Ue(Np),Sp=re({},Un,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Cp=Ue(Sp),bp=re({},Un,{data:0}),oa=Ue(bp),Ep={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Pp={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},Ip={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function _p(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Ip[e])?!!t[e]:!1}function ao(){return _p}var Lp=re({},Mr,{key:function(e){if(e.key){var t=Ep[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=pl(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Pp[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:ao,charCode:function(e){return e.type==="keypress"?pl(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?pl(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Rp=Ue(Lp),Tp=re({},Jl,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),aa=Ue(Tp),Mp=re({},Mr,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ao}),Op=Ue(Mp),$p=re({},Un,{propertyName:0,elapsedTime:0,pseudoElement:0}),Fp=Ue($p),Dp=re({},Jl,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),Ap=Ue(Dp),zp=[9,13,27,32],uo=wt&&"CompositionEvent"in window,ir=null;wt&&"documentMode"in document&&(ir=document.documentMode);var Up=wt&&"TextEvent"in window&&!ir,Nc=wt&&(!uo||ir&&8<ir&&11>=ir),ua=" ",ca=!1;function kc(e,t){switch(e){case"keyup":return zp.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Sc(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var xn=!1;function Bp(e,t){switch(e){case"compositionend":return Sc(t);case"keypress":return t.which!==32?null:(ca=!0,ua);case"textInput":return e=t.data,e===ua&&ca?null:e;default:return null}}function Wp(e,t){if(xn)return e==="compositionend"||!uo&&kc(e,t)?(e=jc(),fl=io=Lt=null,xn=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return Nc&&t.locale!=="ko"?null:t.data;default:return null}}var Vp={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function da(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Vp[e.type]:t==="textarea"}function Cc(e,t,n,r){nc(r),t=Pl(t,"onChange"),0<t.length&&(n=new oo("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var or=null,yr=null;function Hp(e){$c(e,0)}function Zl(e){var t=yn(e);if(Xu(t))return e}function Kp(e,t){if(e==="change")return t}var bc=!1;if(wt){var Cs;if(wt){var bs="oninput"in document;if(!bs){var fa=document.createElement("div");fa.setAttribute("oninput","return;"),bs=typeof fa.oninput=="function"}Cs=bs}else Cs=!1;bc=Cs&&(!document.documentMode||9<document.documentMode)}function pa(){or&&(or.detachEvent("onpropertychange",Ec),yr=or=null)}function Ec(e){if(e.propertyName==="value"&&Zl(yr)){var t=[];Cc(t,yr,e,to(e)),ic(Hp,t)}}function Qp(e,t,n){e==="focusin"?(pa(),or=t,yr=n,or.attachEvent("onpropertychange",Ec)):e==="focusout"&&pa()}function Yp(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Zl(yr)}function Xp(e,t){if(e==="click")return Zl(t)}function Gp(e,t){if(e==="input"||e==="change")return Zl(t)}function Jp(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var st=typeof Object.is=="function"?Object.is:Jp;function wr(e,t){if(st(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var l=n[r];if(!Ys.call(t,l)||!st(e[l],t[l]))return!1}return!0}function ma(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function ha(e,t){var n=ma(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=ma(n)}}function Pc(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Pc(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Ic(){for(var e=window,t=jl();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=jl(e.document)}return t}function co(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function Zp(e){var t=Ic(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Pc(n.ownerDocument.documentElement,n)){if(r!==null&&co(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var l=n.textContent.length,s=Math.min(r.start,l);r=r.end===void 0?s:Math.min(r.end,l),!e.extend&&s>r&&(l=r,r=s,s=l),l=ha(n,s);var o=ha(n,r);l&&o&&(e.rangeCount!==1||e.anchorNode!==l.node||e.anchorOffset!==l.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(l.node,l.offset),e.removeAllRanges(),s>r?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var qp=wt&&"documentMode"in document&&11>=document.documentMode,gn=null,pi=null,ar=null,mi=!1;function xa(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;mi||gn==null||gn!==jl(r)||(r=gn,"selectionStart"in r&&co(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),ar&&wr(ar,r)||(ar=r,r=Pl(pi,"onSelect"),0<r.length&&(t=new oo("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=gn)))}function Qr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var vn={animationend:Qr("Animation","AnimationEnd"),animationiteration:Qr("Animation","AnimationIteration"),animationstart:Qr("Animation","AnimationStart"),transitionend:Qr("Transition","TransitionEnd")},Es={},_c={};wt&&(_c=document.createElement("div").style,"AnimationEvent"in window||(delete vn.animationend.animation,delete vn.animationiteration.animation,delete vn.animationstart.animation),"TransitionEvent"in window||delete vn.transitionend.transition);function ql(e){if(Es[e])return Es[e];if(!vn[e])return e;var t=vn[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in _c)return Es[e]=t[n];return e}var Lc=ql("animationend"),Rc=ql("animationiteration"),Tc=ql("animationstart"),Mc=ql("transitionend"),Oc=new Map,ga="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function Ht(e,t){Oc.set(e,t),cn(t,[e])}for(var Ps=0;Ps<ga.length;Ps++){var Is=ga[Ps],em=Is.toLowerCase(),tm=Is[0].toUpperCase()+Is.slice(1);Ht(em,"on"+tm)}Ht(Lc,"onAnimationEnd");Ht(Rc,"onAnimationIteration");Ht(Tc,"onAnimationStart");Ht("dblclick","onDoubleClick");Ht("focusin","onFocus");Ht("focusout","onBlur");Ht(Mc,"onTransitionEnd");Rn("onMouseEnter",["mouseout","mouseover"]);Rn("onMouseLeave",["mouseout","mouseover"]);Rn("onPointerEnter",["pointerout","pointerover"]);Rn("onPointerLeave",["pointerout","pointerover"]);cn("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));cn("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));cn("onBeforeInput",["compositionend","keypress","textInput","paste"]);cn("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));cn("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));cn("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var rr="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),nm=new Set("cancel close invalid load scroll toggle".split(" ").concat(rr));function va(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,ep(r,t,void 0,e),e.currentTarget=null}function $c(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],l=r.event;r=r.listeners;e:{var s=void 0;if(t)for(var o=r.length-1;0<=o;o--){var a=r[o],u=a.instance,c=a.currentTarget;if(a=a.listener,u!==s&&l.isPropagationStopped())break e;va(l,a,c),s=u}else for(o=0;o<r.length;o++){if(a=r[o],u=a.instance,c=a.currentTarget,a=a.listener,u!==s&&l.isPropagationStopped())break e;va(l,a,c),s=u}}}if(kl)throw e=ui,kl=!1,ui=null,e}function Z(e,t){var n=t[yi];n===void 0&&(n=t[yi]=new Set);var r=e+"__bubble";n.has(r)||(Fc(t,e,2,!1),n.add(r))}function _s(e,t,n){var r=0;t&&(r|=4),Fc(n,e,r,t)}var Yr="_reactListening"+Math.random().toString(36).slice(2);function jr(e){if(!e[Yr]){e[Yr]=!0,Vu.forEach(function(n){n!=="selectionchange"&&(nm.has(n)||_s(n,!1,e),_s(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Yr]||(t[Yr]=!0,_s("selectionchange",!1,t))}}function Fc(e,t,n,r){switch(wc(t)){case 1:var l=xp;break;case 4:l=gp;break;default:l=so}n=l.bind(null,t,n,e),l=void 0,!ai||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(l=!0),r?l!==void 0?e.addEventListener(t,n,{capture:!0,passive:l}):e.addEventListener(t,n,!0):l!==void 0?e.addEventListener(t,n,{passive:l}):e.addEventListener(t,n,!1)}function Ls(e,t,n,r,l){var s=r;if(!(t&1)&&!(t&2)&&r!==null)e:for(;;){if(r===null)return;var o=r.tag;if(o===3||o===4){var a=r.stateNode.containerInfo;if(a===l||a.nodeType===8&&a.parentNode===l)break;if(o===4)for(o=r.return;o!==null;){var u=o.tag;if((u===3||u===4)&&(u=o.stateNode.containerInfo,u===l||u.nodeType===8&&u.parentNode===l))return;o=o.return}for(;a!==null;){if(o=qt(a),o===null)return;if(u=o.tag,u===5||u===6){r=s=o;continue e}a=a.parentNode}}r=r.return}ic(function(){var c=s,m=to(n),p=[];e:{var g=Oc.get(e);if(g!==void 0){var v=oo,y=e;switch(e){case"keypress":if(pl(n)===0)break e;case"keydown":case"keyup":v=Rp;break;case"focusin":y="focus",v=Ss;break;case"focusout":y="blur",v=Ss;break;case"beforeblur":case"afterblur":v=Ss;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":v=ia;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":v=wp;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":v=Op;break;case Lc:case Rc:case Tc:v=kp;break;case Mc:v=Fp;break;case"scroll":v=vp;break;case"wheel":v=Ap;break;case"copy":case"cut":case"paste":v=Cp;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":v=aa}var w=(t&4)!==0,N=!w&&e==="scroll",f=w?g!==null?g+"Capture":null:g;w=[];for(var d=c,h;d!==null;){h=d;var j=h.stateNode;if(h.tag===5&&j!==null&&(h=j,f!==null&&(j=hr(d,f),j!=null&&w.push(Nr(d,j,h)))),N)break;d=d.return}0<w.length&&(g=new v(g,y,null,n,m),p.push({event:g,listeners:w}))}}if(!(t&7)){e:{if(g=e==="mouseover"||e==="pointerover",v=e==="mouseout"||e==="pointerout",g&&n!==ii&&(y=n.relatedTarget||n.fromElement)&&(qt(y)||y[jt]))break e;if((v||g)&&(g=m.window===m?m:(g=m.ownerDocument)?g.defaultView||g.parentWindow:window,v?(y=n.relatedTarget||n.toElement,v=c,y=y?qt(y):null,y!==null&&(N=dn(y),y!==N||y.tag!==5&&y.tag!==6)&&(y=null)):(v=null,y=c),v!==y)){if(w=ia,j="onMouseLeave",f="onMouseEnter",d="mouse",(e==="pointerout"||e==="pointerover")&&(w=aa,j="onPointerLeave",f="onPointerEnter",d="pointer"),N=v==null?g:yn(v),h=y==null?g:yn(y),g=new w(j,d+"leave",v,n,m),g.target=N,g.relatedTarget=h,j=null,qt(m)===c&&(w=new w(f,d+"enter",y,n,m),w.target=h,w.relatedTarget=N,j=w),N=j,v&&y)t:{for(w=v,f=y,d=0,h=w;h;h=fn(h))d++;for(h=0,j=f;j;j=fn(j))h++;for(;0<d-h;)w=fn(w),d--;for(;0<h-d;)f=fn(f),h--;for(;d--;){if(w===f||f!==null&&w===f.alternate)break t;w=fn(w),f=fn(f)}w=null}else w=null;v!==null&&ya(p,g,v,w,!1),y!==null&&N!==null&&ya(p,N,y,w,!0)}}e:{if(g=c?yn(c):window,v=g.nodeName&&g.nodeName.toLowerCase(),v==="select"||v==="input"&&g.type==="file")var k=Kp;else if(da(g))if(bc)k=Gp;else{k=Yp;var E=Qp}else(v=g.nodeName)&&v.toLowerCase()==="input"&&(g.type==="checkbox"||g.type==="radio")&&(k=Xp);if(k&&(k=k(e,c))){Cc(p,k,n,m);break e}E&&E(e,g,c),e==="focusout"&&(E=g._wrapperState)&&E.controlled&&g.type==="number"&&ti(g,"number",g.value)}switch(E=c?yn(c):window,e){case"focusin":(da(E)||E.contentEditable==="true")&&(gn=E,pi=c,ar=null);break;case"focusout":ar=pi=gn=null;break;case"mousedown":mi=!0;break;case"contextmenu":case"mouseup":case"dragend":mi=!1,xa(p,n,m);break;case"selectionchange":if(qp)break;case"keydown":case"keyup":xa(p,n,m)}var I;if(uo)e:{switch(e){case"compositionstart":var L="onCompositionStart";break e;case"compositionend":L="onCompositionEnd";break e;case"compositionupdate":L="onCompositionUpdate";break e}L=void 0}else xn?kc(e,n)&&(L="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(L="onCompositionStart");L&&(Nc&&n.locale!=="ko"&&(xn||L!=="onCompositionStart"?L==="onCompositionEnd"&&xn&&(I=jc()):(Lt=m,io="value"in Lt?Lt.value:Lt.textContent,xn=!0)),E=Pl(c,L),0<E.length&&(L=new oa(L,e,null,n,m),p.push({event:L,listeners:E}),I?L.data=I:(I=Sc(n),I!==null&&(L.data=I)))),(I=Up?Bp(e,n):Wp(e,n))&&(c=Pl(c,"onBeforeInput"),0<c.length&&(m=new oa("onBeforeInput","beforeinput",null,n,m),p.push({event:m,listeners:c}),m.data=I))}$c(p,t)})}function Nr(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Pl(e,t){for(var n=t+"Capture",r=[];e!==null;){var l=e,s=l.stateNode;l.tag===5&&s!==null&&(l=s,s=hr(e,n),s!=null&&r.unshift(Nr(e,s,l)),s=hr(e,t),s!=null&&r.push(Nr(e,s,l))),e=e.return}return r}function fn(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function ya(e,t,n,r,l){for(var s=t._reactName,o=[];n!==null&&n!==r;){var a=n,u=a.alternate,c=a.stateNode;if(u!==null&&u===r)break;a.tag===5&&c!==null&&(a=c,l?(u=hr(n,s),u!=null&&o.unshift(Nr(n,u,a))):l||(u=hr(n,s),u!=null&&o.push(Nr(n,u,a)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var rm=/\r\n?/g,lm=/\u0000|\uFFFD/g;function wa(e){return(typeof e=="string"?e:""+e).replace(rm,`
38
+ `).replace(lm,"")}function Xr(e,t,n){if(t=wa(t),wa(e)!==t&&n)throw Error(C(425))}function Il(){}var hi=null,xi=null;function gi(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var vi=typeof setTimeout=="function"?setTimeout:void 0,sm=typeof clearTimeout=="function"?clearTimeout:void 0,ja=typeof Promise=="function"?Promise:void 0,im=typeof queueMicrotask=="function"?queueMicrotask:typeof ja<"u"?function(e){return ja.resolve(null).then(e).catch(om)}:vi;function om(e){setTimeout(function(){throw e})}function Rs(e,t){var n=t,r=0;do{var l=n.nextSibling;if(e.removeChild(n),l&&l.nodeType===8)if(n=l.data,n==="/$"){if(r===0){e.removeChild(l),vr(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=l}while(n);vr(t)}function Ft(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==="$?")break;if(t==="/$")return null}}return e}function Na(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var Bn=Math.random().toString(36).slice(2),dt="__reactFiber$"+Bn,kr="__reactProps$"+Bn,jt="__reactContainer$"+Bn,yi="__reactEvents$"+Bn,am="__reactListeners$"+Bn,um="__reactHandles$"+Bn;function qt(e){var t=e[dt];if(t)return t;for(var n=e.parentNode;n;){if(t=n[jt]||n[dt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Na(e);e!==null;){if(n=e[dt])return n;e=Na(e)}return t}e=n,n=e.parentNode}return null}function Or(e){return e=e[dt]||e[jt],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function yn(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(C(33))}function es(e){return e[kr]||null}var wi=[],wn=-1;function Kt(e){return{current:e}}function q(e){0>wn||(e.current=wi[wn],wi[wn]=null,wn--)}function G(e,t){wn++,wi[wn]=e.current,e.current=t}var Vt={},je=Kt(Vt),Le=Kt(!1),ln=Vt;function Tn(e,t){var n=e.type.contextTypes;if(!n)return Vt;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var l={},s;for(s in n)l[s]=t[s];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=l),l}function Re(e){return e=e.childContextTypes,e!=null}function _l(){q(Le),q(je)}function ka(e,t,n){if(je.current!==Vt)throw Error(C(168));G(je,t),G(Le,n)}function Dc(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var l in r)if(!(l in t))throw Error(C(108,Qf(e)||"Unknown",l));return re({},n,r)}function Ll(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Vt,ln=je.current,G(je,e),G(Le,Le.current),!0}function Sa(e,t,n){var r=e.stateNode;if(!r)throw Error(C(169));n?(e=Dc(e,t,ln),r.__reactInternalMemoizedMergedChildContext=e,q(Le),q(je),G(je,e)):q(Le),G(Le,n)}var ht=null,ts=!1,Ts=!1;function Ac(e){ht===null?ht=[e]:ht.push(e)}function cm(e){ts=!0,Ac(e)}function Qt(){if(!Ts&&ht!==null){Ts=!0;var e=0,t=Q;try{var n=ht;for(Q=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}ht=null,ts=!1}catch(l){throw ht!==null&&(ht=ht.slice(e+1)),cc(no,Qt),l}finally{Q=t,Ts=!1}}return null}var jn=[],Nn=0,Rl=null,Tl=0,Ve=[],He=0,sn=null,xt=1,gt="";function Jt(e,t){jn[Nn++]=Tl,jn[Nn++]=Rl,Rl=e,Tl=t}function zc(e,t,n){Ve[He++]=xt,Ve[He++]=gt,Ve[He++]=sn,sn=e;var r=xt;e=gt;var l=32-rt(r)-1;r&=~(1<<l),n+=1;var s=32-rt(t)+l;if(30<s){var o=l-l%5;s=(r&(1<<o)-1).toString(32),r>>=o,l-=o,xt=1<<32-rt(t)+l|n<<l|r,gt=s+e}else xt=1<<s|n<<l|r,gt=e}function fo(e){e.return!==null&&(Jt(e,1),zc(e,1,0))}function po(e){for(;e===Rl;)Rl=jn[--Nn],jn[Nn]=null,Tl=jn[--Nn],jn[Nn]=null;for(;e===sn;)sn=Ve[--He],Ve[He]=null,gt=Ve[--He],Ve[He]=null,xt=Ve[--He],Ve[He]=null}var De=null,Fe=null,ee=!1,nt=null;function Uc(e,t){var n=Ke(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function Ca(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,De=e,Fe=Ft(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,De=e,Fe=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=sn!==null?{id:xt,overflow:gt}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=Ke(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,De=e,Fe=null,!0):!1;default:return!1}}function ji(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Ni(e){if(ee){var t=Fe;if(t){var n=t;if(!Ca(e,t)){if(ji(e))throw Error(C(418));t=Ft(n.nextSibling);var r=De;t&&Ca(e,t)?Uc(r,n):(e.flags=e.flags&-4097|2,ee=!1,De=e)}}else{if(ji(e))throw Error(C(418));e.flags=e.flags&-4097|2,ee=!1,De=e}}}function ba(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;De=e}function Gr(e){if(e!==De)return!1;if(!ee)return ba(e),ee=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!gi(e.type,e.memoizedProps)),t&&(t=Fe)){if(ji(e))throw Bc(),Error(C(418));for(;t;)Uc(e,t),t=Ft(t.nextSibling)}if(ba(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(C(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){Fe=Ft(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}Fe=null}}else Fe=De?Ft(e.stateNode.nextSibling):null;return!0}function Bc(){for(var e=Fe;e;)e=Ft(e.nextSibling)}function Mn(){Fe=De=null,ee=!1}function mo(e){nt===null?nt=[e]:nt.push(e)}var dm=Ct.ReactCurrentBatchConfig;function Xn(e,t,n){if(e=n.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(C(309));var r=n.stateNode}if(!r)throw Error(C(147,e));var l=r,s=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===s?t.ref:(t=function(o){var a=l.refs;o===null?delete a[s]:a[s]=o},t._stringRef=s,t)}if(typeof e!="string")throw Error(C(284));if(!n._owner)throw Error(C(290,e))}return e}function Jr(e,t){throw e=Object.prototype.toString.call(t),Error(C(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function Ea(e){var t=e._init;return t(e._payload)}function Wc(e){function t(f,d){if(e){var h=f.deletions;h===null?(f.deletions=[d],f.flags|=16):h.push(d)}}function n(f,d){if(!e)return null;for(;d!==null;)t(f,d),d=d.sibling;return null}function r(f,d){for(f=new Map;d!==null;)d.key!==null?f.set(d.key,d):f.set(d.index,d),d=d.sibling;return f}function l(f,d){return f=Ut(f,d),f.index=0,f.sibling=null,f}function s(f,d,h){return f.index=h,e?(h=f.alternate,h!==null?(h=h.index,h<d?(f.flags|=2,d):h):(f.flags|=2,d)):(f.flags|=1048576,d)}function o(f){return e&&f.alternate===null&&(f.flags|=2),f}function a(f,d,h,j){return d===null||d.tag!==6?(d=zs(h,f.mode,j),d.return=f,d):(d=l(d,h),d.return=f,d)}function u(f,d,h,j){var k=h.type;return k===hn?m(f,d,h.props.children,j,h.key):d!==null&&(d.elementType===k||typeof k=="object"&&k!==null&&k.$$typeof===Et&&Ea(k)===d.type)?(j=l(d,h.props),j.ref=Xn(f,d,h),j.return=f,j):(j=wl(h.type,h.key,h.props,null,f.mode,j),j.ref=Xn(f,d,h),j.return=f,j)}function c(f,d,h,j){return d===null||d.tag!==4||d.stateNode.containerInfo!==h.containerInfo||d.stateNode.implementation!==h.implementation?(d=Us(h,f.mode,j),d.return=f,d):(d=l(d,h.children||[]),d.return=f,d)}function m(f,d,h,j,k){return d===null||d.tag!==7?(d=rn(h,f.mode,j,k),d.return=f,d):(d=l(d,h),d.return=f,d)}function p(f,d,h){if(typeof d=="string"&&d!==""||typeof d=="number")return d=zs(""+d,f.mode,h),d.return=f,d;if(typeof d=="object"&&d!==null){switch(d.$$typeof){case zr:return h=wl(d.type,d.key,d.props,null,f.mode,h),h.ref=Xn(f,null,d),h.return=f,h;case mn:return d=Us(d,f.mode,h),d.return=f,d;case Et:var j=d._init;return p(f,j(d._payload),h)}if(tr(d)||Vn(d))return d=rn(d,f.mode,h,null),d.return=f,d;Jr(f,d)}return null}function g(f,d,h,j){var k=d!==null?d.key:null;if(typeof h=="string"&&h!==""||typeof h=="number")return k!==null?null:a(f,d,""+h,j);if(typeof h=="object"&&h!==null){switch(h.$$typeof){case zr:return h.key===k?u(f,d,h,j):null;case mn:return h.key===k?c(f,d,h,j):null;case Et:return k=h._init,g(f,d,k(h._payload),j)}if(tr(h)||Vn(h))return k!==null?null:m(f,d,h,j,null);Jr(f,h)}return null}function v(f,d,h,j,k){if(typeof j=="string"&&j!==""||typeof j=="number")return f=f.get(h)||null,a(d,f,""+j,k);if(typeof j=="object"&&j!==null){switch(j.$$typeof){case zr:return f=f.get(j.key===null?h:j.key)||null,u(d,f,j,k);case mn:return f=f.get(j.key===null?h:j.key)||null,c(d,f,j,k);case Et:var E=j._init;return v(f,d,h,E(j._payload),k)}if(tr(j)||Vn(j))return f=f.get(h)||null,m(d,f,j,k,null);Jr(d,j)}return null}function y(f,d,h,j){for(var k=null,E=null,I=d,L=d=0,b=null;I!==null&&L<h.length;L++){I.index>L?(b=I,I=null):b=I.sibling;var _=g(f,I,h[L],j);if(_===null){I===null&&(I=b);break}e&&I&&_.alternate===null&&t(f,I),d=s(_,d,L),E===null?k=_:E.sibling=_,E=_,I=b}if(L===h.length)return n(f,I),ee&&Jt(f,L),k;if(I===null){for(;L<h.length;L++)I=p(f,h[L],j),I!==null&&(d=s(I,d,L),E===null?k=I:E.sibling=I,E=I);return ee&&Jt(f,L),k}for(I=r(f,I);L<h.length;L++)b=v(I,f,L,h[L],j),b!==null&&(e&&b.alternate!==null&&I.delete(b.key===null?L:b.key),d=s(b,d,L),E===null?k=b:E.sibling=b,E=b);return e&&I.forEach(function(z){return t(f,z)}),ee&&Jt(f,L),k}function w(f,d,h,j){var k=Vn(h);if(typeof k!="function")throw Error(C(150));if(h=k.call(h),h==null)throw Error(C(151));for(var E=k=null,I=d,L=d=0,b=null,_=h.next();I!==null&&!_.done;L++,_=h.next()){I.index>L?(b=I,I=null):b=I.sibling;var z=g(f,I,_.value,j);if(z===null){I===null&&(I=b);break}e&&I&&z.alternate===null&&t(f,I),d=s(z,d,L),E===null?k=z:E.sibling=z,E=z,I=b}if(_.done)return n(f,I),ee&&Jt(f,L),k;if(I===null){for(;!_.done;L++,_=h.next())_=p(f,_.value,j),_!==null&&(d=s(_,d,L),E===null?k=_:E.sibling=_,E=_);return ee&&Jt(f,L),k}for(I=r(f,I);!_.done;L++,_=h.next())_=v(I,f,L,_.value,j),_!==null&&(e&&_.alternate!==null&&I.delete(_.key===null?L:_.key),d=s(_,d,L),E===null?k=_:E.sibling=_,E=_);return e&&I.forEach(function(X){return t(f,X)}),ee&&Jt(f,L),k}function N(f,d,h,j){if(typeof h=="object"&&h!==null&&h.type===hn&&h.key===null&&(h=h.props.children),typeof h=="object"&&h!==null){switch(h.$$typeof){case zr:e:{for(var k=h.key,E=d;E!==null;){if(E.key===k){if(k=h.type,k===hn){if(E.tag===7){n(f,E.sibling),d=l(E,h.props.children),d.return=f,f=d;break e}}else if(E.elementType===k||typeof k=="object"&&k!==null&&k.$$typeof===Et&&Ea(k)===E.type){n(f,E.sibling),d=l(E,h.props),d.ref=Xn(f,E,h),d.return=f,f=d;break e}n(f,E);break}else t(f,E);E=E.sibling}h.type===hn?(d=rn(h.props.children,f.mode,j,h.key),d.return=f,f=d):(j=wl(h.type,h.key,h.props,null,f.mode,j),j.ref=Xn(f,d,h),j.return=f,f=j)}return o(f);case mn:e:{for(E=h.key;d!==null;){if(d.key===E)if(d.tag===4&&d.stateNode.containerInfo===h.containerInfo&&d.stateNode.implementation===h.implementation){n(f,d.sibling),d=l(d,h.children||[]),d.return=f,f=d;break e}else{n(f,d);break}else t(f,d);d=d.sibling}d=Us(h,f.mode,j),d.return=f,f=d}return o(f);case Et:return E=h._init,N(f,d,E(h._payload),j)}if(tr(h))return y(f,d,h,j);if(Vn(h))return w(f,d,h,j);Jr(f,h)}return typeof h=="string"&&h!==""||typeof h=="number"?(h=""+h,d!==null&&d.tag===6?(n(f,d.sibling),d=l(d,h),d.return=f,f=d):(n(f,d),d=zs(h,f.mode,j),d.return=f,f=d),o(f)):n(f,d)}return N}var On=Wc(!0),Vc=Wc(!1),Ml=Kt(null),Ol=null,kn=null,ho=null;function xo(){ho=kn=Ol=null}function go(e){var t=Ml.current;q(Ml),e._currentValue=t}function ki(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function _n(e,t){Ol=e,ho=kn=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Ie=!0),e.firstContext=null)}function Ye(e){var t=e._currentValue;if(ho!==e)if(e={context:e,memoizedValue:t,next:null},kn===null){if(Ol===null)throw Error(C(308));kn=e,Ol.dependencies={lanes:0,firstContext:e}}else kn=kn.next=e;return t}var en=null;function vo(e){en===null?en=[e]:en.push(e)}function Hc(e,t,n,r){var l=t.interleaved;return l===null?(n.next=n,vo(t)):(n.next=l.next,l.next=n),t.interleaved=n,Nt(e,r)}function Nt(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var Pt=!1;function yo(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Kc(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function yt(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Dt(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,H&2){var l=r.pending;return l===null?t.next=t:(t.next=l.next,l.next=t),r.pending=t,Nt(e,n)}return l=r.interleaved,l===null?(t.next=t,vo(r)):(t.next=l.next,l.next=t),r.interleaved=t,Nt(e,n)}function ml(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,ro(e,n)}}function Pa(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var l=null,s=null;if(n=n.firstBaseUpdate,n!==null){do{var o={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};s===null?l=s=o:s=s.next=o,n=n.next}while(n!==null);s===null?l=s=t:s=s.next=t}else l=s=t;n={baseState:r.baseState,firstBaseUpdate:l,lastBaseUpdate:s,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function $l(e,t,n,r){var l=e.updateQueue;Pt=!1;var s=l.firstBaseUpdate,o=l.lastBaseUpdate,a=l.shared.pending;if(a!==null){l.shared.pending=null;var u=a,c=u.next;u.next=null,o===null?s=c:o.next=c,o=u;var m=e.alternate;m!==null&&(m=m.updateQueue,a=m.lastBaseUpdate,a!==o&&(a===null?m.firstBaseUpdate=c:a.next=c,m.lastBaseUpdate=u))}if(s!==null){var p=l.baseState;o=0,m=c=u=null,a=s;do{var g=a.lane,v=a.eventTime;if((r&g)===g){m!==null&&(m=m.next={eventTime:v,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var y=e,w=a;switch(g=t,v=n,w.tag){case 1:if(y=w.payload,typeof y=="function"){p=y.call(v,p,g);break e}p=y;break e;case 3:y.flags=y.flags&-65537|128;case 0:if(y=w.payload,g=typeof y=="function"?y.call(v,p,g):y,g==null)break e;p=re({},p,g);break e;case 2:Pt=!0}}a.callback!==null&&a.lane!==0&&(e.flags|=64,g=l.effects,g===null?l.effects=[a]:g.push(a))}else v={eventTime:v,lane:g,tag:a.tag,payload:a.payload,callback:a.callback,next:null},m===null?(c=m=v,u=p):m=m.next=v,o|=g;if(a=a.next,a===null){if(a=l.shared.pending,a===null)break;g=a,a=g.next,g.next=null,l.lastBaseUpdate=g,l.shared.pending=null}}while(!0);if(m===null&&(u=p),l.baseState=u,l.firstBaseUpdate=c,l.lastBaseUpdate=m,t=l.shared.interleaved,t!==null){l=t;do o|=l.lane,l=l.next;while(l!==t)}else s===null&&(l.shared.lanes=0);an|=o,e.lanes=o,e.memoizedState=p}}function Ia(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],l=r.callback;if(l!==null){if(r.callback=null,r=n,typeof l!="function")throw Error(C(191,l));l.call(r)}}}var $r={},pt=Kt($r),Sr=Kt($r),Cr=Kt($r);function tn(e){if(e===$r)throw Error(C(174));return e}function wo(e,t){switch(G(Cr,t),G(Sr,e),G(pt,$r),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:ri(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=ri(t,e)}q(pt),G(pt,t)}function $n(){q(pt),q(Sr),q(Cr)}function Qc(e){tn(Cr.current);var t=tn(pt.current),n=ri(t,e.type);t!==n&&(G(Sr,e),G(pt,n))}function jo(e){Sr.current===e&&(q(pt),q(Sr))}var te=Kt(0);function Fl(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Ms=[];function No(){for(var e=0;e<Ms.length;e++)Ms[e]._workInProgressVersionPrimary=null;Ms.length=0}var hl=Ct.ReactCurrentDispatcher,Os=Ct.ReactCurrentBatchConfig,on=0,ne=null,de=null,pe=null,Dl=!1,ur=!1,br=0,fm=0;function ve(){throw Error(C(321))}function ko(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!st(e[n],t[n]))return!1;return!0}function So(e,t,n,r,l,s){if(on=s,ne=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,hl.current=e===null||e.memoizedState===null?xm:gm,e=n(r,l),ur){s=0;do{if(ur=!1,br=0,25<=s)throw Error(C(301));s+=1,pe=de=null,t.updateQueue=null,hl.current=vm,e=n(r,l)}while(ur)}if(hl.current=Al,t=de!==null&&de.next!==null,on=0,pe=de=ne=null,Dl=!1,t)throw Error(C(300));return e}function Co(){var e=br!==0;return br=0,e}function ct(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return pe===null?ne.memoizedState=pe=e:pe=pe.next=e,pe}function Xe(){if(de===null){var e=ne.alternate;e=e!==null?e.memoizedState:null}else e=de.next;var t=pe===null?ne.memoizedState:pe.next;if(t!==null)pe=t,de=e;else{if(e===null)throw Error(C(310));de=e,e={memoizedState:de.memoizedState,baseState:de.baseState,baseQueue:de.baseQueue,queue:de.queue,next:null},pe===null?ne.memoizedState=pe=e:pe=pe.next=e}return pe}function Er(e,t){return typeof t=="function"?t(e):t}function $s(e){var t=Xe(),n=t.queue;if(n===null)throw Error(C(311));n.lastRenderedReducer=e;var r=de,l=r.baseQueue,s=n.pending;if(s!==null){if(l!==null){var o=l.next;l.next=s.next,s.next=o}r.baseQueue=l=s,n.pending=null}if(l!==null){s=l.next,r=r.baseState;var a=o=null,u=null,c=s;do{var m=c.lane;if((on&m)===m)u!==null&&(u=u.next={lane:0,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null}),r=c.hasEagerState?c.eagerState:e(r,c.action);else{var p={lane:m,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null};u===null?(a=u=p,o=r):u=u.next=p,ne.lanes|=m,an|=m}c=c.next}while(c!==null&&c!==s);u===null?o=r:u.next=a,st(r,t.memoizedState)||(Ie=!0),t.memoizedState=r,t.baseState=o,t.baseQueue=u,n.lastRenderedState=r}if(e=n.interleaved,e!==null){l=e;do s=l.lane,ne.lanes|=s,an|=s,l=l.next;while(l!==e)}else l===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function Fs(e){var t=Xe(),n=t.queue;if(n===null)throw Error(C(311));n.lastRenderedReducer=e;var r=n.dispatch,l=n.pending,s=t.memoizedState;if(l!==null){n.pending=null;var o=l=l.next;do s=e(s,o.action),o=o.next;while(o!==l);st(s,t.memoizedState)||(Ie=!0),t.memoizedState=s,t.baseQueue===null&&(t.baseState=s),n.lastRenderedState=s}return[s,r]}function Yc(){}function Xc(e,t){var n=ne,r=Xe(),l=t(),s=!st(r.memoizedState,l);if(s&&(r.memoizedState=l,Ie=!0),r=r.queue,bo(Zc.bind(null,n,r,e),[e]),r.getSnapshot!==t||s||pe!==null&&pe.memoizedState.tag&1){if(n.flags|=2048,Pr(9,Jc.bind(null,n,r,l,t),void 0,null),me===null)throw Error(C(349));on&30||Gc(n,t,l)}return l}function Gc(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=ne.updateQueue,t===null?(t={lastEffect:null,stores:null},ne.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Jc(e,t,n,r){t.value=n,t.getSnapshot=r,qc(t)&&ed(e)}function Zc(e,t,n){return n(function(){qc(t)&&ed(e)})}function qc(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!st(e,n)}catch{return!0}}function ed(e){var t=Nt(e,1);t!==null&&lt(t,e,1,-1)}function _a(e){var t=ct();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Er,lastRenderedState:e},t.queue=e,e=e.dispatch=hm.bind(null,ne,e),[t.memoizedState,e]}function Pr(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=ne.updateQueue,t===null?(t={lastEffect:null,stores:null},ne.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e)),e}function td(){return Xe().memoizedState}function xl(e,t,n,r){var l=ct();ne.flags|=e,l.memoizedState=Pr(1|t,n,void 0,r===void 0?null:r)}function ns(e,t,n,r){var l=Xe();r=r===void 0?null:r;var s=void 0;if(de!==null){var o=de.memoizedState;if(s=o.destroy,r!==null&&ko(r,o.deps)){l.memoizedState=Pr(t,n,s,r);return}}ne.flags|=e,l.memoizedState=Pr(1|t,n,s,r)}function La(e,t){return xl(8390656,8,e,t)}function bo(e,t){return ns(2048,8,e,t)}function nd(e,t){return ns(4,2,e,t)}function rd(e,t){return ns(4,4,e,t)}function ld(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function sd(e,t,n){return n=n!=null?n.concat([e]):null,ns(4,4,ld.bind(null,t,e),n)}function Eo(){}function id(e,t){var n=Xe();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&ko(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function od(e,t){var n=Xe();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&ko(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function ad(e,t,n){return on&21?(st(n,t)||(n=pc(),ne.lanes|=n,an|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,Ie=!0),e.memoizedState=n)}function pm(e,t){var n=Q;Q=n!==0&&4>n?n:4,e(!0);var r=Os.transition;Os.transition={};try{e(!1),t()}finally{Q=n,Os.transition=r}}function ud(){return Xe().memoizedState}function mm(e,t,n){var r=zt(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},cd(e))dd(t,n);else if(n=Hc(e,t,n,r),n!==null){var l=Se();lt(n,e,r,l),fd(n,t,r)}}function hm(e,t,n){var r=zt(e),l={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(cd(e))dd(t,l);else{var s=e.alternate;if(e.lanes===0&&(s===null||s.lanes===0)&&(s=t.lastRenderedReducer,s!==null))try{var o=t.lastRenderedState,a=s(o,n);if(l.hasEagerState=!0,l.eagerState=a,st(a,o)){var u=t.interleaved;u===null?(l.next=l,vo(t)):(l.next=u.next,u.next=l),t.interleaved=l;return}}catch{}finally{}n=Hc(e,t,l,r),n!==null&&(l=Se(),lt(n,e,r,l),fd(n,t,r))}}function cd(e){var t=e.alternate;return e===ne||t!==null&&t===ne}function dd(e,t){ur=Dl=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function fd(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,ro(e,n)}}var Al={readContext:Ye,useCallback:ve,useContext:ve,useEffect:ve,useImperativeHandle:ve,useInsertionEffect:ve,useLayoutEffect:ve,useMemo:ve,useReducer:ve,useRef:ve,useState:ve,useDebugValue:ve,useDeferredValue:ve,useTransition:ve,useMutableSource:ve,useSyncExternalStore:ve,useId:ve,unstable_isNewReconciler:!1},xm={readContext:Ye,useCallback:function(e,t){return ct().memoizedState=[e,t===void 0?null:t],e},useContext:Ye,useEffect:La,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,xl(4194308,4,ld.bind(null,t,e),n)},useLayoutEffect:function(e,t){return xl(4194308,4,e,t)},useInsertionEffect:function(e,t){return xl(4,2,e,t)},useMemo:function(e,t){var n=ct();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=ct();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=mm.bind(null,ne,e),[r.memoizedState,e]},useRef:function(e){var t=ct();return e={current:e},t.memoizedState=e},useState:_a,useDebugValue:Eo,useDeferredValue:function(e){return ct().memoizedState=e},useTransition:function(){var e=_a(!1),t=e[0];return e=pm.bind(null,e[1]),ct().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=ne,l=ct();if(ee){if(n===void 0)throw Error(C(407));n=n()}else{if(n=t(),me===null)throw Error(C(349));on&30||Gc(r,t,n)}l.memoizedState=n;var s={value:n,getSnapshot:t};return l.queue=s,La(Zc.bind(null,r,s,e),[e]),r.flags|=2048,Pr(9,Jc.bind(null,r,s,n,t),void 0,null),n},useId:function(){var e=ct(),t=me.identifierPrefix;if(ee){var n=gt,r=xt;n=(r&~(1<<32-rt(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=br++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=fm++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},gm={readContext:Ye,useCallback:id,useContext:Ye,useEffect:bo,useImperativeHandle:sd,useInsertionEffect:nd,useLayoutEffect:rd,useMemo:od,useReducer:$s,useRef:td,useState:function(){return $s(Er)},useDebugValue:Eo,useDeferredValue:function(e){var t=Xe();return ad(t,de.memoizedState,e)},useTransition:function(){var e=$s(Er)[0],t=Xe().memoizedState;return[e,t]},useMutableSource:Yc,useSyncExternalStore:Xc,useId:ud,unstable_isNewReconciler:!1},vm={readContext:Ye,useCallback:id,useContext:Ye,useEffect:bo,useImperativeHandle:sd,useInsertionEffect:nd,useLayoutEffect:rd,useMemo:od,useReducer:Fs,useRef:td,useState:function(){return Fs(Er)},useDebugValue:Eo,useDeferredValue:function(e){var t=Xe();return de===null?t.memoizedState=e:ad(t,de.memoizedState,e)},useTransition:function(){var e=Fs(Er)[0],t=Xe().memoizedState;return[e,t]},useMutableSource:Yc,useSyncExternalStore:Xc,useId:ud,unstable_isNewReconciler:!1};function et(e,t){if(e&&e.defaultProps){t=re({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function Si(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:re({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var rs={isMounted:function(e){return(e=e._reactInternals)?dn(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Se(),l=zt(e),s=yt(r,l);s.payload=t,n!=null&&(s.callback=n),t=Dt(e,s,l),t!==null&&(lt(t,e,l,r),ml(t,e,l))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Se(),l=zt(e),s=yt(r,l);s.tag=1,s.payload=t,n!=null&&(s.callback=n),t=Dt(e,s,l),t!==null&&(lt(t,e,l,r),ml(t,e,l))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Se(),r=zt(e),l=yt(n,r);l.tag=2,t!=null&&(l.callback=t),t=Dt(e,l,r),t!==null&&(lt(t,e,r,n),ml(t,e,r))}};function Ra(e,t,n,r,l,s,o){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,s,o):t.prototype&&t.prototype.isPureReactComponent?!wr(n,r)||!wr(l,s):!0}function pd(e,t,n){var r=!1,l=Vt,s=t.contextType;return typeof s=="object"&&s!==null?s=Ye(s):(l=Re(t)?ln:je.current,r=t.contextTypes,s=(r=r!=null)?Tn(e,l):Vt),t=new t(n,s),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=rs,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=l,e.__reactInternalMemoizedMaskedChildContext=s),t}function Ta(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&rs.enqueueReplaceState(t,t.state,null)}function Ci(e,t,n,r){var l=e.stateNode;l.props=n,l.state=e.memoizedState,l.refs={},yo(e);var s=t.contextType;typeof s=="object"&&s!==null?l.context=Ye(s):(s=Re(t)?ln:je.current,l.context=Tn(e,s)),l.state=e.memoizedState,s=t.getDerivedStateFromProps,typeof s=="function"&&(Si(e,t,s,n),l.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof l.getSnapshotBeforeUpdate=="function"||typeof l.UNSAFE_componentWillMount!="function"&&typeof l.componentWillMount!="function"||(t=l.state,typeof l.componentWillMount=="function"&&l.componentWillMount(),typeof l.UNSAFE_componentWillMount=="function"&&l.UNSAFE_componentWillMount(),t!==l.state&&rs.enqueueReplaceState(l,l.state,null),$l(e,n,l,r),l.state=e.memoizedState),typeof l.componentDidMount=="function"&&(e.flags|=4194308)}function Fn(e,t){try{var n="",r=t;do n+=Kf(r),r=r.return;while(r);var l=n}catch(s){l=`
39
+ Error generating stack: `+s.message+`
40
+ `+s.stack}return{value:e,source:t,stack:l,digest:null}}function Ds(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function bi(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var ym=typeof WeakMap=="function"?WeakMap:Map;function md(e,t,n){n=yt(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){Ul||(Ul=!0,$i=r),bi(e,t)},n}function hd(e,t,n){n=yt(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var l=t.value;n.payload=function(){return r(l)},n.callback=function(){bi(e,t)}}var s=e.stateNode;return s!==null&&typeof s.componentDidCatch=="function"&&(n.callback=function(){bi(e,t),typeof r!="function"&&(At===null?At=new Set([this]):At.add(this));var o=t.stack;this.componentDidCatch(t.value,{componentStack:o!==null?o:""})}),n}function Ma(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new ym;var l=new Set;r.set(t,l)}else l=r.get(t),l===void 0&&(l=new Set,r.set(t,l));l.has(n)||(l.add(n),e=Tm.bind(null,e,t,n),t.then(e,e))}function Oa(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function $a(e,t,n,r,l){return e.mode&1?(e.flags|=65536,e.lanes=l,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=yt(-1,1),t.tag=2,Dt(n,t,1))),n.lanes|=1),e)}var wm=Ct.ReactCurrentOwner,Ie=!1;function ke(e,t,n,r){t.child=e===null?Vc(t,null,n,r):On(t,e.child,n,r)}function Fa(e,t,n,r,l){n=n.render;var s=t.ref;return _n(t,l),r=So(e,t,n,r,s,l),n=Co(),e!==null&&!Ie?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~l,kt(e,t,l)):(ee&&n&&fo(t),t.flags|=1,ke(e,t,r,l),t.child)}function Da(e,t,n,r,l){if(e===null){var s=n.type;return typeof s=="function"&&!Oo(s)&&s.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=s,xd(e,t,s,r,l)):(e=wl(n.type,null,r,t,t.mode,l),e.ref=t.ref,e.return=t,t.child=e)}if(s=e.child,!(e.lanes&l)){var o=s.memoizedProps;if(n=n.compare,n=n!==null?n:wr,n(o,r)&&e.ref===t.ref)return kt(e,t,l)}return t.flags|=1,e=Ut(s,r),e.ref=t.ref,e.return=t,t.child=e}function xd(e,t,n,r,l){if(e!==null){var s=e.memoizedProps;if(wr(s,r)&&e.ref===t.ref)if(Ie=!1,t.pendingProps=r=s,(e.lanes&l)!==0)e.flags&131072&&(Ie=!0);else return t.lanes=e.lanes,kt(e,t,l)}return Ei(e,t,n,r,l)}function gd(e,t,n){var r=t.pendingProps,l=r.children,s=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},G(Cn,$e),$e|=n;else{if(!(n&1073741824))return e=s!==null?s.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,G(Cn,$e),$e|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=s!==null?s.baseLanes:n,G(Cn,$e),$e|=r}else s!==null?(r=s.baseLanes|n,t.memoizedState=null):r=n,G(Cn,$e),$e|=r;return ke(e,t,l,n),t.child}function vd(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Ei(e,t,n,r,l){var s=Re(n)?ln:je.current;return s=Tn(t,s),_n(t,l),n=So(e,t,n,r,s,l),r=Co(),e!==null&&!Ie?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~l,kt(e,t,l)):(ee&&r&&fo(t),t.flags|=1,ke(e,t,n,l),t.child)}function Aa(e,t,n,r,l){if(Re(n)){var s=!0;Ll(t)}else s=!1;if(_n(t,l),t.stateNode===null)gl(e,t),pd(t,n,r),Ci(t,n,r,l),r=!0;else if(e===null){var o=t.stateNode,a=t.memoizedProps;o.props=a;var u=o.context,c=n.contextType;typeof c=="object"&&c!==null?c=Ye(c):(c=Re(n)?ln:je.current,c=Tn(t,c));var m=n.getDerivedStateFromProps,p=typeof m=="function"||typeof o.getSnapshotBeforeUpdate=="function";p||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==r||u!==c)&&Ta(t,o,r,c),Pt=!1;var g=t.memoizedState;o.state=g,$l(t,r,o,l),u=t.memoizedState,a!==r||g!==u||Le.current||Pt?(typeof m=="function"&&(Si(t,n,m,r),u=t.memoizedState),(a=Pt||Ra(t,n,a,r,g,u,c))?(p||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount=="function"&&(t.flags|=4194308)):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=u),o.props=r,o.state=u,o.context=c,r=a):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{o=t.stateNode,Kc(e,t),a=t.memoizedProps,c=t.type===t.elementType?a:et(t.type,a),o.props=c,p=t.pendingProps,g=o.context,u=n.contextType,typeof u=="object"&&u!==null?u=Ye(u):(u=Re(n)?ln:je.current,u=Tn(t,u));var v=n.getDerivedStateFromProps;(m=typeof v=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==p||g!==u)&&Ta(t,o,r,u),Pt=!1,g=t.memoizedState,o.state=g,$l(t,r,o,l);var y=t.memoizedState;a!==p||g!==y||Le.current||Pt?(typeof v=="function"&&(Si(t,n,v,r),y=t.memoizedState),(c=Pt||Ra(t,n,c,r,g,y,u)||!1)?(m||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(r,y,u),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(r,y,u)),typeof o.componentDidUpdate=="function"&&(t.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof o.componentDidUpdate!="function"||a===e.memoizedProps&&g===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&g===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=y),o.props=r,o.state=y,o.context=u,r=c):(typeof o.componentDidUpdate!="function"||a===e.memoizedProps&&g===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&g===e.memoizedState||(t.flags|=1024),r=!1)}return Pi(e,t,n,r,s,l)}function Pi(e,t,n,r,l,s){vd(e,t);var o=(t.flags&128)!==0;if(!r&&!o)return l&&Sa(t,n,!1),kt(e,t,s);r=t.stateNode,wm.current=t;var a=o&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&o?(t.child=On(t,e.child,null,s),t.child=On(t,null,a,s)):ke(e,t,a,s),t.memoizedState=r.state,l&&Sa(t,n,!0),t.child}function yd(e){var t=e.stateNode;t.pendingContext?ka(e,t.pendingContext,t.pendingContext!==t.context):t.context&&ka(e,t.context,!1),wo(e,t.containerInfo)}function za(e,t,n,r,l){return Mn(),mo(l),t.flags|=256,ke(e,t,n,r),t.child}var Ii={dehydrated:null,treeContext:null,retryLane:0};function _i(e){return{baseLanes:e,cachePool:null,transitions:null}}function wd(e,t,n){var r=t.pendingProps,l=te.current,s=!1,o=(t.flags&128)!==0,a;if((a=o)||(a=e!==null&&e.memoizedState===null?!1:(l&2)!==0),a?(s=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(l|=1),G(te,l&1),e===null)return Ni(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(o=r.children,e=r.fallback,s?(r=t.mode,s=t.child,o={mode:"hidden",children:o},!(r&1)&&s!==null?(s.childLanes=0,s.pendingProps=o):s=is(o,r,0,null),e=rn(e,r,n,null),s.return=t,e.return=t,s.sibling=e,t.child=s,t.child.memoizedState=_i(n),t.memoizedState=Ii,e):Po(t,o));if(l=e.memoizedState,l!==null&&(a=l.dehydrated,a!==null))return jm(e,t,o,r,a,l,n);if(s){s=r.fallback,o=t.mode,l=e.child,a=l.sibling;var u={mode:"hidden",children:r.children};return!(o&1)&&t.child!==l?(r=t.child,r.childLanes=0,r.pendingProps=u,t.deletions=null):(r=Ut(l,u),r.subtreeFlags=l.subtreeFlags&14680064),a!==null?s=Ut(a,s):(s=rn(s,o,n,null),s.flags|=2),s.return=t,r.return=t,r.sibling=s,t.child=r,r=s,s=t.child,o=e.child.memoizedState,o=o===null?_i(n):{baseLanes:o.baseLanes|n,cachePool:null,transitions:o.transitions},s.memoizedState=o,s.childLanes=e.childLanes&~n,t.memoizedState=Ii,r}return s=e.child,e=s.sibling,r=Ut(s,{mode:"visible",children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function Po(e,t){return t=is({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Zr(e,t,n,r){return r!==null&&mo(r),On(t,e.child,null,n),e=Po(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function jm(e,t,n,r,l,s,o){if(n)return t.flags&256?(t.flags&=-257,r=Ds(Error(C(422))),Zr(e,t,o,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(s=r.fallback,l=t.mode,r=is({mode:"visible",children:r.children},l,0,null),s=rn(s,l,o,null),s.flags|=2,r.return=t,s.return=t,r.sibling=s,t.child=r,t.mode&1&&On(t,e.child,null,o),t.child.memoizedState=_i(o),t.memoizedState=Ii,s);if(!(t.mode&1))return Zr(e,t,o,null);if(l.data==="$!"){if(r=l.nextSibling&&l.nextSibling.dataset,r)var a=r.dgst;return r=a,s=Error(C(419)),r=Ds(s,r,void 0),Zr(e,t,o,r)}if(a=(o&e.childLanes)!==0,Ie||a){if(r=me,r!==null){switch(o&-o){case 4:l=2;break;case 16:l=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:l=32;break;case 536870912:l=268435456;break;default:l=0}l=l&(r.suspendedLanes|o)?0:l,l!==0&&l!==s.retryLane&&(s.retryLane=l,Nt(e,l),lt(r,e,l,-1))}return Mo(),r=Ds(Error(C(421))),Zr(e,t,o,r)}return l.data==="$?"?(t.flags|=128,t.child=e.child,t=Mm.bind(null,e),l._reactRetry=t,null):(e=s.treeContext,Fe=Ft(l.nextSibling),De=t,ee=!0,nt=null,e!==null&&(Ve[He++]=xt,Ve[He++]=gt,Ve[He++]=sn,xt=e.id,gt=e.overflow,sn=t),t=Po(t,r.children),t.flags|=4096,t)}function Ua(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),ki(e.return,t,n)}function As(e,t,n,r,l){var s=e.memoizedState;s===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:l}:(s.isBackwards=t,s.rendering=null,s.renderingStartTime=0,s.last=r,s.tail=n,s.tailMode=l)}function jd(e,t,n){var r=t.pendingProps,l=r.revealOrder,s=r.tail;if(ke(e,t,r.children,n),r=te.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Ua(e,n,t);else if(e.tag===19)Ua(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(G(te,r),!(t.mode&1))t.memoizedState=null;else switch(l){case"forwards":for(n=t.child,l=null;n!==null;)e=n.alternate,e!==null&&Fl(e)===null&&(l=n),n=n.sibling;n=l,n===null?(l=t.child,t.child=null):(l=n.sibling,n.sibling=null),As(t,!1,l,n,s);break;case"backwards":for(n=null,l=t.child,t.child=null;l!==null;){if(e=l.alternate,e!==null&&Fl(e)===null){t.child=l;break}e=l.sibling,l.sibling=n,n=l,l=e}As(t,!0,n,null,s);break;case"together":As(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function gl(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function kt(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),an|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(C(153));if(t.child!==null){for(e=t.child,n=Ut(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Ut(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Nm(e,t,n){switch(t.tag){case 3:yd(t),Mn();break;case 5:Qc(t);break;case 1:Re(t.type)&&Ll(t);break;case 4:wo(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,l=t.memoizedProps.value;G(Ml,r._currentValue),r._currentValue=l;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(G(te,te.current&1),t.flags|=128,null):n&t.child.childLanes?wd(e,t,n):(G(te,te.current&1),e=kt(e,t,n),e!==null?e.sibling:null);G(te,te.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return jd(e,t,n);t.flags|=128}if(l=t.memoizedState,l!==null&&(l.rendering=null,l.tail=null,l.lastEffect=null),G(te,te.current),r)break;return null;case 22:case 23:return t.lanes=0,gd(e,t,n)}return kt(e,t,n)}var Nd,Li,kd,Sd;Nd=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};Li=function(){};kd=function(e,t,n,r){var l=e.memoizedProps;if(l!==r){e=t.stateNode,tn(pt.current);var s=null;switch(n){case"input":l=qs(e,l),r=qs(e,r),s=[];break;case"select":l=re({},l,{value:void 0}),r=re({},r,{value:void 0}),s=[];break;case"textarea":l=ni(e,l),r=ni(e,r),s=[];break;default:typeof l.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=Il)}li(n,r);var o;n=null;for(c in l)if(!r.hasOwnProperty(c)&&l.hasOwnProperty(c)&&l[c]!=null)if(c==="style"){var a=l[c];for(o in a)a.hasOwnProperty(o)&&(n||(n={}),n[o]="")}else c!=="dangerouslySetInnerHTML"&&c!=="children"&&c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&c!=="autoFocus"&&(pr.hasOwnProperty(c)?s||(s=[]):(s=s||[]).push(c,null));for(c in r){var u=r[c];if(a=l!=null?l[c]:void 0,r.hasOwnProperty(c)&&u!==a&&(u!=null||a!=null))if(c==="style")if(a){for(o in a)!a.hasOwnProperty(o)||u&&u.hasOwnProperty(o)||(n||(n={}),n[o]="");for(o in u)u.hasOwnProperty(o)&&a[o]!==u[o]&&(n||(n={}),n[o]=u[o])}else n||(s||(s=[]),s.push(c,n)),n=u;else c==="dangerouslySetInnerHTML"?(u=u?u.__html:void 0,a=a?a.__html:void 0,u!=null&&a!==u&&(s=s||[]).push(c,u)):c==="children"?typeof u!="string"&&typeof u!="number"||(s=s||[]).push(c,""+u):c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&(pr.hasOwnProperty(c)?(u!=null&&c==="onScroll"&&Z("scroll",e),s||a===u||(s=[])):(s=s||[]).push(c,u))}n&&(s=s||[]).push("style",n);var c=s;(t.updateQueue=c)&&(t.flags|=4)}};Sd=function(e,t,n,r){n!==r&&(t.flags|=4)};function Gn(e,t){if(!ee)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function ye(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var l=e.child;l!==null;)n|=l.lanes|l.childLanes,r|=l.subtreeFlags&14680064,r|=l.flags&14680064,l.return=e,l=l.sibling;else for(l=e.child;l!==null;)n|=l.lanes|l.childLanes,r|=l.subtreeFlags,r|=l.flags,l.return=e,l=l.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function km(e,t,n){var r=t.pendingProps;switch(po(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ye(t),null;case 1:return Re(t.type)&&_l(),ye(t),null;case 3:return r=t.stateNode,$n(),q(Le),q(je),No(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(Gr(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,nt!==null&&(Ai(nt),nt=null))),Li(e,t),ye(t),null;case 5:jo(t);var l=tn(Cr.current);if(n=t.type,e!==null&&t.stateNode!=null)kd(e,t,n,r,l),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(C(166));return ye(t),null}if(e=tn(pt.current),Gr(t)){r=t.stateNode,n=t.type;var s=t.memoizedProps;switch(r[dt]=t,r[kr]=s,e=(t.mode&1)!==0,n){case"dialog":Z("cancel",r),Z("close",r);break;case"iframe":case"object":case"embed":Z("load",r);break;case"video":case"audio":for(l=0;l<rr.length;l++)Z(rr[l],r);break;case"source":Z("error",r);break;case"img":case"image":case"link":Z("error",r),Z("load",r);break;case"details":Z("toggle",r);break;case"input":Go(r,s),Z("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!s.multiple},Z("invalid",r);break;case"textarea":Zo(r,s),Z("invalid",r)}li(n,s),l=null;for(var o in s)if(s.hasOwnProperty(o)){var a=s[o];o==="children"?typeof a=="string"?r.textContent!==a&&(s.suppressHydrationWarning!==!0&&Xr(r.textContent,a,e),l=["children",a]):typeof a=="number"&&r.textContent!==""+a&&(s.suppressHydrationWarning!==!0&&Xr(r.textContent,a,e),l=["children",""+a]):pr.hasOwnProperty(o)&&a!=null&&o==="onScroll"&&Z("scroll",r)}switch(n){case"input":Ur(r),Jo(r,s,!0);break;case"textarea":Ur(r),qo(r);break;case"select":case"option":break;default:typeof s.onClick=="function"&&(r.onclick=Il)}r=l,t.updateQueue=r,r!==null&&(t.flags|=4)}else{o=l.nodeType===9?l:l.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=Zu(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=o.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=o.createElement(n,{is:r.is}):(e=o.createElement(n),n==="select"&&(o=e,r.multiple?o.multiple=!0:r.size&&(o.size=r.size))):e=o.createElementNS(e,n),e[dt]=t,e[kr]=r,Nd(e,t,!1,!1),t.stateNode=e;e:{switch(o=si(n,r),n){case"dialog":Z("cancel",e),Z("close",e),l=r;break;case"iframe":case"object":case"embed":Z("load",e),l=r;break;case"video":case"audio":for(l=0;l<rr.length;l++)Z(rr[l],e);l=r;break;case"source":Z("error",e),l=r;break;case"img":case"image":case"link":Z("error",e),Z("load",e),l=r;break;case"details":Z("toggle",e),l=r;break;case"input":Go(e,r),l=qs(e,r),Z("invalid",e);break;case"option":l=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},l=re({},r,{value:void 0}),Z("invalid",e);break;case"textarea":Zo(e,r),l=ni(e,r),Z("invalid",e);break;default:l=r}li(n,l),a=l;for(s in a)if(a.hasOwnProperty(s)){var u=a[s];s==="style"?tc(e,u):s==="dangerouslySetInnerHTML"?(u=u?u.__html:void 0,u!=null&&qu(e,u)):s==="children"?typeof u=="string"?(n!=="textarea"||u!=="")&&mr(e,u):typeof u=="number"&&mr(e,""+u):s!=="suppressContentEditableWarning"&&s!=="suppressHydrationWarning"&&s!=="autoFocus"&&(pr.hasOwnProperty(s)?u!=null&&s==="onScroll"&&Z("scroll",e):u!=null&&Ji(e,s,u,o))}switch(n){case"input":Ur(e),Jo(e,r,!1);break;case"textarea":Ur(e),qo(e);break;case"option":r.value!=null&&e.setAttribute("value",""+Wt(r.value));break;case"select":e.multiple=!!r.multiple,s=r.value,s!=null?bn(e,!!r.multiple,s,!1):r.defaultValue!=null&&bn(e,!!r.multiple,r.defaultValue,!0);break;default:typeof l.onClick=="function"&&(e.onclick=Il)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return ye(t),null;case 6:if(e&&t.stateNode!=null)Sd(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(C(166));if(n=tn(Cr.current),tn(pt.current),Gr(t)){if(r=t.stateNode,n=t.memoizedProps,r[dt]=t,(s=r.nodeValue!==n)&&(e=De,e!==null))switch(e.tag){case 3:Xr(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Xr(r.nodeValue,n,(e.mode&1)!==0)}s&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[dt]=t,t.stateNode=r}return ye(t),null;case 13:if(q(te),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(ee&&Fe!==null&&t.mode&1&&!(t.flags&128))Bc(),Mn(),t.flags|=98560,s=!1;else if(s=Gr(t),r!==null&&r.dehydrated!==null){if(e===null){if(!s)throw Error(C(318));if(s=t.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(C(317));s[dt]=t}else Mn(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;ye(t),s=!1}else nt!==null&&(Ai(nt),nt=null),s=!0;if(!s)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(r=r!==null,r!==(e!==null&&e.memoizedState!==null)&&r&&(t.child.flags|=8192,t.mode&1&&(e===null||te.current&1?fe===0&&(fe=3):Mo())),t.updateQueue!==null&&(t.flags|=4),ye(t),null);case 4:return $n(),Li(e,t),e===null&&jr(t.stateNode.containerInfo),ye(t),null;case 10:return go(t.type._context),ye(t),null;case 17:return Re(t.type)&&_l(),ye(t),null;case 19:if(q(te),s=t.memoizedState,s===null)return ye(t),null;if(r=(t.flags&128)!==0,o=s.rendering,o===null)if(r)Gn(s,!1);else{if(fe!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=Fl(e),o!==null){for(t.flags|=128,Gn(s,!1),r=o.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)s=n,e=r,s.flags&=14680066,o=s.alternate,o===null?(s.childLanes=0,s.lanes=e,s.child=null,s.subtreeFlags=0,s.memoizedProps=null,s.memoizedState=null,s.updateQueue=null,s.dependencies=null,s.stateNode=null):(s.childLanes=o.childLanes,s.lanes=o.lanes,s.child=o.child,s.subtreeFlags=0,s.deletions=null,s.memoizedProps=o.memoizedProps,s.memoizedState=o.memoizedState,s.updateQueue=o.updateQueue,s.type=o.type,e=o.dependencies,s.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return G(te,te.current&1|2),t.child}e=e.sibling}s.tail!==null&&ae()>Dn&&(t.flags|=128,r=!0,Gn(s,!1),t.lanes=4194304)}else{if(!r)if(e=Fl(o),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Gn(s,!0),s.tail===null&&s.tailMode==="hidden"&&!o.alternate&&!ee)return ye(t),null}else 2*ae()-s.renderingStartTime>Dn&&n!==1073741824&&(t.flags|=128,r=!0,Gn(s,!1),t.lanes=4194304);s.isBackwards?(o.sibling=t.child,t.child=o):(n=s.last,n!==null?n.sibling=o:t.child=o,s.last=o)}return s.tail!==null?(t=s.tail,s.rendering=t,s.tail=t.sibling,s.renderingStartTime=ae(),t.sibling=null,n=te.current,G(te,r?n&1|2:n&1),t):(ye(t),null);case 22:case 23:return To(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?$e&1073741824&&(ye(t),t.subtreeFlags&6&&(t.flags|=8192)):ye(t),null;case 24:return null;case 25:return null}throw Error(C(156,t.tag))}function Sm(e,t){switch(po(t),t.tag){case 1:return Re(t.type)&&_l(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return $n(),q(Le),q(je),No(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return jo(t),null;case 13:if(q(te),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(C(340));Mn()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return q(te),null;case 4:return $n(),null;case 10:return go(t.type._context),null;case 22:case 23:return To(),null;case 24:return null;default:return null}}var qr=!1,we=!1,Cm=typeof WeakSet=="function"?WeakSet:Set,T=null;function Sn(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){le(e,t,r)}else n.current=null}function Ri(e,t,n){try{n()}catch(r){le(e,t,r)}}var Ba=!1;function bm(e,t){if(hi=bl,e=Ic(),co(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var l=r.anchorOffset,s=r.focusNode;r=r.focusOffset;try{n.nodeType,s.nodeType}catch{n=null;break e}var o=0,a=-1,u=-1,c=0,m=0,p=e,g=null;t:for(;;){for(var v;p!==n||l!==0&&p.nodeType!==3||(a=o+l),p!==s||r!==0&&p.nodeType!==3||(u=o+r),p.nodeType===3&&(o+=p.nodeValue.length),(v=p.firstChild)!==null;)g=p,p=v;for(;;){if(p===e)break t;if(g===n&&++c===l&&(a=o),g===s&&++m===r&&(u=o),(v=p.nextSibling)!==null)break;p=g,g=p.parentNode}p=v}n=a===-1||u===-1?null:{start:a,end:u}}else n=null}n=n||{start:0,end:0}}else n=null;for(xi={focusedElem:e,selectionRange:n},bl=!1,T=t;T!==null;)if(t=T,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,T=e;else for(;T!==null;){t=T;try{var y=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(y!==null){var w=y.memoizedProps,N=y.memoizedState,f=t.stateNode,d=f.getSnapshotBeforeUpdate(t.elementType===t.type?w:et(t.type,w),N);f.__reactInternalSnapshotBeforeUpdate=d}break;case 3:var h=t.stateNode.containerInfo;h.nodeType===1?h.textContent="":h.nodeType===9&&h.documentElement&&h.removeChild(h.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(C(163))}}catch(j){le(t,t.return,j)}if(e=t.sibling,e!==null){e.return=t.return,T=e;break}T=t.return}return y=Ba,Ba=!1,y}function cr(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var l=r=r.next;do{if((l.tag&e)===e){var s=l.destroy;l.destroy=void 0,s!==void 0&&Ri(t,n,s)}l=l.next}while(l!==r)}}function ls(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function Ti(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function Cd(e){var t=e.alternate;t!==null&&(e.alternate=null,Cd(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[dt],delete t[kr],delete t[yi],delete t[am],delete t[um])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function bd(e){return e.tag===5||e.tag===3||e.tag===4}function Wa(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||bd(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Mi(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Il));else if(r!==4&&(e=e.child,e!==null))for(Mi(e,t,n),e=e.sibling;e!==null;)Mi(e,t,n),e=e.sibling}function Oi(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(Oi(e,t,n),e=e.sibling;e!==null;)Oi(e,t,n),e=e.sibling}var he=null,tt=!1;function bt(e,t,n){for(n=n.child;n!==null;)Ed(e,t,n),n=n.sibling}function Ed(e,t,n){if(ft&&typeof ft.onCommitFiberUnmount=="function")try{ft.onCommitFiberUnmount(Gl,n)}catch{}switch(n.tag){case 5:we||Sn(n,t);case 6:var r=he,l=tt;he=null,bt(e,t,n),he=r,tt=l,he!==null&&(tt?(e=he,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):he.removeChild(n.stateNode));break;case 18:he!==null&&(tt?(e=he,n=n.stateNode,e.nodeType===8?Rs(e.parentNode,n):e.nodeType===1&&Rs(e,n),vr(e)):Rs(he,n.stateNode));break;case 4:r=he,l=tt,he=n.stateNode.containerInfo,tt=!0,bt(e,t,n),he=r,tt=l;break;case 0:case 11:case 14:case 15:if(!we&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){l=r=r.next;do{var s=l,o=s.destroy;s=s.tag,o!==void 0&&(s&2||s&4)&&Ri(n,t,o),l=l.next}while(l!==r)}bt(e,t,n);break;case 1:if(!we&&(Sn(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){le(n,t,a)}bt(e,t,n);break;case 21:bt(e,t,n);break;case 22:n.mode&1?(we=(r=we)||n.memoizedState!==null,bt(e,t,n),we=r):bt(e,t,n);break;default:bt(e,t,n)}}function Va(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new Cm),t.forEach(function(r){var l=Om.bind(null,e,r);n.has(r)||(n.add(r),r.then(l,l))})}}function qe(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var l=n[r];try{var s=e,o=t,a=o;e:for(;a!==null;){switch(a.tag){case 5:he=a.stateNode,tt=!1;break e;case 3:he=a.stateNode.containerInfo,tt=!0;break e;case 4:he=a.stateNode.containerInfo,tt=!0;break e}a=a.return}if(he===null)throw Error(C(160));Ed(s,o,l),he=null,tt=!1;var u=l.alternate;u!==null&&(u.return=null),l.return=null}catch(c){le(l,t,c)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)Pd(t,e),t=t.sibling}function Pd(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(qe(t,e),at(e),r&4){try{cr(3,e,e.return),ls(3,e)}catch(w){le(e,e.return,w)}try{cr(5,e,e.return)}catch(w){le(e,e.return,w)}}break;case 1:qe(t,e),at(e),r&512&&n!==null&&Sn(n,n.return);break;case 5:if(qe(t,e),at(e),r&512&&n!==null&&Sn(n,n.return),e.flags&32){var l=e.stateNode;try{mr(l,"")}catch(w){le(e,e.return,w)}}if(r&4&&(l=e.stateNode,l!=null)){var s=e.memoizedProps,o=n!==null?n.memoizedProps:s,a=e.type,u=e.updateQueue;if(e.updateQueue=null,u!==null)try{a==="input"&&s.type==="radio"&&s.name!=null&&Gu(l,s),si(a,o);var c=si(a,s);for(o=0;o<u.length;o+=2){var m=u[o],p=u[o+1];m==="style"?tc(l,p):m==="dangerouslySetInnerHTML"?qu(l,p):m==="children"?mr(l,p):Ji(l,m,p,c)}switch(a){case"input":ei(l,s);break;case"textarea":Ju(l,s);break;case"select":var g=l._wrapperState.wasMultiple;l._wrapperState.wasMultiple=!!s.multiple;var v=s.value;v!=null?bn(l,!!s.multiple,v,!1):g!==!!s.multiple&&(s.defaultValue!=null?bn(l,!!s.multiple,s.defaultValue,!0):bn(l,!!s.multiple,s.multiple?[]:"",!1))}l[kr]=s}catch(w){le(e,e.return,w)}}break;case 6:if(qe(t,e),at(e),r&4){if(e.stateNode===null)throw Error(C(162));l=e.stateNode,s=e.memoizedProps;try{l.nodeValue=s}catch(w){le(e,e.return,w)}}break;case 3:if(qe(t,e),at(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{vr(t.containerInfo)}catch(w){le(e,e.return,w)}break;case 4:qe(t,e),at(e);break;case 13:qe(t,e),at(e),l=e.child,l.flags&8192&&(s=l.memoizedState!==null,l.stateNode.isHidden=s,!s||l.alternate!==null&&l.alternate.memoizedState!==null||(Lo=ae())),r&4&&Va(e);break;case 22:if(m=n!==null&&n.memoizedState!==null,e.mode&1?(we=(c=we)||m,qe(t,e),we=c):qe(t,e),at(e),r&8192){if(c=e.memoizedState!==null,(e.stateNode.isHidden=c)&&!m&&e.mode&1)for(T=e,m=e.child;m!==null;){for(p=T=m;T!==null;){switch(g=T,v=g.child,g.tag){case 0:case 11:case 14:case 15:cr(4,g,g.return);break;case 1:Sn(g,g.return);var y=g.stateNode;if(typeof y.componentWillUnmount=="function"){r=g,n=g.return;try{t=r,y.props=t.memoizedProps,y.state=t.memoizedState,y.componentWillUnmount()}catch(w){le(r,n,w)}}break;case 5:Sn(g,g.return);break;case 22:if(g.memoizedState!==null){Ka(p);continue}}v!==null?(v.return=g,T=v):Ka(p)}m=m.sibling}e:for(m=null,p=e;;){if(p.tag===5){if(m===null){m=p;try{l=p.stateNode,c?(s=l.style,typeof s.setProperty=="function"?s.setProperty("display","none","important"):s.display="none"):(a=p.stateNode,u=p.memoizedProps.style,o=u!=null&&u.hasOwnProperty("display")?u.display:null,a.style.display=ec("display",o))}catch(w){le(e,e.return,w)}}}else if(p.tag===6){if(m===null)try{p.stateNode.nodeValue=c?"":p.memoizedProps}catch(w){le(e,e.return,w)}}else if((p.tag!==22&&p.tag!==23||p.memoizedState===null||p===e)&&p.child!==null){p.child.return=p,p=p.child;continue}if(p===e)break e;for(;p.sibling===null;){if(p.return===null||p.return===e)break e;m===p&&(m=null),p=p.return}m===p&&(m=null),p.sibling.return=p.return,p=p.sibling}}break;case 19:qe(t,e),at(e),r&4&&Va(e);break;case 21:break;default:qe(t,e),at(e)}}function at(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(bd(n)){var r=n;break e}n=n.return}throw Error(C(160))}switch(r.tag){case 5:var l=r.stateNode;r.flags&32&&(mr(l,""),r.flags&=-33);var s=Wa(e);Oi(e,s,l);break;case 3:case 4:var o=r.stateNode.containerInfo,a=Wa(e);Mi(e,a,o);break;default:throw Error(C(161))}}catch(u){le(e,e.return,u)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Em(e,t,n){T=e,Id(e)}function Id(e,t,n){for(var r=(e.mode&1)!==0;T!==null;){var l=T,s=l.child;if(l.tag===22&&r){var o=l.memoizedState!==null||qr;if(!o){var a=l.alternate,u=a!==null&&a.memoizedState!==null||we;a=qr;var c=we;if(qr=o,(we=u)&&!c)for(T=l;T!==null;)o=T,u=o.child,o.tag===22&&o.memoizedState!==null?Qa(l):u!==null?(u.return=o,T=u):Qa(l);for(;s!==null;)T=s,Id(s),s=s.sibling;T=l,qr=a,we=c}Ha(e)}else l.subtreeFlags&8772&&s!==null?(s.return=l,T=s):Ha(e)}}function Ha(e){for(;T!==null;){var t=T;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:we||ls(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!we)if(n===null)r.componentDidMount();else{var l=t.elementType===t.type?n.memoizedProps:et(t.type,n.memoizedProps);r.componentDidUpdate(l,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var s=t.updateQueue;s!==null&&Ia(t,s,r);break;case 3:var o=t.updateQueue;if(o!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}Ia(t,o,n)}break;case 5:var a=t.stateNode;if(n===null&&t.flags&4){n=a;var u=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":u.autoFocus&&n.focus();break;case"img":u.src&&(n.src=u.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var c=t.alternate;if(c!==null){var m=c.memoizedState;if(m!==null){var p=m.dehydrated;p!==null&&vr(p)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(C(163))}we||t.flags&512&&Ti(t)}catch(g){le(t,t.return,g)}}if(t===e){T=null;break}if(n=t.sibling,n!==null){n.return=t.return,T=n;break}T=t.return}}function Ka(e){for(;T!==null;){var t=T;if(t===e){T=null;break}var n=t.sibling;if(n!==null){n.return=t.return,T=n;break}T=t.return}}function Qa(e){for(;T!==null;){var t=T;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{ls(4,t)}catch(u){le(t,n,u)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var l=t.return;try{r.componentDidMount()}catch(u){le(t,l,u)}}var s=t.return;try{Ti(t)}catch(u){le(t,s,u)}break;case 5:var o=t.return;try{Ti(t)}catch(u){le(t,o,u)}}}catch(u){le(t,t.return,u)}if(t===e){T=null;break}var a=t.sibling;if(a!==null){a.return=t.return,T=a;break}T=t.return}}var Pm=Math.ceil,zl=Ct.ReactCurrentDispatcher,Io=Ct.ReactCurrentOwner,Qe=Ct.ReactCurrentBatchConfig,H=0,me=null,ue=null,xe=0,$e=0,Cn=Kt(0),fe=0,Ir=null,an=0,ss=0,_o=0,dr=null,Pe=null,Lo=0,Dn=1/0,mt=null,Ul=!1,$i=null,At=null,el=!1,Rt=null,Bl=0,fr=0,Fi=null,vl=-1,yl=0;function Se(){return H&6?ae():vl!==-1?vl:vl=ae()}function zt(e){return e.mode&1?H&2&&xe!==0?xe&-xe:dm.transition!==null?(yl===0&&(yl=pc()),yl):(e=Q,e!==0||(e=window.event,e=e===void 0?16:wc(e.type)),e):1}function lt(e,t,n,r){if(50<fr)throw fr=0,Fi=null,Error(C(185));Tr(e,n,r),(!(H&2)||e!==me)&&(e===me&&(!(H&2)&&(ss|=n),fe===4&&_t(e,xe)),Te(e,r),n===1&&H===0&&!(t.mode&1)&&(Dn=ae()+500,ts&&Qt()))}function Te(e,t){var n=e.callbackNode;dp(e,t);var r=Cl(e,e===me?xe:0);if(r===0)n!==null&&na(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&na(n),t===1)e.tag===0?cm(Ya.bind(null,e)):Ac(Ya.bind(null,e)),im(function(){!(H&6)&&Qt()}),n=null;else{switch(mc(r)){case 1:n=no;break;case 4:n=dc;break;case 16:n=Sl;break;case 536870912:n=fc;break;default:n=Sl}n=Fd(n,_d.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function _d(e,t){if(vl=-1,yl=0,H&6)throw Error(C(327));var n=e.callbackNode;if(Ln()&&e.callbackNode!==n)return null;var r=Cl(e,e===me?xe:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=Wl(e,r);else{t=r;var l=H;H|=2;var s=Rd();(me!==e||xe!==t)&&(mt=null,Dn=ae()+500,nn(e,t));do try{Lm();break}catch(a){Ld(e,a)}while(!0);xo(),zl.current=s,H=l,ue!==null?t=0:(me=null,xe=0,t=fe)}if(t!==0){if(t===2&&(l=ci(e),l!==0&&(r=l,t=Di(e,l))),t===1)throw n=Ir,nn(e,0),_t(e,r),Te(e,ae()),n;if(t===6)_t(e,r);else{if(l=e.current.alternate,!(r&30)&&!Im(l)&&(t=Wl(e,r),t===2&&(s=ci(e),s!==0&&(r=s,t=Di(e,s))),t===1))throw n=Ir,nn(e,0),_t(e,r),Te(e,ae()),n;switch(e.finishedWork=l,e.finishedLanes=r,t){case 0:case 1:throw Error(C(345));case 2:Zt(e,Pe,mt);break;case 3:if(_t(e,r),(r&130023424)===r&&(t=Lo+500-ae(),10<t)){if(Cl(e,0)!==0)break;if(l=e.suspendedLanes,(l&r)!==r){Se(),e.pingedLanes|=e.suspendedLanes&l;break}e.timeoutHandle=vi(Zt.bind(null,e,Pe,mt),t);break}Zt(e,Pe,mt);break;case 4:if(_t(e,r),(r&4194240)===r)break;for(t=e.eventTimes,l=-1;0<r;){var o=31-rt(r);s=1<<o,o=t[o],o>l&&(l=o),r&=~s}if(r=l,r=ae()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*Pm(r/1960))-r,10<r){e.timeoutHandle=vi(Zt.bind(null,e,Pe,mt),r);break}Zt(e,Pe,mt);break;case 5:Zt(e,Pe,mt);break;default:throw Error(C(329))}}}return Te(e,ae()),e.callbackNode===n?_d.bind(null,e):null}function Di(e,t){var n=dr;return e.current.memoizedState.isDehydrated&&(nn(e,t).flags|=256),e=Wl(e,t),e!==2&&(t=Pe,Pe=n,t!==null&&Ai(t)),e}function Ai(e){Pe===null?Pe=e:Pe.push.apply(Pe,e)}function Im(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var l=n[r],s=l.getSnapshot;l=l.value;try{if(!st(s(),l))return!1}catch{return!1}}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function _t(e,t){for(t&=~_o,t&=~ss,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-rt(t),r=1<<n;e[n]=-1,t&=~r}}function Ya(e){if(H&6)throw Error(C(327));Ln();var t=Cl(e,0);if(!(t&1))return Te(e,ae()),null;var n=Wl(e,t);if(e.tag!==0&&n===2){var r=ci(e);r!==0&&(t=r,n=Di(e,r))}if(n===1)throw n=Ir,nn(e,0),_t(e,t),Te(e,ae()),n;if(n===6)throw Error(C(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Zt(e,Pe,mt),Te(e,ae()),null}function Ro(e,t){var n=H;H|=1;try{return e(t)}finally{H=n,H===0&&(Dn=ae()+500,ts&&Qt())}}function un(e){Rt!==null&&Rt.tag===0&&!(H&6)&&Ln();var t=H;H|=1;var n=Qe.transition,r=Q;try{if(Qe.transition=null,Q=1,e)return e()}finally{Q=r,Qe.transition=n,H=t,!(H&6)&&Qt()}}function To(){$e=Cn.current,q(Cn)}function nn(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,sm(n)),ue!==null)for(n=ue.return;n!==null;){var r=n;switch(po(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&_l();break;case 3:$n(),q(Le),q(je),No();break;case 5:jo(r);break;case 4:$n();break;case 13:q(te);break;case 19:q(te);break;case 10:go(r.type._context);break;case 22:case 23:To()}n=n.return}if(me=e,ue=e=Ut(e.current,null),xe=$e=t,fe=0,Ir=null,_o=ss=an=0,Pe=dr=null,en!==null){for(t=0;t<en.length;t++)if(n=en[t],r=n.interleaved,r!==null){n.interleaved=null;var l=r.next,s=n.pending;if(s!==null){var o=s.next;s.next=l,r.next=o}n.pending=r}en=null}return e}function Ld(e,t){do{var n=ue;try{if(xo(),hl.current=Al,Dl){for(var r=ne.memoizedState;r!==null;){var l=r.queue;l!==null&&(l.pending=null),r=r.next}Dl=!1}if(on=0,pe=de=ne=null,ur=!1,br=0,Io.current=null,n===null||n.return===null){fe=1,Ir=t,ue=null;break}e:{var s=e,o=n.return,a=n,u=t;if(t=xe,a.flags|=32768,u!==null&&typeof u=="object"&&typeof u.then=="function"){var c=u,m=a,p=m.tag;if(!(m.mode&1)&&(p===0||p===11||p===15)){var g=m.alternate;g?(m.updateQueue=g.updateQueue,m.memoizedState=g.memoizedState,m.lanes=g.lanes):(m.updateQueue=null,m.memoizedState=null)}var v=Oa(o);if(v!==null){v.flags&=-257,$a(v,o,a,s,t),v.mode&1&&Ma(s,c,t),t=v,u=c;var y=t.updateQueue;if(y===null){var w=new Set;w.add(u),t.updateQueue=w}else y.add(u);break e}else{if(!(t&1)){Ma(s,c,t),Mo();break e}u=Error(C(426))}}else if(ee&&a.mode&1){var N=Oa(o);if(N!==null){!(N.flags&65536)&&(N.flags|=256),$a(N,o,a,s,t),mo(Fn(u,a));break e}}s=u=Fn(u,a),fe!==4&&(fe=2),dr===null?dr=[s]:dr.push(s),s=o;do{switch(s.tag){case 3:s.flags|=65536,t&=-t,s.lanes|=t;var f=md(s,u,t);Pa(s,f);break e;case 1:a=u;var d=s.type,h=s.stateNode;if(!(s.flags&128)&&(typeof d.getDerivedStateFromError=="function"||h!==null&&typeof h.componentDidCatch=="function"&&(At===null||!At.has(h)))){s.flags|=65536,t&=-t,s.lanes|=t;var j=hd(s,a,t);Pa(s,j);break e}}s=s.return}while(s!==null)}Md(n)}catch(k){t=k,ue===n&&n!==null&&(ue=n=n.return);continue}break}while(!0)}function Rd(){var e=zl.current;return zl.current=Al,e===null?Al:e}function Mo(){(fe===0||fe===3||fe===2)&&(fe=4),me===null||!(an&268435455)&&!(ss&268435455)||_t(me,xe)}function Wl(e,t){var n=H;H|=2;var r=Rd();(me!==e||xe!==t)&&(mt=null,nn(e,t));do try{_m();break}catch(l){Ld(e,l)}while(!0);if(xo(),H=n,zl.current=r,ue!==null)throw Error(C(261));return me=null,xe=0,fe}function _m(){for(;ue!==null;)Td(ue)}function Lm(){for(;ue!==null&&!np();)Td(ue)}function Td(e){var t=$d(e.alternate,e,$e);e.memoizedProps=e.pendingProps,t===null?Md(e):ue=t,Io.current=null}function Md(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=Sm(n,t),n!==null){n.flags&=32767,ue=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{fe=6,ue=null;return}}else if(n=km(n,t,$e),n!==null){ue=n;return}if(t=t.sibling,t!==null){ue=t;return}ue=t=e}while(t!==null);fe===0&&(fe=5)}function Zt(e,t,n){var r=Q,l=Qe.transition;try{Qe.transition=null,Q=1,Rm(e,t,n,r)}finally{Qe.transition=l,Q=r}return null}function Rm(e,t,n,r){do Ln();while(Rt!==null);if(H&6)throw Error(C(327));n=e.finishedWork;var l=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(C(177));e.callbackNode=null,e.callbackPriority=0;var s=n.lanes|n.childLanes;if(fp(e,s),e===me&&(ue=me=null,xe=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||el||(el=!0,Fd(Sl,function(){return Ln(),null})),s=(n.flags&15990)!==0,n.subtreeFlags&15990||s){s=Qe.transition,Qe.transition=null;var o=Q;Q=1;var a=H;H|=4,Io.current=null,bm(e,n),Pd(n,e),Zp(xi),bl=!!hi,xi=hi=null,e.current=n,Em(n),rp(),H=a,Q=o,Qe.transition=s}else e.current=n;if(el&&(el=!1,Rt=e,Bl=l),s=e.pendingLanes,s===0&&(At=null),ip(n.stateNode),Te(e,ae()),t!==null)for(r=e.onRecoverableError,n=0;n<t.length;n++)l=t[n],r(l.value,{componentStack:l.stack,digest:l.digest});if(Ul)throw Ul=!1,e=$i,$i=null,e;return Bl&1&&e.tag!==0&&Ln(),s=e.pendingLanes,s&1?e===Fi?fr++:(fr=0,Fi=e):fr=0,Qt(),null}function Ln(){if(Rt!==null){var e=mc(Bl),t=Qe.transition,n=Q;try{if(Qe.transition=null,Q=16>e?16:e,Rt===null)var r=!1;else{if(e=Rt,Rt=null,Bl=0,H&6)throw Error(C(331));var l=H;for(H|=4,T=e.current;T!==null;){var s=T,o=s.child;if(T.flags&16){var a=s.deletions;if(a!==null){for(var u=0;u<a.length;u++){var c=a[u];for(T=c;T!==null;){var m=T;switch(m.tag){case 0:case 11:case 15:cr(8,m,s)}var p=m.child;if(p!==null)p.return=m,T=p;else for(;T!==null;){m=T;var g=m.sibling,v=m.return;if(Cd(m),m===c){T=null;break}if(g!==null){g.return=v,T=g;break}T=v}}}var y=s.alternate;if(y!==null){var w=y.child;if(w!==null){y.child=null;do{var N=w.sibling;w.sibling=null,w=N}while(w!==null)}}T=s}}if(s.subtreeFlags&2064&&o!==null)o.return=s,T=o;else e:for(;T!==null;){if(s=T,s.flags&2048)switch(s.tag){case 0:case 11:case 15:cr(9,s,s.return)}var f=s.sibling;if(f!==null){f.return=s.return,T=f;break e}T=s.return}}var d=e.current;for(T=d;T!==null;){o=T;var h=o.child;if(o.subtreeFlags&2064&&h!==null)h.return=o,T=h;else e:for(o=d;T!==null;){if(a=T,a.flags&2048)try{switch(a.tag){case 0:case 11:case 15:ls(9,a)}}catch(k){le(a,a.return,k)}if(a===o){T=null;break e}var j=a.sibling;if(j!==null){j.return=a.return,T=j;break e}T=a.return}}if(H=l,Qt(),ft&&typeof ft.onPostCommitFiberRoot=="function")try{ft.onPostCommitFiberRoot(Gl,e)}catch{}r=!0}return r}finally{Q=n,Qe.transition=t}}return!1}function Xa(e,t,n){t=Fn(n,t),t=md(e,t,1),e=Dt(e,t,1),t=Se(),e!==null&&(Tr(e,1,t),Te(e,t))}function le(e,t,n){if(e.tag===3)Xa(e,e,n);else for(;t!==null;){if(t.tag===3){Xa(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(At===null||!At.has(r))){e=Fn(n,e),e=hd(t,e,1),t=Dt(t,e,1),e=Se(),t!==null&&(Tr(t,1,e),Te(t,e));break}}t=t.return}}function Tm(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=Se(),e.pingedLanes|=e.suspendedLanes&n,me===e&&(xe&n)===n&&(fe===4||fe===3&&(xe&130023424)===xe&&500>ae()-Lo?nn(e,0):_o|=n),Te(e,t)}function Od(e,t){t===0&&(e.mode&1?(t=Vr,Vr<<=1,!(Vr&130023424)&&(Vr=4194304)):t=1);var n=Se();e=Nt(e,t),e!==null&&(Tr(e,t,n),Te(e,n))}function Mm(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Od(e,n)}function Om(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,l=e.memoizedState;l!==null&&(n=l.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(C(314))}r!==null&&r.delete(t),Od(e,n)}var $d;$d=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Le.current)Ie=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return Ie=!1,Nm(e,t,n);Ie=!!(e.flags&131072)}else Ie=!1,ee&&t.flags&1048576&&zc(t,Tl,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;gl(e,t),e=t.pendingProps;var l=Tn(t,je.current);_n(t,n),l=So(null,t,r,e,l,n);var s=Co();return t.flags|=1,typeof l=="object"&&l!==null&&typeof l.render=="function"&&l.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Re(r)?(s=!0,Ll(t)):s=!1,t.memoizedState=l.state!==null&&l.state!==void 0?l.state:null,yo(t),l.updater=rs,t.stateNode=l,l._reactInternals=t,Ci(t,r,e,n),t=Pi(null,t,r,!0,s,n)):(t.tag=0,ee&&s&&fo(t),ke(null,t,l,n),t=t.child),t;case 16:r=t.elementType;e:{switch(gl(e,t),e=t.pendingProps,l=r._init,r=l(r._payload),t.type=r,l=t.tag=Fm(r),e=et(r,e),l){case 0:t=Ei(null,t,r,e,n);break e;case 1:t=Aa(null,t,r,e,n);break e;case 11:t=Fa(null,t,r,e,n);break e;case 14:t=Da(null,t,r,et(r.type,e),n);break e}throw Error(C(306,r,""))}return t;case 0:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:et(r,l),Ei(e,t,r,l,n);case 1:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:et(r,l),Aa(e,t,r,l,n);case 3:e:{if(yd(t),e===null)throw Error(C(387));r=t.pendingProps,s=t.memoizedState,l=s.element,Kc(e,t),$l(t,r,null,n);var o=t.memoizedState;if(r=o.element,s.isDehydrated)if(s={element:r,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=s,t.memoizedState=s,t.flags&256){l=Fn(Error(C(423)),t),t=za(e,t,r,n,l);break e}else if(r!==l){l=Fn(Error(C(424)),t),t=za(e,t,r,n,l);break e}else for(Fe=Ft(t.stateNode.containerInfo.firstChild),De=t,ee=!0,nt=null,n=Vc(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Mn(),r===l){t=kt(e,t,n);break e}ke(e,t,r,n)}t=t.child}return t;case 5:return Qc(t),e===null&&Ni(t),r=t.type,l=t.pendingProps,s=e!==null?e.memoizedProps:null,o=l.children,gi(r,l)?o=null:s!==null&&gi(r,s)&&(t.flags|=32),vd(e,t),ke(e,t,o,n),t.child;case 6:return e===null&&Ni(t),null;case 13:return wd(e,t,n);case 4:return wo(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=On(t,null,r,n):ke(e,t,r,n),t.child;case 11:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:et(r,l),Fa(e,t,r,l,n);case 7:return ke(e,t,t.pendingProps,n),t.child;case 8:return ke(e,t,t.pendingProps.children,n),t.child;case 12:return ke(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,l=t.pendingProps,s=t.memoizedProps,o=l.value,G(Ml,r._currentValue),r._currentValue=o,s!==null)if(st(s.value,o)){if(s.children===l.children&&!Le.current){t=kt(e,t,n);break e}}else for(s=t.child,s!==null&&(s.return=t);s!==null;){var a=s.dependencies;if(a!==null){o=s.child;for(var u=a.firstContext;u!==null;){if(u.context===r){if(s.tag===1){u=yt(-1,n&-n),u.tag=2;var c=s.updateQueue;if(c!==null){c=c.shared;var m=c.pending;m===null?u.next=u:(u.next=m.next,m.next=u),c.pending=u}}s.lanes|=n,u=s.alternate,u!==null&&(u.lanes|=n),ki(s.return,n,t),a.lanes|=n;break}u=u.next}}else if(s.tag===10)o=s.type===t.type?null:s.child;else if(s.tag===18){if(o=s.return,o===null)throw Error(C(341));o.lanes|=n,a=o.alternate,a!==null&&(a.lanes|=n),ki(o,n,t),o=s.sibling}else o=s.child;if(o!==null)o.return=s;else for(o=s;o!==null;){if(o===t){o=null;break}if(s=o.sibling,s!==null){s.return=o.return,o=s;break}o=o.return}s=o}ke(e,t,l.children,n),t=t.child}return t;case 9:return l=t.type,r=t.pendingProps.children,_n(t,n),l=Ye(l),r=r(l),t.flags|=1,ke(e,t,r,n),t.child;case 14:return r=t.type,l=et(r,t.pendingProps),l=et(r.type,l),Da(e,t,r,l,n);case 15:return xd(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:et(r,l),gl(e,t),t.tag=1,Re(r)?(e=!0,Ll(t)):e=!1,_n(t,n),pd(t,r,l),Ci(t,r,l,n),Pi(null,t,r,!0,e,n);case 19:return jd(e,t,n);case 22:return gd(e,t,n)}throw Error(C(156,t.tag))};function Fd(e,t){return cc(e,t)}function $m(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ke(e,t,n,r){return new $m(e,t,n,r)}function Oo(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Fm(e){if(typeof e=="function")return Oo(e)?1:0;if(e!=null){if(e=e.$$typeof,e===qi)return 11;if(e===eo)return 14}return 2}function Ut(e,t){var n=e.alternate;return n===null?(n=Ke(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function wl(e,t,n,r,l,s){var o=2;if(r=e,typeof e=="function")Oo(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case hn:return rn(n.children,l,s,t);case Zi:o=8,l|=8;break;case Xs:return e=Ke(12,n,t,l|2),e.elementType=Xs,e.lanes=s,e;case Gs:return e=Ke(13,n,t,l),e.elementType=Gs,e.lanes=s,e;case Js:return e=Ke(19,n,t,l),e.elementType=Js,e.lanes=s,e;case Qu:return is(n,l,s,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Hu:o=10;break e;case Ku:o=9;break e;case qi:o=11;break e;case eo:o=14;break e;case Et:o=16,r=null;break e}throw Error(C(130,e==null?e:typeof e,""))}return t=Ke(o,n,t,l),t.elementType=e,t.type=r,t.lanes=s,t}function rn(e,t,n,r){return e=Ke(7,e,r,t),e.lanes=n,e}function is(e,t,n,r){return e=Ke(22,e,r,t),e.elementType=Qu,e.lanes=n,e.stateNode={isHidden:!1},e}function zs(e,t,n){return e=Ke(6,e,null,t),e.lanes=n,e}function Us(e,t,n){return t=Ke(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Dm(e,t,n,r,l){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=js(0),this.expirationTimes=js(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=js(0),this.identifierPrefix=r,this.onRecoverableError=l,this.mutableSourceEagerHydrationData=null}function $o(e,t,n,r,l,s,o,a,u){return e=new Dm(e,t,n,a,u),t===1?(t=1,s===!0&&(t|=8)):t=0,s=Ke(3,null,null,t),e.current=s,s.stateNode=e,s.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},yo(s),e}function Am(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:mn,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function Dd(e){if(!e)return Vt;e=e._reactInternals;e:{if(dn(e)!==e||e.tag!==1)throw Error(C(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Re(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(C(171))}if(e.tag===1){var n=e.type;if(Re(n))return Dc(e,n,t)}return t}function Ad(e,t,n,r,l,s,o,a,u){return e=$o(n,r,!0,e,l,s,o,a,u),e.context=Dd(null),n=e.current,r=Se(),l=zt(n),s=yt(r,l),s.callback=t??null,Dt(n,s,l),e.current.lanes=l,Tr(e,l,r),Te(e,r),e}function os(e,t,n,r){var l=t.current,s=Se(),o=zt(l);return n=Dd(n),t.context===null?t.context=n:t.pendingContext=n,t=yt(s,o),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=Dt(l,t,o),e!==null&&(lt(e,l,o,s),ml(e,l,o)),o}function Vl(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function Ga(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Fo(e,t){Ga(e,t),(e=e.alternate)&&Ga(e,t)}function zm(){return null}var zd=typeof reportError=="function"?reportError:function(e){console.error(e)};function Do(e){this._internalRoot=e}as.prototype.render=Do.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(C(409));os(e,t,null,null)};as.prototype.unmount=Do.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;un(function(){os(null,e,null,null)}),t[jt]=null}};function as(e){this._internalRoot=e}as.prototype.unstable_scheduleHydration=function(e){if(e){var t=gc();e={blockedOn:null,target:e,priority:t};for(var n=0;n<It.length&&t!==0&&t<It[n].priority;n++);It.splice(n,0,e),n===0&&yc(e)}};function Ao(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function us(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Ja(){}function Um(e,t,n,r,l){if(l){if(typeof r=="function"){var s=r;r=function(){var c=Vl(o);s.call(c)}}var o=Ad(t,r,e,0,null,!1,!1,"",Ja);return e._reactRootContainer=o,e[jt]=o.current,jr(e.nodeType===8?e.parentNode:e),un(),o}for(;l=e.lastChild;)e.removeChild(l);if(typeof r=="function"){var a=r;r=function(){var c=Vl(u);a.call(c)}}var u=$o(e,0,!1,null,null,!1,!1,"",Ja);return e._reactRootContainer=u,e[jt]=u.current,jr(e.nodeType===8?e.parentNode:e),un(function(){os(t,u,n,r)}),u}function cs(e,t,n,r,l){var s=n._reactRootContainer;if(s){var o=s;if(typeof l=="function"){var a=l;l=function(){var u=Vl(o);a.call(u)}}os(t,o,e,l)}else o=Um(n,t,e,l,r);return Vl(o)}hc=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=nr(t.pendingLanes);n!==0&&(ro(t,n|1),Te(t,ae()),!(H&6)&&(Dn=ae()+500,Qt()))}break;case 13:un(function(){var r=Nt(e,1);if(r!==null){var l=Se();lt(r,e,1,l)}}),Fo(e,1)}};lo=function(e){if(e.tag===13){var t=Nt(e,134217728);if(t!==null){var n=Se();lt(t,e,134217728,n)}Fo(e,134217728)}};xc=function(e){if(e.tag===13){var t=zt(e),n=Nt(e,t);if(n!==null){var r=Se();lt(n,e,t,r)}Fo(e,t)}};gc=function(){return Q};vc=function(e,t){var n=Q;try{return Q=e,t()}finally{Q=n}};oi=function(e,t,n){switch(t){case"input":if(ei(e,n),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var l=es(r);if(!l)throw Error(C(90));Xu(r),ei(r,l)}}}break;case"textarea":Ju(e,n);break;case"select":t=n.value,t!=null&&bn(e,!!n.multiple,t,!1)}};lc=Ro;sc=un;var Bm={usingClientEntryPoint:!1,Events:[Or,yn,es,nc,rc,Ro]},Jn={findFiberByHostInstance:qt,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},Wm={bundleType:Jn.bundleType,version:Jn.version,rendererPackageName:Jn.rendererPackageName,rendererConfig:Jn.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Ct.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=ac(e),e===null?null:e.stateNode},findFiberByHostInstance:Jn.findFiberByHostInstance||zm,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var tl=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!tl.isDisabled&&tl.supportsFiber)try{Gl=tl.inject(Wm),ft=tl}catch{}}ze.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Bm;ze.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Ao(t))throw Error(C(200));return Am(e,t,null,n)};ze.createRoot=function(e,t){if(!Ao(e))throw Error(C(299));var n=!1,r="",l=zd;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(l=t.onRecoverableError)),t=$o(e,1,!1,null,null,n,!1,r,l),e[jt]=t.current,jr(e.nodeType===8?e.parentNode:e),new Do(t)};ze.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(C(188)):(e=Object.keys(e).join(","),Error(C(268,e)));return e=ac(t),e=e===null?null:e.stateNode,e};ze.flushSync=function(e){return un(e)};ze.hydrate=function(e,t,n){if(!us(t))throw Error(C(200));return cs(null,e,t,!0,n)};ze.hydrateRoot=function(e,t,n){if(!Ao(e))throw Error(C(405));var r=n!=null&&n.hydratedSources||null,l=!1,s="",o=zd;if(n!=null&&(n.unstable_strictMode===!0&&(l=!0),n.identifierPrefix!==void 0&&(s=n.identifierPrefix),n.onRecoverableError!==void 0&&(o=n.onRecoverableError)),t=Ad(t,null,e,1,n??null,l,!1,s,o),e[jt]=t.current,jr(e),r)for(e=0;e<r.length;e++)n=r[e],l=n._getVersion,l=l(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,l]:t.mutableSourceEagerHydrationData.push(n,l);return new as(t)};ze.render=function(e,t,n){if(!us(t))throw Error(C(200));return cs(null,e,t,!1,n)};ze.unmountComponentAtNode=function(e){if(!us(e))throw Error(C(40));return e._reactRootContainer?(un(function(){cs(null,null,e,!1,function(){e._reactRootContainer=null,e[jt]=null})}),!0):!1};ze.unstable_batchedUpdates=Ro;ze.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!us(n))throw Error(C(200));if(e==null||e._reactInternals===void 0)throw Error(C(38));return cs(e,t,n,!1,r)};ze.version="18.3.1-next-f1338f8080-20240426";function Ud(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Ud)}catch(e){console.error(e)}}Ud(),Uu.exports=ze;var Vm=Uu.exports,Za=Vm;Qs.createRoot=Za.createRoot,Qs.hydrateRoot=Za.hydrateRoot;/**
41
+ * @remix-run/router v1.23.4
42
+ *
43
+ * Copyright (c) Remix Software Inc.
44
+ *
45
+ * This source code is licensed under the MIT license found in the
46
+ * LICENSE.md file in the root directory of this source tree.
47
+ *
48
+ * @license MIT
49
+ */function _r(){return _r=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},_r.apply(null,arguments)}var Tt;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(Tt||(Tt={}));const qa="popstate";function Hm(e){e===void 0&&(e={});function t(r,l){let{pathname:s,search:o,hash:a}=r.location;return zi("",{pathname:s,search:o,hash:a},l.state&&l.state.usr||null,l.state&&l.state.key||"default")}function n(r,l){return typeof l=="string"?l:Hl(l)}return Qm(t,n,null,e)}function se(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Bd(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function Km(){return Math.random().toString(36).substr(2,8)}function eu(e,t){return{usr:e.state,key:e.key,idx:t}}function zi(e,t,n,r){return n===void 0&&(n=null),_r({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?Wn(t):t,{state:n,key:t&&t.key||r||Km()})}function Hl(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(t+=r.charAt(0)==="#"?r:"#"+r),t}function Wn(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function Qm(e,t,n,r){r===void 0&&(r={});let{window:l=document.defaultView,v5Compat:s=!1}=r,o=l.history,a=Tt.Pop,u=null,c=m();c==null&&(c=0,o.replaceState(_r({},o.state,{idx:c}),""));function m(){return(o.state||{idx:null}).idx}function p(){a=Tt.Pop;let N=m(),f=N==null?null:N-c;c=N,u&&u({action:a,location:w.location,delta:f})}function g(N,f){a=Tt.Push;let d=zi(w.location,N,f);c=m()+1;let h=eu(d,c),j=w.createHref(d);try{o.pushState(h,"",j)}catch(k){if(k instanceof DOMException&&k.name==="DataCloneError")throw k;l.location.assign(j)}s&&u&&u({action:a,location:w.location,delta:1})}function v(N,f){a=Tt.Replace;let d=zi(w.location,N,f);c=m();let h=eu(d,c),j=w.createHref(d);o.replaceState(h,"",j),s&&u&&u({action:a,location:w.location,delta:0})}function y(N){let f=l.location.origin!=="null"?l.location.origin:l.location.href,d=typeof N=="string"?N:Hl(N);return d=d.replace(/ $/,"%20"),se(f,"No window.location.(origin|href) available to create URL for href: "+d),new URL(d,f)}let w={get action(){return a},get location(){return e(l,o)},listen(N){if(u)throw new Error("A history only accepts one active listener");return l.addEventListener(qa,p),u=N,()=>{l.removeEventListener(qa,p),u=null}},createHref(N){return t(l,N)},createURL:y,encodeLocation(N){let f=y(N);return{pathname:f.pathname,search:f.search,hash:f.hash}},push:g,replace:v,go(N){return o.go(N)}};return w}var tu;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(tu||(tu={}));function Ym(e,t,n){return n===void 0&&(n="/"),Xm(e,t,n)}function Xm(e,t,n,r){let l=typeof t=="string"?Wn(t):t,s=An(l.pathname||"/",n);if(s==null)return null;let o=Wd(e);Gm(o);let a=null,u=oh(s);for(let c=0;a==null&&c<o.length;++c)a=sh(o[c],u);return a}function Wd(e,t,n,r){t===void 0&&(t=[]),n===void 0&&(n=[]),r===void 0&&(r="");let l=(s,o,a)=>{let u={relativePath:a===void 0?s.path||"":a,caseSensitive:s.caseSensitive===!0,childrenIndex:o,route:s};u.relativePath.startsWith("/")&&(se(u.relativePath.startsWith(r),'Absolute route path "'+u.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),u.relativePath=u.relativePath.slice(r.length));let c=Bt([r,u.relativePath]),m=n.concat(u);s.children&&s.children.length>0&&(se(s.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+c+'".')),Wd(s.children,t,m,c)),!(s.path==null&&!s.index)&&t.push({path:c,score:rh(c,s.index),routesMeta:m})};return e.forEach((s,o)=>{var a;if(s.path===""||!((a=s.path)!=null&&a.includes("?")))l(s,o);else for(let u of Vd(s.path))l(s,o,u)}),t}function Vd(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,l=n.endsWith("?"),s=n.replace(/\?$/,"");if(r.length===0)return l?[s,""]:[s];let o=Vd(r.join("/")),a=[];return a.push(...o.map(u=>u===""?s:[s,u].join("/"))),l&&a.push(...o),a.map(u=>e.startsWith("/")&&u===""?"/":u)}function Gm(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:lh(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const Jm=/^:[\w-]+$/,Zm=3,qm=2,eh=1,th=10,nh=-2,nu=e=>e==="*";function rh(e,t){let n=e.split("/"),r=n.length;return n.some(nu)&&(r+=nh),t&&(r+=qm),n.filter(l=>!nu(l)).reduce((l,s)=>l+(Jm.test(s)?Zm:s===""?eh:th),r)}function lh(e,t){return e.length===t.length&&e.slice(0,-1).every((r,l)=>r===t[l])?e[e.length-1]-t[t.length-1]:0}function sh(e,t,n){let{routesMeta:r}=e,l={},s="/",o=[];for(let a=0;a<r.length;++a){let u=r[a],c=a===r.length-1,m=s==="/"?t:t.slice(s.length)||"/",p=Ui({path:u.relativePath,caseSensitive:u.caseSensitive,end:c},m),g=u.route;if(!p)return null;Object.assign(l,p.params),o.push({params:l,pathname:Bt([s,p.pathname]),pathnameBase:ch(Bt([s,p.pathnameBase])),route:g}),p.pathnameBase!=="/"&&(s=Bt([s,p.pathnameBase]))}return o}function Ui(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=ih(e.path,e.caseSensitive,e.end),l=t.match(n);if(!l)return null;let s=l[0],o=s.replace(/(.)\/+$/,"$1"),a=l.slice(1);return{params:r.reduce((c,m,p)=>{let{paramName:g,isOptional:v}=m;if(g==="*"){let w=a[p]||"";o=s.slice(0,s.length-w.length).replace(/(.)\/+$/,"$1")}const y=a[p];return v&&!y?c[g]=void 0:c[g]=(y||"").replace(/%2F/g,"/"),c},{}),pathname:s,pathnameBase:o,pattern:e}}function ih(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),Bd(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let r=[],l="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,a,u)=>(r.push({paramName:a,isOptional:u!=null}),u?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),l+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?l+="\\/*$":e!==""&&e!=="/"&&(l+="(?:(?=\\/|$))"),[new RegExp(l,t?void 0:"i"),r]}function oh(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Bd(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function An(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}function ah(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:l=""}=typeof e=="string"?Wn(e):e,s;return n?(n=Qd(n),n.startsWith("/")?s=ru(n.substring(1),"/"):s=ru(n,t)):s=t,{pathname:s,search:dh(r),hash:fh(l)}}function ru(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(l=>{l===".."?n.length>1&&n.pop():l!=="."&&n.push(l)}),n.length>1?n.join("/"):"/"}function Bs(e,t,n,r){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(r)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function uh(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function Hd(e,t){let n=uh(e);return t?n.map((r,l)=>l===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function Kd(e,t,n,r){r===void 0&&(r=!1);let l;typeof e=="string"?l=Wn(e):(l=_r({},e),se(!l.pathname||!l.pathname.includes("?"),Bs("?","pathname","search",l)),se(!l.pathname||!l.pathname.includes("#"),Bs("#","pathname","hash",l)),se(!l.search||!l.search.includes("#"),Bs("#","search","hash",l)));let s=e===""||l.pathname==="",o=s?"/":l.pathname,a;if(o==null)a=n;else{let p=t.length-1;if(!r&&o.startsWith("..")){let g=o.split("/");for(;g[0]==="..";)g.shift(),p-=1;l.pathname=g.join("/")}a=p>=0?t[p]:"/"}let u=ah(l,a),c=o&&o!=="/"&&o.endsWith("/"),m=(s||o===".")&&n.endsWith("/");return!u.pathname.endsWith("/")&&(c||m)&&(u.pathname+="/"),u}const Qd=e=>e.replace(/\/\/+/g,"/"),Bt=e=>Qd(e.join("/")),ch=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),dh=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,fh=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function ph(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const Yd=["post","put","patch","delete"];new Set(Yd);const mh=["get",...Yd];new Set(mh);/**
50
+ * React Router v6.30.6
51
+ *
52
+ * Copyright (c) Remix Software Inc.
53
+ *
54
+ * This source code is licensed under the MIT license found in the
55
+ * LICENSE.md file in the root directory of this source tree.
56
+ *
57
+ * @license MIT
58
+ */function Lr(){return Lr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Lr.apply(null,arguments)}const ds=x.createContext(null),Xd=x.createContext(null),Yt=x.createContext(null),fs=x.createContext(null),Xt=x.createContext({outlet:null,matches:[],isDataRoute:!1}),Gd=x.createContext(null);function hh(e,t){let{relative:n}=t===void 0?{}:t;Fr()||se(!1);let{basename:r,navigator:l}=x.useContext(Yt),{hash:s,pathname:o,search:a}=ms(e,{relative:n}),u=o;return r!=="/"&&(u=o==="/"?r:Bt([r,o])),l.createHref({pathname:u,search:a,hash:s})}function Fr(){return x.useContext(fs)!=null}function Dr(){return Fr()||se(!1),x.useContext(fs).location}function Jd(e){x.useContext(Yt).static||x.useLayoutEffect(e)}function ps(){let{isDataRoute:e}=x.useContext(Xt);return e?Ph():xh()}function xh(){Fr()||se(!1);let e=x.useContext(ds),{basename:t,future:n,navigator:r}=x.useContext(Yt),{matches:l}=x.useContext(Xt),{pathname:s}=Dr(),o=JSON.stringify(Hd(l,n.v7_relativeSplatPath)),a=x.useRef(!1);return Jd(()=>{a.current=!0}),x.useCallback(function(c,m){if(m===void 0&&(m={}),!a.current)return;if(typeof c=="number"){r.go(c);return}let p=Kd(c,JSON.parse(o),s,m.relative==="path");e==null&&t!=="/"&&(p.pathname=p.pathname==="/"?t:Bt([t,p.pathname])),(m.replace?r.replace:r.push)(p,m.state,m)},[t,r,o,s,e])}function Zd(){let{matches:e}=x.useContext(Xt),t=e[e.length-1];return t?t.params:{}}function ms(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=x.useContext(Yt),{matches:l}=x.useContext(Xt),{pathname:s}=Dr(),o=JSON.stringify(Hd(l,r.v7_relativeSplatPath));return x.useMemo(()=>Kd(e,JSON.parse(o),s,n==="path"),[e,o,s,n])}function gh(e,t){return vh(e,t)}function vh(e,t,n,r){Fr()||se(!1);let{navigator:l}=x.useContext(Yt),{matches:s}=x.useContext(Xt),o=s[s.length-1],a=o?o.params:{};o&&o.pathname;let u=o?o.pathnameBase:"/";o&&o.route;let c=Dr(),m;if(t){var p;let N=typeof t=="string"?Wn(t):t;u==="/"||(p=N.pathname)!=null&&p.startsWith(u)||se(!1),m=N}else m=c;let g=m.pathname||"/",v=g;if(u!=="/"){let N=u.replace(/^\//,"").split("/");v="/"+g.replace(/^\//,"").split("/").slice(N.length).join("/")}let y=Ym(e,{pathname:v}),w=kh(y&&y.map(N=>Object.assign({},N,{params:Object.assign({},a,N.params),pathname:Bt([u,l.encodeLocation?l.encodeLocation(N.pathname).pathname:N.pathname]),pathnameBase:N.pathnameBase==="/"?u:Bt([u,l.encodeLocation?l.encodeLocation(N.pathnameBase).pathname:N.pathnameBase])})),s,n,r);return t&&w?x.createElement(fs.Provider,{value:{location:Lr({pathname:"/",search:"",hash:"",state:null,key:"default"},m),navigationType:Tt.Pop}},w):w}function yh(){let e=Eh(),t=ph(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,l={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return x.createElement(x.Fragment,null,x.createElement("h2",null,"Unexpected Application Error!"),x.createElement("h3",{style:{fontStyle:"italic"}},t),n?x.createElement("pre",{style:l},n):null,null)}const wh=x.createElement(yh,null);class jh extends x.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,n){return n.location!==t.location||n.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:n.error,location:n.location,revalidation:t.revalidation||n.revalidation}}componentDidCatch(t,n){console.error("React Router caught the following error during render",t,n)}render(){return this.state.error!==void 0?x.createElement(Xt.Provider,{value:this.props.routeContext},x.createElement(Gd.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function Nh(e){let{routeContext:t,match:n,children:r}=e,l=x.useContext(ds);return l&&l.static&&l.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(l.staticContext._deepestRenderedBoundaryId=n.route.id),x.createElement(Xt.Provider,{value:t},r)}function kh(e,t,n,r){var l;if(t===void 0&&(t=[]),n===void 0&&(n=null),r===void 0&&(r=null),e==null){var s;if(!n)return null;if(n.errors)e=n.matches;else if((s=r)!=null&&s.v7_partialHydration&&t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let o=e,a=(l=n)==null?void 0:l.errors;if(a!=null){let m=o.findIndex(p=>p.route.id&&(a==null?void 0:a[p.route.id])!==void 0);m>=0||se(!1),o=o.slice(0,Math.min(o.length,m+1))}let u=!1,c=-1;if(n&&r&&r.v7_partialHydration)for(let m=0;m<o.length;m++){let p=o[m];if((p.route.HydrateFallback||p.route.hydrateFallbackElement)&&(c=m),p.route.id){let{loaderData:g,errors:v}=n,y=p.route.loader&&g[p.route.id]===void 0&&(!v||v[p.route.id]===void 0);if(p.route.lazy||y){u=!0,c>=0?o=o.slice(0,c+1):o=[o[0]];break}}}return o.reduceRight((m,p,g)=>{let v,y=!1,w=null,N=null;n&&(v=a&&p.route.id?a[p.route.id]:void 0,w=p.route.errorElement||wh,u&&(c<0&&g===0?(Ih("route-fallback"),y=!0,N=null):c===g&&(y=!0,N=p.route.hydrateFallbackElement||null)));let f=t.concat(o.slice(0,g+1)),d=()=>{let h;return v?h=w:y?h=N:p.route.Component?h=x.createElement(p.route.Component,null):p.route.element?h=p.route.element:h=m,x.createElement(Nh,{match:p,routeContext:{outlet:m,matches:f,isDataRoute:n!=null},children:h})};return n&&(p.route.ErrorBoundary||p.route.errorElement||g===0)?x.createElement(jh,{location:n.location,revalidation:n.revalidation,component:w,error:v,children:d(),routeContext:{outlet:null,matches:f,isDataRoute:!0}}):d()},null)}var qd=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(qd||{}),ef=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(ef||{});function Sh(e){let t=x.useContext(ds);return t||se(!1),t}function Ch(e){let t=x.useContext(Xd);return t||se(!1),t}function bh(e){let t=x.useContext(Xt);return t||se(!1),t}function tf(e){let t=bh(),n=t.matches[t.matches.length-1];return n.route.id||se(!1),n.route.id}function Eh(){var e;let t=x.useContext(Gd),n=Ch(),r=tf();return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function Ph(){let{router:e}=Sh(qd.UseNavigateStable),t=tf(ef.UseNavigateStable),n=x.useRef(!1);return Jd(()=>{n.current=!0}),x.useCallback(function(l,s){s===void 0&&(s={}),n.current&&(typeof l=="number"?e.navigate(l):e.navigate(l,Lr({fromRouteId:t},s)))},[e,t])}const lu={};function Ih(e,t,n){lu[e]||(lu[e]=!0)}function _h(e,t){e==null||e.v7_startTransition,e==null||e.v7_relativeSplatPath}function Oe(e){se(!1)}function Lh(e){let{basename:t="/",children:n=null,location:r,navigationType:l=Tt.Pop,navigator:s,static:o=!1,future:a}=e;Fr()&&se(!1);let u=t.replace(/^\/*/,"/"),c=x.useMemo(()=>({basename:u,navigator:s,static:o,future:Lr({v7_relativeSplatPath:!1},a)}),[u,a,s,o]);typeof r=="string"&&(r=Wn(r));let{pathname:m="/",search:p="",hash:g="",state:v=null,key:y="default"}=r,w=x.useMemo(()=>{let N=An(m,u);return N==null?null:{location:{pathname:N,search:p,hash:g,state:v,key:y},navigationType:l}},[u,m,p,g,v,y,l]);return w==null?null:x.createElement(Yt.Provider,{value:c},x.createElement(fs.Provider,{children:n,value:w}))}function Rh(e){let{children:t,location:n}=e;return gh(Bi(t),n)}new Promise(()=>{});function Bi(e,t){t===void 0&&(t=[]);let n=[];return x.Children.forEach(e,(r,l)=>{if(!x.isValidElement(r))return;let s=[...t,l];if(r.type===x.Fragment){n.push.apply(n,Bi(r.props.children,s));return}r.type!==Oe&&se(!1),!r.props.index||!r.props.children||se(!1);let o={id:r.props.id||s.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(o.children=Bi(r.props.children,s)),n.push(o)}),n}/**
59
+ * React Router DOM v6.30.6
60
+ *
61
+ * Copyright (c) Remix Software Inc.
62
+ *
63
+ * This source code is licensed under the MIT license found in the
64
+ * LICENSE.md file in the root directory of this source tree.
65
+ *
66
+ * @license MIT
67
+ */function Kl(){return Kl=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Kl.apply(null,arguments)}function nf(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function Th(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Mh(e,t){return e.button===0&&(!t||t==="_self")&&!Th(e)}const Oh=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],$h=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"],Fh="6";try{window.__reactRouterVersion=Fh}catch{}const Dh=x.createContext({isTransitioning:!1}),Ah="startTransition",su=Tf[Ah];function zh(e){let{basename:t,children:n,future:r,window:l}=e,s=x.useRef();s.current==null&&(s.current=Hm({window:l,v5Compat:!0}));let o=s.current,[a,u]=x.useState({action:o.action,location:o.location}),{v7_startTransition:c}=r||{},m=x.useCallback(p=>{c&&su?su(()=>u(p)):u(p)},[u,c]);return x.useLayoutEffect(()=>o.listen(m),[o,m]),x.useEffect(()=>_h(r),[r]),x.createElement(Lh,{basename:t,children:n,location:a.location,navigationType:a.action,navigator:o,future:r})}const Uh=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",Bh=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,_e=x.forwardRef(function(t,n){let{onClick:r,relative:l,reloadDocument:s,replace:o,state:a,target:u,to:c,preventScrollReset:m,viewTransition:p}=t,g=nf(t,Oh),{basename:v}=x.useContext(Yt),y,w=!1;if(typeof c=="string"&&Bh.test(c)&&(y=c,Uh))try{let h=new URL(window.location.href),j=c.startsWith("//")?new URL(h.protocol+c):new URL(c),k=An(j.pathname,v);j.origin===h.origin&&k!=null?c=k+j.search+j.hash:w=!0}catch{}let N=hh(c,{relative:l}),f=Hh(c,{replace:o,state:a,target:u,preventScrollReset:m,relative:l,viewTransition:p});function d(h){r&&r(h),h.defaultPrevented||f(h)}return x.createElement("a",Kl({},g,{href:y||N,onClick:w||s?r:d,ref:n,target:u}))}),Wh=x.forwardRef(function(t,n){let{"aria-current":r="page",caseSensitive:l=!1,className:s="",end:o=!1,style:a,to:u,viewTransition:c,children:m}=t,p=nf(t,$h),g=ms(u,{relative:p.relative}),v=Dr(),y=x.useContext(Xd),{navigator:w,basename:N}=x.useContext(Yt),f=y!=null&&Kh(g)&&c===!0,d=w.encodeLocation?w.encodeLocation(g).pathname:g.pathname,h=v.pathname,j=y&&y.navigation&&y.navigation.location?y.navigation.location.pathname:null;l||(h=h.toLowerCase(),j=j?j.toLowerCase():null,d=d.toLowerCase()),j&&N&&(j=An(j,N)||j);const k=d!=="/"&&d.endsWith("/")?d.length-1:d.length;let E=h===d||!o&&h.startsWith(d)&&h.charAt(k)==="/",I=j!=null&&(j===d||!o&&j.startsWith(d)&&j.charAt(d.length)==="/"),L={isActive:E,isPending:I,isTransitioning:f},b=E?r:void 0,_;typeof s=="function"?_=s(L):_=[s,E?"active":null,I?"pending":null,f?"transitioning":null].filter(Boolean).join(" ");let z=typeof a=="function"?a(L):a;return x.createElement(_e,Kl({},p,{"aria-current":b,className:_,ref:n,style:z,to:u,viewTransition:c}),typeof m=="function"?m(L):m)});var Wi;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(Wi||(Wi={}));var iu;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(iu||(iu={}));function Vh(e){let t=x.useContext(ds);return t||se(!1),t}function Hh(e,t){let{target:n,replace:r,state:l,preventScrollReset:s,relative:o,viewTransition:a}=t===void 0?{}:t,u=ps(),c=Dr(),m=ms(e,{relative:o});return x.useCallback(p=>{if(Mh(p,n)){p.preventDefault();let g=r!==void 0?r:Hl(c)===Hl(m);u(e,{replace:g,state:l,preventScrollReset:s,relative:o,viewTransition:a})}},[c,u,m,r,l,n,e,s,o,a])}function Kh(e,t){t===void 0&&(t={});let n=x.useContext(Dh);n==null&&se(!1);let{basename:r}=Vh(Wi.useViewTransitionState),l=ms(e,{relative:t.relative});if(!n.isTransitioning)return!1;let s=An(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=An(n.nextLocation.pathname,r)||n.nextLocation.pathname;return Ui(l.pathname,o)!=null||Ui(l.pathname,s)!=null}const ou="whydid.token",Qh=!1;function rf(){const e=new URLSearchParams(window.location.search).get("token");if(e){try{sessionStorage.setItem(ou,e)}catch{}return e}try{return sessionStorage.getItem(ou)??""}catch{return""}}async function V(e,t){const n=e.includes("?")?"&":"?";let r;try{r=await fetch(`/api${e}${n}token=${rf()}`,{...t,headers:{"content-type":"application/json",...(t==null?void 0:t.headers)??{}}})}catch{throw new Error("Can't reach the whydid daemon — it may have restarted. Try reloading this page, or run `whydid daemon status` in your terminal.")}if(!r.ok){const l=await r.json().catch(()=>({error:r.statusText}));throw new Error(l.error??`Request failed: ${r.status}`)}return r.json()}const Ql=(e={})=>{const t=new URLSearchParams;e.limit!=null&&t.set("limit",String(e.limit)),e.offset!=null&&t.set("offset",String(e.offset)),e.search&&t.set("search",e.search),e.risk&&e.risk!=="all"&&t.set("risk",e.risk);const n=t.toString();return V(`/states${n?`?${n}`:""}`)},Yh=e=>V(`/states/${e}`),au=e=>V(`/recap${e?`?days=${e}`:""}`),lf=()=>V("/continuity"),Xh=(e=14)=>V(`/usage?days=${e}`),Gh=(e,t)=>V(`/states/${e}/diff/${encodeURIComponent(t)}`),Jh=e=>V(`/states/${e}/restore`,{method:"POST"}),Zh=(e,t)=>V(`/states/${e}/restore-files`,{method:"POST",body:JSON.stringify({filePaths:t})}),qh=(e,t)=>V(`/states/${e}/milestone`,{method:"PUT",body:JSON.stringify({label:t})}),ex=(e,t)=>V(`/states/${e}/fork`,{method:"POST",body:JSON.stringify({name:t})}),tx=e=>V(`/files/${encodeURIComponent(e)}/history`),nx=(e,t)=>V(`/files/${encodeURIComponent(e)}/agent-prompt`,{method:"POST",body:JSON.stringify(t)}),sf=()=>V("/project"),rx=()=>V("/config"),of=e=>V("/config",{method:"PUT",body:JSON.stringify(e)}),lx=()=>V("/secrets/status"),sx=(e,t)=>V("/secrets",{method:"PUT",body:JSON.stringify({provider:e,key:t})}),ix=e=>V(`/secrets/${e}`,{method:"DELETE"}),uu=(e={})=>{const t=new URLSearchParams;e.limit!=null&&t.set("limit",String(e.limit)),e.offset!=null&&t.set("offset",String(e.offset));const n=t.toString();return V(`/sessions${n?`?${n}`:""}`)},ox=e=>V(`/sessions/${e}`),ax=e=>`/api/export?format=${e}&token=${rf()}`,af=()=>V("/context"),ux=e=>V(`/context/file?path=${encodeURIComponent(e)}`),uf=(e=14)=>V(`/ai-cost?days=${e}`),cx=()=>V("/pricing/community-status"),dx=()=>V("/pricing/community-refresh",{method:"POST"}),cf=()=>V("/ai-budget"),fx=()=>V("/social-posts"),px=(e,t)=>V("/social-posts/generate",{method:"POST",body:JSON.stringify({sessionId:e,platform:t})}),mx=(e,t)=>V(`/social-posts/${e}/pin`,{method:"POST",body:JSON.stringify({pinned:t})}),hx=e=>V(`/social-posts/${e}`,{method:"DELETE"}),xx=()=>V("/chat/conversations"),cu=()=>V("/chat/conversations",{method:"POST"}),du=e=>V(`/chat/conversations/${e}`),gx=e=>V(`/chat/conversations/${e}`,{method:"DELETE"}),vx=(e,t)=>V(`/chat/conversations/${e}/messages`,{method:"POST",body:JSON.stringify({question:t})});function ut({to:e,children:t,onNavigate:n,dot:r}){return i.jsxs(Wh,{to:e,end:e==="/",onClick:n,className:({isActive:l})=>`flex items-center gap-2 px-3 py-2 rounded-md text-sm font-mono transition-colors ${l?"bg-iron-raised text-amber":"text-paper-dim hover:text-paper hover:bg-iron-raised"}`,children:[i.jsx("span",{className:"flex-1",children:t}),r&&i.jsx("span",{className:`w-1.5 h-1.5 rounded-full flex-shrink-0 ${r==="exceeded"?"bg-danger":"bg-amber"}`,title:r==="exceeded"?"Monthly AI budget exceeded":r==="warning"?"Approaching monthly AI budget":"A coding session's context was auto-compacted — check Continuity"})]})}function yx({children:e}){const[t,n]=x.useState(null),[r,l]=x.useState(!1),[s,o]=x.useState(!1),[a,u]=x.useState(null),[c,m]=x.useState(!1);x.useEffect(()=>{sf().then(n).catch(()=>n(null))},[]),x.useEffect(()=>{let g=!1;function v(){cf().then(w=>!g&&u(w)).catch(()=>{})}v();const y=setInterval(v,5*60*1e3);return()=>{g=!0,clearInterval(y)}},[]),x.useEffect(()=>{let g=!1;function v(){lf().then(w=>!g&&m(w.resumes.length>0)).catch(()=>{})}v();const y=setInterval(v,5*60*1e3);return()=>{g=!0,clearInterval(y)}},[]);const p=(a==null?void 0:a.status)==="exceeded"?"exceeded":(a==null?void 0:a.status)==="warning"?"warning":void 0;return i.jsxs("div",{className:"h-screen flex overflow-hidden",children:[s&&i.jsx("div",{className:"fixed inset-0 z-30 bg-black/50 md:hidden",onClick:()=>o(!1),"aria-hidden":"true"}),i.jsxs("aside",{className:`w-56 flex-shrink-0 border-r border-iron-line bg-iron flex flex-col h-screen fixed inset-y-0 left-0 z-40 transition-transform duration-200 md:static md:translate-x-0 ${s?"translate-x-0":"-translate-x-full"}`,children:[i.jsxs("div",{className:"px-4 py-5 border-b border-iron-line flex items-center justify-between",children:[i.jsxs("div",{children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("img",{src:"/logo-mark.svg",alt:"",width:20,height:20,className:"rounded-[5px]"}),i.jsxs("div",{className:"font-display text-base tracking-wide",children:["why",i.jsx("span",{className:"text-amber",children:"did"})]})]}),i.jsx("div",{className:"text-xs font-mono text-paper-faint mt-1 truncate",title:t==null?void 0:t.name,children:(t==null?void 0:t.name)??"…"})]}),i.jsx("button",{className:"md:hidden text-paper-dim hover:text-paper text-lg leading-none px-1",onClick:()=>o(!1),"aria-label":"Close menu",children:"✕"})]}),i.jsxs("nav",{className:"flex-1 p-3 space-y-1 overflow-y-auto",children:[i.jsx(ut,{to:"/",onNavigate:()=>o(!1),children:"Home"}),i.jsx(ut,{to:"/timeline",onNavigate:()=>o(!1),children:"Timeline"}),i.jsx(ut,{to:"/graph",onNavigate:()=>o(!1),children:"Graph"}),i.jsx(ut,{to:"/sessions",onNavigate:()=>o(!1),children:"Sessions"}),i.jsx(ut,{to:"/context",onNavigate:()=>o(!1),children:"Context"}),i.jsx(ut,{to:"/continuity",onNavigate:()=>o(!1),dot:c?"info":void 0,children:"Continuity"}),i.jsx(ut,{to:"/ai-usage",onNavigate:()=>o(!1),dot:p,children:"AI Usage"}),i.jsx(ut,{to:"/build-in-public",onNavigate:()=>o(!1),children:"Build in Public"}),i.jsx(ut,{to:"/chat",onNavigate:()=>o(!1),children:"Chat"}),i.jsx(ut,{to:"/settings",onNavigate:()=>o(!1),children:"Settings"})]}),i.jsxs("div",{className:"p-3 border-t border-iron-line relative",children:[i.jsxs(i.Fragment,{children:[i.jsx("button",{className:"w-full text-left px-3 py-2 rounded-md text-sm font-mono text-paper-dim hover:text-amber hover:bg-iron-raised transition-colors",onClick:()=>l(g=>!g),children:"↓ Export"}),r&&i.jsx("div",{className:"absolute bottom-full left-3 mb-1 w-40 bg-iron-raised border border-iron-line rounded-md overflow-hidden shadow-xl",children:["json","markdown","html"].map(g=>i.jsx("a",{href:ax(g),className:"block px-3 py-2 text-xs font-mono text-paper-dim hover:text-amber hover:bg-iron",onClick:()=>l(!1),children:g},g))})]}),i.jsx("div",{className:"text-[10px] font-mono text-paper-faint px-3 mt-2",children:"local · offline · BYOK"})]})]}),i.jsxs("div",{className:"flex-1 min-w-0 flex flex-col h-screen overflow-hidden",children:[Qh,i.jsxs("div",{className:"md:hidden flex items-center gap-3 px-4 py-3 border-b border-iron-line bg-iron flex-shrink-0",children:[i.jsx("button",{className:"text-paper-dim hover:text-paper text-lg leading-none px-1",onClick:()=>o(!0),"aria-label":"Open menu",children:"☰"}),i.jsx("img",{src:"/logo-mark.svg",alt:"",width:18,height:18,className:"rounded-[4px]"}),i.jsxs("div",{className:"font-display text-sm tracking-wide",children:["why",i.jsx("span",{className:"text-amber",children:"did"})]})]}),i.jsx("main",{className:"flex-1 min-h-0 overflow-y-auto",children:e})]})]})}function St(e){const t=Date.now()-new Date(e).getTime(),n=Math.round(t/6e4);if(n<1)return"just now";if(n<60)return`${n}m ago`;const r=Math.round(n/60);return r<24?`${r}h ago`:`${Math.round(r/24)}d ago`}function nl({label:e,value:t,accent:n}){const r=n==="amber"?"text-amber":n==="danger"?"text-danger":n==="scope"?"text-scope":"text-paper";return i.jsxs("div",{className:"flex-1 min-w-[120px]",children:[i.jsx("div",{className:`font-mono text-2xl font-semibold tabular-nums ${r}`,children:t}),i.jsx("div",{className:"font-mono text-[10px] uppercase tracking-wider text-paper-faint mt-1",children:e})]})}function df({recap:e,title:t="Today's recap",changesLabel:n="Changes today"}){return i.jsxs("div",{className:"bg-iron-raised border border-iron-line rounded-xl px-6 py-5",children:[i.jsx("div",{className:"font-mono text-[10px] uppercase tracking-wider text-amber-dim mb-4",children:t}),i.jsxs("div",{className:"flex flex-wrap gap-6",children:[i.jsx(nl,{label:n,value:String(e.totalChanges)}),i.jsx(nl,{label:"Explained by AI",value:`${Math.max(e.totalChanges-e.unexplainedChanges,0)}/${e.totalChanges}`,accent:e.unexplainedChanges>0?"amber":"scope"}),i.jsx(nl,{label:"Risky areas flagged",value:String(e.riskyAreas.length),accent:e.riskyAreas.length>0?"danger":"scope"}),e.latestTestRun&&i.jsx(nl,{label:"Last test run",value:e.latestTestRun.status==="passed"?"PASS":"FAIL",accent:e.latestTestRun.status==="passed"?"scope":"danger"})]}),(e.mainAreas.length>0||e.highChurnFiles.length>0)&&i.jsxs("div",{className:"mt-4 pt-4 border-t border-iron-line flex flex-wrap gap-x-8 gap-y-2 text-sm",children:[e.mainAreas.length>0&&i.jsxs("div",{className:"text-paper-dim",children:[i.jsx("span",{className:"text-paper-faint",children:"Main areas: "}),e.mainAreas.join(", ")]}),e.highChurnFiles.length>0&&i.jsxs("div",{className:"text-paper-dim font-mono text-xs",children:[i.jsx("span",{className:"font-body text-paper-faint",children:"High churn: "}),e.highChurnFiles.slice(0,3).map(r=>`${r.filePath} (${r.changes})`).join(", ")]})]})]})}function zo({value:e,size:t="md"}){const n=String(e).split(""),r=t==="lg"?"w-9 h-11 text-2xl":"w-6 h-8 text-base";return i.jsx("div",{className:"flex gap-[3px]",children:n.map((l,s)=>i.jsx("span",{className:`${r} flex items-center justify-center rounded border border-iron-line bg-[#100d0a] font-mono font-semibold text-amber tabular-nums`,style:{textShadow:"0 0 6px rgba(255,154,61,0.38), 0 0 16px rgba(255,154,61,0.38)"},children:l===" "?" ":l},s))})}const pn=600,Zn=130,We={top:14,right:10,bottom:20,left:10};function Ws(e){return new Date(`${e}T00:00:00Z`).toLocaleDateString(void 0,{month:"short",day:"numeric",timeZone:"UTC"})}function ff({data:e}){const t=pn-We.left-We.right,n=Zn-We.top-We.bottom,r=Math.max(1,...e.map(v=>v.count)),l=x.useMemo(()=>e.map((v,y)=>({x:We.left+(e.length===1?t/2:y/(e.length-1)*t),y:We.top+n-v.count/r*n,date:v.date,count:v.count})),[e,r,t,n]),s=l.map((v,y)=>`${y===0?"M":"L"} ${v.x.toFixed(1)} ${v.y.toFixed(1)}`).join(" "),o=We.top+n,a=l.length>0?`${s} L ${l[l.length-1].x.toFixed(1)} ${o} L ${l[0].x.toFixed(1)} ${o} Z`:"",[u,c]=x.useState(null),m=x.useRef(null);function p(v){const y=m.current.getBoundingClientRect(),w=(v.clientX-y.left)/y.width*pn;let N=0,f=1/0;l.forEach((d,h)=>{const j=Math.abs(d.x-w);j<f&&(f=j,N=h)}),c(N)}const g=u!=null?l[u]:null;return e.length===0?i.jsx("div",{className:"text-sm text-paper-faint py-8 text-center",children:"No activity yet."}):i.jsxs("div",{className:"relative",children:[i.jsxs("svg",{ref:m,viewBox:`0 0 ${pn} ${Zn}`,className:"block w-full h-auto cursor-crosshair",onMouseMove:p,onMouseLeave:()=>c(null),children:[i.jsx("line",{x1:We.left,y1:o,x2:pn-We.right,y2:o,stroke:"#3a332a",strokeWidth:1}),i.jsx("path",{d:a,fill:"rgba(255,154,61,0.12)",stroke:"none"}),i.jsx("path",{d:s,fill:"none",stroke:"#ff9a3d",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),g&&i.jsxs(i.Fragment,{children:[i.jsx("line",{x1:g.x,y1:We.top,x2:g.x,y2:o,stroke:"#55493a",strokeWidth:1,strokeDasharray:"2 2"}),i.jsx("circle",{cx:g.x,cy:g.y,r:4,fill:"#ff9a3d",stroke:"#1b1815",strokeWidth:1.5})]}),i.jsx("text",{x:We.left,y:Zn-5,fontSize:"9",fontFamily:"IBM Plex Mono, monospace",fill:"#766a58",children:Ws(e[0].date)}),i.jsx("text",{x:pn-We.right,y:Zn-5,fontSize:"9",fontFamily:"IBM Plex Mono, monospace",fill:"#766a58",textAnchor:"end",children:Ws(e[e.length-1].date)})]}),g&&i.jsxs("div",{className:"absolute pointer-events-none bg-iron border border-iron-line rounded-md px-2 py-1 text-xs font-mono shadow-xl -translate-x-1/2",style:{left:`${g.x/pn*100}%`,top:`${Math.max(0,g.y/Zn*100-16)}%`},children:[i.jsx("div",{className:"text-paper-faint",children:Ws(g.date)}),i.jsxs("div",{className:"text-amber font-semibold",children:[g.count," checkpoint",g.count===1?"":"s"]})]})]})}const wx={low:-60,medium:0,high:60},jx={low:"text-scope",medium:"text-amber",high:"text-danger"};function Nx({level:e}){return i.jsxs("div",{className:"flex items-end gap-3.5",children:[i.jsxs("div",{className:"w-[70px] h-[38px] rounded-t-full relative overflow-hidden flex-shrink-0",style:{background:"conic-gradient(from 270deg at 50% 100%, #63e6a3 0deg 60deg, #ff9a3d 60deg 120deg, #ff6b57 120deg 180deg)"},children:[i.jsx("div",{className:"absolute inset-[5px_5px_0_5px] bg-iron-raised rounded-t-full"}),i.jsx("div",{className:"absolute bottom-0 left-1/2 w-[2px] h-[30px] bg-paper origin-bottom",style:{transform:`translateX(-50%) rotate(${wx[e]}deg)`}})]}),i.jsx("span",{className:`font-mono text-sm font-semibold tracking-wide ${jx[e]}`,children:e.toUpperCase()})]})}const kx={low:"bg-scope/15 text-scope border-scope/30",medium:"bg-amber/15 text-amber border-amber/30",high:"bg-danger/15 text-danger border-danger/30"};function Uo({level:e}){return e?i.jsxs("span",{className:`inline-flex items-center gap-1 px-2 py-0.5 rounded-full border text-[10px] font-mono uppercase tracking-wider ${kx[e]}`,children:[e," risk"]}):null}const Sx={low:()=>"Everything this week is tracked and explained. Safe to keep building on top of it.",medium:e=>`${e.unexplainedChanges} change${e.unexplainedChanges===1?"":"s"} this week ${e.unexplainedChanges===1?"hasn't":"haven't"} gotten an AI explanation yet — nothing risky flagged, just unreviewed.`,high:e=>`${e.riskyAreas.length} area${e.riskyAreas.length===1?"":"s"} flagged risky this week — worth a look before building further on top.`};function Cx(e){return e?Math.max(1,Math.round((Date.now()-new Date(e).getTime())/864e5)):0}function bx(){const[e,t]=x.useState(null),[n,r]=x.useState(null),[l,s]=x.useState(null),[o,a]=x.useState(null),[u,c]=x.useState(null),[m,p]=x.useState(null),[g,v]=x.useState(null),[y,w]=x.useState(null);if(x.useEffect(()=>{Promise.all([au(),au(7),Xh(14),Ql({limit:5}),sf(),af(),uf()]).then(([d,h,j,k,E,I,L])=>{t(d),r(h),s(j),a(k.states),c(E),p(I),v(L)}).catch(d=>w(d instanceof Error?d.message:"Failed to load your dashboard"))},[]),y)return i.jsx("div",{className:"p-8 text-danger",children:y});if(!e||!n||!l||!o||!u||!m||!g)return i.jsx("div",{className:"p-8 text-paper-dim",children:"Loading…"});const N=n.riskyAreas.length>0?"high":n.unexplainedChanges>0?"medium":"low",f=Cx(l.projectCreatedAt);return i.jsxs("div",{className:"max-w-3xl mx-auto p-4 sm:p-8 space-y-6",children:[i.jsxs("div",{children:[i.jsx("h1",{className:"text-2xl font-semibold text-paper mb-1",children:u.name}),i.jsx("p",{className:"text-sm text-paper-faint",children:"Here's where things stand."})]}),i.jsxs("section",{className:"bg-iron-raised border border-iron-line rounded-xl p-5",children:[i.jsx("div",{className:"text-[11px] font-mono uppercase tracking-wider text-amber-dim mb-3",children:"This week's health"}),i.jsxs("div",{className:"flex items-center gap-5",children:[i.jsx(Nx,{level:N}),i.jsx("p",{className:"text-sm text-paper leading-relaxed flex-1",children:Sx[N](n)})]})]}),i.jsx(df,{recap:e}),i.jsxs("section",{className:"bg-iron-raised border border-iron-line rounded-xl p-5",children:[i.jsx("div",{className:"text-[11px] font-mono uppercase tracking-wider text-amber-dim mb-4",children:"Progress so far"}),i.jsxs("div",{className:"flex flex-wrap items-end gap-8",children:[i.jsxs("div",{children:[i.jsx(zo,{value:l.totalCheckpoints,size:"lg"}),i.jsx("div",{className:"text-[10px] font-mono uppercase tracking-wider text-paper-faint mt-1.5",children:"Checkpoints captured"})]}),i.jsxs("div",{children:[i.jsx("div",{className:"font-mono text-xl font-semibold text-paper tabular-nums",children:l.totalSessions}),i.jsx("div",{className:"text-[10px] font-mono uppercase tracking-wider text-paper-faint mt-1",children:"AI sessions"})]}),i.jsxs("div",{children:[i.jsx("div",{className:"font-mono text-xl font-semibold text-paper tabular-nums",children:f}),i.jsx("div",{className:"text-[10px] font-mono uppercase tracking-wider text-paper-faint mt-1",children:"Days protected"})]}),i.jsxs(_e,{to:"/context",className:"group",children:[i.jsx("div",{className:"font-mono text-xl font-semibold text-paper tabular-nums group-hover:text-amber transition-colors",children:m.length}),i.jsx("div",{className:"text-[10px] font-mono uppercase tracking-wider text-paper-faint mt-1 group-hover:text-amber transition-colors",children:"Areas documented for AI hand-off →"})]}),i.jsxs(_e,{to:"/ai-usage",className:"group",children:[i.jsx("div",{className:"font-mono text-xl font-semibold text-paper tabular-nums group-hover:text-amber transition-colors",children:g.totalEstimatedCostUsd!=null?`$${g.totalEstimatedCostUsd.toFixed(2)}`:"—"}),i.jsx("div",{className:"text-[10px] font-mono uppercase tracking-wider text-paper-faint mt-1 group-hover:text-amber transition-colors",children:"Estimated AI spend →"})]})]})]}),i.jsxs("section",{className:"bg-[rgba(0,0,0,0.28)] border border-iron-line rounded-xl p-4 pt-4",children:[i.jsx("div",{className:"text-[11px] font-mono uppercase tracking-wider text-paper-faint px-2 mb-2",children:"AI activity · last 14 days"}),i.jsx(ff,{data:l.daily})]}),i.jsxs("section",{children:[i.jsxs("div",{className:"flex items-center justify-between mb-2",children:[i.jsx("h2",{className:"text-[11px] font-mono uppercase tracking-wider text-paper-faint",children:"Recent activity"}),i.jsx(_e,{to:"/timeline",className:"text-xs font-mono text-paper-faint hover:text-amber",children:"View full history →"})]}),i.jsx("div",{className:"divide-y divide-iron-line border border-iron-line rounded-lg overflow-hidden",children:o.length===0?i.jsx("div",{className:"p-4 text-sm text-paper-faint",children:"No checkpoints yet — start editing this project with your AI coding agent running."}):o.map(d=>{var j,k;const h=((j=d.annotation)==null?void 0:j.status)==="generated";return i.jsxs(_e,{to:`/state/${d.id}`,className:"flex items-center gap-3 px-4 py-3 hover:bg-iron-raised transition-colors",children:[i.jsxs("div",{className:"flex-1 min-w-0",children:[i.jsx("div",{className:"text-sm text-paper truncate",children:h?d.annotation.summary:d.label??d.stateType}),i.jsxs("div",{className:"text-[11px] font-mono text-paper-faint mt-0.5",children:[St(d.createdAt)," · ",d.fileCount," file",d.fileCount===1?"":"s"]})]}),i.jsx(Uo,{level:((k=d.annotation)==null?void 0:k.riskLevel)??d.riskLevel})]},d.id)})})]})]})}const fu=["#ff9a3d","#63e6a3","#7aa2ff","#ff7ab8","#c97425"];function pf(e){const t=new Map(e.map(a=>[a.id,a])),n=[...e].sort((a,u)=>a.createdAt.localeCompare(u.createdAt)),r=new Map,l=new Map;let s=0;for(const a of n){if(!a.parentStateId||!t.has(a.parentStateId)){r.set(a.id,s++);continue}const u=r.get(a.parentStateId);if(u===void 0){r.set(a.id,s++);continue}l.get(a.parentStateId)?r.set(a.id,s++):(l.set(a.parentStateId,a.id),r.set(a.id,u))}const o=new Map;for(const a of e){const u=r.get(a.id)??0,c=a.parentStateId?r.get(a.parentStateId)??null:null;o.set(a.id,{id:a.id,lane:u,parentLane:c,isBranchPoint:c!==null&&c!==u})}return o}function vt(e){return fu[e%fu.length]}function Ex(e){const t=pf(e),n=new Map(e.map((o,a)=>[o.id,a])),r=new Map,l=new Map;e.forEach((o,a)=>{const u=t.get(o.id).lane;r.set(u,Math.min(r.get(u)??a,a)),l.set(u,Math.max(l.get(u)??a,a))});const s=new Map(l);for(const[o,a]of l){const u=e[a],c=u.parentStateId?n.get(u.parentStateId):void 0;c!==void 0&&s.set(o,Math.max(a,c))}return e.map((o,a)=>{const u=t.get(o.id),c=[];for(const m of r.keys()){const p=r.get(m),g=s.get(m);a>=p&&a<=g&&c.push(m)}return{lane:u.lane,activeLanes:c,branch:u.isBranchPoint?{fromLane:u.lane,toLane:u.parentLane}:null}})}function Px(e){const t=new Set(e.map(r=>r.id)),n=[];for(const r of e)r.parentStateId&&t.has(r.parentStateId)&&n.push({fromId:r.id,toId:r.parentStateId});return n}function Ix(e,t){var u,c,m;const n=new Map(e.map(p=>[p.id,p])),r=new Map(t.map(p=>[p.fromId,p.toId])),l=new Map;for(const p of t){const g=l.get(p.toId);g?g.push(p.fromId):l.set(p.toId,[p.fromId])}const s=new Set;for(const p of e){const g=((u=l.get(p.id))==null?void 0:u.length)??0,v=r.get(p.id),y=v?((c=l.get(v))==null?void 0:c.length)??0:0,w=((m=p.annotation)==null?void 0:m.riskLevel)??p.riskLevel,N=!v,f=g===0,d=g>=2,h=y>=2,j=p.milestoneLabel!=null;(N||f||d||h||j||w==="high")&&s.add(p.id)}const o=[],a=[];for(const p of e){if(!s.has(p.id))continue;const g=r.get(p.id);if(!g||!n.has(g))continue;if(s.has(g)){o.push({fromId:p.id,toId:g});continue}const v=[];let y=g;for(;y&&n.has(y)&&!s.has(y);)v.push(y),y=r.get(y);y&&s.has(y)&&a.push({fromId:p.id,toId:y,hiddenIds:v})}return{visibleIds:s,directEdges:o,segments:a}}const _x=3*60*1e3;function Lx(e){var n;const t=((n=e.annotation)==null?void 0:n.riskLevel)??e.riskLevel;return e.milestoneLabel!=null||t==="high"||e.resumedFromCompaction||e.stateType!=="checkpoint"}function Rx(e,t={}){const n=t.burstWindowMs??_x,r=[];for(let l=0;l<e.length;l++){const s=e[l],o=r[r.length-1];if(o&&!Lx(s)){const a=o.memberIndices.length>0?o.memberIndices[o.memberIndices.length-1]:o.headIndex;if(new Date(e[a].createdAt).getTime()-new Date(s.createdAt).getTime()<=n){o.memberIndices.push(l);continue}}r.push({headIndex:l,memberIndices:[]})}return r}const pu=18,mu=14;function hu({row:e,laneCount:t}){const n=mu*2+pu*Math.max(t-1,0)+4,r=l=>mu+l*pu;return i.jsxs("svg",{width:n,className:"h-full flex-shrink-0",viewBox:`0 0 ${n} 100`,preserveAspectRatio:"none","aria-hidden":"true",children:[e.activeLanes.map(l=>i.jsx("line",{x1:r(l),x2:r(l),y1:0,y2:100,stroke:vt(l),strokeWidth:2,opacity:l===e.lane?1:.45},l)),e.branch&&i.jsx("path",{d:`M ${r(e.branch.fromLane)} 0 C ${r(e.branch.fromLane)} 45, ${r(e.branch.toLane)} 55, ${r(e.branch.toLane)} 100`,fill:"none",stroke:vt(e.branch.fromLane),strokeWidth:2}),i.jsx("circle",{cx:r(e.lane),cy:50,r:5,fill:vt(e.lane)}),i.jsx("circle",{cx:r(e.lane),cy:50,r:8,fill:"none",stroke:vt(e.lane),strokeWidth:1,opacity:.35})]})}const xu=30,gu={initial:"Initial state",checkpoint:"Checkpoint",restore:"Restored",fork:"Forked",manual:"Manual checkpoint"},Tx=[{value:"all",label:"All risk"},{value:"high",label:"High"},{value:"medium",label:"Medium"},{value:"low",label:"Low"}];function Mx(e){return e.stateType==="checkpoint"&&e.fileCount===0&&(e.label==="Before restore"||e.label==="Before fork")}function Ox(){const[e,t]=x.useState(null),[n,r]=x.useState(0),[l,s]=x.useState(!1),[o,a]=x.useState(null),[u,c]=x.useState(""),[m,p]=x.useState(""),[g,v]=x.useState("all"),[y,w]=x.useState(new Set),N=x.useRef(0);x.useEffect(()=>{const b=setTimeout(()=>p(u.trim()),300);return()=>clearTimeout(b)},[u]),x.useEffect(()=>{const b=++N.current;t(null),Ql({limit:xu,offset:0,search:m||void 0,risk:g}).then(({states:_,total:z})=>{N.current===b&&(t(_),r(z))}).catch(_=>a(_ instanceof Error?_.message:"Failed to load checkpoints"))},[m,g]);async function f(){if(!(!e||l)){s(!0);try{const{states:b,total:_}=await Ql({limit:xu,offset:e.length,search:m||void 0,risk:g});t([...e,...b]),r(_)}catch(b){a(b instanceof Error?b.message:"Failed to load more checkpoints")}finally{s(!1)}}}const d=m!==""||g!=="all",h=x.useMemo(()=>e&&!d?Ex(e):[],[e,d]),j=x.useMemo(()=>new Set(h.flatMap(b=>b.activeLanes)).size||1,[h]),k=x.useMemo(()=>e&&!d?Rx(e):null,[e,d]);if(x.useEffect(()=>{w(new Set)},[m,g]),o)return i.jsx("div",{className:"p-8 text-danger",children:o});if(!e)return i.jsx("div",{className:"p-8 text-paper-dim",children:"Loading…"});const E=e.length<n;function I({s:b,i:_}){var J;const z=b.annotation,X=(z==null?void 0:z.status)==="generated";return i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"flex items-center gap-2 text-[11px] font-mono text-paper-faint mb-1.5",children:[_===0&&!d&&i.jsx("span",{className:"text-scope font-semibold",style:{textShadow:"0 0 8px rgba(99,230,163,0.5)"},children:"● CURRENT"}),i.jsx("span",{children:St(b.createdAt)}),i.jsx("span",{className:"text-iron-line",children:"·"}),i.jsxs("span",{children:["#",b.id.slice(0,8)]}),b.stateType!=="checkpoint"&&b.stateType!=="initial"&&i.jsx("span",{className:"px-1.5 py-0.5 rounded border border-iron-line",style:{color:d?void 0:vt(((J=h[_])==null?void 0:J.lane)??0)},children:gu[b.stateType]??b.stateType}),b.resumedFromCompaction&&i.jsx("span",{className:"px-1.5 py-0.5 rounded border border-amber-dim text-amber whitespace-nowrap",title:"Made right after the coding agent's own conversation context was auto-compacted and the session continued",children:"↺ resumed"})]}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("div",{className:"font-medium text-paper leading-snug",children:X?z.summary:b.label??gu[b.stateType]??b.stateType}),b.milestoneLabel&&i.jsxs("span",{className:"text-[10px] font-mono px-1.5 py-0.5 rounded border border-amber-dim text-amber whitespace-nowrap",children:["★ ",b.milestoneLabel]})]}),X&&z.reason&&i.jsx("p",{className:"text-sm text-paper-dim mt-1 leading-relaxed",children:z.reason}),!X&&i.jsx("p",{className:"text-xs text-paper-faint mt-1 italic",children:(z==null?void 0:z.status)==="failed"?"AI annotation failed — checkpoint still saved.":"No AI explanation available."}),i.jsxs("div",{className:"flex items-center gap-3 mt-2.5",children:[i.jsxs("span",{className:"text-xs font-mono text-paper-faint",children:[b.fileCount," file",b.fileCount===1?"":"s"," · ",i.jsxs("span",{className:"text-scope",children:["+",b.linesAdded]})," ",i.jsxs("span",{className:"text-danger",children:["-",b.linesRemoved]})]}),i.jsx(Uo,{level:(z==null?void 0:z.riskLevel)??b.riskLevel})]})]})}function L({i:b}){const _=e[b];return Mx(_)?i.jsxs("div",{className:"flex items-stretch group",children:[i.jsx(hu,{row:h[b],laneCount:j}),i.jsxs(_e,{to:`/state/${_.id}`,className:"flex-1 flex items-center gap-2 py-1.5 pl-2 pr-4 border-b border-iron-line group-hover:bg-iron-raised transition-colors text-xs font-mono text-paper-faint",children:[i.jsx("span",{children:St(_.createdAt)}),i.jsx("span",{className:"text-iron-line",children:"·"}),i.jsxs("span",{children:["#",_.id.slice(0,8)]}),i.jsx("span",{className:"text-iron-line",children:"·"}),i.jsxs("span",{className:"italic",children:[_.label," — safety snapshot, no changes"]})]})]}):i.jsxs("div",{className:"flex items-stretch group",children:[i.jsx(hu,{row:h[b],laneCount:j}),i.jsx(_e,{to:`/state/${_.id}`,className:"flex-1 block py-4 pl-2 pr-4 border-b border-iron-line group-hover:bg-iron-raised transition-colors rounded-md",children:i.jsx(I,{s:_,i:b})})]})}return i.jsxs("div",{className:"max-w-3xl mx-auto p-4 sm:p-8 space-y-6",children:[i.jsxs("div",{children:[i.jsx("h1",{className:"text-2xl font-semibold text-paper mb-1",children:"Full history"}),i.jsx("p",{className:"text-sm text-paper-faint",children:"Every checkpoint whydid has captured for this project, oldest branches included."})]}),i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("input",{className:"flex-1 bg-iron-raised border border-iron-line rounded-md px-3 py-2 text-sm text-paper outline-none focus:border-amber-dim placeholder:text-paper-faint",placeholder:"Search summaries, reasons, state ids…",value:u,onChange:b=>c(b.target.value)}),i.jsx("div",{className:"flex gap-1",children:Tx.map(b=>i.jsx("button",{className:`px-2.5 py-1.5 rounded-md text-xs font-mono border transition-colors ${g===b.value?"bg-amber text-iron border-amber font-semibold":"border-iron-line text-paper-faint hover:text-paper"}`,onClick:()=>v(b.value),children:b.label},b.value))})]}),d&&i.jsxs("div",{className:"text-xs font-mono text-paper-faint",children:[n," checkpoint",n===1?"":"s"," match"]}),d?e.length===0?i.jsx("div",{className:"text-sm text-paper-faint p-6 text-center border border-iron-line rounded-lg",children:"No checkpoints match your search."}):i.jsx("div",{className:"space-y-0",children:e.map((b,_)=>i.jsx(_e,{to:`/state/${b.id}`,className:"block py-4 px-3 border-b border-iron-line hover:bg-iron-raised transition-colors rounded-md",children:i.jsx(I,{s:b,i:_})},b.id))}):i.jsx("div",{className:"space-y-0",children:k.map(b=>{const _=e[b.headIndex],z=y.has(b.headIndex),X=b.memberIndices.length;return i.jsxs("div",{children:[i.jsx(L,{i:b.headIndex}),X>0&&(z?b.memberIndices.map(J=>i.jsx(L,{i:J},e[J].id)):i.jsxs("button",{className:"w-full flex items-center gap-2 pl-2 pr-4 py-2 border-b border-iron-line text-xs font-mono text-paper-faint hover:text-amber hover:bg-iron-raised transition-colors text-left",onClick:()=>w(J=>new Set(J).add(b.headIndex)),children:[i.jsx("span",{className:"w-6 flex justify-center text-iron-line",children:"⋮"}),i.jsxs("span",{children:["+",X," more checkpoint",X===1?"":"s"," in the ",X===1?"moments":"minutes"," before — click to expand"]})]}))]},_.id)})}),E&&i.jsx("div",{className:"flex justify-center pt-2",children:i.jsx("button",{className:"px-4 py-2 rounded-md border border-iron-line text-sm text-paper-dim hover:text-amber hover:border-amber-dim transition-colors disabled:opacity-50",onClick:f,disabled:l,children:l?"Loading…":`Load more (${n-e.length} remaining)`})})]})}const qn={repulsion:12e3,linkDistance:110,linkStrength:.09,centerStrength:.015,damping:.82};function vu(e,t,n){const r=new Map,l=t/2,s=n/2,o=Math.PI*(3-Math.sqrt(5));return e.forEach((a,u)=>{const c=14*Math.sqrt(u+1),m=u*o;r.set(a,{id:a,x:l+c*Math.cos(m),y:s+c*Math.sin(m),vx:0,vy:0,fx:null,fy:null})}),r}function $x(e,t,n,r){const l=r.repulsion??qn.repulsion,s=r.linkDistance??qn.linkDistance,o=r.linkStrength??qn.linkStrength,a=r.centerStrength??qn.centerStrength,u=r.damping??qn.damping,c=[...e.values()];for(let v=0;v<c.length;v++)for(let y=v+1;y<c.length;y++){const w=c[v],N=c[y];let f=w.x-N.x,d=w.y-N.y,h=f*f+d*d;h<1e-4&&(f=.1,d=0,h=.01);const j=Math.sqrt(h),k=l*n/h,E=f/j*k,I=d/j*k;w.vx+=E,w.vy+=I,N.vx-=E,N.vy-=I}for(const v of t){const y=e.get(v.fromId),w=e.get(v.toId);if(!y||!w)continue;const N=w.x-y.x,f=w.y-y.y,d=Math.sqrt(N*N+f*f)||.01,h=(d-s)*o*n,j=N/d*h,k=f/d*h;y.vx+=j,y.vy+=k,w.vx-=j,w.vy-=k}const m=r.width/2,p=r.height/2;for(const v of c)v.vx+=(m-v.x)*a*n,v.vy+=(p-v.y)*a*n;for(const v of c)v.fx!=null?(v.x=v.fx,v.vx=0):(v.vx*=u,v.x+=v.vx),v.fy!=null?(v.y=v.fy,v.vy=0):(v.vy*=u,v.y+=v.vy);const g=Math.max(r.width,r.height)*1.5;for(const v of c){if(v.fx!=null||v.fy!=null)continue;const y=v.x-m,w=v.y-p,N=Math.sqrt(y*y+w*w);if(N>g){const f=g/N;v.x=m+y*f,v.y=p+w*f}}}const Fx=200,rl=1e3,ll=700,yu=7,Dx=.97,Ax=.001,wu=.6,zx=4,ju=.25,Nu=3,ku={low:"#63e6a3",medium:"#ff9a3d",high:"#ff6b57"},sl="#ffe066";function Vs(e){return`${e.fromId}::${e.toId}`}function Su(e,t){return{x:t.x+e.x*t.k,y:t.y+e.y*t.k}}function Cu(e,t){try{e.setPointerCapture(t)}catch{}}function Ux(){var Bo,Wo;const e=ps(),t=x.useRef(null),[n,r]=x.useState(null),[l,s]=x.useState(0),[o,a]=x.useState(null),[,u]=x.useState(0),[c,m]=x.useState({x:0,y:0,k:1}),[p,g]=x.useState(null),[v,y]=x.useState(new Set),w=x.useRef(null),N=x.useRef([]),f=x.useRef(1),d=x.useRef(null),h=x.useRef(!1),j=x.useRef(null),k=x.useRef(null);x.useEffect(()=>{Ql({limit:Fx}).then(({states:P,total:M})=>{r(P),s(M)}).catch(P=>a(P instanceof Error?P.message:"Failed to load the state graph"))},[]);const E=x.useMemo(()=>n?Px(n):[],[n]),I=x.useMemo(()=>n?pf(n):new Map,[n]),L=x.useMemo(()=>new Map((n??[]).map(P=>[P.id,P])),[n]),b=x.useMemo(()=>n?Ix(n,E):null,[n,E]),_=x.useMemo(()=>{if(!b)return null;const P=new Set(b.visibleIds),M=[...b.directEdges],F=[];for(const W of b.segments)if(v.has(Vs(W))){const K=[W.fromId,...W.hiddenIds,W.toId];for(const ie of K)P.add(ie);for(let ie=0;ie<K.length-1;ie++)M.push({fromId:K[ie],toId:K[ie+1]})}else F.push(W);return{visibleIds:P,edges:M,segments:F}},[b,v]),z=x.useMemo(()=>n&&_?n.filter(P=>_.visibleIds.has(P.id)):[],[n,_]);x.useEffect(()=>{N.current=(_==null?void 0:_.edges)??[]},[_]);function X(){d.current!=null&&(cancelAnimationFrame(d.current),d.current=null)}function J(){if(d.current!=null)return;const P=()=>{const M=w.current;M&&(f.current>Ax?($x(M,N.current,f.current,{width:rl,height:ll}),f.current*=Dx,u(F=>F+1),!h.current&&f.current<.15&&(h.current=!0,Me(M)),d.current=requestAnimationFrame(P)):d.current=null)};d.current=requestAnimationFrame(P)}function Me(P){const M=t.current;if(!M||P.size===0)return;const F=[...P.values()],W=Math.min(...F.map(Gt=>Gt.x)),K=Math.max(...F.map(Gt=>Gt.x)),ie=Math.min(...F.map(Gt=>Gt.y)),oe=Math.max(...F.map(Gt=>Gt.y)),Ee=Math.max(K-W,1),Je=Math.max(oe-ie,1),Ze=M.getBoundingClientRect(),Ne=60,hs=Math.min(Nu,Math.max(ju,Math.min((Ze.width-Ne)/Ee,(Ze.height-Ne)/Je))),mf=(W+K)/2,hf=(ie+oe)/2;m({k:hs,x:Ze.width/2-mf*hs,y:Ze.height/2-hf*hs})}x.useEffect(()=>{if(!(!n||!b))return y(new Set),w.current=vu([...b.visibleIds],rl,ll),f.current=1,h.current=!1,J(),X},[n]);function it(){!n||!_||(w.current=vu([..._.visibleIds],rl,ll),f.current=1,h.current=!1,J())}function Ge(P){const M=Vs(P);y(W=>{if(W.has(M))return W;const K=new Set(W);return K.add(M),K});const F=w.current;if(F){const W=F.get(P.fromId),K=F.get(P.toId),ie=P.hiddenIds.length;P.hiddenIds.forEach((oe,Ee)=>{if(F.has(oe))return;const Je=(Ee+1)/(ie+1),Ze=W&&K?W.x+(K.x-W.x)*Je:rl/2,Ne=W&&K?W.y+(K.y-W.y)*Je:ll/2;F.set(oe,{id:oe,x:Ze,y:Ne,vx:0,vy:0,fx:null,fy:null})})}f.current=Math.max(f.current,wu),J()}function ot(){w.current&&Me(w.current)}x.useEffect(()=>{const P=t.current;if(!P)return;function M(F){F.preventDefault();const W=P.getBoundingClientRect(),K=F.clientX-W.left,ie=F.clientY-W.top;m(oe=>{const Ee=F.deltaY>0?.9:1.1,Je=Math.min(Nu,Math.max(ju,oe.k*Ee)),Ze=(K-oe.x)/oe.k,Ne=(ie-oe.y)/oe.k;return{k:Je,x:K-Ze*Je,y:ie-Ne*Je}})}return P.addEventListener("wheel",M,{passive:!1}),()=>P.removeEventListener("wheel",M)},[n]);function R(P){P.button===0&&(Cu(P.target,P.pointerId),j.current={startClientX:P.clientX,startClientY:P.clientY,startView:c})}function O(P){const M=j.current;M&&m({...M.startView,x:M.startView.x+(P.clientX-M.startClientX),y:M.startView.y+(P.clientY-M.startClientY)})}function D(){j.current=null}function Y(P,M){var W;P.stopPropagation(),Cu(P.target,P.pointerId),k.current={id:M,moved:!1,startClientX:P.clientX,startClientY:P.clientY};const F=(W=w.current)==null?void 0:W.get(M);F&&(F.fx=F.x,F.fy=F.y),f.current=Math.max(f.current,wu),J()}function B(P){var oe;const M=k.current,F=(oe=w.current)==null?void 0:oe.get((M==null?void 0:M.id)??"");if(!M||!F)return;!M.moved&&Math.hypot(P.clientX-M.startClientX,P.clientY-M.startClientY)>zx&&(M.moved=!0);const W=t.current.getBoundingClientRect(),K=(P.clientX-W.left-c.x)/c.k,ie=(P.clientY-W.top-c.y)/c.k;F.x=K,F.y=ie,F.fx=K,F.fy=ie,u(Ee=>Ee+1)}function $(P,M){P.stopPropagation();const F=k.current;k.current=null,F&&!F.moved&&e(`/state/${M}`)}if(o)return i.jsx("div",{className:"p-8 text-danger",children:o});if(!n)return i.jsx("div",{className:"p-8 text-paper-dim",children:"Loading…"});if(n.length===0)return i.jsxs("div",{className:"max-w-3xl mx-auto p-4 sm:p-8",children:[i.jsx("h1",{className:"text-2xl font-semibold text-paper mb-1",children:"State graph"}),i.jsxs("div",{className:"bg-iron-raised border border-iron-line rounded-xl p-6 text-sm text-paper-faint mt-4",children:["No states yet — run ",i.jsx("code",{className:"text-paper",children:"whydid init"})," to capture the first one."]})]});const ce=l>n.length,S=w.current,A=p?L.get(p):null,Be=p?S==null?void 0:S.get(p):null;return i.jsxs("div",{className:"max-w-6xl mx-auto p-4 sm:p-8 space-y-4",children:[i.jsxs("div",{children:[i.jsx("h1",{className:"text-2xl font-semibold text-paper mb-1",children:"State graph"}),i.jsx("p",{className:"text-sm text-paper-faint max-w-xl",children:"Every checkpoint, restore, and fork as a real branching graph, laid out on its own — not a flat list. Drag any node to rearrange it, scroll to zoom, drag the background to pan. Click a node (without dragging) to open it. Fill color marks the branch; the ring marks risk, or gold for the current state. Long unbranched runs collapse into a single dashed edge — click its count to expand."}),ce&&i.jsxs("p",{className:"text-xs font-mono text-paper-faint mt-1",children:["Showing the ",n.length," most recent of ",l," states."]})]}),i.jsxs("div",{className:"flex flex-wrap items-center gap-4 text-xs font-mono text-paper-faint",children:[["low","medium","high"].map(P=>i.jsxs("span",{className:"flex items-center gap-1.5",children:[i.jsx("span",{className:"w-2.5 h-2.5 rounded-full bg-iron",style:{boxShadow:`0 0 0 2px ${ku[P]}`}}),P," risk"]},P)),i.jsxs("span",{className:"flex items-center gap-1.5",children:[i.jsx("span",{className:"text-amber",children:"★"})," milestone"]}),i.jsxs("span",{className:"flex items-center gap-1.5",children:[i.jsx("span",{className:"w-2.5 h-2.5 rounded-full bg-iron",style:{boxShadow:`0 0 6px ${sl}, 0 0 0 2px ${sl}`}})," current"]}),i.jsxs("span",{className:"flex items-center gap-1.5",children:[i.jsx("span",{className:"w-4 border-t border-dashed border-paper-faint"})," ⋯N collapsed run — click to expand"]}),i.jsxs("div",{className:"ml-auto flex gap-2",children:[i.jsx("button",{className:"px-2.5 py-1 rounded border border-iron-line text-paper-dim hover:text-amber hover:border-amber-dim transition-colors",onClick:ot,children:"Fit view"}),i.jsx("button",{className:"px-2.5 py-1 rounded border border-iron-line text-paper-dim hover:text-amber hover:border-amber-dim transition-colors",onClick:it,children:"Reset layout"})]})]}),i.jsxs("div",{ref:t,className:"relative border border-iron-line rounded-lg bg-iron-raised overflow-hidden h-[70vh] touch-none select-none cursor-grab active:cursor-grabbing",onPointerDown:R,onPointerMove:O,onPointerUp:D,children:[i.jsx("svg",{width:"100%",height:"100%",className:"absolute inset-0",children:i.jsxs("g",{transform:`translate(${c.x} ${c.y}) scale(${c.k})`,children:[((_==null?void 0:_.edges)??[]).map(P=>{var K;const M=S==null?void 0:S.get(P.fromId),F=S==null?void 0:S.get(P.toId);if(!M||!F)return null;const W=((K=I.get(P.fromId))==null?void 0:K.lane)??0;return i.jsx("line",{x1:M.x,y1:M.y,x2:F.x,y2:F.y,stroke:vt(W),strokeWidth:1.5,opacity:.4},`${P.fromId}-${P.toId}`)}),((_==null?void 0:_.segments)??[]).map(P=>{var oe;const M=S==null?void 0:S.get(P.fromId),F=S==null?void 0:S.get(P.toId);if(!M||!F)return null;const W=((oe=I.get(P.fromId))==null?void 0:oe.lane)??0,K=(M.x+F.x)/2,ie=(M.y+F.y)/2;return i.jsxs("g",{children:[i.jsx("line",{x1:M.x,y1:M.y,x2:F.x,y2:F.y,stroke:vt(W),strokeWidth:1.5,strokeDasharray:"4 4",opacity:.35}),i.jsxs("g",{transform:`translate(${K} ${ie})`,className:"cursor-pointer",onPointerDown:Ee=>Ee.stopPropagation(),onClick:()=>Ge(P),role:"button",tabIndex:0,"aria-label":`Expand ${P.hiddenIds.length} hidden checkpoints`,onKeyDown:Ee=>{Ee.key==="Enter"&&Ge(P)},children:[i.jsx("rect",{x:-16,y:-9,width:32,height:18,rx:9,fill:"#1a1a1a",stroke:vt(W),strokeWidth:1,opacity:.9}),i.jsxs("text",{x:0,y:4,textAnchor:"middle",fontSize:10,fontFamily:"monospace",fill:"#e8e6df",children:["⋯",P.hiddenIds.length]})]})]},Vs(P))}),z.map(P=>{var oe,Ee,Je,Ze;const M=S==null?void 0:S.get(P.id);if(!M)return null;const F=((oe=I.get(P.id))==null?void 0:oe.lane)??0,W=((Ee=P.annotation)==null?void 0:Ee.riskLevel)??P.riskLevel,K=P.id===((Je=n[0])==null?void 0:Je.id),ie=((Ze=P.annotation)==null?void 0:Ze.status)==="generated"?P.annotation.summary:P.label??P.stateType;return i.jsxs("g",{transform:`translate(${M.x} ${M.y})`,className:"cursor-pointer",onPointerDown:Ne=>Y(Ne,P.id),onPointerMove:B,onPointerUp:Ne=>$(Ne,P.id),onPointerEnter:()=>g(P.id),onPointerLeave:()=>g(Ne=>Ne===P.id?null:Ne),role:"button",tabIndex:0,"aria-label":ie,onKeyDown:Ne=>{Ne.key==="Enter"&&e(`/state/${P.id}`)},children:[i.jsx("circle",{r:yu,fill:vt(F),stroke:K?sl:W?ku[W]:"transparent",strokeWidth:2.5,style:{filter:K?`drop-shadow(0 0 5px ${sl})`:void 0}}),P.milestoneLabel&&i.jsx("text",{x:0,y:-yu-5,textAnchor:"middle",fontSize:11,fill:"#ff9a3d",children:"★"})]},P.id)})]})}),A&&Be&&i.jsxs("div",{className:"absolute z-10 max-w-xs bg-iron border border-iron-line rounded-lg shadow-2xl p-3 pointer-events-none",style:{left:Math.min(Su(Be,c).x+16,(((Bo=t.current)==null?void 0:Bo.clientWidth)??0)-280),top:Math.max(Su(Be,c).y-10,8)},children:[i.jsxs("p",{className:"text-xs font-mono text-paper-faint mb-1",children:["#",A.id.slice(0,8)," · ",St(A.createdAt)]}),i.jsx("p",{className:"text-sm text-paper leading-snug",children:((Wo=A.annotation)==null?void 0:Wo.status)==="generated"?A.annotation.summary:A.label??A.stateType}),A.milestoneLabel&&i.jsxs("p",{className:"text-xs font-mono text-amber mt-1",children:["★ ",A.milestoneLabel]})]})]})]})}function Bx({unified:e,binary:t}){if(t)return i.jsx("div",{className:"p-4 text-paper-faint font-mono text-sm border border-iron-line rounded-lg",children:"Binary file differs."});const n=e.split(`
68
+ `);return i.jsx("pre",{className:"p-4 font-mono text-sm overflow-x-auto bg-iron-raised border border-iron-line rounded-lg leading-relaxed",children:n.map((r,l)=>{let s="text-paper-dim";return r.startsWith("+")&&!r.startsWith("+++")?s="text-scope":r.startsWith("-")&&!r.startsWith("---")?s="text-danger":r.startsWith("@@")&&(s="text-amber"),i.jsx("div",{className:s,children:r||" "},l)})})}function Wx({target:e,onClose:t,onRestored:n}){const[r,l]=x.useState(!1),[s,o]=x.useState(null);async function a(){l(!0),o(null);try{const u=await Jh(e.id);n(u.safetyStateId)}catch(u){o(u instanceof Error?u.message:"Restore failed")}finally{l(!1)}}return i.jsx("div",{className:"fixed inset-0 bg-black/70 flex items-center justify-center z-50",children:i.jsxs("div",{className:"bg-iron-raised border border-iron-line rounded-xl p-6 w-96 space-y-4 shadow-2xl",children:[i.jsx("h2",{className:"text-lg font-semibold text-paper",children:"Restore this state?"}),i.jsx("p",{className:"text-sm text-paper-dim",children:"Current state will be preserved automatically — nothing is ever lost."}),i.jsxs("p",{className:"text-sm text-paper font-mono",children:["Target: ",e.label??e.stateType," — ",new Date(e.createdAt).toLocaleString()]}),s&&i.jsx("p",{className:"text-sm text-danger",children:s}),i.jsxs("div",{className:"flex justify-end gap-2 pt-2",children:[i.jsx("button",{className:"px-3 py-1.5 rounded-md text-sm text-paper-dim hover:bg-iron",onClick:t,disabled:r,children:"Cancel"}),i.jsx("button",{className:"px-3 py-1.5 rounded-md text-sm bg-amber text-iron font-semibold hover:bg-[#ffb066] disabled:opacity-50 transition-colors",onClick:a,disabled:r,children:r?"Restoring…":"Restore State"})]})]})})}function Vx({target:e,filePaths:t,onClose:n,onRestored:r}){const[l,s]=x.useState(!1),[o,a]=x.useState(null);async function u(){s(!0),a(null);try{const c=await Zh(e.id,t);r(c.safetyStateId)}catch(c){a(c instanceof Error?c.message:"Restore failed")}finally{s(!1)}}return i.jsx("div",{className:"fixed inset-0 bg-black/70 flex items-center justify-center z-50",children:i.jsxs("div",{className:"bg-iron-raised border border-iron-line rounded-xl p-6 w-96 space-y-4 shadow-2xl",children:[i.jsxs("h2",{className:"text-lg font-semibold text-paper",children:["Restore ",t.length," file",t.length===1?"":"s","?"]}),i.jsx("p",{className:"text-sm text-paper-dim",children:"Everything else in your current state stays exactly as it is. Current state is preserved automatically."}),i.jsx("div",{className:"border border-iron-line rounded-md divide-y divide-iron-line max-h-40 overflow-y-auto",children:t.map(c=>i.jsx("div",{className:"px-3 py-1.5 font-mono text-xs text-paper",children:c},c))}),i.jsxs("p",{className:"text-sm text-paper font-mono",children:["From: ",e.label??e.stateType," — ",new Date(e.createdAt).toLocaleString()]}),o&&i.jsx("p",{className:"text-sm text-danger",children:o}),i.jsxs("div",{className:"flex justify-end gap-2 pt-2",children:[i.jsx("button",{className:"px-3 py-1.5 rounded-md text-sm text-paper-dim hover:bg-iron",onClick:n,disabled:l,children:"Cancel"}),i.jsx("button",{className:"px-3 py-1.5 rounded-md text-sm bg-amber text-iron font-semibold hover:bg-[#ffb066] disabled:opacity-50 transition-colors",onClick:u,disabled:l,children:l?"Restoring…":`Restore ${t.length} File${t.length===1?"":"s"}`})]})]})})}function Hx({source:e,onClose:t,onForked:n}){const[r,l]=x.useState(""),[s,o]=x.useState(!1),[a,u]=x.useState(null);async function c(){if(!r.trim()){u("Fork name is required");return}o(!0),u(null);try{const m=await ex(e.id,r.trim());n(m.forkStateId)}catch(m){u(m instanceof Error?m.message:"Fork failed")}finally{o(!1)}}return i.jsx("div",{className:"fixed inset-0 bg-black/70 flex items-center justify-center z-50",children:i.jsxs("div",{className:"bg-iron-raised border border-iron-line rounded-xl p-6 w-96 space-y-4 shadow-2xl",children:[i.jsx("h2",{className:"text-lg font-semibold text-paper",children:"Fork from here"}),i.jsx("input",{autoFocus:!0,className:"w-full bg-iron border border-iron-line rounded-md px-3 py-2 text-sm text-paper outline-none focus:border-amber-dim font-mono",placeholder:"fork name, e.g. stripe-webhook-experiment",value:r,onChange:m=>l(m.target.value)}),a&&i.jsx("p",{className:"text-sm text-danger",children:a}),i.jsxs("div",{className:"flex justify-end gap-2 pt-2",children:[i.jsx("button",{className:"px-3 py-1.5 rounded-md text-sm text-paper-dim hover:bg-iron",onClick:t,disabled:s,children:"Cancel"}),i.jsx("button",{className:"px-3 py-1.5 rounded-md text-sm bg-scope text-iron font-semibold hover:brightness-110 disabled:opacity-50 transition-all",onClick:c,disabled:s,children:s?"Forking…":"Create Fork"})]})]})})}function Kx({history:e}){return e.length===0?i.jsx("div",{className:"p-4 text-paper-faint text-sm font-mono",children:"No recorded history for this file."}):i.jsx("div",{className:"border border-iron-line rounded-lg divide-y divide-iron-line bg-iron-raised",children:e.map((t,n)=>i.jsxs("div",{className:"p-4",children:[i.jsxs("div",{className:"flex items-center gap-2 text-[11px] font-mono text-paper-faint mb-1.5",children:[i.jsxs("span",{children:[n+1,"."]}),i.jsxs("span",{children:["#",t.stateId.slice(0,8)]}),i.jsx("span",{className:"text-iron-line",children:"·"}),i.jsx("span",{children:new Date(t.createdAt).toLocaleString()}),i.jsx("span",{className:"uppercase px-1.5 py-0.5 rounded border border-iron-line",children:t.changeType})]}),t.turnPrompt&&i.jsxs("p",{className:"text-sm text-paper italic mb-1",children:['"',t.turnPrompt,'"']}),t.annotationReason?i.jsx("p",{className:"text-sm text-paper-dim",children:t.annotationReason}):!t.turnPrompt&&i.jsx("p",{className:"text-sm text-paper-faint italic",children:"No AI explanation available."}),t.buildsOnPriorChange&&i.jsxs("p",{className:"text-xs text-amber mt-2 flex items-center gap-1",children:[i.jsx("span",{children:"⚠"}),i.jsx("span",{children:"Builds on top of the previous entry's change to this file — reverting that one may affect this one."})]})]},t.stateId))})}function Qx({filePath:e,stateId:t,onClose:n}){const[r,l]=x.useState("revert"),[s,o]=x.useState(""),[a,u]=x.useState(null),[c,m]=x.useState(!1),[p,g]=x.useState(null),[v,y]=x.useState(!1);async function w(){m(!0),g(null),u(null);try{const f=await nx(e,{stateId:t,mode:r,instruction:s||void 0});u(f.prompt)}catch(f){g(f instanceof Error?f.message:"Failed to generate prompt")}finally{m(!1)}}async function N(){if(a)try{await navigator.clipboard.writeText(a),y(!0),setTimeout(()=>y(!1),1500)}catch{}}return i.jsx("div",{className:"fixed inset-0 bg-black/70 flex items-center justify-center z-50 p-6",children:i.jsxs("div",{className:"bg-iron-raised border border-iron-line rounded-xl p-6 w-full max-w-lg space-y-4 shadow-2xl max-h-[85vh] overflow-y-auto",children:[i.jsx("h2",{className:"text-lg font-semibold text-paper",children:"Generate agent prompt"}),i.jsx("p",{className:"text-sm text-paper-dim font-mono",children:e}),i.jsxs("div",{className:"flex gap-2",children:[i.jsx("button",{className:`px-3 py-1.5 rounded-md text-sm border ${r==="revert"?"bg-amber text-iron border-amber":"border-iron-line text-paper-dim"}`,onClick:()=>l("revert"),children:"Revert this change"}),i.jsx("button",{className:`px-3 py-1.5 rounded-md text-sm border ${r==="continue"?"bg-amber text-iron border-amber":"border-iron-line text-paper-dim"}`,onClick:()=>l("continue"),children:"Build on top"})]}),r==="continue"&&i.jsx("input",{autoFocus:!0,className:"w-full bg-iron border border-iron-line rounded-md px-3 py-2 text-sm text-paper outline-none focus:border-amber-dim",placeholder:"what should the agent build on top of this?",value:s,onChange:f=>o(f.target.value)}),p&&i.jsx("p",{className:"text-sm text-danger",children:p}),a&&i.jsxs("div",{className:"relative",children:[i.jsx("pre",{className:"bg-iron border border-iron-line rounded-lg p-3 text-xs font-mono text-paper whitespace-pre-wrap max-h-64 overflow-y-auto",children:a}),i.jsx("button",{className:"absolute top-2 right-2 px-2 py-1 rounded bg-iron-raised border border-iron-line text-xs text-paper-dim hover:text-amber",onClick:N,children:v?"Copied":"Copy"})]}),i.jsxs("div",{className:"flex justify-end gap-2 pt-2",children:[i.jsx("button",{className:"px-3 py-1.5 rounded-md text-sm text-paper-dim hover:bg-iron",onClick:n,children:"Close"}),i.jsx("button",{className:"px-3 py-1.5 rounded-md text-sm bg-amber text-iron font-semibold hover:bg-[#ffb066] disabled:opacity-50 transition-colors",onClick:w,disabled:c||r==="continue"&&!s.trim(),children:c?"Generating…":"Generate"})]})]})})}function Yx(){var D,Y,B;const{id:e}=Zd(),t=ps(),[n,r]=x.useState(null),[l,s]=x.useState(null),[o,a]=x.useState(null),[u,c]=x.useState("diff"),[m,p]=x.useState(null),[g,v]=x.useState(!1),[y,w]=x.useState(!1),[N,f]=x.useState(!1),[d,h]=x.useState(new Set),[j,k]=x.useState(!1),[E,I]=x.useState(null),[L,b]=x.useState(null),[_,z]=x.useState(!1),[X,J]=x.useState(""),[Me,it]=x.useState(!1),[Ge,ot]=x.useState(null);if(x.useEffect(()=>{e&&(I(null),Yh(e).then(r).catch($=>I($ instanceof Error?$.message:"Failed to load this state")))},[e]),x.useEffect(()=>{!e||!l||(b(null),Gh(e,l).then(a).catch($=>b($ instanceof Error?$.message:"Failed to load diff")),p(null),c("diff"))},[e,l]),x.useEffect(()=>{!l||u!=="history"||m||tx(l).then(p).catch(()=>p([]))},[l,u,m]),E)return i.jsxs("div",{className:"p-8 space-y-4",children:[i.jsx("button",{className:"text-sm text-paper-faint hover:text-amber font-mono",onClick:()=>t("/timeline"),children:"← Timeline"}),i.jsxs("div",{className:"bg-iron-raised border border-iron-line rounded-xl p-6 text-sm",children:[i.jsx("p",{className:"text-paper mb-1",children:"This state couldn't be found."}),i.jsx("p",{className:"text-paper-faint",children:E})]})]});if(!n)return i.jsx("div",{className:"p-8 text-paper-dim",children:"Loading…"});const R=((D=n.annotation)==null?void 0:D.status)==="generated";async function O($){if(n){it(!0),ot(null);try{await qh(n.id,$),r({...n,milestoneLabel:$}),z(!1)}catch(ce){ot(ce instanceof Error?ce.message:"Failed to update milestone")}finally{it(!1)}}}return i.jsxs("div",{className:"max-w-4xl mx-auto p-4 sm:p-8 space-y-6",children:[i.jsx("button",{className:"text-sm text-paper-faint hover:text-amber font-mono",onClick:()=>t("/timeline"),children:"← Timeline"}),i.jsxs("div",{children:[i.jsxs("div",{className:"flex items-center gap-3 mb-1",children:[i.jsx("h1",{className:"text-2xl font-semibold text-paper",children:R?n.annotation.summary:n.label??n.stateType}),i.jsx(Uo,{level:((Y=n.annotation)==null?void 0:Y.riskLevel)??n.riskLevel})]}),i.jsxs("div",{className:"text-sm text-paper-faint font-mono",children:[new Date(n.createdAt).toLocaleString()," · #",n.id.slice(0,8)]}),i.jsx("div",{className:"mt-2 flex items-center gap-2",children:_?i.jsxs(i.Fragment,{children:[i.jsx("input",{autoFocus:!0,className:"bg-iron-raised border border-iron-line rounded-md px-2 py-1 text-sm text-paper outline-none focus:border-amber-dim placeholder:text-paper-faint w-56",placeholder:"e.g. v1 launch",value:X,onChange:$=>J($.target.value),onKeyDown:$=>{$.key==="Enter"&&X.trim()&&O(X.trim()),$.key==="Escape"&&z(!1)},disabled:Me}),i.jsx("button",{className:"text-xs font-mono px-2 py-1 rounded border border-amber-dim text-amber hover:bg-amber hover:text-iron disabled:opacity-50 transition-colors",onClick:()=>X.trim()&&O(X.trim()),disabled:Me||!X.trim(),children:"Save"}),i.jsx("button",{className:"text-xs font-mono px-2 py-1 rounded border border-iron-line text-paper-faint hover:text-paper",onClick:()=>z(!1),disabled:Me,children:"Cancel"})]}):n.milestoneLabel?i.jsxs(i.Fragment,{children:[i.jsxs("span",{className:"text-xs font-mono px-2 py-1 rounded border border-amber-dim text-amber",children:["★ ",n.milestoneLabel]}),i.jsx("button",{className:"text-xs font-mono text-paper-faint hover:text-paper",onClick:()=>{J(n.milestoneLabel??""),z(!0)},children:"Edit"}),i.jsx("button",{className:"text-xs font-mono text-paper-faint hover:text-danger",onClick:()=>O(null),disabled:Me,children:"Remove"})]}):i.jsx("button",{className:"text-xs font-mono text-paper-faint hover:text-amber",onClick:()=>{J(""),z(!0)},children:"★ Tag as milestone"})}),Ge&&i.jsx("p",{className:"text-xs text-danger mt-1",children:Ge})]}),i.jsxs("section",{className:"bg-iron-raised border border-iron-line rounded-xl p-5",children:[i.jsx("h2",{className:"text-[11px] font-mono uppercase tracking-wider text-amber-dim mb-2",children:"Why"}),R?i.jsxs(i.Fragment,{children:[i.jsx("p",{className:"text-paper leading-relaxed",children:n.annotation.reason}),n.annotation.decisions.length>0&&i.jsxs("div",{className:"mt-3 pt-3 border-t border-iron-line",children:[i.jsx("div",{className:"text-[11px] font-mono uppercase tracking-wider text-paper-faint mb-1.5",children:"Decisions"}),i.jsx("ul",{className:"text-sm text-paper-dim space-y-1 list-disc list-inside",children:n.annotation.decisions.map(($,ce)=>i.jsx("li",{children:$},ce))})]})]}):i.jsx("p",{className:"text-paper-faint italic text-sm",children:((B=n.annotation)==null?void 0:B.status)==="failed"?"AI annotation failed for this checkpoint — the checkpoint itself was still saved.":"AI session context unavailable. This checkpoint was inferred from project changes."})]}),i.jsxs("section",{children:[i.jsxs("div",{className:"flex items-center justify-between mb-2",children:[i.jsxs("h2",{className:"text-[11px] font-mono uppercase tracking-wider text-paper-faint",children:["What changed · ",n.fileChanges.length," file",n.fileChanges.length===1?"":"s"]}),d.size>0&&i.jsxs("button",{className:"text-xs font-mono px-2 py-1 rounded border border-amber-dim text-amber hover:bg-amber hover:text-iron transition-colors",onClick:()=>f(!0),children:["Restore ",d.size," selected"]})]}),i.jsx("div",{className:"divide-y divide-iron-line border border-iron-line rounded-lg overflow-hidden",children:n.fileChanges.map($=>i.jsxs("div",{className:`w-full text-left px-2 py-2 hover:bg-iron-raised flex items-center gap-2 transition-colors ${l===$.filePath?"bg-iron-raised":""}`,children:[i.jsx("input",{type:"checkbox",className:"accent-amber",checked:d.has($.filePath),onChange:ce=>{h(S=>{const A=new Set(S);return ce.target.checked?A.add($.filePath):A.delete($.filePath),A})},"aria-label":`Select ${$.filePath} for selective restore`}),i.jsxs("button",{className:"flex-1 text-left flex items-center gap-2 min-w-0",onClick:()=>s(l===$.filePath?null:$.filePath),children:[i.jsx("span",{className:"uppercase text-[10px] font-mono text-paper-faint w-16",children:$.changeType}),i.jsx("span",{className:"font-mono text-sm text-paper truncate",children:$.filePath}),i.jsxs("span",{className:"ml-auto text-xs font-mono text-paper-faint",children:[i.jsxs("span",{className:"text-scope",children:["+",$.linesAdded]})," ",i.jsxs("span",{className:"text-danger",children:["-",$.linesRemoved]})]})]})]},$.filePath))})]}),l&&i.jsxs("section",{children:[i.jsxs("div",{className:"flex items-center justify-between mb-2",children:[i.jsxs("div",{className:"flex items-center gap-4",children:[i.jsx("button",{className:`text-[11px] font-mono uppercase tracking-wider pb-1 border-b-2 ${u==="diff"?"text-amber border-amber":"text-paper-faint border-transparent"}`,onClick:()=>c("diff"),children:"Diff"}),i.jsx("button",{className:`text-[11px] font-mono uppercase tracking-wider pb-1 border-b-2 ${u==="history"?"text-amber border-amber":"text-paper-faint border-transparent"}`,onClick:()=>c("history"),children:"History"}),i.jsx("span",{className:"text-[11px] font-mono text-paper-faint",children:l})]}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("button",{className:"text-xs font-mono px-2 py-1 rounded border border-iron-line text-paper-dim hover:text-amber hover:border-amber-dim",onClick:()=>k(!0),children:"⚡ Agent prompt"}),i.jsx("button",{className:"text-xs font-mono px-2 py-1 rounded border border-iron-line text-paper-dim hover:text-paper hover:border-iron-lit",onClick:()=>s(null),"aria-label":"Close diff",title:"Close",children:"✕"})]})]}),u==="diff"&&L&&i.jsx("div",{className:"p-4 text-danger text-sm border border-iron-line rounded-lg",children:L}),u==="diff"&&o&&!L&&i.jsx(Bx,{unified:o.unified,binary:o.binary}),u==="history"&&(m?i.jsx(Kx,{history:m}):i.jsx("div",{className:"p-4 text-paper-faint text-sm",children:"Loading…"}))]}),i.jsxs("section",{className:"flex gap-3 pt-4",children:[i.jsx("button",{className:"px-4 py-2 rounded-md bg-amber text-iron font-semibold text-sm hover:bg-[#ffb066] transition-colors",onClick:()=>v(!0),children:"Restore"}),i.jsx("button",{className:"px-4 py-2 rounded-md border border-iron-lit text-paper text-sm hover:border-amber-dim hover:text-amber transition-colors",onClick:()=>w(!0),children:"Fork From Here"})]}),g&&i.jsx(Wx,{target:n,onClose:()=>v(!1),onRestored:$=>t(`/state/${$}`)}),y&&i.jsx(Hx,{source:n,onClose:()=>w(!1),onForked:$=>t(`/state/${$}`)}),N&&i.jsx(Vx,{target:n,filePaths:[...d],onClose:()=>f(!1),onRestored:$=>t(`/state/${$}`)}),j&&l&&i.jsx(Qx,{filePath:l,stateId:n.id,onClose:()=>k(!1)})]})}const Hs=30;function Xx(e){const t=Date.now()-new Date(e).getTime(),n=Math.round(t/6e4);if(n<1)return"just now";if(n<60)return`${n}m ago`;const r=Math.round(n/60);return r<24?`${r}h ago`:`${Math.round(r/24)}d ago`}function Gx(){const[e,t]=x.useState(null),[n,r]=x.useState(0),[l,s]=x.useState(!1),[o,a]=x.useState(null);x.useEffect(()=>{let m=!0;const p=()=>{uu({limit:Hs,offset:0}).then(({sessions:v,total:y})=>{m&&(t(w=>{if(!w)return v;const N=new Set(v.map(f=>f.id));return[...v,...w.slice(Hs).filter(f=>!N.has(f.id))]}),r(y))}).catch(v=>{m&&a(v instanceof Error?v.message:"Failed to load sessions")})};p();const g=setInterval(p,5e3);return()=>{m=!1,clearInterval(g)}},[]);async function u(){if(!(!e||l)){s(!0);try{const{sessions:m,total:p}=await uu({limit:Hs,offset:e.length});t([...e,...m]),r(p)}catch(m){a(m instanceof Error?m.message:"Failed to load more sessions")}finally{s(!1)}}}if(o)return i.jsx("div",{className:"p-8 text-danger",children:o});if(!e)return i.jsx("div",{className:"p-8 text-paper-dim",children:"Loading…"});const c=e.length<n;return i.jsxs("div",{className:"max-w-3xl mx-auto p-4 sm:p-8 space-y-6",children:[i.jsxs("div",{children:[i.jsx("h1",{className:"text-2xl font-semibold text-paper mb-1",children:"AI sessions"}),i.jsx("p",{className:"text-sm text-paper-faint",children:"Sessions and prompts captured from Claude Code, Codex, and Cursor, with checkpoints linked to the request that caused them."})]}),e.length===0?i.jsxs("div",{className:"bg-iron-raised border border-iron-line rounded-xl p-6 text-sm text-paper-dim",children:["No AI sessions recorded yet. Run ",i.jsx("code",{className:"text-paper",children:"whydid init"}),", enable project hooks when prompted by Codex or Cursor, and keep"," ",i.jsx("code",{className:"text-paper",children:"whydid daemon start"})," active while you work. Claude Code sessions are detected automatically."]}):i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"divide-y divide-iron-line border border-iron-line rounded-lg overflow-hidden",children:e.map(m=>i.jsxs(_e,{to:`/sessions/${m.id}`,className:"block px-4 py-3 hover:bg-iron-raised transition-colors",children:[i.jsxs("div",{className:"flex items-center gap-2 text-[11px] font-mono text-paper-faint mb-1",children:[i.jsx("span",{className:"uppercase px-1.5 py-0.5 rounded border border-iron-line",children:m.agent}),i.jsx("span",{children:Xx(m.startedAt)}),i.jsx("span",{className:"text-iron-line",children:"·"}),i.jsxs("span",{children:[m.turnCount," turn",m.turnCount===1?"":"s"]})]}),m.lastTurnKind==="compact_resume"?i.jsxs("div",{className:"text-sm text-amber flex items-center gap-1.5",children:[i.jsx("span",{children:"↺"}),i.jsx("span",{children:"Context compacted — session resumed"})]}):i.jsx("div",{className:"text-sm text-paper line-clamp-2",children:m.lastPrompt??"(no prompt recorded)"})]},m.id))}),c&&i.jsx("div",{className:"flex justify-center pt-2",children:i.jsx("button",{className:"px-4 py-2 rounded-md border border-iron-line text-sm text-paper-dim hover:text-amber hover:border-amber-dim transition-colors disabled:opacity-50",onClick:u,disabled:l,children:l?"Loading…":`Load more (${n-e.length} remaining)`})})]})]})}const bu=400;function Jx({turn:e}){const[t,n]=x.useState(!1),r=e.prompt??"(no prompt text)",l=r.length>bu,s=e.kind==="compact_resume";return i.jsxs("div",{className:"mb-2",children:[s&&i.jsxs("div",{className:"text-xs font-mono text-amber flex items-center gap-1.5 mb-1.5",children:[i.jsx("span",{children:"↺"}),i.jsx("span",{children:"Context compacted — session resumed. What follows is the agent's own summary of the earlier conversation."})]}),i.jsx("p",{className:`text-sm ${s?"text-paper-dim":"text-paper"} whitespace-pre-wrap leading-relaxed`,children:t||!l?r:`${r.slice(0,bu)}…`}),l&&i.jsx("button",{className:"text-xs font-mono text-amber hover:underline mt-1",onClick:()=>n(o=>!o),children:t?"Show less":"Show full text"})]})}function Zx({sessionId:e}){const[t,n]=x.useState(null),[r,l]=x.useState(null);async function s(o){n(o),l(null);try{const a=await px(e,o);l(a.saved&&a.post?{content:a.post.content,platform:o}:{message:a.message??"Nothing came back for this session."})}catch(a){l({error:a instanceof Error?a.message:"Failed to generate a draft"})}finally{n(null)}}return i.jsxs("div",{className:"bg-iron-raised border border-iron-line rounded-xl p-4 space-y-3",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("span",{className:"text-[11px] font-mono uppercase tracking-wider text-amber-dim",children:"Draft a post"}),i.jsx("button",{className:"text-xs font-mono px-2 py-1 rounded border border-iron-line text-paper-dim hover:text-amber hover:border-amber-dim transition-colors disabled:opacity-50",onClick:()=>s("x"),disabled:t!==null,children:t==="x"?"Drafting…":"for X"}),i.jsx("button",{className:"text-xs font-mono px-2 py-1 rounded border border-iron-line text-paper-dim hover:text-amber hover:border-amber-dim transition-colors disabled:opacity-50",onClick:()=>s("linkedin"),disabled:t!==null,children:t==="linkedin"?"Drafting…":"for LinkedIn"})]}),r&&"content"in r&&i.jsxs("div",{className:"text-sm text-paper whitespace-pre-wrap leading-relaxed border-t border-iron-line pt-3",children:[r.content,i.jsx("div",{className:"mt-2",children:i.jsx(_e,{to:"/build-in-public",className:"text-xs font-mono text-paper-faint hover:text-amber",children:"View in Build in Public →"})})]}),r&&"message"in r&&i.jsx("p",{className:"text-xs text-paper-faint italic border-t border-iron-line pt-3",children:r.message}),r&&"error"in r&&i.jsx("p",{className:"text-xs text-danger border-t border-iron-line pt-3",children:r.error})]})}function qx(){const{id:e}=Zd(),t=ps(),[n,r]=x.useState(null),[l,s]=x.useState(null);return x.useEffect(()=>{if(!e)return;let o=!0;const a=()=>{ox(e).then(c=>{o&&r(c)}).catch(c=>{o&&s(c instanceof Error?c.message:"Failed to load this session")})};a();const u=setInterval(a,5e3);return()=>{o=!1,clearInterval(u)}},[e]),l?i.jsxs("div",{className:"p-8 space-y-4",children:[i.jsx("button",{className:"text-sm text-paper-faint hover:text-amber font-mono",onClick:()=>t("/sessions"),children:"← Sessions"}),i.jsxs("div",{className:"bg-iron-raised border border-iron-line rounded-xl p-6 text-sm",children:[i.jsx("p",{className:"text-paper mb-1",children:"This session couldn't be found."}),i.jsx("p",{className:"text-paper-faint",children:l})]})]}):n?i.jsxs("div",{className:"max-w-3xl mx-auto p-4 sm:p-8 space-y-6",children:[i.jsx("button",{className:"text-sm text-paper-faint hover:text-amber font-mono",onClick:()=>t("/sessions"),children:"← Sessions"}),i.jsxs("div",{children:[i.jsxs("h1",{className:"text-2xl font-semibold text-paper mb-1",children:[n.agent," session · ",new Date(n.startedAt).toLocaleString()]}),i.jsxs("p",{className:"text-sm text-paper-faint font-mono",children:[n.turns.length," turn",n.turns.length===1?"":"s"]})]}),i.jsx(Zx,{sessionId:n.id}),i.jsx("div",{className:"space-y-3",children:n.turns.map((o,a)=>i.jsxs("div",{className:`bg-iron-raised border rounded-lg p-4 ${o.kind==="compact_resume"?"border-amber-dim":"border-iron-line"}`,children:[i.jsxs("div",{className:"flex items-center gap-2 text-[11px] font-mono text-paper-faint mb-2",children:[i.jsxs("span",{children:["#",a+1]}),i.jsx("span",{children:new Date(o.startedAt).toLocaleTimeString()}),i.jsx("span",{className:`px-1.5 py-0.5 rounded border border-iron-line uppercase ${o.status==="completed"?"text-scope":"text-amber"}`,children:o.status})]}),i.jsx(Jx,{turn:o}),o.states.length>0?i.jsx("div",{className:"flex flex-wrap gap-2 mt-2",children:o.states.map(u=>i.jsxs(_e,{to:`/state/${u.id}`,className:"text-xs font-mono px-2 py-1 rounded border border-iron-line text-paper-dim hover:text-amber hover:border-amber-dim",children:["#",u.id.slice(0,8)," — ",u.label??u.stateType]},u.id))}):i.jsx("p",{className:"text-xs text-paper-faint italic",children:"No checkpoint produced from this turn."})]},o.id))})]}):i.jsx("div",{className:"p-8 text-paper-dim",children:"Loading…"})}function il(e){const t=[],n=/(\*\*[^*]+\*\*|_[^_]+_)/g;let r=0,l,s=0;for(;(l=n.exec(e))!==null;){l.index>r&&t.push(e.slice(r,l.index));const o=l[0];o.startsWith("**")?t.push(i.jsx("strong",{className:"text-paper font-semibold",children:o.slice(2,-2)},s++)):t.push(i.jsx("em",{className:"text-paper-faint not-italic text-xs tracking-wide",children:o.slice(1,-1)},s++)),r=l.index+o.length}return r<e.length&&t.push(e.slice(r)),t}function eg({content:e}){const t=e.split(`
69
+ `),n=[];let r=[],l=0;function s(){r.length!==0&&(n.push(i.jsx("ul",{className:"list-disc list-inside space-y-0.5 my-2",children:r.map((o,a)=>i.jsx("li",{className:"text-sm text-paper-dim",children:il(o)},a))},l++)),r=[])}for(const o of t){const a=o.trim();if(a.startsWith("- ")){r.push(a.slice(2));continue}s(),a.startsWith("## ")?n.push(i.jsx("h3",{className:"text-sm font-semibold text-paper mt-4 mb-1 first:mt-0",children:il(a.slice(3))},l++)):a.startsWith("# ")?n.push(i.jsx("h2",{className:"text-base font-semibold text-paper mb-2",children:il(a.slice(2))},l++)):a==="---"?n.push(i.jsx("hr",{className:"border-iron-line my-3"},l++)):a!==""&&n.push(i.jsx("p",{className:"text-sm text-paper-dim leading-relaxed my-1.5",children:il(a)},l++))}return s(),i.jsx("div",{children:n})}const Vi="WHYDID_SUMMARY.md";function Eu({file:e,index:t}){const[n,r]=x.useState(null),[l,s]=x.useState("preview"),o=n!==null;async function a(){if(o){r(null);return}r("loading");try{r(await ux(e.filePath))}catch{r(null)}}const u=e.filePath===Vi;return i.jsxs("div",{className:`whydid-stagger-in border rounded-lg overflow-hidden ${u?"border-amber-dim bg-iron-raised":"border-iron-line bg-iron-raised"}`,style:{animationDelay:`${Math.min(t,10)*50}ms`},children:[i.jsxs("button",{className:"w-full flex items-center gap-3 px-4 py-3 text-left hover:bg-iron transition-colors",onClick:a,children:[i.jsx("span",{className:`text-xs font-mono px-1.5 py-0.5 rounded border ${u?"border-amber-dim text-amber":"border-iron-line text-paper-faint"}`,children:u?"★ PROJECT":e.dirPath===""?"/":e.dirPath}),i.jsx("span",{className:"flex-1 min-w-0 text-sm text-paper font-mono truncate",children:e.filePath}),i.jsxs("span",{className:"text-[11px] font-mono text-paper-faint whitespace-nowrap",children:[e.checkpointCount," decision",e.checkpointCount===1?"":"s"," · ",St(e.updatedAt)]}),i.jsx("span",{className:"text-paper-faint text-xs font-mono",children:o?"▾":"▸"})]}),o&&i.jsx("div",{className:"border-t border-iron-line px-4 py-3 bg-[rgba(0,0,0,0.2)]",children:n==="loading"?i.jsx("div",{className:"text-xs text-paper-faint py-4",children:"Loading…"}):i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"flex justify-end gap-1 mb-2",children:["preview","raw"].map(c=>i.jsx("button",{className:`text-[10px] font-mono uppercase tracking-wider px-2 py-1 rounded border transition-colors ${l===c?"bg-amber text-iron border-amber font-semibold":"border-iron-line text-paper-faint hover:text-paper"}`,onClick:()=>s(c),children:c},c))}),i.jsx("div",{className:"max-h-96 overflow-y-auto",children:l==="preview"?i.jsx(eg,{content:n.content}):i.jsx("pre",{className:"text-xs font-mono text-paper-dim whitespace-pre-wrap leading-relaxed",children:n.content})})]})})]})}function tg(){const[e,t]=x.useState(null),[n,r]=x.useState(null);if(x.useEffect(()=>{af().then(t).catch(o=>r(o instanceof Error?o.message:"Failed to load context files"))},[]),n)return i.jsx("div",{className:"p-8 text-danger",children:n});if(!e)return i.jsx("div",{className:"p-8 text-paper-dim",children:"Loading…"});const l=e.find(o=>o.filePath===Vi),s=e.filter(o=>o.filePath!==Vi);return i.jsxs("div",{className:"max-w-3xl mx-auto p-4 sm:p-8 space-y-6",children:[i.jsxs("div",{children:[i.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[i.jsx("span",{className:"whydid-rec-dot inline-block w-2 h-2 rounded-full bg-scope"}),i.jsx("h1",{className:"text-2xl font-semibold text-paper",children:"Context files"})]}),i.jsxs("p",{className:"text-sm text-paper-faint max-w-xl",children:["whydid writes a ",i.jsx("code",{className:"text-paper",children:"CONTEXT.md"})," next to the code it explains — the real reasoning behind recent changes, committed to git like any other file. Any AI tool that opens this repo — Claude Code, Codex, Cursor, a teammate's fresh session — reads it automatically. Nothing to import, nothing to maintain by hand."]})]}),i.jsxs("div",{className:"flex items-end gap-8 bg-iron-raised border border-iron-line rounded-xl p-5",children:[i.jsxs("div",{children:[i.jsx(zo,{value:e.length,size:"lg"}),i.jsx("div",{className:"text-[10px] font-mono uppercase tracking-wider text-paper-faint mt-1.5",children:"Areas documented"})]}),i.jsxs("div",{children:[i.jsx("div",{className:"font-mono text-xl font-semibold text-paper tabular-nums",children:e.reduce((o,a)=>o+a.checkpointCount,0)}),i.jsx("div",{className:"text-[10px] font-mono uppercase tracking-wider text-paper-faint mt-1",children:"Decisions captured"})]})]}),e.length===0?i.jsxs("div",{className:"bg-iron-raised border border-iron-line rounded-xl p-6 text-sm text-paper-dim space-y-2",children:[i.jsx("p",{className:"text-paper",children:"No context files yet."}),i.jsxs("p",{className:"text-paper-faint",children:["These are generated automatically once your AI provider is configured (Settings → AI provider) and a checkpoint gets a real explanation. Already have annotated history? Run ",i.jsx("code",{className:"text-paper",children:"whydid context"})," to backfill from it."]})]}):i.jsxs("div",{className:"space-y-2",children:[l&&i.jsx(Eu,{file:l,index:0,pinned:!0}),s.map((o,a)=>i.jsx(Eu,{file:o,index:l?a+1:a},o.filePath))]})]})}const Pu=400;function ng({resume:e}){const[t,n]=x.useState(!1),r=e.summary??"",l=r.length>Pu;return i.jsxs("div",{className:"border border-iron-line rounded-xl bg-iron-raised overflow-hidden",children:[i.jsxs("div",{className:"px-5 py-4 border-b border-iron-line flex items-center gap-3 flex-wrap",children:[i.jsx("span",{className:"text-amber font-mono text-xs px-2 py-0.5 rounded border border-amber-dim",children:"↺ context compacted"}),i.jsx("span",{className:"text-sm text-paper-dim",children:St(e.startedAt)}),i.jsx(_e,{to:`/sessions/${e.sessionId}`,className:"ml-auto text-xs font-mono text-paper-faint hover:text-amber transition-colors",children:"View session →"})]}),i.jsx("div",{className:"px-5 py-4 space-y-3",children:i.jsxs("div",{children:[i.jsx("div",{className:"font-mono text-[10px] uppercase tracking-wider text-paper-faint mb-1.5",children:"What the resumed session was told (its own compaction summary)"}),i.jsx("p",{className:"text-sm text-paper-dim leading-relaxed whitespace-pre-wrap",children:t||!l?r:`${r.slice(0,Pu)}…`}),l&&i.jsx("button",{className:"text-xs font-mono text-amber hover:underline mt-1",onClick:()=>n(s=>!s),children:t?"Show less":"Show full summary"})]})}),i.jsx("div",{className:"px-5 pb-5",children:i.jsx(df,{recap:e.recap,title:"What actually happened since, per whydid's own checkpoints",changesLabel:"Changes since resume"})})]})}function rg(){const[e,t]=x.useState(null),[n,r]=x.useState(null);return x.useEffect(()=>{lf().then(l=>t(l.resumes)).catch(l=>r(l instanceof Error?l.message:"Failed to load continuity data"))},[]),n?i.jsx("div",{className:"p-8 text-danger",children:n}):e?i.jsxs("div",{className:"max-w-3xl mx-auto p-4 sm:p-8 space-y-6",children:[i.jsxs("div",{children:[i.jsx("h1",{className:"text-2xl font-semibold text-paper mb-1",children:"Continuity"}),i.jsx("p",{className:"text-sm text-paper-faint max-w-xl",children:"Every point where a coding agent's own conversation ran out of context and got auto-compacted mid-session — the moment its memory of your project became a lossy summary instead of the real thing. whydid's checkpoints don't compact; for each resume below, check what the agent was told against what its own real, on-disk history says actually happened."})]}),e.length===0?i.jsx("div",{className:"bg-iron-raised border border-iron-line rounded-xl p-6 text-sm text-paper-faint",children:"No context compactions detected yet. When a coding agent's session gets auto-compacted and continues, whydid will flag the resume point here automatically, alongside a real recap of everything that happened afterward — so you can check its summary against what actually changed."}):i.jsx("div",{className:"space-y-4",children:e.map(l=>i.jsx(ng,{resume:l},l.turnId))})]}):i.jsx("div",{className:"p-8 text-paper-dim",children:"Loading…"})}function Yl(e){return e<.01&&e>0?"<$0.01":`$${e.toFixed(2)}`}function ol(e){return e>=1e6?`${(e/1e6).toFixed(2)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:String(e)}function lg({source:e}){return e==="verified"?null:e==="override"?i.jsx("span",{className:"text-[10px] font-mono px-1.5 py-0.5 rounded border border-amber-dim text-amber whitespace-nowrap",title:"Priced from a rate you entered yourself in Settings",children:"custom price"}):i.jsx("span",{className:"text-[10px] font-mono px-1.5 py-0.5 rounded border border-iron-line text-paper-faint whitespace-nowrap",title:"Priced from LiteLLM's community-maintained rate list, not whydid's own verified table — double-check against your provider's real pricing page",children:"community-sourced"})}function sg({model:e,onSaved:t}){const[n,r]=x.useState(!1),[l,s]=x.useState(""),[o,a]=x.useState(""),[u,c]=x.useState(!1),[m,p]=x.useState(null);if(!n)return i.jsx("button",{className:"text-xs font-mono text-amber hover:underline whitespace-nowrap",onClick:()=>r(!0),children:"Set a price"});async function g(){const v=Number(l),y=Number(o);if(!Number.isFinite(v)||!Number.isFinite(y)||v<0||y<0){p("Enter a non-negative $/M number for both.");return}c(!0),p(null);try{await of({pricingOverrides:{[e]:{inputPerMillion:v,outputPerMillion:y}}}),t()}catch(w){p(w instanceof Error?w.message:"Failed to save")}finally{c(!1)}}return i.jsxs("div",{className:"flex items-center gap-1.5",children:[i.jsx("input",{className:"w-16 bg-iron border border-iron-line rounded px-1.5 py-0.5 text-xs font-mono text-paper text-right outline-none focus:border-amber-dim",placeholder:"$/M in",value:l,onChange:v=>s(v.target.value)}),i.jsx("input",{className:"w-16 bg-iron border border-iron-line rounded px-1.5 py-0.5 text-xs font-mono text-paper text-right outline-none focus:border-amber-dim",placeholder:"$/M out",value:o,onChange:v=>a(v.target.value)}),i.jsx("button",{className:"text-xs font-mono px-2 py-0.5 rounded border border-amber-dim text-amber hover:bg-amber/10 transition-colors disabled:opacity-50",onClick:g,disabled:u,children:u?"…":"Save"}),m&&i.jsx("span",{className:"text-xs text-danger",children:m})]})}const ig={disabled:{border:"border-iron-line",text:"text-paper-faint"},ok:{border:"border-iron-line",text:"text-scope"},warning:{border:"border-amber-dim",text:"text-amber"},exceeded:{border:"border-danger",text:"text-danger"}};function og({budget:e}){if(e.status==="disabled")return i.jsxs("section",{className:"bg-iron-raised border border-iron-line rounded-xl p-4 flex items-center justify-between gap-3 text-sm",children:[i.jsx("span",{className:"text-paper-faint",children:"No monthly AI budget set."}),i.jsx(_e,{to:"/settings",className:"text-xs font-mono text-amber hover:underline whitespace-nowrap",children:"Set a budget →"})]});const t=ig[e.status],n=e.percentUsed!=null?Math.min(100,e.percentUsed):0;return i.jsxs("section",{className:`bg-iron-raised border ${t.border} rounded-xl p-4 space-y-2`,children:[i.jsxs("div",{className:"flex items-center justify-between text-sm",children:[i.jsx("span",{className:`font-mono font-semibold ${t.text}`,children:e.status==="exceeded"?"Monthly budget exceeded":e.status==="warning"?"Approaching monthly budget":"Monthly budget"}),i.jsxs("span",{className:"font-mono text-paper-faint",children:[e.spentUsd!=null?Yl(e.spentUsd):"?"," / ",Yl(e.limitUsd??0)]})]}),i.jsx("div",{className:"h-1.5 rounded-full bg-iron overflow-hidden",children:i.jsx("div",{className:`h-full rounded-full ${e.status==="exceeded"?"bg-danger":e.status==="warning"?"bg-amber":"bg-scope"}`,style:{width:`${n}%`}})}),e.hasUnpricedUsage&&i.jsx("p",{className:"text-xs text-paper-faint",children:"Some usage this month is on an unpriced model — this may understate actual spend."})]})}function ag(){const[e,t]=x.useState(null),[n,r]=x.useState(null),[l,s]=x.useState(null);function o(){uf(30).then(t).catch(c=>s(c instanceof Error?c.message:"Failed to load AI usage")),cf().catch(()=>{}).then(c=>c&&r(c))}if(x.useEffect(o,[]),l)return i.jsx("div",{className:"p-8 text-danger",children:l});if(!e)return i.jsx("div",{className:"p-8 text-paper-dim",children:"Loading…"});const a=e.daily.map(c=>({date:c.date,count:c.inputTokens+c.outputTokens})),u=e.totalInputTokens+e.totalOutputTokens;return i.jsxs("div",{className:"max-w-3xl mx-auto p-4 sm:p-8 space-y-6",children:[i.jsxs("div",{children:[i.jsx("h1",{className:"text-2xl font-semibold text-paper mb-1",children:"AI usage"}),i.jsx("p",{className:"text-sm text-paper-faint max-w-xl",children:"How much whydid itself is calling your configured AI provider to generate checkpoint explanations — separate from your own coding agent's usage, which whydid never sees or meters."})]}),n&&i.jsx(og,{budget:n}),u===0?i.jsxs("div",{className:"bg-iron-raised border border-iron-line rounded-xl p-6 text-sm text-paper-dim space-y-2",children:[i.jsx("p",{className:"text-paper",children:"No AI usage recorded yet."}),i.jsx("p",{className:"text-paper-faint",children:"This fills in once your AI provider is configured (Settings → AI provider) and checkpoints start getting real explanations."})]}):i.jsxs(i.Fragment,{children:[i.jsxs("section",{className:"bg-iron-raised border border-iron-line rounded-xl p-5",children:[i.jsx("div",{className:"text-[11px] font-mono uppercase tracking-wider text-amber-dim mb-4",children:"Estimated spend so far"}),i.jsxs("div",{className:"flex flex-wrap items-end gap-8",children:[i.jsxs("div",{children:[i.jsx(zo,{value:e.totalEstimatedCostUsd!=null?Yl(e.totalEstimatedCostUsd):"?",size:"lg"}),i.jsx("div",{className:"text-[10px] font-mono uppercase tracking-wider text-paper-faint mt-1.5",children:e.hasUnpricedUsage?"Estimated (excludes unpriced models)":"Estimated total"})]}),i.jsxs("div",{children:[i.jsx("div",{className:"font-mono text-xl font-semibold text-paper tabular-nums",children:ol(e.totalInputTokens)}),i.jsx("div",{className:"text-[10px] font-mono uppercase tracking-wider text-paper-faint mt-1",children:"Input tokens"})]}),i.jsxs("div",{children:[i.jsx("div",{className:"font-mono text-xl font-semibold text-paper tabular-nums",children:ol(e.totalOutputTokens)}),i.jsx("div",{className:"text-[10px] font-mono uppercase tracking-wider text-paper-faint mt-1",children:"Output tokens"})]})]}),i.jsx("p",{className:"text-xs text-paper-faint mt-4 pt-4 border-t border-iron-line leading-relaxed",children:e.pricingDisclaimer})]}),i.jsxs("section",{className:"bg-[rgba(0,0,0,0.28)] border border-iron-line rounded-xl p-4 pt-4",children:[i.jsx("div",{className:"text-[11px] font-mono uppercase tracking-wider text-paper-faint px-2 mb-2",children:"Token usage · last 30 days"}),i.jsx(ff,{data:a})]}),i.jsxs("section",{children:[i.jsx("h2",{className:"text-[11px] font-mono uppercase tracking-wider text-paper-faint mb-2",children:"By model"}),i.jsx("div",{className:"divide-y divide-iron-line border border-iron-line rounded-lg overflow-hidden",children:e.byModel.map(c=>i.jsxs("div",{className:"flex items-center gap-3 px-4 py-3",children:[i.jsxs("div",{className:"flex-1 min-w-0",children:[i.jsx("div",{className:"text-sm text-paper font-mono truncate",children:c.model}),i.jsxs("div",{className:"text-[11px] font-mono text-paper-faint mt-0.5",children:[c.calls," call",c.calls===1?"":"s"," · ",ol(c.inputTokens)," in · ",ol(c.outputTokens)," out"]})]}),c.pricingSource&&i.jsx(lg,{source:c.pricingSource}),i.jsx("div",{className:"text-sm font-mono text-paper tabular-nums",children:c.estimatedCostUsd!=null?Yl(c.estimatedCostUsd):i.jsx(sg,{model:c.model,onSaved:o})})]},c.model))})]})]})]})}const ug={x:"X",linkedin:"LinkedIn"};function cg({post:e,index:t,onChange:n}){const[r,l]=x.useState(!1),[s,o]=x.useState(!1);async function a(){try{await navigator.clipboard.writeText(e.content),l(!0),setTimeout(()=>l(!1),1500)}catch{}}async function u(){o(!0);try{n(await mx(e.id,!e.pinned))}catch{}finally{o(!1)}}async function c(){o(!0);try{await hx(e.id),n(null)}catch{o(!1)}}return i.jsxs("div",{className:`whydid-stagger-in border rounded-lg overflow-hidden bg-iron-raised ${e.pinned?"border-amber-dim":"border-iron-line"}`,style:{animationDelay:`${Math.min(t,10)*50}ms`},children:[i.jsxs("div",{className:"flex items-center gap-2 px-4 pt-3",children:[i.jsx("span",{className:`text-xs font-mono px-1.5 py-0.5 rounded border ${e.pinned?"border-amber-dim text-amber":"border-iron-line text-paper-faint"}`,children:ug[e.platform]}),i.jsx("span",{className:"text-[10px] font-mono uppercase tracking-wider text-paper-faint",children:e.source}),e.pinned&&i.jsx("span",{className:"text-[10px] font-mono uppercase tracking-wider text-amber",children:"★ pinned"}),i.jsx("span",{className:"ml-auto text-[11px] font-mono text-paper-faint",children:St(e.createdAt)})]}),i.jsx("p",{className:"px-4 py-3 text-sm text-paper whitespace-pre-wrap leading-relaxed",children:e.content}),i.jsxs("div",{className:"flex items-center gap-2 px-4 pb-3",children:[i.jsx("button",{className:"text-xs font-mono px-2 py-1 rounded border border-iron-line text-paper-dim hover:text-amber hover:border-amber-dim transition-colors disabled:opacity-50",onClick:a,disabled:s,children:r?"✓ Copied":"Copy"}),i.jsx("button",{className:"text-xs font-mono px-2 py-1 rounded border border-iron-line text-paper-dim hover:text-paper hover:border-iron-lit transition-colors disabled:opacity-50",onClick:u,disabled:s,children:e.pinned?"Unpin":"Pin"}),i.jsx("button",{className:"text-xs font-mono px-2 py-1 rounded border border-iron-line text-paper-faint hover:text-danger hover:border-danger transition-colors disabled:opacity-50 ml-auto",onClick:c,disabled:s,children:"Delete"})]})]})}function dg(){const[e,t]=x.useState(null),[n,r]=x.useState(null);x.useEffect(()=>{fx().then(t).catch(s=>r(s instanceof Error?s.message:"Failed to load drafts"))},[]);function l(s,o){t(a=>a&&(o===null?a.filter(u=>u.id!==s):a.map(u=>u.id===s?o:u)))}return n?i.jsx("div",{className:"p-8 text-danger",children:n}):e?i.jsxs("div",{className:"max-w-3xl mx-auto p-4 sm:p-8 space-y-6",children:[i.jsxs("div",{children:[i.jsx("h1",{className:"text-2xl font-semibold text-paper mb-1",children:"Build in public"}),i.jsx("p",{className:"text-sm text-paper-faint max-w-xl",children:`Draft posts generated from your real sessions — the actual prompts and what whydid recorded actually happened. whydid never posts anything for you; copy, edit, post it yourself whenever you're ready. Open a session and use "Draft a post" to generate one on demand, or turn on automatic drafting in Settings.`})]}),e.length===0?i.jsxs("div",{className:"bg-iron-raised border border-iron-line rounded-xl p-6 text-sm text-paper-dim space-y-2",children:[i.jsx("p",{className:"text-paper",children:"No drafts yet."}),i.jsx("p",{className:"text-paper-faint",children:'Open a session from the Sessions page and click "Draft a post," or enable automatic drafting in Settings → Build in public.'})]}):i.jsx("div",{className:"space-y-3",children:e.map((s,o)=>i.jsx(cg,{post:s,index:o,onChange:a=>l(s.id,a)},s.id))})]}):i.jsx("div",{className:"p-8 text-paper-dim",children:"Loading…"})}function fg({message:e}){const t=e.role==="user";return i.jsx("div",{className:`flex ${t?"justify-end":"justify-start"}`,children:i.jsxs("div",{className:`max-w-xl rounded-lg px-4 py-3 ${t?"bg-amber text-iron":"bg-iron-raised border border-iron-line text-paper"}`,children:[i.jsx("p",{className:"text-sm whitespace-pre-wrap leading-relaxed",children:e.content}),e.citedStateIds.length>0&&i.jsx("div",{className:"flex flex-wrap gap-1.5 mt-2 pt-2 border-t border-iron-line/40",children:e.citedStateIds.map(n=>i.jsxs(_e,{to:`/state/${n}`,className:`text-[10px] font-mono px-1.5 py-0.5 rounded border ${t?"border-iron/30 text-iron hover:bg-iron/10":"border-iron-line text-paper-faint hover:text-amber hover:border-amber-dim"}`,children:["#",n.slice(0,8)]},n))})]})})}function pg(){const[e,t]=x.useState(null),[n,r]=x.useState(null),[l,s]=x.useState(null),[o,a]=x.useState(""),[u,c]=x.useState(!1),[m,p]=x.useState(null),[g,v]=x.useState(null),y=x.useRef(null);x.useEffect(()=>{xx().then(d=>{t(d),d.length>0&&r(d[0].id)}).catch(d=>v(d instanceof Error?d.message:"Failed to load conversations"))},[]),x.useEffect(()=>{if(!n){s(null);return}du(n).then(d=>s(d.messages)).catch(d=>p(d instanceof Error?d.message:"Failed to load this conversation"))},[n]),x.useEffect(()=>{var d;(d=y.current)==null||d.scrollIntoView({behavior:"smooth"})},[l]);async function w(){try{const d=await cu();t(h=>[d,...h??[]]),r(d.id)}catch(d){p(d instanceof Error?d.message:"Failed to create a conversation")}}async function N(d){try{await gx(d),t(h=>(h??[]).filter(j=>j.id!==d)),n===d&&r(null)}catch{}}async function f(){const d=o.trim();if(!d||u)return;let h=n;p(null),c(!0);try{if(!h){const E=await cu();t(I=>[E,...I??[]]),h=E.id,r(E.id)}a(""),s(E=>[...E??[],{id:"pending-user",conversationId:h,role:"user",content:d,citedStateIds:[],model:null,inputTokens:null,outputTokens:null,createdAt:new Date().toISOString()}]);const j=await vx(h,d);s(E=>[...(E??[]).filter(I=>I.id!=="pending-user"),j.userMessage,j.assistantMessage]);const k=await du(h);t(E=>{const L=(E??[]).filter(b=>b.id!==h);return[{id:k.id,projectId:k.projectId,title:k.title,createdAt:k.createdAt,updatedAt:k.updatedAt},...L]})}catch(j){s(k=>(k??[]).filter(E=>E.id!=="pending-user")),p(j instanceof Error?j.message:"Failed to send that message"),a(d)}finally{c(!1)}}return g?i.jsx("div",{className:"p-8 text-danger",children:g}):e?i.jsxs("div",{className:"h-full flex flex-col sm:flex-row",children:[i.jsxs("div",{className:"w-full sm:w-72 sm:flex-shrink-0 border-b sm:border-b-0 sm:border-r border-iron-line flex flex-col max-h-48 sm:max-h-none",children:[i.jsx("div",{className:"p-4 border-b border-iron-line",children:i.jsx("button",{className:"w-full px-3 py-2 rounded-md bg-amber text-iron font-semibold text-sm hover:bg-[#ffb066] transition-colors",onClick:w,children:"+ New conversation"})}),i.jsx("div",{className:"flex-1 overflow-y-auto",children:e.length===0?i.jsx("p",{className:"text-xs text-paper-faint p-4",children:"No conversations yet."}):e.map(d=>i.jsxs("div",{className:`group flex items-center gap-2 px-4 py-3 border-b border-iron-line cursor-pointer transition-colors ${n===d.id?"bg-iron-raised":"hover:bg-iron-raised"}`,onClick:()=>r(d.id),children:[i.jsxs("div",{className:"flex-1 min-w-0",children:[i.jsx("div",{className:"text-sm text-paper truncate",children:d.title}),i.jsx("div",{className:"text-[10px] font-mono text-paper-faint mt-0.5",children:St(d.updatedAt)})]}),i.jsx("button",{className:"opacity-0 group-hover:opacity-100 text-paper-faint hover:text-danger text-xs transition-opacity",onClick:h=>{h.stopPropagation(),N(d.id)},"aria-label":"Delete conversation",children:"✕"})]},d.id))})]}),i.jsxs("div",{className:"flex-1 flex flex-col min-w-0",children:[i.jsx("div",{className:"flex-1 overflow-y-auto p-6 space-y-4",children:!n||!l||l.length===0?i.jsx("div",{className:"h-full flex items-center justify-center text-center px-8",children:i.jsxs("div",{children:[i.jsx("p",{className:"text-paper mb-1",children:"Ask anything about this project."}),i.jsx("p",{className:"text-sm text-paper-faint max-w-sm",children:'"What did I do this week?" · "Why did we switch to Stripe?" · "Summarize the auth changes." Answers are grounded in your real checkpoint history, with links back to what they drew from.'})]})}):i.jsxs(i.Fragment,{children:[l.map(d=>i.jsx(fg,{message:d},d.id)),i.jsx("div",{ref:y})]})}),i.jsxs("div",{className:"p-4 border-t border-iron-line",children:[m&&i.jsx("p",{className:"text-xs text-danger mb-2",children:m}),i.jsxs("div",{className:"flex gap-2",children:[i.jsx("input",{className:"flex-1 bg-iron-raised border border-iron-line rounded-md px-3 py-2 text-sm text-paper outline-none focus:border-amber-dim placeholder:text-paper-faint",placeholder:"Ask about this project…",value:o,onChange:d=>a(d.target.value),onKeyDown:d=>{d.key==="Enter"&&!d.shiftKey&&(d.preventDefault(),f())},disabled:u}),i.jsx("button",{className:"px-4 py-2 rounded-md bg-amber text-iron font-semibold text-sm hover:bg-[#ffb066] transition-colors disabled:opacity-50",onClick:f,disabled:u||!o.trim(),children:u?"…":"Ask"})]})]})]})]}):i.jsx("div",{className:"p-8 text-paper-dim",children:"Loading…"})}const Ks=[{id:"noop",label:"None (local only)",envVar:null},{id:"anthropic",label:"Anthropic",envVar:"ANTHROPIC_API_KEY"},{id:"openai",label:"OpenAI",envVar:"OPENAI_API_KEY"}];function al({checked:e,onChange:t,label:n,hint:r}){return i.jsxs("label",{className:"flex items-start gap-3 py-2 cursor-pointer",children:[i.jsx("input",{type:"checkbox",checked:e,onChange:l=>t(l.target.checked),className:"mt-1 accent-amber"}),i.jsxs("div",{children:[i.jsx("div",{className:"text-sm text-paper",children:n}),i.jsx("div",{className:"text-xs text-paper-faint",children:r})]})]})}function mg(){var ce;const[e,t]=x.useState(null),[n,r]=x.useState(!1),[l,s]=x.useState(null),[o,a]=x.useState(null),[u,c]=x.useState(null),[m,p]=x.useState(""),[g,v]=x.useState(!1),[y,w]=x.useState(!1),[N,f]=x.useState(null),[d,h]=x.useState(null),[j,k]=x.useState(!1),[E,I]=x.useState(null),[L,b]=x.useState(""),[_,z]=x.useState(""),[X,J]=x.useState(""),[Me,it]=x.useState(null);function Ge(){lx().then(({providers:S})=>c(S)).catch(()=>{})}x.useEffect(()=>{rx().then(({config:S})=>t(S)).catch(S=>a(S instanceof Error?S.message:"Failed to load settings")),Ge(),cx().then(h).catch(()=>{})},[]);async function ot(){k(!0),I(null);try{h(await dx())}catch(S){I(S instanceof Error?S.message:"Failed to refresh community pricing")}finally{k(!1)}}async function R(){const S=L.trim(),A=Number(_),Be=Number(X);if(!S){it("Enter the exact model id (as it appears in AI Usage or Settings → AI provider).");return}if(!Number.isFinite(A)||!Number.isFinite(Be)||A<0||Be<0){it("Enter a non-negative $/M number for both input and output.");return}it(null),await B({pricingOverrides:{[S]:{inputPerMillion:A,outputPerMillion:Be}}}),b(""),z(""),J("")}async function O(S){await B({pricingOverrides:{[S]:null}})}async function D(S){if(m.trim()){w(!0),f(null);try{const{providers:A}=await sx(S,m.trim());c(A),p(""),v(!1)}catch(A){f(A instanceof Error?A.message:"Failed to save the key")}finally{w(!1)}}}async function Y(S){w(!0),f(null);try{const{providers:A}=await ix(S);c(A)}catch(A){f(A instanceof Error?A.message:"Failed to remove the key")}finally{w(!1)}}async function B(S){r(!0),a(null);try{const A=await of(S);t(A.config),s(Date.now())}catch(A){a(A instanceof Error?A.message:"Failed to save")}finally{r(!1)}}if(!e&&o)return i.jsx("div",{className:"p-8 text-danger",children:o});if(!e)return i.jsx("div",{className:"p-8 text-paper-dim",children:"Loading…"});const $=Ks.find(S=>S.id===e.ai.provider)??Ks[0];return i.jsxs("div",{className:"max-w-2xl mx-auto p-4 sm:p-8 space-y-8",children:[i.jsxs("div",{children:[i.jsx("h1",{className:"text-2xl font-semibold text-paper mb-1",children:"Settings"}),i.jsx("p",{className:"text-sm text-paper-faint",children:"Everything here is stored locally in .whydid/config.json — never sent anywhere."})]}),i.jsxs("section",{className:"bg-iron-raised border border-iron-line rounded-xl p-5 space-y-4",children:[i.jsx("h2",{className:"text-[11px] font-mono uppercase tracking-wider text-amber-dim",children:"AI provider (BYOK)"}),i.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-2",children:Ks.map(S=>i.jsx("button",{className:`px-3 py-2 rounded-md text-sm border transition-colors ${e.ai.provider===S.id?"bg-amber text-iron border-amber font-semibold":"border-iron-line text-paper-dim hover:text-paper"}`,onClick:()=>B({ai:{provider:S.id,model:e.ai.model}}),children:S.label},S.id))}),$.envVar&&i.jsxs("div",{className:"space-y-2.5",children:[(()=>{const S=u==null?void 0:u.find(A=>A.provider===e.ai.provider);return!S||!S.configured?i.jsxs("p",{className:"text-xs font-mono text-danger",children:["No key found. Save one below, or set ",i.jsx("span",{className:"text-paper",children:$.envVar})," in the environment."]}):i.jsxs("div",{className:"flex items-center gap-2 text-xs font-mono",children:[i.jsxs("span",{className:"text-scope",children:["✓ ",S.masked]}),i.jsx("span",{className:"text-paper-faint",children:S.source==="file"?"— saved locally for this project":`— from ${$.envVar} in your environment`}),S.source==="file"&&i.jsx("button",{className:"ml-auto text-paper-faint hover:text-danger disabled:opacity-50",onClick:()=>Y(e.ai.provider),disabled:y,children:"Remove"})]})})(),i.jsxs("div",{className:"flex gap-2",children:[i.jsx("input",{type:g?"text":"password",className:"flex-1 bg-iron border border-iron-line rounded-md px-3 py-2 text-sm text-paper outline-none focus:border-amber-dim font-mono placeholder:text-paper-faint disabled:opacity-50",placeholder:`Paste your ${$.label} API key`,value:m,onChange:S=>p(S.target.value),onKeyDown:S=>S.key==="Enter"&&D(e.ai.provider),disabled:y}),i.jsx("button",{type:"button",className:"px-2.5 rounded-md border border-iron-line text-xs font-mono text-paper-dim hover:text-paper",onClick:()=>v(S=>!S),tabIndex:-1,children:g?"Hide":"Show"}),i.jsx("button",{className:"px-3 py-2 rounded-md bg-amber text-iron text-xs font-mono font-semibold hover:bg-[#ffb066] disabled:opacity-50 transition-colors",onClick:()=>D(e.ai.provider),disabled:y||!m.trim(),children:y?"Saving…":"Save key"})]}),N&&i.jsx("p",{className:"text-xs text-danger",children:N}),i.jsxs("p",{className:"text-[11px] text-paper-faint",children:["Saved to ",i.jsx("code",{className:"text-paper-dim",children:".whydid/secrets.json"})," on this machine only — never committed, never sent anywhere except to ",$.label," itself when generating an annotation. Takes precedence over ",$.envVar," if both are set."]})]}),i.jsxs("div",{children:[i.jsx("label",{className:"text-xs font-mono text-paper-faint block mb-1",children:"Model (optional — leave blank for the provider's default)"}),i.jsx("input",{className:"w-full bg-iron border border-iron-line rounded-md px-3 py-2 text-sm text-paper outline-none focus:border-amber-dim font-mono placeholder:text-paper-faint",value:e.ai.model,placeholder:e.ai.provider==="anthropic"?"claude-sonnet-5":e.ai.provider==="openai"?"gpt-4o":"",onChange:S=>t({...e,ai:{...e.ai,model:S.target.value}}),onBlur:()=>B({ai:e.ai}),disabled:e.ai.provider==="noop"})]})]}),i.jsxs("section",{className:"bg-iron-raised border border-iron-line rounded-xl p-5 divide-y divide-iron-line",children:[i.jsx("h2",{className:"text-[11px] font-mono uppercase tracking-wider text-amber-dim mb-1",children:"AI context (spec §21)"}),i.jsx(al,{checked:e.privacy.sendPrompts,onChange:S=>B({privacy:{...e.privacy,sendPrompts:S}}),label:"Send AI prompts",hint:"Include your actual instruction to the coding agent as context for annotations."}),i.jsx(al,{checked:e.privacy.sendDiffs,onChange:S=>B({privacy:{...e.privacy,sendDiffs:S}}),label:"Send changed-file diffs",hint:"Without this, only file names and your prompt are sent — no code content."}),i.jsx("div",{className:"pt-2 text-xs text-paper-faint",children:"Unchanged source and full-repository context are never sent, regardless of these settings."})]}),i.jsxs("section",{className:"bg-iron-raised border border-iron-line rounded-xl p-5",children:[i.jsx("h2",{className:"text-[11px] font-mono uppercase tracking-wider text-amber-dim mb-1",children:"Context files"}),i.jsx(al,{checked:e.contextTree.enabled,onChange:S=>B({contextTree:{enabled:S}}),label:"Write CONTEXT.md files",hint:"Auto-writes a CONTEXT.md next to the code it explains, so any AI tool reading this repo sees the real reasoning. whydid never commits these for you — they show up as normal files for your own git workflow."})]}),i.jsxs("section",{className:"bg-iron-raised border border-iron-line rounded-xl p-5 space-y-3",children:[i.jsx("h2",{className:"text-[11px] font-mono uppercase tracking-wider text-amber-dim mb-1",children:"Build in public"}),i.jsx(al,{checked:e.buildInPublic.enabled,onChange:S=>B({buildInPublic:{...e.buildInPublic,enabled:S}}),label:"Automatically draft posts",hint:"Drafts a post for X once a session wraps up, only when whydid judges it genuinely worth sharing. Spends an extra AI call per session — off by default. You can always draft one manually from a session either way."}),i.jsxs("div",{children:[i.jsx("label",{className:"text-xs font-mono text-paper-faint block mb-1",children:"Auto-delete unpinned drafts after (days)"}),i.jsx("input",{type:"number",min:0,className:"w-32 bg-iron border border-iron-line rounded-md px-3 py-2 text-sm text-paper outline-none focus:border-amber-dim font-mono",value:e.buildInPublic.retentionDays,onChange:S=>t({...e,buildInPublic:{...e.buildInPublic,retentionDays:Number(S.target.value)}}),onBlur:()=>B({buildInPublic:e.buildInPublic})}),i.jsx("p",{className:"text-xs text-paper-faint mt-1",children:"0 keeps every draft forever. Pinned drafts are never auto-deleted regardless of this setting."})]})]}),i.jsxs("section",{className:"bg-iron-raised border border-iron-line rounded-xl p-5 space-y-3",children:[i.jsx("h2",{className:"text-[11px] font-mono uppercase tracking-wider text-amber-dim mb-1",children:"AI spend budget"}),i.jsx("p",{className:"text-xs text-paper-faint",children:"Purely informational — whydid never blocks a call or switches providers on its own. Tracks only whydid's own AI usage (checkpoint annotations, chat, build-in-public), never your coding agent's."}),i.jsxs("div",{className:"flex items-end gap-4",children:[i.jsxs("div",{children:[i.jsx("label",{className:"text-xs font-mono text-paper-faint block mb-1",children:"Monthly limit (USD)"}),i.jsx("input",{type:"number",min:0,step:"0.01",placeholder:"No limit",className:"w-32 bg-iron border border-iron-line rounded-md px-3 py-2 text-sm text-paper outline-none focus:border-amber-dim font-mono placeholder:text-paper-faint",value:e.aiBudget.monthlyLimitUsd??"",onChange:S=>t({...e,aiBudget:{...e.aiBudget,monthlyLimitUsd:S.target.value===""?null:Number(S.target.value)}}),onBlur:()=>B({aiBudget:e.aiBudget})})]}),i.jsxs("div",{children:[i.jsx("label",{className:"text-xs font-mono text-paper-faint block mb-1",children:"Alert threshold (%)"}),i.jsx("input",{type:"number",min:1,max:100,className:"w-24 bg-iron border border-iron-line rounded-md px-3 py-2 text-sm text-paper outline-none focus:border-amber-dim font-mono disabled:opacity-50",value:e.aiBudget.alertThresholdPercent,disabled:e.aiBudget.monthlyLimitUsd==null,onChange:S=>t({...e,aiBudget:{...e.aiBudget,alertThresholdPercent:Number(S.target.value)}}),onBlur:()=>B({aiBudget:e.aiBudget})})]})]}),i.jsx("p",{className:"text-xs text-paper-faint",children:"Leave the limit blank to disable budget tracking entirely."})]}),i.jsxs("section",{className:"bg-iron-raised border border-iron-line rounded-xl p-5 space-y-4",children:[i.jsxs("div",{children:[i.jsx("h2",{className:"text-[11px] font-mono uppercase tracking-wider text-amber-dim mb-1",children:"Model pricing"}),i.jsx("p",{className:"text-xs text-paper-faint",children:"Neither Anthropic nor OpenAI publish pricing through an API. whydid ships a small, hand-verified table (see AI Usage), and can fill gaps from LiteLLM's community-maintained rate list — never automatically, only when you ask. Your own price below always wins over both."})]}),i.jsxs("div",{className:"flex items-center justify-between gap-3 pt-3 border-t border-iron-line",children:[i.jsx("div",{className:"text-xs text-paper-dim",children:d!=null&&d.fetchedAt?i.jsxs(i.Fragment,{children:["Community pricing last refreshed ",St(d.fetchedAt)," · covers ",d.modelCount," model",d.modelCount===1?"":"s"]}):"Community pricing has never been refreshed on this machine."}),i.jsx("button",{className:"px-2.5 py-1 rounded border border-iron-line text-xs font-mono text-paper-dim hover:text-amber hover:border-amber-dim transition-colors disabled:opacity-50 whitespace-nowrap",onClick:ot,disabled:j,children:j?"Refreshing…":"Refresh now"})]}),E&&i.jsx("p",{className:"text-xs text-danger",children:E}),i.jsxs("div",{className:"pt-3 border-t border-iron-line space-y-2",children:[i.jsx("div",{className:"text-xs font-mono text-paper-faint",children:"Your custom prices"}),Object.keys(e.pricingOverrides).length===0?i.jsx("p",{className:"text-xs text-paper-faint italic",children:'None set. Add one below, or use "Set a price" next to an unpriced model on the AI Usage page.'}):i.jsx("div",{className:"space-y-1.5",children:Object.entries(e.pricingOverrides).map(([S,A])=>i.jsxs("div",{className:"flex items-center gap-2 text-xs font-mono",children:[i.jsx("span",{className:"flex-1 text-paper truncate",children:S}),i.jsxs("span",{className:"text-paper-faint whitespace-nowrap",children:["$",A.inputPerMillion,"/M in · $",A.outputPerMillion,"/M out"]}),i.jsx("button",{className:"text-danger hover:underline",onClick:()=>O(S),children:"Remove"})]},S))}),i.jsxs("div",{className:"flex items-center gap-2 pt-1",children:[i.jsx("input",{className:"flex-1 min-w-0 bg-iron border border-iron-line rounded px-2 py-1 text-xs font-mono text-paper outline-none focus:border-amber-dim placeholder:text-paper-faint",placeholder:"model id",value:L,onChange:S=>b(S.target.value)}),i.jsx("input",{className:"w-20 bg-iron border border-iron-line rounded px-2 py-1 text-xs font-mono text-paper text-right outline-none focus:border-amber-dim placeholder:text-paper-faint",placeholder:"$/M in",value:_,onChange:S=>z(S.target.value)}),i.jsx("input",{className:"w-20 bg-iron border border-iron-line rounded px-2 py-1 text-xs font-mono text-paper text-right outline-none focus:border-amber-dim placeholder:text-paper-faint",placeholder:"$/M out",value:X,onChange:S=>J(S.target.value)}),i.jsx("button",{className:"px-2.5 py-1 rounded border border-amber-dim text-xs font-mono text-amber hover:bg-amber/10 transition-colors whitespace-nowrap",onClick:R,children:"Add"})]}),Me&&i.jsx("p",{className:"text-xs text-danger",children:Me})]})]}),i.jsxs("section",{className:"bg-iron-raised border border-iron-line rounded-xl p-5 space-y-3",children:[i.jsx("h2",{className:"text-[11px] font-mono uppercase tracking-wider text-amber-dim",children:"Test command"}),i.jsxs("p",{className:"text-xs text-paper-faint",children:["Run by ",i.jsx("code",{className:"text-paper",children:"whydid test"})," and surfaced in the recap strip."]}),i.jsx("input",{className:"w-full bg-iron border border-iron-line rounded-md px-3 py-2 text-sm text-paper outline-none focus:border-amber-dim font-mono placeholder:text-paper-faint",placeholder:"npm test",value:((ce=e.test)==null?void 0:ce.command)??"",onChange:S=>t({...e,test:{command:S.target.value,mode:"manual"}}),onBlur:()=>{var S;return B({test:(S=e.test)!=null&&S.command?e.test:null})}})]}),i.jsxs("div",{className:"flex items-center gap-3 text-xs font-mono text-paper-faint h-4",children:[n&&i.jsx("span",{children:"Saving…"}),!n&&l&&Date.now()-l<3e3&&i.jsx("span",{className:"text-scope",children:"✓ Saved"}),o&&i.jsx("span",{className:"text-danger",children:o})]})]})}function hg(){return i.jsx(yx,{children:i.jsxs(Rh,{children:[i.jsx(Oe,{path:"/",element:i.jsx(bx,{})}),i.jsx(Oe,{path:"/timeline",element:i.jsx(Ox,{})}),i.jsx(Oe,{path:"/graph",element:i.jsx(Ux,{})}),i.jsx(Oe,{path:"/state/:id",element:i.jsx(Yx,{})}),i.jsx(Oe,{path:"/sessions",element:i.jsx(Gx,{})}),i.jsx(Oe,{path:"/sessions/:id",element:i.jsx(qx,{})}),i.jsx(Oe,{path:"/context",element:i.jsx(tg,{})}),i.jsx(Oe,{path:"/continuity",element:i.jsx(rg,{})}),i.jsx(Oe,{path:"/ai-usage",element:i.jsx(ag,{})}),i.jsx(Oe,{path:"/build-in-public",element:i.jsx(dg,{})}),i.jsx(Oe,{path:"/chat",element:i.jsx(pg,{})}),i.jsx(Oe,{path:"/settings",element:i.jsx(mg,{})})]})})}const xg=void 0;Qs.createRoot(document.getElementById("root")).render(i.jsx(Au.StrictMode,{children:i.jsx(zh,{basename:xg,children:i.jsx(hg,{})})}));