@aku11i/phantom 6.3.0-3 → 6.3.0-4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/app/server/{app-BLBOjh4e.mjs → app-DS_9Jsep.mjs} +433 -33
- package/app/server/app-DS_9Jsep.mjs.map +1 -0
- package/app/server/index.mjs +1 -1
- package/app/server/start.mjs +1 -1
- package/app/web/assets/index-CxSrPVaP.css +2 -0
- package/app/web/assets/index-D1nPzGgA.js +52 -0
- package/app/web/index.html +2 -2
- package/package.json +1 -1
- package/phantom.js +2 -2
- package/app/server/app-BLBOjh4e.mjs.map +0 -1
- package/app/web/assets/index-DfF5Sezp.css +0 -2
- package/app/web/assets/index-IIn3YvIM.js +0 -52
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),s=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},c=(n,r,a)=>(a=n==null?{}:e(i(n)),s(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var l=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.iterator;function m(e){return typeof e!=`object`||!e?null:(e=p&&e[p]||e[`@@iterator`],typeof e==`function`?e:null)}var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,_={};function v(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}v.prototype.isReactComponent={},v.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function y(){}y.prototype=v.prototype;function b(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}var x=b.prototype=new y;x.constructor=b,g(x,v.prototype),x.isPureReactComponent=!0;var S=Array.isArray;function C(){}var w={H:null,A:null,T:null,S:null},T=Object.prototype.hasOwnProperty;function E(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function D(e,t){return E(e.type,t,e.props)}function O(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function k(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var A=/\/+/g;function j(e,t){return typeof e==`object`&&e&&e.key!=null?k(``+e.key):t.toString(36)}function M(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(C,C):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function ee(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,ee(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+j(e,0):a,S(o)?(i=``,c!=null&&(i=c.replace(A,`$&/`)+`/`),ee(o,r,i,``,function(e){return e})):o!=null&&(O(o)&&(o=D(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(A,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(S(e))for(var u=0;u<e.length;u++)a=e[u],s=l+j(a,u),c+=ee(a,r,i,s,o);else if(u=m(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+j(a,u++),c+=ee(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return ee(M(e),r,i,a,o);throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`)}return c}function N(e,t,n){if(e==null)return e;var r=[],i=0;return ee(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function te(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t)},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var P=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},F={map:N,forEach:function(e,t,n){N(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return N(e,function(){t++}),t},toArray:function(e){return N(e,function(e){return e})||[]},only:function(e){if(!O(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=F,e.Component=v,e.Fragment=r,e.Profiler=a,e.PureComponent=b,e.StrictMode=i,e.Suspense=l,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=w,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return w.H.useMemoCache(e)}},e.cache=function(e){return function(){return e.apply(null,arguments)}},e.cacheSignal=function(){return null},e.cloneElement=function(e,t,n){if(e==null)throw Error(`The argument must be a React element, but you passed `+e+`.`);var r=g({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!T.call(t,a)||a===`key`||a===`__self`||a===`__source`||a===`ref`&&t.ref===void 0||(r[a]=t[a]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];r.children=o}return E(e.type,i,r)},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:o,_context:e},e},e.createElement=function(e,t,n){var r,i={},a=null;if(t!=null)for(r in t.key!==void 0&&(a=``+t.key),t)T.call(t,r)&&r!==`key`&&r!==`__self`&&r!==`__source`&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var s=Array(o),c=0;c<o;c++)s[c]=arguments[c+2];i.children=s}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return E(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=O,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:te}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=function(e){var t=w.T,n={};w.T=n;try{var r=e(),i=w.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(C,P)}catch(e){P(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),w.T=t}},e.unstable_useCacheRefresh=function(){return w.H.useCacheRefresh()},e.use=function(e){return w.H.use(e)},e.useActionState=function(e,t,n){return w.H.useActionState(e,t,n)},e.useCallback=function(e,t){return w.H.useCallback(e,t)},e.useContext=function(e){return w.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return w.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return w.H.useEffect(e,t)},e.useEffectEvent=function(e){return w.H.useEffectEvent(e)},e.useId=function(){return w.H.useId()},e.useImperativeHandle=function(e,t,n){return w.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return w.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return w.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return w.H.useMemo(e,t)},e.useOptimistic=function(e,t){return w.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return w.H.useReducer(e,t,n)},e.useRef=function(e){return w.H.useRef(e)},e.useState=function(e){return w.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return w.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return w.H.useTransition()},e.version=`19.2.5`})),u=o(((e,t)=>{t.exports=l()})),d=o((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m)if(n(c)!==null)m=!0,S||(S=!0,O());else{var t=n(l);t!==null&&j(x,t.startTime-e)}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-T<w)}function D(){if(g=!1,S){var t=e.unstable_now();T=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&E());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&j(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?O():S=!1}}}var O;if(typeof y==`function`)O=function(){y(D)};else if(typeof MessageChannel<`u`){var k=new MessageChannel,A=k.port2;k.port1.onmessage=D,O=function(){A.postMessage(null)}}else O=function(){_(D,0)};function j(t,n){C=_(function(){t(e.unstable_now())},n)}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(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):w=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,j(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,O()))),r},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),f=o(((e,t)=>{t.exports=d()})),p=o((e=>{var t=u();function n(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function r(){}var i={d:{f:r,r:function(){throw Error(n(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},a=Symbol.for(`react.portal`);function o(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:r==null?null:``+r,children:e,containerInfo:t,implementation:n}}var s=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function c(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,e.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(n(299));return o(e,t,null,r)},e.flushSync=function(e){var t=s.T,n=i.p;try{if(s.T=null,i.p=2,e)return e()}finally{s.T=t,i.p=n,i.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,i.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&i.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=c(n,t.crossOrigin),a=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?i.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:a,fetchPriority:o}):n===`script`&&i.d.X(e,{crossOrigin:r,integrity:a,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`)if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=c(t.as,t.crossOrigin);i.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0})}}else t??i.d.M(e)},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=c(n,t.crossOrigin);i.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`)if(t){var n=c(t.as,t.crossOrigin);i.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0})}else i.d.m(e)},e.requestFormReset=function(e){i.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return s.H.useFormState(e,t,n)},e.useFormStatus=function(){return s.H.useHostTransitionStatus()},e.version=`19.2.5`})),m=o(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=p()})),h=o((e=>{var t=f(),n=u(),r=m();function i(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function a(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function o(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 s(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 c(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function l(e){if(o(e)!==e)throw Error(i(188))}function d(e){var t=e.alternate;if(!t){if(t=o(e),t===null)throw Error(i(188));return t===e?e:null}for(var n=e,r=t;;){var a=n.return;if(a===null)break;var s=a.alternate;if(s===null){if(r=a.return,r!==null){n=r;continue}break}if(a.child===s.child){for(s=a.child;s;){if(s===n)return l(a),e;if(s===r)return l(a),t;s=s.sibling}throw Error(i(188))}if(n.return!==r.return)n=a,r=s;else{for(var c=!1,u=a.child;u;){if(u===n){c=!0,n=a,r=s;break}if(u===r){c=!0,r=a,n=s;break}u=u.sibling}if(!c){for(u=s.child;u;){if(u===n){c=!0,n=s,r=a;break}if(u===r){c=!0,r=s,n=a;break}u=u.sibling}if(!c)throw Error(i(189))}}if(n.alternate!==r)throw Error(i(190))}if(n.tag!==3)throw Error(i(188));return n.stateNode.current===n?e:t}function p(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=p(e),t!==null)return t;e=e.sibling}return null}var h=Object.assign,g=Symbol.for(`react.element`),_=Symbol.for(`react.transitional.element`),v=Symbol.for(`react.portal`),y=Symbol.for(`react.fragment`),b=Symbol.for(`react.strict_mode`),x=Symbol.for(`react.profiler`),S=Symbol.for(`react.consumer`),C=Symbol.for(`react.context`),w=Symbol.for(`react.forward_ref`),T=Symbol.for(`react.suspense`),E=Symbol.for(`react.suspense_list`),D=Symbol.for(`react.memo`),O=Symbol.for(`react.lazy`),k=Symbol.for(`react.activity`),A=Symbol.for(`react.memo_cache_sentinel`),j=Symbol.iterator;function M(e){return typeof e!=`object`||!e?null:(e=j&&e[j]||e[`@@iterator`],typeof e==`function`?e:null)}var ee=Symbol.for(`react.client.reference`);function N(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===ee?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case y:return`Fragment`;case x:return`Profiler`;case b:return`StrictMode`;case T:return`Suspense`;case E:return`SuspenseList`;case k:return`Activity`}if(typeof e==`object`)switch(e.$$typeof){case v:return`Portal`;case C:return e.displayName||`Context`;case S:return(e._context.displayName||`Context`)+`.Consumer`;case w:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case D:return t=e.displayName||null,t===null?N(e.type)||`Memo`:t;case O:t=e._payload,e=e._init;try{return N(e(t))}catch{}}return null}var te=Array.isArray,P=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,F=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ne={pending:!1,data:null,method:null,action:null},re=[],ie=-1;function ae(e){return{current:e}}function I(e){0>ie||(e.current=re[ie],re[ie]=null,ie--)}function L(e,t){ie++,re[ie]=e.current,e.current=t}var oe=ae(null),se=ae(null),ce=ae(null),le=ae(null);function ue(e,t){switch(L(ce,t),L(se,e),L(oe,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Vd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Vd(t),e=Hd(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}I(oe),L(oe,e)}function de(){I(oe),I(se),I(ce)}function fe(e){e.memoizedState!==null&&L(le,e);var t=oe.current,n=Hd(t,e.type);t!==n&&(L(se,e),L(oe,n))}function pe(e){se.current===e&&(I(oe),I(se)),le.current===e&&(I(le),Qf._currentValue=ne)}var me,he;function ge(e){if(me===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);me=t&&t[1]||``,he=-1<e.stack.indexOf(`
|
|
2
|
+
at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
|
|
3
|
+
`+me+e+he}var _e=!1;function ve(e,t){if(!e||_e)return``;_e=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,`props`,{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}e.call(n.prototype)}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,`name`,{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(`
|
|
4
|
+
`),l=s.split(`
|
|
5
|
+
`);for(i=r=0;r<c.length&&!c[r].includes(`DetermineComponentFrameRoot`);)r++;for(;i<l.length&&!l[i].includes(`DetermineComponentFrameRoot`);)i++;if(r===c.length||i===l.length)for(r=c.length-1,i=l.length-1;1<=r&&0<=i&&c[r]!==l[i];)i--;for(;1<=r&&0<=i;r--,i--)if(c[r]!==l[i]){if(r!==1||i!==1)do if(r--,i--,0>i||c[r]!==l[i]){var u=`
|
|
6
|
+
`+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(`<anonymous>`)&&(u=u.replace(`<anonymous>`,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{_e=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?ge(n):``}function ye(e,t){switch(e.tag){case 26:case 27:case 5:return ge(e.type);case 16:return ge(`Lazy`);case 13:return e.child!==t&&t!==null?ge(`Suspense Fallback`):ge(`Suspense`);case 19:return ge(`SuspenseList`);case 0:case 15:return ve(e.type,!1);case 11:return ve(e.type.render,!1);case 1:return ve(e.type,!0);case 31:return ge(`Activity`);default:return``}}function be(e){try{var t=``,n=null;do t+=ye(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
|
|
7
|
+
Error generating stack: `+e.message+`
|
|
8
|
+
`+e.stack}}var xe=Object.prototype.hasOwnProperty,Se=t.unstable_scheduleCallback,Ce=t.unstable_cancelCallback,we=t.unstable_shouldYield,Te=t.unstable_requestPaint,Ee=t.unstable_now,De=t.unstable_getCurrentPriorityLevel,Oe=t.unstable_ImmediatePriority,ke=t.unstable_UserBlockingPriority,Ae=t.unstable_NormalPriority,je=t.unstable_LowPriority,Me=t.unstable_IdlePriority,Ne=t.log,Pe=t.unstable_setDisableYieldValue,Fe=null,Ie=null;function R(e){if(typeof Ne==`function`&&Pe(e),Ie&&typeof Ie.setStrictMode==`function`)try{Ie.setStrictMode(Fe,e)}catch{}}var z=Math.clz32?Math.clz32:ze,Le=Math.log,Re=Math.LN2;function ze(e){return e>>>=0,e===0?32:31-(Le(e)/Re|0)|0}var Be=256,Ve=262144,He=4194304;function Ue(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function We(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=r&134217727;return s===0?(s=r&~a,s===0?o===0?n||(n=r&~e,n!==0&&(i=Ue(n))):i=Ue(o):i=Ue(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=Ue(n))):i=Ue(o)):i=Ue(r)),i===0?0:t!==0&&t!==i&&(t&a)===0&&(a=i&-i,n=t&-t,a>=n||a===32&&n&4194048)?t:i}function Ge(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Ke(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function qe(){var e=He;return He<<=1,!(He&62914560)&&(He=4194304),e}function Je(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Ye(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Xe(e,t,n,r,i,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,c=e.expirationTimes,l=e.hiddenUpdates;for(n=o&~n;0<n;){var u=31-z(n),d=1<<u;s[u]=0,c[u]=-1;var f=l[u];if(f!==null)for(l[u]=null,u=0;u<f.length;u++){var p=f[u];p!==null&&(p.lane&=-536870913)}n&=~d}r!==0&&Ze(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function Ze(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-z(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function Qe(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-z(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function B(e,t){var n=t&-t;return n=n&42?1:$e(n),(n&(e.suspendedLanes|t))===0?n:0}function $e(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function et(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function tt(){var e=F.p;return e===0?(e=window.event,e===void 0?32:mp(e.type)):e}function nt(e,t){var n=F.p;try{return F.p=e,t()}finally{F.p=n}}var rt=Math.random().toString(36).slice(2),it=`__reactFiber$`+rt,at=`__reactProps$`+rt,ot=`__reactContainer$`+rt,st=`__reactEvents$`+rt,ct=`__reactListeners$`+rt,lt=`__reactHandles$`+rt,ut=`__reactResources$`+rt,dt=`__reactMarker$`+rt;function ft(e){delete e[it],delete e[at],delete e[st],delete e[ct],delete e[lt]}function pt(e){var t=e[it];if(t)return t;for(var n=e.parentNode;n;){if(t=n[ot]||n[it]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=df(e);e!==null;){if(n=e[it])return n;e=df(e)}return t}e=n,n=e.parentNode}return null}function mt(e){if(e=e[it]||e[ot]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function ht(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function gt(e){var t=e[ut];return t||=e[ut]={hoistableStyles:new Map,hoistableScripts:new Map},t}function _t(e){e[dt]=!0}var vt=new Set,yt={};function bt(e,t){xt(e,t),xt(e+`Capture`,t)}function xt(e,t){for(yt[e]=t,e=0;e<t.length;e++)vt.add(t[e])}var St=RegExp(`^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$`),Ct={},wt={};function Tt(e){return xe.call(wt,e)?!0:xe.call(Ct,e)?!1:St.test(e)?wt[e]=!0:(Ct[e]=!0,!1)}function Et(e,t,n){if(Tt(t))if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:e.removeAttribute(t);return;case`boolean`:var r=t.toLowerCase().slice(0,5);if(r!==`data-`&&r!==`aria-`){e.removeAttribute(t);return}}e.setAttribute(t,``+n)}}function Dt(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(t);return}e.setAttribute(t,``+n)}}function Ot(e,t,n,r){if(r===null)e.removeAttribute(n);else{switch(typeof r){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(n);return}e.setAttributeNS(t,n,``+r)}}function kt(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function At(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function jt(e,t,n){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&r!==void 0&&typeof r.get==`function`&&typeof r.set==`function`){var i=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){n=``+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(e){n=``+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Mt(e){if(!e._valueTracker){var t=At(e)?`checked`:`value`;e._valueTracker=jt(e,t,``+e[t])}}function Nt(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=At(e)?e.checked?`true`:`false`:e.value),e=r,e===n?!1:(t.setValue(e),!0)}function Pt(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}var Ft=/[\n"\\]/g;function It(e){return e.replace(Ft,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function Lt(e,t,n,r,i,a,o,s){e.name=``,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`?e.type=o:e.removeAttribute(`type`),t==null?o!==`submit`&&o!==`reset`||e.removeAttribute(`value`):o===`number`?(t===0&&e.value===``||e.value!=t)&&(e.value=``+kt(t)):e.value!==``+kt(t)&&(e.value=``+kt(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):zt(e,o,kt(n)):zt(e,o,kt(t)),i==null&&a!=null&&(e.defaultChecked=!!a),i!=null&&(e.checked=i&&typeof i!=`function`&&typeof i!=`symbol`),s!=null&&typeof s!=`function`&&typeof s!=`symbol`&&typeof s!=`boolean`?e.name=``+kt(s):e.removeAttribute(`name`)}function Rt(e,t,n,r,i,a,o,s){if(a!=null&&typeof a!=`function`&&typeof a!=`symbol`&&typeof a!=`boolean`&&(e.type=a),t!=null||n!=null){if(!(a!==`submit`&&a!==`reset`||t!=null)){Mt(e);return}n=n==null?``:``+kt(n),t=t==null?n:``+kt(t),s||t===e.value||(e.value=t),e.defaultValue=t}r??=i,r=typeof r!=`function`&&typeof r!=`symbol`&&!!r,e.checked=s?e.checked:!!r,e.defaultChecked=!!r,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`&&(e.name=o),Mt(e)}function zt(e,t,n){t===`number`&&Pt(e.ownerDocument)===e||e.defaultValue===``+n||(e.defaultValue=``+n)}function Bt(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t[`$`+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty(`$`+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=``+kt(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function Vt(e,t,n){if(t!=null&&(t=``+kt(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n==null?``:``+kt(n)}function Ht(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(te(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n??=``,t=n}n=kt(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),Mt(e)}function Ut(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Wt=new Set(`animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp`.split(` `));function Gt(e,t,n){var r=t.indexOf(`--`)===0;n==null||typeof n==`boolean`||n===``?r?e.setProperty(t,``):t===`float`?e.cssFloat=``:e[t]=``:r?e.setProperty(t,n):typeof n!=`number`||n===0||Wt.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function Kt(e,t,n){if(t!=null&&typeof t!=`object`)throw Error(i(62));if(e=e.style,n!=null){for(var r in n)!n.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf(`--`)===0?e.setProperty(r,``):r===`float`?e.cssFloat=``:e[r]=``);for(var a in t)r=t[a],t.hasOwnProperty(a)&&n[a]!==r&&Gt(e,a,r)}else for(var o in t)t.hasOwnProperty(o)&&Gt(e,o,t[o])}function qt(e){if(e.indexOf(`-`)===-1)return!1;switch(e){case`annotation-xml`:case`color-profile`:case`font-face`:case`font-face-src`:case`font-face-uri`:case`font-face-format`:case`font-face-name`:case`missing-glyph`:return!1;default:return!0}}var Jt=new Map([[`acceptCharset`,`accept-charset`],[`htmlFor`,`for`],[`httpEquiv`,`http-equiv`],[`crossOrigin`,`crossorigin`],[`accentHeight`,`accent-height`],[`alignmentBaseline`,`alignment-baseline`],[`arabicForm`,`arabic-form`],[`baselineShift`,`baseline-shift`],[`capHeight`,`cap-height`],[`clipPath`,`clip-path`],[`clipRule`,`clip-rule`],[`colorInterpolation`,`color-interpolation`],[`colorInterpolationFilters`,`color-interpolation-filters`],[`colorProfile`,`color-profile`],[`colorRendering`,`color-rendering`],[`dominantBaseline`,`dominant-baseline`],[`enableBackground`,`enable-background`],[`fillOpacity`,`fill-opacity`],[`fillRule`,`fill-rule`],[`floodColor`,`flood-color`],[`floodOpacity`,`flood-opacity`],[`fontFamily`,`font-family`],[`fontSize`,`font-size`],[`fontSizeAdjust`,`font-size-adjust`],[`fontStretch`,`font-stretch`],[`fontStyle`,`font-style`],[`fontVariant`,`font-variant`],[`fontWeight`,`font-weight`],[`glyphName`,`glyph-name`],[`glyphOrientationHorizontal`,`glyph-orientation-horizontal`],[`glyphOrientationVertical`,`glyph-orientation-vertical`],[`horizAdvX`,`horiz-adv-x`],[`horizOriginX`,`horiz-origin-x`],[`imageRendering`,`image-rendering`],[`letterSpacing`,`letter-spacing`],[`lightingColor`,`lighting-color`],[`markerEnd`,`marker-end`],[`markerMid`,`marker-mid`],[`markerStart`,`marker-start`],[`overlinePosition`,`overline-position`],[`overlineThickness`,`overline-thickness`],[`paintOrder`,`paint-order`],[`panose-1`,`panose-1`],[`pointerEvents`,`pointer-events`],[`renderingIntent`,`rendering-intent`],[`shapeRendering`,`shape-rendering`],[`stopColor`,`stop-color`],[`stopOpacity`,`stop-opacity`],[`strikethroughPosition`,`strikethrough-position`],[`strikethroughThickness`,`strikethrough-thickness`],[`strokeDasharray`,`stroke-dasharray`],[`strokeDashoffset`,`stroke-dashoffset`],[`strokeLinecap`,`stroke-linecap`],[`strokeLinejoin`,`stroke-linejoin`],[`strokeMiterlimit`,`stroke-miterlimit`],[`strokeOpacity`,`stroke-opacity`],[`strokeWidth`,`stroke-width`],[`textAnchor`,`text-anchor`],[`textDecoration`,`text-decoration`],[`textRendering`,`text-rendering`],[`transformOrigin`,`transform-origin`],[`underlinePosition`,`underline-position`],[`underlineThickness`,`underline-thickness`],[`unicodeBidi`,`unicode-bidi`],[`unicodeRange`,`unicode-range`],[`unitsPerEm`,`units-per-em`],[`vAlphabetic`,`v-alphabetic`],[`vHanging`,`v-hanging`],[`vIdeographic`,`v-ideographic`],[`vMathematical`,`v-mathematical`],[`vectorEffect`,`vector-effect`],[`vertAdvY`,`vert-adv-y`],[`vertOriginX`,`vert-origin-x`],[`vertOriginY`,`vert-origin-y`],[`wordSpacing`,`word-spacing`],[`writingMode`,`writing-mode`],[`xmlnsXlink`,`xmlns:xlink`],[`xHeight`,`x-height`]]),Yt=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Xt(e){return Yt.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function Zt(){}var Qt=null;function $t(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var en=null,tn=null;function V(e){var t=mt(e);if(t&&(e=t.stateNode)){var n=e[at]||null;a:switch(e=t.stateNode,t.type){case`input`:if(Lt(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type===`radio`&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll(`input[name="`+It(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[at]||null;if(!a)throw Error(i(90));Lt(r,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name)}}for(t=0;t<n.length;t++)r=n[t],r.form===e.form&&Nt(r)}break a;case`textarea`:Vt(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&Bt(e,!!n.multiple,t,!1)}}}var nn=!1;function rn(e,t,n){if(nn)return e(t,n);nn=!0;try{return e(t)}finally{if(nn=!1,(en!==null||tn!==null)&&(vu(),en&&(t=en,e=tn,tn=en=null,V(t),e)))for(t=0;t<e.length;t++)V(e[t])}}function an(e,t){var n=e.stateNode;if(n===null)return null;var r=n[at]||null;if(r===null)return null;n=r[t];a: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 a;default:e=!1}if(e)return null;if(n&&typeof n!=`function`)throw Error(i(231,t,typeof n));return n}var on=!(typeof window>`u`||window.document===void 0||window.document.createElement===void 0),sn=!1;if(on)try{var cn={};Object.defineProperty(cn,`passive`,{get:function(){sn=!0}}),window.addEventListener(`test`,cn,cn),window.removeEventListener(`test`,cn,cn)}catch{sn=!1}var ln=null,un=null,dn=null;function fn(){if(dn)return dn;var e,t=un,n=t.length,r,i=`value`in ln?ln.value:ln.textContent,a=i.length;for(e=0;e<n&&t[e]===i[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===i[a-r];r++);return dn=i.slice(e,1<r?1-r:void 0)}function pn(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 mn(){return!0}function hn(){return!1}function gn(e){function t(t,n,r,i,a){for(var o in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=i,this.target=a,this.currentTarget=null,e)e.hasOwnProperty(o)&&(t=e[o],this[o]=t?t(i):i[o]);return this.isDefaultPrevented=(i.defaultPrevented==null?!1===i.returnValue:i.defaultPrevented)?mn:hn,this.isPropagationStopped=hn,this}return h(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():typeof e.returnValue!=`unknown`&&(e.returnValue=!1),this.isDefaultPrevented=mn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=mn)},persist:function(){},isPersistent:mn}),t}var _n={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},vn=gn(_n),yn=h({},_n,{view:0,detail:0}),bn=gn(yn),xn,Sn,Cn,wn=h({},yn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Nn,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!==Cn&&(Cn&&e.type===`mousemove`?(xn=e.screenX-Cn.screenX,Sn=e.screenY-Cn.screenY):Sn=xn=0,Cn=e),xn)},movementY:function(e){return`movementY`in e?e.movementY:Sn}}),Tn=gn(wn),En=gn(h({},wn,{dataTransfer:0})),Dn=gn(h({},yn,{relatedTarget:0})),On=gn(h({},_n,{animationName:0,elapsedTime:0,pseudoElement:0})),H=gn(h({},_n,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),kn=gn(h({},_n,{data:0})),An={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},jn={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`},U={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function Mn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=U[e])?!!t[e]:!1}function Nn(){return Mn}var Pn=gn(h({},yn,{key:function(e){if(e.key){var t=An[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=pn(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?jn[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Nn,charCode:function(e){return e.type===`keypress`?pn(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?pn(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),Fn=gn(h({},wn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),In=gn(h({},yn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Nn})),Ln=gn(h({},_n,{propertyName:0,elapsedTime:0,pseudoElement:0})),Rn=gn(h({},wn,{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})),zn=gn(h({},_n,{newState:0,oldState:0})),Bn=[9,13,27,32],Vn=on&&`CompositionEvent`in window,Hn=null;on&&`documentMode`in document&&(Hn=document.documentMode);var Un=on&&`TextEvent`in window&&!Hn,Wn=on&&(!Vn||Hn&&8<Hn&&11>=Hn),Gn=` `,Kn=!1;function qn(e,t){switch(e){case`keyup`:return Bn.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function Jn(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var Yn=!1;function Xn(e,t){switch(e){case`compositionend`:return Jn(t);case`keypress`:return t.which===32?(Kn=!0,Gn):null;case`textInput`:return e=t.data,e===Gn&&Kn?null:e;default:return null}}function Zn(e,t){if(Yn)return e===`compositionend`||!Vn&&qn(e,t)?(e=fn(),dn=un=ln=null,Yn=!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 Wn&&t.locale!==`ko`?null:t.data;default:return null}}var Qn={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 $n(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!Qn[e.type]:t===`textarea`}function er(e,t,n,r){en?tn?tn.push(r):tn=[r]:en=r,t=Td(t,`onChange`),0<t.length&&(n=new vn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var tr=null,nr=null;function rr(e){vd(e,0)}function ir(e){if(Nt(ht(e)))return e}function ar(e,t){if(e===`change`)return t}var or=!1;if(on){var sr;if(on){var cr=`oninput`in document;if(!cr){var lr=document.createElement(`div`);lr.setAttribute(`oninput`,`return;`),cr=typeof lr.oninput==`function`}sr=cr}else sr=!1;or=sr&&(!document.documentMode||9<document.documentMode)}function ur(){tr&&(tr.detachEvent(`onpropertychange`,dr),nr=tr=null)}function dr(e){if(e.propertyName===`value`&&ir(nr)){var t=[];er(t,nr,e,$t(e)),rn(rr,t)}}function fr(e,t,n){e===`focusin`?(ur(),tr=t,nr=n,tr.attachEvent(`onpropertychange`,dr)):e===`focusout`&&ur()}function pr(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return ir(nr)}function mr(e,t){if(e===`click`)return ir(t)}function hr(e,t){if(e===`input`||e===`change`)return ir(t)}function gr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var _r=typeof Object.is==`function`?Object.is:gr;function vr(e,t){if(_r(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)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 i=n[r];if(!xe.call(t,i)||!_r(e[i],t[i]))return!1}return!0}function yr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function br(e,t){var n=yr(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}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=yr(n)}}function xr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?xr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Sr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Pt(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=Pt(e.document)}return t}function Cr(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`)}var wr=on&&`documentMode`in document&&11>=document.documentMode,Tr=null,Er=null,Dr=null,Or=!1;function kr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Or||Tr==null||Tr!==Pt(r)||(r=Tr,`selectionStart`in r&&Cr(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}),Dr&&vr(Dr,r)||(Dr=r,r=Td(Er,`onSelect`),0<r.length&&(t=new vn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=Tr)))}function Ar(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var jr={animationend:Ar(`Animation`,`AnimationEnd`),animationiteration:Ar(`Animation`,`AnimationIteration`),animationstart:Ar(`Animation`,`AnimationStart`),transitionrun:Ar(`Transition`,`TransitionRun`),transitionstart:Ar(`Transition`,`TransitionStart`),transitioncancel:Ar(`Transition`,`TransitionCancel`),transitionend:Ar(`Transition`,`TransitionEnd`)},Mr={},Nr={};on&&(Nr=document.createElement(`div`).style,`AnimationEvent`in window||(delete jr.animationend.animation,delete jr.animationiteration.animation,delete jr.animationstart.animation),`TransitionEvent`in window||delete jr.transitionend.transition);function Pr(e){if(Mr[e])return Mr[e];if(!jr[e])return e;var t=jr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Nr)return Mr[e]=t[n];return e}var Fr=Pr(`animationend`),Ir=Pr(`animationiteration`),Lr=Pr(`animationstart`),Rr=Pr(`transitionrun`),zr=Pr(`transitionstart`),Br=Pr(`transitioncancel`),Vr=Pr(`transitionend`),Hr=new Map,Ur=`abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel`.split(` `);Ur.push(`scrollEnd`);function Wr(e,t){Hr.set(e,t),bt(t,[e])}var Gr=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},Kr=[],qr=0,Jr=0;function Yr(){for(var e=qr,t=Jr=qr=0;t<e;){var n=Kr[t];Kr[t++]=null;var r=Kr[t];Kr[t++]=null;var i=Kr[t];Kr[t++]=null;var a=Kr[t];if(Kr[t++]=null,r!==null&&i!==null){var o=r.pending;o===null?i.next=i:(i.next=o.next,o.next=i),r.pending=i}a!==0&&$r(n,i,a)}}function Xr(e,t,n,r){Kr[qr++]=e,Kr[qr++]=t,Kr[qr++]=n,Kr[qr++]=r,Jr|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function Zr(e,t,n,r){return Xr(e,t,n,r),ei(e)}function Qr(e,t){return Xr(e,null,null,t),ei(e)}function $r(e,t,n){e.lanes|=n;var r=e.alternate;r!==null&&(r.lanes|=n);for(var i=!1,a=e.return;a!==null;)a.childLanes|=n,r=a.alternate,r!==null&&(r.childLanes|=n),a.tag===22&&(e=a.stateNode,e===null||e._visibility&1||(i=!0)),e=a,a=a.return;return e.tag===3?(a=e.stateNode,i&&t!==null&&(i=31-z(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function ei(e){if(50<lu)throw lu=0,uu=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var ti={};function ni(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.refCleanup=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 ri(e,t,n,r){return new ni(e,t,n,r)}function ii(e){return e=e.prototype,!(!e||!e.isReactComponent)}function ai(e,t){var n=e.alternate;return n===null?(n=ri(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&65011712,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.refCleanup=e.refCleanup,n}function oi(e,t){e.flags&=65011714;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function si(e,t,n,r,a,o){var s=0;if(r=e,typeof e==`function`)ii(e)&&(s=1);else if(typeof e==`string`)s=Uf(e,n,oe.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(e){case k:return e=ri(31,n,t,a),e.elementType=k,e.lanes=o,e;case y:return ci(n.children,a,o,t);case b:s=8,a|=24;break;case x:return e=ri(12,n,t,a|2),e.elementType=x,e.lanes=o,e;case T:return e=ri(13,n,t,a),e.elementType=T,e.lanes=o,e;case E:return e=ri(19,n,t,a),e.elementType=E,e.lanes=o,e;default:if(typeof e==`object`&&e)switch(e.$$typeof){case C:s=10;break a;case S:s=9;break a;case w:s=11;break a;case D:s=14;break a;case O:s=16,r=null;break a}s=29,n=Error(i(130,e===null?`null`:typeof e,``)),r=null}return t=ri(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function ci(e,t,n,r){return e=ri(7,e,r,t),e.lanes=n,e}function li(e,t,n){return e=ri(6,e,null,t),e.lanes=n,e}function ui(e){var t=ri(18,null,null,0);return t.stateNode=e,t}function di(e,t,n){return t=ri(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var fi=new WeakMap;function pi(e,t){if(typeof e==`object`&&e){var n=fi.get(e);return n===void 0?(t={value:e,source:t,stack:be(t)},fi.set(e,t),t):n}return{value:e,source:t,stack:be(t)}}var mi=[],hi=0,gi=null,_i=0,vi=[],yi=0,bi=null,xi=1,Si=``;function Ci(e,t){mi[hi++]=_i,mi[hi++]=gi,gi=e,_i=t}function wi(e,t,n){vi[yi++]=xi,vi[yi++]=Si,vi[yi++]=bi,bi=e;var r=xi;e=Si;var i=32-z(r)-1;r&=~(1<<i),n+=1;var a=32-z(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,xi=1<<32-z(t)+i|n<<i|r,Si=a+e}else xi=1<<a|n<<i|r,Si=e}function Ti(e){e.return!==null&&(Ci(e,1),wi(e,1,0))}function Ei(e){for(;e===gi;)gi=mi[--hi],mi[hi]=null,_i=mi[--hi],mi[hi]=null;for(;e===bi;)bi=vi[--yi],vi[yi]=null,Si=vi[--yi],vi[yi]=null,xi=vi[--yi],vi[yi]=null}function Di(e,t){vi[yi++]=xi,vi[yi++]=Si,vi[yi++]=bi,xi=t.id,Si=t.overflow,bi=e}var Oi=null,ki=null,W=!1,Ai=null,ji=!1,Mi=Error(i(519));function Ni(e){throw zi(pi(Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),Mi}function Pi(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[it]=e,t[at]=r,n){case`dialog`:$(`cancel`,t),$(`close`,t);break;case`iframe`:case`object`:case`embed`:$(`load`,t);break;case`video`:case`audio`:for(n=0;n<gd.length;n++)$(gd[n],t);break;case`source`:$(`error`,t);break;case`img`:case`image`:case`link`:$(`error`,t),$(`load`,t);break;case`details`:$(`toggle`,t);break;case`input`:$(`invalid`,t),Rt(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:$(`invalid`,t);break;case`textarea`:$(`invalid`,t),Ht(t,r.value,r.defaultValue,r.children)}n=r.children,typeof n!=`string`&&typeof n!=`number`&&typeof n!=`bigint`||t.textContent===``+n||!0===r.suppressHydrationWarning||jd(t.textContent,n)?(r.popover!=null&&($(`beforetoggle`,t),$(`toggle`,t)),r.onScroll!=null&&$(`scroll`,t),r.onScrollEnd!=null&&$(`scrollend`,t),r.onClick!=null&&(t.onclick=Zt),t=!0):t=!1,t||Ni(e,!0)}function Fi(e){for(Oi=e.return;Oi;)switch(Oi.tag){case 5:case 31:case 13:ji=!1;return;case 27:case 3:ji=!0;return;default:Oi=Oi.return}}function Ii(e){if(e!==Oi)return!1;if(!W)return Fi(e),W=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!==`form`&&n!==`button`)||Ud(e.type,e.memoizedProps)),n=!n),n&&ki&&Ni(e),Fi(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));ki=uf(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));ki=uf(e)}else t===27?(t=ki,Zd(e.type)?(e=lf,lf=null,ki=e):ki=t):ki=Oi?cf(e.stateNode.nextSibling):null;return!0}function Li(){ki=Oi=null,W=!1}function Ri(){var e=Ai;return e!==null&&(Yl===null?Yl=e:Yl.push.apply(Yl,e),Ai=null),e}function zi(e){Ai===null?Ai=[e]:Ai.push(e)}var Bi=ae(null),Vi=null,Hi=null;function Ui(e,t,n){L(Bi,t._currentValue),t._currentValue=n}function Wi(e){e._currentValue=Bi.current,I(Bi)}function Gi(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)===t?r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t):(e.childLanes|=t,r!==null&&(r.childLanes|=t)),e===n)break;e=e.return}}function Ki(e,t,n,r){var a=e.child;for(a!==null&&(a.return=e);a!==null;){var o=a.dependencies;if(o!==null){var s=a.child;o=o.firstContext;a:for(;o!==null;){var c=o;o=a;for(var l=0;l<t.length;l++)if(c.context===t[l]){o.lanes|=n,c=o.alternate,c!==null&&(c.lanes|=n),Gi(o.return,n,e),r||(s=null);break a}o=c.next}}else if(a.tag===18){if(s=a.return,s===null)throw Error(i(341));s.lanes|=n,o=s.alternate,o!==null&&(o.lanes|=n),Gi(s,n,e),s=null}else s=a.child;if(s!==null)s.return=a;else for(s=a;s!==null;){if(s===e){s=null;break}if(a=s.sibling,a!==null){a.return=s.return,s=a;break}s=s.return}a=s}}function qi(e,t,n,r){e=null;for(var a=t,o=!1;a!==null;){if(!o){if(a.flags&524288)o=!0;else if(a.flags&262144)break}if(a.tag===10){var s=a.alternate;if(s===null)throw Error(i(387));if(s=s.memoizedProps,s!==null){var c=a.type;_r(a.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(a===le.current){if(s=a.alternate,s===null)throw Error(i(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e===null?e=[Qf]:e.push(Qf))}a=a.return}e!==null&&Ki(t,e,n,r),t.flags|=262144}function Ji(e){for(e=e.firstContext;e!==null;){if(!_r(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Yi(e){Vi=e,Hi=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Xi(e){return Qi(Vi,e)}function Zi(e,t){return Vi===null&&Yi(e),Qi(e,t)}function Qi(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},Hi===null){if(e===null)throw Error(i(308));Hi=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Hi=Hi.next=t;return n}var $i=typeof AbortController<`u`?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(t,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(e){return e()})}},ea=t.unstable_scheduleCallback,ta=t.unstable_NormalPriority,na={$$typeof:C,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function ra(){return{controller:new $i,data:new Map,refCount:0}}function ia(e){e.refCount--,e.refCount===0&&ea(ta,function(){e.controller.abort()})}var aa=null,oa=0,sa=0,ca=null;function la(e,t){if(aa===null){var n=aa=[];oa=0,sa=ud(),ca={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return oa++,t.then(ua,ua),t}function ua(){if(--oa===0&&aa!==null){ca!==null&&(ca.status=`fulfilled`);var e=aa;aa=null,sa=0,ca=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function da(e,t){var n=[],r={status:`pending`,value:null,reason:null,then:function(e){n.push(e)}};return e.then(function(){r.status=`fulfilled`,r.value=t;for(var e=0;e<n.length;e++)(0,n[e])(t)},function(e){for(r.status=`rejected`,r.reason=e,e=0;e<n.length;e++)(0,n[e])(void 0)}),r}var fa=P.S;P.S=function(e,t){Ql=Ee(),typeof t==`object`&&t&&typeof t.then==`function`&&la(e,t),fa!==null&&fa(e,t)};var pa=ae(null);function ma(){var e=pa.current;return e===null?Il.pooledCache:e}function ha(e,t){t===null?L(pa,pa.current):L(pa,t.pool)}function ga(){var e=ma();return e===null?null:{parent:na._currentValue,pool:e}}var _a=Error(i(460)),va=Error(i(474)),ya=Error(i(542)),ba={then:function(){}};function xa(e){return e=e.status,e===`fulfilled`||e===`rejected`}function Sa(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(Zt,Zt),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,Ea(e),e;default:if(typeof t.status==`string`)t.then(Zt,Zt);else{if(e=Il,e!==null&&100<e.shellSuspendCounter)throw Error(i(482));e=t,e.status=`pending`,e.then(function(e){if(t.status===`pending`){var n=t;n.status=`fulfilled`,n.value=e}},function(e){if(t.status===`pending`){var n=t;n.status=`rejected`,n.reason=e}})}switch(t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,Ea(e),e}throw wa=t,_a}}function Ca(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(wa=e,_a):e}}var wa=null;function Ta(){if(wa===null)throw Error(i(459));var e=wa;return wa=null,e}function Ea(e){if(e===_a||e===ya)throw Error(i(483))}var Da=null,Oa=0;function ka(e){var t=Oa;return Oa+=1,Da===null&&(Da=[]),Sa(Da,e,t)}function Aa(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function ja(e,t){throw t.$$typeof===g?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function Ma(e){function t(t,n){if(e){var r=t.deletions;r===null?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;r!==null;)t(n,r),r=r.sibling;return null}function r(e){for(var t=new Map;e!==null;)e.key===null?t.set(e.index,e):t.set(e.key,e),e=e.sibling;return t}function a(e,t){return e=ai(e,t),e.index=0,e.sibling=null,e}function o(t,n,r){return t.index=r,e?(r=t.alternate,r===null?(t.flags|=67108866,n):(r=r.index,r<n?(t.flags|=67108866,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=67108866),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=li(n,e.mode,r),t.return=e,t):(t=a(t,n),t.return=e,t)}function l(e,t,n,r){var i=n.type;return i===y?d(e,t,n.props.children,r,n.key):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===O&&Ca(i)===t.type)?(t=a(t,n.props),Aa(t,n),t.return=e,t):(t=si(n.type,n.key,n.props,null,e.mode,r),Aa(t,n),t.return=e,t)}function u(e,t,n,r){return t===null||t.tag!==4||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?(t=di(n,e.mode,r),t.return=e,t):(t=a(t,n.children||[]),t.return=e,t)}function d(e,t,n,r,i){return t===null||t.tag!==7?(t=ci(n,e.mode,r,i),t.return=e,t):(t=a(t,n),t.return=e,t)}function f(e,t,n){if(typeof t==`string`&&t!==``||typeof t==`number`||typeof t==`bigint`)return t=li(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case _:return n=si(t.type,t.key,t.props,null,e.mode,n),Aa(n,t),n.return=e,n;case v:return t=di(t,e.mode,n),t.return=e,t;case O:return t=Ca(t),f(e,t,n)}if(te(t)||M(t))return t=ci(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,ka(t),n);if(t.$$typeof===C)return f(e,Zi(e,t),n);ja(e,t)}return null}function p(e,t,n,r){var i=t===null?null:t.key;if(typeof n==`string`&&n!==``||typeof n==`number`||typeof n==`bigint`)return i===null?c(e,t,``+n,r):null;if(typeof n==`object`&&n){switch(n.$$typeof){case _:return n.key===i?l(e,t,n,r):null;case v:return n.key===i?u(e,t,n,r):null;case O:return n=Ca(n),p(e,t,n,r)}if(te(n)||M(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,ka(n),r);if(n.$$typeof===C)return p(e,t,Zi(e,n),r);ja(e,n)}return null}function m(e,t,n,r,i){if(typeof r==`string`&&r!==``||typeof r==`number`||typeof r==`bigint`)return e=e.get(n)||null,c(t,e,``+r,i);if(typeof r==`object`&&r){switch(r.$$typeof){case _:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case v:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case O:return r=Ca(r),m(e,t,n,r,i)}if(te(r)||M(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,ka(r),i);if(r.$$typeof===C)return m(e,t,n,Zi(t,r),i);ja(t,r)}return null}function h(i,a,s,c){for(var l=null,u=null,d=a,h=a=0,g=null;d!==null&&h<s.length;h++){d.index>h?(g=d,d=null):g=d.sibling;var _=p(i,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(i,d),a=o(_,a,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(i,d),W&&Ci(i,h),l;if(d===null){for(;h<s.length;h++)d=f(i,s[h],c),d!==null&&(a=o(d,a,h),u===null?l=d:u.sibling=d,u=d);return W&&Ci(i,h),l}for(d=r(d);h<s.length;h++)g=m(d,i,h,s[h],c),g!==null&&(e&&g.alternate!==null&&d.delete(g.key===null?h:g.key),a=o(g,a,h),u===null?l=g:u.sibling=g,u=g);return e&&d.forEach(function(e){return t(i,e)}),W&&Ci(i,h),l}function g(a,s,c,l){if(c==null)throw Error(i(151));for(var u=null,d=null,h=s,g=s=0,_=null,v=c.next();h!==null&&!v.done;g++,v=c.next()){h.index>g?(_=h,h=null):_=h.sibling;var y=p(a,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(a,h),s=o(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(a,h),W&&Ci(a,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(a,v.value,l),v!==null&&(s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return W&&Ci(a,g),u}for(h=r(h);!v.done;g++,v=c.next())v=m(h,a,g,v.value,l),v!==null&&(e&&v.alternate!==null&&h.delete(v.key===null?g:v.key),s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(a,e)}),W&&Ci(a,g),u}function b(e,r,o,c){if(typeof o==`object`&&o&&o.type===y&&o.key===null&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case _:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===y){if(r.tag===7){n(e,r.sibling),c=a(r,o.props.children),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===O&&Ca(l)===r.type){n(e,r.sibling),c=a(r,o.props),Aa(c,o),c.return=e,e=c;break a}n(e,r);break}else t(e,r);r=r.sibling}o.type===y?(c=ci(o.props.children,e.mode,c,o.key),c.return=e,e=c):(c=si(o.type,o.key,o.props,null,e.mode,c),Aa(c,o),c.return=e,e=c)}return s(e);case v:a:{for(l=o.key;r!==null;){if(r.key===l)if(r.tag===4&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),c=a(r,o.children||[]),c.return=e,e=c;break a}else{n(e,r);break}else t(e,r);r=r.sibling}c=di(o,e.mode,c),c.return=e,e=c}return s(e);case O:return o=Ca(o),b(e,r,o,c)}if(te(o))return h(e,r,o,c);if(M(o)){if(l=M(o),typeof l!=`function`)throw Error(i(150));return o=l.call(o),g(e,r,o,c)}if(typeof o.then==`function`)return b(e,r,ka(o),c);if(o.$$typeof===C)return b(e,r,Zi(e,o),c);ja(e,o)}return typeof o==`string`&&o!==``||typeof o==`number`||typeof o==`bigint`?(o=``+o,r!==null&&r.tag===6?(n(e,r.sibling),c=a(r,o),c.return=e,e=c):(n(e,r),c=li(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{Oa=0;var i=b(e,t,n,r);return Da=null,i}catch(t){if(t===_a||t===ya)throw t;var a=ri(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var Na=Ma(!0),Pa=Ma(!1),Fa=!1;function Ia(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function La(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Ra(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function za(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Fl&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=ei(e),$r(e,null,n),t}return Xr(e,r,t,n),ei(e)}function Ba(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194048)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Qe(e,n)}}function Va(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Ha=!1;function Ua(){if(Ha){var e=ca;if(e!==null)throw e}}function Wa(e,t,n,r){Ha=!1;var i=e.updateQueue;Fa=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var f=s.lane&-536870913,p=f!==s.lane;if(p?(Z&f)===f:(r&f)===f){f!==0&&f===sa&&(Ha=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var m=e,g=s;f=t;var _=n;switch(g.tag){case 1:if(m=g.payload,typeof m==`function`){d=m.call(_,d,f);break a}d=m;break a;case 3:m.flags=m.flags&-65537|128;case 0:if(m=g.payload,f=typeof m==`function`?m.call(_,d,f):m,f==null)break a;d=h({},d,f);break a;case 2:Fa=!0}}f=s.callback,f!==null&&(e.flags|=64,p&&(e.flags|=8192),p=i.callbacks,p===null?i.callbacks=[f]:p.push(f))}else p={lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=p,c=d):u=u.next=p,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;p=s,s=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(1);u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,a===null&&(i.shared.lanes=0),Ul|=o,e.lanes=o,e.memoizedState=d}}function Ga(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function Ka(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)Ga(n[e],t)}var qa=ae(null),Ja=ae(0);function Ya(e,t){e=Vl,L(Ja,e),L(qa,t),Vl=e|t.baseLanes}function Xa(){L(Ja,Vl),L(qa,qa.current)}function Za(){Vl=Ja.current,I(qa),I(Ja)}var Qa=ae(null),$a=null;function eo(e){var t=e.alternate;L(ao,ao.current&1),L(Qa,e),$a===null&&(t===null||qa.current!==null||t.memoizedState!==null)&&($a=e)}function to(e){L(ao,ao.current),L(Qa,e),$a===null&&($a=e)}function no(e){e.tag===22?(L(ao,ao.current),L(Qa,e),$a===null&&($a=e)):ro(e)}function ro(){L(ao,ao.current),L(Qa,Qa.current)}function io(e){I(Qa),$a===e&&($a=null),I(ao)}var ao=ae(0);function oo(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||af(n)||of(n)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder===`forwards`||t.memoizedProps.revealOrder===`backwards`||t.memoizedProps.revealOrder===`unstable_legacy-backwards`||t.memoizedProps.revealOrder===`together`)){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 so=0,G=null,co=null,K=null,lo=!1,uo=!1,fo=!1,po=0,mo=0,ho=null,go=0;function _o(){throw Error(i(321))}function vo(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!_r(e[n],t[n]))return!1;return!0}function yo(e,t,n,r,i,a){return so=a,G=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,P.H=e===null||e.memoizedState===null?J:Fs,fo=!1,a=n(r,i),fo=!1,uo&&(a=xo(t,n,r,i)),bo(e),a}function bo(e){P.H=Ps;var t=co!==null&&co.next!==null;if(so=0,K=co=G=null,lo=!1,mo=0,ho=null,t)throw Error(i(300));e===null||Qs||(e=e.dependencies,e!==null&&Ji(e)&&(Qs=!0))}function xo(e,t,n,r){G=e;var a=0;do{if(uo&&(ho=null),mo=0,uo=!1,25<=a)throw Error(i(301));if(a+=1,K=co=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}P.H=Is,o=t(n,r)}while(uo);return o}function So(){var e=P.H,t=e.useState()[0];return t=typeof t.then==`function`?ko(t):t,e=e.useState()[0],(co===null?null:co.memoizedState)!==e&&(G.flags|=1024),t}function Co(){var e=po!==0;return po=0,e}function wo(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function To(e){if(lo){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}lo=!1}so=0,K=co=G=null,uo=!1,mo=po=0,ho=null}function Eo(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return K===null?G.memoizedState=K=e:K=K.next=e,K}function Do(){if(co===null){var e=G.alternate;e=e===null?null:e.memoizedState}else e=co.next;var t=K===null?G.memoizedState:K.next;if(t!==null)K=t,co=e;else{if(e===null)throw G.alternate===null?Error(i(467)):Error(i(310));co=e,e={memoizedState:co.memoizedState,baseState:co.baseState,baseQueue:co.baseQueue,queue:co.queue,next:null},K===null?G.memoizedState=K=e:K=K.next=e}return K}function Oo(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function ko(e){var t=mo;return mo+=1,ho===null&&(ho=[]),e=Sa(ho,e,t),t=G,(K===null?t.memoizedState:K.next)===null&&(t=t.alternate,P.H=t===null||t.memoizedState===null?J:Fs),e}function Ao(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return ko(e);if(e.$$typeof===C)return Xi(e)}throw Error(i(438,String(e)))}function jo(e){var t=null,n=G.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=G.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(e){return e.slice()}),index:0})))}if(t??={data:[],index:0},n===null&&(n=Oo(),G.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),r=0;r<e;r++)n[r]=A;return t.index++,n}function Mo(e,t){return typeof t==`function`?t(e):t}function No(e){return Po(Do(),co,e)}function Po(e,t,n){var r=e.queue;if(r===null)throw Error(i(311));r.lastRenderedReducer=n;var a=e.baseQueue,o=r.pending;if(o!==null){if(a!==null){var s=a.next;a.next=o.next,o.next=s}t.baseQueue=a=o,r.pending=null}if(o=e.baseState,a===null)e.memoizedState=o;else{t=a.next;var c=s=null,l=null,u=t,d=!1;do{var f=u.lane&-536870913;if(f===u.lane?(so&f)===f:(Z&f)===f){var p=u.revertLane;if(p===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),f===sa&&(d=!0);else if((so&p)===p){u=u.next,p===sa&&(d=!0);continue}else f={lane:0,revertLane:u.revertLane,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=f,s=o):l=l.next=f,G.lanes|=p,Ul|=p;f=u.action,fo&&n(o,f),o=u.hasEagerState?u.eagerState:n(o,f)}else p={lane:f,revertLane:u.revertLane,gesture:u.gesture,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=p,s=o):l=l.next=p,G.lanes|=f,Ul|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!_r(o,e.memoizedState)&&(Qs=!0,d&&(n=ca,n!==null)))throw n;e.memoizedState=o,e.baseState=s,e.baseQueue=l,r.lastRenderedState=o}return a===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function Fo(e){var t=Do(),n=t.queue;if(n===null)throw Error(i(311));n.lastRenderedReducer=e;var r=n.dispatch,a=n.pending,o=t.memoizedState;if(a!==null){n.pending=null;var s=a=a.next;do o=e(o,s.action),s=s.next;while(s!==a);_r(o,t.memoizedState)||(Qs=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function Io(e,t,n){var r=G,a=Do(),o=W;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!_r((co||a).memoizedState,n);if(s&&(a.memoizedState=n,Qs=!0),a=a.queue,os(zo.bind(null,r,a,e),[e]),a.getSnapshot!==t||s||K!==null&&K.memoizedState.tag&1){if(r.flags|=2048,ts(9,{destroy:void 0},Ro.bind(null,r,a,n,t),null),Il===null)throw Error(i(349));o||so&127||Lo(r,t,n)}return n}function Lo(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=G.updateQueue,t===null?(t=Oo(),G.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Ro(e,t,n,r){t.value=n,t.getSnapshot=r,Bo(t)&&Vo(e)}function zo(e,t,n){return n(function(){Bo(t)&&Vo(e)})}function Bo(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!_r(e,n)}catch{return!0}}function Vo(e){var t=Qr(e,2);t!==null&&pu(t,e,2)}function Ho(e){var t=Eo();if(typeof e==`function`){var n=e;if(e=n(),fo){R(!0);try{n()}finally{R(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Mo,lastRenderedState:e},t}function Uo(e,t,n,r){return e.baseState=n,Po(e,co,typeof r==`function`?r:Mo)}function Wo(e,t,n,r,a){if(js(e))throw Error(i(485));if(e=t.action,e!==null){var o={payload:a,action:e,next:null,isTransition:!0,status:`pending`,value:null,reason:null,listeners:[],then:function(e){o.listeners.push(e)}};P.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,Go(t,o)):(o.next=n.next,t.pending=n.next=o)}}function Go(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=P.T,o={};P.T=o;try{var s=n(i,r),c=P.S;c!==null&&c(o,s),Ko(e,t,s)}catch(n){qo(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),P.T=a}}else try{a=n(i,r),Ko(e,t,a)}catch(n){qo(e,t,n)}}function Ko(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){q(e,t,n)},function(n){return qo(e,t,n)}):q(e,t,n)}function q(e,t,n){t.status=`fulfilled`,t.value=n,Jo(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Go(e,n)))}function qo(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,Jo(t),t=t.next;while(t!==r)}e.action=null}function Jo(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Yo(e,t){return t}function Xo(e,t){if(W){var n=Il.formState;if(n!==null){a:{var r=G;if(W){if(ki){b:{for(var i=ki,a=ji;i.nodeType!==8;){if(!a){i=null;break b}if(i=cf(i.nextSibling),i===null){i=null;break b}}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){ki=cf(i.nextSibling),r=i.data===`F!`;break a}}Ni(r)}r=!1}r&&(t=n[0])}}return n=Eo(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Yo,lastRenderedState:t},n.queue=r,n=Os.bind(null,G,r),r.dispatch=n,r=Ho(!1),a=As.bind(null,G,!1,r.queue),r=Eo(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=Wo.bind(null,G,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function Zo(e){return Qo(Do(),co,e)}function Qo(e,t,n){if(t=Po(e,t,Yo)[0],e=No(Mo)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=ko(t)}catch(e){throw e===_a?ya:e}else r=t;t=Do();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(G.flags|=2048,ts(9,{destroy:void 0},$o.bind(null,i,n),null)),[r,a,e]}function $o(e,t){e.action=t}function es(e){var t=Do(),n=co;if(n!==null)return Qo(t,n,e);Do(),t=t.memoizedState,n=Do();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function ts(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=G.updateQueue,t===null&&(t=Oo(),G.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function ns(){return Do().memoizedState}function rs(e,t,n,r){var i=Eo();G.flags|=e,i.memoizedState=ts(1|t,{destroy:void 0},n,r===void 0?null:r)}function is(e,t,n,r){var i=Do();r=r===void 0?null:r;var a=i.memoizedState.inst;co!==null&&r!==null&&vo(r,co.memoizedState.deps)?i.memoizedState=ts(t,a,n,r):(G.flags|=e,i.memoizedState=ts(1|t,a,n,r))}function as(e,t){rs(8390656,8,e,t)}function os(e,t){is(2048,8,e,t)}function ss(e){G.flags|=4;var t=G.updateQueue;if(t===null)t=Oo(),G.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function cs(e){var t=Do().memoizedState;return ss({ref:t,nextImpl:e}),function(){if(Fl&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function ls(e,t){return is(4,2,e,t)}function us(e,t){return is(4,4,e,t)}function ds(e,t){if(typeof t==`function`){e=e();var n=t(e);return function(){typeof n==`function`?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function fs(e,t,n){n=n==null?null:n.concat([e]),is(4,4,ds.bind(null,t,e),n)}function ps(){}function ms(e,t){var n=Do();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&vo(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function hs(e,t){var n=Do();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&vo(t,r[1]))return r[0];if(r=e(),fo){R(!0);try{e()}finally{R(!1)}}return n.memoizedState=[r,t],r}function gs(e,t,n){return n===void 0||so&1073741824&&!(Z&261930)?e.memoizedState=t:(e.memoizedState=n,e=fu(),G.lanes|=e,Ul|=e,n)}function _s(e,t,n,r){return _r(n,t)?n:qa.current===null?!(so&42)||so&1073741824&&!(Z&261930)?(Qs=!0,e.memoizedState=n):(e=fu(),G.lanes|=e,Ul|=e,t):(e=gs(e,n,r),_r(e,t)||(Qs=!0),e)}function vs(e,t,n,r,i){var a=F.p;F.p=a!==0&&8>a?a:8;var o=P.T,s={};P.T=s,As(e,!1,t,n);try{var c=i(),l=P.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?ks(e,t,da(c,r),du(e)):ks(e,t,r,du(e))}catch(n){ks(e,t,{then:function(){},status:`rejected`,reason:n},du())}finally{F.p=a,o!==null&&s.types!==null&&(o.types=s.types),P.T=o}}function ys(){}function bs(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=xs(e).queue;vs(e,a,t,ne,n===null?ys:function(){return Ss(e),n(r)})}function xs(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ne,baseState:ne,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Mo,lastRenderedState:ne},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Mo,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Ss(e){var t=xs(e);t.next===null&&(t=e.alternate.memoizedState),ks(e,t.next.queue,{},du())}function Cs(){return Xi(Qf)}function ws(){return Do().memoizedState}function Ts(){return Do().memoizedState}function Es(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=du();e=Ra(n);var r=za(t,e,n);r!==null&&(pu(r,t,n),Ba(r,t,n)),t={cache:ra()},e.payload=t;return}t=t.return}}function Ds(e,t,n){var r=du();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},js(e)?Ms(t,n):(n=Zr(e,t,n,r),n!==null&&(pu(n,e,r),Ns(n,t,r)))}function Os(e,t,n){ks(e,t,n,du())}function ks(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(js(e))Ms(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,_r(s,o))return Xr(e,t,i,0),Il===null&&Yr(),!1}catch{}if(n=Zr(e,t,i,r),n!==null)return pu(n,e,r),Ns(n,t,r),!0}return!1}function As(e,t,n,r){if(r={lane:2,revertLane:ud(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},js(e)){if(t)throw Error(i(479))}else t=Zr(e,n,r,2),t!==null&&pu(t,e,2)}function js(e){var t=e.alternate;return e===G||t!==null&&t===G}function Ms(e,t){uo=lo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Ns(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Qe(e,n)}}var Ps={readContext:Xi,use:Ao,useCallback:_o,useContext:_o,useEffect:_o,useImperativeHandle:_o,useLayoutEffect:_o,useInsertionEffect:_o,useMemo:_o,useReducer:_o,useRef:_o,useState:_o,useDebugValue:_o,useDeferredValue:_o,useTransition:_o,useSyncExternalStore:_o,useId:_o,useHostTransitionStatus:_o,useFormState:_o,useActionState:_o,useOptimistic:_o,useMemoCache:_o,useCacheRefresh:_o};Ps.useEffectEvent=_o;var J={readContext:Xi,use:Ao,useCallback:function(e,t){return Eo().memoizedState=[e,t===void 0?null:t],e},useContext:Xi,useEffect:as,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),rs(4194308,4,ds.bind(null,t,e),n)},useLayoutEffect:function(e,t){return rs(4194308,4,e,t)},useInsertionEffect:function(e,t){rs(4,2,e,t)},useMemo:function(e,t){var n=Eo();t=t===void 0?null:t;var r=e();if(fo){R(!0);try{e()}finally{R(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=Eo();if(n!==void 0){var i=n(t);if(fo){R(!0);try{n(t)}finally{R(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=Ds.bind(null,G,e),[r.memoizedState,e]},useRef:function(e){var t=Eo();return e={current:e},t.memoizedState=e},useState:function(e){e=Ho(e);var t=e.queue,n=Os.bind(null,G,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:ps,useDeferredValue:function(e,t){return gs(Eo(),e,t)},useTransition:function(){var e=Ho(!1);return e=vs.bind(null,G,e.queue,!0,!1),Eo().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=G,a=Eo();if(W){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),Il===null)throw Error(i(349));Z&127||Lo(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,as(zo.bind(null,r,o,e),[e]),r.flags|=2048,ts(9,{destroy:void 0},Ro.bind(null,r,o,n,t),null),n},useId:function(){var e=Eo(),t=Il.identifierPrefix;if(W){var n=Si,r=xi;n=(r&~(1<<32-z(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=po++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=go++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:Cs,useFormState:Xo,useActionState:Xo,useOptimistic:function(e){var t=Eo();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=As.bind(null,G,!0,n),n.dispatch=t,[e,t]},useMemoCache:jo,useCacheRefresh:function(){return Eo().memoizedState=Es.bind(null,G)},useEffectEvent:function(e){var t=Eo(),n={impl:e};return t.memoizedState=n,function(){if(Fl&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},Fs={readContext:Xi,use:Ao,useCallback:ms,useContext:Xi,useEffect:os,useImperativeHandle:fs,useInsertionEffect:ls,useLayoutEffect:us,useMemo:hs,useReducer:No,useRef:ns,useState:function(){return No(Mo)},useDebugValue:ps,useDeferredValue:function(e,t){return _s(Do(),co.memoizedState,e,t)},useTransition:function(){var e=No(Mo)[0],t=Do().memoizedState;return[typeof e==`boolean`?e:ko(e),t]},useSyncExternalStore:Io,useId:ws,useHostTransitionStatus:Cs,useFormState:Zo,useActionState:Zo,useOptimistic:function(e,t){return Uo(Do(),co,e,t)},useMemoCache:jo,useCacheRefresh:Ts};Fs.useEffectEvent=cs;var Is={readContext:Xi,use:Ao,useCallback:ms,useContext:Xi,useEffect:os,useImperativeHandle:fs,useInsertionEffect:ls,useLayoutEffect:us,useMemo:hs,useReducer:Fo,useRef:ns,useState:function(){return Fo(Mo)},useDebugValue:ps,useDeferredValue:function(e,t){var n=Do();return co===null?gs(n,e,t):_s(n,co.memoizedState,e,t)},useTransition:function(){var e=Fo(Mo)[0],t=Do().memoizedState;return[typeof e==`boolean`?e:ko(e),t]},useSyncExternalStore:Io,useId:ws,useHostTransitionStatus:Cs,useFormState:es,useActionState:es,useOptimistic:function(e,t){var n=Do();return co===null?(n.baseState=e,[e,n.queue.dispatch]):Uo(n,co,e,t)},useMemoCache:jo,useCacheRefresh:Ts};Is.useEffectEvent=cs;function Ls(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:h({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Rs={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=du(),i=Ra(r);i.payload=t,n!=null&&(i.callback=n),t=za(e,i,r),t!==null&&(pu(t,e,r),Ba(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=du(),i=Ra(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=za(e,i,r),t!==null&&(pu(t,e,r),Ba(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=du(),r=Ra(n);r.tag=2,t!=null&&(r.callback=t),t=za(e,r,n),t!==null&&(pu(t,e,n),Ba(t,e,n))}};function zs(e,t,n,r,i,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate==`function`?e.shouldComponentUpdate(r,a,o):t.prototype&&t.prototype.isPureReactComponent?!vr(n,r)||!vr(i,a):!0}function Bs(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 Vs(e,t){var n=t;if(`ref`in t)for(var r in n={},t)r!==`ref`&&(n[r]=t[r]);if(e=e.defaultProps)for(var i in n===t&&(n=h({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function Hs(e){Gr(e)}function Us(e){console.error(e)}function Ws(e){Gr(e)}function Gs(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function Ks(e,t,n){try{var r=e.onCaughtError;r(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(e){setTimeout(function(){throw e})}}function qs(e,t,n){return n=Ra(n),n.tag=3,n.payload={element:null},n.callback=function(){Gs(e,t)},n}function Js(e){return e=Ra(e),e.tag=3,e}function Ys(e,t,n,r){var i=n.type.getDerivedStateFromError;if(typeof i==`function`){var a=r.value;e.payload=function(){return i(a)},e.callback=function(){Ks(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){Ks(t,n,r),typeof i!=`function`&&(tu===null?tu=new Set([this]):tu.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function Xs(e,t,n,r,a){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&qi(t,n,a,!0),n=Qa.current,n!==null){switch(n.tag){case 31:case 13:return $a===null?Tu():n.alternate===null&&Hl===0&&(Hl=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===ba?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),Wu(e,r,a)),!1;case 22:return n.flags|=65536,r===ba?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([r]):n.add(r)),Wu(e,r,a)),!1}throw Error(i(435,n.tag))}return Wu(e,r,a),Tu(),!1}if(W)return t=Qa.current,t===null?(r!==Mi&&(t=Error(i(423),{cause:r}),zi(pi(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=pi(r,n),a=qs(e.stateNode,r,a),Va(e,a),Hl!==4&&(Hl=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==Mi&&(e=Error(i(422),{cause:r}),zi(pi(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=pi(o,n),Jl===null?Jl=[o]:Jl.push(o),Hl!==4&&(Hl=2),t===null)return!0;r=pi(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=qs(n.stateNode,r,e),Va(n,e),!1;case 1:if(t=n.type,o=n.stateNode,!(n.flags&128)&&(typeof t.getDerivedStateFromError==`function`||o!==null&&typeof o.componentDidCatch==`function`&&(tu===null||!tu.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=Js(a),Ys(a,e,n,r),Va(n,a),!1}n=n.return}while(n!==null);return!1}var Zs=Error(i(461)),Qs=!1;function $s(e,t,n,r){t.child=e===null?Pa(t,null,n,r):Na(t,e.child,n,r)}function ec(e,t,n,r,i){n=n.render;var a=t.ref;if(`ref`in r){var o={};for(var s in r)s!==`ref`&&(o[s]=r[s])}else o=r;return Yi(t),r=yo(e,t,n,o,a,i),s=Co(),e!==null&&!Qs?(wo(e,t,i),wc(e,t,i)):(W&&s&&Ti(t),t.flags|=1,$s(e,t,r,i),t.child)}function tc(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!ii(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,nc(e,t,a,r,i)):(e=si(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!Y(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?vr:n,n(o,r)&&e.ref===t.ref)return wc(e,t,i)}return t.flags|=1,e=ai(a,r),e.ref=t.ref,e.return=t,t.child=e}function nc(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(vr(a,r)&&e.ref===t.ref)if(Qs=!1,t.pendingProps=r=a,Y(e,i))e.flags&131072&&(Qs=!0);else return t.lanes=e.lanes,wc(e,t,i)}return uc(e,t,n,r,i)}function rc(e,t,n,r){var i=r.children,a=e===null?null:e.memoizedState;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode===`hidden`){if(t.flags&128){if(a=a===null?n:a.baseLanes|n,e!==null){for(r=t.child=e.child,i=0;r!==null;)i=i|r.lanes|r.childLanes,r=r.sibling;r=i&~a}else r=0,t.child=null;return ac(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&ha(t,a===null?null:a.cachePool),a===null?Xa():Ya(t,a),no(t);else return r=t.lanes=536870912,ac(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&ha(t,null),Xa(),ro(t)):(ha(t,a.cachePool),Ya(t,a),ro(t),t.memoizedState=null);return $s(e,t,i,n),t.child}function ic(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function ac(e,t,n,r,i){var a=ma();return a=a===null?null:{parent:na._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&ha(t,null),Xa(),no(t),e!==null&&qi(e,t,r,!0),t.childLanes=i,null}function oc(e,t){return t=yc({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function sc(e,t,n){return Na(t,e.child,null,n),e=oc(t,t.pendingProps),e.flags|=2,io(t),t.memoizedState=null,e}function cc(e,t,n){var r=t.pendingProps,a=(t.flags&128)!=0;if(t.flags&=-129,e===null){if(W){if(r.mode===`hidden`)return e=oc(t,r),t.lanes=536870912,ic(null,e);if(to(t),(e=ki)?(e=rf(e,ji),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:bi===null?null:{id:xi,overflow:Si},retryLane:536870912,hydrationErrors:null},n=ui(e),n.return=t,t.child=n,Oi=t,ki=null)):e=null,e===null)throw Ni(t);return t.lanes=536870912,null}return oc(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(to(t),a)if(t.flags&256)t.flags&=-257,t=sc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558));else if(Qs||qi(e,t,n,!1),a=(n&e.childLanes)!==0,Qs||a){if(r=Il,r!==null&&(s=B(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,Qr(e,s),pu(r,e,s),Zs;Tu(),t=sc(e,t,n)}else e=o.treeContext,ki=cf(s.nextSibling),Oi=t,W=!0,Ai=null,ji=!1,e!==null&&Di(t,e),t=oc(t,r),t.flags|=4096;return t}return e=ai(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function lc(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!=`function`&&typeof n!=`object`)throw Error(i(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function uc(e,t,n,r,i){return Yi(t),n=yo(e,t,n,r,void 0,i),r=Co(),e!==null&&!Qs?(wo(e,t,i),wc(e,t,i)):(W&&r&&Ti(t),t.flags|=1,$s(e,t,n,i),t.child)}function dc(e,t,n,r,i,a){return Yi(t),t.updateQueue=null,n=xo(t,r,n,i),bo(e),r=Co(),e!==null&&!Qs?(wo(e,t,a),wc(e,t,a)):(W&&r&&Ti(t),t.flags|=1,$s(e,t,n,a),t.child)}function fc(e,t,n,r,i){if(Yi(t),t.stateNode===null){var a=ti,o=n.contextType;typeof o==`object`&&o&&(a=Xi(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=Rs,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},Ia(t),o=n.contextType,a.context=typeof o==`object`&&o?Xi(o):ti,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(Ls(t,n,o,r),a.state=t.memoizedState),typeof n.getDerivedStateFromProps==`function`||typeof a.getSnapshotBeforeUpdate==`function`||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(o=a.state,typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount(),o!==a.state&&Rs.enqueueReplaceState(a,a.state,null),Wa(t,r,a,i),Ua(),a.state=t.memoizedState),typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!0}else if(e===null){a=t.stateNode;var s=t.memoizedProps,c=Vs(n,s);a.props=c;var l=a.context,u=n.contextType;o=ti,typeof u==`object`&&u&&(o=Xi(u));var d=n.getDerivedStateFromProps;u=typeof d==`function`||typeof a.getSnapshotBeforeUpdate==`function`,s=t.pendingProps!==s,u||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(s||l!==o)&&Bs(t,a,r,o),Fa=!1;var f=t.memoizedState;a.state=f,Wa(t,r,a,i),Ua(),l=t.memoizedState,s||f!==l||Fa?(typeof d==`function`&&(Ls(t,n,d,r),l=t.memoizedState),(c=Fa||zs(t,n,c,r,f,l,o))?(u||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount==`function`&&(t.flags|=4194308)):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=o,r=c):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,La(e,t),o=t.memoizedProps,u=Vs(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=ti,typeof l==`object`&&l&&(c=Xi(l)),s=n.getDerivedStateFromProps,(l=typeof s==`function`||typeof a.getSnapshotBeforeUpdate==`function`)||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(o!==d||f!==c)&&Bs(t,a,r,c),Fa=!1,f=t.memoizedState,a.state=f,Wa(t,r,a,i),Ua();var p=t.memoizedState;o!==d||f!==p||Fa||e!==null&&e.dependencies!==null&&Ji(e.dependencies)?(typeof s==`function`&&(Ls(t,n,s,r),p=t.memoizedState),(u=Fa||zs(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&Ji(e.dependencies))?(l||typeof a.UNSAFE_componentWillUpdate!=`function`&&typeof a.componentWillUpdate!=`function`||(typeof a.componentWillUpdate==`function`&&a.componentWillUpdate(r,p,c),typeof a.UNSAFE_componentWillUpdate==`function`&&a.UNSAFE_componentWillUpdate(r,p,c)),typeof a.componentDidUpdate==`function`&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate==`function`&&(t.flags|=1024)):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),a.props=r,a.state=p,a.context=c,r=u):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return a=r,lc(e,t),r=(t.flags&128)!=0,a||r?(a=t.stateNode,n=r&&typeof n.getDerivedStateFromError!=`function`?null:a.render(),t.flags|=1,e!==null&&r?(t.child=Na(t,e.child,null,i),t.child=Na(t,null,n,i)):$s(e,t,n,i),t.memoizedState=a.state,e=t.child):e=wc(e,t,i),e}function pc(e,t,n,r){return Li(),t.flags|=256,$s(e,t,n,r),t.child}var mc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function hc(e){return{baseLanes:e,cachePool:ga()}}function gc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=Kl),e}function _c(e,t,n){var r=t.pendingProps,a=!1,o=(t.flags&128)!=0,s;if((s=o)||(s=e!==null&&e.memoizedState===null?!1:(ao.current&2)!=0),s&&(a=!0,t.flags&=-129),s=(t.flags&32)!=0,t.flags&=-33,e===null){if(W){if(a?eo(t):ro(t),(e=ki)?(e=rf(e,ji),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:bi===null?null:{id:xi,overflow:Si},retryLane:536870912,hydrationErrors:null},n=ui(e),n.return=t,t.child=n,Oi=t,ki=null)):e=null,e===null)throw Ni(t);return of(e)?t.lanes=32:t.lanes=536870912,null}var c=r.children;return r=r.fallback,a?(ro(t),a=t.mode,c=yc({mode:`hidden`,children:c},a),r=ci(r,a,n,null),c.return=t,r.return=t,c.sibling=r,t.child=c,r=t.child,r.memoizedState=hc(n),r.childLanes=gc(e,s,n),t.memoizedState=mc,ic(null,r)):(eo(t),vc(t,c))}var l=e.memoizedState;if(l!==null&&(c=l.dehydrated,c!==null)){if(o)t.flags&256?(eo(t),t.flags&=-257,t=bc(e,t,n)):t.memoizedState===null?(ro(t),c=r.fallback,a=t.mode,r=yc({mode:`visible`,children:r.children},a),c=ci(c,a,n,null),c.flags|=2,r.return=t,c.return=t,r.sibling=c,t.child=r,Na(t,e.child,null,n),r=t.child,r.memoizedState=hc(n),r.childLanes=gc(e,s,n),t.memoizedState=mc,t=ic(null,r)):(ro(t),t.child=e.child,t.flags|=128,t=null);else if(eo(t),of(c)){if(s=c.nextSibling&&c.nextSibling.dataset,s)var u=s.dgst;s=u,r=Error(i(419)),r.stack=``,r.digest=s,zi({value:r,source:null,stack:null}),t=bc(e,t,n)}else if(Qs||qi(e,t,n,!1),s=(n&e.childLanes)!==0,Qs||s){if(s=Il,s!==null&&(r=B(s,n),r!==0&&r!==l.retryLane))throw l.retryLane=r,Qr(e,r),pu(s,e,r),Zs;af(c)||Tu(),t=bc(e,t,n)}else af(c)?(t.flags|=192,t.child=e.child,t=null):(e=l.treeContext,ki=cf(c.nextSibling),Oi=t,W=!0,Ai=null,ji=!1,e!==null&&Di(t,e),t=vc(t,r.children),t.flags|=4096);return t}return a?(ro(t),c=r.fallback,a=t.mode,l=e.child,u=l.sibling,r=ai(l,{mode:`hidden`,children:r.children}),r.subtreeFlags=l.subtreeFlags&65011712,u===null?(c=ci(c,a,n,null),c.flags|=2):c=ai(u,c),c.return=t,r.return=t,r.sibling=c,t.child=r,ic(null,r),r=t.child,c=e.child.memoizedState,c===null?c=hc(n):(a=c.cachePool,a===null?a=ga():(l=na._currentValue,a=a.parent===l?a:{parent:l,pool:l}),c={baseLanes:c.baseLanes|n,cachePool:a}),r.memoizedState=c,r.childLanes=gc(e,s,n),t.memoizedState=mc,ic(e.child,r)):(eo(t),n=e.child,e=n.sibling,n=ai(n,{mode:`visible`,children:r.children}),n.return=t,n.sibling=null,e!==null&&(s=t.deletions,s===null?(t.deletions=[e],t.flags|=16):s.push(e)),t.child=n,t.memoizedState=null,n)}function vc(e,t){return t=yc({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function yc(e,t){return e=ri(22,e,null,t),e.lanes=0,e}function bc(e,t,n){return Na(t,e.child,null,n),e=vc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function xc(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Gi(e.return,t,n)}function Sc(e,t,n,r,i,a){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i,treeForkCount:a}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i,o.treeForkCount=a)}function Cc(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=ao.current,s=(o&2)!=0;if(s?(o=o&1|2,t.flags|=128):o&=1,L(ao,o),$s(e,t,r,n),r=W?_i:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&xc(e,n,t);else if(e.tag===19)xc(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break a;for(;e.sibling===null;){if(e.return===null||e.return===t)break a;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(i){case`forwards`:for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&oo(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),Sc(t,!1,i,n,a,r);break;case`backwards`:case`unstable_legacy-backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&oo(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}Sc(t,!0,n,null,a,r);break;case`together`:Sc(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function wc(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Ul|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(qi(e,t,n,!1),(n&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(i(153));if(t.child!==null){for(e=t.child,n=ai(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=ai(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Y(e,t){return(e.lanes&t)===0?(e=e.dependencies,!!(e!==null&&Ji(e))):!0}function Tc(e,t,n){switch(t.tag){case 3:ue(t,t.stateNode.containerInfo),Ui(t,na,e.memoizedState.cache),Li();break;case 27:case 5:fe(t);break;case 4:ue(t,t.stateNode.containerInfo);break;case 10:Ui(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,to(t),null;break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated===null?(n&t.child.childLanes)===0?(eo(t),e=wc(e,t,n),e===null?null:e.sibling):_c(e,t,n):(eo(t),t.flags|=128,null);eo(t);break;case 19:var i=(e.flags&128)!=0;if(r=(n&t.childLanes)!==0,r||=(qi(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return Cc(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),L(ao,ao.current),r)break;return null;case 22:return t.lanes=0,rc(e,t,n,t.pendingProps);case 24:Ui(t,na,e.memoizedState.cache)}return wc(e,t,n)}function Ec(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)Qs=!0;else{if(!Y(e,n)&&!(t.flags&128))return Qs=!1,Tc(e,t,n);Qs=!!(e.flags&131072)}else Qs=!1,W&&t.flags&1048576&&wi(t,_i,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=Ca(t.elementType),t.type=e,typeof e==`function`)ii(e)?(r=Vs(e,r),t.tag=1,t=fc(null,t,e,r,n)):(t.tag=0,t=uc(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===w){t.tag=11,t=ec(null,t,e,r,n);break a}else if(a===D){t.tag=14,t=tc(null,t,e,r,n);break a}}throw t=N(e)||e,Error(i(306,t,``))}}return t;case 0:return uc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=Vs(r,t.pendingProps),fc(e,t,r,a,n);case 3:a:{if(ue(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var o=t.memoizedState;a=o.element,La(e,t),Wa(t,r,null,n);var s=t.memoizedState;if(r=s.cache,Ui(t,na,r),r!==o.cache&&Ki(t,[na],n,!0),Ua(),r=s.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:s.cache},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){t=pc(e,t,r,n);break a}else if(r!==a){a=pi(Error(i(424)),t),zi(a),t=pc(e,t,r,n);break a}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName===`HTML`?e.ownerDocument.body:e}for(ki=cf(e.firstChild),Oi=t,W=!0,Ai=null,ji=!0,n=Pa(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(Li(),r===a){t=wc(e,t,n);break a}$s(e,t,r,n)}t=t.child}return t;case 26:return lc(e,t),e===null?(n=kf(t.type,null,t.pendingProps,null))?t.memoizedState=n:W||(n=t.type,e=t.pendingProps,r=Bd(ce.current).createElement(n),r[it]=t,r[at]=e,Pd(r,n,e),_t(r),t.stateNode=r):t.memoizedState=kf(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return fe(t),e===null&&W&&(r=t.stateNode=ff(t.type,t.pendingProps,ce.current),Oi=t,ji=!0,a=ki,Zd(t.type)?(lf=a,ki=cf(r.firstChild)):ki=a),$s(e,t,t.pendingProps.children,n),lc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&W&&((a=r=ki)&&(r=tf(r,t.type,t.pendingProps,ji),r===null?a=!1:(t.stateNode=r,Oi=t,ki=cf(r.firstChild),ji=!1,a=!0)),a||Ni(t)),fe(t),a=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,Ud(a,o)?r=null:s!==null&&Ud(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=yo(e,t,So,null,null,n),Qf._currentValue=a),lc(e,t),$s(e,t,r,n),t.child;case 6:return e===null&&W&&((e=n=ki)&&(n=nf(n,t.pendingProps,ji),n===null?e=!1:(t.stateNode=n,Oi=t,ki=null,e=!0)),e||Ni(t)),null;case 13:return _c(e,t,n);case 4:return ue(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Na(t,null,r,n):$s(e,t,r,n),t.child;case 11:return ec(e,t,t.type,t.pendingProps,n);case 7:return $s(e,t,t.pendingProps,n),t.child;case 8:return $s(e,t,t.pendingProps.children,n),t.child;case 12:return $s(e,t,t.pendingProps.children,n),t.child;case 10:return r=t.pendingProps,Ui(t,t.type,r.value),$s(e,t,r.children,n),t.child;case 9:return a=t.type._context,r=t.pendingProps.children,Yi(t),a=Xi(a),r=r(a),t.flags|=1,$s(e,t,r,n),t.child;case 14:return tc(e,t,t.type,t.pendingProps,n);case 15:return nc(e,t,t.type,t.pendingProps,n);case 19:return Cc(e,t,n);case 31:return cc(e,t,n);case 22:return rc(e,t,n,t.pendingProps);case 24:return Yi(t),r=Xi(na),e===null?(a=ma(),a===null&&(a=Il,o=ra(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},Ia(t),Ui(t,na,a)):((e.lanes&n)!==0&&(La(e,t),Wa(t,null,null,n),Ua()),a=e.memoizedState,o=t.memoizedState,a.parent===r?(r=o.cache,Ui(t,na,r),r!==a.cache&&Ki(t,[na],n,!0)):(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),Ui(t,na,r))),$s(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function Dc(e){e.flags|=4}function Oc(e,t,n,r,i){if((t=(e.mode&32)!=0)&&(t=!1),t){if(e.flags|=16777216,(i&335544128)===i)if(e.stateNode.complete)e.flags|=8192;else if(Su())e.flags|=8192;else throw wa=ba,va}else e.flags&=-16777217}function kc(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!Wf(t))if(Su())e.flags|=8192;else throw wa=ba,va}function Ac(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:qe(),e.lanes|=t,ql|=t)}function jc(e,t){if(!W)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 Mc(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&65011712,r|=i.flags&65011712,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function Nc(e,t,n){var r=t.pendingProps;switch(Ei(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Mc(t),null;case 1:return Mc(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),Wi(na),de(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Ii(t)?Dc(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Ri())),Mc(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(Dc(t),o===null?(Mc(t),Oc(t,a,null,r,n)):(Mc(t),kc(t,o))):o?o===e.memoizedState?(Mc(t),t.flags&=-16777217):(Dc(t),Mc(t),kc(t,o)):(e=e.memoizedProps,e!==r&&Dc(t),Mc(t),Oc(t,a,e,r,n)),null;case 27:if(pe(t),n=ce.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Dc(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Mc(t),null}e=oe.current,Ii(t)?Pi(t,e):(e=ff(a,r,n),t.stateNode=e,Dc(t))}return Mc(t),null;case 5:if(pe(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Dc(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Mc(t),null}if(o=oe.current,Ii(t))Pi(t,o);else{var s=Bd(ce.current);switch(o){case 1:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case 2:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;default:switch(a){case`svg`:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case`math`:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;case`script`:o=s.createElement(`div`),o.innerHTML=`<script><\/script>`,o=o.removeChild(o.firstChild);break;case`select`:o=typeof r.is==`string`?s.createElement(`select`,{is:r.is}):s.createElement(`select`),r.multiple?o.multiple=!0:r.size&&(o.size=r.size);break;default:o=typeof r.is==`string`?s.createElement(a,{is:r.is}):s.createElement(a)}}o[it]=t,o[at]=r;a:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)o.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break a;for(;s.sibling===null;){if(s.return===null||s.return===t)break a;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=o;a:switch(Pd(o,a,r),a){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&Dc(t)}}return Mc(t),Oc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&Dc(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=ce.current,Ii(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=Oi,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[it]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||jd(e.nodeValue,n)),e||Ni(t,!0)}else e=Bd(e).createTextNode(r),e[it]=t,t.stateNode=e}return Mc(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=Ii(t),n!==null){if(e===null){if(!r)throw Error(i(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(557));e[it]=t}else Li(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Mc(t),e=!1}else n=Ri(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(io(t),t):(io(t),null);if(t.flags&128)throw Error(i(558))}return Mc(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=Ii(t),r!==null&&r.dehydrated!==null){if(e===null){if(!a)throw Error(i(318));if(a=t.memoizedState,a=a===null?null:a.dehydrated,!a)throw Error(i(317));a[it]=t}else Li(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Mc(t),a=!1}else a=Ri(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(io(t),t):(io(t),null)}return io(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,a=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(a=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==a&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),Ac(t,t.updateQueue),Mc(t),null);case 4:return de(),e===null&&xd(t.stateNode.containerInfo),Mc(t),null;case 10:return Wi(t.type),Mc(t),null;case 19:if(I(ao),r=t.memoizedState,r===null)return Mc(t),null;if(a=(t.flags&128)!=0,o=r.rendering,o===null)if(a)jc(r,!1);else{if(Hl!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=oo(e),o!==null){for(t.flags|=128,jc(r,!1),e=o.updateQueue,t.updateQueue=e,Ac(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)oi(n,e),n=n.sibling;return L(ao,ao.current&1|2),W&&Ci(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Ee()>$l&&(t.flags|=128,a=!0,jc(r,!1),t.lanes=4194304)}else{if(!a)if(e=oo(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,Ac(t,e),jc(r,!0),r.tail===null&&r.tailMode===`hidden`&&!o.alternate&&!W)return Mc(t),null}else 2*Ee()-r.renderingStartTime>$l&&n!==536870912&&(t.flags|=128,a=!0,jc(r,!1),t.lanes=4194304);r.isBackwards?(o.sibling=t.child,t.child=o):(e=r.last,e===null?t.child=o:e.sibling=o,r.last=o)}return r.tail===null?(Mc(t),null):(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=Ee(),e.sibling=null,n=ao.current,L(ao,a?n&1|2:n&1),W&&Ci(t,r.treeForkCount),e);case 22:case 23:return io(t),Za(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(Mc(t),t.subtreeFlags&6&&(t.flags|=8192)):Mc(t),n=t.updateQueue,n!==null&&Ac(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&I(pa),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Wi(na),Mc(t),null;case 25:return null;case 30:return null}throw Error(i(156,t.tag))}function Pc(e,t){switch(Ei(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Wi(na),de(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return pe(t),null;case 31:if(t.memoizedState!==null){if(io(t),t.alternate===null)throw Error(i(340));Li()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(io(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));Li()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return I(ao),null;case 4:return de(),null;case 10:return Wi(t.type),null;case 22:case 23:return io(t),Za(),e!==null&&I(pa),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Wi(na),null;case 25:return null;default:return null}}function Fc(e,t){switch(Ei(t),t.tag){case 3:Wi(na),de();break;case 26:case 27:case 5:pe(t);break;case 4:de();break;case 31:t.memoizedState!==null&&io(t);break;case 13:io(t);break;case 19:I(ao);break;case 10:Wi(t.type);break;case 22:case 23:io(t),Za(),e!==null&&I(pa);break;case 24:Wi(na)}}function Ic(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){Uu(t,t.return,e)}}function Lc(e,t,n){try{var r=t.updateQueue,i=r===null?null:r.lastEffect;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,i=t;var c=n,l=s;try{l()}catch(e){Uu(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){Uu(t,t.return,e)}}function Rc(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Ka(t,n)}catch(t){Uu(e,e.return,t)}}}function zc(e,t,n){n.props=Vs(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){Uu(e,t,n)}}function Bc(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){Uu(e,t,n)}}function Vc(e,t){var n=e.ref,r=e.refCleanup;if(n!==null)if(typeof r==`function`)try{r()}catch(n){Uu(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==`function`)try{n(null)}catch(n){Uu(e,t,n)}else n.current=null}function Hc(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{a:switch(t){case`button`:case`input`:case`select`:case`textarea`:n.autoFocus&&r.focus();break a;case`img`:n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){Uu(e,e.return,t)}}function Uc(e,t,n){try{var r=e.stateNode;Fd(r,e.type,n,t),r[at]=t}catch(t){Uu(e,e.return,t)}}function Wc(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Zd(e.type)||e.tag===4}function Gc(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Wc(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&Zd(e.type)||e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Kc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Zt));else if(r!==4&&(r===27&&Zd(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(Kc(e,t,n),e=e.sibling;e!==null;)Kc(e,t,n),e=e.sibling}function qc(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&&(r===27&&Zd(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(qc(e,t,n),e=e.sibling;e!==null;)qc(e,t,n),e=e.sibling}function Jc(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);Pd(t,r,n),t[it]=e,t[at]=n}catch(t){Uu(e,e.return,t)}}var Yc=!1,Xc=!1,Zc=!1,Qc=typeof WeakSet==`function`?WeakSet:Set,$c=null;function el(e,t){if(e=e.containerInfo,Rd=sp,e=Sr(e),Cr(e)){if(`selectionStart`in e)var n={start:e.selectionStart,end:e.selectionEnd};else a:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var a=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==n||a!==0&&f.nodeType!==3||(c=s+a),f!==o||r!==0&&f.nodeType!==3||(l=s+r),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===n&&++u===a&&(c=s),p===o&&++d===r&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}n=c===-1||l===-1?null:{start:c,end:l}}else n=null}n||={start:0,end:0}}else n=null;for(zd={focusedElem:e,selectionRange:n},sp=!1,$c=t;$c!==null;)if(t=$c,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,$c=e;else for(;$c!==null;){switch(t=$c,o=t.alternate,e=t.flags,t.tag){case 0:if(e&4&&(e=t.updateQueue,e=e===null?null:e.events,e!==null))for(n=0;n<e.length;n++)a=e[n],a.ref.impl=a.nextImpl;break;case 11:case 15:break;case 1:if(e&1024&&o!==null){e=void 0,n=t,a=o.memoizedProps,o=o.memoizedState,r=n.stateNode;try{var h=Vs(n.type,a);e=r.getSnapshotBeforeUpdate(h,o),r.__reactInternalSnapshotBeforeUpdate=e}catch(e){Uu(n,n.return,e)}}break;case 3:if(e&1024){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)ef(e);else if(n===1)switch(e.nodeName){case`HEAD`:case`HTML`:case`BODY`:ef(e);break;default:e.textContent=``}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if(e&1024)throw Error(i(163))}if(e=t.sibling,e!==null){e.return=t.return,$c=e;break}$c=t.return}}function tl(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:gl(e,n),r&4&&Ic(5,n);break;case 1:if(gl(e,n),r&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){Uu(n,n.return,e)}else{var i=Vs(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){Uu(n,n.return,e)}}r&64&&Rc(n),r&512&&Bc(n,n.return);break;case 3:if(gl(e,n),r&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{Ka(e,t)}catch(e){Uu(n,n.return,e)}}break;case 27:t===null&&r&4&&Jc(n);case 26:case 5:gl(e,n),t===null&&r&4&&Hc(n),r&512&&Bc(n,n.return);break;case 12:gl(e,n);break;case 31:gl(e,n),r&4&&sl(e,n);break;case 13:gl(e,n),r&4&&cl(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=qu.bind(null,n),sf(e,n))));break;case 22:if(r=n.memoizedState!==null||Yc,!r){t=t!==null&&t.memoizedState!==null||Xc,i=Yc;var a=Xc;Yc=r,(Xc=t)&&!a?vl(e,n,(n.subtreeFlags&8772)!=0):gl(e,n),Yc=i,Xc=a}break;case 30:break;default:gl(e,n)}}function nl(e){var t=e.alternate;t!==null&&(e.alternate=null,nl(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&ft(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var rl=null,il=!1;function al(e,t,n){for(n=n.child;n!==null;)ol(e,t,n),n=n.sibling}function ol(e,t,n){if(Ie&&typeof Ie.onCommitFiberUnmount==`function`)try{Ie.onCommitFiberUnmount(Fe,n)}catch{}switch(n.tag){case 26:Xc||Vc(n,t),al(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:Xc||Vc(n,t);var r=rl,i=il;Zd(n.type)&&(rl=n.stateNode,il=!1),al(e,t,n),pf(n.stateNode),rl=r,il=i;break;case 5:Xc||Vc(n,t);case 6:if(r=rl,i=il,rl=null,al(e,t,n),rl=r,il=i,rl!==null)if(il)try{(rl.nodeType===9?rl.body:rl.nodeName===`HTML`?rl.ownerDocument.body:rl).removeChild(n.stateNode)}catch(e){Uu(n,t,e)}else try{rl.removeChild(n.stateNode)}catch(e){Uu(n,t,e)}break;case 18:rl!==null&&(il?(e=rl,Qd(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Np(e)):Qd(rl,n.stateNode));break;case 4:r=rl,i=il,rl=n.stateNode.containerInfo,il=!0,al(e,t,n),rl=r,il=i;break;case 0:case 11:case 14:case 15:Lc(2,n,t),Xc||Lc(4,n,t),al(e,t,n);break;case 1:Xc||(Vc(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&zc(n,t,r)),al(e,t,n);break;case 21:al(e,t,n);break;case 22:Xc=(r=Xc)||n.memoizedState!==null,al(e,t,n),Xc=r;break;default:al(e,t,n)}}function sl(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Np(e)}catch(e){Uu(t,t.return,e)}}}function cl(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Np(e)}catch(e){Uu(t,t.return,e)}}function ll(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Qc),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Qc),t;default:throw Error(i(435,e.tag))}}function ul(e,t){var n=ll(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=Ju.bind(null,e,t);t.then(r,r)}})}function dl(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var a=n[r],o=e,s=t,c=s;a:for(;c!==null;){switch(c.tag){case 27:if(Zd(c.type)){rl=c.stateNode,il=!1;break a}break;case 5:rl=c.stateNode,il=!1;break a;case 3:case 4:rl=c.stateNode.containerInfo,il=!0;break a}c=c.return}if(rl===null)throw Error(i(160));ol(o,s,a),rl=null,il=!1,o=a.alternate,o!==null&&(o.return=null),a.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)pl(t,e),t=t.sibling}var fl=null;function pl(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:dl(t,e),ml(e),r&4&&(Lc(3,e,e.return),Ic(3,e),Lc(5,e,e.return));break;case 1:dl(t,e),ml(e),r&512&&(Xc||n===null||Vc(n,n.return)),r&64&&Yc&&(e=e.updateQueue,e!==null&&(r=e.callbacks,r!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?r:n.concat(r))));break;case 26:var a=fl;if(dl(t,e),ml(e),r&512&&(Xc||n===null||Vc(n,n.return)),r&4){var o=n===null?null:n.memoizedState;if(r=e.memoizedState,n===null)if(r===null)if(e.stateNode===null){a:{r=e.type,n=e.memoizedProps,a=a.ownerDocument||a;b:switch(r){case`title`:o=a.getElementsByTagName(`title`)[0],(!o||o[dt]||o[it]||o.namespaceURI===`http://www.w3.org/2000/svg`||o.hasAttribute(`itemprop`))&&(o=a.createElement(r),a.head.insertBefore(o,a.querySelector(`head > title`))),Pd(o,r,n),o[it]=e,_t(o),r=o;break a;case`link`:var s=Vf(`link`,`href`,a).get(r+(n.href||``));if(s){for(var c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`href`)===(n.href==null||n.href===``?null:n.href)&&o.getAttribute(`rel`)===(n.rel==null?null:n.rel)&&o.getAttribute(`title`)===(n.title==null?null:n.title)&&o.getAttribute(`crossorigin`)===(n.crossOrigin==null?null:n.crossOrigin)){s.splice(c,1);break b}}o=a.createElement(r),Pd(o,r,n),a.head.appendChild(o);break;case`meta`:if(s=Vf(`meta`,`content`,a).get(r+(n.content||``))){for(c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`content`)===(n.content==null?null:``+n.content)&&o.getAttribute(`name`)===(n.name==null?null:n.name)&&o.getAttribute(`property`)===(n.property==null?null:n.property)&&o.getAttribute(`http-equiv`)===(n.httpEquiv==null?null:n.httpEquiv)&&o.getAttribute(`charset`)===(n.charSet==null?null:n.charSet)){s.splice(c,1);break b}}o=a.createElement(r),Pd(o,r,n),a.head.appendChild(o);break;default:throw Error(i(468,r))}o[it]=e,_t(o),r=o}e.stateNode=r}else Hf(a,e.type,e.stateNode);else e.stateNode=If(a,r,e.memoizedProps);else o===r?r===null&&e.stateNode!==null&&Uc(e,e.memoizedProps,n.memoizedProps):(o===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):o.count--,r===null?Hf(a,e.type,e.stateNode):If(a,r,e.memoizedProps))}break;case 27:dl(t,e),ml(e),r&512&&(Xc||n===null||Vc(n,n.return)),n!==null&&r&4&&Uc(e,e.memoizedProps,n.memoizedProps);break;case 5:if(dl(t,e),ml(e),r&512&&(Xc||n===null||Vc(n,n.return)),e.flags&32){a=e.stateNode;try{Ut(a,``)}catch(t){Uu(e,e.return,t)}}r&4&&e.stateNode!=null&&(a=e.memoizedProps,Uc(e,a,n===null?a:n.memoizedProps)),r&1024&&(Zc=!0);break;case 6:if(dl(t,e),ml(e),r&4){if(e.stateNode===null)throw Error(i(162));r=e.memoizedProps,n=e.stateNode;try{n.nodeValue=r}catch(t){Uu(e,e.return,t)}}break;case 3:if(Bf=null,a=fl,fl=gf(t.containerInfo),dl(t,e),fl=a,ml(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Np(t.containerInfo)}catch(t){Uu(e,e.return,t)}Zc&&(Zc=!1,hl(e));break;case 4:r=fl,fl=gf(e.stateNode.containerInfo),dl(t,e),ml(e),fl=r;break;case 12:dl(t,e),ml(e);break;case 31:dl(t,e),ml(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,ul(e,r)));break;case 13:dl(t,e),ml(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(Zl=Ee()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,ul(e,r)));break;case 22:a=e.memoizedState!==null;var l=n!==null&&n.memoizedState!==null,u=Yc,d=Xc;if(Yc=u||a,Xc=d||l,dl(t,e),Xc=d,Yc=u,ml(e),r&8192)a:for(t=e.stateNode,t._visibility=a?t._visibility&-2:t._visibility|1,a&&(n===null||l||Yc||Xc||_l(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){l=n=t;try{if(o=l.stateNode,a)s=o.style,typeof s.setProperty==`function`?s.setProperty(`display`,`none`,`important`):s.display=`none`;else{c=l.stateNode;var f=l.memoizedProps.style,p=f!=null&&f.hasOwnProperty(`display`)?f.display:null;c.style.display=p==null||typeof p==`boolean`?``:(``+p).trim()}}catch(e){Uu(l,l.return,e)}}}else if(t.tag===6){if(n===null){l=t;try{l.stateNode.nodeValue=a?``:l.memoizedProps}catch(e){Uu(l,l.return,e)}}}else if(t.tag===18){if(n===null){l=t;try{var m=l.stateNode;a?$d(m,!0):$d(l.stateNode,!1)}catch(e){Uu(l,l.return,e)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break a;for(;t.sibling===null;){if(t.return===null||t.return===e)break a;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}r&4&&(r=e.updateQueue,r!==null&&(n=r.retryQueue,n!==null&&(r.retryQueue=null,ul(e,n))));break;case 19:dl(t,e),ml(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,ul(e,r)));break;case 30:break;case 21:break;default:dl(t,e),ml(e)}}function ml(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(Wc(r)){n=r;break}r=r.return}if(n==null)throw Error(i(160));switch(n.tag){case 27:var a=n.stateNode;qc(e,Gc(e),a);break;case 5:var o=n.stateNode;n.flags&32&&(Ut(o,``),n.flags&=-33),qc(e,Gc(e),o);break;case 3:case 4:var s=n.stateNode.containerInfo;Kc(e,Gc(e),s);break;default:throw Error(i(161))}}catch(t){Uu(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function hl(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;hl(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function gl(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)tl(e,t.alternate,t),t=t.sibling}function _l(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Lc(4,t,t.return),_l(t);break;case 1:Vc(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount==`function`&&zc(t,t.return,n),_l(t);break;case 27:pf(t.stateNode);case 26:case 5:Vc(t,t.return),_l(t);break;case 22:t.memoizedState===null&&_l(t);break;case 30:_l(t);break;default:_l(t)}e=e.sibling}}function vl(e,t,n){for(n&&=(t.subtreeFlags&8772)!=0,t=t.child;t!==null;){var r=t.alternate,i=e,a=t,o=a.flags;switch(a.tag){case 0:case 11:case 15:vl(i,a,n),Ic(4,a);break;case 1:if(vl(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){Uu(r,r.return,e)}if(r=a,i=r.updateQueue,i!==null){var s=r.stateNode;try{var c=i.shared.hiddenCallbacks;if(c!==null)for(i.shared.hiddenCallbacks=null,i=0;i<c.length;i++)Ga(c[i],s)}catch(e){Uu(r,r.return,e)}}n&&o&64&&Rc(a),Bc(a,a.return);break;case 27:Jc(a);case 26:case 5:vl(i,a,n),n&&r===null&&o&4&&Hc(a),Bc(a,a.return);break;case 12:vl(i,a,n);break;case 31:vl(i,a,n),n&&o&4&&sl(i,a);break;case 13:vl(i,a,n),n&&o&4&&cl(i,a);break;case 22:a.memoizedState===null&&vl(i,a,n),Bc(a,a.return);break;case 30:break;default:vl(i,a,n)}t=t.sibling}}function yl(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&ia(n))}function bl(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ia(e))}function xl(e,t,n,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Sl(e,t,n,r),t=t.sibling}function Sl(e,t,n,r){var i=t.flags;switch(t.tag){case 0:case 11:case 15:xl(e,t,n,r),i&2048&&Ic(9,t);break;case 1:xl(e,t,n,r);break;case 3:xl(e,t,n,r),i&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ia(e)));break;case 12:if(i&2048){xl(e,t,n,r),e=t.stateNode;try{var a=t.memoizedProps,o=a.id,s=a.onPostCommit;typeof s==`function`&&s(o,t.alternate===null?`mount`:`update`,e.passiveEffectDuration,-0)}catch(e){Uu(t,t.return,e)}}else xl(e,t,n,r);break;case 31:xl(e,t,n,r);break;case 13:xl(e,t,n,r);break;case 23:break;case 22:a=t.stateNode,o=t.alternate,t.memoizedState===null?a._visibility&2?xl(e,t,n,r):(a._visibility|=2,Cl(e,t,n,r,(t.subtreeFlags&10256)!=0||!1)):a._visibility&2?xl(e,t,n,r):wl(e,t),i&2048&&yl(o,t);break;case 24:xl(e,t,n,r),i&2048&&bl(t.alternate,t);break;default:xl(e,t,n,r)}}function Cl(e,t,n,r,i){for(i&&=(t.subtreeFlags&10256)!=0||!1,t=t.child;t!==null;){var a=e,o=t,s=n,c=r,l=o.flags;switch(o.tag){case 0:case 11:case 15:Cl(a,o,s,c,i),Ic(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,Cl(a,o,s,c,i)):u._visibility&2?Cl(a,o,s,c,i):wl(a,o),i&&l&2048&&yl(o.alternate,o);break;case 24:Cl(a,o,s,c,i),i&&l&2048&&bl(o.alternate,o);break;default:Cl(a,o,s,c,i)}t=t.sibling}}function wl(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,r=t,i=r.flags;switch(r.tag){case 22:wl(n,r),i&2048&&yl(r.alternate,r);break;case 24:wl(n,r),i&2048&&bl(r.alternate,r);break;default:wl(n,r)}t=t.sibling}}var Tl=8192;function El(e,t,n){if(e.subtreeFlags&Tl)for(e=e.child;e!==null;)Dl(e,t,n),e=e.sibling}function Dl(e,t,n){switch(e.tag){case 26:El(e,t,n),e.flags&Tl&&e.memoizedState!==null&&Gf(n,fl,e.memoizedState,e.memoizedProps);break;case 5:El(e,t,n);break;case 3:case 4:var r=fl;fl=gf(e.stateNode.containerInfo),El(e,t,n),fl=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Tl,Tl=16777216,El(e,t,n),Tl=r):El(e,t,n));break;default:El(e,t,n)}}function Ol(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function kl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];$c=r,Ml(r,e)}Ol(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Al(e),e=e.sibling}function Al(e){switch(e.tag){case 0:case 11:case 15:kl(e),e.flags&2048&&Lc(9,e,e.return);break;case 3:kl(e);break;case 12:kl(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,jl(e)):kl(e);break;default:kl(e)}}function jl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];$c=r,Ml(r,e)}Ol(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Lc(8,t,t.return),jl(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,jl(t));break;default:jl(t)}e=e.sibling}}function Ml(e,t){for(;$c!==null;){var n=$c;switch(n.tag){case 0:case 11:case 15:Lc(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var r=n.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:ia(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,$c=r;else a:for(n=e;$c!==null;){r=$c;var i=r.sibling,a=r.return;if(nl(r),r===n){$c=null;break a}if(i!==null){i.return=a,$c=i;break a}$c=a}}}var Nl={getCacheForType:function(e){var t=Xi(na),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return Xi(na).controller.signal}},Pl=typeof WeakMap==`function`?WeakMap:Map,Fl=0,Il=null,X=null,Z=0,Q=0,Ll=null,Rl=!1,zl=!1,Bl=!1,Vl=0,Hl=0,Ul=0,Wl=0,Gl=0,Kl=0,ql=0,Jl=null,Yl=null,Xl=!1,Zl=0,Ql=0,$l=1/0,eu=null,tu=null,nu=0,ru=null,iu=null,au=0,ou=0,su=null,cu=null,lu=0,uu=null;function du(){return Fl&2&&Z!==0?Z&-Z:P.T===null?tt():ud()}function fu(){if(Kl===0)if(!(Z&536870912)||W){var e=Ve;Ve<<=1,!(Ve&3932160)&&(Ve=262144),Kl=e}else Kl=536870912;return e=Qa.current,e!==null&&(e.flags|=32),Kl}function pu(e,t,n){(e===Il&&(Q===2||Q===9)||e.cancelPendingCommit!==null)&&(bu(e,0),_u(e,Z,Kl,!1)),Ye(e,n),(!(Fl&2)||e!==Il)&&(e===Il&&(!(Fl&2)&&(Wl|=n),Hl===4&&_u(e,Z,Kl,!1)),nd(e))}function mu(e,t,n){if(Fl&6)throw Error(i(327));var r=!n&&(t&127)==0&&(t&e.expiredLanes)===0||Ge(e,t),a=r?Ou(e,t):Eu(e,t,!0),o=r;do{if(a===0){zl&&!r&&_u(e,t,0,!1);break}else{if(n=e.current.alternate,o&&!gu(n)){a=Eu(e,t,!1),o=!1;continue}if(a===2){if(o=t,e.errorRecoveryDisabledLanes&o)var s=0;else s=e.pendingLanes&-536870913,s=s===0?s&536870912?536870912:0:s;if(s!==0){t=s;a:{var c=e;a=Jl;var l=c.current.memoizedState.isDehydrated;if(l&&(bu(c,s).flags|=256),s=Eu(c,s,!1),s!==2){if(Bl&&!l){c.errorRecoveryDisabledLanes|=o,Wl|=o,a=4;break a}o=Yl,Yl=a,o!==null&&(Yl===null?Yl=o:Yl.push.apply(Yl,o))}a=s}if(o=!1,a!==2)continue}}if(a===1){bu(e,0),_u(e,t,0,!0);break}a:{switch(r=e,o=a,o){case 0:case 1:throw Error(i(345));case 4:if((t&4194048)!==t)break;case 6:_u(r,t,Kl,!Rl);break a;case 2:Yl=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(a=Zl+300-Ee(),10<a)){if(_u(r,t,Kl,!Rl),We(r,0,!0)!==0)break a;au=t,r.timeoutHandle=Kd(hu.bind(null,r,n,Yl,eu,Xl,t,Kl,Wl,ql,Rl,o,`Throttled`,-0,0),a);break a}hu(r,n,Yl,eu,Xl,t,Kl,Wl,ql,Rl,o,null,-0,0)}}break}while(1);nd(e)}function hu(e,t,n,r,i,a,o,s,c,l,u,d,f,p){if(e.timeoutHandle=-1,d=t.subtreeFlags,d&8192||(d&16785408)==16785408){d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Zt},Dl(t,a,d);var m=(a&62914560)===a?Zl-Ee():(a&4194048)===a?Ql-Ee():0;if(m=qf(d,m),m!==null){au=a,e.cancelPendingCommit=m(Fu.bind(null,e,t,a,n,r,i,o,s,c,u,d,null,f,p)),_u(e,a,o,!l);return}}Fu(e,t,a,n,r,i,o,s,c)}function gu(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var r=0;r<n.length;r++){var i=n[r],a=i.getSnapshot;i=i.value;try{if(!_r(a(),i))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 _u(e,t,n,r){t&=~Gl,t&=~Wl,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-z(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&Ze(e,n,t)}function vu(){return Fl&6?!0:(rd(0,!1),!1)}function yu(){if(X!==null){if(Q===0)var e=X.return;else e=X,Hi=Vi=null,To(e),Da=null,Oa=0,e=X;for(;e!==null;)Fc(e.alternate,e),e=e.return;X=null}}function bu(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,qd(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),au=0,yu(),Il=e,X=n=ai(e.current,null),Z=t,Q=0,Ll=null,Rl=!1,zl=Ge(e,t),Bl=!1,ql=Kl=Gl=Wl=Ul=Hl=0,Yl=Jl=null,Xl=!1,t&8&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0<r;){var i=31-z(r),a=1<<i;t|=e[i],r&=~a}return Vl=t,Yr(),n}function xu(e,t){G=null,P.H=Ps,t===_a||t===ya?(t=Ta(),Q=3):t===va?(t=Ta(),Q=4):Q=t===Zs?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,Ll=t,X===null&&(Hl=1,Gs(e,pi(t,e.current)))}function Su(){var e=Qa.current;return e===null?!0:(Z&4194048)===Z?$a===null:(Z&62914560)===Z||Z&536870912?e===$a:!1}function Cu(){var e=P.H;return P.H=Ps,e===null?Ps:e}function wu(){var e=P.A;return P.A=Nl,e}function Tu(){Hl=4,Rl||(Z&4194048)!==Z&&Qa.current!==null||(zl=!0),!(Ul&134217727)&&!(Wl&134217727)||Il===null||_u(Il,Z,Kl,!1)}function Eu(e,t,n){var r=Fl;Fl|=2;var i=Cu(),a=wu();(Il!==e||Z!==t)&&(eu=null,bu(e,t)),t=!1;var o=Hl;a:do try{if(Q!==0&&X!==null){var s=X,c=Ll;switch(Q){case 8:yu(),o=6;break a;case 3:case 2:case 9:case 6:Qa.current===null&&(t=!0);var l=Q;if(Q=0,Ll=null,Mu(e,s,c,l),n&&zl){o=0;break a}break;default:l=Q,Q=0,Ll=null,Mu(e,s,c,l)}}Du(),o=Hl;break}catch(t){xu(e,t)}while(1);return t&&e.shellSuspendCounter++,Hi=Vi=null,Fl=r,P.H=i,P.A=a,X===null&&(Il=null,Z=0,Yr()),o}function Du(){for(;X!==null;)Au(X)}function Ou(e,t){var n=Fl;Fl|=2;var r=Cu(),a=wu();Il!==e||Z!==t?(eu=null,$l=Ee()+500,bu(e,t)):zl=Ge(e,t);a:do try{if(Q!==0&&X!==null){t=X;var o=Ll;b:switch(Q){case 1:Q=0,Ll=null,Mu(e,t,o,1);break;case 2:case 9:if(xa(o)){Q=0,Ll=null,ju(t);break}t=function(){Q!==2&&Q!==9||Il!==e||(Q=7),nd(e)},o.then(t,t);break a;case 3:Q=7;break a;case 4:Q=5;break a;case 7:xa(o)?(Q=0,Ll=null,ju(t)):(Q=0,Ll=null,Mu(e,t,o,7));break;case 5:var s=null;switch(X.tag){case 26:s=X.memoizedState;case 5:case 27:var c=X;if(s?Wf(s):c.stateNode.complete){Q=0,Ll=null;var l=c.sibling;if(l!==null)X=l;else{var u=c.return;u===null?X=null:(X=u,Nu(u))}break b}}Q=0,Ll=null,Mu(e,t,o,5);break;case 6:Q=0,Ll=null,Mu(e,t,o,6);break;case 8:yu(),Hl=6;break a;default:throw Error(i(462))}}ku();break}catch(t){xu(e,t)}while(1);return Hi=Vi=null,P.H=r,P.A=a,Fl=n,X===null?(Il=null,Z=0,Yr(),Hl):0}function ku(){for(;X!==null&&!we();)Au(X)}function Au(e){var t=Ec(e.alternate,e,Vl);e.memoizedProps=e.pendingProps,t===null?Nu(e):X=t}function ju(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=dc(n,t,t.pendingProps,t.type,void 0,Z);break;case 11:t=dc(n,t,t.pendingProps,t.type.render,t.ref,Z);break;case 5:To(t);default:Fc(n,t),t=X=oi(t,Vl),t=Ec(n,t,Vl)}e.memoizedProps=e.pendingProps,t===null?Nu(e):X=t}function Mu(e,t,n,r){Hi=Vi=null,To(t),Da=null,Oa=0;var i=t.return;try{if(Xs(e,i,t,n,Z)){Hl=1,Gs(e,pi(n,e.current)),X=null;return}}catch(t){if(i!==null)throw X=i,t;Hl=1,Gs(e,pi(n,e.current)),X=null;return}t.flags&32768?(W||r===1?e=!0:zl||Z&536870912?e=!1:(Rl=e=!0,(r===2||r===9||r===3||r===6)&&(r=Qa.current,r!==null&&r.tag===13&&(r.flags|=16384))),Pu(t,e)):Nu(t)}function Nu(e){var t=e;do{if(t.flags&32768){Pu(t,Rl);return}e=t.return;var n=Nc(t.alternate,t,Vl);if(n!==null){X=n;return}if(t=t.sibling,t!==null){X=t;return}X=t=e}while(t!==null);Hl===0&&(Hl=5)}function Pu(e,t){do{var n=Pc(e.alternate,e);if(n!==null){n.flags&=32767,X=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){X=e;return}X=e=n}while(e!==null);Hl=6,X=null}function Fu(e,t,n,r,a,o,s,c,l){e.cancelPendingCommit=null;do Bu();while(nu!==0);if(Fl&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));if(o=t.lanes|t.childLanes,o|=Jr,Xe(e,n,o,s,c,l),e===Il&&(X=Il=null,Z=0),iu=t,ru=e,au=n,ou=o,su=a,cu=r,t.subtreeFlags&10256||t.flags&10256?(e.callbackNode=null,e.callbackPriority=0,Yu(Ae,function(){return Vu(),null})):(e.callbackNode=null,e.callbackPriority=0),r=(t.flags&13878)!=0,t.subtreeFlags&13878||r){r=P.T,P.T=null,a=F.p,F.p=2,s=Fl,Fl|=4;try{el(e,t,n)}finally{Fl=s,F.p=a,P.T=r}}nu=1,Iu(),Lu(),Ru()}}function Iu(){if(nu===1){nu=0;var e=ru,t=iu,n=(t.flags&13878)!=0;if(t.subtreeFlags&13878||n){n=P.T,P.T=null;var r=F.p;F.p=2;var i=Fl;Fl|=4;try{pl(t,e);var a=zd,o=Sr(e.containerInfo),s=a.focusedElem,c=a.selectionRange;if(o!==s&&s&&s.ownerDocument&&xr(s.ownerDocument.documentElement,s)){if(c!==null&&Cr(s)){var l=c.start,u=c.end;if(u===void 0&&(u=l),`selectionStart`in s)s.selectionStart=l,s.selectionEnd=Math.min(u,s.value.length);else{var d=s.ownerDocument||document,f=d&&d.defaultView||window;if(f.getSelection){var p=f.getSelection(),m=s.textContent.length,h=Math.min(c.start,m),g=c.end===void 0?h:Math.min(c.end,m);!p.extend&&h>g&&(o=g,g=h,h=o);var _=br(s,h),v=br(s,g);if(_&&v&&(p.rangeCount!==1||p.anchorNode!==_.node||p.anchorOffset!==_.offset||p.focusNode!==v.node||p.focusOffset!==v.offset)){var y=d.createRange();y.setStart(_.node,_.offset),p.removeAllRanges(),h>g?(p.addRange(y),p.extend(v.node,v.offset)):(y.setEnd(v.node,v.offset),p.addRange(y))}}}}for(d=[],p=s;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof s.focus==`function`&&s.focus(),s=0;s<d.length;s++){var b=d[s];b.element.scrollLeft=b.left,b.element.scrollTop=b.top}}sp=!!Rd,zd=Rd=null}finally{Fl=i,F.p=r,P.T=n}}e.current=t,nu=2}}function Lu(){if(nu===2){nu=0;var e=ru,t=iu,n=(t.flags&8772)!=0;if(t.subtreeFlags&8772||n){n=P.T,P.T=null;var r=F.p;F.p=2;var i=Fl;Fl|=4;try{tl(e,t.alternate,t)}finally{Fl=i,F.p=r,P.T=n}}nu=3}}function Ru(){if(nu===4||nu===3){nu=0,Te();var e=ru,t=iu,n=au,r=cu;t.subtreeFlags&10256||t.flags&10256?nu=5:(nu=0,iu=ru=null,zu(e,e.pendingLanes));var i=e.pendingLanes;if(i===0&&(tu=null),et(n),t=t.stateNode,Ie&&typeof Ie.onCommitFiberRoot==`function`)try{Ie.onCommitFiberRoot(Fe,t,void 0,(t.current.flags&128)==128)}catch{}if(r!==null){t=P.T,i=F.p,F.p=2,P.T=null;try{for(var a=e.onRecoverableError,o=0;o<r.length;o++){var s=r[o];a(s.value,{componentStack:s.stack})}}finally{P.T=t,F.p=i}}au&3&&Bu(),nd(e),i=e.pendingLanes,n&261930&&i&42?e===uu?lu++:(lu=0,uu=e):lu=0,rd(0,!1)}}function zu(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,ia(t)))}function Bu(){return Iu(),Lu(),Ru(),Vu()}function Vu(){if(nu!==5)return!1;var e=ru,t=ou;ou=0;var n=et(au),r=P.T,a=F.p;try{F.p=32>n?32:n,P.T=null,n=su,su=null;var o=ru,s=au;if(nu=0,iu=ru=null,au=0,Fl&6)throw Error(i(331));var c=Fl;if(Fl|=4,Al(o.current),Sl(o,o.current,s,n),Fl=c,rd(0,!1),Ie&&typeof Ie.onPostCommitFiberRoot==`function`)try{Ie.onPostCommitFiberRoot(Fe,o)}catch{}return!0}finally{F.p=a,P.T=r,zu(e,t)}}function Hu(e,t,n){t=pi(n,t),t=qs(e.stateNode,t,2),e=za(e,t,2),e!==null&&(Ye(e,2),nd(e))}function Uu(e,t,n){if(e.tag===3)Hu(e,e,n);else for(;t!==null;){if(t.tag===3){Hu(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(tu===null||!tu.has(r))){e=pi(n,e),n=Js(2),r=za(t,n,2),r!==null&&(Ys(n,r,t,e),Ye(r,2),nd(r));break}}t=t.return}}function Wu(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Pl;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(Bl=!0,i.add(n),e=Gu.bind(null,e,t,n),t.then(e,e))}function Gu(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Il===e&&(Z&n)===n&&(Hl===4||Hl===3&&(Z&62914560)===Z&&300>Ee()-Zl?!(Fl&2)&&bu(e,0):Gl|=n,ql===Z&&(ql=0)),nd(e)}function Ku(e,t){t===0&&(t=qe()),e=Qr(e,t),e!==null&&(Ye(e,t),nd(e))}function qu(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Ku(e,n)}function Ju(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(i(314))}r!==null&&r.delete(t),Ku(e,n)}function Yu(e,t){return Se(e,t)}var Xu=null,Zu=null,Qu=!1,$u=!1,ed=!1,td=0;function nd(e){e!==Zu&&e.next===null&&(Zu===null?Xu=Zu=e:Zu=Zu.next=e),$u=!0,Qu||(Qu=!0,ld())}function rd(e,t){if(!ed&&$u){ed=!0;do for(var n=!1,r=Xu;r!==null;){if(!t)if(e!==0){var i=r.pendingLanes;if(i===0)var a=0;else{var o=r.suspendedLanes,s=r.pingedLanes;a=(1<<31-z(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,cd(r,a))}else a=Z,a=We(r,r===Il?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||Ge(r,a)||(n=!0,cd(r,a));r=r.next}while(n);ed=!1}}function id(){ad()}function ad(){$u=Qu=!1;var e=0;td!==0&&Gd()&&(e=td);for(var t=Ee(),n=null,r=Xu;r!==null;){var i=r.next,a=od(r,t);a===0?(r.next=null,n===null?Xu=i:n.next=i,i===null&&(Zu=n)):(n=r,(e!==0||a&3)&&($u=!0)),r=i}nu!==0&&nu!==5||rd(e,!1),td!==0&&(td=0)}function od(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-z(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=Ke(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=Il,n=Z,n=We(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(Q===2||Q===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&Ce(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||Ge(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&Ce(r),et(n)){case 2:case 8:n=ke;break;case 32:n=Ae;break;case 268435456:n=Me;break;default:n=Ae}return r=sd.bind(null,e),n=Se(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&Ce(r),e.callbackPriority=2,e.callbackNode=null,2}function sd(e,t){if(nu!==0&&nu!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Bu()&&e.callbackNode!==n)return null;var r=Z;return r=We(e,e===Il?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(mu(e,r,t),od(e,Ee()),e.callbackNode!=null&&e.callbackNode===n?sd.bind(null,e):null)}function cd(e,t){if(Bu())return null;mu(e,t,!0)}function ld(){Yd(function(){Fl&6?Se(Oe,id):ad()})}function ud(){if(td===0){var e=sa;e===0&&(e=Be,Be<<=1,!(Be&261888)&&(Be=256)),td=e}return td}function dd(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:Xt(``+e)}function fd(e,t){var n=t.ownerDocument.createElement(`input`);return n.name=t.name,n.value=t.value,e.id&&n.setAttribute(`form`,e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}function pd(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=dd((i[at]||null).action),o=r.submitter;o&&(t=(t=o[at]||null)?dd(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new vn(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(td!==0){var e=o?fd(i,o):new FormData(i);bs(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=o?fd(i,o):new FormData(i),bs(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var md=0;md<Ur.length;md++){var hd=Ur[md];Wr(hd.toLowerCase(),`on`+(hd[0].toUpperCase()+hd.slice(1)))}Wr(Fr,`onAnimationEnd`),Wr(Ir,`onAnimationIteration`),Wr(Lr,`onAnimationStart`),Wr(`dblclick`,`onDoubleClick`),Wr(`focusin`,`onFocus`),Wr(`focusout`,`onBlur`),Wr(Rr,`onTransitionRun`),Wr(zr,`onTransitionStart`),Wr(Br,`onTransitionCancel`),Wr(Vr,`onTransitionEnd`),xt(`onMouseEnter`,[`mouseout`,`mouseover`]),xt(`onMouseLeave`,[`mouseout`,`mouseover`]),xt(`onPointerEnter`,[`pointerout`,`pointerover`]),xt(`onPointerLeave`,[`pointerout`,`pointerover`]),bt(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),bt(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),bt(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),bt(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),bt(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),bt(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var gd=`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(` `),_d=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(gd));function vd(e,t){t=(t&4)!=0;for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;a:{var a=void 0;if(t)for(var o=r.length-1;0<=o;o--){var s=r[o],c=s.instance,l=s.currentTarget;if(s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){Gr(e)}i.currentTarget=null,a=c}else for(o=0;o<r.length;o++){if(s=r[o],c=s.instance,l=s.currentTarget,s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){Gr(e)}i.currentTarget=null,a=c}}}}function $(e,t){var n=t[st];n===void 0&&(n=t[st]=new Set);var r=e+`__bubble`;n.has(r)||(Sd(t,e,2,!1),n.add(r))}function yd(e,t,n){var r=0;t&&(r|=4),Sd(n,e,r,t)}var bd=`_reactListening`+Math.random().toString(36).slice(2);function xd(e){if(!e[bd]){e[bd]=!0,vt.forEach(function(t){t!==`selectionchange`&&(_d.has(t)||yd(t,!1,e),yd(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[bd]||(t[bd]=!0,yd(`selectionchange`,!1,t))}}function Sd(e,t,n,r){switch(mp(t)){case 2:var i=cp;break;case 8:i=lp;break;default:i=up}n=i.bind(null,t,n,e),i=void 0,!sn||t!==`touchstart`&&t!==`touchmove`&&t!==`wheel`||(i=!0),r?i===void 0?e.addEventListener(t,n,!0):e.addEventListener(t,n,{capture:!0,passive:i}):i===void 0?e.addEventListener(t,n,!1):e.addEventListener(t,n,{passive:i})}function Cd(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)a:for(;;){if(r===null)return;var s=r.tag;if(s===3||s===4){var c=r.stateNode.containerInfo;if(c===i)break;if(s===4)for(s=r.return;s!==null;){var l=s.tag;if((l===3||l===4)&&s.stateNode.containerInfo===i)return;s=s.return}for(;c!==null;){if(s=pt(c),s===null)return;if(l=s.tag,l===5||l===6||l===26||l===27){r=a=s;continue a}c=c.parentNode}}r=r.return}rn(function(){var r=a,i=$t(n),s=[];a:{var c=Hr.get(e);if(c!==void 0){var l=vn,u=e;switch(e){case`keypress`:if(pn(n)===0)break a;case`keydown`:case`keyup`:l=Pn;break;case`focusin`:u=`focus`,l=Dn;break;case`focusout`:u=`blur`,l=Dn;break;case`beforeblur`:case`afterblur`:l=Dn;break;case`click`:if(n.button===2)break a;case`auxclick`:case`dblclick`:case`mousedown`:case`mousemove`:case`mouseup`:case`mouseout`:case`mouseover`:case`contextmenu`:l=Tn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=En;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=In;break;case Fr:case Ir:case Lr:l=On;break;case Vr:l=Ln;break;case`scroll`:case`scrollend`:l=bn;break;case`wheel`:l=Rn;break;case`copy`:case`cut`:case`paste`:l=H;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=Fn;break;case`toggle`:case`beforetoggle`:l=zn}var d=(t&4)!=0,f=!d&&(e===`scroll`||e===`scrollend`),p=d?c===null?null:c+`Capture`:c;d=[];for(var m=r,h;m!==null;){var g=m;if(h=g.stateNode,g=g.tag,g!==5&&g!==26&&g!==27||h===null||p===null||(g=an(m,p),g!=null&&d.push(wd(m,g,h))),f)break;m=m.return}0<d.length&&(c=new l(c,u,null,n,i),s.push({event:c,listeners:d}))}}if(!(t&7)){a:{if(c=e===`mouseover`||e===`pointerover`,l=e===`mouseout`||e===`pointerout`,c&&n!==Qt&&(u=n.relatedTarget||n.fromElement)&&(pt(u)||u[ot]))break a;if((l||c)&&(c=i.window===i?i:(c=i.ownerDocument)?c.defaultView||c.parentWindow:window,l?(u=n.relatedTarget||n.toElement,l=r,u=u?pt(u):null,u!==null&&(f=o(u),d=u.tag,u!==f||d!==5&&d!==27&&d!==6)&&(u=null)):(l=null,u=r),l!==u)){if(d=Tn,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=Fn,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=l==null?c:ht(l),h=u==null?c:ht(u),c=new d(g,m+`leave`,l,n,i),c.target=f,c.relatedTarget=h,g=null,pt(i)===r&&(d=new d(p,m+`enter`,u,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,l&&u)b:{for(d=Ed,p=l,m=u,h=0,g=p;g;g=d(g))h++;g=0;for(var _=m;_;_=d(_))g++;for(;0<h-g;)p=d(p),h--;for(;0<g-h;)m=d(m),g--;for(;h--;){if(p===m||m!==null&&p===m.alternate){d=p;break b}p=d(p),m=d(m)}d=null}else d=null;l!==null&&Dd(s,c,l,d,!1),u!==null&&f!==null&&Dd(s,f,u,d,!0)}}a:{if(c=r?ht(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var v=ar;else if($n(c))if(or)v=hr;else{v=pr;var y=fr}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&qt(r.elementType)&&(v=ar):v=mr;if(v&&=v(e,r)){er(s,v,n,i);break a}y&&y(e,c,r),e===`focusout`&&r&&c.type===`number`&&r.memoizedProps.value!=null&&zt(c,`number`,c.value)}switch(y=r?ht(r):window,e){case`focusin`:($n(y)||y.contentEditable===`true`)&&(Tr=y,Er=r,Dr=null);break;case`focusout`:Dr=Er=Tr=null;break;case`mousedown`:Or=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:Or=!1,kr(s,n,i);break;case`selectionchange`:if(wr)break;case`keydown`:case`keyup`:kr(s,n,i)}var b;if(Vn)b:{switch(e){case`compositionstart`:var x=`onCompositionStart`;break b;case`compositionend`:x=`onCompositionEnd`;break b;case`compositionupdate`:x=`onCompositionUpdate`;break b}x=void 0}else Yn?qn(e,n)&&(x=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(x=`onCompositionStart`);x&&(Wn&&n.locale!==`ko`&&(Yn||x!==`onCompositionStart`?x===`onCompositionEnd`&&Yn&&(b=fn()):(ln=i,un=`value`in ln?ln.value:ln.textContent,Yn=!0)),y=Td(r,x),0<y.length&&(x=new kn(x,e,null,n,i),s.push({event:x,listeners:y}),b?x.data=b:(b=Jn(n),b!==null&&(x.data=b)))),(b=Un?Xn(e,n):Zn(e,n))&&(x=Td(r,`onBeforeInput`),0<x.length&&(y=new kn(`onBeforeInput`,`beforeinput`,null,n,i),s.push({event:y,listeners:x}),y.data=b)),pd(s,e,r,n,i)}vd(s,t)})}function wd(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Td(e,t){for(var n=t+`Capture`,r=[];e!==null;){var i=e,a=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||a===null||(i=an(e,n),i!=null&&r.unshift(wd(e,i,a)),i=an(e,t),i!=null&&r.push(wd(e,i,a))),e.tag===3)return r;e=e.return}return[]}function Ed(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Dd(e,t,n,r,i){for(var a=t._reactName,o=[];n!==null&&n!==r;){var s=n,c=s.alternate,l=s.stateNode;if(s=s.tag,c!==null&&c===r)break;s!==5&&s!==26&&s!==27||l===null||(c=l,i?(l=an(n,a),l!=null&&o.unshift(wd(n,l,c))):i||(l=an(n,a),l!=null&&o.push(wd(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var Od=/\r\n?/g,kd=/\u0000|\uFFFD/g;function Ad(e){return(typeof e==`string`?e:``+e).replace(Od,`
|
|
9
|
+
`).replace(kd,``)}function jd(e,t){return t=Ad(t),Ad(e)===t}function Md(e,t,n,r,a,o){switch(n){case`children`:typeof r==`string`?t===`body`||t===`textarea`&&r===``||Ut(e,r):(typeof r==`number`||typeof r==`bigint`)&&t!==`body`&&Ut(e,``+r);break;case`className`:Dt(e,`class`,r);break;case`tabIndex`:Dt(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:Dt(e,n,r);break;case`style`:Kt(e,r,o);break;case`data`:if(t!==`object`){Dt(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)){e.removeAttribute(n);break}if(r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=Xt(``+r),e.setAttribute(n,r);break;case`action`:case`formAction`:if(typeof r==`function`){e.setAttribute(n,`javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')`);break}else typeof o==`function`&&(n===`formAction`?(t!==`input`&&Md(e,t,`name`,a.name,a,null),Md(e,t,`formEncType`,a.formEncType,a,null),Md(e,t,`formMethod`,a.formMethod,a,null),Md(e,t,`formTarget`,a.formTarget,a,null)):(Md(e,t,`encType`,a.encType,a,null),Md(e,t,`method`,a.method,a,null),Md(e,t,`target`,a.target,a,null)));if(r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=Xt(``+r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=Zt);break;case`onScroll`:r!=null&&$(`scroll`,e);break;case`onScrollEnd`:r!=null&&$(`scrollend`,e);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));e.innerHTML=n}}break;case`multiple`:e.multiple=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`muted`:e.muted=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`ref`:break;case`autoFocus`:break;case`xlinkHref`:if(r==null||typeof r==`function`||typeof r==`boolean`||typeof r==`symbol`){e.removeAttribute(`xlink:href`);break}n=Xt(``+r),e.setAttributeNS(`http://www.w3.org/1999/xlink`,`xlink:href`,n);break;case`contentEditable`:case`spellCheck`:case`draggable`:case`value`:case`autoReverse`:case`externalResourcesRequired`:case`focusable`:case`preserveAlpha`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``+r):e.removeAttribute(n);break;case`inert`:case`allowFullScreen`:case`async`:case`autoPlay`:case`controls`:case`default`:case`defer`:case`disabled`:case`disablePictureInPicture`:case`disableRemotePlayback`:case`formNoValidate`:case`hidden`:case`loop`:case`noModule`:case`noValidate`:case`open`:case`playsInline`:case`readOnly`:case`required`:case`reversed`:case`scoped`:case`seamless`:case`itemScope`:r&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``):e.removeAttribute(n);break;case`capture`:case`download`:!0===r?e.setAttribute(n,``):!1!==r&&r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`cols`:case`rows`:case`size`:case`span`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case`rowSpan`:case`start`:r==null||typeof r==`function`||typeof r==`symbol`||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case`popover`:$(`beforetoggle`,e),$(`toggle`,e),Et(e,`popover`,r);break;case`xlinkActuate`:Ot(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:Ot(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:Ot(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:Ot(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:Ot(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:Ot(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:Ot(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:Ot(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:Ot(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:Et(e,`is`,r);break;case`innerText`:case`textContent`:break;default:(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)&&(n=Jt.get(n)||n,Et(e,n,r))}}function Nd(e,t,n,r,a,o){switch(n){case`style`:Kt(e,r,o);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));e.innerHTML=n}}break;case`children`:typeof r==`string`?Ut(e,r):(typeof r==`number`||typeof r==`bigint`)&&Ut(e,``+r);break;case`onScroll`:r!=null&&$(`scroll`,e);break;case`onScrollEnd`:r!=null&&$(`scrollend`,e);break;case`onClick`:r!=null&&(e.onclick=Zt);break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:break;case`innerText`:case`textContent`:break;default:if(!yt.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(a=n.endsWith(`Capture`),t=n.slice(2,a?n.length-7:void 0),o=e[at]||null,o=o==null?null:o[n],typeof o==`function`&&e.removeEventListener(t,o,a),typeof r==`function`)){typeof o!=`function`&&o!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,r,a);break a}n in e?e[n]=r:!0===r?e.setAttribute(n,``):Et(e,n,r)}}}function Pd(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:$(`error`,e),$(`load`,e);var r=!1,a=!1,o;for(o in n)if(n.hasOwnProperty(o)){var s=n[o];if(s!=null)switch(o){case`src`:r=!0;break;case`srcSet`:a=!0;break;case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:Md(e,t,o,s,n,null)}}a&&Md(e,t,`srcSet`,n.srcSet,n,null),r&&Md(e,t,`src`,n.src,n,null);return;case`input`:$(`invalid`,e);var c=o=s=a=null,l=null,u=null;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case`name`:a=d;break;case`type`:s=d;break;case`checked`:l=d;break;case`defaultChecked`:u=d;break;case`value`:o=d;break;case`defaultValue`:c=d;break;case`children`:case`dangerouslySetInnerHTML`:if(d!=null)throw Error(i(137,t));break;default:Md(e,t,r,d,n,null)}}Rt(e,o,c,l,u,s,a,!1);return;case`select`:for(a in $(`invalid`,e),r=s=o=null,n)if(n.hasOwnProperty(a)&&(c=n[a],c!=null))switch(a){case`value`:o=c;break;case`defaultValue`:s=c;break;case`multiple`:r=c;default:Md(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&Bt(e,!!r,n,!0):Bt(e,!!r,t,!1);return;case`textarea`:for(s in $(`invalid`,e),o=a=r=null,n)if(n.hasOwnProperty(s)&&(c=n[s],c!=null))switch(s){case`value`:r=c;break;case`defaultValue`:a=c;break;case`children`:o=c;break;case`dangerouslySetInnerHTML`:if(c!=null)throw Error(i(91));break;default:Md(e,t,s,c,n,null)}Ht(e,r,a,o);return;case`option`:for(l in n)if(n.hasOwnProperty(l)&&(r=n[l],r!=null))switch(l){case`selected`:e.selected=r&&typeof r!=`function`&&typeof r!=`symbol`;break;default:Md(e,t,l,r,n,null)}return;case`dialog`:$(`beforetoggle`,e),$(`toggle`,e),$(`cancel`,e),$(`close`,e);break;case`iframe`:case`object`:$(`load`,e);break;case`video`:case`audio`:for(r=0;r<gd.length;r++)$(gd[r],e);break;case`image`:$(`error`,e),$(`load`,e);break;case`details`:$(`toggle`,e);break;case`embed`:case`source`:case`link`:$(`error`,e),$(`load`,e);case`area`:case`base`:case`br`:case`col`:case`hr`:case`keygen`:case`meta`:case`param`:case`track`:case`wbr`:case`menuitem`:for(u in n)if(n.hasOwnProperty(u)&&(r=n[u],r!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:Md(e,t,u,r,n,null)}return;default:if(qt(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&Nd(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&Md(e,t,c,r,n,null))}function Fd(e,t,n,r){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`input`:var a=null,o=null,s=null,c=null,l=null,u=null,d=null;for(m in n){var f=n[m];if(n.hasOwnProperty(m)&&f!=null)switch(m){case`checked`:break;case`value`:break;case`defaultValue`:l=f;default:r.hasOwnProperty(m)||Md(e,t,m,null,r,f)}}for(var p in r){var m=r[p];if(f=n[p],r.hasOwnProperty(p)&&(m!=null||f!=null))switch(p){case`type`:o=m;break;case`name`:a=m;break;case`checked`:u=m;break;case`defaultChecked`:d=m;break;case`value`:s=m;break;case`defaultValue`:c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(i(137,t));break;default:m!==f&&Md(e,t,p,m,r,f)}}Lt(e,s,c,l,u,d,o,a);return;case`select`:for(o in m=s=c=p=null,n)if(l=n[o],n.hasOwnProperty(o)&&l!=null)switch(o){case`value`:break;case`multiple`:m=l;default:r.hasOwnProperty(o)||Md(e,t,o,null,r,l)}for(a in r)if(o=r[a],l=n[a],r.hasOwnProperty(a)&&(o!=null||l!=null))switch(a){case`value`:p=o;break;case`defaultValue`:c=o;break;case`multiple`:s=o;default:o!==l&&Md(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?Bt(e,!!n,n?[]:``,!1):Bt(e,!!n,t,!0)):Bt(e,!!n,p,!1);return;case`textarea`:for(c in m=p=null,n)if(a=n[c],n.hasOwnProperty(c)&&a!=null&&!r.hasOwnProperty(c))switch(c){case`value`:break;case`children`:break;default:Md(e,t,c,null,r,a)}for(s in r)if(a=r[s],o=n[s],r.hasOwnProperty(s)&&(a!=null||o!=null))switch(s){case`value`:p=a;break;case`defaultValue`:m=a;break;case`children`:break;case`dangerouslySetInnerHTML`:if(a!=null)throw Error(i(91));break;default:a!==o&&Md(e,t,s,a,r,o)}Vt(e,p,m);return;case`option`:for(var h in n)if(p=n[h],n.hasOwnProperty(h)&&p!=null&&!r.hasOwnProperty(h))switch(h){case`selected`:e.selected=!1;break;default:Md(e,t,h,null,r,p)}for(l in r)if(p=r[l],m=n[l],r.hasOwnProperty(l)&&p!==m&&(p!=null||m!=null))switch(l){case`selected`:e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:Md(e,t,l,p,r,m)}return;case`img`:case`link`:case`area`:case`base`:case`br`:case`col`:case`embed`:case`hr`:case`keygen`:case`meta`:case`param`:case`source`:case`track`:case`wbr`:case`menuitem`:for(var g in n)p=n[g],n.hasOwnProperty(g)&&p!=null&&!r.hasOwnProperty(g)&&Md(e,t,g,null,r,p);for(u in r)if(p=r[u],m=n[u],r.hasOwnProperty(u)&&p!==m&&(p!=null||m!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:if(p!=null)throw Error(i(137,t));break;default:Md(e,t,u,p,r,m)}return;default:if(qt(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&Nd(e,t,_,void 0,r,p);for(d in r)p=r[d],m=n[d],!r.hasOwnProperty(d)||p===m||p===void 0&&m===void 0||Nd(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&Md(e,t,v,null,r,p);for(f in r)p=r[f],m=n[f],!r.hasOwnProperty(f)||p===m||p==null&&m==null||Md(e,t,f,p,r,m)}function Id(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function Ld(){if(typeof performance.getEntriesByType==`function`){for(var e=0,t=0,n=performance.getEntriesByType(`resource`),r=0;r<n.length;r++){var i=n[r],a=i.transferSize,o=i.initiatorType,s=i.duration;if(a&&s&&Id(o)){for(o=0,s=i.responseEnd,r+=1;r<n.length;r++){var c=n[r],l=c.startTime;if(l>s)break;var u=c.transferSize,d=c.initiatorType;u&&Id(d)&&(c=c.responseEnd,o+=u*(c<s?1:(s-l)/(c-l)))}if(--r,t+=8*(a+o)/(i.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e==`number`)?e:5}var Rd=null,zd=null;function Bd(e){return e.nodeType===9?e:e.ownerDocument}function Vd(e){switch(e){case`http://www.w3.org/2000/svg`:return 1;case`http://www.w3.org/1998/Math/MathML`:return 2;default:return 0}}function Hd(e,t){if(e===0)switch(t){case`svg`:return 1;case`math`:return 2;default:return 0}return e===1&&t===`foreignObject`?0:e}function Ud(e,t){return e===`textarea`||e===`noscript`||typeof t.children==`string`||typeof t.children==`number`||typeof t.children==`bigint`||typeof t.dangerouslySetInnerHTML==`object`&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Wd=null;function Gd(){var e=window.event;return e&&e.type===`popstate`?e===Wd?!1:(Wd=e,!0):(Wd=null,!1)}var Kd=typeof setTimeout==`function`?setTimeout:void 0,qd=typeof clearTimeout==`function`?clearTimeout:void 0,Jd=typeof Promise==`function`?Promise:void 0,Yd=typeof queueMicrotask==`function`?queueMicrotask:Jd===void 0?Kd:function(e){return Jd.resolve(null).then(e).catch(Xd)};function Xd(e){setTimeout(function(){throw e})}function Zd(e){return e===`head`}function Qd(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8)if(n=i.data,n===`/$`||n===`/&`){if(r===0){e.removeChild(i),Np(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)pf(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,pf(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[dt]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&pf(e.ownerDocument.body);n=i}while(n);Np(t)}function $d(e,t){var n=e;e=0;do{var r=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display=`none`):(n.style.display=n._stashedDisplay||``,n.getAttribute(`style`)===``&&n.removeAttribute(`style`)):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=``):n.nodeValue=n._stashedText||``),r&&r.nodeType===8)if(n=r.data,n===`/$`){if(e===0)break;e--}else n!==`$`&&n!==`$?`&&n!==`$~`&&n!==`$!`||e++;n=r}while(n)}function ef(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case`HTML`:case`HEAD`:case`BODY`:ef(n),ft(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function tf(e,t,n,r){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!==`INPUT`||e.type!==`hidden`))break}else if(!r)if(t===`input`&&e.type===`hidden`){var a=i.name==null?null:``+i.name;if(i.type===`hidden`&&e.getAttribute(`name`)===a)return e}else return e;else if(!e[dt])switch(t){case`meta`:if(!e.hasAttribute(`itemprop`))break;return e;case`link`:if(a=e.getAttribute(`rel`),a===`stylesheet`&&e.hasAttribute(`data-precedence`)||a!==i.rel||e.getAttribute(`href`)!==(i.href==null||i.href===``?null:i.href)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute(`title`)!==(i.title==null?null:i.title))break;return e;case`style`:if(e.hasAttribute(`data-precedence`))break;return e;case`script`:if(a=e.getAttribute(`src`),(a!==(i.src==null?null:i.src)||e.getAttribute(`type`)!==(i.type==null?null:i.type)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin))&&a&&e.hasAttribute(`async`)&&!e.hasAttribute(`itemprop`))break;return e;default:return e}if(e=cf(e.nextSibling),e===null)break}return null}function nf(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=cf(e.nextSibling),e===null))return null;return e}function rf(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=cf(e.nextSibling),e===null))return null;return e}function af(e){return e.data===`$?`||e.data===`$~`}function of(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function sf(e,t){var n=e.ownerDocument;if(e.data===`$~`)e._reactRetry=t;else if(e.data!==`$?`||n.readyState!==`loading`)t();else{var r=function(){t(),n.removeEventListener(`DOMContentLoaded`,r)};n.addEventListener(`DOMContentLoaded`,r),e._reactRetry=r}}function cf(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t===`$`||t===`$!`||t===`$?`||t===`$~`||t===`&`||t===`F!`||t===`F`)break;if(t===`/$`||t===`/&`)return null}}return e}var lf=null;function uf(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return cf(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function df(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`$`||n===`$!`||n===`$?`||n===`$~`||n===`&`){if(t===0)return e;t--}else n!==`/$`&&n!==`/&`||t++}e=e.previousSibling}return null}function ff(e,t,n){switch(t=Bd(n),e){case`html`:if(e=t.documentElement,!e)throw Error(i(452));return e;case`head`:if(e=t.head,!e)throw Error(i(453));return e;case`body`:if(e=t.body,!e)throw Error(i(454));return e;default:throw Error(i(451))}}function pf(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);ft(e)}var mf=new Map,hf=new Set;function gf(e){return typeof e.getRootNode==`function`?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var _f=F.d;F.d={f:vf,r:yf,D:Sf,C:Cf,L:wf,m:Tf,X:Df,S:Ef,M:Of};function vf(){var e=_f.f(),t=vu();return e||t}function yf(e){var t=mt(e);t!==null&&t.tag===5&&t.type===`form`?Ss(t):_f.r(e)}var bf=typeof document>`u`?null:document;function xf(e,t,n){var r=bf;if(r&&typeof t==`string`&&t){var i=It(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),hf.has(i)||(hf.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),Pd(t,`link`,e),_t(t),r.head.appendChild(t)))}}function Sf(e){_f.D(e),xf(`dns-prefetch`,e,null)}function Cf(e,t){_f.C(e,t),xf(`preconnect`,e,t)}function wf(e,t,n){_f.L(e,t,n);var r=bf;if(r&&e&&t){var i=`link[rel="preload"][as="`+It(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+It(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+It(n.imageSizes)+`"]`)):i+=`[href="`+It(e)+`"]`;var a=i;switch(t){case`style`:a=Af(e);break;case`script`:a=Pf(e)}mf.has(a)||(e=h({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),mf.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(jf(a))||t===`script`&&r.querySelector(Ff(a))||(t=r.createElement(`link`),Pd(t,`link`,e),_t(t),r.head.appendChild(t)))}}function Tf(e,t){_f.m(e,t);var n=bf;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+It(r)+`"][href="`+It(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Pf(e)}if(!mf.has(a)&&(e=h({rel:`modulepreload`,href:e},t),mf.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Ff(a)))return}r=n.createElement(`link`),Pd(r,`link`,e),_t(r),n.head.appendChild(r)}}}function Ef(e,t,n){_f.S(e,t,n);var r=bf;if(r&&e){var i=gt(r).hoistableStyles,a=Af(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(jf(a)))s.loading=5;else{e=h({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=mf.get(a))&&Rf(e,n);var c=o=r.createElement(`link`);_t(c),Pd(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,Lf(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Df(e,t){_f.X(e,t);var n=bf;if(n&&e){var r=gt(n).hoistableScripts,i=Pf(e),a=r.get(i);a||(a=n.querySelector(Ff(i)),a||(e=h({src:e,async:!0},t),(t=mf.get(i))&&zf(e,t),a=n.createElement(`script`),_t(a),Pd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Of(e,t){_f.M(e,t);var n=bf;if(n&&e){var r=gt(n).hoistableScripts,i=Pf(e),a=r.get(i);a||(a=n.querySelector(Ff(i)),a||(e=h({src:e,async:!0,type:`module`},t),(t=mf.get(i))&&zf(e,t),a=n.createElement(`script`),_t(a),Pd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function kf(e,t,n,r){var a=(a=ce.current)?gf(a):null;if(!a)throw Error(i(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(t=Af(n.href),n=gt(a).hoistableStyles,r=n.get(t),r||(r={type:`style`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=Af(n.href);var o=gt(a).hoistableStyles,s=o.get(e);if(s||(a=a.ownerDocument||a,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=a.querySelector(jf(e)))&&!o._p&&(s.instance=o,s.state.loading=5),mf.has(e)||(n={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},mf.set(e,n),o||Nf(a,e,n,s.state))),t&&r===null)throw Error(i(528,``));return s}if(t&&r!==null)throw Error(i(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(t=Pf(n),n=gt(a).hoistableScripts,r=n.get(t),r||(r={type:`script`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(i(444,e))}}function Af(e){return`href="`+It(e)+`"`}function jf(e){return`link[rel="stylesheet"][`+e+`]`}function Mf(e){return h({},e,{"data-precedence":e.precedence,precedence:null})}function Nf(e,t,n,r){e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)?r.loading=1:(t=e.createElement(`link`),r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2}),Pd(t,`link`,n),_t(t),e.head.appendChild(t))}function Pf(e){return`[src="`+It(e)+`"]`}function Ff(e){return`script[async]`+e}function If(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+It(n.href)+`"]`);if(r)return t.instance=r,_t(r),r;var a=h({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),_t(r),Pd(r,`style`,a),Lf(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Af(n.href);var o=e.querySelector(jf(a));if(o)return t.state.loading|=4,t.instance=o,_t(o),o;r=Mf(n),(a=mf.get(a))&&Rf(r,a),o=(e.ownerDocument||e).createElement(`link`),_t(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),Pd(o,`link`,r),t.state.loading|=4,Lf(o,n.precedence,e),t.instance=o;case`script`:return o=Pf(n.src),(a=e.querySelector(Ff(o)))?(t.instance=a,_t(a),a):(r=n,(a=mf.get(o))&&(r=h({},n),zf(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),_t(a),Pd(a,`link`,r),e.head.appendChild(a),t.instance=a);case`void`:return null;default:throw Error(i(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Lf(r,n.precedence,e));return t.instance}function Lf(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o<r.length;o++){var s=r[o];if(s.dataset.precedence===t)a=s;else if(a!==i)break}a?a.parentNode.insertBefore(e,a.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function Rf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function zf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Bf=null;function Vf(e,t,n){if(Bf===null){var r=new Map,i=Bf=new Map;i.set(n,r)}else i=Bf,r=i.get(n),r||(r=new Map,i.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var a=n[i];if(!(a[dt]||a[it]||e===`link`&&a.getAttribute(`rel`)===`stylesheet`)&&a.namespaceURI!==`http://www.w3.org/2000/svg`){var o=a.getAttribute(t)||``;o=e+o;var s=r.get(o);s?s.push(a):r.set(o,[a])}}return r}function Hf(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function Uf(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case`meta`:case`title`:return!0;case`style`:if(typeof t.precedence!=`string`||typeof t.href!=`string`||t.href===``)break;return!0;case`link`:if(typeof t.rel!=`string`||typeof t.href!=`string`||t.href===``||t.onLoad||t.onError)break;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!0}case`script`:if(t.async&&typeof t.async!=`function`&&typeof t.async!=`symbol`&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==`string`)return!0}return!1}function Wf(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function Gf(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=Af(r.href),a=t.querySelector(jf(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=Jf.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,_t(a);return}a=t.ownerDocument||t,r=Mf(r),(i=mf.get(i))&&Rf(r,i),a=a.createElement(`link`),_t(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),Pd(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=Jf.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var Kf=0;function qf(e,t){return e.stylesheets&&e.count===0&&Xf(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&Xf(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&Kf===0&&(Kf=62500*Ld());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Xf(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>Kf?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function Jf(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Xf(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Yf=null;function Xf(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Yf=new Map,t.forEach(Zf,e),Yf=null,Jf.call(e))}function Zf(e,t){if(!(t.state.loading&4)){var n=Yf.get(e);if(n)var r=n.get(null);else{n=new Map,Yf.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a<i.length;a++){var o=i[a];(o.nodeName===`LINK`||o.getAttribute(`media`)!==`not all`)&&(n.set(o.dataset.precedence,o),r=o)}r&&n.set(null,r)}i=t.instance,o=i.getAttribute(`data-precedence`),a=n.get(o)||r,a===r&&n.set(null,i),n.set(o,i),this.count++,r=Jf.bind(this),i.addEventListener(`load`,r),i.addEventListener(`error`,r),a?a.parentNode.insertBefore(i,a.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var Qf={$$typeof:C,Provider:null,Consumer:null,_currentValue:ne,_currentValue2:ne,_threadCount:0};function $f(e,t,n,r,i,a,o,s,c){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Je(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Je(0),this.hiddenUpdates=Je(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.incompleteTransitions=new Map}function ep(e,t,n,r,i,a,o,s,c,l,u,d){return e=new $f(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=ri(3,null,null,t),e.current=a,a.stateNode=e,t=ra(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},Ia(a),e}function tp(e){return e?(e=ti,e):ti}function np(e,t,n,r,i,a){i=tp(i),r.context===null?r.context=i:r.pendingContext=i,r=Ra(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=za(e,r,t),n!==null&&(pu(n,e,t),Ba(n,e,t))}function rp(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function ip(e,t){rp(e,t),(e=e.alternate)&&rp(e,t)}function ap(e){if(e.tag===13||e.tag===31){var t=Qr(e,67108864);t!==null&&pu(t,e,67108864),ip(e,67108864)}}function op(e){if(e.tag===13||e.tag===31){var t=du();t=$e(t);var n=Qr(e,t);n!==null&&pu(n,e,t),ip(e,t)}}var sp=!0;function cp(e,t,n,r){var i=P.T;P.T=null;var a=F.p;try{F.p=2,up(e,t,n,r)}finally{F.p=a,P.T=i}}function lp(e,t,n,r){var i=P.T;P.T=null;var a=F.p;try{F.p=8,up(e,t,n,r)}finally{F.p=a,P.T=i}}function up(e,t,n,r){if(sp){var i=dp(r);if(i===null)Cd(e,t,r,fp,n),Cp(e,r);else if(Tp(i,e,t,n,r))r.stopPropagation();else if(Cp(e,r),t&4&&-1<Sp.indexOf(e)){for(;i!==null;){var a=mt(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=Ue(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-z(o);s.entanglements[1]|=c,o&=~c}nd(a),!(Fl&6)&&($l=Ee()+500,rd(0,!1))}}break;case 31:case 13:s=Qr(a,2),s!==null&&pu(s,a,2),vu(),ip(a,2)}if(a=dp(r),a===null&&Cd(e,t,r,fp,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else Cd(e,t,r,null,n)}}function dp(e){return e=$t(e),pp(e)}var fp=null;function pp(e){if(fp=null,e=pt(e),e!==null){var t=o(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=s(t),e!==null)return e;e=null}else if(n===31){if(e=c(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 fp=e,null}function mp(e){switch(e){case`beforetoggle`:case`cancel`:case`click`:case`close`:case`contextmenu`:case`copy`:case`cut`:case`auxclick`:case`dblclick`:case`dragend`:case`dragstart`:case`drop`:case`focusin`:case`focusout`:case`input`:case`invalid`:case`keydown`:case`keypress`:case`keyup`:case`mousedown`:case`mouseup`:case`paste`:case`pause`:case`play`:case`pointercancel`:case`pointerdown`:case`pointerup`:case`ratechange`:case`reset`:case`resize`:case`seeked`:case`submit`:case`toggle`:case`touchcancel`:case`touchend`:case`touchstart`:case`volumechange`:case`change`:case`selectionchange`:case`textInput`:case`compositionstart`:case`compositionend`:case`compositionupdate`:case`beforeblur`:case`afterblur`:case`beforeinput`:case`blur`:case`fullscreenchange`:case`focus`:case`hashchange`:case`popstate`:case`select`:case`selectstart`:return 2;case`drag`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`mousemove`:case`mouseout`:case`mouseover`:case`pointermove`:case`pointerout`:case`pointerover`:case`scroll`:case`touchmove`:case`wheel`:case`mouseenter`:case`mouseleave`:case`pointerenter`:case`pointerleave`:return 8;case`message`:switch(De()){case Oe:return 2;case ke:return 8;case Ae:case je:return 32;case Me:return 268435456;default:return 32}default:return 32}}var hp=!1,gp=null,_p=null,vp=null,yp=new Map,bp=new Map,xp=[],Sp=`mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset`.split(` `);function Cp(e,t){switch(e){case`focusin`:case`focusout`:gp=null;break;case`dragenter`:case`dragleave`:_p=null;break;case`mouseover`:case`mouseout`:vp=null;break;case`pointerover`:case`pointerout`:yp.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:bp.delete(t.pointerId)}}function wp(e,t,n,r,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},t!==null&&(t=mt(t),t!==null&&ap(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Tp(e,t,n,r,i){switch(t){case`focusin`:return gp=wp(gp,e,t,n,r,i),!0;case`dragenter`:return _p=wp(_p,e,t,n,r,i),!0;case`mouseover`:return vp=wp(vp,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return yp.set(a,wp(yp.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,bp.set(a,wp(bp.get(a)||null,e,t,n,r,i)),!0}return!1}function Ep(e){var t=pt(e.target);if(t!==null){var n=o(t);if(n!==null){if(t=n.tag,t===13){if(t=s(n),t!==null){e.blockedOn=t,nt(e.priority,function(){op(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,nt(e.priority,function(){op(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 Dp(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=dp(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Qt=r,n.target.dispatchEvent(r),Qt=null}else return t=mt(n),t!==null&&ap(t),e.blockedOn=n,!1;t.shift()}return!0}function Op(e,t,n){Dp(e)&&n.delete(t)}function kp(){hp=!1,gp!==null&&Dp(gp)&&(gp=null),_p!==null&&Dp(_p)&&(_p=null),vp!==null&&Dp(vp)&&(vp=null),yp.forEach(Op),bp.forEach(Op)}function Ap(e,n){e.blockedOn===n&&(e.blockedOn=null,hp||(hp=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,kp)))}var jp=null;function Mp(e){jp!==e&&(jp=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){jp===e&&(jp=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],i=e[t+2];if(typeof r!=`function`){if(pp(r||n)===null)continue;break}var a=mt(n);a!==null&&(e.splice(t,3),t-=3,bs(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Np(e){function t(t){return Ap(t,e)}gp!==null&&Ap(gp,e),_p!==null&&Ap(_p,e),vp!==null&&Ap(vp,e),yp.forEach(t),bp.forEach(t);for(var n=0;n<xp.length;n++){var r=xp[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<xp.length&&(n=xp[0],n.blockedOn===null);)Ep(n),n.blockedOn===null&&xp.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var i=n[r],a=n[r+1],o=i[at]||null;if(typeof a==`function`)o||Mp(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[at]||null)s=o.formAction;else if(pp(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Mp(n)}}}function Pp(){function e(e){e.canIntercept&&e.info===`react-transition`&&e.intercept({handler:function(){return new Promise(function(e){return i=e})},focusReset:`manual`,scroll:`manual`})}function t(){i!==null&&(i(),i=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var e=navigation.currentEntry;e&&e.url!=null&&navigation.navigate(e.url,{state:e.getState(),info:`react-transition`,history:`replace`})}}if(typeof navigation==`object`){var r=!1,i=null;return navigation.addEventListener(`navigate`,e),navigation.addEventListener(`navigatesuccess`,t),navigation.addEventListener(`navigateerror`,t),setTimeout(n,100),function(){r=!0,navigation.removeEventListener(`navigate`,e),navigation.removeEventListener(`navigatesuccess`,t),navigation.removeEventListener(`navigateerror`,t),i!==null&&(i(),i=null)}}}function Fp(e){this._internalRoot=e}Ip.prototype.render=Fp.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;np(n,du(),e,t,null,null)},Ip.prototype.unmount=Fp.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;np(e.current,2,null,e,null,null),vu(),t[ot]=null}};function Ip(e){this._internalRoot=e}Ip.prototype.unstable_scheduleHydration=function(e){if(e){var t=tt();e={blockedOn:null,target:e,priority:t};for(var n=0;n<xp.length&&t!==0&&t<xp[n].priority;n++);xp.splice(n,0,e),n===0&&Ep(e)}};var Lp=n.version;if(Lp!==`19.2.5`)throw Error(i(527,Lp,`19.2.5`));F.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(i(188)):(e=Object.keys(e).join(`,`),Error(i(268,e)));return e=d(t),e=e===null?null:p(e),e=e===null?null:e.stateNode,e};var Rp={bundleType:0,version:`19.2.5`,rendererPackageName:`react-dom`,currentDispatcherRef:P,reconcilerVersion:`19.2.5`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var zp=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!zp.isDisabled&&zp.supportsFiber)try{Fe=zp.inject(Rp),Ie=zp}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=Hs,s=Us,c=Ws;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(o=t.onUncaughtError),t.onCaughtError!==void 0&&(s=t.onCaughtError),t.onRecoverableError!==void 0&&(c=t.onRecoverableError)),t=ep(e,1,!1,null,null,n,r,null,o,s,c,Pp),e[ot]=t.current,xd(e),new Fp(t)}})),g=o(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=h()})),_=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},v=new class extends _{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e();return window.addEventListener(`visibilitychange`,t,!1),()=>{window.removeEventListener(`visibilitychange`,t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(e=>{typeof e==`boolean`?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e==`boolean`?this.#e:globalThis.document?.visibilityState!==`hidden`}},y={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},b=new class{#e=y;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}};function x(e){setTimeout(e,0)}var S=typeof window>`u`||`Deno`in globalThis;function C(){}function w(e,t){return typeof e==`function`?e(t):e}function T(e){return typeof e==`number`&&e>=0&&e!==1/0}function E(e,t){return Math.max(e+(t||0)-Date.now(),0)}function D(e,t){return typeof e==`function`?e(t):e}function O(e,t){return typeof e==`function`?e(t):e}function k(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==j(o,t.options))return!1}else if(!ee(t.queryKey,o))return!1}if(n!==`all`){let e=t.isActive();if(n===`active`&&!e||n===`inactive`&&e)return!1}return!(typeof s==`boolean`&&t.isStale()!==s||i&&i!==t.state.fetchStatus||a&&!a(t))}function A(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(M(t.options.mutationKey)!==M(a))return!1}else if(!ee(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function j(e,t){return(t?.queryKeyHashFn||M)(e)}function M(e){return JSON.stringify(e,(e,t)=>ne(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function ee(e,t){return e===t?!0:typeof e==typeof t&&e&&t&&typeof e==`object`&&typeof t==`object`?Object.keys(t).every(n=>ee(e[n],t[n])):!1}var N=Object.prototype.hasOwnProperty;function te(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=F(e)&&F(t);if(!r&&!(ne(e)&&ne(t)))return t;let i=(r?e:Object.keys(e)).length,a=r?t:Object.keys(t),o=a.length,s=r?Array(o):{},c=0;for(let l=0;l<o;l++){let o=r?l:a[l],u=e[o],d=t[o];if(u===d){s[o]=u,(r?l<i:N.call(e,o))&&c++;continue}if(u===null||d===null||typeof u!=`object`||typeof d!=`object`){s[o]=d;continue}let f=te(u,d,n+1);s[o]=f,f===u&&c++}return i===o&&c===i?e:s}function P(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(e[n]!==t[n])return!1;return!0}function F(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function ne(e){if(!re(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!re(n)||!n.hasOwnProperty(`isPrototypeOf`)||Object.getPrototypeOf(e)!==Object.prototype)}function re(e){return Object.prototype.toString.call(e)===`[object Object]`}function ie(e){return new Promise(t=>{b.setTimeout(t,e)})}function ae(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:te(e,t)}function I(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function L(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var oe=Symbol();function se(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===oe?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function ce(e,t){return typeof e==`function`?e(...t):!!e}function le(e,t,n){let r=!1,i;return Object.defineProperty(e,`signal`,{enumerable:!0,get:()=>(i??=t(),r?i:(r=!0,i.aborted?n():i.addEventListener(`abort`,n,{once:!0}),i))}),e}var ue=(()=>{let e=()=>S;return{isServer(){return e()},setIsServer(t){e=t}}})();function de(){let e,t,n=new Promise((n,r)=>{e=n,t=r});n.status=`pending`,n.catch(()=>{});function r(e){Object.assign(n,e),delete n.resolve,delete n.reject}return n.resolve=t=>{r({status:`fulfilled`,value:t}),e(t)},n.reject=e=>{r({status:`rejected`,reason:e}),t(e)},n}var fe=x;function pe(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=fe,a=r=>{t?e.push(r):i(()=>{n(r)})},o=()=>{let t=e;e=[],t.length&&i(()=>{r(()=>{t.forEach(e=>{n(e)})})})};return{batch:e=>{let n;t++;try{n=e()}finally{t--,t||o()}return n},batchCalls:e=>(...t)=>{a(()=>{e(...t)})},schedule:a,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{i=e}}}var me=pe(),he=new class extends _{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e(!0),n=()=>e(!1);return window.addEventListener(`online`,t,!1),window.addEventListener(`offline`,n,!1),()=>{window.removeEventListener(`online`,t),window.removeEventListener(`offline`,n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#e}};function ge(e){return Math.min(1e3*2**e,3e4)}function _e(e){return(e??`online`)===`online`?he.isOnline():!0}var ve=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function ye(e){let t=!1,n=0,r,i=de(),a=()=>i.status!==`pending`,o=t=>{if(!a()){let n=new ve(t);f(n),e.onCancel?.(n)}},s=()=>{t=!0},c=()=>{t=!1},l=()=>v.isFocused()&&(e.networkMode===`always`||he.isOnline())&&e.canRun(),u=()=>_e(e.networkMode)&&e.canRun(),d=e=>{a()||(r?.(),i.resolve(e))},f=e=>{a()||(r?.(),i.reject(e))},p=()=>new Promise(t=>{r=e=>{(a()||l())&&t(e)},e.onPause?.()}).then(()=>{r=void 0,a()||e.onContinue?.()}),m=()=>{if(a())return;let r,i=n===0?e.initialPromise:void 0;try{r=i??e.fn()}catch(e){r=Promise.reject(e)}Promise.resolve(r).then(d).catch(r=>{if(a())return;let i=e.retry??(ue.isServer()?0:3),o=e.retryDelay??ge,s=typeof o==`function`?o(n,r):o,c=i===!0||typeof i==`number`&&n<i||typeof i==`function`&&i(n,r);if(t||!c){f(r);return}n++,e.onFail?.(n,r),ie(s).then(()=>l()?void 0:p()).then(()=>{t?f(r):m()})})};return{promise:i,status:()=>i.status,cancel:o,continue:()=>(r?.(),i),cancelRetry:s,continueRetry:c,canStart:u,start:()=>(u()?m():p().then(m),i)}}var be=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),T(this.gcTime)&&(this.#e=b.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(ue.isServer()?1/0:300*1e3))}clearGcTimeout(){this.#e!==void 0&&(b.clearTimeout(this.#e),this.#e=void 0)}},xe=class extends be{#e;#t;#n;#r;#i;#a;#o;constructor(e){super(),this.#o=!1,this.#a=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#r=e.client,this.#n=this.#r.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#e=we(this.options),this.state=e.state??this.#e,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#i?.promise}setOptions(e){if(this.options={...this.#a,...e},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let e=we(this.options);e.data!==void 0&&(this.setState(Ce(e.data,e.dataUpdatedAt)),this.#e=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#n.remove(this)}setData(e,t){let n=ae(this.state.data,e,this.options);return this.#c({data:n,type:`success`,dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e,t){this.#c({type:`setState`,state:e,setStateOptions:t})}cancel(e){let t=this.#i?.promise;return this.#i?.cancel(e),t?t.then(C).catch(C):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#e}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>O(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===oe||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>D(e.options.staleTime,this)===`static`):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e===`static`?!1:this.state.isInvalidated?!0:!E(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#i?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#i?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#i&&(this.#o||this.#s()?this.#i.cancel({revert:!0}):this.#i.cancelRetry()),this.scheduleGc()),this.#n.notify({type:`observerRemoved`,query:this,observer:e}))}getObserversCount(){return this.observers.length}#s(){return this.state.fetchStatus===`paused`&&this.state.status===`pending`}invalidate(){this.state.isInvalidated||this.#c({type:`invalidate`})}async fetch(e,t){if(this.state.fetchStatus!==`idle`&&this.#i?.status()!==`rejected`){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#i)return this.#i.continueRetry(),this.#i.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let n=new AbortController,r=e=>{Object.defineProperty(e,`signal`,{enumerable:!0,get:()=>(this.#o=!0,n.signal)})},i=()=>{let e=se(this.options,t),n=(()=>{let e={client:this.#r,queryKey:this.queryKey,meta:this.meta};return r(e),e})();return this.#o=!1,this.options.persister?this.options.persister(e,n,this):e(n)},a=(()=>{let e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#r,state:this.state,fetchFn:i};return r(e),e})();this.options.behavior?.onFetch(a,this),this.#t=this.state,(this.state.fetchStatus===`idle`||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#c({type:`fetch`,meta:a.fetchOptions?.meta}),this.#i=ye({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof ve&&e.revert&&this.setState({...this.#t,fetchStatus:`idle`}),n.abort()},onFail:(e,t)=>{this.#c({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#c({type:`pause`})},onContinue:()=>{this.#c({type:`continue`})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{let e=await this.#i.start();if(e===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#n.config.onSuccess?.(e,this),this.#n.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof ve){if(e.silent)return this.#i.promise;if(e.revert){if(this.state.data===void 0)throw e;return this.state.data}}throw this.#c({type:`error`,error:e}),this.#n.config.onError?.(e,this),this.#n.config.onSettled?.(this.state.data,e,this),e}finally{this.scheduleGc()}}#c(e){this.state=(t=>{switch(e.type){case`failed`:return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case`pause`:return{...t,fetchStatus:`paused`};case`continue`:return{...t,fetchStatus:`fetching`};case`fetch`:return{...t,...Se(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...Ce(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:`idle`,fetchFailureCount:0,fetchFailureReason:null}};return this.#t=e.manual?n:void 0,n;case`error`:let r=e.error;return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:`idle`,status:`error`,isInvalidated:!0};case`invalidate`:return{...t,isInvalidated:!0};case`setState`:return{...t,...e.state}}})(this.state),me.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),this.#n.notify({query:this,type:`updated`,action:e})})}};function Se(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:_e(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function Ce(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function we(e){let t=typeof e.initialData==`function`?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt==`function`?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?`success`:`pending`,fetchStatus:`idle`}}function Te(e){return{onFetch:(t,n)=>{let r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[],s={pages:[],pageParams:[]},c=0,l=async()=>{let n=!1,l=e=>{le(e,()=>t.signal,()=>n=!0)},u=se(t.options,t.fetchOptions),d=async(e,r,i)=>{if(n)return Promise.reject();if(r==null&&e.pages.length)return Promise.resolve(e);let a=await u((()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:i?`backward`:`forward`,meta:t.options.meta};return l(e),e})()),{maxPages:o}=t.options,s=i?L:I;return{pages:s(e.pages,a,o),pageParams:s(e.pageParams,r,o)}};if(i&&a.length){let e=i===`backward`,t=e?De:Ee,n={pages:a,pageParams:o};s=await d(n,t(r,n),e)}else{let t=e??a.length;do{let e=c===0?o[0]??r.initialPageParam:Ee(r,s);if(c>0&&e==null)break;s=await d(s,e),c++}while(c<t)}return s};t.options.persister?t.fetchFn=()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=l}}}function Ee(e,{pages:t,pageParams:n}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function De(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var Oe=class extends be{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||ke(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:`observerRemoved`,mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status===`pending`?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??this.execute(this.state.variables)}async execute(e){let t=()=>{this.#i({type:`continue`})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#r=ye({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(Error(`No mutationFn found`)),onFail:(e,t)=>{this.#i({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#i({type:`pause`})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});let r=this.state.status===`pending`,i=!this.#r.canStart();try{if(r)t();else{this.#i({type:`pending`,variables:e,isPaused:i}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);let t=await this.options.onMutate?.(e,n);t!==this.state.context&&this.#i({type:`pending`,context:t,variables:e,isPaused:i})}let a=await this.#r.start();return await this.#n.config.onSuccess?.(a,e,this.state.context,this,n),await this.options.onSuccess?.(a,e,this.state.context,n),await this.#n.config.onSettled?.(a,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(a,null,e,this.state.context,n),this.#i({type:`success`,data:a}),a}catch(t){try{await this.#n.config.onError?.(t,e,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,n)}catch(e){Promise.reject(e)}try{await this.#n.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,n)}catch(e){Promise.reject(e)}throw this.#i({type:`error`,error:t}),t}finally{this.#n.runNext(this)}}#i(e){this.state=(t=>{switch(e.type){case`failed`:return{...t,failureCount:e.failureCount,failureReason:e.error};case`pause`:return{...t,isPaused:!0};case`continue`:return{...t,isPaused:!1};case`pending`:return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:`pending`,variables:e.variables,submittedAt:Date.now()};case`success`:return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:`success`,isPaused:!1};case`error`:return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:`error`}}})(this.state),me.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function ke(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var Ae=class extends _{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,t,n){let r=new Oe({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);let t=je(e);if(typeof t==`string`){let n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:`added`,mutation:e})}remove(e){if(this.#e.delete(e)){let t=je(e);if(typeof t==`string`){let n=this.#t.get(t);if(n)if(n.length>1){let t=n.indexOf(e);t!==-1&&n.splice(t,1)}else n[0]===e&&this.#t.delete(t)}}this.notify({type:`removed`,mutation:e})}canRun(e){let t=je(e);if(typeof t==`string`){let n=this.#t.get(t)?.find(e=>e.state.status===`pending`);return!n||n===e}else return!0}runNext(e){let t=je(e);return typeof t==`string`?(this.#t.get(t)?.find(t=>t!==e&&t.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){me.batch(()=>{this.#e.forEach(e=>{this.notify({type:`removed`,mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>A(t,e))}findAll(e={}){return this.getAll().filter(t=>A(e,t))}notify(e){me.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return me.batch(()=>Promise.all(e.map(e=>e.continue().catch(C))))}};function je(e){return e.options.scope?.id}var Me=class extends _{#e;#t=void 0;#n;#r;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#i()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){let t=this.options;this.options=this.#e.defaultMutationOptions(e),P(this.options,t)||this.#e.getMutationCache().notify({type:`observerOptionsUpdated`,mutation:this.#n,observer:this}),t?.mutationKey&&this.options.mutationKey&&M(t.mutationKey)!==M(this.options.mutationKey)?this.reset():this.#n?.state.status===`pending`&&this.#n.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(e){this.#i(),this.#a(e)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#i(),this.#a()}mutate(e,t){return this.#r=t,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(e)}#i(){let e=this.#n?.state??ke();this.#t={...e,isPending:e.status===`pending`,isSuccess:e.status===`success`,isError:e.status===`error`,isIdle:e.status===`idle`,mutate:this.mutate,reset:this.reset}}#a(e){me.batch(()=>{if(this.#r&&this.hasListeners()){let t=this.#t.variables,n=this.#t.context,r={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(e?.type===`success`){try{this.#r.onSuccess?.(e.data,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(e.data,null,t,n,r)}catch(e){Promise.reject(e)}}else if(e?.type===`error`){try{this.#r.onError?.(e.error,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(void 0,e.error,t,n,r)}catch(e){Promise.reject(e)}}}this.listeners.forEach(e=>{e(this.#t)})})}},Ne=class extends _{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){let r=t.queryKey,i=t.queryHash??j(r,t),a=this.get(i);return a||(a=new xe({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(a)),a}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:`added`,query:e}))}remove(e){let t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:`removed`,query:e}))}clear(){me.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>k(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>k(e,t)):t}notify(e){me.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){me.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){me.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},Pe=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new Ne,this.#t=e.mutationCache||new Ae,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=v.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=he.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#o?.(),this.#o=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:`fetching`}).length}isMutating(e){return this.#t.findAll({...e,status:`pending`}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(D(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,n){let r=this.defaultQueryOptions({queryKey:e}),i=this.#e.get(r.queryHash)?.state.data,a=w(t,i);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return me.batch(()=>this.#e.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,n)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){let t=this.#e;me.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#e;return me.batch(()=>(n.findAll(e).forEach(e=>{e.reset()}),this.refetchQueries({type:`active`,...e},t)))}cancelQueries(e,t={}){let n={revert:!0,...t},r=me.batch(()=>this.#e.findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(C).catch(C)}invalidateQueries(e,t={}){return me.batch(()=>(this.#e.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType===`none`?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??`active`},t)))}refetchQueries(e,t={}){let n={...t,cancelRefetch:t.cancelRefetch??!0},r=me.batch(()=>this.#e.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,n);return n.throwOnError||(t=t.catch(C)),e.state.fetchStatus===`paused`?Promise.resolve():t}));return Promise.all(r).then(C)}fetchQuery(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t);return n.isStaleByTime(D(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(C).catch(C)}fetchInfiniteQuery(e){return e.behavior=Te(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(C).catch(C)}ensureInfiniteQueryData(e){return e.behavior=Te(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return he.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#r.set(M(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#r.values()],n={};return t.forEach(t=>{ee(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set(M(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#i.values()],n={};return t.forEach(t=>{ee(e,t.mutationKey)&&Object.assign(n,t.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||=j(t.queryKey,t),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!==`always`),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode=`offlineFirst`),t.queryFn===oe&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},Fe=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),Ie=o(((e,t)=>{t.exports=Fe()})),R=c(u(),1),z=Ie(),Le=R.createContext(void 0),Re=e=>{let t=R.useContext(Le);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},ze=({client:e,children:t})=>(R.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,z.jsx)(Le.Provider,{value:e,children:t}));function Be(e){return e}function Ve(e,t){let n=Re(t),[r]=R.useState(()=>new Me(n,e));R.useEffect(()=>{r.setOptions(e)},[r,e]);let i=R.useSyncExternalStore(R.useCallback(e=>r.subscribe(me.batchCalls(e)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),a=R.useCallback((e,t)=>{r.mutate(e,t).catch(C)},[r]);if(i.error&&ce(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:a,mutateAsync:i.mutate}}var He=`modulepreload`,Ue=function(e){return`/`+e},We={},Ge=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}r=o(t.map(t=>{if(t=Ue(t,n),t in We)return;We[t]=!0;let r=t.endsWith(`.css`),i=r?`[rel="stylesheet"]`:``;if(n)for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}else if(document.querySelector(`link[href="${t}"]${i}`))return;let o=document.createElement(`link`);if(o.rel=r?`stylesheet`:He,r||(o.as=`script`),o.crossOrigin=``,o.href=t,a&&o.setAttribute(`nonce`,a),document.head.appendChild(o),r)return new Promise((e,n)=>{o.addEventListener(`load`,e),o.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},Ke=e=>{throw TypeError(e)},qe=(e,t,n)=>t.has(e)||Ke(`Cannot `+n),Je=(e,t,n)=>(qe(e,t,`read from private field`),n?n.call(e):t.get(e)),Ye=(e,t,n)=>t.has(e)?Ke(`Cannot add the same private member more than once`):t instanceof WeakSet?t.add(e):t.set(e,n),Xe=`popstate`;function Ze(e){return typeof e==`object`&&!!e&&`pathname`in e&&`search`in e&&`hash`in e&&`state`in e&&`key`in e}function Qe(e={}){function t(e,t){let n=t.state?.masked,{pathname:r,search:i,hash:a}=n||e.location;return nt(``,{pathname:r,search:i,hash:a},t.state&&t.state.usr||null,t.state&&t.state.key||`default`,n?{pathname:e.location.pathname,search:e.location.search,hash:e.location.hash}:void 0)}function n(e,t){return typeof t==`string`?t:rt(t)}return at(t,n,null,e)}function B(e,t){if(e===!1||e==null)throw Error(t)}function $e(e,t){if(!e){typeof console<`u`&&console.warn(t);try{throw Error(t)}catch{}}}function et(){return Math.random().toString(36).substring(2,10)}function tt(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.unstable_mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function nt(e,t,n=null,r,i){return{pathname:typeof e==`string`?e:e.pathname,search:``,hash:``,...typeof t==`string`?it(t):t,state:n,key:t&&t.key||r||et(),unstable_mask:i}}function rt({pathname:e=`/`,search:t=``,hash:n=``}){return t&&t!==`?`&&(e+=t.charAt(0)===`?`?t:`?`+t),n&&n!==`#`&&(e+=n.charAt(0)===`#`?n:`#`+n),e}function it(e){let t={};if(e){let n=e.indexOf(`#`);n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf(`?`);r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function at(e,t,n,r={}){let{window:i=document.defaultView,v5Compat:a=!1}=r,o=i.history,s=`POP`,c=null,l=u();l??(l=0,o.replaceState({...o.state,idx:l},``));function u(){return(o.state||{idx:null}).idx}function d(){s=`POP`;let e=u(),t=e==null?null:e-l;l=e,c&&c({action:s,location:h.location,delta:t})}function f(e,t){s=`PUSH`;let r=Ze(e)?e:nt(h.location,e,t);n&&n(r,e),l=u()+1;let d=tt(r,l),f=h.createHref(r.unstable_mask||r);try{o.pushState(d,``,f)}catch(e){if(e instanceof DOMException&&e.name===`DataCloneError`)throw e;i.location.assign(f)}a&&c&&c({action:s,location:h.location,delta:1})}function p(e,t){s=`REPLACE`;let r=Ze(e)?e:nt(h.location,e,t);n&&n(r,e),l=u();let i=tt(r,l),d=h.createHref(r.unstable_mask||r);o.replaceState(i,``,d),a&&c&&c({action:s,location:h.location,delta:0})}function m(e){return ot(e)}let h={get action(){return s},get location(){return e(i,o)},listen(e){if(c)throw Error(`A history only accepts one active listener`);return i.addEventListener(Xe,d),c=e,()=>{i.removeEventListener(Xe,d),c=null}},createHref(e){return t(i,e)},createURL:m,encodeLocation(e){let t=m(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:f,replace:p,go(e){return o.go(e)}};return h}function ot(e,t=!1){let n=`http://localhost`;typeof window<`u`&&(n=window.location.origin===`null`?window.location.href:window.location.origin),B(n,`No window.location.(origin|href) available to create URL`);let r=typeof e==`string`?e:rt(e);return r=r.replace(/ $/,`%20`),!t&&r.startsWith(`//`)&&(r=n+r),new URL(r,n)}var st,ct=class{constructor(e){if(Ye(this,st,new Map),e)for(let[t,n]of e)this.set(t,n)}get(e){if(Je(this,st).has(e))return Je(this,st).get(e);if(e.defaultValue!==void 0)return e.defaultValue;throw Error(`No value found for context`)}set(e,t){Je(this,st).set(e,t)}};st=new WeakMap;var lt=new Set([`lazy`,`caseSensitive`,`path`,`id`,`index`,`children`]);function ut(e){return lt.has(e)}var dt=new Set([`lazy`,`caseSensitive`,`path`,`id`,`index`,`middleware`,`children`]);function ft(e){return dt.has(e)}function pt(e){return e.index===!0}function mt(e,t,n=[],r={},i=!1){return e.map((e,a)=>{let o=[...n,String(a)],s=typeof e.id==`string`?e.id:o.join(`-`);if(B(e.index!==!0||!e.children,`Cannot specify children on an index route`),B(i||!r[s],`Found a route id collision on id "${s}". Route id's must be globally unique within Data Router usages`),pt(e)){let n={...e,id:s};return r[s]=ht(n,t(n)),n}else{let n={...e,id:s,children:void 0};return r[s]=ht(n,t(n)),e.children&&(n.children=mt(e.children,t,o,r,i)),n}})}function ht(e,t){return Object.assign(e,{...t,...typeof t.lazy==`object`&&t.lazy!=null?{lazy:{...e.lazy,...t.lazy}}:{}})}function gt(e,t,n=`/`){return _t(e,t,n,!1)}function _t(e,t,n,r){let i=Ft((typeof t==`string`?it(t):t).pathname||`/`,n);if(i==null)return null;let a=yt(e);xt(a);let o=null;for(let e=0;o==null&&e<a.length;++e){let t=Pt(i);o=jt(a[e],t,r)}return o}function vt(e,t){let{route:n,pathname:r,params:i}=e;return{id:n.id,pathname:r,params:i,data:t[n.id],loaderData:t[n.id],handle:n.handle}}function yt(e,t=[],n=[],r=``,i=!1){let a=(e,a,o=i,s)=>{let c={relativePath:s===void 0?e.path||``:s,caseSensitive:e.caseSensitive===!0,childrenIndex:a,route:e};if(c.relativePath.startsWith(`/`)){if(!c.relativePath.startsWith(r)&&o)return;B(c.relativePath.startsWith(r),`Absolute route path "${c.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),c.relativePath=c.relativePath.slice(r.length)}let l=Kt([r,c.relativePath]),u=n.concat(c);e.children&&e.children.length>0&&(B(e.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${l}".`),yt(e.children,t,u,l,o)),!(e.path==null&&!e.index)&&t.push({path:l,score:kt(l,e.index),routesMeta:u})};return e.forEach((e,t)=>{if(e.path===``||!e.path?.includes(`?`))a(e,t);else for(let n of bt(e.path))a(e,t,!0,n)}),t}function bt(e){let t=e.split(`/`);if(t.length===0)return[];let[n,...r]=t,i=n.endsWith(`?`),a=n.replace(/\?$/,``);if(r.length===0)return i?[a,``]:[a];let o=bt(r.join(`/`)),s=[];return s.push(...o.map(e=>e===``?a:[a,e].join(`/`))),i&&s.push(...o),s.map(t=>e.startsWith(`/`)&&t===``?`/`:t)}function xt(e){e.sort((e,t)=>e.score===t.score?At(e.routesMeta.map(e=>e.childrenIndex),t.routesMeta.map(e=>e.childrenIndex)):t.score-e.score)}var St=/^:[\w-]+$/,Ct=3,wt=2,Tt=1,Et=10,Dt=-2,Ot=e=>e===`*`;function kt(e,t){let n=e.split(`/`),r=n.length;return n.some(Ot)&&(r+=Dt),t&&(r+=wt),n.filter(e=>!Ot(e)).reduce((e,t)=>e+(St.test(t)?Ct:t===``?Tt:Et),r)}function At(e,t){return e.length===t.length&&e.slice(0,-1).every((e,n)=>e===t[n])?e[e.length-1]-t[t.length-1]:0}function jt(e,t,n=!1){let{routesMeta:r}=e,i={},a=`/`,o=[];for(let e=0;e<r.length;++e){let s=r[e],c=e===r.length-1,l=a===`/`?t:t.slice(a.length)||`/`,u=Mt({path:s.relativePath,caseSensitive:s.caseSensitive,end:c},l),d=s.route;if(!u&&c&&n&&!r[r.length-1].route.index&&(u=Mt({path:s.relativePath,caseSensitive:s.caseSensitive,end:!1},l)),!u)return null;Object.assign(i,u.params),o.push({params:i,pathname:Kt([a,u.pathname]),pathnameBase:Jt(Kt([a,u.pathnameBase])),route:d}),u.pathnameBase!==`/`&&(a=Kt([a,u.pathnameBase]))}return o}function Mt(e,t){typeof e==`string`&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=Nt(e.path,e.caseSensitive,e.end),i=t.match(n);if(!i)return null;let a=i[0],o=a.replace(/(.)\/+$/,`$1`),s=i.slice(1);return{params:r.reduce((e,{paramName:t,isOptional:n},r)=>{if(t===`*`){let e=s[r]||``;o=a.slice(0,a.length-e.length).replace(/(.)\/+$/,`$1`)}let i=s[r];return n&&!i?e[t]=void 0:e[t]=(i||``).replace(/%2F/g,`/`),e},{}),pathname:a,pathnameBase:o,pattern:e}}function Nt(e,t=!1,n=!0){$e(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=[],i=`^`+e.replace(/\/*\*?$/,``).replace(/^\/*/,`/`).replace(/[\\.*+^${}|()[\]]/g,`\\$&`).replace(/\/:([\w-]+)(\?)?/g,(e,t,n,i,a)=>{if(r.push({paramName:t,isOptional:n!=null}),n){let t=a.charAt(i+e.length);return t&&t!==`/`?`/([^\\/]*)`:`(?:/([^\\/]*))?`}return`/([^\\/]+)`}).replace(/\/([\w-]+)\?(\/|$)/g,`(/$1)?$2`);return e.endsWith(`*`)?(r.push({paramName:`*`}),i+=e===`*`||e===`/*`?`(.*)$`:`(?:\\/(.+)|\\/*)$`):n?i+=`\\/*$`:e!==``&&e!==`/`&&(i+=`(?:(?=\\/|$))`),[new RegExp(i,t?void 0:`i`),r]}function Pt(e){try{return e.split(`/`).map(e=>decodeURIComponent(e).replace(/\//g,`%2F`)).join(`/`)}catch(t){return $e(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function Ft(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 It({basename:e,pathname:t}){return t===`/`?e:Kt([e,t])}var Lt=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Rt=e=>Lt.test(e);function zt(e,t=`/`){let{pathname:n,search:r=``,hash:i=``}=typeof e==`string`?it(e):e,a;return n?(n=Gt(n),a=n.startsWith(`/`)?Bt(n.substring(1),`/`):Bt(n,t)):a=t,{pathname:a,search:Yt(r),hash:Xt(i)}}function Bt(e,t){let n=qt(t).split(`/`);return e.split(`/`).forEach(e=>{e===`..`?n.length>1&&n.pop():e!==`.`&&n.push(e)}),n.length>1?n.join(`/`):`/`}function Vt(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 Ht(e){return e.filter((e,t)=>t===0||e.route.path&&e.route.path.length>0)}function Ut(e){let t=Ht(e);return t.map((e,n)=>n===t.length-1?e.pathname:e.pathnameBase)}function Wt(e,t,n,r=!1){let i;typeof e==`string`?i=it(e):(i={...e},B(!i.pathname||!i.pathname.includes(`?`),Vt(`?`,`pathname`,`search`,i)),B(!i.pathname||!i.pathname.includes(`#`),Vt(`#`,`pathname`,`hash`,i)),B(!i.search||!i.search.includes(`#`),Vt(`#`,`search`,`hash`,i)));let a=e===``||i.pathname===``,o=a?`/`:i.pathname,s;if(o==null)s=n;else{let e=t.length-1;if(!r&&o.startsWith(`..`)){let t=o.split(`/`);for(;t[0]===`..`;)t.shift(),--e;i.pathname=t.join(`/`)}s=e>=0?t[e]:`/`}let c=zt(i,s),l=o&&o!==`/`&&o.endsWith(`/`),u=(a||o===`.`)&&n.endsWith(`/`);return!c.pathname.endsWith(`/`)&&(l||u)&&(c.pathname+=`/`),c}var Gt=e=>e.replace(/\/\/+/g,`/`),Kt=e=>Gt(e.join(`/`)),qt=e=>e.replace(/\/+$/,``),Jt=e=>qt(e).replace(/^\/*/,`/`),Yt=e=>!e||e===`?`?``:e.startsWith(`?`)?e:`?`+e,Xt=e=>!e||e===`#`?``:e.startsWith(`#`)?e:`#`+e,Zt=class{constructor(e,t,n,r=!1){this.status=e,this.statusText=t||``,this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function Qt(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.internal==`boolean`&&`data`in e}function $t(e){return Kt(e.map(e=>e.route.path).filter(Boolean))||`/`}var en=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function tn(e,t){let n=e;if(typeof n!=`string`||!Lt.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,i=!1;if(en)try{let e=new URL(window.location.href),r=n.startsWith(`//`)?new URL(e.protocol+n):new URL(n),a=Ft(r.pathname,t);r.origin===e.origin&&a!=null?n=a+r.search+r.hash:i=!0}catch{$e(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:i,to:n}}var V=Symbol(`Uninstrumented`);function nn(e,t){let n={lazy:[],"lazy.loader":[],"lazy.action":[],"lazy.middleware":[],middleware:[],loader:[],action:[]};e.forEach(e=>e({id:t.id,index:t.index,path:t.path,instrument(e){let t=Object.keys(n);for(let r of t)e[r]&&n[r].push(e[r])}}));let r={};if(typeof t.lazy==`function`&&n.lazy.length>0){let e=an(n.lazy,t.lazy,()=>void 0);e&&(r.lazy=e)}if(typeof t.lazy==`object`){let e=t.lazy;[`middleware`,`loader`,`action`].forEach(t=>{let i=e[t],a=n[`lazy.${t}`];if(typeof i==`function`&&a.length>0){let e=an(a,i,()=>void 0);e&&(r.lazy=Object.assign(r.lazy||{},{[t]:e}))}})}return[`loader`,`action`].forEach(e=>{let i=t[e];if(typeof i==`function`&&n[e].length>0){let t=i[V]??i,a=an(n[e],t,(...e)=>sn(e[0]));a&&(e===`loader`&&t.hydrate===!0&&(a.hydrate=!0),a[V]=t,r[e]=a)}}),t.middleware&&t.middleware.length>0&&n.middleware.length>0&&(r.middleware=t.middleware.map(e=>{let t=e[V]??e,r=an(n.middleware,t,(...e)=>sn(e[0]));return r?(r[V]=t,r):e})),r}function rn(e,t){let n={navigate:[],fetch:[]};if(t.forEach(e=>e({instrument(e){let t=Object.keys(e);for(let r of t)e[r]&&n[r].push(e[r])}})),n.navigate.length>0){let t=e.navigate[V]??e.navigate,r=an(n.navigate,t,(...t)=>{let[n,r]=t;return{to:typeof n==`number`||typeof n==`string`?n:n?rt(n):`.`,...cn(e,r??{})}});r&&(r[V]=t,e.navigate=r)}if(n.fetch.length>0){let t=e.fetch[V]??e.fetch,r=an(n.fetch,t,(...t)=>{let[n,,r,i]=t;return{href:r??`.`,fetcherKey:n,...cn(e,i??{})}});r&&(r[V]=t,e.fetch=r)}return e}function an(e,t,n){return e.length===0?null:async(...r)=>{let i=await on(e,n(...r),()=>t(...r),e.length-1);if(i.type===`error`)throw i.value;return i.value}}async function on(e,t,n,r){let i=e[r],a;if(i){let o,s=async()=>(o?console.error(`You cannot call instrumented handlers more than once`):o=on(e,t,n,r-1),a=await o,B(a,`Expected a result`),a.type===`error`&&a.value instanceof Error?{status:`error`,error:a.value}:{status:`success`,error:void 0});try{await i(s,t)}catch(e){console.error(`An instrumentation function threw an error:`,e)}o||await s(),await o}else try{a={type:`success`,value:await n()}}catch(e){a={type:`error`,value:e}}return a||{type:`error`,value:Error(`No result assigned in instrumentation chain.`)}}function sn(e){let{request:t,context:n,params:r,unstable_pattern:i}=e;return{request:ln(t),params:{...r},unstable_pattern:i,context:un(n)}}function cn(e,t){return{currentUrl:rt(e.state.location),...`formMethod`in t?{formMethod:t.formMethod}:{},...`formEncType`in t?{formEncType:t.formEncType}:{},...`formData`in t?{formData:t.formData}:{},...`body`in t?{body:t.body}:{}}}function ln(e){return{method:e.method,url:e.url,headers:{get:(...t)=>e.headers.get(...t)}}}function un(e){if(fn(e)){let t={...e};return Object.freeze(t),t}else return{get:t=>e.get(t)}}var dn=Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);function fn(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null||Object.getOwnPropertyNames(t).sort().join(`\0`)===dn}var pn=[`POST`,`PUT`,`PATCH`,`DELETE`],mn=new Set(pn),hn=[`GET`,...pn],gn=new Set(hn),_n=new Set([301,302,303,307,308]),vn=new Set([307,308]),yn={state:`idle`,location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},bn={state:`idle`,data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},xn={state:`unblocked`,proceed:void 0,reset:void 0,location:void 0},Sn=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),Cn=`remix-router-transitions`,wn=Symbol(`ResetLoaderData`);function Tn(e){let t=e.window?e.window:typeof window<`u`?window:void 0,n=t!==void 0&&t.document!==void 0&&t.document.createElement!==void 0;B(e.routes.length>0,`You must provide a non-empty routes array to createRouter`);let r=e.hydrationRouteProperties||[],i=e.mapRouteProperties||Sn,a=i;if(e.unstable_instrumentations){let t=e.unstable_instrumentations;a=e=>({...i(e),...nn(t.map(e=>e.route).filter(Boolean),e)})}let o={},s=mt(e.routes,a,void 0,o),c,l=e.basename||`/`;l.startsWith(`/`)||(l=`/${l}`);let u=e.dataStrategy||Bn,d={unstable_passThroughRequests:!1,...e.future},f=null,p=new Set,m=null,h=null,g=null,_=e.hydrationData!=null,v=gt(s,e.history.location,l),y=!1,b=null,x,S;if(v==null&&!e.patchRoutesOnNavigation){let t=ur(404,{pathname:e.history.location.pathname}),{matches:n,route:r}=lr(s);x=!0,S=!x,v=n,b={[r.id]:t}}else if(v&&!e.hydrationData&&We(v,s,e.history.location.pathname).active&&(v=null),!v){x=!1,S=!x,v=[];let t=We(null,s,e.history.location.pathname);t.active&&t.matches&&(y=!0,v=t.matches)}else if(v.some(e=>e.route.lazy))x=!1,S=!x;else if(!v.some(e=>kn(e.route)))x=!0,S=!x;else{let t=e.hydrationData?e.hydrationData.loaderData:null,n=e.hydrationData?e.hydrationData.errors:null,r=v;if(n){let e=v.findIndex(e=>n[e.route.id]!==void 0);r=r.slice(0,e+1)}S=!1,x=!0,r.forEach(e=>{let r=An(e.route,t,n);S||=r.renderFallback,x&&=!r.shouldLoad})}let C,w={historyAction:e.history.action,location:e.history.location,matches:v,initialized:x,renderFallback:S,navigation:yn,restoreScrollPosition:e.hydrationData==null?null:!1,preventScrollReset:!1,revalidation:`idle`,loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||b,fetchers:new Map,blockers:new Map},T=`POP`,E=null,D=!1,O,k=!1,A=new Map,j=null,M=!1,ee=!1,N=new Set,te=new Map,P=0,F=-1,ne=new Map,re=new Set,ie=new Map,ae=new Map,I=new Set,L=new Map,oe,se=null;function ce(){if(f=e.history.listen(({action:t,location:n,delta:r})=>{if(oe){oe(),oe=void 0;return}$e(L.size===0||r!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let i=Re({currentLocation:w.location,nextLocation:n,historyAction:t});if(i&&r!=null){let t=new Promise(e=>{oe=e});e.history.go(r*-1),Le(i,{state:`blocked`,location:n,proceed(){Le(i,{state:`proceeding`,proceed:void 0,reset:void 0,location:n}),t.then(()=>e.history.go(r))},reset(){let e=new Map(w.blockers);e.set(i,xn),de({blockers:e})}}),E?.resolve(),E=null;return}return he(t,n)}),n){Pr(t,A);let e=()=>Fr(t,A);t.addEventListener(`pagehide`,e),j=()=>t.removeEventListener(`pagehide`,e)}return w.initialized||he(`POP`,w.location,{initialHydration:!0}),C}function le(){f&&f(),j&&j(),p.clear(),O&&O.abort(),w.fetchers.forEach((e,t)=>je(t)),w.blockers.forEach((e,t)=>z(t))}function ue(e){return p.add(e),()=>p.delete(e)}function de(e,t={}){e.matches&&=e.matches.map(e=>{let t=o[e.route.id],n=e.route;return n.element!==t.element||n.errorElement!==t.errorElement||n.hydrateFallbackElement!==t.hydrateFallbackElement?{...e,route:t}:e}),w={...w,...e};let n=[],r=[];w.fetchers.forEach((e,t)=>{e.state===`idle`&&(I.has(t)?n.push(t):r.push(t))}),I.forEach(e=>{!w.fetchers.has(e)&&!te.has(e)&&n.push(e)}),[...p].forEach(r=>r(w,{deletedFetchers:n,newErrors:e.errors??null,viewTransitionOpts:t.viewTransitionOpts,flushSync:t.flushSync===!0})),n.forEach(e=>je(e)),r.forEach(e=>w.fetchers.delete(e))}function fe(t,n,{flushSync:r}={}){let i=w.actionData!=null&&w.navigation.formMethod!=null&&Tr(w.navigation.formMethod)&&w.navigation.state===`loading`&&t.state?._isRedirect!==!0,a;a=n.actionData?Object.keys(n.actionData).length>0?n.actionData:null:i?w.actionData:null;let o=n.loaderData?or(w.loaderData,n.loaderData,n.matches||[],n.errors):w.loaderData,l=w.blockers;l.size>0&&(l=new Map(l),l.forEach((e,t)=>l.set(t,xn)));let u=M?!1:Ue(t,n.matches||w.matches),d=D===!0||w.navigation.formMethod!=null&&Tr(w.navigation.formMethod)&&t.state?._isRedirect!==!0;c&&=(s=c,void 0),M||T===`POP`||(T===`PUSH`?e.history.push(t,t.state):T===`REPLACE`&&e.history.replace(t,t.state));let f;if(T===`POP`){let e=A.get(w.location.pathname);e&&e.has(t.pathname)?f={currentLocation:w.location,nextLocation:t}:A.has(t.pathname)&&(f={currentLocation:t,nextLocation:w.location})}else if(k){let e=A.get(w.location.pathname);e?e.add(t.pathname):(e=new Set([t.pathname]),A.set(w.location.pathname,e)),f={currentLocation:w.location,nextLocation:t}}de({...n,actionData:a,loaderData:o,historyAction:T,location:t,initialized:!0,renderFallback:!1,navigation:yn,revalidation:`idle`,restoreScrollPosition:u,preventScrollReset:d,blockers:l},{viewTransitionOpts:f,flushSync:r===!0}),T=`POP`,D=!1,k=!1,M=!1,ee=!1,E?.resolve(),E=null,se?.resolve(),se=null}async function pe(t,n){if(E?.resolve(),E=null,typeof t==`number`){E||=Ir();let n=E.promise;return e.history.go(t),n}let{path:r,submission:i,error:a}=On(!1,Dn(w.location,w.matches,l,t,n?.fromRouteId,n?.relative),n),o;n?.unstable_mask&&(o={pathname:``,search:``,hash:``,...typeof n.unstable_mask==`string`?it(n.unstable_mask):{...w.location.unstable_mask,...n.unstable_mask}});let s=w.location,c=nt(s,r,n&&n.state,void 0,o);c={...c,...e.history.encodeLocation(c)};let u=n&&n.replace!=null?n.replace:void 0,d=`PUSH`;u===!0?d=`REPLACE`:u===!1||i!=null&&Tr(i.formMethod)&&i.formAction===w.location.pathname+w.location.search&&(d=`REPLACE`);let f=n&&`preventScrollReset`in n?n.preventScrollReset===!0:void 0,p=(n&&n.flushSync)===!0,m=Re({currentLocation:s,nextLocation:c,historyAction:d});if(m){Le(m,{state:`blocked`,location:c,proceed(){Le(m,{state:`proceeding`,proceed:void 0,reset:void 0,location:c}),pe(t,n)},reset(){let e=new Map(w.blockers);e.set(m,xn),de({blockers:e})}});return}await he(d,c,{submission:i,pendingError:a,preventScrollReset:f,replace:n&&n.replace,enableViewTransition:n&&n.viewTransition,flushSync:p,callSiteDefaultShouldRevalidate:n&&n.unstable_defaultShouldRevalidate})}function me(){se||=Ir(),Ee(),de({revalidation:`loading`});let e=se.promise;return w.navigation.state===`submitting`?e:w.navigation.state===`idle`?(he(w.historyAction,w.location,{startUninterruptedRevalidation:!0}),e):(he(T||w.historyAction,w.navigation.location,{overrideNavigation:w.navigation,enableViewTransition:k===!0}),e)}async function he(t,n,r){O&&O.abort(),O=null,T=t,M=(r&&r.startUninterruptedRevalidation)===!0,He(w.location,w.matches),D=(r&&r.preventScrollReset)===!0,k=(r&&r.enableViewTransition)===!0;let i=c||s,a=r&&r.overrideNavigation,o=r?.initialHydration&&w.matches&&w.matches.length>0&&!y?w.matches:gt(i,n,l),u=(r&&r.flushSync)===!0;if(o&&w.initialized&&!ee&&pr(w.location,n)&&!(r&&r.submission&&Tr(r.submission.formMethod))){fe(n,{matches:o},{flushSync:u});return}let d=We(o,i,n.pathname);if(d.active&&d.matches&&(o=d.matches),!o){let{error:e,notFoundMatches:t,route:r}=ze(n.pathname);fe(n,{matches:t,loaderData:{},errors:{[r.id]:e}},{flushSync:u});return}O=new AbortController;let f=er(e.history,n,O.signal,r&&r.submission),p=e.getContext?await e.getContext():new ct,m;if(r&&r.pendingError)m=[cr(o).route.id,{type:`error`,error:r.pendingError}];else if(r&&r.submission&&Tr(r.submission.formMethod)){let t=await ge(f,n,r.submission,o,p,d.active,r&&r.initialHydration===!0,{replace:r.replace,flushSync:u});if(t.shortCircuited)return;if(t.pendingActionResult){let[e,r]=t.pendingActionResult;if(vr(r)&&Qt(r.error)&&r.error.status===404){O=null,fe(n,{matches:t.matches,loaderData:{},errors:{[e]:r.error}});return}}o=t.matches||o,m=t.pendingActionResult,a=kr(n,r.submission),u=!1,d.active=!1,f=er(e.history,f.url,f.signal)}let{shortCircuited:h,matches:g,loaderData:_,errors:v}=await _e(f,n,o,p,d.active,a,r&&r.submission,r&&r.fetcherSubmission,r&&r.replace,r&&r.initialHydration===!0,u,m,r&&r.callSiteDefaultShouldRevalidate);h||(O=null,fe(n,{matches:g||o,...sr(m),loaderData:_,errors:v}))}async function ge(t,n,i,c,u,d,f,p={}){if(Ee(),de({navigation:Ar(n,i)},{flushSync:p.flushSync===!0}),d){let e=await Ge(c,n.pathname,t.signal);if(e.type===`aborted`)return{shortCircuited:!0};if(e.type===`error`){if(e.partialMatches.length===0){let{matches:t,route:n}=lr(s);return{matches:t,pendingActionResult:[n.id,{type:`error`,error:e.error}]}}let t=cr(e.partialMatches).route.id;return{matches:e.partialMatches,pendingActionResult:[t,{type:`error`,error:e.error}]}}else if(e.matches)c=e.matches;else{let{notFoundMatches:e,error:t,route:r}=ze(n.pathname);return{matches:e,pendingActionResult:[r.id,{type:`error`,error:t}]}}}let m,h=Dr(c,n);if(!h.route.action&&!h.route.lazy)m={type:`error`,error:ur(405,{method:t.method,pathname:n.pathname,routeId:h.route.id})};else{let e=await we(t,n,Kn(a,o,t,n,c,h,f?[]:r,u),u,null);if(m=e[h.route.id],!m){for(let t of c)if(e[t.route.id]){m=e[t.route.id];break}}if(t.signal.aborted)return{shortCircuited:!0}}if(yr(m)){let n;return n=p&&p.replace!=null?p.replace:$n(m.response.headers.get(`Location`),new URL(t.url),l,e.history)===w.location.pathname+w.location.search,await Ce(t,m,!0,{submission:i,replace:n}),{shortCircuited:!0}}if(vr(m)){let e=cr(c,h.route.id);return(p&&p.replace)!==!0&&(T=`PUSH`),{matches:c,pendingActionResult:[e.route.id,m,h.route.id]}}return{matches:c,pendingActionResult:[h.route.id,m]}}async function _e(t,n,i,u,d,f,p,m,h,g,_,v,y){let b=f||kr(n,p),x=p||m||Or(b),S=!M&&!g;if(d){if(S){let e=ve(v);de({navigation:b,...e===void 0?{}:{actionData:e}},{flushSync:_})}let e=await Ge(i,n.pathname,t.signal);if(e.type===`aborted`)return{shortCircuited:!0};if(e.type===`error`){if(e.partialMatches.length===0){let{matches:t,route:n}=lr(s);return{matches:t,loaderData:{},errors:{[n.id]:e.error}}}let t=cr(e.partialMatches).route.id;return{matches:e.partialMatches,loaderData:{},errors:{[t]:e.error}}}else if(e.matches)i=e.matches;else{let{error:e,notFoundMatches:t,route:r}=ze(n.pathname);return{matches:t,loaderData:{},errors:{[r.id]:e}}}}let C=c||s,{dsMatches:T,revalidatingFetchers:E}=H(t,u,a,o,e.history,w,i,x,n,g?[]:r,g===!0,ee,N,I,ie,re,C,l,e.patchRoutesOnNavigation!=null,v,y);if(F=++P,!e.dataStrategy&&!T.some(e=>e.shouldLoad)&&!T.some(e=>e.route.middleware&&e.route.middleware.length>0)&&E.length===0){let e=Fe();return fe(n,{matches:i,loaderData:{},errors:v&&vr(v[1])?{[v[0]]:v[1].error}:null,...sr(v),...e?{fetchers:new Map(w.fetchers)}:{}},{flushSync:_}),{shortCircuited:!0}}if(S){let e={};if(!d){e.navigation=b;let t=ve(v);t!==void 0&&(e.actionData=t)}E.length>0&&(e.fetchers=ye(E)),de(e,{flushSync:_})}E.forEach(e=>{Ne(e.key),e.controller&&te.set(e.key,e.controller)});let D=()=>E.forEach(e=>Ne(e.key));O&&O.signal.addEventListener(`abort`,D);let{loaderResults:k,fetcherResults:A}=await Te(T,E,t,n,u);if(t.signal.aborted)return{shortCircuited:!0};O&&O.signal.removeEventListener(`abort`,D),E.forEach(e=>te.delete(e.key));let j=dr(k);if(j)return await Ce(t,j.result,!0,{replace:h}),{shortCircuited:!0};if(j=dr(A),j)return re.add(j.key),await Ce(t,j.result,!0,{replace:h}),{shortCircuited:!0};let{loaderData:ne,errors:ae}=ar(w,i,k,v,E,A);g&&w.errors&&(ae={...w.errors,...ae});let L=Fe(),oe=Ie(F),se=L||oe||E.length>0;return{matches:i,loaderData:ne,errors:ae,...se?{fetchers:new Map(w.fetchers)}:{}}}function ve(e){if(e&&!vr(e[1]))return{[e[0]]:e[1].data};if(w.actionData)return Object.keys(w.actionData).length===0?null:w.actionData}function ye(e){return e.forEach(e=>{let t=w.fetchers.get(e.key),n=jr(void 0,t?t.data:void 0);w.fetchers.set(e.key,n)}),new Map(w.fetchers)}async function be(t,n,r,i){Ne(t);let a=(i&&i.flushSync)===!0,o=c||s,u=Dn(w.location,w.matches,l,r,n,i?.relative),d=gt(o,u,l),f=We(d,o,u);if(f.active&&f.matches&&(d=f.matches),!d){Oe(t,n,ur(404,{pathname:u}),{flushSync:a});return}let{path:p,submission:m,error:h}=On(!0,u,i);if(h){Oe(t,n,h,{flushSync:a});return}let g=e.getContext?await e.getContext():new ct,_=(i&&i.preventScrollReset)===!0;if(m&&Tr(m.formMethod)){await xe(t,n,p,d,g,f.active,a,_,m,i&&i.unstable_defaultShouldRevalidate);return}ie.set(t,{routeId:n,path:p}),await Se(t,n,p,d,g,f.active,a,_,m)}async function xe(t,n,i,u,d,f,p,m,h,g){Ee(),ie.delete(t),De(t,Mr(h,w.fetchers.get(t)),{flushSync:p});let _=new AbortController,v=er(e.history,i,_.signal,h);if(f){let e=await Ge(u,new URL(v.url).pathname,v.signal,t);if(e.type===`aborted`)return;if(e.type===`error`){Oe(t,n,e.error,{flushSync:p});return}else if(e.matches)u=e.matches;else{Oe(t,n,ur(404,{pathname:i}),{flushSync:p});return}}let y=Dr(u,i);if(!y.route.action&&!y.route.lazy){Oe(t,n,ur(405,{method:h.formMethod,pathname:i,routeId:n}),{flushSync:p});return}te.set(t,_);let b=P,x=Kn(a,o,v,i,u,y,r,d),S=await we(v,i,x,d,t),C=S[y.route.id];if(!C){for(let e of x)if(S[e.route.id]){C=S[e.route.id];break}}if(v.signal.aborted){te.get(t)===_&&te.delete(t);return}if(I.has(t)){if(yr(C)||vr(C)){De(t,Nr(void 0));return}}else{if(yr(C))if(te.delete(t),F>b){De(t,Nr(void 0));return}else return re.add(t),De(t,jr(h)),Ce(v,C,!1,{fetcherSubmission:h,preventScrollReset:m});if(vr(C)){Oe(t,n,C.error);return}}let E=w.navigation.location||w.location,D=er(e.history,E,_.signal),k=c||s,A=w.navigation.state===`idle`?w.matches:gt(k,w.navigation.location,l);B(A,`Didn't find any matches after fetcher action`);let j=++P;ne.set(t,j);let M=jr(h,C.data);w.fetchers.set(t,M);let{dsMatches:ae,revalidatingFetchers:L}=H(D,d,a,o,e.history,w,A,h,E,r,!1,ee,N,I,ie,re,k,l,e.patchRoutesOnNavigation!=null,[y.route.id,C],g);L.filter(e=>e.key!==t).forEach(e=>{let t=e.key,n=w.fetchers.get(t),r=jr(void 0,n?n.data:void 0);w.fetchers.set(t,r),Ne(t),e.controller&&te.set(t,e.controller)}),de({fetchers:new Map(w.fetchers)});let oe=()=>L.forEach(e=>Ne(e.key));_.signal.addEventListener(`abort`,oe);let{loaderResults:se,fetcherResults:ce}=await Te(ae,L,D,E,d);if(_.signal.aborted)return;if(_.signal.removeEventListener(`abort`,oe),ne.delete(t),te.delete(t),L.forEach(e=>te.delete(e.key)),w.fetchers.has(t)){let e=Nr(C.data);w.fetchers.set(t,e)}let le=dr(se);if(le)return Ce(D,le.result,!1,{preventScrollReset:m});if(le=dr(ce),le)return re.add(le.key),Ce(D,le.result,!1,{preventScrollReset:m});let{loaderData:ue,errors:pe}=ar(w,A,se,void 0,L,ce);Ie(j),w.navigation.state===`loading`&&j>F?(B(T,`Expected pending action`),O&&O.abort(),fe(w.navigation.location,{matches:A,loaderData:ue,errors:pe,fetchers:new Map(w.fetchers)})):(de({errors:pe,loaderData:or(w.loaderData,ue,A,pe),fetchers:new Map(w.fetchers)}),ee=!1)}async function Se(t,n,i,s,c,l,u,d,f){let p=w.fetchers.get(t);De(t,jr(f,p?p.data:void 0),{flushSync:u});let m=new AbortController,h=er(e.history,i,m.signal);if(l){let e=await Ge(s,new URL(h.url).pathname,h.signal,t);if(e.type===`aborted`)return;if(e.type===`error`){Oe(t,n,e.error,{flushSync:u});return}else if(e.matches)s=e.matches;else{Oe(t,n,ur(404,{pathname:i}),{flushSync:u});return}}let g=Dr(s,i);te.set(t,m);let _=P,v=await we(h,i,Kn(a,o,h,i,s,g,r,c),c,t),y=v[g.route.id];if(!y){for(let e of s)if(v[e.route.id]){y=v[e.route.id];break}}if(te.get(t)===m&&te.delete(t),!h.signal.aborted){if(I.has(t)){De(t,Nr(void 0));return}if(yr(y))if(F>_){De(t,Nr(void 0));return}else{re.add(t),await Ce(h,y,!1,{preventScrollReset:d});return}if(vr(y)){Oe(t,n,y.error);return}De(t,Nr(y.data))}}async function Ce(r,i,a,{submission:o,fetcherSubmission:s,preventScrollReset:c,replace:u}={}){a||(E?.resolve(),E=null),i.response.headers.has(`X-Remix-Revalidate`)&&(ee=!0);let d=i.response.headers.get(`Location`);B(d,`Expected a Location header on the redirect Response`),d=$n(d,new URL(r.url),l,e.history);let f=nt(w.location,d,{_isRedirect:!0});if(n){let e=!1;if(i.response.headers.has(`X-Remix-Reload-Document`))e=!0;else if(Rt(d)){let n=ot(d,!0);e=n.origin!==t.location.origin||Ft(n.pathname,l)==null}if(e){u?t.location.replace(d):t.location.assign(d);return}}O=null;let p=u===!0||i.response.headers.has(`X-Remix-Replace`)?`REPLACE`:`PUSH`,{formMethod:m,formAction:h,formEncType:g}=w.navigation;!o&&!s&&m&&h&&g&&(o=Or(w.navigation));let _=o||s;vn.has(i.response.status)&&_&&Tr(_.formMethod)?await he(p,f,{submission:{..._,formAction:d},preventScrollReset:c||D,enableViewTransition:a?k:void 0}):await he(p,f,{overrideNavigation:kr(f,o),fetcherSubmission:s,preventScrollReset:c||D,enableViewTransition:a?k:void 0})}async function we(e,t,n,r,i){let a,o={};try{a=await qn(u,e,t,n,i,r,!1)}catch(e){return n.filter(e=>e.shouldLoad).forEach(t=>{o[t.route.id]={type:`error`,error:e}}),o}if(e.signal.aborted)return o;if(!Tr(e.method))for(let e of n){if(a[e.route.id]?.type===`error`)break;!a.hasOwnProperty(e.route.id)&&!w.loaderData.hasOwnProperty(e.route.id)&&(!w.errors||!w.errors.hasOwnProperty(e.route.id))&&e.shouldCallHandler()&&(a[e.route.id]={type:`error`,result:Error(`No result returned from dataStrategy for route ${e.route.id}`)})}for(let[t,r]of Object.entries(a))if(_r(r)){let i=r.result;o[t]={type:`redirect`,response:Zn(i,e,t,n,l)}}else o[t]=await Xn(r);return o}async function Te(e,t,n,r,i){let a=we(n,r,e,i,null),o=Promise.all(t.map(async e=>{if(e.matches&&e.match&&e.request&&e.controller){let t=(await we(e.request,e.path,e.matches,i,e.key))[e.match.route.id];return{[e.key]:t}}else return Promise.resolve({[e.key]:{type:`error`,error:ur(404,{pathname:e.path})}})}));return{loaderResults:await a,fetcherResults:(await o).reduce((e,t)=>Object.assign(e,t),{})}}function Ee(){ee=!0,ie.forEach((e,t)=>{te.has(t)&&N.add(t),Ne(t)})}function De(e,t,n={}){w.fetchers.set(e,t),de({fetchers:new Map(w.fetchers)},{flushSync:(n&&n.flushSync)===!0})}function Oe(e,t,n,r={}){let i=cr(w.matches,t);je(e),de({errors:{[i.route.id]:n},fetchers:new Map(w.fetchers)},{flushSync:(r&&r.flushSync)===!0})}function ke(e){return ae.set(e,(ae.get(e)||0)+1),I.has(e)&&I.delete(e),w.fetchers.get(e)||bn}function Ae(e,t){Ne(e,t?.reason),De(e,Nr(null))}function je(e){let t=w.fetchers.get(e);te.has(e)&&!(t&&t.state===`loading`&&ne.has(e))&&Ne(e),ie.delete(e),ne.delete(e),re.delete(e),I.delete(e),N.delete(e),w.fetchers.delete(e)}function Me(e){let t=(ae.get(e)||0)-1;t<=0?(ae.delete(e),I.add(e)):ae.set(e,t),de({fetchers:new Map(w.fetchers)})}function Ne(e,t){let n=te.get(e);n&&(n.abort(t),te.delete(e))}function Pe(e){for(let t of e){let e=Nr(ke(t).data);w.fetchers.set(t,e)}}function Fe(){let e=[],t=!1;for(let n of re){let r=w.fetchers.get(n);B(r,`Expected fetcher: ${n}`),r.state===`loading`&&(re.delete(n),e.push(n),t=!0)}return Pe(e),t}function Ie(e){let t=[];for(let[n,r]of ne)if(r<e){let e=w.fetchers.get(n);B(e,`Expected fetcher: ${n}`),e.state===`loading`&&(Ne(n),ne.delete(n),t.push(n))}return Pe(t),t.length>0}function R(e,t){let n=w.blockers.get(e)||xn;return L.get(e)!==t&&L.set(e,t),n}function z(e){w.blockers.delete(e),L.delete(e)}function Le(e,t){let n=w.blockers.get(e)||xn;B(n.state===`unblocked`&&t.state===`blocked`||n.state===`blocked`&&t.state===`blocked`||n.state===`blocked`&&t.state===`proceeding`||n.state===`blocked`&&t.state===`unblocked`||n.state===`proceeding`&&t.state===`unblocked`,`Invalid blocker state transition: ${n.state} -> ${t.state}`);let r=new Map(w.blockers);r.set(e,t),de({blockers:r})}function Re({currentLocation:e,nextLocation:t,historyAction:n}){if(L.size===0)return;L.size>1&&$e(!1,`A router only supports one blocker at a time`);let r=Array.from(L.entries()),[i,a]=r[r.length-1],o=w.blockers.get(i);if(!(o&&o.state===`proceeding`)&&a({currentLocation:e,nextLocation:t,historyAction:n}))return i}function ze(e){let t=ur(404,{pathname:e}),{matches:n,route:r}=lr(c||s);return{notFoundMatches:n,route:r,error:t}}function Be(e,t,n){if(m=e,g=t,h=n||null,!_&&w.navigation===yn){_=!0;let e=Ue(w.location,w.matches);e!=null&&de({restoreScrollPosition:e})}return()=>{m=null,g=null,h=null}}function Ve(e,t){return h&&h(e,t.map(e=>vt(e,w.loaderData)))||e.key}function He(e,t){if(m&&g){let n=Ve(e,t);m[n]=g()}}function Ue(e,t){if(m){let n=Ve(e,t),r=m[n];if(typeof r==`number`)return r}return null}function We(t,n,r){if(e.patchRoutesOnNavigation){if(!t)return{active:!0,matches:_t(n,r,l,!0)||[]};if(Object.keys(t[0].params).length>0)return{active:!0,matches:_t(n,r,l,!0)}}return{active:!1,matches:null}}async function Ge(t,n,r,i){if(!e.patchRoutesOnNavigation)return{type:`success`,matches:t};let u=t;for(;;){let t=c==null,d=c||s,f=o;try{await e.patchRoutesOnNavigation({signal:r,path:n,matches:u,fetcherKey:i,patch:(e,t)=>{r.aborted||Nn(e,t,d,f,a,!1)}})}catch(e){return{type:`error`,error:e,partialMatches:u}}finally{t&&!r.aborted&&(s=[...s])}if(r.aborted)return{type:`aborted`};let p=gt(d,n,l),m=null;if(p&&(Object.keys(p[0].params).length===0||(m=_t(d,n,l,!0),!(m&&u.length<m.length&&Ke(u,m.slice(0,u.length))))))return{type:`success`,matches:p};if(m||=_t(d,n,l,!0),!m||Ke(u,m))return{type:`success`,matches:null};u=m}}function Ke(e,t){return e.length===t.length&&e.every((e,n)=>e.route.id===t[n].route.id)}function qe(e){o={},c=mt(e,a,void 0,o)}function Je(e,t,n=!1){let r=c==null;Nn(e,t,c||s,o,a,n),r&&(s=[...s],de({}))}return C={get basename(){return l},get future(){return d},get state(){return w},get routes(){return s},get window(){return t},initialize:ce,subscribe:ue,enableScrollRestoration:Be,navigate:pe,fetch:be,revalidate:me,createHref:t=>e.history.createHref(t),encodeLocation:t=>e.history.encodeLocation(t),getFetcher:ke,resetFetcher:Ae,deleteFetcher:Me,dispose:le,getBlocker:R,deleteBlocker:z,patchRoutes:Je,_internalFetchControllers:te,_internalSetRoutes:qe,_internalSetStateDoNotUseOrYouWillBreakYourApp(e){de(e)}},e.unstable_instrumentations&&(C=rn(C,e.unstable_instrumentations.map(e=>e.router).filter(Boolean))),C}function En(e){return e!=null&&(`formData`in e&&e.formData!=null||`body`in e&&e.body!==void 0)}function Dn(e,t,n,r,i,a){let o,s;if(i){o=[];for(let e of t)if(o.push(e),e.route.id===i){s=e;break}}else o=t,s=t[t.length-1];let c=Wt(r||`.`,Ut(o),Ft(e.pathname,n)||e.pathname,a===`path`);if(r??(c.search=e.search,c.hash=e.hash),(r==null||r===``||r===`.`)&&s){let e=Er(c.search);if(s.route.index&&!e)c.search=c.search?c.search.replace(/^\?/,`?index&`):`?index`;else if(!s.route.index&&e){let e=new URLSearchParams(c.search),t=e.getAll(`index`);e.delete(`index`),t.filter(e=>e).forEach(t=>e.append(`index`,t));let n=e.toString();c.search=n?`?${n}`:``}}return n!==`/`&&(c.pathname=It({basename:n,pathname:c.pathname})),rt(c)}function On(e,t,n){if(!n||!En(n))return{path:t};if(n.formMethod&&!wr(n.formMethod))return{path:t,error:ur(405,{method:n.formMethod})};let r=()=>({path:t,error:ur(400,{type:`invalid-body`})}),i=(n.formMethod||`get`).toUpperCase(),a=fr(t);if(n.body!==void 0){if(n.formEncType===`text/plain`){if(!Tr(i))return r();let e=typeof n.body==`string`?n.body:n.body instanceof FormData||n.body instanceof URLSearchParams?Array.from(n.body.entries()).reduce((e,[t,n])=>`${e}${t}=${n}
|
|
10
|
+
`,``):String(n.body);return{path:t,submission:{formMethod:i,formAction:a,formEncType:n.formEncType,formData:void 0,json:void 0,text:e}}}else if(n.formEncType===`application/json`){if(!Tr(i))return r();try{let e=typeof n.body==`string`?JSON.parse(n.body):n.body;return{path:t,submission:{formMethod:i,formAction:a,formEncType:n.formEncType,formData:void 0,json:e,text:void 0}}}catch{return r()}}}B(typeof FormData==`function`,`FormData is not available in this environment`);let o,s;if(n.formData)o=nr(n.formData),s=n.formData;else if(n.body instanceof FormData)o=nr(n.body),s=n.body;else if(n.body instanceof URLSearchParams)o=n.body,s=rr(o);else if(n.body==null)o=new URLSearchParams,s=new FormData;else try{o=new URLSearchParams(n.body),s=rr(o)}catch{return r()}let c={formMethod:i,formAction:a,formEncType:n&&n.formEncType||`application/x-www-form-urlencoded`,formData:s,json:void 0,text:void 0};if(Tr(c.formMethod))return{path:t,submission:c};let l=it(t);return e&&l.search&&Er(l.search)&&o.append(`index`,``),l.search=`?${o}`,{path:rt(l),submission:c}}function H(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b){let x=y?vr(y[1])?y[1].error:y[1].data:void 0,S=i.createURL(a.location),C=i.createURL(c),w;if(u&&a.errors){let e=Object.keys(a.errors)[0];w=o.findIndex(t=>t.route.id===e)}else if(y&&vr(y[1])){let e=y[0];w=o.findIndex(t=>t.route.id===e)-1}let T=y?y[1].statusCode:void 0,E=T&&T>=400,D={currentUrl:S,currentParams:a.matches[0]?.params||{},nextUrl:C,nextParams:o[0].params,...s,actionResult:x,actionStatus:T},O=$t(o),k=o.map((i,o)=>{let{route:s}=i,f=null;if(w!=null&&o>w)f=!1;else if(s.lazy)f=!0;else if(!kn(s))f=!1;else if(u){let{shouldLoad:e}=An(s,a.loaderData,a.errors);f=e}else jn(a.loaderData,a.matches[o],i)&&(f=!0);if(f!==null)return Gn(n,r,e,c,O,i,l,t,f);let p=!1;typeof b==`boolean`?p=b:E?p=!1:d||S.pathname+S.search===C.pathname+C.search?p=!0:S.search===C.search?U(a.matches[o],i)&&(p=!0):p=!0;let m={...D,defaultShouldRevalidate:p};return Gn(n,r,e,c,O,i,l,t,Mn(i,m),m,b)}),A=[];return m.forEach((e,s)=>{if(u||!o.some(t=>t.route.id===e.routeId)||p.has(s))return;let c=a.fetchers.get(s),m=c&&c.state!==`idle`&&c.data===void 0,y=gt(g,e.path,_);if(!y){if(v&&m)return;A.push({key:s,routeId:e.routeId,path:e.path,matches:null,match:null,request:null,controller:null});return}if(h.has(s))return;let x=Dr(y,e.path),S=new AbortController,C=er(i,e.path,S.signal),w=null;if(f.has(s))f.delete(s),w=Kn(n,r,C,e.path,y,x,l,t);else if(m)d&&(w=Kn(n,r,C,e.path,y,x,l,t));else{let i;i=typeof b==`boolean`?b:E?!1:d;let a={...D,defaultShouldRevalidate:i};Mn(x,a)&&(w=Kn(n,r,C,e.path,y,x,l,t,a))}w&&A.push({key:s,routeId:e.routeId,path:e.path,matches:w,match:x,request:C,controller:S})}),{dsMatches:k,revalidatingFetchers:A}}function kn(e){return e.loader!=null||e.middleware!=null&&e.middleware.length>0}function An(e,t,n){if(e.lazy)return{shouldLoad:!0,renderFallback:!0};if(!kn(e))return{shouldLoad:!1,renderFallback:!1};let r=t!=null&&e.id in t,i=n!=null&&n[e.id]!==void 0;if(!r&&i)return{shouldLoad:!1,renderFallback:!1};if(typeof e.loader==`function`&&e.loader.hydrate===!0)return{shouldLoad:!0,renderFallback:!r};let a=!r&&!i;return{shouldLoad:a,renderFallback:a}}function jn(e,t,n){let r=!t||n.route.id!==t.route.id,i=!e.hasOwnProperty(n.route.id);return r||i}function U(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith(`*`)&&e.params[`*`]!==t.params[`*`]}function Mn(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n==`boolean`)return n}return t.defaultShouldRevalidate}function Nn(e,t,n,r,i,a){let o;if(e){let t=r[e];B(t,`No route found to patch children into: routeId = ${e}`),t.children||=[],o=t.children}else o=n;let s=[],c=[];if(t.forEach(e=>{let t=o.find(t=>Pn(e,t));t?c.push({existingRoute:t,newRoute:e}):s.push(e)}),s.length>0){let t=mt(s,i,[e||`_`,`patch`,String(o?.length||`0`)],r);o.push(...t)}if(a&&c.length>0)for(let e=0;e<c.length;e++){let{existingRoute:t,newRoute:n}=c[e],r=t,[a]=mt([n],i,[],{},!0);Object.assign(r,{element:a.element?a.element:r.element,errorElement:a.errorElement?a.errorElement:r.errorElement,hydrateFallbackElement:a.hydrateFallbackElement?a.hydrateFallbackElement:r.hydrateFallbackElement})}}function Pn(e,t){return`id`in e&&`id`in t&&e.id===t.id?!0:e.index===t.index&&e.path===t.path&&e.caseSensitive===t.caseSensitive?(!e.children||e.children.length===0)&&(!t.children||t.children.length===0)?!0:e.children?.every((e,n)=>t.children?.some(t=>Pn(e,t)))??!1:!1}var Fn=new WeakMap,In=({key:e,route:t,manifest:n,mapRouteProperties:r})=>{let i=n[t.id];if(B(i,`No route found in manifest`),!i.lazy||typeof i.lazy!=`object`)return;let a=i.lazy[e];if(!a)return;let o=Fn.get(i);o||(o={},Fn.set(i,o));let s=o[e];if(s)return s;let c=(async()=>{let t=ut(e),n=i[e]!==void 0&&e!==`hasErrorBoundary`;if(t)$e(!t,`Route property `+e+` is not a supported lazy route property. This property will be ignored.`),o[e]=Promise.resolve();else if(n)$e(!1,`Route "${i.id}" has a static property "${e}" defined. The lazy property will be ignored.`);else{let t=await a();t!=null&&(Object.assign(i,{[e]:t}),Object.assign(i,r(i)))}typeof i.lazy==`object`&&(i.lazy[e]=void 0,Object.values(i.lazy).every(e=>e===void 0)&&(i.lazy=void 0))})();return o[e]=c,c},Ln=new WeakMap;function Rn(e,t,n,r,i){let a=n[e.id];if(B(a,`No route found in manifest`),!e.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof e.lazy==`function`){let t=Ln.get(a);if(t)return{lazyRoutePromise:t,lazyHandlerPromise:t};let n=(async()=>{B(typeof e.lazy==`function`,`No lazy route function found`);let t=await e.lazy(),n={};for(let e in t){let r=t[e];if(r===void 0)continue;let i=ft(e),o=a[e]!==void 0&&e!==`hasErrorBoundary`;i?$e(!i,`Route property `+e+` is not a supported property to be returned from a lazy route function. This property will be ignored.`):o?$e(!o,`Route "${a.id}" has a static property "${e}" defined but its lazy function is also returning a value for this property. The lazy route property "${e}" will be ignored.`):n[e]=r}Object.assign(a,n),Object.assign(a,{...r(a),lazy:void 0})})();return Ln.set(a,n),n.catch(()=>{}),{lazyRoutePromise:n,lazyHandlerPromise:n}}let o=Object.keys(e.lazy),s=[],c;for(let a of o){if(i&&i.includes(a))continue;let o=In({key:a,route:e,manifest:n,mapRouteProperties:r});o&&(s.push(o),a===t&&(c=o))}let l=s.length>0?Promise.all(s).then(()=>{}):void 0;return l?.catch(()=>{}),c?.catch(()=>{}),{lazyRoutePromise:l,lazyHandlerPromise:c}}async function zn(e){let t=e.matches.filter(e=>e.shouldLoad),n={};return(await Promise.all(t.map(e=>e.resolve()))).forEach((e,r)=>{n[t[r].route.id]=e}),n}async function Bn(e){return e.matches.some(e=>e.route.middleware)?Vn(e,()=>zn(e)):zn(e)}function Vn(e,t){return Hn(e,t,e=>{if(Cr(e))throw e;return e},hr,n);function n(t,n,r){if(r)return Promise.resolve(Object.assign(r.value,{[n]:{type:`error`,result:t}}));{let{matches:r}=e,i=cr(r,r[Math.min(Math.max(r.findIndex(e=>e.route.id===n),0),Math.max(r.findIndex(e=>e.shouldCallHandler()),0))].route.id).route.id;return Promise.resolve({[i]:{type:`error`,result:t}})}}}async function Hn(e,t,n,r,i){let{matches:a,...o}=e;return await Un(o,a.flatMap(e=>e.route.middleware?e.route.middleware.map(t=>[e.route.id,t]):[]),t,n,r,i)}async function Un(e,t,n,r,i,a,o=0){let{request:s}=e;if(s.signal.aborted)throw s.signal.reason??Error(`Request aborted: ${s.method} ${s.url}`);let c=t[o];if(!c)return await n();let[l,u]=c,d,f=async()=>{if(d)throw Error("You may only call `next()` once per middleware");try{return d={value:await Un(e,t,n,r,i,a,o+1)},d.value}catch(e){return d={value:await a(e,l,d)},d.value}};try{let t=await u(e,f),n=t==null?void 0:r(t);return i(n)?n:d?n??d.value:(d={value:await f()},d.value)}catch(e){return await a(e,l,d)}}function Wn(e,t,n,r,i){let a=In({key:`middleware`,route:r.route,manifest:t,mapRouteProperties:e}),o=Rn(r.route,Tr(n.method)?`action`:`loader`,t,e,i);return{middleware:a,route:o.lazyRoutePromise,handler:o.lazyHandlerPromise}}function Gn(e,t,n,r,i,a,o,s,c,l=null,u){let d=!1,f=Wn(e,t,n,a,o);return{...a,_lazyPromises:f,shouldLoad:c,shouldRevalidateArgs:l,shouldCallHandler(e){return d=!0,l?typeof u==`boolean`?Mn(a,{...l,defaultShouldRevalidate:u}):typeof e==`boolean`?Mn(a,{...l,defaultShouldRevalidate:e}):Mn(a,l):c},resolve(e){let{lazy:t,loader:o,middleware:l}=a.route,u=d||c||e&&!Tr(n.method)&&(t||o),p=l&&l.length>0&&!o&&!t;return u&&(Tr(n.method)||!p)?Jn({request:n,path:r,unstable_pattern:i,match:a,lazyHandlerPromise:f?.handler,lazyRoutePromise:f?.route,handlerOverride:e,scopedContext:s}):Promise.resolve({type:`data`,result:void 0})}}}function Kn(e,t,n,r,i,a,o,s,c=null){return i.map(l=>l.route.id===a.route.id?Gn(e,t,n,r,$t(i),l,o,s,!0,c):{...l,shouldLoad:!1,shouldRevalidateArgs:c,shouldCallHandler:()=>!1,_lazyPromises:Wn(e,t,n,l,o),resolve:()=>Promise.resolve({type:`data`,result:void 0})})}async function qn(e,t,n,r,i,a,o){r.some(e=>e._lazyPromises?.middleware)&&await Promise.all(r.map(e=>e._lazyPromises?.middleware));let s={request:t,unstable_url:tr(t,n),unstable_pattern:$t(r),params:r[0].params,context:a,matches:r},c=o?()=>{throw Error("You cannot call `runClientMiddleware()` from a static handler `dataStrategy`. Middleware is run outside of `dataStrategy` during SSR in order to bubble up the Response. You can enable middleware via the `respond` API in `query`/`queryRoute`")}:e=>{let t=s;return Vn(t,()=>e({...t,fetcherKey:i,runClientMiddleware:()=>{throw Error("Cannot call `runClientMiddleware()` from within an `runClientMiddleware` handler")}}))},l=await e({...s,fetcherKey:i,runClientMiddleware:c});try{await Promise.all(r.flatMap(e=>[e._lazyPromises?.handler,e._lazyPromises?.route]))}catch{}return l}async function Jn({request:e,path:t,unstable_pattern:n,match:r,lazyHandlerPromise:i,lazyRoutePromise:a,handlerOverride:o,scopedContext:s}){let c,l,u=Tr(e.method),d=u?`action`:`loader`,f=i=>{let a,c=new Promise((e,t)=>a=t);l=()=>a(),e.signal.addEventListener(`abort`,l);let u=a=>typeof i==`function`?i({request:e,unstable_url:tr(e,t),unstable_pattern:n,params:r.params,context:s},...a===void 0?[]:[a]):Promise.reject(Error(`You cannot call the handler for a route which defines a boolean "${d}" [routeId: ${r.route.id}]`)),f=(async()=>{try{return{type:`data`,result:await(o?o(e=>u(e)):u())}}catch(e){return{type:`error`,result:e}}})();return Promise.race([f,c])};try{let t=u?r.route.action:r.route.loader;if(i||a)if(t){let e,[n]=await Promise.all([f(t).catch(t=>{e=t}),i,a]);if(e!==void 0)throw e;c=n}else{await i;let t=u?r.route.action:r.route.loader;if(t)[c]=await Promise.all([f(t),a]);else if(d===`action`){let t=new URL(e.url),n=t.pathname+t.search;throw ur(405,{method:e.method,pathname:n,routeId:r.route.id})}else return{type:`data`,result:void 0}}else if(t)c=await f(t);else{let t=new URL(e.url);throw ur(404,{pathname:t.pathname+t.search})}}catch(e){return{type:`error`,result:e}}finally{l&&e.signal.removeEventListener(`abort`,l)}return c}async function Yn(e){let t=e.headers.get(`Content-Type`);return t&&/\bapplication\/json\b/.test(t)?e.body==null?null:e.json():e.text()}async function Xn(e){let{result:t,type:n}=e;if(xr(t)){let e;try{e=await Yn(t)}catch(e){return{type:`error`,error:e}}return n===`error`?{type:`error`,error:new Zt(t.status,t.statusText,e),statusCode:t.status,headers:t.headers}:{type:`data`,data:e,statusCode:t.status,headers:t.headers}}return n===`error`?br(t)?t.data instanceof Error?{type:`error`,error:t.data,statusCode:t.init?.status,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:`error`,error:mr(t),statusCode:Qt(t)?t.status:void 0,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:`error`,error:t,statusCode:Qt(t)?t.status:void 0}:br(t)?{type:`data`,data:t.data,statusCode:t.init?.status,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:`data`,data:t}}function Zn(e,t,n,r,i){let a=e.headers.get(`Location`);if(B(a,`Redirects returned/thrown from loaders/actions must have a Location header`),!Rt(a)){let o=r.slice(0,r.findIndex(e=>e.route.id===n)+1);a=Dn(new URL(t.url),o,i,a),e.headers.set(`Location`,a)}return e}var Qn=[`about:`,`blob:`,`chrome:`,`chrome-untrusted:`,`content:`,`data:`,`devtools:`,`file:`,`filesystem:`,`javascript:`];function $n(e,t,n,r){if(Rt(e)){let r=e,i=r.startsWith(`//`)?new URL(t.protocol+r):new URL(r);if(Qn.includes(i.protocol))throw Error(`Invalid redirect location`);let a=Ft(i.pathname,n)!=null;if(i.origin===t.origin&&a)return Gt(i.pathname)+i.search+i.hash}try{let t=r.createURL(e);if(Qn.includes(t.protocol))throw Error(`Invalid redirect location`)}catch{}return e}function er(e,t,n,r){let i=e.createURL(fr(t)).toString(),a={signal:n};if(r&&Tr(r.formMethod)){let{formMethod:e,formEncType:t}=r;a.method=e.toUpperCase(),t===`application/json`?(a.headers=new Headers({"Content-Type":t}),a.body=JSON.stringify(r.json)):t===`text/plain`?a.body=r.text:t===`application/x-www-form-urlencoded`&&r.formData?a.body=nr(r.formData):a.body=r.formData}return new Request(i,a)}function tr(e,t){let n=new URL(e.url),r=typeof t==`string`?it(t):t;if(n.pathname=r.pathname||`/`,r.search){let e=new URLSearchParams(r.search),t=e.getAll(`index`);e.delete(`index`);for(let n of t.filter(Boolean))e.append(`index`,n);n.search=e.size?`?${e.toString()}`:``}else n.search=``;return n.hash=r.hash||``,n}function nr(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,typeof r==`string`?r:r.name);return t}function rr(e){let t=new FormData;for(let[n,r]of e.entries())t.append(n,r);return t}function ir(e,t,n,r=!1,i=!1){let a={},o=null,s,c=!1,l={},u=n&&vr(n[1])?n[1].error:void 0;return e.forEach(n=>{if(!(n.route.id in t))return;let d=n.route.id,f=t[d];if(B(!yr(f),`Cannot handle redirect results in processLoaderData`),vr(f)){let t=f.error;if(u!==void 0&&(t=u,u=void 0),o||={},i)o[d]=t;else{let n=cr(e,d);o[n.route.id]??(o[n.route.id]=t)}r||(a[d]=wn),c||(c=!0,s=Qt(f.error)?f.error.status:500),f.headers&&(l[d]=f.headers)}else a[d]=f.data,f.statusCode&&f.statusCode!==200&&!c&&(s=f.statusCode),f.headers&&(l[d]=f.headers)}),u!==void 0&&n&&(o={[n[0]]:u},n[2]&&(a[n[2]]=void 0)),{loaderData:a,errors:o,statusCode:s||200,loaderHeaders:l}}function ar(e,t,n,r,i,a){let{loaderData:o,errors:s}=ir(t,n,r);return i.filter(e=>!e.matches||e.matches.some(e=>e.shouldLoad)).forEach(t=>{let{key:n,match:r,controller:i}=t;if(i&&i.signal.aborted)return;let o=a[n];if(B(o,`Did not find corresponding fetcher result`),vr(o)){let t=cr(e.matches,r?.route.id);s&&s[t.route.id]||(s={...s,[t.route.id]:o.error}),e.fetchers.delete(n)}else if(yr(o))B(!1,`Unhandled fetcher revalidation redirect`);else{let t=Nr(o.data);e.fetchers.set(n,t)}}),{loaderData:o,errors:s}}function or(e,t,n,r){let i=Object.entries(t).filter(([,e])=>e!==wn).reduce((e,[t,n])=>(e[t]=n,e),{});for(let a of n){let n=a.route.id;if(!t.hasOwnProperty(n)&&e.hasOwnProperty(n)&&a.route.loader&&(i[n]=e[n]),r&&r.hasOwnProperty(n))break}return i}function sr(e){return e?vr(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function cr(e,t){return(t?e.slice(0,e.findIndex(e=>e.route.id===t)+1):[...e]).reverse().find(e=>e.route.hasErrorBoundary===!0)||e[0]}function lr(e){let t=e.length===1?e[0]:e.find(e=>e.index||!e.path||e.path===`/`)||{id:`__shim-error-route__`};return{matches:[{params:{},pathname:``,pathnameBase:``,route:t}],route:t}}function ur(e,{pathname:t,routeId:n,method:r,type:i,message:a}={}){let o=`Unknown Server Error`,s=`Unknown @remix-run/router error`;return e===400?(o=`Bad Request`,r&&t&&n?s=`You made a ${r} request to "${t}" but did not provide a \`loader\` for route "${n}", so there is no way to handle the request.`:i===`invalid-body`&&(s=`Unable to encode submission body`)):e===403?(o=`Forbidden`,s=`Route "${n}" does not match URL "${t}"`):e===404?(o=`Not Found`,s=`No route matches URL "${t}"`):e===405&&(o=`Method Not Allowed`,r&&t&&n?s=`You made a ${r.toUpperCase()} request to "${t}" but did not provide an \`action\` for route "${n}", so there is no way to handle the request.`:r&&(s=`Invalid request method "${r.toUpperCase()}"`)),new Zt(e||500,o,Error(s),!0)}function dr(e){let t=Object.entries(e);for(let e=t.length-1;e>=0;e--){let[n,r]=t[e];if(yr(r))return{key:n,result:r}}}function fr(e){return rt({...typeof e==`string`?it(e):e,hash:``})}function pr(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===``?t.hash!==``:e.hash===t.hash?!0:t.hash!==``}function mr(e){return new Zt(e.init?.status??500,e.init?.statusText??`Internal Server Error`,e.data)}function hr(e){return typeof e==`object`&&!!e&&Object.entries(e).every(([e,t])=>typeof e==`string`&&gr(t))}function gr(e){return typeof e==`object`&&!!e&&`type`in e&&`result`in e&&(e.type===`data`||e.type===`error`)}function _r(e){return xr(e.result)&&_n.has(e.result.status)}function vr(e){return e.type===`error`}function yr(e){return(e&&e.type)===`redirect`}function br(e){return typeof e==`object`&&!!e&&`type`in e&&`data`in e&&`init`in e&&e.type===`DataWithResponseInit`}function xr(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.headers==`object`&&e.body!==void 0}function Sr(e){return _n.has(e)}function Cr(e){return xr(e)&&Sr(e.status)&&e.headers.has(`Location`)}function wr(e){return gn.has(e.toUpperCase())}function Tr(e){return mn.has(e.toUpperCase())}function Er(e){return new URLSearchParams(e).getAll(`index`).some(e=>e===``)}function Dr(e,t){let n=typeof t==`string`?it(t).search:t.search;if(e[e.length-1].route.index&&Er(n||``))return e[e.length-1];let r=Ht(e);return r[r.length-1]}function Or(e){let{formMethod:t,formAction:n,formEncType:r,text:i,formData:a,json:o}=e;if(!(!t||!n||!r)){if(i!=null)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:void 0,text:i};if(a!=null)return{formMethod:t,formAction:n,formEncType:r,formData:a,json:void 0,text:void 0};if(o!==void 0)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:o,text:void 0}}}function kr(e,t){return t?{state:`loading`,location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}:{state:`loading`,location:e,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function Ar(e,t){return{state:`submitting`,location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}}function jr(e,t){return e?{state:`loading`,formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t}:{state:`loading`,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function Mr(e,t){return{state:`submitting`,formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t?t.data:void 0}}function Nr(e){return{state:`idle`,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function Pr(e,t){try{let n=e.sessionStorage.getItem(Cn);if(n){let e=JSON.parse(n);for(let[n,r]of Object.entries(e||{}))r&&Array.isArray(r)&&t.set(n,new Set(r||[]))}}catch{}}function Fr(e,t){if(t.size>0){let n={};for(let[e,r]of t)n[e]=[...r];try{e.sessionStorage.setItem(Cn,JSON.stringify(n))}catch(e){$e(!1,`Failed to save applied view transitions in sessionStorage (${e}).`)}}}function Ir(){let e,t,n=new Promise((r,i)=>{e=async e=>{r(e);try{await n}catch{}},t=async e=>{i(e);try{await n}catch{}}});return{promise:n,resolve:e,reject:t}}var Lr=R.createContext(null);Lr.displayName=`DataRouter`;var Rr=R.createContext(null);Rr.displayName=`DataRouterState`;var zr=R.createContext(!1);function Br(){return R.useContext(zr)}var Vr=R.createContext({isTransitioning:!1});Vr.displayName=`ViewTransition`;var Hr=R.createContext(new Map);Hr.displayName=`Fetchers`;var Ur=R.createContext(null);Ur.displayName=`Await`;var Wr=R.createContext(null);Wr.displayName=`Navigation`;var Gr=R.createContext(null);Gr.displayName=`Location`;var Kr=R.createContext({outlet:null,matches:[],isDataRoute:!1});Kr.displayName=`Route`;var qr=R.createContext(null);qr.displayName=`RouteError`;var Jr=`REACT_ROUTER_ERROR`,Yr=`REDIRECT`,Xr=`ROUTE_ERROR_RESPONSE`;function Zr(e){if(e.startsWith(`${Jr}:${Yr}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`&&typeof t.location==`string`&&typeof t.reloadDocument==`boolean`&&typeof t.replace==`boolean`)return t}catch{}}function Qr(e){if(e.startsWith(`${Jr}:${Xr}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`)return new Zt(t.status,t.statusText,t.data)}catch{}}function $r(e,{relative:t}={}){B(ei(),`useHref() may be used only in the context of a <Router> component.`);let{basename:n,navigator:r}=R.useContext(Wr),{hash:i,pathname:a,search:o}=ci(e,{relative:t}),s=a;return n!==`/`&&(s=a===`/`?n:Kt([n,a])),r.createHref({pathname:s,search:o,hash:i})}function ei(){return R.useContext(Gr)!=null}function ti(){return B(ei(),`useLocation() may be used only in the context of a <Router> component.`),R.useContext(Gr).location}var ni=`You should call navigate() in a React.useEffect(), not when your component is first rendered.`;function ri(e){R.useContext(Wr).static||R.useLayoutEffect(e)}function ii(){let{isDataRoute:e}=R.useContext(Kr);return e?Ei():ai()}function ai(){B(ei(),`useNavigate() may be used only in the context of a <Router> component.`);let e=R.useContext(Lr),{basename:t,navigator:n}=R.useContext(Wr),{matches:r}=R.useContext(Kr),{pathname:i}=ti(),a=JSON.stringify(Ut(r)),o=R.useRef(!1);return ri(()=>{o.current=!0}),R.useCallback((r,s={})=>{if($e(o.current,ni),!o.current)return;if(typeof r==`number`){n.go(r);return}let c=Wt(r,JSON.parse(a),i,s.relative===`path`);e==null&&t!==`/`&&(c.pathname=c.pathname===`/`?t:Kt([t,c.pathname])),(s.replace?n.replace:n.push)(c,s.state,s)},[t,n,a,i,e])}var oi=R.createContext(null);function si(e){let t=R.useContext(Kr).outlet;return R.useMemo(()=>t&&R.createElement(oi.Provider,{value:e},t),[t,e])}function ci(e,{relative:t}={}){let{matches:n}=R.useContext(Kr),{pathname:r}=ti(),i=JSON.stringify(Ut(n));return R.useMemo(()=>Wt(e,JSON.parse(i),r,t===`path`),[e,i,r,t])}function li(e,t,n){B(ei(),`useRoutes() may be used only in the context of a <Router> component.`);let{navigator:r}=R.useContext(Wr),{matches:i}=R.useContext(Kr),a=i[i.length-1],o=a?a.params:{},s=a?a.pathname:`/`,c=a?a.pathnameBase:`/`,l=a&&a.route;{let e=l&&l.path||``;Oi(s,!l||e.endsWith(`*`)||e.endsWith(`*?`),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${s}" (under <Route path="${e}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
|
|
11
|
+
|
|
12
|
+
Please change the parent <Route path="${e}"> to <Route path="${e===`/`?`*`:`${e}/*`}">.`)}let u=ti(),d;if(t){let e=typeof t==`string`?it(t):t;B(c===`/`||e.pathname?.startsWith(c),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${c}" but pathname "${e.pathname}" was given in the \`location\` prop.`),d=e}else d=u;let f=d.pathname||`/`,p=f;if(c!==`/`){let e=c.replace(/^\//,``).split(`/`);p=`/`+f.replace(/^\//,``).split(`/`).slice(e.length).join(`/`)}let m=gt(e,{pathname:p});$e(l||m!=null,`No routes matched location "${d.pathname}${d.search}${d.hash}" `),$e(m==null||m[m.length-1].route.element!==void 0||m[m.length-1].route.Component!==void 0||m[m.length-1].route.lazy!==void 0,`Matched leaf route at location "${d.pathname}${d.search}${d.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let h=gi(m&&m.map(e=>Object.assign({},e,{params:Object.assign({},o,e.params),pathname:Kt([c,r.encodeLocation?r.encodeLocation(e.pathname.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathname]),pathnameBase:e.pathnameBase===`/`?c:Kt([c,r.encodeLocation?r.encodeLocation(e.pathnameBase.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathnameBase])})),i,n);return t&&h?R.createElement(Gr.Provider,{value:{location:{pathname:`/`,search:``,hash:``,state:null,key:`default`,unstable_mask:void 0,...d},navigationType:`POP`}},h):h}function ui(){let e=Ti(),t=Qt(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r=`rgba(200,200,200, 0.5)`,i={padding:`0.5rem`,backgroundColor:r},a={padding:`2px 4px`,backgroundColor:r},o=null;return console.error(`Error handled by React Router default ErrorBoundary:`,e),o=R.createElement(R.Fragment,null,R.createElement(`p`,null,`💿 Hey developer 👋`),R.createElement(`p`,null,`You can provide a way better UX than this when your app throws errors by providing your own `,R.createElement(`code`,{style:a},`ErrorBoundary`),` or`,` `,R.createElement(`code`,{style:a},`errorElement`),` prop on your route.`)),R.createElement(R.Fragment,null,R.createElement(`h2`,null,`Unexpected Application Error!`),R.createElement(`h3`,{style:{fontStyle:`italic`}},t),n?R.createElement(`pre`,{style:i},n):null,o)}var di=R.createElement(ui,null),fi=class extends R.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!==`idle`&&e.revalidation===`idle`?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error===void 0?t.error:e.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error(`React Router caught the following error during render`,e)}render(){let e=this.state.error;if(this.context&&typeof e==`object`&&e&&`digest`in e&&typeof e.digest==`string`){let t=Qr(e.digest);t&&(e=t)}let t=e===void 0?this.props.children:R.createElement(Kr.Provider,{value:this.props.routeContext},R.createElement(qr.Provider,{value:e,children:this.props.component}));return this.context?R.createElement(mi,{error:e},t):t}};fi.contextType=zr;var pi=new WeakMap;function mi({children:e,error:t}){let{basename:n}=R.useContext(Wr);if(typeof t==`object`&&t&&`digest`in t&&typeof t.digest==`string`){let e=Zr(t.digest);if(e){let r=pi.get(t);if(r)throw r;let i=tn(e.location,n);if(en&&!pi.get(t))if(i.isExternal||e.reloadDocument)window.location.href=i.absoluteURL||i.to;else{let n=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(i.to,{replace:e.replace}));throw pi.set(t,n),n}return R.createElement(`meta`,{httpEquiv:`refresh`,content:`0;url=${i.absoluteURL||i.to}`})}}return e}function hi({routeContext:e,match:t,children:n}){let r=R.useContext(Lr);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),R.createElement(Kr.Provider,{value:e},n)}function gi(e,t=[],n){let r=n?.state;if(e==null){if(!r)return null;if(r.errors)e=r.matches;else if(t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let i=e,a=r?.errors;if(a!=null){let e=i.findIndex(e=>e.route.id&&a?.[e.route.id]!==void 0);B(e>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(a).join(`,`)}`),i=i.slice(0,Math.min(i.length,e+1))}let o=!1,s=-1;if(n&&r){o=r.renderFallback;for(let e=0;e<i.length;e++){let t=i[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(s=e),t.route.id){let{loaderData:e,errors:a}=r,c=t.route.loader&&!e.hasOwnProperty(t.route.id)&&(!a||a[t.route.id]===void 0);if(t.route.lazy||c){n.isStatic&&(o=!0),i=s>=0?i.slice(0,s+1):[i[0]];break}}}}let c=n?.onError,l=r&&c?(e,t)=>{c(e,{location:r.location,params:r.matches?.[0]?.params??{},unstable_pattern:$t(r.matches),errorInfo:t})}:void 0;return i.reduceRight((e,n,c)=>{let u,d=!1,f=null,p=null;r&&(u=a&&n.route.id?a[n.route.id]:void 0,f=n.route.errorElement||di,o&&(s<0&&c===0?(Oi(`route-fallback`,!1,"No `HydrateFallback` element provided to render during initial hydration"),d=!0,p=null):s===c&&(d=!0,p=n.route.hydrateFallbackElement||null)));let m=t.concat(i.slice(0,c+1)),h=()=>{let t;return t=u?f:d?p:n.route.Component?R.createElement(n.route.Component,null):n.route.element?n.route.element:e,R.createElement(hi,{match:n,routeContext:{outlet:e,matches:m,isDataRoute:r!=null},children:t})};return r&&(n.route.ErrorBoundary||n.route.errorElement||c===0)?R.createElement(fi,{location:r.location,revalidation:r.revalidation,component:f,error:u,children:h(),routeContext:{outlet:null,matches:m,isDataRoute:!0},onError:l}):h()},null)}function _i(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function vi(e){let t=R.useContext(Lr);return B(t,_i(e)),t}function yi(e){let t=R.useContext(Rr);return B(t,_i(e)),t}function bi(e){let t=R.useContext(Kr);return B(t,_i(e)),t}function xi(e){let t=bi(e),n=t.matches[t.matches.length-1];return B(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function Si(){return xi(`useRouteId`)}function Ci(){return yi(`useNavigation`).navigation}function wi(){let{matches:e,loaderData:t}=yi(`useMatches`);return R.useMemo(()=>e.map(e=>vt(e,t)),[e,t])}function Ti(){let e=R.useContext(qr),t=yi(`useRouteError`),n=xi(`useRouteError`);return e===void 0?t.errors?.[n]:e}function Ei(){let{router:e}=vi(`useNavigate`),t=xi(`useNavigate`),n=R.useRef(!1);return ri(()=>{n.current=!0}),R.useCallback(async(r,i={})=>{$e(n.current,ni),n.current&&(typeof r==`number`?await e.navigate(r):await e.navigate(r,{fromRouteId:t,...i}))},[e,t])}var Di={};function Oi(e,t,n){!t&&!Di[e]&&(Di[e]=!0,$e(!1,n))}var ki={};function W(e,t){!e&&!ki[t]&&(ki[t]=!0,console.warn(t))}var Ai=R.useOptimistic,ji=()=>void 0;function Mi(e){return Ai?Ai(e):[e,ji]}function Ni(e){let t={hasErrorBoundary:e.hasErrorBoundary||e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&(e.element&&$e(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(t,{element:R.createElement(e.Component),Component:void 0})),e.HydrateFallback&&(e.hydrateFallbackElement&&$e(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(t,{hydrateFallbackElement:R.createElement(e.HydrateFallback),HydrateFallback:void 0})),e.ErrorBoundary&&(e.errorElement&&$e(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(t,{errorElement:R.createElement(e.ErrorBoundary),ErrorBoundary:void 0})),t}var Pi=[`HydrateFallback`,`hydrateFallbackElement`],Fi=class{constructor(){this.status=`pending`,this.promise=new Promise((e,t)=>{this.resolve=t=>{this.status===`pending`&&(this.status=`resolved`,e(t))},this.reject=e=>{this.status===`pending`&&(this.status=`rejected`,t(e))}})}};function Ii({router:e,flushSync:t,onError:n,unstable_useTransitions:r}){r=Br()||r;let[i,a]=R.useState(e.state),[o,s]=Mi(i),[c,l]=R.useState(),[u,d]=R.useState({isTransitioning:!1}),[f,p]=R.useState(),[m,h]=R.useState(),[g,_]=R.useState(),v=R.useRef(new Map),y=R.useCallback((i,{deletedFetchers:o,newErrors:c,flushSync:u,viewTransitionOpts:g})=>{c&&n&&Object.values(c).forEach(e=>n(e,{location:i.location,params:i.matches[0]?.params??{},unstable_pattern:$t(i.matches)})),i.fetchers.forEach((e,t)=>{e.data!==void 0&&v.current.set(t,e.data)}),o.forEach(e=>v.current.delete(e)),W(u===!1||t!=null,'You provided the `flushSync` option to a router update, but you are not using the `<RouterProvider>` from `react-router/dom` so `ReactDOM.flushSync()` is unavailable. Please update your app to `import { RouterProvider } from "react-router/dom"` and ensure you have `react-dom` installed as a dependency to use the `flushSync` option.');let y=e.window!=null&&e.window.document!=null&&typeof e.window.document.startViewTransition==`function`;if(W(g==null||y,"You provided the `viewTransition` option to a router update, but you do not appear to be running in a DOM environment as `window.startViewTransition` is not available."),!g||!y){t&&u?t(()=>a(i)):r===!1?a(i):R.startTransition(()=>{r===!0&&s(e=>Li(e,i)),a(i)});return}if(t&&u){t(()=>{m&&(f?.resolve(),m.skipTransition()),d({isTransitioning:!0,flushSync:!0,currentLocation:g.currentLocation,nextLocation:g.nextLocation})});let n=e.window.document.startViewTransition(()=>{t(()=>a(i))});n.finished.finally(()=>{t(()=>{p(void 0),h(void 0),l(void 0),d({isTransitioning:!1})})}),t(()=>h(n));return}m?(f?.resolve(),m.skipTransition(),_({state:i,currentLocation:g.currentLocation,nextLocation:g.nextLocation})):(l(i),d({isTransitioning:!0,flushSync:!1,currentLocation:g.currentLocation,nextLocation:g.nextLocation}))},[e.window,t,m,f,r,s,n]);R.useLayoutEffect(()=>e.subscribe(y),[e,y]);let b=o.initialized;R.useLayoutEffect(()=>{!b&&e.state.initialized&&y(e.state,{deletedFetchers:[],flushSync:!1,newErrors:null})},[b,y,e.state]),R.useEffect(()=>{u.isTransitioning&&!u.flushSync&&p(new Fi)},[u]),R.useEffect(()=>{if(f&&c&&e.window){let t=c,n=f.promise,i=e.window.document.startViewTransition(async()=>{r===!1?a(t):R.startTransition(()=>{r===!0&&s(e=>Li(e,t)),a(t)}),await n});i.finished.finally(()=>{p(void 0),h(void 0),l(void 0),d({isTransitioning:!1})}),h(i)}},[c,f,e.window,r,s]),R.useEffect(()=>{f&&c&&o.location.key===c.location.key&&f.resolve()},[f,m,o.location,c]),R.useEffect(()=>{!u.isTransitioning&&g&&(l(g.state),d({isTransitioning:!0,flushSync:!1,currentLocation:g.currentLocation,nextLocation:g.nextLocation}),_(void 0))},[u.isTransitioning,g]);let x=R.useMemo(()=>({createHref:e.createHref,encodeLocation:e.encodeLocation,go:t=>e.navigate(t),push:(t,n,r)=>e.navigate(t,{state:n,preventScrollReset:r?.preventScrollReset}),replace:(t,n,r)=>e.navigate(t,{replace:!0,state:n,preventScrollReset:r?.preventScrollReset})}),[e]),S=e.basename||`/`,C=R.useMemo(()=>({router:e,navigator:x,static:!1,basename:S,onError:n}),[e,x,S,n]);return R.createElement(R.Fragment,null,R.createElement(Lr.Provider,{value:C},R.createElement(Rr.Provider,{value:o},R.createElement(Hr.Provider,{value:v.current},R.createElement(Vr.Provider,{value:u},R.createElement(Vi,{basename:S,location:o.location,navigationType:o.historyAction,navigator:x,unstable_useTransitions:r},R.createElement(Ri,{routes:e.routes,future:e.future,state:o,isStatic:!1,onError:n})))))),null)}function Li(e,t){return{...e,navigation:t.navigation.state===`idle`?e.navigation:t.navigation,revalidation:t.revalidation===`idle`?e.revalidation:t.revalidation,actionData:t.navigation.state===`submitting`?e.actionData:t.actionData,fetchers:t.fetchers}}var Ri=R.memo(zi);function zi({routes:e,future:t,state:n,isStatic:r,onError:i}){return li(e,void 0,{state:n,isStatic:r,onError:i,future:t})}function Bi(e){return si(e.context)}function Vi({basename:e=`/`,children:t=null,location:n,navigationType:r=`POP`,navigator:i,static:a=!1,unstable_useTransitions:o}){B(!ei(),`You cannot render a <Router> inside another <Router>. You should never have more than one in your app.`);let s=e.replace(/^\/*/,`/`),c=R.useMemo(()=>({basename:s,navigator:i,static:a,unstable_useTransitions:o,future:{}}),[s,i,a,o]);typeof n==`string`&&(n=it(n));let{pathname:l=`/`,search:u=``,hash:d=``,state:f=null,key:p=`default`,unstable_mask:m}=n,h=R.useMemo(()=>{let e=Ft(l,s);return e==null?null:{location:{pathname:e,search:u,hash:d,state:f,key:p,unstable_mask:m},navigationType:r}},[s,l,u,d,f,p,r,m]);return $e(h!=null,`<Router basename="${s}"> is not able to match the URL "${l}${u}${d}" because it does not start with the basename, so the <Router> won't render anything.`),h==null?null:R.createElement(Wr.Provider,{value:c},R.createElement(Gr.Provider,{children:t,value:h}))}R.Component;var Hi=`get`,Ui=`application/x-www-form-urlencoded`;function Wi(e){return typeof HTMLElement<`u`&&e instanceof HTMLElement}function Gi(e){return Wi(e)&&e.tagName.toLowerCase()===`button`}function Ki(e){return Wi(e)&&e.tagName.toLowerCase()===`form`}function qi(e){return Wi(e)&&e.tagName.toLowerCase()===`input`}function Ji(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Yi(e,t){return e.button===0&&(!t||t===`_self`)&&!Ji(e)}function Xi(e=``){return new URLSearchParams(typeof e==`string`||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(e=>[n,e]):[[n,r]])},[]))}function Zi(e,t){let n=Xi(e);return t&&t.forEach((e,r)=>{n.has(r)||t.getAll(r).forEach(e=>{n.append(r,e)})}),n}var Qi=null;function $i(){if(Qi===null)try{new FormData(document.createElement(`form`),0),Qi=!1}catch{Qi=!0}return Qi}var ea=new Set([`application/x-www-form-urlencoded`,`multipart/form-data`,`text/plain`]);function ta(e){return e!=null&&!ea.has(e)?($e(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Ui}"`),null):e}function na(e,t){let n,r,i,a,o;if(Ki(e)){let o=e.getAttribute(`action`);r=o?Ft(o,t):null,n=e.getAttribute(`method`)||Hi,i=ta(e.getAttribute(`enctype`))||Ui,a=new FormData(e)}else if(Gi(e)||qi(e)&&(e.type===`submit`||e.type===`image`)){let o=e.form;if(o==null)throw Error(`Cannot submit a <button> or <input type="submit"> without a <form>`);let s=e.getAttribute(`formaction`)||o.getAttribute(`action`);if(r=s?Ft(s,t):null,n=e.getAttribute(`formmethod`)||o.getAttribute(`method`)||Hi,i=ta(e.getAttribute(`formenctype`))||ta(o.getAttribute(`enctype`))||Ui,a=new FormData(o,e),!$i()){let{name:t,type:n,value:r}=e;if(n===`image`){let e=t?`${t}.`:``;a.append(`${e}x`,`0`),a.append(`${e}y`,`0`)}else t&&a.append(t,r)}}else if(Wi(e))throw Error(`Cannot submit element that is not <form>, <button>, or <input type="submit|image">`);else n=Hi,r=null,i=Ui,o=e;return a&&i===`text/plain`&&(o=a,a=void 0),{action:r,method:n.toLowerCase(),encType:i,formData:a,body:o}}Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);var ra={"&":`\\u0026`,">":`\\u003e`,"<":`\\u003c`,"\u2028":`\\u2028`,"\u2029":`\\u2029`},ia=/[&><\u2028\u2029]/g;function aa(e){return e.replace(ia,e=>ra[e])}function oa(e,t){if(e===!1||e==null)throw Error(t)}function sa(e,t,n,r){let i=typeof e==`string`?new URL(e,typeof window>`u`?`server://singlefetch/`:window.location.origin):e;return n?i.pathname.endsWith(`/`)?i.pathname=`${i.pathname}_.${r}`:i.pathname=`${i.pathname}.${r}`:i.pathname===`/`?i.pathname=`_root.${r}`:t&&Ft(i.pathname,t)===`/`?i.pathname=`${qt(t)}/_root.${r}`:i.pathname=`${qt(i.pathname)}.${r}`,i}async function ca(e,t){if(e.id in t)return t[e.id];try{let n=await Ge(()=>import(e.module),[]);return t[e.id]=n,n}catch(t){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(t),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function la(e){return e!=null&&typeof e.page==`string`}function ua(e){return e==null?!1:e.href==null?e.rel===`preload`&&typeof e.imageSrcSet==`string`&&typeof e.imageSizes==`string`:typeof e.rel==`string`&&typeof e.href==`string`}async function da(e,t,n){return ga((await Promise.all(e.map(async e=>{let r=t.routes[e.route.id];if(r){let e=await ca(r,n);return e.links?e.links():[]}return[]}))).flat(1).filter(ua).filter(e=>e.rel===`stylesheet`||e.rel===`preload`).map(e=>e.rel===`stylesheet`?{...e,rel:`prefetch`,as:`style`}:{...e,rel:`prefetch`}))}function fa(e,t,n,r,i,a){let o=(e,t)=>n[t]?e.route.id!==n[t].route.id:!0,s=(e,t)=>n[t].pathname!==e.pathname||n[t].route.path?.endsWith(`*`)&&n[t].params[`*`]!==e.params[`*`];return a===`assets`?t.filter((e,t)=>o(e,t)||s(e,t)):a===`data`?t.filter((t,a)=>{let c=r.routes[t.route.id];if(!c||!c.hasLoader)return!1;if(o(t,a)||s(t,a))return!0;if(t.route.shouldRevalidate){let r=t.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParams:n[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:t.params,defaultShouldRevalidate:!0});if(typeof r==`boolean`)return r}return!0}):[]}function pa(e,t,{includeHydrateFallback:n}={}){return ma(e.map(e=>{let r=t.routes[e.route.id];if(!r)return[];let i=[r.module];return r.clientActionModule&&(i=i.concat(r.clientActionModule)),r.clientLoaderModule&&(i=i.concat(r.clientLoaderModule)),n&&r.hydrateFallbackModule&&(i=i.concat(r.hydrateFallbackModule)),r.imports&&(i=i.concat(r.imports)),i}).flat(1))}function ma(e){return[...new Set(e)]}function ha(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function ga(e,t){let n=new Set,r=new Set(t);return e.reduce((e,i)=>{if(t&&!la(i)&&i.as===`script`&&i.href&&r.has(i.href))return e;let a=JSON.stringify(ha(i));return n.has(a)||(n.add(a),e.push({key:a,link:i})),e},[])}function _a(){let e=R.useContext(Lr);return oa(e,`You must render this element inside a <DataRouterContext.Provider> element`),e}function va(){let e=R.useContext(Rr);return oa(e,`You must render this element inside a <DataRouterStateContext.Provider> element`),e}var ya=R.createContext(void 0);ya.displayName=`FrameworkContext`;function ba(){let e=R.useContext(ya);return oa(e,`You must render this element inside a <HydratedRouter> element`),e}function xa(e,t){let n=R.useContext(ya),[r,i]=R.useState(!1),[a,o]=R.useState(!1),{onFocus:s,onBlur:c,onMouseEnter:l,onMouseLeave:u,onTouchStart:d}=t,f=R.useRef(null);R.useEffect(()=>{if(e===`render`&&o(!0),e===`viewport`){let e=new IntersectionObserver(e=>{e.forEach(e=>{o(e.isIntersecting)})},{threshold:.5});return f.current&&e.observe(f.current),()=>{e.disconnect()}}},[e]),R.useEffect(()=>{if(r){let e=setTimeout(()=>{o(!0)},100);return()=>{clearTimeout(e)}}},[r]);let p=()=>{i(!0)},m=()=>{i(!1),o(!1)};return n?e===`intent`?[a,f,{onFocus:Sa(s,p),onBlur:Sa(c,m),onMouseEnter:Sa(l,p),onMouseLeave:Sa(u,m),onTouchStart:Sa(d,p)}]:[a,f,{}]:[!1,f,{}]}function Sa(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function Ca({page:e,...t}){let n=Br(),{router:r}=_a(),i=R.useMemo(()=>gt(r.routes,e,r.basename),[r.routes,e,r.basename]);return i?n?R.createElement(Ta,{page:e,matches:i,...t}):R.createElement(Ea,{page:e,matches:i,...t}):null}function wa(e){let{manifest:t,routeModules:n}=ba(),[r,i]=R.useState([]);return R.useEffect(()=>{let r=!1;return da(e,t,n).then(e=>{r||i(e)}),()=>{r=!0}},[e,t,n]),r}function Ta({page:e,matches:t,...n}){let r=ti(),{future:i}=ba(),{basename:a}=_a(),o=R.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=sa(e,a,i.unstable_trailingSlashAwareDataRequests,`rsc`),o=!1,s=[];for(let e of t)typeof e.route.shouldRevalidate==`function`?o=!0:s.push(e.route.id);return o&&s.length>0&&n.searchParams.set(`_routes`,s.join(`,`)),[n.pathname+n.search]},[a,i.unstable_trailingSlashAwareDataRequests,e,r,t]);return R.createElement(R.Fragment,null,o.map(e=>R.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})))}function Ea({page:e,matches:t,...n}){let r=ti(),{future:i,manifest:a,routeModules:o}=ba(),{basename:s}=_a(),{loaderData:c,matches:l}=va(),u=R.useMemo(()=>fa(e,t,l,a,r,`data`),[e,t,l,a,r]),d=R.useMemo(()=>fa(e,t,l,a,r,`assets`),[e,t,l,a,r]),f=R.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=new Set,l=!1;if(t.forEach(e=>{let t=a.routes[e.route.id];!t||!t.hasLoader||(!u.some(t=>t.route.id===e.route.id)&&e.route.id in c&&o[e.route.id]?.shouldRevalidate||t.hasClientLoader?l=!0:n.add(e.route.id))}),n.size===0)return[];let d=sa(e,s,i.unstable_trailingSlashAwareDataRequests,`data`);return l&&n.size>0&&d.searchParams.set(`_routes`,t.filter(e=>n.has(e.route.id)).map(e=>e.route.id).join(`,`)),[d.pathname+d.search]},[s,i.unstable_trailingSlashAwareDataRequests,c,r,a,u,t,e,o]),p=R.useMemo(()=>pa(d,a),[d,a]),m=wa(d);return R.createElement(R.Fragment,null,f.map(e=>R.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})),p.map(e=>R.createElement(`link`,{key:e,rel:`modulepreload`,href:e,...n})),m.map(({key:e,link:t})=>R.createElement(`link`,{key:e,nonce:n.nonce,...t,crossOrigin:t.crossOrigin??n.crossOrigin})))}function Da(...e){return t=>{e.forEach(e=>{typeof e==`function`?e(t):e!=null&&(e.current=t)})}}R.Component;var Oa=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;try{Oa&&(window.__reactRouterVersion=`7.14.2`)}catch{}function ka(e,t){return Tn({basename:t?.basename,getContext:t?.getContext,future:t?.future,history:Qe({window:t?.window}),hydrationData:t?.hydrationData||Aa(),routes:e,mapRouteProperties:Ni,hydrationRouteProperties:Pi,dataStrategy:t?.dataStrategy,patchRoutesOnNavigation:t?.patchRoutesOnNavigation,window:t?.window,unstable_instrumentations:t?.unstable_instrumentations}).initialize()}function Aa(){let e=window?.__staticRouterHydrationData;return e&&e.errors&&(e={...e,errors:ja(e.errors)}),e}function ja(e){if(!e)return null;let t=Object.entries(e),n={};for(let[e,r]of t)if(r&&r.__type===`RouteErrorResponse`)n[e]=new Zt(r.status,r.statusText,r.data,r.internal===!0);else if(r&&r.__type===`Error`){if(r.__subType){let t=window[r.__subType];if(typeof t==`function`)try{let i=new t(r.message);i.stack=``,n[e]=i}catch{}}if(n[e]==null){let t=Error(r.message);t.stack=``,n[e]=t}}else n[e]=r;return n}function Ma({basename:e,children:t,history:n,unstable_useTransitions:r}){let[i,a]=R.useState({action:n.action,location:n.location}),o=R.useCallback(e=>{r===!1?a(e):R.startTransition(()=>a(e))},[r]);return R.useLayoutEffect(()=>n.listen(o),[n,o]),R.createElement(Vi,{basename:e,children:t,location:i.location,navigationType:i.action,navigator:n,unstable_useTransitions:r})}Ma.displayName=`unstable_HistoryRouter`;var Na=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Pa=R.forwardRef(function({onClick:e,discover:t=`render`,prefetch:n=`none`,relative:r,reloadDocument:i,replace:a,unstable_mask:o,state:s,target:c,to:l,preventScrollReset:u,viewTransition:d,unstable_defaultShouldRevalidate:f,...p},m){let{basename:h,navigator:g,unstable_useTransitions:_}=R.useContext(Wr),v=typeof l==`string`&&Na.test(l),y=tn(l,h);l=y.to;let b=$r(l,{relative:r}),x=ti(),S=null;if(o){let e=Wt(o,[],x.unstable_mask?x.unstable_mask.pathname:`/`,!0);h!==`/`&&(e.pathname=e.pathname===`/`?h:Kt([h,e.pathname])),S=g.createHref(e)}let[C,w,T]=xa(n,p),E=Va(l,{replace:a,unstable_mask:o,state:s,target:c,preventScrollReset:u,relative:r,viewTransition:d,unstable_defaultShouldRevalidate:f,unstable_useTransitions:_});function D(t){e&&e(t),t.defaultPrevented||E(t)}let O=!(y.isExternal||i),k=R.createElement(`a`,{...p,...T,href:(O?S:void 0)||y.absoluteURL||b,onClick:O?D:e,ref:Da(m,w),target:c,"data-discover":!v&&t===`render`?`true`:void 0});return C&&!v?R.createElement(R.Fragment,null,k,R.createElement(Ca,{page:b})):k});Pa.displayName=`Link`;var Fa=R.forwardRef(function({"aria-current":e=`page`,caseSensitive:t=!1,className:n=``,end:r=!1,style:i,to:a,viewTransition:o,children:s,...c},l){let u=ci(a,{relative:c.relative}),d=ti(),f=R.useContext(Rr),{navigator:p,basename:m}=R.useContext(Wr),h=f!=null&&Qa(u)&&o===!0,g=p.encodeLocation?p.encodeLocation(u).pathname:u.pathname,_=d.pathname,v=f&&f.navigation&&f.navigation.location?f.navigation.location.pathname:null;t||(_=_.toLowerCase(),v=v?v.toLowerCase():null,g=g.toLowerCase()),v&&m&&(v=Ft(v,m)||v);let y=g!==`/`&&g.endsWith(`/`)?g.length-1:g.length,b=_===g||!r&&_.startsWith(g)&&_.charAt(y)===`/`,x=v!=null&&(v===g||!r&&v.startsWith(g)&&v.charAt(g.length)===`/`),S={isActive:b,isPending:x,isTransitioning:h},C=b?e:void 0,w;w=typeof n==`function`?n(S):[n,b?`active`:null,x?`pending`:null,h?`transitioning`:null].filter(Boolean).join(` `);let T=typeof i==`function`?i(S):i;return R.createElement(Pa,{...c,"aria-current":C,className:w,ref:l,style:T,to:a,viewTransition:o},typeof s==`function`?s(S):s)});Fa.displayName=`NavLink`;var Ia=R.forwardRef(({discover:e=`render`,fetcherKey:t,navigate:n,reloadDocument:r,replace:i,state:a,method:o=Hi,action:s,onSubmit:c,relative:l,preventScrollReset:u,viewTransition:d,unstable_defaultShouldRevalidate:f,...p},m)=>{let{unstable_useTransitions:h}=R.useContext(Wr),g=Ga(),_=Ka(s,{relative:l}),v=o.toLowerCase()===`get`?`get`:`post`,y=typeof s==`string`&&Na.test(s);return R.createElement(`form`,{ref:m,method:v,action:_,onSubmit:r?c:e=>{if(c&&c(e),e.defaultPrevented)return;e.preventDefault();let r=e.nativeEvent.submitter,s=r?.getAttribute(`formmethod`)||o,p=()=>g(r||e.currentTarget,{fetcherKey:t,method:s,navigate:n,replace:i,state:a,relative:l,preventScrollReset:u,viewTransition:d,unstable_defaultShouldRevalidate:f});h&&n!==!1?R.startTransition(()=>p()):p()},...p,"data-discover":!y&&e===`render`?`true`:void 0})});Ia.displayName=`Form`;function La({getKey:e,storageKey:t,...n}){let r=R.useContext(ya),{basename:i}=R.useContext(Wr),a=ti(),o=wi();Xa({getKey:e,storageKey:t});let s=R.useMemo(()=>{if(!r||!e)return null;let t=Ya(a,o,i,e);return t===a.key?null:t},[]);if(!r||r.isSpaMode)return null;let c=((e,t)=>{if(!window.history.state||!window.history.state.key){let e=Math.random().toString(32).slice(2);window.history.replaceState({key:e},``)}try{let n=JSON.parse(sessionStorage.getItem(e)||`{}`)[t||window.history.state.key];typeof n==`number`&&window.scrollTo(0,n)}catch(t){console.error(t),sessionStorage.removeItem(e)}}).toString();return R.createElement(`script`,{...n,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:`(${c})(${aa(JSON.stringify(t||qa))}, ${aa(JSON.stringify(s))})`}})}La.displayName=`ScrollRestoration`;function Ra(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function za(e){let t=R.useContext(Lr);return B(t,Ra(e)),t}function Ba(e){let t=R.useContext(Rr);return B(t,Ra(e)),t}function Va(e,{target:t,replace:n,unstable_mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,unstable_defaultShouldRevalidate:c,unstable_useTransitions:l}={}){let u=ii(),d=ti(),f=ci(e,{relative:o});return R.useCallback(p=>{if(Yi(p,t)){p.preventDefault();let t=n===void 0?rt(d)===rt(f):n,m=()=>u(e,{replace:t,unstable_mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,unstable_defaultShouldRevalidate:c});l?R.startTransition(()=>m()):m()}},[d,u,f,n,r,i,t,e,a,o,s,c,l])}function Ha(e){$e(typeof URLSearchParams<`u`,"You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=R.useRef(Xi(e)),n=R.useRef(!1),r=ti(),i=R.useMemo(()=>Zi(r.search,n.current?null:t.current),[r.search]),a=ii();return[i,R.useCallback((e,t)=>{let r=Xi(typeof e==`function`?e(new URLSearchParams(i)):e);n.current=!0,a(`?`+r,t)},[a,i])]}var Ua=0,Wa=()=>`__${String(++Ua)}__`;function Ga(){let{router:e}=za(`useSubmit`),{basename:t}=R.useContext(Wr),n=Si(),r=e.fetch,i=e.navigate;return R.useCallback(async(e,a={})=>{let{action:o,method:s,encType:c,formData:l,body:u}=na(e,t);a.navigate===!1?await r(a.fetcherKey||Wa(),n,a.action||o,{unstable_defaultShouldRevalidate:a.unstable_defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,flushSync:a.flushSync}):await i(a.action||o,{unstable_defaultShouldRevalidate:a.unstable_defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,replace:a.replace,state:a.state,fromRouteId:n,flushSync:a.flushSync,viewTransition:a.viewTransition})},[r,i,t,n])}function Ka(e,{relative:t}={}){let{basename:n}=R.useContext(Wr),r=R.useContext(Kr);B(r,`useFormAction must be used inside a RouteContext`);let[i]=r.matches.slice(-1),a={...ci(e||`.`,{relative:t})},o=ti();if(e==null){a.search=o.search;let e=new URLSearchParams(a.search),t=e.getAll(`index`);if(t.some(e=>e===``)){e.delete(`index`),t.filter(e=>e).forEach(t=>e.append(`index`,t));let n=e.toString();a.search=n?`?${n}`:``}}return(!e||e===`.`)&&i.route.index&&(a.search=a.search?a.search.replace(/^\?/,`?index&`):`?index`),n!==`/`&&(a.pathname=a.pathname===`/`?n:Kt([n,a.pathname])),rt(a)}var qa=`react-router-scroll-positions`,Ja={};function Ya(e,t,n,r){let i=null;return r&&(i=r(n===`/`?e:{...e,pathname:Ft(e.pathname,n)||e.pathname},t)),i??=e.key,i}function Xa({getKey:e,storageKey:t}={}){let{router:n}=za(`useScrollRestoration`),{restoreScrollPosition:r,preventScrollReset:i}=Ba(`useScrollRestoration`),{basename:a}=R.useContext(Wr),o=ti(),s=wi(),c=Ci();R.useEffect(()=>(window.history.scrollRestoration=`manual`,()=>{window.history.scrollRestoration=`auto`}),[]),Za(R.useCallback(()=>{if(c.state===`idle`){let t=Ya(o,s,a,e);Ja[t]=window.scrollY}try{sessionStorage.setItem(t||qa,JSON.stringify(Ja))}catch(e){$e(!1,`Failed to save scroll positions in sessionStorage, <ScrollRestoration /> will not work properly (${e}).`)}window.history.scrollRestoration=`auto`},[c.state,e,a,o,s,t])),typeof document<`u`&&(R.useLayoutEffect(()=>{try{let e=sessionStorage.getItem(t||qa);e&&(Ja=JSON.parse(e))}catch{}},[t]),R.useLayoutEffect(()=>{let t=n?.enableScrollRestoration(Ja,()=>window.scrollY,e?(t,n)=>Ya(t,n,a,e):void 0);return()=>t&&t()},[n,a,e]),R.useLayoutEffect(()=>{if(r!==!1){if(typeof r==`number`){window.scrollTo(0,r);return}try{if(o.hash){let e=document.getElementById(decodeURIComponent(o.hash.slice(1)));if(e){e.scrollIntoView();return}}}catch{$e(!1,`"${o.hash.slice(1)}" is not a decodable element ID. The view will not scroll to it.`)}i!==!0&&window.scrollTo(0,0)}},[o,r,i]))}function Za(e,t){let{capture:n}=t||{};R.useEffect(()=>{let t=n==null?void 0:{capture:n};return window.addEventListener(`pagehide`,e,t),()=>{window.removeEventListener(`pagehide`,e,t)}},[e,n])}function Qa(e,{relative:t}={}){let n=R.useContext(Vr);B(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=za(`useViewTransitionState`),i=ci(e,{relative:t});if(!n.isTransitioning)return!1;let a=Ft(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=Ft(n.nextLocation.pathname,r)||n.nextLocation.pathname;return Mt(i.pathname,o)!=null||Mt(i.pathname,a)!=null}var $a=g();function eo(){`serviceWorker`in navigator&&globalThis.isSecureContext&&window.addEventListener(`load`,()=>{navigator.serviceWorker.register(`/sw.js`).catch(()=>void 0)})}var to=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),no=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),ro=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),io=e=>{let t=ro(e);return t.charAt(0).toUpperCase()+t.slice(1)},ao={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},oo=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},so=(0,R.createContext)({}),G=()=>(0,R.useContext)(so),co=(0,R.forwardRef)(({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...s},c)=>{let{size:l=24,strokeWidth:u=2,absoluteStrokeWidth:d=!1,color:f=`currentColor`,className:p=``}=G()??{},m=r??d?Number(n??u)*24/Number(t??l):n??u;return(0,R.createElement)(`svg`,{ref:c,...ao,width:t??l??ao.width,height:t??l??ao.height,stroke:e??f,strokeWidth:m,className:to(`lucide`,p,i),...!a&&!oo(s)&&{"aria-hidden":`true`},...s},[...o.map(([e,t])=>(0,R.createElement)(e,t)),...Array.isArray(a)?a:[a]])}),K=(e,t)=>{let n=(0,R.forwardRef)(({className:n,...r},i)=>(0,R.createElement)(co,{ref:i,iconNode:t,className:to(`lucide-${no(io(e))}`,`lucide-${e}`,n),...r}));return n.displayName=io(e),n},lo=K(`archive-restore`,[[`rect`,{width:`20`,height:`5`,x:`2`,y:`3`,rx:`1`,key:`1wp1u1`}],[`path`,{d:`M4 8v11a2 2 0 0 0 2 2h2`,key:`tvwodi`}],[`path`,{d:`M20 8v11a2 2 0 0 1-2 2h-2`,key:`1gkqxj`}],[`path`,{d:`m9 15 3-3 3 3`,key:`1pd0qc`}],[`path`,{d:`M12 12v9`,key:`192myk`}]]),uo=K(`archive`,[[`rect`,{width:`20`,height:`5`,x:`2`,y:`3`,rx:`1`,key:`1wp1u1`}],[`path`,{d:`M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8`,key:`1s80jp`}],[`path`,{d:`M10 12h4`,key:`a56b0p`}]]),fo=K(`bot`,[[`path`,{d:`M12 8V4H8`,key:`hb8ula`}],[`rect`,{width:`16`,height:`12`,x:`4`,y:`8`,rx:`2`,key:`enze0r`}],[`path`,{d:`M2 14h2`,key:`vft8re`}],[`path`,{d:`M20 14h2`,key:`4cs60a`}],[`path`,{d:`M15 13v2`,key:`1xurst`}],[`path`,{d:`M9 13v2`,key:`rq6x2g`}]]),po=K(`brain`,[[`path`,{d:`M12 18V5`,key:`adv99a`}],[`path`,{d:`M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4`,key:`1e3is1`}],[`path`,{d:`M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5`,key:`1gqd8o`}],[`path`,{d:`M17.997 5.125a4 4 0 0 1 2.526 5.77`,key:`iwvgf7`}],[`path`,{d:`M18 18a4 4 0 0 0 2-7.464`,key:`efp6ie`}],[`path`,{d:`M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517`,key:`1gq6am`}],[`path`,{d:`M6 18a4 4 0 0 1-2-7.464`,key:`k1g0md`}],[`path`,{d:`M6.003 5.125a4 4 0 0 0-2.526 5.77`,key:`q97ue3`}]]),mo=K(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),ho=K(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),go=K(`chevrons-up-down`,[[`path`,{d:`m7 15 5 5 5-5`,key:`1hf1tw`}],[`path`,{d:`m7 9 5-5 5 5`,key:`sgt6xg`}]]),_o=K(`circle-check`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),vo=K(`circle-dot`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}]]),yo=K(`circle`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]),bo=K(`clock-3`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6h4`,key:`135r8i`}]]),xo=K(`ellipsis`,[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`19`,cy:`12`,r:`1`,key:`1wjl8i`}],[`circle`,{cx:`5`,cy:`12`,r:`1`,key:`1pcz8c`}]]),So=K(`file-diff`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M9 10h6`,key:`9gxzsh`}],[`path`,{d:`M12 13V7`,key:`h0r20n`}],[`path`,{d:`M9 17h6`,key:`r8uit2`}]]),Co=K(`file-text`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 9H8`,key:`b1mrlr`}],[`path`,{d:`M16 13H8`,key:`t4e002`}],[`path`,{d:`M16 17H8`,key:`z1uh3a`}]]),wo=K(`folder-git-2`,[[`path`,{d:`M18 19a5 5 0 0 1-5-5v8`,key:`sz5oeg`}],[`path`,{d:`M9 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v5`,key:`1w6njk`}],[`circle`,{cx:`13`,cy:`12`,r:`2`,key:`1j92g6`}],[`circle`,{cx:`20`,cy:`19`,r:`2`,key:`1obnsp`}]]),To=K(`git-branch`,[[`path`,{d:`M15 6a9 9 0 0 0-9 9V3`,key:`1cii5b`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}]]),Eo=K(`git-pull-request`,[[`circle`,{cx:`18`,cy:`18`,r:`3`,key:`1xkwt0`}],[`circle`,{cx:`6`,cy:`6`,r:`3`,key:`1lh9wr`}],[`path`,{d:`M13 6h3a2 2 0 0 1 2 2v7`,key:`1yeb86`}],[`line`,{x1:`6`,x2:`6`,y1:`9`,y2:`21`,key:`rroup`}]]),Do=K(`grip-vertical`,[[`circle`,{cx:`9`,cy:`12`,r:`1`,key:`1vctgf`}],[`circle`,{cx:`9`,cy:`5`,r:`1`,key:`hp0tcf`}],[`circle`,{cx:`9`,cy:`19`,r:`1`,key:`fkjjf6`}],[`circle`,{cx:`15`,cy:`12`,r:`1`,key:`1tmaij`}],[`circle`,{cx:`15`,cy:`5`,r:`1`,key:`19l28e`}],[`circle`,{cx:`15`,cy:`19`,r:`1`,key:`f4zoj3`}]]),Oo=K(`inbox`,[[`polyline`,{points:`22 12 16 12 14 15 10 15 8 12 2 12`,key:`o97t9d`}],[`path`,{d:`M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z`,key:`oot6mr`}]]),ko=K(`list-checks`,[[`path`,{d:`M13 5h8`,key:`a7qcls`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 19h8`,key:`c3s6r1`}],[`path`,{d:`m3 17 2 2 4-4`,key:`1jhpwq`}],[`path`,{d:`m3 7 2 2 4-4`,key:`1obspn`}]]),Ao=K(`loader-circle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),jo=K(`message-square-plus`,[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}],[`path`,{d:`M12 8v6`,key:`1ib9pf`}],[`path`,{d:`M9 11h6`,key:`1fldmi`}]]),Mo=K(`message-square`,[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}]]),No=K(`panel-left`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}]]),Po=K(`paperclip`,[[`path`,{d:`m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551`,key:`1miecu`}]]),Fo=K(`pencil`,[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}]]),Io=K(`plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]),Lo=K(`refresh-cw`,[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]),Ro=K(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]),zo=K(`send`,[[`path`,{d:`M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z`,key:`1ffxy3`}],[`path`,{d:`m21.854 2.147-10.94 10.939`,key:`12cjpa`}]]),Bo=K(`sparkles`,[[`path`,{d:`M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z`,key:`1s2grr`}],[`path`,{d:`M20 2v4`,key:`1rf3ol`}],[`path`,{d:`M22 4h-4`,key:`gwowj6`}],[`circle`,{cx:`4`,cy:`20`,r:`2`,key:`6kqj1y`}]]),Vo=K(`square`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}]]),Ho=K(`terminal`,[[`path`,{d:`M12 19h8`,key:`baeox8`}],[`path`,{d:`m4 17 6-6-6-6`,key:`1yngyt`}]]),Uo=K(`trash-2`,[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]]),Wo=K(`triangle-alert`,[[`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`,key:`wmoenq`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),Go=K(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),Ko=K(`zap`,[[`path`,{d:`M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z`,key:`1xq2db`}]]);function q(...e){return e.filter(Boolean).join(` `)}function qo({className:e}){return(0,z.jsx)(Ao,{"aria-hidden":`true`,className:q(`size-4 animate-spin`,e)})}function Jo({className:e}){return(0,z.jsx)(`span`,{"aria-hidden":`true`,className:q(`block animate-pulse rounded-[var(--radius-sm)] bg-[var(--skeleton-bg)]`,e)})}function Yo({className:e,label:t}){return(0,z.jsxs)(`div`,{className:q(`inline-flex items-center gap-2 text-[length:var(--font-size-xs)] text-[var(--text-tertiary)]`,e),role:`status`,children:[(0,z.jsx)(qo,{className:`size-3.5`}),(0,z.jsx)(`span`,{children:t})]})}function Xo(){return(0,z.jsxs)(`div`,{className:`flex h-screen min-h-0 bg-[var(--surface-window)] text-[var(--text-primary)]`,role:`status`,children:[(0,z.jsxs)(`aside`,{className:`hidden w-[var(--layout-sidebar-width)] shrink-0 border-r border-sidebar-border bg-sidebar p-3 md:block`,children:[(0,z.jsxs)(`div`,{className:`mb-5 flex min-h-[calc(var(--layout-topbar-height)-24px)] items-center gap-2`,children:[(0,z.jsx)(Jo,{className:`size-8`}),(0,z.jsx)(Jo,{className:`h-4 w-28`})]}),(0,z.jsxs)(`div`,{className:`space-y-2`,children:[(0,z.jsx)(Jo,{className:`h-3 w-20`}),(0,z.jsx)(Zo,{})]})]}),(0,z.jsxs)(`main`,{className:`flex min-w-0 flex-1 flex-col bg-[var(--surface-panel)]`,children:[(0,z.jsxs)(`header`,{className:`flex min-h-[var(--layout-topbar-height)] items-center gap-3 border-b border-border px-4`,children:[(0,z.jsx)(Jo,{className:`size-8`}),(0,z.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-2`,children:[(0,z.jsx)(Jo,{className:`h-4 w-40 max-w-full`}),(0,z.jsx)(Jo,{className:`h-3 w-64 max-w-full`})]})]}),(0,z.jsx)(`div`,{className:`min-h-0 flex-1 px-4 py-4`,children:(0,z.jsx)($o,{})})]})]})}function Zo(){return(0,z.jsx)(`div`,{className:`space-y-2`,"aria-hidden":`true`,children:Array.from({length:4},(e,t)=>(0,z.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,z.jsxs)(`div`,{className:`flex h-8 items-center gap-2 px-2`,children:[(0,z.jsx)(Jo,{className:`size-4 shrink-0`}),(0,z.jsx)(Jo,{className:`h-3.5 w-32`})]}),t<2&&(0,z.jsx)(Qo,{})]},t))})}function Qo(){return(0,z.jsx)(`div`,{className:`ml-4 space-y-1 border-l border-sidebar-border pl-4`,children:Array.from({length:2},(e,t)=>(0,z.jsxs)(`div`,{className:`flex h-7 items-center gap-2`,children:[(0,z.jsx)(Jo,{className:`size-3.5 shrink-0`}),(0,z.jsx)(Jo,{className:`h-3 w-28`})]},t))})}function $o(){return(0,z.jsxs)(`div`,{className:`mx-auto flex max-w-[var(--layout-max-content-width)] flex-col gap-3`,children:[(0,z.jsx)(es,{align:`right`}),(0,z.jsx)(es,{align:`left`,lines:4}),(0,z.jsx)(es,{align:`right`,lines:2}),(0,z.jsx)(es,{align:`left`,lines:3})]})}function es({align:e,lines:t=3}){return(0,z.jsx)(`div`,{className:q(`rounded-[var(--radius-lg)] border px-4 py-3 shadow-[var(--shadow-xs)]`,e===`right`?`ml-auto w-[min(78%,34rem)] border-transparent bg-[var(--chat-user-skeleton-bg)]`:`mr-auto w-[min(82%,42rem)] border-border bg-card`),children:(0,z.jsx)(`div`,{className:`space-y-2`,children:Array.from({length:t},(e,n)=>(0,z.jsx)(Jo,{className:q(`h-3`,n===t-1?`w-2/3`:`w-full`)},n))})})}var ts=/^[\w!#$%&'*.^`|~+-]+$/,ns=(e,t,n={})=>{if(!ts.test(e))throw Error(`Invalid cookie name`);let r=`${e}=${t}`;if(e.startsWith(`__Secure-`)&&!n.secure)throw Error(`__Secure- Cookie must have Secure attributes`);if(e.startsWith(`__Host-`)){if(!n.secure)throw Error(`__Host- Cookie must have Secure attributes`);if(n.path!==`/`)throw Error(`__Host- Cookie must have Path attributes with "/"`);if(n.domain)throw Error(`__Host- Cookie must not have Domain attributes`)}for(let e of[`domain`,`path`])if(n[e]&&/[;\r\n]/.test(n[e]))throw Error(`${e} must not contain ";", "\\r", or "\\n"`);if(n&&typeof n.maxAge==`number`&&n.maxAge>=0){if(n.maxAge>3456e4)throw Error(`Cookies Max-Age SHOULD NOT be greater than 400 days (34560000 seconds) in duration.`);r+=`; Max-Age=${n.maxAge|0}`}if(n.domain&&n.prefix!==`host`&&(r+=`; Domain=${n.domain}`),n.path&&(r+=`; Path=${n.path}`),n.expires){if(n.expires.getTime()-Date.now()>3456e7)throw Error(`Cookies Expires SHOULD NOT be greater than 400 days (34560000 seconds) in the future.`);r+=`; Expires=${n.expires.toUTCString()}`}if(n.httpOnly&&(r+=`; HttpOnly`),n.secure&&(r+=`; Secure`),n.sameSite&&(r+=`; SameSite=${n.sameSite.charAt(0).toUpperCase()+n.sameSite.slice(1)}`),n.priority&&(r+=`; Priority=${n.priority.charAt(0).toUpperCase()+n.priority.slice(1)}`),n.partitioned){if(!n.secure)throw Error(`Partitioned Cookie must have Secure attributes`);r+=`; Partitioned`}return r},rs=(e,t,n)=>(t=encodeURIComponent(t),ns(e,t,n)),is=(e,t)=>(e=e.replace(/\/+$/,``),e+=`/`,t=t.replace(/^\/+/,``),e+t),as=(e,t)=>{for(let[n,r]of Object.entries(t)){let t=RegExp(`/:`+n+`(?:{[^/]+})?\\??`);e=e.replace(t,r?`/${r}`:``)}return e},os=e=>{let t=new URLSearchParams;for(let[n,r]of Object.entries(e))if(r!==void 0)if(Array.isArray(r))for(let e of r)t.append(n,e);else t.set(n,r);return t},ss=(e,t)=>{switch(t){case`ws`:return e.replace(/^http/,`ws`);case`http`:return e.replace(/^ws/,`http`)}},cs=e=>/^https?:\/\/[^\/]+?\/index(?=\?|$)/.test(e)?e.replace(/\/index(?=\?|$)/,`/`):e.replace(/\/index(?=\?|$)/,``);function ls(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function us(e,t){if(!ls(e)&&!ls(t))return t;let n={...e};for(let e in t){let r=t[e];ls(n[e])&&ls(r)?n[e]=us(n[e],r):n[e]=r}return n}var ds=(e,t)=>new Proxy(()=>{},{get(n,r){if(!(typeof r!=`string`||r===`then`))return ds(e,[...t,r])},apply(n,r,i){return e({path:t,args:i})}}),fs=class{url;method;buildSearchParams;queryParams=void 0;pathParams={};rBody;cType=void 0;constructor(e,t,n){this.url=e,this.method=t,this.buildSearchParams=n.buildSearchParams}fetch=async(e,t)=>{if(e){if(e.query&&(this.queryParams=this.buildSearchParams(e.query)),e.form){let t=new FormData;for(let[n,r]of Object.entries(e.form))if(r!==void 0)if(Array.isArray(r))for(let e of r)t.append(n,e);else t.append(n,r);this.rBody=t}e.json&&(this.rBody=JSON.stringify(e.json),this.cType=`application/json`),e.param&&(this.pathParams=e.param)}let n=this.method.toUpperCase(),r={...e?.header,...typeof t?.headers==`function`?await t.headers():t?.headers};if(e?.cookie){let t=[];for(let[n,r]of Object.entries(e.cookie))t.push(rs(n,r,{path:`/`}));r.Cookie=t.join(`,`)}this.cType&&(r[`Content-Type`]=this.cType);let i=new Headers(r??void 0),a=this.url;a=cs(a),a=as(a,this.pathParams),this.queryParams&&(a=a+`?`+this.queryParams.toString()),n=this.method.toUpperCase();let o=!(n===`GET`||n===`HEAD`);return(t?.fetch||fetch)(a,{body:o?this.rBody:void 0,method:n,headers:i,...t?.init})}},ps=(e,t)=>ds(function n(r){let i=t?.buildSearchParams??os,a=[...r.path],o=a.slice(-3).reverse();if(o[0]===`toString`)return o[1]===`name`?o[2]||``:n.toString();if(o[0]===`valueOf`)return o[1]===`name`?o[2]||``:n;let s=``;if(/^\$/.test(o[0])){let e=a.pop();e&&(s=e.replace(/^\$/,``))}let c=is(e,a.join(`/`));if(s===`url`||s===`path`){let t=c;return r.args[0]&&(r.args[0].param&&(t=as(c,r.args[0].param)),r.args[0].query&&(t=t+`?`+i(r.args[0].query).toString())),t=cs(t),s===`url`?new URL(t):t.slice(e.replace(/\/+$/,``).length).replace(/^\/?/,`/`)}if(s===`ws`){let e=ss(r.args[0]&&r.args[0].param?as(c,r.args[0].param):c,`ws`),n=new URL(e),i=r.args[0]?.query;return i&&Object.entries(i).forEach(([e,t])=>{Array.isArray(t)?t.forEach(t=>n.searchParams.append(e,t)):n.searchParams.set(e,t)}),((...e)=>t?.webSocket!==void 0&&typeof t.webSocket==`function`?t.webSocket(...e):new WebSocket(...e))(n.toString())}let l=new fs(c,s,{buildSearchParams:i});if(s){t??={};let e=us(t,{...r.args[1]});return l.fetch(r.args[0],e)}return l},[]),ms=`/api`,hs=ps(ms);function gs(e,t){return`${e.endsWith(`/`)?e.slice(0,-1):e}${t.startsWith(`/`)?t:`/${t}`}`}function _s(e){return encodeURIComponent(e)}function vs(e){return gs(ms,e)}async function ys(e){let t=await e.json().catch(()=>({}));if(!e.ok){let n=t,r=n.error?.message?n.error.message:`Request failed with status ${e.status}`;throw Error(r)}return t}async function bs(e,t){let n=new FormData;return n.append(`file`,t),ys(await fetch(vs(`/chats/${_s(e)}/attachments`),{body:n,method:`POST`}))}async function xs(e){return ys(await hs.projects.$post({json:{path:e}}))}async function Ss(e){return ys(await hs.projects[`:projectId`].$delete({param:{projectId:_s(e)}}))}async function Cs(e,t={}){return ys(await hs.projects[`:projectId`].chats.$post({param:{projectId:_s(e)},json:t}))}async function ws(e,t){return ys(await hs.chats[`:chatId`].archive.$post({param:{chatId:_s(e)},json:{archived:t}}))}async function Ts(e,t){return ys(await hs.projects[`:projectId`].worktrees.$delete({param:{projectId:_s(e)},json:t}))}async function Es(e,t){return ys(await hs.projects[`:projectId`].worktrees.sync.$post({param:{projectId:_s(e)},json:t}))}async function Ds(e,t){return ys(await hs.projects[`:projectId`][`recent-skills`].$post({param:{projectId:_s(e)},json:{path:t}}))}async function Os(e,t){return ys(await hs.chats[`:chatId`].messages.$post({param:{chatId:_s(e)},json:t}))}async function ks(e,t){return ys(await hs.chats[`:chatId`].messages[`:messageId`].$delete({param:{chatId:_s(e),messageId:_s(t)}}))}async function As(e,t){return ys(await hs.chats[`:chatId`].messages[`:messageId`].restore.$post({param:{chatId:_s(e),messageId:_s(t.message.id)},json:t}))}async function js(e,t){return ys(await hs.chats[`:chatId`].steer.$post({param:{chatId:_s(e)},json:t}))}async function Ms(e,t){return ys(await hs.chats[`:chatId`].queue.$post({param:{chatId:_s(e)},json:t}))}async function Ns(e){return ys(await hs.chats[`:chatId`].interrupt.$post({param:{chatId:_s(e)}}))}async function Ps(e,t,n){return ys(await hs.chats[`:chatId`].approvals[`:requestId`].$post({param:{chatId:_s(e),requestId:_s(t)},json:{decision:n}}))}var J={auth:[`auth`],models:[`models`],projects:[`projects`],projectChats:e=>[`projects`,e,`chats`],projectGitHubCheckoutTargets:e=>[`projects`,e,`github`,`checkout-targets`],projectRecentSkills:e=>[`projects`,e,`recent-skills`],projectSkills:e=>[`projects`,e,`skills`],projectWorktrees:e=>[`projects`,e,`worktrees`],chat:e=>[`chats`,e],chatApproval:e=>[`chats`,e,`approval`],messages:e=>[`chats`,e,`messages`],chatSkills:e=>[`chats`,e,`skills`],fileSearch:(e,t)=>[`chats`,e,`files`,t]};function Fs(){return Be({queryKey:J.auth,queryFn:async()=>ys(await hs.auth.$get())})}function Is(){return Be({queryKey:J.projects,queryFn:async()=>ys(await hs.projects.$get())})}function Ls(){return Be({queryKey:J.models,queryFn:async()=>ys(await hs.models.$get())})}function Rs(e){return Be({queryKey:J.projectWorktrees(e),queryFn:async()=>ys(await hs.projects[`:projectId`].worktrees.$get({param:{projectId:_s(e)}}))})}function zs(e){return Be({queryKey:J.projectChats(e),queryFn:async()=>ys(await hs.projects[`:projectId`].chats.$get({param:{projectId:_s(e)}}))})}function Bs(e){return Be({queryKey:J.projectGitHubCheckoutTargets(e),queryFn:async()=>ys(await hs.projects[`:projectId`].github[`checkout-targets`].$get({param:{projectId:_s(e)}}))})}function Vs(e,t){return Be({queryKey:J.projectRecentSkills(e),queryFn:async()=>ys(await hs.projects[`:projectId`][`recent-skills`].$get({param:{projectId:_s(e)}},{init:{signal:t}}))})}function Hs(e,t){return Be({queryKey:J.projectSkills(e),queryFn:async()=>ys(await hs.projects[`:projectId`].skills.$get({param:{projectId:_s(e)}},{init:{signal:t}}))})}function Us(e){return Be({queryKey:J.chat(e),queryFn:async()=>ys(await hs.chats[`:chatId`].$get({param:{chatId:_s(e)},query:{}}))})}function Ws(e,t){return Be({queryKey:J.chatApproval(e),queryFn:async()=>ys(await hs.chats[`:chatId`].$get({param:{chatId:_s(e)},query:{context:`approval`}},{init:{signal:t}}))})}function Gs(e){return Be({queryKey:J.messages(e),queryFn:async()=>({messages:Js((await ys(await hs.chats[`:chatId`].messages.$get({param:{chatId:_s(e)}}))).messages)})})}function Ks(e,t){return Be({queryKey:J.chatSkills(e),queryFn:async()=>ys(await hs.chats[`:chatId`].$get({param:{chatId:_s(e)},query:{context:`skills`}},{init:{signal:t}}))})}function qs(e,t,n){return Be({queryKey:J.fileSearch(e,t),queryFn:async()=>ys(await hs.chats[`:chatId`].$get({param:{chatId:_s(e)},query:{fileQuery:t}},{init:{signal:n}}))})}function Js(e){return e.map(Ys)}function Ys(e){if(e.role!==`event`)return e;if(e.eventType===`item/commandExecution/outputDelta`||e.eventType===`command/exec/outputDelta`||e.eventType===`item/fileChange/outputDelta`){let t=Zs(e);return{...e,eventData:Qs(Xs(e.eventData,`text`),t),text:``,textHtml:``}}return e.eventType===`turn/diff/updated`?{...e,eventData:$s(e.eventData)}:e.eventType===`item/fileChange/patchUpdated`?{...e,eventData:ec(e.eventData)}:e}function Xs(e,t){if(!tc(e))return e;let n={...e};return delete n[t],n}function Zs(e){return tc(e.eventData)&&typeof e.eventData.text==`string`?e.eventData.text:e.text}function Qs(e,t){return t?tc(e)?typeof e.hiddenContentDeltaCount==`number`||typeof e.hiddenContentLength==`number`?e:{...e,hiddenContentLength:t.length}:{hiddenContentLength:t.length}:e}function $s(e){if(!tc(e))return e;let t=typeof e.diff==`string`?e.diff:``,n={...e};return delete n.diff,t&&typeof n.hasDiff!=`boolean`&&(n.hasDiff=!0),n}function ec(e){if(!tc(e))return e;let t=e.changes;return Array.isArray(t)?{...e,changes:t.map(e=>Xs(e,`diff`))}:e}function tc(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var nc={default:`border-transparent bg-primary text-primary-foreground`,danger:`border-[var(--semantic-danger-border)] bg-[var(--semantic-danger-bg)] text-[var(--semantic-danger-fg)]`,info:`border-[var(--semantic-info-border)] bg-[var(--semantic-info-bg)] text-[var(--semantic-info-fg)]`,outline:`border-border bg-transparent text-foreground`,secondary:`border-transparent bg-secondary text-secondary-foreground`,success:`border-[var(--semantic-success-border)] bg-[var(--semantic-success-bg)] text-[var(--semantic-success-fg)]`,warning:`border-[var(--semantic-warning-border)] bg-[var(--semantic-warning-bg)] text-[var(--semantic-warning-fg)]`};function rc({className:e,variant:t=`default`,...n}){return(0,z.jsx)(`span`,{className:q(`inline-flex items-center gap-1 rounded-[var(--radius-xs)] border px-2 py-0.5 text-[length:var(--font-size-xs)] font-medium whitespace-nowrap transition-colors`,nc[t],e),...n})}var ic={default:`bg-primary text-primary-foreground shadow-[var(--shadow-xs)] hover:bg-[var(--button-primary-hover-bg)]`,destructive:`bg-destructive text-destructive-foreground shadow-[var(--shadow-xs)] hover:bg-[var(--button-destructive-hover-bg)] focus-visible:ring-[var(--semantic-danger-border)]/40`,ghost:`hover:bg-accent hover:text-accent-foreground`,outline:`border border-input bg-[var(--surface-card)] shadow-[var(--shadow-xs)] hover:bg-accent hover:text-accent-foreground`,secondary:`bg-secondary text-secondary-foreground shadow-[var(--shadow-xs)] hover:bg-[var(--button-secondary-hover-bg)]`},ac={default:`h-9 px-4 py-2`,icon:`size-8`,sm:`h-8 gap-1.5 px-3`};function oc({className:e,size:t=`default`,variant:n=`default`,...r}){return(0,z.jsx)(`button`,{className:q(`inline-flex shrink-0 items-center justify-center gap-2 whitespace-nowrap rounded-[var(--radius-sm)] text-[length:var(--font-size-sm)] font-medium outline-none transition-colors duration-[var(--motion-duration-fast)] ease-[var(--motion-ease-standard)] focus-visible:border-ring focus-visible:shadow-[var(--state-focus-ring)] disabled:pointer-events-none disabled:opacity-[var(--opacity-disabled)] [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0`,ic[n],ac[t],e),...r})}var sc=c(m(),1);function cc({className:e,...t}){return(0,z.jsx)(`input`,{className:q(`flex h-9 w-full min-w-0 rounded-[var(--radius-sm)] border border-input bg-[var(--surface-input)] px-3 py-1 text-[length:var(--font-size-md)] shadow-[var(--shadow-xs)] outline-none transition-[border-color,box-shadow] duration-[var(--motion-duration-fast)] placeholder:text-[var(--text-tertiary)] focus-visible:border-ring focus-visible:shadow-[var(--state-focus-ring)] disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-[var(--opacity-disabled)]`,e),...t})}var lc=4,uc=16,dc=320,fc=256;function pc({"aria-label":e,align:t=`start`,className:n,disabled:r=!1,emptyMessage:i=`No results`,icon:a,isLoading:o=!1,onQueryChange:s,onValueChange:c,options:l,placeholder:u,query:d,searchPlaceholder:f=`Search`,shouldFilter:p=!0,side:m=`bottom`,triggerClassName:h,value:g}){let[_,v]=(0,R.useState)(!1),[y,b]=(0,R.useState)(-1),[x,S]=(0,R.useState)(``),[C,w]=(0,R.useState)({}),T=(0,R.useRef)(null),E=(0,R.useRef)(null),D=(0,R.useRef)(null),O=(0,R.useRef)(null),k=(0,R.useId)(),A=d??x,j=l.find(e=>e.value===g),M=(0,R.useMemo)(()=>{if(!p||!A.trim())return l;let e=A.trim().toLowerCase();return l.filter(t=>[t.label,t.description,...t.keywords??[]].filter(Boolean).join(` `).toLowerCase().includes(e))},[l,A,p]);(0,R.useEffect)(()=>{if(!_)return;let e=e=>{let t=e.target;!T.current?.contains(t)&&!O.current?.contains(t)&&v(!1)},t=e=>{e.key===`Escape`&&v(!1)};return document.addEventListener(`pointerdown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`pointerdown`,e),document.removeEventListener(`keydown`,t)}},[_]),(0,R.useEffect)(()=>{!_&&d===void 0&&S(``)},[_,d]),(0,R.useLayoutEffect)(()=>{if(!_)return;let e=()=>{let e=T.current,n=O.current;if(!e||!n)return;let r=window.visualViewport,i=r?.offsetLeft??0,a=r?.offsetTop??0,o=r?.width??window.innerWidth,s=r?.height??window.innerHeight,c=e.getBoundingClientRect(),l=Math.max(0,o-uc*2),u=Math.max(0,s-uc*2),d=Math.min(dc,l),f=u,p=E.current?.getBoundingClientRect().height??0,h=D.current?Math.min(D.current.scrollHeight,fc):0,g=Math.min(p+h,f),_=i+uc,v=i+o-uc-d,y=a+uc,b=a+s-uc-g,x=t===`end`?c.right-d:c.left,S=m===`top`?c.top-lc-g:c.bottom+lc,C={left:hc(x,_,Math.max(_,v)),maxHeight:f,top:hc(S,y,Math.max(y,b)),width:d};w(e=>gc(e,C)?e:C)};e();let n=typeof ResizeObserver>`u`?null:new ResizeObserver(e),r=O.current;return r&&n?.observe(r),E.current&&n?.observe(E.current),D.current&&n?.observe(D.current),window.addEventListener(`resize`,e),window.addEventListener(`scroll`,e,!0),window.visualViewport?.addEventListener(`resize`,e),window.visualViewport?.addEventListener(`scroll`,e),()=>{window.removeEventListener(`resize`,e),window.removeEventListener(`scroll`,e,!0),window.visualViewport?.removeEventListener(`resize`,e),window.visualViewport?.removeEventListener(`scroll`,e),n?.disconnect()}},[t,i,M,o,_,m]),(0,R.useEffect)(()=>{if(!_){b(-1);return}b(mc(M,-1,1))},[M,_]);function ee(e){s?s(e):S(e)}function N(e){e.disabled||(c(e.value),v(!1),ee(``))}function te(e){if(e.key===`ArrowDown`){e.preventDefault(),b(e=>mc(M,e,1));return}if(e.key===`ArrowUp`){e.preventDefault(),b(e=>mc(M,e,-1));return}if(e.key===`Home`){e.preventDefault(),b(mc(M,-1,1));return}if(e.key===`End`){e.preventDefault(),b(mc(M,M.length,-1));return}if(e.key===`Enter`&&(e.preventDefault(),y>=0)){let e=M[y];if(!e)return;N(e)}}let P=_&&typeof document<`u`?(0,sc.createPortal)((0,z.jsx)(`div`,{className:`fixed z-50 flex overflow-hidden rounded-[var(--radius-md)] border border-border bg-popover text-popover-foreground shadow-[var(--shadow-md)]`,ref:O,style:C,children:(0,z.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:[(0,z.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2 border-b border-[var(--border-divider)] px-2 py-2`,ref:E,children:[(0,z.jsx)(Ro,{className:`size-3.5 shrink-0 text-[var(--icon-color-muted)]`}),(0,z.jsx)(cc,{"aria-activedescendant":y>=0?`${k}-option-${y}`:void 0,"aria-autocomplete":`list`,"aria-controls":k,autoFocus:!0,className:`h-7 border-0 bg-transparent px-0 py-0 shadow-none focus-visible:shadow-none`,placeholder:f,value:A,onChange:e=>ee(e.target.value),onKeyDown:te}),o&&(0,z.jsx)(Ao,{"aria-hidden":`true`,className:`size-3.5 shrink-0 animate-spin text-[var(--icon-color-muted)]`})]}),(0,z.jsx)(`div`,{className:`min-h-0 max-h-64 flex-1 overflow-y-auto p-1`,id:k,ref:D,role:`listbox`,children:M.length===0?(0,z.jsx)(`div`,{className:`px-2 py-3 text-[length:var(--font-size-sm)] text-[var(--text-tertiary)]`,children:i}):M.map((e,t)=>{let n=e.value===g;return(0,z.jsxs)(`button`,{"aria-selected":n,className:q(`flex w-full min-w-0 items-start gap-2 rounded-[var(--radius-sm)] px-2 py-2 text-left outline-none transition-colors hover:bg-accent focus-visible:shadow-[var(--state-focus-ring)] disabled:pointer-events-none disabled:opacity-[var(--opacity-disabled)]`,(t===y||n)&&`bg-[var(--state-selected-bg)]`),disabled:e.disabled,id:`${k}-option-${t}`,onClick:()=>N(e),onMouseEnter:()=>b(t),role:`option`,type:`button`,children:[(0,z.jsx)(mo,{className:q(`mt-0.5 size-3.5 shrink-0 text-[var(--icon-color-active)]`,!n&&`opacity-0`)}),(0,z.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,z.jsx)(`span`,{className:`block truncate text-[length:var(--font-size-sm)] font-medium text-[var(--text-primary)]`,children:e.label}),e.description&&(0,z.jsx)(`span`,{className:`mt-0.5 block truncate text-[length:var(--font-size-xs)] text-[var(--text-tertiary)]`,children:e.description})]})]},e.value)})})]})}),document.body):null;return(0,z.jsxs)(`div`,{className:q(`relative min-w-0`,n),ref:T,children:[(0,z.jsxs)(`button`,{"aria-controls":k,"aria-expanded":_,"aria-label":e,className:q(`inline-flex h-8 max-w-full items-center gap-1.5 rounded-[var(--radius-sm)] border border-input bg-[var(--surface-card)] px-2.5 text-[length:var(--font-size-sm)] font-medium text-[var(--text-secondary)] shadow-[var(--shadow-xs)] outline-none transition-colors hover:bg-accent focus-visible:border-ring focus-visible:shadow-[var(--state-focus-ring)] disabled:pointer-events-none disabled:opacity-[var(--opacity-disabled)]`,h),disabled:r,onClick:()=>v(e=>!e),role:`combobox`,type:`button`,children:[o?(0,z.jsx)(Ao,{"aria-hidden":`true`,className:`size-3.5 shrink-0 animate-spin text-[var(--icon-color-muted)]`}):a,(0,z.jsx)(`span`,{className:`min-w-0 truncate`,children:j?.label??u}),(0,z.jsx)(go,{className:`size-3.5 shrink-0 text-[var(--icon-color-muted)]`})]}),P]})}function mc(e,t,n){if(e.length===0)return-1;let r=t;for(let t=0;t<e.length;t+=1)if(r=(r+n+e.length)%e.length,!e[r]?.disabled)return r;return-1}function hc(e,t,n){return Math.min(Math.max(e,t),n)}function gc(e,t){return e.left===t.left&&e.maxHeight===t.maxHeight&&e.top===t.top&&e.width===t.width}var _c=[`a[href]`,`button:not([disabled])`,`input:not([disabled])`,`select:not([disabled])`,`textarea:not([disabled])`,`[tabindex]:not([tabindex='-1'])`].join(`,`);function vc({children:e,onOpenChange:t,open:n}){let r=(0,R.useRef)(null);(0,R.useEffect)(()=>{if(!n)return;let e=document.activeElement;return wc(r.current)[0]?.focus(),()=>{e instanceof HTMLElement&&e.focus()}},[n]);function i(e){if(e.key===`Escape`){e.preventDefault(),t(!1);return}if(e.key!==`Tab`)return;let n=wc(r.current);if(n.length===0){e.preventDefault();return}let i=n[0],a=n[n.length-1];!i||!a||(e.shiftKey&&document.activeElement===i&&(e.preventDefault(),a.focus()),!e.shiftKey&&document.activeElement===a&&(e.preventDefault(),i.focus()))}return n?(0,z.jsxs)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center p-4`,onKeyDown:i,children:[(0,z.jsx)(`button`,{"aria-label":`Close dialog`,className:`absolute inset-0 bg-[var(--surface-overlay)]`,onClick:()=>t(!1),tabIndex:-1,type:`button`}),(0,z.jsx)(`div`,{ref:r,className:`contents`,children:e})]}):null}function yc({className:e,...t}){return(0,z.jsx)(`div`,{className:q(`relative z-10 grid w-full max-w-md gap-4 rounded-[var(--radius-lg)] border border-border bg-card p-5 text-card-foreground shadow-[var(--shadow-lg)]`,e),"aria-modal":`true`,role:`dialog`,...t})}function bc({className:e,...t}){return(0,z.jsx)(`div`,{className:q(`grid gap-1.5`,e),...t})}function xc({className:e,...t}){return(0,z.jsx)(`h2`,{className:q(`text-[length:var(--font-size-xl)] font-semibold leading-none`,e),...t})}function Sc({className:e,...t}){return(0,z.jsx)(`p`,{className:q(`text-[length:var(--font-size-md)] text-muted-foreground`,e),...t})}function Cc({className:e,...t}){return(0,z.jsx)(`div`,{className:q(`flex justify-end gap-2`,e),...t})}function wc(e){return e?Array.from(e.querySelectorAll(_c)).filter(e=>!e.hasAttribute(`disabled`)&&e.getAttribute(`aria-hidden`)!==`true`):[]}typeof window<`u`&&window.document&&window.document.createElement;function Y(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),n===!1||!r.defaultPrevented)return t?.(r)}}function Tc(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function Ec(...e){return t=>{let n=!1,r=e.map(e=>{let r=Tc(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():Tc(e[t],null)}}}}function Dc(...e){return R.useCallback(Ec(...e),e)}function Oc(e,t=[]){let n=[];function r(t,r){let i=R.createContext(r),a=n.length;n=[...n,r];let o=t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,c=R.useMemo(()=>o,Object.values(o));return(0,z.jsx)(s.Provider,{value:c,children:r})};o.displayName=t+`Provider`;function s(n,o){let s=o?.[e]?.[a]||i,c=R.useContext(s);if(c)return c;if(r!==void 0)return r;throw Error(`\`${n}\` must be used within \`${t}\``)}return[o,s]}let i=()=>{let t=n.map(e=>R.createContext(e));return function(n){let r=n?.[e]||t;return R.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])}};return i.scopeName=e,[r,kc(i,...t)]}function kc(...e){let t=e[0];if(e.length===1)return t;let n=()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return R.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])}};return n.scopeName=t.scopeName,n}var Ac=globalThis?.document?R.useLayoutEffect:()=>{},jc=R.useInsertionEffect||Ac;function Mc({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){let[i,a,o]=Nc({defaultProp:t,onChange:n}),s=e!==void 0,c=s?e:i;{let t=R.useRef(e!==void 0);R.useEffect(()=>{let e=t.current;e!==s&&console.warn(`${r} is changing from ${e?`controlled`:`uncontrolled`} to ${s?`controlled`:`uncontrolled`}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),t.current=s},[s,r])}return[c,R.useCallback(t=>{if(s){let n=Pc(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}function Nc({defaultProp:e,onChange:t}){let[n,r]=R.useState(e),i=R.useRef(n),a=R.useRef(t);return jc(()=>{a.current=t},[t]),R.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}function Pc(e){return typeof e==`function`}function Fc(e){let t=Ic(e),n=R.forwardRef((e,n)=>{let{children:r,...i}=e,a=R.Children.toArray(r),o=a.find(Rc);if(o){let e=o.props.children,r=a.map(t=>t===o?R.Children.count(e)>1?R.Children.only(null):R.isValidElement(e)?e.props.children:null:t);return(0,z.jsx)(t,{...i,ref:n,children:R.isValidElement(e)?R.cloneElement(e,void 0,r):null})}return(0,z.jsx)(t,{...i,ref:n,children:r})});return n.displayName=`${e}.Slot`,n}function Ic(e){let t=R.forwardRef((e,t)=>{let{children:n,...r}=e;if(R.isValidElement(n)){let e=Bc(n),i=zc(r,n.props);return n.type!==R.Fragment&&(i.ref=t?Ec(t,e):e),R.cloneElement(n,i)}return R.Children.count(n)>1?R.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Lc=Symbol(`radix.slottable`);function Rc(e){return R.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===Lc}function zc(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}function Bc(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Vc=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=Fc(`Primitive.${t}`),r=R.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,z.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Hc(e,t){e&&sc.flushSync(()=>e.dispatchEvent(t))}function Uc(e){let t=e+`CollectionProvider`,[n,r]=Oc(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=e=>{let{scope:t,children:n}=e,r=R.useRef(null),a=R.useRef(new Map).current;return(0,z.jsx)(i,{scope:t,itemMap:a,collectionRef:r,children:n})};o.displayName=t;let s=e+`CollectionSlot`,c=Fc(s),l=R.forwardRef((e,t)=>{let{scope:n,children:r}=e;return(0,z.jsx)(c,{ref:Dc(t,a(s,n).collectionRef),children:r})});l.displayName=s;let u=e+`CollectionItemSlot`,d=`data-radix-collection-item`,f=Fc(u),p=R.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=R.useRef(null),s=Dc(t,o),c=a(u,n);return R.useEffect(()=>(c.itemMap.set(o,{ref:o,...i}),()=>void c.itemMap.delete(o))),(0,z.jsx)(f,{[d]:``,ref:s,children:r})});p.displayName=u;function m(t){let n=a(e+`CollectionConsumer`,t);return R.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${d}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])}return[{Provider:o,Slot:l,ItemSlot:p},m,r]}var Wc=R.createContext(void 0);function Gc(e){let t=R.useContext(Wc);return e||t||`ltr`}function Kc(e){let t=R.useRef(e);return R.useEffect(()=>{t.current=e}),R.useMemo(()=>(...e)=>t.current?.(...e),[])}function qc(e,t=globalThis?.document){let n=Kc(e);R.useEffect(()=>{let e=e=>{e.key===`Escape`&&n(e)};return t.addEventListener(`keydown`,e,{capture:!0}),()=>t.removeEventListener(`keydown`,e,{capture:!0})},[n,t])}var Jc=`DismissableLayer`,Yc=`dismissableLayer.update`,Xc=`dismissableLayer.pointerDownOutside`,Zc=`dismissableLayer.focusOutside`,Qc,$c=R.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),el=R.forwardRef((e,t)=>{let{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:a,onInteractOutside:o,onDismiss:s,...c}=e,l=R.useContext($c),[u,d]=R.useState(null),f=u?.ownerDocument??globalThis?.document,[,p]=R.useState({}),m=Dc(t,e=>d(e)),h=Array.from(l.layers),[g]=[...l.layersWithOutsidePointerEventsDisabled].slice(-1),_=h.indexOf(g),v=u?h.indexOf(u):-1,y=l.layersWithOutsidePointerEventsDisabled.size>0,b=v>=_,x=rl(e=>{let t=e.target,n=[...l.branches].some(e=>e.contains(t));!b||n||(i?.(e),o?.(e),e.defaultPrevented||s?.())},f),S=il(e=>{let t=e.target;[...l.branches].some(e=>e.contains(t))||(a?.(e),o?.(e),e.defaultPrevented||s?.())},f);return qc(e=>{v===l.layers.size-1&&(r?.(e),!e.defaultPrevented&&s&&(e.preventDefault(),s()))},f),R.useEffect(()=>{if(u)return n&&(l.layersWithOutsidePointerEventsDisabled.size===0&&(Qc=f.body.style.pointerEvents,f.body.style.pointerEvents=`none`),l.layersWithOutsidePointerEventsDisabled.add(u)),l.layers.add(u),al(),()=>{n&&l.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=Qc)}},[u,f,n,l]),R.useEffect(()=>()=>{u&&(l.layers.delete(u),l.layersWithOutsidePointerEventsDisabled.delete(u),al())},[u,l]),R.useEffect(()=>{let e=()=>p({});return document.addEventListener(Yc,e),()=>document.removeEventListener(Yc,e)},[]),(0,z.jsx)(Vc.div,{...c,ref:m,style:{pointerEvents:y?b?`auto`:`none`:void 0,...e.style},onFocusCapture:Y(e.onFocusCapture,S.onFocusCapture),onBlurCapture:Y(e.onBlurCapture,S.onBlurCapture),onPointerDownCapture:Y(e.onPointerDownCapture,x.onPointerDownCapture)})});el.displayName=Jc;var tl=`DismissableLayerBranch`,nl=R.forwardRef((e,t)=>{let n=R.useContext($c),r=R.useRef(null),i=Dc(t,r);return R.useEffect(()=>{let e=r.current;if(e)return n.branches.add(e),()=>{n.branches.delete(e)}},[n.branches]),(0,z.jsx)(Vc.div,{...e,ref:i})});nl.displayName=tl;function rl(e,t=globalThis?.document){let n=Kc(e),r=R.useRef(!1),i=R.useRef(()=>{});return R.useEffect(()=>{let e=e=>{if(e.target&&!r.current){let r=function(){ol(Xc,n,a,{discrete:!0})},a={originalEvent:e};e.pointerType===`touch`?(t.removeEventListener(`click`,i.current),i.current=r,t.addEventListener(`click`,i.current,{once:!0})):r()}else t.removeEventListener(`click`,i.current);r.current=!1},a=window.setTimeout(()=>{t.addEventListener(`pointerdown`,e)},0);return()=>{window.clearTimeout(a),t.removeEventListener(`pointerdown`,e),t.removeEventListener(`click`,i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function il(e,t=globalThis?.document){let n=Kc(e),r=R.useRef(!1);return R.useEffect(()=>{let e=e=>{e.target&&!r.current&&ol(Zc,n,{originalEvent:e},{discrete:!1})};return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function al(){let e=new CustomEvent(Yc);document.dispatchEvent(e)}function ol(e,t,n,{discrete:r}){let i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?Hc(i,a):i.dispatchEvent(a)}var sl=0;function cl(){R.useEffect(()=>{let e=document.querySelectorAll(`[data-radix-focus-guard]`);return document.body.insertAdjacentElement(`afterbegin`,e[0]??ll()),document.body.insertAdjacentElement(`beforeend`,e[1]??ll()),sl++,()=>{sl===1&&document.querySelectorAll(`[data-radix-focus-guard]`).forEach(e=>e.remove()),sl--}},[])}function ll(){let e=document.createElement(`span`);return e.setAttribute(`data-radix-focus-guard`,``),e.tabIndex=0,e.style.outline=`none`,e.style.opacity=`0`,e.style.position=`fixed`,e.style.pointerEvents=`none`,e}var ul=`focusScope.autoFocusOnMount`,dl=`focusScope.autoFocusOnUnmount`,fl={bubbles:!1,cancelable:!0},pl=`FocusScope`,ml=R.forwardRef((e,t)=>{let{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[s,c]=R.useState(null),l=Kc(i),u=Kc(a),d=R.useRef(null),f=Dc(t,e=>c(e)),p=R.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;R.useEffect(()=>{if(r){let e=function(e){if(p.paused||!s)return;let t=e.target;s.contains(t)?d.current=t:xl(d.current,{select:!0})},t=function(e){if(p.paused||!s)return;let t=e.relatedTarget;t!==null&&(s.contains(t)||xl(d.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&xl(s)};document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return s&&r.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[r,s,p.paused]),R.useEffect(()=>{if(s){Sl.add(p);let e=document.activeElement;if(!s.contains(e)){let t=new CustomEvent(ul,fl);s.addEventListener(ul,l),s.dispatchEvent(t),t.defaultPrevented||(hl(Tl(_l(s)),{select:!0}),document.activeElement===e&&xl(s))}return()=>{s.removeEventListener(ul,l),setTimeout(()=>{let t=new CustomEvent(dl,fl);s.addEventListener(dl,u),s.dispatchEvent(t),t.defaultPrevented||xl(e??document.body,{select:!0}),s.removeEventListener(dl,u),Sl.remove(p)},0)}}},[s,l,u,p]);let m=R.useCallback(e=>{if(!n&&!r||p.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,i=document.activeElement;if(t&&i){let t=e.currentTarget,[r,a]=gl(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&xl(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&xl(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,p.paused]);return(0,z.jsx)(Vc.div,{tabIndex:-1,...o,ref:f,onKeyDown:m})});ml.displayName=pl;function hl(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(xl(r,{select:t}),document.activeElement!==n)return}function gl(e){let t=_l(e);return[vl(t,e),vl(t.reverse(),e)]}function _l(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function vl(e,t){for(let n of e)if(!yl(n,{upTo:t}))return n}function yl(e,{upTo:t}){if(getComputedStyle(e).visibility===`hidden`)return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display===`none`)return!0;e=e.parentElement}return!1}function bl(e){return e instanceof HTMLInputElement&&`select`in e}function xl(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&bl(e)&&t&&e.select()}}var Sl=Cl();function Cl(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=wl(e,t),e.unshift(t)},remove(t){e=wl(e,t),e[0]?.resume()}}}function wl(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function Tl(e){return e.filter(e=>e.tagName!==`A`)}var El=R.useId||(()=>void 0),Dl=0;function Ol(e){let[t,n]=R.useState(El());return Ac(()=>{e||n(e=>e??String(Dl++))},[e]),e||(t?`radix-${t}`:``)}var kl=[`top`,`right`,`bottom`,`left`],Al=Math.min,jl=Math.max,Ml=Math.round,Nl=Math.floor,Pl=e=>({x:e,y:e}),Fl={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function Il(e,t,n){return jl(e,Al(t,n))}function X(e,t){return typeof e==`function`?e(t):e}function Z(e){return e.split(`-`)[0]}function Q(e){return e.split(`-`)[1]}function Ll(e){return e===`x`?`y`:`x`}function Rl(e){return e===`y`?`height`:`width`}function zl(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function Bl(e){return Ll(zl(e))}function Vl(e,t,n){n===void 0&&(n=!1);let r=Q(e),i=Bl(e),a=Rl(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=Xl(o)),[o,Xl(o)]}function Hl(e){let t=Xl(e);return[Ul(e),t,Ul(t)]}function Ul(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var Wl=[`left`,`right`],Gl=[`right`,`left`],Kl=[`top`,`bottom`],ql=[`bottom`,`top`];function Jl(e,t,n){switch(e){case`top`:case`bottom`:return n?t?Gl:Wl:t?Wl:Gl;case`left`:case`right`:return t?Kl:ql;default:return[]}}function Yl(e,t,n,r){let i=Q(e),a=Jl(Z(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(Ul)))),a}function Xl(e){let t=Z(e);return Fl[t]+e.slice(t.length)}function Zl(e){return{top:0,right:0,bottom:0,left:0,...e}}function Ql(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:Zl(e)}function $l(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function eu(e,t,n){let{reference:r,floating:i}=e,a=zl(t),o=Bl(t),s=Rl(o),c=Z(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}switch(Q(t)){case`start`:p[o]-=f*(n&&l?-1:1);break;case`end`:p[o]+=f*(n&&l?-1:1);break}return p}async function tu(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=X(t,e),p=Ql(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=$l(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=$l(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var nu=50,ru=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:tu},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=eu(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<nu&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=eu(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},iu=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=X(e,t)||{};if(l==null)return{};let d=Ql(u),f={x:n,y:r},p=Bl(i),m=Rl(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;(!C||!await(o.isElement==null?void 0:o.isElement(S)))&&(C=s.floating[y]||a.floating[m]);let w=b/2-x/2,T=C/2-h[m]/2-1,E=Al(d[_],T),D=Al(d[v],T),O=E,k=C-h[m]-D,A=C/2-h[m]/2+w,j=Il(O,A,k),M=!c.arrow&&Q(i)!=null&&A!==j&&a.reference[m]/2-(A<O?E:D)-h[m]/2<0,ee=M?A<O?A-O:A-k:0;return{[p]:f[p]+ee,data:{[p]:j,centerOffset:A-j-ee,...M&&{alignmentOffset:ee}},reset:M}}}),au=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=X(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=Z(r),_=zl(o),v=Z(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[Xl(o)]:Hl(o)),x=p!==`none`;!d&&x&&b.push(...Yl(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=Vl(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(!(u===`alignment`&&_!==zl(t))||T.every(e=>zl(e.placement)===_?e.overflows[0]>0:!0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=zl(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o;break}if(r!==n)return{reset:{placement:n}}}return{}}}};function ou(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function su(e){return kl.some(t=>e[t]>=0)}var cu=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=X(e,t);switch(i){case`referenceHidden`:{let e=ou(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:su(e)}}}case`escaped`:{let e=ou(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:su(e)}}}default:return{}}}}},lu=new Set([`left`,`top`]);async function uu(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=Z(n),s=Q(n),c=zl(n)===`y`,l=lu.has(o)?-1:1,u=a&&c?-1:1,d=X(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var du=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await uu(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},fu=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=X(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=zl(Z(i)),p=Ll(f),m=u[p],h=u[f];if(o){let e=p===`y`?`top`:`left`,t=p===`y`?`bottom`:`right`,n=m+d[e],r=m-d[t];m=Il(n,m,r)}if(s){let e=f===`y`?`top`:`left`,t=f===`y`?`bottom`:`right`,n=h+d[e],r=h-d[t];h=Il(n,h,r)}let g=c.fn({...t,[p]:m,[f]:h});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[p]:o,[f]:s}}}}}},pu=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=X(e,t),u={x:n,y:r},d=zl(i),f=Ll(d),p=u[f],m=u[d],h=X(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=lu.has(Z(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},mu=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){var n,r;let{placement:i,rects:a,platform:o,elements:s}=t,{apply:c=()=>{},...l}=X(e,t),u=await o.detectOverflow(t,l),d=Z(i),f=Q(i),p=zl(i)===`y`,{width:m,height:h}=a.floating,g,_;d===`top`||d===`bottom`?(g=d,_=f===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?`start`:`end`)?`left`:`right`):(_=d,g=f===`end`?`top`:`bottom`);let v=h-u.top-u.bottom,y=m-u.left-u.right,b=Al(h-u[g],v),x=Al(m-u[_],y),S=!t.middlewareData.shift,C=b,w=x;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(w=y),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(C=v),S&&!f){let e=jl(u.left,0),t=jl(u.right,0),n=jl(u.top,0),r=jl(u.bottom,0);p?w=m-2*(e!==0||t!==0?e+t:jl(u.left,u.right)):C=h-2*(n!==0||r!==0?n+r:jl(u.top,u.bottom))}await c({...t,availableWidth:w,availableHeight:C});let T=await o.getDimensions(s.floating);return m!==T.width||h!==T.height?{reset:{rects:!0}}:{}}}};function hu(){return typeof window<`u`}function gu(e){return yu(e)?(e.nodeName||``).toLowerCase():`#document`}function _u(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function vu(e){return((yu(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function yu(e){return hu()?e instanceof Node||e instanceof _u(e).Node:!1}function bu(e){return hu()?e instanceof Element||e instanceof _u(e).Element:!1}function xu(e){return hu()?e instanceof HTMLElement||e instanceof _u(e).HTMLElement:!1}function Su(e){return!hu()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof _u(e).ShadowRoot}function Cu(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=Pu(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function wu(e){return/^(table|td|th)$/.test(gu(e))}function Tu(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var Eu=/transform|translate|scale|rotate|perspective|filter/,Du=/paint|layout|strict|content/,Ou=e=>!!e&&e!==`none`,ku;function Au(e){let t=bu(e)?Pu(e):e;return Ou(t.transform)||Ou(t.translate)||Ou(t.scale)||Ou(t.rotate)||Ou(t.perspective)||!Mu()&&(Ou(t.backdropFilter)||Ou(t.filter))||Eu.test(t.willChange||``)||Du.test(t.contain||``)}function ju(e){let t=Iu(e);for(;xu(t)&&!Nu(t);){if(Au(t))return t;if(Tu(t))return null;t=Iu(t)}return null}function Mu(){return ku??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),ku}function Nu(e){return/^(html|body|#document)$/.test(gu(e))}function Pu(e){return _u(e).getComputedStyle(e)}function Fu(e){return bu(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Iu(e){if(gu(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||Su(e)&&e.host||vu(e);return Su(t)?t.host:t}function Lu(e){let t=Iu(e);return Nu(t)?e.ownerDocument?e.ownerDocument.body:e.body:xu(t)&&Cu(t)?t:Lu(t)}function Ru(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=Lu(e),i=r===e.ownerDocument?.body,a=_u(r);if(i){let e=zu(a);return t.concat(a,a.visualViewport||[],Cu(r)?r:[],e&&n?Ru(e):[])}else return t.concat(r,Ru(r,[],n))}function zu(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Bu(e){let t=Pu(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=xu(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=Ml(n)!==a||Ml(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function Vu(e){return bu(e)?e:e.contextElement}function Hu(e){let t=Vu(e);if(!xu(t))return Pl(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=Bu(t),o=(a?Ml(n.width):n.width)/r,s=(a?Ml(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var Uu=Pl(0);function Wu(e){let t=_u(e);return!Mu()||!t.visualViewport?Uu:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Gu(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==_u(e)?!1:t}function Ku(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=Vu(e),o=Pl(1);t&&(r?bu(r)&&(o=Hu(r)):o=Hu(e));let s=Gu(a,n,r)?Wu(a):Pl(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a){let e=_u(a),t=r&&bu(r)?_u(r):r,n=e,i=zu(n);for(;i&&r&&t!==n;){let e=Hu(i),t=i.getBoundingClientRect(),r=Pu(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=_u(i),i=zu(n)}}return $l({width:u,height:d,x:c,y:l})}function qu(e,t){let n=Fu(e).scrollLeft;return t?t.left+n:Ku(vu(e)).left+n}function Ju(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-qu(e,n),y:n.top+t.scrollTop}}function Yu(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=vu(r),s=t?Tu(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=Pl(1),u=Pl(0),d=xu(r);if((d||!d&&!a)&&((gu(r)!==`body`||Cu(o))&&(c=Fu(r)),d)){let e=Ku(r);l=Hu(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?Ju(o,c):Pl(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function Xu(e){return Array.from(e.getClientRects())}function Zu(e){let t=vu(e),n=Fu(e),r=e.ownerDocument.body,i=jl(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=jl(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),o=-n.scrollLeft+qu(e),s=-n.scrollTop;return Pu(r).direction===`rtl`&&(o+=jl(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}var Qu=25;function $u(e,t){let n=_u(e),r=vu(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;let e=Mu();(!e||e&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}let l=qu(r);if(l<=0){let e=r.ownerDocument,t=e.body,n=getComputedStyle(t),i=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,o=Math.abs(r.clientWidth-t.clientWidth-i);o<=Qu&&(a-=o)}else l<=Qu&&(a+=l);return{width:a,height:o,x:s,y:c}}function ed(e,t){let n=Ku(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=xu(e)?Hu(e):Pl(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function td(e,t,n){let r;if(t===`viewport`)r=$u(e,n);else if(t===`document`)r=Zu(vu(e));else if(bu(t))r=ed(t,n);else{let n=Wu(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return $l(r)}function nd(e,t){let n=Iu(e);return n===t||!bu(n)||Nu(n)?!1:Pu(n).position===`fixed`||nd(n,t)}function rd(e,t){let n=t.get(e);if(n)return n;let r=Ru(e,[],!1).filter(e=>bu(e)&&gu(e)!==`body`),i=null,a=Pu(e).position===`fixed`,o=a?Iu(e):e;for(;bu(o)&&!Nu(o);){let t=Pu(o),n=Au(o);!n&&t.position===`fixed`&&(i=null),(a?!n&&!i:!n&&t.position===`static`&&i&&(i.position===`absolute`||i.position===`fixed`)||Cu(o)&&!n&&nd(e,o))?r=r.filter(e=>e!==o):i=t,o=Iu(o)}return t.set(e,r),r}function id(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?Tu(t)?[]:rd(t,this._c):[].concat(n),r],o=td(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=td(t,a[e],i);s=jl(n.top,s),c=Al(n.right,c),l=Al(n.bottom,l),u=jl(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function ad(e){let{width:t,height:n}=Bu(e);return{width:t,height:n}}function od(e,t,n){let r=xu(t),i=vu(t),a=n===`fixed`,o=Ku(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=Pl(0);function l(){c.x=qu(i)}if(r||!r&&!a)if((gu(t)!==`body`||Cu(i))&&(s=Fu(t)),r){let e=Ku(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else i&&l();a&&!r&&i&&l();let u=i&&!r&&!a?Ju(i,s):Pl(0);return{x:o.left+s.scrollLeft-c.x-u.x,y:o.top+s.scrollTop-c.y-u.y,width:o.width,height:o.height}}function sd(e){return Pu(e).position===`static`}function cd(e,t){if(!xu(e)||Pu(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return vu(e)===n&&(n=n.ownerDocument.body),n}function ld(e,t){let n=_u(e);if(Tu(e))return n;if(!xu(e)){let t=Iu(e);for(;t&&!Nu(t);){if(bu(t)&&!sd(t))return t;t=Iu(t)}return n}let r=cd(e,t);for(;r&&wu(r)&&sd(r);)r=cd(r,t);return r&&Nu(r)&&sd(r)&&!Au(r)?n:r||ju(e)||n}var ud=async function(e){let t=this.getOffsetParent||ld,n=this.getDimensions,r=await n(e.floating);return{reference:od(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function dd(e){return Pu(e).direction===`rtl`}var fd={convertOffsetParentRelativeRectToViewportRelativeRect:Yu,getDocumentElement:vu,getClippingRect:id,getOffsetParent:ld,getElementRects:ud,getClientRects:Xu,getDimensions:ad,getScale:Hu,isElement:bu,isRTL:dd};function pd(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function md(e,t){let n=null,r,i=vu(e);function a(){var e;clearTimeout(r),(e=n)==null||e.disconnect(),n=null}function o(s,c){s===void 0&&(s=!1),c===void 0&&(c=1),a();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(s||t(),!f||!p)return;let m=Nl(d),h=Nl(i.clientWidth-(u+f)),g=Nl(i.clientHeight-(d+p)),_=Nl(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:jl(0,Al(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(n!==c){if(!y)return o();n?o(!1,n):r=setTimeout(()=>{o(!1,1e-7)},1e3)}n===1&&!pd(l,e.getBoundingClientRect())&&o(),y=!1}try{n=new IntersectionObserver(b,{...v,root:i.ownerDocument})}catch{n=new IntersectionObserver(b,v)}n.observe(e)}return o(!0),a}function hd(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=Vu(e),u=i||a?[...l?Ru(l):[],...t?Ru(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n,{passive:!0}),a&&e.addEventListener(`resize`,n)});let d=l&&s?md(l,n):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?Ku(e):null;c&&g();function g(){let t=Ku(e);h&&!pd(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var gd=du,_d=fu,vd=au,$=mu,yd=cu,bd=iu,xd=pu,Sd=(e,t,n)=>{let r=new Map,i={platform:fd,...n},a={...i.platform,_c:r};return ru(e,t,{...i,platform:a})},Cd=typeof document<`u`?R.useLayoutEffect:function(){};function wd(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!wd(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!wd(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function Td(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Ed(e,t){let n=Td(e);return Math.round(t*n)/n}function Dd(e){let t=R.useRef(e);return Cd(()=>{t.current=e}),t}function Od(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=R.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=R.useState(r);wd(f,r)||p(r);let[m,h]=R.useState(null),[g,_]=R.useState(null),v=R.useCallback(e=>{e!==S.current&&(S.current=e,h(e))},[]),y=R.useCallback(e=>{e!==C.current&&(C.current=e,_(e))},[]),b=a||m,x=o||g,S=R.useRef(null),C=R.useRef(null),w=R.useRef(u),T=c!=null,E=Dd(c),D=Dd(i),O=Dd(l),k=R.useCallback(()=>{if(!S.current||!C.current)return;let e={placement:t,strategy:n,middleware:f};D.current&&(e.platform=D.current),Sd(S.current,C.current,e).then(e=>{let t={...e,isPositioned:O.current!==!1};A.current&&!wd(w.current,t)&&(w.current=t,sc.flushSync(()=>{d(t)}))})},[f,t,n,D,O]);Cd(()=>{l===!1&&w.current.isPositioned&&(w.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let A=R.useRef(!1);Cd(()=>(A.current=!0,()=>{A.current=!1}),[]),Cd(()=>{if(b&&(S.current=b),x&&(C.current=x),b&&x){if(E.current)return E.current(b,x,k);k()}},[b,x,k,E,T]);let j=R.useMemo(()=>({reference:S,floating:C,setReference:v,setFloating:y}),[v,y]),M=R.useMemo(()=>({reference:b,floating:x}),[b,x]),ee=R.useMemo(()=>{let e={position:n,left:0,top:0};if(!M.floating)return e;let t=Ed(M.floating,u.x),r=Ed(M.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...Td(M.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,M.floating,u.x,u.y]);return R.useMemo(()=>({...u,update:k,refs:j,elements:M,floatingStyles:ee}),[u,k,j,M,ee])}var kd=e=>{function t(e){return{}.hasOwnProperty.call(e,`current`)}return{name:`arrow`,options:e,fn(n){let{element:r,padding:i}=typeof e==`function`?e(n):e;return r&&t(r)?r.current==null?{}:bd({element:r.current,padding:i}).fn(n):r?bd({element:r,padding:i}).fn(n):{}}}},Ad=(e,t)=>{let n=gd(e);return{name:n.name,fn:n.fn,options:[e,t]}},jd=(e,t)=>{let n=_d(e);return{name:n.name,fn:n.fn,options:[e,t]}},Md=(e,t)=>({fn:xd(e).fn,options:[e,t]}),Nd=(e,t)=>{let n=vd(e);return{name:n.name,fn:n.fn,options:[e,t]}},Pd=(e,t)=>{let n=$(e);return{name:n.name,fn:n.fn,options:[e,t]}},Fd=(e,t)=>{let n=yd(e);return{name:n.name,fn:n.fn,options:[e,t]}},Id=(e,t)=>{let n=kd(e);return{name:n.name,fn:n.fn,options:[e,t]}},Ld=`Arrow`,Rd=R.forwardRef((e,t)=>{let{children:n,width:r=10,height:i=5,...a}=e;return(0,z.jsx)(Vc.svg,{...a,ref:t,width:r,height:i,viewBox:`0 0 30 10`,preserveAspectRatio:`none`,children:e.asChild?n:(0,z.jsx)(`polygon`,{points:`0,0 30,0 15,10`})})});Rd.displayName=Ld;var zd=Rd;function Bd(e){let[t,n]=R.useState(void 0);return Ac(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{if(!Array.isArray(t)||!t.length)return;let r=t[0],i,a;if(`borderBoxSize`in r){let e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;i=t.inlineSize,a=t.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return t.observe(e,{box:`border-box`}),()=>t.unobserve(e)}else n(void 0)},[e]),t}var Vd=`Popper`,[Hd,Ud]=Oc(Vd),[Wd,Gd]=Hd(Vd),Kd=e=>{let{__scopePopper:t,children:n}=e,[r,i]=R.useState(null);return(0,z.jsx)(Wd,{scope:t,anchor:r,onAnchorChange:i,children:n})};Kd.displayName=Vd;var qd=`PopperAnchor`,Jd=R.forwardRef((e,t)=>{let{__scopePopper:n,virtualRef:r,...i}=e,a=Gd(qd,n),o=R.useRef(null),s=Dc(t,o),c=R.useRef(null);return R.useEffect(()=>{let e=c.current;c.current=r?.current||o.current,e!==c.current&&a.onAnchorChange(c.current)}),r?null:(0,z.jsx)(Vc.div,{...i,ref:s})});Jd.displayName=qd;var Yd=`PopperContent`,[Xd,Zd]=Hd(Yd),Qd=R.forwardRef((e,t)=>{let{__scopePopper:n,side:r=`bottom`,sideOffset:i=0,align:a=`center`,alignOffset:o=0,arrowPadding:s=0,avoidCollisions:c=!0,collisionBoundary:l=[],collisionPadding:u=0,sticky:d=`partial`,hideWhenDetached:f=!1,updatePositionStrategy:p=`optimized`,onPlaced:m,...h}=e,g=Gd(Yd,n),[_,v]=R.useState(null),y=Dc(t,e=>v(e)),[b,x]=R.useState(null),S=Bd(b),C=S?.width??0,w=S?.height??0,T=r+(a===`center`?``:`-`+a),E=typeof u==`number`?u:{top:0,right:0,bottom:0,left:0,...u},D=Array.isArray(l)?l:[l],O=D.length>0,k={padding:E,boundary:D.filter(nf),altBoundary:O},{refs:A,floatingStyles:j,placement:M,isPositioned:ee,middlewareData:N}=Od({strategy:`fixed`,placement:T,whileElementsMounted:(...e)=>hd(...e,{animationFrame:p===`always`}),elements:{reference:g.anchor},middleware:[Ad({mainAxis:i+w,alignmentAxis:o}),c&&jd({mainAxis:!0,crossAxis:!1,limiter:d===`partial`?Md():void 0,...k}),c&&Nd({...k}),Pd({...k,apply:({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:a}=t.reference,o=e.floating.style;o.setProperty(`--radix-popper-available-width`,`${n}px`),o.setProperty(`--radix-popper-available-height`,`${r}px`),o.setProperty(`--radix-popper-anchor-width`,`${i}px`),o.setProperty(`--radix-popper-anchor-height`,`${a}px`)}}),b&&Id({element:b,padding:s}),rf({arrowWidth:C,arrowHeight:w}),f&&Fd({strategy:`referenceHidden`,...k})]}),[te,P]=af(M),F=Kc(m);Ac(()=>{ee&&F?.()},[ee,F]);let ne=N.arrow?.x,re=N.arrow?.y,ie=N.arrow?.centerOffset!==0,[ae,I]=R.useState();return Ac(()=>{_&&I(window.getComputedStyle(_).zIndex)},[_]),(0,z.jsx)(`div`,{ref:A.setFloating,"data-radix-popper-content-wrapper":``,style:{...j,transform:ee?j.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:ae,"--radix-popper-transform-origin":[N.transformOrigin?.x,N.transformOrigin?.y].join(` `),...N.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,z.jsx)(Xd,{scope:n,placedSide:te,onArrowChange:x,arrowX:ne,arrowY:re,shouldHideArrow:ie,children:(0,z.jsx)(Vc.div,{"data-side":te,"data-align":P,...h,ref:y,style:{...h.style,animation:ee?void 0:`none`}})})})});Qd.displayName=Yd;var $d=`PopperArrow`,ef={top:`bottom`,right:`left`,bottom:`top`,left:`right`},tf=R.forwardRef(function(e,t){let{__scopePopper:n,...r}=e,i=Zd($d,n),a=ef[i.placedSide];return(0,z.jsx)(`span`,{ref:i.onArrowChange,style:{position:`absolute`,left:i.arrowX,top:i.arrowY,[a]:0,transformOrigin:{top:``,right:`0 0`,bottom:`center 0`,left:`100% 0`}[i.placedSide],transform:{top:`translateY(100%)`,right:`translateY(50%) rotate(90deg) translateX(-50%)`,bottom:`rotate(180deg)`,left:`translateY(50%) rotate(-90deg) translateX(50%)`}[i.placedSide],visibility:i.shouldHideArrow?`hidden`:void 0},children:(0,z.jsx)(zd,{...r,ref:t,style:{...r.style,display:`block`}})})});tf.displayName=$d;function nf(e){return e!==null}var rf=e=>({name:`transformOrigin`,options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,o=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[c,l]=af(n),u={start:`0%`,center:`50%`,end:`100%`}[l],d=(i.arrow?.x??0)+o/2,f=(i.arrow?.y??0)+s/2,p=``,m=``;return c===`bottom`?(p=a?u:`${d}px`,m=`${-s}px`):c===`top`?(p=a?u:`${d}px`,m=`${r.floating.height+s}px`):c===`right`?(p=`${-s}px`,m=a?u:`${f}px`):c===`left`&&(p=`${r.floating.width+s}px`,m=a?u:`${f}px`),{data:{x:p,y:m}}}});function af(e){let[t,n=`center`]=e.split(`-`);return[t,n]}var of=Kd,sf=Jd,cf=Qd,lf=tf,uf=`Portal`,df=R.forwardRef((e,t)=>{let{container:n,...r}=e,[i,a]=R.useState(!1);Ac(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?sc.createPortal((0,z.jsx)(Vc.div,{...r,ref:t}),o):null});df.displayName=uf;function ff(e,t){return R.useReducer((e,n)=>t[e][n]??e,e)}var pf=e=>{let{present:t,children:n}=e,r=mf(t),i=typeof n==`function`?n({present:r.isPresent}):R.Children.only(n),a=Dc(r.ref,gf(i));return typeof n==`function`||r.isPresent?R.cloneElement(i,{ref:a}):null};pf.displayName=`Presence`;function mf(e){let[t,n]=R.useState(),r=R.useRef(null),i=R.useRef(e),a=R.useRef(`none`),[o,s]=ff(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return R.useEffect(()=>{let e=hf(r.current);a.current=o===`mounted`?e:`none`},[o]),Ac(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,o=hf(t);e?s(`MOUNT`):o===`none`||t?.display===`none`?s(`UNMOUNT`):s(n&&r!==o?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,s]),Ac(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=a=>{let o=hf(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(s(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},c=e=>{e.target===t&&(a.current=hf(r.current))};return t.addEventListener(`animationstart`,c),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,c),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}else s(`ANIMATION_END`)},[t,s]),{isPresent:[`mounted`,`unmountSuspended`].includes(o),ref:R.useCallback(e=>{r.current=e?getComputedStyle(e):null,n(e)},[])}}function hf(e){return e?.animationName||`none`}function gf(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var _f=`rovingFocusGroup.onEntryFocus`,vf={bubbles:!1,cancelable:!0},yf=`RovingFocusGroup`,[bf,xf,Sf]=Uc(yf),[Cf,wf]=Oc(yf,[Sf]),[Tf,Ef]=Cf(yf),Df=R.forwardRef((e,t)=>(0,z.jsx)(bf.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,z.jsx)(bf.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,z.jsx)(Of,{...e,ref:t})})}));Df.displayName=yf;var Of=R.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:a,currentTabStopId:o,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:c,onEntryFocus:l,preventScrollOnEntryFocus:u=!1,...d}=e,f=R.useRef(null),p=Dc(t,f),m=Gc(a),[h,g]=Mc({prop:o,defaultProp:s??null,onChange:c,caller:yf}),[_,v]=R.useState(!1),y=Kc(l),b=xf(n),x=R.useRef(!1),[S,C]=R.useState(0);return R.useEffect(()=>{let e=f.current;if(e)return e.addEventListener(_f,y),()=>e.removeEventListener(_f,y)},[y]),(0,z.jsx)(Tf,{scope:n,orientation:r,dir:m,loop:i,currentTabStopId:h,onItemFocus:R.useCallback(e=>g(e),[g]),onItemShiftTab:R.useCallback(()=>v(!0),[]),onFocusableItemAdd:R.useCallback(()=>C(e=>e+1),[]),onFocusableItemRemove:R.useCallback(()=>C(e=>e-1),[]),children:(0,z.jsx)(Vc.div,{tabIndex:_||S===0?-1:0,"data-orientation":r,...d,ref:p,style:{outline:`none`,...e.style},onMouseDown:Y(e.onMouseDown,()=>{x.current=!0}),onFocus:Y(e.onFocus,e=>{let t=!x.current;if(e.target===e.currentTarget&&t&&!_){let t=new CustomEvent(_f,vf);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=b().filter(e=>e.focusable);Pf([e.find(e=>e.active),e.find(e=>e.id===h),...e].filter(Boolean).map(e=>e.ref.current),u)}}x.current=!1}),onBlur:Y(e.onBlur,()=>v(!1))})})}),kf=`RovingFocusGroupItem`,Af=R.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:a,children:o,...s}=e,c=Ol(),l=a||c,u=Ef(kf,n),d=u.currentTabStopId===l,f=xf(n),{onFocusableItemAdd:p,onFocusableItemRemove:m,currentTabStopId:h}=u;return R.useEffect(()=>{if(r)return p(),()=>m()},[r,p,m]),(0,z.jsx)(bf.ItemSlot,{scope:n,id:l,focusable:r,active:i,children:(0,z.jsx)(Vc.span,{tabIndex:d?0:-1,"data-orientation":u.orientation,...s,ref:t,onMouseDown:Y(e.onMouseDown,e=>{r?u.onItemFocus(l):e.preventDefault()}),onFocus:Y(e.onFocus,()=>u.onItemFocus(l)),onKeyDown:Y(e.onKeyDown,e=>{if(e.key===`Tab`&&e.shiftKey){u.onItemShiftTab();return}if(e.target!==e.currentTarget)return;let t=Nf(e,u.orientation,u.dir);if(t!==void 0){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let n=f().filter(e=>e.focusable).map(e=>e.ref.current);if(t===`last`)n.reverse();else if(t===`prev`||t===`next`){t===`prev`&&n.reverse();let r=n.indexOf(e.currentTarget);n=u.loop?Ff(n,r+1):n.slice(r+1)}setTimeout(()=>Pf(n))}}),children:typeof o==`function`?o({isCurrentTabStop:d,hasTabStop:h!=null}):o})})});Af.displayName=kf;var jf={ArrowLeft:`prev`,ArrowUp:`prev`,ArrowRight:`next`,ArrowDown:`next`,PageUp:`first`,Home:`first`,PageDown:`last`,End:`last`};function Mf(e,t){return t===`rtl`?e===`ArrowLeft`?`ArrowRight`:e===`ArrowRight`?`ArrowLeft`:e:e}function Nf(e,t,n){let r=Mf(e.key,n);if(!(t===`vertical`&&[`ArrowLeft`,`ArrowRight`].includes(r))&&!(t===`horizontal`&&[`ArrowUp`,`ArrowDown`].includes(r)))return jf[r]}function Pf(e,t=!1){let n=document.activeElement;for(let r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function Ff(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var If=Df,Lf=Af,Rf=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},zf=new WeakMap,Bf=new WeakMap,Vf={},Hf=0,Uf=function(e){return e&&(e.host||Uf(e.parentNode))},Wf=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=Uf(t);return n&&e.contains(n)?n:(console.error(`aria-hidden`,t,`in not contained inside`,e,`. Doing nothing`),null)}).filter(function(e){return!!e})},Gf=function(e,t,n,r){var i=Wf(t,Array.isArray(e)?e:[e]);Vf[n]||(Vf[n]=new WeakMap);var a=Vf[n],o=[],s=new Set,c=new Set(i),l=function(e){!e||s.has(e)||(s.add(e),l(e.parentNode))};i.forEach(l);var u=function(e){!e||c.has(e)||Array.prototype.forEach.call(e.children,function(e){if(s.has(e))u(e);else try{var t=e.getAttribute(r),i=t!==null&&t!==`false`,c=(zf.get(e)||0)+1,l=(a.get(e)||0)+1;zf.set(e,c),a.set(e,l),o.push(e),c===1&&i&&Bf.set(e,!0),l===1&&e.setAttribute(n,`true`),i||e.setAttribute(r,`true`)}catch(t){console.error(`aria-hidden: cannot operate on `,e,t)}})};return u(t),s.clear(),Hf++,function(){o.forEach(function(e){var t=zf.get(e)-1,i=a.get(e)-1;zf.set(e,t),a.set(e,i),t||(Bf.has(e)||e.removeAttribute(r),Bf.delete(e)),i||e.removeAttribute(n)}),Hf--,Hf||(zf=new WeakMap,zf=new WeakMap,Bf=new WeakMap,Vf={})}},Kf=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||Rf(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),Gf(r,i,n,`aria-hidden`)):function(){return null}},qf=function(){return qf=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},qf.apply(this,arguments)};function Jf(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function Yf(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var Xf=`right-scroll-bar-position`,Zf=`width-before-scroll-bar`,Qf=`with-scroll-bars-hidden`,$f=`--removed-body-scroll-bar-size`;function ep(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function tp(e,t){var n=(0,R.useState)(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=t,n.facade}var np=typeof window<`u`?R.useLayoutEffect:R.useEffect,rp=new WeakMap;function ip(e,t){var n=tp(t||null,function(t){return e.forEach(function(e){return ep(e,t)})});return np(function(){var t=rp.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||ep(e,null)}),i.forEach(function(e){r.has(e)||ep(e,a)})}rp.set(n,e)},[e]),n}function ap(e){return e}function op(e,t){t===void 0&&(t=ap);var n=[],r=!1;return{read:function(){if(r)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var i=t(e,r);return n.push(i),function(){n=n.filter(function(e){return e!==i})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var i=n;n=[],i.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},o=function(){return Promise.resolve().then(a)};o(),n={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),n}}}}}function sp(e){e===void 0&&(e={});var t=op(null);return t.options=qf({async:!0,ssr:!1},e),t}var cp=function(e){var t=e.sideCar,n=Jf(e,[`sideCar`]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error(`Sidecar medium not found`);return R.createElement(r,qf({},n))};cp.isSideCarExport=!0;function lp(e,t){return e.useMedium(t),cp}var up=sp(),dp=function(){},fp=R.forwardRef(function(e,t){var n=R.useRef(null),r=R.useState({onScrollCapture:dp,onWheelCapture:dp,onTouchMoveCapture:dp}),i=r[0],a=r[1],o=e.forwardProps,s=e.children,c=e.className,l=e.removeScrollBar,u=e.enabled,d=e.shards,f=e.sideCar,p=e.noRelative,m=e.noIsolation,h=e.inert,g=e.allowPinchZoom,_=e.as,v=_===void 0?`div`:_,y=e.gapMode,b=Jf(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),x=f,S=ip([n,t]),C=qf(qf({},b),i);return R.createElement(R.Fragment,null,u&&R.createElement(x,{sideCar:up,removeScrollBar:l,shards:d,noRelative:p,noIsolation:m,inert:h,setCallbacks:a,allowPinchZoom:!!g,lockRef:n,gapMode:y}),o?R.cloneElement(R.Children.only(s),qf(qf({},C),{ref:S})):R.createElement(v,qf({},C,{className:c,ref:S}),s))});fp.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},fp.classNames={fullWidth:Zf,zeroRight:Xf};var pp,mp=function(){if(pp)return pp;if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function hp(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=mp();return t&&e.setAttribute(`nonce`,t),e}function gp(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function _p(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var vp=function(){var e=0,t=null;return{add:function(n){e==0&&(t=hp())&&(gp(t,n),_p(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},yp=function(){var e=vp();return function(t,n){R.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},bp=function(){var e=yp();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},xp={left:0,top:0,right:0,gap:0},Sp=function(e){return parseInt(e||``,10)||0},Cp=function(e){var t=window.getComputedStyle(document.body),n=t[e===`padding`?`paddingLeft`:`marginLeft`],r=t[e===`padding`?`paddingTop`:`marginTop`],i=t[e===`padding`?`paddingRight`:`marginRight`];return[Sp(n),Sp(r),Sp(i)]},wp=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return xp;var t=Cp(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},Tp=bp(),Ep=`data-scroll-locked`,Dp=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
|
|
13
|
+
.${Qf} {
|
|
14
|
+
overflow: hidden ${r};
|
|
15
|
+
padding-right: ${s}px ${r};
|
|
16
|
+
}
|
|
17
|
+
body[${Ep}] {
|
|
18
|
+
overflow: hidden ${r};
|
|
19
|
+
overscroll-behavior: contain;
|
|
20
|
+
${[t&&`position: relative ${r};`,n===`margin`&&`
|
|
21
|
+
padding-left: ${i}px;
|
|
22
|
+
padding-top: ${a}px;
|
|
23
|
+
padding-right: ${o}px;
|
|
24
|
+
margin-left:0;
|
|
25
|
+
margin-top:0;
|
|
26
|
+
margin-right: ${s}px ${r};
|
|
27
|
+
`,n===`padding`&&`padding-right: ${s}px ${r};`].filter(Boolean).join(``)}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.${Xf} {
|
|
31
|
+
right: ${s}px ${r};
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.${Zf} {
|
|
35
|
+
margin-right: ${s}px ${r};
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.${Xf} .${Xf} {
|
|
39
|
+
right: 0 ${r};
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.${Zf} .${Zf} {
|
|
43
|
+
margin-right: 0 ${r};
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
body[${Ep}] {
|
|
47
|
+
${$f}: ${s}px;
|
|
48
|
+
}
|
|
49
|
+
`},Op=function(){var e=parseInt(document.body.getAttribute(`data-scroll-locked`)||`0`,10);return isFinite(e)?e:0},kp=function(){R.useEffect(function(){return document.body.setAttribute(Ep,(Op()+1).toString()),function(){var e=Op()-1;e<=0?document.body.removeAttribute(Ep):document.body.setAttribute(Ep,e.toString())}},[])},Ap=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?`margin`:r;kp();var a=R.useMemo(function(){return wp(i)},[i]);return R.createElement(Tp,{styles:Dp(a,!t,i,n?``:`!important`)})},jp=!1;if(typeof window<`u`)try{var Mp=Object.defineProperty({},`passive`,{get:function(){return jp=!0,!0}});window.addEventListener(`test`,Mp,Mp),window.removeEventListener(`test`,Mp,Mp)}catch{jp=!1}var Np=jp?{passive:!1}:!1,Pp=function(e){return e.tagName===`TEXTAREA`},Fp=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!==`hidden`&&!(n.overflowY===n.overflowX&&!Pp(e)&&n[t]===`visible`)},Ip=function(e){return Fp(e,`overflowY`)},Lp=function(e){return Fp(e,`overflowX`)},Rp=function(e,t){var n=t.ownerDocument,r=t;do{if(typeof ShadowRoot<`u`&&r instanceof ShadowRoot&&(r=r.host),Vp(e,r)){var i=Hp(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},zp=function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]},Bp=function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]},Vp=function(e,t){return e===`v`?Ip(t):Lp(t)},Hp=function(e,t){return e===`v`?zp(t):Bp(t)},Up=function(e,t){return e===`h`&&t===`rtl`?-1:1},Wp=function(e,t,n,r,i){var a=Up(e,window.getComputedStyle(t).direction),o=a*r,s=n.target,c=t.contains(s),l=!1,u=o>0,d=0,f=0;do{if(!s)break;var p=Hp(e,s),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&Vp(e,s)&&(d+=h,f+=m);var g=s.parentNode;s=g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE?g.host:g}while(!c&&s!==document.body||c&&(t.contains(s)||t===s));return(u&&(i&&Math.abs(d)<1||!i&&o>d)||!u&&(i&&Math.abs(f)<1||!i&&-o>f))&&(l=!0),l},Gp=function(e){return`changedTouches`in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Kp=function(e){return[e.deltaX,e.deltaY]},qp=function(e){return e&&`current`in e?e.current:e},Jp=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Yp=function(e){return`
|
|
50
|
+
.block-interactivity-${e} {pointer-events: none;}
|
|
51
|
+
.allow-interactivity-${e} {pointer-events: all;}
|
|
52
|
+
`},Xp=0,Zp=[];function Qp(e){var t=R.useRef([]),n=R.useRef([0,0]),r=R.useRef(),i=R.useState(Xp++)[0],a=R.useState(bp)[0],o=R.useRef(e);R.useEffect(function(){o.current=e},[e]),R.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=Yf([e.lockRef.current],(e.shards||[]).map(qp),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add(`allow-interactivity-${i}`)}),function(){document.body.classList.remove(`block-interactivity-${i}`),t.forEach(function(e){return e.classList.remove(`allow-interactivity-${i}`)})}}},[e.inert,e.lockRef.current,e.shards]);var s=R.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!o.current.allowPinchZoom;var i=Gp(e),a=n.current,s=`deltaX`in e?e.deltaX:a[0]-i[0],c=`deltaY`in e?e.deltaY:a[1]-i[1],l,u=e.target,d=Math.abs(s)>Math.abs(c)?`h`:`v`;if(`touches`in e&&d===`h`&&u.type===`range`)return!1;var f=window.getSelection(),p=f&&f.anchorNode;if(p&&(p===u||p.contains(u)))return!1;var m=Rp(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=Rp(d,u)),!m)return!1;if(!r.current&&`changedTouches`in e&&(s||c)&&(r.current=l),!l)return!0;var h=r.current||l;return Wp(h,t,e,h===`h`?s:c,!0)},[]),c=R.useCallback(function(e){var n=e;if(!(!Zp.length||Zp[Zp.length-1]!==a)){var r=`deltaY`in n?Kp(n):Gp(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&Jp(e.delta,r)})[0];if(i&&i.should){n.cancelable&&n.preventDefault();return}if(!i){var c=(o.current.shards||[]).map(qp).filter(Boolean).filter(function(e){return e.contains(n.target)});(c.length>0?s(n,c[0]):!o.current.noIsolation)&&n.cancelable&&n.preventDefault()}}},[]),l=R.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:$p(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),u=R.useCallback(function(e){n.current=Gp(e),r.current=void 0},[]),d=R.useCallback(function(t){l(t.type,Kp(t),t.target,s(t,e.lockRef.current))},[]),f=R.useCallback(function(t){l(t.type,Gp(t),t.target,s(t,e.lockRef.current))},[]);R.useEffect(function(){return Zp.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener(`wheel`,c,Np),document.addEventListener(`touchmove`,c,Np),document.addEventListener(`touchstart`,u,Np),function(){Zp=Zp.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,c,Np),document.removeEventListener(`touchmove`,c,Np),document.removeEventListener(`touchstart`,u,Np)}},[]);var p=e.removeScrollBar,m=e.inert;return R.createElement(R.Fragment,null,m?R.createElement(a,{styles:Yp(i)}):null,p?R.createElement(Ap,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function $p(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var em=lp(up,Qp),tm=R.forwardRef(function(e,t){return R.createElement(fp,qf({},e,{ref:t,sideCar:em}))});tm.classNames=fp.classNames;var nm=[`Enter`,` `],rm=[`ArrowDown`,`PageUp`,`Home`],im=[`ArrowUp`,`PageDown`,`End`],am=[...rm,...im],om={ltr:[...nm,`ArrowRight`],rtl:[...nm,`ArrowLeft`]},sm={ltr:[`ArrowLeft`],rtl:[`ArrowRight`]},cm=`Menu`,[lm,um,dm]=Uc(cm),[fm,pm]=Oc(cm,[dm,Ud,wf]),mm=Ud(),hm=wf(),[gm,_m]=fm(cm),[vm,ym]=fm(cm),bm=e=>{let{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:a,modal:o=!0}=e,s=mm(t),[c,l]=R.useState(null),u=R.useRef(!1),d=Kc(a),f=Gc(i);return R.useEffect(()=>{let e=()=>{u.current=!0,document.addEventListener(`pointerdown`,t,{capture:!0,once:!0}),document.addEventListener(`pointermove`,t,{capture:!0,once:!0})},t=()=>u.current=!1;return document.addEventListener(`keydown`,e,{capture:!0}),()=>{document.removeEventListener(`keydown`,e,{capture:!0}),document.removeEventListener(`pointerdown`,t,{capture:!0}),document.removeEventListener(`pointermove`,t,{capture:!0})}},[]),(0,z.jsx)(of,{...s,children:(0,z.jsx)(gm,{scope:t,open:n,onOpenChange:d,content:c,onContentChange:l,children:(0,z.jsx)(vm,{scope:t,onClose:R.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:u,dir:f,modal:o,children:r})})})};bm.displayName=cm;var xm=`MenuAnchor`,Sm=R.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e,i=mm(n);return(0,z.jsx)(sf,{...i,...r,ref:t})});Sm.displayName=xm;var Cm=`MenuPortal`,[wm,Tm]=fm(Cm,{forceMount:void 0}),Em=e=>{let{__scopeMenu:t,forceMount:n,children:r,container:i}=e,a=_m(Cm,t);return(0,z.jsx)(wm,{scope:t,forceMount:n,children:(0,z.jsx)(pf,{present:n||a.open,children:(0,z.jsx)(df,{asChild:!0,container:i,children:r})})})};Em.displayName=Cm;var Dm=`MenuContent`,[Om,km]=fm(Dm),Am=R.forwardRef((e,t)=>{let n=Tm(Dm,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=_m(Dm,e.__scopeMenu),o=ym(Dm,e.__scopeMenu);return(0,z.jsx)(lm.Provider,{scope:e.__scopeMenu,children:(0,z.jsx)(pf,{present:r||a.open,children:(0,z.jsx)(lm.Slot,{scope:e.__scopeMenu,children:o.modal?(0,z.jsx)(jm,{...i,ref:t}):(0,z.jsx)(Mm,{...i,ref:t})})})})}),jm=R.forwardRef((e,t)=>{let n=_m(Dm,e.__scopeMenu),r=R.useRef(null),i=Dc(t,r);return R.useEffect(()=>{let e=r.current;if(e)return Kf(e)},[]),(0,z.jsx)(Pm,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:Y(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),Mm=R.forwardRef((e,t)=>{let n=_m(Dm,e.__scopeMenu);return(0,z.jsx)(Pm,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),Nm=Fc(`MenuContent.ScrollLock`),Pm=R.forwardRef((e,t)=>{let{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:a,onCloseAutoFocus:o,disableOutsidePointerEvents:s,onEntryFocus:c,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:p,disableOutsideScroll:m,...h}=e,g=_m(Dm,n),_=ym(Dm,n),v=mm(n),y=hm(n),b=um(n),[x,S]=R.useState(null),C=R.useRef(null),w=Dc(t,C,g.onContentChange),T=R.useRef(0),E=R.useRef(``),D=R.useRef(0),O=R.useRef(null),k=R.useRef(`right`),A=R.useRef(0),j=m?tm:R.Fragment,M=m?{as:Nm,allowPinchZoom:!0}:void 0,ee=e=>{let t=E.current+e,n=b().filter(e=>!e.disabled),r=document.activeElement,i=n.find(e=>e.ref.current===r)?.textValue,a=vh(n.map(e=>e.textValue),t,i),o=n.find(e=>e.textValue===a)?.ref.current;(function e(t){E.current=t,window.clearTimeout(T.current),t!==``&&(T.current=window.setTimeout(()=>e(``),1e3))})(t),o&&setTimeout(()=>o.focus())};R.useEffect(()=>()=>window.clearTimeout(T.current),[]),cl();let N=R.useCallback(e=>k.current===O.current?.side&&bh(e,O.current?.area),[]);return(0,z.jsx)(Om,{scope:n,searchRef:E,onItemEnter:R.useCallback(e=>{N(e)&&e.preventDefault()},[N]),onItemLeave:R.useCallback(e=>{N(e)||(C.current?.focus(),S(null))},[N]),onTriggerLeave:R.useCallback(e=>{N(e)&&e.preventDefault()},[N]),pointerGraceTimerRef:D,onPointerGraceIntentChange:R.useCallback(e=>{O.current=e},[]),children:(0,z.jsx)(j,{...M,children:(0,z.jsx)(ml,{asChild:!0,trapped:i,onMountAutoFocus:Y(a,e=>{e.preventDefault(),C.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:(0,z.jsx)(el,{asChild:!0,disableOutsidePointerEvents:s,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:p,children:(0,z.jsx)(If,{asChild:!0,...y,dir:_.dir,orientation:`vertical`,loop:r,currentTabStopId:x,onCurrentTabStopIdChange:S,onEntryFocus:Y(c,e=>{_.isUsingKeyboardRef.current||e.preventDefault()}),preventScrollOnEntryFocus:!0,children:(0,z.jsx)(cf,{role:`menu`,"aria-orientation":`vertical`,"data-state":ph(g.open),"data-radix-menu-content":``,dir:_.dir,...v,...h,ref:w,style:{outline:`none`,...h.style},onKeyDown:Y(h.onKeyDown,e=>{let t=e.target.closest(`[data-radix-menu-content]`)===e.currentTarget,n=e.ctrlKey||e.altKey||e.metaKey,r=e.key.length===1;t&&(e.key===`Tab`&&e.preventDefault(),!n&&r&&ee(e.key));let i=C.current;if(e.target!==i||!am.includes(e.key))return;e.preventDefault();let a=b().filter(e=>!e.disabled).map(e=>e.ref.current);im.includes(e.key)&&a.reverse(),gh(a)}),onBlur:Y(e.onBlur,e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(T.current),E.current=``)}),onPointerMove:Y(e.onPointerMove,xh(e=>{let t=e.target,n=A.current!==e.clientX;e.currentTarget.contains(t)&&n&&(k.current=e.clientX>A.current?`right`:`left`,A.current=e.clientX)}))})})})})})})});Am.displayName=Dm;var Fm=`MenuGroup`,Im=R.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,z.jsx)(Vc.div,{role:`group`,...r,ref:t})});Im.displayName=Fm;var Lm=`MenuLabel`,Rm=R.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,z.jsx)(Vc.div,{...r,ref:t})});Rm.displayName=Lm;var zm=`MenuItem`,Bm=`menu.itemSelect`,Vm=R.forwardRef((e,t)=>{let{disabled:n=!1,onSelect:r,...i}=e,a=R.useRef(null),o=ym(zm,e.__scopeMenu),s=km(zm,e.__scopeMenu),c=Dc(t,a),l=R.useRef(!1),u=()=>{let e=a.current;if(!n&&e){let t=new CustomEvent(Bm,{bubbles:!0,cancelable:!0});e.addEventListener(Bm,e=>r?.(e),{once:!0}),Hc(e,t),t.defaultPrevented?l.current=!1:o.onClose()}};return(0,z.jsx)(Hm,{...i,ref:c,disabled:n,onClick:Y(e.onClick,u),onPointerDown:t=>{e.onPointerDown?.(t),l.current=!0},onPointerUp:Y(e.onPointerUp,e=>{l.current||e.currentTarget?.click()}),onKeyDown:Y(e.onKeyDown,e=>{let t=s.searchRef.current!==``;n||t&&e.key===` `||nm.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())})})});Vm.displayName=zm;var Hm=R.forwardRef((e,t)=>{let{__scopeMenu:n,disabled:r=!1,textValue:i,...a}=e,o=km(zm,n),s=hm(n),c=R.useRef(null),l=Dc(t,c),[u,d]=R.useState(!1),[f,p]=R.useState(``);return R.useEffect(()=>{let e=c.current;e&&p((e.textContent??``).trim())},[a.children]),(0,z.jsx)(lm.ItemSlot,{scope:n,disabled:r,textValue:i??f,children:(0,z.jsx)(Lf,{asChild:!0,...s,focusable:!r,children:(0,z.jsx)(Vc.div,{role:`menuitem`,"data-highlighted":u?``:void 0,"aria-disabled":r||void 0,"data-disabled":r?``:void 0,...a,ref:l,onPointerMove:Y(e.onPointerMove,xh(e=>{r?o.onItemLeave(e):(o.onItemEnter(e),e.defaultPrevented||e.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Y(e.onPointerLeave,xh(e=>o.onItemLeave(e))),onFocus:Y(e.onFocus,()=>d(!0)),onBlur:Y(e.onBlur,()=>d(!1))})})})}),Um=`MenuCheckboxItem`,Wm=R.forwardRef((e,t)=>{let{checked:n=!1,onCheckedChange:r,...i}=e;return(0,z.jsx)(Qm,{scope:e.__scopeMenu,checked:n,children:(0,z.jsx)(Vm,{role:`menuitemcheckbox`,"aria-checked":mh(n)?`mixed`:n,...i,ref:t,"data-state":hh(n),onSelect:Y(i.onSelect,()=>r?.(mh(n)?!0:!n),{checkForDefaultPrevented:!1})})})});Wm.displayName=Um;var Gm=`MenuRadioGroup`,[Km,qm]=fm(Gm,{value:void 0,onValueChange:()=>{}}),Jm=R.forwardRef((e,t)=>{let{value:n,onValueChange:r,...i}=e,a=Kc(r);return(0,z.jsx)(Km,{scope:e.__scopeMenu,value:n,onValueChange:a,children:(0,z.jsx)(Im,{...i,ref:t})})});Jm.displayName=Gm;var Ym=`MenuRadioItem`,Xm=R.forwardRef((e,t)=>{let{value:n,...r}=e,i=qm(Ym,e.__scopeMenu),a=n===i.value;return(0,z.jsx)(Qm,{scope:e.__scopeMenu,checked:a,children:(0,z.jsx)(Vm,{role:`menuitemradio`,"aria-checked":a,...r,ref:t,"data-state":hh(a),onSelect:Y(r.onSelect,()=>i.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});Xm.displayName=Ym;var Zm=`MenuItemIndicator`,[Qm,$m]=fm(Zm,{checked:!1}),eh=R.forwardRef((e,t)=>{let{__scopeMenu:n,forceMount:r,...i}=e,a=$m(Zm,n);return(0,z.jsx)(pf,{present:r||mh(a.checked)||a.checked===!0,children:(0,z.jsx)(Vc.span,{...i,ref:t,"data-state":hh(a.checked)})})});eh.displayName=Zm;var th=`MenuSeparator`,nh=R.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,z.jsx)(Vc.div,{role:`separator`,"aria-orientation":`horizontal`,...r,ref:t})});nh.displayName=th;var rh=`MenuArrow`,ih=R.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e,i=mm(n);return(0,z.jsx)(lf,{...i,...r,ref:t})});ih.displayName=rh;var ah=`MenuSub`,[oh,sh]=fm(ah),ch=e=>{let{__scopeMenu:t,children:n,open:r=!1,onOpenChange:i}=e,a=_m(ah,t),o=mm(t),[s,c]=R.useState(null),[l,u]=R.useState(null),d=Kc(i);return R.useEffect(()=>(a.open===!1&&d(!1),()=>d(!1)),[a.open,d]),(0,z.jsx)(of,{...o,children:(0,z.jsx)(gm,{scope:t,open:r,onOpenChange:d,content:l,onContentChange:u,children:(0,z.jsx)(oh,{scope:t,contentId:Ol(),triggerId:Ol(),trigger:s,onTriggerChange:c,children:n})})})};ch.displayName=ah;var lh=`MenuSubTrigger`,uh=R.forwardRef((e,t)=>{let n=_m(lh,e.__scopeMenu),r=ym(lh,e.__scopeMenu),i=sh(lh,e.__scopeMenu),a=km(lh,e.__scopeMenu),o=R.useRef(null),{pointerGraceTimerRef:s,onPointerGraceIntentChange:c}=a,l={__scopeMenu:e.__scopeMenu},u=R.useCallback(()=>{o.current&&window.clearTimeout(o.current),o.current=null},[]);return R.useEffect(()=>u,[u]),R.useEffect(()=>{let e=s.current;return()=>{window.clearTimeout(e),c(null)}},[s,c]),(0,z.jsx)(Sm,{asChild:!0,...l,children:(0,z.jsx)(Hm,{id:i.triggerId,"aria-haspopup":`menu`,"aria-expanded":n.open,"aria-controls":i.contentId,"data-state":ph(n.open),...e,ref:Ec(t,i.onTriggerChange),onClick:t=>{e.onClick?.(t),!(e.disabled||t.defaultPrevented)&&(t.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:Y(e.onPointerMove,xh(t=>{a.onItemEnter(t),!t.defaultPrevented&&!e.disabled&&!n.open&&!o.current&&(a.onPointerGraceIntentChange(null),o.current=window.setTimeout(()=>{n.onOpenChange(!0),u()},100))})),onPointerLeave:Y(e.onPointerLeave,xh(e=>{u();let t=n.content?.getBoundingClientRect();if(t){let r=n.content?.dataset.side,i=r===`right`,o=i?-5:5,c=t[i?`left`:`right`],l=t[i?`right`:`left`];a.onPointerGraceIntentChange({area:[{x:e.clientX+o,y:e.clientY},{x:c,y:t.top},{x:l,y:t.top},{x:l,y:t.bottom},{x:c,y:t.bottom}],side:r}),window.clearTimeout(s.current),s.current=window.setTimeout(()=>a.onPointerGraceIntentChange(null),300)}else{if(a.onTriggerLeave(e),e.defaultPrevented)return;a.onPointerGraceIntentChange(null)}})),onKeyDown:Y(e.onKeyDown,t=>{let i=a.searchRef.current!==``;e.disabled||i&&t.key===` `||om[r.dir].includes(t.key)&&(n.onOpenChange(!0),n.content?.focus(),t.preventDefault())})})})});uh.displayName=lh;var dh=`MenuSubContent`,fh=R.forwardRef((e,t)=>{let n=Tm(Dm,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=_m(Dm,e.__scopeMenu),o=ym(Dm,e.__scopeMenu),s=sh(dh,e.__scopeMenu),c=R.useRef(null),l=Dc(t,c);return(0,z.jsx)(lm.Provider,{scope:e.__scopeMenu,children:(0,z.jsx)(pf,{present:r||a.open,children:(0,z.jsx)(lm.Slot,{scope:e.__scopeMenu,children:(0,z.jsx)(Pm,{id:s.contentId,"aria-labelledby":s.triggerId,...i,ref:l,align:`start`,side:o.dir===`rtl`?`left`:`right`,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:e=>{o.isUsingKeyboardRef.current&&c.current?.focus(),e.preventDefault()},onCloseAutoFocus:e=>e.preventDefault(),onFocusOutside:Y(e.onFocusOutside,e=>{e.target!==s.trigger&&a.onOpenChange(!1)}),onEscapeKeyDown:Y(e.onEscapeKeyDown,e=>{o.onClose(),e.preventDefault()}),onKeyDown:Y(e.onKeyDown,e=>{let t=e.currentTarget.contains(e.target),n=sm[o.dir].includes(e.key);t&&n&&(a.onOpenChange(!1),s.trigger?.focus(),e.preventDefault())})})})})})});fh.displayName=dh;function ph(e){return e?`open`:`closed`}function mh(e){return e===`indeterminate`}function hh(e){return mh(e)?`indeterminate`:e?`checked`:`unchecked`}function gh(e){let t=document.activeElement;for(let n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function _h(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function vh(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=_h(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}function yh(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}function bh(e,t){return t?yh({x:e.clientX,y:e.clientY},t):!1}function xh(e){return t=>t.pointerType===`mouse`?e(t):void 0}var Sh=bm,Ch=Sm,wh=Em,Th=Am,Eh=Im,Dh=Rm,Oh=Vm,kh=Wm,Ah=Jm,jh=Xm,Mh=eh,Nh=nh,Ph=ih,Fh=uh,Ih=fh,Lh=`DropdownMenu`,[Rh,zh]=Oc(Lh,[pm]),Bh=pm(),[Vh,Hh]=Rh(Lh),Uh=e=>{let{__scopeDropdownMenu:t,children:n,dir:r,open:i,defaultOpen:a,onOpenChange:o,modal:s=!0}=e,c=Bh(t),l=R.useRef(null),[u,d]=Mc({prop:i,defaultProp:a??!1,onChange:o,caller:Lh});return(0,z.jsx)(Vh,{scope:t,triggerId:Ol(),triggerRef:l,contentId:Ol(),open:u,onOpenChange:d,onOpenToggle:R.useCallback(()=>d(e=>!e),[d]),modal:s,children:(0,z.jsx)(Sh,{...c,open:u,onOpenChange:d,dir:r,modal:s,children:n})})};Uh.displayName=Lh;var Wh=`DropdownMenuTrigger`,Gh=R.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,disabled:r=!1,...i}=e,a=Hh(Wh,n),o=Bh(n);return(0,z.jsx)(Ch,{asChild:!0,...o,children:(0,z.jsx)(Vc.button,{type:`button`,id:a.triggerId,"aria-haspopup":`menu`,"aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":a.open?`open`:`closed`,"data-disabled":r?``:void 0,disabled:r,...i,ref:Ec(t,a.triggerRef),onPointerDown:Y(e.onPointerDown,e=>{!r&&e.button===0&&e.ctrlKey===!1&&(a.onOpenToggle(),a.open||e.preventDefault())}),onKeyDown:Y(e.onKeyDown,e=>{r||([`Enter`,` `].includes(e.key)&&a.onOpenToggle(),e.key===`ArrowDown`&&a.onOpenChange(!0),[`Enter`,` `,`ArrowDown`].includes(e.key)&&e.preventDefault())})})})});Gh.displayName=Wh;var Kh=`DropdownMenuPortal`,qh=e=>{let{__scopeDropdownMenu:t,...n}=e,r=Bh(t);return(0,z.jsx)(wh,{...r,...n})};qh.displayName=Kh;var Jh=`DropdownMenuContent`,Yh=R.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Hh(Jh,n),a=Bh(n),o=R.useRef(!1);return(0,z.jsx)(Th,{id:i.contentId,"aria-labelledby":i.triggerId,...a,...r,ref:t,onCloseAutoFocus:Y(e.onCloseAutoFocus,e=>{o.current||i.triggerRef.current?.focus(),o.current=!1,e.preventDefault()}),onInteractOutside:Y(e.onInteractOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,r=t.button===2||n;(!i.modal||r)&&(o.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-dropdown-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-dropdown-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-dropdown-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-dropdown-menu-trigger-height":`var(--radix-popper-anchor-height)`}})});Yh.displayName=Jh;var Xh=`DropdownMenuGroup`,Zh=R.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Bh(n);return(0,z.jsx)(Eh,{...i,...r,ref:t})});Zh.displayName=Xh;var Qh=`DropdownMenuLabel`,$h=R.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Bh(n);return(0,z.jsx)(Dh,{...i,...r,ref:t})});$h.displayName=Qh;var eg=`DropdownMenuItem`,tg=R.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Bh(n);return(0,z.jsx)(Oh,{...i,...r,ref:t})});tg.displayName=eg;var ng=`DropdownMenuCheckboxItem`,rg=R.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Bh(n);return(0,z.jsx)(kh,{...i,...r,ref:t})});rg.displayName=ng;var ig=`DropdownMenuRadioGroup`,ag=R.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Bh(n);return(0,z.jsx)(Ah,{...i,...r,ref:t})});ag.displayName=ig;var og=`DropdownMenuRadioItem`,sg=R.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Bh(n);return(0,z.jsx)(jh,{...i,...r,ref:t})});sg.displayName=og;var cg=`DropdownMenuItemIndicator`,lg=R.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Bh(n);return(0,z.jsx)(Mh,{...i,...r,ref:t})});lg.displayName=cg;var ug=`DropdownMenuSeparator`,dg=R.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Bh(n);return(0,z.jsx)(Nh,{...i,...r,ref:t})});dg.displayName=ug;var fg=`DropdownMenuArrow`,pg=R.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Bh(n);return(0,z.jsx)(Ph,{...i,...r,ref:t})});pg.displayName=fg;var mg=`DropdownMenuSubTrigger`,hg=R.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Bh(n);return(0,z.jsx)(Fh,{...i,...r,ref:t})});hg.displayName=mg;var gg=`DropdownMenuSubContent`,_g=R.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Bh(n);return(0,z.jsx)(Ih,{...i,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-dropdown-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-dropdown-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-dropdown-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-dropdown-menu-trigger-height":`var(--radix-popper-anchor-height)`}})});_g.displayName=gg;var vg=Uh,yg=Gh,bg=qh,xg=Yh,Sg=tg,Cg=vg,wg=yg;function Tg({align:e=`end`,className:t,sideOffset:n=4,...r}){return(0,z.jsx)(bg,{children:(0,z.jsx)(xg,{align:e,className:q(`z-50 min-w-40 overflow-hidden rounded-[var(--radius-md)] border border-border bg-popover p-1 text-popover-foreground shadow-[var(--shadow-md)] outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0`,t),sideOffset:n,...r})})}function Eg({className:e,variant:t,...n}){return(0,z.jsx)(Sg,{className:q(`relative flex cursor-default select-none items-center gap-2 rounded-[var(--radius-sm)] px-2 py-1.5 text-[length:var(--font-size-sm)] outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-[var(--opacity-disabled)] [&_svg]:size-4 [&_svg]:shrink-0`,t===`destructive`&&`text-[var(--semantic-danger-fg)] focus:bg-[var(--semantic-danger-bg)] focus:text-[var(--semantic-danger-fg)]`,e),...n})}function Dg({className:e,...t}){return(0,z.jsx)(`label`,{className:q(`text-[length:var(--font-size-sm)] font-medium leading-none text-foreground`,e),...t})}function Og(e,t){let n=getComputedStyle(e);return t*parseFloat(n.fontSize)}function kg(e,t){let n=getComputedStyle(e.ownerDocument.body);return t*parseFloat(n.fontSize)}function Ag(e){return e/100*window.innerHeight}function jg(e){return e/100*window.innerWidth}function Mg(e){switch(typeof e){case`number`:return[e,`px`];case`string`:{let t=parseFloat(e);return e.endsWith(`%`)?[t,`%`]:e.endsWith(`px`)?[t,`px`]:e.endsWith(`rem`)?[t,`rem`]:e.endsWith(`em`)?[t,`em`]:e.endsWith(`vh`)?[t,`vh`]:e.endsWith(`vw`)?[t,`vw`]:[t,`%`]}}}function Ng({groupSize:e,panelElement:t,styleProp:n}){let r,[i,a]=Mg(n);switch(a){case`%`:r=i/100*e;break;case`px`:r=i;break;case`rem`:r=kg(t,i);break;case`em`:r=Og(t,i);break;case`vh`:r=Ag(i);break;case`vw`:r=jg(i);break}return r}function Pg(e){return parseFloat(e.toFixed(3))}function Fg({group:e}){let{orientation:t,panels:n}=e;return n.reduce((e,n)=>(e+=t===`horizontal`?n.element.offsetWidth:n.element.offsetHeight,e),0)}function Ig(e){let{panels:t}=e,n=Fg({group:e});return n===0?t.map(e=>({groupResizeBehavior:e.panelConstraints.groupResizeBehavior,collapsedSize:0,collapsible:e.panelConstraints.collapsible===!0,defaultSize:void 0,disabled:e.panelConstraints.disabled,minSize:0,maxSize:100,panelId:e.id})):t.map(e=>{let{element:t,panelConstraints:r}=e,i=0;r.collapsedSize!==void 0&&(i=Pg(Ng({groupSize:n,panelElement:t,styleProp:r.collapsedSize})/n*100));let a;r.defaultSize!==void 0&&(a=Pg(Ng({groupSize:n,panelElement:t,styleProp:r.defaultSize})/n*100));let o=0;r.minSize!==void 0&&(o=Pg(Ng({groupSize:n,panelElement:t,styleProp:r.minSize})/n*100));let s=100;return r.maxSize!==void 0&&(s=Pg(Ng({groupSize:n,panelElement:t,styleProp:r.maxSize})/n*100)),{groupResizeBehavior:r.groupResizeBehavior,collapsedSize:i,collapsible:r.collapsible===!0,defaultSize:a,disabled:r.disabled,minSize:o,maxSize:s,panelId:e.id}})}function Lg(e,t=`Assertion error`){if(!e)throw Error(t)}function Rg(e,t){return Array.from(t).sort(e===`horizontal`?zg:Bg)}function zg(e,t){let n=e.element.offsetLeft-t.element.offsetLeft;return n===0?e.element.offsetWidth-t.element.offsetWidth:n}function Bg(e,t){let n=e.element.offsetTop-t.element.offsetTop;return n===0?e.element.offsetHeight-t.element.offsetHeight:n}function Vg(e){return typeof e==`object`&&!!e&&`nodeType`in e&&e.nodeType===Node.ELEMENT_NODE}function Hg(e,t){return{x:e.x>=t.left&&e.x<=t.right?0:Math.min(Math.abs(e.x-t.left),Math.abs(e.x-t.right)),y:e.y>=t.top&&e.y<=t.bottom?0:Math.min(Math.abs(e.y-t.top),Math.abs(e.y-t.bottom))}}function Ug({orientation:e,rects:t,targetRect:n}){let r={x:n.x+n.width/2,y:n.y+n.height/2},i,a=Number.MAX_VALUE;for(let n of t){let{x:t,y:o}=Hg(r,n),s=e===`horizontal`?t:o;s<a&&(a=s,i=n)}return Lg(i,`No rect found`),i}var Wg;function Gg(){return Wg===void 0&&(Wg=typeof matchMedia==`function`?!!matchMedia(`(pointer:coarse)`).matches:!1),Wg}function Kg(e){let{element:t,orientation:n,panels:r,separators:i}=e,a=Rg(n,Array.from(t.children).filter(Vg).map(e=>({element:e}))).map(({element:e})=>e),o=[],s=!1,c=!1,l=-1,u=-1,d=0,f,p=[];{let e=-1;for(let t of a)t.hasAttribute(`data-panel`)&&(e++,t.hasAttribute(`data-disabled`)||(d++,l===-1&&(l=e),u=e))}if(d>1){let t=-1;for(let d of a)if(d.hasAttribute(`data-panel`)){t++;let i=r.find(e=>e.element===d);if(i){if(f){let r=f.element.getBoundingClientRect(),a=d.getBoundingClientRect(),m;if(c){let e=n===`horizontal`?new DOMRect(r.right,r.top,0,r.height):new DOMRect(r.left,r.bottom,r.width,0),t=n===`horizontal`?new DOMRect(a.left,a.top,0,a.height):new DOMRect(a.left,a.top,a.width,0);switch(p.length){case 0:m=[e,t];break;case 1:{let i=p[0];m=[i,Ug({orientation:n,rects:[r,a],targetRect:i.element.getBoundingClientRect()})===r?t:e];break}default:m=p;break}}else m=p.length?p:[n===`horizontal`?new DOMRect(r.right,a.top,a.left-r.right,a.height):new DOMRect(a.left,r.bottom,a.width,a.top-r.bottom)];for(let n of m){let r=`width`in n?n:n.element.getBoundingClientRect(),a=Gg()?e.resizeTargetMinimumSize.coarse:e.resizeTargetMinimumSize.fine;if(r.width<a){let e=a-r.width;r=new DOMRect(r.x-e/2,r.y,r.width+e,r.height)}if(r.height<a){let e=a-r.height;r=new DOMRect(r.x,r.y-e/2,r.width,r.height+e)}!s&&!(t<=l||t>u)&&o.push({group:e,groupSize:Fg({group:e}),panels:[f,i],separator:`width`in n?void 0:n,rect:r}),s=!1}}c=!1,f=i,p=[]}}else if(d.hasAttribute(`data-separator`)){d.ariaDisabled!==null&&(s=!0);let e=i.find(e=>e.element===d);e?p.push(e):(f=void 0,p=[])}else c=!0}return o}var qg=class{#e={};addListener(e,t){let n=this.#e[e];return n===void 0?this.#e[e]=[t]:n.includes(t)||n.push(t),()=>{this.removeListener(e,t)}}emit(e,t){let n=this.#e[e];if(n!==void 0)if(n.length===1)n[0].call(null,t);else{let e=!1,r=null,i=Array.from(n);for(let n=0;n<i.length;n++){let a=i[n];try{a.call(null,t)}catch(t){r===null&&(e=!0,r=t)}}if(e)throw r}}removeAllListeners(){this.#e={}}removeListener(e,t){let n=this.#e[e];if(n!==void 0){let e=n.indexOf(t);e>=0&&n.splice(e,1)}}},Jg=new Map,Yg=new qg;function Xg(e){Jg=new Map(Jg),Jg.delete(e)}function Zg(e,t){for(let[t]of Jg)if(t.id===e)return t}function Qg(e,t){for(let[t,n]of Jg)if(t.id===e)return n;if(t)throw Error(`Could not find data for Group with id ${e}`)}function $g(){return Jg}function e_(e,t){return Yg.addListener(`groupChange`,n=>{n.group.id===e&&t(n)})}function t_(e,t){let n=Jg.get(e);Jg=new Map(Jg),Jg.set(e,t),Yg.emit(`groupChange`,{group:e,prev:n,next:t})}function n_(e,t,n){let r,i={x:1/0,y:1/0};for(let a of t){let t=Hg(n,a.rect);switch(e){case`horizontal`:t.x<=i.x&&(r=a,i=t);break;case`vertical`:t.y<=i.y&&(r=a,i=t);break}}return r?{distance:i,hitRegion:r}:void 0}function r_(e){return typeof e==`object`&&!!e&&`nodeType`in e&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE}function i_(e,t){if(e===t)throw Error(`Cannot compare node with itself`);let n={a:u_(e),b:u_(t)},r;for(;n.a.at(-1)===n.b.at(-1);)r=n.a.pop(),n.b.pop();Lg(r,`Stacking order can only be calculated for elements with a common ancestor`);let i={a:l_(c_(n.a)),b:l_(c_(n.b))};if(i.a===i.b){let e=r.childNodes,t={a:n.a.at(-1),b:n.b.at(-1)},i=e.length;for(;i--;){let n=e[i];if(n===t.a)return 1;if(n===t.b)return-1}}return Math.sign(i.a-i.b)}var a_=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function o_(e){let t=getComputedStyle(d_(e)??e).display;return t===`flex`||t===`inline-flex`}function s_(e){let t=getComputedStyle(e);return!!(t.position===`fixed`||t.zIndex!==`auto`&&(t.position!==`static`||o_(e))||+t.opacity<1||`transform`in t&&t.transform!==`none`||`webkitTransform`in t&&t.webkitTransform!==`none`||`mixBlendMode`in t&&t.mixBlendMode!==`normal`||`filter`in t&&t.filter!==`none`||`webkitFilter`in t&&t.webkitFilter!==`none`||`isolation`in t&&t.isolation===`isolate`||a_.test(t.willChange)||t.webkitOverflowScrolling===`touch`)}function c_(e){let t=e.length;for(;t--;){let n=e[t];if(Lg(n,`Missing node`),s_(n))return n}return null}function l_(e){return e&&Number(getComputedStyle(e).zIndex)||0}function u_(e){let t=[];for(;e;)t.push(e),e=d_(e);return t}function d_(e){let{parentNode:t}=e;return r_(t)?t.host:t}function f_(e,t){return e.x<t.x+t.width&&e.x+e.width>t.x&&e.y<t.y+t.height&&e.y+e.height>t.y}function p_({groupElement:e,hitRegion:t,pointerEventTarget:n}){if(!Vg(n)||n.contains(e)||e.contains(n))return!0;if(i_(n,e)>0){let r=n;for(;r;){if(r.contains(e))return!0;if(f_(r.getBoundingClientRect(),t))return!1;r=r.parentElement}}return!0}function m_(e,t){let n=[];return t.forEach((t,r)=>{if(r.disabled)return;let i=Kg(r),a=n_(r.orientation,i,{x:e.clientX,y:e.clientY});a&&a.distance.x<=0&&a.distance.y<=0&&p_({groupElement:r.element,hitRegion:a.hitRegion.rect,pointerEventTarget:e.target})&&n.push(a.hitRegion)}),n}function h_(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!=t[n])return!1;return!0}function g_(e,t,n=0){return Math.abs(Pg(e)-Pg(t))<=n}function __(e,t){return g_(e,t)?0:e>t?1:-1}function v_({overrideDisabledPanels:e,panelConstraints:t,prevSize:n,size:r}){let{collapsedSize:i=0,collapsible:a,disabled:o,maxSize:s=100,minSize:c=0}=t;if(o&&!e)return n;if(__(r,c)<0)if(a){let e=(i+c)/2;r=__(r,e)<0?i:c}else r=c;return r=Math.min(s,r),r=Pg(r),r}function y_({delta:e,initialLayout:t,panelConstraints:n,pivotIndices:r,prevLayout:i,trigger:a}){if(g_(e,0))return t;let o=a===`imperative-api`,s=Object.values(t),c=Object.values(i),l=[...s],[u,d]=r;Lg(u!=null,`Invalid first pivot index`),Lg(d!=null,`Invalid second pivot index`);let f=0;switch(a){case`keyboard`:{let t=e<0?d:u,r=n[t];Lg(r,`Panel constraints not found for index ${t}`);let{collapsedSize:i=0,collapsible:a,minSize:o=0}=r;if(a){let n=s[t];if(Lg(n!=null,`Previous layout not found for panel index ${t}`),g_(n,i)){let t=o-n;__(t,Math.abs(e))>0&&(e=e<0?0-t:t)}}}{let t=e<0?u:d,r=n[t];Lg(r,`No panel constraints found for index ${t}`);let{collapsedSize:i=0,collapsible:a,minSize:o=0}=r;if(a){let n=s[t];if(Lg(n!=null,`Previous layout not found for panel index ${t}`),g_(n,o)){let t=n-i;__(t,Math.abs(e))>0&&(e=e<0?0-t:t)}}}break;default:{let t=e<0?d:u,r=n[t];Lg(r,`Panel constraints not found for index ${t}`);let i=s[t],{collapsible:a,collapsedSize:o,minSize:c}=r;if(a&&__(i,c)<0)if(e>0){let t=c-o,n=t/2;__(i+e,c)<0&&(e=__(e,n)<=0?0:t)}else{let t=c-o,n=100-t/2;__(i-e,c)<0&&(e=__(100+e,n)>0?0:-t)}break}}{let t=e<0?1:-1,r=e<0?d:u,i=0;for(;;){let e=s[r];Lg(e!=null,`Previous layout not found for panel index ${r}`);let a=v_({overrideDisabledPanels:o,panelConstraints:n[r],prevSize:e,size:100})-e;if(i+=a,r+=t,r<0||r>=n.length)break}let a=Math.min(Math.abs(e),Math.abs(i));e=e<0?0-a:a}{let t=e<0?u:d;for(;t>=0&&t<n.length;){let r=Math.abs(e)-Math.abs(f),i=s[t];Lg(i!=null,`Previous layout not found for panel index ${t}`);let a=i-r,c=v_({overrideDisabledPanels:o,panelConstraints:n[t],prevSize:i,size:a});if(!g_(i,c)&&(f+=i-c,l[t]=c,f.toFixed(3).localeCompare(Math.abs(e).toFixed(3),void 0,{numeric:!0})>=0))break;e<0?t--:t++}}if(h_(c,l))return i;{let t=e<0?d:u,r=s[t];Lg(r!=null,`Previous layout not found for panel index ${t}`);let i=r+f,a=v_({overrideDisabledPanels:o,panelConstraints:n[t],prevSize:r,size:i});if(l[t]=a,!g_(a,i)){let t=i-a,r=e<0?d:u;for(;r>=0&&r<n.length;){let i=l[r];Lg(i!=null,`Previous layout not found for panel index ${r}`);let a=i+t,s=v_({overrideDisabledPanels:o,panelConstraints:n[r],prevSize:i,size:a});if(g_(i,s)||(t-=s-i,l[r]=s),g_(t,0))break;e>0?r--:r++}}}if(!g_(Object.values(l).reduce((e,t)=>t+e,0),100,.1))return i;let p=Object.keys(i);return l.reduce((e,t,n)=>(e[p[n]]=t,e),{})}function b_(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(t[n]===void 0||__(e[n],t[n])!==0)return!1;return!0}function x_({layout:e,panelConstraints:t}){let n=Object.values(e),r=[...n],i=r.reduce((e,t)=>e+t,0);if(r.length!==t.length)throw Error(`Invalid ${t.length} panel layout: ${r.map(e=>`${e}%`).join(`, `)}`);if(!g_(i,100)&&r.length>0)for(let e=0;e<t.length;e++){let t=r[e];Lg(t!=null,`No layout data found for index ${e}`),r[e]=100/i*t}let a=0;for(let e=0;e<t.length;e++){let i=n[e];Lg(i!=null,`No layout data found for index ${e}`);let o=r[e];Lg(o!=null,`No layout data found for index ${e}`);let s=v_({overrideDisabledPanels:!0,panelConstraints:t[e],prevSize:i,size:o});o!=s&&(a+=o-s,r[e]=s)}if(!g_(a,0))for(let e=0;e<t.length;e++){let n=r[e];Lg(n!=null,`No layout data found for index ${e}`);let i=n+a,o=v_({overrideDisabledPanels:!0,panelConstraints:t[e],prevSize:n,size:i});if(n!==o&&(a-=o-n,r[e]=o,g_(a,0)))break}let o=Object.keys(e);return r.reduce((e,t,n)=>(e[o[n]]=t,e),{})}function S_({groupId:e,panelId:t}){let n=()=>{let t=$g();for(let[n,{defaultLayoutDeferred:r,derivedPanelConstraints:i,layout:a,groupSize:o,separatorToPanels:s}]of t)if(n.id===e)return{defaultLayoutDeferred:r,derivedPanelConstraints:i,group:n,groupSize:o,layout:a,separatorToPanels:s};throw Error(`Group ${e} not found`)},r=()=>{let e=n().derivedPanelConstraints.find(e=>e.panelId===t);if(e!==void 0)return e;throw Error(`Panel constraints not found for Panel ${t}`)},i=()=>{let e=n().group.panels.find(e=>e.id===t);if(e!==void 0)return e;throw Error(`Layout not found for Panel ${t}`)},a=()=>{let e=n().layout[t];if(e!==void 0)return e;throw Error(`Layout not found for Panel ${t}`)},o=e=>{let r=a();if(e===r)return;let{defaultLayoutDeferred:i,derivedPanelConstraints:o,group:s,groupSize:c,layout:l,separatorToPanels:u}=n(),d=s.panels.findIndex(e=>e.id===t),f=d===s.panels.length-1,p=x_({layout:y_({delta:f?r-e:e-r,initialLayout:l,panelConstraints:o,pivotIndices:f?[d-1,d]:[d,d+1],prevLayout:l,trigger:`imperative-api`}),panelConstraints:o});b_(l,p)||t_(s,{defaultLayoutDeferred:i,derivedPanelConstraints:o,groupSize:c,layout:p,separatorToPanels:u})};return{collapse:()=>{let{collapsible:e,collapsedSize:t}=r(),{mutableValues:n}=i(),s=a();e&&s!==t&&(n.expandToSize=s,o(t))},expand:()=>{let{collapsible:e,collapsedSize:t,minSize:n}=r(),{mutableValues:s}=i(),c=a();if(e&&c===t){let e=s.expandToSize??n;e===0&&(e=1),o(e)}},getSize:()=>{let{group:e}=n(),t=a(),{element:r}=i();return{asPercentage:t,inPixels:e.orientation===`horizontal`?r.offsetWidth:r.offsetHeight}},isCollapsed:()=>{let{collapsible:e,collapsedSize:t}=r(),n=a();return e&&g_(t,n)},resize:e=>{let{group:t}=n(),{element:r}=i(),a=Fg({group:t});o(Pg(Ng({groupSize:a,panelElement:r,styleProp:e})/a*100))}}}function C_(e){e.defaultPrevented||m_(e,$g()).forEach(t=>{if(t.separator&&!t.separator.disableDoubleClick){let n=t.panels.find(e=>e.panelConstraints.defaultSize!==void 0);if(n){let r=n.panelConstraints.defaultSize,i=S_({groupId:t.group.id,panelId:n.id});i&&r!==void 0&&(i.resize(r),e.preventDefault())}}})}function w_(e){let t=$g();for(let[n]of t)if(n.separators.some(t=>t.element===e))return n;throw Error(`Could not find parent Group for separator element`)}function T_({groupId:e}){let t=()=>{let t=$g();for(let[n,r]of t)if(n.id===e)return{group:n,...r};throw Error(`Could not find Group with id "${e}"`)};return{getLayout(){let{defaultLayoutDeferred:e,layout:n}=t();return e?{}:n},setLayout(e){let{defaultLayoutDeferred:n,derivedPanelConstraints:r,group:i,groupSize:a,layout:o,separatorToPanels:s}=t(),c=x_({layout:e,panelConstraints:r});return n?o:(b_(o,c)||t_(i,{defaultLayoutDeferred:n,derivedPanelConstraints:r,groupSize:a,layout:c,separatorToPanels:s}),c)}}}function E_(e,t){let n=w_(e),r=Qg(n.id,!0),i=n.separators.find(t=>t.element===e);Lg(i,`Matching separator not found`);let a=r.separatorToPanels.get(i);Lg(a,`Matching panels not found`);let o=a.map(e=>n.panels.indexOf(e)),s=T_({groupId:n.id}).getLayout(),c=x_({layout:y_({delta:t,initialLayout:s,panelConstraints:r.derivedPanelConstraints,pivotIndices:o,prevLayout:s,trigger:`keyboard`}),panelConstraints:r.derivedPanelConstraints});b_(s,c)||t_(n,{defaultLayoutDeferred:r.defaultLayoutDeferred,derivedPanelConstraints:r.derivedPanelConstraints,groupSize:r.groupSize,layout:c,separatorToPanels:r.separatorToPanels})}function D_(e){if(e.defaultPrevented)return;let t=e.currentTarget,n=w_(t);if(!n.disabled)switch(e.key){case`ArrowDown`:e.preventDefault(),n.orientation===`vertical`&&E_(t,5);break;case`ArrowLeft`:e.preventDefault(),n.orientation===`horizontal`&&E_(t,-5);break;case`ArrowRight`:e.preventDefault(),n.orientation===`horizontal`&&E_(t,5);break;case`ArrowUp`:e.preventDefault(),n.orientation===`vertical`&&E_(t,-5);break;case`End`:e.preventDefault(),E_(t,100);break;case`Enter`:{e.preventDefault();let n=w_(t),{derivedPanelConstraints:r,layout:i,separatorToPanels:a}=Qg(n.id,!0),o=n.separators.find(e=>e.element===t);Lg(o,`Matching separator not found`);let s=a.get(o);Lg(s,`Matching panels not found`);let c=s[0],l=r.find(e=>e.panelId===c.id);if(Lg(l,`Panel metadata not found`),l.collapsible){let e=i[c.id];E_(t,(l.collapsedSize===e?n.mutableState.expandedPanelSizes[c.id]??l.minSize:l.collapsedSize)-e)}break}case`F6`:{e.preventDefault();let n=w_(t).separators.map(e=>e.element),r=Array.from(n).findIndex(t=>t===e.currentTarget);Lg(r!==null,`Index not found`),n[e.shiftKey?r>0?r-1:n.length-1:r+1<n.length?r+1:0].focus({preventScroll:!0});break}case`Home`:e.preventDefault(),E_(t,-100);break}}var O_={cursorFlags:0,state:`inactive`},k_=new qg;function A_(){return O_}function j_(e){return k_.addListener(`change`,e)}function M_(e){let t=O_,n={...O_};n.cursorFlags=e,O_=n,k_.emit(`change`,{prev:t,next:n})}function N_(e){let t=O_;O_=e,k_.emit(`change`,{prev:t,next:e})}function P_(e){if(e.defaultPrevented||e.pointerType===`mouse`&&e.button>0)return;let t=$g(),n=m_(e,t),r=new Map,i=!1;n.forEach(e=>{e.separator&&(i||(i=!0,e.separator.element.focus({preventScroll:!0})));let n=t.get(e.group);n&&r.set(e.group,n.layout)}),N_({cursorFlags:0,hitRegions:n,initialLayoutMap:r,pointerDownAtPoint:{x:e.clientX,y:e.clientY},state:`active`}),n.length&&e.preventDefault()}var F_=e=>e,I_=()=>{},L_=1,R_=2,z_=4,B_=8,V_=3,H_=12,U_;function W_(){return U_===void 0&&(U_=!1,typeof window<`u`&&(window.navigator.userAgent.includes(`Chrome`)||window.navigator.userAgent.includes(`Firefox`))&&(U_=!0)),U_}function G_({cursorFlags:e,groups:t,state:n}){let r=0,i=0;switch(n){case`active`:case`hover`:t.forEach(e=>{if(!e.mutableState.disableCursor)switch(e.orientation){case`horizontal`:r++;break;case`vertical`:i++;break}})}if(!(r===0&&i===0)){switch(n){case`active`:if(e&&W_()){let t=(e&L_)!==0,n=(e&R_)!==0,r=(e&z_)!==0,i=(e&B_)!==0;if(t)return r?`se-resize`:i?`ne-resize`:`e-resize`;if(n)return r?`sw-resize`:i?`nw-resize`:`w-resize`;if(r)return`s-resize`;if(i)return`n-resize`}break}return W_()?r>0&&i>0?`move`:r>0?`ew-resize`:`ns-resize`:r>0&&i>0?`grab`:r>0?`col-resize`:`row-resize`}}var K_=new WeakMap;function q_(e){if(e.defaultView===null||e.defaultView===void 0)return;let{prevStyle:t,styleSheet:n}=K_.get(e)??{};n===void 0&&(n=new e.defaultView.CSSStyleSheet,e.adoptedStyleSheets&&e.adoptedStyleSheets.push(n));let r=A_();switch(r.state){case`active`:case`hover`:{let e=G_({cursorFlags:r.cursorFlags,groups:r.hitRegions.map(e=>e.group),state:r.state}),i=`*, *:hover {cursor: ${e} !important; }`;if(t===i)return;t=i,e?n.cssRules.length===0?n.insertRule(i):n.replaceSync(i):n.cssRules.length===1&&n.deleteRule(0);break}case`inactive`:t=void 0,n.cssRules.length===1&&n.deleteRule(0);break}K_.set(e,{prevStyle:t,styleSheet:n})}function J_({document:e,event:t,hitRegions:n,initialLayoutMap:r,mountedGroups:i,pointerDownAtPoint:a,prevCursorFlags:o}){let s=0;n.forEach(e=>{let{group:n,groupSize:o}=e,{orientation:c,panels:l}=n,{disableCursor:u}=n.mutableState,d=0;d=a?c===`horizontal`?(t.clientX-a.x)/o*100:(t.clientY-a.y)/o*100:c===`horizontal`?t.clientX<0?-100:100:t.clientY<0?-100:100;let f=r.get(n),p=i.get(n);if(!f||!p)return;let{defaultLayoutDeferred:m,derivedPanelConstraints:h,groupSize:g,layout:_,separatorToPanels:v}=p;if(h&&_&&v){let t=y_({delta:d,initialLayout:f,panelConstraints:h,pivotIndices:e.panels.map(e=>l.indexOf(e)),prevLayout:_,trigger:`mouse-or-touch`});if(b_(t,_)){if(d!==0&&!u)switch(c){case`horizontal`:s|=d<0?L_:R_;break;case`vertical`:s|=d<0?z_:B_;break}}else t_(e.group,{defaultLayoutDeferred:m,derivedPanelConstraints:h,groupSize:g,layout:t,separatorToPanels:v})}});let c=0;t.movementX===0?c|=o&V_:c|=s&V_,t.movementY===0?c|=o&H_:c|=s&H_,M_(c),q_(e)}function Y_(e){let t=$g(),n=A_();switch(n.state){case`active`:J_({document:e.currentTarget,event:e,hitRegions:n.hitRegions,initialLayoutMap:n.initialLayoutMap,mountedGroups:t,prevCursorFlags:n.cursorFlags})}}function X_(e){if(e.defaultPrevented)return;let t=A_(),n=$g();switch(t.state){case`active`:if(e.buttons===0){N_({cursorFlags:0,state:`inactive`}),t.hitRegions.forEach(e=>{let t=Qg(e.group.id,!0);t_(e.group,t)});return}for(let n of t.hitRegions)if(n.separator){let{element:t}=n.separator;t.hasPointerCapture?.(e.pointerId)||t.setPointerCapture?.(e.pointerId)}J_({document:e.currentTarget,event:e,hitRegions:t.hitRegions,initialLayoutMap:t.initialLayoutMap,mountedGroups:n,pointerDownAtPoint:t.pointerDownAtPoint,prevCursorFlags:t.cursorFlags});break;default:{let r=m_(e,n);r.length===0?t.state!==`inactive`&&N_({cursorFlags:0,state:`inactive`}):N_({cursorFlags:0,hitRegions:r,state:`hover`}),q_(e.currentTarget);break}}}function Z_(e){if(e.relatedTarget instanceof HTMLIFrameElement)switch(A_().state){case`hover`:N_({cursorFlags:0,state:`inactive`})}}function Q_(e){if(e.defaultPrevented||e.pointerType===`mouse`&&e.button>0)return;let t=A_();switch(t.state){case`active`:N_({cursorFlags:0,state:`inactive`}),t.hitRegions.length>0&&(q_(e.currentTarget),t.hitRegions.forEach(e=>{let t=Qg(e.group.id,!0);t_(e.group,t)}),e.preventDefault())}}function $_(e){let t=0,n=0,r={};for(let i of e)if(i.defaultSize!==void 0){t++;let e=Pg(i.defaultSize);n+=e,r[i.panelId]=e}else r[i.panelId]=void 0;let i=e.length-t;if(i!==0){let t=Pg((100-n)/i);for(let n of e)n.defaultSize===void 0&&(r[n.panelId]=t)}return r}function ev(e,t,n){if(!n[0])return;let r=e.panels.find(e=>e.element===t);if(!r||!r.onResize)return;let i=Fg({group:e}),a=e.orientation===`horizontal`?r.element.offsetWidth:r.element.offsetHeight,o=r.mutableValues.prevSize,s={asPercentage:Pg(a/i*100),inPixels:a};r.mutableValues.prevSize=s,r.onResize(s,r.id,o)}function tv(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(e[n]!==t[n])return!1;return!0}function nv({group:e,nextGroupSize:t,prevGroupSize:n,prevLayout:r}){if(n<=0||t<=0||n===t)return r;let i=0,a=0,o=!1,s=new Map,c=[];for(let l of e.panels){let e=r[l.id]??0;switch(l.panelConstraints.groupResizeBehavior){case`preserve-pixel-size`:{o=!0;let r=Pg(e/100*n/t*100);s.set(l.id,r),i+=r;break}default:c.push(l.id),a+=e;break}}if(!o||c.length===0)return r;let l=100-i,u={...r};if(s.forEach((e,t)=>{u[t]=e}),a>0)for(let e of c)u[e]=Pg((r[e]??0)/a*l);else{let e=Pg(l/c.length);for(let t of c)u[t]=e}return u}function rv(e,t){let n=e.map(e=>e.id),r=Object.keys(t);if(n.length!==r.length)return!1;for(let e of n)if(!r.includes(e))return!1;return!0}var iv=new Map;function av(e){let t=!0;Lg(e.element.ownerDocument.defaultView,`Cannot register an unmounted Group`);let n=e.element.ownerDocument.defaultView.ResizeObserver,r=new Set,i=new Set,a=new n(n=>{for(let r of n){let{borderBoxSize:n,target:i}=r;if(i===e.element){if(t){let t=Fg({group:e});if(t===0)return;let n=Qg(e.id);if(!n)return;let r=Ig(e),i=n.defaultLayoutDeferred?$_(r):n.layout,a=x_({layout:nv({group:e,nextGroupSize:t,prevGroupSize:n.groupSize,prevLayout:i}),panelConstraints:r});if(!n.defaultLayoutDeferred&&b_(n.layout,a)&&tv(n.derivedPanelConstraints,r)&&n.groupSize===t)return;t_(e,{defaultLayoutDeferred:!1,derivedPanelConstraints:r,groupSize:t,layout:a,separatorToPanels:n.separatorToPanels})}}else ev(e,i,n)}});a.observe(e.element),e.panels.forEach(e=>{Lg(!r.has(e.id),`Panel ids must be unique; id "${e.id}" was used more than once`),r.add(e.id),e.onResize&&a.observe(e.element)});let o=Fg({group:e}),s=Ig(e),c=e.panels.map(({id:e})=>e).join(`,`),l=e.mutableState.defaultLayout;l&&(rv(e.panels,l)||(l=void 0));let u=x_({layout:e.mutableState.layouts[c]??l??$_(s),panelConstraints:s}),d=e.element.ownerDocument;iv.set(d,(iv.get(d)??0)+1);let f=new Map;return Kg(e).forEach(e=>{e.separator&&f.set(e.separator,e.panels)}),t_(e,{defaultLayoutDeferred:o===0,derivedPanelConstraints:s,groupSize:o,layout:u,separatorToPanels:f}),e.separators.forEach(e=>{Lg(!i.has(e.id),`Separator ids must be unique; id "${e.id}" was used more than once`),i.add(e.id),e.element.addEventListener(`keydown`,D_)}),iv.get(d)===1&&(d.addEventListener(`dblclick`,C_,!0),d.addEventListener(`pointerdown`,P_,!0),d.addEventListener(`pointerleave`,Y_),d.addEventListener(`pointermove`,X_),d.addEventListener(`pointerout`,Z_),d.addEventListener(`pointerup`,Q_,!0)),function(){t=!1,iv.set(d,Math.max(0,(iv.get(d)??0)-1)),Xg(e),e.separators.forEach(e=>{e.element.removeEventListener(`keydown`,D_)}),iv.get(d)||(d.removeEventListener(`dblclick`,C_,!0),d.removeEventListener(`pointerdown`,P_,!0),d.removeEventListener(`pointerleave`,Y_),d.removeEventListener(`pointermove`,X_),d.removeEventListener(`pointerout`,Z_),d.removeEventListener(`pointerup`,Q_,!0)),a.disconnect()}}function ov(){let[e,t]=(0,R.useState)({});return[e,(0,R.useCallback)(()=>t({}),[])]}function sv(e){let t=(0,R.useId)();return`${e??t}`}var cv=typeof window<`u`?R.useLayoutEffect:R.useEffect;function lv(e){let t=(0,R.useRef)(e);return cv(()=>{t.current=e},[e]),(0,R.useCallback)((...e)=>t.current?.(...e),[t])}function uv(...e){return lv(t=>{e.forEach(e=>{if(e)switch(typeof e){case`function`:e(t);break;case`object`:e.current=t;break}})})}function dv(e){let t=(0,R.useRef)({...e});return cv(()=>{for(let n in e)t.current[n]=e[n]},[e]),t.current}var fv=(0,R.createContext)(null);function pv(e,t){let n=(0,R.useRef)({getLayout:()=>({}),setLayout:F_});(0,R.useImperativeHandle)(t,()=>n.current,[]),cv(()=>{Object.assign(n.current,T_({groupId:e}))})}function mv({children:e,className:t,defaultLayout:n,disableCursor:r,disabled:i,elementRef:a,groupRef:o,id:s,onLayoutChange:c,onLayoutChanged:l,orientation:u=`horizontal`,resizeTargetMinimumSize:d={coarse:20,fine:10},style:f,...p}){let m=(0,R.useRef)({onLayoutChange:{},onLayoutChanged:{}}),h=lv(e=>{b_(m.current.onLayoutChange,e)||(m.current.onLayoutChange=e,c?.(e))}),g=lv(e=>{b_(m.current.onLayoutChanged,e)||(m.current.onLayoutChanged=e,l?.(e))}),_=sv(s),v=(0,R.useRef)(null),[y,b]=ov(),x=(0,R.useRef)({lastExpandedPanelSizes:{},layouts:{},panels:[],resizeTargetMinimumSize:d,separators:[]}),S=uv(v,a);pv(_,o);let C=lv((e,t)=>{let r=A_(),i=Zg(e),a=Qg(e);if(a){let e=!1;switch(r.state){case`active`:e=r.hitRegions.some(e=>e.group===i);break}return{flexGrow:a.layout[t]??1,pointerEvents:e?`none`:void 0}}if(n?.[t])return{flexGrow:n?.[t]}}),w=dv({defaultLayout:n,disableCursor:r}),T=(0,R.useMemo)(()=>({get disableCursor(){return!!w.disableCursor},getPanelStyles:C,id:_,orientation:u,registerPanel:e=>{let t=x.current;return t.panels=Rg(u,[...t.panels,e]),b(),()=>{t.panels=t.panels.filter(t=>t!==e),b()}},registerSeparator:e=>{let t=x.current;return t.separators=Rg(u,[...t.separators,e]),b(),()=>{t.separators=t.separators.filter(t=>t!==e),b()}},updatePanelProps:(e,{disabled:t})=>{let n=x.current.panels.find(t=>t.id===e);n&&(n.panelConstraints.disabled=t);let r=Zg(_),i=Qg(_);r&&i&&t_(r,{...i,derivedPanelConstraints:Ig(r)})},updateSeparatorProps:(e,{disabled:t,disableDoubleClick:n})=>{let r=x.current.separators.find(t=>t.id===e);r&&(r.disabled=t,r.disableDoubleClick=n)}}),[C,_,b,u,w]),E=(0,R.useRef)(null);return cv(()=>{let e=v.current;if(e===null)return;let t=x.current,n;if(w.defaultLayout!==void 0&&Object.keys(w.defaultLayout).length===t.panels.length){n={};for(let e of t.panels){let t=w.defaultLayout[e.id];t!==void 0&&(n[e.id]=t)}}let r={disabled:!!i,element:e,id:_,mutableState:{defaultLayout:n,disableCursor:!!w.disableCursor,expandedPanelSizes:x.current.lastExpandedPanelSizes,layouts:x.current.layouts},orientation:u,panels:t.panels,resizeTargetMinimumSize:t.resizeTargetMinimumSize,separators:t.separators};E.current=r;let a=av(r),{defaultLayoutDeferred:o,derivedPanelConstraints:s,layout:c}=Qg(r.id,!0);!o&&s.length>0&&(h(c),g(c));let l=e_(_,e=>{let{defaultLayoutDeferred:t,derivedPanelConstraints:n,layout:i}=e.next;if(t||n.length===0)return;let a=r.panels.map(({id:e})=>e).join(`,`);r.mutableState.layouts[a]=i,n.forEach(t=>{if(t.collapsible){let{layout:n}=e.prev??{};if(n){let e=g_(t.collapsedSize,i[t.panelId]),a=g_(t.collapsedSize,n[t.panelId]);e&&!a&&(r.mutableState.expandedPanelSizes[t.panelId]=n[t.panelId])}}});let o=A_().state!==`active`;h(i),o&&g(i)});return()=>{E.current=null,a(),l()}},[i,_,g,h,u,y,w]),(0,R.useEffect)(()=>{let e=E.current;e&&(e.mutableState.defaultLayout=n,e.mutableState.disableCursor=!!r)}),(0,z.jsx)(fv.Provider,{value:T,children:(0,z.jsx)(`div`,{...p,className:t,"data-group":!0,"data-testid":_,id:_,ref:S,style:{height:`100%`,width:`100%`,overflow:`hidden`,...f,display:`flex`,flexDirection:u===`horizontal`?`row`:`column`,flexWrap:`nowrap`,touchAction:u===`horizontal`?`pan-y`:`pan-x`},children:e})})}mv.displayName=`Group`;function hv(){let e=(0,R.useContext)(fv);return Lg(e,`Group Context not found; did you render a Panel or Separator outside of a Group?`),e}function gv(e,t){let{id:n}=hv(),r=(0,R.useRef)({collapse:I_,expand:I_,getSize:()=>({asPercentage:0,inPixels:0}),isCollapsed:()=>!1,resize:I_});(0,R.useImperativeHandle)(t,()=>r.current,[]),cv(()=>{Object.assign(r.current,S_({groupId:n,panelId:e}))})}function _v({children:e,className:t,collapsedSize:n=`0%`,collapsible:r=!1,defaultSize:i,disabled:a,elementRef:o,groupResizeBehavior:s=`preserve-relative-size`,id:c,maxSize:l=`100%`,minSize:u=`0%`,onResize:d,panelRef:f,style:p,...m}){let h=!!c,g=sv(c),_=dv({disabled:a}),v=(0,R.useRef)(null),y=uv(v,o),{getPanelStyles:b,id:x,orientation:S,registerPanel:C,updatePanelProps:w}=hv(),T=d!==null,E=lv((e,t,n)=>{d?.(e,c,n)});cv(()=>{let e=v.current;if(e!==null)return C({element:e,id:g,idIsStable:h,mutableValues:{expandToSize:void 0,prevSize:void 0},onResize:T?E:void 0,panelConstraints:{groupResizeBehavior:s,collapsedSize:n,collapsible:r,defaultSize:i,disabled:_.disabled,maxSize:l,minSize:u}})},[s,n,r,i,T,g,h,l,u,E,C,_]),(0,R.useEffect)(()=>{w(g,{disabled:a})},[a,g,w]),gv(g,f);let D=()=>{let e=b(x,g);if(e)return JSON.stringify(e)},O=(0,R.useSyncExternalStore)(e=>e_(x,e),D,D),k;return k=O?JSON.parse(O):i?{flexGrow:void 0,flexShrink:void 0,flexBasis:i}:{flexGrow:1},(0,z.jsx)(`div`,{...m,"data-disabled":a||void 0,"data-panel":!0,"data-testid":g,id:g,ref:y,style:{...vv,display:`flex`,flexBasis:0,flexShrink:1,overflow:`visible`,...k},children:(0,z.jsx)(`div`,{className:t,style:{maxHeight:`100%`,maxWidth:`100%`,flexGrow:1,overflow:`auto`,...p,touchAction:S===`horizontal`?`pan-y`:`pan-x`},children:e})})}_v.displayName=`Panel`;var vv={minHeight:0,maxHeight:`100%`,height:`auto`,minWidth:0,maxWidth:`100%`,width:`auto`,border:`none`,borderWidth:0,padding:0,margin:0};function yv({layout:e,panelConstraints:t,panelId:n,panelIndex:r}){let i,a,o=e[n],s=t.find(e=>e.panelId===n);if(s){let c=s.maxSize,l=s.collapsible?s.collapsedSize:s.minSize,u=[r,r+1];a=x_({layout:y_({delta:l-o,initialLayout:e,panelConstraints:t,pivotIndices:u,prevLayout:e}),panelConstraints:t})[n],i=x_({layout:y_({delta:c-o,initialLayout:e,panelConstraints:t,pivotIndices:u,prevLayout:e}),panelConstraints:t})[n]}return{valueControls:n,valueMax:i,valueMin:a,valueNow:o}}function bv({children:e,className:t,disabled:n,disableDoubleClick:r,elementRef:i,id:a,style:o,...s}){let c=sv(a),l=dv({disabled:n,disableDoubleClick:r}),[u,d]=(0,R.useState)({}),[f,p]=(0,R.useState)(`inactive`),[m,h]=(0,R.useState)(!1),g=(0,R.useRef)(null),_=uv(g,i),{disableCursor:v,id:y,orientation:b,registerSeparator:x,updateSeparatorProps:S}=hv(),C=b===`horizontal`?`vertical`:`horizontal`;cv(()=>{let e=g.current;if(e!==null){let t={disabled:l.disabled,disableDoubleClick:l.disableDoubleClick,element:e,id:c},n=x(t),r=j_(e=>{p(e.next.state!==`inactive`&&e.next.hitRegions.some(e=>e.separator===t)?e.next.state:`inactive`)}),i=e_(y,e=>{let{derivedPanelConstraints:n,layout:r,separatorToPanels:i}=e.next,a=i.get(t);if(a){let e=a[0],t=a.indexOf(e);d(yv({layout:r,panelConstraints:n,panelId:e.id,panelIndex:t}))}});return()=>{r(),i(),n()}}},[y,c,x,l]),(0,R.useEffect)(()=>{S(c,{disabled:n,disableDoubleClick:r})},[n,r,c,S]);let w;n&&!v&&(w=`not-allowed`);let T;if(n)T=`disabled`;else switch(f){case`active`:T=`active`;break;default:T=m?`focus`:f}return(0,z.jsx)(`div`,{...s,"aria-controls":u.valueControls,"aria-disabled":n||void 0,"aria-orientation":C,"aria-valuemax":u.valueMax,"aria-valuemin":u.valueMin,"aria-valuenow":u.valueNow,children:e,className:t,"data-separator":T,"data-testid":c,id:c,onBlur:()=>h(!1),onFocus:()=>h(!0),ref:_,role:`separator`,style:{flexBasis:`auto`,cursor:w,...o,flexGrow:0,flexShrink:0,touchAction:`none`},tabIndex:n?void 0:0})}bv.displayName=`Separator`;var xv=`relative flex w-px shrink-0 items-center justify-center bg-sidebar-border outline-none transition-colors duration-[var(--motion-duration-fast)] after:absolute after:inset-y-0 after:left-1/2 after:w-3 after:-translate-x-1/2 hover:bg-[var(--border-strong)] focus-visible:shadow-[var(--state-focus-ring)] data-[separator=active]:bg-[var(--border-strong)] [aria-orientation=horizontal]:h-px [aria-orientation=horizontal]:w-full [aria-orientation=horizontal]:after:inset-x-0 [aria-orientation=horizontal]:after:inset-y-auto [aria-orientation=horizontal]:after:top-1/2 [aria-orientation=horizontal]:after:h-3 [aria-orientation=horizontal]:after:w-full [aria-orientation=horizontal]:after:translate-x-0 [aria-orientation=horizontal]:after:-translate-y-1/2 [&[aria-orientation=horizontal]>div]:rotate-90`;function Sv({className:e,...t}){return(0,z.jsx)(mv,{className:q(`min-h-0 w-full`,e),...t})}var Cv=_v;function wv({className:e,withHandle:t,...n}){return(0,z.jsx)(bv,{className:q(xv,e),...n,children:t&&(0,z.jsx)(`div`,{className:`z-10 flex h-5 w-3 items-center justify-center rounded-[var(--radius-xs)] border border-sidebar-border bg-[var(--surface-card)] shadow-[var(--shadow-xs)]`,children:(0,z.jsx)(Do,{className:`size-3 text-[var(--icon-color-muted)]`})})})}var Tv=`b`,Ev=(0,R.createContext)(null);function Dv(){let e=(0,R.useContext)(Ev);if(!e)throw Error(`useSidebar must be used within a SidebarProvider.`);return e}function Ov({children:e,className:t,defaultOpen:n=!0,open:r,onOpenChange:i,style:a,...o}){let[s,c]=(0,R.useState)(n),l=r??s,u=(0,R.useCallback)(e=>{let t=typeof e==`function`?e(l):e;i?.(t),r===void 0&&c(t)},[i,l,r]),d=(0,R.useCallback)(()=>{u(e=>!e)},[u]);(0,R.useEffect)(()=>{let e=e=>{e.key.toLowerCase()===Tv&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),d())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[d]);let f=(0,R.useMemo)(()=>({open:l,setOpen:u,state:l?`expanded`:`collapsed`,toggleSidebar:d}),[l,u,d]);return(0,z.jsx)(Ev.Provider,{value:f,children:(0,z.jsx)(`div`,{"data-sidebar-wrapper":``,"data-state":l?`expanded`:`collapsed`,className:q(`group/sidebar-wrapper flex min-h-svh w-full bg-background text-foreground has-[[data-variant=inset]]:bg-background`,t),style:{"--sidebar-width":`var(--layout-sidebar-width)`,...a},...o,children:e})})}function kv({children:e,className:t,collapsible:n=`offcanvas`,variant:r=`sidebar`,...i}){let{setOpen:a,state:o}=Dv(),s=o===`collapsed`&&n===`offcanvas`;return(0,z.jsxs)(z.Fragment,{children:[!s&&n===`offcanvas`&&(0,z.jsx)(`button`,{"aria-label":`Close sidebar`,className:`fixed inset-0 z-30 bg-[var(--surface-overlay)] md:hidden`,onClick:()=>a(!1),type:`button`}),(0,z.jsx)(`aside`,{"data-collapsible":o===`collapsed`?n:``,"data-state":o,"data-variant":r,className:q(`group/sidebar fixed inset-y-0 left-0 z-40 flex h-svh w-[var(--sidebar-width)] shrink-0 flex-col overflow-hidden text-sidebar-foreground transition-transform duration-[var(--motion-duration-normal)] ease-[var(--motion-ease-standard)] md:relative md:z-auto`,s&&`hidden`,!s&&`translate-x-0`,!s&&r===`sidebar`&&`border-r border-sidebar-border bg-sidebar`,!s&&r===`inset`&&`border-r border-sidebar-border bg-sidebar`,t),...i,children:!s&&(0,z.jsx)(`div`,{className:`flex h-full min-h-0 flex-col bg-sidebar`,children:e})})]})}function Av({className:e,...t}){return(0,z.jsx)(`div`,{className:q(`flex min-h-[var(--layout-topbar-height)] items-center gap-2 border-b border-sidebar-border px-3 group-data-[state=collapsed]/sidebar:justify-center group-data-[state=collapsed]/sidebar:px-2`,e),...t})}function jv({className:e,...t}){return(0,z.jsx)(`main`,{className:q(`relative flex min-w-0 flex-1 flex-col bg-[var(--surface-panel)]`,e),...t})}function Mv({className:e,"aria-label":t,title:n=`Toggle sidebar`,...r}){let{toggleSidebar:i}=Dv(),a=t??(typeof n==`string`?n:`Toggle sidebar`);return(0,z.jsxs)(`button`,{"aria-label":a,className:q(`inline-flex size-8 shrink-0 items-center justify-center rounded-[var(--radius-sm)] text-muted-foreground outline-none transition-colors hover:bg-accent hover:text-accent-foreground focus-visible:shadow-[var(--state-focus-ring)] disabled:pointer-events-none disabled:opacity-[var(--opacity-disabled)]`,e),onClick:i,title:n,type:`button`,...r,children:[(0,z.jsx)(No,{className:`size-4`}),(0,z.jsx)(`span`,{className:`sr-only`,children:a})]})}function Nv({className:e,...t}){return(0,z.jsx)(`div`,{className:q(`min-h-0 flex-1 overflow-y-auto p-2 group-data-[state=collapsed]/sidebar:px-2`,e),...t})}function Pv({className:e,...t}){return(0,z.jsx)(`section`,{className:q(`relative space-y-1 group-data-[state=collapsed]/sidebar:space-y-2`,e),...t})}function Fv({className:e,...t}){return(0,z.jsx)(`div`,{className:q(`flex items-center gap-2 group-data-[state=collapsed]/sidebar:hidden`,e),...t})}function Iv({className:e,...t}){return(0,z.jsx)(`div`,{className:q(`min-w-0 flex-1 px-2 py-1 text-[length:var(--font-size-xs)] font-medium text-[var(--text-secondary)]`,e),...t})}function Lv({className:e,...t}){return(0,z.jsx)(`button`,{className:q(`inline-flex size-7 shrink-0 items-center justify-center rounded-[var(--radius-sm)] text-[var(--icon-color-default)] outline-none transition-colors hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:shadow-[var(--state-focus-ring)]`,e),type:`button`,...t})}function Rv({className:e,...t}){return(0,z.jsx)(`div`,{className:q(`w-full`,e),...t})}function zv({className:e,...t}){return(0,z.jsx)(`ul`,{className:q(`space-y-1`,e),...t})}function Bv({className:e,...t}){return(0,z.jsx)(`li`,{className:q(`min-w-0`,e),...t})}function Vv({className:e,isActive:t,...n}){return(0,z.jsx)(`button`,{className:q(`flex min-h-8 w-full min-w-0 items-center gap-2 rounded-[var(--radius-sm)] px-2 py-1.5 text-left text-[length:var(--font-size-sm)] outline-none transition-colors duration-[var(--motion-duration-fast)] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:shadow-[var(--state-focus-ring)] group-data-[state=collapsed]/sidebar:justify-center group-data-[state=collapsed]/sidebar:px-0`,t&&`bg-sidebar-accent text-sidebar-accent-foreground`,e),...n})}function Hv({className:e,...t}){return(0,z.jsx)(`ul`,{className:q(`ml-4 mt-1 space-y-1 border-l border-sidebar-border pl-2 group-data-[state=collapsed]/sidebar:hidden`,e),...t})}function Uv({className:e,...t}){return(0,z.jsx)(`li`,{className:q(`min-w-0`,e),...t})}function Wv({className:e,isActive:t,...n}){return(0,z.jsx)(`button`,{className:q(`flex min-h-7 w-full min-w-0 items-center gap-2 rounded-[var(--radius-sm)] px-2 py-1 text-left text-[length:var(--font-size-sm)] outline-none transition-colors duration-[var(--motion-duration-fast)] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:shadow-[var(--state-focus-ring)]`,t&&`bg-sidebar-accent text-sidebar-accent-foreground`,e),...n})}function Gv({className:e,...t}){return(0,z.jsx)(`textarea`,{className:q(`flex min-h-16 w-full min-w-0 resize-none rounded-[var(--radius-sm)] border border-input bg-[var(--surface-input)] px-3 py-2 text-[length:var(--font-size-md)] shadow-[var(--shadow-xs)] outline-none transition-[border-color,box-shadow] duration-[var(--motion-duration-fast)] placeholder:text-[var(--text-tertiary)] focus-visible:border-ring focus-visible:shadow-[var(--state-focus-ring)] disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-[var(--opacity-disabled)]`,e),...t})}function Kv(e,t=globalThis){let n=e.isComposing||e.keyCode===229;return e.key!==`Enter`||e.shiftKey||e.altKey||n||!Jv(e)||Yv(t)?null:e.metaKey||e.ctrlKey?`modifiedSubmit`:`submit`}function qv(e,t){return e===`modifiedSubmit`?`queue`:t?.activeTurnId?t.status===`running`?`steer`:null:`send`}function Jv(e){return e.code===`Enter`||e.code===`NumpadEnter`}function Yv(e){if((e.navigator?.virtualKeyboard?.boundingRect?.height??0)>0||e.navigator?.userAgentData?.mobile)return!0;let t=e.navigator?.userAgent??``;if(/(Android|iPhone|iPad|iPod|Mobile|Windows Phone)/i.test(t))return!0;if((e.navigator?.maxTouchPoints??0)===0||!e.matchMedia)return!1;let n=e.matchMedia(`(pointer: coarse)`).matches,r=e.matchMedia(`(any-pointer: fine)`).matches,i=e.matchMedia(`(hover: hover)`).matches;return n&&!r&&!i}function Xv(e,t){let n=Zv(e.trim());for(let e of[...t].sort((e,t)=>t.length-e.length)){let t=Zv(e),r=t.endsWith(`/`)?t:`${t}/`;if(n.startsWith(r))return n.slice(r.length)}return n}function Zv(e){return e.replaceAll(`\\`,`/`)}var Qv=[`low`,`medium`,`high`,`xhigh`],$v=/%(?:2f|3a|5c|7e)/i,ey=/^[A-Za-z]:/;function ty(e){let t=e.trim();if(!t)return!1;for(let e=0;e<8;e+=1){if($v.test(t)||t.includes(`/`)||t.includes(`\\`)||t.startsWith(`~`)||ey.test(t))return!1;try{let e=decodeURIComponent(t);if(e===t)return!0;t=e}catch{return!1}}return!1}function ny(e,t,n){if(!t)return null;let r=e.find(e=>e.id===t)??null;return r&&(!n||r.projectId===n)?r:null}function ry(e,t,n,r){let i=new Set(t.map(e=>e.id));return ny(Object.values(e).flat().filter(e=>i.has(e.projectId)),n,r)}function iy(e,t){return Object.fromEntries(Object.entries(e).filter(([e])=>t.has(e)))}function ay(e,t){let n=new Map;for(let e of t){if(e.status===`archived`)continue;let t=n.get(e.worktreePath);(!t||e.updatedAt.localeCompare(t.updatedAt)>0)&&n.set(e.worktreePath,e)}return e.map(e=>{let t=n.get(e.path);return t?{...e,chatId:t.id,chatStatus:t.status,chatTitle:t.title}:{...e,chatId:null,chatStatus:null,chatTitle:e.name}})}function oy(e){let t=e.filter(e=>e.codexThreadId),n=t.length>0?t:e,r=new Map;for(let e of n){let t=e.codexThreadId??e.id,n=r.get(t);(!n||n.status===`archived`&&e.status!==`archived`||n.status===e.status&&e.updatedAt.localeCompare(n.updatedAt)>0||n.status!==`archived`&&e.status!==`archived`&&e.updatedAt.localeCompare(n.updatedAt)>0)&&r.set(t,e)}return[...r.values()].sort((e,t)=>t.updatedAt.localeCompare(e.updatedAt))}function sy(e,t){return!!(t&&e.some(e=>e.chatId===t))}function cy(e,t,n,r){return n?!e||e.some(e=>e.id===n)||sy(t,n)?n:r??n:null}function ly(e){return e?e.supportedReasoningEfforts:Qv}function uy(e){return!!e?.additionalSpeedTiers.includes(`fast`)}function dy(e,t,n){return e?t===`fast`&&uy(e)?`fast`:null:n===`fast`?`fast`:null}function fy(e,t){return e.filter(e=>e.enabled&&t.has(e.path)).map(e=>({name:e.name,path:e.path}))}function py(e){return e.role===`event`?e.eventType===`turn/plan/updated`||e.eventType===`item/plan/delta`?`plan`:e.eventType===`turn/diff/updated`?`diff`:e.eventType===`item/commandExecution/outputDelta`||e.eventType===`command/exec/outputDelta`?`command`:e.eventType===`item/fileChange/patchUpdated`||e.eventType===`item/fileChange/outputDelta`?`file`:e.eventType?.startsWith(`item/reasoning/`)&&e.eventType!==`item/reasoning/summaryPartAdded`?`reasoning`:e.eventType===`warning`||e.eventType===`guardianWarning`||e.eventType===`configWarning`?`warning`:null:null}function my(e){return py(e)!==null}function hy(e){let t=Cy(e);return{explanation:Ty(t,`explanation`)??null,plan:wy(t,`plan`).map(e=>{let t=Ty(e,`step`),n=Ty(e,`status`);return!t||n!==`completed`&&n!==`inProgress`&&n!==`pending`?null:{step:t,status:n}}).filter(e=>!!e)}}function gy(e){let t=Cy(e),n=Ty(t,`diff`)??``;return{diff:n,files:Oy(t,`files`).filter(Boolean),hasDiff:Dy(t,`hasDiff`)??!!n}}function _y(e){return wy(Cy(e),`changes`).map(e=>{let t=Ty(e,`path`);return t?{path:t,kind:Ty(e,`kind`)??`update`,diff:Ty(e,`diff`)??``}:null}).filter(e=>!!e)}function vy(e){return Ty(Cy(e),`text`)??e.text}function yy(e){let t=Cy(e);return{summary:Ty(t,`message`)??Ty(t,`summary`)??e.text,details:Ty(t,`details`)??null}}function by(e){let t=Cy(e);return{capReached:t?.capReached===!0,command:Ty(t,`command`)??null,cwd:Ty(t,`cwd`)??null,durationMs:Ey(t,`durationMs`)??null,exitCode:Ey(t,`exitCode`)??null,stream:Ty(t,`stream`)??null,status:Ty(t,`status`)??null}}function xy(e){return{status:Ty(Cy(e),`status`)??null}}function Sy(e){let t=e.trimEnd();return t?t.split(/\r?\n/).length:0}function Cy(e){return ky(e.eventData)?e.eventData:null}function wy(e,t){let n=e?.[t];return Array.isArray(n)?n.filter(ky):[]}function Ty(e,t){let n=e?.[t];return typeof n==`string`?n:void 0}function Ey(e,t){let n=e?.[t];return typeof n==`number`&&Number.isFinite(n)?n:void 0}function Dy(e,t){let n=e?.[t];return typeof n==`boolean`?n:void 0}function Oy(e,t){let n=e?.[t];return Array.isArray(n)?n.filter(e=>typeof e==`string`):[]}function ky(e){return!!(e&&typeof e==`object`&&!Array.isArray(e))}var Ay=[`chat.created`,`chat.updated`,`chat.message.created`,`chat.message.deleted`,`agent.thread.started`,`agent.turn.started`,`agent.plan.updated`,`agent.diff.updated`,`agent.command.output`,`agent.file.updated`,`agent.reasoning.updated`,`agent.warning`,`agent.item.updated`,`agent.item.delta`,`agent.approval.requested`,`agent.approval.resolved`,`agent.turn.completed`,`agent.error`,`agent.event`,`auth.updated`],jy=`phantom.chatScroll:v1:`,My=4,Ny=5,Py={chat:`chat`,effort:`effort`,expandedProject:`expandedProject`,fileQuery:`fileQuery`,model:`model`,project:`project`,serviceTier:`serviceTier`},Fy={archived:{badge:`secondary`,dot:`bg-[var(--status-archived-dot)]`,label:`Archived`},failed:{badge:`danger`,dot:`bg-[var(--semantic-danger-fg)]`,label:`Failed`},idle:{badge:`secondary`,dot:`bg-[var(--status-idle-dot)]`,label:`Idle`},running:{badge:`info`,dot:`bg-[var(--semantic-info-fg)]`,label:`Running`},waitingForApproval:{badge:`warning`,dot:`bg-[var(--semantic-warning-fg)]`,label:`Approval`}};function Iy(e){if(e.kind!==`pullRequest`||!e.headRef)return null;if(e.headRepoFullName&&e.baseRepoFullName&&e.headRepoFullName!==e.baseRepoFullName){let[t]=e.headRepoFullName.split(`/`);return t?`${t}/${e.headRef}`:e.headRef}return e.headRef}function Ly(e,t){return!e||!t?.available?null:t.targets.find(t=>Iy(t)===e.branch)??null}function Ry(e,t){return t?.title??e.name}function zy({className:e}){return(0,z.jsx)(`svg`,{"aria-hidden":`true`,className:e,fill:`currentColor`,viewBox:`0 0 24 24`,children:(0,z.jsx)(`path`,{d:`M12 0.5C5.65 0.5 0.5 5.65 0.5 12c0 5.09 3.29 9.39 7.86 10.92 0.58 0.1 0.79-0.25 0.79-0.56 0-0.27-0.01-1.18-0.02-2.14-3.2 0.7-3.88-1.36-3.88-1.36-0.52-1.33-1.28-1.68-1.28-1.68-1.05-0.72 0.08-0.7 0.08-0.7 1.16 0.08 1.77 1.19 1.77 1.19 1.03 1.76 2.7 1.25 3.36 0.96 0.1-0.75 0.4-1.25 0.73-1.54-2.55-0.29-5.24-1.28-5.24-5.68 0-1.25 0.45-2.28 1.19-3.08-0.12-0.29-0.52-1.46 0.11-3.04 0 0 0.97-0.31 3.17 1.18a11.02 11.02 0 0 1 5.77 0c2.2-1.49 3.17-1.18 3.17-1.18 0.63 1.58 0.23 2.75 0.11 3.04 0.74 0.8 1.19 1.83 1.19 3.08 0 4.42-2.69 5.39-5.25 5.68 0.41 0.35 0.78 1.05 0.78 2.12 0 1.53-0.01 2.76-0.01 3.14 0 0.31 0.21 0.67 0.79 0.56A11.51 11.51 0 0 0 23.5 12C23.5 5.65 18.35 0.5 12 0.5Z`})})}function By(e){return e.status!==`archived`&&e.status!==`running`&&e.status!==`waitingForApproval`&&!e.activeTurnId}var Vy=6e3,Hy=3,Uy=10*1024*1024,Wy=new Uint8Array([137,80,78,71,13,10,26,10]),Gy=`.png,image/png`,Ky=`\0`;function qy(e,t){return e?t[e]?.[0]??null:null}function Jy(e,t){return`${e}:${t}`}function Yy(e){return e instanceof Error?e.message:typeof e==`string`?e:`Something went wrong`}function Xy(e,t){let n=Yy(t);return n?`${e}: ${n}`:e}function Zy(e,t){return e.get(t)?.trim()||null}function Qy(e,t){let n=e.getAll(t).flatMap(e=>e.split(`,`)).map(e=>e.trim()).filter(Boolean);return new Set(n)}function $y(e,t){return`${e??``}\u0000${t??``}`}function eb(e,t,n){n?e.set(t,n):e.delete(t)}function tb(e,t,n){e.delete(t);let r=[...n].sort();r.length>0&&e.set(t,r.join(`,`))}function nb(e,t){if(!t)return;let n=Qy(e,Py.expandedProject);n.add(t),tb(e,Py.expandedProject,n)}function rb(e,t=44){if(e.length<=t)return e;let n=t-3,r=e.slice(-n),i=r.indexOf(`/`);return`...${i>0?r.slice(i):r}`}function ib(e){return`${jy}${e}`}function ab(e){try{let t=window.localStorage.getItem(ib(e));if(!t)return null;let n=JSON.parse(t);return n.version!==1||typeof n.top!=`number`||!Number.isFinite(n.top)?null:{version:1,pinnedToBottom:n.pinnedToBottom===!0,top:Math.max(0,n.top)}}catch{return null}}function ob(e,t){try{window.localStorage.setItem(ib(e),JSON.stringify({version:1,pinnedToBottom:sb(t),top:Math.max(0,Math.round(t.scrollTop))}))}catch{}}function sb(e){return e.scrollHeight-e.scrollTop-e.clientHeight<=My}function cb(){let[e,t]=Ha(),n=(0,R.useRef)(e);n.current=e;let r=Zy(e,Py.project),i=Zy(e,Py.chat),a=$y(r,i),o=(0,R.useRef)(a);o.current=a;let s=Zy(e,Py.model),c=Zy(e,Py.effort),l=Zy(e,Py.serviceTier),u=e.get(Py.fileQuery)??``,d=ty(u)?u:``,f=(0,R.useMemo)(()=>Qy(e,Py.expandedProject),[e]),[p,m]=(0,R.useState)([]),[h,g]=(0,R.useState)({}),[_,v]=(0,R.useState)({}),[y,b]=(0,R.useState)({}),[x,S]=(0,R.useState)(()=>new Set),[C,w]=(0,R.useState)([]),[T,E]=(0,R.useState)(null),D=(0,R.useRef)(T);D.current=T;let[O,k]=(0,R.useState)(!1),[A,j]=(0,R.useState)(``),[M,ee]=(0,R.useState)(null),[N,te]=(0,R.useState)(null),[P,F]=(0,R.useState)(`default`),[ne,re]=(0,R.useState)(!1),[ie,ae]=(0,R.useState)(``),[I,L]=(0,R.useState)([]),[oe,se]=(0,R.useState)([]),[ce,le]=(0,R.useState)(()=>new Set),[ue,de]=(0,R.useState)([]),[fe,pe]=(0,R.useState)(null),me=d||(fe?.workspaceSelectionKey===a?fe.query:``),he=(0,R.useRef)(me),ge=(0,R.useRef)(0),_e=(0,R.useRef)(new Map),ve=(0,R.useRef)(new Map),ye=(0,R.useRef)(0),be=(0,R.useRef)(0),[xe,Se]=(0,R.useState)([]),[Ce,we]=(0,R.useState)([]),[Te,Ee]=(0,R.useState)([]),[De,Oe]=(0,R.useState)(`Starting`),[ke,Ae]=(0,R.useState)(null),[je,Me]=(0,R.useState)(null),[Ne,Pe]=(0,R.useState)(null),[Fe,Ie]=(0,R.useState)(null),[Le,ze]=(0,R.useState)(null),[Be,He]=(0,R.useState)(null),[Ue,We]=(0,R.useState)(null),[Ge,Ke]=(0,R.useState)(null),[qe,Je]=(0,R.useState)(null),[Ye,Xe]=(0,R.useState)([]),[Ze,Qe]=(0,R.useState)(!1),[B,$e]=(0,R.useState)(!0),[et,tt]=(0,R.useState)(()=>new Set),[nt,rt]=(0,R.useState)(()=>new Set),[it,at]=(0,R.useState)(!0),[ot,st]=(0,R.useState)(!1),[ct,lt]=(0,R.useState)(!1),[ut,dt]=(0,R.useState)(!1),[ft,pt]=(0,R.useState)(()=>new Set),[mt,ht]=(0,R.useState)(null),[gt,_t]=(0,R.useState)(null),[vt,yt]=(0,R.useState)(null),[bt,xt]=(0,R.useState)(!1),[St,Ct]=(0,R.useState)(null),[wt,Tt]=(0,R.useState)(!1),[Et,Dt]=(0,R.useState)(null),Ot=(0,R.useRef)(!1),kt=(0,R.useRef)(null),At=(0,R.useRef)(null),jt=(0,R.useRef)(new Set),Mt=(0,R.useRef)(!0),Nt=(0,R.useRef)(!1),Pt=(0,R.useRef)(null),Ft=(0,R.useRef)(null),It=(0,R.useRef)(null),Lt=(0,R.useRef)(null),Rt=(0,R.useRef)(0),zt=(0,R.useRef)(0),Bt=(0,R.useRef)(new Map),Vt=(0,R.useRef)(h),Ht=(0,R.useRef)(_),Ut=(0,R.useRef)(y),Wt=(0,R.useRef)(0),Gt=(0,R.useRef)(0),Kt=(0,R.useRef)(null),qt=(0,R.useRef)(null),Jt=(0,R.useRef)(ie),Yt=(0,R.useRef)(!1),Xt=(0,R.useRef)(null),Zt=(0,R.useRef)(new Set),Qt=(0,R.useRef)(new Map),[$t,en]=(0,R.useState)(null),tn=(0,R.useRef)($t);tn.current=$t;let V=Re(),nn=Ve({mutationFn:xs}),rn=Ve({mutationFn:Ss}),an=Ve({mutationFn:({input:e,projectId:t})=>Cs(t,e)}),on=Ve({mutationFn:({input:e,projectId:t})=>Ts(t,e)}),sn=Ve({mutationFn:({input:e,projectId:t})=>Es(t,e)}),cn=Ve({mutationFn:({chatId:e,input:t})=>Os(e,t)}),ln=Ve({mutationFn:({chatId:e,messageId:t})=>ks(e,t)}),un=Ve({mutationFn:({chatId:e,input:t})=>As(e,t)}),dn=Ve({mutationFn:({chatId:e,input:t})=>js(e,t)}),fn=Ve({mutationFn:({chatId:e,input:t})=>Ms(e,t)}),pn=Ve({mutationFn:Ns}),mn=Ve({mutationFn:({chatId:e,decision:t,requestId:n})=>Ps(e,n,t)}),hn=Ve({mutationFn:({archived:e,chatId:t})=>ws(t,e)});function gn(e){let t=Bt.current.get(e);t!==void 0&&(window.clearTimeout(t),Bt.current.delete(e))}function _n(e){gn(e),Xe(t=>t.filter(t=>t.id!==e))}function vn(e,t=`danger`){let n=zt.current+1;zt.current=n;let r=window.setTimeout(()=>_n(n),Vy);Bt.current.set(n,r),Xe(r=>{let i=[...r,{id:n,message:e,tone:t}].slice(-Hy),a=new Set(i.map(e=>e.id));for(let e of r)a.has(e.id)||gn(e.id);return i})}(0,R.useEffect)(()=>()=>{for(let e of Bt.current.values())window.clearTimeout(e);Bt.current.clear()},[]);function yn(e){tn.current=e,en(e)}function bn(e){en(t=>{let n=t?.chatId===e?null:t;return tn.current=n,n})}function xn(e,t){en(n=>{let r=n?.chatId===e&&n.requestId===t?null:n;return tn.current=r,r})}function Sn(e,r={}){let i=new URLSearchParams(n.current);e(i),n.current=i,t(i,{replace:r.replace??!1})}function Cn(e,t={}){e.clearFileQuery&&pe(null),Sn(t=>{`projectId`in e&&(eb(t,Py.project,e.projectId??null),nb(t,e.projectId??null)),`chatId`in e&&eb(t,Py.chat,e.chatId??null),e.clearFileQuery&&t.delete(Py.fileQuery)},t)}function wn(e,t,n={}){Sn(n=>{eb(n,e,t)},n)}function Tn(e){let t=e.trim()?e:null;if(!t){pe(null),wn(Py.fileQuery,null,{replace:!0});return}if(!ty(t)){pe({query:e,workspaceSelectionKey:a}),wn(Py.fileQuery,null,{replace:!0});return}pe(null),wn(Py.fileQuery,t,{replace:!0})}function En(e){let t=(_e.current.get(e)??0)+1;return _e.current.set(e,t),t}function Dn(e,t){return It.current===e&&_e.current.get(e)===t}function On(){let e=n.current;return $y(Zy(e,Py.project),Zy(e,Py.chat))}let H=(0,R.useMemo)(()=>ny(Object.values(h).flat(),i,r),[h,r,i]),kn=!i||!!H,An=!!H,jn=H?.id??null,U=H?.projectId??r;Lt.current=i,It.current=U,Vt.current=h,Ht.current=_,Ut.current=y,he.current=me;let Mn=(0,R.useMemo)(()=>p.find(e=>e.id===U)??null,[p,U]),Nn=U?y[U]??null:null,Pn=!!(U&&ft.has(U)),Fn=(0,R.useMemo)(()=>Nn?.available?Nn.targets.find(e=>e.number===mt)??null:null,[mt,Nn]),In=!!(U&&h[U]!==void 0&&_[U]!==void 0),Ln=!!(U&&sy(_[U]??[],i)),Rn=!!H?.activeTurnId,zn=H?.status===`archived`,Bn=H?.status===`running`&&Rn,Vn=(0,R.useMemo)(()=>I.find(e=>e.id===s)??I.find(e=>e.isDefault)??I[0]??null,[I,s]),Hn=(0,R.useMemo)(()=>ly(Vn),[Vn]),Un=uy(Vn),Wn=l===`fast`&&Un,Gn=(0,R.useMemo)(()=>oe.filter(e=>e.enabled&&ce.has(e.path)),[ce,oe]),Kn=Te.length>0||Ce.length>0||Gn.length>0;Jt.current=ie,Yt.current=Kn;let qn=!!Mn&&!i&&!!(ie.trim()||Kn),Jn=An&&!zn&&!!(ie.trim()||Kn)||qn,Yn=Rn?Bn?`steer`:`queue`:`send`,Xn=bt||zn||!!(i&&Et===i)||ln.isPending||un.isPending||!!(i&&Zt.current.has(i)),Zn=Jn&&!Xn&&(Yn!==`steer`||Bn),Qn=An&&!zn&&Jn&&!Xn,$n=Rn&&!wt&&!!H?.activeTurnId,er=!An||Xn,tr=!!Mn&&!Xn,nr=gb(Yn),rr=St===Yn?_b(St):nr,ir=(0,R.useMemo)(()=>I.map(e=>({value:e.id,label:e.displayName,description:e.description||e.model,keywords:[e.model]})),[I]),ar=(0,R.useMemo)(()=>[{value:`auto`,label:`Auto`,description:Vn?.defaultReasoningEffort?`Default: ${Vn.defaultReasoningEffort}`:`Use model default`},...Hn.map(e=>({value:e,label:hb(e)}))],[Vn,Hn]),or=(0,R.useMemo)(()=>oe.filter(e=>e.enabled&&!ce.has(e.path)).map(e=>({value:e.path,label:e.displayName,description:e.shortDescription??e.description,keywords:[e.name]})),[ce,oe]),sr=(0,R.useMemo)(()=>[Mn?.rootPath??null,H?.worktreePath??null].filter(e=>!!e).sort((e,t)=>t.length-e.length),[H?.worktreePath,Mn?.rootPath]),cr=(0,R.useMemo)(()=>{let e=new Map;for(let t of oe.filter(e=>e.enabled&&!ce.has(e.path)))e.set(t.path,t),e.set(Xv(t.path,sr),t);return ue.map(t=>e.get(t.path)??e.get(Xv(t.path,sr))??null).filter(e=>!!e).slice(0,Ny)},[sr,ue,ce,oe]),lr=(0,R.useMemo)(()=>xe.filter(e=>!Ce.some(t=>t.path===e.path)).map(e=>({value:e.path,label:e.relativePath,description:e.root,keywords:[e.name]})),[xe,Ce]),ur=(0,R.useMemo)(()=>M?p.find(e=>e.id===M)??null:null,[M,p]),dr=(0,R.useMemo)(()=>M?h[M]??[]:[],[h,M]),fr=(0,R.useMemo)(()=>dr.find(e=>e.status===`running`||e.status===`waitingForApproval`||!!e.activeTurnId||!!e.hasQueuedMessages||!!e.isDrainingQueuedMessages||Zt.current.has(e.id))??null,[dr]),pr=(0,R.useMemo)(()=>N?p.find(e=>e.id===N.projectId)??null:null,[N,p]),mr=(0,R.useMemo)(()=>N?(_[N.projectId]??[]).find(e=>e.path===N.worktreePath)??null:null,[N,_]),hr=!!(N?.forceRequired||mr&&!mr.isClean),gr=(0,R.useMemo)(()=>{if(!U)return null;let e=_[U]??[];return H?e.find(e=>e.path===H.worktreePath)??null:null},[H,U,_]),_r=(0,R.useMemo)(()=>Ly(gr,Nn),[Nn,gr]),vr=gr&&_r?Ry(gr,_r):null,yr=(0,R.useMemo)(()=>{let e={};for(let[t,n]of Object.entries(h)){let r=new Map;for(let e of n){let t=r.get(e.worktreePath)??[];t.push(e),r.set(e.worktreePath,t)}for(let[e,t]of r)r.set(e,oy(t));e[t]=r}return e},[h]),br=(0,R.useMemo)(()=>!U||!gr?[]:yr[U]?.get(gr.path)??[],[yr,U,gr]),xr=(0,R.useMemo)(()=>C.filter(e=>e.role!==`event`||my(e)),[C]),Sr=(0,R.useMemo)(()=>xr.filter(e=>Zb(e)),[xr]),Cr=(0,R.useMemo)(()=>Sr.map(e=>e.id).join(Ky),[Sr]),wr=(0,R.useMemo)(()=>xr.filter(e=>!Zb(e)),[xr]),Tr=(0,R.useMemo)(()=>Db(wr),[wr]),Er=B&&p.length===0,Dr=!!i&&ot&&wr.length===0&&Sr.length===0;(0,R.useEffect)(()=>{jr(),Mr(),V.fetchQuery(Fs()).then(()=>Oe(`Ready`)).catch(e=>Oe(e.message))},[]),(0,R.useEffect)(()=>{u&&!ty(u)&&wn(Py.fileQuery,null,{replace:!0})},[u]),(0,R.useEffect)(()=>{if(!U){de([]);return}let e=new AbortController;return Nr(U,e.signal),Ir(U,{updateSelection:kn}),Lr(U,{updateSelection:kn}),()=>{e.abort()}},[kn,U]),(0,R.useEffect)(()=>{ht(null),U&&Rr(U)},[U,i]),(0,R.useEffect)(()=>{mt===null||!Nn?.available||Nn.targets.some(e=>e.number===mt)||ht(null)},[mt,Nn]),(0,R.useEffect)(()=>{if(Rt.current+=1,Mt.current=!0,Ft.current=null,Me(null),Pe(null),Je(null),Pt.current!==null&&(cancelAnimationFrame(Pt.current),Pt.current=null),xt(!!(i&&Zt.current.has(i))),Ct(i?Qt.current.get(i)??null:null),!kn){w([]),E(null),yn(null),we([]),Ee([]),le(new Set),Se([]),se([]),st(!1),lt(!1),dt(!1);return}if(!i){if(w([]),E(null),yn(null),we([]),Ee([]),le(new Set),Se([]),se([]),st(!1),dt(!1),!U){lt(!1);return}let e=new AbortController;return Pr(U,e.signal),()=>{e.abort()}}we([]),Ee([]),le(new Set),Se([]),se([]),w([]),E(null),Je(null),yn(null);let e=new AbortController;Hr(i,{showLoading:!0}),Br(i),Fr(i,e.signal);let t=new EventSource(vs(`/chats/${encodeURIComponent(i)}/events`)),n=e=>{let t=JSON.parse(e.data);if(t.type===`agent.approval.requested`){let e=t.data;be.current+=1,yn({...e,chatId:i}),V.invalidateQueries({queryKey:J.chatApproval(i)})}t.type===`agent.approval.resolved`&&(be.current+=1,bn(i),V.invalidateQueries({queryKey:J.chatApproval(i)})),V.invalidateQueries({queryKey:J.messages(i)}),V.invalidateQueries({queryKey:J.chat(i)}),Hr(i),Br(i),U&&(V.invalidateQueries({queryKey:J.projectChats(U)}),Lr(U))};for(let e of Ay)t.addEventListener(e,n);return t.onopen=()=>{Vr(i,e.signal)},t.onerror=()=>Oe(`Event stream disconnected`),()=>{Ur(i),e.abort();for(let e of Ay)t.removeEventListener(e,n);t.close()}},[kn,i,U]),(0,R.useLayoutEffect)(()=>{if(!i||T!==i)return;let e=kt.current;if(e){if(Ft.current!==i){let t=ab(i),n=!t||t.pinnedToBottom;Nt.current=!0,e.scrollTop=n?e.scrollHeight:t.top,Ft.current=i,Mt.current=n||sb(e);return}Mt.current&&(Nt.current=!0,e.scrollTop=e.scrollHeight)}},[T,Cr,i,wr]),(0,R.useLayoutEffect)(()=>{let e=new Set(Cr?Cr.split(Ky):[]),t=[...e].some(e=>!jt.current.has(e));if(jt.current=e,!t)return;let n=At.current;n&&(n.scrollTop=n.scrollHeight)},[Cr]),(0,R.useEffect)(()=>()=>{Pt.current!==null&&(cancelAnimationFrame(Pt.current),Pt.current=null);let e=Lt.current;e&&Ur(e)},[]),(0,R.useEffect)(()=>{s&&I.length>0&&!I.some(e=>e.id===s)&&wn(Py.model,null,{replace:!0})},[I,s]),(0,R.useEffect)(()=>{if(!c||c===`auto`){c===`auto`&&wn(Py.effort,null,{replace:!0});return}I.length===0||!Vn||Hn.includes(c)||wn(Py.effort,null,{replace:!0})},[I.length,c,Vn,Hn]),(0,R.useEffect)(()=>{l&&(l!==`fast`||Vn&&!Un)&&wn(Py.serviceTier,null,{replace:!0})},[Vn,Un,l]),(0,R.useEffect)(()=>{let e=ge.current+1;if(ge.current=e,!jn||!me.trim()){Se([]),Ie(null),dt(!1);return}let t=new AbortController,n=me.trim();Ie(null),dt(!0);let r=setTimeout(()=>{V.fetchQuery(qs(jn,n,t.signal)).then(n=>{t.signal.aborted||ge.current!==e||(Se(n.files),Ie(null))}).catch(n=>{n.name!==`AbortError`&&!t.signal.aborted&&ge.current===e&&Ie(Xy(`Could not search files`,n))}).finally(()=>{!t.signal.aborted&&ge.current===e&&dt(!1)})},160);return()=>{clearTimeout(r),t.abort()}},[me,jn]),(0,R.useEffect)(()=>{!kn||br.length===0||br.some(e=>e.id===i)||Cn({chatId:br[0]?.id??null,clearFileQuery:!!me.trim()},{replace:!0})},[me,kn,i,br]),(0,R.useEffect)(()=>{!i||kn||Ln||!U||!In||Cn({chatId:qy(U,_)?.chatId??null,clearFileQuery:!!me.trim()},{replace:!0})},[me,In,Ln,kn,i,U,_]);function Or(e,t){tt(n=>{let r=new Set(n);return t?r.add(e):r.delete(e),r})}function kr(e,t){rt(n=>{let r=new Set(n);return t?r.add(e):r.delete(e),r})}function Ar(e,t){pt(n=>{let r=new Set(n);return t?r.add(e):r.delete(e),r})}async function jr(){let e=o.current;$e(!0);try{let t=await V.fetchQuery(Is());m(t.projects),Ae(null);let n=new Set(t.projects.map(e=>e.id)),r=iy(Vt.current,n),i=iy(Ht.current,n),a=Object.fromEntries(Object.entries(Ut.current).filter(([e])=>n.has(e)));if(Vt.current=r,Ht.current=i,Ut.current=a,g(r),v(i),b(a),o.current!==e)return!0;let s=Lt.current,c=It.current,l=he.current,u=ry(r,t.projects,s,c),d=u?.projectId??(c&&t.projects.some(e=>e.id===c)?c:t.projects[0]?.id??null),f=c===d?s:null,p=u?.id??f;Cn({projectId:d,chatId:p,clearFileQuery:!!l.trim()&&s!==p},{replace:!0});for(let e of t.projects)Ir(e.id,{updateSelection:e.id===d}),Lr(e.id,{updateSelection:e.id===d});return!0}catch(e){return Ae(Xy(`Could not load projects`,e)),!1}finally{$e(!1)}}async function Mr(){at(!0);try{L((await V.fetchQuery(Ls())).models),ze(null)}catch(e){ze(Xy(`Could not load models`,e))}finally{at(!1)}}async function Nr(e,t){let n=En(e);try{let r=await V.fetchQuery(Vs(e,t));if(t?.aborted||!Dn(e,n))return;de(r.recentSkills)}catch(r){if(t?.aborted||r instanceof Error&&r.name===`AbortError`||!Dn(e,n))return;Pe(Xy(`Could not load recent skills`,r))}}async function Pr(e,t){lt(!0);try{let n=await V.fetchQuery(Hs(e,t));if(t?.aborted||It.current!==e||Lt.current)return;se(n.skills)}catch(n){if(t?.aborted||n instanceof Error&&n.name===`AbortError`||It.current!==e||Lt.current)return;Pe(Xy(`Could not load skills`,n))}finally{!t?.aborted&&It.current===e&&!Lt.current&<(!1)}}async function Fr(e,t){lt(!0);try{let n=await V.fetchQuery(Ks(e,t));if(t?.aborted)return;se(n.skills)}catch(e){if(t?.aborted||e instanceof Error&&e.name===`AbortError`)return;Pe(Xy(`Could not load skills`,e))}finally{t?.aborted||lt(!1)}}async function Ir(e,t={}){let n=o.current;Or(e,!0);try{let r=ay((await V.fetchQuery(Rs(e))).worktrees,Vt.current[e]??[]),i={...Ht.current,[e]:r};if(Ht.current=i,v(i),t.updateSelection===!1||It.current!==e||o.current!==n)return!0;let a=qy(e,i),s=Lt.current,c=he.current,l=cy(Vt.current[e],r,s,a?.chatId??null);return Cn({projectId:e,chatId:l,clearFileQuery:!!c.trim()&&s!==l},{replace:!0}),!0}catch(e){return Ae(Xy(`Could not load worktrees`,e)),!1}finally{Or(e,!1)}}async function Lr(e,t={}){let n=o.current;kr(e,!0);try{let r=await V.fetchQuery(zs(e)),i={...Vt.current,[e]:r.chats};Vt.current=i,g(i);let a=ay(Ht.current[e]??[],r.chats),s={...Ht.current,[e]:a};if(Ht.current=s,v(s),t.updateSelection===!1||It.current!==e||o.current!==n)return!0;let c=qy(e,s),l=Lt.current,u=he.current,d=r.chats.some(e=>e.id===l)?l:l?c?.chatId??r.chats[0]?.id??null:null;return Cn({projectId:e,chatId:d,clearFileQuery:!!u.trim()&&l!==d},{replace:!0}),!0}catch(e){return Ae(Xy(`Could not load chats`,e)),!1}finally{kr(e,!1)}}async function Rr(e){Ar(e,!0);try{let t=await V.fetchQuery(Bs(e)),n={...Ut.current,[e]:t.github};Ut.current=n,b(n)}catch{let t={...Ut.current,[e]:{available:!1,targets:[]}};Ut.current=t,b(t)}finally{Ar(e,!1)}}function zr(e){let t=Vt.current[e.projectId]??[],n=t.some(t=>t.id===e.id)?t.map(t=>t.id===e.id?e:t):[e,...t],r={...Vt.current,[e.projectId]:n};Vt.current=r,g(r);let i=Ht.current[e.projectId]??[],a={...Ht.current,[e.projectId]:ay(i,n)};Ht.current=a,v(a)}async function Br(e){zr((await V.fetchQuery(Us(e))).chat)}async function Vr(e,t){let n=ye.current+1;ye.current=n;let r=be.current;try{let i=await V.fetchQuery(Ws(e,t));Lt.current===e&&ye.current===n&&be.current===r&&yn(i.approval?{...i.approval,chatId:e}:null)}catch(r){if(t?.aborted||r instanceof Error&&r.name===`AbortError`)return;Lt.current===e&&ye.current===n&&vn(Xy(`Could not load approval`,r))}}async function Hr(e,t={}){let n=Wt.current+1;Wt.current=n,t.showLoading&&st(!0);try{let t=await V.fetchQuery(Gs(e));Lt.current===e&&Wt.current===n&&(w(t.messages),E(e),Me(null))}catch(t){Lt.current===e&&Wt.current===n&&Me(Xy(`Could not load messages`,t))}finally{t.showLoading&&Lt.current===e&&st(!1)}}function Ur(e){let t=kt.current;!t||Ft.current!==e||ob(e,t)}function Wr(){let e=Lt.current,t=kt.current;if(!(!e||!t||Ft.current!==e)){if(Mt.current=sb(t),Nt.current){Nt.current=!1;return}Pt.current===null&&(Pt.current=requestAnimationFrame(()=>{Pt.current=null,Lt.current===e&&Ft.current===e&&Ur(e)}))}}function Gr(){He(null),k(!0)}function Kr(){k(!1),He(null)}async function qr(e){e.preventDefault();let t=A.trim();if(!t)return;He(null);let n=o.current;Qe(!0);try{let e=await nn.mutateAsync(t);if(V.invalidateQueries({queryKey:J.projects}),j(``),Kr(),!await jr()||o.current!==n)return;Cn({projectId:e.project.id,chatId:null})}catch(e){He(Xy(`Could not add project`,e))}finally{Qe(!1)}}function Jr(e){We(null),ee(e.id)}function Yr(){ee(null),We(null)}async function Xr(e){if(e.preventDefault(),!ur||fr)return;We(null),Qe(!0);let t=ur.id,n=(Vt.current[t]??[]).map(e=>e.id),r=It.current===t;try{await rn.mutateAsync(t),V.removeQueries({exact:!0,queryKey:J.projects}),V.removeQueries({queryKey:J.projectWorktrees(t)}),V.removeQueries({queryKey:J.projectChats(t)});for(let e of n)V.removeQueries({queryKey:J.chat(e)});S(e=>{let n=new Set;for(let r of e)r.startsWith(`${t}:`)||n.add(r);return n}),r&&(ae(``),we([]),Ee([]),le(new Set),pe(null),Se([]),se([]),En(t),de([]),yn(null),Xt.current=null),Yr(),await jr()}catch(e){We(Xy(`Could not delete project`,e))}finally{Qe(!1)}}async function Zr(e,t,n={}){let r=await an.mutateAsync({projectId:e,input:n});return V.invalidateQueries({queryKey:J.projectWorktrees(e)}),V.invalidateQueries({queryKey:J.projectChats(e)}),V.invalidateQueries({queryKey:J.projectGitHubCheckoutTargets(e)}),S(t=>new Set(t).add(Jy(e,r.chat.worktreePath))),!await Ir(e,{updateSelection:!1})||!await Lr(e,{updateSelection:!1})?null:On()===t?(Cn({projectId:e,chatId:r.chat.id,clearFileQuery:!0}),It.current=e,Lt.current=r.chat.id,r.chat):r.chat}async function Qr(e,t){if(Ze||Ot.current)return null;Ae(null);let n=o.current,r=t?Jy(e,t.path):null;Ot.current=!0,r?yt(r):_t(e),Qe(!0);try{return await Zr(e,n,t?{worktreeName:t.name,worktreePath:t.path}:{})}catch(e){return vn(Xy(`Could not create worktree`,e)),null}finally{Ot.current=!1,_t(null),yt(null),Qe(!1)}}function $r(e,t){ei(e,t)}function ei(e,t){Ke(null),F(`default`),re(!1),te({forceRequired:!t.isClean,projectId:e,worktreePath:t.path})}function ti(){te(null),Ke(null),F(`default`),re(!1)}async function ni(e,t,n){Ke(null),Qe(!0);try{let r={name:t.name,path:t.path,force:n.force};n.branchMode===`keep`&&(r.keepBranch=!0),n.branchMode===`delete`&&(r.keepBranch=!1),await on.mutateAsync({projectId:e,input:r}),V.invalidateQueries({queryKey:J.projectWorktrees(e)}),V.invalidateQueries({queryKey:J.projectChats(e)}),ti(),await Ir(e,{updateSelection:It.current===e}),await Lr(e,{updateSelection:It.current===e})}catch(r){let i=r instanceof Error?r.message:String(r),a=!n.force&&i.includes(`has uncommitted changes`);a&&(F(n.branchMode),re(!1),te({forceRequired:!0,projectId:e,worktreePath:t.path})),N||a?Ke(Xy(`Could not delete worktree`,i)):vn(Xy(`Could not delete worktree`,i))}finally{Qe(!1)}}async function ri(e){e.preventDefault(),!(!N||!mr)&&await ni(N.projectId,mr,{branchMode:P,force:ne})}async function ii(e,t){if(!Ze){Ae(null),Qe(!0);try{await sn.mutateAsync({projectId:e,input:{name:t.name,path:t.path}}),V.invalidateQueries({queryKey:J.projectWorktrees(e)}),V.invalidateQueries({queryKey:J.projectChats(e)}),await Ir(e,{updateSelection:It.current===e}),await Lr(e,{updateSelection:It.current===e})}catch(e){vn(Xy(`Could not sync branch`,e))}finally{Qe(!1)}}}async function ai(e,t){if(Ze||hn.isPending||t&&!By(e))return;let n=Lt.current===e.id&&Xt.current?.chatId===e.id&&!!(Jt.current.trim()||Yt.current),r=Lt.current===e.id&&!!(Jt.current.trim()||Yt.current);if(t&&(r||n)){Pe(`Clear or send the current message before archiving this chat`),qt.current?.focus();return}Pe(null),Qe(!0),Dt(e.id);try{zr((await hn.mutateAsync({chatId:e.id,archived:t})).chat),V.invalidateQueries({queryKey:J.chat(e.id)}),V.invalidateQueries({queryKey:J.projectChats(e.projectId)}),V.invalidateQueries({queryKey:J.projectWorktrees(e.projectId)}),Lt.current===e.id&&t&&(Xt.current=null,ae(``),we([]),Ee([]),le(new Set)),await Lr(e.projectId,{updateSelection:!1}),await Ir(e.projectId,{updateSelection:!1})}catch(e){Pe(Xy(t?`Could not archive chat`:`Could not restore chat`,e))}finally{Dt(null),Qe(!1)}}function oi(){!U||!gr||Qr(U,gr)}function si(){!U||!gr||!gr.isManagedByPhantom||ei(U,gr)}async function ci(e){e.preventDefault(),await fi(`send`)}function li(e,t,n=[]){let r=Vn?.id??Vn?.model??t?.model??void 0,i=Vn?c&&Hn.includes(c)?c:null:t?.effort??null,a=dy(Vn,l,t?.serviceTier??null);return{attachments:n,effort:i,files:Ce.map(e=>({name:e.relativePath,path:e.path})),model:r,serviceTier:a,skills:fy(oe,ce),text:e}}async function ui(e,t){let n=[];for(let r of t){if(r.record){n.push(r.record);continue}if(!r.file)continue;let{attachment:t}=await bs(e,r.file);n.push(t)}return n}async function di(e,t,n,r,i,a,o){let s=null,c=()=>On()===a,l=()=>s!==null&&On()===$y(e,s);Ot.current=!0,_t(e),Qe(!0);try{let u=await Zr(e,a,{githubTargetNumber:o??void 0,initialMessage:t.text,serviceTier:t.serviceTier});if(!u){c()&&(ae(n),Ee(r),le(new Set(i)));return}s=u.id;let d=await ui(u.id,r),f={...t,attachments:d};Zt.current.add(u.id),Qt.current.set(u.id,`send`),zr((await cn.mutateAsync({chatId:u.id,input:f})).chat),V.invalidateQueries({queryKey:J.messages(u.id)}),V.invalidateQueries({queryKey:J.chat(u.id)}),l()&&(we([]),Ee([]),le(new Set),ht(null),Tn(``),await Hr(u.id))}catch(e){(s?l():c())&&(ae(n),Ee(r),le(new Set(i)),Pe(Xy(`Could not send message`,e)))}finally{s&&(Zt.current.delete(s),Qt.current.delete(s)),Ot.current=!1,_t(null),Qe(!1)}}async function fi(e){let t=jn;if(!t&&(!U||e!==`send`)||!Jn||Xn||!t&&U&&(Ze||Ot.current)||e===`steer`&&!H?.activeTurnId)return;Pe(null);let n=Rt.current,r=Gt.current+1;Gt.current=r;let i=()=>t!==null&&Lt.current===t&&Rt.current===n&&Gt.current===r,a=ie,s=Te,c=new Set(ce),l=a.trim().length>0?a:vb({hasAttachments:Te.length>0,hasFiles:Ce.length>0,hasSkills:Gn.length>0});ae(``);let u=t&&Xt.current?.chatId===t?Xt.current:null;if(!t){if(!U)return;let e=li(l,u);xt(!0),Ct(`send`),await di(U,e,a,s,c,o.current,Fn?.number??null),xt(!1),Ct(null);return}Zt.current.add(t),Qt.current.set(t,e),xt(!0),Ct(e);try{let n=li(l,u,await ui(t,s));if(await(e===`steer`?dn:e===`queue`?fn:cn).mutateAsync({chatId:t,input:n}),V.invalidateQueries({queryKey:J.messages(t)}),Xt.current?.chatId===t&&(Xt.current=null),!i())return;we([]),Ee([]),le(new Set),Tn(``),await Hr(t)}catch(e){if(!i())return;ae(a),Pe(Xy(`Could not send message`,e))}finally{Zt.current.delete(t),Qt.current.delete(t),(i()||Lt.current===t)&&(xt(!1),Ct(Qt.current.get(t)??null))}}async function pi(e){if(!i||e.chatId!==i)return null;let t=i;try{let n=await ln.mutateAsync({chatId:t,messageId:e.id});return V.invalidateQueries({queryKey:J.messages(t)}),await Hr(t),n}catch(e){return vn(Xy(`Could not delete pending message`,e)),null}}async function mi(e){if(ie.trim()||Kn){Pe(`Clear the current message before editing a pending message`),qt.current?.focus();return}let t=await pi(e);if(t){if(!(Lt.current===t.message.chatId&&!Jt.current.trim()&&!Yt.current)){let e=t.message.chatId;try{await un.mutateAsync({chatId:e,input:t}),V.invalidateQueries({queryKey:J.messages(e)}),Lt.current===e&&await Hr(e),vn(`Pending message was restored to the queue because the composer changed before editing completed`,`warning`)}catch(e){vn(`Pending message was deleted but could not be restored: ${Yy(e)}`)}return}Xt.current={chatId:t.message.chatId,effort:t.queuedMessage.effort??null,model:t.queuedMessage.model??null,serviceTier:t.queuedMessage.serviceTier??null},ae(t.message.text),we((t.queuedMessage.files??[]).map(Qb)),Ee((t.queuedMessage.attachments??[]).map($b)),le(new Set((t.queuedMessage.skills??[]).map(e=>e.path))),wn(Py.model,t.queuedMessage.model??null),wn(Py.effort,t.queuedMessage.effort??null),wn(Py.serviceTier,t.queuedMessage.serviceTier??null),requestAnimationFrame(()=>{qt.current?.focus()})}}function hi(e){let t=Kv({altKey:e.altKey,code:e.code,ctrlKey:e.ctrlKey,isComposing:e.nativeEvent.isComposing,key:e.key,keyCode:e.keyCode,metaKey:e.metaKey,shiftKey:e.shiftKey});if(!t||!jn&&!U||!Jn||bt)return;let n=qv(t,H);if(!(!n||!jn&&n!==`send`)){if(e.preventDefault(),n===`send`){e.currentTarget.form?.requestSubmit();return}fi(n)}}async function gi(){if(i){Tt(!0);try{await pn.mutateAsync(i),V.invalidateQueries({queryKey:J.chat(i)})}catch(e){vn(Xy(`Could not stop turn`,e))}finally{Tt(!1)}}}async function _i(e){if(!i||!$t||$t.chatId!==i)return;let t=$t.chatId,n=$t,r=()=>Lt.current===t&&tn.current?.requestId===n.requestId;Je(null);try{if(e!==`accept`&&e!==`acceptForSession`&&e!==`decline`&&e!==`cancel`)throw Error(`Approval decision is invalid`);await mn.mutateAsync({chatId:t,decision:e,requestId:n.requestId}),be.current+=1,V.invalidateQueries({queryKey:J.chatApproval(t)}),V.invalidateQueries({queryKey:J.chat(t)}),xn(t,n.requestId)}catch(e){r()&&Je(Xy(`Could not answer approval`,e))}}function vi(e){Sn(t=>{let n=Qy(t,Py.expandedProject);n.has(e)?n.delete(e):n.add(e),tb(t,Py.expandedProject,n)})}function yi(e){Xt.current=null,ae(``),we([]),Ee([]),le(new Set),Se([]),se([]),Cn({projectId:e,chatId:null,clearFileQuery:!0})}function bi(e,t){let n=Jy(e,t);S(e=>{let t=new Set(e);return t.has(n)?t.delete(n):t.add(n),t})}function xi(e,t){if(!t.chatId){Qr(e,t);return}Cn({projectId:e,chatId:t.chatId,clearFileQuery:!0})}function Si(e,t,n){Cn({projectId:e,chatId:n,clearFileQuery:!0}),S(n=>new Set(n).add(Jy(e,t.path)))}function Ci(e){let t=xe.find(t=>t.path===e);t&&(we(e=>e.some(e=>e.path===t.path)?e:[...e,t]),Tn(``))}async function wi(e){if(!e||e.length===0)return;let t=[],n=[];for(let r of Array.from(e)){if(r.size<=0||r.size>Uy){n.push(r.name);continue}if(!await ex(r)){n.push(r.name);continue}t.push({file:r,id:`${r.name}:${r.size}:${r.lastModified}:${crypto.randomUUID()}`,mimeType:`image/png`,name:r.name,size:r.size})}t.length>0&&(Ee(e=>[...e,...t.filter(t=>!e.some(e=>e.name===t.name&&e.size===t.size))]),Pe(null)),n.length>0&&Pe(`Only PNG images up to ${tx(Uy)} can be attached: ${n.join(`, `)}`)}function Ti(e){oe.find(t=>t.enabled&&t.path===e)&&(le(t=>new Set(t).add(e)),U&&Ei(U,e))}function Ei(e,t){let n=(ve.current.get(e)??Promise.resolve()).catch(()=>void 0).then(async()=>{En(e);try{let n=await Ds(e,t);V.setQueryData(J.projectRecentSkills(e),n),It.current===e&&(En(e),de(n.recentSkills))}catch(t){It.current===e&&Pe(Xy(`Could not remember skill`,t))}});ve.current.set(e,n),n.finally(()=>{ve.current.get(e)===n&&ve.current.delete(e)})}let Di=$t?.chatId===i?$t:null,Oi=e=>(0,z.jsxs)(kv,{className:e,collapsible:`offcanvas`,variant:`inset`,children:[(0,z.jsxs)(Av,{children:[(0,z.jsx)(Mv,{"aria-label":`Close sidebar`,className:`text-[var(--icon-color-default)] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground`,title:`Close sidebar`}),(0,z.jsx)(`div`,{className:`min-w-0 flex-1 group-data-[state=collapsed]/sidebar:hidden`,children:(0,z.jsx)(`h1`,{className:`truncate text-[length:var(--font-size-lg)] font-semibold leading-tight`,children:`Phantom`})}),(0,z.jsxs)(rc,{className:`max-w-28 truncate group-data-[state=collapsed]/sidebar:hidden`,variant:De===`Ready`?`success`:`warning`,children:[De!==`Ready`&&(0,z.jsx)(qo,{className:`size-3`}),De]})]}),(0,z.jsx)(Nv,{children:(0,z.jsxs)(Pv,{children:[(0,z.jsxs)(Fv,{children:[(0,z.jsx)(Iv,{children:`Projects`}),(0,z.jsx)(Lv,{"aria-label":`Add project`,onClick:Gr,title:`Add project`,children:(0,z.jsx)(Io,{className:`size-4`})})]}),(0,z.jsxs)(Rv,{children:[ke&&(0,z.jsx)(bb,{className:`mx-2 mb-2 group-data-[state=collapsed]/sidebar:hidden`,message:ke,onDismiss:()=>Ae(null)}),(0,z.jsx)(zv,{children:Er?(0,z.jsx)(`li`,{className:`px-2 py-1 group-data-[state=collapsed]/sidebar:hidden`,children:(0,z.jsx)(Zo,{})}):p.length===0?(0,z.jsx)(`li`,{className:`px-2 py-4 group-data-[state=collapsed]/sidebar:hidden`,children:(0,z.jsx)(`div`,{className:`rounded-[var(--radius-md)] border border-dashed border-sidebar-border bg-[var(--surface-card)] px-3 py-3 text-[length:var(--font-size-sm)] text-muted-foreground`,children:`Add a Git project to begin.`})}):p.map(e=>{let t=f.has(e.id),n=_[e.id]??[],r=y[e.id]??null,a=et.has(e.id)&&_[e.id]===void 0;return(0,z.jsxs)(Bv,{children:[(0,z.jsxs)(`div`,{className:`group/project flex items-center gap-0.5 rounded-[var(--radius-sm)]`,children:[(0,z.jsx)(`button`,{"aria-expanded":t,"aria-label":`${t?`Collapse`:`Expand`} ${e.name}`,className:`inline-flex size-7 shrink-0 items-center justify-center rounded-[var(--radius-sm)] text-[var(--icon-color-default)] outline-none transition-colors hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:shadow-[var(--state-focus-ring)] group-data-[state=collapsed]/sidebar:hidden`,onClick:()=>vi(e.id),title:t?`Collapse`:`Expand`,type:`button`,children:(0,z.jsx)(ho,{className:q(`size-4 transition-transform duration-[var(--motion-duration-fast)]`,t&&`rotate-90`)})}),(0,z.jsxs)(Vv,{className:`min-h-8 flex-1 group-data-[state=collapsed]/sidebar:flex-none`,isActive:U===e.id&&!H,onClick:()=>yi(e.id),title:e.name,type:`button`,children:[(0,z.jsx)(wo,{className:`size-4 text-[var(--icon-color-default)]`}),(0,z.jsx)(`span`,{className:`min-w-0 flex-1 group-data-[state=collapsed]/sidebar:hidden`,children:(0,z.jsx)(`span`,{className:`block truncate font-medium`,children:e.name})})]}),(0,z.jsxs)(Cg,{children:[(0,z.jsx)(wg,{asChild:!0,children:(0,z.jsx)(oc,{"aria-label":gt===e.id?`Creating worktree in ${e.name}`:`Open actions for ${e.name}`,className:q(`mr-1 size-7 text-[var(--icon-color-default)] opacity-100 data-[state=open]:opacity-100 group-data-[state=collapsed]/sidebar:hidden sm:opacity-0 sm:group-focus-within/project:opacity-100 sm:group-hover/project:opacity-100`,U===e.id&&`sm:opacity-100`,gt===e.id&&`sm:opacity-100`),disabled:Ze,size:`icon`,title:gt===e.id?`Creating worktree`:`Project actions`,type:`button`,variant:`ghost`,children:gt===e.id?(0,z.jsx)(qo,{className:`size-4`}):(0,z.jsx)(xo,{className:`size-4`})})}),(0,z.jsxs)(Tg,{align:`end`,children:[(0,z.jsxs)(Eg,{disabled:Ze,onSelect:()=>void Qr(e.id),children:[gt===e.id?(0,z.jsx)(qo,{className:`size-4`}):(0,z.jsx)(jo,{className:`size-4`}),(0,z.jsx)(`span`,{children:`Create worktree`})]}),(0,z.jsxs)(Eg,{disabled:Ze,onSelect:()=>Jr(e),variant:`destructive`,children:[(0,z.jsx)(Uo,{className:`size-4`}),(0,z.jsx)(`span`,{children:`Delete project`})]})]})]})]}),t&&(0,z.jsx)(Hv,{children:a?(0,z.jsx)(`li`,{className:`px-2 py-1.5`,children:(0,z.jsx)(Qo,{})}):n.length===0?(0,z.jsx)(`li`,{className:`px-2 py-1.5 text-[length:var(--font-size-xs)] text-[var(--text-tertiary)]`,children:`No worktrees`}):n.map(t=>{let n=U===e.id&&gr?.path===t.path,a=Ly(t,r),o=Ry(t,a),s=yr[e.id]?.get(t.path)??[],c=s.find(e=>e.status===`running`||e.status===`waitingForApproval`||!!e.activeTurnId)??null,l=bt&&H?.projectId===e.id&&H.worktreePath===t.path,u=l?`Sending message`:c?Fy[c.status].label:null,d=Jy(e.id,t.path),f=vt===d,p=x.has(d),m=nt.has(e.id)&&s.length===0,h=`${t.name} (${t.path})${a?` [PR #${a.number}: ${a.title}]`:``}${t.isClean?``:` [dirty]`}${t.isMainWorktree?` [main worktree]`:``}${u?` [${u}]`:``}`,g=t.isManagedByPhantom,_=g||!!t.path;return(0,z.jsxs)(Uv,{children:[(0,z.jsxs)(`div`,{className:`group/worktree flex items-center gap-0.5 rounded-[var(--radius-sm)]`,children:[(0,z.jsx)(`button`,{"aria-expanded":p,"aria-label":`${p?`Collapse`:`Expand`} chats for ${o}`,className:`inline-flex size-7 shrink-0 items-center justify-center rounded-[var(--radius-sm)] text-[var(--icon-color-default)] outline-none transition-colors hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:shadow-[var(--state-focus-ring)]`,onClick:()=>bi(e.id,t.path),title:p?`Collapse chats`:`Expand chats`,type:`button`,children:(0,z.jsx)(ho,{className:q(`size-3.5 transition-transform duration-[var(--motion-duration-fast)]`,p&&`rotate-90`)})}),(0,z.jsxs)(Wv,{className:`flex-1`,disabled:!t.chatId&&Ze,isActive:n,onClick:()=>xi(e.id,t),title:h,type:`button`,children:[t.isMainWorktree?(0,z.jsx)(wo,{className:`size-3.5 text-[var(--icon-color-default)]`}):a?(0,z.jsx)(zy,{className:`size-3.5 text-[var(--icon-color-default)]`}):(0,z.jsx)(To,{className:`size-3.5 text-[var(--icon-color-default)]`}),(0,z.jsx)(`span`,{className:`min-w-0 flex-1`,children:(0,z.jsx)(`span`,{className:`flex min-w-0 items-center gap-1.5`,children:(0,z.jsx)(`span`,{className:`block min-w-0 truncate font-medium`,children:o})})}),!t.isClean&&(0,z.jsx)(`span`,{className:`size-1.5 shrink-0 rounded-full bg-[var(--semantic-warning-fg)]`}),u&&(0,z.jsx)(db,{label:u,status:l?`running`:c?.status??`running`})]}),(0,z.jsx)(oc,{"aria-label":`Start new chat in ${t.name}`,className:q(`size-7 text-[var(--icon-color-default)] opacity-100 sm:opacity-0 sm:group-focus-within/worktree:opacity-100 sm:group-hover/worktree:opacity-100`,(n||f)&&`sm:opacity-100`),disabled:Ze,onClick:()=>void Qr(e.id,t),size:`icon`,title:`New chat`,type:`button`,variant:`ghost`,children:f?(0,z.jsx)(qo,{className:`size-4`}):(0,z.jsx)(jo,{className:`size-4`})}),_&&(0,z.jsxs)(Cg,{children:[(0,z.jsx)(wg,{asChild:!0,children:(0,z.jsx)(oc,{"aria-label":`Open actions for ${t.name}`,className:q(`mr-1 size-7 text-[var(--icon-color-default)] opacity-100 data-[state=open]:opacity-100 sm:opacity-0 sm:group-focus-within/worktree:opacity-100 sm:group-hover/worktree:opacity-100`,n&&`sm:opacity-100`),disabled:Ze,size:`icon`,title:`Worktree actions`,type:`button`,variant:`ghost`,children:(0,z.jsx)(xo,{className:`size-4`})})}),(0,z.jsxs)(Tg,{align:`end`,children:[(0,z.jsxs)(Eg,{disabled:Ze,onSelect:()=>void ii(e.id,t),children:[(0,z.jsx)(Lo,{className:`size-4`}),(0,z.jsx)(`span`,{children:`Sync branch`})]}),g&&(0,z.jsxs)(Eg,{disabled:Ze,onSelect:()=>void $r(e.id,t),variant:`destructive`,children:[(0,z.jsx)(Uo,{className:`size-4`}),(0,z.jsx)(`span`,{children:`Delete worktree`})]})]})]})]}),p&&(0,z.jsx)(ub,{chats:s,isLoading:m,selectedChatId:i,onSelectChat:n=>Si(e.id,t,n),onSetChatArchived:(e,t)=>void ai(e,t)})]},t.path)})})]},e.id)})})]})]})})]});return(0,z.jsxs)(Ov,{className:`app-shell`,children:[(0,z.jsx)(`div`,{className:`contents md:hidden`,children:Oi()}),(0,z.jsxs)(Sv,{className:`min-h-0 flex-1`,orientation:`horizontal`,children:[(0,z.jsx)(Cv,{className:`flex min-h-0`,defaultSize:`320px`,id:`workspace-sidebar-panel`,maxSize:`520px`,minSize:`240px`,style:{overflow:`hidden`},children:Oi(`md:w-full`)}),(0,z.jsx)(wv,{"aria-label":`Resize sidebar`,id:`workspace-sidebar-resize-handle`}),(0,z.jsxs)(Cv,{className:`flex min-h-0 min-w-0`,minSize:`320px`,style:{overflow:`hidden`},children:[(0,z.jsx)(vc,{open:O,onOpenChange:e=>{e?Gr():Kr()},children:(0,z.jsxs)(yc,{"aria-labelledby":`add-project-title`,children:[(0,z.jsxs)(bc,{children:[(0,z.jsx)(xc,{id:`add-project-title`,children:`Add project`}),(0,z.jsx)(Sc,{children:`Add a local Git project to the Phantom sidebar.`})]}),(0,z.jsxs)(`form`,{className:`grid gap-4`,onSubmit:qr,children:[(0,z.jsxs)(`div`,{className:`grid gap-2`,children:[(0,z.jsx)(Dg,{htmlFor:`project-path`,children:`Project path`}),(0,z.jsx)(cc,{id:`project-path`,placeholder:`/Users/me/project`,value:A,onChange:e=>j(e.target.value)})]}),Be&&(0,z.jsx)(bb,{message:Be,onDismiss:()=>He(null)}),(0,z.jsxs)(Cc,{children:[(0,z.jsx)(oc,{onClick:Kr,type:`button`,variant:`outline`,children:`Cancel`}),(0,z.jsxs)(oc,{disabled:Ze||!A.trim(),type:`submit`,children:[Ze&&(0,z.jsx)(qo,{}),`Add project`]})]})]})]})}),(0,z.jsx)(vc,{open:!!M,onOpenChange:e=>{e||Yr()},children:(0,z.jsxs)(yc,{"aria-labelledby":`delete-project-title`,children:[(0,z.jsxs)(bc,{children:[(0,z.jsx)(xc,{id:`delete-project-title`,children:`Delete project`}),(0,z.jsx)(Sc,{children:`Remove this project from the Phantom sidebar and delete its Phantom chat history and messages. Local repository files and worktrees are not deleted.`})]}),(0,z.jsxs)(`form`,{className:`grid gap-4`,onSubmit:Xr,children:[(0,z.jsxs)(`div`,{className:`grid gap-2 rounded-[var(--radius-sm)] bg-[var(--surface-code)] px-3 py-2`,children:[(0,z.jsx)(`p`,{className:`truncate text-[length:var(--font-size-sm)] font-medium`,children:ur?.name??`Unknown project`}),ur&&(0,z.jsx)(`p`,{className:`truncate font-mono text-[length:var(--font-size-xs)] text-muted-foreground`,children:ur.rootPath})]}),(0,z.jsx)(`p`,{className:`text-[length:var(--font-size-sm)] text-muted-foreground`,children:`Projects with running, approval-blocked, or queued chats cannot be deleted.`}),fr&&(0,z.jsx)(`div`,{className:`rounded-[var(--radius-sm)] border border-[var(--semantic-warning-border)] bg-[var(--semantic-warning-bg)] px-3 py-2 text-[length:var(--font-size-sm)] text-[var(--semantic-warning-fg)]`,children:`Stop running, approval-blocked, or queued chats before deleting this project.`}),Ue&&(0,z.jsx)(bb,{message:Ue,onDismiss:()=>We(null)}),(0,z.jsxs)(Cc,{children:[(0,z.jsx)(oc,{onClick:Yr,type:`button`,variant:`outline`,children:`Cancel`}),(0,z.jsxs)(oc,{disabled:Ze||!ur||!!fr,type:`submit`,variant:`destructive`,children:[Ze&&(0,z.jsx)(qo,{}),`Delete project`]})]})]})]})}),(0,z.jsx)(vc,{open:!!N,onOpenChange:e=>{e||ti()},children:(0,z.jsxs)(yc,{"aria-labelledby":`delete-worktree-title`,children:[(0,z.jsxs)(bc,{children:[(0,z.jsx)(xc,{id:`delete-worktree-title`,children:`Delete worktree`}),(0,z.jsxs)(Sc,{children:[hr?`This worktree has uncommitted changes. Force deletion is required to remove it from `:`This will remove the worktree and its chat history from `,pr?.name??`the project`,`.`]})]}),(0,z.jsxs)(`form`,{className:`grid gap-4`,onSubmit:ri,children:[(0,z.jsxs)(`div`,{className:`grid gap-2 rounded-[var(--radius-sm)] bg-[var(--surface-code)] px-3 py-2`,children:[(0,z.jsx)(`p`,{className:`truncate text-[length:var(--font-size-sm)] font-medium`,children:mr?.name??`Unknown worktree`}),mr&&(0,z.jsx)(`p`,{className:`truncate font-mono text-[length:var(--font-size-xs)] text-muted-foreground`,children:mr.path})]}),(0,z.jsxs)(`div`,{className:`grid gap-2`,children:[(0,z.jsx)(Dg,{htmlFor:`delete-worktree-branch-mode`,children:`Branch handling`}),(0,z.jsxs)(`select`,{className:`h-9 rounded-[var(--radius-sm)] border border-input bg-[var(--surface-input)] px-3 text-[length:var(--font-size-sm)] shadow-[var(--shadow-xs)] outline-none transition-[border-color,box-shadow] focus-visible:border-ring focus-visible:shadow-[var(--state-focus-ring)] disabled:cursor-not-allowed disabled:opacity-[var(--opacity-disabled)]`,id:`delete-worktree-branch-mode`,onChange:e=>F(e.target.value),value:P,children:[(0,z.jsx)(`option`,{value:`default`,children:`Use project preference`}),(0,z.jsx)(`option`,{value:`keep`,children:`Keep branch`}),(0,z.jsx)(`option`,{value:`delete`,children:`Delete branch`})]})]}),hr&&(0,z.jsxs)(`label`,{className:`flex items-start gap-2 text-[length:var(--font-size-sm)] text-[var(--semantic-danger-fg)]`,children:[(0,z.jsx)(`input`,{checked:ne,className:`mt-0.5 size-4 accent-[var(--semantic-danger-fg)]`,onChange:e=>re(e.target.checked),type:`checkbox`}),(0,z.jsx)(`span`,{children:`Force delete uncommitted changes`})]}),Ge&&(0,z.jsx)(bb,{message:Ge,onDismiss:()=>Ke(null)}),(0,z.jsxs)(Cc,{children:[(0,z.jsx)(oc,{onClick:ti,type:`button`,variant:`outline`,children:`Cancel`}),(0,z.jsxs)(oc,{disabled:Ze||!mr||hr&&!ne,type:`submit`,variant:`destructive`,children:[Ze&&(0,z.jsx)(qo,{}),`Delete`]})]})]})]})}),(0,z.jsx)(xb,{toasts:Ye,onDismiss:_n}),(0,z.jsxs)(jv,{children:[(0,z.jsxs)(`header`,{className:`flex min-h-[var(--layout-topbar-height)] items-center gap-3 border-b border-border bg-[var(--surface-panel)] px-4`,children:[(0,z.jsx)(lb,{}),(0,z.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,z.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,z.jsx)(`p`,{className:`truncate text-[length:var(--font-size-xl)] font-semibold leading-tight`,children:H?vr??gr?.name??H.worktreeName:Mn?`New chat`:`Workspace`}),H&&(0,z.jsx)(fb,{status:H.status})]}),(0,z.jsxs)(`p`,{className:`flex min-w-0 text-[length:var(--font-size-xs)] text-muted-foreground`,children:[(0,z.jsxs)(`span`,{className:`shrink-0`,children:[Mn?.name??`No project selected`,gr?` / `:``]}),gr&&(0,z.jsx)(pb,{text:gr.path})]})]}),_r&&(0,z.jsx)(`a`,{"aria-label":`Open PR #${_r.number}`,className:`inline-flex size-8 shrink-0 items-center justify-center rounded-[var(--radius-sm)] text-[var(--icon-color-default)] outline-none transition-colors duration-[var(--motion-duration-fast)] hover:bg-accent hover:text-accent-foreground focus-visible:border-ring focus-visible:shadow-[var(--state-focus-ring)]`,href:_r.htmlUrl,rel:`noreferrer`,target:`_blank`,title:`Open PR #${_r.number}`,children:(0,z.jsx)(zy,{className:`size-4`})}),H&&(0,z.jsx)(oc,{"aria-label":H.status===`archived`?`Restore chat`:`Archive chat`,className:`size-8 text-[var(--icon-color-default)]`,disabled:Ze||hn.isPending||H.status!==`archived`&&!By(H),onClick:()=>void ai(H,H.status!==`archived`),size:`icon`,title:H.status===`archived`?`Restore chat`:`Archive chat`,type:`button`,variant:`ghost`,children:hn.isPending?(0,z.jsx)(qo,{}):H.status===`archived`?(0,z.jsx)(lo,{}):(0,z.jsx)(uo,{})}),gr&&(0,z.jsxs)(Cg,{children:[(0,z.jsx)(wg,{asChild:!0,children:(0,z.jsx)(oc,{"aria-label":`Open worktree actions for ${gr.name}`,className:`size-8 shrink-0 text-[var(--icon-color-default)]`,disabled:Ze,size:`icon`,title:`Worktree actions`,type:`button`,variant:`ghost`,children:(0,z.jsx)(xo,{className:`size-4`})})}),(0,z.jsxs)(Tg,{align:`end`,children:[(0,z.jsxs)(Eg,{disabled:Ze,onSelect:oi,children:[(0,z.jsx)(jo,{className:`size-4`}),(0,z.jsx)(`span`,{children:`New chat`})]}),gr.isManagedByPhantom&&(0,z.jsxs)(Eg,{disabled:Ze,onSelect:si,variant:`destructive`,children:[(0,z.jsx)(Uo,{className:`size-4`}),(0,z.jsx)(`span`,{children:`Delete worktree`})]})]})]})]}),Di&&(0,z.jsx)(`div`,{className:`border-b border-[var(--semantic-warning-border)] bg-[var(--semantic-warning-bg)] px-4 py-3 text-[var(--semantic-warning-fg)]`,children:(0,z.jsxs)(`div`,{className:`mx-auto flex max-w-[var(--layout-max-content-width)] flex-col gap-3 sm:flex-row sm:items-center sm:justify-between`,children:[(0,z.jsxs)(`div`,{className:`min-w-0`,children:[(0,z.jsxs)(`p`,{className:`flex items-center gap-2 text-[length:var(--font-size-md)] font-semibold`,children:[(0,z.jsx)(bo,{className:`size-4`}),`Approval requested`]}),(0,z.jsx)(`p`,{className:`mt-1 truncate font-mono text-[length:var(--font-size-xs)]`,children:Di.method}),qe&&(0,z.jsx)(bb,{className:`mt-2`,message:qe,onDismiss:()=>Je(null)})]}),(0,z.jsxs)(`div`,{className:`flex shrink-0 flex-wrap gap-2`,children:[(0,z.jsx)(oc,{onClick:()=>void _i(`accept`),size:`sm`,type:`button`,children:`Accept`}),(0,z.jsx)(oc,{onClick:()=>void _i(`acceptForSession`),size:`sm`,type:`button`,variant:`outline`,children:`Accept for session`}),(0,z.jsx)(oc,{onClick:()=>void _i(`decline`),size:`sm`,type:`button`,variant:`outline`,children:`Decline`})]})]})}),(0,z.jsxs)(`section`,{"aria-busy":ot||bt||Rn||!!gt,className:`min-h-0 flex-1 overflow-y-auto px-4 py-4`,ref:kt,onScroll:Wr,children:[je&&(0,z.jsx)(`div`,{className:`mx-auto mb-3 max-w-[var(--layout-max-content-width)]`,children:(0,z.jsx)(bb,{message:je,onDismiss:()=>Me(null)})}),Dr?(0,z.jsx)($o,{}):Tr.length===0?Sr.length===0?(0,z.jsx)(Sb,{githubTargets:Nn,hasChat:!!H,hasWorktree:!!gr,isGitHubTargetsLoading:Pn,selectedProject:Mn,selectedGitHubTargetNumber:mt,onOpenProjectDialog:Gr,onSelectGitHubTarget:ht}):null:(0,z.jsx)(`div`,{className:`mx-auto flex max-w-[var(--layout-max-content-width)] flex-col gap-2`,children:Tr.map(e=>e.kind===`commandGroup`?(0,z.jsx)(Nb,{messages:e.messages},e.id):(0,z.jsx)(Ob,{isPendingActionBusy:ln.isPending,message:e.message,onDeletePendingMessage:e=>void pi(e),onEditPendingMessage:e=>void mi(e)},e.message.id))})]}),(0,z.jsxs)(`form`,{className:`chat-composer border-t border-border bg-[var(--surface-floating)] backdrop-blur`,onSubmit:ci,children:[Sr.length>0&&(0,z.jsx)(Tb,{isPendingActionBusy:ln.isPending,messages:Sr,scrollContainerRef:At,onDeletePendingMessage:e=>void pi(e),onEditPendingMessage:e=>void mi(e)}),(0,z.jsxs)(`div`,{className:`mx-auto flex max-w-[var(--layout-max-content-width)] flex-col gap-2`,children:[Ne&&(0,z.jsx)(bb,{message:Ne,onDismiss:()=>Pe(null)}),Fe&&(0,z.jsx)(bb,{message:Fe,onDismiss:()=>Ie(null)}),Le&&(0,z.jsx)(bb,{message:Le,onDismiss:()=>ze(null)}),tr&&!ct&&cr.length>0&&(0,z.jsxs)(`div`,{className:`flex min-h-8 flex-wrap items-center gap-2 px-1`,children:[(0,z.jsx)(`span`,{className:`text-[length:var(--font-size-xs)] font-medium text-[var(--text-tertiary)]`,children:`Recent skills`}),cr.map(e=>(0,z.jsxs)(`button`,{"aria-label":`Select ${e.displayName}`,className:`inline-flex h-8 max-w-48 items-center gap-1.5 rounded-[var(--radius-sm)] border border-[var(--border-divider)] bg-[var(--surface-input)] px-2 text-[length:var(--font-size-sm)] text-[var(--text-secondary)] outline-none transition-colors hover:bg-[var(--state-hover-bg)] hover:text-[var(--text-primary)] focus-visible:shadow-[var(--state-focus-ring)]`,onClick:()=>Ti(e.path),title:e.displayName,type:`button`,children:[(0,z.jsx)(Bo,{className:`size-3.5 shrink-0`}),(0,z.jsx)(`span`,{className:`min-w-0 truncate`,children:e.displayName})]},e.path))]}),(Te.length>0||Ce.length>0||Gn.length>0)&&(0,z.jsxs)(`div`,{className:`flex min-h-8 flex-wrap items-center gap-2 px-1`,children:[Te.map(e=>(0,z.jsx)(mb,{icon:(0,z.jsx)(Po,{className:`size-3.5`}),label:`${e.name} (${tx(e.size)})`,onRemove:()=>Ee(t=>t.filter(t=>t.id!==e.id))},e.id)),Ce.map(e=>(0,z.jsx)(mb,{icon:(0,z.jsx)(Co,{className:`size-3.5`}),label:e.relativePath,onRemove:()=>we(t=>t.filter(t=>t.path!==e.path))},e.path)),Gn.map(e=>(0,z.jsx)(mb,{icon:(0,z.jsx)(Bo,{className:`size-3.5`}),label:e.displayName,onRemove:()=>le(t=>{let n=new Set(t);return n.delete(e.path),n})},e.path))]}),(0,z.jsxs)(`div`,{className:`flex items-end gap-2`,children:[(0,z.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,z.jsx)(Dg,{className:`sr-only`,htmlFor:`composer`,children:`Message`}),(0,z.jsx)(Gv,{className:`min-h-12 border-0 bg-transparent px-2 py-2 shadow-none focus-visible:shadow-none`,disabled:!Mn||Xn,enterKeyHint:`enter`,id:`composer`,placeholder:zn?`Restore this chat to continue`:An?`Ask Codex to work in this worktree`:Mn?`Ask Codex to create a worktree and start`:`Select a project to start`,rows:2,ref:qt,value:ie,onChange:e=>{ae(e.target.value),Ne&&Pe(null)},onKeyDown:hi})]}),(0,z.jsxs)(`div`,{className:`flex shrink-0 items-end gap-1.5`,children:[(0,z.jsx)(`input`,{accept:Gy,className:`sr-only`,multiple:!0,ref:Kt,type:`file`,onChange:e=>{wi(e.target.files),e.target.value=``}}),(0,z.jsx)(oc,{"aria-label":`Attach image`,className:`size-10`,disabled:!Mn||Xn,onClick:()=>Kt.current?.click(),size:`icon`,title:`Attach image`,type:`button`,variant:`outline`,children:(0,z.jsx)(Po,{})}),An&&Yn!==`queue`&&(0,z.jsx)(oc,{"aria-label":St===`queue`?`Queueing message`:`Queue message`,className:`size-10`,disabled:!Qn,onClick:()=>void fi(`queue`),size:`icon`,title:`Queue message`,type:`button`,variant:`outline`,children:St===`queue`?(0,z.jsx)(qo,{}):(0,z.jsx)(bo,{})}),(0,z.jsx)(oc,{"aria-label":rr,className:`size-10`,disabled:!Zn,onClick:Rn?()=>void fi(Yn):void 0,size:`icon`,title:nr,type:Rn?`button`:`submit`,children:St===Yn?(0,z.jsx)(qo,{}):Yn===`queue`?(0,z.jsx)(bo,{}):(0,z.jsx)(zo,{})}),Rn&&(0,z.jsx)(oc,{"aria-label":wt?`Stopping turn`:`Stop turn`,className:`size-10`,disabled:!$n,onClick:gi,size:`icon`,title:`Stop turn`,type:`button`,variant:`destructive`,children:wt?(0,z.jsx)(qo,{}):(0,z.jsx)(Vo,{})})]})]}),(0,z.jsxs)(`div`,{className:`flex min-h-8 flex-wrap items-center gap-2 border-t border-[var(--border-divider)] px-1 pt-2`,children:[(0,z.jsx)(pc,{"aria-label":`Select model`,className:`w-36 max-w-full sm:w-40`,disabled:it||I.length===0||Xn,emptyMessage:it?`Loading models`:`No models`,icon:(0,z.jsx)(fo,{className:`size-3.5`}),isLoading:it,options:ir,placeholder:it?`Loading`:`Model`,searchPlaceholder:`Search models`,side:`top`,triggerClassName:`w-full justify-between`,value:Vn?.id??null,onValueChange:e=>wn(Py.model,e)}),(0,z.jsx)(pc,{"aria-label":`Select reasoning effort`,className:`w-28 max-w-full`,disabled:!Vn||Xn,icon:(0,z.jsx)(po,{className:`size-3.5`}),options:ar,placeholder:`Effort`,searchPlaceholder:`Search effort`,side:`top`,triggerClassName:`w-full justify-between`,value:c??`auto`,onValueChange:e=>wn(Py.effort,e===`auto`?null:e)}),(0,z.jsxs)(oc,{"aria-label":Wn?`Disable fast mode`:`Enable fast mode`,"aria-pressed":Wn,className:`h-9 px-3`,disabled:!Vn||!Un||Xn,onClick:()=>wn(Py.serviceTier,Wn?null:`fast`),title:Un?Wn?`Disable fast mode`:`Enable fast mode`:`Fast mode unavailable for selected model`,type:`button`,variant:Wn?`secondary`:`outline`,children:[(0,z.jsx)(Ko,{className:`size-3.5`}),`Fast`]}),(0,z.jsx)(pc,{"aria-label":`Attach file`,className:`w-32 max-w-full`,disabled:er,emptyMessage:ut?`Searching files`:me.trim()?`No files`:`Type to search`,icon:(0,z.jsx)(Co,{className:`size-3.5`}),isLoading:ut,options:lr,placeholder:`Files`,query:me,searchPlaceholder:`Search files`,shouldFilter:!1,side:`top`,triggerClassName:`w-full justify-between`,value:null,onQueryChange:Tn,onValueChange:Ci}),(0,z.jsx)(pc,{"aria-label":`Select skill`,align:`end`,className:`w-32 max-w-full`,disabled:er||ct,emptyMessage:ct?`Loading skills`:`No skills`,icon:(0,z.jsx)(Bo,{className:`size-3.5`}),isLoading:ct,options:or,placeholder:ct?`Loading`:`Skills`,searchPlaceholder:`Search skills`,side:`top`,triggerClassName:`w-full justify-between`,value:null,onValueChange:Ti})]})]})]})]})]})]})]})}function lb(){let{open:e}=Dv();return e?null:(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(Mv,{"aria-label":`Open sidebar`,className:`-ml-1`,title:`Open sidebar`}),(0,z.jsx)(`div`,{className:`h-5 w-px bg-[var(--border-divider)]`})]})}function ub({chats:e,isLoading:t,onSetChatArchived:n,onSelectChat:r,selectedChatId:i}){let a=e.filter(e=>e.status!==`archived`);return(0,z.jsx)(`ul`,{"aria-label":`Chat history`,className:`ml-7 mt-1 space-y-1 border-l border-sidebar-border pl-2`,children:t?(0,z.jsx)(`li`,{className:`px-2 py-1.5`,children:(0,z.jsx)(Yo,{label:`Loading chats`})}):a.length===0?(0,z.jsx)(`li`,{className:`px-2 py-1.5 text-[length:var(--font-size-xs)] text-[var(--text-tertiary)]`,children:`No chat history`}):a.map(e=>{let t=e.id===i;return(0,z.jsx)(`li`,{className:`group/chat min-w-0`,children:(0,z.jsxs)(`div`,{className:q(`flex min-h-7 min-w-0 items-center gap-0.5 rounded-[var(--radius-sm)] transition-colors duration-[var(--motion-duration-fast)] hover:bg-sidebar-accent`,t&&`bg-sidebar-accent text-sidebar-accent-foreground`),children:[(0,z.jsxs)(`button`,{"aria-current":t?`page`:void 0,className:q(`flex min-w-0 flex-1 items-center gap-2 rounded-[var(--radius-sm)] px-2 py-1 text-left text-[length:var(--font-size-xs)] outline-none focus-visible:shadow-[var(--state-focus-ring)]`,t?`text-sidebar-accent-foreground`:`text-[var(--text-secondary)]`),onClick:()=>r(e.id),title:e.title,type:`button`,children:[(0,z.jsx)(Mo,{className:`size-3.5 shrink-0 text-[var(--icon-color-default)]`}),(0,z.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e.title}),(0,z.jsx)(`span`,{"aria-hidden":`true`,className:q(`size-1.5 shrink-0 rounded-full`,Fy[e.status].dot)}),(0,z.jsxs)(`span`,{className:`sr-only`,children:[`Status: `,Fy[e.status].label]})]}),(0,z.jsxs)(Cg,{children:[(0,z.jsx)(wg,{asChild:!0,children:(0,z.jsx)(oc,{"aria-label":`Open actions for ${e.title}`,className:q(`mr-0.5 size-6 text-[var(--icon-color-default)] opacity-100 data-[state=open]:opacity-100 sm:opacity-0 sm:group-focus-within/chat:opacity-100 sm:group-hover/chat:opacity-100`,t&&`sm:opacity-100`),size:`icon`,title:`Chat actions`,type:`button`,variant:`ghost`,children:(0,z.jsx)(xo,{className:`size-3.5`})})}),(0,z.jsx)(Tg,{align:`end`,children:(0,z.jsxs)(Eg,{disabled:!By(e),onSelect:()=>n(e,!0),children:[(0,z.jsx)(uo,{className:`size-4`}),(0,z.jsx)(`span`,{children:`Archive chat`})]})})]})]})},e.id)})})}function db({label:e,status:t}){let n=Fy[t],r=t===`running`;return(0,z.jsx)(`span`,{"aria-label":e,className:q(`flex size-4 shrink-0 items-center justify-center rounded-full`,r?`text-[var(--semantic-info-fg)]`:`bg-[var(--surface-card)]`),role:`status`,title:e,children:r?(0,z.jsx)(qo,{className:`size-3`}):(0,z.jsx)(`span`,{className:q(`size-1.5 rounded-full`,n.dot)})})}function fb({status:e}){let t=Fy[e];return(0,z.jsxs)(rc,{variant:t.badge,children:[(0,z.jsx)(`span`,{className:q(`size-1.5 rounded-full`,t.dot)}),t.label]})}function pb({text:e}){return(0,z.jsx)(`span`,{className:`block min-w-0 truncate`,title:e,children:rb(e)})}function mb({icon:e,label:t,onRemove:n}){return(0,z.jsxs)(`span`,{className:`inline-flex h-8 max-w-52 items-center gap-1.5 rounded-[var(--radius-sm)] border border-[var(--border-divider)] bg-[var(--surface-code)] px-2 text-[length:var(--font-size-sm)] text-[var(--text-secondary)]`,children:[e,(0,z.jsx)(`span`,{className:`min-w-0 truncate`,children:t}),(0,z.jsx)(`button`,{"aria-label":`Remove ${t}`,className:`rounded-[var(--radius-xs)] text-[var(--icon-color-muted)] outline-none transition-colors hover:bg-[var(--state-hover-bg)] hover:text-[var(--icon-color-active)] focus-visible:shadow-[var(--state-focus-ring)]`,onClick:n,title:`Remove ${t}`,type:`button`,children:(0,z.jsx)(Go,{className:`size-3.5`})})]})}function hb(e){return e.split(/[-_\s]+/).filter(Boolean).map(e=>`${e.charAt(0).toUpperCase()}${e.slice(1)}`).join(` `)}function gb(e){switch(e){case`queue`:return`Queue message`;case`steer`:return`Steer turn`;case`send`:return`Send message`}}function _b(e){switch(e){case`queue`:return`Queueing message`;case`steer`:return`Steering turn`;case`send`:return`Sending message`}}function vb({hasAttachments:e,hasFiles:t,hasSkills:n}){return e&&t&&n?`Use the attached images, selected files, and selected skills as context.`:e&&t?`Use the attached images and selected files as context.`:e&&n?`Use the attached images and selected skills as context.`:t&&n?`Use the selected files and skills as context.`:e?`Use the attached images as context.`:t?`Use the selected files as context.`:`Use the selected skills as context.`}function yb(e){switch(e){case`danger`:return`border-[var(--semantic-danger-border)] bg-[var(--semantic-danger-bg)] text-[var(--semantic-danger-fg)]`;case`info`:return`border-[var(--semantic-info-border)] bg-[var(--semantic-info-bg)] text-[var(--semantic-info-fg)]`;case`warning`:return`border-[var(--semantic-warning-border)] bg-[var(--semantic-warning-bg)] text-[var(--semantic-warning-fg)]`}}function bb({className:e,message:t,onDismiss:n,tone:r=`danger`}){return(0,z.jsxs)(`div`,{className:q(`flex min-w-0 items-start gap-2 rounded-[var(--radius-sm)] border px-3 py-2 text-left text-[length:var(--font-size-sm)]`,yb(r),e),role:r===`danger`?`alert`:`status`,children:[(0,z.jsx)(Wo,{className:`mt-0.5 size-4 shrink-0`}),(0,z.jsx)(`span`,{className:`min-w-0 flex-1 break-words`,children:t}),n&&(0,z.jsx)(`button`,{"aria-label":`Dismiss`,className:`rounded-[var(--radius-xs)] p-0.5 outline-none transition-colors hover:bg-[var(--state-hover-bg)] focus-visible:shadow-[var(--state-focus-ring)]`,onClick:n,type:`button`,children:(0,z.jsx)(Go,{className:`size-3.5`})})]})}function xb({onDismiss:e,toasts:t}){return t.length===0?null:(0,z.jsx)(`div`,{"aria-live":`polite`,className:`pointer-events-none fixed bottom-4 right-4 z-50 flex w-[min(360px,calc(100vw-2rem))] flex-col gap-2`,children:t.map(t=>(0,z.jsx)(bb,{className:`pointer-events-auto shadow-[var(--shadow-md)]`,message:t.message,tone:t.tone,onDismiss:()=>e(t.id)},t.id))})}function Sb({githubTargets:e,hasChat:t,hasWorktree:n,isGitHubTargetsLoading:r,onOpenProjectDialog:i,onSelectGitHubTarget:a,selectedGitHubTargetNumber:o,selectedProject:s}){let c=!!s&&!t&&e?.available;return(0,z.jsx)(`div`,{className:`mx-auto flex h-full max-w-[var(--layout-max-content-width)] items-center justify-center py-8`,children:(0,z.jsxs)(`section`,{className:`grid w-full max-w-2xl gap-4 px-5 py-6 text-center`,children:[(0,z.jsx)(`div`,{className:`mx-auto flex size-10 items-center justify-center rounded-[var(--radius-md)] bg-[var(--surface-code)] text-[var(--icon-color-default)]`,children:(0,z.jsx)(Oo,{className:`size-5`})}),(0,z.jsxs)(`div`,{children:[(0,z.jsx)(`h2`,{className:`text-[length:var(--font-size-xl)] font-semibold`,children:t?`No messages yet`:s?`New chat`:n?`Select chat history`:`Select a project`}),(0,z.jsx)(`p`,{className:`mt-1 text-[length:var(--font-size-md)] text-muted-foreground`,children:t?`Send a message to start a focused Codex session.`:s?`Send a message to create a named worktree and start Codex.`:n?`Choose a chat history for this worktree.`:`Select a project to begin a Codex session.`})]}),!s&&(0,z.jsx)(`div`,{className:`flex justify-center gap-2`,children:(0,z.jsxs)(oc,{onClick:i,type:`button`,children:[(0,z.jsx)(Io,{className:`size-4`}),`Add project`]})}),c&&e&&(0,z.jsx)(Cb,{isLoading:r,selectedNumber:o,targets:e.targets,onSelectTarget:a})]})})}function Cb({isLoading:e,onSelectTarget:t,selectedNumber:n,targets:r}){return(0,z.jsxs)(`div`,{className:`mx-auto mt-2 grid w-full gap-2 text-left`,children:[(0,z.jsxs)(`div`,{className:`flex items-center justify-between gap-3 px-1`,children:[(0,z.jsx)(`p`,{className:`text-[length:var(--font-size-sm)] font-medium text-[var(--text-secondary)]`,children:`GitHub`}),e&&(0,z.jsx)(Yo,{label:`Refreshing`})]}),r.length===0?(0,z.jsx)(`p`,{className:`rounded-[var(--radius-sm)] border border-dashed border-[var(--border-divider)] bg-[var(--surface-code)] px-3 py-2 text-[length:var(--font-size-sm)] text-muted-foreground`,children:`No open issues or pull requests.`}):(0,z.jsx)(`ul`,{className:`max-h-72 overflow-y-auto rounded-[var(--radius-sm)] border border-[var(--border-divider)] bg-[var(--surface-code)]`,children:r.map(e=>(0,z.jsx)(wb,{isSelected:n===e.number,target:e,onSelectTarget:t},`${e.kind}-${e.number}`))})]})}function wb({isSelected:e,onSelectTarget:t,target:n}){let r=`${n.kind===`pullRequest`?`PR`:`Issue`} #${n.number}: ${n.title}`;return(0,z.jsx)(`li`,{className:`border-b border-[var(--border-divider)] last:border-b-0`,children:(0,z.jsxs)(`label`,{className:q(`grid cursor-pointer grid-cols-[auto_1fr] gap-3 px-3 py-2.5 text-[length:var(--font-size-sm)] transition-colors hover:bg-[var(--state-hover-bg)]`,e&&`bg-[var(--state-selected-bg)]`),children:[(0,z.jsx)(`input`,{"aria-label":r,checked:e,className:`mt-0.5 size-4 accent-[var(--button-primary-bg)]`,type:`checkbox`,onChange:e=>t(e.target.checked?n.number:null)}),(0,z.jsxs)(`span`,{className:`grid min-w-0 gap-1`,children:[(0,z.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[n.kind===`pullRequest`?(0,z.jsx)(Eo,{className:`size-3.5 shrink-0 text-[var(--semantic-info-fg)]`}):(0,z.jsx)(vo,{className:`size-3.5 shrink-0 text-[var(--semantic-success-fg)]`}),(0,z.jsxs)(`span`,{className:`shrink-0 font-mono text-[length:var(--font-size-xs)] text-[var(--text-tertiary)]`,children:[`#`,n.number]}),(0,z.jsx)(`span`,{className:`truncate font-medium text-[var(--text-primary)]`,children:n.title})]}),(0,z.jsxs)(`span`,{className:`truncate text-[length:var(--font-size-xs)] text-muted-foreground`,children:[n.kind===`pullRequest`?`Pull request`:`Issue`,n.author?` by ${n.author}`:``]})]})]})})}function Tb({isPendingActionBusy:e,messages:t,onDeletePendingMessage:n,onEditPendingMessage:r,scrollContainerRef:i}){return(0,z.jsx)(`div`,{"aria-live":`polite`,className:`mb-2 border-b border-[var(--border-divider)]`,children:(0,z.jsxs)(`div`,{className:`mx-auto flex max-h-56 max-w-[var(--layout-max-content-width)] flex-col gap-2 overflow-y-auto px-0 py-2`,ref:i,children:[(0,z.jsxs)(`div`,{className:`flex items-center justify-between gap-3 px-1 text-[length:var(--font-size-xs)] font-medium uppercase text-[var(--text-tertiary)]`,children:[(0,z.jsx)(`span`,{children:`Pending messages`}),(0,z.jsx)(`span`,{children:t.length})]}),(0,z.jsx)(`div`,{className:`flex flex-col gap-2`,children:t.map(t=>{let i=Zb(t);return i?(0,z.jsx)(Eb,{isPendingActionBusy:e,message:t,state:i,onDeletePendingMessage:n,onEditPendingMessage:r},t.id):null})})]})})}function Eb({isPendingActionBusy:e,message:t,onDeletePendingMessage:n,onEditPendingMessage:r,state:i}){let a=i===`queued`,o=t.attachments??[];return(0,z.jsxs)(`article`,{className:q(`rounded-[var(--radius-sm)] border px-3 py-2 shadow-[var(--shadow-xs)]`,a?`border-[var(--semantic-warning-border)] bg-[var(--semantic-warning-bg)] text-[var(--semantic-warning-fg)]`:`border-[var(--semantic-info-border)] bg-[var(--semantic-info-bg)] text-[var(--semantic-info-fg)]`),children:[(0,z.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-2 sm:flex-row sm:items-start sm:gap-3`,children:[(0,z.jsx)(`pre`,{className:`min-w-0 flex-1 whitespace-pre-wrap break-words font-sans text-[length:var(--font-size-sm)] leading-[var(--line-height-relaxed)]`,children:t.text}),(0,z.jsx)(Xb,{className:`mt-0 shrink-0 self-end`,isActionBusy:e,message:t,state:i,onDelete:n,onEdit:r})]}),o.length>0&&(0,z.jsx)(`div`,{className:`mt-2 flex flex-wrap gap-1.5`,children:o.map(e=>(0,z.jsxs)(`span`,{className:`inline-flex h-6 max-w-full items-center gap-1.5 rounded-[var(--radius-sm)] border border-current/20 bg-[var(--surface-floating)] px-2 text-[length:var(--font-size-xs)] font-medium text-current`,title:`${e.name} (${tx(e.size)})`,children:[(0,z.jsx)(Po,{className:`size-3.5 shrink-0`}),(0,z.jsx)(`span`,{className:`truncate`,children:e.name})]},`${e.path}:${e.name}`))})]})}function Db(e){let t=[],n=[];function r(){n.length!==0&&(n.length===1?t.push({kind:`message`,message:n[0]}):t.push({kind:`commandGroup`,id:`${n[0].id}:commands`,messages:n}),n=[])}for(let i of e){if(py(i)===`command`){n.push(i);continue}r(),t.push({kind:`message`,message:i})}return r(),t}function Ob({isPendingActionBusy:e,message:t,onDeletePendingMessage:n,onEditPendingMessage:r}){if(t.role===`event`)return(0,z.jsx)(kb,{message:t});let i=t.role===`user`,a=t.role===`error`,o=Zb(t),s=t.attachments??[];return(0,z.jsxs)(`article`,{className:q(i&&`ml-auto max-w-[78%] rounded-[var(--radius-lg)] border px-4 py-3 shadow-[var(--shadow-xs)]`,i&&!o&&`border-transparent bg-[var(--chat-user-bg)] text-[var(--chat-user-fg)]`,o===`queued`&&`border-[var(--semantic-warning-border)] bg-[var(--semantic-warning-bg)] text-[var(--semantic-warning-fg)]`,o===`steered`&&`border-[var(--semantic-info-border)] bg-[var(--semantic-info-bg)] text-[var(--semantic-info-fg)]`,t.role===`assistant`&&`mr-auto max-w-[82%] px-2 py-1 text-[var(--text-primary)]`,a&&`rounded-[var(--radius-lg)] border border-[var(--semantic-danger-border)] bg-[var(--semantic-danger-bg)] px-4 py-3 text-[var(--semantic-danger-fg)] shadow-[var(--shadow-xs)]`),children:[t.role===`assistant`&&t.textHtml!==void 0?(0,z.jsx)(`div`,{className:`markdown-message`,dangerouslySetInnerHTML:{__html:t.textHtml}}):(0,z.jsx)(`pre`,{className:`whitespace-pre-wrap break-words font-sans text-[length:var(--font-size-md)] leading-[var(--line-height-relaxed)]`,children:t.text}),s.length>0&&(0,z.jsx)(`div`,{className:q(`mt-2 flex flex-wrap gap-1.5`,i?`justify-end`:`justify-start`),children:s.map(e=>(0,z.jsxs)(`span`,{className:`inline-flex h-6 max-w-full items-center gap-1.5 rounded-[var(--radius-sm)] border border-current/20 bg-[var(--surface-floating)] px-2 text-[length:var(--font-size-xs)] font-medium text-current`,title:`${e.name} (${tx(e.size)})`,children:[(0,z.jsx)(Po,{className:`size-3.5 shrink-0`}),(0,z.jsx)(`span`,{className:`truncate`,children:e.name})]},`${e.path}:${e.name}`))}),o&&(0,z.jsx)(Xb,{isActionBusy:e,message:t,state:o,onDelete:n,onEdit:r})]})}function kb({message:e}){let t=py(e);return t===`plan`?(0,z.jsx)(Ab,{message:e}):t===`diff`?(0,z.jsx)(jb,{message:e}):t===`command`?(0,z.jsx)(Mb,{message:e}):t===`file`?(0,z.jsx)(Bb,{message:e}):t===`reasoning`?(0,z.jsx)(Kb,{message:e}):t===`warning`?(0,z.jsx)(qb,{message:e}):null}function Ab({message:e}){let{explanation:t,plan:n}=hy(e),r=vy(e);return(0,z.jsxs)(Jb,{icon:(0,z.jsx)(ko,{className:`size-4`}),meta:`${n.length} step${n.length===1?``:`s`}`,title:`Plan updated`,children:[t&&(0,z.jsx)(`p`,{className:`text-[length:var(--font-size-sm)] text-muted-foreground`,children:t}),n.length>0&&(0,z.jsx)(`ol`,{className:`mt-2 space-y-1`,children:n.map((e,t)=>(0,z.jsxs)(`li`,{className:`grid grid-cols-[1rem_minmax(0,1fr)] items-start gap-2 text-[length:var(--font-size-sm)]`,children:[(0,z.jsx)(e.status===`completed`?_o:e.status===`inProgress`?bo:yo,{className:q(`mt-0.5 size-3.5`,e.status===`completed`&&`text-[var(--semantic-success-fg)]`,e.status===`inProgress`&&`text-[var(--semantic-info-fg)]`,e.status===`pending`&&`text-muted-foreground`)}),(0,z.jsx)(`span`,{className:`min-w-0 break-words`,children:e.step})]},`${e.step}-${t}`))}),!t&&n.length===0&&r&&(0,z.jsx)(`p`,{className:`whitespace-pre-wrap break-words text-[length:var(--font-size-sm)] text-muted-foreground`,children:r})]})}function jb({message:e}){let{files:t,hasDiff:n}=gy(e);return(0,z.jsx)(Jb,{defaultOpen:!1,icon:(0,z.jsx)(So,{className:`size-4`}),meta:Wb([Ub(t.length,`file`),n?`diff hidden`:`cleared`]),summary:t.length>0?(0,z.jsx)(Gb,{paths:t}):(0,z.jsx)(`span`,{className:`truncate text-muted-foreground`,children:e.text||(n?`Diff hidden`:`Diff cleared`)}),title:`Diff`,children:(0,z.jsx)(Yb,{label:n?`Unified diff hidden`:`No diff`})})}function Mb({message:e}){return(0,z.jsx)(Pb,{messages:[e]})}function Nb({messages:e}){return(0,z.jsx)(Pb,{messages:e})}function Pb({messages:e}){let t=e.map(by),n=t.filter(zb).length,r=t.filter(e=>e.status===`completed`).length,i=t.reduce((e,t)=>e+(t.durationMs??0),0),a=t.some(e=>e.durationMs!==null),o=t.some(e=>e.capReached),s=t[0],c=e.length>1,l=c?Wb([n>0?`${n} failed`:null,r>0?`${r} completed`:null,a?Hb(i):null,o?`truncated`:null,`output hidden`]):Rb(s);return(0,z.jsxs)(`details`,{className:q(`group/command-log w-full border-l pl-2 text-[var(--text-tertiary)]`,n>0?`border-[var(--semantic-danger-border)]`:`border-[var(--border-divider)]`),children:[(0,z.jsxs)(`summary`,{className:`grid min-h-6 cursor-pointer list-none grid-cols-[auto_auto_minmax(0,auto)_minmax(0,1fr)_auto] items-center gap-1.5 rounded-[var(--radius-xs)] px-1 py-0.5 outline-none transition-colors hover:bg-[var(--state-hover-bg)] focus-visible:shadow-[var(--state-focus-ring)] [&::-webkit-details-marker]:hidden`,title:s?.command??s?.cwd??void 0,children:[(0,z.jsx)(ho,{className:`size-3 shrink-0 transition-transform group-open/command-log:rotate-90`}),(0,z.jsx)(Ho,{className:`size-3.5 shrink-0`}),(0,z.jsx)(`span`,{className:q(`truncate text-[length:var(--font-size-xs)] font-medium`,n>0?`text-[var(--semantic-danger-fg)]`:`text-[var(--text-tertiary)]`),children:c?`${e.length} log entries`:`Command`}),(0,z.jsxs)(`span`,{className:`min-w-0 truncate font-mono text-[length:var(--font-size-xs)]`,children:[Ib(s),c&&e.length>1?` ...`:``]}),l&&(0,z.jsx)(`span`,{className:`max-w-[45%] shrink-0 truncate text-[length:var(--font-size-2xs)] text-muted-foreground`,children:l})]}),(0,z.jsx)(`div`,{className:`ml-5 mt-1 space-y-1 border-l border-[var(--border-divider)] pl-2`,children:e.map(e=>(0,z.jsx)(Fb,{message:e},e.id))})]})}function Fb({message:e}){let t=by(e),n=Rb(t);return(0,z.jsxs)(`div`,{className:q(`grid min-h-6 grid-cols-[minmax(0,1fr)_auto] items-center gap-x-2 gap-y-1 rounded-[var(--radius-xs)] px-1 py-0.5`,zb(t)&&`bg-[var(--semantic-danger-bg)]`),children:[(0,z.jsx)(`span`,{className:q(`min-w-0 truncate font-mono text-[length:var(--font-size-xs)]`,zb(t)?`text-[var(--semantic-danger-fg)]`:`text-[var(--text-secondary)]`),title:t.command??t.cwd??void 0,children:Ib(t)}),n&&(0,z.jsx)(`span`,{className:q(`max-w-[45%] shrink-0 truncate text-[length:var(--font-size-2xs)]`,zb(t)?`text-[var(--semantic-danger-fg)]`:`text-muted-foreground`),children:n}),(0,z.jsx)(`p`,{className:`col-span-2 min-w-0 max-w-full whitespace-pre-wrap break-words font-mono text-[length:var(--font-size-xs)] leading-[var(--line-height-relaxed)] text-muted-foreground`,title:t.cwd??void 0,children:Lb(t)})]})}function Ib(e){let t=e?.command??e?.stream??`output`,n=t.indexOf(` -lc '`);if(n>=0&&t.endsWith(`'`))return t.slice(n+6,-1);let r=t.indexOf(` -lc "`);return r>=0&&t.endsWith(`"`)?t.slice(r+6,-1):t}function Lb(e){return e.command??e.stream??`output`}function Rb(e){if(e)return Wb([e.status,e.exitCode===null?null:`exit ${e.exitCode}`,e.durationMs===null?null:Hb(e.durationMs),e.capReached?`truncated`:null,`output hidden`])}function zb(e){return e.status===`failed`||e.exitCode!==null&&e.exitCode!==0}function Bb({message:e}){let t=_y(e),n=xy(e);return e.eventType===`item/fileChange/outputDelta`?(0,z.jsx)(Jb,{defaultOpen:!1,icon:(0,z.jsx)(Co,{className:`size-4`}),meta:`output hidden`,summary:(0,z.jsx)(`span`,{className:`block min-w-0 max-w-full truncate text-muted-foreground`,children:`File change output`}),title:`File`,children:(0,z.jsx)(Yb,{label:`Output hidden`})}):(0,z.jsxs)(Jb,{defaultOpen:!1,icon:(0,z.jsx)(Co,{className:`size-4`}),meta:Wb([n.status,Ub(t.length,`file`),`patch hidden`]),summary:t.length>0?(0,z.jsx)(Gb,{paths:t.map(e=>e.path)}):(0,z.jsx)(`span`,{className:`truncate text-muted-foreground`,children:e.text||`No files`}),title:`File edit`,children:[n.status&&(0,z.jsxs)(`div`,{className:`mb-2 flex flex-wrap gap-1.5`,children:[(0,z.jsx)(rc,{variant:Vb(n.status),children:n.status}),(0,z.jsxs)(rc,{variant:`secondary`,children:[t.length,` file`,t.length===1?``:`s`]})]}),t.length===0?(0,z.jsx)(`p`,{className:`text-[length:var(--font-size-sm)] text-muted-foreground`,children:e.text}):(0,z.jsx)(`div`,{className:`space-y-1.5`,children:t.map(e=>(0,z.jsx)(`div`,{className:`rounded-[var(--radius-sm)] border border-[var(--border-subtle)] bg-[var(--surface-panel)]`,children:(0,z.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2 px-2 py-1.5`,children:[(0,z.jsx)(rc,{className:`shrink-0`,variant:`secondary`,children:e.kind}),(0,z.jsx)(`span`,{className:`truncate font-mono text-[length:var(--font-size-xs)]`,children:e.path}),(0,z.jsx)(`span`,{className:`ml-auto shrink-0 font-mono text-[length:var(--font-size-xs)] text-muted-foreground`,children:`patch hidden`})]})},`${e.kind}:${e.path}`))})]})}function Vb(e){return e===`completed`?`success`:e===`failed`?`danger`:e===`declined`?`warning`:e===`inProgress`?`info`:`secondary`}function Hb(e){return e>=1e3?`${(e/1e3).toFixed(1)}s`:`${e}ms`}function Ub(e,t){return`${e} ${t}${e===1?``:`s`}`}function Wb(e){let t=e.filter(e=>!!(e&&e.trim()));return t.length>0?t.join(` · `):void 0}function Gb({paths:e}){let t=e.slice(0,3);return(0,z.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-center gap-1 overflow-hidden`,children:[t.map(e=>(0,z.jsx)(`span`,{className:`min-w-0 max-w-48 truncate rounded-[var(--radius-xs)] border border-[var(--border-subtle)] bg-[var(--surface-panel)] px-1.5 py-0.5 font-mono text-[length:var(--font-size-xs)] text-[var(--text-secondary)]`,title:e,children:e},e)),e.length>t.length&&(0,z.jsxs)(`span`,{className:`shrink-0 text-[length:var(--font-size-xs)] text-muted-foreground`,children:[`+`,e.length-t.length]})]})}function Kb({message:e}){let t=vy(e);return(0,z.jsx)(Jb,{defaultOpen:!1,icon:(0,z.jsx)(po,{className:`size-4`}),meta:Ub(Sy(t),`line`),summary:(0,z.jsx)(`span`,{className:`block min-w-0 max-w-full truncate text-muted-foreground`,children:`Reasoning details`}),title:`Reasoning updated`,children:(0,z.jsx)(`pre`,{className:`whitespace-pre-wrap break-words rounded-[var(--radius-md)] bg-[var(--surface-code)] p-2 font-mono text-[length:var(--font-size-xs)] leading-[var(--line-height-relaxed)]`,children:t})})}function qb({message:e}){let t=yy(e);return(0,z.jsxs)(Jb,{icon:(0,z.jsx)(Wo,{className:`size-4`}),summary:(0,z.jsx)(`span`,{className:`block min-w-0 max-w-full truncate`,children:t.summary}),tone:`warning`,title:`Warning`,children:[(0,z.jsx)(`p`,{className:`text-[length:var(--font-size-sm)]`,children:t.summary}),t.details&&(0,z.jsx)(`p`,{className:`mt-1 text-[length:var(--font-size-xs)] text-muted-foreground`,children:t.details})]})}function Jb({children:e,defaultOpen:t=!0,icon:n,meta:r,summary:i,title:a,tone:o=`neutral`}){return(0,z.jsxs)(`details`,{className:q(`group w-full rounded-[var(--radius-md)] border bg-[var(--surface-card)] text-[var(--text-primary)]`,o===`neutral`&&`border-[var(--border-subtle)]`,o===`warning`&&`border-[var(--semantic-warning-border)] bg-[var(--semantic-warning-bg)] text-[var(--semantic-warning-fg)]`),open:t||void 0,children:[(0,z.jsxs)(`summary`,{className:`grid min-h-9 cursor-pointer list-none grid-cols-[auto_auto_minmax(0,auto)_minmax(0,1fr)_auto] items-center gap-2 px-2.5 py-1.5 outline-none transition-colors hover:bg-[var(--state-hover-bg)] focus-visible:shadow-[var(--state-focus-ring)] [&::-webkit-details-marker]:hidden`,title:r,children:[(0,z.jsx)(ho,{className:`size-3.5 shrink-0 text-muted-foreground transition-transform group-open:rotate-90`}),(0,z.jsx)(`span`,{className:`shrink-0 text-muted-foreground`,children:n}),(0,z.jsx)(`span`,{className:`truncate text-[length:var(--font-size-sm)] font-semibold`,children:a}),i&&(0,z.jsx)(`span`,{className:`min-w-0 max-w-full overflow-hidden`,children:i}),r&&(0,z.jsx)(`span`,{className:`shrink-0 truncate text-[length:var(--font-size-xs)] text-muted-foreground`,children:r})]}),(0,z.jsx)(`div`,{className:q(`border-t px-3 py-2`,o===`neutral`&&`border-[var(--border-subtle)]`,o===`warning`&&`border-[var(--semantic-warning-border)]`),children:e})]})}function Yb({label:e}){return(0,z.jsx)(`p`,{className:`text-[length:var(--font-size-sm)] text-muted-foreground`,children:e})}function Xb({className:e,isActionBusy:t,message:n,onDelete:r,onEdit:i,state:a}){let o=a===`queued`,s=o?`Queued for next turn`:`Steered into active turn`,c=o?bo:zo;return(0,z.jsxs)(`div`,{className:q(`mt-2 flex flex-wrap justify-end gap-1.5`,e),children:[(0,z.jsxs)(`span`,{className:`inline-flex h-6 max-w-full items-center gap-1.5 rounded-[var(--radius-sm)] border border-current/20 bg-[var(--surface-floating)] px-2 text-[length:var(--font-size-xs)] font-medium text-current`,children:[(0,z.jsx)(c,{className:`size-3.5 shrink-0`}),(0,z.jsx)(`span`,{className:`truncate`,children:s})]}),o&&(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(oc,{"aria-label":`Edit pending message`,className:`size-6 border-current/20 bg-[var(--surface-floating)] text-current hover:bg-[var(--state-hover-bg)]`,disabled:t,size:`icon`,title:`Edit pending message`,type:`button`,variant:`outline`,onClick:()=>i(n),children:(0,z.jsx)(Fo,{className:`size-3.5`})}),(0,z.jsx)(oc,{"aria-label":`Delete pending message`,className:`size-6 border-current/20 bg-[var(--surface-floating)] text-current hover:bg-[var(--state-hover-bg)]`,disabled:t,size:`icon`,title:`Delete pending message`,type:`button`,variant:`outline`,onClick:()=>r(n),children:(0,z.jsx)(Uo,{className:`size-3.5`})})]})]})}function Zb(e){return e.role===`user`?e.eventType===`chat.message.queued`?`queued`:e.eventType===`chat.message.steered`?`steered`:null:null}function Qb(e){return{name:e.name,path:e.path,relativePath:e.name,root:``,score:0}}function $b(e){return{id:`${e.path}:${e.name}`,mimeType:e.mimeType,name:e.name,record:e,size:e.size}}async function ex(e){try{let t=new Uint8Array(await e.slice(0,Wy.length).arrayBuffer());return Wy.every((e,n)=>t[n]===e)}catch{return!1}}function tx(e){return e<1024?`${e} B`:e<1024*1024?`${Math.ceil(e/1024)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function nx(){return(0,z.jsx)(Bi,{})}var rx=[{path:`/`,Component:nx,HydrateFallback:Xo,children:[{index:!0,Component:cb}]}];function ix(){return ka(rx)}var ax=new Pe,ox=document.getElementById(`root`);if(!ox)throw Error(`Root element was not found`);(0,$a.createRoot)(ox).render((0,z.jsx)(R.StrictMode,{children:(0,z.jsx)(ze,{client:ax,children:(0,z.jsx)(Ii,{router:ix()})})})),eo();
|