@ai-matrx/coding-sessions 0.1.81 → 0.1.83

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.
@@ -1,69 +0,0 @@
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),e=null),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,o)=>(o=n==null?{}:e(i(n)),s(r||!n||!n.__esModule||!a.call(n,`default`)?t(o,`default`,{value:n,enumerable:!0}):o,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),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`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.for(`react.view_transition`),m=Symbol.iterator;function h(e){return typeof e!=`object`||!e?null:(e=m&&e[m]||e[`@@iterator`],typeof e==`function`?e:null)}var g={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},_=Object.assign,v={};function y(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||g}y.prototype.isReactComponent={},y.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`)},y.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function b(){}b.prototype=y.prototype;function x(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||g}var S=x.prototype=new b;S.constructor=x,_(S,y.prototype),S.isPureReactComponent=!0;var C=Array.isArray;function w(){}var T={H:null,A:null,T:null,S:null},E=Object.prototype.hasOwnProperty;function D(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function O(e,t){return D(e.type,t,e.props)}function k(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function ee(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?ee(``+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(w,w):(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 te(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,te(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+j(e,0):a,C(o)?(i=``,c!=null&&(i=c.replace(A,`$&/`)+`/`),te(o,r,i,``,function(e){return e})):o!=null&&(k(o)&&(o=O(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(C(e))for(var u=0;u<e.length;u++)a=e[u],s=l+j(a,u),c+=te(a,r,i,s,o);else if(u=h(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+j(a,u++),c+=te(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return te(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 ne(e,t,n){if(e==null)return e;var r=[],i=0;return te(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function N(e){if(e._status===-1){var t=e._result,n=t();n.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t,n.status===void 0&&(n.status=`fulfilled`,n.value=t))},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t,n.status===void 0&&(n.status=`rejected`,n.reason=t))}),e._status===-1&&(e._status=0,e._result=n)}if(e._status===1)return e._result.default;throw e._result}var re=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)};function ie(e){var t=T.T,n={};n.types=t===null?null:t.types,T.T=n;try{var r=e(),i=T.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(w,re)}catch(e){re(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),T.T=t}}function ae(e){var t=T.T;if(t!==null){var n=t.types;n===null?t.types=[e]:n.indexOf(e)===-1&&n.push(e)}else ie(ae.bind(null,e))}var oe={map:ne,forEach:function(e,t,n){ne(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return ne(e,function(){t++}),t},toArray:function(e){return ne(e,function(e){return e})||[]},only:function(e){if(!k(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=oe,e.Component=y,e.Fragment=r,e.Profiler=a,e.PureComponent=x,e.StrictMode=i,e.Suspense=l,e.ViewTransition=p,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=T,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return T.H.useMemoCache(e)}},e.addTransitionType=ae,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=_({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!E.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 D(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)E.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 D(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=k,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:N}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=ie,e.unstable_useCacheRefresh=function(){return T.H.useCacheRefresh()},e.use=function(e){return T.H.use(e)},e.useActionState=function(e,t,n){return T.H.useActionState(e,t,n)},e.useCallback=function(e,t){return T.H.useCallback(e,t)},e.useContext=function(e){return T.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return T.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return T.H.useEffect(e,t)},e.useEffectEvent=function(e){return T.H.useEffectEvent(e)},e.useId=function(){return T.H.useId()},e.useImperativeHandle=function(e,t,n){return T.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return T.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return T.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return T.H.useMemo(e,t)},e.useOptimistic=function(e,t){return T.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return T.H.useReducer(e,t,n)},e.useRef=function(e){return T.H.useRef(e)},e.useState=function(e){return T.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return T.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return T.H.useTransition()},e.version=`19.3.0`})),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&&A(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&&A(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,ee=k.port2;k.port1.onmessage=D,O=function(){ee.postMessage(null)}}else O=function(){_(D,0)};function A(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,A(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`),o=Symbol.for(`react.recoverable`),s=Symbol.for(`react.optimistic_key`);function c(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:r==null?null:r===s?s:``+r,children:e,containerInfo:t,implementation:n}}var l=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function d(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.browser=function(e){return{$$typeof:o,_reason:e}},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 c(e,t,null,r)},e.flushSync=function(e){var t=l.T,n=i.p;try{if(l.T=null,i.p=2,e)return e()}finally{l.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=d(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=d(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,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority: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=d(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=d(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,nonce:typeof t.nonce==`string`?t.nonce:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority: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 l.H.useFormState(e,t,n)},e.useFormStatus=function(){return l.H.useHostTransitionStatus()},e.version=`19.3.0`})),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){for(var t=e,n=t;n&&!n.alternate;)t=n,t.flags&4098&&(e=t.return),n=t.return;for(;t.return;)t=t.return;return t.tag===3?e: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}function h(e,t,n,r,i,a){for(;e!==null;){if((e.tag===5||e.tag===27||e.tag===6)&&n(e,r,i,a)||(e.tag!==22||e.memoizedState===null)&&(t||e.tag!==5&&e.tag!==27)&&h(e.child,t,n,r,i,a))return!0;e=e.sibling}return!1}function g(e){for(e=e.return;e!==null;){if(e.tag===3||e.tag===5||e.tag===27)return e;e=e.return}return null}function _(e){var t=!1;for(e=e.return;e!==null&&(e.tag===4&&(t=!0),e.tag!==3&&e.tag!==5&&e.tag!==27);)e=e.return;return t}function v(e){var t=[null,null],n=g(e);return n===null||y(t,e,n.child,{foundSelf:!1}),t}function y(e,t,n,r){for(;n!==null;){if(n===t)r.foundSelf=!0;else if(n.tag===5||n.tag===27||n.tag===6){if(r.foundSelf)return e[1]=n,!0;e[0]=n}else if((n.tag!==22||n.memoizedState===null)&&y(e,t,n.child,r))return!0;n=n.sibling}return!1}function b(e){switch(e.tag){case 5:case 27:case 6:return e.stateNode;case 3:return e.stateNode.containerInfo;default:throw Error(i(559))}}var x=null,S=null;function C(e,t,n){return e===n||e===t&&(x=e,!0)}function w(e,t,n){return e===n?(S=e,!1):e===t&&(S!==null&&(x=e),!0)}function T(e){if(e===null)return null;do e=e===null?null:e.return;while(e&&e.tag!==5&&e.tag!==27&&e.tag!==3);return e||null}function E(e,t,n){for(var r=0,i=e;i;i=n(i))r++;i=0;for(var a=t;a;a=n(a))i++;for(;0<r-i;)e=n(e),r--;for(;0<i-r;)t=n(t),i--;for(;r--;){if(e===t||t!==null&&e===t.alternate)return e;e=n(e),t=n(t)}return null}var D=Object.assign,O=Symbol.for(`react.element`),k=Symbol.for(`react.transitional.element`),ee=Symbol.for(`react.portal`),A=Symbol.for(`react.fragment`),j=Symbol.for(`react.strict_mode`),M=Symbol.for(`react.profiler`),te=Symbol.for(`react.consumer`),ne=Symbol.for(`react.context`),N=Symbol.for(`react.forward_ref`),re=Symbol.for(`react.suspense`),ie=Symbol.for(`react.suspense_list`),ae=Symbol.for(`react.memo`),oe=Symbol.for(`react.lazy`),se=Symbol.for(`react.activity`),ce=Symbol.for(`react.legacy_hidden`),le=Symbol.for(`react.memo_cache_sentinel`),ue=Symbol.for(`react.view_transition`),de=Symbol.for(`react.recoverable`),fe=Symbol.iterator;function pe(e){return typeof e!=`object`||!e?null:(e=fe&&e[fe]||e[`@@iterator`],typeof e==`function`?e:null)}var me=Symbol.for(`react.client.reference`);function he(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===me?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case A:return`Fragment`;case M:return`Profiler`;case j:return`StrictMode`;case re:return`Suspense`;case ie:return`SuspenseList`;case se:return`Activity`;case ue:return`ViewTransition`}if(typeof e==`object`)switch(e.$$typeof){case ee:return`Portal`;case ne:return e.displayName||`Context`;case te:return(e._context.displayName||`Context`)+`.Consumer`;case N:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case ae:return t=e.displayName||null,t===null?he(e.type)||`Memo`:t;case oe:t=e._payload,e=e._init;try{return he(e(t))}catch{}}return null}var ge=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,_e={pending:!1,data:null,method:null,action:null},ve=[],ye=-1;function be(e){return{current:e}}function xe(e){0>ye||(e.current=ve[ye],ve[ye]=null,ye--)}function Se(e,t){ye++,ve[ye]=e.current,e.current=t}var Ce=be(null),we=be(null),Te=be(null),Ee=be(null);function De(e,t){switch(Se(Te,t),Se(we,e),Se(Ce,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?dp(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=dp(t),e=fp(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}xe(Ce),Se(Ce,e)}function Oe(){xe(Ce),xe(we),xe(Te)}function ke(e){var t=e.memoizedState;t!==null&&(sh._currentValue=t.memoizedState,Se(Ee,e)),t=Ce.current;var n=fp(t,e.type);t!==n&&(Se(we,e),Se(Ce,n))}function Ae(e){we.current===e&&(xe(Ce),xe(we)),Ee.current===e&&(xe(Ee),sh._currentValue=_e)}var je,Me;function Ne(e){if(je===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);je=t&&t[1]||``,Me=-1<e.stack.indexOf(`
2
- at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
3
- `+je+e+Me}var Pe=!1;function Fe(e,t){if(!e||Pe)return``;Pe=!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}n=!1;try{var i=Object.getOwnPropertyDescriptor(e.prototype,`props`);Object.defineProperty(e.prototype,"props",{configurable:!0,set:function(){throw Error()}}),n=!0,new e}finally{n&&(i===void 0?delete e.prototype.props:Object.defineProperty(e.prototype,"props",i))}}}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{Pe=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?Ne(n):``}function Ie(e,t){switch(e.tag){case 26:case 27:case 5:return Ne(e.type);case 16:return Ne(`Lazy`);case 13:return e.child!==t&&t!==null?Ne(`Suspense Fallback`):Ne(`Suspense`);case 19:return Ne(`SuspenseList`);case 0:case 15:return Fe(e.type,!1);case 11:return Fe(e.type.render,!1);case 1:return Fe(e.type,!0);case 31:return Ne(`Activity`);case 30:return Ne(`ViewTransition`);default:return``}}function Le(e){try{var t=``,n=null;do t+=Ie(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
7
- Error generating stack: `+e.message+`
8
- `+e.stack}}var Re=Object.prototype.hasOwnProperty,ze=t.unstable_scheduleCallback,Be=t.unstable_cancelCallback,Ve=t.unstable_shouldYield,He=t.unstable_requestPaint,Ue=t.unstable_now,We=t.unstable_getCurrentPriorityLevel,Ge=t.unstable_ImmediatePriority,Ke=t.unstable_UserBlockingPriority,qe=t.unstable_NormalPriority,Je=t.unstable_LowPriority,Ye=t.unstable_IdlePriority,Xe=t.log,Ze=t.unstable_setDisableYieldValue,Qe=null,$e=null;function et(e){if(typeof Xe==`function`&&Ze(e),$e&&typeof $e.setStrictMode==`function`)try{$e.setStrictMode(Qe,e)}catch{}}var tt=Math.clz32?Math.clz32:it,nt=Math.log,rt=Math.LN2;function it(e){return e>>>=0,e===0?32:31-(nt(e)/rt|0)|0}var at=256,ot=262144,st=4194304;function ct(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&-e;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 lt(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=ct(n))):i=ct(o):i=ct(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=ct(n))):i=ct(o)):i=ct(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 ut(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function dt(e,t){t&8&&(t|=t&32);var n=e.entangledLanes;if(n!==0)for(e=e.entanglements,n&=t;0<n;){var r=31-tt(n),i=1<<r;t|=e[r],n&=~i}return t}function ft(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 pt(){var e=st;return st<<=1,!(st&62914560)&&(st=4194304),e}function mt(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function ht(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function gt(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-tt(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&&_t(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function _t(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-tt(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function vt(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-tt(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function yt(e,t){var n=t&-t;return n=n&42?1:bt(n),(n&(e.suspendedLanes|t))===0?n:0}function bt(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 xt(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function St(){var e=F.p;return e===0?(e=window.event,e===void 0?32:Ch(e.type)):e}function Ct(e,t){var n=F.p;try{return F.p=e,t()}finally{F.p=n}}var wt=Math.random().toString(36).slice(2),Tt=`__reactFiber$`+wt,Et=`__reactProps$`+wt,Dt=`__reactContainer$`+wt,Ot=`__reactEvents$`+wt,kt=`__reactListeners$`+wt,At=`__reactHandles$`+wt,jt=`__reactResources$`+wt,Mt=`__reactMarker$`+wt,Nt=`__reactLoad$`+wt;function Pt(e){delete e[Tt],delete e[Et],delete e[kt],delete e[At]}function Ft(e){var t;if(t=e[Tt])return t;for(var n=e.parentNode;n;){if(t=n[Dt]||n[Tt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=pm(e);e!==null;){if(n=e[Tt])return n;e=pm(e)}return t}e=n,n=e.parentNode}return null}function It(e){if(e=e[Tt]||e[Dt]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Lt(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function Rt(e){var t=e[jt];return t||=e[jt]={hoistableStyles:new Map,hoistableScripts:new Map},t}function zt(e){e[Mt]=!0}function Bt(e){e[Nt]=void 0}var Vt=new Set,Ht={};function Ut(e,t){Wt(e,t),Wt(e+`Capture`,t)}function Wt(e,t){for(Ht[e]=t,e=0;e<t.length;e++)Vt.add(t[e])}var Gt=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]*$`),Kt={},qt={};function Jt(e){return Re.call(qt,e)?!0:Re.call(Kt,e)?!1:Gt.test(e)?qt[e]=!0:(Kt[e]=!0,!1)}var I=!1;function Yt(){var e=I;return I=!1,e}function Xt(e,t,n){if(Jt(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 Zt(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 Qt(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 $t(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function en(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function tn(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 nn(e){if(!e._valueTracker){var t=en(e)?`checked`:`value`;e._valueTracker=tn(e,t,``+e[t])}}function rn(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=en(e)?e.checked?`true`:`false`:e.value),e=r,e!==n&&(t.setValue(e),!0)}var an=/[\n"\\]/g;function on(e){return e.replace(an,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function sn(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=``+$t(t)):e.value!==``+$t(t)&&(e.value=``+$t(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):ln(e,$t(n)):o===`number`&&e.value==t?ln(e,$t(e.value)):ln(e,$t(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=``+$t(s):e.removeAttribute(`name`)}function cn(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)){nn(e);return}n=n==null?``:``+$t(n),t=t==null?n:``+$t(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),nn(e)}function ln(e,t){e.defaultValue!==``+t&&(e.defaultValue=``+t)}function un(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=``+$t(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 dn(e,t,n){if(t!=null&&(t=``+$t(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n==null?``:``+$t(n)}function fn(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(ge(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n??=``,t=n}n=$t(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),nn(e)}function pn(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var mn=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 hn(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||mn.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function gn(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]=``,I=!0);for(var a in t)r=t[a],t.hasOwnProperty(a)&&n[a]!==r&&(hn(e,a,r),I=!0)}else for(var o in t)t.hasOwnProperty(o)&&hn(e,o,t[o])}function _n(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 vn=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`],[`maskType`,`mask-type`],[`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`]]),yn=/^[\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 bn(e){return yn.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function xn(){}var Sn=null;function Cn(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var wn=null,Tn=null;function En(e){var t=It(e);if(t&&(e=t.stateNode)){var n=e[Et]||null;a:switch(e=t.stateNode,t.type){case`input`:if(sn(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="`+on(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[Et]||null;if(!a)throw Error(i(90));sn(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&&rn(r)}break a;case`textarea`:dn(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&un(e,!!n.multiple,t,!1)}}}var Dn=!1;function On(e,t,n){if(Dn)return e(t,n);Dn=!0;try{return e(t)}finally{if(Dn=!1,(wn!==null||Tn!==null)&&(zd(),wn&&(t=wn,e=Tn,Tn=wn=null,En(t),e)))for(t=0;t<e.length;t++)En(e[t])}}function kn(e,t){var n=e.stateNode;if(n===null)return null;var r=n[Et]||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 An=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0,jn=!1;if(An)try{var Mn={};Object.defineProperty(Mn,"passive",{get:function(){jn=!0}}),window.addEventListener(`test`,Mn,Mn),window.removeEventListener(`test`,Mn,Mn)}catch{jn=!1}var Nn=null,Pn=null,Fn=null;function In(){if(Fn)return Fn;var e,t=Pn,n=t.length,r,i=`value`in Nn?Nn.value:Nn.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 Fn=i.slice(e,1<r?1-r:void 0)}function Ln(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 Rn(){return!0}function zn(){return!1}function Bn(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)?Rn:zn,this.isPropagationStopped=zn,this}return D(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=Rn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=Rn)},persist:function(){},isPersistent:Rn}),t}var Vn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Hn=Bn(Vn),Un=D({},Vn,{view:0,detail:0}),Wn=Bn(Un),Gn,Kn,qn,Jn=D({},Un,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ar,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!==qn&&(qn&&e.type===`mousemove`?(Gn=e.screenX-qn.screenX,Kn=e.screenY-qn.screenY):Kn=Gn=0,qn=e),Gn)},movementY:function(e){return`movementY`in e?e.movementY:Kn}}),Yn=Bn(Jn),Xn=Bn(D({},Jn,{dataTransfer:0})),Zn=Bn(D({},Un,{relatedTarget:0})),Qn=Bn(D({},Vn,{animationName:0,elapsedTime:0,pseudoElement:0})),$n=Bn(D({},Vn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),er=Bn(D({},Vn,{data:0})),tr={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},nr={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`},rr={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function ir(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=rr[e])?!!t[e]:!1}function ar(){return ir}var or=Bn(D({},Un,{key:function(e){if(e.key){var t=tr[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=Ln(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?nr[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:ar,charCode:function(e){return e.type===`keypress`?Ln(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?Ln(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),sr=Bn(D({},Jn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),cr=Bn(D({},Vn,{submitter:0})),lr=Bn(D({},Un,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ar})),ur=Bn(D({},Vn,{propertyName:0,elapsedTime:0,pseudoElement:0})),dr=Bn(D({},Jn,{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})),fr=Bn(D({},Vn,{newState:0,oldState:0,source:0})),pr=[9,13,27,32],mr=An&&`CompositionEvent`in window,hr=null;An&&`documentMode`in document&&(hr=document.documentMode);var gr=An&&`TextEvent`in window&&!hr,_r=An&&(!mr||hr&&8<hr&&11>=hr),vr=` `,yr=!1;function br(e,t){switch(e){case`keyup`:return pr.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function xr(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var Sr=!1;function Cr(e,t){switch(e){case`compositionend`:return xr(t);case`keypress`:return t.which===32?(yr=!0,vr):null;case`textInput`:return e=t.data,e===vr&&yr?null:e;default:return null}}function wr(e,t){if(Sr)return e===`compositionend`||!mr&&br(e,t)?(e=In(),Fn=Pn=Nn=null,Sr=!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 _r&&t.locale!==`ko`?null:t.data;default:return null}}var Tr={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 Er(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!Tr[e.type]:t===`textarea`}function Dr(e,t,n,r){wn?Tn?Tn.push(r):Tn=[r]:wn=r,t=Jf(t,`onChange`),0<t.length&&(n=new Hn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var Or=null,kr=null;function Ar(e){Vf(e,0)}function jr(e){if(rn(Lt(e)))return e}function Mr(e,t){if(e===`change`)return t}var Nr=!1;if(An){var Pr;if(An){var Fr=`oninput`in document;if(!Fr){var Ir=document.createElement(`div`);Ir.setAttribute(`oninput`,`return;`),Fr=typeof Ir.oninput==`function`}Pr=Fr}else Pr=!1;Nr=Pr&&(!document.documentMode||9<document.documentMode)}function Lr(){Or&&(Or.detachEvent(`onpropertychange`,Rr),kr=Or=null)}function Rr(e){if(e.propertyName===`value`&&jr(kr)){var t=[];Dr(t,kr,e,Cn(e)),On(Ar,t)}}function zr(e,t,n){e===`focusin`?(Lr(),Or=t,kr=n,Or.attachEvent(`onpropertychange`,Rr)):e===`focusout`&&Lr()}function Br(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return jr(kr)}function Vr(e,t){if(e===`click`)return jr(t)}function Hr(e,t){if(e===`input`||e===`change`)return jr(t)}function Ur(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var Wr=typeof Object.is==`function`?Object.is:Ur;function Gr(e,t){if(Wr(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(!Re.call(t,i)||!Wr(e[i],t[i]))return!1}return!0}function Kr(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}function qr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Jr(e,t){var n=qr(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=qr(n)}}function Yr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Yr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function L(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Kr(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=Kr(e.document)}return t}function Xr(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 Zr=An&&`documentMode`in document&&11>=document.documentMode,Qr=null,$r=null,ei=null,ti=!1;function ni(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;ti||Qr==null||Qr!==Kr(r)||(r=Qr,`selectionStart`in r&&Xr(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}),ei&&Gr(ei,r)||(ei=r,r=Jf($r,`onSelect`),0<r.length&&(t=new Hn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=Qr)))}function ri(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var R={animationend:ri(`Animation`,`AnimationEnd`),animationiteration:ri(`Animation`,`AnimationIteration`),animationstart:ri(`Animation`,`AnimationStart`),transitionrun:ri(`Transition`,`TransitionRun`),transitionstart:ri(`Transition`,`TransitionStart`),transitioncancel:ri(`Transition`,`TransitionCancel`),transitionend:ri(`Transition`,`TransitionEnd`)},ii={},ai={};An&&(ai=document.createElement(`div`).style,`AnimationEvent`in window||(delete R.animationend.animation,delete R.animationiteration.animation,delete R.animationstart.animation),`TransitionEvent`in window||delete R.transitionend.transition);function oi(e){if(ii[e])return ii[e];if(!R[e])return e;var t=R[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in ai)return ii[e]=t[n];return e}var si=oi(`animationend`),ci=oi(`animationiteration`),li=oi(`animationstart`),ui=oi(`transitionrun`),di=oi(`transitionstart`),fi=oi(`transitioncancel`),pi=oi(`transitionend`),mi=new Map,hi=`abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error fullscreenChange fullscreenError 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(` `);hi.push(`scrollEnd`);function gi(e,t){mi.set(e,t),Ut(t,[e])}var _i=0;function vi(e,t){if(e.name!=null&&e.name!==`auto`)return e.name;if(t.autoName!==null)return t.autoName;e=bd.identifierPrefix;var n=_i++;return e=`_`+e+`t_`+n.toString(32)+`_`,t.autoName=e}function yi(e){if(e==null||typeof e==`string`)return e;var t=null,n=Od;if(n!==null)for(var r=0;r<n.length;r++){var i=e[n[r]];if(i!=null){if(i===`none`)return`none`;t=t==null?i:t+(` `+i)}}return t??e.default}function bi(e,t){return e=yi(e),t=yi(t),t==null?e===`auto`?null:e:t===`auto`?null:t}var xi=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)},Si=[],Ci=0,wi=0;function Ti(){for(var e=Ci,t=wi=Ci=0;t<e;){var n=Si[t];Si[t++]=null;var r=Si[t];Si[t++]=null;var i=Si[t];Si[t++]=null;var a=Si[t];if(Si[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&&ki(n,i,a)}}function Ei(e,t,n,r){Si[Ci++]=e,Si[Ci++]=t,Si[Ci++]=n,Si[Ci++]=r,wi|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function Di(e,t,n,r){return Ei(e,t,n,r),Ai(e)}function Oi(e,t){return Ei(e,null,null,t),Ai(e)}function ki(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-tt(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function Ai(e){if(50<kd)throw kd=0,Ad=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var ji={};function Mi(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 Ni(e,t,n,r){return new Mi(e,t,n,r)}function Pi(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Fi(e,t){var n=e.alternate;return n===null?(n=Ni(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&1206910976,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 Ii(e,t){e.flags&=1206910978;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 Li(e,t,n,r,a,o){var s=0;if(r=e,typeof r==`function`)Pi(r)&&(s=1);else if(typeof r==`string`)s=qm(e,n,Ce.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(r){case se:return e=Ni(31,n,t,a),e.elementType=se,e.lanes=o,e;case A:return Ri(n.children,a,o,t);case j:s=8,a|=24;break;case M:return e=Ni(12,n,t,a|2),e.elementType=M,e.lanes=o,e;case re:return e=Ni(13,n,t,a),e.elementType=re,e.lanes=o,e;case ie:return e=Ni(19,n,t,a),e.elementType=ie,e.lanes=o,e;case ce:case ue:return e=a|32,e=Ni(30,n,t,e),e.elementType=ue,e.lanes=o,e.stateNode={autoName:null,paired:null,clones:null,ref:null},e;default:if(typeof r==`object`&&r)switch(r.$$typeof){case ne:s=10;break a;case te:s=9;break a;case N:s=11;break a;case ae:s=14;break a;case oe:s=16,r=null;break a}s=29,n=Error(i(130,e===null?`null`:typeof e,``)),r=null}return t=Ni(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function Ri(e,t,n,r){return e=Ni(7,e,r,t),e.lanes=n,e}function zi(e,t,n){return e=Ni(6,e,null,t),e.lanes=n,e}function Bi(e){var t=Ni(18,null,null,0);return t.stateNode=e,t}function Vi(e,t,n){return t=Ni(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Hi=new WeakMap;function Ui(e,t){if(typeof e==`object`&&e){var n=Hi.get(e);return n===void 0?(t={value:e,source:t,stack:Le(t)},Hi.set(e,t),t):n}return{value:e,source:t,stack:Le(t)}}var Wi=[],Gi=0,Ki=null,qi=0,Ji=[],Yi=0,Xi=null,Zi=1,Qi=``;function $i(e,t){Wi[Gi++]=qi,Wi[Gi++]=Ki,Ki=e,qi=t}function ea(e,t,n){Ji[Yi++]=Zi,Ji[Yi++]=Qi,Ji[Yi++]=Xi,Xi=e;var r=Zi;e=Qi;var i=32-tt(r)-1;r&=~(1<<i),n+=1;var a=32-tt(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,Zi=1<<32-tt(t)+i|n<<i|r,Qi=a+e}else Zi=1<<a|n<<i|r,Qi=e}function ta(e){e.return!==null&&($i(e,1),ea(e,1,0))}function na(e){for(;e===Ki;)Ki=Wi[--Gi],Wi[Gi]=null,qi=Wi[--Gi],Wi[Gi]=null;for(;e===Xi;)Xi=Ji[--Yi],Ji[Yi]=null,Qi=Ji[--Yi],Ji[Yi]=null,Zi=Ji[--Yi],Ji[Yi]=null}function ra(e,t){Ji[Yi++]=Zi,Ji[Yi++]=Qi,Ji[Yi++]=Xi,Zi=t.id,Qi=t.overflow,Xi=e}var ia=null,aa=null,z=!1,oa=null,sa=!1,ca=Error(i(519));function la(e){throw ha(Ui(Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),ca}function ua(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[Tt]=e,t[Et]=r,n){case`dialog`:Q(`cancel`,t),Q(`close`,t);break;case`iframe`:case`object`:case`embed`:Q(`load`,t);break;case`video`:case`audio`:for(n=0;n<zf.length;n++)Q(zf[n],t);break;case`source`:Q(`error`,t);break;case`img`:case`image`:case`link`:Q(`error`,t),Q(`load`,t);break;case`details`:Q(`toggle`,t);break;case`input`:Q(`invalid`,t),cn(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:Q(`invalid`,t);break;case`textarea`:Q(`invalid`,t),fn(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||ep(t.textContent,n)?(r.popover!=null&&(Q(`beforetoggle`,t),Q(`toggle`,t)),r.onScroll!=null&&Q(`scroll`,t),r.onScrollEnd!=null&&Q(`scrollend`,t),r.onClick!=null&&(t.onclick=xn),t=!0):t=!1,t||la(e,!0)}function da(e){for(ia=e.return;ia;)switch(ia.tag){case 5:case 31:case 13:sa=!1;return;case 27:case 3:sa=!0;return;default:ia=ia.return}}function fa(e){if(e!==ia)return!1;if(!z)return da(e),z=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=n===`form`||n===`button`||mp(e.type,e.memoizedProps)),n=!n),n&&aa&&la(e),da(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));aa=fm(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));aa=fm(e)}else t===27?(t=aa,Cp(e.type)?(e=dm,dm=null,aa=e):aa=t):aa=ia?um(e.stateNode.nextSibling):null;return!0}function pa(){aa=ia=null,z=!1}function ma(){var e=oa;return e!==null&&(fd===null?fd=e:fd.push.apply(fd,e),oa=null),e}function ha(e){oa===null?oa=[e]:oa.push(e)}var ga=be(null),_a=null,va=null;function ya(e,t,n){Se(ga,t._currentValue),t._currentValue=n}function ba(e){e._currentValue=ga.current,xe(ga)}function xa(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 Sa(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),xa(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),xa(s,n,e),s=null}else a.tag===13&&a.memoizedState!==null&&a.memoizedState.dehydrated===null?(a.lanes|=n,s=a.alternate,s!==null&&(s.lanes|=n),xa(a.return,n,e),s=a.child,s=s===null?null:s.sibling):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 Ca(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;Wr(a.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(a===Ee.current){if(s=a.alternate,s===null)throw Error(i(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e===null?e=[sh]:e.push(sh))}a=a.return}return e!==null&&Sa(t,e,n,r),t.flags|=262144,e!==null}function wa(e){for(e=e.firstContext;e!==null;){if(!Wr(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Ta(e){_a=e,va=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Ea(e){return Oa(_a,e)}function Da(e,t){return _a===null&&Ta(e),Oa(e,t)}function Oa(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},va===null){if(e===null)throw Error(i(308));va=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else va=va.next=t;return n}var ka=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()})}},Aa=t.unstable_scheduleCallback,ja=t.unstable_NormalPriority,Ma={$$typeof:ne,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Na(){return{controller:new ka,data:new Map,refCount:0}}function Pa(e){e.refCount--,e.refCount===0&&Aa(ja,function(){e.controller.abort()})}function Fa(e,t){if(e.pendingLanes&4194048){var n=e.transitionTypes;for(n===null&&(n=e.transitionTypes=[]),e=0;e<t.length;e++){var r=t[e];n.indexOf(r)===-1&&n.push(r)}}}var Ia=null;function La(e){var t=e.transitionTypes;return e.transitionTypes=null,t}var Ra=null,za=0,Ba=0,Va=null;function Ha(e,t){if(Ra===null){var n=Ra=[];za=0,Ba=Pf(),Va={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return za++,t.then(Ua,Ua),t}function Ua(){if(--za===0&&(Ia=null,Ra!==null)){Va!==null&&(Va.status=`fulfilled`);var e=Ra;Ra=null,Ba=0,Va=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Wa(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 Ga=P.S;P.S=function(e,t){if(hd=Ue(),typeof t==`object`&&t&&typeof t.then==`function`&&Ha(e,t),Ia!==null)for(var n=bf;n!==null;)Fa(n,Ia),n=n.next;if(n=e.types,n!==null){for(var r=bf;r!==null;)Fa(r,n),r=r.next;if(Ba!==0){r=Ia,r===null&&(r=Ia=[]);for(var i=0;i<n.length;i++){var a=n[i];r.indexOf(a)===-1&&r.push(a)}}}Ga!==null&&Ga(e,t)};var Ka=be(null);function qa(){var e=Ka.current;return e===null?$u.pooledCache:e}function Ja(e,t){t===null?Se(Ka,Ka.current):Se(Ka,t.pool)}function Ya(){var e=qa();return e===null?null:{parent:Ma._currentValue,pool:e}}var Xa=Error(i(460)),Za=Error(i(474)),Qa=Error(i(542)),$a={then:function(){}};function eo(e){return e=e.status,e===`fulfilled`||e===`rejected`}function to(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(xn,xn),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,ao(e),e===void 0&&!(`reason`in t)?Error(i(600)):e;default:if(typeof t.status==`string`)t.then(xn,xn);else{if(e=$u,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,ao(e),e}throw ro=t,Xa}}function no(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(ro=e,Xa):e}}var ro=null;function io(){if(ro===null)throw Error(i(459));var e=ro;return ro=null,e}function ao(e){if(e===Xa||e===Qa)throw Error(i(483))}var oo=null,so=0;function co(e){var t=so;return so+=1,oo===null&&(oo=[]),to(oo,e,t)}function lo(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function uo(e,t){throw t.$$typeof===O?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function fo(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=Fi(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|=134217730,n):(r=r.index,r<n?(t.flags|=2,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=134217730),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=zi(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===A?(e=d(e,t,n.props.children,r,n.key),lo(e,n),e):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===oe&&no(i)===t.type)?(t=a(t,n.props),lo(t,n),t.return=e,t):(t=Li(n.type,n.key,n.props,null,e.mode,r),lo(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=Vi(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=Ri(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=zi(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case k:return n=Li(t.type,t.key,t.props,null,e.mode,n),lo(n,t),n.return=e,n;case ee:return t=Vi(t,e.mode,n),t.return=e,t;case oe:return t=no(t),f(e,t,n)}if(ge(t)||pe(t))return t=Ri(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,co(t),n);if(t.$$typeof===ne)return f(e,Da(e,t),n);uo(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 k:return n.key===i?l(e,t,n,r):null;case ee:return n.key===i?u(e,t,n,r):null;case oe:return n=no(n),p(e,t,n,r)}if(ge(n)||pe(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,co(n),r);if(n.$$typeof===ne)return p(e,t,Da(e,n),r);uo(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 k:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case ee:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case oe:return r=no(r),m(e,t,n,r,i)}if(ge(r)||pe(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,co(r),i);if(r.$$typeof===ne)return m(e,t,n,Da(t,r),i);uo(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),z&&$i(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 z&&$i(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(_.key===null?h:_.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)}),z&&$i(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),z&&$i(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 z&&$i(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(_.key===null?g:_.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)}),z&&$i(a,g),u}function _(e,r,o,c){if(typeof o==`object`&&o&&o.type===A&&o.key===null&&o.props.ref===void 0&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case k:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===A){if(r.tag===7){n(e,r.sibling),c=a(r,o.props.children),lo(c,o),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===oe&&no(l)===r.type){n(e,r.sibling),c=a(r,o.props),lo(c,o),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}o.type===A?(c=Ri(o.props.children,e.mode,c,o.key),lo(c,o),c.return=e,e=c):(c=Li(o.type,o.key,o.props,null,e.mode,c),lo(c,o),c.return=e,e=c)}return s(e);case ee: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}n(e,r);break}t(e,r),r=r.sibling}c=Vi(o,e.mode,c),c.return=e,e=c}return s(e);case oe:return o=no(o),_(e,r,o,c)}if(ge(o))return h(e,r,o,c);if(pe(o)){if(l=pe(o),typeof l!=`function`)throw Error(i(150));return o=l.call(o),g(e,r,o,c)}if(typeof o.then==`function`)return _(e,r,co(o),c);if(o.$$typeof===ne)return _(e,r,Da(e,o),c);uo(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=zi(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{so=0;var i=_(e,t,n,r);return oo=null,i}catch(t){if(t===Xa||t===Qa)throw t;var a=Ni(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var po=fo(!0),mo=fo(!1),ho=!1;function go(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function _o(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 vo(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function yo(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,q&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=Ai(e),ki(e,null,n),t}return Ei(e,r,t,n),Ai(e)}function bo(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,vt(e,n)}}function xo(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 So=!1;function Co(){if(So){var e=Va;if(e!==null)throw e}}function wo(e,t,n,r){So=!1;var i=e.updateQueue;ho=!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?(Y&f)===f:(r&f)===f){f!==0&&f===Ba&&(So=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var m=e,h=s;f=t;var g=n;switch(h.tag){case 1:if(m=h.payload,typeof m==`function`){d=m.call(g,d,f);break a}d=m;break a;case 3:m.flags=m.flags&-65537|128;case 0:if(m=h.payload,f=typeof m==`function`?m.call(g,d,f):m,f==null)break a;d=D({},d,f);break a;case 2:ho=!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),od|=o,e.lanes=o,e.memoizedState=d}}function To(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function Eo(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)To(n[e],t)}var Do=be(null),Oo=be(0);function ko(e,t){e=id,Se(Oo,e),Se(Do,t),id=e|t.baseLanes}function Ao(){Se(Oo,id),Se(Do,Do.current)}function jo(){id=Oo.current,xe(Do),xe(Oo)}var Mo=be(null),No=null;function Po(e){var t=e.alternate;Se(zo,zo.current&1),Se(Mo,e),No===null&&(t===null||Do.current!==null||t.memoizedState!==null)&&(No=e)}function Fo(e){Se(zo,zo.current),Se(Mo,e),No===null&&(No=e)}function Io(e){e.tag===22?(Se(zo,zo.current),Se(Mo,e),No===null&&(No=e)):Lo()}function Lo(){Se(zo,zo.current),Se(Mo,Mo.current)}function Ro(e){xe(Mo),No===e&&(No=null),xe(zo)}var zo=be(0);function Bo(e,t){Se(Mo,Mo.current),Se(zo,t)}function Vo(e){xe(zo),xe(Mo),No===e&&(No=null)}function Ho(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||sm(n)||cm(n)))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==`independent`){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 Uo=0,B=null,Wo=null,Go=null,Ko=!1,qo=!1,Jo=!1,Yo=0,Xo=0,Zo=null,Qo=0;function $o(){throw Error(i(321))}function es(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Wr(e[n],t[n]))return!1;return!0}function ts(e,t,n,r,i,a){return Uo=a,B=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,P.H=e===null||e.memoizedState===null?vc:yc,Jo=!1,a=n(r,i),Jo=!1,qo&&(a=rs(t,n,r,i)),ns(e),a}function ns(e){P.H=_c;var t=Wo!==null&&Wo.next!==null;if(Uo=0,Go=Wo=B=null,Ko=!1,Xo=0,Zo=null,t)throw Error(i(300));e===null||Ic||(e=e.dependencies,e!==null&&wa(e)&&(Ic=!0))}function rs(e,t,n,r){B=e;var a=0;do{if(qo&&(Zo=null),Xo=0,qo=!1,25<=a)throw Error(i(301));if(a+=1,Go=Wo=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=bc,o=t(n,r)}while(qo);return o}function is(){var e=P.H,t=e.useState()[0];return t=typeof t.then==`function`?ds(t):t,e=e.useState()[0],(Wo===null?null:Wo.memoizedState)!==e&&(B.flags|=1024),t}function as(){var e=Yo!==0;return Yo=0,e}function os(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function ss(e){if(Ko){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Ko=!1}Uo=0,Go=Wo=B=null,qo=!1,Xo=Yo=0,Zo=null}function cs(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Go===null?B.memoizedState=Go=e:Go=Go.next=e,Go}function ls(){if(Wo===null){var e=B.alternate;e=e===null?null:e.memoizedState}else e=Wo.next;var t=Go===null?B.memoizedState:Go.next;if(t!==null)Go=t,Wo=e;else{if(e===null)throw B.alternate===null?Error(i(467)):Error(i(310));Wo=e,e={memoizedState:Wo.memoizedState,baseState:Wo.baseState,baseQueue:Wo.baseQueue,queue:Wo.queue,next:null},Go===null?B.memoizedState=Go=e:Go=Go.next=e}return Go}function us(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function ds(e){var t=Xo;return Xo+=1,Zo===null&&(Zo=[]),e=to(Zo,e,t),t=B,(Go===null?t.memoizedState:Go.next)===null&&(t=t.alternate,P.H=t===null||t.memoizedState===null?vc:yc),e}function fs(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return ds(e);if(e.$$typeof===de)return;if(e.$$typeof===ne)return Ea(e)}throw Error(i(438,String(e)))}function ps(e){var t=null,n=B.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=B.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=us(),B.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]=le;return t.index++,n}function ms(e,t){return typeof t==`function`?t(e):t}function hs(e){return gs(ls(),Wo,e)}function gs(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?(Uo&f)===f:(Y&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===Ba&&(d=!0);else if((Uo&p)===p){u=u.next,p===Ba&&(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,B.lanes|=p,od|=p;f=u.action,Jo&&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,B.lanes|=f,od|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!Wr(o,e.memoizedState)&&(Ic=!0,d&&(n=Va,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 _s(e){var t=ls(),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);Wr(o,t.memoizedState)||(Ic=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function vs(e,t,n){var r=B,a=ls(),o=z;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!Wr((Wo||a).memoizedState,n);if(s&&(a.memoizedState=n,Ic=!0),a=a.queue,Us(xs.bind(null,r,a,e),[e]),e=a.getSnapshot!==t||s||Go!==null&&!!(Go.memoizedState.tag&1),Rs(e?9:8,{destroy:void 0},bs.bind(null,r,a,n,t),null),e){if(r.flags|=2048,$u===null)throw Error(i(349));o||Uo&127||ys(r,t,n)}return n}function ys(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=B.updateQueue,t===null?(t=us(),B.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function bs(e,t,n,r){t.value=n,t.getSnapshot=r,Ss(t)&&Cs(e)}function xs(e,t,n){return n(function(){Ss(t)&&Cs(e)})}function Ss(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Wr(e,n)}catch{return!0}}function Cs(e){var t=Oi(e,2);t!==null&&Pd(t,e,2)}function ws(e){var t=cs();if(typeof e==`function`){var n=e;if(e=n(),Jo){et(!0);try{n()}finally{et(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ms,lastRenderedState:e},t}function Ts(e,t,n,r){return e.baseState=n,gs(e,Wo,typeof r==`function`?r:ms)}function Es(e,t,n,r,a){if(mc(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,Ds(t,o)):(o.next=n.next,t.pending=n.next=o)}}function Ds(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=P.T,o={};o.types=a===null?null:a.types,P.T=o;try{var s=n(i,r),c=P.S;c!==null&&c(o,s),Os(e,t,s)}catch(n){As(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),P.T=a}}else try{a=n(i,r),Os(e,t,a)}catch(n){As(e,t,n)}}function Os(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){ks(e,t,n)},function(n){return As(e,t,n)}):ks(e,t,n)}function ks(e,t,n){t.status=`fulfilled`,t.value=n,js(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Ds(e,n)))}function As(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,js(t),t=t.next;while(t!==r)}e.action=null}function js(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Ms(e,t){return t}function Ns(e,t){if(z){var n=$u.formState;if(n!==null){a:{var r=B;if(z){if(aa){b:{for(var i=aa,a=sa;i.nodeType!==8;){if(!a){i=null;break b}if(i=um(i.nextSibling),i===null){i=null;break b}}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){aa=um(i.nextSibling),r=i.data===`F!`;break a}}la(r)}r=!1}r&&(t=n[0])}}return n=cs(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ms,lastRenderedState:t},n.queue=r,n=dc.bind(null,B,r),r.dispatch=n,r=ws(!1),a=pc.bind(null,B,!1,r.queue),r=cs(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=Es.bind(null,B,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function Ps(e){return Fs(ls(),Wo,e)}function Fs(e,t,n){if(t=gs(e,t,Ms)[0],e=hs(ms)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=ds(t)}catch(e){throw e===Xa?Qa:e}else r=t;t=ls();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(B.flags|=2048,Rs(9,{destroy:void 0},Is.bind(null,i,n),null)),[r,a,e]}function Is(e,t){e.action=t}function Ls(e){var t=ls(),n=Wo;if(n!==null)return Fs(t,n,e);ls(),t=t.memoizedState,n=ls();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function Rs(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=B.updateQueue,t===null&&(t=us(),B.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 zs(){return ls().memoizedState}function Bs(e,t,n,r){var i=cs();B.flags|=e,i.memoizedState=Rs(1|t,{destroy:void 0},n,r===void 0?null:r)}function Vs(e,t,n,r){var i=ls();r=r===void 0?null:r;var a=i.memoizedState.inst;Wo!==null&&r!==null&&es(r,Wo.memoizedState.deps)?i.memoizedState=Rs(t,a,n,r):(B.flags|=e,i.memoizedState=Rs(1|t,a,n,r))}function Hs(e,t){Bs(8390656,8,e,t)}function Us(e,t){Vs(2048,8,e,t)}function Ws(e){B.flags|=4;var t=B.updateQueue;if(t===null)t=us(),B.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function Gs(e){var t=ls().memoizedState;return Ws({ref:t,nextImpl:e}),function(){if(q&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function Ks(e,t){return Vs(4,2,e,t)}function qs(e,t){return Vs(4,4,e,t)}function Js(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 Ys(e,t,n){n=n==null?null:n.concat([e]),Vs(4,4,Js.bind(null,t,e),n)}function Xs(){}function Zs(e,t){var n=ls();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&es(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Qs(e,t){var n=ls();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&es(t,r[1]))return r[0];if(r=e(),Jo){et(!0);try{e()}finally{et(!1)}}return n.memoizedState=[r,t],r}function $s(e,t,n){return n===void 0||Uo&1073741824&&!(Y&261930)?e.memoizedState=t:(e.memoizedState=n,e=Md(),B.lanes|=e,od|=e,n)}function ec(e,t,n,r){return Wr(n,t)?n:Do.current===null?!(Uo&106)||Uo&1073741824&&!(Y&261930)?(Ic=!0,e.memoizedState=n):(e=Md(),B.lanes|=e,od|=e,t):(e=$s(e,n,r),Wr(e,t)||(Ic=!0),e)}function tc(e,t,n,r,i){var a=F.p;F.p=a!==0&&8>a?a:8;var o=P.T,s={};s.types=o===null?null:o.types,P.T=s,pc(e,!1,t,n);try{var c=i(),l=P.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?fc(e,t,Wa(c,r),jd(e)):fc(e,t,r,jd(e))}catch(n){fc(e,t,{then:function(){},status:`rejected`,reason:n},jd())}finally{F.p=a,o!==null&&s.types!==null&&(o.types=s.types),P.T=o}}function nc(){}function rc(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=ic(e).queue;tc(e,a,t,_e,n===null?nc:function(){return ac(e),n(r)})}function ic(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:_e,baseState:_e,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ms,lastRenderedState:_e},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ms,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function ac(e){var t=ic(e);t.next===null&&(t=e.alternate.memoizedState),fc(e,t.next.queue,{},jd())}function oc(){return Ea(sh)}function sc(){return ls().memoizedState}function cc(){return ls().memoizedState}function lc(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=jd();e=vo(n);var r=yo(t,e,n);r!==null&&(Pd(r,t,n),bo(r,t,n)),t={cache:Na()},e.payload=t;return}t=t.return}}function uc(e,t,n){var r=jd();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},mc(e)?hc(t,n):(n=Di(e,t,n,r),n!==null&&(Pd(n,e,r),gc(n,t,r)))}function dc(e,t,n){fc(e,t,n,jd())}function fc(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(mc(e))hc(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,Wr(s,o))return Ei(e,t,i,0),$u===null&&Ti(),!1}catch{}if(n=Di(e,t,i,r),n!==null)return Pd(n,e,r),gc(n,t,r),!0}return!1}function pc(e,t,n,r){if(r={lane:2,revertLane:Pf(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},mc(e)){if(t)throw Error(i(479))}else t=Di(e,n,r,2),t!==null&&Pd(t,e,2)}function mc(e){var t=e.alternate;return e===B||t!==null&&t===B}function hc(e,t){qo=Ko=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function gc(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,vt(e,n)}}var _c={readContext:Ea,use:fs,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,useEffectEvent:$o},vc={readContext:Ea,use:fs,useCallback:function(e,t){return cs().memoizedState=[e,t===void 0?null:t],e},useContext:Ea,useEffect:Hs,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),Bs(4194308,4,Js.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Bs(4194308,4,e,t)},useInsertionEffect:function(e,t){Bs(4,2,e,t)},useMemo:function(e,t){var n=cs();t=t===void 0?null:t;var r=e();if(Jo){et(!0);try{e()}finally{et(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=cs();if(n!==void 0){var i=n(t);if(Jo){et(!0);try{n(t)}finally{et(!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=uc.bind(null,B,e),[r.memoizedState,e]},useRef:function(e){var t=cs();return e={current:e},t.memoizedState=e},useState:function(e){e=ws(e);var t=e.queue,n=dc.bind(null,B,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Xs,useDeferredValue:function(e,t){return $s(cs(),e,t)},useTransition:function(){var e=ws(!1);return e=tc.bind(null,B,e.queue,!0,!1),cs().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=B,a=cs();if(z){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),$u===null)throw Error(i(349));Y&127||ys(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,Hs(xs.bind(null,r,o,e),[e]),r.flags|=2048,Rs(9,{destroy:void 0},bs.bind(null,r,o,n,t),null),n},useId:function(){var e=cs(),t=$u.identifierPrefix;if(z){var n=Qi,r=Zi;n=(r&~(1<<32-tt(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=Yo++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=Qo++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:oc,useFormState:Ns,useActionState:Ns,useOptimistic:function(e){var t=cs();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=pc.bind(null,B,!0,n),n.dispatch=t,[e,t]},useMemoCache:ps,useCacheRefresh:function(){return cs().memoizedState=lc.bind(null,B)},useEffectEvent:function(e){var t=cs(),n={impl:e};return t.memoizedState=n,function(){if(q&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},yc={readContext:Ea,use:fs,useCallback:Zs,useContext:Ea,useEffect:Us,useImperativeHandle:Ys,useInsertionEffect:Ks,useLayoutEffect:qs,useMemo:Qs,useReducer:hs,useRef:zs,useState:function(){return hs(ms)},useDebugValue:Xs,useDeferredValue:function(e,t){return ec(ls(),Wo.memoizedState,e,t)},useTransition:function(){var e=hs(ms)[0],t=ls().memoizedState;return[typeof e==`boolean`?e:ds(e),t]},useSyncExternalStore:vs,useId:sc,useHostTransitionStatus:oc,useFormState:Ps,useActionState:Ps,useOptimistic:function(e,t){return Ts(ls(),Wo,e,t)},useMemoCache:ps,useCacheRefresh:cc,useEffectEvent:Gs},bc={readContext:Ea,use:fs,useCallback:Zs,useContext:Ea,useEffect:Us,useImperativeHandle:Ys,useInsertionEffect:Ks,useLayoutEffect:qs,useMemo:Qs,useReducer:_s,useRef:zs,useState:function(){return _s(ms)},useDebugValue:Xs,useDeferredValue:function(e,t){var n=ls();return Wo===null?$s(n,e,t):ec(n,Wo.memoizedState,e,t)},useTransition:function(){var e=_s(ms)[0],t=ls().memoizedState;return[typeof e==`boolean`?e:ds(e),t]},useSyncExternalStore:vs,useId:sc,useHostTransitionStatus:oc,useFormState:Ls,useActionState:Ls,useOptimistic:function(e,t){var n=ls();return Wo===null?(n.baseState=e,[e,n.queue.dispatch]):Ts(n,Wo,e,t)},useMemoCache:ps,useCacheRefresh:cc,useEffectEvent:Gs};function xc(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:D({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Sc={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=jd(),i=vo(r);i.payload=t,n!=null&&(i.callback=n),t=yo(e,i,r),t!==null&&(Pd(t,e,r),bo(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=jd(),i=vo(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=yo(e,i,r),t!==null&&(Pd(t,e,r),bo(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=jd(),r=vo(n);r.tag=2,t!=null&&(r.callback=t),t=yo(e,r,n),t!==null&&(Pd(t,e,n),bo(t,e,n))}};function Cc(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?!Gr(n,r)||!Gr(i,a):!0}function wc(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&&Sc.enqueueReplaceState(t,t.state,null)}function Tc(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=D({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function Ec(e){xi(e)}function Dc(e){console.error(e)}function Oc(e){xi(e)}function kc(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function Ac(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 jc(e,t,n){return n=vo(n),n.tag=3,n.payload={element:null},n.callback=function(){kc(e,t)},n}function Mc(e){return e=vo(e),e.tag=3,e}function Nc(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(){Ac(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){Ac(t,n,r),typeof i!=`function`&&(vd===null?vd=new Set([this]):vd.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function Pc(e,t,n,r,a){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&Ca(t,n,a,!0),n=Mo.current,n!==null){switch(n.tag){case 31:case 13:case 19:return No===null?Kd():n.alternate===null&&ad===0&&(ad=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===$a?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),mf(e,r,a)),!1;case 22:return n.flags|=65536,r===$a?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)),mf(e,r,a)),!1}throw Error(i(435,n.tag))}return mf(e,r,a),Kd(),!1}if(z)return t=Mo.current,t===null?(r!==ca&&(t=Error(i(423),{cause:r}),ha(Ui(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=Ui(r,n),a=jc(e.stateNode,r,a),xo(e,a),ad!==4&&(ad=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==ca&&(e=Error(i(422),{cause:r}),ha(Ui(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=Ui(o,n),dd===null?dd=[o]:dd.push(o),ad!==4&&(ad=2),t===null)return!0;r=Ui(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=jc(n.stateNode,r,e),xo(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`&&(vd===null||!vd.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=Mc(a),Nc(a,e,n,r),xo(n,a),!1;break;case 22:if(n.memoizedState!==null)return n.flags|=65536,!1}n=n.return}while(n!==null);return!1}var Fc=Error(i(461)),Ic=!1;function Lc(e,t,n,r){t.child=e===null?mo(t,null,n,r):po(t,e.child,n,r)}function Rc(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 Ta(t),r=ts(e,t,n,o,a,i),s=as(),e!==null&&!Ic?(os(e,t,i),fl(e,t,i)):(z&&s&&ta(t),t.flags|=1,Lc(e,t,r,i),t.child)}function zc(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!Pi(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,Bc(e,t,a,r,i)):(e=Li(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!pl(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?Gr:n,n(o,r)&&e.ref===t.ref)return fl(e,t,i)}return t.flags|=1,e=Fi(a,r),e.ref=t.ref,e.return=t,t.child=e}function Bc(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(Gr(a,r)&&e.ref===t.ref){if(Ic=!1,t.pendingProps=r=a,pl(e,i))e.flags&131072&&(Ic=!0);else return t.lanes=e.lanes,fl(e,t,i)}}return Jc(e,t,n,r,i)}function Vc(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 Uc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Ja(t,a===null?null:a.cachePool),a===null?Ao():ko(t,a),Io(t);else return r=t.lanes=536870912,Uc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&Ja(t,null),Ao(),Lo()):(Ja(t,a.cachePool),ko(t,a),Lo(),t.memoizedState=null);return Lc(e,t,i,n),t.child}function Hc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Uc(e,t,n,r,i){var a=qa();return a=a===null?null:{parent:Ma._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&Ja(t,null),Ao(),Io(t),e!==null&&Ca(e,t,r,!0),t.childLanes=i,null}function Wc(e,t){return t=rl({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Gc(e,t,n){return po(t,e.child,null,n),e=Wc(t,t.pendingProps),e.flags|=2,Ro(t),t.memoizedState=null,e}function Kc(e,t,n){var r=t.pendingProps,a=!!(t.flags&128);if(t.flags&=-129,e===null){if(z){if(r.mode===`hidden`)return e=Wc(t,r),t.lanes=536870912,e.memoizedState={baseLanes:0,cachePool:null},Hc(null,e);if(Fo(t),(e=aa)?(e=om(e,sa),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Xi===null?null:{id:Zi,overflow:Qi},retryLane:536870912,hydrationErrors:null},n=Bi(e),n.return=t,t.child=n,ia=t,aa=null)):e=null,e===null)throw la(t);return t.lanes=536870912,null}return Wc(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(Fo(t),a){if(t.flags&256)t.flags&=-257,t=Gc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558))}else if(Ic||Ca(e,t,n,!1),a=(n&e.childLanes)!==0,Ic||a){if(Do.current===null){if(r=$u,r!==null&&(s=yt(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,Oi(e,s),Pd(r,e,s),Fc;Kd()}t=Gc(e,t,n)}else e=o.treeContext,aa=um(s.nextSibling),ia=t,z=!0,oa=null,sa=!1,e!==null&&ra(t,e),t=Wc(t,r),t.flags|=134221824;return t}return e=Fi(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function qc(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 Jc(e,t,n,r,i){return Ta(t),n=ts(e,t,n,r,void 0,i),r=as(),e!==null&&!Ic?(os(e,t,i),fl(e,t,i)):(z&&r&&ta(t),t.flags|=1,Lc(e,t,n,i),t.child)}function Yc(e,t,n,r,i,a){return Ta(t),t.updateQueue=null,n=rs(t,r,n,i),ns(e),r=as(),e!==null&&!Ic?(os(e,t,a),fl(e,t,a)):(z&&r&&ta(t),t.flags|=1,Lc(e,t,n,a),t.child)}function Xc(e,t,n,r,i){if(Ta(t),t.stateNode===null){var a=ji,o=n.contextType;typeof o==`object`&&o&&(a=Ea(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=Sc,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},go(t),o=n.contextType,a.context=typeof o==`object`&&o?Ea(o):ji,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(xc(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&&Sc.enqueueReplaceState(a,a.state,null),wo(t,r,a,i),Co(),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=Tc(n,s);a.props=c;var l=a.context,u=n.contextType;o=ji,typeof u==`object`&&u&&(o=Ea(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)&&wc(t,a,r,o),ho=!1;var f=t.memoizedState;a.state=f,wo(t,r,a,i),Co(),l=t.memoizedState,s||f!==l||ho?(typeof d==`function`&&(xc(t,n,d,r),l=t.memoizedState),(c=ho||Cc(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,_o(e,t),o=t.memoizedProps,u=Tc(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=ji,typeof l==`object`&&l&&(c=Ea(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)&&wc(t,a,r,c),ho=!1,f=t.memoizedState,a.state=f,wo(t,r,a,i),Co();var p=t.memoizedState;o!==d||f!==p||ho||e!==null&&e.dependencies!==null&&wa(e.dependencies)?(typeof s==`function`&&(xc(t,n,s,r),p=t.memoizedState),(u=ho||Cc(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&wa(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,qc(e,t),r=!!(t.flags&128),a||r?(a=t.stateNode,n=r&&typeof n.getDerivedStateFromError!=`function`?null:a.render(),t.flags|=1,e!==null&&r?(t.child=po(t,e.child,null,i),t.child=po(t,null,n,i)):Lc(e,t,n,i),t.memoizedState=a.state,e=t.child):e=fl(e,t,i),e}function Zc(e,t,n,r){return pa(),t.flags|=256,Lc(e,t,n,r),t.child}var Qc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function $c(e){return{baseLanes:e,cachePool:Ya()}}function el(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=ld),e}function tl(e,t,n){var r=t.pendingProps,i=!1,a=!!(t.flags&128),o;if((o=a)||(o=e!==null&&e.memoizedState===null?!1:!!(zo.current&2)),o&&(i=!0,t.flags&=-129),o=!!(t.flags&32),t.flags&=-33,e===null){if(z){if(i?Po(t):Lo(),(e=aa)?(e=om(e,sa),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Xi===null?null:{id:Zi,overflow:Qi},retryLane:536870912,hydrationErrors:null},n=Bi(e),n.return=t,t.child=n,ia=t,aa=null)):e=null,e===null)throw la(t);return t.lanes=cm(e)?32:536870912,null}return a=r.children,r=r.fallback,i?(Lo(),i=t.mode,a=rl({mode:`hidden`,children:a},i),r=Ri(r,i,n,null),a.return=t,r.return=t,a.sibling=r,t.child=a,r=t.child,r.memoizedState=$c(n),r.childLanes=el(e,o,n),t.memoizedState=Qc,Hc(null,r)):(Po(t),nl(t,a))}var s=e.memoizedState;if(s!==null){var c=s.dehydrated;if(c!==null)return al(e,t,a,o,r,c,s,n)}return i?(Lo(),i=r.fallback,a=t.mode,s=e.child,c=s.sibling,r=Fi(s,{mode:`hidden`,children:r.children}),r.subtreeFlags=s.subtreeFlags&1206910976,c===null?(i=Ri(i,a,n,null),i.flags|=2):i=Fi(c,i),i.return=t,r.return=t,r.sibling=i,t.child=r,Hc(null,r),r=t.child,i=e.child.memoizedState,i===null?i=$c(n):(a=i.cachePool,a===null?a=Ya():(s=Ma._currentValue,a=a.parent===s?a:{parent:s,pool:s}),i={baseLanes:i.baseLanes|n,cachePool:a}),r.memoizedState=i,r.childLanes=el(e,o,n),t.memoizedState=Qc,Hc(e.child,r)):(Po(t),n=e.child,e=n.sibling,n=Fi(n,{mode:`visible`,children:r.children}),n.return=t,n.sibling=null,e!==null&&(o=t.deletions,o===null?(t.deletions=[e],t.flags|=16):o.push(e)),t.child=n,t.memoizedState=null,n)}function nl(e,t){return t=rl({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function rl(e,t){return e=Ni(22,e,null,t),e.lanes=0,e}function il(e,t,n){return po(t,e.child,null,n),e=nl(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function al(e,t,n,r,a,o,s,c){if(n)return t.flags&256?(Po(t),t.flags&=-257,il(e,t,c)):t.memoizedState===null?(Lo(),o=a.fallback,s=t.mode,a=rl({mode:`visible`,children:a.children},s),o=Ri(o,s,c,null),o.flags|=2,a.return=t,o.return=t,a.sibling=o,t.child=a,po(t,e.child,null,c),a=t.child,a.memoizedState=$c(c),a.childLanes=el(e,r,c),t.memoizedState=Qc,Hc(null,a)):(Lo(),t.child=e.child,t.flags|=128,null);if(Po(t),cm(o)){if(r=o.nextSibling&&o.nextSibling.dataset,r)var l=r.dgst;return r=l,r!==``&&(a=Error(i(419)),a.stack=``,a.digest=r,ha({value:a,source:null,stack:null})),il(e,t,c)}if(Ic||Ca(e,t,c,!1),r=(c&e.childLanes)!==0,Ic||r){if(Do.current!==null)return il(e,t,c);if(r=$u,r!==null&&(a=yt(r,c),a!==0&&a!==s.retryLane))throw s.retryLane=a,Oi(e,a),Pd(r,e,a),Fc;return sm(o)||Kd(),il(e,t,c)}return sm(o)?(t.flags|=192,t.child=e.child,null):(e=s.treeContext,aa=um(o.nextSibling),ia=t,z=!0,oa=null,sa=!1,e!==null&&ra(t,e),t=nl(t,a.children),t.flags|=134221824,t)}function ol(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),xa(e.return,t,n)}function sl(e){for(var t=null;e!==null;){var n=e.alternate;n!==null&&Ho(n)===null&&(t=e),e=e.sibling}return t}function cl(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 ll(e){var t=e.child;for(e.child=null;t!==null;){var n=t.sibling;t.sibling=e.child,e.child=t,t=n}}function ul(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=zo.current;if(t.flags&128)return Bo(t,o),null;var s=!!(o&2);if(s?(o=o&1|2,t.flags|=128):o&=1,Bo(t,o),i===`backwards`&&e!==null?(ll(e),Lc(e,t,r,n),ll(e)):Lc(e,t,r,n),r=z?qi:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&ol(e,n,t);else if(e.tag===19)ol(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`backwards`:n=sl(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null,ll(t)),cl(t,!0,i,null,a,r);break;case`unstable_legacy-backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&Ho(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}cl(t,!0,n,null,a,r);break;case`together`:cl(t,!1,null,null,void 0,r);break;case`independent`:t.memoizedState=null;break;default:n=sl(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),cl(t,!1,i,n,a,r)}return t.child}function dl(e,t,n){var r=t.pendingProps;return ya(t,t.type,r.value),Lc(e,t,r.children,n),t.child}function fl(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),od|=t.lanes,(n&t.childLanes)===0){if(e!==null){if(Ca(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=Fi(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Fi(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function pl(e,t){return(e.lanes&t)!==0||(e=e.dependencies,!!(e!==null&&wa(e)))}function ml(e,t,n){switch(t.tag){case 3:De(t,t.stateNode.containerInfo),ya(t,Ma,e.memoizedState.cache),pa();break;case 27:case 5:ke(t);break;case 4:De(t,t.stateNode.containerInfo);break;case 10:ya(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Fo(t),null;break;case 13:var r=t.memoizedState;if(r!==null){if(r.dehydrated!==null)return Po(t),t.flags|=128,null;r=Ca(e,t,n,!1);var i=t.child.childLanes;return r||(n&i)!==0?tl(e,t,n):(Po(t),e=fl(e,t,n),e===null?null:e.sibling)}Po(t);break;case 19:if(t.flags&128)return ul(e,t,n);if(i=!!(e.flags&128),r=(n&t.childLanes)!==0,r||=(Ca(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return ul(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),Bo(t,zo.current),r)break;return null;case 22:return t.lanes=0,Vc(e,t,n,t.pendingProps);case 24:ya(t,Ma,e.memoizedState.cache)}return fl(e,t,n)}function hl(e,t,n){if(e!==null){if(e.memoizedProps!==t.pendingProps)Ic=!0;else{if(!pl(e,n)&&!(t.flags&128))return Ic=!1,ml(e,t,n);Ic=!!(e.flags&131072)}}else Ic=!1,z&&t.flags&1048576&&ea(t,qi,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=no(t.elementType),t.type=e,typeof e==`function`)Pi(e)?(r=Tc(e,r),t.tag=1,t=Xc(null,t,e,r,n)):(t.tag=0,t=Jc(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===N){t.tag=11,t=Rc(null,t,e,r,n);break a}if(a===ae){t.tag=14,t=zc(null,t,e,r,n);break a}if(a===ne){t.tag=10,t.type=e,t=dl(null,t,n);break a}}throw t=he(e)||e,Error(i(306,t,``))}}return t;case 0:return Jc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=Tc(r,t.pendingProps),Xc(e,t,r,a,n);case 3:a:{if(De(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var o=t.memoizedState;a=o.element,_o(e,t),wo(t,r,null,n);var s=t.memoizedState;if(r=s.cache,ya(t,Ma,r),r!==o.cache&&Sa(t,[Ma],n,!0),Co(),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=Zc(e,t,r,n);break a}if(r!==a){a=Ui(Error(i(424)),t),ha(a),t=Zc(e,t,r,n);break a}switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName===`HTML`?e.ownerDocument.body:e}for(aa=um(e.firstChild),ia=t,z=!0,oa=null,sa=!0,n=mo(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|134221824,n=n.sibling}else{if(pa(),r===a){t=fl(e,t,n);break a}Lc(e,t,r,n)}t=t.child}return t;case 26:return qc(e,t),e===null?(n=Pm(t.type,null,t.pendingProps,null))?t.memoizedState=n:z||(t.stateNode=pp(t.type,t.pendingProps,Te.current,t)):t.memoizedState=Pm(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return ke(t),e===null&&z&&(r=t.stateNode=gm(t.type,t.pendingProps,Te.current),ia=t,sa=!0,a=aa,Cp(t.type)?(dm=a,aa=um(r.firstChild)):aa=a),Lc(e,t,t.pendingProps.children,n),qc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&z&&((a=r=aa)&&(r=im(r,t.type,t.pendingProps,sa),r===null?a=!1:(t.stateNode=r,ia=t,aa=um(r.firstChild),sa=!1,a=!0)),a||la(t)),ke(t),a=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,mp(a,o)?r=null:s!==null&&mp(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=ts(e,t,is,null,null,n),sh._currentValue=a),qc(e,t),Lc(e,t,r,n),t.child;case 6:return e===null&&z&&((e=n=aa)&&(n=am(n,t.pendingProps,sa),n===null?e=!1:(t.stateNode=n,ia=t,aa=null,e=!0)),e||la(t)),null;case 13:return tl(e,t,n);case 4:return De(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=po(t,null,r,n):Lc(e,t,r,n),t.child;case 11:return Rc(e,t,t.type,t.pendingProps,n);case 7:return r=t.pendingProps,qc(e,t),Lc(e,t,r,n),t.child;case 8:return Lc(e,t,t.pendingProps.children,n),t.child;case 12:return Lc(e,t,t.pendingProps.children,n),t.child;case 10:return dl(e,t,n);case 9:return a=t.type._context,r=t.pendingProps.children,Ta(t),a=Ea(a),r=r(a),t.flags|=1,Lc(e,t,r,n),t.child;case 14:return zc(e,t,t.type,t.pendingProps,n);case 15:return Bc(e,t,t.type,t.pendingProps,n);case 19:return ul(e,t,n);case 31:return Kc(e,t,n);case 22:return Vc(e,t,n,t.pendingProps);case 24:return Ta(t),r=Ea(Ma),e===null?(a=qa(),a===null&&(a=$u,o=Na(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},go(t),ya(t,Ma,a)):((e.lanes&n)!==0&&(_o(e,t),wo(t,null,null,n),Co()),a=e.memoizedState,o=t.memoizedState,a.parent===r?(r=o.cache,ya(t,Ma,r),r!==a.cache&&Sa(t,[Ma],n,!0)):(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),ya(t,Ma,r))),Lc(e,t,t.pendingProps.children,n),t.child;case 30:return t.stateNode===null&&(t.stateNode={autoName:null,paired:null,clones:null,ref:null}),r=t.pendingProps,r.name!=null&&r.name!==`auto`?t.flags|=e===null?18882560:18874368:z&&ta(t),e!==null&&e.memoizedProps.name!==r.name?t.flags|=4194816:qc(e,t),Lc(e,t,r.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function gl(e){e.flags|=4}function _l(e,t,n,r,i){var a;if((a=!!(e.mode&32))&&(a=n===null?Jm(t,r):Jm(t,r)&&(r.src!==n.src||r.srcSet!==n.srcSet)),a){if(e.flags|=16777216,(i&335544128)===i){if(e.stateNode.complete)e.flags|=8192;else if(Ud())e.flags|=8192;else throw ro=$a,Za}}else e.flags&=-16777217}function vl(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!Ym(t)){if(Ud())e.flags|=8192;else throw ro=$a,Za}}function yl(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:pt(),e.lanes|=t,ud|=t)}function bl(e,t){if(!z)switch(e.tailMode){case`visible`:break;case`collapsed`:for(var n=e.tail,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;break;default:for(t=e.tail,n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null}}function V(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&1206910976,r|=i.flags&1206910976,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 xl(e,t,n){var r=t.pendingProps;switch(na(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return V(t),null;case 1:return V(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),ba(Ma),Oe(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(fa(t)?gl(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,ma())),V(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(gl(t),o===null?(V(t),_l(t,a,null,r,n)):(V(t),vl(t,o))):o?o===e.memoizedState?(V(t),t.flags&=-16777217):(gl(t),V(t),vl(t,o)):(e=e.memoizedProps,e!==r&&gl(t),V(t),_l(t,a,e,r,n)),null;case 27:if(Ae(t),n=Te.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&gl(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return V(t),t.subtreeFlags&=-33554433,null}e=Ce.current,fa(t)?ua(t,e):(e=gm(a,r,n),t.stateNode=e,gl(t))}return V(t),t.subtreeFlags&=-33554433,null;case 5:if(Ae(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&gl(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return V(t),t.subtreeFlags&=-33554433,null}if(o=Ce.current,fa(t))ua(t,o);else{var s=up(Te.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[Tt]=t,o[Et]=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(rp(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&&gl(t)}}return V(t),t.subtreeFlags&=-33554433,_l(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&gl(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=Te.current,fa(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=ia,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[Tt]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||ep(e.nodeValue,n)),e||la(t,!0)}else e=up(e).createTextNode(r),e[Tt]=t,t.stateNode=e}return V(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=fa(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[Tt]=t}else pa(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;V(t),e=!1}else n=ma(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(Ro(t),t):(Ro(t),null);if(t.flags&128)throw Error(i(558))}return V(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=fa(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[Tt]=t}else pa(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;V(t),a=!1}else a=ma(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(Ro(t),t):(Ro(t),null)}return Ro(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),yl(t,t.updateQueue),V(t),null);case 4:return Oe(),e===null&&Wf(t.stateNode.containerInfo),t.flags|=67108864,V(t),null;case 10:return ba(t.type),V(t),null;case 19:if(Vo(t),r=t.memoizedState,r===null)return V(t),null;if(a=!!(t.flags&128),o=r.rendering,o===null){if(a)bl(r,!1);else{if(ad!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=Ho(e),o!==null){for(t.flags|=128,bl(r,!1),e=o.updateQueue,t.updateQueue=e,yl(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)Ii(n,e),n=n.sibling;return Bo(t,zo.current&1|2),z&&$i(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Ue()>gd&&(t.flags|=128,a=!0,bl(r,!1),t.lanes=4194304)}}else{if(!a){if(e=Ho(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,yl(t,e),bl(r,!0),r.tail===null&&r.tailMode!==`collapsed`&&r.tailMode!==`visible`&&!o.alternate&&!z)return V(t),null}else 2*Ue()-r.renderingStartTime>gd&&n!==536870912&&(t.flags|=128,a=!0,bl(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)}if(r.tail!==null){e=r.tail;a:{for(n=e;n!==null;){if(n.alternate!==null){n=!1;break a}n=n.sibling}n=!0}return r.rendering=e,r.tail=e.sibling,r.renderingStartTime=Ue(),e.sibling=null,o=zo.current,o=a?o&1|2:o&1,r.tailMode===`visible`||r.tailMode===`collapsed`||!n||z?Bo(t,o):(n=o,Se(Mo,t),Se(zo,n),No===null&&(No=t)),z&&$i(t,r.treeForkCount),e}return V(t),null;case 22:case 23:return Ro(t),jo(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(V(t),t.subtreeFlags&6&&(t.flags|=8192)):V(t),n=t.updateQueue,n!==null&&yl(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&&xe(Ka),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),ba(Ma),V(t),null;case 25:return null;case 30:return t.flags|=33554432,V(t),null}throw Error(i(156,t.tag))}function Sl(e,t){switch(na(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ba(Ma),Oe(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Ae(t),null;case 31:if(t.memoizedState!==null){if(Ro(t),t.alternate===null)throw Error(i(340));pa()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Ro(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));pa()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Vo(t),e=t.flags,e&65536?(t.flags=e&-65537|128,e=t.memoizedState,e!==null&&(e.rendering=null,e.tail=null),t.flags|=4,t):null;case 4:return Oe(),null;case 10:return ba(t.type),null;case 22:case 23:return Ro(t),jo(),e!==null&&xe(Ka),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return ba(Ma),null;case 25:return null;default:return null}}function Cl(e,t){switch(na(t),t.tag){case 3:ba(Ma),Oe();break;case 26:case 27:case 5:Ae(t);break;case 4:Oe();break;case 31:t.memoizedState!==null&&Ro(t);break;case 13:Ro(t);break;case 19:Vo(t);break;case 10:ba(t.type);break;case 22:case 23:Ro(t),jo(),e!==null&&xe(Ka);break;case 24:ba(Ma)}}function wl(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){Z(t,t.return,e)}}function Tl(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){Z(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){Z(t,t.return,e)}}function El(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Eo(t,n)}catch(t){Z(e,e.return,t)}}}function Dl(e,t,n){n.props=Tc(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){Z(e,t,n)}}function Ol(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:var i=e.stateNode,a=vi(e.memoizedProps,i);(i.ref===null||i.ref.name!==a)&&(i.ref=Fp(a)),r=i.ref;break;case 7:if(e.stateNode===null){var o=new Ip(e);h(e.child,!1,$p,o,void 0,void 0),e.stateNode=o}r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){Z(e,t,n)}}function kl(e,t){var n=e.ref,r=e.refCleanup;if(n!==null){if(typeof r==`function`)try{r()}catch(n){Z(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){Z(e,t,n)}else n.current=null}}function H(e,t){if((e.tag===5||e.tag===27||e.tag===6)&&e.alternate===null&&t!==null)for(var n=0;n<t.length;n++)tm(e.stateNode,t[n])}function Al(e){for(var t=e.return;t!==null&&(Nl(t)&&tm(e.stateNode,t.stateNode),!Ml(t));)t=t.return}function jl(e){for(var t=e.return;t!==null&&(Nl(t)&&nm(e.stateNode,t.stateNode),!Ml(t));)t=t.return}function Ml(e){return e.tag===5||e.tag===3||e.tag===27}function Nl(e){return e&&e.tag===7&&e.stateNode!==null}function Pl(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){Z(e,e.return,t)}}function Fl(e,t,n){try{var r=e.stateNode;ap(r,e.type,n,t),r[Et]=t}catch(t){Z(e,e.return,t)}}function Il(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Cp(e.type)||e.tag===4}function Ll(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Il(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&&Cp(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 Rl(e,t,n,r){var i=e.tag;if(i===5||i===6)i=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(i,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(i),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=xn)),H(e,r),I=!0;else if(i!==4&&(i===27&&(H(e,r),r=null,Cp(e.type)&&(n=e.stateNode,t=null)),e=e.child,e!==null))for(Rl(e,t,n,r),e=e.sibling;e!==null;)Rl(e,t,n,r),e=e.sibling}function zl(e,t,n,r){var i=e.tag;if(i===5||i===6)i=e.stateNode,t?n.insertBefore(i,t):n.appendChild(i),H(e,r),I=!0;else if(i!==4&&(i===27&&(H(e,r),r=null,Cp(e.type)&&(n=e.stateNode)),e=e.child,e!==null))for(zl(e,t,n,r),e=e.sibling;e!==null;)zl(e,t,n,r),e=e.sibling}function Bl(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);rp(t,r,n),t[Tt]=e,t[Et]=n}catch(t){Z(e,e.return,t)}}var U=!1,Vl=null;function Hl(e){(e.tag===30||e.subtreeFlags&33554432)&&(U=!0)}var Ul=null;function Wl(){var e=Ul;return Ul=null,e}var Gl=0;function Kl(e,t,n,r,i){return Gl=0,ql(e.child,t,n,r,i)}function ql(e,t,n,r,i){for(var a=!1;e!==null;){if(e.tag===5){var o=e.stateNode;if(r!==null){var s=kp(o);r.push(s),s.view&&(a=!0)}else a||kp(o).view&&(a=!0);U=!0,Ep(o,Gl===0?t:t+`_`+Gl,n),Gl++}else(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&i||ql(e.child,t,n,r,i)&&(a=!0));e=e.sibling}return a}function W(e,t){for(;e!==null;)e.tag===5?Dp(e.stateNode,e.memoizedProps):(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&t||W(e.child,t)),e=e.sibling}function Jl(e){if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if((e.tag!==22||e.memoizedState===null)&&(Jl(e),e.tag===30&&e.flags&18874368&&e.stateNode.paired)){var t=e.memoizedProps;if(t.name==null||t.name===`auto`)throw Error(i(544));var n=t.name;t=bi(t.default,t.share),t!==`none`&&(Kl(e,n,t,null,!1)||W(e.child,!1))}e=e.sibling}}function Yl(e,t){if(e.tag===30){var n=e.stateNode,r=e.memoizedProps,i=vi(r,n),a=bi(r.default,n.paired?r.share:r.enter);a===`none`?Jl(e):Kl(e,i,a,null,!1)?(Jl(e),n.paired||t||Nd(e,r.onEnter)):W(e.child,!1)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)Yl(e,t),e=e.sibling;else Jl(e)}function Xl(e){if(Vl!==null&&Vl.size!==0){var t=Vl;if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&e.flags&18874368){var n=e.memoizedProps,r=n.name;if(r!=null&&r!==`auto`){var i=t.get(r);if(i!==void 0){var a=bi(n.default,n.share);if(a!==`none`&&(Kl(e,r,a,null,!1)?(a=e.stateNode,i.paired=a,a.paired=i,Nd(e,n.onShare)):W(e.child,!1)),t.delete(r),t.size===0)break}}}Xl(e)}e=e.sibling}}}function Zl(e){if(e.tag===30){var t=e.memoizedProps,n=vi(t,e.stateNode),r=Vl===null?void 0:Vl.get(n),i=bi(t.default,r===void 0?t.exit:t.share);i!==`none`&&(Kl(e,n,i,null,!1)?r===void 0?Nd(e,t.onExit):(i=e.stateNode,r.paired=i,i.paired=r,Vl.delete(n),Nd(e,t.onShare)):W(e.child,!1)),Vl!==null&&Xl(e)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)Zl(e),e=e.sibling;else Vl!==null&&Xl(e)}function Ql(e){for(e=e.child;e!==null;){if(e.tag===30){var t=e.memoizedProps,n=vi(t,e.stateNode);t=bi(t.default,t.update),e.flags&=-5,t!==`none`&&Kl(e,n,t,e.memoizedState=[],!1)}else e.subtreeFlags&33554432&&Ql(e);e=e.sibling}}function $l(e){if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&e.flags&18874368){var t=e.stateNode;t.paired!==null&&(t.paired=null,W(e.child,!1))}$l(e)}e=e.sibling}}function eu(e){if(e.tag===30)e.stateNode.paired=null,W(e.child,!1),$l(e);else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)eu(e),e=e.sibling;else $l(e)}function tu(e){for(e=e.child;e!==null;)e.tag===30?W(e.child,!1):e.subtreeFlags&33554432&&tu(e),e=e.sibling}function nu(e,t,n,r,i,a,o){for(var s=!1;t!==null;){if(t.tag===5){var c=t.stateNode;if(a!==null&&Gl<a.length){var l=a[Gl],u=kp(c);(l.view||u.view)&&(s=!0);var d;if(d=!(e.flags&4)){if(u.clip)d=!0;else{d=l.rect;var f=u.rect;d=d.y!==f.y||d.x!==f.x||d.height!==f.height||d.width!==f.width}}d&&(e.flags|=4),u.abs?u=!l.abs:(l=l.rect,u=u.rect,u=l.height!==u.height||l.width!==u.width),u&&(e.flags|=32)}else e.flags|=32;e.flags&4&&Ep(c,Gl===0?n:n+`_`+Gl,i),s&&e.flags&4||(Ul===null&&(Ul=[]),Ul.push(c,Gl===0?r:r+`_`+Gl,t.memoizedProps)),Gl++}else(t.tag!==22||t.memoizedState===null)&&(t.tag===30&&o?e.flags|=t.flags&32:nu(e,t.child,n,r,i,a,o)&&(s=!0));t=t.sibling}return s}function ru(e,t){for(e=e.child;e!==null;){if(e.tag===30){var n=e.memoizedProps,r=e.stateNode,i=vi(n,r),a=bi(n.default,n.update);if(t){r=r.clones;var o=r===null?null:r.map(Ap)}else o=e.memoizedState,e.memoizedState=null;r=e;var s=e.child;Gl=0,i=nu(r,s,i,i,a,o,!1),e.flags&4&&i&&(t||Nd(e,n.onUpdate))}else e.subtreeFlags&33554432&&ru(e,t);e=e.sibling}}var iu=!1,G=!1,au=!1,ou=!1,su=typeof WeakSet==`function`?WeakSet:Set,cu=null,lu=!1,uu=!1,K=!1,du=!1;function fu(e,t,n){if(e=e.containerInfo,cp=gh,e=L(e),Xr(e)){if(`selectionStart`in e)var r={start:e.selectionStart,end:e.selectionEnd};else a:{r=(r=e.ownerDocument)&&r.defaultView||window;var i=r.getSelection&&r.getSelection();if(i&&i.rangeCount!==0){r=i.anchorNode;var a=i.anchorOffset,o=i.focusNode;i=i.focusOffset;try{r.nodeType,o.nodeType}catch{r=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==r||a!==0&&f.nodeType!==3||(c=s+a),f!==o||i!==0&&f.nodeType!==3||(l=s+i),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===r&&++u===a&&(c=s),p===o&&++d===i&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}r=c===-1||l===-1?null:{start:c,end:l}}else r=null}r||={start:0,end:0}}else r=null;for(lp={focusedElem:e,selectionRange:r},gh=!1,n=(n&335544064)===n,cu=t,t=n?9270:1024;cu!==null;){if(e=cu,n&&(r=e.deletions,r!==null))for(a=0;a<r.length;a++)n&&Zl(r[a]);if(e.alternate===null&&e.flags&2)n&&Hl(e),pu(n);else{if(e.tag===22){if(r=e.alternate,e.memoizedState!==null){r!==null&&r.memoizedState===null&&n&&Zl(r),pu(n);continue}if(r!==null&&r.memoizedState!==null){n&&Hl(e),pu(n);continue}}r=e.child,(e.subtreeFlags&t)!==0&&r!==null?(r.return=e,cu=r):(n&&Ql(e),pu(n))}}Vl=null}function pu(e){for(;cu!==null;){var t=cu,n=e,r=t.alternate,a=t.flags;switch(t.tag){case 0:case 11:case 15:break;case 1:if(a&1024&&r!==null){n=void 0,a=r.memoizedProps,r=r.memoizedState;var o=t.stateNode;try{var s=Tc(t.type,a);n=o.getSnapshotBeforeUpdate(s,r),o.__reactInternalSnapshotBeforeUpdate=n}catch(e){Z(t,t.return,e)}}break;case 3:if(a&1024){if(r=t.stateNode.containerInfo,n=r.nodeType,n===9)rm(r);else if(n===1)switch(r.nodeName){case`HEAD`:case`HTML`:case`BODY`:rm(r);break;default:r.textContent=``}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;case 30:n&&r!==null&&(n=vi(r.memoizedProps,r.stateNode),a=t.memoizedProps,a=bi(a.default,a.update),a!==`none`&&Kl(r,n,a,r.memoizedState=[],!0));break;default:if(a&1024)throw Error(i(163))}if(r=t.sibling,r!==null){r.return=t.return,cu=r;break}cu=t.return}}function mu(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:Pu(e,n),r&4&&wl(5,n);break;case 1:if(Pu(e,n),r&4){if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){Z(n,n.return,e)}else{var i=Tc(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){Z(n,n.return,e)}}}r&64&&El(n),r&512&&Ol(n,n.return);break;case 3:if(Pu(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{Eo(e,t)}catch(e){Z(n,n.return,e)}}break;case 27:t===null&&r&4&&Bl(n);case 26:case 5:Pu(e,n),t===null&&r&4&&Pl(n),r&512&&Ol(n,n.return);break;case 12:Pu(e,n);break;case 31:Pu(e,n),r&4&&Cu(e,n);break;case 13:Pu(e,n),r&4&&wu(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=_f.bind(null,n),lm(e,n))));break;case 22:if(r=n.memoizedState!==null||iu,!r){var a=t!==null&&t.memoizedState!==null||G;t=iu,i=G,iu=r,(G=a)&&!i?(r=2,n.subtreeFlags&8772&&(r|=1),Iu(e,n,r)):Pu(e,n),iu=t,G=i}break;case 30:Pu(e,n),r&512&&Ol(n,n.return);break;case 7:r&512&&Ol(n,n.return);default:Pu(e,n)}}function hu(e,t){for(e=e.child;e!==null;)gu(e,t),e=e.sibling}function gu(e,t){switch(e.tag){case 5:case 26:try{var n=e.stateNode;if(t){var r=n.style;typeof r.setProperty==`function`?r.setProperty(`display`,`none`,`important`):r.display=`none`}else{var i=e.stateNode,a=e.memoizedProps.style,o=a!=null&&a.hasOwnProperty(`display`)?a.display:null;i.style.display=o==null||typeof o==`boolean`?``:(``+o).trim()}}catch(t){Z(e,e.return,t)}_u(e,t);break;case 6:try{e.stateNode.nodeValue=t?``:e.memoizedProps,I=!0}catch(t){Z(e,e.return,t)}break;case 18:try{var s=e.stateNode;t?Tp(s,!0):Tp(e.stateNode,!1)}catch(t){Z(e,e.return,t)}break;case 22:case 23:e.memoizedState===null&&hu(e,t);break;default:hu(e,t)}}function _u(e,t){if(e.subtreeFlags&67108864)for(e=e.child;e!==null;){a:{var n=e,r=t;switch(n.tag){case 4:gu(n,r);break a;case 22:n.memoizedState===null&&_u(n,r);break a;default:_u(n,r)}}e=e.sibling}}function vu(e){var t=e.alternate;t!==null&&(e.alternate=null,vu(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Pt(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 yu=null,bu=!1;function xu(e,t,n){for(n=n.child;n!==null;)Su(e,t,n),n=n.sibling}function Su(e,t,n){if($e&&typeof $e.onCommitFiberUnmount==`function`)try{$e.onCommitFiberUnmount(Qe,n)}catch{}switch(n.tag){case 26:G||kl(n,t),xu(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&!G&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:G||kl(n,t),jl(n);var r=yu,i=bu;Cp(n.type)&&(yu=n.stateNode,bu=!1),xu(e,t,n),_m(n.stateNode,n.type,n.memoizedProps),yu=r,bu=i;break;case 5:G||kl(n,t),jl(n);case 6:if(n.tag===6&&jl(n),r=yu,i=bu,yu=null,xu(e,t,n),yu=r,bu=i,yu!==null){if(bu)try{(yu.nodeType===9?yu.body:yu.nodeName===`HTML`?yu.ownerDocument.body:yu).removeChild(n.stateNode),I=!0}catch(e){Z(n,t,e)}else try{yu.removeChild(n.stateNode),I=!0}catch(e){Z(n,t,e)}}break;case 18:yu!==null&&(bu?(e=yu,wp(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Hh(e)):wp(yu,n.stateNode));break;case 4:r=yu,i=bu,yu=n.stateNode.containerInfo,bu=!0,xu(e,t,n),yu=r,bu=i;break;case 0:case 11:case 14:case 15:Tl(2,n,t),G||Tl(4,n,t),xu(e,t,n);break;case 1:G||(kl(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&Dl(n,t,r)),xu(e,t,n);break;case 21:xu(e,t,n);break;case 22:G=(r=G)||n.memoizedState!==null,xu(e,t,n),G=r;break;case 30:kl(n,t),xu(e,t,n);break;case 7:G||kl(n,t),xu(e,t,n);break;default:xu(e,t,n)}}function Cu(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Hh(e)}catch(e){Z(t,t.return,e)}}}function wu(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Hh(e)}catch(e){Z(t,t.return,e)}}function Tu(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new su),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new su),t;default:throw Error(i(435,e.tag))}}function Eu(e,t){var n=Tu(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=vf.bind(null,e,t);t.then(r,r)}})}function Du(e,t,n){var r=t.deletions;if(r!==null)for(var a=0;a<r.length;a++){var o=r[a],s=e,c=t,l=c;a:for(;l!==null;){switch(l.tag){case 27:if(Cp(l.type)){yu=l.stateNode,bu=!1;break a}break;case 5:yu=l.stateNode,bu=!1;break a;case 3:case 4:yu=l.stateNode.containerInfo,bu=!0;break a}l=l.return}if(yu===null)throw Error(i(160));Su(s,c,o),yu=null,bu=!1,s=o.alternate,s!==null&&(s.return=null),o.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)ku(t,e,n),t=t.sibling}var Ou=null;function ku(e,t,n){var r=e.alternate,a=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(a&4&&(r=e.updateQueue,r=r===null?null:r.events,r!==null))for(var o=0;o<r.length;o++){var s=r[o];s.ref.impl=s.nextImpl}Du(t,e,n),Au(e),a&4&&(Tl(3,e,e.return),wl(3,e),Tl(5,e,e.return));break;case 1:Du(t,e,n),Au(e),a&512&&(G||r===null||kl(r,r.return)),a&64&&iu&&(e=e.updateQueue,e!==null&&(t=e.callbacks,t!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?t:n.concat(t))));break;case 26:if(o=Ou,Du(t,e,n),Au(e),a&512&&(G||r===null||kl(r,r.return)),a&4){if(a=r===null?null:r.memoizedState,n=e.memoizedState,r===null){if(n===null){if(e.stateNode===null){if(iu)e.stateNode=pp(e.type,e.memoizedProps,t.containerInfo,e);else{a:{t=e.type,n=e.memoizedProps,a=o.ownerDocument||o;b:switch(t){case`title`:r=a.getElementsByTagName(`title`)[0],(!r||r[Mt]||r[Tt]||r.namespaceURI===`http://www.w3.org/2000/svg`||r.hasAttribute(`itemprop`))&&(r=a.createElement(t),a.head.insertBefore(r,a.querySelector(`head > title`))),rp(r,t,n),r[Tt]=e,zt(r),t=r;break a;case`link`:if(o=Gm(`link`,`href`,a).get(t+(n.href||``))){for(s=0;s<o.length;s++)if(r=o[s],r.getAttribute(`href`)===(n.href==null||n.href===``?null:n.href)&&r.getAttribute(`rel`)===(n.rel==null?null:n.rel)&&r.getAttribute(`title`)===(n.title==null?null:n.title)&&r.getAttribute(`crossorigin`)===(n.crossOrigin==null?null:n.crossOrigin)){o.splice(s,1);break b}}r=a.createElement(t),rp(r,t,n),a.head.appendChild(r);break;case`meta`:if(o=Gm(`meta`,`content`,a).get(t+(n.content||``))){for(s=0;s<o.length;s++)if(r=o[s],r.getAttribute(`content`)===(n.content==null?null:``+n.content)&&r.getAttribute(`name`)===(n.name==null?null:n.name)&&r.getAttribute(`property`)===(n.property==null?null:n.property)&&r.getAttribute(`http-equiv`)===(n.httpEquiv==null?null:n.httpEquiv)&&r.getAttribute(`charset`)===(n.charSet==null?null:n.charSet)){o.splice(s,1);break b}}r=a.createElement(t),rp(r,t,n),a.head.appendChild(r);break;default:throw Error(i(468,t))}r[Tt]=e,zt(r),t=r}e.stateNode=t}}else iu||Km(o,e.type,e.stateNode)}else e.stateNode=Bm(o,n,e.memoizedProps)}else a===n?n===null&&e.stateNode!==null&&Fl(e,e.memoizedProps,r.memoizedProps):(a===null?(t=r.stateNode,t===null||G||t.parentNode.removeChild(t)):a.count--,n===null?iu||Km(o,e.type,e.stateNode):Bm(o,n,e.memoizedProps))}break;case 27:Du(t,e,n),Au(e),a&512&&(G||r===null||kl(r,r.return)),r!==null&&a&4&&Fl(e,e.memoizedProps,r.memoizedProps);break;case 5:if(o=au,au=!1,Du(t,e,n),au=o,Au(e),a&512&&(G||r===null||kl(r,r.return)),e.flags&32){t=e.stateNode;try{pn(t,``),I=!0}catch(t){Z(e,e.return,t)}}a&4&&e.stateNode!=null&&(t=e.memoizedProps,Fl(e,t,r===null?t:r.memoizedProps)),a&1024&&(ou=!0);break;case 6:if(Du(t,e,n),Au(e),a&4){if(e.stateNode===null)throw Error(i(162));t=e.memoizedProps,n=e.stateNode;try{n.nodeValue=t,I=!0}catch(t){Z(e,e.return,t)}}break;case 3:if(I=!1,Wm=null,o=Ou,Ou=xm(t.containerInfo),Du(t,e,n),Ou=o,Au(e),a&4&&r!==null&&r.memoizedState.isDehydrated)try{Hh(t.containerInfo)}catch(t){Z(e,e.return,t)}ou&&(ou=!1,ju(e)),I=!1;break;case 4:a=au,au=iu,r=Yt(),o=Ou,Ou=xm(e.stateNode.containerInfo),Du(t,e,n),Au(e),Ou=o,I&&uu&&(K=!0),I=r,au=a;break;case 12:Du(t,e,n),Au(e);break;case 31:Du(t,e,n),Au(e),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Eu(e,t)));break;case 13:Du(t,e,n),Au(e),e.child.flags&8192&&e.memoizedState!==null!=(r!==null&&r.memoizedState!==null)&&(md=Ue()),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Eu(e,t)));break;case 22:o=e.memoizedState!==null,s=r!==null&&r.memoizedState!==null;var c=iu,l=G,u=au;iu=c||o,au=u||o,G=l||s,Du(t,e,n),G=l,au=u,iu=c,Au(e),a&8192&&(t=e.stateNode,t._visibility=o?t._visibility&-2:t._visibility|1,!o||r===null||s||iu||G||(t=s||G,n=iu,r=G,iu=o||iu,G=t,Fu(e,2),iu=n,G=r),!o&&au||hu(e,o)),a&4&&(t=e.updateQueue,t!==null&&(n=t.retryQueue,n!==null&&(t.retryQueue=null,Eu(e,n))));break;case 19:Du(t,e,n),Au(e),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Eu(e,t)));break;case 30:a&512&&(G||r===null||kl(r,r.return)),a=Yt(),o=uu,s=(n&335544064)===n,c=e.memoizedProps,uu=s&&bi(c.default,c.update)!==`none`,Du(t,e,n),Au(e),s&&r!==null&&I&&(e.flags|=4),uu=o,I=a;break;case 21:break;case 7:a&512&&(G||r===null||kl(r,r.return)),r&&r.stateNode!==null&&(r.stateNode._fragmentFiber=e);default:Du(t,e,n),Au(e)}}function Au(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(Il(r)){n=r;break}r=r.return}r=null;for(var a=e.return;a!==null;){if(Nl(a)){var o=a.stateNode;r===null?r=[o]:r.push(o)}if(Ml(a))break;a=a.return}var s=r;if(n==null)throw Error(i(160));switch(n.tag){case 27:var c=n.stateNode;zl(e,Ll(e),c,s);break;case 5:var l=n.stateNode;n.flags&32&&(pn(l,``),n.flags&=-33),zl(e,Ll(e),l,s);break;case 3:case 4:var u=n.stateNode.containerInfo;Rl(e,Ll(e),u,s);break;default:throw Error(i(161))}}catch(t){Z(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function ju(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;ju(t),t.tag===5&&t.flags&1024&&(t=t.stateNode,gh=!0,t.reset(),gh=!1),e=e.sibling}}function Mu(e,t){if(t.subtreeFlags&9270)for(t=t.child;t!==null;)Nu(t,e),t=t.sibling;else ru(t,!1)}function Nu(e,t){var n=e.alternate;if(n===null)Yl(e,!1);else switch(e.tag){case 3:if(du=lu=!1,Wl(),Mu(t,e),!lu&&!K){if(e=Ul,e!==null)for(var r=0;r<e.length;r+=3){n=e[r];var i=e[r+1];Dp(n,e[r+2]),n=n.ownerDocument.documentElement,n!==null&&n.animate({opacity:[0,0],pointerEvents:[`none`,`none`]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition-group(`+i+`)`})}e=t.containerInfo,e=e.nodeType===9?e.documentElement:e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName===``&&(e.style.viewTransitionName=`none`,e.animate({opacity:[0,0],pointerEvents:[`none`,`none`]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition-group(root)`}),e.animate({width:[0,0],height:[0,0]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition`})),du=!0}Ul=null;break;case 5:Mu(t,e);break;case 4:r=lu,lu=!1,Mu(t,e),lu&&(K=!0),lu=r;break;case 22:e.memoizedState===null&&(n.memoizedState===null?Mu(t,e):Yl(e,!1));break;case 30:r=lu,i=Wl(),lu=!1,Mu(t,e),lu&&(e.flags|=4);var a=e.memoizedProps,o=e.stateNode;t=vi(a,o),o=vi(n.memoizedProps,o);var s=bi(a.default,a.update);s===`none`?t=!1:(a=n.memoizedState,n.memoizedState=null,n=e.child,Gl=0,t=nu(e,n,t,o,s,a,!0),Gl!==(a===null?0:a.length)&&(e.flags|=32)),e.flags&4&&t?(Nd(e,e.memoizedProps.onUpdate),Ul=i):i!==null&&(i.push.apply(i,Ul),Ul=i),lu=e.flags&32?!0:r;break;default:Mu(t,e)}}function Pu(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)mu(e,t.alternate,t),t=t.sibling}function Fu(e,t){for(e=e.child;e!==null;){var n=e,r=t;switch(n.tag){case 0:case 11:case 14:case 15:Tl(4,n,n.return),Fu(n,r);break;case 1:kl(n,n.return);var i=n.stateNode;typeof i.componentWillUnmount==`function`&&Dl(n,n.return,i),Fu(n,r);break;case 27:r&2&&_m(n.stateNode,n.type,n.memoizedProps);case 5:kl(n,n.return),n.tag!==5&&n.tag!==27||jl(n),Fu(n,r);break;case 6:jl(n);break;case 26:kl(n,n.return),i=n.stateNode,n.memoizedState!==null||i===null||G||i.parentNode.removeChild(i),Fu(n,r);break;case 22:n.memoizedState===null&&Fu(n,r);break;case 30:kl(n,n.return),Fu(n,r);break;case 7:kl(n,n.return);default:Fu(n,r)}e=e.sibling}}function Iu(e,t,n){for(n=t.subtreeFlags&8772?n:n&-2,t=t.child;t!==null;){var r=t.alternate,i=e,a=t,o=a.flags,s=!!(n&1);switch(a.tag){case 0:case 11:case 15:Iu(i,a,n),wl(4,a);break;case 1:if(Iu(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){Z(r,r.return,e)}if(r=a,i=r.updateQueue,i!==null){var c=r.stateNode;try{var l=i.shared.hiddenCallbacks;if(l!==null)for(i.shared.hiddenCallbacks=null,i=0;i<l.length;i++)To(l[i],c)}catch(e){Z(r,r.return,e)}}s&&o&64&&El(a),Ol(a,a.return);break;case 27:n&2&&Bl(a);case 5:a.tag!==5&&a.tag!==27||Al(a),Iu(i,a,n),s&&r===null&&o&4&&Pl(a),Ol(a,a.return);break;case 6:Al(a);break;case 26:c=a.stateNode,a.memoizedState!==null||c===null||iu||Km(xm(c.ownerDocument),a.type,c),Iu(i,a,n),s&&r===null&&o&4&&Pl(a),Ol(a,a.return);break;case 12:Iu(i,a,n);break;case 31:Iu(i,a,n),s&&o&4&&Cu(i,a);break;case 13:Iu(i,a,n),s&&o&4&&wu(i,a);break;case 22:a.memoizedState===null&&Iu(i,a,n),Ol(a,a.return);break;case 30:Iu(i,a,n),Ol(a,a.return);break;case 7:Ol(a,a.return);default:Iu(i,a,n)}t=t.sibling}}function Lu(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&&Pa(n))}function Ru(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Pa(e))}function zu(e,t,n,r){var i=(n&335544064)===n;if(t.subtreeFlags&(i?10262:10256))for(t=t.child;t!==null;)Bu(e,t,n,r),t=t.sibling;else i&&tu(t)}function Bu(e,t,n,r){var i=(n&335544064)===n;i&&t.alternate===null&&t.return!==null&&t.return.alternate!==null&&eu(t);var a=t.flags;switch(t.tag){case 0:case 11:case 15:zu(e,t,n,r),a&2048&&wl(9,t);break;case 1:zu(e,t,n,r);break;case 3:zu(e,t,n,r),i&&du&&(e=e.containerInfo,e=e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,e.style.viewTransitionName===`root`&&(e.style.viewTransitionName=``),e=e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName===`none`&&(e.style.viewTransitionName=``)),a&2048&&(a=null,t.alternate!==null&&(a=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==a&&(t.refCount++,a!=null&&Pa(a)));break;case 12:if(a&2048){zu(e,t,n,r),a=t.stateNode;try{var o=t.memoizedProps,s=o.id,c=o.onPostCommit;typeof c==`function`&&c(s,t.alternate===null?`mount`:`update`,a.passiveEffectDuration,-0)}catch(e){Z(t,t.return,e)}}else zu(e,t,n,r);break;case 31:zu(e,t,n,r);break;case 13:zu(e,t,n,r);break;case 23:break;case 22:o=t.stateNode,s=t.alternate,t.memoizedState===null?(i&&s!==null&&s.memoizedState!==null&&eu(t),o._visibility&2?zu(e,t,n,r):(o._visibility|=2,Vu(e,t,n,r,!!(t.subtreeFlags&10256)||!1))):(i&&s!==null&&s.memoizedState===null&&eu(s),o._visibility&2?zu(e,t,n,r):Hu(e,t)),a&2048&&Lu(s,t);break;case 24:zu(e,t,n,r),a&2048&&Ru(t.alternate,t);break;case 30:i&&(a=t.alternate,a!==null&&(W(a.child,!0),W(t.child,!0))),zu(e,t,n,r);break;default:zu(e,t,n,r)}}function Vu(e,t,n,r,i){for(i&&=!!(t.subtreeFlags&10256)||!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:Vu(a,o,s,c,i),wl(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,Vu(a,o,s,c,i)):u._visibility&2?Vu(a,o,s,c,i):Hu(a,o),i&&l&2048&&Lu(o.alternate,o);break;case 24:Vu(a,o,s,c,i),i&&l&2048&&Ru(o.alternate,o);break;default:Vu(a,o,s,c,i)}t=t.sibling}}function Hu(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:Hu(n,r),i&2048&&Lu(r.alternate,r);break;case 24:Hu(n,r),i&2048&&Ru(r.alternate,r);break;default:Hu(n,r)}t=t.sibling}}var Uu=8192;function Wu(e,t,n){if(e.subtreeFlags&Uu)for(e=e.child;e!==null;)Gu(e,t,n),e=e.sibling}function Gu(e,t,n){switch(e.tag){case 26:Wu(e,t,n),e.flags&Uu&&(e.memoizedState===null?(e=e.stateNode,(t&335544128)===t&&Zm(n,e)):Qm(n,Ou,e.memoizedState,e.memoizedProps));break;case 5:Wu(e,t,n),e.flags&Uu&&(e=e.stateNode,(t&335544128)===t&&Zm(n,e));break;case 3:case 4:var r=Ou;Ou=xm(e.stateNode.containerInfo),Wu(e,t,n),Ou=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Uu,Uu=16777216,Wu(e,t,n),Uu=r):Wu(e,t,n));break;case 30:if((e.flags&Uu)!==0&&(r=e.memoizedProps.name,r!=null&&r!==`auto`)){var i=e.stateNode;i.paired=null,Vl===null&&(Vl=new Map),Vl.set(r,i)}Wu(e,t,n);break;default:Wu(e,t,n)}}function Ku(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 qu(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];cu=r,Xu(r,e)}Ku(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Ju(e),e=e.sibling}function Ju(e){switch(e.tag){case 0:case 11:case 15:qu(e),e.flags&2048&&Tl(9,e,e.return);break;case 3:qu(e);break;case 12:qu(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Yu(e)):qu(e);break;default:qu(e)}}function Yu(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];cu=r,Xu(r,e)}Ku(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Tl(8,t,t.return),Yu(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Yu(t));break;default:Yu(t)}e=e.sibling}}function Xu(e,t){for(;cu!==null;){var n=cu;switch(n.tag){case 0:case 11:case 15:Tl(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:Pa(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,cu=r;else a:for(n=e;cu!==null;){r=cu;var i=r.sibling,a=r.return;if(vu(r),r===n){cu=null;break a}if(i!==null){i.return=a,cu=i;break a}cu=a}}}var Zu={getCacheForType:function(e){var t=Ea(Ma),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return Ea(Ma).controller.signal}},Qu=typeof WeakMap==`function`?WeakMap:Map,q=0,$u=null,J=null,Y=0,X=0,ed=null,td=!1,nd=!1,rd=!1,id=0,ad=0,od=0,sd=0,cd=0,ld=0,ud=0,dd=null,fd=null,pd=!1,md=0,hd=0,gd=1/0,_d=null,vd=null,yd=0,bd=null,xd=null,Sd=0,Cd=0,wd=null,Td=null,Ed=null,Dd=null,Od=null,kd=0,Ad=null;function jd(){return q&2&&Y!==0?Y&-Y:P.T===null?St():Pf()}function Md(){if(ld===0){if(!(Y&536870912)||z){var e=ot;ot<<=1,!(ot&3932160)&&(ot=262144),ld=e}else ld=536870912}return e=Mo.current,e!==null&&(e.flags|=32),ld}function Nd(e,t){if(t!=null){var n=e.stateNode,r=n.ref;r===null&&(r=n.ref=Fp(vi(e.memoizedProps,n))),Dd===null&&(Dd=[]),Dd.push(t.bind(null,r))}}function Pd(e,t,n){(e===$u&&(X===2||X===9)||e.cancelPendingCommit!==null)&&(Vd(e,0),Rd(e,Y,ld,!1)),ht(e,n),(!(q&2)||e!==$u)&&(e===$u&&(!(q&2)&&(sd|=n),ad===4&&Rd(e,Y,ld,!1)),Ef(e))}function Fd(e,t,n){if(q&6)throw Error(i(327));var r=!n&&!(t&127)&&(t&e.expiredLanes)===0||ut(e,t),a=r?Yd(e,t):qd(e,t,!0),o=r;do{if(a===0){nd&&!r&&Rd(e,t,0,!1);break}if(n=e.current.alternate,o&&!Ld(n)){a=qd(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=dd;var l=c.current.memoizedState.isDehydrated;if(l&&(Vd(c,s).flags|=256),s=qd(c,s,!1),s!==2&&s!==6){if(rd&&!l){c.errorRecoveryDisabledLanes|=o,sd|=o,a=4;break a}o=fd,fd=a,o!==null&&(fd===null?fd=o:fd.push.apply(fd,o))}a=s}if(o=!1,a!==2)continue}}if(a===1){Vd(e,0),Rd(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&&(t&62914560)!==t)break;case 6:Rd(r,t,ld,!td);break a;case 2:fd=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(a=md+300-Ue(),10<a)){if(Rd(r,t,ld,!td),lt(r,0,!0)!==0)break a;Sd=t,r.timeoutHandle=_p(Id.bind(null,r,n,fd,_d,pd,t,ld,sd,ud,td,o,`Throttled`,-0,0),a);break a}Id(r,n,fd,_d,pd,t,ld,sd,ud,td,o,null,-0,0)}break}while(1);Ef(e)}function Id(e,t,n,r,i,a,o,s,c,l,u,d,f,p){e.timeoutHandle=-1;var m=t.subtreeFlags,h=(a&335544064)===a;if(d=null,(h||m&8192||(m&16785408)==16785408)&&(d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:xn},Vl=null,Gu(t,a,d),h&&(m=d,h=e.containerInfo,h=(h.nodeType===9?h:h.ownerDocument).__reactViewTransition,h!=null&&(m.count++,m.waitingForViewTransition=!0,m=nh.bind(m),h.finished.then(m,m))),m=(a&62914560)===a?md-Ue():(a&4194048)===a?hd-Ue():0,m=eh(d,m),m!==null)){Sd=a,e.cancelPendingCommit=m(nf.bind(null,e,t,a,n,r,i,o,s,c,l,u,d,null,f,p)),Rd(e,a,o,!l);return}nf(e,t,a,n,r,i,o,s,c,l,u,d)}function Ld(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(!Wr(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 Rd(e,t,n,r){t=dt(e,t),t&=~cd,t&=~sd,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-tt(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&_t(e,n,t)}function zd(){return q&6?!0:(Df(0,!1),!1)}function Bd(){if(J!==null){if(X===0)var e=J.return;else e=J,va=_a=null,ss(e),oo=null,so=0,e=J;for(;e!==null;)Cl(e.alternate,e),e=e.return;J=null}}function Vd(e,t){var n=e.timeoutHandle;return n!==-1&&(e.timeoutHandle=-1,vp(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),Sd=0,Bd(),$u=e,J=n=Fi(e.current,null),Y=t,X=0,ed=null,td=!1,nd=ut(e,t),rd=!1,ud=ld=cd=sd=od=ad=0,fd=dd=null,pd=!1,id=dt(e,t),Ti(),n}function Hd(e,t){B=null,P.H=_c,t===Xa||t===Qa?(t=io(),X=3):t===Za?(t=io(),X=4):X=t===Fc?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,ed=t,J===null&&(ad=1,kc(e,Ui(t,e.current)))}function Ud(){var e=Mo.current;return e===null?!0:(Y&4194048)===Y?No===null:(Y&62914560)===Y||Y&536870912?e===No:!1}function Wd(){var e=P.H;return P.H=_c,e===null?_c:e}function Gd(){var e=P.A;return P.A=Zu,e}function Kd(){ad=4,td||(Y&4194048)!==Y&&Mo.current!==null||(nd=!0),!(od&134217727)&&!(sd&134217727)||$u===null||Rd($u,Y,ld,!1)}function qd(e,t,n){var r=q;q|=2;var i=Wd(),a=Gd();($u!==e||Y!==t)&&(_d=null,Vd(e,t)),t=!1;var o=ad;a:do try{if(X!==0&&J!==null){var s=J,c=ed;switch(X){case 8:Bd(),o=6;break a;case 3:case 2:case 9:case 6:Mo.current===null&&(t=!0);var l=X;if(X=0,ed=null,$d(e,s,c,l),n&&nd){o=0;break a}break;default:l=X,X=0,ed=null,$d(e,s,c,l)}}Jd(),o=ad;break}catch(t){Hd(e,t)}while(1);return t&&e.shellSuspendCounter++,va=_a=null,q=r,P.H=i,P.A=a,J===null&&($u=null,Y=0,Ti()),o}function Jd(){for(;J!==null;)Zd(J)}function Yd(e,t){var n=q;q|=2;var r=Wd(),a=Gd();$u!==e||Y!==t?(_d=null,gd=Ue()+500,Vd(e,t)):nd=ut(e,t);a:do try{if(X!==0&&J!==null){t=J;var o=ed;b:switch(X){case 1:X=0,ed=null,$d(e,t,o,1);break;case 2:case 9:if(eo(o)){X=0,ed=null,Qd(t);break}t=function(){X!==2&&X!==9||$u!==e||(X=7),Ef(e)},o.then(t,t);break a;case 3:X=7;break a;case 4:X=5;break a;case 7:eo(o)?(X=0,ed=null,Qd(t)):(X=0,ed=null,$d(e,t,o,7));break;case 5:var s=null;switch(J.tag){case 26:s=J.memoizedState;case 5:case 27:var c=J;if(s?Ym(s):c.stateNode.complete){X=0,ed=null;var l=c.sibling;if(l!==null)J=l;else{var u=c.return;u===null?J=null:(J=u,ef(u))}break b}}X=0,ed=null,$d(e,t,o,5);break;case 6:X=0,ed=null,$d(e,t,o,6);break;case 8:Bd(),ad=6;break a;default:throw Error(i(462))}}Xd();break}catch(t){Hd(e,t)}while(1);return va=_a=null,P.H=r,P.A=a,q=n,J===null?($u=null,Y=0,Ti(),ad):0}function Xd(){for(;J!==null&&!Ve();)Zd(J)}function Zd(e){var t=hl(e.alternate,e,id);e.memoizedProps=e.pendingProps,t===null?ef(e):J=t}function Qd(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=Yc(n,t,t.pendingProps,t.type,void 0,Y);break;case 11:t=Yc(n,t,t.pendingProps,t.type.render,t.ref,Y);break;case 5:ss(t);var r=t;r===ia&&(z?(da(r),r.tag===5&&r.stateNode!=null&&(aa=r.stateNode)):(da(r),z=!0));default:Cl(n,t),t=J=Ii(t,id),t=hl(n,t,id)}e.memoizedProps=e.pendingProps,t===null?ef(e):J=t}function $d(e,t,n,r){va=_a=null,ss(t),oo=null,so=0;var i=t.return;try{if(Pc(e,i,t,n,Y)){ad=1,kc(e,Ui(n,e.current)),J=null;return}}catch(t){if(i!==null)throw J=i,t;ad=1,kc(e,Ui(n,e.current)),J=null;return}t.flags&32768?(z||r===1?e=!0:nd||Y&536870912?e=!1:(td=e=!0,(r===2||r===9||r===3||r===6)&&(r=Mo.current,r!==null&&r.tag===13&&(r.flags|=16384))),tf(t,e)):ef(t)}function ef(e){var t=e;do{if(t.flags&32768){tf(t,td);return}e=t.return;var n=xl(t.alternate,t,id);if(n!==null){J=n;return}if(t=t.sibling,t!==null){J=t;return}J=t=e}while(t!==null);ad===0&&(ad=5)}function tf(e,t){do{var n=Sl(e.alternate,e);if(n!==null){n.flags&=32767,J=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){J=e;return}J=e=n}while(e!==null);ad=6,J=null}function nf(e,t,n,r,a,o,s,c,l,u,d,f){e.cancelPendingCommit=null;do df();while(yd!==0);if(q&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));e===$u&&(J=$u=null,Y=0),xd=t,bd=e,Sd=n,wd=a,Td=r,rf(e,t,n,s,c,l,f)}}function rf(e,t,n,r,i,a,o){var s=t.lanes|t.childLanes;if(Cd=s,s|=wi,gt(e,n,s,r,i,a),Dd=null,(n&335544064)===n?(Od=La(e),r=10262):(Od=null,r=10256),(t.subtreeFlags&r)!==0||(t.flags&r)!==0?(e.callbackNode=null,e.callbackPriority=0,yf(qe,function(){return ff(),null})):(e.callbackNode=null,e.callbackPriority=0),U=!1,r=!!(t.flags&13878),t.subtreeFlags&13878||r){r=P.T,P.T=null,i=F.p,F.p=2,a=q,q|=4;try{fu(e,t,n)}finally{q=a,F.p=i,P.T=r}}yd=1,U?Ed=Np(o,e.containerInfo,Od,sf,cf,of,lf,ff,af,null,null):(sf(),cf(),lf())}function af(e){if(yd!==0){var t=bd.onRecoverableError;t(e,{componentStack:null})}}function of(){yd===3&&(yd=0,Nu(xd,bd),yd=4)}function sf(){if(yd===1){yd=0;var e=bd,t=xd,n=Sd,r=!!(t.flags&13878);if(t.subtreeFlags&13878||r){r=P.T,P.T=null;var i=F.p;F.p=2;var a=q;q|=4;try{uu=K=!1,ku(t,e,n),n=lp;var o=L(e.containerInfo),s=n.focusedElem,c=n.selectionRange;if(o!==s&&s&&s.ownerDocument&&Yr(s.ownerDocument.documentElement,s)){if(c!==null&&Xr(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 _=Jr(s,h),v=Jr(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}}gh=!!cp,lp=cp=null}finally{q=a,F.p=i,P.T=r}}e.current=t,yd=2}}function cf(){if(yd===2){yd=0;var e=bd,t=xd,n=!!(t.flags&8772);if(t.subtreeFlags&8772||n){n=P.T,P.T=null;var r=F.p;F.p=2;var i=q;q|=4;try{mu(e,t.alternate,t)}finally{q=i,F.p=r,P.T=n}}yd=3}}function lf(){if(yd===4||yd===3){yd=0;var e=Ed;Ed=null,He();var t=bd,n=xd,r=Sd,i=Td,a=(r&335544064)===r?10262:10256;if((n.subtreeFlags&a)!==0||(n.flags&a)!==0?yd=5:(yd=0,xd=bd=null,uf(t,t.pendingLanes)),a=t.pendingLanes,a===0&&(vd=null),xt(r),n=n.stateNode,$e&&typeof $e.onCommitFiberRoot==`function`)try{$e.onCommitFiberRoot(Qe,n,void 0,(n.current.flags&128)==128)}catch{}if(i!==null){n=P.T,a=F.p,F.p=2,P.T=null;try{for(var o=t.onRecoverableError,s=0;s<i.length;s++){var c=i[s];o(c.value,{componentStack:c.stack})}}finally{P.T=n,F.p=a}}if(i=Dd,o=Od,Od=null,i!==null&&(Dd=null,o===null&&(o=[]),e!==null))for(c=0;c<i.length;c++)n=(0,i[c])(o),n!==void 0&&e.finished.finally(n);Sd&3&&df(),Ef(t),a=t.pendingLanes,r&261930&&a&42?t===Ad?kd++:(kd=0,Ad=t):(kd=0,Ad=null),Df(0,!1)}}function uf(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Pa(t)))}function df(){return Ed!==null&&(Ed.skipTransition(),Ed=null),sf(),cf(),lf(),ff()}function ff(){if(yd!==5)return!1;var e=bd,t=Cd;Cd=0;var n=xt(Sd),r=P.T,a=F.p;try{F.p=32>n?32:n,P.T=null,n=wd,wd=null;var o=bd,s=Sd;if(yd=0,xd=bd=null,Sd=0,q&6)throw Error(i(331));var c=q;if(q|=4,Ju(o.current),Bu(o,o.current,s,n),q=c,Df(0,!1),$e&&typeof $e.onPostCommitFiberRoot==`function`)try{$e.onPostCommitFiberRoot(Qe,o)}catch{}return!0}finally{F.p=a,P.T=r,uf(e,t)}}function pf(e,t,n){t=Ui(n,t),t=jc(e.stateNode,t,2),e=yo(e,t,2),e!==null&&(ht(e,2),Ef(e))}function Z(e,t,n){if(e.tag===3)pf(e,e,n);else for(;t!==null;){if(t.tag===3){pf(t,e,n);break}if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(vd===null||!vd.has(r))){e=Ui(n,e),n=Mc(2),r=yo(t,n,2),r!==null&&(Nc(n,r,t,e),ht(r,2),Ef(r));break}}t=t.return}}function mf(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Qu;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)||(rd=!0,i.add(n),e=hf.bind(null,e,t,n),t.then(e,e))}function hf(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,$u===e&&(Y&n)===n&&(ad===4||ad===3&&(Y&62914560)===Y&&300>Ue()-md?q&2?cd|=n:Vd(e,0):cd|=n,ud===Y&&(ud=0)),Ef(e)}function gf(e,t){t===0&&(t=pt()),e=Oi(e,t),e!==null&&(ht(e,t),Ef(e))}function _f(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),gf(e,n)}function vf(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),gf(e,n)}function yf(e,t){return ze(e,t)}var bf=null,xf=null,Sf=!1,Cf=!1,wf=!1,Tf=0;function Ef(e){e!==xf&&e.next===null&&(xf===null?bf=xf=e:xf=xf.next=e),Cf=!0,Sf||(Sf=!0,Nf())}function Df(e,t){if(!wf&&Cf){wf=!0;do for(var n=!1,r=bf;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-tt(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,Mf(r,a))}else a=Y,a=lt(r,r===$u?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||ut(r,a)||(n=!0,Mf(r,a))}r=r.next}while(n);wf=!1}}function Of(){kf()}function kf(){Cf=Sf=!1;var e=0;Tf!==0&&gp()&&(e=Tf);for(var t=Ue(),n=null,r=bf;r!==null;){var i=r.next,a=Af(r,t);a===0?(r.next=null,n===null?bf=i:n.next=i,i===null&&(xf=n)):(n=r,(e!==0||a&3)&&(Cf=!0)),r=i}yd!==0&&yd!==5||Df(e,!1),Tf!==0&&(Tf=0)}function Af(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-tt(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=ft(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=$u,n=Y,n=lt(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(X===2||X===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&Be(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||ut(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&Be(r),xt(n)){case 2:case 8:n=Ke;break;case 32:n=qe;break;case 268435456:n=Ye;break;default:n=qe}return r=jf.bind(null,e),n=ze(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&Be(r),e.callbackPriority=2,e.callbackNode=null,2}function jf(e,t){if(yd!==0&&yd!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(df()&&e.callbackNode!==n)return null;var r=Y;return r=lt(e,e===$u?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(Fd(e,r,t),Af(e,Ue()),e.callbackNode!=null&&e.callbackNode===n?jf.bind(null,e):null)}function Mf(e,t){if(df())return null;Fd(e,t,!0)}function Nf(){xp(function(){q&6?ze(Ge,Of):kf()})}function Pf(){if(Tf===0){var e=Ba;e===0&&(e=at,at<<=1,!(at&261888)&&(at=256)),Tf=e}return Tf}function Ff(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:bn(e)}function If(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=Ff((i[Et]||null).action),o=r.submitter;o&&(t=(t=o[Et]||null)?Ff(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new Hn(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(Tf!==0){var e=new FormData(i,o);rc(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=new FormData(i,o),rc(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var Lf=0;Lf<hi.length;Lf++){var Rf=hi[Lf];gi(Rf.toLowerCase(),`on`+(Rf[0].toUpperCase()+Rf.slice(1)))}gi(si,`onAnimationEnd`),gi(ci,`onAnimationIteration`),gi(li,`onAnimationStart`),gi(`dblclick`,`onDoubleClick`),gi(`focusin`,`onFocus`),gi(`focusout`,`onBlur`),gi(ui,`onTransitionRun`),gi(di,`onTransitionStart`),gi(fi,`onTransitionCancel`),gi(pi,`onTransitionEnd`),Wt(`onMouseEnter`,[`mouseout`,`mouseover`]),Wt(`onMouseLeave`,[`mouseout`,`mouseover`]),Wt(`onPointerEnter`,[`pointerout`,`pointerover`]),Wt(`onPointerLeave`,[`pointerout`,`pointerover`]),Ut(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),Ut(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),Ut(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),Ut(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),Ut(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),Ut(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var zf=`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(` `),Bf=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(zf));function Vf(e,t){t=!!(t&4);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){xi(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){xi(e)}i.currentTarget=null,a=c}}}}function Q(e,t){var n=t[Ot];n===void 0&&(n=t[Ot]=new Set);var r=e+`__bubble`;n.has(r)||(Gf(t,e,2,!1),n.add(r))}function Hf(e,t,n){var r=0;t&&(r|=4),Gf(n,e,r,t)}var Uf=`_reactListening`+Math.random().toString(36).slice(2);function Wf(e){if(!e[Uf]){e[Uf]=!0,Vt.forEach(function(t){t!==`selectionchange`&&(Bf.has(t)||Hf(t,!1,e),Hf(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Uf]||(t[Uf]=!0,Hf(`selectionchange`,!1,t))}}function Gf(e,t,n,r){switch(Ch(t)){case 2:var i=_h;break;case 8:i=vh;break;default:i=yh}n=i.bind(null,t,n,e),i=void 0,!jn||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 Kf(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=Ft(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}On(function(){var r=a,i=Cn(n),s=[];a:{var c=mi.get(e);if(c!==void 0){var l=Hn,u=e;switch(e){case`keypress`:if(Ln(n)===0)break a;case`keydown`:case`keyup`:l=or;break;case`focusin`:u=`focus`,l=Zn;break;case`focusout`:u=`blur`,l=Zn;break;case`beforeblur`:case`afterblur`:l=Zn;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=Yn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=Xn;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=lr;break;case si:case ci:case li:l=Qn;break;case pi:l=ur;break;case`scroll`:case`scrollend`:l=Wn;break;case`wheel`:l=dr;break;case`copy`:case`cut`:case`paste`:l=$n;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=sr;break;case`submit`:l=cr;break;case`toggle`:case`beforetoggle`:l=fr}var d=!!(t&4),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=kn(m,p),g!=null&&d.push(qf(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(l=e===`mouseover`||e===`pointerover`,c=e===`mouseout`||e===`pointerout`,l&&n!==Sn&&(u=n.relatedTarget||n.fromElement)&&(Ft(u)||u[Dt]))break a;(c||l)&&(u=i.window===i?i:(l=i.ownerDocument)?l.defaultView||l.parentWindow:window,c?(l=n.relatedTarget||n.toElement,c=r,l=l?Ft(l):null,l!==null&&(f=o(l),d=l.tag,l!==f||d!==5&&d!==27&&d!==6)&&(l=null)):(c=null,l=r),c!==l&&(d=Yn,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=sr,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=c==null?u:Lt(c),h=l==null?u:Lt(l),u=new d(g,m+`leave`,c,n,i),u.target=f,u.relatedTarget=h,g=null,Ft(i)===r&&(d=new d(p,m+`enter`,l,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,d=c&&l?E(c,l,Yf):null,c!==null&&Xf(s,u,c,d,!1),l!==null&&f!==null&&Xf(s,f,l,d,!0)))}a:{if(c=r?Lt(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var _=Mr;else if(Er(c)){if(Nr)_=Hr;else{_=Br;var v=zr}}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&_n(r.elementType)&&(_=Mr):_=Vr;if(_&&=_(e,r)){Dr(s,_,n,i);break a}v&&v(e,c,r)}switch(v=r?Lt(r):window,e){case`focusin`:(Er(v)||v.contentEditable===`true`)&&(Qr=v,$r=r,ei=null);break;case`focusout`:ei=$r=Qr=null;break;case`mousedown`:ti=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:ti=!1,ni(s,n,i);break;case`selectionchange`:if(Zr)break;case`keydown`:case`keyup`:ni(s,n,i)}var y;if(mr)b:{switch(e){case`compositionstart`:var b=`onCompositionStart`;break b;case`compositionend`:b=`onCompositionEnd`;break b;case`compositionupdate`:b=`onCompositionUpdate`;break b}b=void 0}else Sr?br(e,n)&&(b=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(b=`onCompositionStart`);b&&(_r&&n.locale!==`ko`&&(Sr||b!==`onCompositionStart`?b===`onCompositionEnd`&&Sr&&(y=In()):(Nn=i,Pn=`value`in Nn?Nn.value:Nn.textContent,Sr=!0)),v=Jf(r,b),0<v.length&&(b=new er(b,e,null,n,i),s.push({event:b,listeners:v}),y?b.data=y:(y=xr(n),y!==null&&(b.data=y)))),(y=gr?Cr(e,n):wr(e,n))&&(b=Jf(r,`onBeforeInput`),0<b.length&&(v=new er(`onBeforeInput`,`beforeinput`,null,n,i),s.push({event:v,listeners:b}),v.data=y)),If(s,e,r,n,i)}Vf(s,t)})}function qf(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Jf(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=kn(e,n),i!=null&&r.unshift(qf(e,i,a)),i=kn(e,t),i!=null&&r.push(qf(e,i,a))),e.tag===3)return r;e=e.return}return[]}function Yf(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Xf(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=kn(n,a),l!=null&&o.unshift(qf(n,l,c))):i||(l=kn(n,a),l!=null&&o.push(qf(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var Zf=/\r\n?/g,Qf=/\u0000|\uFFFD/g;function $f(e){return(typeof e==`string`?e:``+e).replace(Zf,`
9
- `).replace(Qf,``)}function ep(e,t){return t=$f(t),$f(e)===t}function tp(e,t,n,r,a,o){switch(n){case`children`:if(typeof r==`string`)t===`body`||t===`textarea`&&r===``||pn(e,r);else if(typeof r==`number`||typeof r==`bigint`)t!==`body`&&pn(e,``+r);else return;break;case`className`:Zt(e,`class`,r);break;case`tabIndex`:Zt(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:Zt(e,n,r);break;case`style`:gn(e,r,o);return;case`data`:if(t!==`object`){Zt(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=bn(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}if(typeof o==`function`&&(n===`formAction`?(t!==`input`&&tp(e,t,`name`,a.name,a,null),tp(e,t,`formEncType`,a.formEncType,a,null),tp(e,t,`formMethod`,a.formMethod,a,null),tp(e,t,`formTarget`,a.formTarget,a,null)):(tp(e,t,`encType`,a.encType,a,null),tp(e,t,`method`,a.method,a,null),tp(e,t,`target`,a.target,a,null))),r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=bn(r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=xn);return;case`onScroll`:r!=null&&Q(`scroll`,e);return;case`onScrollEnd`:r!=null&&Q(`scrollend`,e);return;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));o?.__html!==n&&(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=bn(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`credentialless`: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`:Q(`beforetoggle`,e),Q(`toggle`,e),Xt(e,`popover`,r);break;case`xlinkActuate`:Qt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:Qt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:Qt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:Qt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:Qt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:Qt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:Qt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:Qt(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:Qt(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:Xt(e,`is`,r);break;case`innerText`:case`textContent`:return;default:if(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)n=vn.get(n)||n,Xt(e,n,r);else return}I=!0}function np(e,t,n,r,a,o){switch(n){case`style`:gn(e,r,o);return;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));o?.__html!==n&&(e.innerHTML=n)}}break;case`children`:if(typeof r==`string`)pn(e,r);else if(typeof r==`number`||typeof r==`bigint`)pn(e,``+r);else return;break;case`onScroll`:r!=null&&Q(`scroll`,e);return;case`onScrollEnd`:r!=null&&Q(`scrollend`,e);return;case`onClick`:r!=null&&(e.onclick=xn);return;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:return;case`innerText`:case`textContent`:return;default:if(!Ht.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(a=n.endsWith(`Capture`),o=n.slice(2,a?n.length-7:void 0),t=e[Et]||null,t=t==null?null:t[n],typeof t==`function`&&e.removeEventListener(o,t,a),typeof r==`function`)){typeof t!=`function`&&t!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(o,r,a);break a}I=!0,n in e?e[n]=r:!0===r?e.setAttribute(n,``):Xt(e,n,r)}return}I=!0}function rp(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:Q(`error`,e),Q(`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:tp(e,t,o,s,n,null)}}a&&tp(e,t,`srcSet`,n.srcSet,n,null),r&&tp(e,t,`src`,n.src,n,null);return;case`input`:Q(`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:tp(e,t,r,d,n,null)}}cn(e,o,c,l,u,s,a,!1);return;case`select`:for(a in Q(`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:tp(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&un(e,!!r,n,!0):un(e,!!r,t,!1);return;case`textarea`:for(s in Q(`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:tp(e,t,s,c,n,null)}fn(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:tp(e,t,l,r,n,null)}return;case`dialog`:Q(`beforetoggle`,e),Q(`toggle`,e),Q(`cancel`,e),Q(`close`,e);break;case`iframe`:case`object`:Q(`load`,e);break;case`video`:case`audio`:for(r=0;r<zf.length;r++)Q(zf[r],e);break;case`image`:Q(`error`,e),Q(`load`,e);break;case`details`:Q(`toggle`,e);break;case`embed`:case`source`:case`link`:Q(`error`,e),Q(`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:tp(e,t,u,r,n,null)}return;default:if(_n(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&np(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&tp(e,t,c,r,n,null))}var ip={};function ap(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)||tp(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`:m!==f&&(I=!0),o=m;break;case`name`:m!==f&&(I=!0),a=m;break;case`checked`:m!==f&&(I=!0),u=m;break;case`defaultChecked`:m!==f&&(I=!0),d=m;break;case`value`:m!==f&&(I=!0),s=m;break;case`defaultValue`:m!==f&&(I=!0),c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(i(137,t));break;default:m!==f&&tp(e,t,p,m,r,f)}}sn(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)||tp(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`:o!==l&&(I=!0),p=o;break;case`defaultValue`:o!==l&&(I=!0),c=o;break;case`multiple`:o!==l&&(I=!0),s=o;default:o!==l&&tp(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?un(e,!!n,n?[]:``,!1):un(e,!!n,t,!0)):un(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:tp(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`:a!==o&&(I=!0),p=a;break;case`defaultValue`:a!==o&&(I=!0),m=a;break;case`children`:break;case`dangerouslySetInnerHTML`:if(a!=null)throw Error(i(91));break;default:a!==o&&tp(e,t,s,a,r,o)}dn(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:tp(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`:p!==m&&(I=!0),e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:tp(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)&&tp(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:tp(e,t,u,p,r,m)}return;default:if(_n(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&np(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||np(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&tp(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||tp(e,t,f,p,r,m)}function op(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function sp(){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&&op(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&&op(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 cp=null,lp=null;function up(e){return e.nodeType===9?e:e.ownerDocument}function dp(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 fp(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 pp(e,t,n,r){return n=up(n).createElement(e),n[Tt]=r,n[Et]=t,rp(n,e,t),zt(n),n}function mp(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 hp=null;function gp(){var e=window.event;return e&&e.type===`popstate`?e!==hp&&(hp=e,!0):(hp=null,!1)}var _p=typeof setTimeout==`function`?setTimeout:void 0,vp=typeof clearTimeout==`function`?clearTimeout:void 0,yp=typeof Promise==`function`?Promise:void 0,bp=typeof requestAnimationFrame==`function`?requestAnimationFrame:_p,xp=typeof queueMicrotask==`function`?queueMicrotask:yp===void 0?_p:function(e){return yp.resolve(null).then(e).catch(Sp)};function Sp(e){setTimeout(function(){throw e})}function Cp(e){return e===`head`}function wp(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),Hh(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)vm(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,vm(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[Mt]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&vm(e.ownerDocument.body)}n=i}while(n);Hh(t)}function Tp(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 Ep(e,t,n){if(t=CSS.escape(t)===t?t:`r-`+btoa(t).replace(/=/g,``),e.style.viewTransitionName=t,n!=null&&(e.style.viewTransitionClass=n),n=getComputedStyle(e),n.display===`inline`){if(t=e.getClientRects(),t.length===1)var r=1;else for(var i=r=0;i<t.length;i++){var a=t[i];0<a.width&&0<a.height&&r++}r===1&&(e=e.style,e.display=t.length===1?`inline-block`:`block`,e.marginTop=`-`+n.paddingTop,e.marginBottom=`-`+n.paddingBottom)}}function Dp(e,t){e=e.style,t=t.style;var n=t==null?null:t.hasOwnProperty(`viewTransitionName`)?t.viewTransitionName:t.hasOwnProperty(`view-transition-name`)?t[`view-transition-name`]:null;e.viewTransitionName=n==null||typeof n==`boolean`?``:(``+n).trim(),n=t==null?null:t.hasOwnProperty(`viewTransitionClass`)?t.viewTransitionClass:t.hasOwnProperty(`view-transition-class`)?t[`view-transition-class`]:null,e.viewTransitionClass=n==null||typeof n==`boolean`?``:(``+n).trim(),e.display===`inline-block`&&(t==null?e.display=e.margin=``:(n=t.display,e.display=n==null||typeof n==`boolean`?``:n,n=t.margin,n==null?(n=t.hasOwnProperty(`marginTop`)?t.marginTop:t[`margin-top`],e.marginTop=n==null||typeof n==`boolean`?``:n,t=t.hasOwnProperty(`marginBottom`)?t.marginBottom:t[`margin-bottom`],e.marginBottom=t==null||typeof t==`boolean`?``:t):e.margin=n))}function Op(e,t,n){return n=n.ownerDocument.defaultView,{rect:e,abs:t.position===`absolute`||t.position===`fixed`,clip:t.clipPath!==`none`||t.overflow!==`visible`||t.filter!==`none`||t.mask!==`none`||t.mask!==`none`||t.borderRadius!==`0px`,view:0<=e.bottom&&0<=e.right&&e.top<=n.innerHeight&&e.left<=n.innerWidth}}function kp(e){return Op(e.getBoundingClientRect(),getComputedStyle(e),e)}function Ap(e){var t=e.getBoundingClientRect();t=new DOMRect(t.x+2e4,t.y+2e4,t.width,t.height);var n=getComputedStyle(e);return Op(t,n,e)}function jp(e){return e.documentElement.clientHeight}function Mp(e){this.addEventListener(`load`,e),this.addEventListener(`error`,e)}function Np(e,t,n,r,i,a,o,s,c){var l=t.nodeType===9?t:t.ownerDocument;try{var u=l.startViewTransition({update:function(){var t=l.defaultView,n=t.navigation&&t.navigation.transition,o=l.fonts.status;r();var s=[];if(o===`loaded`&&(jp(l),l.fonts.status===`loading`&&s.push(l.fonts.ready)),o=s.length,e!==null)for(var c=e.suspenseyImages,u=0,d=0;d<c.length;d++){var f=c[d];if(!f.complete){var p=f.getBoundingClientRect();if(0<p.bottom&&0<p.right&&p.top<t.innerHeight&&p.left<t.innerWidth){if(u+=Xm(f),u>$m){s.length=o;break}f=new Promise(Mp.bind(f)),s.push(f)}}}if(0<s.length)return t=Promise.race([Promise.all(s),new Promise(function(e){return setTimeout(e,500)})]).then(i,i),(n?Promise.allSettled([n.finished,t]):t).then(a,a);if(i(),n)return n.finished.then(a,a);a()},types:n});l.__reactViewTransition=u;var d=[];return u.ready.then(function(){for(var e=l.documentElement.getAnimations({subtree:!0}),t=0;t<e.length;t++){var n=e[t],r=n.effect,i=r.pseudoElement;if(i!=null&&i.startsWith(`::view-transition`)){d.push(n),n=r.getKeyframes();for(var a=i=void 0,s=!0,c=0;c<n.length;c++){var u=n[c],f=u.width;if(i===void 0)i=f;else if(i!==f){s=!1;break}if(f=u.height,a===void 0)a=f;else if(a!==f){s=!1;break}delete u.width,delete u.height,u.transform===`none`&&delete u.transform}s&&i!==void 0&&a!==void 0&&(r.setKeyframes(n),s=getComputedStyle(r.target,r.pseudoElement),s.width!==i||s.height!==a)&&(s=n[0],s.width=i,s.height=a,s=n[n.length-1],s.width=i,s.height=a,r.setKeyframes(n))}}o()},function(e){l.__reactViewTransition===u&&(l.__reactViewTransition=null);try{if(typeof e==`object`&&e)switch(e.name){case`InvalidStateError`:(e.message===`View transition was skipped because document visibility state is hidden.`||e.message===`Skipping view transition because document visibility state has become hidden.`||e.message===`Skipping view transition because viewport size changed.`||e.message===`Transition was aborted because of invalid state`)&&(e=null)}e!==null&&c(e)}finally{r(),i(),o()}}),u.finished.finally(function(){for(var e=0;e<d.length;e++)d[e].cancel();l.__reactViewTransition===u&&(l.__reactViewTransition=null),s()}),u}catch{return r(),i(),o(),null}}function Pp(e,t){this._scope=document.documentElement,this._selector=`::view-transition-`+e+`(`+t+`)`}Pp.prototype.animate=function(e,t){return t=typeof t==`number`?{duration:t}:D({},t),t.pseudoElement=this._selector,this._scope.animate(e,t)},Pp.prototype.getAnimations=function(){for(var e=this._scope,t=this._selector,n=e.getAnimations({subtree:!0}),r=[],i=0;i<n.length;i++){var a=n[i].effect;a!==null&&a.target===e&&a.pseudoElement===t&&r.push(n[i])}return r},Pp.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function Fp(e){return{name:e,group:new Pp(`group`,e),imagePair:new Pp(`image-pair`,e),old:new Pp(`old`,e),new:new Pp(`new`,e)}}function Ip(e){this._fragmentFiber=e,this._observers=this._eventListeners=null}Ip.prototype.addEventListener=function(e,t,n){var r=null,i=null;if(!(n!=null&&typeof n!=`boolean`&&(r=n.signal||null,r!==null&&r.aborted))){this._eventListeners===null&&(this._eventListeners=[]);var a=this._eventListeners;if(Vp(a,e,t,n)===-1){var o=this,s=t;n!=null&&typeof n!=`boolean`&&!0===n.once&&(s=function(r){o.removeEventListener(e,t,n),typeof t==`function`?t.call(this,r):t.handleEvent(r)}),r!==null&&(i=o.removeEventListener.bind(o,e,t,n),r.addEventListener(`abort`,i,{once:!0}),i=r.removeEventListener.bind(r,`abort`,i)),r=zp(n),a.push({type:e,listener:t,optionsOrUseCapture:n,attachedListener:s,cleanup:i}),h(this._fragmentFiber.child,!1,Lp,e,s,r)}this._eventListeners=a}};function Lp(e,t,n,r){return b(e).addEventListener(t,n,r),!1}Ip.prototype.removeEventListener=function(e,t,n){var r=this._eventListeners;if(r!==null&&(t=Vp(r,e,t,n),t!==-1)){var i=r[t];n=i.attachedListener;var a=i.cleanup;i=zp(i.optionsOrUseCapture),h(this._fragmentFiber.child,!1,Rp,e,n,i),r.splice(t,1),a!==null&&a()}};function Rp(e,t,n,r){return b(e).removeEventListener(t,n,r),!1}function zp(e){return e!=null&&typeof e!=`boolean`&&(!0===e.once||e.signal instanceof AbortSignal)?{capture:e.capture,passive:e.passive}:e}function Bp(e){return e==null?`c=0`:typeof e==`boolean`?`c=`+(e?`1`:`0`):`c=`+(e.capture?`1`:`0`)}function Vp(e,t,n,r){if(e.length===0)return-1;r=Bp(r);for(var i=0;i<e.length;i++){var a=e[i];if(a.type===t&&a.listener===n&&Bp(a.optionsOrUseCapture)===r)return i}return-1}Ip.prototype.dispatchEvent=function(e){var t=g(this._fragmentFiber);if(t===null)return!0;t=b(t);var n=this._eventListeners;if(n!==null&&0<n.length||!e.bubbles){var r=t.nodeType===9?t.createComment(``):document.createTextNode(``);if(n)for(var i=0;i<n.length;i++){var a=n[i];r.addEventListener(a.type,a.attachedListener,zp(a.optionsOrUseCapture))}if(t.appendChild(r),e=r.dispatchEvent(e),n)for(i=0;i<n.length;i++)a=n[i],r.removeEventListener(a.type,a.attachedListener,zp(a.optionsOrUseCapture));return t.removeChild(r),e}return t.dispatchEvent(e)},Ip.prototype.focus=function(e){h(this._fragmentFiber.child,!0,Hp,e,void 0,void 0)};function Hp(e,t){return e.tag!==6&&(e=b(e),mm(e,t))}Ip.prototype.focusLast=function(e){var t=[];h(this._fragmentFiber.child,!0,Up,t,void 0,void 0);for(var n=t.length-1;0<=n&&!Hp(t[n],e);n--);};function Up(e,t){return t.push(e),!1}Ip.prototype.blur=function(){var e=g(this._fragmentFiber);e!==null&&(e=b(e),e=up(e).activeElement,e!==null&&h(this._fragmentFiber.child,!1,Wp,e,void 0,void 0))};function Wp(e,t){return e.tag!==6&&(e=b(e),e===t||e.contains(t)?(t.blur(),!0):!1)}Ip.prototype.observeUsing=function(e){this._observers===null&&(this._observers=new Set),this._observers.add(e),h(this._fragmentFiber.child,!1,Gp,e,void 0,void 0)};function Gp(e,t){return e.tag!==6&&(e=b(e),t.observe(e),!1)}Ip.prototype.unobserveUsing=function(e){var t=this._observers;if(t!==null&&t.has(e)){t.delete(e),h(this._fragmentFiber.child,!1,Kp,e,void 0,void 0);for(var n=t=0;n<qp.length;n++){var r=qp[n];r.fragmentInstance===this&&r.observer===e?e.unobserve(r.instance):qp[t++]=r}qp.length=t}};function Kp(e,t){return e.tag!==6&&(e=b(e),t.unobserve(e),!1)}var qp=[],Jp=!1;function Yp(e,t,n){qp.push({fragmentInstance:e,observer:t,instance:n}),Jp||(Jp=!0,hm(function(){Jp=!1;var e=qp;qp=[];for(var t=0;t<e.length;t++){var n=e[t];n.observer.unobserve(n.instance)}}))}Ip.prototype.getClientRects=function(){var e=[];return h(this._fragmentFiber.child,!1,Xp,e,void 0,void 0),e};function Xp(e,t){if(e.tag===6){e=e.stateNode;var n=e.ownerDocument.createRange();n.selectNodeContents(e),t.push.apply(t,n.getClientRects())}else e=b(e),t.push.apply(t,e.getClientRects());return!1}Ip.prototype.getRootNode=function(e){var t=g(this._fragmentFiber);return t===null?this:b(t).getRootNode(e)},Ip.prototype.compareDocumentPosition=function(e){var t=g(this._fragmentFiber);if(t===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var n=[];h(this._fragmentFiber.child,!1,Up,n,void 0,void 0);var r=b(t);if(n.length===0){if(n=r,_(this._fragmentFiber)){a:{for(t=this._fragmentFiber.return;t!==null;){if(t.tag===4){t=t.stateNode.containerInfo;break a}if(t.tag===3||t.tag===5||t.tag===27)break;t=t.return}t=null}t!=null&&(n=t)}t=this._fragmentFiber;var i=r=n.compareDocumentPosition(e);return n===e?i=Node.DOCUMENT_POSITION_CONTAINS:r&Node.DOCUMENT_POSITION_CONTAINED_BY&&(n=v(t)[1],n===null?i=Node.DOCUMENT_POSITION_PRECEDING:(e=b(n).compareDocumentPosition(e),i=e===0||e&Node.DOCUMENT_POSITION_FOLLOWING?Node.DOCUMENT_POSITION_FOLLOWING:Node.DOCUMENT_POSITION_PRECEDING)),i|=Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC}t=b(n[0]),i=b(n[n.length-1]);var a=_(this._fragmentFiber)?t.parentElement:r;if(a==null)return Node.DOCUMENT_POSITION_DISCONNECTED;r=a.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY,a=a.compareDocumentPosition(i)&Node.DOCUMENT_POSITION_CONTAINED_BY;var o=t.compareDocumentPosition(e),s=i.compareDocumentPosition(e),c=o&Node.DOCUMENT_POSITION_CONTAINED_BY||s&Node.DOCUMENT_POSITION_CONTAINED_BY;return s=r&&a&&o&Node.DOCUMENT_POSITION_FOLLOWING&&s&Node.DOCUMENT_POSITION_PRECEDING,t=r&&t===e||a&&i===e||c||s?Node.DOCUMENT_POSITION_CONTAINED_BY:!r&&t===e||!a&&i===e?Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:o,t&Node.DOCUMENT_POSITION_DISCONNECTED||t&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC||Zp(t,this._fragmentFiber,n[0],n[n.length-1],e)?t:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function Zp(e,t,n,r,i){var a=Ft(i);if(e&Node.DOCUMENT_POSITION_CONTAINED_BY){if(n=!!a)a:{for(;a!==null;){if(a.tag===7&&(a===t||a.alternate===t)){n=!0;break a}a=a.return}n=!1}return n}if(e&Node.DOCUMENT_POSITION_CONTAINS){if(a===null)return a=i.ownerDocument,i===a||i===a.documentElement||i===a.body;a:{for(a=t,t=g(t);a!==null;){if(!(a.tag!==5&&a.tag!==3&&a.tag!==27||a!==t&&a.alternate!==t)){a=!0;break a}a=a.return}a=!1}return a}return e&Node.DOCUMENT_POSITION_PRECEDING?((t=!!a)&&!(t=a===n)&&(t=E(n,a,T),t===null?t=!1:(h(t,!0,C,a,n),a=x,x=null,t=a!==null)),t):e&Node.DOCUMENT_POSITION_FOLLOWING?((t=!!a)&&!(t=a===r)&&(t=E(r,a,T),t===null?t=!1:(h(t,!0,w,a,r),a=x,S=x=null,t=a!==null)),t):!1}function Qp(e,t){var n=e.ownerDocument.createRange();n.selectNodeContents(e),e=n.getBoundingClientRect(),window.scrollTo(window.scrollX+e.left,t?window.scrollY+e.top:window.scrollY+e.bottom-window.innerHeight)}Ip.prototype.scrollIntoView=function(e){if(typeof e==`object`)throw Error(i(566));var t=[];h(this._fragmentFiber.child,!1,Up,t,void 0,void 0);var n=!1!==e;if(t.length===0){var r=v(this._fragmentFiber);if(r=n?r[1]||r[0]||g(this._fragmentFiber):r[0]||r[1],r===null)return;if(r.tag===6){e=b(r),Qp(e,n);return}if(r=b(r),r.nodeType!==9){if(r.nodeType===11){n=`host`in r?r.host:null,n!==null&&n.scrollIntoView(e);return}r.scrollIntoView(e)}}for(r=n?t.length-1:0;r!==(n?-1:t.length);){var a=t[r];a.tag===6?(a=b(a),Qp(a,n)):b(a).scrollIntoView(e),r+=n?-1:1}};function $p(e,t){return e=b(e),em(e,t),!1}function em(e,t){e.reactFragments??=new Set,e.reactFragments.add(t)}function tm(e,t){var n=t._eventListeners;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];e.addEventListener(i.type,i.attachedListener,zp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){for(var r=0,i=0;i<qp.length;i++){var a=qp[i];(a.fragmentInstance!==t||a.observer!==n||a.instance!==e)&&(qp[r++]=a)}qp.length=r,n.observe(e)}),em(e,t))}function nm(e,t){var n=t._eventListeners;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];e.removeEventListener(i.type,i.attachedListener,zp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){typeof n.rootMargin==`string`?Yp(t,n,e):n.unobserve(e)}),e.reactFragments!=null&&e.reactFragments.delete(t))}function rm(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`:rm(n),Pt(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function im(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[Mt])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=um(e.nextSibling),e===null)break}return null}function am(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=um(e.nextSibling),e===null))return null;return e}function om(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=um(e.nextSibling),e===null))return null;return e}function sm(e){return e.data===`$?`||e.data===`$~`}function cm(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function lm(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 um(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 dm=null;function fm(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return um(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function pm(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 mm(e,t){function n(){r=!0}if(e.ownerDocument.activeElement===e)return!0;var r=!1;try{e.ownerDocument.addEventListener(`focus`,n,!0),(e.focus||HTMLElement.prototype.focus).call(e,t)}finally{e.ownerDocument.removeEventListener(`focus`,n,!0)}return r}function hm(e){bp(function(){bp(function(t){return e(t)})})}function gm(e,t,n){switch(t=up(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 _m(e,t,n){for(var r in n){var i=n[r];n.hasOwnProperty(r)&&i!=null&&tp(e,t,r,null,ip,i)}n.dangerouslySetInnerHTML!=null&&(e.textContent=``),e.onclick===xn&&(e.onclick=null),Pt(e)}function vm(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Pt(e)}var ym=new Map,bm=new Set;function xm(e){if(typeof e.getRootNode==`function`){var t=e.getRootNode();if(t.nodeType===9||t.nodeType===11)return t}return e.nodeType===9?e:e.ownerDocument}var Sm=F.d;F.d={f:Cm,r:wm,D:Dm,C:Om,L:km,m:Am,X:Mm,S:jm,M:Nm};function Cm(){var e=Sm.f(),t=zd();return e||t}function wm(e){var t=It(e);t!==null&&t.tag===5&&t.type===`form`?ac(t):Sm.r(e)}var Tm=typeof document>`u`?null:document;function Em(e,t,n){var r=Tm;if(r&&typeof t==`string`&&t){var i=on(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),bm.has(i)||(bm.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),rp(t,`link`,e),zt(t),r.head.appendChild(t)))}}function Dm(e){Sm.D(e),Em(`dns-prefetch`,e,null)}function Om(e,t){Sm.C(e,t),Em(`preconnect`,e,t)}function km(e,t,n){Sm.L(e,t,n);var r=Tm;if(r&&e&&t){var i=`link[rel="preload"][as="`+on(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+on(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+on(n.imageSizes)+`"]`)):i+=`[href="`+on(e)+`"]`;var a=i;switch(t){case`style`:a=Fm(e);break;case`script`:a=Rm(e)}if(!(ym.has(a)||(e=D({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),ym.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Im(a))||t===`script`&&r.querySelector(zm(a))))){var o=r.createElement(`link`);rp(o,`link`,e),t===`style`&&(o[Nt]=!0,o.onload=o.onerror=function(){Bt(o)}),zt(o),r.head.appendChild(o)}}}function Am(e,t){Sm.m(e,t);var n=Tm;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+on(r)+`"][href="`+on(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Rm(e)}if(!ym.has(a)&&(e=D({rel:`modulepreload`,href:e},t),ym.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(zm(a)))return}r=n.createElement(`link`),rp(r,`link`,e),zt(r),n.head.appendChild(r)}}}function jm(e,t,n){Sm.S(e,t,n);var r=Tm;if(r&&e){var i=Rt(r).hoistableStyles,a=Fm(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Im(a)))s.loading=5;else{e=D({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=ym.get(a))&&Hm(e,n);var c=o=r.createElement(`link`);zt(c),rp(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,Vm(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Mm(e,t){Sm.X(e,t);var n=Tm;if(n&&e){var r=Rt(n).hoistableScripts,i=Rm(e),a=r.get(i);a||(a=n.querySelector(zm(i)),a||(e=D({src:e,async:!0},t),(t=ym.get(i))&&Um(e,t),a=n.createElement(`script`),zt(a),rp(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Nm(e,t){Sm.M(e,t);var n=Tm;if(n&&e){var r=Rt(n).hoistableScripts,i=Rm(e),a=r.get(i);a||(a=n.querySelector(zm(i)),a||(e=D({src:e,async:!0,type:`module`},t),(t=ym.get(i))&&Um(e,t),a=n.createElement(`script`),zt(a),rp(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Pm(e,t,n,r){var a=(a=Te.current)?xm(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`?(n=Fm(n.href),t=Rt(a).hoistableStyles,r=t.get(n),r||(r={type:`style`,instance:null,count:0,state:null},t.set(n,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=Fm(n.href);var o=Rt(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(Im(e)))?o._p||(s.instance=o,s.state.loading=5):(o=ym.get(e),o||(o={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},ym.set(e,o)),Lm(a,e,o,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`?(n=Rm(n),t=Rt(a).hoistableScripts,r=t.get(n),r||(r={type:`script`,instance:null,count:0,state:null},t.set(n,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(i(444,e))}}function Fm(e){return`href="`+on(e)+`"`}function Im(e){return`link[rel="stylesheet"][`+e+`]`}function $(e){return D({},e,{"data-precedence":e.precedence,precedence:null})}function Lm(e,t,n,r){if(t=e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)){if(!0!==t[Nt]){r.loading=1;return}}else t=e.createElement(`link`),t[Nt]=!0,t.onload=t.onerror=Bt.bind(null,t),rp(t,`link`,n),zt(t),e.head.appendChild(t);r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2})}function Rm(e){return`[src="`+on(e)+`"]`}function zm(e){return`script[async]`+e}function Bm(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+on(n.href)+`"]`);if(r)return t.instance=r,zt(r),r;var a=D({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),zt(r),rp(r,`style`,a),Vm(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Fm(n.href);var o=e.querySelector(Im(a));if(o)return t.state.loading|=4,t.instance=o,zt(o),o;r=$(n),(a=ym.get(a))&&Hm(r,a),o=(e.ownerDocument||e).createElement(`link`),zt(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),rp(o,`link`,r),t.state.loading|=4,Vm(o,n.precedence,e),t.instance=o;case`script`:return o=Rm(n.src),(a=e.querySelector(zm(o)))?(t.instance=a,zt(a),a):(r=n,(a=ym.get(o))&&(r=D({},n),Um(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),zt(a),rp(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,Vm(r,n.precedence,e));return t.instance}function Vm(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 Hm(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function Um(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Wm=null;function Gm(e,t,n){if(Wm===null){var r=new Map,i=Wm=new Map;i.set(n,r)}else i=Wm,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[Mt]||a[Tt]||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 Km(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function qm(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 Jm(e,t){return e===`img`&&t.src!=null&&t.src!==``&&t.onLoad==null&&t.loading!==`lazy`}function Ym(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function Xm(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio==`number`?devicePixelRatio:1)*.25}function Zm(e,t){typeof t.decode==`function`&&(e.imgCount++,t.complete||(e.imgBytes+=Xm(t),e.suspenseyImages.push(t)),e=rh.bind(e),t.decode().then(e,e))}function Qm(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=Fm(r.href),a=t.querySelector(Im(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=nh.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,zt(a);return}a=t.ownerDocument||t,r=$(r),(i=ym.get(i))&&Hm(r,i),a=a.createElement(`link`),zt(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),rp(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=nh.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var $m=0;function eh(e,t){return e.stylesheets&&e.count===0&&ah(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&ah(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&$m===0&&($m=62500*sp());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&ah(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>$m?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function th(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)ah(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}}function nh(){this.count--,th(this)}function rh(){this.imgCount--,th(this)}var ih=null;function ah(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,ih=new Map,t.forEach(oh,e),ih=null,nh.call(e))}function oh(e,t){if(!(t.state.loading&4)){var n=ih.get(e);if(n)var r=n.get(null);else{n=new Map,ih.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=nh.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 sh={$$typeof:ne,Provider:null,Consumer:null,_currentValue:_e,_currentValue2:_e,_threadCount:0};function ch(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=mt(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=mt(0),this.hiddenUpdates=mt(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.transitionTypes=null,this.incompleteTransitions=new Map}function lh(e,t,n,r,i,a,o,s,c,l,u,d){return e=new ch(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=Ni(3,null,null,t),e.current=a,a.stateNode=e,t=Na(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},go(a),e}function uh(e){return e?(e=ji,e):ji}function dh(e,t,n,r,i,a){i=uh(i),r.context===null?r.context=i:r.pendingContext=i,r=vo(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=yo(e,r,t),n!==null&&(Pd(n,e,t),bo(n,e,t))}function fh(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function ph(e,t){fh(e,t),(e=e.alternate)&&fh(e,t)}function mh(e){if(e.tag===13||e.tag===31){var t=Oi(e,67108864);t!==null&&Pd(t,e,67108864),ph(e,67108864)}}function hh(e){if(e.tag===13||e.tag===31){var t=jd();t=bt(t);var n=Oi(e,t);n!==null&&Pd(n,e,t),ph(e,t)}}var gh=!0;function _h(e,t,n,r){var i=P.T;P.T=null;var a=F.p;try{F.p=2,yh(e,t,n,r)}finally{F.p=a,P.T=i}}function vh(e,t,n,r){var i=P.T;P.T=null;var a=F.p;try{F.p=8,yh(e,t,n,r)}finally{F.p=a,P.T=i}}function yh(e,t,n,r){if(gh){var i=bh(r);if(i===null)Kf(e,t,r,xh,n),Mh(e,r);else if(Ph(i,e,t,n,r))r.stopPropagation();else if(Mh(e,r),t&4&&-1<jh.indexOf(e)){for(;i!==null;){var a=It(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=ct(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-tt(o);s.entanglements[1]|=c,o&=~c}Ef(a),!(q&6)&&(gd=Ue()+500,Df(0,!1))}}break;case 31:case 13:s=Oi(a,2),s!==null&&Pd(s,a,2),zd(),ph(a,2)}if(a=bh(r),a===null&&Kf(e,t,r,xh,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else Kf(e,t,r,null,n)}}function bh(e){return e=Cn(e),Sh(e)}var xh=null;function Sh(e){if(xh=null,e=Ft(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 xh=e,null}function Ch(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`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`fullscreenerror`: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`resize`:case`scroll`:case`touchmove`:case`wheel`:case`mouseenter`:case`mouseleave`:case`pointerenter`:case`pointerleave`:return 8;case`message`:switch(We()){case Ge:return 2;case Ke:return 8;case qe:case Je:return 32;case Ye:return 268435456;default:return 32}default:return 32}}var wh=!1,Th=null,Eh=null,Dh=null,Oh=new Map,kh=new Map,Ah=[],jh=`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 Mh(e,t){switch(e){case`focusin`:case`focusout`:Th=null;break;case`dragenter`:case`dragleave`:Eh=null;break;case`mouseover`:case`mouseout`:Dh=null;break;case`pointerover`:case`pointerout`:Oh.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:kh.delete(t.pointerId)}}function Nh(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=It(t),t!==null&&mh(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Ph(e,t,n,r,i){switch(t){case`focusin`:return Th=Nh(Th,e,t,n,r,i),!0;case`dragenter`:return Eh=Nh(Eh,e,t,n,r,i),!0;case`mouseover`:return Dh=Nh(Dh,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return Oh.set(a,Nh(Oh.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,kh.set(a,Nh(kh.get(a)||null,e,t,n,r,i)),!0}return!1}function Fh(e){var t=Ft(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,Ct(e.priority,function(){hh(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,Ct(e.priority,function(){hh(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 Ih(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=bh(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Sn=r,n.target.dispatchEvent(r),Sn=null}else return t=It(n),t!==null&&mh(t),e.blockedOn=n,!1;t.shift()}return!0}function Lh(e,t,n){Ih(e)&&n.delete(t)}function Rh(){wh=!1,Th!==null&&Ih(Th)&&(Th=null),Eh!==null&&Ih(Eh)&&(Eh=null),Dh!==null&&Ih(Dh)&&(Dh=null),Oh.forEach(Lh),kh.forEach(Lh)}function zh(e,n){e.blockedOn===n&&(e.blockedOn=null,wh||(wh=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Rh)))}var Bh=null;function Vh(e){Bh!==e&&(Bh=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Bh===e&&(Bh=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(Sh(r||n)===null)continue;break}var a=It(n);a!==null&&(e.splice(t,3),t-=3,rc(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Hh(e){function t(t){return zh(t,e)}Th!==null&&zh(Th,e),Eh!==null&&zh(Eh,e),Dh!==null&&zh(Dh,e),Oh.forEach(t),kh.forEach(t);for(var n=0;n<Ah.length;n++){var r=Ah[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Ah.length&&(n=Ah[0],n.blockedOn===null);)Fh(n),n.blockedOn===null&&Ah.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[Et]||null;if(typeof a==`function`)o||Vh(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[Et]||null)s=o.formAction;else if(Sh(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Vh(n)}}}function Uh(){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 Wh(e){this._internalRoot=e}Gh.prototype.render=Wh.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;dh(n,jd(),e,t,null,null)},Gh.prototype.unmount=Wh.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;dh(e.current,2,null,e,null,null),zd(),t[Dt]=null}};function Gh(e){this._internalRoot=e}Gh.prototype.unstable_scheduleHydration=function(e){if(e){var t=St();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Ah.length&&t!==0&&t<Ah[n].priority;n++);Ah.splice(n,0,e),n===0&&Fh(e)}};var Kh=n.version;if(Kh!==`19.3.0`)throw Error(i(527,Kh,`19.3.0`));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 qh={bundleType:0,version:`19.3.0`,rendererPackageName:`react-dom`,currentDispatcherRef:P,reconcilerVersion:`19.3.0`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var Jh=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Jh.isDisabled&&Jh.supportsFiber)try{Qe=Jh.inject(qh),$e=Jh}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=Ec,s=Dc,c=Oc;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=lh(e,1,!1,null,null,n,r,null,o,s,c,Uh),e[Dt]=t.current,Wf(e),new Wh(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()})),_=c(u(),1),v=g();function y(e){let t=`${e.url??(typeof location<`u`?`ws://${location.host}/ws`:`ws://127.0.0.1:4789/ws`)}?token=${encodeURIComponent(e.token)}`,n=new Set,r=new Set,i=new Map,a=[],o=null,s={state:`connecting`},c=1,l=500,u=!1;function d(e){s=e;for(let t of r)t(e)}function f(){d({state:`connecting`});let r=new WebSocket(t);o=r,r.onopen=()=>{for(u=!0,l=500,d({state:`open`});a.length>0;)r.send(a.shift())},r.onmessage=e=>{let t;try{t=JSON.parse(String(e.data))}catch{return}if(t.event){for(let e of n)e(t.event);return}if(typeof t.id==`number`){let e=i.get(t.id);if(!e)return;i.delete(t.id),t.ok?e.resolve(t.result):e.reject(Error(t.error??`The request failed.`))}},r.onclose=()=>{o=null;for(let[,e]of i)e.reject(Error(`Lost the connection to the coding sessions host.`));i.clear(),d({state:`closed`,reason:u?`Lost the connection to the coding sessions host. Reconnecting…`:`Can't reach the coding sessions host. It may have stopped, or this link's access token is out of date.`});let t=e.maxBackoffMs??8e3;setTimeout(f,l),l=Math.min(t,l*2)}}return f(),{call(e,...t){let n=c++,r=JSON.stringify({id:n,method:e,args:t}),s=new Promise((e,t)=>{i.set(n,{resolve:e,reject:t})});return o&&o.readyState===WebSocket.OPEN?o.send(r):a.push(r),s},subscribe(e){return n.add(e),()=>{n.delete(e)}},status(){return s},onStatus(e){return r.add(e),()=>{r.delete(e)}}}}var b=0;function x(e){let t=globalThis.crypto;return typeof t?.randomUUID==`function`?`${e}_${t.randomUUID()}`:(b+=1,`${e}_${Date.now().toString(36)}_${b.toString(36)}_${Math.random().toString(36).slice(2,10)}`)}function S(e){return{id:e.id??x(`msg`),role:e.role,parts:e.parts??[],status:e.status??`complete`,metadata:{requestId:e.metadata?.requestId??null,serverMessageId:e.metadata?.serverMessageId??null,modelRef:e.metadata?.modelRef??null,createdAt:e.metadata?.createdAt??new Date().toISOString(),raw:e.metadata?.raw??null}}}function C(e){let t=``;for(let n of e.parts)n.type===`text`&&(t+=n.text);return t}var w=Object.freeze({sendKey:`enter`,density:`comfortable`,showReasoningByDefault:!1,expandToolCardsByDefault:!1,autoScroll:!0,readAloudAutoPlay:!1,retainDrafts:!0,sendWhileBusy:!1,hideArchivedConversations:!0,messageActions:!0,attachmentMaxBytes:26214400,reasoningSentinel:`split`,routing:`any`});function T(e={}){return{...w,...E(e.organization),...E(e.surface),...E(e.user)}}function E(e){if(!e)return{};let t={};for(let[n,r]of Object.entries(e))r!==void 0&&(t[n]=r);return t}function D(){return{notify(e){let t=e.remedy?`[ai-matrx/chat] ${e.message} — ${e.remedy}`:`[ai-matrx/chat] ${e.message}`;e.level===`error`?console.error(t):e.level===`warning`?console.warn(t):console.info(t)}}}function O(e=D()){let t=new Map,n=!1,r=()=>{n||(n=!0,e.notify({level:`warning`,message:`Chat preferences and drafts are being kept in memory only, so they will be lost when this page reloads.`,remedy:"Give the chat a `prefs` port backed by localStorage (or your own store) to keep drafts across reloads."}))};return{get:e=>t.get(e)??null,set:(e,n)=>{r(),t.set(e,n)},remove:e=>{t.delete(e)}}}function k(e=D()){let t=O(e),n=null;try{if(n=globalThis.localStorage??null,n){let e=`__ai_matrx_chat_probe__`;n.setItem(e,`1`),n.removeItem(e)}}catch{n=null}if(!n)return t;let r=n;return{get:e=>{try{let t=r.getItem(e);if(t!==null)return t}catch{}return t.get(e)},set:(e,n)=>{try{r.setItem(e,n)}catch{t.set(e,n)}},remove:e=>{try{r.removeItem(e)}catch{}t.remove(e)}}}var ee=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})),A=o(((e,t)=>{t.exports=ee()}))(),j=(0,_.createContext)(null),M={};function te(){return(0,_.useContext)(j)??M}var ne=(0,_.createContext)(null);function N(){return(0,_.useContext)(ne)}function re(){let e=N();if(!e)throw Error(`[content-ir-react] No ContentIrRenderProvider above this component. Mount one at the app root with your host adapter (kind definitions, component resolver, renderBlock, renderValue, reportError).`);return e}var ie=`__ir`,ae=`__kind`,oe=2166136261,se=16777619;function ce(e,t){let n=e>>>0;for(let e=0;e<t.length;e++)n^=t.charCodeAt(e),n=n+((n<<1)+(n<<4)+(n<<7)+(n<<8)+(n<<24))>>>0;return n>>>0}function le(){let e=oe,t=se,n=0;return{push(r){e=ce(e,r),t=ce(t,r),n+=r.length},current(){return`${n.toString(36)}-${e.toString(36)}${t.toString(36)}`}}}function ue(e){let t=le();return t.push(e),t.current()}function de(e,t,n){return{v:1,engine:`fe-kind-parser`,fingerprint:ue(JSON.stringify(e)),root:{role:`structured`,kind:t,kindState:`resolved`,discriminator:n?.discriminator??{format:`json`,key:`__kind`},path:[],status:`complete`,value:e,residue:null}}}var fe=`directive_v`;`${fe}`;var pe=[`reference`,`view`,`create`,`update`,`delete`,`action`,`validation`,`secret`],me={reference:`pure`,view:`pure`,validation:`pure`,secret:`sensitive`,create:`side_effect`,update:`side_effect`,delete:`side_effect`,action:`side_effect`},he=new Set(pe.filter(e=>me[e]===`side_effect`)),ge=new Set([`reference`,`secret`]);function P(e){return typeof e==`string`&&Object.prototype.hasOwnProperty.call(me,e)}function F(e){return typeof e==`string`&&e.startsWith(`directive_v`)}function _e(e){return/^[a-z][a-z0-9_]*$/.test(e)}function ve(e,t,n=1){if(!P(e))throw Error(`unknown directive class ${JSON.stringify(e)}; the vocabulary is CLOSED: ${pe.join(`, `)}.`);if(typeof t!=`string`||!_e(t))throw Error(`invalid directive noun ${JSON.stringify(t)} for class ${JSON.stringify(e)}: a noun is lowercase [a-z0-9_], starts with a letter, and is non-empty.`);return`${fe}${n}_${e}_${t}`}function ye(e){if(!F(e))return null;let t=e.slice(11),n=t.indexOf(`_`);if(n<=0)return null;let r=t.slice(0,n);if(!/^[0-9]+$/.test(r))return null;let i=t.slice(n+1),a=i.indexOf(`_`);if(a<=0)return null;let o=i.slice(0,a),s=i.slice(a+1);return!P(o)||!_e(s)?null:{slug:e,version:Number.parseInt(r,10),directiveClass:o,noun:s,capability:me[o],executes:be(o),inContent:xe(o)}}function be(e){return P(e)&&he.has(e)}function xe(e){return P(e)&&ge.has(e)}function Se(e){let t=e.trimStart().match(/^\{\s*"__kind"\s*:\s*"([^"]*)/);return!!t&&F(t[1])}var Ce=`matrx_version`,we={reference:`reference`,secret:`secret`,validation:`validation`},Te=new Set([`output_directive`,`function`]),Ee=/^(create|update|delete):([a-z][a-z0-9_]*)$/,De=Symbol.for(`ai-matrx.content-ir.legacy-shell-uses`),Oe=globalThis[De]??={count:0};function ke(e){if(typeof e!=`object`||!e||Array.isArray(e))return!1;let t=e;if(!(Ce in t))return!1;let n=t.kind;return typeof n==`string`&&(n in we||Te.has(n))}function Ae(e,t){let n,r;if(Te.has(e)){let e=Ee.exec(t);e?(n=e[1],r=e[2]):(n=`action`,r=t)}else{let i=we[e];if(!i)return null;n=i,r=t}try{return ve(n,r)}catch{return null}}function je(e){let t=e.kind,n=e.type;if(typeof t!=`string`||typeof n!=`string`)return null;let r=Ae(t,n);if(r===null)return null;let i=e.items;return Oe.count+=1,{[ae]:r,items:Array.isArray(i)?[...i]:[]}}var Me=class extends Error{constructor(e){super(e),this.name=`DirectiveDecodeError`}};function Ne(e){return typeof e!=`object`||!e||Array.isArray(e)?null:e}function Pe(e){let t=Ne(e);if(t===null)return null;let n=!1;if(ke(t)){let e=je(t);if(e===null)throw new Me(`a retired 4-key shell with kind=${JSON.stringify(t.kind)} type=${JSON.stringify(t.type)} does not map onto the Kind Directives grammar. Emit the current shell: {"${ae}": "directive_v1_<class>_<noun>", "items": [...]}.`);t=e,n=!0}let r=t[ae];if(!F(r))return null;let i=ye(r);if(i===null)throw new Me(`malformed directive slug ${JSON.stringify(r)} — it claims the reserved "directive_v" namespace but does not parse as directive_v<version>_<class>_<noun>.`);let a=t.items,o=Array.isArray(a)?a.filter(e=>Ne(e)!==null):[];return{parsed:i,slug:i.slug,directiveClass:i.directiveClass,noun:i.noun,items:o,shell:{[ae]:i.slug,items:o},legacyShell:n}}function Fe(e,t){try{return Pe(e)}catch(e){return t?.(e instanceof Error?e.message:`directive decode failed`),null}}function Ie(e,t){if(typeof e!=`string`)return Fe(e,t);let n;try{n=JSON.parse(e)}catch{return null}return Fe(n,t)}function Le(e){let t=e.replace(/_/g,` `).trim();return t?t.charAt(0).toUpperCase()+t.slice(1):e}var Re={reference:`Reference`,view:`View`,create:`Create`,update:`Update`,delete:`Delete`,action:`Run`,validation:`Validate`,secret:`Secret`};function ze(e,t){let n=t?.(e)?.label;return n&&n.length>0?n:Le(e)}function Be(e,t){return t?.(e)?.family??``}function Ve(e,t){return t?.(e)?.titleColumn??null}function He(e,t,n){let r=ze(t,n),i=Re[e];return{noun:r,family:Be(t,n),action:i,title:`${i} ${r}`}}var Ue=[`name`,`title`,`label`,`heading`,`slug`,`key`,`question`,`summary`],We=new Set([`__kind`,...Ue,`id`,`description`,`about`,`notes`,`content`,`text`,`body`,`organization_id`,`user_id`,`created_by`,`resource_type`]);function Ge(e,t){for(let n of t){let t=e[n];if(typeof t==`string`&&t.trim())return t.trim()}return null}function Ke(e,t,n,r){return((t?Ge(e,[t]):null)??Ge(e,Ue))||(r>1?`Item ${n+1} of ${r}`:`Item`)}function qe(e){return Ge(e,[`description`,`about`,`summary`,`doc`])}var Je=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,Ye={variable_definitions:`variables`,context_policies:`context`,custom_tools:`custom tools`};function Xe(e){return Ye[e]??e.replace(/_/g,` `)}function Ze(e,t=4){let n=[];for(let[r,i]of Object.entries(e)){if(n.length>=t)break;if(!We.has(r)){if(Array.isArray(i)){if(i.length===0)continue;n.push({key:r,label:Xe(r),value:String(i.length)});continue}if(typeof i==`string`){let e=i.trim();if(!e||e.length>40||Je.test(e))continue;n.push({key:r,label:Xe(r),value:e});continue}(typeof i==`number`||typeof i==`boolean`)&&n.push({key:r,label:Xe(r),value:String(i)})}}return n}function Qe(e,t){let n=e[ae],r=typeof n==`string`&&n?n:t;return r?{[ae]:r,...e}:null}var $e=new Set([`markdown`,`md`,`mdx`]);function et(e){return!!e&&$e.has(e.toLowerCase())}function tt(e){return e!==void 0&&e!==``&&`
10
- \r\f\v`.includes(e)}function nt(e){let t=0,n=e.length;for(;t<n&&tt(e[t]);)t++;for(;n>t&&tt(e[n-1]);)n--;return t===0&&n===e.length?e:e.slice(t,n)}function rt(e){return e!==void 0&&e!==``&&`
11
- \v\f\r \xA0            \u2028\u2029   `.includes(e)}function it(e){let t=0,n=e.length;for(;t<n&&rt(e[t]);)t++;for(;n>t&&rt(e[n-1]);)n--;let r=0;for(;t+r<n&&e[t+r]==="`";)r++;if(r<3||e.slice(t+r,n).includes("`"))return null;let i=t+r;for(;i<n&&rt(e[i]);)i++;let a=i;for(;a<n&&!rt(e[a]);)a++;return{ticks:r,lang:e.slice(i,a)}}function at(e,t,n,r){let i=0;for(;i<e.length&&e[i]==="`";)i++;if(i<3)return`content`;let a=nt(e.slice(i));return a===``?i<t?`content`:n&&r>0?`close-nested`:`close-outer`:n&&i>=t&&!a.includes("`")?`open-nested`:`content`}function ot(e){let t=e.trimStart();if(t.startsWith("```")){let e=it(t);return e?{char:"`",ticks:e.ticks,lang:e.lang}:null}if(e.length-t.length<=3&&t.startsWith(`~~~`)){let e=/^(~{3,})(.*)$/.exec(t);return e?{char:`~`,ticks:e[1].length,lang:e[2].trim().split(/\s/)[0]??``}:null}return null}function st(e){return ot(e)!==null}var ct=class{opener;state={inString:!1,escaped:!1};depth=0;sawNested=!1;isJson;nesting;tildeCloser;constructor(e,t={}){this.opener=e,this.isJson=e.char==="`"&&e.lang===`json`,this.nesting=e.char==="`"&&(t.nesting??et(e.lang)),this.tildeCloser=e.char===`~`?RegExp(`^ {0,3}~{${e.ticks},}[ \\t]*$`):null}get nestedDepth(){return this.depth}feed(e){if(this.tildeCloser)return this.tildeCloser.test(e);let t=nt(e),n=e.indexOf("```");if(n===-1)return this.isJson&&(this.state=dt(e,0,e.length,this.state)),!1;if(this.isJson){let t=dt(e,0,n,this.state);if(t.inString)return this.state=dt(e,n,e.length,t),!1}if(t.startsWith("```")){let e=at(t,this.opener.ticks,this.nesting,this.depth);if(e===`close-outer`)return!0;e===`open-nested`&&(this.depth++,this.sawNested=!0),e===`close-nested`&&this.depth--}else{let t=ft(e,n),r=nt(e.slice(n+t));if(t>=this.opener.ticks&&r===``&&this.depth===0)return!0}return this.isJson&&(this.state=dt(e,0,e.length,this.state)),!1}};function lt(e,t,n){let r=ut(e,t,new ct(n));if(r.closed||!r.reader.sawNested||r.reader.nestedDepth<=0)return{line:r.line,closed:r.closed};if(e.streaming)return{line:r.line,closed:!1};let i=ut(e,t,new ct(n,{nesting:!1}));return{line:i.line,closed:i.closed}}function ut(e,t,n){for(let r=t+1;r<e.count;r++){if(e.openTail?.(r))continue;let t=e.line(r);if(t===null)return{line:r-1,closed:!1,reader:n};if(n.feed(t))return{line:r,closed:!0,reader:n}}return{line:e.count-1,closed:!1,reader:n}}function dt(e,t,n,r){let{inString:i,escaped:a}=r;for(let r=t;r<n;r++){let t=e[r];if(a){a=!1;continue}if(t===`\\`&&i){a=!0;continue}t===`"`&&(i=!i)}return{inString:i,escaped:a}}function ft(e,t){let n=0;for(;t+n<e.length&&e[t+n]==="`";)n++;return n}function pt(e){let t=0,n=0;for(;;){let r=/^ {0,3}> ?/.exec(e.slice(n));if(!r)return{depth:t,offset:n};t++,n+=r[0].length}}function mt(e,t){let n=0;for(let r=0;r<t;r++){let t=/^ {0,3}> ?/.exec(e.slice(n));if(!t)return null;n+=t[0].length}return e.slice(n)}var ht=/^( *)([-*+]|\d{1,9}[.)])( +|\t|$)/;function gt(e){let t=0;for(;t<e.length&&e[t]===` `;)t++;return t}function _t(e){let t=[],n=[];for(let r=0;;){let i=e.indexOf(`
12
- `,r),a=i===-1?e.length:i;if(t.push(r),n.push(a>r&&e.charCodeAt(a-1)===13?a-1:a),i===-1)break;r=i+1}let r=t.length,i=r=>e.slice(t[r],n[r]),a={ranges:[],fences:[],paragraphs:[],endsInFence:!1,pendingPara:-1},o={count:r,line:i},s=0;for(let c=0;c<r;c++){let l=ot(i(c));if(!l||l.char!=="`")continue;vt(e,t,n,i,s,c,a);let u=lt(o,c,l);a.ranges.push({start:t[c],end:n[u.line],kind:`fence`}),a.fences.push([c,u.line,u.closed]),a.pendingPara=-1,!u.closed&&u.line===r-1&&(a.endsInFence=!0),c=u.line,s=c+1}return vt(e,t,n,i,s,r,a),a}function vt(e,t,n,r,i,a,o){let s=-1,c=0,l=[],u=e=>{s!==-1&&o.paragraphs.push([s,e]),s=-1};for(let e=i;e<a;e++){let i=r(e),{depth:d,offset:f}=pt(i);d!==c&&(c=d,l=[]);let p=i.slice(f);if(p.trim()===``){u(t[e]),(e!==t.length-1||i!==``)&&(o.pendingPara=-1);continue}let m=gt(p);for(;l.length&&m<l[l.length-1];)l.pop();let h=ht.exec(p),g=l.length?l[l.length-1]:0;if(h){let e=h[3].length;g=h[1].length+h[2].length+(e>=1&&e<=4?e:1),l.push(g),p=p.slice(Math.min(g,p.length))}else p=p.slice(Math.min(m,g));let _=ot(p);if(!_){s===-1&&(s=t[e]),o.pendingPara===-1&&(o.pendingPara=t[e]);continue}u(t[e]),o.pendingPara=-1;let v=g,y=lt({count:a,line:e=>{let t=mt(r(e),d);if(t===null)return null;if(_.char===`~`&&v>0){let e=gt(t);return t.trim()!==``&&e<v?null:t.slice(Math.min(e,v))}return t}},e,_);o.ranges.push({start:t[e],end:n[y.line],kind:`fence`}),o.fences.push([e,y.line,y.closed]),!y.closed&&y.line===t.length-1&&(o.endsInFence=!0),e=y.line}u(a<t.length?t[a]:e.length)}var yt=class{all=[];byLength=new Map;indexOf=new Map;constructor(e,t,n){for(let r=t;r<n;){if(e.charCodeAt(r)!==96){r++;continue}let t=1;for(;r+t<n&&e.charCodeAt(r+t)===96;)t++;this.indexOf.set(r,this.all.length),this.all.push([r,t]);let i=this.byLength.get(t);i?i.push(r):this.byLength.set(t,[r]),r+=t}}next(e,t){let n=this.byLength.get(e);if(!n)return-1;let r=0,i=n.length;for(;r<i;){let e=r+i>>>1;n[e]<t?r=e+1:i=e}return n[r]??-1}index(e){return this.indexOf.get(e)??-1}};function bt(e,t,n,r){let i=null;for(let a=t;a<n;){let o=e.charCodeAt(a);if(o===92){a+=2;continue}if(o!==96){a++;continue}let s=ft(e,a),c=Math.min(s,n-a);i??=new yt(e,t,n);let l=i.next(c,a+c);if(l===-1){a+=c;continue}r.push({start:a,end:l+c,kind:`span`}),a=l+c}}function xt(e){let t=_t(e),n=[...t.ranges];for(let[r,i]of t.paragraphs)bt(e,r,i,n);return n.sort((e,t)=>e.start-t.start)}function St(e){let t=[],n=0;for(let r=0;r<e.length;r+=1){let i=e[r];if(i===`\\`){r+=1;continue}i===`|`&&(t.push(e.slice(n,r)),n=r+1)}return t.push(e.slice(n)),t}function Ct(e){let t=St(e).map(e=>e.trim());return t.length>1&&t[0]===``&&t.shift(),(t.length>1&&t[t.length-1]===``||t.length===1&&t[0]===``&&!e.includes(`|`))&&t.pop(),t}function wt(e){return e.replace(/\\\|/g,`|`)}var Tt=/^(?:[-+*](?:\s|$)|\d{1,9}[.)](?:\s|$)|>|#{1,6}(?:\s|$)|(?:-\s*){3,}$|(?:\*\s*){3,}$|(?:_\s*){3,}$|\[\^[^\]\s]+\]:)/,Et=e=>Tt.test(e)||st(e)||Pt(e),Dt=/^<(?:script|pre|style|textarea)(?:[\s>]|$)/i,Ot=/^(?:<!--|<\?|<![A-Za-z]|<!\[CDATA\[)/,kt=`address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul`,At=RegExp(`^</?(?:${kt})(?:[\\s>]|/>|$)`,`i`),jt=RegExp(`^(?:<[A-Za-z][A-Za-z0-9-]*(?:\\s+[A-Za-z_:][A-Za-z0-9_.:-]*(?:\\s*=\\s*(?:[^\\s"'=<>\`]+|'[^']*'|"[^"]*"))?)*\\s*/?>|</[A-Za-z][A-Za-z0-9-]*\\s*>)\\s*$`),Mt=RegExp(`^</?(?:address|article|aside|base|basefont|body|center|dialog|dir|fieldset|footer|form|frame|frameset|head|header|html|iframe|legend|link|main|menu|menuitem|nav|noframes|optgroup|option|param|search|title|track)(?:[\\s>]|/>|$)`,`i`);function Nt(e){return Mt.test(e)}[...kt.replace(`h[1-6]`,`h1|h2|h3|h4|h5|h6`).split(`|`)];function Pt(e){return e.startsWith(`<`)?Dt.test(e)||Ot.test(e)||At.test(e)||jt.test(e):!1}function Ft(e){let t=0;for(let n of e)if(n===` `)t+=1;else if(n===` `)t+=4-t%4;else break;return t}var It=/^([ \t]*)([-+*]|\d{1,9}[.)])([ \t]+|$)/;function Lt(e){let t=Ft(e[1]??``)+(e[2]??``).length,n=e[3]?Ft(` `.repeat(t)+e[3])-t:1;return t+(n>=1&&n<=4?n:1)}function Rt(e,t){return zt(e,t,!1)}function zt(e,t,n){let r=n?It.exec(e[t]??``):null;if(r)return Lt(r);let i=Ft(e[t]??``);if(i===0)return 0;for(let n=t-1;n>=0;--n){let t=e[n]??``;if(!t.trim())continue;let r=Ft(t),a=It.exec(t);if(a&&r<i){let e=Lt(a);if(e<=i)return e;continue}if(r===0)return 0}return 0}var Bt=/^:?-+:?$/;function Vt(e){let t=e.trim();if(!t.includes(`|`))return!1;let n=Ct(t);return n.length>0&&n.every(e=>Bt.test(e))}function Ht(e){let t=e.trim();return t.startsWith(`|`)&&t.includes(`|`,1)}function Ut(e){return e===void 0||!Vt(e)?!1:!Tt.test(e.trim())}function Wt(e,t){let n=e.trim();return!n||Ht(n)||!n.startsWith(`|`)&&Et(n)||!Ut(t)?!1:Ct(n).length===Ct(t.trim()).length}function Gt(e,t=0){let n=e.trim();return!n||Ft(e)-t>=4?!1:n.startsWith(`|`)||!Et(n)}function Kt(e,t){let n=e[t]??``;return!Ht(n)&&!Wt(n,e[t+1])?!1:!Zt(e,t)&&!Xt(e,t)}var qt=/^ {0,3}>/,Jt=/^(?:(?:-[ \t]*){3,}|(?:\*[ \t]*){3,}|(?:_[ \t]*){3,})$/,I=e=>/^#{1,6}(?:\s|$)/.test(e)||Jt.test(e)||st(e)||Pt(e);function Yt(e){if(Dt.test(e))return/<\/(?:script|pre|style|textarea)>/i;if(e.startsWith(`<!--`))return/-->/;if(e.startsWith(`<?`))return/\?>/;if(e.startsWith(`<![CDATA[`))return/\]\]>/;if(/^<![A-Za-z]/.test(e))return/>/;if(At.test(e)||jt.test(e))return null}function Xt(e,t){let n=t;for(;n>0&&(e[n-1]??``).trim();)--n;let r,i=!1;for(let a=n;a<t;a+=1){let t=e[a]??``;if(r!==void 0){r&&r.test(t)&&(r=void 0);continue}let n=t.trim(),o=Ft(t)<4?Yt(n):void 0,s=o===null&&!At.test(n);if(o===void 0||i&&s){i=!0;continue}i=!1,!Nt(n)&&(r=o&&o.test(n.slice(2))?void 0:o)}return r!==void 0}function Zt(e,t){let n=e[t]??``,r=-1;for(let n=t-1;n>=0;--n){let t=e[n]??``,i=t.trim();if(!i||I(i))break;let a=It.exec(t);if(a){let e=t.slice(a[0].length).trim();if(!e||I(e))break;r=n;break}if(r=n,qt.test(t))break}if(r<0)return!1;let i=e[r]??``;return qt.test(i)?!qt.test(n):Ft(n)<zt(e,r,!0)}function Qt(e,t){let n=e[t]??``,r=e[t+1];return!Kt(e,t)||!Ut(r)||Ct(n).length!==Ct(r).length?!1:Ft(n)-Rt(e,t)<4}function $t(e,t){let n=Rt(e,t),r=Math.min(e.length,t+2);for(;r<e.length&&Gt(e[r]??``,n);)r+=1;return r}var en=`generic_structured`,tn=Symbol.for(`ai-matrx.content-ir-react.sourceless-db-row-reports`);globalThis[tn]??=new Set;var nn=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function rn(e){return typeof e==`string`&&nn.test(e)}var an=new Set([`update`,`delete`]),on=new Set([`__kind`,`id`]);function sn(e){let t=e.id;return typeof t==`string`&&t.trim()?t.trim():typeof t==`number`?String(t):null}function cn(e){let t=e.replace(/_/g,` `).trim();return t.charAt(0).toUpperCase()+t.slice(1)}function ln(e,t){return`${e} ${rn(t)?t.slice(0,8):t.length>12?`${t.slice(0,12)}…`:t}`}function un(e){if(e==null)return{value:`cleared`,full:`cleared`,clears:!0};if(typeof e==`string`){let t=e.trim();if(!t)return{value:`cleared`,full:`cleared`,clears:!0};let n=t.replace(/\s+/g,` `);return{value:n.length>60?`${n.slice(0,59)}…`:n,full:t,clears:!1}}if(typeof e==`number`||typeof e==`boolean`)return{value:String(e),full:String(e),clears:!1};if(Array.isArray(e)){let t=e.length;return{value:t===0?`cleared`:`${t} ${t===1?`entry`:`entries`}`,full:dn(e),clears:t===0}}let t=Object.keys(e).length;return{value:t===0?`cleared`:`${t} ${t===1?`field`:`fields`}`,full:dn(e),clears:t===0}}function dn(e){try{return JSON.stringify(e,null,2)}catch{return String(e)}}function fn(e){let t=[];for(let[n,r]of Object.entries(e))on.has(n)||t.push({key:n,label:cn(n),...un(r)});return t}function pn({children:e,...t}){return(0,A.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,...t,children:e})}var mn=e=>(0,A.jsxs)(pn,{...e,children:[(0,A.jsx)(`path`,{d:`M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v4`}),(0,A.jsx)(`path`,{d:`M14 2v4a2 2 0 0 0 2 2h4`}),(0,A.jsx)(`path`,{d:`M3 15h6`}),(0,A.jsx)(`path`,{d:`M6 12v6`})]}),hn=e=>(0,A.jsxs)(pn,{...e,children:[(0,A.jsx)(`path`,{d:`M12 20h9`}),(0,A.jsx)(`path`,{d:`M16.376 3.622a1 1 0 0 1 3.002 3.002L7.368 18.635a2 2 0 0 1-.855.506l-2.872.838a.5.5 0 0 1-.62-.62l.838-2.872a2 2 0 0 1 .506-.854z`})]}),gn=e=>(0,A.jsxs)(pn,{...e,children:[(0,A.jsx)(`path`,{d:`M3 6h18`}),(0,A.jsx)(`path`,{d:`M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6`}),(0,A.jsx)(`path`,{d:`M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2`}),(0,A.jsx)(`line`,{x1:`10`,x2:`10`,y1:`11`,y2:`17`}),(0,A.jsx)(`line`,{x1:`14`,x2:`14`,y1:`11`,y2:`17`})]}),_n=e=>(0,A.jsx)(pn,{...e,children:(0,A.jsx)(`polygon`,{points:`6 3 20 12 6 21 6 3`})}),vn=e=>(0,A.jsxs)(pn,{...e,children:[(0,A.jsx)(`path`,{d:`M18 16.98h-5.99c-1.1 0-1.95.94-2.48 1.9A4 4 0 0 1 2 17c.01-.7.2-1.4.57-2`}),(0,A.jsx)(`path`,{d:`m6 17 3.13-5.78c.53-.97.1-2.01-.4-2.96A4 4 0 0 1 14 5.5c.63.42 1.13 1 1.44 1.66`}),(0,A.jsx)(`path`,{d:`m12 6 3.13 5.73C15.66 12.7 16.9 13 18 13a4 4 0 0 1 0 8`})]}),yn=e=>(0,A.jsxs)(pn,{...e,children:[(0,A.jsx)(`path`,{d:`M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z`}),(0,A.jsx)(`path`,{d:`m7 16.5-4.74-2.85`}),(0,A.jsx)(`path`,{d:`m7 16.5 5-3`}),(0,A.jsx)(`path`,{d:`M7 16.5v5.17`}),(0,A.jsx)(`path`,{d:`M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z`}),(0,A.jsx)(`path`,{d:`m17 16.5-5-3`}),(0,A.jsx)(`path`,{d:`m17 16.5 4.74-2.85`}),(0,A.jsx)(`path`,{d:`M17 16.5v5.17`}),(0,A.jsx)(`path`,{d:`M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z`}),(0,A.jsx)(`path`,{d:`M12 8 7.26 5.15`}),(0,A.jsx)(`path`,{d:`m12 8 4.74-2.85`}),(0,A.jsx)(`path`,{d:`M12 13.5V8`})]}),bn=e=>(0,A.jsx)(pn,{...e,children:(0,A.jsx)(`path`,{d:`m6 9 6 6 6-6`})}),xn=e=>(0,A.jsx)(pn,{...e,children:(0,A.jsx)(`path`,{d:`m9 18 6-6-6-6`})}),Sn=e=>(0,A.jsxs)(pn,{...e,children:[(0,A.jsx)(`polyline`,{points:`15 3 21 3 21 9`}),(0,A.jsx)(`polyline`,{points:`9 21 3 21 3 15`}),(0,A.jsx)(`line`,{x1:`21`,x2:`14`,y1:`3`,y2:`10`}),(0,A.jsx)(`line`,{x1:`3`,x2:`10`,y1:`21`,y2:`14`})]}),Cn=e=>(0,A.jsx)(pn,{...e,children:(0,A.jsx)(`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`})}),wn=e=>(0,A.jsxs)(pn,{...e,children:[(0,A.jsx)(`circle`,{cx:`12`,cy:`12`,r:`10`}),(0,A.jsx)(`path`,{d:`m9 12 2 2 4-4`})]}),Tn=e=>(0,A.jsxs)(pn,{...e,children:[(0,A.jsx)(`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`}),(0,A.jsx)(`path`,{d:`M12 9v4`}),(0,A.jsx)(`path`,{d:`M12 17h.01`})]}),En=new Set([`create_agent`,`create_agent_definition`,`agent`]);function Dn(e,t){if(e===`action`&&En.has(t))return vn;switch(e){case`create`:return mn;case`update`:return hn;case`delete`:return gn;default:return _n}}function On({directive:e,label:t=`Apply`,itemCount:n,onApplied:r}){let i=te(),[a,o]=(0,_.useState)({status:`idle`}),[s,c]=(0,_.useState)(0),l=(0,_.useRef)(null);if((0,_.useEffect)(()=>{if(a.status!==`applying`)return;l.current=Date.now();let e=setInterval(()=>c(Math.round((Date.now()-(l.current??0))/1e3)),1e3);return()=>clearInterval(e)},[a.status]),!e.parsed.executes)return null;let u=i.confirm;if(!u)return null;let d=e.items;async function f(){if(u){if(i.ask){o({status:`asking`});let t=!1;try{t=await i.ask({directive:e,items:d,nounLabel:ze(e.noun,i.nouns)})}catch(e){o({status:`error`,message:e instanceof Error&&e.message?e.message:`We could not ask you to confirm this, so nothing was done.`});return}if(!t){o({status:`idle`});return}}c(0),o({status:`applying`});try{let t=await u({__kind:e.slug,items:d});o({status:`applied`,applied:t.applied,failed:t.failed,message:t.message?.trim()?t.message.trim():null,records:t.records??[]}),r?.()}catch(e){o({status:`error`,message:e instanceof Error&&e.message?e.message:`That couldn't be applied just now. Please try again.`})}}}if(a.status===`applied`){let t=a.failed>0,n=e.directiveClass===`delete`,r=ze(e.noun,i.nouns),o=i.renderRecord?a.records:[];return(0,A.jsxs)(`span`,{className:`inline-flex min-w-0 flex-wrap items-center gap-1 text-xs ${t?`text-destructive`:`text-primary`}`,"data-apply-state":`applied`,children:[t?(0,A.jsx)(Tn,{className:`h-3.5 w-3.5 shrink-0`}):(0,A.jsx)(wn,{className:`h-3.5 w-3.5 shrink-0`}),(0,A.jsxs)(`span`,{children:[a.message??`Applied ${a.applied}`,t&&!a.message?` · ${a.failed} failed`:``]}),o.map(e=>(0,A.jsx)(`span`,{className:`inline-flex min-w-0 items-center`,children:i.renderRecord?.({...e,fallback:ln(r,e.id),context:`applied`,trashed:n})},`${e.noun}:${e.id}`))]})}return(0,A.jsxs)(`span`,{className:`inline-flex items-center gap-2`,children:[(0,A.jsxs)(`button`,{type:`button`,onClick:()=>void f(),disabled:a.status===`applying`||a.status===`asking`||d.length===0,className:`inline-flex items-center gap-1 rounded-md border border-border bg-background px-2 py-1 text-xs font-medium hover:bg-accent disabled:opacity-50`,children:[a.status===`applying`?(0,A.jsx)(Cn,{className:`h-3.5 w-3.5 animate-spin`}):(0,A.jsx)(_n,{className:`h-3.5 w-3.5`}),a.status===`applying`?`Applying${n?` ${n} ${n===1?`item`:`items`}`:``}…${s?` ${s}s`:``}`:t]}),a.status===`error`?(0,A.jsxs)(`span`,{className:`inline-flex max-w-sm items-start gap-1 text-xs text-destructive`,children:[(0,A.jsx)(Tn,{className:`mt-0.5 h-3.5 w-3.5 shrink-0`}),(0,A.jsx)(`span`,{children:a.message})]}):null]})}function kn({directive:e,reason:t}){let n=te(),r=e.items.length,i=He(e.directiveClass,e.noun,n.nouns);return(0,A.jsxs)(`div`,{className:`my-3 inline-flex flex-wrap items-center gap-2 rounded-md border border-border bg-muted px-2.5 py-1 text-sm`,children:[(0,A.jsx)(yn,{className:`h-3.5 w-3.5 shrink-0 text-muted-foreground`}),(0,A.jsx)(`span`,{className:`text-foreground`,children:i.title}),i.family?(0,A.jsxs)(`span`,{className:`text-muted-foreground`,children:[`· `,i.family]}):null,(0,A.jsxs)(`span`,{className:`text-muted-foreground`,children:[`· `,r,` `,r===1?`item`:`items`]}),t?(0,A.jsxs)(`span`,{className:`text-muted-foreground`,children:[`· `,t]}):null,(0,A.jsx)(On,{directive:e})]})}var An=/^\{\s*"__kind"\s*:\s*"([^"]+)"/;function jn(e){return e.trimStart().match(An)?.[1]??null}function Mn({content:e,streaming:t,className:n}){let r=te(),i=jn(e),a=i?ye(i):null,o=a?He(a.directiveClass,a.noun,r.nouns):null,s=a?Dn(a.directiveClass,a.noun):yn,c=o?.title??`Structured action`;return(0,A.jsxs)(`div`,{className:`my-3 rounded-md border border-border bg-card px-2.5 py-1.5${n?` ${n}`:``}`,"data-directive":i??void 0,"data-directive-state":t?`streaming`:`incomplete`,children:[(0,A.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1`,children:[(0,A.jsx)(s,{className:`h-3.5 w-3.5 shrink-0 text-muted-foreground`}),(0,A.jsx)(`span`,{className:`text-sm font-medium text-foreground`,children:c}),o?.family?(0,A.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:o.family}):null,t?(0,A.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 text-xs text-muted-foreground`,role:`status`,children:[(0,A.jsx)(`span`,{className:`h-1.5 w-1.5 animate-pulse rounded-full bg-primary`,"aria-hidden":!0}),`Writing…`]}):(0,A.jsx)(`span`,{className:`text-xs text-destructive`,role:`status`,children:`Cut off before it finished — nothing can be applied.`})]}),t?null:(0,A.jsxs)(`details`,{className:`mt-1 text-xs text-muted-foreground`,children:[(0,A.jsx)(`summary`,{className:`cursor-pointer select-none hover:text-foreground`,children:`Show what arrived`}),(0,A.jsx)(`pre`,{className:`mt-1 max-h-64 overflow-auto whitespace-pre-wrap break-all rounded bg-muted px-2 py-1 text-[11px]`,children:e})]})]})}var Nn=Symbol.for(`ai-matrx.content-ir-react.directive-renderers`),Pn=globalThis[Nn]??={bySlug:new Map,byClass:new Map};function Fn(e){return Pn.bySlug.get(e.slug)??Pn.byClass.get(e.directiveClass)??null}var In=3;function Ln({directive:e,item:t,index:n,total:r}){let i=te(),a=an.has(e.directiveClass)?sn(t):null;if(a)return(0,A.jsx)(Rn,{directive:e,item:t,recordId:a});let o=Ke(t,Ve(e.noun,i.nouns),n,r),s=qe(t),c=Ze(t),l=i.itemKind?.(e.slug)??null,u=He(e.directiveClass,e.noun,i.nouns),d=i.openItem,f=(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(`span`,{className:`min-w-0 shrink-0 truncate font-medium text-foreground`,children:o}),(0,A.jsx)(`span`,{className:`hidden min-w-0 flex-1 items-baseline gap-2 overflow-hidden sm:flex`,children:c.map(e=>(0,A.jsxs)(`span`,{className:`truncate text-[11px] text-muted-foreground`,children:[e.value,` `,e.label]},e.key))}),s&&c.length===0?(0,A.jsx)(`span`,{className:`hidden truncate text-[11px] text-muted-foreground sm:inline`,children:s}):null,d?(0,A.jsx)(Sn,{className:`ml-auto h-3 w-3 shrink-0 text-muted-foreground`}):null]});return(0,A.jsxs)(`div`,{className:`flex items-center gap-2 py-1 text-xs`,children:[d?(0,A.jsx)(`button`,{type:`button`,onClick:()=>d({item:Qe(t,l)??t,itemKind:l,title:o,subtitle:`${u.title} · item ${n+1} of ${r}`,directive:e,index:n,total:r}),className:`flex min-w-0 flex-1 items-center gap-2 rounded px-1 py-0.5 text-left hover:bg-accent hover:text-accent-foreground`,title:`Open to read it`,children:f}):(0,A.jsx)(`span`,{className:`flex min-w-0 flex-1 items-center gap-2 px-1 py-0.5`,children:f}),i.renderCopy?.({label:o,value:t,kind:l,size:`xs`})]})}function Rn({directive:e,item:t,recordId:n}){let r=te(),i=ln(ze(e.noun,r.nouns),n),a=e.directiveClass===`update`?fn(t):[],o=r.renderRecord?r.renderRecord({noun:e.noun,id:n,fallback:i,context:`row`}):(0,A.jsx)(`span`,{className:`truncate font-medium text-foreground`,children:i});return(0,A.jsxs)(`div`,{className:`py-1 text-xs`,"data-directive-target":n,children:[(0,A.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,A.jsx)(`span`,{className:`flex min-w-0 flex-1 items-center gap-1 px-1`,children:o}),r.renderCopy?.({label:i,value:t,size:`xs`})]}),e.directiveClass===`update`?a.length===0?(0,A.jsx)(`p`,{className:`px-1 text-[11px] text-muted-foreground`,children:`Sets no fields — nothing would change.`}):(0,A.jsx)(`ul`,{className:`mt-0.5 space-y-0.5 px-1`,children:a.map(e=>(0,A.jsxs)(`li`,{className:`flex min-w-0 items-baseline gap-1.5 text-[11px]`,title:`${e.label} → ${e.full}`,children:[(0,A.jsx)(`span`,{className:`shrink-0 text-muted-foreground`,children:e.label}),(0,A.jsx)(`span`,{"aria-hidden":!0,className:`shrink-0 text-muted-foreground`,children:`→`}),(0,A.jsx)(`span`,{className:`min-w-0 truncate ${e.clears?`italic text-muted-foreground`:`text-foreground`}`,children:e.value})]},e.key))}):null]})}function zn({directive:e}){let t=te(),[n,r]=(0,_.useState)(!1),i=e.items,a=i.length,o=He(e.directiveClass,e.noun,t.nouns),s=Dn(e.directiveClass,e.noun),c=n?i:i.slice(0,In),l=a-c.length;return(0,A.jsxs)(`div`,{className:`my-3 rounded-md border border-border bg-card px-2.5 py-1.5`,"data-directive":e.slug,children:[(0,A.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1`,children:[(0,A.jsx)(s,{className:`h-3.5 w-3.5 shrink-0 text-muted-foreground`}),(0,A.jsx)(`span`,{className:`text-sm font-medium text-foreground`,children:o.title}),o.family?(0,A.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:o.family}):null,(0,A.jsxs)(`span`,{className:`text-xs tabular-nums text-muted-foreground`,children:[a,` `,a===1?`item`:`items`]}),(0,A.jsxs)(`div`,{className:`ml-auto flex items-center gap-1`,children:[t.renderCopy?.({label:o.title,value:e.shell,size:`icon`}),(0,A.jsx)(On,{directive:e,itemCount:a})]})]}),a===0?(0,A.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:`No items — nothing would be written.`}):(0,A.jsx)(`div`,{className:`mt-0.5 divide-y divide-border/60`,children:c.map((t,n)=>(0,A.jsx)(Ln,{directive:e,item:t,index:n,total:a},n))}),l>0||n?(0,A.jsxs)(`button`,{type:`button`,onClick:()=>r(e=>!e),className:`mt-0.5 inline-flex items-center gap-1 rounded px-1 py-0.5 text-[11px] text-muted-foreground hover:text-foreground`,children:[n?(0,A.jsx)(bn,{className:`h-3 w-3`}):(0,A.jsx)(xn,{className:`h-3 w-3`}),n?`Show less`:`Show ${l} more`]}):null]})}function Bn(e){try{return JSON.parse(e),!0}catch{return!1}}function Vn({content:e,className:t,streaming:n}){let r=te(),i=Ie(e,e=>{let t=`[kind-directives] ${e}`;r.reportError?r.reportError(t):console.error(t)});if(!i){if(typeof e==`string`&&Se(e)&&!Bn(e))return(0,A.jsx)(Mn,{content:e,streaming:n!==!1,className:t});let r=typeof e==`string`?e:JSON.stringify(e,null,2);return(0,A.jsx)(`pre`,{className:`my-3 overflow-x-auto rounded-md border border-border bg-muted px-3 py-2 text-xs text-muted-foreground${t?` ${t}`:``}`,children:r})}let a=Fn(i);return a?(0,A.jsx)(a,{directive:i}):i.parsed.executes?(0,A.jsx)(zn,{directive:i}):(0,A.jsx)(kn,{directive:i})}function Hn(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Un(e,t){if(F(e)||t.kinds.getDefinition(e)?.legacyBlockType)return!0;let n=t.components.resolve(e,t.platform,`output`);return n?.isActive?n.componentKey!==en:!1}function Wn(e){return F(e.kind)?(0,A.jsx)(Vn,{content:e.value,...e.className===void 0?{}:{className:e.className}}):(0,A.jsx)(Gn,{...e})}function Gn({kind:e,value:t,showRoutingNote:n=!0,unroutableFallback:r,variant:i=`card`,className:a}){let o=re(),[s,c]=(0,_.useState)(()=>Un(e,o)?`routable`:`checking`);(0,_.useEffect)(()=>{let t=!1,n=!1,r=()=>{t||c(Un(e,o)?`routable`:n?`unroutable`:`checking`)},i=o.components.subscribe(r);r(),o.components.requestComponent(e,o.platform,`output`);let a=o.components.getVersion()>0;return Promise.allSettled([o.kinds.ensureWarm(),o.components.ensureWarm()]).then(async()=>{n=!0,r(),a&&await o.components.refresh(),r()}),()=>{t=!0,i()}},[o,e]);let l=Hn(t)?{type:`code`,content:JSON.stringify(t,null,2),language:`json`,metadata:{[ie]:de(t,e)}}:null,u=i===`bare`?void 0:`rounded-md border border-border bg-card p-3`;if(s===`unroutable`&&r!==void 0)return(0,A.jsx)(A.Fragment,{children:r});let d=l===null||s===`unroutable`,f=`This shape has no custom component yet, so it renders through the universal viewer — exactly what production shows today.`;return(0,A.jsxs)(`div`,{className:a?`space-y-3 ${a}`:`space-y-3`,children:[n&&s===`unroutable`?o.renderNotice?.(f)??(0,A.jsx)(`div`,{className:`rounded-md border border-amber-500/30 bg-amber-500/5 px-3 py-2 text-xs text-amber-800 dark:text-amber-200`,children:f}):null,(0,A.jsx)(`div`,{className:u,children:d?o.renderValue({value:t,kind:e}):o.renderBlock(l)})]})}var Kn=/^(https?:|mailto:|tel:)/i,qn=/^([./#?]|[A-Za-z0-9_-]+\/)/;function Jn(e){let t=e.trim();return t===``?null:Kn.test(t)?t:/^[A-Za-z][A-Za-z0-9+.-]*:/.test(t)?null:qn.test(t)?t:null}function Yn(e){let t=e.trim();return/^https?:\/\//i.test(t)?t:null}var Xn=400,Zn=["(`+)([^\\n]{0,400}?)\\1",`!\\[([^\\]\\n]*)\\]\\(((?:[^()\\s]|\\([^()\\s]*\\))+)\\)`,`\\[([^\\]\\n]+)\\]\\(((?:[^()\\s]|\\([^()\\s]*\\))+)\\)`,`(\\*\\*|__)(?=\\S)([^\\n]{0,400}?\\S)\\7`,`(\\*|_)(?=\\S)([^*_\\n]{0,400}?\\S)\\9`,`(~~)(?=\\S)([^\\n]{0,400}?\\S)\\11`,`(https?://[^\\s<>()]+)`].join(`|`);function Qn(e,t,n=0){if(n>6||e.length>Xn*64)return[e];let r=[],i=new RegExp(Zn,`g`),a=0,o=0,s=i.exec(e);for(;s!==null;){s.index>a&&r.push(e.slice(a,s.index));let c=`${t}i${o}`;if(o+=1,s[1]!==void 0)r.push((0,A.jsx)(`code`,{children:s[2]??``},c));else if(s[4]!==void 0){let e=Yn(s[4]),t=s[3]??``;r.push(e===null?(0,A.jsx)(_.Fragment,{children:t===``?s[4]:t},c):(0,A.jsx)(`img`,{className:`mx-chat-md__image`,src:e,alt:t,loading:`lazy`,referrerPolicy:`no-referrer`},c))}else if(s[6]!==void 0){let e=Jn(s[6]),t=s[5]??``;r.push(e===null?(0,A.jsx)(_.Fragment,{children:t},c):(0,A.jsx)(`a`,{href:e,target:`_blank`,rel:`noreferrer noopener`,children:Qn(t,`${c}-`,n+1)},c))}else s[8]===void 0?s[10]===void 0?s[12]===void 0?s[13]!==void 0&&r.push((0,A.jsx)(`a`,{href:s[13],target:`_blank`,rel:`noreferrer noopener`,children:s[13]},c)):r.push((0,A.jsx)(`del`,{children:Qn(s[12],`${c}-`,n+1)},c)):r.push((0,A.jsx)(`em`,{children:Qn(s[10],`${c}-`,n+1)},c)):r.push((0,A.jsx)(`strong`,{children:Qn(s[8],`${c}-`,n+1)},c));a=s.index+s[0].length,s=i.exec(e)}return a<e.length&&r.push(e.slice(a)),r}var $n=/^\s{0,3}(`{3,}|~{3,})\s*([^\s`]*)/,er=/^(#{1,6})\s+(.*)$/,tr=/^\s{0,3}[-*+]\s+(.*)$/,nr=/^\s{0,3}\d{1,9}[.)]\s+(.*)$/,rr=/^\s{0,3}>\s?(.*)$/,ir=/^\s{0,3}([-*_])(\s*\1){2,}\s*$/;function ar(e){return Ct(e).map(wt)}function or(e){let t=e.split(`
13
- `),n=[];{let e=0;for(let r of t)n.push(e),e+=r.length+1}let r=[],i=0,a=0;for(;i<t.length;){let e=t[i]??``;if(e.trim()===``){i+=1;continue}a=i;let n=$n.exec(e);if(n!==null){let e=n[1]??"```",a=n[2]??``,o=[];i+=1;let s=!1;for(;i<t.length;){let n=t[i]??``;if(n.trimStart().startsWith(e[0]??"`")&&n.trim().length>=3){let t=$n.exec(n);if(t!==null&&(t[1]??``).length>=e.length){s=!0,i+=1;break}}o.push(n),i+=1}r.push({type:`code`,language:a,body:o.join(`
14
- `),closed:s});continue}let o=er.exec(e);if(o!==null){r.push({type:`heading`,level:(o[1]??`#`).length,body:o[2]??``}),i+=1;continue}if(ir.test(e)){r.push({type:`rule`}),i+=1;continue}if(rr.test(e)){let e=[];for(;i<t.length;){let n=rr.exec(t[i]??``);if(n===null)break;e.push(n[1]??``),i+=1}r.push({type:`quote`,body:e.join(`
15
- `)});continue}let s=tr.exec(e),c=nr.exec(e);if(s!==null||c!==null){let e=c!==null,n=[];for(;i<t.length;){let r=t[i]??``,a=e?nr.exec(r):tr.exec(r);if(a===null)break;n.push(a[1]??``),i+=1}r.push({type:`list`,ordered:e,items:n});continue}if(Qt(t,i)){let n=ar(e),a=$t(t,i);i+=2;let o=[];for(;i<a;){let e=ar(t[i]??``);o.push(n.map((t,n)=>e[n]??``)),i+=1}r.push({type:`table`,header:n,rows:o});continue}let l=[];for(;i<t.length;){let e=t[i]??``;if(e.trim()===``||$n.test(e)||er.test(e)||tr.test(e)||nr.test(e)||rr.test(e)||ir.test(e))break;l.push(e),i+=1}r.push({type:`paragraph`,body:l.join(`
16
- `)})}return{blocks:r,openFrom:n[a]??0}}function sr(){let e=new Map,t=0,n=(n,r)=>{t+=1;let i=or(r);return e.set(n,{text:r,blocks:i.blocks,stable:i.blocks.slice(0,Math.max(0,i.blocks.length-1)),stableEnd:i.openFrom}),i.blocks};return{get parses(){return t},forget(t){e.delete(t)},parse(r,i){let a=e.get(r);if(a===void 0)return n(r,i);if(a.text===i)return a.blocks;if(!i.startsWith(a.text))return n(r,i);t+=1;let o=or(i.slice(a.stableEnd)),s=[...a.stable,...o.blocks];return e.set(r,{text:i,blocks:s,stable:s.slice(0,Math.max(0,s.length-1)),stableEnd:a.stableEnd+o.openFrom}),s}}}function cr(e,t){switch(e.type){case`code`:return(0,A.jsx)(`pre`,{className:`mx-chat-md__pre`,"data-language":e.language||void 0,children:(0,A.jsx)(`code`,{children:e.body})},t);case`heading`:{let n=Math.min(6,Math.max(1,e.level)),r=`h${n}`;return(0,A.jsx)(r,{className:`mx-chat-md__heading`,"data-level":n,children:Qn(e.body,`${t}-`)},t)}case`quote`:return(0,A.jsx)(`blockquote`,{className:`mx-chat-md__quote`,children:Qn(e.body,`${t}-`)},t);case`list`:return e.ordered?(0,A.jsx)(`ol`,{className:`mx-chat-md__list`,children:e.items.map((e,n)=>(0,A.jsx)(`li`,{children:Qn(e,`${t}-${n}-`)},`${t}-${n}`))},t):(0,A.jsx)(`ul`,{className:`mx-chat-md__list`,children:e.items.map((e,n)=>(0,A.jsx)(`li`,{children:Qn(e,`${t}-${n}-`)},`${t}-${n}`))},t);case`table`:return(0,A.jsx)(`div`,{className:`mx-chat-md__table-scroll`,children:(0,A.jsxs)(`table`,{className:`mx-chat-md__table`,children:[(0,A.jsx)(`thead`,{children:(0,A.jsx)(`tr`,{children:e.header.map((e,n)=>(0,A.jsx)(`th`,{children:Qn(e,`${t}-h${n}-`)},`${t}-h${n}`))})}),(0,A.jsx)(`tbody`,{children:e.rows.map((e,n)=>(0,A.jsx)(`tr`,{children:e.map((e,r)=>(0,A.jsx)(`td`,{children:Qn(e,`${t}-r${n}c${r}-`)},`${t}-r${n}c${r}`))},`${t}-r${n}`))})]})},t);case`rule`:return(0,A.jsx)(`hr`,{className:`mx-chat-md__rule`},t);case`paragraph`:return(0,A.jsx)(`p`,{className:`mx-chat-md__paragraph`,children:Qn(e.body,`${t}-`)},t)}}function lr(e){let t=e.cache.parse(e.cacheKey,e.text);return(0,A.jsx)(`div`,{className:`mx-chat-md`,children:t.map((e,t)=>cr(e,`b${t}`))})}var ur=`This answer contains a structured block, and it is shown as plain text here because this app has not connected the content renderer.`,dr=`Mount <ContentIrRenderProvider host={…}> from @ai-matrx/content-ir-react above your chat to draw structured blocks properly.`;function fr(e){let t=N(),n=e.announce;return(0,_.useEffect)(()=>{t===null&&n()},[t,n]),t===null?(0,A.jsxs)(`div`,{className:`mx-chat-content`,"data-mx-chat-content":`block-standin`,children:[(0,A.jsx)(`span`,{className:`mx-chat-standin`,children:ur}),(0,A.jsx)(lr,{text:e.request.text,cacheKey:`${e.request.messageId}:${e.request.kind}`,cache:e.cache})]}):(0,A.jsx)(`div`,{className:`mx-chat-content`,"data-mx-chat-content":`block`,"data-kind":e.request.kind,children:(0,A.jsx)(Wn,{kind:e.request.kind,value:e.request.data??e.request.text,variant:`bare`})})}function pr(e={}){let t=e.notifier??D(),n=e.cache??sr(),r=!1,i=()=>{r||(r=!0,t.notify({level:`warning`,message:ur,remedy:dr}))};return function(e){return e.kind!==`markdown`&&e.kind!==`text`?(0,A.jsx)(fr,{request:e,cache:n,notifier:t,announce:i}):e.text===``?null:(0,A.jsx)(`div`,{className:`mx-chat-content`,"data-mx-chat-content":`markdown`,children:(0,A.jsx)(lr,{text:e.text,cacheKey:e.messageId,cache:n})})}}function mr(e){return!!(/[zZ]$/.test(e)||/[+-]\d{2}(:?\d{2})?$/.test(e)||/\b(GMT|UTC)\b/i.test(e))}function hr(e){let t=e.trim();return!t||!/\d{1,2}:\d{2}/.test(t)||mr(t)?t:`${t.replace(` `,`T`)}Z`}function gr(e){if(e==null)return null;if(e instanceof Date)return Number.isNaN(e.getTime())?null:e;if(typeof e==`number`){let t=new Date(e);return Number.isNaN(t.getTime())?null:t}if(typeof e!=`string`)return null;let t=hr(e);if(!t)return null;let n=new Date(t);return Number.isNaN(n.getTime())?null:n}var _r={year:`numeric`,month:`short`,day:`numeric`,hour:`numeric`,minute:`2-digit`};function vr(e,t=_r,n=`—`){let r=gr(e);return r?r.toLocaleString(void 0,t):n}var yr=[{limit:6e4,divisor:1e3,short:`s`,long:`second`},{limit:36e5,divisor:6e4,short:`m`,long:`minute`},{limit:864e5,divisor:36e5,short:`h`,long:`hour`},{limit:6048e5,divisor:864e5,short:`d`,long:`day`},{limit:2592e6,divisor:6048e5,short:`w`,long:`week`},{limit:31536e6,divisor:2592e6,short:`mo`,long:`month`}],br=[{unit:`year`,ms:31536e6},{unit:`month`,ms:2592e6},{unit:`week`,ms:6048e5},{unit:`day`,ms:864e5},{unit:`hour`,ms:36e5},{unit:`minute`,ms:6e4}];function xr(e,t={}){let n=t.style??`short`,r=t.suffix===!1,i=t.now??Date.now(),a=gr(e);if(!a)return t.fallbackToInput===!0&&typeof e==`string`?e:t.fallback??`—`;if(n===`intl`){let e=a.getTime()-i,t=Math.abs(e);if(t<6e4)return`just now`;let n=new Intl.RelativeTimeFormat(void 0,{numeric:`auto`});for(let{unit:r,ms:i}of br)if(t>=i)return n.format(Math.trunc(e/i),r);return`just now`}let o=i-a.getTime(),s=o<0;if(s&&-o<6e4)return`just now`;let c=Math.abs(o);for(let e of yr)if(c<e.limit){let t=Math.max(1,Math.floor(c/e.divisor)),i=n===`long`?`${t} ${e.long}${t===1?``:`s`}`:`${t}${e.short}`;return r?i:s?`in ${i}`:`${i} ago`}return(t.absolute??(r?`date`:`datetime`))===`date`?a.toLocaleDateString():vr(a)}var Sr=[`B`,`KB`,`MB`,`GB`,`TB`,`PB`];function Cr(e,t={}){let n=t.fallback??`—`;if(e==null||!Number.isFinite(e)||e<0)return n;if(e<1024)return`${Math.round(e)} B`;let r=e,i=0;for(;r>=1024&&i<Sr.length-1;)r/=1024,i+=1;return`${r>=10?String(Math.round(r)):r.toFixed(1)} ${Sr[i]}`}function wr(e){return typeof e==`number`&&Number.isFinite(e)}function Tr(e,t={}){let{digits:n=2,unknown:r=`—`}=t;if(!wr(e))return r;let i;if(n===`adaptive`||n===`trim`){let t=Math.abs(e);i=t===0||t>=1?2:t>=.01?4:6}else i=n;return`$${e.toLocaleString(`en-US`,{minimumFractionDigits:n===`trim`?Math.min(2,i):i,maximumFractionDigits:i})}`}var Er=[``,`k`,`M`,`B`,`T`];function Dr(e,t={}){let{unknown:n=`—`,style:r=`plain`,locale:i}=t;if(!wr(e))return n;if(r!==`compact`)return e.toLocaleString(i);let a=e<0?`-`:``,o=Math.abs(e);if(o<1e3)return`${a}${Math.round(o)}`;let s=0;for(;o>=1e3&&s<Er.length-1;)o/=1e3,s+=1;let c=o>=10?Math.round(o):Number(o.toFixed(1));return c>=1e3&&s<Er.length-1&&(o/=1e3,s+=1,c=o>=10?Math.round(o):Number(o.toFixed(1))),`${a}${o>=10?String(c):c.toFixed(1)}${Er[s]}`}var Or=`Attachments aren't set up here, so this file has not been sent.`,kr="Give <ChatComposerProvider> a `files` port (your upload service) to attach files to a message.";function Ar(e){let t=!1;return{available:!1,upload(){return t||(t=!0,e.notify({level:`warning`,message:Or,remedy:kr})),Promise.reject(Error(Or))}}}function jr(e,t){return`${e} is larger than the ${Cr(t)} limit for this chat, so it has not been attached.`}function Mr(e){let t=e.replace(/[._-]+/g,` `).replace(/([a-z\d])([A-Z])/g,`$1 $2`).trim().toLowerCase();return t===``?`Working…`:t.charAt(0).toUpperCase()+t.slice(1)}function Nr(e){let t=new Set;return{request(n){if(t.size===0)return e.notify({level:`warning`,message:`There is nowhere to put your message back, so it has not been restored for you.`,remedy:`Copy your message from the conversation above and send it again, or mount this transcript inside a chat that has a message box.`}),!1;for(let e of t)e(n);return!0},subscribe(e){return t.add(e),()=>{t.delete(e)}}}}var Pr=(0,_.createContext)(null);function Fr(e){let{thread:t,ports:n,slots:r,children:i}=e,[a]=(0,_.useState)(()=>{let e=D();return{notifier:e,prefs:k(e)}}),o=n?.notifier??a.notifier,s=(0,_.useRef)(null);(s.current===null||s.current.notifier!==o)&&(s.current={notifier:o,bus:Nr(o),renderContent:pr({notifier:o}),files:Ar(o)});let c=s.current.bus,l=s.current.renderContent,u=s.current.files,d=(0,_.useMemo)(()=>({thread:t,ports:{renderContent:n?.renderContent??l,notifier:o,prefs:n?.prefs??a.prefs,files:n?.files??u,voice:n?.voice??null,toolLabel:n?.toolLabel??Mr,modelPicker:n?.modelPicker??null,quickset:n?.quickset??null},slots:r??{},retry:c}),[t,n?.renderContent,n?.prefs,n?.files,n?.voice,n?.toolLabel,n?.modelPicker,n?.quickset,o,r,c,l,u,a.prefs]),f=(0,_.useRef)(t);return(0,_.useEffect)(()=>{if(f.current===t)return;let e=f.current.getSnapshot().status;(e===`streaming`||e===`submitted`)&&o.notify({level:`warning`,message:`The previous answer was still arriving when this chat switched conversations.`,remedy:`Stop the answer before switching, or the run keeps going in the background.`}),f.current=t},[t,o]),(0,A.jsx)(Pr.Provider,{value:d,children:i})}function Ir(){let e=(0,_.useContext)(Pr);if(e===null)throw Error(`[@ai-matrx/chat] This component must be rendered inside <ChatProvider thread={…}>. Wrap your chat surface in one, passing a thread from createChatThread() or createExternalThreadSource().`);return e}function Lr(){let{thread:e}=Ir(),t=(0,_.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getSnapshot),n=(0,_.useCallback)((t,n)=>e.send(n===void 0?{text:t}:{text:t,fileIds:n}),[e]),r=(0,_.useCallback)(()=>e.cancel(),[e]);return(0,_.useMemo)(()=>({snapshot:t,messages:t.messages,status:t.status,isBusy:t.status===`submitted`||t.status===`streaming`,conversationId:t.conversationId,ephemeral:t.ephemeral,ephemeralReason:t.ephemeralReason,error:t.error,send:n,cancel:r}),[t,n,r])}function Rr(e){let{thread:t}=Ir(),n=(0,_.useCallback)(n=>t.subscribeToMessage(e,n),[t,e]),r=(0,_.useCallback)(()=>t.getMessageSnapshot(e),[t,e]);return(0,_.useSyncExternalStore)(n,r,r)}function zr(){return Ir().thread.features}function Br(){return Ir().ports}function Vr(){return Ir().slots}var Hr=`ai-matrx.chat.draft.`;function Ur(){let{thread:e,ports:t,retry:n}=Ir(),r=e.features,i=(0,_.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getSnapshot),a=i.conversationId,o=i.status===`submitted`||i.status===`streaming`,s=`${Hr}${a??`new`}`,[c,l]=(0,_.useState)(()=>r.retainDrafts?t.prefs.get(s)??``:``),[u,d]=(0,_.useState)(!1),f=(0,_.useRef)(s);(0,_.useEffect)(()=>{if(f.current===s)return;let e=f.current;if(f.current=s,!r.retainDrafts)return;let n=t.prefs.get(e);if(n!==null&&n!==``){t.prefs.set(s,n),t.prefs.remove(e),l(n);return}l(t.prefs.get(s)??``)},[s,r.retainDrafts,t.prefs]);let p=(0,_.useCallback)(e=>{l(e),d(!1),r.retainDrafts&&(e===``?t.prefs.remove(f.current):t.prefs.set(f.current,e))},[r.retainDrafts,t.prefs]);(0,_.useEffect)(()=>n.subscribe(e=>{l(e),d(!0),r.retainDrafts&&t.prefs.set(f.current,e)}),[n,r.retainDrafts,t.prefs]);let m=(0,_.useCallback)(async()=>{let n=c.trim();if(n===``||o&&!r.sendWhileBusy)return null;l(``),d(!1),r.retainDrafts&&t.prefs.remove(f.current);let i=await e.send({text:n});return i.accepted||(l(n),r.retainDrafts&&t.prefs.set(f.current,n)),i},[c,o,e,r.retainDrafts,r.sendWhileBusy,t.prefs]),h=(0,_.useCallback)(()=>e.cancel(),[e]),g=(0,_.useCallback)(t=>{if(t.key===`Escape`){if(!o)return;t.preventDefault(),e.cancel();return}if(t.key!==`Enter`)return;let n=t.metaKey||t.ctrlKey;(r.sendKey===`enter`?!t.shiftKey&&!n:n)&&(t.preventDefault(),m())},[r.sendKey,o,m,e]);return{text:c,setText:p,canSend:c.trim()!==``&&(!o||r.sendWhileBusy),isBusy:o,send:m,stop:h,onKeyDown:g,restoredFromFailure:u}}function Wr(e,t){let n=e.findIndex(e=>e.id===t);if(n<=0)return``;for(let t=n-1;t>=0;--t){let n=e[t];if(n&&n.role===`user`)return C(n)}return``}function Gr(){return(0,A.jsx)(`svg`,{className:`mx-chat-chevron`,width:`1em`,height:`1em`,viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.75`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,focusable:`false`,children:(0,A.jsx)(`path`,{d:`M6 3.5 10.5 8 6 12.5`})})}function Kr(){return(0,A.jsx)(`svg`,{width:`1em`,height:`1em`,viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.75`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,focusable:`false`,children:(0,A.jsx)(`path`,{d:`M8 3v10M3.5 8.5 8 13l4.5-4.5`})})}var qr=Object.defineProperty,Jr=(e,t)=>qr(e,`name`,{value:t,configurable:!0}),Yr=!!(typeof window<`u`&&window.document&&window.document.createElement);function L(e,t,{checkForDefaultPrevented:n=!0}={}){return Jr(function(r){if(e?.(r),n===!1||!r||!r.defaultPrevented)return t?.(r)},`handleEvent`)}Jr(L,`composeEventHandlers`);function Xr(e){if(!Yr)throw Error(`Cannot access window outside of the DOM`);return e?.ownerDocument?.defaultView??window}Jr(Xr,`getOwnerWindow`);function Zr(e){if(!Yr)throw Error(`Cannot access document outside of the DOM`);return e?.ownerDocument??document}Jr(Zr,`getOwnerDocument`);function Qr(e,t=!1){let{activeElement:n}=Zr(e);if(!n?.nodeName)return null;if($r(n)&&n.contentDocument)return Qr(n.contentDocument.body,t);if(t){let e=n.getAttribute(`aria-activedescendant`);if(e){let t=Zr(n).getElementById(e);if(t)return t}}return n}Jr(Qr,`getActiveElement`);function $r(e){return e.tagName===`IFRAME`}Jr($r,`isFrame`);var ei=Object.defineProperty,ti=(e,t)=>ei(e,`name`,{value:t,configurable:!0});function ni(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}ti(ni,`setRef`);function ri(...e){return t=>{let n=!1,r=e.map(e=>{let r=ni(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():ni(e[t],null)}}}}ti(ri,`composeRefs`);function R(...e){return _.useCallback(ri(...e),e)}ti(R,`useComposedRefs`);var ii=Object.defineProperty,ai=(e,t)=>ii(e,`name`,{value:t,configurable:!0});function oi(e,t){let n=_.createContext(t);n.displayName=e+`Context`;let r=ai(e=>{let{children:t,...r}=e,i=_.useMemo(()=>r,Object.values(r));return(0,A.jsx)(n.Provider,{value:i,children:t})},`Provider`);r.displayName=e+`Provider`;function i(r,i={}){let{optional:a=!1}=i,o=_.useContext(n);if(o)return o;if(t!==void 0)return t;if(!a)throw Error(`\`${r}\` must be used within \`${e}\``)}return ai(i,`useContext`),[r,i]}ai(oi,`createContext`);function si(e,t=[]){let n=[];function r(t,r){let i=_.createContext(r);i.displayName=t+`Context`;let a=n.length;n=[...n,r];let o=ai(t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,c=_.useMemo(()=>o,Object.values(o));return(0,A.jsx)(s.Provider,{value:c,children:r})},`Provider`);o.displayName=t+`Provider`;function s(n,o,s={}){let{optional:c=!1}=s,l=o?.[e]?.[a]||i,u=_.useContext(l);if(u)return u;if(r!==void 0)return r;if(!c)throw Error(`\`${n}\` must be used within \`${t}\``)}return ai(s,`useContext`),[o,s]}ai(r,`createContext`);let i=ai(()=>{let t=n.map(e=>_.createContext(e));return ai(function(n){let r=n?.[e]||t;return _.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])},`useScope`)},`createScope`);return i.scopeName=e,[r,ci(i,...t)]}ai(si,`createContextScope`);function ci(...e){let t=e[0];if(e.length===1)return t;let n=ai(()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return ai(function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return _.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])},`useComposedScopes`)},`createScope`);return n.scopeName=t.scopeName,n}ai(ci,`composeContextScopes`);var li=Object.defineProperty,ui=(e,t)=>li(e,`name`,{value:t,configurable:!0});function di(e){let t=_.forwardRef((t,n)=>{let{children:r,...i}=t,a=null,o=!1,s=[];bi(r)&&typeof wi==`function`&&(r=wi(r._payload)),_.Children.forEach(r,e=>{if(vi(e)){o=!0;let t=e,n=`child`in t.props?t.props.child:t.props.children;bi(n)&&typeof wi==`function`&&(n=wi(n._payload)),a=hi(t,n),s.push(a?.props?.children)}else s.push(e)}),a?a=_.cloneElement(a,void 0,s):!o&&_.Children.count(r)===1&&_.isValidElement(r)&&(a=r);let c=a?_i(a):void 0,l=R(n,c);if(!a){if(r||r===0)throw Error(o?Ci(e):Si(e));return r}let u=gi(i,a.props??{});return a.type!==_.Fragment&&(u.ref=n?l:c),_.cloneElement(a,u)});return t.displayName=`${e}.Slot`,t}ui(di,`createSlot`);var fi=di(`Slot`),pi=Symbol.for(`radix.slottable`);function mi(e){let t=ui(e=>`child`in e?e.children(e.child):e.children,`Slottable`);return t.displayName=`${e}.Slottable`,t.__radixId=pi,t}ui(mi,`createSlottable`);var hi=ui((e,t)=>{if(`child`in e.props){let t=e.props.child;return _.isValidElement(t)?_.cloneElement(t,void 0,e.props.children(t.props.children)):null}return _.isValidElement(t)?t:null},`getSlottableElementFromSlottable`);function gi(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}}ui(gi,`mergeProps`);function _i(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)}ui(_i,`getElementRef`);function vi(e){return _.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===pi}ui(vi,`isSlottable`);var yi=Symbol.for(`react.lazy`);function bi(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===yi&&`_payload`in e&&xi(e._payload)}ui(bi,`isLazyComponent`);function xi(e){return typeof e==`object`&&!!e&&`then`in e}ui(xi,`isPromiseLike`);var Si=ui(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,`createSlotError`),Ci=ui(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,`createSlottableError`),wi=_.use,Ti=c(m(),1),Ei=Object.defineProperty,Di=(e,t)=>Ei(e,`name`,{value:t,configurable:!0}),Oi=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=di(`Primitive.${t}`),r=_.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,A.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function ki(e,t){e&&Ti.flushSync(()=>e.dispatchEvent(t))}Di(ki,`dispatchDiscreteCustomEvent`);var Ai=Object.defineProperty,ji=(e,t)=>Ai(e,`name`,{value:t,configurable:!0});function Mi(e){let t=_.useRef(e);return _.useEffect(()=>{t.current=e}),_.useMemo(()=>((...e)=>t.current?.(...e)),[])}ji(Mi,`useCallbackRef`);var Ni=Object.defineProperty,Pi=(e,t)=>Ni(e,`name`,{value:t,configurable:!0}),Fi=`dismissableLayer.update`,Ii=`dismissableLayer.pointerDownOutside`,Li=`dismissableLayer.focusOutside`,Ri,zi=_.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),Bi=_.forwardRef(Pi(function(e,t){let{disableOutsidePointerEvents:n=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:o,onInteractOutside:s,onDismiss:c,...l}=e,u=_.useContext(zi),[d,f]=_.useState(null),p=d?.ownerDocument??globalThis?.document,[,m]=_.useState({}),h=R(t,f),g=Array.from(u.layers),[v]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),y=v?g.indexOf(v):-1,b=d?g.indexOf(d):-1,x=u.layersWithOutsidePointerEventsDisabled.size>0,S=b>=y,C=_.useRef(!1),w=Ui(e=>{a?.(e),s?.(e),e.defaultPrevented||c?.()},{ownerDocument:p,deferPointerDownOutside:r,isDeferredPointerDownOutsideRef:C,dismissableSurfaces:u.dismissableSurfaces,shouldHandlePointerDownOutside:_.useCallback(e=>{if(!(e instanceof Node))return!1;let t=[...u.branches].some(t=>t.contains(e));return S&&!t},[u.branches,S])}),T=Wi(e=>{if(r&&C.current)return;let t=e.target;[...u.branches].some(e=>e.contains(t))||(o?.(e),s?.(e),e.defaultPrevented||c?.())},p),E=d?b===g.length-1:!1,D=Mi(e=>{e.key===`Escape`&&(i?.(e),!e.defaultPrevented&&c&&(e.preventDefault(),c()))});return _.useEffect(()=>{if(E)return p.addEventListener(`keydown`,D,{capture:!0}),()=>p.removeEventListener(`keydown`,D,{capture:!0})},[p,E,D]),_.useEffect(()=>{if(d)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(Ri=p.body.style.pointerEvents,p.body.style.pointerEvents=`none`),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),Gi(),()=>{n&&(u.layersWithOutsidePointerEventsDisabled.delete(d),u.layersWithOutsidePointerEventsDisabled.size===0&&(p.body.style.pointerEvents=Ri))}},[d,p,n,u]),_.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),Gi())},[d,u]),_.useEffect(()=>{let e=Pi(()=>m({}),`handleUpdate`);return document.addEventListener(Fi,e),()=>document.removeEventListener(Fi,e)},[]),(0,A.jsx)(Oi.div,{...l,ref:h,style:{pointerEvents:x?S?`auto`:`none`:void 0,...e.style},onFocusCapture:L(e.onFocusCapture,T.onFocusCapture),onBlurCapture:L(e.onBlurCapture,T.onBlurCapture),onPointerDownCapture:L(e.onPointerDownCapture,w.onPointerDownCapture)})},`DismissableLayer`));function Vi(){let e=_.useContext(zi),[t,n]=_.useState(null);return _.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}Pi(Vi,`useDismissableLayerSurface`);var Hi=Pi(()=>!0,`IS_TRUE`);function Ui(e,t){let{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:i,dismissableSurfaces:a,shouldHandlePointerDownOutside:o=Hi}=t,s=Mi(e),c=_.useRef(!1),l=_.useRef(!1),u=_.useRef(new Map),d=_.useRef(()=>{});return _.useEffect(()=>{function e(){l.current=!1,i.current=!1,u.current.clear()}Pi(e,`resetOutsideInteraction`);function t(){return Array.from(u.current.values()).some(Boolean)}Pi(t,`isOutsideInteractionIntercepted`);function f(e){if(!l.current)return;let t=e.target;t instanceof Node&&[...a].some(e=>e.contains(t))||u.current.set(e.type,!0),e.type===`click`&&window.setTimeout(()=>{l.current&&d.current()},0)}Pi(f,`handleInteractionCapture`);function p(e){l.current&&u.current.set(e.type,!1)}Pi(p,`handleInteractionBubble`);let m=Pi(a=>{if(a.target&&!c.current){let f=function(){n.removeEventListener(`click`,d.current);let r=t();e(),r||Ki(Ii,s,p,{discrete:!0})};if(Pi(f,`handleAndDispatchPointerDownOutsideEvent`),!o(a.target)){n.removeEventListener(`click`,d.current),e(),c.current=!1;return}let p={originalEvent:a};l.current=!0,i.current=r&&a.button===0,u.current.clear(),!r||a.button!==0?f():(n.removeEventListener(`click`,d.current),d.current=f,n.addEventListener(`click`,d.current,{once:!0}))}else n.removeEventListener(`click`,d.current),e();c.current=!1},`handlePointerDown`),h=[`pointerup`,`mousedown`,`mouseup`,`touchstart`,`touchend`,`click`];for(let e of h)n.addEventListener(e,f,!0),n.addEventListener(e,p);let g=window.setTimeout(()=>{n.addEventListener(`pointerdown`,m)},0);return()=>{window.clearTimeout(g),n.removeEventListener(`pointerdown`,m),n.removeEventListener(`click`,d.current);for(let e of h)n.removeEventListener(e,f,!0),n.removeEventListener(e,p)}},[n,s,r,i,a,o]),{onPointerDownCapture:Pi(()=>c.current=!0,`onPointerDownCapture`)}}Pi(Ui,`usePointerDownOutside`);function Wi(e,t=globalThis?.document){let n=Mi(e),r=_.useRef(!1);return _.useEffect(()=>{let e=Pi(e=>{e.target&&!r.current&&Ki(Li,n,{originalEvent:e},{discrete:!1})},`handleFocus`);return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:Pi(()=>r.current=!0,`onFocusCapture`),onBlurCapture:Pi(()=>r.current=!1,`onBlurCapture`)}}Pi(Wi,`useFocusOutside`);function Gi(){let e=new CustomEvent(Fi);document.dispatchEvent(e)}Pi(Gi,`dispatchUpdate`);function Ki(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?ki(i,a):i.dispatchEvent(a)}Pi(Ki,`handleAndDispatchCustomEvent`);var qi=globalThis?.document?_.useLayoutEffect:()=>{},Ji=Object.defineProperty,Yi=(e,t)=>Ji(e,`name`,{value:t,configurable:!0}),Xi=_.useId||(()=>void 0),Zi=0;function Qi(e){let[t,n]=_.useState(Xi());return qi(()=>{e||n(e=>e??String(Zi++))},[e]),e||(t?`radix-${t}`:``)}Yi(Qi,`useId`);var $i=[`top`,`right`,`bottom`,`left`],ea=Math.min,ta=Math.max,na=Math.round,ra=Math.floor,ia=e=>({x:e,y:e}),aa={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function z(e,t,n){return ta(e,ea(t,n))}function oa(e,t){return typeof e==`function`?e(t):e}function sa(e){return e.split(`-`)[0]}function ca(e){return e.split(`-`)[1]}function la(e){return e===`x`?`y`:`x`}function ua(e){return e===`y`?`height`:`width`}function da(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function fa(e){return la(da(e))}function pa(e,t,n){n===void 0&&(n=!1);let r=ca(e),i=fa(e),a=ua(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=Sa(o)),[o,Sa(o)]}function ma(e){let t=Sa(e);return[ha(e),t,ha(t)]}function ha(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var ga=[`left`,`right`],_a=[`right`,`left`],va=[`top`,`bottom`],ya=[`bottom`,`top`];function ba(e,t,n){switch(e){case`top`:case`bottom`:return n?t?_a:ga:t?ga:_a;case`left`:case`right`:return t?va:ya;default:return[]}}function xa(e,t,n,r){let i=ca(e),a=ba(sa(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(ha)))),a}function Sa(e){let t=sa(e);return aa[t]+e.slice(t.length)}function Ca(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function wa(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:Ca(e)}function Ta(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 Ea(e,t,n){let{reference:r,floating:i}=e,a=da(t),o=fa(t),s=ua(o),c=sa(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}}let m=ca(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function Da(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}=oa(t,e),p=wa(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=Ta(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=Ta(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 Oa=50,ka=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:Da},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=Ea(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<Oa&&(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}=Ea(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},Aa=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}=oa(e,t)||{};if(l==null)return{};let d=wa(u),f={x:n,y:r},p=fa(i),m=ua(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=ea(d[_],T),D=ea(d[v],T),O=C-h[m]-D,k=C/2-h[m]/2+w,ee=z(E,k,O),A=!c.arrow&&ca(i)!=null&&k!==ee&&a.reference[m]/2-(k<E?E:D)-h[m]/2<0,j=A?k<E?k-E:k-O:0;return{[p]:f[p]+j,data:{[p]:ee,centerOffset:k-ee-j,...A&&{alignmentOffset:j}},reset:A}}}),ja=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}=oa(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=sa(r),_=da(o),v=sa(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[Sa(o)]:ma(o)),x=p!==`none`;!d&&x&&b.push(...xa(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=pa(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`||_===da(t)||T.every(e=>da(e.placement)!==_||e.overflows[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=da(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}if(r!==n)return{reset:{placement:n}}}return{}}}};function Ma(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Na(e){return $i.some(t=>e[t]>=0)}var Pa=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=oa(e,t);switch(i){case`referenceHidden`:{let e=Ma(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:Na(e)}}}case`escaped`:{let e=Ma(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:Na(e)}}}default:return{}}}}},Fa=new Set([`left`,`top`]);async function Ia(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=sa(n),s=ca(n),c=da(n)===`y`,l=Fa.has(o)?-1:1,u=a&&c?-1:1,d=oa(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 La=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 Ia(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}}}}},Ra=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}=oa(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=da(i),p=la(f),m=u[p],h=u[f],g=(e,t)=>z(t+d[e===`y`?`top`:`left`],t,t-d[e===`y`?`bottom`:`right`]);o&&(m=g(p,m)),s&&(h=g(f,h));let _=c.fn({...t,[p]:m,[f]:h});return{..._,data:{x:_.x-n,y:_.y-r,enabled:{[p]:o,[f]:s}}}}}},za=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}=oa(e,t),u={x:n,y:r},d=da(i),f=la(d),p=u[f],m=u[d],h=oa(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:h.mainAxis??0,crossAxis:h.crossAxis??0};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=Fa.has(sa(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}}}},Ba=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){let{placement:n,rects:r,platform:i,elements:a}=t,{apply:o=()=>{},...s}=oa(e,t),c=await i.detectOverflow(t,s),l=sa(n),u=ca(n),d=da(n)===`y`,{width:f,height:p}=r.floating,m,h;l===`top`||l===`bottom`?(m=l,h=u===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?`start`:`end`)?`left`:`right`):(h=l,m=u===`end`?`top`:`bottom`);let g=p-c.top-c.bottom,_=f-c.left-c.right,v=ea(p-c[m],g),y=ea(f-c[h],_),b=t.middlewareData.shift,x=!b,S=v,C=y;b!=null&&b.enabled.x&&(C=_),b!=null&&b.enabled.y&&(S=g),x&&!u&&(d?C=f-2*ta(c.left,c.right):S=p-2*ta(c.top,c.bottom)),await o({...t,availableWidth:C,availableHeight:S});let w=await i.getDimensions(a.floating);return f!==w.width||p!==w.height?{reset:{rects:!0}}:{}}}};function Va(){return typeof window<`u`}function Ha(e){return Ga(e)?(e.nodeName||``).toLowerCase():`#document`}function Ua(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Wa(e){return((Ga(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function Ga(e){return Va()?e instanceof Node||e instanceof Ua(e).Node:!1}function Ka(e){return Va()?e instanceof Element||e instanceof Ua(e).Element:!1}function qa(e){return Va()?e instanceof HTMLElement||e instanceof Ua(e).HTMLElement:!1}function Ja(e){return!Va()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof Ua(e).ShadowRoot}function Ya(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=oo(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function Xa(e){return/^(table|td|th)$/.test(Ha(e))}function Za(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var Qa=/transform|translate|scale|rotate|perspective|filter/,$a=/paint|layout|strict|content/,eo=e=>!!e&&e!==`none`,to;function no(e){let t=Ka(e)?oo(e):e;return eo(t.transform)||eo(t.translate)||eo(t.scale)||eo(t.rotate)||eo(t.perspective)||!io()&&(eo(t.backdropFilter)||eo(t.filter))||Qa.test(t.willChange||``)||$a.test(t.contain||``)}function ro(e){let t=co(e);for(;qa(t)&&!ao(t);){if(no(t))return t;if(Za(t))return null;t=co(t)}return null}function io(){return to??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),to}function ao(e){return/^(html|body|#document)$/.test(Ha(e))}function oo(e){return Ua(e).getComputedStyle(e)}function so(e){return Ka(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function co(e){if(Ha(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||Ja(e)&&e.host||Wa(e);return Ja(t)?t.host:t}function lo(e){let t=co(e);return ao(t)?(e.ownerDocument||e).body:qa(t)&&Ya(t)?t:lo(t)}function uo(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=lo(e),i=r===e.ownerDocument?.body,a=Ua(r);if(i){let e=fo(a);return t.concat(a,a.visualViewport||[],Ya(r)?r:[],e&&n?uo(e):[])}return t.concat(r,uo(r,[],n))}function fo(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function po(e){let t=oo(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=qa(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=na(n)!==a||na(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function mo(e){return Ka(e)?e:e.contextElement}function ho(e){let t=mo(e);if(!qa(t))return ia(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=po(t),o=(a?na(n.width):n.width)/r,s=(a?na(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var go=ia(0);function _o(e){let t=Ua(e);return!io()||!t.visualViewport?go:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function vo(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===Ua(e)}function yo(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=mo(e),o=ia(1);t&&(r?Ka(r)&&(o=ho(r)):o=ho(e));let s=vo(a,n,r)?_o(a):ia(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&&r){let e=Ua(a),t=Ka(r)?Ua(r):r,n=e,i=fo(n);for(;i&&t!==n;){let e=ho(i),t=i.getBoundingClientRect(),r=oo(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=Ua(i),i=fo(n)}}return Ta({width:u,height:d,x:c,y:l})}function bo(e,t){let n=so(e).scrollLeft;return t?t.left+n:yo(Wa(e)).left+n}function xo(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-bo(e,n),y:n.top+t.scrollTop}}function So(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=Wa(r),s=t?Za(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=ia(1),u=ia(0),d=qa(r);if((d||!a)&&((Ha(r)!==`body`||Ya(o))&&(c=so(r)),d)){let e=yo(r);l=ho(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?xo(o,c):ia(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 Co(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function wo(e){let t=so(e),n=e.ownerDocument.body,r=ta(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=ta(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+bo(e),o=-t.scrollTop;return oo(n).direction===`rtl`&&(a+=ta(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var To=25;function Eo(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=Ua(e),a=Wa(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!io()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(bo(a)<=0){let e=a.ownerDocument,t=e.body,n=getComputedStyle(t),r=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(a.clientWidth-t.clientWidth-r),o=getComputedStyle(a).scrollbarGutter===`stable both-edges`?i/2:i;o<=To&&(s-=o)}return{width:s,height:c,x:l,y:u}}function Do(e,t){let n=yo(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=ho(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function Oo(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=Eo(e,n,t);else if(t===`document`)r=wo(Wa(e));else if(Ka(t))r=Do(t,n);else{let n=_o(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return Ta(r)}function ko(e,t){let n=t.get(e);if(n)return n;let r=uo(e,[],!1).filter(e=>Ka(e)&&Ha(e)!==`body`),i=null,a=oo(e).position===`fixed`,o=a?co(e):e;for(;Ka(o)&&!ao(o);){let e=oo(o),t=no(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=co(o)}return t.set(e,r),r}function Ao(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?Za(t)?[]:ko(t,this._c):[].concat(n),r],o=Oo(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=Oo(t,a[e],i);s=ta(n.top,s),c=ea(n.right,c),l=ea(n.bottom,l),u=ta(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function jo(e){let{width:t,height:n}=po(e);return{width:t,height:n}}function Mo(e,t,n){let r=qa(t),i=Wa(t),a=n===`fixed`,o=yo(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=ia(0);if((r||!a)&&((Ha(t)!==`body`||Ya(i))&&(s=so(t)),r)){let e=yo(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=bo(i));let l=i&&!r&&!a?xo(i,s):ia(0);return{x:o.left+s.scrollLeft-c.x-l.x,y:o.top+s.scrollTop-c.y-l.y,width:o.width,height:o.height}}function No(e){return oo(e).position===`static`}function Po(e,t){if(!qa(e)||oo(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return Wa(e)===n&&(n=n.ownerDocument.body),n}function Fo(e,t){let n=Ua(e);if(Za(e))return n;if(!qa(e)){let t=co(e);for(;t&&!ao(t);){if(Ka(t)&&!No(t))return t;t=co(t)}return n}let r=Po(e,t);for(;r&&Xa(r)&&No(r);)r=Po(r,t);return r&&ao(r)&&No(r)&&!no(r)?n:r||ro(e)||n}var Io=async function(e){let t=this.getOffsetParent||Fo,n=this.getDimensions,r=await n(e.floating);return{reference:Mo(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Lo(e){return oo(e).direction===`rtl`}var Ro={convertOffsetParentRelativeRectToViewportRelativeRect:So,getDocumentElement:Wa,getClippingRect:Ao,getOffsetParent:Fo,getElementRects:Io,getClientRects:Co,getDimensions:jo,getScale:ho,isElement:Ka,isRTL:Lo};function zo(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Bo(e,t,n){let r=null,i,a=Wa(e);function o(){var e;clearTimeout(i),(e=r)==null||e.disconnect(),r=null}function s(n,c){n===void 0&&(n=!1),c===void 0&&(c=1),o();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(n||t(),!f||!p)return;let m=ra(d),h=ra(a.clientWidth-(u+f)),g=ra(a.clientHeight-(d+p)),_=ra(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:ta(0,ea(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!zo(l,e.getBoundingClientRect()))return s();if(n!==c){if(!y)return s();n?s(!1,n):i=setTimeout(()=>{s(!1,1e-7)},1e3)}y=!1}try{r=new IntersectionObserver(b,{...v,root:a.ownerDocument})}catch{r=new IntersectionObserver(b,v)}r.observe(e)}let c=Ua(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function Vo(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=mo(e),u=i||a?[...l?uo(l):[],...t?uo(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?Bo(l,n,a):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?yo(e):null;c&&g();function g(){let t=yo(e);h&&!zo(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 Ho=La,Uo=Ra,B=ja,Wo=Ba,Go=Pa,Ko=Aa,qo=za,Jo=(e,t,n)=>{let r=new Map,i=n??{},a={...Ro,...i.platform,_c:r};return ka(e,t,{...i,platform:a})},Yo=typeof document<`u`?_.useLayoutEffect:function(){};function Xo(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(!Xo(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)&&!Xo(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function Zo(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Qo(e,t){let n=Zo(e);return Math.round(t*n)/n}function $o(e){let t=_.useRef(e);return Yo(()=>{t.current=e}),t}function es(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]=_.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=_.useState(r);Xo(f,r)||p(r);let[m,h]=_.useState(null),[g,v]=_.useState(null),y=_.useCallback(e=>{e!==C.current&&(C.current=e,h(e))},[]),b=_.useCallback(e=>{e!==w.current&&(w.current=e,v(e))},[]),x=a||m,S=o||g,C=_.useRef(null),w=_.useRef(null),T=_.useRef(u),E=c!=null,D=$o(c),O=$o(i),k=$o(l),ee=_.useCallback(()=>{if(!C.current||!w.current)return;let e={placement:t,strategy:n,middleware:f};O.current&&(e.platform=O.current),Jo(C.current,w.current,e).then(e=>{let t={...e,isPositioned:k.current!==!1};A.current&&!Xo(T.current,t)&&(T.current=t,Ti.flushSync(()=>{d(t)}))})},[f,t,n,O,k]);Yo(()=>{l===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let A=_.useRef(!1);Yo(()=>(A.current=!0,()=>{A.current=!1}),[]),Yo(()=>{if(x&&(C.current=x),S&&(w.current=S),x&&S){if(D.current)return D.current(x,S,ee);ee()}},[x,S,ee,D,E]);let j=_.useMemo(()=>({reference:C,floating:w,setReference:y,setFloating:b}),[y,b]),M=_.useMemo(()=>({reference:x,floating:S}),[x,S]),te=_.useMemo(()=>{let e={position:n,left:0,top:0};if(!M.floating)return e;let t=Qo(M.floating,u.x),r=Qo(M.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...Zo(M.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,M.floating,u.x,u.y]);return _.useMemo(()=>({...u,update:ee,refs:j,elements:M,floatingStyles:te}),[u,ee,j,M,te])}var ts=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?{}:Ko({element:r.current,padding:i}).fn(n):r?Ko({element:r,padding:i}).fn(n):{}}}},ns=(e,t)=>{let n=Ho(e);return{name:n.name,fn:n.fn,options:[e,t]}},rs=(e,t)=>{let n=Uo(e);return{name:n.name,fn:n.fn,options:[e,t]}},is=(e,t)=>({fn:qo(e).fn,options:[e,t]}),as=(e,t)=>{let n=B(e);return{name:n.name,fn:n.fn,options:[e,t]}},os=(e,t)=>{let n=Wo(e);return{name:n.name,fn:n.fn,options:[e,t]}},ss=(e,t)=>{let n=Go(e);return{name:n.name,fn:n.fn,options:[e,t]}},cs=(e,t)=>{let n=ts(e);return{name:n.name,fn:n.fn,options:[e,t]}},ls=Object.defineProperty,us=(e,t)=>ls(e,`name`,{value:t,configurable:!0});function ds(e){let[t,n]=_.useState(void 0);return qi(()=>{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)}n(void 0)},[e]),t}us(ds,`useSize`);var fs=Object.defineProperty,ps=(e,t)=>fs(e,`name`,{value:t,configurable:!0}),ms=`Popper`,[hs,gs]=si(ms),[_s,vs]=hs(ms),ys=ps(e=>{let{__scopePopper:t,children:n}=e,[r,i]=_.useState(null),[a,o]=_.useState(void 0);return(0,A.jsx)(_s,{scope:t,anchor:r,onAnchorChange:i,placementState:a,setPlacementState:o,children:n})},`Popper`),bs=`PopperAnchor`,xs=_.forwardRef(ps(function(e,t){let{__scopePopper:n,virtualRef:r,...i}=e,a=vs(bs,n),o=_.useRef(null),s=a.onAnchorChange,c=R(t,_.useCallback(e=>{o.current=e,e&&s(e)},[s])),l=_.useRef(null);_.useEffect(()=>{if(!r)return;let e=l.current;l.current=r.current,e!==l.current&&s(l.current)});let u=a.placementState&&Os(a.placementState),d=u?.[0],f=u?.[1];return r?null:(0,A.jsx)(Oi.div,{"data-radix-popper-side":d,"data-radix-popper-align":f,...i,ref:c})},`PopperAnchor`)),Ss=`PopperContent`,[Cs,ws]=hs(Ss),Ts=_.forwardRef(ps(function(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=vs(Ss,n),[v,y]=_.useState(null),b=R(t,y),[x,S]=_.useState(null),C=ds(x),w=C?.width??0,T=C?.height??0,E=r+(a===`center`?``:`-`+a),D=typeof u==`number`?u:{top:0,right:0,bottom:0,left:0,...u},O=Array.isArray(l)?l:[l],k=O.length>0,ee={padding:D,boundary:O.filter(Es),altBoundary:k},{refs:j,floatingStyles:M,placement:te,isPositioned:ne,middlewareData:N}=es({strategy:`fixed`,placement:E,whileElementsMounted:ps((...e)=>Vo(...e,{animationFrame:p===`always`}),`whileElementsMounted`),elements:{reference:g.anchor},middleware:[ns({mainAxis:i+T,alignmentAxis:o}),c&&rs({mainAxis:!0,crossAxis:!1,limiter:d===`partial`?is():void 0,...ee}),c&&as({...ee}),os({...ee,apply:ps(({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`)},`apply`)}),x&&cs({element:x,padding:s}),Ds({arrowWidth:w,arrowHeight:T}),f&&ss({strategy:`referenceHidden`,...ee,boundary:k?ee.boundary:void 0})]}),re=g.setPlacementState;qi(()=>(re(te),()=>{re(void 0)}),[te,re]);let[ie,ae]=Os(te),oe=Mi(m);qi(()=>{ne&&oe?.()},[ne,oe]);let se=N.arrow?.x,ce=N.arrow?.y,le=N.arrow?.centerOffset!==0,[ue,de]=_.useState();return qi(()=>{v&&de(window.getComputedStyle(v).zIndex)},[v]),(0,A.jsx)(`div`,{ref:j.setFloating,"data-radix-popper-content-wrapper":``,style:{...M,transform:ne?M.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:ue,"--radix-popper-transform-origin":[N.transformOrigin?.x,N.transformOrigin?.y].join(` `),...N.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,A.jsx)(Cs,{scope:n,placedSide:ie,placedAlign:ae,onArrowChange:S,arrowX:se,arrowY:ce,shouldHideArrow:le,children:(0,A.jsx)(Oi.div,{"data-side":ie,"data-align":ae,...h,ref:b,style:{...h.style,animation:ne?h.style?.animation:`none`}})})})},`PopperContent`));function Es(e){return e!==null}ps(Es,`isNotNull`);var Ds=ps(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]=Os(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}}}}),`transformOrigin`);function Os(e){let[t,n=`center`]=e.split(`-`);return[t,n]}ps(Os,`getSideAndAlignFromPlacement`);var ks=ys,As=xs,js=Ts,Ms=Object.defineProperty,Ns=_.forwardRef(((e,t)=>Ms(e,`name`,{value:t,configurable:!0}))(function(e,t){let{container:n,...r}=e,[i,a]=_.useState(!1);qi(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?Ti.createPortal((0,A.jsx)(Oi.div,{...r,ref:t}),o):null},`Portal`)),Ps=Object.defineProperty,Fs=(e,t)=>Ps(e,`name`,{value:t,configurable:!0});function Is(e,t){return _.useReducer((e,n)=>t[e][n]??e,e)}Fs(Is,`useStateMachine`);var Ls=Fs(e=>{let{present:t,children:n}=e,r=Rs(t),i=typeof n==`function`?n({present:r.isPresent}):_.Children.only(n),a=Bs(r.ref,Hs(i));return typeof n==`function`||r.isPresent?_.cloneElement(i,{ref:a}):null},`Presence`);function Rs(e){let[t,n]=_.useState(),r=_.useRef(null),i=_.useRef(e),a=_.useRef(`none`),o=_.useRef(void 0),[s,c]=Is(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return _.useEffect(()=>{s===`mounted`?(a.current=o.current??Vs(r.current),o.current=void 0):a.current=`none`},[s]),qi(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,s=Vs(t);e?(o.current=s,c(`MOUNT`)):s===`none`||t?.display===`none`?c(`UNMOUNT`):c(n&&r!==s?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,c]),qi(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=Fs(a=>{let o=Vs(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(c(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},`handleAnimationEnd`),s=Fs(e=>{e.target===t&&(a.current=Vs(r.current))},`handleAnimationStart`);return t.addEventListener(`animationstart`,s),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,s),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}c(`ANIMATION_END`)},[t,c]),{isPresent:[`mounted`,`unmountSuspended`].includes(s),ref:_.useCallback(e=>{if(e){let t=getComputedStyle(e);r.current=t,o.current=Vs(t)}else r.current=null;n(e)},[])}}Fs(Rs,`usePresence`);function zs(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}Fs(zs,`setRef`);function Bs(...e){let t=_.useRef(e);return t.current=e,_.useCallback(e=>{let n=t.current,r=!1,i=n.map(t=>{let n=zs(t,e);return!r&&typeof n==`function`&&(r=!0),n});if(r)return()=>{for(let e=0;e<i.length;e++){let t=i[e];typeof t==`function`?t():zs(n[e],null)}}},[])}Fs(Bs,`useStableComposedRefs`);function Vs(e){return e?.animationName||`none`}Fs(Vs,`getAnimationName`);function Hs(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)}Fs(Hs,`getElementRef`);var Us=Object.defineProperty,Ws=(e,t)=>Us(e,`name`,{value:t,configurable:!0}),Gs=_.useEffectEvent,Ks=_.useInsertionEffect;function qs(e){if(typeof Gs==`function`)return Gs(e);let t=_.useRef(()=>{throw Error(`Cannot call an event handler while rendering.`)});return typeof Ks==`function`?Ks(()=>{t.current=e}):qi(()=>{t.current=e}),_.useMemo(()=>((...e)=>t.current?.(...e)),[])}Ws(qs,`useEffectEvent`);var Js=Object.defineProperty,Ys=(e,t)=>Js(e,`name`,{value:t,configurable:!0}),Xs=_.useInsertionEffect||qi;function Zs({prop:e,defaultProp:t,onChange:n=Ys(()=>{},`onChange`),caller:r}){let[i,a,o]=Qs({defaultProp:t,onChange:n}),s=e!==void 0;return[s?e:i,_.useCallback(t=>{if(s){let n=$s(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}Ys(Zs,`useControllableState`);function Qs({defaultProp:e,onChange:t}){let[n,r]=_.useState(e),i=_.useRef(n),a=_.useRef(t);return Xs(()=>{a.current=t},[t]),_.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}Ys(Qs,`useUncontrolledState`);function $s(e){return typeof e==`function`}Ys($s,`isFunction`);var ec=Symbol(`RADIX:SYNC_STATE`);function tc(e,t,n,r){let{prop:i,defaultProp:a,onChange:o,caller:s}=t,c=i!==void 0,l=qs(o),u=[{...n,state:a}];r&&u.push(r);let[d,f]=_.useReducer((t,n)=>{if(n.type===ec)return{...t,state:n.state};let r=e(t,n);return c&&!Object.is(r.state,t.state)&&l(r.state),r},...u),p=d.state,m=_.useRef(p);_.useEffect(()=>{m.current!==p&&(m.current=p,c||l(p))},[p,m,c]);let h=_.useMemo(()=>i===void 0?d:{...d,state:i},[d,i]);return _.useEffect(()=>{c&&!Object.is(i,d.state)&&f({type:ec,state:i})},[i,d.state,c]),[h,f]}Ys(tc,`useControllableStateReducer`);var nc=Object.defineProperty,rc=(e,t)=>nc(e,`name`,{value:t,configurable:!0}),ic=Object.freeze({position:`absolute`,border:0,width:1,height:1,padding:0,margin:-1,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,wordWrap:`normal`}),ac=_.forwardRef(rc(function(e,t){return(0,A.jsx)(Oi.span,{...e,ref:t,style:{...ic,...e.style}})},`VisuallyHidden`)),oc=Object.defineProperty,sc=(e,t)=>oc(e,`name`,{value:t,configurable:!0}),[cc,lc]=si(`Tooltip`,[gs]),uc=gs(),dc=`TooltipProvider`,fc=`tooltip.open`,[pc,mc]=cc(dc),hc=`Tooltip`,[gc,_c]=cc(hc),vc=sc(e=>{let{__scopeTooltip:t,children:n,open:r,defaultOpen:i,onOpenChange:a,disableHoverableContent:o,delayDuration:s}=e,c=mc(hc,e.__scopeTooltip),l=uc(t),[u,d]=_.useState(null),[f,p]=_.useState(void 0),m=Qi(),h=_.useRef(0),g=o??c.disableHoverableContent,v=s??c.delayDuration,y=_.useRef(!1),[b,x]=Zs({prop:r,defaultProp:i??!1,onChange:sc(e=>{e?(c.onOpen(),document.dispatchEvent(new CustomEvent(fc))):c.onClose(),a?.(e)},`onChange`),caller:hc}),S=_.useMemo(()=>b?y.current?`delayed-open`:`instant-open`:`closed`,[b]),C=_.useCallback(()=>{window.clearTimeout(h.current),h.current=0,y.current=!1,x(!0)},[x]),w=_.useCallback(()=>{window.clearTimeout(h.current),h.current=0,x(!1)},[x]),T=_.useCallback(()=>{window.clearTimeout(h.current),h.current=window.setTimeout(()=>{y.current=!0,x(!0),h.current=0},v)},[v,x]);_.useEffect(()=>()=>{h.current&&=(window.clearTimeout(h.current),0)},[]);let E=f??m;return(0,A.jsx)(ks,{...l,children:(0,A.jsx)(gc,{scope:t,contentId:E,setContentId:p,open:b,stateAttribute:S,trigger:u,onTriggerChange:d,onTriggerEnter:_.useCallback(()=>{c.isOpenDelayedRef.current?T():C()},[c.isOpenDelayedRef,T,C]),onTriggerLeave:_.useCallback(()=>{g?w():(window.clearTimeout(h.current),h.current=0)},[w,g]),onOpen:C,onClose:w,disableHoverableContent:g,children:n})})},`Tooltip`),yc=`TooltipTrigger`,bc=_.forwardRef(sc(function(e,t){let{__scopeTooltip:n,...r}=e,i=_c(yc,n),a=mc(yc,n),o=uc(n),s=R(t,_.useRef(null),i.onTriggerChange),c=_.useRef(!1),l=_.useRef(!1),u=_.useCallback(()=>c.current=!1,[]);return _.useEffect(()=>()=>document.removeEventListener(`pointerup`,u),[u]),(0,A.jsx)(As,{asChild:!0,...o,children:(0,A.jsx)(Oi.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:s,onPointerMove:L(e.onPointerMove,e=>{e.pointerType!==`touch`&&!l.current&&!a.isPointerInTransitRef.current&&(i.onTriggerEnter(),l.current=!0)}),onPointerLeave:L(e.onPointerLeave,()=>{i.onTriggerLeave(),l.current=!1}),onPointerDown:L(e.onPointerDown,()=>{i.open&&i.onClose(),c.current=!0,document.addEventListener(`pointerup`,u,{once:!0})}),onFocus:L(e.onFocus,()=>{c.current||i.onOpen()}),onBlur:L(e.onBlur,i.onClose),onClick:L(e.onClick,i.onClose)})})},`TooltipTrigger`)),xc=`TooltipPortal`,[Sc,Cc]=cc(xc,{forceMount:void 0}),wc=sc(e=>{let{__scopeTooltip:t,forceMount:n,children:r,container:i}=e,a=_c(xc,t);return(0,A.jsx)(Sc,{scope:t,forceMount:n,children:(0,A.jsx)(Ls,{present:n||a.open,children:(0,A.jsx)(Ns,{asChild:!0,container:i,children:r})})})},`TooltipPortal`),Tc=`TooltipContent`,Ec=_.forwardRef(sc(function(e,t){let n=Cc(Tc,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i=`top`,...a}=e,o=_c(Tc,e.__scopeTooltip);return(0,A.jsx)(Ls,{present:r||o.open,children:o.disableHoverableContent?(0,A.jsx)(kc,{side:i,...a,ref:t}):(0,A.jsx)(Dc,{side:i,...a,ref:t})})},`TooltipContent`)),Dc=_.forwardRef(sc(function(e,t){let n=_c(Tc,e.__scopeTooltip),r=mc(Tc,e.__scopeTooltip),i=_.useRef(null),a=R(t,i),[o,s]=_.useState(null),{trigger:c,onClose:l}=n,u=i.current,{onPointerInTransitChange:d}=r,f=_.useCallback(()=>{s(null),d(!1)},[d]),p=_.useCallback((e,t)=>{let n=e.currentTarget,r={x:e.clientX,y:e.clientY},i=jc(r,Ac(r,n.getBoundingClientRect())),a=Mc(t.getBoundingClientRect()),o=Pc([...i,...a]);s(o),d(!0)},[d]);return _.useEffect(()=>()=>f(),[f]),_.useEffect(()=>{if(c&&u){let e=sc(e=>p(e,u),`handleTriggerLeave`),t=sc(e=>p(e,c),`handleContentLeave`);return c.addEventListener(`pointerleave`,e),u.addEventListener(`pointerleave`,t),()=>{c.removeEventListener(`pointerleave`,e),u.removeEventListener(`pointerleave`,t)}}},[c,u,p,f]),_.useEffect(()=>{if(o){let e=sc(e=>{let t=e.target,n={x:e.clientX,y:e.clientY},r=c?.contains(t)||u?.contains(t),i=!Nc(n,o);r?f():i&&(f(),l())},`handleTrackPointerGrace`);return document.addEventListener(`pointermove`,e),()=>document.removeEventListener(`pointermove`,e)}},[c,u,o,l,f]),(0,A.jsx)(kc,{...e,ref:a})},`TooltipContentHoverable`)),Oc=mi(`TooltipContent`),kc=_.forwardRef(sc(function(e,t){let{__scopeTooltip:n,children:r,"aria-label":i,id:a,onEscapeKeyDown:o,onPointerDownOutside:s,...c}=e,l=_c(Tc,n),u=uc(n),{onClose:d}=l;_.useEffect(()=>(document.addEventListener(fc,d),()=>document.removeEventListener(fc,d)),[d]),_.useEffect(()=>{if(l.trigger){let e=sc(e=>{e.target instanceof Node&&e.target.contains(l.trigger)&&d()},`handleScroll`);return window.addEventListener(`scroll`,e,{capture:!0}),()=>window.removeEventListener(`scroll`,e,{capture:!0})}},[l.trigger,d]);let{setContentId:f}=l;return qi(()=>(f(a),()=>{f(void 0)}),[a,f]),(0,A.jsx)(Bi,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:s,onFocusOutside:e=>e.preventDefault(),onDismiss:d,children:(0,A.jsxs)(js,{"data-state":l.stateAttribute,role:i?void 0:`tooltip`,id:i?void 0:l.contentId,...u,...c,ref:t,style:{...c.style,"--radix-tooltip-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-tooltip-content-available-width":`var(--radix-popper-available-width)`,"--radix-tooltip-content-available-height":`var(--radix-popper-available-height)`,"--radix-tooltip-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-tooltip-trigger-height":`var(--radix-popper-anchor-height)`},children:[(0,A.jsx)(Oc,{children:r}),i?(0,A.jsx)(ac,{id:l.contentId,role:`tooltip`,children:i}):null]})})},`TooltipContentImpl`));function Ac(e,t){let n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,r,i,a)){case a:return`left`;case i:return`right`;case n:return`top`;case r:return`bottom`;default:throw Error(`unreachable`)}}sc(Ac,`getExitSideFromRect`);function jc(e,t,n=5){let r=[];switch(t){case`top`:r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case`bottom`:r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case`left`:r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case`right`:r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n})}return r}sc(jc,`getPaddedExitPoints`);function Mc(e){let{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}sc(Mc,`getPointsFromRect`);function Nc(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}sc(Nc,`isPointInPolygon`);function Pc(e){let t=e.slice();return t.sort((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:+(e.y>t.y)),Fc(t)}sc(Pc,`getHull`);function Fc(e){if(e.length<=1)return e.slice();let t=[];for(let n=0;n<e.length;n++){let r=e[n];for(;t.length>=2;){let e=t[t.length-1],n=t[t.length-2];if((e.x-n.x)*(r.y-n.y)>=(e.y-n.y)*(r.x-n.x))t.pop();else break}t.push(r)}t.pop();let n=[];for(let t=e.length-1;t>=0;t--){let r=e[t];for(;n.length>=2;){let e=n[n.length-1],t=n[n.length-2];if((e.x-t.x)*(r.y-t.y)>=(e.y-t.y)*(r.x-t.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}sc(Fc,`getHullPresorted`);var Ic=vc,Lc=bc,Rc=wc,zc=Ec;function Bc(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`){if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=Bc(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n)}return r}function Vc(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=Bc(e))&&(r&&(r+=` `),r+=t);return r}var Hc=(e,t)=>{let n=Array(e.length+t.length);for(let t=0;t<e.length;t++)n[t]=e[t];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},Uc=(e,t)=>({classGroupId:e,validator:t}),Wc=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),Gc=`-`,Kc=[],qc=`arbitrary..`,Jc=e=>{let t=Zc(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith(`[`)&&e.endsWith(`]`))return Xc(e);let n=e.split(Gc);return Yc(n,+(n[0]===``&&n.length>1),t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=r[e],i=n[e];return t?i?Hc(i,t):t:i||Kc}return n[e]||Kc}}},Yc=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;let r=e[t],i=n.nextPart.get(r);if(i){let n=Yc(e,t+1,i);if(n)return n}let a=n.validators;if(a===null)return;let o=t===0?e.join(Gc):e.slice(t).join(Gc),s=a.length;for(let e=0;e<s;e++){let t=a[e];if(t.validator(o))return t.classGroupId}},Xc=e=>e.slice(1,-1).indexOf(`:`)===-1?void 0:(()=>{let t=e.slice(1,-1),n=t.indexOf(`:`),r=t.slice(0,n);return r?qc+r:void 0})(),Zc=e=>{let{theme:t,classGroups:n}=e;return Qc(n,t)},Qc=(e,t)=>{let n=Wc();for(let r in e){let i=e[r];$c(i,n,r,t)}return n},$c=(e,t,n,r)=>{let i=e.length;for(let a=0;a<i;a++){let i=e[a];el(i,t,n,r)}},el=(e,t,n,r)=>{if(typeof e==`string`){tl(e,t,n);return}if(typeof e==`function`){nl(e,t,n,r);return}rl(e,t,n,r)},tl=(e,t,n)=>{let r=e===``?t:il(t,e);r.classGroupId=n},nl=(e,t,n,r)=>{if(al(e)){$c(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(Uc(n,e))},rl=(e,t,n,r)=>{let i=Object.entries(e),a=i.length;for(let e=0;e<a;e++){let[a,o]=i[e];$c(o,il(t,a),n,r)}},il=(e,t)=>{let n=e,r=t.split(Gc),i=r.length;for(let e=0;e<i;e++){let t=r[e],i=n.nextPart.get(t);i||(i=Wc(),n.nextPart.set(t,i)),n=i}return n},al=e=>`isThemeGetter`in e&&e.isThemeGetter===!0,ol=e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null),i=(i,a)=>{n[i]=a,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(e){let t=n[e];if(t!==void 0)return t;if((t=r[e])!==void 0)return i(e,t),t},set(e,t){e in n?n[e]=t:i(e,t)}}},sl=`!`,cl=`:`,ll=[],ul=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),dl=e=>{let{prefix:t,experimentalParseClassName:n}=e,r=e=>{let t=[],n=0,r=0,i=0,a,o=e.length;for(let s=0;s<o;s++){let o=e[s];if(n===0&&r===0){if(o===cl){t.push(e.slice(i,s)),i=s+1;continue}if(o===`/`){a=s;continue}}o===`[`?n++:o===`]`?n--:o===`(`?r++:o===`)`&&r--}let s=t.length===0?e:e.slice(i),c=s,l=!1;s.endsWith(sl)?(c=s.slice(0,-1),l=!0):s.startsWith(sl)&&(c=s.slice(1),l=!0);let u=a&&a>i?a-i:void 0;return ul(t,l,c,u)};if(t){let e=t+cl,n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):ul(ll,!1,t,void 0,!0)}if(n){let e=r;r=t=>n({className:t,parseClassName:e})}return r},fl=e=>{let t=new Map;return e.orderSensitiveModifiers.forEach((e,n)=>{t.set(e,1e6+n)}),e=>{let n=[],r=[];for(let i=0;i<e.length;i++){let a=e[i],o=a[0]===`[`,s=t.has(a);o||s?(r.length>0&&(r.sort(),n.push(...r),r=[]),n.push(a)):r.push(a)}return r.length>0&&(r.sort(),n.push(...r)),n}},pl=e=>({cache:ol(e.cacheSize),parseClassName:dl(e),sortModifiers:fl(e),postfixLookupClassGroupIds:ml(e),...Jc(e)}),ml=e=>{let t=Object.create(null),n=e.postfixLookupClassGroups;if(n)for(let e=0;e<n.length;e++)t[n[e]]=!0;return t},hl=/\s+/,gl=(e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a,postfixLookupClassGroupIds:o}=t,s=[],c=e.trim().split(hl),l=``;for(let e=c.length-1;e>=0;--e){let t=c[e],{isExternal:u,modifiers:d,hasImportantModifier:f,baseClassName:p,maybePostfixModifierPosition:m}=n(t);if(u){l=t+(l.length>0?` `+l:l);continue}let h=!!m,g;if(h){g=r(p.substring(0,m));let e=g&&o[g]?r(p):void 0;e&&e!==g&&(g=e,h=!1)}else g=r(p);if(!g){if(!h){l=t+(l.length>0?` `+l:l);continue}if(g=r(p),!g){l=t+(l.length>0?` `+l:l);continue}h=!1}let _=d.length===0?``:d.length===1?d[0]:a(d).join(`:`),v=f?_+sl:_,y=v+g;if(s.indexOf(y)>-1)continue;s.push(y);let b=i(g,h);for(let e=0;e<b.length;++e){let t=b[e];s.push(v+t)}l=t+(l.length>0?` `+l:l)}return l},_l=(...e)=>{let t=0,n,r,i=``;for(;t<e.length;)(n=e[t++])&&(r=vl(n))&&(i&&(i+=` `),i+=r);return i},vl=e=>{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r<e.length;r++)e[r]&&(t=vl(e[r]))&&(n&&(n+=` `),n+=t);return n},yl=(e,...t)=>{let n,r,i,a,o=o=>(n=pl(t.reduce((e,t)=>t(e),e())),r=n.cache.get,i=n.cache.set,a=s,s(o)),s=e=>{let t=r(e);if(t)return t;let a=gl(e,n);return i(e,a),a};return a=o,(...e)=>a(_l(...e))},bl=[],V=e=>{let t=t=>t[e]||bl;return t.isThemeGetter=!0,t.themeKey=e,t},xl=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Sl=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Cl=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,wl=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Tl=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,El=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix|color|light-dark)\(.+\)$/,Dl=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Ol=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,kl=e=>Cl.test(e),H=e=>!!e&&!Number.isNaN(Number(e)),Al=e=>!!e&&Number.isInteger(Number(e)),jl=e=>e.endsWith(`%`)&&H(e.slice(0,-1)),Ml=e=>wl.test(e),Nl=()=>!0,Pl=e=>Tl.test(e)&&!El.test(e),Fl=()=>!1,Il=e=>Dl.test(e),Ll=e=>Ol.test(e),Rl=e=>!U(e)&&!W(e),zl=e=>e.startsWith(`@container`)&&(e[10]===`/`&&e[11]!==void 0||e[11]===`s`&&e[16]!==void 0&&e.startsWith(`-size/`,10)||e[11]===`n`&&e[18]!==void 0&&e.startsWith(`-normal/`,10)),Bl=e=>tu(e,G,Fl),U=e=>xl.test(e),Vl=e=>tu(e,au,Pl),Hl=e=>tu(e,ou,H),Ul=e=>tu(e,cu,Nl),Wl=e=>tu(e,su,Fl),Gl=e=>tu(e,ru,Fl),Kl=e=>tu(e,iu,Ll),ql=e=>tu(e,lu,Il),W=e=>Sl.test(e),Jl=e=>nu(e,au),Yl=e=>nu(e,su),Xl=e=>nu(e,ru),Zl=e=>nu(e,G),Ql=e=>nu(e,iu),$l=e=>nu(e,lu,!0),eu=e=>nu(e,cu,!0),tu=(e,t,n)=>{let r=xl.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},nu=(e,t,n=!1)=>{let r=Sl.exec(e);return r?r[1]?t(r[1]):n:!1},ru=e=>e===`position`||e===`percentage`,iu=e=>e===`image`||e===`url`,G=e=>e===`length`||e===`size`||e===`bg-size`,au=e=>e===`length`,ou=e=>e===`number`,su=e=>e===`family-name`,cu=e=>e===`number`||e===`weight`,lu=e=>e===`shadow`,uu=yl(()=>{let e=V(`color`),t=V(`font`),n=V(`text`),r=V(`font-weight`),i=V(`tracking`),a=V(`leading`),o=V(`breakpoint`),s=V(`container`),c=V(`spacing`),l=V(`radius`),u=V(`shadow`),d=V(`inset-shadow`),f=V(`text-shadow`),p=V(`drop-shadow`),m=V(`blur`),h=V(`perspective`),g=V(`aspect`),_=V(`ease`),v=V(`animate`),y=()=>[`auto`,`avoid`,`all`,`avoid-page`,`page`,`left`,`right`,`column`],b=()=>[`center`,`top`,`bottom`,`left`,`right`,`top-left`,`left-top`,`top-right`,`right-top`,`bottom-right`,`right-bottom`,`bottom-left`,`left-bottom`],x=()=>[...b(),W,U],S=()=>[`auto`,`hidden`,`clip`,`visible`,`scroll`],C=()=>[`auto`,`contain`,`none`],w=()=>[W,U,c],T=()=>[kl,`full`,`auto`,...w()],E=()=>[Al,`none`,`subgrid`,W,U],D=()=>[`auto`,{span:[`full`,Al,W,U]},Al,W,U],O=()=>[Al,`auto`,W,U],k=()=>[`auto`,`min`,`max`,`fr`,W,U],ee=()=>[`start`,`end`,`center`,`between`,`around`,`evenly`,`stretch`,`baseline`,`center-safe`,`end-safe`],A=()=>[`start`,`end`,`center`,`stretch`,`center-safe`,`end-safe`],j=()=>[`auto`,...w()],M=()=>[kl,`auto`,`full`,`dvw`,`dvh`,`lvw`,`lvh`,`svw`,`svh`,`min`,`max`,`fit`,...w()],te=()=>[s,kl,`screen`,`full`,`dvw`,`lvw`,`svw`,`min`,`max`,`fit`,...w()],ne=()=>[kl,`screen`,`full`,`lh`,`dvh`,`lvh`,`svh`,`min`,`max`,`fit`,...w()],N=()=>[e,W,U],re=()=>[...b(),Xl,Gl,{position:[W,U]}],ie=()=>[`no-repeat`,{repeat:[``,`x`,`y`,`space`,`round`]}],ae=()=>[`auto`,`cover`,`contain`,Zl,Bl,{size:[W,U]}],oe=()=>[jl,Jl,Vl],se=()=>[``,`none`,`full`,l,W,U],ce=()=>[``,H,Jl,Vl],le=()=>[`solid`,`dashed`,`dotted`,`double`],ue=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],de=()=>[H,jl,Xl,Gl],fe=()=>[``,`none`,m,W,U],pe=()=>[`none`,H,W,U],me=()=>[`none`,H,W,U],he=()=>[H,W,U],ge=()=>[kl,`full`,...w()];return{cacheSize:500,theme:{animate:[`spin`,`ping`,`pulse`,`bounce`],aspect:[`video`],blur:[Ml],breakpoint:[Ml],color:[Nl],container:[Ml],"drop-shadow":[Ml],ease:[`in`,`out`,`in-out`],font:[Rl],"font-weight":[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`],"inset-shadow":[Ml],leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`],perspective:[`dramatic`,`near`,`normal`,`midrange`,`distant`,`none`],radius:[Ml],shadow:[Ml],spacing:[`px`,H],text:[Ml],"text-shadow":[Ml],tracking:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`]},classGroups:{aspect:[{aspect:[`auto`,`square`,kl,U,W,g]}],container:[`container`],"container-type":[{"@container":[``,`normal`,`size`,W,U]}],"container-named":[zl],columns:[{columns:[H,`auto`,U,W,s]}],"break-after":[{"break-after":y()}],"break-before":[{"break-before":y()}],"break-inside":[{"break-inside":[`auto`,`avoid`,`avoid-page`,`avoid-column`]}],"box-decoration":[{"box-decoration":[`slice`,`clone`]}],box:[{box:[`border`,`content`]}],display:[`block`,`inline-block`,`inline`,`flex`,`inline-flex`,`table`,`inline-table`,`table-caption`,`table-cell`,`table-column`,`table-column-group`,`table-footer-group`,`table-header-group`,`table-row-group`,`table-row`,`flow-root`,`grid`,`inline-grid`,`contents`,`list-item`,`hidden`],sr:[`sr-only`,`not-sr-only`],float:[{float:[`right`,`left`,`none`,`start`,`end`]}],clear:[{clear:[`left`,`right`,`both`,`none`,`start`,`end`]}],isolation:[`isolate`,`isolation-auto`],"object-fit":[{object:[`contain`,`cover`,`fill`,`none`,`scale-down`]}],"object-position":[{object:x()}],overflow:[{overflow:S()}],"overflow-x":[{"overflow-x":S()}],"overflow-y":[{"overflow-y":S()}],overscroll:[{overscroll:C()}],"overscroll-x":[{"overscroll-x":C()}],"overscroll-y":[{"overscroll-y":C()}],position:[`static`,`fixed`,`absolute`,`relative`,`sticky`],inset:[{inset:T()}],"inset-x":[{"inset-x":T()}],"inset-y":[{"inset-y":T()}],start:[{"inset-s":T(),start:T()}],end:[{"inset-e":T(),end:T()}],"inset-bs":[{"inset-bs":T()}],"inset-be":[{"inset-be":T()}],top:[{top:T()}],right:[{right:T()}],bottom:[{bottom:T()}],left:[{left:T()}],visibility:[`visible`,`invisible`,`collapse`],z:[{z:[Al,`auto`,W,U]}],basis:[{basis:[kl,`full`,`auto`,s,...w()]}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`nowrap`,`wrap`,`wrap-reverse`]}],flex:[{flex:[H,kl,`auto`,`initial`,`none`,U]}],grow:[{grow:[``,H,W,U]}],shrink:[{shrink:[``,H,W,U]}],order:[{order:[Al,`first`,`last`,`none`,W,U]}],"grid-cols":[{"grid-cols":E()}],"col-start-end":[{col:D()}],"col-start":[{"col-start":O()}],"col-end":[{"col-end":O()}],"grid-rows":[{"grid-rows":E()}],"row-start-end":[{row:D()}],"row-start":[{"row-start":O()}],"row-end":[{"row-end":O()}],"grid-flow":[{"grid-flow":[`row`,`col`,`dense`,`row-dense`,`col-dense`]}],"auto-cols":[{"auto-cols":k()}],"auto-rows":[{"auto-rows":k()}],gap:[{gap:w()}],"gap-x":[{"gap-x":w()}],"gap-y":[{"gap-y":w()}],"justify-content":[{justify:[...ee(),`normal`]}],"justify-items":[{"justify-items":[...A(),`normal`]}],"justify-self":[{"justify-self":[`auto`,...A()]}],"align-content":[{content:[`normal`,...ee()]}],"align-items":[{items:[...A(),{baseline:[``,`last`]}]}],"align-self":[{self:[`auto`,...A(),{baseline:[``,`last`]}]}],"place-content":[{"place-content":ee()}],"place-items":[{"place-items":[...A(),`baseline`]}],"place-self":[{"place-self":[`auto`,...A()]}],p:[{p:w()}],px:[{px:w()}],py:[{py:w()}],ps:[{ps:w()}],pe:[{pe:w()}],pbs:[{pbs:w()}],pbe:[{pbe:w()}],pt:[{pt:w()}],pr:[{pr:w()}],pb:[{pb:w()}],pl:[{pl:w()}],m:[{m:j()}],mx:[{mx:j()}],my:[{my:j()}],ms:[{ms:j()}],me:[{me:j()}],mbs:[{mbs:j()}],mbe:[{mbe:j()}],mt:[{mt:j()}],mr:[{mr:j()}],mb:[{mb:j()}],ml:[{ml:j()}],"space-x":[{"space-x":w()}],"space-x-reverse":[`space-x-reverse`],"space-y":[{"space-y":w()}],"space-y-reverse":[`space-y-reverse`],size:[{size:M()}],"inline-size":[{inline:[`auto`,...te()]}],"min-inline-size":[{"min-inline":[`auto`,...te()]}],"max-inline-size":[{"max-inline":[`none`,...te()]}],"block-size":[{block:[`auto`,...ne()]}],"min-block-size":[{"min-block":[`auto`,...ne()]}],"max-block-size":[{"max-block":[`none`,...ne()]}],w:[{w:[s,`screen`,...M()]}],"min-w":[{"min-w":[s,`screen`,`none`,...M()]}],"max-w":[{"max-w":[s,`screen`,`none`,`prose`,{screen:[o]},...M()]}],h:[{h:[`screen`,`lh`,...M()]}],"min-h":[{"min-h":[`screen`,`lh`,`none`,...M()]}],"max-h":[{"max-h":[`screen`,`lh`,`none`,...M()]}],"font-size":[{text:[`base`,n,Jl,Vl]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[r,eu,Ul]}],"font-stretch":[{"font-stretch":[`ultra-condensed`,`extra-condensed`,`condensed`,`semi-condensed`,`normal`,`semi-expanded`,`expanded`,`extra-expanded`,`ultra-expanded`,jl,U]}],"font-family":[{font:[Yl,Wl,t]}],"font-features":[{"font-features":[U]}],"fvn-normal":[`normal-nums`],"fvn-ordinal":[`ordinal`],"fvn-slashed-zero":[`slashed-zero`],"fvn-figure":[`lining-nums`,`oldstyle-nums`],"fvn-spacing":[`proportional-nums`,`tabular-nums`],"fvn-fraction":[`diagonal-fractions`,`stacked-fractions`],tracking:[{tracking:[i,W,U]}],"line-clamp":[{"line-clamp":[H,`none`,W,Hl]}],leading:[{leading:[`none`,a,...w()]}],"list-image":[{"list-image":[`none`,W,U]}],"list-style-position":[{list:[`inside`,`outside`]}],"list-style-type":[{list:[`disc`,`decimal`,`none`,W,U]}],"text-alignment":[{text:[`left`,`center`,`right`,`justify`,`start`,`end`]}],"placeholder-color":[{placeholder:N()}],"text-color":[{text:N()}],"text-decoration":[`underline`,`overline`,`line-through`,`no-underline`],"text-decoration-style":[{decoration:[...le(),`wavy`]}],"text-decoration-thickness":[{decoration:[H,`from-font`,`auto`,W,Vl]}],"text-decoration-color":[{decoration:N()}],"underline-offset":[{"underline-offset":[H,`auto`,W,U]}],"text-transform":[`uppercase`,`lowercase`,`capitalize`,`normal-case`],"text-overflow":[`truncate`,`text-ellipsis`,`text-clip`],"text-wrap":[{text:[`wrap`,`nowrap`,`balance`,`pretty`]}],indent:[{indent:w()}],"tab-size":[{tab:[Al,W,U]}],"vertical-align":[{align:[`baseline`,`top`,`middle`,`bottom`,`text-top`,`text-bottom`,`sub`,`super`,W,U]}],whitespace:[{whitespace:[`normal`,`nowrap`,`pre`,`pre-line`,`pre-wrap`,`break-spaces`]}],break:[{break:[`normal`,`words`,`all`,`keep`]}],wrap:[{wrap:[`break-word`,`anywhere`,`normal`]}],hyphens:[{hyphens:[`none`,`manual`,`auto`]}],content:[{content:[`none`,W,U]}],"bg-attachment":[{bg:[`fixed`,`local`,`scroll`]}],"bg-clip":[{"bg-clip":[`border`,`padding`,`content`,`text`]}],"bg-origin":[{"bg-origin":[`border`,`padding`,`content`]}],"bg-position":[{bg:re()}],"bg-repeat":[{bg:ie()}],"bg-size":[{bg:ae()}],"bg-image":[{bg:[`none`,{linear:[{to:[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},Al,W,U],radial:[``,W,U],conic:[``,Al,W,U]},Ql,Kl]}],"bg-color":[{bg:N()}],"gradient-from-pos":[{from:oe()}],"gradient-via-pos":[{via:oe()}],"gradient-to-pos":[{to:oe()}],"gradient-from":[{from:N()}],"gradient-via":[{via:N()}],"gradient-to":[{to:N()}],rounded:[{rounded:se()}],"rounded-s":[{"rounded-s":se()}],"rounded-e":[{"rounded-e":se()}],"rounded-t":[{"rounded-t":se()}],"rounded-r":[{"rounded-r":se()}],"rounded-b":[{"rounded-b":se()}],"rounded-l":[{"rounded-l":se()}],"rounded-ss":[{"rounded-ss":se()}],"rounded-se":[{"rounded-se":se()}],"rounded-ee":[{"rounded-ee":se()}],"rounded-es":[{"rounded-es":se()}],"rounded-tl":[{"rounded-tl":se()}],"rounded-tr":[{"rounded-tr":se()}],"rounded-br":[{"rounded-br":se()}],"rounded-bl":[{"rounded-bl":se()}],"border-w":[{border:ce()}],"border-w-x":[{"border-x":ce()}],"border-w-y":[{"border-y":ce()}],"border-w-s":[{"border-s":ce()}],"border-w-e":[{"border-e":ce()}],"border-w-bs":[{"border-bs":ce()}],"border-w-be":[{"border-be":ce()}],"border-w-t":[{"border-t":ce()}],"border-w-r":[{"border-r":ce()}],"border-w-b":[{"border-b":ce()}],"border-w-l":[{"border-l":ce()}],"divide-x":[{"divide-x":ce()}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":ce()}],"divide-y-reverse":[`divide-y-reverse`],"border-style":[{border:[...le(),`hidden`,`none`]}],"divide-style":[{divide:[...le(),`hidden`,`none`]}],"border-color":[{border:N()}],"border-color-x":[{"border-x":N()}],"border-color-y":[{"border-y":N()}],"border-color-s":[{"border-s":N()}],"border-color-e":[{"border-e":N()}],"border-color-bs":[{"border-bs":N()}],"border-color-be":[{"border-be":N()}],"border-color-t":[{"border-t":N()}],"border-color-r":[{"border-r":N()}],"border-color-b":[{"border-b":N()}],"border-color-l":[{"border-l":N()}],"divide-color":[{divide:N()}],"outline-style":[{outline:[...le(),`none`,`hidden`]}],"outline-offset":[{"outline-offset":[H,W,U]}],"outline-w":[{outline:[``,H,Jl,Vl]}],"outline-color":[{outline:N()}],shadow:[{shadow:[``,`inner`,`none`,u,$l,ql]}],"shadow-color":[{shadow:N()}],"inset-shadow":[{"inset-shadow":[`none`,d,$l,ql]}],"inset-shadow-color":[{"inset-shadow":N()}],"ring-w":[{ring:ce()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:N()}],"ring-offset-w":[{"ring-offset":[H,Vl]}],"ring-offset-color":[{"ring-offset":N()}],"inset-ring-w":[{"inset-ring":ce()}],"inset-ring-color":[{"inset-ring":N()}],"text-shadow":[{"text-shadow":[`none`,f,$l,ql]}],"text-shadow-color":[{"text-shadow":N()}],opacity:[{opacity:[H,W,U]}],"mix-blend":[{"mix-blend":[...ue(),`plus-darker`,`plus-lighter`]}],"bg-blend":[{"bg-blend":ue()}],"mask-clip":[{"mask-clip":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]},`mask-no-clip`],"mask-composite":[{mask:[`add`,`subtract`,`intersect`,`exclude`]}],"mask-image-linear-pos":[{"mask-linear":[H]}],"mask-image-linear-from-pos":[{"mask-linear-from":de()}],"mask-image-linear-to-pos":[{"mask-linear-to":de()}],"mask-image-linear-from-color":[{"mask-linear-from":N()}],"mask-image-linear-to-color":[{"mask-linear-to":N()}],"mask-image-t-from-pos":[{"mask-t-from":de()}],"mask-image-t-to-pos":[{"mask-t-to":de()}],"mask-image-t-from-color":[{"mask-t-from":N()}],"mask-image-t-to-color":[{"mask-t-to":N()}],"mask-image-r-from-pos":[{"mask-r-from":de()}],"mask-image-r-to-pos":[{"mask-r-to":de()}],"mask-image-r-from-color":[{"mask-r-from":N()}],"mask-image-r-to-color":[{"mask-r-to":N()}],"mask-image-b-from-pos":[{"mask-b-from":de()}],"mask-image-b-to-pos":[{"mask-b-to":de()}],"mask-image-b-from-color":[{"mask-b-from":N()}],"mask-image-b-to-color":[{"mask-b-to":N()}],"mask-image-l-from-pos":[{"mask-l-from":de()}],"mask-image-l-to-pos":[{"mask-l-to":de()}],"mask-image-l-from-color":[{"mask-l-from":N()}],"mask-image-l-to-color":[{"mask-l-to":N()}],"mask-image-x-from-pos":[{"mask-x-from":de()}],"mask-image-x-to-pos":[{"mask-x-to":de()}],"mask-image-x-from-color":[{"mask-x-from":N()}],"mask-image-x-to-color":[{"mask-x-to":N()}],"mask-image-y-from-pos":[{"mask-y-from":de()}],"mask-image-y-to-pos":[{"mask-y-to":de()}],"mask-image-y-from-color":[{"mask-y-from":N()}],"mask-image-y-to-color":[{"mask-y-to":N()}],"mask-image-radial":[{"mask-radial":[W,U]}],"mask-image-radial-from-pos":[{"mask-radial-from":de()}],"mask-image-radial-to-pos":[{"mask-radial-to":de()}],"mask-image-radial-from-color":[{"mask-radial-from":N()}],"mask-image-radial-to-color":[{"mask-radial-to":N()}],"mask-image-radial-shape":[{"mask-radial":[`circle`,`ellipse`]}],"mask-image-radial-size":[{"mask-radial":[{closest:[`side`,`corner`],farthest:[`side`,`corner`]}]}],"mask-image-radial-pos":[{"mask-radial-at":b()}],"mask-image-conic-pos":[{"mask-conic":[H]}],"mask-image-conic-from-pos":[{"mask-conic-from":de()}],"mask-image-conic-to-pos":[{"mask-conic-to":de()}],"mask-image-conic-from-color":[{"mask-conic-from":N()}],"mask-image-conic-to-color":[{"mask-conic-to":N()}],"mask-mode":[{mask:[`alpha`,`luminance`,`match`]}],"mask-origin":[{"mask-origin":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]}],"mask-position":[{mask:re()}],"mask-repeat":[{mask:ie()}],"mask-size":[{mask:ae()}],"mask-type":[{"mask-type":[`alpha`,`luminance`]}],"mask-image":[{mask:[`none`,W,U]}],filter:[{filter:[``,`none`,W,U]}],blur:[{blur:fe()}],brightness:[{brightness:[H,W,U]}],contrast:[{contrast:[H,W,U]}],"drop-shadow":[{"drop-shadow":[``,`none`,p,$l,ql]}],"drop-shadow-color":[{"drop-shadow":N()}],grayscale:[{grayscale:[``,H,W,U]}],"hue-rotate":[{"hue-rotate":[H,W,U]}],invert:[{invert:[``,H,W,U]}],saturate:[{saturate:[H,W,U]}],sepia:[{sepia:[``,H,W,U]}],"backdrop-filter":[{"backdrop-filter":[``,`none`,W,U]}],"backdrop-blur":[{"backdrop-blur":fe()}],"backdrop-brightness":[{"backdrop-brightness":[H,W,U]}],"backdrop-contrast":[{"backdrop-contrast":[H,W,U]}],"backdrop-grayscale":[{"backdrop-grayscale":[``,H,W,U]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[H,W,U]}],"backdrop-invert":[{"backdrop-invert":[``,H,W,U]}],"backdrop-opacity":[{"backdrop-opacity":[H,W,U]}],"backdrop-saturate":[{"backdrop-saturate":[H,W,U]}],"backdrop-sepia":[{"backdrop-sepia":[``,H,W,U]}],"border-collapse":[{border:[`collapse`,`separate`]}],"border-spacing":[{"border-spacing":w()}],"border-spacing-x":[{"border-spacing-x":w()}],"border-spacing-y":[{"border-spacing-y":w()}],"table-layout":[{table:[`auto`,`fixed`]}],caption:[{caption:[`top`,`bottom`]}],transition:[{transition:[``,`all`,`colors`,`opacity`,`shadow`,`transform`,`none`,W,U]}],"transition-behavior":[{transition:[`normal`,`discrete`]}],duration:[{duration:[H,`initial`,W,U]}],ease:[{ease:[`linear`,`initial`,_,W,U]}],delay:[{delay:[H,W,U]}],animate:[{animate:[`none`,v,W,U]}],backface:[{backface:[`hidden`,`visible`]}],perspective:[{perspective:[h,W,U]}],"perspective-origin":[{"perspective-origin":x()}],rotate:[{rotate:pe()}],"rotate-x":[{"rotate-x":pe()}],"rotate-y":[{"rotate-y":pe()}],"rotate-z":[{"rotate-z":pe()}],scale:[{scale:me()}],"scale-x":[{"scale-x":me()}],"scale-y":[{"scale-y":me()}],"scale-z":[{"scale-z":me()}],"scale-3d":[`scale-3d`],skew:[{skew:he()}],"skew-x":[{"skew-x":he()}],"skew-y":[{"skew-y":he()}],transform:[{transform:[W,U,``,`none`,`gpu`,`cpu`]}],"transform-origin":[{origin:x()}],"transform-style":[{transform:[`3d`,`flat`]}],translate:[{translate:ge()}],"translate-x":[{"translate-x":ge()}],"translate-y":[{"translate-y":ge()}],"translate-z":[{"translate-z":ge()}],"translate-none":[`translate-none`],zoom:[{zoom:[Al,W,U]}],accent:[{accent:N()}],appearance:[{appearance:[`none`,`auto`]}],"caret-color":[{caret:N()}],"color-scheme":[{scheme:[`normal`,`dark`,`light`,`light-dark`,`only-dark`,`only-light`]}],cursor:[{cursor:[`auto`,`default`,`pointer`,`wait`,`text`,`move`,`help`,`not-allowed`,`none`,`context-menu`,`progress`,`cell`,`crosshair`,`vertical-text`,`alias`,`copy`,`no-drop`,`grab`,`grabbing`,`all-scroll`,`col-resize`,`row-resize`,`n-resize`,`e-resize`,`s-resize`,`w-resize`,`ne-resize`,`nw-resize`,`se-resize`,`sw-resize`,`ew-resize`,`ns-resize`,`nesw-resize`,`nwse-resize`,`zoom-in`,`zoom-out`,W,U]}],"field-sizing":[{"field-sizing":[`fixed`,`content`]}],"pointer-events":[{"pointer-events":[`auto`,`none`]}],resize:[{resize:[`none`,``,`y`,`x`]}],"scroll-behavior":[{scroll:[`auto`,`smooth`]}],"scrollbar-thumb-color":[{"scrollbar-thumb":N()}],"scrollbar-track-color":[{"scrollbar-track":N()}],"scrollbar-gutter":[{"scrollbar-gutter":[`auto`,`stable`,`both`]}],"scrollbar-w":[{scrollbar:[`auto`,`thin`,`none`]}],"scroll-m":[{"scroll-m":w()}],"scroll-mx":[{"scroll-mx":w()}],"scroll-my":[{"scroll-my":w()}],"scroll-ms":[{"scroll-ms":w()}],"scroll-me":[{"scroll-me":w()}],"scroll-mbs":[{"scroll-mbs":w()}],"scroll-mbe":[{"scroll-mbe":w()}],"scroll-mt":[{"scroll-mt":w()}],"scroll-mr":[{"scroll-mr":w()}],"scroll-mb":[{"scroll-mb":w()}],"scroll-ml":[{"scroll-ml":w()}],"scroll-p":[{"scroll-p":w()}],"scroll-px":[{"scroll-px":w()}],"scroll-py":[{"scroll-py":w()}],"scroll-ps":[{"scroll-ps":w()}],"scroll-pe":[{"scroll-pe":w()}],"scroll-pbs":[{"scroll-pbs":w()}],"scroll-pbe":[{"scroll-pbe":w()}],"scroll-pt":[{"scroll-pt":w()}],"scroll-pr":[{"scroll-pr":w()}],"scroll-pb":[{"scroll-pb":w()}],"scroll-pl":[{"scroll-pl":w()}],"snap-align":[{snap:[`start`,`end`,`center`,`align-none`]}],"snap-stop":[{snap:[`normal`,`always`]}],"snap-type":[{snap:[`none`,`x`,`y`,`both`]}],"snap-strictness":[{snap:[`mandatory`,`proximity`]}],touch:[{touch:[`auto`,`none`,`manipulation`]}],"touch-x":[{"touch-pan":[`x`,`left`,`right`]}],"touch-y":[{"touch-pan":[`y`,`up`,`down`]}],"touch-pz":[`touch-pinch-zoom`],select:[{select:[`none`,`text`,`all`,`auto`]}],"will-change":[{"will-change":[`auto`,`scroll`,`contents`,`transform`,W,U]}],fill:[{fill:[`none`,...N()]}],"stroke-w":[{stroke:[H,Jl,Vl,Hl]}],stroke:[{stroke:[`none`,...N()]}],"forced-color-adjust":[{"forced-color-adjust":[`auto`,`none`]}]},conflictingClassGroups:{"container-named":[`container-type`],overflow:[`overflow-x`,`overflow-y`],overscroll:[`overscroll-x`,`overscroll-y`],inset:[`inset-x`,`inset-y`,`inset-bs`,`inset-be`,`start`,`end`,`top`,`right`,`bottom`,`left`],"inset-x":[`start`,`end`,`right`,`left`],"inset-y":[`inset-bs`,`inset-be`,`top`,`bottom`],flex:[`basis`,`grow`,`shrink`],gap:[`gap-x`,`gap-y`],p:[`px`,`py`,`ps`,`pe`,`pbs`,`pbe`,`pt`,`pr`,`pb`,`pl`],px:[`ps`,`pe`,`pr`,`pl`],py:[`pbs`,`pbe`,`pt`,`pb`],m:[`mx`,`my`,`ms`,`me`,`mbs`,`mbe`,`mt`,`mr`,`mb`,`ml`],mx:[`ms`,`me`,`mr`,`ml`],my:[`mbs`,`mbe`,`mt`,`mb`],size:[`w`,`h`],"font-size":[`leading`],"fvn-normal":[`fvn-ordinal`,`fvn-slashed-zero`,`fvn-figure`,`fvn-spacing`,`fvn-fraction`],"fvn-ordinal":[`fvn-normal`],"fvn-slashed-zero":[`fvn-normal`],"fvn-figure":[`fvn-normal`],"fvn-spacing":[`fvn-normal`],"fvn-fraction":[`fvn-normal`],"line-clamp":[`display`,`overflow`],rounded:[`rounded-s`,`rounded-e`,`rounded-t`,`rounded-r`,`rounded-b`,`rounded-l`,`rounded-ss`,`rounded-se`,`rounded-ee`,`rounded-es`,`rounded-tl`,`rounded-tr`,`rounded-br`,`rounded-bl`],"rounded-s":[`rounded-ss`,`rounded-es`],"rounded-e":[`rounded-se`,`rounded-ee`],"rounded-t":[`rounded-tl`,`rounded-tr`],"rounded-r":[`rounded-tr`,`rounded-br`],"rounded-b":[`rounded-br`,`rounded-bl`],"rounded-l":[`rounded-tl`,`rounded-bl`],"border-spacing":[`border-spacing-x`,`border-spacing-y`],"border-w":[`border-w-x`,`border-w-y`,`border-w-s`,`border-w-e`,`border-w-bs`,`border-w-be`,`border-w-t`,`border-w-r`,`border-w-b`,`border-w-l`],"border-w-x":[`border-w-s`,`border-w-e`,`border-w-r`,`border-w-l`],"border-w-y":[`border-w-bs`,`border-w-be`,`border-w-t`,`border-w-b`],"border-color":[`border-color-x`,`border-color-y`,`border-color-s`,`border-color-e`,`border-color-bs`,`border-color-be`,`border-color-t`,`border-color-r`,`border-color-b`,`border-color-l`],"border-color-x":[`border-color-s`,`border-color-e`,`border-color-r`,`border-color-l`],"border-color-y":[`border-color-bs`,`border-color-be`,`border-color-t`,`border-color-b`],translate:[`translate-x`,`translate-y`,`translate-none`],"translate-none":[`translate`,`translate-x`,`translate-y`,`translate-z`],"scroll-m":[`scroll-mx`,`scroll-my`,`scroll-ms`,`scroll-me`,`scroll-mbs`,`scroll-mbe`,`scroll-mt`,`scroll-mr`,`scroll-mb`,`scroll-ml`],"scroll-mx":[`scroll-ms`,`scroll-me`,`scroll-mr`,`scroll-ml`],"scroll-my":[`scroll-mbs`,`scroll-mbe`,`scroll-mt`,`scroll-mb`],"scroll-p":[`scroll-px`,`scroll-py`,`scroll-ps`,`scroll-pe`,`scroll-pbs`,`scroll-pbe`,`scroll-pt`,`scroll-pr`,`scroll-pb`,`scroll-pl`],"scroll-px":[`scroll-ps`,`scroll-pe`,`scroll-pr`,`scroll-pl`],"scroll-py":[`scroll-pbs`,`scroll-pbe`,`scroll-pt`,`scroll-pb`],touch:[`touch-x`,`touch-y`,`touch-pz`],"touch-x":[`touch`],"touch-y":[`touch`],"touch-pz":[`touch`]},conflictingClassGroupModifiers:{"font-size":[`leading`]},postfixLookupClassGroups:[`container-type`],orderSensitiveModifiers:[`*`,`**`,`after`,`backdrop`,`before`,`details-content`,`file`,`first-letter`,`first-line`,`marker`,`placeholder`,`selection`]}});function K(...e){return uu(Vc(e))}var du=`matrx-motion-overlay`,fu=`matrx-motion-popper`;[...Object.values({top:`matrx-motion-sheet-top`,bottom:`matrx-motion-sheet-bottom`,left:`matrx-motion-sheet-left`,right:`matrx-motion-sheet-right`,center:`matrx-motion-sheet-center`})];var pu=Symbol.for(`ai-matrx.design-system.portal-container-context`),mu=globalThis,hu=mu[pu]??=_.createContext(void 0);function gu({container:e,children:t}){return(0,A.jsx)(hu.Provider,{value:e??void 0,children:t})}function _u(e){let t=_.useContext(hu);return e===void 0?t??void 0:e??void 0}var vu=`data-matrx-tooltip-trigger`,yu=Ic,bu=_.forwardRef((e,t)=>(0,A.jsx)(Lc,{ref:t,[vu]:``,...e}));bu.displayName=Lc.displayName;var xu=_.forwardRef(({className:e,sideOffset:t=4,container:n,animated:r=!0,...i},a)=>{let o=_u(n);return(0,A.jsx)(Rc,{container:o??null,children:(0,A.jsx)(zc,{ref:a,"data-slot":`tooltip-content`,sideOffset:t,className:K(`matrx-tooltip z-[10001] overflow-hidden rounded-md border border-border bg-popover px-2.5 py-1 text-xs font-medium text-popover-foreground`,r&&`matrx-motion-popper`,e),...i})})});xu.displayName=zc.displayName;function Su(...e){return e.filter(Boolean).join(` `).trim()}var Cu=Symbol.for(`@ai-matrx/tap-target:link-component`);function wu(){return globalThis[Cu]??null}var Tu=/^(https?:|mailto:|tel:)/i,Eu=`matrx-tap-target group`,Du=`matrx-tap-target matrx-tap-target-sm group`;function Ou({icon:e,children:t,strokeWidth:n=2,className:r}){return e?(0,_.isValidElement)(e)?(0,_.cloneElement)(e,{className:Su(r,e.props.className)}):(0,A.jsx)(`span`,{className:r,children:e}):(0,A.jsx)(`svg`,{className:r,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:n,strokeLinecap:`round`,strokeLinejoin:`round`,children:t})}function ku(e,t,n){let r=!!e;return t===`sm`?{outerClassName:r&&n?`matrx-tap-target matrx-tap-target-sm matrx-tap-target-mobile-icon-only-sm group`:r?`matrx-tap-target matrx-tap-target-sm matrx-tap-target-inline-sm group`:Du,inlineModifier:n?`matrx-tap-pill-mobile-icon-only-sm`:`matrx-tap-pill-inline-sm`}:{outerClassName:r&&n?`${Eu} matrx-tap-target-mobile-icon-only`:r?`${Eu} matrx-tap-target-inline`:Eu,inlineModifier:n?`matrx-tap-pill-mobile-icon-only`:`matrx-tap-pill-inline`}}function Au({label:e,pillClassName:t,iconClassName:n,labelClassName:r,inlineModifier:i,icon:a,children:o,strokeWidth:s=2}){let c=(0,A.jsx)(Ou,{icon:a,strokeWidth:s,className:n,children:o}),l=e?`${t} ${i}`.trim():t;return e?(0,A.jsxs)(`div`,{className:l,children:[c,(0,A.jsx)(`span`,{className:r??`matrx-tap-label`,children:e})]}):(0,A.jsx)(`div`,{className:l,children:c})}function ju({size:e=`default`,pillClassName:t,iconClassName:n,labelClassName:r,icon:i,children:a,strokeWidth:o,label:s,mobileIconOnly:c=!1,onClick:l,as:u,htmlFor:d,ariaLabel:f,disabled:p,href:m,target:h,rel:g,prefetch:_,linkComponent:v,tooltip:y,tooltipSide:b,tooltipAlign:x,rest:S,buttonRef:C}){let{outerClassName:w,inlineModifier:T}=ku(s,e,c),E=Au({label:s,pillClassName:t,iconClassName:n,labelClassName:c?`${r??`matrx-tap-label`} matrx-tap-label-mobile-icon-only`:r,inlineModifier:s?T:``,icon:i,children:a,strokeWidth:o}),D=y===void 0?!s&&void 0:y,O=s&&!c?void 0:f??s;return Nu(Mu({href:m,target:h,rel:g,prefetch:_,linkComponent:v,as:u,htmlFor:d,onClick:l,ariaLabel:O,disabled:p,outerClassName:w,children:E,rest:S,buttonRef:C}),{tooltip:D,ariaLabel:O,disabled:p,tooltipSide:b,tooltipAlign:x})}function Mu({href:e,target:t,rel:n,prefetch:r,linkComponent:i,as:a,htmlFor:o,onClick:s,ariaLabel:c,disabled:l,outerClassName:u,children:d,rest:f,buttonRef:p}){if(l&&e)return(0,A.jsx)(`span`,{"aria-disabled":`true`,"aria-label":c,className:`${u} opacity-40 pointer-events-none`,children:d});if(e){if(Tu.test(e))return(0,A.jsx)(`a`,{href:e,target:t??`_blank`,rel:n??`noopener noreferrer`,"aria-label":c,className:u,children:d});let a=i??wu();return a?(0,A.jsx)(a,{href:e,target:t,rel:n,prefetch:r,"aria-label":c,className:u,children:d}):(0,A.jsx)(`a`,{href:e,target:t,rel:n,"aria-label":c,className:u,children:d})}return a===`label`?(0,A.jsx)(`label`,{htmlFor:o,"aria-label":c,className:u,children:d}):(0,A.jsx)(`button`,{ref:p,type:`button`,onClick:s,"aria-label":c,disabled:l,...f,className:u,children:d})}function Nu(e,{tooltip:t,ariaLabel:n,disabled:r,tooltipSide:i=`top`,tooltipAlign:a=`center`}){if(t===!1)return e;let o=typeof t==`string`&&t.length>0?t:n;return o?(0,A.jsxs)(yu,{children:[(0,A.jsx)(bu,{asChild:!0,children:r?(0,A.jsx)(`span`,{className:`inline-flex`,children:e}):e}),(0,A.jsx)(xu,{side:i,align:a,children:o})]}):e}var Pu=(0,_.forwardRef)(function({icon:e,children:t,strokeWidth:n=2,onClick:r,className:i,as:a,htmlFor:o,ariaLabel:s,disabled:c,href:l,target:u,rel:d,prefetch:f,linkComponent:p,tooltip:m,tooltipSide:h,tooltipAlign:g,label:_,mobileIconOnly:v,...y},b){return ju({icon:e,children:t,strokeWidth:n,onClick:r,as:a,htmlFor:o,ariaLabel:s,disabled:c,href:l,target:u,rel:d,prefetch:f,linkComponent:p,tooltip:m,tooltipSide:h,tooltipAlign:g,label:_,mobileIconOnly:v,pillClassName:`matrx-tap-pill matrx-glass-thin-border`,iconClassName:`matrx-tap-icon ${i??`text-foreground`}`,rest:y,buttonRef:b})});(0,_.forwardRef)(function({icon:e,children:t,strokeWidth:n=2,onClick:r,className:i,as:a,htmlFor:o,ariaLabel:s,disabled:c,href:l,target:u,rel:d,prefetch:f,linkComponent:p,tooltip:m,tooltipSide:h,tooltipAlign:g,label:_,mobileIconOnly:v,...y},b){return ju({icon:e,children:t,strokeWidth:n,onClick:r,as:a,htmlFor:o,ariaLabel:s,disabled:c,href:l,target:u,rel:d,prefetch:f,linkComponent:p,tooltip:m,tooltipSide:h,tooltipAlign:g,label:_,mobileIconOnly:v,pillClassName:`matrx-tap-pill hover:bg-muted active:bg-muted-foreground/15`,iconClassName:`matrx-tap-icon ${i??`text-foreground`}`,rest:y,buttonRef:b})}),(0,_.forwardRef)(function({icon:e,children:t,strokeWidth:n=2,onClick:r,className:i,as:a,htmlFor:o,ariaLabel:s,disabled:c,href:l,target:u,rel:d,prefetch:f,linkComponent:p,tooltip:m,tooltipSide:h,tooltipAlign:g,label:_,mobileIconOnly:v,...y},b){let x=i??`text-muted-foreground group-hover:text-foreground`;return ju({icon:e,children:t,strokeWidth:n,onClick:r,as:a,htmlFor:o,ariaLabel:s,disabled:c,href:l,target:u,rel:d,prefetch:f,linkComponent:p,tooltip:m,tooltipSide:h,tooltipAlign:g,label:_,mobileIconOnly:v,pillClassName:`matrx-tap-pill border border-border bg-transparent transition-colors group-hover:border-primary/60 active:bg-muted`,iconClassName:`matrx-tap-icon ${x}`,labelClassName:`matrx-tap-label ${x}`,rest:y,buttonRef:b})});var Fu=(0,_.forwardRef)(function({icon:e,children:t,strokeWidth:n=2,onClick:r,as:i,htmlFor:a,ariaLabel:o,disabled:s,href:c,target:l,rel:u,prefetch:d,linkComponent:f,bgColor:p=`bg-primary`,iconColor:m=`text-primary-foreground`,hoverBgColor:h=`hover:bg-primary/80`,activeBgColor:g=`active:brightness-90`,tooltip:_,tooltipSide:v,tooltipAlign:y,label:b,mobileIconOnly:x,...S},C){return ju({icon:e,children:t,strokeWidth:n,onClick:r,as:i,htmlFor:a,ariaLabel:o,disabled:s,href:c,target:l,rel:u,prefetch:d,linkComponent:f,tooltip:_,tooltipSide:v,tooltipAlign:y,label:b,mobileIconOnly:x,pillClassName:`matrx-tap-pill ${p} ${m} ${h} ${g}`,iconClassName:`matrx-tap-icon ${m}`,labelClassName:`matrx-tap-label ${m}`,rest:S,buttonRef:C})});(0,_.forwardRef)(function({bgColor:e=`bg-destructive`,iconColor:t=`text-destructive-foreground`,hoverBgColor:n=`hover:bg-destructive/90`,...r},i){return(0,A.jsx)(Fu,{ref:i,bgColor:e,iconColor:t,hoverBgColor:n,...r})}),(0,_.forwardRef)(function({icon:e,children:t,strokeWidth:n=2,onClick:r,className:i,as:a,htmlFor:o,ariaLabel:s,disabled:c,href:l,target:u,rel:d,prefetch:f,linkComponent:p,tooltip:m,tooltipSide:h,tooltipAlign:g,label:_,mobileIconOnly:v,...y},b){let x=i??`text-foreground`;return ju({size:`sm`,icon:e,children:t,strokeWidth:n,onClick:r,as:a,htmlFor:o,ariaLabel:s,disabled:c,href:l,target:u,rel:d,prefetch:f,linkComponent:p,tooltip:m,tooltipSide:h,tooltipAlign:g,label:_,mobileIconOnly:v,pillClassName:`matrx-tap-pill matrx-tap-pill-sm matrx-glass-interactive`,iconClassName:`matrx-tap-icon ${x}`,labelClassName:`matrx-tap-label ${x}`,rest:y,buttonRef:b})});function Iu(e){let t=(0,_.useRef)(null),n=(0,_.useRef)(!0),r=(0,_.useRef)(!1),[i,a]=(0,_.useState)(!0),[o,s]=(0,_.useState)(!1),c=(0,_.useCallback)(e=>e.scrollHeight-e.scrollTop-e.clientHeight<=48,[]),l=(0,_.useCallback)(e=>{r.current=!0,e.scrollTop=e.scrollHeight},[]),u=(0,_.useCallback)(()=>{let e=t.current;if(e===null)return;if(r.current){r.current=!1;return}let i=c(e);n.current=i,a(i),i&&s(!1)},[c]),d=(0,_.useCallback)(e=>{let n=t.current;n!==null&&n.removeEventListener(`scroll`,u),t.current=e,e!==null&&e.addEventListener(`scroll`,u,{passive:!0})},[u]);(0,_.useEffect)(()=>()=>{let e=t.current;e!==null&&e.removeEventListener(`scroll`,u)},[u]);let f=(0,_.useCallback)(()=>{let r=t.current;if(r!==null&&e){if(n.current){l(r);return}s(!0)}},[e,l]);return{ref:d,pinned:i,hasUnseenBelow:o,jumpToLatest:(0,_.useCallback)(()=>{let e=t.current;e!==null&&(l(e),n.current=!0,a(!0),s(!1))},[l]),onContentChange:f}}function Lu(e){let t=[],n=``,r=0;for(let i of xt(e)){if(i.start<r)continue;n+=e.slice(r,i.start);let a=e.slice(i.start,i.end);t.push(i.kind===`fence`?` code block `:Ru(a)),n+=`\uE300${t.length-1}\uE301`,r=i.end}return n+=e.slice(r),n.replace(/!\[([^\]]*)\]\([^)]*\)/g,`$1`).replace(/\[([^\]]*)\]\([^)]*\)/g,`$1`).replace(/^\s{0,3}#{1,6}\s+/gm,``).replace(/^\s{0,3}>\s?/gm,``).replace(/^\s{0,3}([*+-]|\d+\.)\s+/gm,``).replace(/(\*\*\*|___)(.+?)\1/g,`$2`).replace(/(\*\*|__)(.+?)\1/g,`$2`).replace(/(\*|_)(.+?)\1/g,`$2`).replace(/~~(.+?)~~/g,`$1`).replace(/^\s{0,3}([-*_]\s?){3,}$/gm,``).replace(/\uE300(\d+)\uE301/g,(e,n)=>t[Number(n)]??``).replace(/[ \t]{2,}/g,` `)}function Ru(e){let t=/^`+/.exec(e)?.[0].length??0,n=e.slice(t,e.length-t);return/^ .* $/s.test(n)&&n.trim()?n.slice(1,-1):n}var zu=`Your message could not be copied.`,Bu=`Select the text and copy it with your keyboard — this browser did not allow the page to use the clipboard.`,Vu=2e3;function Hu(e){let{message:t}=e,{notifier:n}=Br(),r=Vr(),{thread:i,retry:a}=Ir(),[o,s]=(0,_.useState)(null),c=(0,_.useRef)(null);(0,_.useEffect)(()=>()=>{c.current!==null&&clearTimeout(c.current)},[]);let l=(0,_.useCallback)((e,t)=>{let r=globalThis.navigator?.clipboard,i=r?.writeText?.bind(r);if(i===void 0){n.notify({level:`warning`,message:zu,remedy:Bu});return}i(e).then(()=>{s(t),c.current!==null&&clearTimeout(c.current),c.current=setTimeout(()=>s(null),Vu)},()=>{n.notify({level:`warning`,message:zu,remedy:Bu})})},[n]);if(t.status===`streaming`||t.status===`pending`)return null;let u=C(t),d=r.messageActions?.(t),f=t.role===`user`,p=f?``:Wr(i.getSnapshot().messages,t.id);return u===``&&d===void 0?null:(0,A.jsxs)(`div`,{className:`mx-chat-actions`,role:`group`,"aria-label":f?`Actions for your message`:`Actions for this answer`,"data-message-id":t.id,children:[u===``?null:(0,A.jsx)(`button`,{type:`button`,className:`mx-chat-quiet-button mx-chat-focusable`,"data-action":`copy-text`,onClick:()=>l(Lu(u),`text`),children:o===`text`?`Copied`:`Copy`}),u===``||f?null:(0,A.jsx)(`button`,{type:`button`,className:`mx-chat-quiet-button mx-chat-focusable`,"data-action":`copy-markdown`,onClick:()=>l(u,`markdown`),children:o===`markdown`?`Copied`:`Copy as markdown`}),p===``?null:(0,A.jsx)(`button`,{type:`button`,className:`mx-chat-quiet-button mx-chat-focusable`,"data-action":`retry`,onClick:()=>void i.send({text:p}),children:`Ask again`}),f&&u!==``?(0,A.jsx)(`button`,{type:`button`,className:`mx-chat-quiet-button mx-chat-focusable`,"data-action":`edit`,onClick:()=>a.request(u),children:`Edit and send again`}):null,d,o===null?null:(0,A.jsx)(`span`,{className:`mx-chat__sr-only`,role:`status`,"aria-live":`polite`,children:`Copied to the clipboard`})]})}var Uu=Object.defineProperty,Wu=(e,t)=>Uu(e,`name`,{value:t,configurable:!0});function Gu(e){let t=e+`CollectionProvider`,[n,r]=si(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=Wu(e=>{let{scope:t,children:n}=e,r=_.useRef(null),a=_.useRef(new Map).current;return(0,A.jsx)(i,{scope:t,itemMap:a,collectionRef:r,children:n})},`CollectionProvider`);o.displayName=t;let s=e+`CollectionSlot`,c=di(s),l=_.forwardRef((e,t)=>{let{scope:n,children:r}=e,i=R(t,a(s,n).collectionRef);return(0,A.jsx)(c,{ref:i,children:r})});l.displayName=s;let u=e+`CollectionItemSlot`,d=`data-radix-collection-item`,f=di(u),p=_.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=_.useRef(null),s=R(t,o),c=a(u,n);return _.useEffect(()=>(c.itemMap.set(o,{ref:o,...i}),()=>void c.itemMap.delete(o))),(0,A.jsx)(f,{[d]:``,ref:s,children:r})});p.displayName=u;function m(t){let n=a(e+`CollectionConsumer`,t);return _.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 Wu(m,`useCollection`),[{Provider:o,Slot:l,ItemSlot:p},m,r]}Wu(Gu,`createCollection`);var Ku=new WeakMap,qu=class e extends Map{static{Wu(this,`OrderedDict`)}#e;constructor(e){super(e),this.#e=[...super.keys()],Ku.set(this,!0)}set(e,t){return Ku.get(this)&&(this.has(e)?this.#e[this.#e.indexOf(e)]=e:this.#e.push(e)),super.set(e,t),this}insert(e,t,n){let r=this.has(t),i=this.#e.length,a=Xu(e),o=a>=0?a:i+a,s=o<0||o>=i?-1:o;if(s===this.size||r&&s===this.size-1||s===-1)return this.set(t,n),this;let c=this.size+ +!r;a<0&&o++;let l=[...this.#e],u,d=!1;for(let e=o;e<c;e++)if(o===e){let i=l[e];l[e]===t&&(i=l[e+1]),r&&this.delete(t),u=this.get(i),this.set(t,n)}else{!d&&l[e-1]===t&&(d=!0);let n=l[d?e:e-1],r=u;u=this.get(n),this.delete(n),this.set(n,r)}return this}with(t,n,r){let i=new e(this);return i.insert(t,n,r),i}before(e){let t=this.#e.indexOf(e)-1;if(!(t<0))return this.entryAt(t)}setBefore(e,t,n){let r=this.#e.indexOf(e);return r===-1?this:this.insert(r,t,n)}after(e){let t=this.#e.indexOf(e);if(t=t===-1||t===this.size-1?-1:t+1,t!==-1)return this.entryAt(t)}setAfter(e,t,n){let r=this.#e.indexOf(e);return r===-1?this:this.insert(r+1,t,n)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return this.#e=[],super.clear()}delete(e){let t=super.delete(e);return t&&this.#e.splice(this.#e.indexOf(e),1),t}deleteAt(e){let t=this.keyAt(e);return t!==void 0&&this.delete(t)}at(e){let t=Ju(this.#e,e);if(t!==void 0)return this.get(t)}entryAt(e){let t=Ju(this.#e,e);if(t!==void 0)return[t,this.get(t)]}indexOf(e){return this.#e.indexOf(e)}keyAt(e){return Ju(this.#e,e)}from(e,t){let n=this.indexOf(e);if(n===-1)return;let r=n+t;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.at(r)}keyFrom(e,t){let n=this.indexOf(e);if(n===-1)return;let r=n+t;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.keyAt(r)}find(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return r;n++}}findIndex(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return n;n++}return-1}filter(t,n){let r=[],i=0;for(let e of this)Reflect.apply(t,n,[e,i,this])&&r.push(e),i++;return new e(r)}map(t,n){let r=[],i=0;for(let e of this)r.push([e[0],Reflect.apply(t,n,[e,i,this])]),i++;return new e(r)}reduce(...e){let[t,n]=e,r=0,i=n??this.at(0);for(let n of this)i=r===0&&e.length===1?n:Reflect.apply(t,this,[i,n,r,this]),r++;return i}reduceRight(...e){let[t,n]=e,r=n??this.at(-1);for(let n=this.size-1;n>=0;n--){let i=this.at(n);r=n===this.size-1&&e.length===1?i:Reflect.apply(t,this,[r,i,n,this])}return r}toSorted(t){let n=[...this.entries()].sort(t);return new e(n)}toReversed(){let t=new e;for(let e=this.size-1;e>=0;e--){let n=this.keyAt(e),r=this.get(n);t.set(n,r)}return t}toSpliced(...t){let n=[...this.entries()];return n.splice(...t),new e(n)}slice(t,n){let r=new e,i=this.size-1;if(t===void 0)return r;t<0&&(t+=this.size),n!==void 0&&n>0&&(i=n-1);for(let e=t;e<=i;e++){let t=this.keyAt(e),n=this.get(t);r.set(t,n)}return r}every(e,t){let n=0;for(let r of this){if(!Reflect.apply(e,t,[r,n,this]))return!1;n++}return!0}some(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return!0;n++}return!1}};function Ju(e,t){if(`at`in Array.prototype)return Array.prototype.at.call(e,t);let n=Yu(e,t);return n===-1?void 0:e[n]}Wu(Ju,`at`);function Yu(e,t){let n=e.length,r=Xu(t),i=r>=0?r:n+r;return i<0||i>=n?-1:i}Wu(Yu,`toSafeIndex`);function Xu(e){return e!==e||e===0?0:Math.trunc(e)}Wu(Xu,`toSafeInteger`);function Zu(e){let t=e+`CollectionProvider`,[n,r]=si(t),[i,a]=n(t,{collectionElement:null,collectionRef:{current:null},collectionRefObject:{current:null},itemMap:new qu,setItemMap:Wu(()=>void 0,`setItemMap`)}),o=Wu(({state:e,...t})=>e?(0,A.jsx)(c,{...t,state:e}):(0,A.jsx)(s,{...t}),`CollectionProvider`);o.displayName=t;let s=Wu(e=>{let t=h();return(0,A.jsx)(c,{...e,state:t})},`CollectionInit`);s.displayName=t+`Init`;let c=Wu(e=>{let{scope:t,children:n,state:r}=e,a=_.useRef(null),[o,s]=_.useState(null),c=R(a,s),[l,u]=r;return _.useEffect(()=>{if(!o)return;let e=J(()=>{});return e.observe(o,{childList:!0,subtree:!0}),()=>{e.disconnect()}},[o]),(0,A.jsx)(i,{scope:t,itemMap:l,setItemMap:u,collectionRef:c,collectionRefObject:a,collectionElement:o,children:n})},`CollectionProviderImpl`);c.displayName=t+`Impl`;let l=e+`CollectionSlot`,u=di(l),d=_.forwardRef((e,t)=>{let{scope:n,children:r}=e,i=R(t,a(l,n).collectionRef);return(0,A.jsx)(u,{ref:i,children:r})});d.displayName=l;let f=e+`CollectionItemSlot`,p=di(f),m=_.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=_.useRef(null),[s,c]=_.useState(null),l=R(t,o,c),{setItemMap:u}=a(f,n),d=_.useRef(i);Qu(d.current,i)||(d.current=i);let m=d.current;return _.useEffect(()=>{let e=m;return u(t=>s?t.has(s)?t.set(s,{...e,element:s}).toSorted($u):(t.set(s,{...e,element:s}),t.toSorted($u)):t),()=>{u(e=>!s||!e.has(s)?e:(e.delete(s),new qu(e)))}},[s,m,u]),(0,A.jsx)(p,{"data-radix-collection-item":``,ref:l,children:r})});m.displayName=f;function h(){return _.useState(new qu)}Wu(h,`useInitCollection`);function g(t){let{itemMap:n}=a(e+`CollectionConsumer`,t);return n}return Wu(g,`useCollection`),[{Provider:o,Slot:d,ItemSlot:m},{createCollectionScope:r,useCollection:g,useInitCollection:h}]}Wu(Zu,`createCollection`);function Qu(e,t){if(e===t)return!0;if(typeof e!=`object`||typeof t!=`object`||e==null||t==null)return!1;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||e[r]!==t[r])return!1;return!0}Wu(Qu,`shallowEqual`);function q(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}Wu(q,`isElementPreceding`);function $u(e,t){return!e[1].element||!t[1].element?0:q(e[1].element,t[1].element)?-1:1}Wu($u,`sortByDocumentPosition`);function J(e){return new MutationObserver(t=>{for(let n of t)if(n.type===`childList`){e();return}})}Wu(J,`getChildListObserver`);var Y=Object.defineProperty,X=(e,t)=>Y(e,`name`,{value:t,configurable:!0}),ed=_.createContext(void 0);function td(e){let t=_.useContext(ed);return e||t||`ltr`}X(td,`useDirection`);function nd(e){return{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":!0,...e}}function rd(e){return(0,A.jsxs)(`svg`,{...nd(e),children:[(0,A.jsx)(`path`,{d:`M18 6 6 18`}),(0,A.jsx)(`path`,{d:`m6 6 12 12`})]})}function id(e){return{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 15 15`,width:15,height:15,fill:`none`,"aria-hidden":!0,...e}}function ad(e){return(0,A.jsx)(`svg`,{...id(e),children:(0,A.jsx)(`path`,{d:`M11.4669 3.72684C11.7558 3.91574 11.8369 4.30308 11.648 4.59198L7.39799 11.092C7.29783 11.2452 7.13556 11.3467 6.95402 11.3699C6.77247 11.3931 6.58989 11.3355 6.45446 11.2124L3.70446 8.71241C3.44905 8.48022 3.43023 8.08494 3.66242 7.82953C3.89461 7.57412 4.28989 7.55529 4.5453 7.78749L6.75292 9.79441L10.6018 3.90792C10.7907 3.61902 11.178 3.53795 11.4669 3.72684Z`,fill:`currentColor`,fillRule:`evenodd`,clipRule:`evenodd`})})}function od(e){return(0,A.jsx)(`svg`,{...id(e),children:(0,A.jsx)(`path`,{d:`M9.875 7.5C9.875 8.81168 8.81168 9.875 7.5 9.875C6.18832 9.875 5.125 8.81168 5.125 7.5C5.125 6.18832 6.18832 5.125 7.5 5.125C8.81168 5.125 9.875 6.18832 9.875 7.5Z`,fill:`currentColor`})})}function sd(e){return(0,A.jsx)(`svg`,{...id(e),children:(0,A.jsx)(`path`,{d:`M6.1584 3.13508C6.35985 2.94621 6.67627 2.95642 6.86514 3.15788L10.6151 7.15788C10.7954 7.3502 10.7954 7.64949 10.6151 7.84182L6.86514 11.8418C6.67627 12.0433 6.35985 12.0535 6.1584 11.8646C5.95694 11.6757 5.94673 11.3593 6.1356 11.1579L9.565 7.49985L6.1356 3.84182C5.94673 3.64036 5.95694 3.32394 6.1584 3.13508Z`,fill:`currentColor`,fillRule:`evenodd`,clipRule:`evenodd`})})}var cd=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,ld=Vc,ud=(e,t)=>n=>{if(t?.variants==null)return ld(e,n?.class,n?.className);let{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(e=>{let t=n?.[e],a=i?.[e];if(t===null)return null;let o=cd(t)||cd(a);return r[e][o]}),o=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return ld(e,a,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...o}[t]):{...i,...o}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)},dd=Object.defineProperty,fd=(e,t)=>dd(e,`name`,{value:t,configurable:!0}),pd=`focusScope.autoFocusOnMount`,md=`focusScope.autoFocusOnUnmount`,hd={bubbles:!1,cancelable:!0},gd=_.forwardRef(fd(function(e,t){let{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[s,c]=_.useState(null),l=Mi(i),u=Mi(a),d=_.useRef(null),f=R(t,c),p=_.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;_.useEffect(()=>{if(r){let e=function(e){if(p.paused||!s)return;let t=e.target;s.contains(t)?d.current=t:Cd(d.current,{select:!0})},t=function(e){if(p.paused||!s)return;let t=e.relatedTarget;t!==null&&(s.contains(t)||Cd(d.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&Cd(s)};fd(e,`handleFocusIn`),fd(t,`handleFocusOut`),fd(n,`handleMutations`),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]),_.useEffect(()=>{if(s){wd.add(p);let e=document.activeElement;if(!s.contains(e)){let t=new CustomEvent(pd,hd);s.addEventListener(pd,l),s.dispatchEvent(t),t.defaultPrevented||(_d(Dd(yd(s)),{select:!0}),document.activeElement===e&&Cd(s))}return()=>{s.removeEventListener(pd,l),setTimeout(()=>{let t=new CustomEvent(md,hd);s.addEventListener(md,u),s.dispatchEvent(t),t.defaultPrevented||Cd(e??document.body,{select:!0}),s.removeEventListener(md,u),wd.remove(p)},0)}}},[s,l,u,p]);let m=_.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]=vd(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&Cd(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&Cd(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,p.paused]);return(0,A.jsx)(Oi.div,{tabIndex:-1,...o,ref:f,onKeyDown:m})},`FocusScope`));function _d(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(Cd(r,{select:t}),document.activeElement!==n)return}fd(_d,`focusFirst`);function vd(e){let t=yd(e);return[bd(t,e),bd(t.reverse(),e)]}fd(vd,`getTabbableEdges`);function yd(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:fd(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},`acceptNode`)});for(;n.nextNode();)t.push(n.currentNode);return t}fd(yd,`getTabbableCandidates`);function bd(e,t){let n=typeof t.checkVisibility==`function`&&t.checkVisibility({checkVisibilityCSS:!0});for(let r of e)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):xd(r,{upTo:t})))return r}fd(bd,`findVisible`);function xd(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}fd(xd,`isHidden`);function Sd(e){return e instanceof HTMLInputElement&&`select`in e}fd(Sd,`isSelectableInput`);function Cd(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Sd(e)&&t&&e.select()}}fd(Cd,`focus`);var wd=Td();function Td(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=Ed(e,t),e.unshift(t)},remove(t){e=Ed(e,t),e[0]?.resume()}}}fd(Td,`createFocusScopesStack`);function Ed(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}fd(Ed,`arrayRemove`);function Dd(e){return e.filter(e=>e.tagName!==`A`)}fd(Dd,`removeLinks`);var Od=Object.defineProperty,kd=(e,t)=>Od(e,`name`,{value:t,configurable:!0}),Ad=0,jd=null;function Md(e){return Nd(),e.children}kd(Md,`FocusGuards`);function Nd(){_.useEffect(()=>{jd||={start:Pd(),end:Pd()};let{start:e,end:t}=jd;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement(`afterbegin`,e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement(`beforeend`,t),Ad++,()=>{Ad===1&&(jd?.start.remove(),jd?.end.remove(),jd=null),Ad=Math.max(0,Ad-1)}},[])}kd(Nd,`useFocusGuards`);function Pd(){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}kd(Pd,`createFocusGuard`);var Fd=function(){return Fd=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},Fd.apply(this,arguments)};function Id(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 Ld(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 Rd=`right-scroll-bar-position`,zd=`width-before-scroll-bar`,Bd=`with-scroll-bars-hidden`,Vd=`--removed-body-scroll-bar-size`;function Hd(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function Ud(e,t){var n=(0,_.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 Wd=typeof window<`u`?_.useLayoutEffect:_.useEffect,Gd=new WeakMap;function Kd(e,t){var n=Ud(t||null,function(t){return e.forEach(function(e){return Hd(e,t)})});return Wd(function(){var t=Gd.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||Hd(e,null)}),i.forEach(function(e){r.has(e)||Hd(e,a)})}Gd.set(n,e)},[e]),n}function qd(e){return e}function Jd(e,t){t===void 0&&(t=qd);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 Yd(e){e===void 0&&(e={});var t=Jd(null);return t.options=Fd({async:!0,ssr:!1},e),t}var Xd=function(e){var t=e.sideCar,n=Id(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 _.createElement(r,Fd({},n))};Xd.isSideCarExport=!0;function Zd(e,t){return e.useMedium(t),Xd}var Qd=Yd(),$d=function(){},ef=_.forwardRef(function(e,t){var n=_.useRef(null),r=_.useState({onScrollCapture:$d,onWheelCapture:$d,onTouchMoveCapture:$d}),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,v=e.as,y=v===void 0?`div`:v,b=e.gapMode,x=Id(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),S=f,C=Kd([n,t]),w=Fd(Fd({},x),i);return _.createElement(_.Fragment,null,u&&_.createElement(S,{sideCar:Qd,removeScrollBar:l,shards:d,noRelative:p,noIsolation:m,inert:h,setCallbacks:a,allowPinchZoom:!!g,lockRef:n,gapMode:b}),o?_.cloneElement(_.Children.only(s),Fd(Fd({},w),{ref:C})):_.createElement(y,Fd({},w,{className:c,ref:C}),s))});ef.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},ef.classNames={fullWidth:zd,zeroRight:Rd};var tf=function(){if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function nf(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=tf();return t&&e.setAttribute(`nonce`,t),e}function rf(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function af(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var of=function(){var e=0,t=null;return{add:function(n){e==0&&(t=nf())&&(rf(t,n),af(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},sf=function(){var e=of();return function(t,n){_.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},cf=function(){var e=sf();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},lf={left:0,top:0,right:0,gap:0},uf=function(e){return parseInt(e||``,10)||0},df=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[uf(n),uf(r),uf(i)]},ff=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return lf;var t=df(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])}},pf=cf(),Z=`data-scroll-locked`,mf=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
17
- .${Bd} {
18
- overflow: hidden ${r};
19
- padding-right: ${s}px ${r};
20
- }
21
- body[${Z}] {
22
- overflow: hidden ${r};
23
- overscroll-behavior: contain;
24
- ${[t&&`position: relative ${r};`,n===`margin`&&`
25
- padding-left: ${i}px;
26
- padding-top: ${a}px;
27
- padding-right: ${o}px;
28
- margin-left:0;
29
- margin-top:0;
30
- margin-right: ${s}px ${r};
31
- `,n===`padding`&&`padding-right: ${s}px ${r};`].filter(Boolean).join(``)}
32
- }
33
-
34
- .${Rd} {
35
- right: ${s}px ${r};
36
- }
37
-
38
- .${zd} {
39
- margin-right: ${s}px ${r};
40
- }
41
-
42
- .${Rd} .${Rd} {
43
- right: 0 ${r};
44
- }
45
-
46
- .${zd} .${zd} {
47
- margin-right: 0 ${r};
48
- }
49
-
50
- body[${Z}] {
51
- ${Vd}: ${s}px;
52
- }
53
- `},hf=function(){var e=parseInt(document.body.getAttribute(`data-scroll-locked`)||`0`,10);return isFinite(e)?e:0},gf=function(){_.useEffect(function(){return document.body.setAttribute(Z,(hf()+1).toString()),function(){var e=hf()-1;e<=0?document.body.removeAttribute(Z):document.body.setAttribute(Z,e.toString())}},[])},_f=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?`margin`:r;gf();var a=_.useMemo(function(){return ff(i)},[i]);return _.createElement(pf,{styles:mf(a,!t,i,n?``:`!important`)})},vf=!1;if(typeof window<`u`)try{var yf=Object.defineProperty({},"passive",{get:function(){return vf=!0,!0}});window.addEventListener(`test`,yf,yf),window.removeEventListener(`test`,yf,yf)}catch{vf=!1}var bf=vf?{passive:!1}:!1,xf=function(e){return e.tagName===`TEXTAREA`},Sf=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!==`hidden`&&!(n.overflowY===n.overflowX&&!xf(e)&&n[t]===`visible`)},Cf=function(e){return Sf(e,`overflowY`)},wf=function(e){return Sf(e,`overflowX`)},Tf=function(e,t){var n=t.ownerDocument,r=t;do{if(typeof ShadowRoot<`u`&&r instanceof ShadowRoot&&(r=r.host),Of(e,r)){var i=kf(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Ef=function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]},Df=function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]},Of=function(e,t){return e===`v`?Cf(t):wf(t)},kf=function(e,t){return e===`v`?Ef(t):Df(t)},Af=function(e,t){return e===`h`&&t===`rtl`?-1:1},jf=function(e,t,n,r,i){var a=Af(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=kf(e,s),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&Of(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},Mf=function(e){return`changedTouches`in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Nf=function(e){return[e.deltaX,e.deltaY]},Pf=function(e){return e&&`current`in e?e.current:e},Ff=function(e,t){return e[0]===t[0]&&e[1]===t[1]},If=function(e){return`
54
- .block-interactivity-${e} {pointer-events: none;}
55
- .allow-interactivity-${e} {pointer-events: all;}
56
- `},Lf=0,Rf=[];function zf(e){var t=_.useRef([]),n=_.useRef([0,0]),r=_.useRef(),i=_.useState(Lf++)[0],a=_.useState(cf)[0],o=_.useRef(e);_.useEffect(function(){o.current=e},[e]),_.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=Ld([e.lockRef.current],(e.shards||[]).map(Pf),!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=_.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!o.current.allowPinchZoom;var i=Mf(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=Tf(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=Tf(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 jf(h,t,e,h===`h`?s:c,!0)},[]),c=_.useCallback(function(e){var n=e;if(Rf.length&&Rf[Rf.length-1]===a){var r=`deltaY`in n?Nf(n):Mf(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&Ff(e.delta,r)})[0];if(i&&i.should){n.cancelable&&n.preventDefault();return}if(!i){var c=(o.current.shards||[]).map(Pf).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=_.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:Bf(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),u=_.useCallback(function(e){n.current=Mf(e),r.current=void 0},[]),d=_.useCallback(function(t){l(t.type,Nf(t),t.target,s(t,e.lockRef.current))},[]),f=_.useCallback(function(t){l(t.type,Mf(t),t.target,s(t,e.lockRef.current))},[]);_.useEffect(function(){return Rf.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener(`wheel`,c,bf),document.addEventListener(`touchmove`,c,bf),document.addEventListener(`touchstart`,u,bf),function(){Rf=Rf.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,c,bf),document.removeEventListener(`touchmove`,c,bf),document.removeEventListener(`touchstart`,u,bf)}},[]);var p=e.removeScrollBar,m=e.inert;return _.createElement(_.Fragment,null,m?_.createElement(a,{styles:If(i)}):null,p?_.createElement(_f,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Bf(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var Vf=Zd(Qd,zf),Q=_.forwardRef(function(e,t){return _.createElement(ef,Fd({},e,{ref:t,sideCar:Vf}))});Q.classNames=ef.classNames;var Hf=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},Uf=new WeakMap,Wf=new WeakMap,Gf={},Kf=0,qf=function(e){return e&&(e.host||qf(e.parentNode))},Jf=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=qf(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})},Yf=function(e,t,n,r){var i=Jf(t,Array.isArray(e)?e:[e]);Gf[n]||(Gf[n]=new WeakMap);var a=Gf[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=(Uf.get(e)||0)+1,l=(a.get(e)||0)+1;Uf.set(e,c),a.set(e,l),o.push(e),c===1&&i&&Wf.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(),Kf++,function(){o.forEach(function(e){var t=Uf.get(e)-1,i=a.get(e)-1;Uf.set(e,t),a.set(e,i),t||(Wf.has(e)||e.removeAttribute(r),Wf.delete(e)),i||e.removeAttribute(n)}),Kf--,Kf||(Uf=new WeakMap,Uf=new WeakMap,Wf=new WeakMap,Gf={})}},Xf=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||Hf(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),Yf(r,i,n,`aria-hidden`)):function(){return null}},Zf=Object.defineProperty,Qf=(e,t)=>Zf(e,`name`,{value:t,configurable:!0}),$f=`Dialog`,[ep,tp]=si($f),[np,rp]=ep($f),ip=Qf(e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,s=_.useRef(null),c=_.useRef(null),[l,u]=Zs({prop:r,defaultProp:i??!1,onChange:a,caller:$f}),[d,f]=_.useState(0),[p,m]=_.useState(0);return(0,A.jsx)(np,{scope:t,triggerRef:s,contentRef:c,contentId:Qi(),titleId:Qi(),descriptionId:Qi(),titlePresent:d>0,descriptionPresent:p>0,setTitleCount:f,setDescriptionCount:m,open:l,onOpenChange:u,onOpenToggle:_.useCallback(()=>u(e=>!e),[u]),modal:o,children:n})},`Dialog`),ap=`DialogPortal`,[op,sp]=ep(ap,{forceMount:void 0}),cp=Qf(e=>{let{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=rp(ap,t);return(0,A.jsx)(op,{scope:t,forceMount:n,children:_.Children.map(r,e=>(0,A.jsx)(Ls,{present:n||a.open,children:(0,A.jsx)(Ns,{asChild:!0,container:i,children:e})}))})},`DialogPortal`),lp=`DialogOverlay`,up=_.forwardRef(Qf(function(e,t){let n=sp(lp,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=rp(lp,e.__scopeDialog);return a.modal?(0,A.jsx)(Ls,{present:r||a.open,children:(0,A.jsx)(fp,{...i,ref:t})}):null},`DialogOverlay`)),dp=di(`DialogOverlay.RemoveScroll`),fp=_.forwardRef(Qf(function(e,t){let{__scopeDialog:n,...r}=e,i=rp(lp,n),a=R(t,Vi());return(0,A.jsx)(Q,{as:dp,allowPinchZoom:!0,shards:[i.contentRef],children:(0,A.jsx)(Oi.div,{"data-state":wp(i.open),...r,ref:a,style:{pointerEvents:`auto`,...r.style}})})},`DialogOverlayImpl`)),pp=`DialogContent`,mp=_.forwardRef(Qf(function(e,t){let n=sp(pp,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=rp(pp,e.__scopeDialog);return(0,A.jsx)(Ls,{present:r||a.open,children:a.modal?(0,A.jsx)(hp,{...i,ref:t}):(0,A.jsx)(gp,{...i,ref:t})})},`DialogContent`)),hp=_.forwardRef(Qf(function(e,t){let n=rp(pp,e.__scopeDialog),r=_.useRef(null),i=R(t,n.contentRef,r);return _.useEffect(()=>{let e=r.current;if(e)return Xf(e)},[]),(0,A.jsx)(_p,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,onCloseAutoFocus:L(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:L(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:L(e.onFocusOutside,e=>e.preventDefault())})},`DialogContentModal`)),gp=_.forwardRef(Qf(function(e,t){let n=rp(pp,e.__scopeDialog),r=_.useRef(!1),i=_.useRef(!1);return(0,A.jsx)(_p,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})},`DialogContentNonModal`)),_p=_.forwardRef(Qf(function(e,t){let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,...o}=e,s=rp(pp,n);return Nd(),(0,A.jsx)(A.Fragment,{children:(0,A.jsx)(gd,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,A.jsx)(Bi,{role:`dialog`,id:s.contentId,"aria-describedby":s.descriptionPresent?s.descriptionId:void 0,"aria-labelledby":s.titlePresent?s.titleId:void 0,"data-state":wp(s.open),...o,ref:t,deferPointerDownOutside:!0,onDismiss:()=>s.onOpenChange(!1)})})})},`DialogContentImpl`)),vp=`DialogTitle`,yp=_.forwardRef(Qf(function(e,t){let{__scopeDialog:n,...r}=e,i=rp(vp,n),{setTitleCount:a}=i;return qi(()=>(a(e=>e+1),()=>a(e=>e-1)),[a]),(0,A.jsx)(Oi.h2,{id:i.titleId,...r,ref:t})},`DialogTitle`)),bp=`DialogDescription`,xp=_.forwardRef(Qf(function(e,t){let{__scopeDialog:n,...r}=e,i=rp(bp,n),{setDescriptionCount:a}=i;return qi(()=>(a(e=>e+1),()=>a(e=>e-1)),[a]),(0,A.jsx)(Oi.p,{id:i.descriptionId,...r,ref:t})},`DialogDescription`)),Sp=`DialogClose`,Cp=_.forwardRef(Qf(function(e,t){let{__scopeDialog:n,...r}=e,i=rp(Sp,n);return(0,A.jsx)(Oi.button,{type:`button`,...r,ref:t,onClick:L(e.onClick,()=>i.onOpenChange(!1))})},`DialogClose`));function wp(e){return e?`open`:`closed`}Qf(wp,`getState`);var Tp=Symbol.for(`react.portal`);function Ep(e,t){if(e==null||typeof e==`boolean`)return!1;if(Array.isArray(e))return e.some(e=>Ep(e,t));if(_.isValidElement(e)){if(e.type===t)return!0;let n=e.props;return n.children!=null&&Ep(n.children,t)}if(typeof e==`string`||typeof e==`number`)return!1;if(typeof e==`object`&&e.$$typeof===Tp)return Ep(e.children,t);if(typeof e==`object`&&Symbol.iterator in e)return Array.from(e).some(e=>Ep(e,t));if(globalThis.process?.env?.NODE_ENV!==`production`){let t=typeof e==`object`?` with keys {${Object.keys(e).join(`, `)}}`:``;console.error(`[treeContainsComponent] A non-renderable value${t} is being passed as a React child. React will throw 'Objects are not valid as a React child' at the real render site. Stringify it (e.g. JSON.stringify) before rendering.`,e)}return!1}var Dp=`data-matrx-floating-layer`,Op=Symbol.for(`ai-matrx.design-system.modal-layer-registry`),kp=globalThis,Ap=kp[Op]??={count:0,listeners:new Set};function jp(){for(let e of Ap.listeners)e()}var Mp=[`wheel`,`touchmove`];function Np(e){zp(e.target)&&e.stopPropagation()}function Pp(e){if(typeof document<`u`&&document.body)for(let t of Mp)e?document.body.addEventListener(t,Np,{passive:!0}):document.body.removeEventListener(t,Np)}function Fp(){Ap.count+=1,Ap.count===1&&Pp(!0),jp();let e=!1;return()=>{e||(e=!0,Ap.count=Math.max(0,Ap.count-1),Ap.count===0&&Pp(!1),jp())}}function Ip(){return Ap.count>0}function Lp(e){_.useLayoutEffect(()=>e?Fp():void 0,[e])}var Rp=`[data-radix-popper-content-wrapper]`;function zp(e){return e instanceof Element?e.closest(`[data-matrx-floating-layer]`)?!0:e.closest(Rp)!==null&&e.ownerDocument.querySelector(`[data-matrx-floating-layer]`)!==null:!1}function Bp(e){return t=>{e?.(t),zp(t.target)&&t.preventDefault()}}var Vp=e=>e.preventDefault(),Hp=_.forwardRef(({children:e},t)=>{let[n]=_.useState(()=>typeof document>`u`?null:document.activeElement);return(0,A.jsx)(gd,{asChild:!0,trapped:!1,loop:!1,onMountAutoFocus:Vp,onUnmountAutoFocus:e=>{e.preventDefault();let t=document.activeElement;(!t||t===document.body||!t.isConnected)&&Ip()&&n instanceof HTMLElement&&n.isConnected&&n.focus({preventScroll:!0})},children:(0,A.jsx)(fi,{ref:t,[Dp]:``,style:{pointerEvents:`auto`},children:e})})});Hp.displayName=`FloatingLayer`;var Up=Symbol.for(`ai-matrx.design-system.dialog-modal-context`),Wp=globalThis,Gp=Wp[Up]??=_.createContext(!0);function Kp({children:e,modal:t}){return(0,A.jsx)(Gp.Provider,{value:t,children:e})}function qp(){return _.useContext(Gp)}var Jp=Symbol.for(`@ai-matrx/design-system/error-actions`),Yp=globalThis,Xp=Yp[Jp]??(Yp[Jp]=_.createContext(null));function Zp(){return _.useContext(Xp)}function Qp(e){let t=Zp();return t?(0,A.jsx)(A.Fragment,{children:t(e)}):null}var $p=_.forwardRef(function({as:e=`p`,message:t,title:n,error:r,operation:i,records:a,unsavedInput:o,origin:s,children:c,...l},u){let d=e,f={...t===void 0?{}:{message:t},...n===void 0?{}:{title:n},...r===void 0?{}:{error:r},...i===void 0?{}:{operation:i},...a===void 0?{}:{records:a},...o===void 0?{}:{unsavedInput:o},...s===void 0?{}:{origin:s}};return(0,A.jsxs)(d,{ref:u,role:`alert`,"data-error-box":``,...l,children:[c??t,(0,A.jsx)(Qp,{...f})]})}),em=ud(`inline-flex cursor-pointer items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all duration-200 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-0 disabled:pointer-events-none disabled:opacity-50 active:scale-[0.98] [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0`,{variants:{variant:{default:`bg-primary text-primary-foreground shadow-sm hover:bg-primary/90`,primary:`bg-primary text-primary-foreground shadow-sm hover:bg-primary/90`,destructive:`bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90`,success:`bg-success text-success-foreground shadow-sm hover:bg-success/90`,outline:`border border-border bg-card shadow-sm hover:bg-accent hover:text-accent-foreground`,secondary:`bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80`,ghost:`hover:bg-accent hover:text-accent-foreground`,link:`text-primary underline-offset-4 hover:underline`,subtle:`border border-transparent bg-muted/50 text-foreground hover:border-border hover:bg-muted`},size:{xs:`h-6 rounded-md px-1 text-xs`,sm:`h-8 rounded-md px-3 text-xs`,default:`h-9 px-4 py-2`,md:`h-9 px-4 py-2`,lg:`h-10 rounded-md px-6`,xl:`h-12 px-8 py-3 text-base`,"2xl":`h-14 px-10 py-3 text-base`,"3xl":`h-16 px-12 py-3 text-base`,icon:`h-9 w-9`,"icon-sm":`h-7 w-7`,roundIcon:`h-8 w-8 rounded-full p-0`}},defaultVariants:{variant:`default`,size:`default`}}),tm=new Set([`xs`,`sm`,`default`,`md`,`lg`,`icon`,`icon-sm`,`roundIcon`]),nm=new Set([`icon`,`icon-sm`,`roundIcon`]),rm=_.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...i},a)=>{let o=r?fi:`button`,s=n??`default`;return(0,A.jsx)(o,{className:K(em({variant:t,size:n,className:e})),"data-matrx-button":``,"data-tap-floor":tm.has(s)?``:void 0,"data-tap-floor-square":nm.has(s)?``:void 0,ref:a,...i})});rm.displayName=`Button`;function im(){let[e,t]=_.useState(!1),[n,r]=_.useState(!1);return _.useEffect(()=>{r(!0);let e=()=>{t(window.innerWidth<768)};if(e(),typeof window.matchMedia!=`function`)return;let n=window.matchMedia(`(max-width: 767px)`);return n.addEventListener(`change`,e),()=>n.removeEventListener(`change`,e)},[]),n?e:!1}var am=Object.defineProperty,om=(e,t)=>am(e,`name`,{value:t,configurable:!0}),sm=!1;function cm(){let[e,t]=_.useState(sm);return _.useEffect(()=>{sm||(sm=!0,t(!0))},[]),e}om(cm,`useIsHydrated`);var lm=_.useSyncExternalStore;function um(){return()=>{}}om(um,`subscribe`);function dm(){return lm(um,()=>!0,()=>!1)}om(dm,`useIsHydratedModern`);var fm=typeof lm==`function`?dm:cm,pm=Object.defineProperty,mm=(e,t)=>pm(e,`name`,{value:t,configurable:!0}),hm=`rovingFocusGroup.onEntryFocus`,gm={bubbles:!1,cancelable:!0},_m=`RovingFocusGroup`,[vm,ym,bm]=Gu(_m),[xm,Sm]=si(_m,[bm]),[Cm,wm]=xm(_m),Tm=_.forwardRef(mm(function(e,t){return(0,A.jsx)(vm.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,A.jsx)(vm.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,A.jsx)(Em,{...e,ref:t})})})},`RovingFocusGroup`)),Em=_.forwardRef(mm(function(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=_.useRef(null),p=R(t,f),m=td(a),[h,g]=Zs({prop:o,defaultProp:s??null,onChange:c,caller:_m}),[v,y]=_.useState(!1),b=Mi(l),x=ym(n),S=_.useRef(!1),[C,w]=_.useState(0);return _.useEffect(()=>{let e=f.current;if(e)return e.addEventListener(hm,b),()=>e.removeEventListener(hm,b)},[b]),(0,A.jsx)(Cm,{scope:n,orientation:r,dir:m,loop:i,currentTabStopId:h,onItemFocus:_.useCallback(e=>g(e),[g]),onItemShiftTab:_.useCallback(()=>y(!0),[]),onFocusableItemAdd:_.useCallback(()=>w(e=>e+1),[]),onFocusableItemRemove:_.useCallback(()=>w(e=>e-1),[]),children:(0,A.jsx)(Oi.div,{tabIndex:v||C===0?-1:0,"data-orientation":r,...d,ref:p,style:{outline:`none`,...e.style},onMouseDown:L(e.onMouseDown,()=>{S.current=!0}),onFocus:L(e.onFocus,e=>{let t=!S.current;if(e.target===e.currentTarget&&t&&!v){let t=new CustomEvent(hm,gm);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=x().filter(e=>e.focusable);Mm([e.find(e=>e.active),e.find(e=>e.id===h),...e].filter(Boolean).map(e=>e.ref.current),u)}}S.current=!1}),onBlur:L(e.onBlur,()=>y(!1))})})},`RovingFocusGroupImpl`)),Dm=`RovingFocusGroupItem`,Om=_.forwardRef(mm(function(e,t){let{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:a,children:o,...s}=e,c=Qi(),l=a||c,u=wm(Dm,n),d=u.currentTabStopId===l,f=ym(n),{onFocusableItemAdd:p,onFocusableItemRemove:m,currentTabStopId:h}=u,g=fm();return qi(()=>{if(g&&r)return p(),()=>m()},[g,r,p,m]),_.useEffect(()=>{if(!g&&r)return p(),()=>m()},[g,r,p,m]),(0,A.jsx)(vm.ItemSlot,{scope:n,id:l,focusable:r,active:i,children:(0,A.jsx)(Oi.span,{tabIndex:d?0:-1,"data-orientation":u.orientation,...s,ref:t,onMouseDown:L(e.onMouseDown,e=>{r?u.onItemFocus(l):e.preventDefault()}),onFocus:L(e.onFocus,()=>u.onItemFocus(l)),onKeyDown:L(e.onKeyDown,e=>{if(e.key===`Tab`&&e.shiftKey){u.onItemShiftTab();return}if(e.target!==e.currentTarget)return;let t=jm(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?Nm(n,r+1):n.slice(r+1)}setTimeout(()=>Mm(n))}}),children:typeof o==`function`?o({isCurrentTabStop:d,hasTabStop:h!=null}):o})})},`RovingFocusGroupItem`)),km={ArrowLeft:`prev`,ArrowUp:`prev`,ArrowRight:`next`,ArrowDown:`next`,PageUp:`first`,Home:`first`,PageDown:`last`,End:`last`};function Am(e,t){return t===`rtl`?e===`ArrowLeft`?`ArrowRight`:e===`ArrowRight`?`ArrowLeft`:e:e}mm(Am,`getDirectionAwareKey`);function jm(e,t,n){let r=Am(e.key,n);if(!(t===`vertical`&&[`ArrowLeft`,`ArrowRight`].includes(r))&&!(t===`horizontal`&&[`ArrowUp`,`ArrowDown`].includes(r)))return km[r]}mm(jm,`getFocusIntent`);function Mm(e,t=!1){let n=document.activeElement;for(let r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}mm(Mm,`focusFirst`);function Nm(e,t){return e.map((n,r)=>e[(t+r)%e.length])}mm(Nm,`wrapArray`);var Pm=Tm,Fm=Om,Im=Object.defineProperty,$=(e,t)=>Im(e,`name`,{value:t,configurable:!0}),Lm=[`Enter`,` `],Rm=[`ArrowDown`,`PageUp`,`Home`],zm=[`ArrowUp`,`PageDown`,`End`],Bm=[...Rm,...zm],Vm={ltr:[...Lm,`ArrowRight`],rtl:[...Lm,`ArrowLeft`]},Hm={ltr:[`ArrowLeft`],rtl:[`ArrowRight`]},Um=`Menu`,[Wm,Gm,Km]=Gu(Um),[qm,Jm]=si(Um,[Km,gs,Sm]),Ym=gs(),Xm=Sm(),[Zm,Qm]=qm(Um),[$m,eh]=qm(Um),th=$(e=>{let{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:a,modal:o=!0}=e,s=Ym(t),[c,l]=_.useState(null),u=_.useRef(!1),d=Mi(a),f=td(i);return _.useEffect(()=>{let e=$(()=>{u.current=!0,document.addEventListener(`pointerdown`,t,{capture:!0,once:!0}),document.addEventListener(`pointermove`,t,{capture:!0,once:!0})},`handleKeyDown`),t=$(()=>u.current=!1,`handlePointer`);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})}},[]),_.useEffect(()=>{if(!n)return;let e=$(()=>d(!1),`handleBlur`);return window.addEventListener(`blur`,e),()=>window.removeEventListener(`blur`,e)},[n,d]),(0,A.jsx)(ks,{...s,children:(0,A.jsx)(Zm,{scope:t,open:n,onOpenChange:d,content:c,onContentChange:l,children:(0,A.jsx)($m,{scope:t,onClose:_.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:u,dir:f,modal:o,children:r})})})},`Menu`),nh=_.forwardRef($(function(e,t){let{__scopeMenu:n,...r}=e,i=Ym(n);return(0,A.jsx)(As,{...i,...r,ref:t})},`MenuAnchor`)),rh=`MenuPortal`,[ih,ah]=qm(rh,{forceMount:void 0}),oh=$(e=>{let{__scopeMenu:t,forceMount:n,children:r,container:i}=e,a=Qm(rh,t);return(0,A.jsx)(ih,{scope:t,forceMount:n,children:(0,A.jsx)(Ls,{present:n||a.open,children:(0,A.jsx)(Ns,{asChild:!0,container:i,children:r})})})},`MenuPortal`),sh=`MenuContent`,[ch,lh]=qm(sh),uh=_.forwardRef($(function(e,t){let n=ah(sh,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=Qm(sh,e.__scopeMenu),o=eh(sh,e.__scopeMenu);return(0,A.jsx)(Wm.Provider,{scope:e.__scopeMenu,children:(0,A.jsx)(Ls,{present:r||a.open,children:(0,A.jsx)(Wm.Slot,{scope:e.__scopeMenu,children:o.modal?(0,A.jsx)(dh,{...i,ref:t}):(0,A.jsx)(fh,{...i,ref:t})})})})},`MenuContent`)),dh=_.forwardRef($(function(e,t){let n=Qm(sh,e.__scopeMenu),r=_.useRef(null),i=R(t,r);return _.useEffect(()=>{let e=r.current;if(e)return Xf(e)},[]),(0,A.jsx)(mh,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:L(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})},`MenuRootContentModal`)),fh=_.forwardRef($(function(e,t){let n=Qm(sh,e.__scopeMenu);return(0,A.jsx)(mh,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})},`MenuRootContentNonModal`)),ph=di(`MenuContent.ScrollLock`),mh=_.forwardRef($(function(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=Qm(sh,n),v=eh(sh,n),y=Ym(n),b=Xm(n),x=Gm(n),[S,C]=_.useState(null),w=_.useRef(null),T=R(t,w,g.onContentChange),E=_.useRef(0),D=_.useRef(``),O=_.useRef(0),k=_.useRef(null),ee=_.useRef(`right`),j=_.useRef(0),M=m?Q:_.Fragment,te=m?{as:ph,allowPinchZoom:!0}:void 0,ne=$(e=>{let t=D.current+e,n=x().filter(e=>!e.disabled),r=document.activeElement,i=n.find(e=>e.ref.current===r)?.textValue,a=Gh(n.map(e=>e.textValue),t,i),o=n.find(e=>e.textValue===a)?.ref.current;$((function e(t){D.current=t,window.clearTimeout(E.current),t!==``&&(E.current=window.setTimeout(()=>e(``),1e3))}),`updateSearch`)(t),o&&setTimeout(()=>o.focus())},`handleTypeaheadSearch`);_.useEffect(()=>()=>window.clearTimeout(E.current),[]),Nd();let N=_.useCallback(e=>ee.current===k.current?.side&&qh(e,k.current?.area),[]);return(0,A.jsx)(ch,{scope:n,searchRef:D,onItemEnter:_.useCallback(e=>{N(e)&&e.preventDefault()},[N]),onItemLeave:_.useCallback(e=>{N(e)||(w.current?.focus(),C(null))},[N]),onTriggerLeave:_.useCallback(e=>{N(e)&&e.preventDefault()},[N]),pointerGraceTimerRef:O,onPointerGraceIntentChange:_.useCallback(e=>{k.current=e},[]),children:(0,A.jsx)(M,{...te,children:(0,A.jsx)(gd,{asChild:!0,trapped:i,onMountAutoFocus:L(a,e=>{e.preventDefault(),w.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:(0,A.jsx)(Bi,{asChild:!0,disableOutsidePointerEvents:s,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:p,children:(0,A.jsx)(Pm,{asChild:!0,...b,dir:v.dir,orientation:`vertical`,loop:r,currentTabStopId:S,onCurrentTabStopIdChange:C,onEntryFocus:L(c,e=>{v.isUsingKeyboardRef.current||e.preventDefault()}),preventScrollOnEntryFocus:!0,children:(0,A.jsx)(js,{role:`menu`,"aria-orientation":`vertical`,"data-state":Bh(g.open),"data-radix-menu-content":``,dir:v.dir,...y,...h,ref:T,style:{outline:`none`,...h.style},onKeyDown:L(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&&ne(e.key));let i=w.current;if(e.target!==i||!Bm.includes(e.key))return;e.preventDefault();let a=x().filter(e=>!e.disabled).map(e=>e.ref.current);zm.includes(e.key)&&a.reverse(),Uh(a)}),onBlur:L(e.onBlur,e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(E.current),D.current=``)}),onPointerMove:L(e.onPointerMove,Jh(e=>{let t=e.target,n=j.current!==e.clientX;if(e.currentTarget.contains(t)&&n){let t=e.clientX>j.current?`right`:`left`;ee.current=t,j.current=e.clientX}}))})})})})})})},`MenuContentImpl`)),hh=_.forwardRef($(function(e,t){let{__scopeMenu:n,...r}=e;return(0,A.jsx)(Oi.div,{role:`group`,...r,ref:t})},`MenuGroup`)),gh=_.forwardRef($(function(e,t){let{__scopeMenu:n,...r}=e;return(0,A.jsx)(Oi.div,{...r,ref:t})},`MenuLabel`)),_h=`MenuItem`,vh=`menu.itemSelect`,yh=_.forwardRef($(function(e,t){let{disabled:n=!1,onSelect:r,...i}=e,a=_.useRef(null),o=eh(_h,e.__scopeMenu),s=lh(_h,e.__scopeMenu),c=R(t,a),l=_.useRef(!1),u=$(()=>{let e=a.current;if(!n&&e){let t=new CustomEvent(vh,{bubbles:!0,cancelable:!0});e.addEventListener(vh,e=>r?.(e),{once:!0}),ki(e,t),t.defaultPrevented?l.current=!1:o.onClose()}},`handleSelect`);return(0,A.jsx)(bh,{...i,ref:c,disabled:n,onClick:L(e.onClick,u),onPointerDown:t=>{e.onPointerDown?.(t),l.current=!0},onPointerUp:L(e.onPointerUp,e=>{l.current||e.currentTarget?.click()}),onKeyDown:L(e.onKeyDown,e=>{n||e.target!==e.currentTarget||(s.searchRef.current===``||e.key!==` `)&&Lm.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())})})},`MenuItem`)),bh=_.forwardRef($(function(e,t){let{__scopeMenu:n,disabled:r=!1,textValue:i,...a}=e,o=lh(_h,n),s=Xm(n),c=_.useRef(null),l=R(t,c),[u,d]=_.useState(!1),[f,p]=_.useState(``);return _.useEffect(()=>{let e=c.current;e&&p((e.textContent??``).trim())},[a.children]),(0,A.jsx)(Wm.ItemSlot,{scope:n,disabled:r,textValue:i??f,children:(0,A.jsx)(Fm,{asChild:!0,...s,focusable:!r,children:(0,A.jsx)(Oi.div,{role:`menuitem`,"data-highlighted":u?``:void 0,"aria-disabled":r||void 0,"data-disabled":r?``:void 0,...a,ref:l,onPointerMove:L(e.onPointerMove,Jh(e=>{r?o.onItemLeave(e):(o.onItemEnter(e),e.defaultPrevented||e.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:L(e.onPointerLeave,Jh(e=>o.onItemLeave(e))),onFocus:L(e.onFocus,()=>d(!0)),onBlur:L(e.onBlur,()=>d(!1))})})})},`MenuItemImpl`)),xh=_.forwardRef($(function(e,t){let{checked:n=!1,onCheckedChange:r,...i}=e;return(0,A.jsx)(Oh,{scope:e.__scopeMenu,checked:n,children:(0,A.jsx)(yh,{role:`menuitemcheckbox`,"aria-checked":Vh(n)?`mixed`:n,...i,ref:t,"data-state":Hh(n),onSelect:L(i.onSelect,()=>r?.(Vh(n)?!0:!n),{checkForDefaultPrevented:!1})})})},`MenuCheckboxItem`)),[Sh,Ch]=qm(`MenuRadioGroup`,{value:void 0,onValueChange:$(()=>{},`onValueChange`)}),wh=_.forwardRef($(function(e,t){let{value:n,onValueChange:r,...i}=e,a=Mi(r);return(0,A.jsx)(Sh,{scope:e.__scopeMenu,value:n,onValueChange:a,children:(0,A.jsx)(hh,{...i,ref:t})})},`MenuRadioGroup`)),Th=`MenuRadioItem`,Eh=_.forwardRef($(function(e,t){let{value:n,...r}=e,i=Ch(Th,e.__scopeMenu),a=n===i.value;return(0,A.jsx)(Oh,{scope:e.__scopeMenu,checked:a,children:(0,A.jsx)(yh,{role:`menuitemradio`,"aria-checked":a,...r,ref:t,"data-state":Hh(a),onSelect:L(r.onSelect,()=>i.onValueChange?.(n),{checkForDefaultPrevented:!1})})})},`MenuRadioItem`)),Dh=`MenuItemIndicator`,[Oh,kh]=qm(Dh,{checked:!1}),Ah=_.forwardRef($(function(e,t){let{__scopeMenu:n,forceMount:r,...i}=e,a=kh(Dh,n);return(0,A.jsx)(Ls,{present:r||Vh(a.checked)||a.checked===!0,children:(0,A.jsx)(Oi.span,{...i,ref:t,"data-state":Hh(a.checked)})})},`MenuItemIndicator`)),jh=_.forwardRef($(function(e,t){let{__scopeMenu:n,...r}=e;return(0,A.jsx)(Oi.div,{role:`separator`,"aria-orientation":`horizontal`,...r,ref:t})},`MenuSeparator`)),Mh=`MenuSub`,[Nh,Ph]=qm(Mh),Fh=$(e=>{let{__scopeMenu:t,children:n,open:r=!1,onOpenChange:i}=e,a=Qm(Mh,t),o=Ym(t),[s,c]=_.useState(null),[l,u]=_.useState(null),d=Mi(i);return _.useEffect(()=>(a.open===!1&&d(!1),()=>d(!1)),[a.open,d]),(0,A.jsx)(ks,{...o,children:(0,A.jsx)(Zm,{scope:t,open:r,onOpenChange:d,content:l,onContentChange:u,children:(0,A.jsx)(Nh,{scope:t,contentId:Qi(),triggerId:Qi(),trigger:s,onTriggerChange:c,children:n})})})},`MenuSub`),Ih=`MenuSubTrigger`,Lh=_.forwardRef($(function(e,t){let n=Qm(Ih,e.__scopeMenu),r=eh(Ih,e.__scopeMenu),i=Ph(Ih,e.__scopeMenu),a=lh(Ih,e.__scopeMenu),o=_.useRef(null),{pointerGraceTimerRef:s,onPointerGraceIntentChange:c}=a,l={__scopeMenu:e.__scopeMenu},u=_.useCallback(()=>{o.current&&window.clearTimeout(o.current),o.current=null},[]);_.useEffect(()=>u,[u]),_.useEffect(()=>{let e=s.current;return()=>{window.clearTimeout(e),c(null)}},[s,c]);let d=R(t,i.onTriggerChange);return(0,A.jsx)(nh,{asChild:!0,...l,children:(0,A.jsx)(bh,{id:i.triggerId,"aria-haspopup":`menu`,"aria-expanded":n.open,"aria-controls":n.open?i.contentId:void 0,"data-state":Bh(n.open),...e,ref:d,onClick:t=>{e.onClick?.(t),!(e.disabled||t.defaultPrevented)&&(t.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:L(e.onPointerMove,Jh(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:L(e.onPointerLeave,Jh(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:L(e.onKeyDown,t=>{e.disabled||t.target!==t.currentTarget||(a.searchRef.current===``||t.key!==` `)&&Vm[r.dir].includes(t.key)&&(n.onOpenChange(!0),n.content?.focus(),t.preventDefault())})})})},`MenuSubTrigger`)),Rh=`MenuSubContent`,zh=_.forwardRef($(function(e,t){let n=ah(sh,e.__scopeMenu),{forceMount:r=n.forceMount,align:i=`start`,...a}=e,o=Qm(sh,e.__scopeMenu),s=eh(sh,e.__scopeMenu),c=Ph(Rh,e.__scopeMenu),l=_.useRef(null),u=R(t,l);return(0,A.jsx)(Wm.Provider,{scope:e.__scopeMenu,children:(0,A.jsx)(Ls,{present:r||o.open,children:(0,A.jsx)(Wm.Slot,{scope:e.__scopeMenu,children:(0,A.jsx)(mh,{id:c.contentId,"aria-labelledby":c.triggerId,...a,ref:u,align:i,side:s.dir===`rtl`?`left`:`right`,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:e=>{s.isUsingKeyboardRef.current&&l.current?.focus(),e.preventDefault()},onCloseAutoFocus:e=>e.preventDefault(),onFocusOutside:L(e.onFocusOutside,e=>{e.target!==c.trigger&&o.onOpenChange(!1)}),onEscapeKeyDown:L(e.onEscapeKeyDown,e=>{s.onClose(),e.preventDefault()}),onKeyDown:L(e.onKeyDown,e=>{let t=e.currentTarget.contains(e.target),n=Hm[s.dir].includes(e.key);t&&n&&(o.onOpenChange(!1),c.trigger?.focus(),e.preventDefault())})})})})})},`MenuSubContent`));function Bh(e){return e?`open`:`closed`}$(Bh,`getOpenState`);function Vh(e){return e===`indeterminate`}$(Vh,`isIndeterminate`);function Hh(e){return Vh(e)?`indeterminate`:e?`checked`:`unchecked`}$(Hh,`getCheckedState`);function Uh(e){let t=document.activeElement;for(let n of e)if(n===t||(n.focus(),document.activeElement!==t))return}$(Uh,`focusFirst`);function Wh(e,t){return e.map((n,r)=>e[(t+r)%e.length])}$(Wh,`wrapArray`);function Gh(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=Wh(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}$(Gh,`getNextMatch`);function Kh(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}$(Kh,`isPointInPolygon`);function qh(e,t){return t?Kh({x:e.clientX,y:e.clientY},t):!1}$(qh,`isPointerInGraceArea`);function Jh(e){return t=>t.pointerType===`mouse`?e(t):void 0}$(Jh,`whenMouse`);var Yh=th,Xh=nh,Zh=oh,Qh=uh,$h=gh,eg=yh,tg=xh,ng=wh,rg=Eh,ig=Ah,ag=jh,og=Fh,sg=Lh,cg=zh,lg=Object.defineProperty,ug=(e,t)=>lg(e,`name`,{value:t,configurable:!0}),dg=`ContextMenu`,[fg,pg]=si(dg,[Jm]),mg=Jm(),[hg,gg]=fg(dg),_g=ug(e=>{let{__scopeContextMenu:t,children:n,onOpenChange:r,open:i,dir:a,modal:o=!0}=e,s=_.useRef(!1),[c,l]=Zs({prop:i,defaultProp:!1,onChange:r,caller:dg}),u=mg(t);return(0,A.jsx)(hg,{scope:t,open:c,onOpenChange:l,modal:o,hasInteractedRef:s,children:(0,A.jsx)(Yh,{...u,dir:a,open:c,onOpenChange:l,modal:o,children:n})})},`ContextMenu`),vg=`ContextMenuTrigger`,yg=_.forwardRef(ug(function(e,t){let{__scopeContextMenu:n,disabled:r=!1,...i}=e,a=gg(vg,n),o=mg(n),[s,c]=_.useState({x:0,y:0}),l=_.useMemo(()=>({current:{getBoundingClientRect:ug(()=>DOMRect.fromRect({width:0,height:0,...s}),`getBoundingClientRect`)}}),[s]),u=_.useRef(0),d=_.useCallback(()=>window.clearTimeout(u.current),[]),f=ug(e=>{a.hasInteractedRef.current=!0,c({x:e.clientX,y:e.clientY}),a.onOpenChange(!0)},`handleOpen`);return _.useEffect(()=>d,[d]),_.useEffect(()=>void(r&&d()),[r,d]),(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(Xh,{...o,virtualRef:l}),(0,A.jsx)(Oi.span,{"data-state":a.open?`open`:`closed`,"data-disabled":r?``:void 0,...i,ref:t,style:{WebkitTouchCallout:`none`,...e.style},onContextMenu:r?e.onContextMenu:L(e.onContextMenu,e=>{d(),f(e),e.preventDefault()}),onPointerDown:r?e.onPointerDown:L(e.onPointerDown,Ng(e=>{d(),a.open&&a.onOpenChange(!1),u.current=window.setTimeout(()=>f(e),700)})),onPointerMove:r?e.onPointerMove:L(e.onPointerMove,Ng(d)),onPointerCancel:r?e.onPointerCancel:L(e.onPointerCancel,Ng(d)),onPointerUp:r?e.onPointerUp:L(e.onPointerUp,Ng(d))})]})},`ContextMenuTrigger`)),bg=ug(e=>{let{__scopeContextMenu:t,...n}=e,r=mg(t);return(0,A.jsx)(Zh,{...r,...n})},`ContextMenuPortal`),xg=`ContextMenuContent`,Sg=_.forwardRef(ug(function(e,t){let{__scopeContextMenu:n,...r}=e,i=gg(xg,n),a=mg(n),o=_.useRef(!1);return(0,A.jsx)(Qh,{...a,...r,ref:t,side:`right`,sideOffset:2,align:`start`,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),!t.defaultPrevented&&o.current&&t.preventDefault(),o.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),!t.defaultPrevented&&!i.modal&&(o.current=!0)},style:{...e.style,"--radix-context-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-context-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-context-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-context-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-context-menu-trigger-height":`var(--radix-popper-anchor-height)`}})},`ContextMenuContent`)),Cg=_.forwardRef(ug(function(e,t){let{__scopeContextMenu:n,...r}=e,i=mg(n);return(0,A.jsx)($h,{...i,...r,ref:t})},`ContextMenuLabel`)),wg=_.forwardRef(ug(function(e,t){let{__scopeContextMenu:n,...r}=e,i=mg(n);return(0,A.jsx)(eg,{...i,...r,ref:t})},`ContextMenuItem`)),Tg=_.forwardRef(ug(function(e,t){let{__scopeContextMenu:n,...r}=e,i=mg(n);return(0,A.jsx)(tg,{...i,...r,ref:t})},`ContextMenuCheckboxItem`)),Eg=_.forwardRef(ug(function(e,t){let{__scopeContextMenu:n,...r}=e,i=mg(n);return(0,A.jsx)(rg,{...i,...r,ref:t})},`ContextMenuRadioItem`)),Dg=_.forwardRef(ug(function(e,t){let{__scopeContextMenu:n,...r}=e,i=mg(n);return(0,A.jsx)(ig,{...i,...r,ref:t})},`ContextMenuItemIndicator`)),Og=_.forwardRef(ug(function(e,t){let{__scopeContextMenu:n,...r}=e,i=mg(n);return(0,A.jsx)(ag,{...i,...r,ref:t})},`ContextMenuSeparator`)),kg=`ContextMenuSub`,Ag=ug(e=>{let{__scopeContextMenu:t,children:n,onOpenChange:r,open:i,defaultOpen:a}=e,o=mg(t),[s,c]=Zs({prop:i,defaultProp:a??!1,onChange:r,caller:kg});return(0,A.jsx)(og,{...o,open:s,onOpenChange:c,children:n})},`ContextMenuSub`),jg=_.forwardRef(ug(function(e,t){let{__scopeContextMenu:n,...r}=e,i=mg(n);return(0,A.jsx)(sg,{...i,...r,ref:t})},`ContextMenuSubTrigger`)),Mg=_.forwardRef(ug(function(e,t){let{__scopeContextMenu:n,...r}=e,i=mg(n);return(0,A.jsx)(cg,{...i,...r,ref:t,style:{...e.style,"--radix-context-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-context-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-context-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-context-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-context-menu-trigger-height":`var(--radix-popper-anchor-height)`}})},`ContextMenuSubContent`));function Ng(e){return t=>t.pointerType===`mouse`?void 0:e(t)}ug(Ng,`whenTouchOrPen`);var Pg=_g,Fg=yg,Ig=bg,Lg=Sg,Rg=Cg,zg=wg,Bg=Tg,Vg=Eg,Hg=Dg,Ug=Og,Wg=Ag,Gg=jg,Kg=Mg,qg=Pg,Jg=Fg,Yg=Wg,Xg=`z-[10001] min-w-[8rem] max-h-[var(--radix-context-menu-content-available-height)] overflow-y-auto overflow-x-hidden overscroll-contain rounded-md border bg-popover p-1 text-popover-foreground`,Zg=`relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50`,Qg=`relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50`,$g=_.forwardRef(({className:e,inset:t,children:n,...r},i)=>(0,A.jsxs)(Gg,{ref:i,"data-slot":`context-menu-sub-trigger`,className:K(`flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground`,t&&`pl-8`,e),...r,children:[n,(0,A.jsx)(sd,{className:`ml-auto h-4 w-4`})]}));$g.displayName=Gg.displayName;var e_=_.forwardRef(({className:e,container:t,...n},r)=>{let i=_u(t);return(0,A.jsx)(Ig,{container:i,children:(0,A.jsx)(Kg,{ref:r,"data-slot":`context-menu-sub-content`,className:K(Xg,`shadow-lg`,fu,e),...n})})});e_.displayName=Kg.displayName;var t_=_.forwardRef(({className:e,container:t,...n},r)=>{let i=_u(t);return(0,A.jsx)(Ig,{container:i,children:(0,A.jsx)(Lg,{ref:r,"data-slot":`context-menu-content`,className:K(Xg,`shadow-md`,fu,e),...n})})});t_.displayName=Lg.displayName;var n_=_.forwardRef(({className:e,inset:t,...n},r)=>(0,A.jsx)(zg,{ref:r,"data-slot":`context-menu-item`,className:K(Zg,`gap-2 [&>svg]:size-4 [&>svg]:shrink-0`,t&&`pl-8`,e),...n}));n_.displayName=zg.displayName;var r_=_.forwardRef(({className:e,children:t,...n},r)=>(0,A.jsxs)(Bg,{ref:r,"data-slot":`context-menu-checkbox-item`,className:K(Qg,e),...n,children:[(0,A.jsx)(`span`,{className:`absolute left-2 flex h-3.5 w-3.5 items-center justify-center`,children:(0,A.jsx)(Hg,{children:(0,A.jsx)(ad,{className:`h-4 w-4`})})}),t]}));r_.displayName=Bg.displayName;var i_=_.forwardRef(({className:e,children:t,...n},r)=>(0,A.jsxs)(Vg,{ref:r,"data-slot":`context-menu-radio-item`,className:K(Qg,e),...n,children:[(0,A.jsx)(`span`,{className:`absolute left-2 flex h-3.5 w-3.5 items-center justify-center`,children:(0,A.jsx)(Hg,{children:(0,A.jsx)(od,{className:`h-4 w-4 fill-current`})})}),t]}));i_.displayName=Vg.displayName;var a_=_.forwardRef(({className:e,inset:t,...n},r)=>(0,A.jsx)(Rg,{ref:r,"data-slot":`context-menu-label`,className:K(`px-2 py-1.5 text-sm font-semibold text-foreground`,t&&`pl-8`,e),...n}));a_.displayName=Rg.displayName;var o_=_.forwardRef(({className:e,...t},n)=>(0,A.jsx)(Ug,{ref:n,"data-slot":`context-menu-separator`,className:K(`-mx-1 my-1 h-px bg-border`,e),...t}));o_.displayName=Ug.displayName;var s_=`border border-border bg-card`,c_=Object.defineProperty,l_=(e,t)=>c_(e,`name`,{value:t,configurable:!0}),u_=`Popover`,[d_,f_]=si(u_,[gs]),p_=gs(),[m_,h_]=d_(u_),g_=l_(e=>{let{__scopePopover:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!1}=e,s=p_(t),c=_.useRef(null),[l,u]=_.useState(!1),[d,f]=Zs({prop:r,defaultProp:i??!1,onChange:a,caller:u_});return(0,A.jsx)(ks,{...s,children:(0,A.jsx)(m_,{scope:t,contentId:Qi(),triggerRef:c,open:d,onOpenChange:f,onOpenToggle:_.useCallback(()=>f(e=>!e),[f]),hasCustomAnchor:l,onCustomAnchorAdd:_.useCallback(()=>u(!0),[]),onCustomAnchorRemove:_.useCallback(()=>u(!1),[]),modal:o,children:n})})},`Popover`),__=`PopoverTrigger`,v_=_.forwardRef(l_(function(e,t){let{__scopePopover:n,...r}=e,i=h_(__,n),a=p_(n),o=R(t,i.triggerRef),s=(0,A.jsx)(Oi.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":k_(i.open),...r,ref:o,onClick:L(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?s:(0,A.jsx)(As,{asChild:!0,...a,children:s})},`PopoverTrigger`)),y_=`PopoverPortal`,[b_,x_]=d_(y_,{forceMount:void 0}),S_=l_(e=>{let{__scopePopover:t,forceMount:n,children:r,container:i}=e,a=h_(y_,t);return(0,A.jsx)(b_,{scope:t,forceMount:n,children:(0,A.jsx)(Ls,{present:n||a.open,children:(0,A.jsx)(Ns,{asChild:!0,container:i,children:r})})})},`PopoverPortal`),C_=`PopoverContent`,w_=_.forwardRef(l_(function(e,t){let n=x_(C_,e.__scopePopover),{forceMount:r=n.forceMount,...i}=e,a=h_(C_,e.__scopePopover);return(0,A.jsx)(Ls,{present:r||a.open,children:a.modal?(0,A.jsx)(E_,{...i,ref:t}):(0,A.jsx)(D_,{...i,ref:t})})},`PopoverContent`)),T_=di(`PopoverContent.RemoveScroll`),E_=_.forwardRef(l_(function(e,t){let n=h_(C_,e.__scopePopover),r=_.useRef(null),i=R(t,r),a=_.useRef(!1);return _.useEffect(()=>{let e=r.current;if(e)return Xf(e)},[]),(0,A.jsx)(Q,{as:T_,allowPinchZoom:!0,children:(0,A.jsx)(O_,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:L(e.onCloseAutoFocus,e=>{e.preventDefault(),a.current||n.triggerRef.current?.focus()}),onPointerDownOutside:L(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,r=t.button===2||n;a.current=r},{checkForDefaultPrevented:!1}),onFocusOutside:L(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})},`PopoverContentModal`)),D_=_.forwardRef(l_(function(e,t){let n=h_(C_,e.__scopePopover),r=_.useRef(!1),i=_.useRef(!1);return(0,A.jsx)(O_,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})},`PopoverContentNonModal`)),O_=_.forwardRef(l_(function(e,t){let{__scopePopover:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,disableOutsidePointerEvents:o,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onInteractOutside:u,...d}=e,f=h_(C_,n),p=p_(n);return Nd(),(0,A.jsx)(gd,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,A.jsx)(Bi,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:u,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onDismiss:()=>f.onOpenChange(!1),deferPointerDownOutside:!0,children:(0,A.jsx)(js,{"data-state":k_(f.open),role:`dialog`,id:f.contentId,...p,...d,ref:t,style:{...d.style,"--radix-popover-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-popover-content-available-width":`var(--radix-popper-available-width)`,"--radix-popover-content-available-height":`var(--radix-popper-available-height)`,"--radix-popover-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-popover-trigger-height":`var(--radix-popper-anchor-height)`}})})})},`PopoverContentImpl`));function k_(e){return e?`open`:`closed`}l_(k_,`getState`);var A_=g_,j_=v_,M_=S_,N_=w_,P_=A_,F_=j_,I_=_.forwardRef(({className:e,align:t=`center`,sideOffset:n=4,container:r,animated:i=!0,sizing:a=`fixed`,collisionPadding:o=16,...s},c)=>{let l=_u(r);return(0,A.jsx)(M_,{container:l,children:(0,A.jsx)(N_,{ref:c,align:t,sideOffset:n,collisionPadding:o,className:K(`z-[10000] max-h-[var(--radix-popover-content-available-height)] overflow-y-auto overscroll-contain rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none`,a===`content`?`w-auto min-w-[min(max(var(--radix-popover-trigger-width),20rem),calc(100vw-2rem))] max-w-[min(28rem,calc(100vw-2rem))]`:`w-72 max-w-[calc(100vw-2rem)]`,i&&`matrx-motion-popper`,e),...s})})});I_.displayName=N_.displayName;var L_=`matrx:layer-front`;function R_(e){typeof document<`u`&&document.dispatchEvent(new CustomEvent(L_,{detail:{element:e}}))}var z_=_.createContext(!1),B_=({children:e,...t})=>{let n=im(),r=t.modal??n;return(0,A.jsx)(z_.Provider,{value:t.modal===void 0,children:(0,A.jsx)(Kp,{modal:r,children:(0,A.jsx)(ip,{...t,modal:r,children:e})})})};B_.displayName=`Dialog`;var V_=({container:e,...t})=>{let n=_u(e);return(0,A.jsx)(cp,{container:n??null,...t})};V_.displayName=`DialogPortal`;var H_=Symbol.for(`ai-matrx.design-system.dialog-container-context`),U_=globalThis,W_=U_[H_]??=_.createContext(null),G_=_.forwardRef(({className:e,...t},n)=>(0,A.jsx)(up,{ref:n,"data-slot":`dialog-overlay`,className:K(`fixed inset-0 z-[10000] bg-[var(--matrx-overlay-scrim-soft)]`,du,e),...t}));G_.displayName=up.displayName;var K_=_.forwardRef(({onInteractOutside:e,...t},n)=>{let r=qp();return Lp(r),(0,A.jsx)(mp,{...t,ref:n,"aria-modal":r||void 0,onInteractOutside:Bp(e)})});K_.displayName=`DialogContentPrimitive`;var q_=`matrx-dialog-card fixed inset-0 z-[10000] m-auto grid h-fit min-w-0 w-full max-w-lg gap-4 max-h-[85dvh] overflow-y-auto overscroll-contain [--dialog-pad:1.5rem] overflow-x-clip border bg-background p-6 shadow-lg [overflow-wrap:anywhere] [&>*]:min-w-0 [&>*]:max-w-full sm:rounded-lg`,J_=`matrx-mobile-sheet matrx-dialog-card fixed inset-x-0 bottom-0 left-0 right-0 top-auto z-[10000] flex min-w-0 flex-col w-full max-w-full max-h-[90dvh] gap-4 [--dialog-pad:1rem] overflow-x-clip border-t bg-background p-4 pb-safe shadow-lg [overflow-wrap:anywhere] [&>*]:min-w-0 [&>*]:max-w-full rounded-t-2xl rounded-b-none overflow-y-auto overscroll-contain`,Y_=`inset-x-0 bottom-0 left-0 right-0 top-auto translate-none w-full max-w-full max-h-[90dvh] rounded-b-none rounded-t-2xl overflow-y-auto`,X_=_.createContext(null),Z_=80;function Q_(e){return e instanceof Element&&!!e.closest(`button, a, input, textarea, select, [role='button'], [contenteditable='true']`)}var $_=_.forwardRef(({className:e,children:t,mobileSheet:n=!0,animated:r=!0,showCloseButton:i=!0,container:a,dismissOnOutsideClick:o=!1,onInteractOutside:s,onEscapeKeyDown:c,onPointerDownCapture:l,onFocusCapture:u,style:d,...f},p)=>{let m=im(),h=qp(),g=_u(a),v=n&&m,y=!h&&!v,b=_.useContext(z_),[x,S]=_.useState(null),C=y&&b,[w,T]=_.useState(!1);_.useEffect(()=>{if(!C||!x)return;let e=e=>{let t=e.detail?.element??null;(!t||t!==x&&!x.contains(t))&&T(!0)};return document.addEventListener(L_,e),R_(x),()=>document.removeEventListener(L_,e)},[C,x]);let E=()=>{C&&x&&(T(!1),R_(x))},[D,O]=_.useState({x:0,y:0}),k=_.useRef(null),ee=_.useMemo(()=>{if(!y)return null;let e=(e,t)=>Math.max(-t,Math.min(t,e));return{onPointerDown:e=>{e.button!==0||Q_(e.target)||(k.current={x:e.clientX,y:e.clientY,baseX:D.x,baseY:D.y},e.currentTarget.setPointerCapture?.(e.pointerId))},onPointerMove:t=>{let n=k.current;n&&O({x:e(n.baseX+t.clientX-n.x,window.innerWidth/2-Z_/2),y:e(n.baseY+t.clientY-n.y,window.innerHeight/2-Z_/2)})},onPointerUp:e=>{k.current&&(k.current=null,e.currentTarget.releasePointerCapture?.(e.pointerId))},onPointerCancel:()=>{k.current=null},onDoubleClick:()=>O({x:0,y:0})}},[y,D.x,D.y]),j=_.useCallback(e=>{S(e),typeof p==`function`?p(e):p&&(p.current=e)},[p]),M=Ep(t,nv)||Ep(t,yp),te=Ep(t,rv)||Ep(t,xp);return(0,A.jsxs)(V_,{container:a,children:[h?(0,A.jsx)(G_,{}):null,(0,A.jsxs)(K_,{ref:j,"data-slot":`dialog-content`,className:K(v?J_:q_,r&&(v?`matrx-motion-bottom-sheet`:`matrx-motion-dialog`),e,v&&Y_,!h&&!b&&`z-[900]`,C&&w&&`z-[999]`,y&&`shadow-2xl ring-1 ring-border/60`),style:y&&(D.x!==0||D.y!==0)?{...d,translate:`${D.x}px ${D.y}px`}:d,onPointerDownCapture:e=>{l?.(e),w&&E()},onFocusCapture:e=>{u?.(e),w&&E()},onInteractOutside:e=>{s?.(e),y&&!o&&e.preventDefault()},onEscapeKeyDown:e=>{c?.(e);let t=e.target instanceof Node&&e.target!==document.body?e.target:document.activeElement;y&&x&&!(t&&x.contains(t))&&e.preventDefault()},...te?{}:{"aria-describedby":void 0},...f,children:[M?null:(0,A.jsx)(ac,{children:(0,A.jsx)(yp,{children:`Dialog`})}),(0,A.jsx)(W_.Provider,{value:x,children:(0,A.jsx)(X_.Provider,{value:ee,children:(0,A.jsx)(gu,{container:x??g??null,children:t})})}),i?(0,A.jsxs)(Cp,{"data-slot":`dialog-close`,"aria-label":`Close`,className:`absolute right-2 top-4 flex h-11 w-11 items-center justify-center rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground sm:right-4 lg:h-10 lg:w-10`,children:[(0,A.jsx)(rd,{className:`h-4 w-4`}),(0,A.jsx)(`span`,{className:`sr-only`,children:`Close`})]}):null]})]})});$_.displayName=mp.displayName;var ev=({className:e,...t})=>{let n=_.useContext(X_);return(0,A.jsx)(`div`,{"data-slot":`dialog-header`,...n?{...n,"data-window-handle":``,title:`Drag to move · double-click to recenter`}:{},className:K(`flex flex-col space-y-1.5 pr-12 text-center sm:text-left`,n&&`cursor-grab select-none active:cursor-grabbing`,e),...t})};ev.displayName=`DialogHeader`;var tv=({className:e,...t})=>(0,A.jsx)(`div`,{"data-slot":`dialog-footer`,className:K(`flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2`,`sticky bottom-0 z-10 bg-background pt-3`,`mx-[calc(var(--dialog-pad,0px)*-1)] px-[var(--dialog-pad,0px)] pb-[var(--dialog-pad,0px)]`,e),...t});tv.displayName=`DialogFooter`;var nv=_.forwardRef(({className:e,...t},n)=>(0,A.jsx)(yp,{ref:n,"data-slot":`dialog-title`,className:K(`text-lg font-semibold leading-none tracking-tight`,e),...t}));nv.displayName=yp.displayName;var rv=_.forwardRef(({className:e,...t},n)=>(0,A.jsx)(xp,{ref:n,"data-slot":`dialog-description`,className:K(`text-sm text-muted-foreground`,e),...t}));rv.displayName=xp.displayName;var iv=Object.defineProperty,av=(e,t)=>iv(e,`name`,{value:t,configurable:!0}),ov=`DropdownMenu`,[sv,cv]=si(ov,[Jm]),lv=Jm(),[uv,dv]=sv(ov),fv=av(e=>{let{__scopeDropdownMenu:t,children:n,dir:r,open:i,defaultOpen:a,onOpenChange:o,modal:s=!0}=e,c=lv(t),l=_.useRef(null),[u,d]=Zs({prop:i,defaultProp:a??!1,onChange:o,caller:ov});return(0,A.jsx)(uv,{scope:t,triggerId:Qi(),triggerRef:l,contentId:Qi(),open:u,onOpenChange:d,onOpenToggle:_.useCallback(()=>d(e=>!e),[d]),modal:s,children:(0,A.jsx)(Yh,{...c,open:u,onOpenChange:d,dir:r,modal:s,children:n})})},`DropdownMenu`),pv=`DropdownMenuTrigger`,mv=_.forwardRef(av(function(e,t){let{__scopeDropdownMenu:n,disabled:r=!1,...i}=e,a=dv(pv,n),o=lv(n),s=R(t,a.triggerRef);return(0,A.jsx)(Xh,{asChild:!0,...o,children:(0,A.jsx)(Oi.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:s,onPointerDown:L(e.onPointerDown,e=>{!r&&e.button===0&&e.ctrlKey===!1&&(a.onOpenToggle(),a.open||e.preventDefault())}),onKeyDown:L(e.onKeyDown,e=>{r||([`Enter`,` `].includes(e.key)&&a.onOpenToggle(),e.key===`ArrowDown`&&a.onOpenChange(!0),[`Enter`,` `,`ArrowDown`].includes(e.key)&&e.preventDefault())})})})},`DropdownMenuTrigger`)),hv=av(e=>{let{__scopeDropdownMenu:t,...n}=e,r=lv(t);return(0,A.jsx)(Zh,{...r,...n})},`DropdownMenuPortal`),gv=`DropdownMenuContent`,_v=_.forwardRef(av(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=dv(gv,n),a=lv(n),o=_.useRef(!1);return(0,A.jsx)(Qh,{id:i.contentId,"aria-labelledby":i.triggerId,...a,...r,ref:t,onCloseAutoFocus:L(e.onCloseAutoFocus,e=>{o.current||i.triggerRef.current?.focus(),o.current=!1,e.preventDefault()}),onInteractOutside:L(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)`}})},`DropdownMenuContent`)),vv=_.forwardRef(av(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=lv(n);return(0,A.jsx)($h,{...i,...r,ref:t})},`DropdownMenuLabel`)),yv=_.forwardRef(av(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=lv(n);return(0,A.jsx)(eg,{...i,...r,ref:t})},`DropdownMenuItem`)),bv=_.forwardRef(av(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=lv(n);return(0,A.jsx)(tg,{...i,...r,ref:t})},`DropdownMenuCheckboxItem`)),xv=_.forwardRef(av(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=lv(n);return(0,A.jsx)(ng,{...i,...r,ref:t})},`DropdownMenuRadioGroup`)),Sv=_.forwardRef(av(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=lv(n);return(0,A.jsx)(rg,{...i,...r,ref:t})},`DropdownMenuRadioItem`)),Cv=_.forwardRef(av(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=lv(n);return(0,A.jsx)(ig,{...i,...r,ref:t})},`DropdownMenuItemIndicator`)),wv=_.forwardRef(av(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=lv(n);return(0,A.jsx)(ag,{...i,...r,ref:t})},`DropdownMenuSeparator`)),Tv=av(e=>{let{__scopeDropdownMenu:t,children:n,open:r,onOpenChange:i,defaultOpen:a}=e,o=lv(t),[s,c]=Zs({prop:r,defaultProp:a??!1,onChange:i,caller:`DropdownMenuSub`});return(0,A.jsx)(og,{...o,open:s,onOpenChange:c,children:n})},`DropdownMenuSub`),Ev=_.forwardRef(av(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=lv(n);return(0,A.jsx)(sg,{...i,...r,ref:t})},`DropdownMenuSubTrigger`)),Dv=_.forwardRef(av(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=lv(n);return(0,A.jsx)(cg,{...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)`}})},`DropdownMenuSubContent`)),Ov=fv,kv=mv,Av=hv,jv=_v,Mv=vv,Nv=yv,Pv=bv,Fv=xv,Iv=Sv,Lv=Cv,Rv=wv,zv=Tv,Bv=Ev,Vv=Dv,Hv=Ov,Uv=kv,Wv=zv,Gv=Fv,Kv=`z-[10001] min-w-[8rem] max-h-[var(--radix-dropdown-menu-content-available-height)] overflow-y-auto overflow-x-hidden overscroll-contain rounded-md border bg-popover p-1 text-popover-foreground`,qv=`relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50`,Jv=`relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50`,Yv=_.forwardRef(({className:e,inset:t,children:n,...r},i)=>(0,A.jsxs)(Bv,{ref:i,"data-slot":`dropdown-menu-sub-trigger`,className:K(`flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent`,t&&`pl-8`,e),...r,children:[n,(0,A.jsx)(sd,{className:`ml-auto h-4 w-4`})]}));Yv.displayName=Bv.displayName;var Xv=_.forwardRef(({className:e,container:t,sideOffset:n=2,alignOffset:r=-4,collisionPadding:i=8,...a},o)=>{let s=_u(t);return(0,A.jsx)(Av,{container:s,children:(0,A.jsx)(Vv,{ref:o,"data-slot":`dropdown-menu-sub-content`,sideOffset:n,alignOffset:r,collisionPadding:i,className:K(Kv,`shadow-lg`,fu,e),...a})})});Xv.displayName=Vv.displayName;var Zv=_.forwardRef(({className:e,sideOffset:t=4,container:n,...r},i)=>{let a=_u(n);return(0,A.jsx)(Av,{container:a,children:(0,A.jsx)(jv,{ref:i,"data-slot":`dropdown-menu-content`,sideOffset:t,className:K(Kv,`shadow-md`,fu,e),...r})})});Zv.displayName=jv.displayName;var Qv=_.forwardRef(({className:e,inset:t,...n},r)=>(0,A.jsx)(Nv,{ref:r,"data-slot":`dropdown-menu-item`,className:K(qv,t&&`pl-8`,e),...n}));Qv.displayName=Nv.displayName;var $v=_.forwardRef(({className:e,children:t,...n},r)=>(0,A.jsxs)(Pv,{ref:r,"data-slot":`dropdown-menu-checkbox-item`,className:K(Jv,e),...n,children:[(0,A.jsx)(`span`,{className:`absolute left-2 flex h-3.5 w-3.5 items-center justify-center`,children:(0,A.jsx)(Lv,{children:(0,A.jsx)(ad,{className:`h-4 w-4`})})}),t]}));$v.displayName=Pv.displayName;var ey=_.forwardRef(({className:e,children:t,...n},r)=>(0,A.jsxs)(Iv,{ref:r,"data-slot":`dropdown-menu-radio-item`,className:K(Jv,e),...n,children:[(0,A.jsx)(`span`,{className:`absolute left-2 flex h-3.5 w-3.5 items-center justify-center`,children:(0,A.jsx)(Lv,{children:(0,A.jsx)(od,{className:`h-4 w-4 fill-current`})})}),t]}));ey.displayName=Iv.displayName;var ty=_.forwardRef(({className:e,inset:t,...n},r)=>(0,A.jsx)(Mv,{ref:r,"data-slot":`dropdown-menu-label`,className:K(`px-2 py-1.5 text-sm font-semibold`,t&&`pl-8`,e),...n}));ty.displayName=Mv.displayName;var ny=_.forwardRef(({className:e,...t},n)=>(0,A.jsx)(Rv,{ref:n,"data-slot":`dropdown-menu-separator`,className:K(`-mx-1 my-1 h-px bg-muted`,e),...t}));ny.displayName=Rv.displayName;var ry=(e=`default`)=>{let t=`flex h-10 w-full ${s_} text-foreground shadow-input rounded-md px-3 py-2 text-sm file:border-0 file:bg-transparent
57
- file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground
58
- focus-visible:outline-none focus-visible:ring-[2px] focus-visible:ring-ring
59
- disabled:cursor-not-allowed disabled:opacity-50
60
- dark:shadow-none
61
- transition duration-400
62
- [&:-webkit-autofill]:bg-card [&:-webkit-autofill]:shadow-[0_0_0_1000px_hsl(var(--card))_inset] [&:-webkit-autofill]:[caret-color:currentColor]
63
- dark:[&:-webkit-autofill]:shadow-[0_0_0_1000px_hsl(var(--card))_inset] dark:[&:-webkit-autofill]:[-webkit-text-fill-color:hsl(var(--foreground))]
64
- [&:-webkit-autofill:hover]:shadow-[0_0_0_1000px_hsl(var(--card))_inset] [&:-webkit-autofill:focus]:shadow-[0_0_0_1000px_hsl(var(--card))_inset]`;switch(e){case`destructive`:return`${t} bg-destructive text-destructive-foreground`;case`outline`:return`${t} border-2`;case`secondary`:return`${t} bg-secondary text-secondary-foreground`;case`ghost`:return`${t} bg-transparent shadow-none`;case`link`:return`${t} bg-transparent underline-offset-4 hover:underline`;case`primary`:return`${t} bg-primary text-primary-foreground`;default:return t}},iy=_.forwardRef(({className:e,type:t,variant:n=`default`,...r},i)=>(0,A.jsx)(`input`,{type:t,className:K(ry(n),e),ref:i,...r}));iy.displayName=`Input`;var ay=_.forwardRef(({onEnter:e,...t},n)=>{let r=t=>{t.key===`Enter`&&e&&(t.preventDefault(),e())};return(0,A.jsx)(iy,{...t,ref:n,onKeyDown:e=>{r(e),t.onKeyDown&&t.onKeyDown(e)}})});ay.displayName=`EnterInput`;var oy=_.forwardRef(({className:e,type:t,variant:n=`default`,...r},i)=>(0,A.jsx)(`input`,{type:t,className:K(`flex h-9 w-full rounded-md ${s_} px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50`,e),ref:i,...r}));oy.displayName=`BasicInput`;var sy=_.forwardRef(({prefix:e,className:t,wrapperClassName:n,...r},i)=>(0,A.jsxs)(`div`,{className:K(`relative`,n),children:[e&&(0,A.jsx)(`div`,{className:`absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground`,children:e}),(0,A.jsx)(iy,{ref:i,className:K(e&&`pl-10`,t),...r})]}));sy.displayName=`InputWithPrefix`;var cy=/(?:^|\s)(h-full|h-dvh|flex-1|grow)(?:\s|$)/,ly=/(?:^|\s)(w-full|w-screen)(?:\s|$)/;function uy(e){if(!e)return;let t=[];return cy.test(e)&&t.push(`h-full min-h-0`),ly.test(e)&&t.push(`w-full`),t.length?t.join(` `):void 0}var dy=`flex h-auto w-full rounded-md ${s_} px-3 py-2 text-sm text-foreground shadow-textarea transition duration-400 placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-[2px] focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50`,fy=`flex w-full rounded-md ${s_} px-3 py-2 text-sm text-foreground shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50`;function py(e,t,n=!1,r,i){_.useEffect(()=>{if(!n||!e.current)return;let t=e.current;t.style.height=`auto`;let a=t.scrollHeight;r&&(a=Math.max(a,r)),i&&a>=i?(t.style.height=`${i}px`,t.style.overflowY=`auto`):(t.style.height=`${a}px`,t.style.overflowY=`hidden`)},[t,n,r,i,e])}function my(e){let t=_.useRef(null);return{ref:t,callback:_.useCallback(n=>{t.current=n,typeof e==`function`?e(n):e&&(e.current=n)},[e])}}function hy(e,t){if(e!==void 0||t!==void 0)return{minHeight:e?`${e}px`:void 0,maxHeight:t?`${t}px`:void 0}}var gy=_.forwardRef(({className:e,autoGrow:t,minHeight:n,maxHeight:r,wrapperClassName:i,...a},o)=>{let{ref:s,callback:c}=my(o),l=uy(e),u=!!(i||l);py(s,a.value,t,n,r);let d=(0,A.jsx)(`textarea`,{ref:c,"data-slot":`textarea`,className:K(dy,t&&`resize-none`,l,e),style:hy(n,r),...a});return u?(0,A.jsx)(`div`,{className:K(l,i),children:d}):d});gy.displayName=`Textarea`;var _y=_.forwardRef(({className:e,autoGrow:t,minHeight:n,maxHeight:r,...i},a)=>{let{ref:o,callback:s}=my(a);return py(o,i.value,t,n,r),(0,A.jsx)(`textarea`,{ref:s,"data-slot":`textarea`,className:K(fy,`h-auto min-h-[60px]`,t&&`resize-none`,e),style:hy(n,r),...i})});_y.displayName=`BasicTextarea`;var vy=_.forwardRef(({prefix:e,className:t,wrapperClassName:n,autoGrow:r,minHeight:i,maxHeight:a,...o},s)=>{let{ref:c,callback:l}=my(s);return py(c,o.value,r,i,a),(0,A.jsxs)(`div`,{className:K(`relative`,uy(t),n),children:[e?(0,A.jsx)(`div`,{className:`pointer-events-none absolute left-3 top-3 z-10 text-muted-foreground`,children:e}):null,(0,A.jsx)(`textarea`,{ref:l,"data-slot":`textarea`,className:K(fy,`resize-y`,e&&`pl-10`,r&&`resize-none`,t),style:hy(i,a),...o})]})});vy.displayName=`TextareaWithPrefix`;var yy={"input-streaming":`Preparing`,"input-available":`Running`,"approval-requested":`Needs your approval`,"output-available":`Done`,"output-error":`Failed`,"output-denied":`Declined`};function by(e){if(e===void 0)return``;if(typeof e==`string`)return e;try{return JSON.stringify(e,null,2)}catch{return String(e)}}function xy(e){let{part:t,defaultExpanded:n,body:r}=e,[i,a]=(0,_.useState)(n),{toolLabel:o}=Br(),s=t.progress[t.progress.length-1],c=by(t.input),l=by(t.output),u=yy[t.state],d=s!==void 0&&s.message!==``&&s.message.trim().toLowerCase()!==u.toLowerCase()?s.message:null,f=c!==``||l!==``||t.errorText!==null||t.progress.length>0;return(0,A.jsxs)(`div`,{className:`mx-chat-tool`,"data-state":t.state,"data-tool":t.toolName,...e.rendererTag===void 0?{}:{"data-mx-chat-tool-renderer":e.rendererTag},children:[(0,A.jsxs)(`button`,{type:`button`,className:`mx-chat-tool__header mx-chat-focusable`,"aria-expanded":i,onClick:()=>a(e=>!e),children:[(0,A.jsx)(`span`,{"data-open":i,className:`mx-chat-chevron-wrap`,children:(0,A.jsx)(Gr,{})}),(0,A.jsx)(`span`,{className:`mx-chat-tool__name`,children:o(t.toolName)}),d===null?null:(0,A.jsx)(`span`,{className:`mx-chat-tool__beat`,children:d}),(0,A.jsx)(`span`,{className:`mx-chat-tool__state`,children:u})]}),i?r===void 0?(0,A.jsxs)(`div`,{className:`mx-chat-tool__body`,children:[c===``?null:(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(`span`,{className:`mx-chat-tool__label`,children:`What it was asked`}),(0,A.jsx)(`pre`,{className:`mx-chat-tool__payload`,children:c})]}),t.progress.length>0?(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(`span`,{className:`mx-chat-tool__label`,children:`Progress`}),(0,A.jsx)(`ul`,{className:`mx-chat-tool__progress`,children:t.progress.map((e,t)=>(0,A.jsxs)(`li`,{children:[(0,A.jsx)(`span`,{"data-tool-beat":e.toolName,children:e.toolName}),e.message===``?null:` — ${e.message}`,e.percent===null?null:` (${Math.round(e.percent)}%)`]},`${e.toolName}-${t}`))})]}):null,t.errorText===null?null:(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(`span`,{className:`mx-chat-tool__label`,children:`What went wrong`}),(0,A.jsx)(`p`,{className:`mx-chat-failure__sentence`,children:t.errorText})]}),l===``?null:(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(`span`,{className:`mx-chat-tool__label`,children:`What it returned`}),(0,A.jsx)(`pre`,{className:`mx-chat-tool__payload`,children:l})]}),f?null:(0,A.jsx)(`span`,{className:`mx-chat-standin`,children:t.state===`input-streaming`?`This tool has not said what it is doing yet.`:`This tool ran without reporting any details.`})]}):r:null]})}function Sy(e){return(0,A.jsx)(A.Fragment,{children:e.renderContent({kind:`markdown`,text:e.part.text,streaming:e.streaming,role:e.role,messageId:e.messageId})})}function Cy(e){let{part:t,defaultOpen:n}=e,[r,i]=(0,_.useState)(n),a=t.state===`streaming`;return(0,A.jsxs)(`div`,{className:`mx-chat-reasoning`,"data-streaming":a,children:[(0,A.jsxs)(`button`,{type:`button`,className:`mx-chat-quiet-button mx-chat-focusable`,"aria-expanded":r,onClick:()=>i(e=>!e),children:[(0,A.jsx)(`span`,{"data-open":r,className:`mx-chat-chevron-wrap`,children:(0,A.jsx)(Gr,{})}),a?`Thinking…`:`Thought process`]}),r?(0,A.jsx)(`div`,{className:`mx-chat-reasoning__body`,"data-mx-chat-reasoning":`body`,children:t.text}):null]})}function wy(e){let{part:t}=e;return(0,A.jsxs)(`div`,{className:`mx-chat-notice`,"data-level":t.level,role:`note`,children:[(0,A.jsx)(`span`,{children:t.userMessage}),t.remedy===null?null:(0,A.jsx)(`span`,{className:`mx-chat-notice__remedy`,children:t.remedy})]})}function Ty(e){let{part:t,retryText:n,onRetry:r}=e;return(0,A.jsxs)($p,{as:`div`,className:`mx-chat-failure`,"data-code":t.code??`unknown`,message:t.userMessage,error:t,operation:`Answer the last message`,unsavedInput:n===``?void 0:{message:n},origin:`chat/ChatFailurePart`,children:[(0,A.jsx)(`p`,{className:`mx-chat-failure__sentence`,children:t.userMessage}),t.remedy===null?null:(0,A.jsx)(`p`,{className:`mx-chat-failure__remedy`,children:t.remedy}),n===``?null:(0,A.jsx)(rm,{type:`button`,size:`sm`,variant:`outline`,className:`mx-chat-focusable`,onClick:()=>r(n),children:`Try again`})]})}function Ey(e){return(0,A.jsx)(xy,{part:e.part,defaultExpanded:e.defaultExpanded})}function Dy(e){let{part:t}=e;return(0,A.jsx)(`div`,{"data-mx-chat-block":t.kind,"data-status":t.status,children:e.renderContent({kind:t.kind,text:t.content??``,data:t.data,streaming:t.status===`streaming`,role:e.role,messageId:e.messageId})})}function Oy(e){let t=e.part.name??e.part.fileId;return(0,A.jsx)(`span`,{className:`mx-chat-standin`,"data-mx-chat-standin":`file`,children:`Attached file: ${t}. Previews appear once the attachments capability is turned on for this chat.`})}function ky(e){let{part:t}=e,n=t.title??t.url??t.sourceId;return(0,A.jsx)(`span`,{className:`mx-chat-standin`,"data-mx-chat-standin":`source`,children:`Source: ${n}`})}function Ay(e){return(0,A.jsx)(`span`,{className:`mx-chat-standin`,"data-mx-chat-standin":`ask-user`,children:e.part.answered?`You already answered: ${e.part.prompt}`:`The assistant is waiting for your answer: ${e.part.prompt}. This chat cannot collect it yet — answer in a chat with the approvals capability turned on, or stop this run.`})}var jy=(0,_.memo)(function(e){let t=Rr(e.messageId),n=zr(),{renderContent:r}=Br(),i=Vr(),{thread:a,retry:o}=Ir();if(t===void 0)return null;let s=t.status===`streaming`||t.status===`pending`,c=t.role;if(c===`user`)return(0,A.jsxs)(`article`,{className:`mx-chat-turn`,"data-role":`user`,...e.continued?{"data-continued":`true`}:{},"data-message-id":t.id,"aria-label":`Your message`,children:[(0,A.jsx)(`div`,{className:`mx-chat-turn__bubble`,children:r({kind:`markdown`,text:C(t),streaming:!1,role:c,messageId:t.id})}),Py(t,i.renderTurnMeta),n.messageActions?(0,A.jsx)(Hu,{message:t}):null]});let l=Wr(a.getSnapshot().messages,t.id);return(0,A.jsxs)(`article`,{className:`mx-chat-turn`,"data-role":c,...e.continued?{"data-continued":`true`}:{},"data-status":t.status,"data-message-id":t.id,"aria-label":`Assistant message`,"aria-busy":s||void 0,children:[(0,A.jsxs)(`div`,{className:`mx-chat-turn__body`,children:[t.parts.map((e,a)=>{let c=i.renderPart?.(e,{message:t,index:a,streaming:s});return c===void 0?(0,A.jsx)(`div`,{children:Fy(e,{message:t,streaming:s,renderContent:r,expandTools:n.expandToolCardsByDefault,showReasoning:n.showReasoningByDefault,retryText:l,onRetry:e=>o.request(e)})},Ny(e,a)):(0,A.jsx)(`div`,{children:c},Ny(e,a))}),s&&t.parts.length===0?(0,A.jsx)(`span`,{className:`mx-chat-caret`,"data-mx-chat":`waiting`,"aria-hidden":`true`}):null,My(t)?(0,A.jsx)(`p`,{className:`mx-chat-turn__stopped`,role:`note`,children:`Stopped`}):null]}),Py(t,i.renderTurnMeta),n.messageActions?(0,A.jsx)(Hu,{message:t}):null]})});function My(e){return e.status===`cancelled`&&!e.parts.some(e=>e.type===`error`&&e.errorType===`cancelled`)}function Ny(e,t){return e.type===`tool`?`tool:${e.toolCallId}`:e.type===`render-block`?`block:${e.blockId}`:`${e.type}:${t}`}function Py(e,t){let n=t?.(e);return n===void 0?e.metadata.modelRef===null?null:(0,A.jsx)(`div`,{className:`mx-chat-turn__meta`,children:e.metadata.modelRef}):n}function Fy(e,t){switch(e.type){case`text`:return(0,A.jsx)(Sy,{part:e,renderContent:t.renderContent,streaming:t.streaming,role:t.message.role,messageId:t.message.id});case`reasoning`:return(0,A.jsx)(Cy,{part:e,defaultOpen:t.showReasoning});case`tool`:return(0,A.jsx)(Ey,{part:e,defaultExpanded:t.expandTools});case`notice`:return(0,A.jsx)(wy,{part:e});case`error`:return(0,A.jsx)(Ty,{part:e,retryText:t.retryText,onRetry:t.onRetry});case`render-block`:return(0,A.jsx)(Dy,{part:e,renderContent:t.renderContent,messageId:t.message.id,role:t.message.role});case`file`:return(0,A.jsx)(Oy,{part:e});case`source`:return(0,A.jsx)(ky,{part:e});case`ask-user`:return(0,A.jsx)(Ay,{part:e});default:return e}}var Iy=80,Ly=40;function Ry(e){let t=e.virtualizeAbove??Iy,n=e.pageSize??Ly,r=e.label??`Conversation`,i=Lr(),a=zr(),o=Vr(),s=i.messages,[c,l]=(0,_.useState)(t),u=(0,_.useMemo)(()=>s.length<=c?s:s.slice(s.length-c),[s,c]),d=s.length-u.length,f=Iu(a.autoScroll),{onContentChange:p}=f,m=i.snapshot.revision;(0,_.useEffect)(()=>{p()},[m,p]);let h=Uy(s,i.conversationId);return(0,A.jsxs)(`div`,{className:zy(`mx-chat__viewport`,e.className),children:[i.ephemeral&&i.ephemeralReason!==null?(0,A.jsx)(`p`,{className:`mx-chat__ephemeral`,role:`note`,children:i.ephemeralReason}):null,(0,A.jsxs)(`div`,{className:`mx-chat__scroll`,ref:f.ref,role:`log`,"aria-live":`polite`,"aria-relevant":`additions`,"aria-label":r,"data-pinned":f.pinned,tabIndex:0,children:[o.transcriptHeader??null,s.length===0?By(o.empty):(0,A.jsxs)(`ol`,{className:`mx-chat__messages`,children:[d>0?(0,A.jsx)(`li`,{className:`mx-chat__earlier`,children:(0,A.jsx)(`button`,{type:`button`,className:`mx-chat-quiet-button mx-chat-focusable`,onClick:()=>l(e=>e+n),children:`Show earlier messages (${d} hidden)`})}):null,u.map((e,t)=>{let n=t>0&&u[t-1]?.role===e.role;return(0,A.jsx)(`li`,{...n?{"data-continued":`true`}:{},children:(0,A.jsx)(jy,{messageId:e.id,continued:n})},e.id)})]}),o.transcriptFooter??null]}),(0,A.jsx)(`p`,{className:`mx-chat__sr-only`,role:`status`,"aria-live":`polite`,children:h}),f.hasUnseenBelow?(0,A.jsx)(`div`,{className:`mx-chat__jump`,children:(0,A.jsx)(Pu,{icon:(0,A.jsx)(Kr,{}),ariaLabel:`Jump to the latest message`,tooltip:!1,onClick:f.jumpToLatest})}):null]})}function zy(e,t){return t===void 0||t===``?e:`${e} ${t}`}function By(e){return typeof e==`function`?e():e===void 0?(0,A.jsx)(Vy,{}):e}function Vy(e){return(0,A.jsxs)(`div`,{className:`mx-chat-empty`,children:[(0,A.jsx)(`span`,{className:`mx-chat-empty__title`,children:e.title??`Start the conversation`}),(0,A.jsx)(`span`,{children:e.body??`Ask a question, describe what you need, or paste something in.`})]})}var Hy=/[.!?。!?]["')\]]?\s/g;function Uy(e,t){let[n,r]=(0,_.useState)(``),i=(0,_.useRef)(0),a=e[e.length-1],o=a!==void 0&&a.role===`assistant`,s=o?Lu(C(a)):``,c=o&&a.status!==`streaming`&&a.status!==`pending`,l=a?.id??``,u=(0,_.useRef)(l);u.current!==l&&(u.current=l,i.current=0);let d=(0,_.useRef)(t);if(d.current!==t){let e=d.current!==null;d.current=t,e&&(u.current=l,i.current=s.length,n!==``&&r(``))}return(0,_.useEffect)(()=>{if(!o)return;Hy.lastIndex=0;let e=0,t=Hy.exec(s);for(;t!==null;)e=t.index+t[0].length,t=Hy.exec(s);let n=c?s.length:e;if(n<=i.current)return;let a=s.slice(i.current,n).trim();i.current=n,a!==``&&r(a)},[s,c,o]),n}function Wy(e){return(0,A.jsx)(`svg`,{width:`1em`,height:`1em`,viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.6`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,focusable:`false`,children:e})}function Gy(){return Wy((0,A.jsx)(`path`,{d:`M8 13V3.5M3.75 7.75 8 3.5l4.25 4.25`}))}function Ky(){return Wy((0,A.jsx)(`rect`,{x:`4.25`,y:`4.25`,width:`7.5`,height:`7.5`,rx:`1.5`,fill:`currentColor`,stroke:`none`}))}function qy(){return Wy((0,A.jsx)(`path`,{d:`M10.6 5.1 5.9 9.8a1.7 1.7 0 0 0 2.4 2.4l4.7-4.7a3.2 3.2 0 0 0-4.5-4.5L3.6 7.9a4.7 4.7 0 0 0 6.7 6.7`}))}function Jy(){return Wy((0,A.jsx)(`path`,{d:`M4.5 4.5l7 7M11.5 4.5l-7 7`}))}function Yy(e){return(0,A.jsx)(`ul`,{className:`mx-chat-attachments`,"aria-label":`Attachments on this message`,children:e.attachments.map(t=>(0,A.jsxs)(`li`,{className:`mx-chat-attachment`,"data-status":t.status,children:[(0,A.jsx)(`span`,{className:`mx-chat-attachment__name`,title:t.name,children:t.name}),(0,A.jsx)(`span`,{className:`mx-chat-attachment__meta`,children:t.status===`uploading`?t.progress===null?`Uploading…`:`Uploading ${Math.round(t.progress*100)}%`:t.status===`failed`?`Not attached`:Cr(t.sizeBytes)}),t.status===`uploading`?(0,A.jsx)(`span`,{className:`mx-chat-attachment__bar`,role:`progressbar`,"aria-label":`Uploading ${t.name}`,...t.progress===null?{}:{"aria-valuenow":Math.round(t.progress*100),"aria-valuemin":0,"aria-valuemax":100},"data-indeterminate":t.progress===null||void 0,children:(0,A.jsx)(`span`,{className:`mx-chat-attachment__fill`,style:t.progress===null?void 0:{width:`${Math.round(t.progress*100)}%`}})}):null,t.failure===null?null:(0,A.jsx)(`span`,{className:`mx-chat-attachment__failure`,children:t.failure}),t.status===`failed`&&t.retryable?(0,A.jsx)(`button`,{type:`button`,className:`mx-chat-attachment__retry mx-chat-focusable`,onClick:()=>e.onRetry(t.key),children:`Try again`}):null,(0,A.jsx)(`button`,{type:`button`,className:`mx-chat-attachment__remove mx-chat-focusable`,"aria-label":`Remove ${t.name}`,title:`Remove ${t.name}`,onClick:()=>e.onRemove(t.key),children:(0,A.jsx)(Jy,{})})]},t.key))})}function Xy(e){let t=Vr(),{quickset:n}=Br(),{thread:r}=Ir(),i=r.getSnapshot(),a=n===null||e.busy||e.drafting?[]:n.chips({conversationId:i.conversationId,busy:e.busy,empty:i.messages.length===0}),o=t.composerControls;return o===void 0&&a.length===0?null:(0,A.jsxs)(`div`,{className:`mx-chat-run-controls`,children:[o,a.length===0?null:(0,A.jsx)(`div`,{className:`mx-chat-quickset`,role:`group`,"aria-label":`Things you could ask`,children:a.map(t=>(0,A.jsx)(`button`,{type:`button`,className:`mx-chat-quickset__chip mx-chat-focusable`,"data-quickset":t.id,onClick:()=>e.onFill(t.text),children:t.label},t.id))})]})}var Zy=(0,_.createContext)(null);function Qy(){let e=(0,_.useContext)(Zy),t=Br();return(0,_.useMemo)(()=>e??{files:t.files,voice:t.voice},[e,t.files,t.voice])}function $y(e,t){if(e.isComposing)return`pass`;if(e.key===`Escape`)return e.isBusy?`stop`:`pass`;if(e.key!==`Enter`)return`pass`;let n=e.metaKey||e.ctrlKey;return(t===`enter`?!e.shiftKey&&!n:n)?`send`:`newline`}function eb(e,t,n){if(!Number.isFinite(t)||t<=0)return e;let r=Number.isFinite(n)&&n>0?n:0;return Math.max(1,Math.round((e-r)/t))*t+r}function tb(e){let t=(0,_.useRef)(null),n=(0,_.useCallback)(()=>{let n=t.current;if(n===null)return;let r=n.offsetHeight,i=n.scrollTop,a=getComputedStyle(n),o=Number.parseFloat(a.lineHeight),s=Number.parseFloat(a.paddingTop||`0`)+Number.parseFloat(a.paddingBottom||`0`)+Number.parseFloat(a.borderTopWidth||`0`)+Number.parseFloat(a.borderBottomWidth||`0`);n.style.transitionProperty=`none`,n.style.height=`0px`;let c=n.scrollHeight;n.style.height=`${r}px`,n.offsetHeight,n.style.transitionProperty=``,n.scrollTop=i;let l=eb(c,o,s),u=Math.max(e.minHeightPx,Math.min(l,e.maxHeightPx));u!==r&&(n.style.height=`${u}px`)},[e.maxHeightPx,e.minHeightPx]);(0,_.useLayoutEffect)(()=>{n()},[n,e.value]);let r=(0,_.useCallback)(n=>{t.current=n;let r=e.inputRef;typeof r==`function`?r(n):r!=null&&(r.current=n)},[e.inputRef]),i={maxHeight:e.maxHeightPx};return(0,A.jsx)(`textarea`,{ref:r,className:`mx-chat-composer__field`,value:e.value,rows:1,style:i,placeholder:e.placeholder,"aria-label":e.label,...e.describedBy===void 0?{}:{"aria-describedby":e.describedBy},disabled:e.disabled,autoFocus:e.autoFocus===!0,onChange:t=>e.onValueChange(t.target.value),onKeyDown:e.onKeyDown,...e.onPaste===void 0?{}:{onPaste:e.onPaste}})}function nb(e){let{files:t,maxBytes:n,notifier:r}=e,[i,a]=(0,_.useState)([]),o=(0,_.useRef)(new Map),s=(0,_.useRef)(new Map),c=(0,_.useRef)(!0);(0,_.useEffect)(()=>(c.current=!0,()=>{c.current=!1;for(let e of o.current.values())e.controller.abort();o.current.clear()}),[]);let l=(0,_.useCallback)((e,t)=>{c.current&&a(n=>n.map(n=>n.key===e?{...n,...t}:n))},[]),u=(0,_.useCallback)((e,n)=>{let r=new AbortController;o.current.set(e,{file:n,controller:r}),s.current.set(e,n),l(e,{status:`uploading`,progress:null,failure:null}),t.upload(n,{signal:r.signal,onProgress:t=>{r.signal.aborted||l(e,{progress:Math.max(0,Math.min(1,t))})}}).then(t=>{o.current.delete(e),!r.signal.aborted&&l(e,{status:`ready`,progress:1,fileId:t.fileId,previewUrl:t.previewUrl??null,mediaType:t.mediaType,failure:null})}).catch(t=>{o.current.delete(e),!r.signal.aborted&&l(e,{status:`failed`,progress:null,failure:t instanceof Error&&t.message!==``?t.message:`This file could not be uploaded.`,retryable:!0})})},[t,l]),d=(0,_.useCallback)(e=>{if(e.length===0)return;let t=[],i=[];for(let a of e){let e=x(`att`);if(a.size>n){let i=jr(a.name,n);t.push({key:e,name:a.name,sizeBytes:a.size,mediaType:a.type===``?null:a.type,status:`failed`,progress:null,fileId:null,previewUrl:null,failure:i,retryable:!1}),r.notify({level:`warning`,message:i,remedy:`Attach a smaller file, or ask an administrator to raise the limit for this workspace.`});continue}t.push({key:e,name:a.name,sizeBytes:a.size,mediaType:a.type===``?null:a.type,status:`uploading`,progress:null,fileId:null,previewUrl:null,failure:null,retryable:!0}),i.push({key:e,file:a})}a(e=>[...e,...t]);for(let e of i)u(e.key,e.file)},[n,r,u]),f=(0,_.useCallback)(e=>{let t=o.current.get(e);t!==void 0&&(t.controller.abort(),o.current.delete(e)),s.current.delete(e),a(t=>t.filter(t=>t.key!==e))},[]),p=(0,_.useCallback)(e=>{let t=s.current.get(e);t!==void 0&&u(e,t)},[u]),m=(0,_.useCallback)(()=>{for(let e of o.current.values())e.controller.abort();o.current.clear(),s.current.clear(),a([])},[]);return{attachments:i,readyFileIds:i.filter(e=>e.status===`ready`&&e.fileId!==null).map(e=>e.fileId),uploading:i.some(e=>e.status===`uploading`),add:d,remove:f,retry:p,clear:m}}var rb=24,ib=208;function ab(e){let t=e.dataTransfer?.types;return t!==void 0&&Array.from(t).includes(`Files`)}function ob(e){let t=Ur(),n=zr(),{notifier:r}=Br(),i=Vr(),{files:a,voice:o}=Qy(),{thread:s}=Ir(),c=(0,_.useRef)(null),l=(0,_.useId)(),[u,d]=(0,_.useState)(!1),[f,p]=(0,_.useState)(!1),[m,h]=(0,_.useState)(!1),g=(0,_.useRef)(0),v=(0,_.useRef)(async()=>void 0),y=nb({files:a,maxBytes:n.attachmentMaxBytes,notifier:r}),b=(0,_.useRef)(null);(0,_.useEffect)(()=>{let n=e.draftSeed;n!=null&&n!==``&&b.current!==n&&(b.current=n,t.text.trim()===``&&t.setText(n))},[e.draftSeed]);let x=(0,_.useCallback)(e=>{if(e.length!==0){if(!a.available){a.upload(e[0],{signal:new AbortController().signal,onProgress:()=>void 0}).catch(()=>void 0),h(!0);return}y.add(e)}},[y,a]),S=(0,_.useCallback)(e=>{let t=e.clipboardData?.files;t!==void 0&&t.length!==0&&(e.preventDefault(),x(Array.from(t)))},[x]),w=(0,_.useCallback)(e=>{ab(e)&&(e.preventDefault(),g.current=0,p(!1),x(Array.from(e.dataTransfer.files)))},[x]),T=(0,_.useCallback)(e=>{let r=e.nativeEvent.isComposing;if(!r&&e.key===`ArrowUp`&&t.text===``&&!e.shiftKey&&!e.metaKey&&!e.ctrlKey){let n=s.getSnapshot().messages;for(let r=n.length-1;r>=0;--r){let i=n[r];if(i===void 0||i.role!==`user`)continue;let a=C(i);if(a===``)break;e.preventDefault(),t.setText(a);return}return}let i=$y({key:e.key,shiftKey:e.shiftKey,metaKey:e.metaKey,ctrlKey:e.ctrlKey,isComposing:r,isBusy:t.isBusy},n.sendKey);if(i===`send`){e.preventDefault(),v.current();return}i===`stop`&&(e.preventDefault(),t.stop())},[t,n.sendKey,s]),E=e.held??null,D=E===null?u?`Finish recording to send your message.`:y.uploading?`Your files are still uploading.`:null:E.reason,O=t.canSend&&D===null,k=(0,_.useCallback)(async()=>{if(!O)return;let e=t.text.trim(),n=y.readyFileIds;n.length===0?await t.send():(t.setText(``),(await s.send({text:e,fileIds:n})).accepted?y.clear():t.setText(e)),c.current?.focus()},[y,O,t,s]);v.current=k;let ee=(0,_.useCallback)(e=>{e.preventDefault(),k()},[k]),j=t.isBusy?`Stop the answer`:D===null?`Send message`:D,M=t.isBusy&&n.sendWhileBusy&&t.text.trim()!==``,te=D===null?`Queue message — it sends when this answer finishes`:D,ne={value:t.text,onValueChange:t.setText,busy:t.isBusy,onBusyChange:d,className:`mx-chat-composer__icon-button mx-chat-focusable`};return(0,A.jsxs)(`form`,{className:`mx-chat-composer${e.className===void 0?``:` ${e.className}`}`,"data-dragging":f||void 0,"data-busy":t.isBusy||void 0,onSubmit:ee,onDragEnter:e=>{ab(e)&&(g.current+=1,p(!0))},onDragOver:e=>{ab(e)&&e.preventDefault()},onDragLeave:e=>{ab(e)&&(g.current=Math.max(0,g.current-1),g.current===0&&p(!1))},onDrop:w,children:[i.composerAbove,(0,A.jsx)(Xy,{onFill:t.setText,busy:t.isBusy,drafting:t.text.trim()!==``}),(0,A.jsxs)(`div`,{className:`mx-chat-composer__shell`,children:[y.attachments.length>0?(0,A.jsx)(Yy,{attachments:y.attachments,onRemove:y.remove,onRetry:y.retry}):null,(0,A.jsx)(tb,{value:t.text,onValueChange:t.setText,onKeyDown:T,onPaste:S,placeholder:e.placeholder??`Send a message`,minHeightPx:rb,maxHeightPx:ib,disabled:E!==null,label:`Message`,describedBy:l,inputRef:c,...e.autoFocus===void 0?{}:{autoFocus:e.autoFocus}}),(0,A.jsxs)(`div`,{className:`mx-chat-composer__row`,children:[(0,A.jsxs)(`div`,{className:`mx-chat-composer__left`,children:[a.available?(0,A.jsxs)(`label`,{className:`mx-chat-composer__icon-button mx-chat-focusable`,children:[(0,A.jsx)(qy,{}),(0,A.jsx)(`span`,{className:`mx-chat__sr-only`,children:`Attach files`}),(0,A.jsx)(`input`,{type:`file`,multiple:!0,"aria-label":`Attach files`,...a.accept===void 0?{}:{accept:a.accept},onChange:e=>{let t=e.target.files;t!==null&&x(Array.from(t)),e.target.value=``}})]}):null,o===null?null:o.renderButton(ne),i.composerPickers,i.composerToolbar]}),(0,A.jsxs)(`div`,{className:`mx-chat-composer__right`,children:[i.composerRunControls,M?(0,A.jsx)(`button`,{type:`submit`,className:`mx-chat-composer__send mx-chat-focusable`,"data-mode":`queue`,"aria-label":te,title:te,disabled:!O,children:(0,A.jsx)(Gy,{})}):null,t.isBusy?(0,A.jsx)(`button`,{type:`button`,className:`mx-chat-composer__send mx-chat-focusable`,"data-mode":`stop`,"aria-label":j,title:j,onClick:()=>void t.stop(),children:(0,A.jsx)(Ky,{})}):(0,A.jsx)(`button`,{type:`submit`,className:`mx-chat-composer__send mx-chat-focusable`,"data-mode":`send`,"aria-label":j,title:j,disabled:!O,children:(0,A.jsx)(Gy,{})})]})]})]}),(0,A.jsxs)(`div`,{className:`mx-chat-composer__notice`,id:l,role:`status`,"aria-live":`polite`,children:[E===null?m?(0,A.jsx)(`span`,{className:`mx-chat-standin`,children:`${Or} ${kr}`}):D!==null&&t.text.trim()!==``?(0,A.jsx)(`span`,{className:`mx-chat-standin`,children:D}):t.restoredFromFailure?(0,A.jsx)(`span`,{className:`mx-chat-standin`,children:`Your message is back in the box. Send it again when you are ready.`}):null:(0,A.jsx)(`span`,{className:`mx-chat-standin`,children:E.reason}),o?.renderRecovery?.(ne)??null]}),i.composerBelow,f?(0,A.jsx)(`div`,{className:`mx-chat-composer__drop`,"aria-live":`polite`,children:a.available?`Drop files to attach them to your message`:Or}):null]})}function sb(e){let t=T(e.features),n=new Set,r=new Map,i=0,a=new Map,o=c(e.getSnapshot());a=s(o.messages);function s(e){let t=new Map;for(let n of e)t.set(n.id,n);return t}function c(e){let t=e.ephemeral===!0;return{conversationId:e.conversationId,messages:e.messages,status:e.status,requestId:e.requestId??null,phase:e.phase??null,ephemeral:t,ephemeralReason:t?e.ephemeralReason??`This conversation is not being saved by the application hosting it.`:null,revision:i,error:e.error??null}}let l=e.subscribe(()=>{i+=1,o=c(e.getSnapshot());let t=s(o.messages);for(let[e,n]of r)if(a.get(e)!==t.get(e))for(let e of n)e();a=t;for(let e of n)e()});return{getSnapshot:()=>o,subscribe(e){return n.add(e),()=>{n.delete(e)}},subscribeToMessage(e,t){let n=r.get(e)??new Set;return n.add(t),r.set(e,n),()=>{n.delete(t),n.size===0&&r.delete(e)}},getMessageSnapshot:e=>o.messages.find(t=>t.id===e),features:t,async send(t){return await e.onSubmit(t),{accepted:!0,refusal:null}},async cancel(){await e.onCancel?.()},setMessages(t){if(!e.onSetMessages)throw Error(`This chat thread's state is owned by the host application, which did not provide onSetMessages. Replace the transcript through the host's own store, or provide onSetMessages.`);e.onSetMessages(t)},async loadConversation(t){if(!e.onLoadConversation)throw Error(`This chat thread's state is owned by the host application, which did not provide onLoadConversation. Open the conversation through the host's own routing, or provide onLoadConversation.`);await e.onLoadConversation(t)},canStartNewConversation:e.onStartNewConversation!==void 0,settleToolCall(t){return e.onSettleToolCall?e.onSettleToolCall(t):{messages:o.messages,messageId:null,applied:!1,refusal:`This chat thread's state is owned by the host application, which did not provide onSettleToolCall. Mark the tool call done in the host's own store when it answers, or provide onSettleToolCall.`}},async startNewConversation(){if(!e.onStartNewConversation)throw Error(`This chat thread's state is owned by the host application, which did not provide onStartNewConversation. Start a new conversation through the host's own store, or provide onStartNewConversation.`);await e.onStartNewConversation()},dispose(){l?.(),l=null,n.clear(),r.clear()}}}var cb={claude:`Claude Code`,codex:`Codex`};function lb(e,t,n){return t?`${e}:${t}`:`session:${n??``}`}var ub=[`completed`,`stopped`,`failed`];function db(e){return ub.includes(e)}function fb(e){if(!e)return null;let t=Date.parse(e);return Number.isNaN(t)?e:new Date(t).toLocaleString(void 0,{month:`short`,day:`numeric`,hour:`numeric`,minute:`2-digit`})}var pb={Bash:`Run command`,Shell:`Run command`,BashOutput:`Read command output`,KillShell:`Stop command`,Read:`Read file`,Write:`Write file`,Edit:`Edit file`,MultiEdit:`Edit file`,NotebookEdit:`Edit notebook`,Glob:`Find files`,Grep:`Search code`,LS:`List folder`,WebFetch:`Fetch page`,WebSearch:`Web search`,"Web search":`Web search`,Task:`Sub-agent`,Agent:`Sub-agent`,TodoWrite:`Update plan`,Plan:`Update plan`,"Edit files":`Edit files`,ExitPlanMode:`Finish planning`,Skill:`Use skill`,ToolSearch:`Load tools`};function mb(e){let t=e.replace(/[._-]+/g,` `).replace(/([a-z\d])([A-Z])/g,`$1 $2`).replace(/\s+/g,` `).trim().toLowerCase();return t?t.charAt(0).toUpperCase()+t.slice(1):``}function hb(e){let t=/^mcp__(.+?)__(.+)$/.exec(e);return t?.[1]&&t[2]?{server:t[1],tool:t[2]}:null}function gb(e){let t=pb[e];if(t)return t;let n=hb(e);if(n)return`${mb(n.tool)||`Tool`} · ${mb(n.server)}`;let r=/^([\w-]+)\.([\w-]+)$/.exec(e);return r?.[1]&&r[2]?`${mb(r[2])} · ${mb(r[1])}`:mb(e)||`Working…`}function _b(e){let t=e.match(/^\/(?:Users|home)\/[^/]+/)?.[0];return t?`~${e.slice(t.length)}`:e}function vb(e,t=90){let n=e.replace(/\s+/g,` `).trim();return n.length>t?`${n.slice(0,t-1)}…`:n}function yb(e,t){if(typeof t!=`object`||!t)return typeof t==`string`&&t?vb(t):null;let n=t,r=(...e)=>{for(let t of e){let e=n[t];if(typeof e==`string`&&e.trim())return e}return null};switch(e){case`Bash`:case`Shell`:{let e=r(`command`,`description`);return e?vb(e):null}case`Read`:case`Write`:case`Edit`:case`MultiEdit`:case`NotebookEdit`:{let e=r(`file_path`,`notebook_path`,`path`);return e?vb(_b(e)):null}case`Glob`:case`Grep`:return r(`pattern`)?vb(r(`pattern`)):null;case`WebFetch`:return r(`url`)?vb(r(`url`)):null;case`WebSearch`:case`Web search`:return r(`query`)?vb(r(`query`)):null;case`Task`:case`Agent`:return r(`description`,`prompt`)?vb(r(`description`,`prompt`)):null;case`Edit files`:{let e=n.changes,t=Array.isArray(e)?e.map(e=>typeof e==`object`&&e?e.path:null).filter(e=>typeof e==`string`):typeof e==`object`&&e?Object.keys(e):[];return t.length?vb(t.map(_b).join(`, `)):null}default:{let e=r(`url`,`query`,`command`,`path`,`file_path`,`name`,`description`);return e?vb(e):null}}}function bb(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function xb(e){return typeof e==`string`?e:null}function Sb(e){let t=bb(e)?xb(e.type):xb(e);return t===`add`||t===`create`?`created`:t===`delete`?`deleted`:t===`move`||t===`rename`?`moved`:`edited`}function Cb(e){let t=new Map,n=(e,n,r)=>{let i=t.get(e);i?(i.edits.push(r),n===`deleted`&&(i.kind=`deleted`)):t.set(e,{path:e,kind:n,edits:[r]})};for(let t of e)for(let e of t.parts){if(e.type!==`tool`)continue;let t=e.input;if(!bb(t))continue;let r=e.state===`output-error`||!!e.errorText,i={toolCallId:e.toolCallId,failed:r};switch(e.toolName){case`Write`:{let e=xb(t.file_path);e&&n(e,`created`,{...i,removed:null,added:xb(t.content),diff:null});break}case`Edit`:{let e=xb(t.file_path);e&&n(e,`edited`,{...i,removed:xb(t.old_string),added:xb(t.new_string),diff:null});break}case`MultiEdit`:{let e=xb(t.file_path),r=Array.isArray(t.edits)?t.edits:[];if(e)for(let t of r.filter(bb))n(e,`edited`,{...i,removed:xb(t.old_string),added:xb(t.new_string),diff:null});break}case`NotebookEdit`:{let e=xb(t.notebook_path);e&&n(e,`edited`,{...i,removed:null,added:xb(t.new_source),diff:null});break}case`Edit files`:{let e=t.changes;if(Array.isArray(e))for(let t of e.filter(bb)){let e=xb(t.path);e&&n(e,Sb(t.kind),{...i,removed:null,added:null,diff:null})}else if(bb(e))for(let[t,r]of Object.entries(e)){let e=bb(r)?xb(r.unified_diff):null;n(t,Sb(r),{...i,removed:null,added:null,diff:e})}break}}}return[...t.values()]}function wb(e){let t=0,n=0,r=e=>e?e.split(`
65
- `).length:0;for(let i of e.edits)if(!i.failed){if(i.diff)for(let e of i.diff.split(`
66
- `))e.startsWith(`+`)&&!e.startsWith(`+++`)?t+=1:e.startsWith(`-`)&&!e.startsWith(`---`)&&(n+=1);else t+=r(i.added),n+=r(i.removed)}return{added:t,removed:n}}function Tb(e,t){let n=lb(e.provider,e.providerSessionId,e.id),r=t[n]??t[lb(e.provider,null,e.id)]??{};return{key:n,kind:`session`,provider:e.provider,providerSessionId:e.providerSessionId,title:r.title||e.title,originalTitle:e.title,cwd:e.cwd,updatedAt:e.updatedAt,pinned:r.pinned===!0,hidden:r.hidden===!0,session:e,discovered:null}}function Eb(e,t){let n=lb(e.provider,e.providerSessionId),r=t[n]??{};return{key:n,kind:`discovered`,provider:e.provider,providerSessionId:e.providerSessionId,title:r.title||e.title,originalTitle:e.title,cwd:e.cwd,updatedAt:e.updatedAt,pinned:r.pinned===!0,hidden:r.hidden===!0,session:null,discovered:e}}var Db=864e5;function Ob(e){let t=new Date(e);return t.setHours(0,0,0,0),t.getTime()}function kb(e,t){let n=Date.parse(e);if(Number.isNaN(n))return`Older`;let r=Ob(t);if(n>=r)return`Today`;if(n>=r-Db)return`Yesterday`;if(n>=r-7*Db)return`Previous 7 days`;if(n>=r-30*Db)return`Previous 30 days`;let i=new Date(n),a=new Date(t).getFullYear();return i.getFullYear()===a?i.toLocaleDateString(void 0,{month:`long`}):String(i.getFullYear())}function Ab(e){if(!e)return`Unknown folder`;let t=e.split(`/`).filter(Boolean);return t[t.length-1]??e}function jb(e,t,n){let r=new Map;for(let i of e){let e=t===`date`?kb(i.updatedAt,n):i.cwd??``,a=r.get(e);a||(a={label:t===`date`?e:Ab(i.cwd),entries:[]},r.set(e,a)),a.entries.push(i)}if(t===`folder`){let e=new Map;for(let t of r.values())e.set(t.label,(e.get(t.label)??0)+1);for(let[t,n]of r)(e.get(n.label)??0)>1&&t&&(n.label=t.split(`/`).filter(Boolean).slice(-2).join(`/`))}return[...r.values()]}function Mb(e,t){let n=t.trim().toLowerCase();return!n||e.title.toLowerCase().includes(n)||e.originalTitle.toLowerCase().includes(n)||(e.cwd??``).toLowerCase().includes(n)}function Nb(e,t){return t.updatedAt.localeCompare(e.updatedAt)}function Pb(e){if(!e.providerSessionId)return null;let t=e.provider===`claude`?`claude --resume ${e.providerSessionId}`:`codex resume ${e.providerSessionId}`;return e.cwd?`cd ${/^[A-Za-z0-9_./~-]+$/.test(e.cwd)?e.cwd:`'${e.cwd.replace(/'/g,`'\\''`)}'`} && ${t}`:t}var Fb=(0,_.createContext)(null);function Ib(){let e=(0,_.useContext)(Fb);if(!e)throw Error(`[@ai-matrx/coding-sessions] Render this inside <CodingSessionsProvider transport={…}> (or <CodingSessionsApp>).`);return e}function Lb(){let e=Ib();return(0,_.useSyncExternalStore)(e.subscribe,e.getState,e.getState)}function Rb(e){let t=Ib().transcript(e),[,n]=(0,_.useState)(0);return(0,_.useEffect)(()=>t.thread.subscribe(()=>n(e=>e+1)),[t]),t}function zb(){let[e,t]=(0,_.useState)(()=>Date.now());return(0,_.useEffect)(()=>{let e=setInterval(()=>t(Date.now()),6e4);return()=>clearInterval(e)},[]),e}function Bb(e,t){return e?xr(e,{style:`long`,now:t,fallback:``}):``}function Vb(e){if(!e)return``;let t=e.match(/^\/(?:Users|home)\/[^/]+/)?.[0],n=t?`~${e.slice(t.length)}`:e;return n.length<=48?n:`…/${n.split(`/`).slice(-3).join(`/`)}`}function Hb({size:e=16,children:t,...n}){return(0,A.jsx)(`svg`,{width:e,height:e,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:1.8,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,focusable:`false`,...n,children:t})}var Ub=e=>(0,A.jsx)(Hb,{...e,children:(0,A.jsx)(`path`,{d:`M12 5v14M5 12h14`})}),Wb=e=>(0,A.jsx)(Hb,{...e,children:(0,A.jsx)(`rect`,{x:`6`,y:`6`,width:`12`,height:`12`,rx:`2`,fill:`currentColor`,stroke:`none`})}),Gb=e=>(0,A.jsx)(Hb,{...e,children:(0,A.jsx)(`path`,{d:`M3 7.5A2.5 2.5 0 0 1 5.5 5H9l2 2.5h7.5A2.5 2.5 0 0 1 21 10v7.5a2.5 2.5 0 0 1-2.5 2.5h-13A2.5 2.5 0 0 1 3 17.5z`})}),Kb=e=>(0,A.jsx)(Hb,{...e,children:(0,A.jsx)(`path`,{d:`m5 12.5 4.5 4.5L19 7.5`})}),qb=e=>(0,A.jsxs)(Hb,{...e,children:[(0,A.jsx)(`circle`,{cx:`12`,cy:`12`,r:`9`}),(0,A.jsx)(`path`,{d:`M12 7.5v5.5M12 16.5h.01`})]}),Jb=e=>(0,A.jsx)(Hb,{...e,children:(0,A.jsx)(`path`,{d:`M20 11a8 8 0 0 0-14.3-4.9L4 8M4 4v4h4M4 13a8 8 0 0 0 14.3 4.9L20 16M20 20v-4h-4`})}),Yb=e=>(0,A.jsxs)(Hb,{...e,children:[(0,A.jsx)(`path`,{d:`M5 12h12M13 7l5 5-5 5`}),(0,A.jsx)(`path`,{d:`M5 5v14`})]}),Xb=e=>(0,A.jsxs)(Hb,{...e,children:[(0,A.jsx)(`circle`,{cx:`12`,cy:`12`,r:`4`}),(0,A.jsx)(`path`,{d:`M12 2.5v2M12 19.5v2M4.2 4.2l1.4 1.4M18.4 18.4l1.4 1.4M2.5 12h2M19.5 12h2M4.2 19.8l1.4-1.4M18.4 5.6l1.4-1.4`})]}),Zb=e=>(0,A.jsx)(Hb,{...e,children:(0,A.jsx)(`path`,{d:`M20 14.5A8 8 0 0 1 9.5 4a8 8 0 1 0 10.5 10.5z`})}),Qb=e=>(0,A.jsxs)(Hb,{...e,children:[(0,A.jsx)(`rect`,{x:`3`,y:`4.5`,width:`18`,height:`12`,rx:`2`}),(0,A.jsx)(`path`,{d:`M8.5 20h7M12 16.5V20`})]}),$b=e=>(0,A.jsx)(Hb,{...e,children:(0,A.jsx)(`path`,{d:`M20 12.5a7.5 7.5 0 0 1-10.9 6.7L4 20.5l1.3-4.6A7.5 7.5 0 1 1 20 12.5z`})}),ex=({size:e=16,className:t})=>(0,A.jsxs)(`svg`,{width:e,height:e,viewBox:`0 0 24 24`,"aria-hidden":`true`,className:`cs-spin ${t??``}`,children:[(0,A.jsx)(`circle`,{cx:`12`,cy:`12`,r:`9`,fill:`none`,stroke:`currentColor`,strokeOpacity:`0.2`,strokeWidth:`2.5`}),(0,A.jsx)(`path`,{d:`M21 12a9 9 0 0 0-9-9`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,strokeLinecap:`round`})]});function tx({provider:e,size:t=18}){return(0,A.jsx)(`span`,{className:`cs-provider-mark cs-provider-mark--${e}`,style:{width:t,height:t,fontSize:Math.round(t*.58)},"aria-hidden":`true`,children:e===`claude`?`C`:`X`})}var nx=e=>(0,A.jsxs)(Hb,{...e,children:[(0,A.jsx)(`circle`,{cx:`11`,cy:`11`,r:`6.5`}),(0,A.jsx)(`path`,{d:`m20 20-4.2-4.2`})]}),rx=e=>(0,A.jsxs)(Hb,{...e,children:[(0,A.jsx)(`circle`,{cx:`5.5`,cy:`12`,r:`1.2`,fill:`currentColor`,stroke:`none`}),(0,A.jsx)(`circle`,{cx:`12`,cy:`12`,r:`1.2`,fill:`currentColor`,stroke:`none`}),(0,A.jsx)(`circle`,{cx:`18.5`,cy:`12`,r:`1.2`,fill:`currentColor`,stroke:`none`})]}),ix=e=>(0,A.jsxs)(Hb,{...e,children:[(0,A.jsx)(`path`,{d:`M9 4h6l-1 5 3 3v2H7v-2l3-3z`}),(0,A.jsx)(`path`,{d:`M12 14v6`})]}),ax=e=>(0,A.jsxs)(Hb,{...e,children:[(0,A.jsx)(`path`,{d:`M3 3l18 18`}),(0,A.jsx)(`path`,{d:`M10.6 5.1A9.8 9.8 0 0 1 12 5c5 0 8.5 4.5 9.5 7a13 13 0 0 1-2.6 3.9M6.4 6.4C4.3 7.8 2.9 9.9 2.5 12c1 2.5 4.5 7 9.5 7 1.8 0 3.4-.6 4.8-1.4`}),(0,A.jsx)(`path`,{d:`M9.9 9.9a3 3 0 0 0 4.2 4.2`})]}),ox=e=>(0,A.jsxs)(Hb,{...e,children:[(0,A.jsx)(`rect`,{x:`8.5`,y:`8.5`,width:`11`,height:`11`,rx:`2`}),(0,A.jsx)(`path`,{d:`M15.5 8.5V6.5a2 2 0 0 0-2-2h-7a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h2`})]}),sx=e=>(0,A.jsxs)(Hb,{...e,children:[(0,A.jsx)(`path`,{d:`M4 20h4L19 9a2.8 2.8 0 0 0-4-4L4 16z`}),(0,A.jsx)(`path`,{d:`m13.5 6.5 4 4`})]}),cx=e=>(0,A.jsxs)(Hb,{...e,children:[(0,A.jsx)(`rect`,{x:`3.5`,y:`4.5`,width:`17`,height:`15`,rx:`2.5`}),(0,A.jsx)(`path`,{d:`M9.5 4.5v15`})]}),lx=e=>(0,A.jsx)(Hb,{...e,children:(0,A.jsx)(`path`,{d:`m6.5 9.5 5.5 5.5 5.5-5.5`})}),ux=e=>(0,A.jsxs)(Hb,{...e,children:[(0,A.jsx)(`path`,{d:`M14 3.5H7.5a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2h9a2 2 0 0 0 2-2V8z`}),(0,A.jsx)(`path`,{d:`M14 3.5V8h4.5`})]}),dx=e=>(0,A.jsx)(Hb,{...e,children:(0,A.jsx)(`path`,{d:`M6.5 6.5l11 11M17.5 6.5l-11 11`})}),fx=e=>(0,A.jsxs)(Hb,{...e,children:[(0,A.jsx)(`rect`,{x:`3`,y:`6.5`,width:`18`,height:`11`,rx:`2`}),(0,A.jsx)(`path`,{d:`M7 10.5h.01M11 10.5h.01M15 10.5h.01M8 14h8`})]}),px=e=>(0,A.jsxs)(Hb,{...e,children:[(0,A.jsx)(`path`,{d:`M6 16.5V11a6 6 0 1 1 12 0v5.5l1.5 1.5h-15z`}),(0,A.jsx)(`path`,{d:`M10 20.5a2 2 0 0 0 4 0`})]}),mx=(0,_.createContext)(()=>void 0);function hx(){return(0,_.useContext)(mx)}var gx=[{target:`finder`,label:`Finder`},{target:`vscode`,label:`VS Code`},{target:`cursor`,label:`Cursor`},{target:`terminal`,label:`Terminal`}];async function _x(e,t,n){try{await navigator.clipboard.writeText(e),t(`${n} copied.`)}catch{t(`This browser didn't allow copying. Select the text and copy it with your keyboard instead: ${e}`)}}async function vx(e,t,n){try{let r=await e.readRawTranscript(t.provider,t.providerSessionId);if(!r.available){n(r.reason);return}let i=URL.createObjectURL(new Blob([r.content],{type:`application/x-ndjson`})),a=document.createElement(`a`);a.href=i,a.download=r.fileName,a.click(),setTimeout(()=>URL.revokeObjectURL(i),1e4),n(`Downloaded ${r.fileName} (${Cr(r.bytes)}).`)}catch(e){n(`Full Download failed: ${e instanceof Error?e.message:String(e)}`)}}function yx(e){let t=Ib(),n=hx(),{entry:r}=e,i=e.variant===`dropdown`?{Item:Qv,Separator:ny,Sub:Wv,SubTrigger:Yv,SubContent:Xv}:{Item:n_,Separator:o_,Sub:Yg,SubTrigger:$g,SubContent:e_},a=(e,i)=>{t.setPreference(r.key,e).then(()=>n(i),e=>n(`That didn't save: ${e instanceof Error?e.message:String(e)}`))},o=Pb(r);return(0,A.jsxs)(A.Fragment,{children:[(0,A.jsxs)(i.Item,{onSelect:e.onRename,children:[(0,A.jsx)(sx,{size:14}),`Rename`]}),(0,A.jsxs)(i.Item,{onSelect:()=>a({pinned:!r.pinned},r.pinned?`Unpinned.`:`Pinned to the top.`),children:[(0,A.jsx)(ix,{size:14}),r.pinned?`Unpin`:`Pin to top`]}),(0,A.jsxs)(i.Item,{onSelect:()=>a({hidden:!r.hidden},r.hidden?`Back in the list.`:`Hidden from the list. Search still finds it.`),children:[(0,A.jsx)(ax,{size:14}),r.hidden?`Show in the list`:`Hide from the list`]}),r.providerSessionId||r.cwd?(0,A.jsx)(i.Separator,{}):null,r.providerSessionId?(0,A.jsxs)(i.Item,{onSelect:()=>void _x(r.providerSessionId,n,`Chat ID`),children:[(0,A.jsx)(ox,{size:14}),`Copy chat ID`]}):null,o?(0,A.jsxs)(i.Item,{onSelect:()=>void _x(o,n,`Resume command`),children:[(0,A.jsx)(ox,{size:14}),`Copy resume command`]}):null,r.providerSessionId?(0,A.jsxs)(i.Item,{onSelect:()=>void vx(t,r,n),children:[(0,A.jsx)(ox,{size:14}),`Full Download`]}):null,r.cwd?(0,A.jsxs)(i.Item,{onSelect:()=>void _x(r.cwd,n,`Folder path`),children:[(0,A.jsx)(ox,{size:14}),`Copy folder path`]}):null,r.cwd?(0,A.jsxs)(i.Sub,{children:[(0,A.jsxs)(i.SubTrigger,{className:`gap-2`,children:[(0,A.jsx)(Gb,{size:14}),`Open folder in`]}),(0,A.jsx)(i.SubContent,{children:gx.map(({target:e,label:a})=>(0,A.jsx)(i.Item,{onSelect:()=>t.openFolder(r.cwd,e).catch(e=>n(e instanceof Error?e.message:String(e))),children:a},e))})]}):null]})}var bx=400;function xx(e,t){if(t){let n=t.replace(/\/+$/,``);for(let t of[n,`/private${n}`,n.replace(/^\/private(?=\/)/,``)])if(e.startsWith(`${t}/`))return e.slice(t.length+1)}return Vb(e)}function Sx({edit:e}){let t=[];if(e.diff)for(let n of e.diff.split(`
67
- `))n.startsWith(`@@`)?t.push({kind:`hunk`,text:n}):n.startsWith(`+`)?t.push({kind:`add`,text:n}):n.startsWith(`-`)?t.push({kind:`del`,text:n}):n!==``&&t.push({kind:`ctx`,text:n});else{if(e.removed)for(let n of e.removed.split(`
68
- `))t.push({kind:`del`,text:`-${n}`});if(e.added)for(let n of e.added.split(`
69
- `))t.push({kind:`add`,text:`+${n}`})}if(t.length===0)return(0,A.jsx)(`p`,{className:`text-[12px] text-muted-foreground`,children:e.failed?`This change failed.`:`The agent didn't record the text of this change.`});let n=t.slice(0,bx);return(0,A.jsxs)(A.Fragment,{children:[e.failed?(0,A.jsx)(`p`,{className:`mb-1 text-[11.5px] text-destructive`,children:`This change failed and was not applied.`}):null,(0,A.jsx)(`pre`,{className:K(`cs-diff`,e.failed&&`opacity-60`),children:n.map((e,t)=>(0,A.jsx)(`span`,{className:K(`cs-diff__line`,e.kind!==`ctx`&&`cs-diff__line--${e.kind}`),children:e.text||` `},t))}),t.length>bx?(0,A.jsxs)(`p`,{className:`mt-1 text-[11.5px] text-muted-foreground`,children:[`Showing the first `,bx,` of `,t.length,` lines.`]}):null]})}function Cx({file:e,cwd:t}){let[n,r]=(0,_.useState)(!1),i=hx(),a=wb(e),o=xx(e.path,t),s={created:`New`,edited:`Edited`,deleted:`Deleted`,moved:`Moved`}[e.kind];return(0,A.jsxs)(`li`,{className:`border-b border-border`,children:[(0,A.jsxs)(`div`,{className:`flex items-center gap-2 px-4 py-2`,children:[(0,A.jsxs)(`button`,{type:`button`,onClick:()=>r(e=>!e),"aria-expanded":n,className:`flex min-w-0 flex-1 items-center gap-2 text-left`,children:[(0,A.jsx)(lx,{size:13,className:K(`shrink-0 transition-transform`,!n&&`-rotate-90`)}),(0,A.jsx)(ux,{size:14,className:`shrink-0 text-muted-foreground`}),(0,A.jsx)(`span`,{className:`min-w-0 truncate text-[12.5px] font-medium`,title:e.path,children:o})]}),(0,A.jsx)(`span`,{className:`shrink-0 text-[11px] text-muted-foreground`,children:s}),(0,A.jsxs)(`span`,{className:`shrink-0 font-mono text-[11px]`,children:[a.added?(0,A.jsxs)(`span`,{className:`cs-count-add`,children:[`+`,a.added]}):null,` `,a.removed?(0,A.jsxs)(`span`,{className:`cs-count-del`,children:[`−`,a.removed]}):null]}),(0,A.jsx)(`button`,{type:`button`,className:`cs-icon-button`,onClick:()=>void _x(e.path,i,`File path`),"aria-label":`Copy the path of ${o}`,title:`Copy path`,children:(0,A.jsx)(ux,{size:12})})]}),n?(0,A.jsx)(`div`,{className:`space-y-3 px-4 pb-3`,children:e.edits.map((e,t)=>(0,A.jsx)(Sx,{edit:e},`${e.toolCallId}-${t}`))}):null]})}function wx(e){return(0,_.useMemo)(()=>Cb(e),[e])}function Tx(e){return(0,A.jsxs)(`aside`,{className:`cs-changes`,"aria-label":`Files changed in this chat`,children:[(0,A.jsxs)(`div`,{className:`flex items-center justify-between border-b border-border px-4 py-3`,children:[(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`h2`,{className:`text-[13.5px] font-semibold`,children:`Files changed`}),(0,A.jsxs)(`p`,{className:`text-[11.5px] text-muted-foreground`,children:[e.files.length===0?`Nothing yet`:`${e.files.length} ${e.files.length===1?`file`:`files`}, from this chat's own record`,e.truncated?` · only the part of the chat shown here`:``]})]}),(0,A.jsx)(`button`,{type:`button`,className:`cs-icon-button`,onClick:e.onClose,"aria-label":`Close files changed`,children:(0,A.jsx)(dx,{size:14})})]}),e.files.length===0?(0,A.jsx)(`p`,{className:`px-4 py-6 text-center text-[12.5px] leading-5 text-muted-foreground`,children:`The agent hasn't written any files in this chat yet.`}):(0,A.jsx)(`ul`,{className:`min-h-0 flex-1 overflow-y-auto`,children:e.files.map(t=>(0,A.jsx)(Cx,{file:t,cwd:e.cwd},t.path))})]})}function Ex(e){let t=e?.defaultModel;return t?t.source===`settings`?`${t.id}, from your settings`:`${t.id}, the built-in default`:`${e?.label??`the agent`}'s own default`}function Dx(e,t){let n=e.model??t?.defaultModel?.id??`Default model`,r=e.effort??t?.defaultEffort??null;return r?`${n} · ${r}`:n}function Ox(e){let[t,n]=(0,_.useState)(!1),[r,i]=(0,_.useState)(``),a=e.status?.models??[],o=e.status?.efforts??[],s=e.value.model===null||a.some(t=>t.id===e.value.model),c=t=>e.onChange({...e.value,...t});return(0,A.jsxs)(P_,{open:t,onOpenChange:n,children:[(0,A.jsx)(F_,{asChild:!0,children:(0,A.jsxs)(`button`,{type:`button`,disabled:e.disabled,className:K(e.appearance===`field`?`cs-model-field`:`cs-chip-button`),"aria-label":`Model and effort: ${Dx(e.value,e.status)}. Change`,title:`Model and effort`,children:[(0,A.jsx)(`span`,{className:`truncate`,children:Dx(e.value,e.status)}),(0,A.jsx)(lx,{size:12,className:`shrink-0`})]})}),(0,A.jsxs)(I_,{align:`start`,className:`w-[300px] p-0`,children:[(0,A.jsxs)(`div`,{className:`max-h-[320px] overflow-y-auto p-1`,role:`listbox`,"aria-label":`Model`,children:[(0,A.jsx)(`p`,{className:`px-2 pb-1 pt-1.5 text-[11px] font-medium uppercase tracking-[0.05em] text-muted-foreground`,children:`Model`}),(0,A.jsxs)(`button`,{type:`button`,role:`option`,"aria-selected":e.value.model===null,className:`cs-option`,onClick:()=>c({model:null}),children:[(0,A.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,A.jsx)(`span`,{className:`block text-[13px]`,children:`Default`}),(0,A.jsx)(`span`,{className:`block truncate text-[11.5px] text-muted-foreground`,children:Ex(e.status)})]}),e.value.model===null?(0,A.jsx)(Kb,{size:14}):null]}),a.map(t=>(0,A.jsxs)(`button`,{type:`button`,role:`option`,"aria-selected":e.value.model===t.id,className:`cs-option`,onClick:()=>c({model:t.id}),children:[(0,A.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-[13px]`,children:t.label}),e.value.model===t.id?(0,A.jsx)(Kb,{size:14}):null]},t.id)),s?null:(0,A.jsxs)(`div`,{className:`cs-option`,"aria-selected":`true`,role:`option`,children:[(0,A.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-[13px]`,children:e.value.model}),(0,A.jsx)(Kb,{size:14})]}),(0,A.jsx)(`div`,{className:`flex gap-1 px-1 pb-1 pt-1.5`,children:(0,A.jsx)(`input`,{value:r,onChange:e=>i(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),e.stopPropagation(),r.trim()&&(c({model:r.trim()}),i(``)))},placeholder:`Another model name…`,"aria-label":`Another model name`,spellCheck:!1,className:`cs-option-input`})})]}),o.length>0?(0,A.jsxs)(`div`,{className:`border-t border-border p-2`,children:[(0,A.jsx)(`p`,{className:`px-1 pb-1.5 text-[11px] font-medium uppercase tracking-[0.05em] text-muted-foreground`,children:`Thinking effort`}),(0,A.jsx)(`div`,{className:`flex flex-wrap gap-1`,role:`radiogroup`,"aria-label":`Thinking effort`,children:[null,...o].map(t=>(0,A.jsx)(`button`,{type:`button`,role:`radio`,"aria-checked":e.value.effort===t,className:K(`cs-seg`,e.value.effort===t&&`cs-seg--on`),onClick:()=>c({effort:t}),title:t===null?`Default${e.status?.defaultEffort?` (${e.status.defaultEffort}, from your settings)`:``}`:void 0,children:t===null?`Default`:t},t??`default`))})]}):null]})]})}function kx(e,t,n){try{let r=localStorage.getItem(e);return t.includes(r??``)?r:n}catch{return n}}function Ax(e,t){try{localStorage.setItem(e,t)}catch{}}function jx({children:e,action:t}){return(0,A.jsxs)(`div`,{className:`flex h-8 items-center justify-between px-3 pt-3`,children:[(0,A.jsx)(`span`,{className:`text-[11px] font-medium uppercase tracking-[0.06em] text-muted-foreground`,children:e}),t]})}function Mx({children:e}){return(0,A.jsx)(`div`,{className:`truncate px-4 pb-0.5 pt-2.5 text-[11px] font-medium text-muted-foreground/80`,children:e})}function Nx(e){let[t,n]=(0,_.useState)(e.initial),r=(0,_.useRef)(!1),i=t=>{r.current||(r.current=!0,e.onDone(t))};return(0,A.jsx)(`input`,{autoFocus:!0,value:t,onChange:e=>n(e.target.value),onFocus:e=>e.currentTarget.select(),onKeyDown:e=>{e.key===`Enter`&&i(t),e.key===`Escape`&&i(null)},onBlur:()=>i(t),"aria-label":`New name for this chat`,className:`cs-rename-input`})}function Px(e){let t=Ib(),n=hx(),[r,i]=(0,_.useState)(!1),[a,o]=(0,_.useState)(!1),{entry:s}=e;return(0,A.jsxs)(qg,{children:[(0,A.jsx)(Jg,{asChild:!0,children:(0,A.jsxs)(`div`,{className:K(`cs-row group`,e.active&&`cs-row--active`,a&&`cs-row--menu`),"data-hidden":s.hidden||void 0,children:[(0,A.jsx)(`button`,{type:`button`,onClick:e.onSelect,className:`cs-row__hit`,"aria-current":e.active?`true`:void 0,"aria-label":s.title,title:s.title===s.originalTitle?s.title:`${s.title}\n(${s.originalTitle})`}),(0,A.jsx)(`span`,{className:`pointer-events-none mt-0.5 shrink-0`,children:e.live?(0,A.jsx)(ex,{size:16,className:`text-primary`}):(0,A.jsx)(tx,{provider:s.provider,size:16})}),(0,A.jsxs)(`span`,{className:`cs-row__body`,children:[r?(0,A.jsx)(`span`,{className:`pointer-events-auto relative z-10 block`,children:(0,A.jsx)(Nx,{initial:s.title,onDone:e=>{if(i(!1),e===null||e.trim()===s.title)return;let r=e.trim()===``||e.trim()===s.originalTitle?null:e;t.setPreference(s.key,{title:r}).catch(e=>n(`The new name didn't save: ${e instanceof Error?e.message:String(e)}`))}})}):(0,A.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,A.jsx)(`span`,{className:`min-w-0 truncate text-[13px] font-medium leading-5`,children:s.title}),s.pinned?(0,A.jsx)(ix,{size:11,className:`shrink-0 text-muted-foreground`,"aria-label":`Pinned`}):null]}),(0,A.jsx)(`span`,{className:`block truncate text-[11.5px] leading-4 text-muted-foreground`,children:e.meta}),e.snippet?(0,A.jsx)(`span`,{className:`cs-row__snippet`,children:e.snippet}):null]}),r?null:(0,A.jsxs)(`span`,{className:`cs-row__actions`,children:[e.takeover,(0,A.jsxs)(Hv,{open:a,onOpenChange:o,children:[(0,A.jsx)(Uv,{asChild:!0,children:(0,A.jsx)(`button`,{type:`button`,className:`cs-icon-button`,"aria-label":`More for ${s.title}`,title:`More`,children:(0,A.jsx)(rx,{size:15})})}),(0,A.jsx)(Zv,{align:`start`,className:`w-60`,onCloseAutoFocus:e=>e.preventDefault(),children:(0,A.jsx)(yx,{entry:s,variant:`dropdown`,onRename:()=>i(!0)})})]})]})]})}),(0,A.jsx)(t_,{className:`w-60`,onCloseAutoFocus:e=>e.preventDefault(),children:(0,A.jsx)(yx,{entry:s,variant:`context`,onRename:()=>i(!0)})})]})}function Fx(){return(0,A.jsx)(`div`,{className:`space-y-1.5 px-3 py-2`,"aria-hidden":`true`,children:[0,1,2].map(e=>(0,A.jsx)(`div`,{className:`cs-skeleton h-9 rounded-lg`},e))})}function Ix({text:e,query:t}){let n=t.trim().toLowerCase();if(!n)return e;let r=e.toLowerCase().indexOf(n);return r<0?e:(0,A.jsxs)(A.Fragment,{children:[e.slice(0,r),(0,A.jsx)(`mark`,{className:`cs-mark`,children:e.slice(r,r+n.length)}),e.slice(r+n.length)]})}var Lx={query:``,loading:!1,error:null,hits:[],scanned:0,total:0,nextCursor:null};function Rx(e){let t=Ib(),[n,r]=(0,_.useState)(Lx),i=(0,_.useRef)(e);i.current=e;let a=(0,_.useCallback)(async(e,n,a)=>{r(t=>({...a?t:Lx,query:e,loading:!0,error:null}));try{let o=await t.search(e,n);if(i.current.trim()!==e)return;r(t=>({query:e,loading:!1,error:null,hits:a?[...t.hits,...o.hits]:o.hits,scanned:(a?t.scanned:n)+o.scanned,total:o.total,nextCursor:o.nextCursor}))}catch(t){if(i.current.trim()!==e)return;r(e=>({...e,loading:!1,error:t instanceof Error?t.message:String(t)}))}},[t]);return(0,_.useEffect)(()=>{let t=e.trim();if(t.length<2){r(Lx);return}let n=setTimeout(()=>void a(t,0,!1),350);return()=>clearTimeout(n)},[e,a]),[n,(0,_.useCallback)(()=>{n.nextCursor!==null&&!n.loading&&a(n.query,n.nextCursor,!0)},[a,n.nextCursor,n.loading,n.query])]}function zx(e){return{provider:e.provider,providerSessionId:e.providerSessionId,cwd:e.cwd,title:e.title,updatedAt:e.updatedAt,source:null,activeElsewhere:null}}function Bx(e){let t=Ib(),n=Lb(),r=zb(),[i,a]=(0,_.useState)(``),[o,s]=Rx(i),[c,l]=(0,_.useState)(()=>kx(`coding-sessions.group`,[`date`,`folder`],`date`)),[u,d]=(0,_.useState)(!1),[f,p]=(0,_.useState)(null),[m,h]=(0,_.useState)(null),g=n.preferences,v=n.sessions.data,y=e=>{let t=n.runs[e];return t!==void 0&&!db(t.status)},{ours:b,others:x,hiddenCount:S}=(0,_.useMemo)(()=>{let e=v.map(e=>Tb(e,g)),t=new Set(v.map(e=>e.providerSessionId).filter(Boolean)),r=n.discovered.data.filter(e=>!t.has(e.providerSessionId)).map(e=>Eb(e,g));return{ours:e,others:r,hiddenCount:[...e,...r].filter(e=>e.hidden).length}},[v,n.discovered.data,g]),C=e=>u||!e.hidden,w=[...b,...x].filter(e=>e.pinned&&C(e)).sort(Nb),T=b.filter(e=>!e.pinned&&e.session&&y(e.session.id)&&C(e)),E=b.filter(e=>!e.pinned&&!(e.session&&y(e.session.id))&&C(e)),D=x.filter(e=>!e.pinned&&C(e)),O=e=>{l(e),Ax(`coding-sessions.group`,e)},k=t=>{t.session?e.select({kind:`session`,id:t.session.id}):t.providerSessionId&&e.select({kind:`discovered`,provider:t.provider,id:t.providerSessionId})},ee=t=>t.session?e.selection.kind===`session`&&e.selection.id===t.session.id:e.selection.kind===`discovered`&&e.selection.id===t.providerSessionId,j=async n=>{p(n.providerSessionId),h(null);try{let r=await t.takeover(n);e.select({kind:`session`,id:r.id})}catch(e){h({id:n.providerSessionId,message:e instanceof Error?e.message:String(e)})}finally{p(null)}},M=(e,t)=>{let i=e.session?y(e.session.id):!1,a=e.session?n.runs[e.session.id]:void 0,o=e.discovered,s;if(i)s=`${cb[e.provider]} is working…`;else if(o?.activeElsewhere)s=(0,A.jsxs)(`span`,{className:`cs-live-elsewhere`,children:[(0,A.jsx)(`span`,{className:`cs-live-dot`,"aria-hidden":`true`}),`Running in `,cb[e.provider]]});else{let n=a?a.status===`failed`?`Failed · `:a.status===`stopped`?`Stopped · `:``:``,i=e.cwd?Vb(e.cwd):`unknown folder`;s=`${n}${e.kind===`discovered`?`${cb[e.provider]} · `:``}${c===`folder`&&!t?``:`${i} · `}${Bb(e.updatedAt,r)}`}return(0,A.jsxs)(`div`,{children:[(0,A.jsx)(Px,{entry:e,active:ee(e),onSelect:()=>k(e),live:i,meta:s,snippet:t?.snippet,takeover:o?.cwd?(0,A.jsxs)(`button`,{type:`button`,className:`cs-takeover-chip`,onClick:()=>o.activeElsewhere?k(e):void j(o),title:o.activeElsewhere?o.activeElsewhere.message:`Continue this chat here`,disabled:f===o.providerSessionId,children:[f===o.providerSessionId?(0,A.jsx)(ex,{size:11}):null,`Take over`]}):null}),m&&o&&m.id===o.providerSessionId?(0,A.jsx)(`p`,{className:`mx-4 mb-1 text-[11.5px] text-destructive`,children:m.message}):null]},e.key)},te=e=>jb(e,c,r).map(e=>(0,A.jsxs)(`div`,{role:`group`,"aria-label":e.label,children:[(0,A.jsx)(Mx,{children:e.label}),e.entries.map(e=>M(e))]},e.label)),ne=i.trim().length>0,N=ne?[...b,...x].filter(e=>Mb(e,i)).sort(Nb):[],re=new Set(N.map(e=>e.key)),ie=new Map([...b,...x].map(e=>[e.key,e])),ae=o.hits.filter(e=>!re.has(lb(e.provider,e.providerSessionId))),oe=t=>{let n=ie.get(lb(t.provider,t.providerSessionId));if(n){k(n);return}e.onFound(zx(t)),e.select({kind:`discovered`,provider:t.provider,id:t.providerSessionId})},se=(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(jx,{children:`Chats`}),N.length===0?(0,A.jsx)(`p`,{className:`px-4 py-1 text-[12px] text-muted-foreground`,children:`No listed chat has that in its name or folder.`}):N.map(e=>M(e,{query:i})),(0,A.jsx)(jx,{children:`In conversations`}),i.trim().length<2?(0,A.jsx)(`p`,{className:`px-4 py-1 text-[12px] text-muted-foreground`,children:`Type at least two letters to search what was said.`}):(0,A.jsxs)(A.Fragment,{children:[ae.map(t=>{let n=ie.get(lb(t.provider,t.providerSessionId)),r=n??Eb(zx(t),g);return(0,A.jsx)(`div`,{onClickCapture:n?void 0:()=>e.onFound(zx(t)),children:M(r,{query:i,snippet:t.snippet?(0,A.jsx)(Ix,{text:t.snippet,query:i}):void 0})},`hit:${r.key}`)}),(0,A.jsx)(`div`,{className:`px-4 py-2 text-[11.5px] leading-4 text-muted-foreground`,role:`status`,"aria-live":`polite`,children:o.error?(0,A.jsxs)(`span`,{className:`text-destructive`,children:[`Search stopped: `,o.error]}):o.loading?(0,A.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,A.jsx)(ex,{size:12}),` Searching your chats…`]}):o.query?(0,A.jsxs)(A.Fragment,{children:[ae.length===0&&o.hits.length===0?`Nothing found. `:null,o.nextCursor===null?`Searched all ${o.total.toLocaleString()} chats on this computer.`:`Searched the ${o.scanned.toLocaleString()} most recent of ${o.total.toLocaleString()} chats.`,o.nextCursor===null?null:(0,A.jsx)(`button`,{type:`button`,className:`cs-link ml-1`,onClick:s,children:`Search older chats`})]}):null})]})]}),ce=(0,A.jsxs)(A.Fragment,{children:[w.length>0?(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(jx,{children:`Pinned`}),w.map(e=>M(e))]}):null,T.length>0?(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(jx,{children:`Running`}),T.map(e=>M(e))]}):null,(0,A.jsx)(jx,{children:`Recent`}),n.sessions.loading&&n.sessions.loadedAt===null?(0,A.jsx)(Fx,{}):n.sessions.error?(0,A.jsx)(`p`,{className:`px-4 py-1 text-[12px] text-destructive`,children:n.sessions.error}):E.length===0?T.length===0?(0,A.jsx)(`p`,{className:`px-4 py-1 text-[12px] leading-5 text-muted-foreground`,children:`Sessions you start or take over here will appear here.`}):null:E.map(e=>M(e)),(0,A.jsx)(jx,{action:(0,A.jsxs)(`span`,{className:`flex items-center gap-0.5`,children:[(0,A.jsxs)(Hv,{children:[(0,A.jsx)(Uv,{asChild:!0,children:(0,A.jsx)(`button`,{type:`button`,className:`cs-icon-button cs-icon-button--text`,"aria-label":`How to list your other chats`,children:c===`date`?`By date`:`By folder`})}),(0,A.jsxs)(Zv,{align:`end`,className:`w-52`,children:[(0,A.jsx)(ty,{children:`Group your other chats`}),(0,A.jsxs)(Gv,{value:c,onValueChange:e=>O(e),children:[(0,A.jsx)(ey,{value:`date`,children:`By date`}),(0,A.jsx)(ey,{value:`folder`,children:`By folder`})]}),(0,A.jsx)(ny,{}),(0,A.jsx)(Qv,{onSelect:()=>d(e=>!e),children:u?`Leave hidden chats out`:`Show hidden chats${S?` (${S})`:``}`})]})]}),(0,A.jsx)(`button`,{type:`button`,className:`cs-icon-button`,onClick:()=>void t.refreshDiscovered(),"aria-label":`Look again for your other chats`,title:`Look again`,children:n.discovered.loading?(0,A.jsx)(ex,{size:13}):(0,A.jsx)(Jb,{size:13})})]}),children:`Your other chats`}),n.discovered.loading&&n.discovered.loadedAt===null?(0,A.jsx)(Fx,{}):n.discovered.error?(0,A.jsx)(`p`,{className:`px-4 py-1 text-[12px] text-destructive`,children:n.discovered.error}):D.length===0?(0,A.jsx)(`p`,{className:`px-4 py-1 text-[12px] leading-5 text-muted-foreground`,children:x.length>0?`Every chat found here is pinned or hidden.`:`No other Claude Code or Codex chats were found on this computer.`}):(0,A.jsxs)(A.Fragment,{children:[te(D),n.discovered.data.length>=n.discoveredLimit?(0,A.jsx)(`div`,{className:`px-3 pt-2`,children:(0,A.jsxs)(rm,{variant:`ghost`,size:`sm`,className:`w-full text-muted-foreground`,onClick:()=>void t.showMoreDiscovered(),disabled:n.discovered.loading,children:[n.discovered.loading?(0,A.jsx)(ex,{size:13}):null,`Show older chats`]})}):null]}),u?null:S>0?(0,A.jsxs)(`button`,{type:`button`,className:`cs-link mx-4 mt-3 text-[11.5px]`,onClick:()=>d(!0),children:[S,` hidden `,S===1?`chat`:`chats`,` — show`]}):null]});return(0,A.jsxs)(`aside`,{className:`cs-sidebar flex h-full shrink-0 flex-col border-r border-border bg-muted/30`,style:{width:e.width},"aria-label":`Sessions`,children:[(0,A.jsxs)(`div`,{className:`flex items-center justify-between gap-2 px-4 pb-2 pt-3.5`,children:[(0,A.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,A.jsx)(`span`,{className:`cs-app-mark`,"aria-hidden":`true`}),(0,A.jsx)(`span`,{className:`truncate text-[14px] font-semibold tracking-[-0.01em]`,children:`Coding sessions`})]}),(0,A.jsx)(`button`,{type:`button`,className:`cs-icon-button`,onClick:e.onCollapse,"aria-label":`Hide the sidebar (⌘B)`,title:`Hide sidebar ⌘B`,children:(0,A.jsx)(cx,{size:15})})]}),(0,A.jsxs)(`div`,{className:`space-y-1.5 px-3 pb-1`,children:[(0,A.jsxs)(rm,{className:`w-full justify-start gap-2`,variant:`outline`,size:`sm`,onClick:e.onNew,children:[(0,A.jsx)(Ub,{size:15}),`New session`,(0,A.jsx)(`kbd`,{className:`cs-kbd ml-auto`,children:`⌥⌘N`})]}),(0,A.jsxs)(`div`,{className:`cs-search`,children:[(0,A.jsx)(nx,{size:14,className:`cs-search__icon`}),(0,A.jsx)(`input`,{ref:e.searchRef,type:`search`,value:i,onChange:e=>a(e.target.value),onKeyDown:e=>{if(e.key===`Escape`&&(i?a(``):e.currentTarget.blur(),e.preventDefault()),e.key===`Enter`){let e=N[0],t=ae[0];e?k(e):t&&oe(t)}},placeholder:`Search chats`,"aria-label":`Search chats by name, folder or what was said`,spellCheck:!1,className:`cs-search__input`}),i?(0,A.jsx)(`button`,{type:`button`,className:`cs-icon-button cs-search__clear`,onClick:()=>a(``),"aria-label":`Clear search`,children:(0,A.jsx)(dx,{size:13})}):(0,A.jsx)(`kbd`,{className:`cs-search__kbd`,children:`⌘K`})]})]}),(0,A.jsx)(`nav`,{className:`min-h-0 flex-1 overflow-y-auto pb-3`,children:ne?se:ce}),e.footer]})}function Vx(){let e=[],t=null,n=0,r=null,i=new Map;function a(t,n,r){let i={...t.message,parts:n,status:r??t.message.status};t.message=i;let a=e.findIndex(e=>e.id===i.id);a>=0&&(e[a]=i)}function o(){if(t)return t;n+=1;let r=S({id:`turn-${n}-${e.length}`,role:`assistant`,status:`streaming`});return e.push(r),t={message:r,index:new Map},t}function s(e,t){let n=o(),r=[...n.message.parts],i=n.index.get(e);i===void 0?(n.index.set(e,r.length),r.push(t(null))):r[i]=t(r[i]??null),a(n,r)}function c(e){if(!t)return;let n=t;a(n,n.message.parts.map(t=>{if(t.type===`reasoning`&&t.state===`streaming`)return{...t,state:`done`};if(t.type===`tool`&&t.state===`input-available`&&e!==`streaming`){if(e===`cancelled`)return{...t,state:`output-error`,errorText:`Stopped before this finished.`};if(e===`error`)return{...t,state:`output-error`,errorText:`The run ended before this finished.`}}return t}),e),t=null}let l={apply(n){switch(n.kind){case`user`:c(`complete`),e.push(S({id:`user-${n.id}`,role:`user`,parts:[{type:`text`,text:n.text}],status:`complete`,metadata:n.at?{createdAt:n.at}:void 0}));return;case`text-delta`:s(n.id,e=>e&&e.type===`text`?{type:`text`,text:e.text+n.text}:{type:`text`,text:n.text});return;case`text`:s(n.id,()=>({type:`text`,text:n.text}));return;case`reasoning`:s(n.id,()=>({type:`reasoning`,text:n.text,state:`done`}));return;case`tool-call`:{let r=yb(n.name,n.input),a=r?[{toolName:n.name,message:r,percent:null,at:null}]:[];s(n.id,e=>e&&e.type===`tool`?{...e,input:n.input,progress:a}:{type:`tool`,toolCallId:n.id,toolName:n.name,state:`input-available`,input:n.input,output:null,errorText:null,progress:a,delegated:!1});let o=t;if(o){let t=o.index.get(n.id),r=e.findIndex(e=>e.id===o.message.id);t!==void 0&&r>=0&&i.set(n.id,{messageIndex:r,partIndex:t})}return}case`tool-result`:{let r=i.get(n.id);if(!r){s(n.id,()=>({type:`tool`,toolCallId:n.id,toolName:`Tool`,state:n.isError?`output-error`:`output-available`,input:null,output:n.isError?null:n.output,errorText:n.isError?n.output||`The tool reported an error.`:null,progress:[],delegated:!1}));return}let a=e[r.messageIndex],o=a?.parts[r.partIndex];if(!a||!o||o.type!==`tool`)return;let c=n.isError?{...o,state:`output-error`,errorText:n.output||`The tool reported an error.`,output:null}:{...o,state:`output-available`,output:n.output},l=[...a.parts];l[r.partIndex]=c;let u={...a,parts:l};e[r.messageIndex]=u,t&&t.message.id===u.id&&(t.message=u);return}case`usage`:r={usage:n.usage,costUsd:n.costUsd};return;case`notice`:s(n.id,()=>({type:`notice`,level:n.level===`warning`?`medium`:`info`,code:null,userMessage:n.text,remedy:null}));return;case`error`:if(t?.message.parts.some(e=>e.type===`error`&&e.message.trim()===n.text.trim()))return;s(n.id,()=>({type:`error`,errorType:`provider`,code:null,message:n.text,userMessage:n.text,recoverable:!0,remedy:null}));return}},applyAll(e){for(let t of e)l.apply(t)},beginTurn(){o()},endTurn(n,r){n===`failed`&&r&&l.apply({kind:`error`,id:`run-error-${e.length}`,text:r}),n===`stopped`&&t&&l.apply({kind:`notice`,id:`run-stopped-${e.length}`,level:`info`,text:`You stopped this run.`}),c(n===`stopped`?`cancelled`:n===`failed`?`error`:`complete`)},messages(){return e.slice()},lastUsage(){return r}};return l}var Hx=60,Ux=25165824;function Wx(e){return{data:e,loading:!1,error:null,loadedAt:null}}function Gx(e){return e instanceof Error?e.message:String(e)}var Kx=class{sessionId;client;thread;builder=Vx();messages=[];listeners=new Set;seqMark=0;pending=[];activeRunId=null;activity=null;state={loading:!0,unavailable:null,truncated:!1};maxBytes=Ux;constructor(e,t){this.sessionId=e,this.client=t,this.thread=sb({getSnapshot:()=>({messages:this.messages,status:this.status(),conversationId:this.sessionId,ephemeral:!1}),features:{surface:{sendWhileBusy:!0}},subscribe:e=>(this.listeners.add(e),()=>{this.listeners.delete(e)}),onSubmit:async e=>{await this.client.send(this.sessionId,e.text)},onCancel:async()=>{let e=this.client.getState().runs[this.sessionId];e&&!db(e.status)&&await this.client.stop(e.runId)}})}status(){let e=this.client.getState().runs[this.sessionId];return e?e.status===`starting`?`submitted`:e.status===`running`?`streaming`:`idle`:`idle`}notify(){this.messages=this.builder.messages();for(let e of this.listeners)e()}async loadEarlier(){this.state.truncated&&!this.state.loadingEarlier&&(this.maxBytes*=4,this.state={...this.state,loadingEarlier:!0},this.notify(),await this.load(!0))}async load(e=!1){e||(this.state={loading:!0,unavailable:null,truncated:!1},this.notify());try{let e=await this.client.transport.call(`history`,this.sessionId,{maxBytes:this.maxBytes});this.builder=Vx(),this.builder.applyAll(e.items),this.seqMark=e.seq;let t=this.client.getState().runs[this.sessionId];t&&!db(t.status)?(this.activeRunId=t.runId,this.builder.beginTurn()):this.builder.endTurn(`completed`),this.state={loading:!1,unavailable:e.unavailable,truncated:e.truncated};let n=this.pending;this.pending=[];for(let e of n)this.onEvent(e.event)}catch(e){this.state={loading:!1,unavailable:Gx(e),truncated:!1}}this.notify()}onEvent(e){if(this.state.loading){e.type===`item`&&this.pending.push({seq:e.seq,event:e});return}if(e.type===`item`){if(e.seq<=this.seqMark)return;this.seqMark=e.seq,this.builder.apply(e.item),e.item.kind===`user`&&(this.activeRunId=e.runId,this.builder.beginTurn()),this.activity=qx(this.activity,e.item),this.notify();return}if(e.type===`run`){let t=e.run;db(t.status)&&(this.activity=null,this.activeRunId===t.runId?(this.builder.endTurn(t.status,t.error),this.activeRunId=null):t.status===`failed`&&t.error&&this.builder.endTurn(`failed`,t.error)),this.notify()}}};function qx(e,t){switch(t.kind){case`user`:return`Thinking…`;case`text-delta`:return`Writing…`;case`text`:case`reasoning`:case`tool-result`:return`Thinking…`;case`tool-call`:{let e=yb(t.name,t.input);return`${gb(t.name)}${e?` — ${e}`:``}`}default:return e}}var Jx=class{transport;state;listeners=new Set;transcripts=new Map;finishedListeners=new Set;onRunFinished=e=>(this.finishedListeners.add(e),()=>{this.finishedListeners.delete(e)});constructor(e){this.transport=e,this.state={connection:e.status(),providers:Wx([]),sessions:Wx([]),discovered:Wx([]),folders:Wx([]),runs:{},preferences:{},discoveredLimit:Hx},e.onStatus(e=>{let t=this.state.connection.state===`open`;this.set({connection:e}),e.state===`open`&&!t&&this.refreshAll()}),e.subscribe(e=>this.onEvent(e))}getState=()=>this.state;subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)});set(e){this.state={...this.state,...e};for(let e of this.listeners)e()}onEvent(e){if(e.type===`session`){let t=this.state.sessions.data.filter(t=>t.id!==e.session.id);t.unshift(e.session),t.sort((e,t)=>t.updatedAt.localeCompare(e.updatedAt)),this.set({sessions:{...this.state.sessions,data:t}})}else if(e.type===`run`){let t=this.state.runs[e.run.sessionId];if(this.set({runs:{...this.state.runs,[e.run.sessionId]:e.run}}),db(e.run.status)&&(!t||t.runId!==e.run.runId||!db(t.status))){let t=this.state.sessions.data.find(t=>t.id===e.run.sessionId)??null;for(let n of this.finishedListeners)n({run:e.run,session:t})}}else if(e.type===`preferences`){this.set({preferences:e.preferences});return}let t=e.type===`session`?e.session.id:e.type===`run`?e.run.sessionId:e.sessionId;this.transcripts.get(t)?.onEvent(e)}async load(e,t){this.set({[e]:{...this.state[e],loading:!0,error:null}});try{let n=await t();this.set({[e]:{data:n,loading:!1,error:null,loadedAt:Date.now()}})}catch(t){this.set({[e]:{...this.state[e],loading:!1,error:Gx(t)}})}}refreshProviders=()=>this.load(`providers`,()=>this.transport.call(`providers`));refreshDiscovered=()=>this.load(`discovered`,()=>this.transport.call(`discoverSessions`,{limit:this.state.discoveredLimit}));showMoreDiscovered=async()=>{this.set({discoveredLimit:this.state.discoveredLimit+Hx}),await this.refreshDiscovered()};refreshPreferences=async()=>{try{this.set({preferences:await this.transport.call(`chatPreferences`)})}catch{}};setPreference=async(e,t)=>{let n=this.state.preferences,r={...n[e],...t};this.set({preferences:{...n,[e]:r}});try{this.set({preferences:await this.transport.call(`setChatPreference`,e,t)})}catch(e){throw this.set({preferences:n}),e}};search(e,t=0){return this.transport.call(`searchChats`,e,{cursor:t,limit:30})}readRawTranscript(e,t){return this.transport.call(`readRawTranscript`,e,t)}openFolder(e,t){return this.transport.call(`openFolder`,e,t)}setSessionOptions(e,t){return this.transport.call(`setSessionOptions`,e,t)}refreshFolders=()=>this.load(`folders`,()=>this.transport.call(`recentFolders`));refreshSessions=async()=>{await this.load(`sessions`,()=>this.transport.call(`listSessions`));let e={};await Promise.all(this.state.sessions.data.map(async t=>{let n=await this.transport.call(`listRuns`,t.id).catch(()=>[]),r=n[n.length-1];r&&(e[t.id]=r)})),this.set({runs:{...e,...this.pickLive()}})};pickLive(){let e={};for(let[t,n]of Object.entries(this.state.runs))db(n.status)||(e[t]=n);return e}refreshAll=async()=>{await Promise.all([this.refreshSessions(),this.refreshProviders(),this.refreshDiscovered(),this.refreshFolders(),this.refreshPreferences()]);for(let e of this.transcripts.values())e.load()};transcript(e){let t=this.transcripts.get(e);return t||(t=new Kx(e,this),this.transcripts.set(e,t),t.load()),t}async readPreview(e,t,n){try{let r=await this.transport.call(`readTranscript`,e,t,n?{maxBytes:n}:void 0),i=Vx();return i.applyAll(r.items),i.endTurn(`completed`),{loading:!1,messages:i.messages(),unavailable:r.unavailable,truncated:r.truncated}}catch(e){return{loading:!1,messages:[],unavailable:Gx(e),truncated:!1}}}start(e){return this.transport.call(`start`,e)}takeover(e){return this.transport.call(`takeover`,{provider:e.provider,providerSessionId:e.providerSessionId,cwd:e.cwd??``,title:e.title})}send(e,t){return this.transport.call(`send`,e,t)}stop(e){return this.transport.call(`stop`,e)}},Yx=[`agent`,`folder`,`prompt`];async function Xx(e){let t={},n=e.provider;if(n&&(!n.installed||!n.loggedIn)&&(t.agent=`${n.problem??`${n.label} can't run here yet.`} ${n.fix??``}`.trim()),!e.folder.trim())t.folder=`Choose a folder, or type one, for it to work in.`;else try{let n=await e.checkFolder(e.folder);n.exists?n.isDirectory||(t.folder=`That path is a file, not a folder.`):(t.folder=`That folder doesn't exist on this computer.`,t.createFolder=n.path)}catch(e){t.folder=`Couldn't check that folder: ${e instanceof Error?e.message:String(e)}`}return e.prompt.trim()||(t.prompt=`Tell it what to do first.`),t}function Zx(e){return Yx.find(t=>e[t]!==void 0)??null}function Qx({transport:e,children:t}){let[n]=(0,_.useState)(()=>new Jx(e));return(0,_.useEffect)(()=>{e.status().state===`open`&&n.refreshAll()},[n,e]),(0,A.jsx)(Fb.Provider,{value:n,children:t})}function $x(){if(typeof location>`u`)return{kind:`none`};let[e,t,n]=location.hash.replace(/^#/,``).split(`/`);return e===`s`&&t?{kind:`session`,id:t}:e===`d`&&(t===`claude`||t===`codex`)&&n?{kind:`discovered`,provider:t,id:n}:{kind:`none`}}function eS(e){if(typeof history>`u`)return;let t=e.kind===`session`?`#s/${e.id}`:e.kind===`discovered`?`#d/${e.provider}/${e.id}`:``;history.replaceState(null,``,`${location.pathname}${location.search}${t}`)}function tS(){try{let e=localStorage.getItem(`coding-sessions.theme`);return e===`light`||e===`dark`?e:`system`}catch{return`system`}}function nS(){let[e,t]=(0,_.useState)(tS);return(0,_.useEffect)(()=>{let t=typeof window.matchMedia==`function`?window.matchMedia(`(prefers-color-scheme: dark)`):null,n=()=>{let n=e===`dark`||e===`system`&&t?.matches===!0;document.documentElement.classList.toggle(`dark`,n),document.documentElement.setAttribute(`data-theme`,n?`dark`:`light`)};return n(),t?.addEventListener(`change`,n),()=>t?.removeEventListener(`change`,n)},[e]),[e,(0,_.useCallback)(e=>{t(e);try{localStorage.setItem(`coding-sessions.theme`,e)}catch{}},[])]}var rS={starting:`Starting`,running:`Working`,completed:`Done`,stopped:`Stopped`,failed:`Failed`};function iS({run:e}){if(!e)return null;let t=!db(e.status);return(0,A.jsxs)(`span`,{className:K(`cs-pill`,`cs-pill--${e.status}`),children:[t?(0,A.jsx)(`span`,{className:`cs-pill__dot`,"aria-hidden":`true`}):null,rS[e.status]]})}function aS(){let{connection:e}=Lb();if(e.state===`open`)return null;let t=e.state===`closed`;return(0,A.jsxs)(`div`,{role:`status`,className:K(`flex items-center gap-2 border-b px-4 py-2 text-[13px]`,t?`border-destructive/30 bg-destructive/10 text-destructive`:`border-border bg-muted/60 text-muted-foreground`),children:[t?(0,A.jsx)(qb,{size:15}):(0,A.jsx)(ex,{size:14}),(0,A.jsx)(`span`,{children:t?e.reason:`Connecting to the coding sessions host…`})]})}function oS(e){let t=Lb(),n=Ib(),r={system:`light`,light:`dark`,dark:`system`},i={system:`Match system`,light:`Light`,dark:`Dark`};return(0,A.jsx)(`div`,{className:`border-t border-border px-3 py-2.5`,children:(0,A.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,A.jsx)(`div`,{className:`flex min-w-0 flex-1 flex-wrap gap-1.5`,children:t.providers.loading&&t.providers.loadedAt===null?(0,A.jsx)(`span`,{className:`text-[11.5px] text-muted-foreground`,children:`Checking Claude Code and Codex…`}):t.providers.data.map(e=>(0,A.jsxs)(`span`,{className:K(`cs-provider-chip`,e.ready?``:`cs-provider-chip--problem`),title:e.problem?`${e.problem} ${e.fix??``}`:`${e.label}${e.plan?` · ${e.plan}`:``}`,children:[(0,A.jsx)(tx,{provider:e.provider,size:13}),e.label,e.lastProblem?(0,A.jsx)(`span`,{className:`cs-provider-chip__note`,children:e.lastProblem.kind===`signed-out`?`· sign in again`:`· limit${fb(e.lastProblem.until)?` until ${fb(e.lastProblem.until)}`:``}`}):null,e.ready?(0,A.jsx)(Kb,{size:12}):(0,A.jsx)(qb,{size:12})]},e.provider))}),(0,A.jsx)(`button`,{type:`button`,className:`cs-icon-button`,onClick:()=>void n.refreshProviders(),"aria-label":`Check Claude Code and Codex again`,title:`Check again`,children:t.providers.loading?(0,A.jsx)(ex,{size:13}):(0,A.jsx)(Jb,{size:13})}),e.extra,(0,A.jsx)(`button`,{type:`button`,className:`cs-icon-button`,onClick:()=>e.setTheme(r[e.theme]),"aria-label":`Theme: ${i[e.theme]}. Switch to ${i[r[e.theme]]}.`,title:`Theme: ${i[e.theme]}`,children:e.theme===`system`?(0,A.jsx)(Qb,{size:14}):e.theme===`light`?(0,A.jsx)(Xb,{size:14}):(0,A.jsx)(Zb,{size:14})})]})})}function sS(){let e=(0,_.useContext)(mx);return(0,_.useMemo)(()=>({notify(t){e(t.message)}}),[e])}function cS(e,t,n=null){let r=Ib(),[i,a]=(0,_.useState)(n);return(0,_.useEffect)(()=>{if(!e||!t){a(null);return}let n=!1,i=()=>r.transport.call(`sessionActivity`,e,t).then(e=>{n||a(e)}).catch(()=>void 0);i();let o=setInterval(i,1e4);return()=>{n=!0,clearInterval(o)}},[r,e,t]),i}function lS(e,t){let n=Ib(),[r,i]=(0,_.useState)(null);return(0,_.useEffect)(()=>{let t=!1;return n.transport.call(`listRuns`,e).then(e=>{if(t)return;let n=0,r=null,a=null;for(let t of e)t.usage&&(n+=t.usage.inputTokens+t.usage.outputTokens+t.usage.cachedInputTokens),t.costUsd!==null&&(r=(r??0)+t.costUsd),a=t.billing??a;i(n>0||r!==null?{tokens:n,cost:r,billing:a,runs:e.length}:null)}).catch(()=>void 0),()=>{t=!0}},[n,e,t]),r}function uS(e){return(0,A.jsxs)(Hv,{children:[(0,A.jsx)(Uv,{asChild:!0,children:(0,A.jsx)(`button`,{type:`button`,className:`cs-icon-button`,"aria-label":`More for this chat`,title:`More`,children:(0,A.jsx)(rx,{size:16})})}),(0,A.jsx)(Zv,{align:`end`,className:`w-64`,onCloseAutoFocus:e=>e.preventDefault(),children:(0,A.jsx)(yx,{entry:e.entry,variant:`dropdown`,onRename:e.onRename})})]})}function dS(e){let t=Ib(),n=(0,_.useContext)(mx),[r,i]=(0,_.useState)(e.entry.title);(0,_.useEffect)(()=>i(e.entry.title),[e.entry.title,e.renaming]);let a=(0,_.useRef)(null);if((0,_.useEffect)(()=>{if(!e.renaming)return;let t=setTimeout(()=>{let e=a.current;e&&document.activeElement!==e&&(e.focus(),e.select())},0);return()=>clearTimeout(t)},[e.renaming]),!e.renaming)return(0,A.jsx)(`h1`,{className:`truncate text-[15px] font-semibold leading-5 tracking-[-0.01em]`,title:e.entry.title===e.entry.originalTitle?e.entry.title:`${e.entry.title} (${e.entry.originalTitle})`,onDoubleClick:()=>e.setRenaming(!0),children:e.entry.title});let o=()=>{e.setRenaming(!1);let i=r.trim();if(i===e.entry.title)return;let a=i===``||i===e.entry.originalTitle?null:i;t.setPreference(e.entry.key,{title:a}).catch(e=>n(`The new name didn't save: ${e instanceof Error?e.message:String(e)}`))};return(0,A.jsx)(`input`,{ref:a,autoFocus:!0,value:r,onChange:e=>i(e.target.value),onFocus:e=>e.currentTarget.select(),onBlur:o,onKeyDown:t=>{t.key===`Enter`&&o(),t.key===`Escape`&&e.setRenaming(!1)},"aria-label":`New name for this chat`,className:`cs-rename-input !m-0 !h-6 !text-[15px] !font-semibold`})}function fS(e){return(0,A.jsxs)(`p`,{className:`mx-auto mt-3 flex items-center gap-2 text-[12px] text-muted-foreground`,children:[`This chat is very long — showing its most recent part.`,(0,A.jsx)(`button`,{type:`button`,className:`cs-link`,onClick:e.onEarlier,disabled:e.loading,children:e.loading?`Reading…`:`Show earlier`})]})}function pS({session:e,changesOpen:t,setChangesOpen:n}){let r=Ib(),i=Lb(),a=(0,_.useContext)(mx),o=Rb(e.id),s=i.runs[e.id],c=s!==void 0&&!db(s.status),l=sS(),u=i.providers.data.find(t=>t.provider===e.provider)??null,d=u&&(!u.installed||!u.loggedIn)?u:null,f=!d&&u?.lastProblem?u:null,[p,m]=(0,_.useState)(!1),[h,g]=(0,_.useState)(!1),v=cS(e.origin===`takeover`&&!c?e.provider:null,e.providerSessionId),y=Tb(e,i.preferences),b=o.thread.getSnapshot().messages,x=wx(b),S=lS(e.id,`${s?.runId??``}:${s?.status??``}`);(0,_.useEffect)(()=>{c||m(!1)},[c]);let C=async()=>{s&&(m(!0),await r.stop(s.runId).catch(()=>m(!1)))},w=t=>{r.setSessionOptions(e.id,{model:t.model,effort:t.effort}).then(()=>a(`The next message uses ${Dx(t,u)}.`)).catch(e=>a(`That didn't save: ${e instanceof Error?e.message:String(e)}`))},T=S?`${Dr(S.tokens,{style:`compact`})} tokens${S.cost===null?``:` · ${Tr(S.cost)}`}`:null,E=S?`${Dr(S.tokens)} tokens over ${S.runs} ${S.runs===1?`message`:`messages`} sent from here.`+(S.cost===null?``:S.billing===`subscription`?` ${Tr(S.cost)} is what this would cost at API prices — it's covered by your ${u?.plan??``} plan.`.replace(` `,` `):` Billed ${Tr(S.cost)} to your API key.`):``;return(0,A.jsxs)(`div`,{className:`flex min-w-0 flex-1`,children:[(0,A.jsxs)(`section`,{className:`flex min-w-0 flex-1 flex-col`,"aria-label":y.title,children:[(0,A.jsxs)(`header`,{className:`flex items-center gap-3 border-b border-border px-5 py-2.5`,children:[(0,A.jsx)(tx,{provider:e.provider,size:22}),(0,A.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,A.jsx)(dS,{entry:y,renaming:h,setRenaming:g}),(0,A.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1 text-[12px] leading-5 text-muted-foreground`,children:[(0,A.jsx)(`span`,{className:`shrink-0`,children:cb[e.provider]}),(0,A.jsx)(`span`,{"aria-hidden":`true`,children:`·`}),(0,A.jsx)(Ox,{status:u,value:{model:e.model,effort:e.effort??null},onChange:w}),(0,A.jsx)(`span`,{"aria-hidden":`true`,children:`·`}),(0,A.jsx)(Gb,{size:12,className:`shrink-0`}),(0,A.jsx)(`span`,{className:`min-w-[4rem] truncate`,title:e.cwd,children:Vb(e.cwd)}),T?(0,A.jsxs)(`span`,{className:`shrink-0`,title:E,children:[`· `,T]}):null]})]}),(0,A.jsxs)(`button`,{type:`button`,className:K(`cs-chip-button`,t&&`cs-chip-button--on`),onClick:()=>n(!t),"aria-pressed":t,title:`Files this chat changed`,children:[(0,A.jsx)(ux,{size:13}),x.length>0?`${x.length} ${x.length===1?`file`:`files`} changed`:`Changes`]}),(0,A.jsx)(iS,{run:s}),c?(0,A.jsxs)(rm,{variant:`outline`,size:`sm`,onClick:()=>void C(),disabled:p,className:`gap-1.5`,title:`Stop Esc`,children:[p?(0,A.jsx)(ex,{size:13}):(0,A.jsx)(Wb,{size:13}),p?`Stopping…`:`Stop`]}):null,(0,A.jsx)(uS,{entry:y,onRename:()=>g(!0)})]}),(0,A.jsx)(`div`,{className:`mx-chat flex min-h-0 flex-1 flex-col`,children:(0,A.jsxs)(Fr,{thread:o.thread,ports:{notifier:l,toolLabel:gb},children:[(0,A.jsx)(`div`,{className:`min-h-0 flex-1 overflow-hidden`,children:o.state.loading?(0,A.jsxs)(`div`,{className:`flex h-full items-center justify-center gap-2 text-[13px] text-muted-foreground`,children:[(0,A.jsx)(ex,{size:15}),` Loading the conversation…`]}):(0,A.jsxs)(`div`,{className:`flex h-full flex-col`,children:[o.state.unavailable?(0,A.jsx)(`p`,{className:`mx-auto mt-4 max-w-[720px] rounded-lg border border-border bg-muted/50 px-4 py-2.5 text-[13px] text-muted-foreground`,children:o.state.unavailable}):null,o.state.truncated?(0,A.jsx)(fS,{loading:o.state.loadingEarlier===!0,onEarlier:()=>void o.loadEarlier()}):null,b.length===0&&!c?(0,A.jsx)(`div`,{className:`flex flex-1 items-center justify-center text-[13px] text-muted-foreground`,children:e.origin===`takeover`?`You've taken over this chat. Send a message to continue it.`:`Nothing here yet.`}):(0,A.jsx)(Ry,{className:`min-h-0 flex-1`,label:`Conversation: ${y.title}`})]})}),(0,A.jsxs)(`div`,{className:`mx-auto w-full max-w-[820px] px-4 pb-4`,children:[f?(0,A.jsxs)(`div`,{className:`mb-2 flex items-start gap-2 rounded-lg border border-warning/40 bg-warning/10 px-3 py-2 text-[12.5px]`,children:[(0,A.jsx)(qb,{size:15,className:`mt-0.5 shrink-0 text-warning`}),(0,A.jsxs)(`span`,{children:[f.problem,` `,f.fix]})]}):null,d?(0,A.jsxs)(`div`,{className:`mb-2 flex items-start gap-2 rounded-lg border border-warning/40 bg-warning/10 px-3 py-2 text-[12.5px]`,children:[(0,A.jsx)(qb,{size:15,className:`mt-0.5 shrink-0 text-warning`}),(0,A.jsxs)(`span`,{children:[d.problem,` `,d.fix]})]}):null,(0,A.jsx)(`div`,{className:`cs-activity`,role:`status`,"aria-live":`polite`,"data-idle":!c||void 0,children:c?(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(ex,{size:13}),(0,A.jsx)(`span`,{className:`truncate`,children:s?.status===`starting`?`Starting ${cb[e.provider]}…`:o.activity??`Thinking…`}),(0,A.jsx)(`span`,{className:`ml-auto shrink-0 text-[11px] opacity-70`,children:`Esc to stop`})]}):null}),v?(0,A.jsxs)(`div`,{className:`mb-2 flex items-start gap-2 rounded-lg border border-warning/40 bg-warning/10 px-3 py-2 text-[12.5px]`,children:[(0,A.jsx)(qb,{size:15,className:`mt-0.5 shrink-0 text-warning`}),(0,A.jsxs)(`span`,{children:[v.message,` A message sent here would put a second agent on the same chat.`]})]}):null,e.queued.length>0?(0,A.jsx)(`ul`,{className:`mb-2 space-y-1.5`,"aria-label":`Queued messages`,children:e.queued.map((e,t)=>(0,A.jsxs)(`li`,{className:`cs-queued`,children:[(0,A.jsx)(`span`,{className:`cs-queued__label`,children:`Queued · sends when this run finishes`}),(0,A.jsx)(`span`,{className:`cs-queued__text`,children:e})]},`${t}-${e.slice(0,16)}`))}):null,(0,A.jsx)(ob,{placeholder:`Message ${cb[e.provider]}…`,autoFocus:!0,...d?{held:{reason:`${d.problem} ${d.fix??``}`.trim()}}:{}})]})]})})]}),t?(0,A.jsx)(Tx,{files:x,cwd:e.cwd,truncated:o.state.truncated,onClose:()=>n(!1)}):null]})}function mS(e,t){let n=(0,_.useRef)({messages:[],listeners:new Set}),r=(0,_.useRef)(t);return r.current=t,[(0,_.useMemo)(()=>sb({getSnapshot:()=>({messages:n.current.messages,status:`idle`,conversationId:e}),subscribe:e=>(n.current.listeners.add(e),()=>{n.current.listeners.delete(e)}),onSubmit:()=>r.current()}),[e]),(0,_.useCallback)(e=>{n.current.messages=e;for(let e of n.current.listeners)e()},[])]}function hS(e){let t=Ib(),n=Lb(),r=(0,_.useContext)(mx),i=zb(),[a,o]=(0,_.useState)({loading:!0,messages:[],unavailable:null,truncated:!1}),[s,c]=(0,_.useState)(!1),[l,u]=(0,_.useState)(null),[d,f]=(0,_.useState)(!1),[p,m]=(0,_.useState)(!1),[h,g]=(0,_.useState)(void 0),[v,y]=(0,_.useState)(!1),b=cS(e.provider,e.id,e.session?.activeElsewhere??null),x=wx(a.messages),S=e.session,[C,w]=mS(e.id,()=>r(S?.cwd?`This chat is read-only until you take it over. Press Take over to continue it here.`:`This chat is read-only here: it doesn't record its folder, so it can't be continued.`));(0,_.useEffect)(()=>{let n=!1,r=r=>t.readPreview(e.provider,e.id,h).then(e=>{n||(w(e.messages),o(e),r&&y(!1))});h===void 0&&o({loading:!0,messages:[],unavailable:null,truncated:!1}),r(!0);let i=b?setInterval(()=>void r(!1),8e3):null;return()=>{n=!0,i&&clearInterval(i)}},[t,e.provider,e.id,h,b!==null,w]);let T=sS(),E=Eb(S??{provider:e.provider,providerSessionId:e.id,cwd:null,title:`Chat`,updatedAt:``,source:null,activeElsewhere:null},n.preferences),D=()=>{b?f(!0):O()},O=async()=>{if(S){f(!1),c(!0),u(null);try{let n=await t.takeover(S);e.onTakenOver(n.id)}catch(e){u(e instanceof Error?e.message:String(e))}finally{c(!1)}}};return(0,A.jsxs)(`div`,{className:`flex min-w-0 flex-1`,children:[(0,A.jsxs)(`section`,{className:`flex min-w-0 flex-1 flex-col`,"aria-label":E.title,children:[(0,A.jsxs)(`header`,{className:`flex items-center gap-3 border-b border-border px-5 py-3`,children:[(0,A.jsx)(tx,{provider:e.provider,size:22}),(0,A.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,A.jsx)(dS,{entry:E,renaming:p,setRenaming:m}),(0,A.jsxs)(`p`,{className:`flex items-center gap-1.5 truncate text-[12px] leading-4 text-muted-foreground`,children:[(0,A.jsx)(`span`,{children:cb[e.provider]}),S?.cwd?(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(`span`,{"aria-hidden":`true`,children:`·`}),(0,A.jsx)(Gb,{size:12}),(0,A.jsx)(`span`,{className:`truncate`,title:S.cwd,children:Vb(S.cwd)})]}):null,S?(0,A.jsxs)(`span`,{children:[`· last active `,Bb(S.updatedAt,i)]}):null]})]}),x.length>0?(0,A.jsxs)(`button`,{type:`button`,className:`cs-chip-button`,onClick:()=>e.setChangesOpen(!e.changesOpen),"aria-pressed":e.changesOpen,title:`Files this chat changed`,children:[(0,A.jsx)(ux,{size:13}),`${x.length} ${x.length===1?`file`:`files`} changed`]}):null,S?.cwd?(0,A.jsxs)(rm,{size:`sm`,variant:b?`outline`:`default`,onClick:D,disabled:s,className:`gap-1.5`,title:b?b.message:void 0,children:[s?(0,A.jsx)(ex,{size:13}):b?(0,A.jsx)(qb,{size:14,className:`text-warning`}):(0,A.jsx)(Yb,{size:14}),b?`Take over anyway…`:`Take over`]}):null,S?(0,A.jsx)(uS,{entry:E,onRename:()=>m(!0)}):null]}),b?(0,A.jsxs)(`div`,{role:`status`,className:`flex items-start gap-2 border-b border-warning/40 bg-warning/10 px-5 py-2.5 text-[13px]`,children:[(0,A.jsx)(qb,{size:15,className:`mt-0.5 shrink-0 text-warning`}),(0,A.jsxs)(`span`,{children:[(0,A.jsx)(`span`,{className:`font-medium`,children:b.message}),` Taking it over now would put two agents on the same chat, and they could overwrite each other's work. Finish or stop it there first if you can. This preview follows it as it runs.`]})]}):null,(0,A.jsx)(B_,{open:d,onOpenChange:f,children:(0,A.jsxs)($_,{className:`max-w-[460px]`,children:[(0,A.jsxs)(ev,{children:[(0,A.jsxs)(nv,{children:[`This chat is running right now in `,cb[e.provider]]}),(0,A.jsxs)(rv,{children:[b?.message,` If you take it over, two agents will work in the same conversation at once and may overwrite each other's changes.`]})]}),(0,A.jsxs)(tv,{children:[(0,A.jsx)(rm,{variant:`ghost`,onClick:()=>f(!1),children:`Cancel`}),(0,A.jsx)(rm,{variant:`destructive`,onClick:()=>void O(),children:`Take over anyway`})]})]})}),l?(0,A.jsx)(`p`,{className:`border-b border-destructive/30 bg-destructive/10 px-5 py-2 text-[13px] text-destructive`,children:l}):null,S&&!S.cwd?(0,A.jsx)(`p`,{className:`border-b border-border bg-muted/50 px-5 py-2 text-[13px] text-muted-foreground`,children:`This chat doesn't record which folder it ran in, so it can't be continued from here.`}):null,(0,A.jsxs)(`div`,{className:`mx-chat flex min-h-0 flex-1 flex-col`,children:[a.loading?(0,A.jsxs)(`div`,{className:`flex flex-1 items-center justify-center gap-2 text-[13px] text-muted-foreground`,children:[(0,A.jsx)(ex,{size:15}),` Reading this chat…`]}):a.unavailable?(0,A.jsx)(`div`,{className:`flex flex-1 items-center justify-center px-6 text-center text-[13px] text-muted-foreground`,children:a.unavailable}):(0,A.jsxs)(Fr,{thread:C,ports:{notifier:T,toolLabel:gb},children:[a.truncated?(0,A.jsx)(fS,{loading:v,onEarlier:()=>{y(!0),g(e=>(e??25165824)*4)}}):null,(0,A.jsx)(Ry,{className:`min-h-0 flex-1`,label:`Chat preview`})]}),S?.cwd?(0,A.jsxs)(`div`,{className:`border-t border-border bg-muted/30 px-5 py-3 text-center text-[13px] text-muted-foreground`,children:[`This chat was started in `,cb[e.provider],`.`,` `,(0,A.jsx)(`button`,{type:`button`,className:`font-medium text-foreground underline-offset-4 hover:underline`,onClick:D,children:`Take it over`}),` `,`to continue it here — it stays in your `,cb[e.provider],` history too.`]}):null]})]}),e.changesOpen&&x.length>0?(0,A.jsx)(Tx,{files:x,cwd:S?.cwd??null,truncated:a.truncated,onClose:()=>e.setChangesOpen(!1)}):null]})}function gS(e){let t=e.status.ready;return(0,A.jsxs)(`button`,{type:`button`,onClick:e.onSelect,"aria-pressed":e.selected,className:K(`flex flex-1 flex-col gap-1.5 rounded-xl border px-3.5 py-3 text-left transition-colors`,e.selected?`border-primary bg-primary/5 ring-1 ring-primary`:`border-border hover:bg-accent/50`),children:[(0,A.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,A.jsx)(tx,{provider:e.status.provider,size:18}),(0,A.jsx)(`span`,{className:`text-[13.5px] font-semibold`,children:e.status.label})]}),t?(0,A.jsxs)(`span`,{className:`flex items-center gap-1 text-[12px] text-success`,children:[(0,A.jsx)(Kb,{size:13}),e.status.billing===`subscription`?`Signed in${e.status.plan?` · ${e.status.plan} plan`:``}`:`Signed in with an API key (billed per use)`]}):(0,A.jsxs)(`span`,{className:`flex items-start gap-1 text-[12px] leading-4 text-warning`,children:[(0,A.jsx)(qb,{size:13,className:`mt-px shrink-0`}),e.status.problem]}),e.status.quota.filter(e=>e.usedPercent!==null).length>0?(0,A.jsx)(`span`,{className:`text-[11.5px] leading-4 text-muted-foreground`,children:e.status.quota.filter(e=>e.usedPercent!==null).map(e=>`${e.label}: ${e.usedPercent}% used`).join(` · `)}):null]})}function _S({id:e,children:t}){return(0,A.jsxs)(`p`,{id:e,role:`alert`,className:`flex items-start gap-1.5 text-[12.5px] leading-5 text-destructive`,children:[(0,A.jsx)(qb,{size:14,className:`mt-0.5 shrink-0`}),(0,A.jsx)(`span`,{children:t})]})}function vS(e){let t=Ib(),n=Lb(),r=zb(),[i,a]=(0,_.useState)(`claude`),[o,s]=(0,_.useState)(``),[c,l]=(0,_.useState)({model:null,effort:null}),[u,d]=(0,_.useState)(``),[f,p]=(0,_.useState)({}),[m,h]=(0,_.useState)(null),[g,v]=(0,_.useState)(!1),[y,b]=(0,_.useState)(!1),x=(0,_.useRef)(null),S=(0,_.useRef)(null),C=(0,_.useRef)(null);(0,_.useEffect)(()=>{e.open&&(h(null),p({}),t.refreshProviders(),t.refreshFolders())},[e.open,t]),(0,_.useEffect)(()=>{!o&&n.folders.data[0]?.exists&&s(n.folders.data[0].path)},[n.folders.data,o]),(0,_.useEffect)(()=>{let e=n.providers.data.filter(e=>e.ready),t=n.providers.data.find(e=>e.provider===i);t&&!t.ready&&e[0]&&a(e[0].provider)},[n.providers.loadedAt]);let w=n.providers.data.find(e=>e.provider===i)??null,T=e=>{e===`prompt`?x.current?.focus():e===`folder`?S.current?.focus():e===`agent`&&C.current?.querySelector(`button`)?.focus()},E=async()=>{if(g)return;h(null);let n=await Xx({provider:w,folder:o,prompt:u,checkFolder:e=>t.transport.call(`checkFolder`,e)});p(n);let r=Zx(n);if(r){T(r);return}v(!0);try{let n=await t.start({provider:i,cwd:o.trim(),prompt:u,model:c.model,effort:c.effort});d(``),e.onStarted(n.session.id)}catch(e){h(e instanceof Error?e.message:String(e))}finally{v(!1)}},D=async()=>{if(f.createFolder){b(!0);try{let e=await t.transport.call(`createFolder`,f.createFolder);s(e.path),p(e=>{let t={...e};return delete t.folder,delete t.createFolder,t}),t.refreshFolders(),S.current?.focus()}catch(e){p(t=>({...t,folder:`Couldn't create it: ${e instanceof Error?e.message:String(e)}`}))}finally{b(!1)}}},O=e=>p(t=>{if(t[e]===void 0)return t;let n={...t};return delete n[e],e===`folder`&&delete n.createFolder,n});return(0,A.jsx)(B_,{open:e.open,onOpenChange:e.onOpenChange,children:(0,A.jsxs)($_,{className:`max-w-[560px]`,children:[(0,A.jsxs)(ev,{children:[(0,A.jsx)(nv,{children:`New coding session`}),(0,A.jsxs)(rv,{children:[`Runs on your own `,i===`claude`?`Claude`:`ChatGPT`,` sign-in, in a folder on this computer.`]})]}),(0,A.jsxs)(`form`,{noValidate:!0,onSubmit:e=>{e.preventDefault(),E()},className:`flex min-h-0 flex-col`,children:[(0,A.jsxs)(`div`,{className:`cs-dialog-body space-y-5 py-1 pr-1`,children:[(0,A.jsxs)(`fieldset`,{className:`space-y-2`,ref:C,children:[(0,A.jsx)(`legend`,{className:`mb-2 text-[12.5px] font-medium`,children:`Agent`}),n.providers.loading&&n.providers.loadedAt===null?(0,A.jsxs)(`div`,{className:`flex gap-2`,children:[(0,A.jsx)(`div`,{className:`cs-skeleton h-[68px] flex-1 rounded-xl`}),(0,A.jsx)(`div`,{className:`cs-skeleton h-[68px] flex-1 rounded-xl`})]}):n.providers.error?(0,A.jsx)(`p`,{className:`text-[12.5px] text-destructive`,children:n.providers.error}):(0,A.jsx)(`div`,{className:`flex gap-2`,children:n.providers.data.map(e=>(0,A.jsx)(gS,{status:e,selected:e.provider===i,onSelect:()=>{e.provider!==i&&l({model:null,effort:null}),a(e.provider),O(`agent`)}},e.provider))}),f.agent?(0,A.jsx)(_S,{id:`cs-err-agent`,children:f.agent}):w&&!w.ready&&w.fix?(0,A.jsxs)(`p`,{className:`text-[12px] leading-4 text-muted-foreground`,children:[w.fix,w.installed&&w.loggedIn?` You can still try — the run will say if it's still blocked.`:``]}):null]}),(0,A.jsxs)(`fieldset`,{className:`space-y-2`,children:[(0,A.jsx)(`legend`,{className:`mb-2 text-[12.5px] font-medium`,children:`Folder`}),n.folders.data.length>0?(0,A.jsx)(`div`,{className:`max-h-[132px] space-y-0.5 overflow-y-auto rounded-lg border border-border p-1`,children:n.folders.data.map(e=>(0,A.jsxs)(`button`,{type:`button`,onClick:()=>{s(e.path),O(`folder`)},disabled:!e.exists,title:e.exists?e.path:`${e.path} no longer exists`,className:K(`flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left text-[12.5px]`,o===e.path?`bg-accent text-accent-foreground`:`hover:bg-accent/50`,!e.exists&&`opacity-50`),children:[(0,A.jsx)(Gb,{size:14,className:`shrink-0 text-muted-foreground`}),(0,A.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:Vb(e.path)}),(0,A.jsx)(`span`,{className:`shrink-0 text-[11px] text-muted-foreground`,children:e.exists?Bb(e.lastUsedAt,r):`missing`})]},e.path))}):n.folders.loading?(0,A.jsx)(`div`,{className:`cs-skeleton h-10 rounded-lg`}):null,(0,A.jsx)(iy,{ref:S,value:o,onChange:e=>{s(e.target.value),O(`folder`)},placeholder:`Or type a folder path, like ~/code/my-app`,"aria-label":`Folder path`,"aria-invalid":f.folder?!0:void 0,"aria-describedby":f.folder?`cs-err-folder`:void 0,spellCheck:!1}),f.folder?(0,A.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-3 gap-y-1`,children:[(0,A.jsx)(_S,{id:`cs-err-folder`,children:f.folder}),f.createFolder?(0,A.jsxs)(rm,{type:`button`,size:`sm`,variant:`outline`,onClick:()=>void D(),disabled:y,className:`gap-1.5`,children:[y?(0,A.jsx)(ex,{size:13}):(0,A.jsx)(Gb,{size:13}),`Create this folder`]}):null]}):null]}),(0,A.jsxs)(`fieldset`,{className:`space-y-2`,children:[(0,A.jsx)(`legend`,{className:`mb-2 text-[12.5px] font-medium`,children:`What should it do?`}),(0,A.jsx)(gy,{ref:x,value:u,onChange:e=>{d(e.target.value),O(`prompt`)},onKeyDown:e=>{e.key===`Enter`&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),E())},placeholder:`Describe the change, the bug, or the question…`,rows:4,"aria-label":`First message`,"aria-invalid":f.prompt?!0:void 0,"aria-describedby":f.prompt?`cs-err-prompt`:void 0}),f.prompt?(0,A.jsx)(_S,{id:`cs-err-prompt`,children:f.prompt}):null]}),(0,A.jsxs)(`fieldset`,{className:`space-y-2`,children:[(0,A.jsx)(`legend`,{className:`mb-2 text-[12.5px] font-medium`,children:`Model and thinking effort`}),(0,A.jsx)(Ox,{status:w,value:c,onChange:l,appearance:`field`}),(0,A.jsxs)(`p`,{className:`text-[11.5px] leading-4 text-muted-foreground`,children:[`Default is `,Ex(w),`. You can change it later from the chat's header.`]})]}),m?(0,A.jsx)(_S,{id:`cs-err-start`,children:m}):null]}),(0,A.jsxs)(tv,{className:`pt-4`,children:[(0,A.jsx)(rm,{type:`button`,variant:`ghost`,onClick:()=>e.onOpenChange(!1),children:`Cancel`}),(0,A.jsxs)(rm,{type:`submit`,disabled:g,className:`gap-1.5`,children:[g?(0,A.jsx)(ex,{size:14}):null,g?`Starting…`:`Start session`,g?null:(0,A.jsx)(`kbd`,{className:`cs-kbd`,children:`⌘↵`})]})]})]})]})})}function yS({onNew:e}){let t=Lb();return(0,A.jsx)(`section`,{className:`flex flex-1 items-center justify-center px-6`,children:(0,A.jsxs)(`div`,{className:`w-full max-w-[460px] text-center`,children:[(0,A.jsx)(`span`,{className:`mx-auto mb-4 flex h-11 w-11 items-center justify-center rounded-2xl bg-primary/10 text-primary`,children:(0,A.jsx)($b,{size:22})}),(0,A.jsx)(`h1`,{className:`text-[19px] font-semibold tracking-[-0.015em]`,children:`Drive Claude Code and Codex from here`}),(0,A.jsx)(`p`,{className:`mx-auto mt-2 max-w-[400px] text-[13.5px] leading-6 text-muted-foreground`,children:`Start a session in any folder, or pick up a chat you began somewhere else. Everything runs on your own subscriptions — no API keys.`}),(0,A.jsxs)(rm,{className:`mt-5 gap-1.5`,onClick:e,children:[(0,A.jsx)(Ub,{size:15}),`New session`]}),(0,A.jsxs)(`p`,{className:`mt-3 text-[12px] text-muted-foreground`,children:[(0,A.jsx)(`kbd`,{className:`cs-kbd`,children:`⌥⌘N`}),` new session · `,(0,A.jsx)(`kbd`,{className:`cs-kbd`,children:`⌘K`}),` search your chats ·`,` `,(0,A.jsx)(`kbd`,{className:`cs-kbd`,children:`⌘/`}),` all shortcuts`]}),(0,A.jsx)(`div`,{className:`mt-6 space-y-1.5 text-left`,children:t.providers.data.map(e=>(0,A.jsxs)(`div`,{className:`flex items-start gap-2.5 rounded-lg border border-border px-3 py-2.5`,children:[(0,A.jsx)(tx,{provider:e.provider,size:18}),(0,A.jsxs)(`div`,{className:`min-w-0 flex-1 text-[12.5px] leading-5`,children:[(0,A.jsx)(`span`,{className:`font-medium`,children:e.label}),e.ready?(0,A.jsxs)(`span`,{className:`text-muted-foreground`,children:[` `,`— ready`,e.plan?` on your ${e.plan} plan`:``,e.billing===`api`?` (API key, billed per use)`:``,e.version?` · version ${e.version}`:``]}):(0,A.jsxs)(`span`,{className:`block text-muted-foreground`,children:[e.problem,` `,e.fix]})]}),e.ready?(0,A.jsx)(Kb,{size:15,className:`mt-0.5 text-success`}):(0,A.jsx)(qb,{size:15,className:`mt-0.5 text-warning`})]},e.provider))})]})})}function bS(){let[e,t]=(0,_.useState)(null),n=(0,_.useRef)(null);return(0,_.useEffect)(()=>()=>{n.current&&clearTimeout(n.current)},[]),[e,(0,_.useCallback)(e=>{t(e),n.current&&clearTimeout(n.current),n.current=setTimeout(()=>t(null),6e3)},[])]}function xS({text:e}){return e?(0,A.jsx)(`div`,{role:`status`,className:`cs-toast`,children:e}):null}var SS=300,CS=220,wS=560;function TS(e){return Math.round(Math.min(wS,Math.max(CS,e)))}function ES(){let[e,t]=(0,_.useState)(()=>{try{let e=Number(localStorage.getItem(`coding-sessions.sidebar-width`));return Number.isFinite(e)&&e>0?TS(e):SS}catch{return SS}}),[n,r]=(0,_.useState)(()=>{try{return localStorage.getItem(`coding-sessions.sidebar-collapsed`)===`1`}catch{return!1}});return{width:e,setWidth:(0,_.useCallback)(e=>{let n=TS(e);t(n);try{localStorage.setItem(`coding-sessions.sidebar-width`,String(n))}catch{}},[]),collapsed:n,setCollapsed:(0,_.useCallback)(e=>{r(e);try{localStorage.setItem(`coding-sessions.sidebar-collapsed`,e?`1`:`0`)}catch{}},[])}}function DS(e){let[t,n]=(0,_.useState)(!1);return(0,A.jsx)(`div`,{className:K(`cs-resizer`,t&&`cs-resizer--dragging`),children:(0,A.jsx)(`button`,{type:`button`,className:`cs-resizer__grip`,role:`separator`,"aria-orientation":`vertical`,"aria-label":`Resize the sidebar`,"aria-valuenow":e.width,"aria-valuemin":CS,"aria-valuemax":wS,title:`Drag to resize · double-click to reset`,onDoubleClick:()=>e.setWidth(SS),onKeyDown:t=>{t.key===`ArrowLeft`&&e.setWidth(e.width-16),t.key===`ArrowRight`&&e.setWidth(e.width+16)},onPointerDown:t=>{t.preventDefault();let r=t.clientX,i=e.width;n(!0),document.body.style.cursor=`col-resize`,document.body.style.userSelect=`none`;let a=t=>e.setWidth(i+t.clientX-r),o=()=>{n(!1),document.body.style.cursor=``,document.body.style.userSelect=``,window.removeEventListener(`pointermove`,a),window.removeEventListener(`pointerup`,o)};window.addEventListener(`pointermove`,a),window.addEventListener(`pointerup`,o)}})})}var OS=[{keys:`⌘K`,what:`Search chats`},{keys:`⌥⌘N`,what:`New session`},{keys:`Enter`,what:`Send (Shift+Enter for a new line)`},{keys:`Esc`,what:`Stop the run in the open chat`},{keys:`⌘B`,what:`Show or hide the sidebar`},{keys:`⌥↑ / ⌥↓`,what:`Previous or next chat in the list`},{keys:`⌘/`,what:`These shortcuts`}];function kS(e){return(0,A.jsx)(B_,{open:e.open,onOpenChange:e.onOpenChange,children:(0,A.jsxs)($_,{className:`max-w-[420px]`,children:[(0,A.jsxs)(ev,{children:[(0,A.jsx)(nv,{children:`Keyboard shortcuts`}),(0,A.jsx)(rv,{children:`Ctrl works in place of ⌘ on Windows and Linux.`})]}),(0,A.jsx)(`dl`,{className:`divide-y divide-border text-[13px]`,children:OS.map(e=>(0,A.jsxs)(`div`,{className:`flex items-center justify-between gap-4 py-2`,children:[(0,A.jsx)(`dt`,{className:`text-muted-foreground`,children:e.what}),(0,A.jsx)(`dd`,{children:(0,A.jsx)(`kbd`,{className:`rounded border border-border px-1.5 py-0.5 font-sans text-[12px]`,children:e.keys})})]},e.keys))})]})})}var AS=`Coding sessions`;function jS(e,t){let n=Ib(),r=(0,_.useRef)(0),i=(0,_.useRef)(e);i.current=e,(0,_.useEffect)(()=>{let e=()=>{document.visibilityState===`visible`&&(r.current=0,document.title=AS)};document.addEventListener(`visibilitychange`,e);let a=n.onRunFinished(({run:e,session:n})=>{let a=n?.title??`A session`,o=e.status===`completed`?`finished`:e.status===`failed`?`failed`:`was stopped`,s=`${cb[e.provider]} ${o}: ${a}`;if(document.visibilityState===`hidden`){if(r.current+=1,document.title=`(${r.current}) ${AS}`,typeof Notification<`u`&&Notification.permission===`granted`){let t=new Notification(s,e.error?{tag:e.runId,body:e.error}:{tag:e.runId});t.onclick=()=>{window.focus(),location.hash=`#s/${e.sessionId}`,t.close()}}}else i.current!==e.sessionId&&e.status!==`stopped`&&t(s)});return()=>{a(),document.removeEventListener(`visibilitychange`,e)}},[n,t])}function MS(){let e=typeof Notification<`u`,[t,n]=(0,_.useState)(e?Notification.permission:`denied`);return!e||t===`granted`?null:(0,A.jsx)(`button`,{type:`button`,className:`cs-icon-button`,onClick:()=>void Notification.requestPermission().then(n),"aria-label":t===`denied`?`Notifications are blocked for this page in your browser's site settings`:`Notify me when a run finishes`,title:t===`denied`?`Notifications are blocked in your browser's site settings`:`Notify me when a run finishes`,disabled:t===`denied`,children:(0,A.jsx)(px,{size:14})})}function NS(e){let t=e;return t?t.isContentEditable||t.tagName===`INPUT`||t.tagName===`TEXTAREA`||t.tagName===`SELECT`:!1}function PS(){let e=Ib(),t=Lb(),[n,r]=(0,_.useState)($x),[i,a]=(0,_.useState)(!1),[o,s]=(0,_.useState)(!1),[c,l]=(0,_.useState)(!1),[u,d]=(0,_.useState)({}),[f,p]=nS(),[m,h]=bS(),g=ES(),v=(0,_.useRef)(null),y=(0,_.useCallback)(e=>{r(e),eS(e)},[]);(0,_.useEffect)(()=>{let e=()=>r($x());return window.addEventListener(`hashchange`,e),()=>window.removeEventListener(`hashchange`,e)},[]),jS(n.kind===`session`?n.id:null,h);let b=n.kind===`session`?t.sessions.data.find(e=>e.id===n.id)??null:null,x=n.kind===`discovered`?t.discovered.data.find(e=>e.providerSessionId===n.id)??u[`${n.provider}:${n.id}`]??null:null,S=b?t.runs[b.id]:void 0,C=S!==void 0&&!db(S.status),w=(0,_.useMemo)(()=>{let e=new Set(t.sessions.data.map(e=>e.providerSessionId).filter(Boolean));return[...t.sessions.data.map(e=>({kind:`session`,id:e.id})),...t.discovered.data.filter(t=>!e.has(t.providerSessionId)).map(e=>({kind:`discovered`,provider:e.provider,id:e.providerSessionId}))]},[t.sessions.data,t.discovered.data]);(0,_.useEffect)(()=>{let t=t=>{let r=t.metaKey||t.ctrlKey,i=t.key.toLowerCase();if(r&&!t.shiftKey&&!t.altKey&&i===`k`){t.preventDefault(),g.setCollapsed(!1),requestAnimationFrame(()=>{v.current?.focus(),v.current?.select()});return}if(r&&t.altKey&&(i===`n`||t.code===`KeyN`)||r&&t.shiftKey&&i===`o`){t.preventDefault(),a(!0);return}if(r&&!t.shiftKey&&!t.altKey&&i===`b`){t.preventDefault(),g.setCollapsed(!g.collapsed);return}if(r&&i===`/`){t.preventDefault(),s(!0);return}if(t.altKey&&!r&&(t.key===`ArrowUp`||t.key===`ArrowDown`)){let e=w.findIndex(e=>(e.kind===`session`&&n.kind===`session`||e.kind===`discovered`&&n.kind===`discovered`)&&e.id===n.id),r=w[t.key===`ArrowUp`?Math.max(0,e-1):Math.min(w.length-1,e+1)];r&&(t.preventDefault(),y(r));return}if(t.key===`Escape`&&C&&S&&!t.defaultPrevented){if(document.querySelector(`[role="dialog"], [role="menu"], [data-radix-popper-content-wrapper]`)||t.target===v.current)return;t.preventDefault(),e.stop(S.runId),h(`Stopping…`);return}t.key===`?`&&!NS(t.target)&&s(!0)};return window.addEventListener(`keydown`,t),()=>window.removeEventListener(`keydown`,t)},[e,g,C,S,w,n,y,h]);let T;return T=n.kind===`session`?b?(0,A.jsx)(pS,{session:b,changesOpen:c,setChangesOpen:l},b.id):t.sessions.loadedAt===null?(0,A.jsxs)(`div`,{className:`flex flex-1 items-center justify-center gap-2 text-[13px] text-muted-foreground`,children:[(0,A.jsx)(ex,{size:15}),` Loading…`]}):(0,A.jsx)(`div`,{className:`flex flex-1 items-center justify-center text-[13px] text-muted-foreground`,children:`That session is not in the list anymore.`}):n.kind===`discovered`?(0,A.jsx)(hS,{session:x,provider:n.provider,id:n.id,onTakenOver:e=>y({kind:`session`,id:e}),changesOpen:c,setChangesOpen:l},`${n.provider}:${n.id}`):(0,A.jsx)(yS,{onNew:()=>a(!0)}),(0,A.jsx)(mx.Provider,{value:h,children:(0,A.jsxs)(`div`,{className:`cs-app flex h-full flex-col bg-background text-foreground`,children:[(0,A.jsx)(aS,{}),(0,A.jsxs)(`div`,{className:`flex min-h-0 flex-1`,children:[g.collapsed?(0,A.jsxs)(`div`,{className:`flex flex-col items-center gap-1 border-r border-border bg-muted/30 px-1.5 py-3`,children:[(0,A.jsx)(`button`,{type:`button`,className:`cs-icon-button`,onClick:()=>g.setCollapsed(!1),"aria-label":`Show the sidebar (⌘B)`,title:`Show sidebar ⌘B`,children:(0,A.jsx)(cx,{size:15})}),(0,A.jsx)(`button`,{type:`button`,className:`cs-icon-button`,onClick:()=>a(!0),"aria-label":`New session`,title:`New session ⌥⌘N`,children:(0,A.jsx)(Ub,{size:15})})]}):(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(Bx,{selection:n,select:y,onNew:()=>a(!0),onCollapse:()=>g.setCollapsed(!0),width:g.width,searchRef:v,onFound:e=>d(t=>({...t,[`${e.provider}:${e.providerSessionId}`]:e})),footer:(0,A.jsx)(oS,{theme:f,setTheme:p,extra:(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(MS,{}),(0,A.jsx)(`button`,{type:`button`,className:`cs-icon-button`,onClick:()=>s(!0),"aria-label":`Keyboard shortcuts (⌘/)`,title:`Keyboard shortcuts ⌘/`,children:(0,A.jsx)(fx,{size:14})})]})})}),(0,A.jsx)(DS,{width:g.width,setWidth:g.setWidth})]}),(0,A.jsx)(`main`,{className:`flex min-w-0 flex-1`,children:T})]}),(0,A.jsx)(vS,{open:i,onOpenChange:a,onStarted:e=>{a(!1),y({kind:`session`,id:e})}}),(0,A.jsx)(kS,{open:o,onOpenChange:s}),(0,A.jsx)(xS,{text:m})]})})}function FS({transport:e}){return(0,A.jsx)(Qx,{transport:e,children:(0,A.jsx)(PS,{})})}var IS=`coding-sessions.token`;function LS(){let e=new URL(location.href),t=e.searchParams.get(`token`);if(t){try{sessionStorage.setItem(IS,t)}catch{}return e.searchParams.delete(`token`),history.replaceState(null,``,`${e.pathname}${e.search}${e.hash}`),t}try{return sessionStorage.getItem(IS)}catch{return null}}var RS=(0,v.createRoot)(document.getElementById(`root`)),zS=LS();if(!zS)RS.render((0,A.jsx)(`div`,{className:`flex h-full items-center justify-center p-8`,children:(0,A.jsxs)(`div`,{className:`max-w-[440px] text-center`,children:[(0,A.jsx)(`h1`,{className:`text-[18px] font-semibold`,children:`This link is missing its access code`}),(0,A.jsx)(`p`,{className:`mt-2 text-[13.5px] leading-6 text-muted-foreground`,children:`Open the coding sessions page from the full link AI Matrx gave you — it ends in a long access code that keeps other websites from reaching your coding agents.`})]})}));else{let e=y({token:zS});RS.render((0,A.jsx)(_.StrictMode,{children:(0,A.jsx)(FS,{transport:e})}))}