om-memory-system 4.22.0 → 4.24.0-next.147

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.
@@ -0,0 +1,127 @@
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.iterator;function m(e){return typeof e!=`object`||!e?null:(e=p&&e[p]||e[`@@iterator`],typeof e==`function`?e:null)}var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,_={};function v(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}v.prototype.isReactComponent={},v.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function y(){}y.prototype=v.prototype;function b(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}var x=b.prototype=new y;x.constructor=b,g(x,v.prototype),x.isPureReactComponent=!0;var S=Array.isArray;function C(){}var w={H:null,A:null,T:null,S:null},T=Object.prototype.hasOwnProperty;function E(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function D(e,t){return E(e.type,t,e.props)}function O(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function ee(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var te=/\/+/g;function k(e,t){return typeof e==`object`&&e&&e.key!=null?ee(``+e.key):t.toString(36)}function ne(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(C,C):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function re(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,re(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+k(e,0):a,S(o)?(i=``,c!=null&&(i=c.replace(te,`$&/`)+`/`),re(o,r,i,``,function(e){return e})):o!=null&&(O(o)&&(o=D(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(te,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(S(e))for(var u=0;u<e.length;u++)a=e[u],s=l+k(a,u),c+=re(a,r,i,s,o);else if(u=m(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+k(a,u++),c+=re(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return re(ne(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 ie(e,t,n){if(e==null)return e;var r=[],i=0;return re(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function ae(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t)},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var A=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)},j={map:ie,forEach:function(e,t,n){ie(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return ie(e,function(){t++}),t},toArray:function(e){return ie(e,function(e){return e})||[]},only:function(e){if(!O(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=j,e.Component=v,e.Fragment=r,e.Profiler=a,e.PureComponent=b,e.StrictMode=i,e.Suspense=l,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=w,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return w.H.useMemoCache(e)}},e.cache=function(e){return function(){return e.apply(null,arguments)}},e.cacheSignal=function(){return null},e.cloneElement=function(e,t,n){if(e==null)throw Error(`The argument must be a React element, but you passed `+e+`.`);var r=g({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!T.call(t,a)||a===`key`||a===`__self`||a===`__source`||a===`ref`&&t.ref===void 0||(r[a]=t[a]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];r.children=o}return E(e.type,i,r)},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:o,_context:e},e},e.createElement=function(e,t,n){var r,i={},a=null;if(t!=null)for(r in t.key!==void 0&&(a=``+t.key),t)T.call(t,r)&&r!==`key`&&r!==`__self`&&r!==`__source`&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var s=Array(o),c=0;c<o;c++)s[c]=arguments[c+2];i.children=s}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return E(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=O,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:ae}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=function(e){var t=w.T,n={};w.T=n;try{var r=e(),i=w.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(C,A)}catch(e){A(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),w.T=t}},e.unstable_useCacheRefresh=function(){return w.H.useCacheRefresh()},e.use=function(e){return w.H.use(e)},e.useActionState=function(e,t,n){return w.H.useActionState(e,t,n)},e.useCallback=function(e,t){return w.H.useCallback(e,t)},e.useContext=function(e){return w.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return w.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return w.H.useEffect(e,t)},e.useEffectEvent=function(e){return w.H.useEffectEvent(e)},e.useId=function(){return w.H.useId()},e.useImperativeHandle=function(e,t,n){return w.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return w.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return w.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return w.H.useMemo(e,t)},e.useOptimistic=function(e,t){return w.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return w.H.useReducer(e,t,n)},e.useRef=function(e){return w.H.useRef(e)},e.useState=function(e){return w.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return w.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return w.H.useTransition()},e.version=`19.2.8`})),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&&k(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&&k(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}}}finally{i?O():S=!1}}}var O;if(typeof y==`function`)O=function(){y(D)};else if(typeof MessageChannel<`u`){var ee=new MessageChannel,te=ee.port2;ee.port1.onmessage=D,O=function(){te.postMessage(null)}}else O=function(){_(D,0)};function k(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,k(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,O()))),r},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),f=o(((e,t)=>{t.exports=d()})),p=o((e=>{var t=u();function n(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function r(){}var i={d:{f:r,r:function(){throw Error(n(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},a=Symbol.for(`react.portal`);function o(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:r==null?null:``+r,children:e,containerInfo:t,implementation:n}}var s=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function c(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,e.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(n(299));return o(e,t,null,r)},e.flushSync=function(e){var t=s.T,n=i.p;try{if(s.T=null,i.p=2,e)return e()}finally{s.T=t,i.p=n,i.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,i.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&i.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=c(n,t.crossOrigin),a=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?i.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:a,fetchPriority:o}):n===`script`&&i.d.X(e,{crossOrigin:r,integrity:a,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`){if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=c(t.as,t.crossOrigin);i.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0})}}else t??i.d.M(e)}},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=c(n,t.crossOrigin);i.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`){if(t){var n=c(t.as,t.crossOrigin);i.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0})}else i.d.m(e)}},e.requestFormReset=function(e){i.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return s.H.useFormState(e,t,n)},e.useFormStatus=function(){return s.H.useHostTransitionStatus()},e.version=`19.2.8`})),m=o(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=p()})),h=o((e=>{var t=f(),n=u(),r=m();function i(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function a(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function o(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function s(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function c(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function l(e){if(o(e)!==e)throw Error(i(188))}function d(e){var t=e.alternate;if(!t){if(t=o(e),t===null)throw Error(i(188));return t===e?e:null}for(var n=e,r=t;;){var a=n.return;if(a===null)break;var s=a.alternate;if(s===null){if(r=a.return,r!==null){n=r;continue}break}if(a.child===s.child){for(s=a.child;s;){if(s===n)return l(a),e;if(s===r)return l(a),t;s=s.sibling}throw Error(i(188))}if(n.return!==r.return)n=a,r=s;else{for(var c=!1,u=a.child;u;){if(u===n){c=!0,n=a,r=s;break}if(u===r){c=!0,r=a,n=s;break}u=u.sibling}if(!c){for(u=s.child;u;){if(u===n){c=!0,n=s,r=a;break}if(u===r){c=!0,r=s,n=a;break}u=u.sibling}if(!c)throw Error(i(189))}}if(n.alternate!==r)throw Error(i(190))}if(n.tag!==3)throw Error(i(188));return n.stateNode.current===n?e:t}function p(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=p(e),t!==null)return t;e=e.sibling}return null}var h=Object.assign,g=Symbol.for(`react.element`),_=Symbol.for(`react.transitional.element`),v=Symbol.for(`react.portal`),y=Symbol.for(`react.fragment`),b=Symbol.for(`react.strict_mode`),x=Symbol.for(`react.profiler`),S=Symbol.for(`react.consumer`),C=Symbol.for(`react.context`),w=Symbol.for(`react.forward_ref`),T=Symbol.for(`react.suspense`),E=Symbol.for(`react.suspense_list`),D=Symbol.for(`react.memo`),O=Symbol.for(`react.lazy`),ee=Symbol.for(`react.activity`),te=Symbol.for(`react.memo_cache_sentinel`),k=Symbol.iterator;function ne(e){return typeof e!=`object`||!e?null:(e=k&&e[k]||e[`@@iterator`],typeof e==`function`?e:null)}var re=Symbol.for(`react.client.reference`);function ie(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===re?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case y:return`Fragment`;case x:return`Profiler`;case b:return`StrictMode`;case T:return`Suspense`;case E:return`SuspenseList`;case ee:return`Activity`}if(typeof e==`object`)switch(e.$$typeof){case v:return`Portal`;case C:return e.displayName||`Context`;case S:return(e._context.displayName||`Context`)+`.Consumer`;case w:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case D:return t=e.displayName||null,t===null?ie(e.type)||`Memo`:t;case O:t=e._payload,e=e._init;try{return ie(e(t))}catch{}}return null}var ae=Array.isArray,A=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,j=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,oe={pending:!1,data:null,method:null,action:null},M=[],se=-1;function ce(e){return{current:e}}function N(e){0>se||(e.current=M[se],M[se]=null,se--)}function P(e,t){se++,M[se]=e.current,e.current=t}var le=ce(null),ue=ce(null),de=ce(null),fe=ce(null);function pe(e,t){switch(P(de,t),P(ue,e),P(le,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Wd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Wd(t),e=Gd(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}N(le),P(le,e)}function F(){N(le),N(ue),N(de)}function me(e){e.memoizedState!==null&&P(fe,e);var t=le.current,n=Gd(t,e.type);t!==n&&(P(ue,e),P(le,n))}function he(e){ue.current===e&&(N(le),N(ue)),fe.current===e&&(N(fe),ep._currentValue=oe)}var ge,_e;function ve(e){if(ge===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);ge=t&&t[1]||``,_e=-1<e.stack.indexOf(`
2
+ at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
3
+ `+ge+e+_e}var ye=!1;function be(e,t){if(!e||ye)return``;ye=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}e.call(n.prototype)}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(`
4
+ `),l=s.split(`
5
+ `);for(i=r=0;r<c.length&&!c[r].includes(`DetermineComponentFrameRoot`);)r++;for(;i<l.length&&!l[i].includes(`DetermineComponentFrameRoot`);)i++;if(r===c.length||i===l.length)for(r=c.length-1,i=l.length-1;1<=r&&0<=i&&c[r]!==l[i];)i--;for(;1<=r&&0<=i;r--,i--)if(c[r]!==l[i]){if(r!==1||i!==1)do if(r--,i--,0>i||c[r]!==l[i]){var u=`
6
+ `+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(`<anonymous>`)&&(u=u.replace(`<anonymous>`,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{ye=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?ve(n):``}function xe(e,t){switch(e.tag){case 26:case 27:case 5:return ve(e.type);case 16:return ve(`Lazy`);case 13:return e.child!==t&&t!==null?ve(`Suspense Fallback`):ve(`Suspense`);case 19:return ve(`SuspenseList`);case 0:case 15:return be(e.type,!1);case 11:return be(e.type.render,!1);case 1:return be(e.type,!0);case 31:return ve(`Activity`);default:return``}}function Se(e){try{var t=``,n=null;do t+=xe(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
7
+ Error generating stack: `+e.message+`
8
+ `+e.stack}}var Ce=Object.prototype.hasOwnProperty,we=t.unstable_scheduleCallback,Te=t.unstable_cancelCallback,Ee=t.unstable_shouldYield,De=t.unstable_requestPaint,Oe=t.unstable_now,ke=t.unstable_getCurrentPriorityLevel,Ae=t.unstable_ImmediatePriority,je=t.unstable_UserBlockingPriority,Me=t.unstable_NormalPriority,Ne=t.unstable_LowPriority,Pe=t.unstable_IdlePriority,Fe=t.log,Ie=t.unstable_setDisableYieldValue,Le=null,Re=null;function ze(e){if(typeof Fe==`function`&&Ie(e),Re&&typeof Re.setStrictMode==`function`)try{Re.setStrictMode(Le,e)}catch{}}var Be=Math.clz32?Math.clz32:Ue,Ve=Math.log,He=Math.LN2;function Ue(e){return e>>>=0,e===0?32:31-(Ve(e)/He|0)|0}var We=256,Ge=262144,Ke=4194304;function qe(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Je(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=qe(n))):i=qe(o):i=qe(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=qe(n))):i=qe(o)):i=qe(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 Ye(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Xe(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 Ze(){var e=Ke;return Ke<<=1,!(Ke&62914560)&&(Ke=4194304),e}function Qe(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function $e(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function et(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-Be(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&&tt(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function tt(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-Be(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function nt(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Be(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function rt(e,t){var n=t&-t;return n=n&42?1:it(n),(n&(e.suspendedLanes|t))===0?n:0}function it(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 at(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function ot(){var e=j.p;return e===0?(e=window.event,e===void 0?32:gp(e.type)):e}function st(e,t){var n=j.p;try{return j.p=e,t()}finally{j.p=n}}var ct=Math.random().toString(36).slice(2),lt=`__reactFiber$`+ct,ut=`__reactProps$`+ct,dt=`__reactContainer$`+ct,ft=`__reactEvents$`+ct,pt=`__reactListeners$`+ct,mt=`__reactHandles$`+ct,ht=`__reactResources$`+ct,gt=`__reactMarker$`+ct;function _t(e){delete e[lt],delete e[ut],delete e[ft],delete e[pt],delete e[mt]}function vt(e){var t=e[lt];if(t)return t;for(var n=e.parentNode;n;){if(t=n[dt]||n[lt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=mf(e);e!==null;){if(n=e[lt])return n;e=mf(e)}return t}e=n,n=e.parentNode}return null}function yt(e){if(e=e[lt]||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 bt(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function xt(e){var t=e[ht];return t||=e[ht]={hoistableStyles:new Map,hoistableScripts:new Map},t}function I(e){e[gt]=!0}var St=new Set,Ct={};function wt(e,t){Tt(e,t),Tt(e+`Capture`,t)}function Tt(e,t){for(Ct[e]=t,e=0;e<t.length;e++)St.add(t[e])}var Et=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]*$`),Dt={},Ot={};function kt(e){return Ce.call(Ot,e)?!0:Ce.call(Dt,e)?!1:Et.test(e)?Ot[e]=!0:(Dt[e]=!0,!1)}function At(e,t,n){if(kt(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 L(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 jt(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 Mt(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function Nt(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function Pt(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 Ft(e){if(!e._valueTracker){var t=Nt(e)?`checked`:`value`;e._valueTracker=Pt(e,t,``+e[t])}}function It(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=Nt(e)?e.checked?`true`:`false`:e.value),e=r,e!==n&&(t.setValue(e),!0)}function Lt(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}var Rt=/[\n"\\]/g;function zt(e){return e.replace(Rt,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function Bt(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=``+Mt(t)):e.value!==``+Mt(t)&&(e.value=``+Mt(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):R(e,o,Mt(n)):R(e,o,Mt(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=``+Mt(s):e.removeAttribute(`name`)}function Vt(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)){Ft(e);return}n=n==null?``:``+Mt(n),t=t==null?n:``+Mt(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),Ft(e)}function R(e,t,n){t===`number`&&Lt(e.ownerDocument)===e||e.defaultValue===``+n||(e.defaultValue=``+n)}function Ht(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=``+Mt(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 Ut(e,t,n){if(t!=null&&(t=``+Mt(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n==null?``:``+Mt(n)}function Wt(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(ae(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n??=``,t=n}n=Mt(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),Ft(e)}function Gt(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Kt=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 qt(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||Kt.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function Jt(e,t,n){if(t!=null&&typeof t!=`object`)throw Error(i(62));if(e=e.style,n!=null){for(var r in n)!n.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf(`--`)===0?e.setProperty(r,``):r===`float`?e.cssFloat=``:e[r]=``);for(var a in t)r=t[a],t.hasOwnProperty(a)&&n[a]!==r&&qt(e,a,r)}else for(var o in t)t.hasOwnProperty(o)&&qt(e,o,t[o])}function z(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 Yt=new Map([[`acceptCharset`,`accept-charset`],[`htmlFor`,`for`],[`httpEquiv`,`http-equiv`],[`crossOrigin`,`crossorigin`],[`accentHeight`,`accent-height`],[`alignmentBaseline`,`alignment-baseline`],[`arabicForm`,`arabic-form`],[`baselineShift`,`baseline-shift`],[`capHeight`,`cap-height`],[`clipPath`,`clip-path`],[`clipRule`,`clip-rule`],[`colorInterpolation`,`color-interpolation`],[`colorInterpolationFilters`,`color-interpolation-filters`],[`colorProfile`,`color-profile`],[`colorRendering`,`color-rendering`],[`dominantBaseline`,`dominant-baseline`],[`enableBackground`,`enable-background`],[`fillOpacity`,`fill-opacity`],[`fillRule`,`fill-rule`],[`floodColor`,`flood-color`],[`floodOpacity`,`flood-opacity`],[`fontFamily`,`font-family`],[`fontSize`,`font-size`],[`fontSizeAdjust`,`font-size-adjust`],[`fontStretch`,`font-stretch`],[`fontStyle`,`font-style`],[`fontVariant`,`font-variant`],[`fontWeight`,`font-weight`],[`glyphName`,`glyph-name`],[`glyphOrientationHorizontal`,`glyph-orientation-horizontal`],[`glyphOrientationVertical`,`glyph-orientation-vertical`],[`horizAdvX`,`horiz-adv-x`],[`horizOriginX`,`horiz-origin-x`],[`imageRendering`,`image-rendering`],[`letterSpacing`,`letter-spacing`],[`lightingColor`,`lighting-color`],[`markerEnd`,`marker-end`],[`markerMid`,`marker-mid`],[`markerStart`,`marker-start`],[`overlinePosition`,`overline-position`],[`overlineThickness`,`overline-thickness`],[`paintOrder`,`paint-order`],[`panose-1`,`panose-1`],[`pointerEvents`,`pointer-events`],[`renderingIntent`,`rendering-intent`],[`shapeRendering`,`shape-rendering`],[`stopColor`,`stop-color`],[`stopOpacity`,`stop-opacity`],[`strikethroughPosition`,`strikethrough-position`],[`strikethroughThickness`,`strikethrough-thickness`],[`strokeDasharray`,`stroke-dasharray`],[`strokeDashoffset`,`stroke-dashoffset`],[`strokeLinecap`,`stroke-linecap`],[`strokeLinejoin`,`stroke-linejoin`],[`strokeMiterlimit`,`stroke-miterlimit`],[`strokeOpacity`,`stroke-opacity`],[`strokeWidth`,`stroke-width`],[`textAnchor`,`text-anchor`],[`textDecoration`,`text-decoration`],[`textRendering`,`text-rendering`],[`transformOrigin`,`transform-origin`],[`underlinePosition`,`underline-position`],[`underlineThickness`,`underline-thickness`],[`unicodeBidi`,`unicode-bidi`],[`unicodeRange`,`unicode-range`],[`unitsPerEm`,`units-per-em`],[`vAlphabetic`,`v-alphabetic`],[`vHanging`,`v-hanging`],[`vIdeographic`,`v-ideographic`],[`vMathematical`,`v-mathematical`],[`vectorEffect`,`vector-effect`],[`vertAdvY`,`vert-adv-y`],[`vertOriginX`,`vert-origin-x`],[`vertOriginY`,`vert-origin-y`],[`wordSpacing`,`word-spacing`],[`writingMode`,`writing-mode`],[`xmlnsXlink`,`xmlns:xlink`],[`xHeight`,`x-height`]]),Xt=/^[\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 Zt(e){return Xt.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function Qt(){}var $t=null;function en(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var tn=null,nn=null;function rn(e){var t=yt(e);if(t&&(e=t.stateNode)){var n=e[ut]||null;a:switch(e=t.stateNode,t.type){case`input`:if(Bt(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="`+zt(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[ut]||null;if(!a)throw Error(i(90));Bt(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&&It(r)}break a;case`textarea`:Ut(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&Ht(e,!!n.multiple,t,!1)}}}var an=!1;function on(e,t,n){if(an)return e(t,n);an=!0;try{return e(t)}finally{if(an=!1,(tn!==null||nn!==null)&&(xu(),tn&&(t=tn,e=nn,nn=tn=null,rn(t),e)))for(t=0;t<e.length;t++)rn(e[t])}}function sn(e,t){var n=e.stateNode;if(n===null)return null;var r=n[ut]||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 cn=!(typeof window>`u`||window.document===void 0||window.document.createElement===void 0),ln=!1;if(cn)try{var un={};Object.defineProperty(un,"passive",{get:function(){ln=!0}}),window.addEventListener(`test`,un,un),window.removeEventListener(`test`,un,un)}catch{ln=!1}var dn=null,fn=null,pn=null;function B(){if(pn)return pn;var e,t=fn,n=t.length,r,i=`value`in dn?dn.value:dn.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 pn=i.slice(e,1<r?1-r:void 0)}function mn(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 V(){return!0}function hn(){return!1}function gn(e){function t(t,n,r,i,a){for(var o in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=i,this.target=a,this.currentTarget=null,e)e.hasOwnProperty(o)&&(t=e[o],this[o]=t?t(i):i[o]);return this.isDefaultPrevented=(i.defaultPrevented==null?!1===i.returnValue:i.defaultPrevented)?V:hn,this.isPropagationStopped=hn,this}return h(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():typeof e.returnValue!=`unknown`&&(e.returnValue=!1),this.isDefaultPrevented=V)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=V)},persist:function(){},isPersistent:V}),t}var _n={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},vn=gn(_n),yn=h({},_n,{view:0,detail:0}),bn=gn(yn),xn,Sn,Cn,wn=h({},yn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Pn,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return`movementX`in e?e.movementX:(e!==Cn&&(Cn&&e.type===`mousemove`?(xn=e.screenX-Cn.screenX,Sn=e.screenY-Cn.screenY):Sn=xn=0,Cn=e),xn)},movementY:function(e){return`movementY`in e?e.movementY:Sn}}),Tn=gn(wn),En=gn(h({},wn,{dataTransfer:0})),Dn=gn(h({},yn,{relatedTarget:0})),On=gn(h({},_n,{animationName:0,elapsedTime:0,pseudoElement:0})),kn=gn(h({},_n,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),An=gn(h({},_n,{data:0})),jn={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},Mn={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`},Nn={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function H(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Nn[e])?!!t[e]:!1}function Pn(){return H}var Fn=gn(h({},yn,{key:function(e){if(e.key){var t=jn[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=mn(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?Mn[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Pn,charCode:function(e){return e.type===`keypress`?mn(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?mn(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),In=gn(h({},wn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),Ln=gn(h({},yn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Pn})),Rn=gn(h({},_n,{propertyName:0,elapsedTime:0,pseudoElement:0})),zn=gn(h({},wn,{deltaX:function(e){return`deltaX`in e?e.deltaX:`wheelDeltaX`in e?-e.wheelDeltaX:0},deltaY:function(e){return`deltaY`in e?e.deltaY:`wheelDeltaY`in e?-e.wheelDeltaY:`wheelDelta`in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0})),Bn=gn(h({},_n,{newState:0,oldState:0})),Vn=[9,13,27,32],Hn=cn&&`CompositionEvent`in window,Un=null;cn&&`documentMode`in document&&(Un=document.documentMode);var Wn=cn&&`TextEvent`in window&&!Un,Gn=cn&&(!Hn||Un&&8<Un&&11>=Un),Kn=` `,qn=!1;function Jn(e,t){switch(e){case`keyup`:return Vn.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function Yn(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var Xn=!1;function Zn(e,t){switch(e){case`compositionend`:return Yn(t);case`keypress`:return t.which===32?(qn=!0,Kn):null;case`textInput`:return e=t.data,e===Kn&&qn?null:e;default:return null}}function Qn(e,t){if(Xn)return e===`compositionend`||!Hn&&Jn(e,t)?(e=B(),pn=fn=dn=null,Xn=!1,e):null;switch(e){case`paste`:return null;case`keypress`:if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case`compositionend`:return Gn&&t.locale!==`ko`?null:t.data;default:return null}}var $n={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`?!!$n[e.type]:t===`textarea`}function tr(e,t,n,r){tn?nn?nn.push(r):nn=[r]:tn=r,t=Od(t,`onChange`),0<t.length&&(n=new vn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var nr=null,rr=null;function ir(e){xd(e,0)}function ar(e){if(It(bt(e)))return e}function or(e,t){if(e===`change`)return t}var sr=!1;if(cn){var cr;if(cn){var lr=`oninput`in document;if(!lr){var ur=document.createElement(`div`);ur.setAttribute(`oninput`,`return;`),lr=typeof ur.oninput==`function`}cr=lr}else cr=!1;sr=cr&&(!document.documentMode||9<document.documentMode)}function dr(){nr&&(nr.detachEvent(`onpropertychange`,fr),rr=nr=null)}function fr(e){if(e.propertyName===`value`&&ar(rr)){var t=[];tr(t,rr,e,en(e)),on(ir,t)}}function pr(e,t,n){e===`focusin`?(dr(),nr=t,rr=n,nr.attachEvent(`onpropertychange`,fr)):e===`focusout`&&dr()}function mr(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return ar(rr)}function hr(e,t){if(e===`click`)return ar(t)}function gr(e,t){if(e===`input`||e===`change`)return ar(t)}function _r(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var vr=typeof Object.is==`function`?Object.is:_r;function yr(e,t){if(vr(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(!Ce.call(t,i)||!vr(e[i],t[i]))return!1}return!0}function U(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function br(e,t){var n=U(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=U(n)}}function xr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?xr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Sr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Lt(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=Lt(e.document)}return t}function Cr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t===`input`&&(e.type===`text`||e.type===`search`||e.type===`tel`||e.type===`url`||e.type===`password`)||t===`textarea`||e.contentEditable===`true`)}var wr=cn&&`documentMode`in document&&11>=document.documentMode,Tr=null,Er=null,Dr=null,Or=!1;function kr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Or||Tr==null||Tr!==Lt(r)||(r=Tr,`selectionStart`in r&&Cr(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Dr&&yr(Dr,r)||(Dr=r,r=Od(Er,`onSelect`),0<r.length&&(t=new vn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=Tr)))}function Ar(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var jr={animationend:Ar(`Animation`,`AnimationEnd`),animationiteration:Ar(`Animation`,`AnimationIteration`),animationstart:Ar(`Animation`,`AnimationStart`),transitionrun:Ar(`Transition`,`TransitionRun`),transitionstart:Ar(`Transition`,`TransitionStart`),transitioncancel:Ar(`Transition`,`TransitionCancel`),transitionend:Ar(`Transition`,`TransitionEnd`)},Mr={},Nr={};cn&&(Nr=document.createElement(`div`).style,`AnimationEvent`in window||(delete jr.animationend.animation,delete jr.animationiteration.animation,delete jr.animationstart.animation),`TransitionEvent`in window||delete jr.transitionend.transition);function Pr(e){if(Mr[e])return Mr[e];if(!jr[e])return e;var t=jr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Nr)return Mr[e]=t[n];return e}var Fr=Pr(`animationend`),Ir=Pr(`animationiteration`),Lr=Pr(`animationstart`),Rr=Pr(`transitionrun`),zr=Pr(`transitionstart`),Br=Pr(`transitioncancel`),Vr=Pr(`transitionend`),Hr=new Map,Ur=`abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel`.split(` `);Ur.push(`scrollEnd`);function Wr(e,t){Hr.set(e,t),wt(t,[e])}var Gr=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},Kr=[],qr=0,Jr=0;function Yr(){for(var e=qr,t=Jr=qr=0;t<e;){var n=Kr[t];Kr[t++]=null;var r=Kr[t];Kr[t++]=null;var i=Kr[t];Kr[t++]=null;var a=Kr[t];if(Kr[t++]=null,r!==null&&i!==null){var o=r.pending;o===null?i.next=i:(i.next=o.next,o.next=i),r.pending=i}a!==0&&$r(n,i,a)}}function Xr(e,t,n,r){Kr[qr++]=e,Kr[qr++]=t,Kr[qr++]=n,Kr[qr++]=r,Jr|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function Zr(e,t,n,r){return Xr(e,t,n,r),ei(e)}function Qr(e,t){return Xr(e,null,null,t),ei(e)}function $r(e,t,n){e.lanes|=n;var r=e.alternate;r!==null&&(r.lanes|=n);for(var i=!1,a=e.return;a!==null;)a.childLanes|=n,r=a.alternate,r!==null&&(r.childLanes|=n),a.tag===22&&(e=a.stateNode,e===null||e._visibility&1||(i=!0)),e=a,a=a.return;return e.tag===3?(a=e.stateNode,i&&t!==null&&(i=31-Be(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function ei(e){if(50<fu)throw fu=0,pu=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var ti={};function ni(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ri(e,t,n,r){return new ni(e,t,n,r)}function W(e){return e=e.prototype,!(!e||!e.isReactComponent)}function ii(e,t){var n=e.alternate;return n===null?(n=ri(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&65011712,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function ai(e,t){e.flags&=65011714;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function oi(e,t,n,r,a,o){var s=0;if(r=e,typeof e==`function`)W(e)&&(s=1);else if(typeof e==`string`)s=Gf(e,n,le.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(e){case ee:return e=ri(31,n,t,a),e.elementType=ee,e.lanes=o,e;case y:return si(n.children,a,o,t);case b:s=8,a|=24;break;case x:return e=ri(12,n,t,a|2),e.elementType=x,e.lanes=o,e;case T:return e=ri(13,n,t,a),e.elementType=T,e.lanes=o,e;case E:return e=ri(19,n,t,a),e.elementType=E,e.lanes=o,e;default:if(typeof e==`object`&&e)switch(e.$$typeof){case C:s=10;break a;case S:s=9;break a;case w:s=11;break a;case D:s=14;break a;case O:s=16,r=null;break a}s=29,n=Error(i(130,e===null?`null`:typeof e,``)),r=null}return t=ri(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function si(e,t,n,r){return e=ri(7,e,r,t),e.lanes=n,e}function ci(e,t,n){return e=ri(6,e,null,t),e.lanes=n,e}function li(e){var t=ri(18,null,null,0);return t.stateNode=e,t}function ui(e,t,n){return t=ri(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var di=new WeakMap;function fi(e,t){if(typeof e==`object`&&e){var n=di.get(e);return n===void 0?(t={value:e,source:t,stack:Se(t)},di.set(e,t),t):n}return{value:e,source:t,stack:Se(t)}}var pi=[],mi=0,hi=null,gi=0,_i=[],vi=0,yi=null,bi=1,xi=``;function Si(e,t){pi[mi++]=gi,pi[mi++]=hi,hi=e,gi=t}function Ci(e,t,n){_i[vi++]=bi,_i[vi++]=xi,_i[vi++]=yi,yi=e;var r=bi;e=xi;var i=32-Be(r)-1;r&=~(1<<i),n+=1;var a=32-Be(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,bi=1<<32-Be(t)+i|n<<i|r,xi=a+e}else bi=1<<a|n<<i|r,xi=e}function wi(e){e.return!==null&&(Si(e,1),Ci(e,1,0))}function Ti(e){for(;e===hi;)hi=pi[--mi],pi[mi]=null,gi=pi[--mi],pi[mi]=null;for(;e===yi;)yi=_i[--vi],_i[vi]=null,xi=_i[--vi],_i[vi]=null,bi=_i[--vi],_i[vi]=null}function Ei(e,t){_i[vi++]=bi,_i[vi++]=xi,_i[vi++]=yi,bi=t.id,xi=t.overflow,yi=e}var Di=null,Oi=null,G=!1,ki=null,Ai=!1,ji=Error(i(519));function Mi(e){throw Ri(fi(Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),ji}function Ni(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[lt]=e,t[ut]=r,n){case`dialog`:X(`cancel`,t),X(`close`,t);break;case`iframe`:case`object`:case`embed`:X(`load`,t);break;case`video`:case`audio`:for(n=0;n<yd.length;n++)X(yd[n],t);break;case`source`:X(`error`,t);break;case`img`:case`image`:case`link`:X(`error`,t),X(`load`,t);break;case`details`:X(`toggle`,t);break;case`input`:X(`invalid`,t),Vt(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:X(`invalid`,t);break;case`textarea`:X(`invalid`,t),Wt(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||Pd(t.textContent,n)?(r.popover!=null&&(X(`beforetoggle`,t),X(`toggle`,t)),r.onScroll!=null&&X(`scroll`,t),r.onScrollEnd!=null&&X(`scrollend`,t),r.onClick!=null&&(t.onclick=Qt),t=!0):t=!1,t||Mi(e,!0)}function Pi(e){for(Di=e.return;Di;)switch(Di.tag){case 5:case 31:case 13:Ai=!1;return;case 27:case 3:Ai=!0;return;default:Di=Di.return}}function Fi(e){if(e!==Di)return!1;if(!G)return Pi(e),G=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=n===`form`||n===`button`||Kd(e.type,e.memoizedProps)),n=!n),n&&Oi&&Mi(e),Pi(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));Oi=pf(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));Oi=pf(e)}else t===27?(t=Oi,ef(e.type)?(e=ff,ff=null,Oi=e):Oi=t):Oi=Di?df(e.stateNode.nextSibling):null;return!0}function Ii(){Oi=Di=null,G=!1}function Li(){var e=ki;return e!==null&&($l===null?$l=e:$l.push.apply($l,e),ki=null),e}function Ri(e){ki===null?ki=[e]:ki.push(e)}var zi=ce(null),Bi=null,Vi=null;function Hi(e,t,n){P(zi,t._currentValue),t._currentValue=n}function Ui(e){e._currentValue=zi.current,N(zi)}function Wi(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 Gi(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),Wi(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),Wi(s,n,e),s=null}else s=a.child;if(s!==null)s.return=a;else for(s=a;s!==null;){if(s===e){s=null;break}if(a=s.sibling,a!==null){a.return=s.return,s=a;break}s=s.return}a=s}}function Ki(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;vr(a.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(a===fe.current){if(s=a.alternate,s===null)throw Error(i(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e===null?e=[ep]:e.push(ep))}a=a.return}e!==null&&Gi(t,e,n,r),t.flags|=262144}function qi(e){for(e=e.firstContext;e!==null;){if(!vr(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Ji(e){Bi=e,Vi=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Yi(e){return Zi(Bi,e)}function Xi(e,t){return Bi===null&&Ji(e),Zi(e,t)}function Zi(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},Vi===null){if(e===null)throw Error(i(308));Vi=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Vi=Vi.next=t;return n}var Qi=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()})}},$i=t.unstable_scheduleCallback,ea=t.unstable_NormalPriority,ta={$$typeof:C,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function na(){return{controller:new Qi,data:new Map,refCount:0}}function ra(e){e.refCount--,e.refCount===0&&$i(ea,function(){e.controller.abort()})}var ia=null,aa=0,oa=0,sa=null;function ca(e,t){if(ia===null){var n=ia=[];aa=0,oa=pd(),sa={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return aa++,t.then(la,la),t}function la(){if(--aa===0&&ia!==null){sa!==null&&(sa.status=`fulfilled`);var e=ia;ia=null,oa=0,sa=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function ua(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 da=A.S;A.S=function(e,t){nu=Oe(),typeof t==`object`&&t&&typeof t.then==`function`&&ca(e,t),da!==null&&da(e,t)};var fa=ce(null);function pa(){var e=fa.current;return e===null?zl.pooledCache:e}function ma(e,t){t===null?P(fa,fa.current):P(fa,t.pool)}function ha(){var e=pa();return e===null?null:{parent:ta._currentValue,pool:e}}var ga=Error(i(460)),_a=Error(i(474)),va=Error(i(542)),ya={then:function(){}};function ba(e){return e=e.status,e===`fulfilled`||e===`rejected`}function xa(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(Qt,Qt),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,Ta(e),e;default:if(typeof t.status==`string`)t.then(Qt,Qt);else{if(e=zl,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,Ta(e),e}throw Ca=t,ga}}function Sa(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(Ca=e,ga):e}}var Ca=null;function wa(){if(Ca===null)throw Error(i(459));var e=Ca;return Ca=null,e}function Ta(e){if(e===ga||e===va)throw Error(i(483))}var Ea=null,Da=0;function Oa(e){var t=Da;return Da+=1,Ea===null&&(Ea=[]),xa(Ea,e,t)}function ka(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function Aa(e,t){throw t.$$typeof===g?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function ja(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=ii(e,t),e.index=0,e.sibling=null,e}function o(t,n,r){return t.index=r,e?(r=t.alternate,r===null?(t.flags|=67108866,n):(r=r.index,r<n?(t.flags|=67108866,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=67108866),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=ci(n,e.mode,r),t.return=e,t):(t=a(t,n),t.return=e,t)}function l(e,t,n,r){var i=n.type;return i===y?d(e,t,n.props.children,r,n.key):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===O&&Sa(i)===t.type)?(t=a(t,n.props),ka(t,n),t.return=e,t):(t=oi(n.type,n.key,n.props,null,e.mode,r),ka(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=ui(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=si(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=ci(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case _:return n=oi(t.type,t.key,t.props,null,e.mode,n),ka(n,t),n.return=e,n;case v:return t=ui(t,e.mode,n),t.return=e,t;case O:return t=Sa(t),f(e,t,n)}if(ae(t)||ne(t))return t=si(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,Oa(t),n);if(t.$$typeof===C)return f(e,Xi(e,t),n);Aa(e,t)}return null}function p(e,t,n,r){var i=t===null?null:t.key;if(typeof n==`string`&&n!==``||typeof n==`number`||typeof n==`bigint`)return i===null?c(e,t,``+n,r):null;if(typeof n==`object`&&n){switch(n.$$typeof){case _:return n.key===i?l(e,t,n,r):null;case v:return n.key===i?u(e,t,n,r):null;case O:return n=Sa(n),p(e,t,n,r)}if(ae(n)||ne(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,Oa(n),r);if(n.$$typeof===C)return p(e,t,Xi(e,n),r);Aa(e,n)}return null}function m(e,t,n,r,i){if(typeof r==`string`&&r!==``||typeof r==`number`||typeof r==`bigint`)return e=e.get(n)||null,c(t,e,``+r,i);if(typeof r==`object`&&r){switch(r.$$typeof){case _:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case v:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case O:return r=Sa(r),m(e,t,n,r,i)}if(ae(r)||ne(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,Oa(r),i);if(r.$$typeof===C)return m(e,t,n,Xi(t,r),i);Aa(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),G&&Si(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 G&&Si(i,h),l}for(d=r(d);h<s.length;h++)g=m(d,i,h,s[h],c),g!==null&&(e&&g.alternate!==null&&d.delete(g.key===null?h:g.key),a=o(g,a,h),u===null?l=g:u.sibling=g,u=g);return e&&d.forEach(function(e){return t(i,e)}),G&&Si(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),G&&Si(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 G&&Si(a,g),u}for(h=r(h);!v.done;g++,v=c.next())v=m(h,a,g,v.value,l),v!==null&&(e&&v.alternate!==null&&h.delete(v.key===null?g:v.key),s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(a,e)}),G&&Si(a,g),u}function b(e,r,o,c){if(typeof o==`object`&&o&&o.type===y&&o.key===null&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case _:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===y){if(r.tag===7){n(e,r.sibling),c=a(r,o.props.children),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===O&&Sa(l)===r.type){n(e,r.sibling),c=a(r,o.props),ka(c,o),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}o.type===y?(c=si(o.props.children,e.mode,c,o.key),c.return=e,e=c):(c=oi(o.type,o.key,o.props,null,e.mode,c),ka(c,o),c.return=e,e=c)}return s(e);case v:a:{for(l=o.key;r!==null;){if(r.key===l){if(r.tag===4&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),c=a(r,o.children||[]),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}c=ui(o,e.mode,c),c.return=e,e=c}return s(e);case O:return o=Sa(o),b(e,r,o,c)}if(ae(o))return h(e,r,o,c);if(ne(o)){if(l=ne(o),typeof l!=`function`)throw Error(i(150));return o=l.call(o),g(e,r,o,c)}if(typeof o.then==`function`)return b(e,r,Oa(o),c);if(o.$$typeof===C)return b(e,r,Xi(e,o),c);Aa(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=ci(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{Da=0;var i=b(e,t,n,r);return Ea=null,i}catch(t){if(t===ga||t===va)throw t;var a=ri(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var Ma=ja(!0),Na=ja(!1),Pa=!1;function Fa(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Ia(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 La(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Ra(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Rl&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=ei(e),$r(e,null,n),t}return Xr(e,r,t,n),ei(e)}function za(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,nt(e,n)}}function Ba(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 Va=!1;function Ha(){if(Va){var e=sa;if(e!==null)throw e}}function Ua(e,t,n,r){Va=!1;var i=e.updateQueue;Pa=!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?(J&f)===f:(r&f)===f){f!==0&&f===oa&&(Va=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var m=e,g=s;f=t;var _=n;switch(g.tag){case 1:if(m=g.payload,typeof m==`function`){d=m.call(_,d,f);break a}d=m;break a;case 3:m.flags=m.flags&-65537|128;case 0:if(m=g.payload,f=typeof m==`function`?m.call(_,d,f):m,f==null)break a;d=h({},d,f);break a;case 2:Pa=!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),ql|=o,e.lanes=o,e.memoizedState=d}}function Wa(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function Ga(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)Wa(n[e],t)}var Ka=ce(null),qa=ce(0);function Ja(e,t){e=Gl,P(qa,e),P(Ka,t),Gl=e|t.baseLanes}function Ya(){P(qa,Gl),P(Ka,Ka.current)}function Xa(){Gl=qa.current,N(Ka),N(qa)}var Za=ce(null),Qa=null;function $a(e){var t=e.alternate;P(io,io.current&1),P(Za,e),Qa===null&&(t===null||Ka.current!==null||t.memoizedState!==null)&&(Qa=e)}function eo(e){P(io,io.current),P(Za,e),Qa===null&&(Qa=e)}function to(e){e.tag===22?(P(io,io.current),P(Za,e),Qa===null&&(Qa=e)):no(e)}function no(){P(io,io.current),P(Za,Za.current)}function ro(e){N(Za),Qa===e&&(Qa=null),N(io)}var io=ce(0);function ao(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||cf(n)||lf(n)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder===`forwards`||t.memoizedProps.revealOrder===`backwards`||t.memoizedProps.revealOrder===`unstable_legacy-backwards`||t.memoizedProps.revealOrder===`together`)){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var oo=0,K=null,so=null,co=null,lo=!1,uo=!1,fo=!1,po=0,mo=0,ho=null,go=0;function _o(){throw Error(i(321))}function vo(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!vr(e[n],t[n]))return!1;return!0}function yo(e,t,n,r,i,a){return oo=a,K=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,A.H=e===null||e.memoizedState===null?Is:Ls,fo=!1,a=n(r,i),fo=!1,uo&&(a=xo(t,n,r,i)),bo(e),a}function bo(e){A.H=Fs;var t=so!==null&&so.next!==null;if(oo=0,co=so=K=null,lo=!1,mo=0,ho=null,t)throw Error(i(300));e===null||ec||(e=e.dependencies,e!==null&&qi(e)&&(ec=!0))}function xo(e,t,n,r){K=e;var a=0;do{if(uo&&(ho=null),mo=0,uo=!1,25<=a)throw Error(i(301));if(a+=1,co=so=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}A.H=Rs,o=t(n,r)}while(uo);return o}function So(){var e=A.H,t=e.useState()[0];return t=typeof t.then==`function`?ko(t):t,e=e.useState()[0],(so===null?null:so.memoizedState)!==e&&(K.flags|=1024),t}function Co(){var e=po!==0;return po=0,e}function wo(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function To(e){if(lo){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}lo=!1}oo=0,co=so=K=null,uo=!1,mo=po=0,ho=null}function Eo(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return co===null?K.memoizedState=co=e:co=co.next=e,co}function Do(){if(so===null){var e=K.alternate;e=e===null?null:e.memoizedState}else e=so.next;var t=co===null?K.memoizedState:co.next;if(t!==null)co=t,so=e;else{if(e===null)throw K.alternate===null?Error(i(467)):Error(i(310));so=e,e={memoizedState:so.memoizedState,baseState:so.baseState,baseQueue:so.baseQueue,queue:so.queue,next:null},co===null?K.memoizedState=co=e:co=co.next=e}return co}function Oo(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function ko(e){var t=mo;return mo+=1,ho===null&&(ho=[]),e=xa(ho,e,t),t=K,(co===null?t.memoizedState:co.next)===null&&(t=t.alternate,A.H=t===null||t.memoizedState===null?Is:Ls),e}function Ao(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return ko(e);if(e.$$typeof===C)return Yi(e)}throw Error(i(438,String(e)))}function jo(e){var t=null,n=K.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=K.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(e){return e.slice()}),index:0})))}if(t??={data:[],index:0},n===null&&(n=Oo(),K.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]=te;return t.index++,n}function Mo(e,t){return typeof t==`function`?t(e):t}function No(e){return Po(Do(),so,e)}function Po(e,t,n){var r=e.queue;if(r===null)throw Error(i(311));r.lastRenderedReducer=n;var a=e.baseQueue,o=r.pending;if(o!==null){if(a!==null){var s=a.next;a.next=o.next,o.next=s}t.baseQueue=a=o,r.pending=null}if(o=e.baseState,a===null)e.memoizedState=o;else{t=a.next;var c=s=null,l=null,u=t,d=!1;do{var f=u.lane&-536870913;if(f===u.lane?(oo&f)===f:(J&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===oa&&(d=!0);else if((oo&p)===p){u=u.next,p===oa&&(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,K.lanes|=p,ql|=p;f=u.action,fo&&n(o,f),o=u.hasEagerState?u.eagerState:n(o,f)}else p={lane:f,revertLane:u.revertLane,gesture:u.gesture,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=p,s=o):l=l.next=p,K.lanes|=f,ql|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!vr(o,e.memoizedState)&&(ec=!0,d&&(n=sa,n!==null)))throw n;e.memoizedState=o,e.baseState=s,e.baseQueue=l,r.lastRenderedState=o}return a===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function Fo(e){var t=Do(),n=t.queue;if(n===null)throw Error(i(311));n.lastRenderedReducer=e;var r=n.dispatch,a=n.pending,o=t.memoizedState;if(a!==null){n.pending=null;var s=a=a.next;do o=e(o,s.action),s=s.next;while(s!==a);vr(o,t.memoizedState)||(ec=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function Io(e,t,n){var r=K,a=Do(),o=G;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!vr((so||a).memoizedState,n);if(s&&(a.memoizedState=n,ec=!0),a=a.queue,ss(zo.bind(null,r,a,e),[e]),a.getSnapshot!==t||s||co!==null&&co.memoizedState.tag&1){if(r.flags|=2048,ns(9,{destroy:void 0},Ro.bind(null,r,a,n,t),null),zl===null)throw Error(i(349));o||oo&127||Lo(r,t,n)}return n}function Lo(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=K.updateQueue,t===null?(t=Oo(),K.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Ro(e,t,n,r){t.value=n,t.getSnapshot=r,Bo(t)&&Vo(e)}function zo(e,t,n){return n(function(){Bo(t)&&Vo(e)})}function Bo(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!vr(e,n)}catch{return!0}}function Vo(e){var t=Qr(e,2);t!==null&&gu(t,e,2)}function Ho(e){var t=Eo();if(typeof e==`function`){var n=e;if(e=n(),fo){ze(!0);try{n()}finally{ze(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Mo,lastRenderedState:e},t}function Uo(e,t,n,r){return e.baseState=n,Po(e,so,typeof r==`function`?r:Mo)}function Wo(e,t,n,r,a){if(Ms(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)}};A.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,Go(t,o)):(o.next=n.next,t.pending=n.next=o)}}function Go(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=A.T,o={};A.T=o;try{var s=n(i,r),c=A.S;c!==null&&c(o,s),Ko(e,t,s)}catch(n){Jo(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),A.T=a}}else try{a=n(i,r),Ko(e,t,a)}catch(n){Jo(e,t,n)}}function Ko(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){qo(e,t,n)},function(n){return Jo(e,t,n)}):qo(e,t,n)}function qo(e,t,n){t.status=`fulfilled`,t.value=n,Yo(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Go(e,n)))}function Jo(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,Yo(t),t=t.next;while(t!==r)}e.action=null}function Yo(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Xo(e,t){return t}function Zo(e,t){if(G){var n=zl.formState;if(n!==null){a:{var r=K;if(G){if(Oi){b:{for(var i=Oi,a=Ai;i.nodeType!==8;){if(!a){i=null;break b}if(i=df(i.nextSibling),i===null){i=null;break b}}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){Oi=df(i.nextSibling),r=i.data===`F!`;break a}}Mi(r)}r=!1}r&&(t=n[0])}}return n=Eo(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Xo,lastRenderedState:t},n.queue=r,n=ks.bind(null,K,r),r.dispatch=n,r=Ho(!1),a=js.bind(null,K,!1,r.queue),r=Eo(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=Wo.bind(null,K,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function Qo(e){return $o(Do(),so,e)}function $o(e,t,n){if(t=Po(e,t,Xo)[0],e=No(Mo)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=ko(t)}catch(e){throw e===ga?va:e}else r=t;t=Do();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(K.flags|=2048,ns(9,{destroy:void 0},es.bind(null,i,n),null)),[r,a,e]}function es(e,t){e.action=t}function ts(e){var t=Do(),n=so;if(n!==null)return $o(t,n,e);Do(),t=t.memoizedState,n=Do();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function ns(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=K.updateQueue,t===null&&(t=Oo(),K.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 rs(){return Do().memoizedState}function is(e,t,n,r){var i=Eo();K.flags|=e,i.memoizedState=ns(1|t,{destroy:void 0},n,r===void 0?null:r)}function as(e,t,n,r){var i=Do();r=r===void 0?null:r;var a=i.memoizedState.inst;so!==null&&r!==null&&vo(r,so.memoizedState.deps)?i.memoizedState=ns(t,a,n,r):(K.flags|=e,i.memoizedState=ns(1|t,a,n,r))}function os(e,t){is(8390656,8,e,t)}function ss(e,t){as(2048,8,e,t)}function cs(e){K.flags|=4;var t=K.updateQueue;if(t===null)t=Oo(),K.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function ls(e){var t=Do().memoizedState;return cs({ref:t,nextImpl:e}),function(){if(Rl&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function us(e,t){return as(4,2,e,t)}function ds(e,t){return as(4,4,e,t)}function fs(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 ps(e,t,n){n=n==null?null:n.concat([e]),as(4,4,fs.bind(null,t,e),n)}function ms(){}function hs(e,t){var n=Do();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&vo(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function gs(e,t){var n=Do();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&vo(t,r[1]))return r[0];if(r=e(),fo){ze(!0);try{e()}finally{ze(!1)}}return n.memoizedState=[r,t],r}function _s(e,t,n){return n===void 0||oo&1073741824&&!(J&261930)?e.memoizedState=t:(e.memoizedState=n,e=hu(),K.lanes|=e,ql|=e,n)}function vs(e,t,n,r){return vr(n,t)?n:Ka.current===null?!(oo&42)||oo&1073741824&&!(J&261930)?(ec=!0,e.memoizedState=n):(e=hu(),K.lanes|=e,ql|=e,t):(e=_s(e,n,r),vr(e,t)||(ec=!0),e)}function ys(e,t,n,r,i){var a=j.p;j.p=a!==0&&8>a?a:8;var o=A.T,s={};A.T=s,js(e,!1,t,n);try{var c=i(),l=A.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?As(e,t,ua(c,r),mu(e)):As(e,t,r,mu(e))}catch(n){As(e,t,{then:function(){},status:`rejected`,reason:n},mu())}finally{j.p=a,o!==null&&s.types!==null&&(o.types=s.types),A.T=o}}function bs(){}function xs(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=Ss(e).queue;ys(e,a,t,oe,n===null?bs:function(){return Cs(e),n(r)})}function Ss(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:oe,baseState:oe,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Mo,lastRenderedState:oe},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Mo,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Cs(e){var t=Ss(e);t.next===null&&(t=e.alternate.memoizedState),As(e,t.next.queue,{},mu())}function ws(){return Yi(ep)}function Ts(){return Do().memoizedState}function Es(){return Do().memoizedState}function Ds(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=mu();e=La(n);var r=Ra(t,e,n);r!==null&&(gu(r,t,n),za(r,t,n)),t={cache:na()},e.payload=t;return}t=t.return}}function Os(e,t,n){var r=mu();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Ms(e)?Ns(t,n):(n=Zr(e,t,n,r),n!==null&&(gu(n,e,r),Ps(n,t,r)))}function ks(e,t,n){As(e,t,n,mu())}function As(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Ms(e))Ns(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,vr(s,o))return Xr(e,t,i,0),zl===null&&Yr(),!1}catch{}if(n=Zr(e,t,i,r),n!==null)return gu(n,e,r),Ps(n,t,r),!0}return!1}function js(e,t,n,r){if(r={lane:2,revertLane:pd(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Ms(e)){if(t)throw Error(i(479))}else t=Zr(e,n,r,2),t!==null&&gu(t,e,2)}function Ms(e){var t=e.alternate;return e===K||t!==null&&t===K}function Ns(e,t){uo=lo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Ps(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,nt(e,n)}}var Fs={readContext:Yi,use:Ao,useCallback:_o,useContext:_o,useEffect:_o,useImperativeHandle:_o,useLayoutEffect:_o,useInsertionEffect:_o,useMemo:_o,useReducer:_o,useRef:_o,useState:_o,useDebugValue:_o,useDeferredValue:_o,useTransition:_o,useSyncExternalStore:_o,useId:_o,useHostTransitionStatus:_o,useFormState:_o,useActionState:_o,useOptimistic:_o,useMemoCache:_o,useCacheRefresh:_o};Fs.useEffectEvent=_o;var Is={readContext:Yi,use:Ao,useCallback:function(e,t){return Eo().memoizedState=[e,t===void 0?null:t],e},useContext:Yi,useEffect:os,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),is(4194308,4,fs.bind(null,t,e),n)},useLayoutEffect:function(e,t){return is(4194308,4,e,t)},useInsertionEffect:function(e,t){is(4,2,e,t)},useMemo:function(e,t){var n=Eo();t=t===void 0?null:t;var r=e();if(fo){ze(!0);try{e()}finally{ze(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=Eo();if(n!==void 0){var i=n(t);if(fo){ze(!0);try{n(t)}finally{ze(!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=Os.bind(null,K,e),[r.memoizedState,e]},useRef:function(e){var t=Eo();return e={current:e},t.memoizedState=e},useState:function(e){e=Ho(e);var t=e.queue,n=ks.bind(null,K,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:ms,useDeferredValue:function(e,t){return _s(Eo(),e,t)},useTransition:function(){var e=Ho(!1);return e=ys.bind(null,K,e.queue,!0,!1),Eo().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=K,a=Eo();if(G){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),zl===null)throw Error(i(349));J&127||Lo(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,os(zo.bind(null,r,o,e),[e]),r.flags|=2048,ns(9,{destroy:void 0},Ro.bind(null,r,o,n,t),null),n},useId:function(){var e=Eo(),t=zl.identifierPrefix;if(G){var n=xi,r=bi;n=(r&~(1<<32-Be(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=po++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=go++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:ws,useFormState:Zo,useActionState:Zo,useOptimistic:function(e){var t=Eo();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=js.bind(null,K,!0,n),n.dispatch=t,[e,t]},useMemoCache:jo,useCacheRefresh:function(){return Eo().memoizedState=Ds.bind(null,K)},useEffectEvent:function(e){var t=Eo(),n={impl:e};return t.memoizedState=n,function(){if(Rl&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},Ls={readContext:Yi,use:Ao,useCallback:hs,useContext:Yi,useEffect:ss,useImperativeHandle:ps,useInsertionEffect:us,useLayoutEffect:ds,useMemo:gs,useReducer:No,useRef:rs,useState:function(){return No(Mo)},useDebugValue:ms,useDeferredValue:function(e,t){return vs(Do(),so.memoizedState,e,t)},useTransition:function(){var e=No(Mo)[0],t=Do().memoizedState;return[typeof e==`boolean`?e:ko(e),t]},useSyncExternalStore:Io,useId:Ts,useHostTransitionStatus:ws,useFormState:Qo,useActionState:Qo,useOptimistic:function(e,t){return Uo(Do(),so,e,t)},useMemoCache:jo,useCacheRefresh:Es};Ls.useEffectEvent=ls;var Rs={readContext:Yi,use:Ao,useCallback:hs,useContext:Yi,useEffect:ss,useImperativeHandle:ps,useInsertionEffect:us,useLayoutEffect:ds,useMemo:gs,useReducer:Fo,useRef:rs,useState:function(){return Fo(Mo)},useDebugValue:ms,useDeferredValue:function(e,t){var n=Do();return so===null?_s(n,e,t):vs(n,so.memoizedState,e,t)},useTransition:function(){var e=Fo(Mo)[0],t=Do().memoizedState;return[typeof e==`boolean`?e:ko(e),t]},useSyncExternalStore:Io,useId:Ts,useHostTransitionStatus:ws,useFormState:ts,useActionState:ts,useOptimistic:function(e,t){var n=Do();return so===null?(n.baseState=e,[e,n.queue.dispatch]):Uo(n,so,e,t)},useMemoCache:jo,useCacheRefresh:Es};Rs.useEffectEvent=ls;function zs(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:h({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Bs={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=mu(),i=La(r);i.payload=t,n!=null&&(i.callback=n),t=Ra(e,i,r),t!==null&&(gu(t,e,r),za(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=mu(),i=La(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=Ra(e,i,r),t!==null&&(gu(t,e,r),za(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=mu(),r=La(n);r.tag=2,t!=null&&(r.callback=t),t=Ra(e,r,n),t!==null&&(gu(t,e,n),za(t,e,n))}};function Vs(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?!yr(n,r)||!yr(i,a):!0}function Hs(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&&Bs.enqueueReplaceState(t,t.state,null)}function Us(e,t){var n=t;if(`ref`in t)for(var r in n={},t)r!==`ref`&&(n[r]=t[r]);if(e=e.defaultProps)for(var i in n===t&&(n=h({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function Ws(e){Gr(e)}function Gs(e){console.error(e)}function Ks(e){Gr(e)}function qs(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function Js(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 Ys(e,t,n){return n=La(n),n.tag=3,n.payload={element:null},n.callback=function(){qs(e,t)},n}function Xs(e){return e=La(e),e.tag=3,e}function Zs(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(){Js(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){Js(t,n,r),typeof i!=`function`&&(au===null?au=new Set([this]):au.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function Qs(e,t,n,r,a){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&Ki(t,n,a,!0),n=Za.current,n!==null){switch(n.tag){case 31:case 13:return Qa===null?Ou():n.alternate===null&&Kl===0&&(Kl=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===ya?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),qu(e,r,a)),!1;case 22:return n.flags|=65536,r===ya?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)),qu(e,r,a)),!1}throw Error(i(435,n.tag))}return qu(e,r,a),Ou(),!1}if(G)return t=Za.current,t===null?(r!==ji&&(t=Error(i(423),{cause:r}),Ri(fi(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=fi(r,n),a=Ys(e.stateNode,r,a),Ba(e,a),Kl!==4&&(Kl=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==ji&&(e=Error(i(422),{cause:r}),Ri(fi(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=fi(o,n),Ql===null?Ql=[o]:Ql.push(o),Kl!==4&&(Kl=2),t===null)return!0;r=fi(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=Ys(n.stateNode,r,e),Ba(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`&&(au===null||!au.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=Xs(a),Zs(a,e,n,r),Ba(n,a),!1}n=n.return}while(n!==null);return!1}var $s=Error(i(461)),ec=!1;function tc(e,t,n,r){t.child=e===null?Na(t,null,n,r):Ma(t,e.child,n,r)}function nc(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 Ji(t),r=yo(e,t,n,o,a,i),s=Co(),e!==null&&!ec?(wo(e,t,i),Ec(e,t,i)):(G&&s&&wi(t),t.flags|=1,tc(e,t,r,i),t.child)}function rc(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!W(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,ic(e,t,a,r,i)):(e=oi(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!Dc(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?yr:n,n(o,r)&&e.ref===t.ref)return Ec(e,t,i)}return t.flags|=1,e=ii(a,r),e.ref=t.ref,e.return=t,t.child=e}function ic(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(yr(a,r)&&e.ref===t.ref){if(ec=!1,t.pendingProps=r=a,Dc(e,i))e.flags&131072&&(ec=!0);else return t.lanes=e.lanes,Ec(e,t,i)}}return fc(e,t,n,r,i)}function ac(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 sc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&ma(t,a===null?null:a.cachePool),a===null?Ya():Ja(t,a),to(t);else return r=t.lanes=536870912,sc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&ma(t,null),Ya(),no(t)):(ma(t,a.cachePool),Ja(t,a),no(t),t.memoizedState=null);return tc(e,t,i,n),t.child}function oc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function sc(e,t,n,r,i){var a=pa();return a=a===null?null:{parent:ta._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&ma(t,null),Ya(),to(t),e!==null&&Ki(e,t,r,!0),t.childLanes=i,null}function cc(e,t){return t=xc({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function lc(e,t,n){return Ma(t,e.child,null,n),e=cc(t,t.pendingProps),e.flags|=2,ro(t),t.memoizedState=null,e}function uc(e,t,n){var r=t.pendingProps,a=!!(t.flags&128);if(t.flags&=-129,e===null){if(G){if(r.mode===`hidden`)return e=cc(t,r),t.lanes=536870912,oc(null,e);if(eo(t),(e=Oi)?(e=sf(e,Ai),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:yi===null?null:{id:bi,overflow:xi},retryLane:536870912,hydrationErrors:null},n=li(e),n.return=t,t.child=n,Di=t,Oi=null)):e=null,e===null)throw Mi(t);return t.lanes=536870912,null}return cc(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(eo(t),a){if(t.flags&256)t.flags&=-257,t=lc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558))}else if(ec||Ki(e,t,n,!1),a=(n&e.childLanes)!==0,ec||a){if(r=zl,r!==null&&(s=rt(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,Qr(e,s),gu(r,e,s),$s;Ou(),t=lc(e,t,n)}else e=o.treeContext,Oi=df(s.nextSibling),Di=t,G=!0,ki=null,Ai=!1,e!==null&&Ei(t,e),t=cc(t,r),t.flags|=4096;return t}return e=ii(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function dc(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 fc(e,t,n,r,i){return Ji(t),n=yo(e,t,n,r,void 0,i),r=Co(),e!==null&&!ec?(wo(e,t,i),Ec(e,t,i)):(G&&r&&wi(t),t.flags|=1,tc(e,t,n,i),t.child)}function pc(e,t,n,r,i,a){return Ji(t),t.updateQueue=null,n=xo(t,r,n,i),bo(e),r=Co(),e!==null&&!ec?(wo(e,t,a),Ec(e,t,a)):(G&&r&&wi(t),t.flags|=1,tc(e,t,n,a),t.child)}function mc(e,t,n,r,i){if(Ji(t),t.stateNode===null){var a=ti,o=n.contextType;typeof o==`object`&&o&&(a=Yi(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=Bs,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},Fa(t),o=n.contextType,a.context=typeof o==`object`&&o?Yi(o):ti,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(zs(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&&Bs.enqueueReplaceState(a,a.state,null),Ua(t,r,a,i),Ha(),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=Us(n,s);a.props=c;var l=a.context,u=n.contextType;o=ti,typeof u==`object`&&u&&(o=Yi(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)&&Hs(t,a,r,o),Pa=!1;var f=t.memoizedState;a.state=f,Ua(t,r,a,i),Ha(),l=t.memoizedState,s||f!==l||Pa?(typeof d==`function`&&(zs(t,n,d,r),l=t.memoizedState),(c=Pa||Vs(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,Ia(e,t),o=t.memoizedProps,u=Us(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=ti,typeof l==`object`&&l&&(c=Yi(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)&&Hs(t,a,r,c),Pa=!1,f=t.memoizedState,a.state=f,Ua(t,r,a,i),Ha();var p=t.memoizedState;o!==d||f!==p||Pa||e!==null&&e.dependencies!==null&&qi(e.dependencies)?(typeof s==`function`&&(zs(t,n,s,r),p=t.memoizedState),(u=Pa||Vs(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&qi(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,dc(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=Ma(t,e.child,null,i),t.child=Ma(t,null,n,i)):tc(e,t,n,i),t.memoizedState=a.state,e=t.child):e=Ec(e,t,i),e}function hc(e,t,n,r){return Ii(),t.flags|=256,tc(e,t,n,r),t.child}var gc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function _c(e){return{baseLanes:e,cachePool:ha()}}function vc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=Xl),e}function yc(e,t,n){var r=t.pendingProps,a=!1,o=!!(t.flags&128),s;if((s=o)||(s=e!==null&&e.memoizedState===null?!1:!!(io.current&2)),s&&(a=!0,t.flags&=-129),s=!!(t.flags&32),t.flags&=-33,e===null){if(G){if(a?$a(t):no(t),(e=Oi)?(e=sf(e,Ai),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:yi===null?null:{id:bi,overflow:xi},retryLane:536870912,hydrationErrors:null},n=li(e),n.return=t,t.child=n,Di=t,Oi=null)):e=null,e===null)throw Mi(t);return lf(e)?t.lanes=32:t.lanes=536870912,null}var c=r.children;return r=r.fallback,a?(no(t),a=t.mode,c=xc({mode:`hidden`,children:c},a),r=si(r,a,n,null),c.return=t,r.return=t,c.sibling=r,t.child=c,r=t.child,r.memoizedState=_c(n),r.childLanes=vc(e,s,n),t.memoizedState=gc,oc(null,r)):($a(t),bc(t,c))}var l=e.memoizedState;if(l!==null&&(c=l.dehydrated,c!==null)){if(o)t.flags&256?($a(t),t.flags&=-257,t=Sc(e,t,n)):t.memoizedState===null?(no(t),c=r.fallback,a=t.mode,r=xc({mode:`visible`,children:r.children},a),c=si(c,a,n,null),c.flags|=2,r.return=t,c.return=t,r.sibling=c,t.child=r,Ma(t,e.child,null,n),r=t.child,r.memoizedState=_c(n),r.childLanes=vc(e,s,n),t.memoizedState=gc,t=oc(null,r)):(no(t),t.child=e.child,t.flags|=128,t=null);else if($a(t),lf(c)){if(s=c.nextSibling&&c.nextSibling.dataset,s)var u=s.dgst;s=u,r=Error(i(419)),r.stack=``,r.digest=s,Ri({value:r,source:null,stack:null}),t=Sc(e,t,n)}else if(ec||Ki(e,t,n,!1),s=(n&e.childLanes)!==0,ec||s){if(s=zl,s!==null&&(r=rt(s,n),r!==0&&r!==l.retryLane))throw l.retryLane=r,Qr(e,r),gu(s,e,r),$s;cf(c)||Ou(),t=Sc(e,t,n)}else cf(c)?(t.flags|=192,t.child=e.child,t=null):(e=l.treeContext,Oi=df(c.nextSibling),Di=t,G=!0,ki=null,Ai=!1,e!==null&&Ei(t,e),t=bc(t,r.children),t.flags|=4096);return t}return a?(no(t),c=r.fallback,a=t.mode,l=e.child,u=l.sibling,r=ii(l,{mode:`hidden`,children:r.children}),r.subtreeFlags=l.subtreeFlags&65011712,u===null?(c=si(c,a,n,null),c.flags|=2):c=ii(u,c),c.return=t,r.return=t,r.sibling=c,t.child=r,oc(null,r),r=t.child,c=e.child.memoizedState,c===null?c=_c(n):(a=c.cachePool,a===null?a=ha():(l=ta._currentValue,a=a.parent===l?a:{parent:l,pool:l}),c={baseLanes:c.baseLanes|n,cachePool:a}),r.memoizedState=c,r.childLanes=vc(e,s,n),t.memoizedState=gc,oc(e.child,r)):($a(t),n=e.child,e=n.sibling,n=ii(n,{mode:`visible`,children:r.children}),n.return=t,n.sibling=null,e!==null&&(s=t.deletions,s===null?(t.deletions=[e],t.flags|=16):s.push(e)),t.child=n,t.memoizedState=null,n)}function bc(e,t){return t=xc({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function xc(e,t){return e=ri(22,e,null,t),e.lanes=0,e}function Sc(e,t,n){return Ma(t,e.child,null,n),e=bc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Cc(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Wi(e.return,t,n)}function wc(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 Tc(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=io.current,s=!!(o&2);if(s?(o=o&1|2,t.flags|=128):o&=1,P(io,o),tc(e,t,r,n),r=G?gi:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Cc(e,n,t);else if(e.tag===19)Cc(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break a;for(;e.sibling===null;){if(e.return===null||e.return===t)break a;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(i){case`forwards`:for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&ao(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),wc(t,!1,i,n,a,r);break;case`backwards`:case`unstable_legacy-backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&ao(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}wc(t,!0,n,null,a,r);break;case`together`:wc(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function Ec(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),ql|=t.lanes,(n&t.childLanes)===0){if(e!==null){if(Ki(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=ii(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=ii(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Dc(e,t){return(e.lanes&t)!==0||(e=e.dependencies,!!(e!==null&&qi(e)))}function Oc(e,t,n){switch(t.tag){case 3:pe(t,t.stateNode.containerInfo),Hi(t,ta,e.memoizedState.cache),Ii();break;case 27:case 5:me(t);break;case 4:pe(t,t.stateNode.containerInfo);break;case 10:Hi(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,eo(t),null;break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated===null?(n&t.child.childLanes)===0?($a(t),e=Ec(e,t,n),e===null?null:e.sibling):yc(e,t,n):($a(t),t.flags|=128,null);$a(t);break;case 19:var i=!!(e.flags&128);if(r=(n&t.childLanes)!==0,r||=(Ki(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return Tc(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),P(io,io.current),r)break;return null;case 22:return t.lanes=0,ac(e,t,n,t.pendingProps);case 24:Hi(t,ta,e.memoizedState.cache)}return Ec(e,t,n)}function kc(e,t,n){if(e!==null){if(e.memoizedProps!==t.pendingProps)ec=!0;else{if(!Dc(e,n)&&!(t.flags&128))return ec=!1,Oc(e,t,n);ec=!!(e.flags&131072)}}else ec=!1,G&&t.flags&1048576&&Ci(t,gi,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=Sa(t.elementType),t.type=e,typeof e==`function`)W(e)?(r=Us(e,r),t.tag=1,t=mc(null,t,e,r,n)):(t.tag=0,t=fc(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===w){t.tag=11,t=nc(null,t,e,r,n);break a}if(a===D){t.tag=14,t=rc(null,t,e,r,n);break a}}throw t=ie(e)||e,Error(i(306,t,``))}}return t;case 0:return fc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=Us(r,t.pendingProps),mc(e,t,r,a,n);case 3:a:{if(pe(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var o=t.memoizedState;a=o.element,Ia(e,t),Ua(t,r,null,n);var s=t.memoizedState;if(r=s.cache,Hi(t,ta,r),r!==o.cache&&Gi(t,[ta],n,!0),Ha(),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=hc(e,t,r,n);break a}if(r!==a){a=fi(Error(i(424)),t),Ri(a),t=hc(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(Oi=df(e.firstChild),Di=t,G=!0,ki=null,Ai=!0,n=Na(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(Ii(),r===a){t=Ec(e,t,n);break a}tc(e,t,r,n)}t=t.child}return t;case 26:return dc(e,t),e===null?(n=Mf(t.type,null,t.pendingProps,null))?t.memoizedState=n:G||(n=t.type,e=t.pendingProps,r=Ud(de.current).createElement(n),r[lt]=t,r[ut]=e,Ld(r,n,e),I(r),t.stateNode=r):t.memoizedState=Mf(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return me(t),e===null&&G&&(r=t.stateNode=hf(t.type,t.pendingProps,de.current),Di=t,Ai=!0,a=Oi,ef(t.type)?(ff=a,Oi=df(r.firstChild)):Oi=a),tc(e,t,t.pendingProps.children,n),dc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&G&&((a=r=Oi)&&(r=af(r,t.type,t.pendingProps,Ai),r===null?a=!1:(t.stateNode=r,Di=t,Oi=df(r.firstChild),Ai=!1,a=!0)),a||Mi(t)),me(t),a=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,Kd(a,o)?r=null:s!==null&&Kd(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=yo(e,t,So,null,null,n),ep._currentValue=a),dc(e,t),tc(e,t,r,n),t.child;case 6:return e===null&&G&&((e=n=Oi)&&(n=of(n,t.pendingProps,Ai),n===null?e=!1:(t.stateNode=n,Di=t,Oi=null,e=!0)),e||Mi(t)),null;case 13:return yc(e,t,n);case 4:return pe(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Ma(t,null,r,n):tc(e,t,r,n),t.child;case 11:return nc(e,t,t.type,t.pendingProps,n);case 7:return tc(e,t,t.pendingProps,n),t.child;case 8:return tc(e,t,t.pendingProps.children,n),t.child;case 12:return tc(e,t,t.pendingProps.children,n),t.child;case 10:return r=t.pendingProps,Hi(t,t.type,r.value),tc(e,t,r.children,n),t.child;case 9:return a=t.type._context,r=t.pendingProps.children,Ji(t),a=Yi(a),r=r(a),t.flags|=1,tc(e,t,r,n),t.child;case 14:return rc(e,t,t.type,t.pendingProps,n);case 15:return ic(e,t,t.type,t.pendingProps,n);case 19:return Tc(e,t,n);case 31:return uc(e,t,n);case 22:return ac(e,t,n,t.pendingProps);case 24:return Ji(t),r=Yi(ta),e===null?(a=pa(),a===null&&(a=zl,o=na(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},Fa(t),Hi(t,ta,a)):((e.lanes&n)!==0&&(Ia(e,t),Ua(t,null,null,n),Ha()),a=e.memoizedState,o=t.memoizedState,a.parent===r?(r=o.cache,Hi(t,ta,r),r!==a.cache&&Gi(t,[ta],n,!0)):(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),Hi(t,ta,r))),tc(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function Ac(e){e.flags|=4}function jc(e,t,n,r,i){if((t=!!(e.mode&32))&&(t=!1),t){if(e.flags|=16777216,(i&335544128)===i){if(e.stateNode.complete)e.flags|=8192;else if(Tu())e.flags|=8192;else throw Ca=ya,_a}}else e.flags&=-16777217}function Mc(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!Kf(t)){if(Tu())e.flags|=8192;else throw Ca=ya,_a}}function Nc(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:Ze(),e.lanes|=t,Zl|=t)}function Pc(e,t){if(!G)switch(e.tailMode){case`hidden`:t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case`collapsed`:n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Fc(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&65011712,r|=i.flags&65011712,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function Ic(e,t,n){var r=t.pendingProps;switch(Ti(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Fc(t),null;case 1:return Fc(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),Ui(ta),F(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Fi(t)?Ac(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Li())),Fc(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(Ac(t),o===null?(Fc(t),jc(t,a,null,r,n)):(Fc(t),Mc(t,o))):o?o===e.memoizedState?(Fc(t),t.flags&=-16777217):(Ac(t),Fc(t),Mc(t,o)):(e=e.memoizedProps,e!==r&&Ac(t),Fc(t),jc(t,a,e,r,n)),null;case 27:if(he(t),n=de.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Ac(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Fc(t),null}e=le.current,Fi(t)?Ni(t,e):(e=hf(a,r,n),t.stateNode=e,Ac(t))}return Fc(t),null;case 5:if(he(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Ac(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Fc(t),null}if(o=le.current,Fi(t))Ni(t,o);else{var s=Ud(de.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[lt]=t,o[ut]=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(Ld(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&&Ac(t)}}return Fc(t),jc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&Ac(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=de.current,Fi(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=Di,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[lt]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||Pd(e.nodeValue,n)),e||Mi(t,!0)}else e=Ud(e).createTextNode(r),e[lt]=t,t.stateNode=e}return Fc(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=Fi(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[lt]=t}else Ii(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Fc(t),e=!1}else n=Li(),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 Fc(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=Fi(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[lt]=t}else Ii(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Fc(t),a=!1}else a=Li(),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),Nc(t,t.updateQueue),Fc(t),null);case 4:return F(),e===null&&wd(t.stateNode.containerInfo),Fc(t),null;case 10:return Ui(t.type),Fc(t),null;case 19:if(N(io),r=t.memoizedState,r===null)return Fc(t),null;if(a=!!(t.flags&128),o=r.rendering,o===null){if(a)Pc(r,!1);else{if(Kl!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=ao(e),o!==null){for(t.flags|=128,Pc(r,!1),e=o.updateQueue,t.updateQueue=e,Nc(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)ai(n,e),n=n.sibling;return P(io,io.current&1|2),G&&Si(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Oe()>ru&&(t.flags|=128,a=!0,Pc(r,!1),t.lanes=4194304)}}else{if(!a){if(e=ao(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,Nc(t,e),Pc(r,!0),r.tail===null&&r.tailMode===`hidden`&&!o.alternate&&!G)return Fc(t),null}else 2*Oe()-r.renderingStartTime>ru&&n!==536870912&&(t.flags|=128,a=!0,Pc(r,!1),t.lanes=4194304)}r.isBackwards?(o.sibling=t.child,t.child=o):(e=r.last,e===null?t.child=o:e.sibling=o,r.last=o)}return r.tail===null?(Fc(t),null):(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=Oe(),e.sibling=null,n=io.current,P(io,a?n&1|2:n&1),G&&Si(t,r.treeForkCount),e);case 22:case 23:return ro(t),Xa(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(Fc(t),t.subtreeFlags&6&&(t.flags|=8192)):Fc(t),n=t.updateQueue,n!==null&&Nc(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&&N(fa),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Ui(ta),Fc(t),null;case 25:return null;case 30:return null}throw Error(i(156,t.tag))}function Lc(e,t){switch(Ti(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Ui(ta),F(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return he(t),null;case 31:if(t.memoizedState!==null){if(ro(t),t.alternate===null)throw Error(i(340));Ii()}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));Ii()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return N(io),null;case 4:return F(),null;case 10:return Ui(t.type),null;case 22:case 23:return ro(t),Xa(),e!==null&&N(fa),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Ui(ta),null;case 25:return null;default:return null}}function Rc(e,t){switch(Ti(t),t.tag){case 3:Ui(ta),F();break;case 26:case 27:case 5:he(t);break;case 4:F();break;case 31:t.memoizedState!==null&&ro(t);break;case 13:ro(t);break;case 19:N(io);break;case 10:Ui(t.type);break;case 22:case 23:ro(t),Xa(),e!==null&&N(fa);break;case 24:Ui(ta)}}function zc(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){Ku(t,t.return,e)}}function Bc(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){Ku(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){Ku(t,t.return,e)}}function Vc(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Ga(t,n)}catch(t){Ku(e,e.return,t)}}}function Hc(e,t,n){n.props=Us(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){Ku(e,t,n)}}function Uc(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){Ku(e,t,n)}}function Wc(e,t){var n=e.ref,r=e.refCleanup;if(n!==null){if(typeof r==`function`)try{r()}catch(n){Ku(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){Ku(e,t,n)}else n.current=null}}function Gc(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){Ku(e,e.return,t)}}function Kc(e,t,n){try{var r=e.stateNode;Rd(r,e.type,n,t),r[ut]=t}catch(t){Ku(e,e.return,t)}}function qc(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&ef(e.type)||e.tag===4}function Jc(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||qc(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&&ef(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 Yc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Qt));else if(r!==4&&(r===27&&ef(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(Yc(e,t,n),e=e.sibling;e!==null;)Yc(e,t,n),e=e.sibling}function Xc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(r===27&&ef(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(Xc(e,t,n),e=e.sibling;e!==null;)Xc(e,t,n),e=e.sibling}function Zc(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);Ld(t,r,n),t[lt]=e,t[ut]=n}catch(t){Ku(e,e.return,t)}}var Qc=!1,$c=!1,el=!1,tl=typeof WeakSet==`function`?WeakSet:Set,nl=null;function rl(e,t){if(e=e.containerInfo,Vd=lp,e=Sr(e),Cr(e)){if(`selectionStart`in e)var n={start:e.selectionStart,end:e.selectionEnd};else a:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var a=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==n||a!==0&&f.nodeType!==3||(c=s+a),f!==o||r!==0&&f.nodeType!==3||(l=s+r),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===n&&++u===a&&(c=s),p===o&&++d===r&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}n=c===-1||l===-1?null:{start:c,end:l}}else n=null}n||={start:0,end:0}}else n=null;for(Hd={focusedElem:e,selectionRange:n},lp=!1,nl=t;nl!==null;)if(t=nl,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,nl=e;else for(;nl!==null;){switch(t=nl,o=t.alternate,e=t.flags,t.tag){case 0:if(e&4&&(e=t.updateQueue,e=e===null?null:e.events,e!==null))for(n=0;n<e.length;n++)a=e[n],a.ref.impl=a.nextImpl;break;case 11:case 15:break;case 1:if(e&1024&&o!==null){e=void 0,n=t,a=o.memoizedProps,o=o.memoizedState,r=n.stateNode;try{var h=Us(n.type,a);e=r.getSnapshotBeforeUpdate(h,o),r.__reactInternalSnapshotBeforeUpdate=e}catch(e){Ku(n,n.return,e)}}break;case 3:if(e&1024){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)rf(e);else if(n===1)switch(e.nodeName){case`HEAD`:case`HTML`:case`BODY`:rf(e);break;default:e.textContent=``}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if(e&1024)throw Error(i(163))}if(e=t.sibling,e!==null){e.return=t.return,nl=e;break}nl=t.return}}function il(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:yl(e,n),r&4&&zc(5,n);break;case 1:if(yl(e,n),r&4){if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){Ku(n,n.return,e)}else{var i=Us(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){Ku(n,n.return,e)}}}r&64&&Vc(n),r&512&&Uc(n,n.return);break;case 3:if(yl(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{Ga(e,t)}catch(e){Ku(n,n.return,e)}}break;case 27:t===null&&r&4&&Zc(n);case 26:case 5:yl(e,n),t===null&&r&4&&Gc(n),r&512&&Uc(n,n.return);break;case 12:yl(e,n);break;case 31:yl(e,n),r&4&&ul(e,n);break;case 13:yl(e,n),r&4&&dl(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=Xu.bind(null,n),uf(e,n))));break;case 22:if(r=n.memoizedState!==null||Qc,!r){t=t!==null&&t.memoizedState!==null||$c,i=Qc;var a=$c;Qc=r,($c=t)&&!a?xl(e,n,!!(n.subtreeFlags&8772)):yl(e,n),Qc=i,$c=a}break;case 30:break;default:yl(e,n)}}function al(e){var t=e.alternate;t!==null&&(e.alternate=null,al(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&_t(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 ol=null,sl=!1;function cl(e,t,n){for(n=n.child;n!==null;)ll(e,t,n),n=n.sibling}function ll(e,t,n){if(Re&&typeof Re.onCommitFiberUnmount==`function`)try{Re.onCommitFiberUnmount(Le,n)}catch{}switch(n.tag){case 26:$c||Wc(n,t),cl(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:$c||Wc(n,t);var r=ol,i=sl;ef(n.type)&&(ol=n.stateNode,sl=!1),cl(e,t,n),gf(n.stateNode),ol=r,sl=i;break;case 5:$c||Wc(n,t);case 6:if(r=ol,i=sl,ol=null,cl(e,t,n),ol=r,sl=i,ol!==null){if(sl)try{(ol.nodeType===9?ol.body:ol.nodeName===`HTML`?ol.ownerDocument.body:ol).removeChild(n.stateNode)}catch(e){Ku(n,t,e)}else try{ol.removeChild(n.stateNode)}catch(e){Ku(n,t,e)}}break;case 18:ol!==null&&(sl?(e=ol,tf(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Fp(e)):tf(ol,n.stateNode));break;case 4:r=ol,i=sl,ol=n.stateNode.containerInfo,sl=!0,cl(e,t,n),ol=r,sl=i;break;case 0:case 11:case 14:case 15:Bc(2,n,t),$c||Bc(4,n,t),cl(e,t,n);break;case 1:$c||(Wc(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&Hc(n,t,r)),cl(e,t,n);break;case 21:cl(e,t,n);break;case 22:$c=(r=$c)||n.memoizedState!==null,cl(e,t,n),$c=r;break;default:cl(e,t,n)}}function ul(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Fp(e)}catch(e){Ku(t,t.return,e)}}}function dl(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Fp(e)}catch(e){Ku(t,t.return,e)}}function fl(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new tl),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new tl),t;default:throw Error(i(435,e.tag))}}function pl(e,t){var n=fl(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=Zu.bind(null,e,t);t.then(r,r)}})}function ml(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var a=n[r],o=e,s=t,c=s;a:for(;c!==null;){switch(c.tag){case 27:if(ef(c.type)){ol=c.stateNode,sl=!1;break a}break;case 5:ol=c.stateNode,sl=!1;break a;case 3:case 4:ol=c.stateNode.containerInfo,sl=!0;break a}c=c.return}if(ol===null)throw Error(i(160));ll(o,s,a),ol=null,sl=!1,o=a.alternate,o!==null&&(o.return=null),a.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)gl(t,e),t=t.sibling}var hl=null;function gl(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:ml(t,e),_l(e),r&4&&(Bc(3,e,e.return),zc(3,e),Bc(5,e,e.return));break;case 1:ml(t,e),_l(e),r&512&&($c||n===null||Wc(n,n.return)),r&64&&Qc&&(e=e.updateQueue,e!==null&&(r=e.callbacks,r!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?r:n.concat(r))));break;case 26:var a=hl;if(ml(t,e),_l(e),r&512&&($c||n===null||Wc(n,n.return)),r&4){var o=n===null?null:n.memoizedState;if(r=e.memoizedState,n===null){if(r===null){if(e.stateNode===null){a:{r=e.type,n=e.memoizedProps,a=a.ownerDocument||a;b:switch(r){case`title`:o=a.getElementsByTagName(`title`)[0],(!o||o[gt]||o[lt]||o.namespaceURI===`http://www.w3.org/2000/svg`||o.hasAttribute(`itemprop`))&&(o=a.createElement(r),a.head.insertBefore(o,a.querySelector(`head > title`))),Ld(o,r,n),o[lt]=e,I(o),r=o;break a;case`link`:var s=Uf(`link`,`href`,a).get(r+(n.href||``));if(s){for(var c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`href`)===(n.href==null||n.href===``?null:n.href)&&o.getAttribute(`rel`)===(n.rel==null?null:n.rel)&&o.getAttribute(`title`)===(n.title==null?null:n.title)&&o.getAttribute(`crossorigin`)===(n.crossOrigin==null?null:n.crossOrigin)){s.splice(c,1);break b}}o=a.createElement(r),Ld(o,r,n),a.head.appendChild(o);break;case`meta`:if(s=Uf(`meta`,`content`,a).get(r+(n.content||``))){for(c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`content`)===(n.content==null?null:``+n.content)&&o.getAttribute(`name`)===(n.name==null?null:n.name)&&o.getAttribute(`property`)===(n.property==null?null:n.property)&&o.getAttribute(`http-equiv`)===(n.httpEquiv==null?null:n.httpEquiv)&&o.getAttribute(`charset`)===(n.charSet==null?null:n.charSet)){s.splice(c,1);break b}}o=a.createElement(r),Ld(o,r,n),a.head.appendChild(o);break;default:throw Error(i(468,r))}o[lt]=e,I(o),r=o}e.stateNode=r}else Wf(a,e.type,e.stateNode)}else e.stateNode=zf(a,r,e.memoizedProps)}else o===r?r===null&&e.stateNode!==null&&Kc(e,e.memoizedProps,n.memoizedProps):(o===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):o.count--,r===null?Wf(a,e.type,e.stateNode):zf(a,r,e.memoizedProps))}break;case 27:ml(t,e),_l(e),r&512&&($c||n===null||Wc(n,n.return)),n!==null&&r&4&&Kc(e,e.memoizedProps,n.memoizedProps);break;case 5:if(ml(t,e),_l(e),r&512&&($c||n===null||Wc(n,n.return)),e.flags&32){a=e.stateNode;try{Gt(a,``)}catch(t){Ku(e,e.return,t)}}r&4&&e.stateNode!=null&&(a=e.memoizedProps,Kc(e,a,n===null?a:n.memoizedProps)),r&1024&&(el=!0);break;case 6:if(ml(t,e),_l(e),r&4){if(e.stateNode===null)throw Error(i(162));r=e.memoizedProps,n=e.stateNode;try{n.nodeValue=r}catch(t){Ku(e,e.return,t)}}break;case 3:if(Hf=null,a=hl,hl=yf(t.containerInfo),ml(t,e),hl=a,_l(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Fp(t.containerInfo)}catch(t){Ku(e,e.return,t)}el&&(el=!1,vl(e));break;case 4:r=hl,hl=yf(e.stateNode.containerInfo),ml(t,e),_l(e),hl=r;break;case 12:ml(t,e),_l(e);break;case 31:ml(t,e),_l(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,pl(e,r)));break;case 13:ml(t,e),_l(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(tu=Oe()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,pl(e,r)));break;case 22:a=e.memoizedState!==null;var l=n!==null&&n.memoizedState!==null,u=Qc,d=$c;if(Qc=u||a,$c=d||l,ml(t,e),$c=d,Qc=u,_l(e),r&8192)a:for(t=e.stateNode,t._visibility=a?t._visibility&-2:t._visibility|1,a&&(n===null||l||Qc||$c||bl(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){l=n=t;try{if(o=l.stateNode,a)s=o.style,typeof s.setProperty==`function`?s.setProperty(`display`,`none`,`important`):s.display=`none`;else{c=l.stateNode;var f=l.memoizedProps.style,p=f!=null&&f.hasOwnProperty(`display`)?f.display:null;c.style.display=p==null||typeof p==`boolean`?``:(``+p).trim()}}catch(e){Ku(l,l.return,e)}}}else if(t.tag===6){if(n===null){l=t;try{l.stateNode.nodeValue=a?``:l.memoizedProps}catch(e){Ku(l,l.return,e)}}}else if(t.tag===18){if(n===null){l=t;try{var m=l.stateNode;a?nf(m,!0):nf(l.stateNode,!1)}catch(e){Ku(l,l.return,e)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break a;for(;t.sibling===null;){if(t.return===null||t.return===e)break a;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}r&4&&(r=e.updateQueue,r!==null&&(n=r.retryQueue,n!==null&&(r.retryQueue=null,pl(e,n))));break;case 19:ml(t,e),_l(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,pl(e,r)));break;case 30:break;case 21:break;default:ml(t,e),_l(e)}}function _l(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(qc(r)){n=r;break}r=r.return}if(n==null)throw Error(i(160));switch(n.tag){case 27:var a=n.stateNode;Xc(e,Jc(e),a);break;case 5:var o=n.stateNode;n.flags&32&&(Gt(o,``),n.flags&=-33),Xc(e,Jc(e),o);break;case 3:case 4:var s=n.stateNode.containerInfo;Yc(e,Jc(e),s);break;default:throw Error(i(161))}}catch(t){Ku(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function vl(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;vl(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function yl(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)il(e,t.alternate,t),t=t.sibling}function bl(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Bc(4,t,t.return),bl(t);break;case 1:Wc(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount==`function`&&Hc(t,t.return,n),bl(t);break;case 27:gf(t.stateNode);case 26:case 5:Wc(t,t.return),bl(t);break;case 22:t.memoizedState===null&&bl(t);break;case 30:bl(t);break;default:bl(t)}e=e.sibling}}function xl(e,t,n){for(n&&=!!(t.subtreeFlags&8772),t=t.child;t!==null;){var r=t.alternate,i=e,a=t,o=a.flags;switch(a.tag){case 0:case 11:case 15:xl(i,a,n),zc(4,a);break;case 1:if(xl(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){Ku(r,r.return,e)}if(r=a,i=r.updateQueue,i!==null){var s=r.stateNode;try{var c=i.shared.hiddenCallbacks;if(c!==null)for(i.shared.hiddenCallbacks=null,i=0;i<c.length;i++)Wa(c[i],s)}catch(e){Ku(r,r.return,e)}}n&&o&64&&Vc(a),Uc(a,a.return);break;case 27:Zc(a);case 26:case 5:xl(i,a,n),n&&r===null&&o&4&&Gc(a),Uc(a,a.return);break;case 12:xl(i,a,n);break;case 31:xl(i,a,n),n&&o&4&&ul(i,a);break;case 13:xl(i,a,n),n&&o&4&&dl(i,a);break;case 22:a.memoizedState===null&&xl(i,a,n),Uc(a,a.return);break;case 30:break;default:xl(i,a,n)}t=t.sibling}}function Sl(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&&ra(n))}function Cl(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ra(e))}function wl(e,t,n,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Tl(e,t,n,r),t=t.sibling}function Tl(e,t,n,r){var i=t.flags;switch(t.tag){case 0:case 11:case 15:wl(e,t,n,r),i&2048&&zc(9,t);break;case 1:wl(e,t,n,r);break;case 3:wl(e,t,n,r),i&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ra(e)));break;case 12:if(i&2048){wl(e,t,n,r),e=t.stateNode;try{var a=t.memoizedProps,o=a.id,s=a.onPostCommit;typeof s==`function`&&s(o,t.alternate===null?`mount`:`update`,e.passiveEffectDuration,-0)}catch(e){Ku(t,t.return,e)}}else wl(e,t,n,r);break;case 31:wl(e,t,n,r);break;case 13:wl(e,t,n,r);break;case 23:break;case 22:a=t.stateNode,o=t.alternate,t.memoizedState===null?a._visibility&2?wl(e,t,n,r):(a._visibility|=2,El(e,t,n,r,!!(t.subtreeFlags&10256)||!1)):a._visibility&2?wl(e,t,n,r):Dl(e,t),i&2048&&Sl(o,t);break;case 24:wl(e,t,n,r),i&2048&&Cl(t.alternate,t);break;default:wl(e,t,n,r)}}function El(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:El(a,o,s,c,i),zc(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,El(a,o,s,c,i)):u._visibility&2?El(a,o,s,c,i):Dl(a,o),i&&l&2048&&Sl(o.alternate,o);break;case 24:El(a,o,s,c,i),i&&l&2048&&Cl(o.alternate,o);break;default:El(a,o,s,c,i)}t=t.sibling}}function Dl(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:Dl(n,r),i&2048&&Sl(r.alternate,r);break;case 24:Dl(n,r),i&2048&&Cl(r.alternate,r);break;default:Dl(n,r)}t=t.sibling}}var Ol=8192;function kl(e,t,n){if(e.subtreeFlags&Ol)for(e=e.child;e!==null;)Al(e,t,n),e=e.sibling}function Al(e,t,n){switch(e.tag){case 26:kl(e,t,n),e.flags&Ol&&e.memoizedState!==null&&qf(n,hl,e.memoizedState,e.memoizedProps);break;case 5:kl(e,t,n);break;case 3:case 4:var r=hl;hl=yf(e.stateNode.containerInfo),kl(e,t,n),hl=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Ol,Ol=16777216,kl(e,t,n),Ol=r):kl(e,t,n));break;default:kl(e,t,n)}}function jl(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 Ml(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];nl=r,Fl(r,e)}jl(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Nl(e),e=e.sibling}function Nl(e){switch(e.tag){case 0:case 11:case 15:Ml(e),e.flags&2048&&Bc(9,e,e.return);break;case 3:Ml(e);break;case 12:Ml(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Pl(e)):Ml(e);break;default:Ml(e)}}function Pl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];nl=r,Fl(r,e)}jl(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Bc(8,t,t.return),Pl(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Pl(t));break;default:Pl(t)}e=e.sibling}}function Fl(e,t){for(;nl!==null;){var n=nl;switch(n.tag){case 0:case 11:case 15:Bc(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:ra(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,nl=r;else a:for(n=e;nl!==null;){r=nl;var i=r.sibling,a=r.return;if(al(r),r===n){nl=null;break a}if(i!==null){i.return=a,nl=i;break a}nl=a}}}var Il={getCacheForType:function(e){var t=Yi(ta),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return Yi(ta).controller.signal}},Ll=typeof WeakMap==`function`?WeakMap:Map,Rl=0,zl=null,q=null,J=0,Bl=0,Vl=null,Hl=!1,Ul=!1,Wl=!1,Gl=0,Kl=0,ql=0,Jl=0,Yl=0,Xl=0,Zl=0,Ql=null,$l=null,eu=!1,tu=0,nu=0,ru=1/0,iu=null,au=null,ou=0,su=null,cu=null,Y=0,lu=0,uu=null,du=null,fu=0,pu=null;function mu(){return Rl&2&&J!==0?J&-J:A.T===null?ot():pd()}function hu(){if(Xl===0){if(!(J&536870912)||G){var e=Ge;Ge<<=1,!(Ge&3932160)&&(Ge=262144),Xl=e}else Xl=536870912}return e=Za.current,e!==null&&(e.flags|=32),Xl}function gu(e,t,n){(e===zl&&(Bl===2||Bl===9)||e.cancelPendingCommit!==null)&&(Cu(e,0),bu(e,J,Xl,!1)),$e(e,n),(!(Rl&2)||e!==zl)&&(e===zl&&(!(Rl&2)&&(Jl|=n),Kl===4&&bu(e,J,Xl,!1)),ad(e))}function _u(e,t,n){if(Rl&6)throw Error(i(327));var r=!n&&!(t&127)&&(t&e.expiredLanes)===0||Ye(e,t),a=r?ju(e,t):ku(e,t,!0),o=r;do{if(a===0){Ul&&!r&&bu(e,t,0,!1);break}if(n=e.current.alternate,o&&!yu(n)){a=ku(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=Ql;var l=c.current.memoizedState.isDehydrated;if(l&&(Cu(c,s).flags|=256),s=ku(c,s,!1),s!==2){if(Wl&&!l){c.errorRecoveryDisabledLanes|=o,Jl|=o,a=4;break a}o=$l,$l=a,o!==null&&($l===null?$l=o:$l.push.apply($l,o))}a=s}if(o=!1,a!==2)continue}}if(a===1){Cu(e,0),bu(e,t,0,!0);break}a:{switch(r=e,o=a,o){case 0:case 1:throw Error(i(345));case 4:if((t&4194048)!==t)break;case 6:bu(r,t,Xl,!Hl);break a;case 2:$l=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(a=tu+300-Oe(),10<a)){if(bu(r,t,Xl,!Hl),Je(r,0,!0)!==0)break a;Y=t,r.timeoutHandle=Yd(vu.bind(null,r,n,$l,iu,eu,t,Xl,Jl,Zl,Hl,o,`Throttled`,-0,0),a);break a}vu(r,n,$l,iu,eu,t,Xl,Jl,Zl,Hl,o,null,-0,0)}break}while(1);ad(e)}function vu(e,t,n,r,i,a,o,s,c,l,u,d,f,p){if(e.timeoutHandle=-1,d=t.subtreeFlags,d&8192||(d&16785408)==16785408){d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Qt},Al(t,a,d);var m=(a&62914560)===a?tu-Oe():(a&4194048)===a?nu-Oe():0;if(m=Yf(d,m),m!==null){Y=a,e.cancelPendingCommit=m(Ru.bind(null,e,t,a,n,r,i,o,s,c,u,d,null,f,p)),bu(e,a,o,!l);return}}Ru(e,t,a,n,r,i,o,s,c)}function yu(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(!vr(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 bu(e,t,n,r){t&=~Yl,t&=~Jl,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-Be(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&tt(e,n,t)}function xu(){return Rl&6?!0:(od(0,!1),!1)}function Su(){if(q!==null){if(Bl===0)var e=q.return;else e=q,Vi=Bi=null,To(e),Ea=null,Da=0,e=q;for(;e!==null;)Rc(e.alternate,e),e=e.return;q=null}}function Cu(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,Xd(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),Y=0,Su(),zl=e,q=n=ii(e.current,null),J=t,Bl=0,Vl=null,Hl=!1,Ul=Ye(e,t),Wl=!1,Zl=Xl=Yl=Jl=ql=Kl=0,$l=Ql=null,eu=!1,t&8&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0<r;){var i=31-Be(r),a=1<<i;t|=e[i],r&=~a}return Gl=t,Yr(),n}function wu(e,t){K=null,A.H=Fs,t===ga||t===va?(t=wa(),Bl=3):t===_a?(t=wa(),Bl=4):Bl=t===$s?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,Vl=t,q===null&&(Kl=1,qs(e,fi(t,e.current)))}function Tu(){var e=Za.current;return e===null?!0:(J&4194048)===J?Qa===null:(J&62914560)===J||J&536870912?e===Qa:!1}function Eu(){var e=A.H;return A.H=Fs,e===null?Fs:e}function Du(){var e=A.A;return A.A=Il,e}function Ou(){Kl=4,Hl||(J&4194048)!==J&&Za.current!==null||(Ul=!0),!(ql&134217727)&&!(Jl&134217727)||zl===null||bu(zl,J,Xl,!1)}function ku(e,t,n){var r=Rl;Rl|=2;var i=Eu(),a=Du();(zl!==e||J!==t)&&(iu=null,Cu(e,t)),t=!1;var o=Kl;a:do try{if(Bl!==0&&q!==null){var s=q,c=Vl;switch(Bl){case 8:Su(),o=6;break a;case 3:case 2:case 9:case 6:Za.current===null&&(t=!0);var l=Bl;if(Bl=0,Vl=null,Fu(e,s,c,l),n&&Ul){o=0;break a}break;default:l=Bl,Bl=0,Vl=null,Fu(e,s,c,l)}}Au(),o=Kl;break}catch(t){wu(e,t)}while(1);return t&&e.shellSuspendCounter++,Vi=Bi=null,Rl=r,A.H=i,A.A=a,q===null&&(zl=null,J=0,Yr()),o}function Au(){for(;q!==null;)Nu(q)}function ju(e,t){var n=Rl;Rl|=2;var r=Eu(),a=Du();zl!==e||J!==t?(iu=null,ru=Oe()+500,Cu(e,t)):Ul=Ye(e,t);a:do try{if(Bl!==0&&q!==null){t=q;var o=Vl;b:switch(Bl){case 1:Bl=0,Vl=null,Fu(e,t,o,1);break;case 2:case 9:if(ba(o)){Bl=0,Vl=null,Pu(t);break}t=function(){Bl!==2&&Bl!==9||zl!==e||(Bl=7),ad(e)},o.then(t,t);break a;case 3:Bl=7;break a;case 4:Bl=5;break a;case 7:ba(o)?(Bl=0,Vl=null,Pu(t)):(Bl=0,Vl=null,Fu(e,t,o,7));break;case 5:var s=null;switch(q.tag){case 26:s=q.memoizedState;case 5:case 27:var c=q;if(s?Kf(s):c.stateNode.complete){Bl=0,Vl=null;var l=c.sibling;if(l!==null)q=l;else{var u=c.return;u===null?q=null:(q=u,Iu(u))}break b}}Bl=0,Vl=null,Fu(e,t,o,5);break;case 6:Bl=0,Vl=null,Fu(e,t,o,6);break;case 8:Su(),Kl=6;break a;default:throw Error(i(462))}}Mu();break}catch(t){wu(e,t)}while(1);return Vi=Bi=null,A.H=r,A.A=a,Rl=n,q===null?(zl=null,J=0,Yr(),Kl):0}function Mu(){for(;q!==null&&!Ee();)Nu(q)}function Nu(e){var t=kc(e.alternate,e,Gl);e.memoizedProps=e.pendingProps,t===null?Iu(e):q=t}function Pu(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=pc(n,t,t.pendingProps,t.type,void 0,J);break;case 11:t=pc(n,t,t.pendingProps,t.type.render,t.ref,J);break;case 5:To(t);default:Rc(n,t),t=q=ai(t,Gl),t=kc(n,t,Gl)}e.memoizedProps=e.pendingProps,t===null?Iu(e):q=t}function Fu(e,t,n,r){Vi=Bi=null,To(t),Ea=null,Da=0;var i=t.return;try{if(Qs(e,i,t,n,J)){Kl=1,qs(e,fi(n,e.current)),q=null;return}}catch(t){if(i!==null)throw q=i,t;Kl=1,qs(e,fi(n,e.current)),q=null;return}t.flags&32768?(G||r===1?e=!0:Ul||J&536870912?e=!1:(Hl=e=!0,(r===2||r===9||r===3||r===6)&&(r=Za.current,r!==null&&r.tag===13&&(r.flags|=16384))),Lu(t,e)):Iu(t)}function Iu(e){var t=e;do{if(t.flags&32768){Lu(t,Hl);return}e=t.return;var n=Ic(t.alternate,t,Gl);if(n!==null){q=n;return}if(t=t.sibling,t!==null){q=t;return}q=t=e}while(t!==null);Kl===0&&(Kl=5)}function Lu(e,t){do{var n=Lc(e.alternate,e);if(n!==null){n.flags&=32767,q=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){q=e;return}q=e=n}while(e!==null);Kl=6,q=null}function Ru(e,t,n,r,a,o,s,c,l){e.cancelPendingCommit=null;do Uu();while(ou!==0);if(Rl&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));if(o=t.lanes|t.childLanes,o|=Jr,et(e,n,o,s,c,l),e===zl&&(q=zl=null,J=0),cu=t,su=e,Y=n,lu=o,uu=a,du=r,t.subtreeFlags&10256||t.flags&10256?(e.callbackNode=null,e.callbackPriority=0,Qu(Me,function(){return Wu(),null})):(e.callbackNode=null,e.callbackPriority=0),r=!!(t.flags&13878),t.subtreeFlags&13878||r){r=A.T,A.T=null,a=j.p,j.p=2,s=Rl,Rl|=4;try{rl(e,t,n)}finally{Rl=s,j.p=a,A.T=r}}ou=1,zu(),Bu(),Vu()}}function zu(){if(ou===1){ou=0;var e=su,t=cu,n=!!(t.flags&13878);if(t.subtreeFlags&13878||n){n=A.T,A.T=null;var r=j.p;j.p=2;var i=Rl;Rl|=4;try{gl(t,e);var a=Hd,o=Sr(e.containerInfo),s=a.focusedElem,c=a.selectionRange;if(o!==s&&s&&s.ownerDocument&&xr(s.ownerDocument.documentElement,s)){if(c!==null&&Cr(s)){var l=c.start,u=c.end;if(u===void 0&&(u=l),`selectionStart`in s)s.selectionStart=l,s.selectionEnd=Math.min(u,s.value.length);else{var d=s.ownerDocument||document,f=d&&d.defaultView||window;if(f.getSelection){var p=f.getSelection(),m=s.textContent.length,h=Math.min(c.start,m),g=c.end===void 0?h:Math.min(c.end,m);!p.extend&&h>g&&(o=g,g=h,h=o);var _=br(s,h),v=br(s,g);if(_&&v&&(p.rangeCount!==1||p.anchorNode!==_.node||p.anchorOffset!==_.offset||p.focusNode!==v.node||p.focusOffset!==v.offset)){var y=d.createRange();y.setStart(_.node,_.offset),p.removeAllRanges(),h>g?(p.addRange(y),p.extend(v.node,v.offset)):(y.setEnd(v.node,v.offset),p.addRange(y))}}}}for(d=[],p=s;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof s.focus==`function`&&s.focus(),s=0;s<d.length;s++){var b=d[s];b.element.scrollLeft=b.left,b.element.scrollTop=b.top}}lp=!!Vd,Hd=Vd=null}finally{Rl=i,j.p=r,A.T=n}}e.current=t,ou=2}}function Bu(){if(ou===2){ou=0;var e=su,t=cu,n=!!(t.flags&8772);if(t.subtreeFlags&8772||n){n=A.T,A.T=null;var r=j.p;j.p=2;var i=Rl;Rl|=4;try{il(e,t.alternate,t)}finally{Rl=i,j.p=r,A.T=n}}ou=3}}function Vu(){if(ou===4||ou===3){ou=0,De();var e=su,t=cu,n=Y,r=du;t.subtreeFlags&10256||t.flags&10256?ou=5:(ou=0,cu=su=null,Hu(e,e.pendingLanes));var i=e.pendingLanes;if(i===0&&(au=null),at(n),t=t.stateNode,Re&&typeof Re.onCommitFiberRoot==`function`)try{Re.onCommitFiberRoot(Le,t,void 0,(t.current.flags&128)==128)}catch{}if(r!==null){t=A.T,i=j.p,j.p=2,A.T=null;try{for(var a=e.onRecoverableError,o=0;o<r.length;o++){var s=r[o];a(s.value,{componentStack:s.stack})}}finally{A.T=t,j.p=i}}Y&3&&Uu(),ad(e),i=e.pendingLanes,n&261930&&i&42?e===pu?fu++:(fu=0,pu=e):fu=0,od(0,!1)}}function Hu(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,ra(t)))}function Uu(){return zu(),Bu(),Vu(),Wu()}function Wu(){if(ou!==5)return!1;var e=su,t=lu;lu=0;var n=at(Y),r=A.T,a=j.p;try{j.p=32>n?32:n,A.T=null,n=uu,uu=null;var o=su,s=Y;if(ou=0,cu=su=null,Y=0,Rl&6)throw Error(i(331));var c=Rl;if(Rl|=4,Nl(o.current),Tl(o,o.current,s,n),Rl=c,od(0,!1),Re&&typeof Re.onPostCommitFiberRoot==`function`)try{Re.onPostCommitFiberRoot(Le,o)}catch{}return!0}finally{j.p=a,A.T=r,Hu(e,t)}}function Gu(e,t,n){t=fi(n,t),t=Ys(e.stateNode,t,2),e=Ra(e,t,2),e!==null&&($e(e,2),ad(e))}function Ku(e,t,n){if(e.tag===3)Gu(e,e,n);else for(;t!==null;){if(t.tag===3){Gu(t,e,n);break}if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(au===null||!au.has(r))){e=fi(n,e),n=Xs(2),r=Ra(t,n,2),r!==null&&(Zs(n,r,t,e),$e(r,2),ad(r));break}}t=t.return}}function qu(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Ll;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)||(Wl=!0,i.add(n),e=Ju.bind(null,e,t,n),t.then(e,e))}function Ju(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,zl===e&&(J&n)===n&&(Kl===4||Kl===3&&(J&62914560)===J&&300>Oe()-tu?!(Rl&2)&&Cu(e,0):Yl|=n,Zl===J&&(Zl=0)),ad(e)}function Yu(e,t){t===0&&(t=Ze()),e=Qr(e,t),e!==null&&($e(e,t),ad(e))}function Xu(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Yu(e,n)}function Zu(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),Yu(e,n)}function Qu(e,t){return we(e,t)}var $u=null,ed=null,td=!1,nd=!1,rd=!1,id=0;function ad(e){e!==ed&&e.next===null&&(ed===null?$u=ed=e:ed=ed.next=e),nd=!0,td||(td=!0,fd())}function od(e,t){if(!rd&&nd){rd=!0;do for(var n=!1,r=$u;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-Be(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,dd(r,a))}else a=J,a=Je(r,r===zl?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||Ye(r,a)||(n=!0,dd(r,a))}r=r.next}while(n);rd=!1}}function sd(){cd()}function cd(){nd=td=!1;var e=0;id!==0&&Jd()&&(e=id);for(var t=Oe(),n=null,r=$u;r!==null;){var i=r.next,a=ld(r,t);a===0?(r.next=null,n===null?$u=i:n.next=i,i===null&&(ed=n)):(n=r,(e!==0||a&3)&&(nd=!0)),r=i}ou!==0&&ou!==5||od(e,!1),id!==0&&(id=0)}function ld(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-Be(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=Xe(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=zl,n=J,n=Je(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(Bl===2||Bl===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&Te(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||Ye(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&Te(r),at(n)){case 2:case 8:n=je;break;case 32:n=Me;break;case 268435456:n=Pe;break;default:n=Me}return r=ud.bind(null,e),n=we(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&Te(r),e.callbackPriority=2,e.callbackNode=null,2}function ud(e,t){if(ou!==0&&ou!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Uu()&&e.callbackNode!==n)return null;var r=J;return r=Je(e,e===zl?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(_u(e,r,t),ld(e,Oe()),e.callbackNode!=null&&e.callbackNode===n?ud.bind(null,e):null)}function dd(e,t){if(Uu())return null;_u(e,t,!0)}function fd(){Qd(function(){Rl&6?we(Ae,sd):cd()})}function pd(){if(id===0){var e=oa;e===0&&(e=We,We<<=1,!(We&261888)&&(We=256)),id=e}return id}function md(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:Zt(``+e)}function hd(e,t){var n=t.ownerDocument.createElement(`input`);return n.name=t.name,n.value=t.value,e.id&&n.setAttribute(`form`,e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}function gd(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=md((i[ut]||null).action),o=r.submitter;o&&(t=(t=o[ut]||null)?md(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new vn(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(id!==0){var e=o?hd(i,o):new FormData(i);xs(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=o?hd(i,o):new FormData(i),xs(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var _d=0;_d<Ur.length;_d++){var vd=Ur[_d];Wr(vd.toLowerCase(),`on`+(vd[0].toUpperCase()+vd.slice(1)))}Wr(Fr,`onAnimationEnd`),Wr(Ir,`onAnimationIteration`),Wr(Lr,`onAnimationStart`),Wr(`dblclick`,`onDoubleClick`),Wr(`focusin`,`onFocus`),Wr(`focusout`,`onBlur`),Wr(Rr,`onTransitionRun`),Wr(zr,`onTransitionStart`),Wr(Br,`onTransitionCancel`),Wr(Vr,`onTransitionEnd`),Tt(`onMouseEnter`,[`mouseout`,`mouseover`]),Tt(`onMouseLeave`,[`mouseout`,`mouseover`]),Tt(`onPointerEnter`,[`pointerout`,`pointerover`]),Tt(`onPointerLeave`,[`pointerout`,`pointerover`]),wt(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),wt(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),wt(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),wt(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),wt(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),wt(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var yd=`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(` `),bd=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(yd));function xd(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){Gr(e)}i.currentTarget=null,a=c}else for(o=0;o<r.length;o++){if(s=r[o],c=s.instance,l=s.currentTarget,s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){Gr(e)}i.currentTarget=null,a=c}}}}function X(e,t){var n=t[ft];n===void 0&&(n=t[ft]=new Set);var r=e+`__bubble`;n.has(r)||(Td(t,e,2,!1),n.add(r))}function Sd(e,t,n){var r=0;t&&(r|=4),Td(n,e,r,t)}var Cd=`_reactListening`+Math.random().toString(36).slice(2);function wd(e){if(!e[Cd]){e[Cd]=!0,St.forEach(function(t){t!==`selectionchange`&&(bd.has(t)||Sd(t,!1,e),Sd(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Cd]||(t[Cd]=!0,Sd(`selectionchange`,!1,t))}}function Td(e,t,n,r){switch(gp(t)){case 2:var i=up;break;case 8:i=dp;break;default:i=fp}n=i.bind(null,t,n,e),i=void 0,!ln||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 Ed(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=vt(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=en(n),s=[];a:{var c=Hr.get(e);if(c!==void 0){var l=vn,u=e;switch(e){case`keypress`:if(mn(n)===0)break a;case`keydown`:case`keyup`:l=Fn;break;case`focusin`:u=`focus`,l=Dn;break;case`focusout`:u=`blur`,l=Dn;break;case`beforeblur`:case`afterblur`:l=Dn;break;case`click`:if(n.button===2)break a;case`auxclick`:case`dblclick`:case`mousedown`:case`mousemove`:case`mouseup`:case`mouseout`:case`mouseover`:case`contextmenu`:l=Tn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=En;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=Ln;break;case Fr:case Ir:case Lr:l=On;break;case Vr:l=Rn;break;case`scroll`:case`scrollend`:l=bn;break;case`wheel`:l=zn;break;case`copy`:case`cut`:case`paste`:l=kn;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=In;break;case`toggle`:case`beforetoggle`:l=Bn}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=sn(m,p),g!=null&&d.push(Dd(m,g,h))),f)break;m=m.return}0<d.length&&(c=new l(c,u,null,n,i),s.push({event:c,listeners:d}))}}if(!(t&7)){a:{if(c=e===`mouseover`||e===`pointerover`,l=e===`mouseout`||e===`pointerout`,c&&n!==$t&&(u=n.relatedTarget||n.fromElement)&&(vt(u)||u[dt]))break a;if((l||c)&&(c=i.window===i?i:(c=i.ownerDocument)?c.defaultView||c.parentWindow:window,l?(u=n.relatedTarget||n.toElement,l=r,u=u?vt(u):null,u!==null&&(f=o(u),d=u.tag,u!==f||d!==5&&d!==27&&d!==6)&&(u=null)):(l=null,u=r),l!==u)){if(d=Tn,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=In,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=l==null?c:bt(l),h=u==null?c:bt(u),c=new d(g,m+`leave`,l,n,i),c.target=f,c.relatedTarget=h,g=null,vt(i)===r&&(d=new d(p,m+`enter`,u,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,l&&u)b:{for(d=kd,p=l,m=u,h=0,g=p;g;g=d(g))h++;g=0;for(var _=m;_;_=d(_))g++;for(;0<h-g;)p=d(p),h--;for(;0<g-h;)m=d(m),g--;for(;h--;){if(p===m||m!==null&&p===m.alternate){d=p;break b}p=d(p),m=d(m)}d=null}else d=null;l!==null&&Ad(s,c,l,d,!1),u!==null&&f!==null&&Ad(s,f,u,d,!0)}}a:{if(c=r?bt(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var v=or;else if(er(c)){if(sr)v=gr;else{v=mr;var y=pr}}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&z(r.elementType)&&(v=or):v=hr;if(v&&=v(e,r)){tr(s,v,n,i);break a}y&&y(e,c,r),e===`focusout`&&r&&c.type===`number`&&r.memoizedProps.value!=null&&R(c,`number`,c.value)}switch(y=r?bt(r):window,e){case`focusin`:(er(y)||y.contentEditable===`true`)&&(Tr=y,Er=r,Dr=null);break;case`focusout`:Dr=Er=Tr=null;break;case`mousedown`:Or=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:Or=!1,kr(s,n,i);break;case`selectionchange`:if(wr)break;case`keydown`:case`keyup`:kr(s,n,i)}var b;if(Hn)b:{switch(e){case`compositionstart`:var x=`onCompositionStart`;break b;case`compositionend`:x=`onCompositionEnd`;break b;case`compositionupdate`:x=`onCompositionUpdate`;break b}x=void 0}else Xn?Jn(e,n)&&(x=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(x=`onCompositionStart`);x&&(Gn&&n.locale!==`ko`&&(Xn||x!==`onCompositionStart`?x===`onCompositionEnd`&&Xn&&(b=B()):(dn=i,fn=`value`in dn?dn.value:dn.textContent,Xn=!0)),y=Od(r,x),0<y.length&&(x=new An(x,e,null,n,i),s.push({event:x,listeners:y}),b?x.data=b:(b=Yn(n),b!==null&&(x.data=b)))),(b=Wn?Zn(e,n):Qn(e,n))&&(x=Od(r,`onBeforeInput`),0<x.length&&(y=new An(`onBeforeInput`,`beforeinput`,null,n,i),s.push({event:y,listeners:x}),y.data=b)),gd(s,e,r,n,i)}xd(s,t)})}function Dd(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Od(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=sn(e,n),i!=null&&r.unshift(Dd(e,i,a)),i=sn(e,t),i!=null&&r.push(Dd(e,i,a))),e.tag===3)return r;e=e.return}return[]}function kd(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Ad(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=sn(n,a),l!=null&&o.unshift(Dd(n,l,c))):i||(l=sn(n,a),l!=null&&o.push(Dd(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var jd=/\r\n?/g,Md=/\u0000|\uFFFD/g;function Nd(e){return(typeof e==`string`?e:``+e).replace(jd,`
9
+ `).replace(Md,``)}function Pd(e,t){return t=Nd(t),Nd(e)===t}function Fd(e,t,n,r,a,o){switch(n){case`children`:typeof r==`string`?t===`body`||t===`textarea`&&r===``||Gt(e,r):(typeof r==`number`||typeof r==`bigint`)&&t!==`body`&&Gt(e,``+r);break;case`className`:L(e,`class`,r);break;case`tabIndex`:L(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:L(e,n,r);break;case`style`:Jt(e,r,o);break;case`data`:if(t!==`object`){L(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=Zt(``+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`&&Fd(e,t,`name`,a.name,a,null),Fd(e,t,`formEncType`,a.formEncType,a,null),Fd(e,t,`formMethod`,a.formMethod,a,null),Fd(e,t,`formTarget`,a.formTarget,a,null)):(Fd(e,t,`encType`,a.encType,a,null),Fd(e,t,`method`,a.method,a,null),Fd(e,t,`target`,a.target,a,null))),r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=Zt(``+r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=Qt);break;case`onScroll`:r!=null&&X(`scroll`,e);break;case`onScrollEnd`:r!=null&&X(`scrollend`,e);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));e.innerHTML=n}}break;case`multiple`:e.multiple=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`muted`:e.muted=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`ref`:break;case`autoFocus`:break;case`xlinkHref`:if(r==null||typeof r==`function`||typeof r==`boolean`||typeof r==`symbol`){e.removeAttribute(`xlink:href`);break}n=Zt(``+r),e.setAttributeNS(`http://www.w3.org/1999/xlink`,`xlink:href`,n);break;case`contentEditable`:case`spellCheck`:case`draggable`:case`value`:case`autoReverse`:case`externalResourcesRequired`:case`focusable`:case`preserveAlpha`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``+r):e.removeAttribute(n);break;case`inert`:case`allowFullScreen`:case`async`:case`autoPlay`:case`controls`:case`default`:case`defer`:case`disabled`:case`disablePictureInPicture`:case`disableRemotePlayback`:case`formNoValidate`:case`hidden`:case`loop`:case`noModule`:case`noValidate`:case`open`:case`playsInline`:case`readOnly`:case`required`:case`reversed`:case`scoped`:case`seamless`:case`itemScope`:r&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``):e.removeAttribute(n);break;case`capture`:case`download`:!0===r?e.setAttribute(n,``):!1!==r&&r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`cols`:case`rows`:case`size`:case`span`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case`rowSpan`:case`start`:r==null||typeof r==`function`||typeof r==`symbol`||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case`popover`:X(`beforetoggle`,e),X(`toggle`,e),At(e,`popover`,r);break;case`xlinkActuate`:jt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:jt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:jt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:jt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:jt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:jt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:jt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:jt(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:jt(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:At(e,`is`,r);break;case`innerText`:case`textContent`:break;default:(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)&&(n=Yt.get(n)||n,At(e,n,r))}}function Id(e,t,n,r,a,o){switch(n){case`style`:Jt(e,r,o);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));e.innerHTML=n}}break;case`children`:typeof r==`string`?Gt(e,r):(typeof r==`number`||typeof r==`bigint`)&&Gt(e,``+r);break;case`onScroll`:r!=null&&X(`scroll`,e);break;case`onScrollEnd`:r!=null&&X(`scrollend`,e);break;case`onClick`:r!=null&&(e.onclick=Qt);break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:break;case`innerText`:case`textContent`:break;default:if(!Ct.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(a=n.endsWith(`Capture`),t=n.slice(2,a?n.length-7:void 0),o=e[ut]||null,o=o==null?null:o[n],typeof o==`function`&&e.removeEventListener(t,o,a),typeof r==`function`)){typeof o!=`function`&&o!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,r,a);break a}n in e?e[n]=r:!0===r?e.setAttribute(n,``):At(e,n,r)}}}function Ld(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:X(`error`,e),X(`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:Fd(e,t,o,s,n,null)}}a&&Fd(e,t,`srcSet`,n.srcSet,n,null),r&&Fd(e,t,`src`,n.src,n,null);return;case`input`:X(`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:Fd(e,t,r,d,n,null)}}Vt(e,o,c,l,u,s,a,!1);return;case`select`:for(a in X(`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:Fd(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&Ht(e,!!r,n,!0):Ht(e,!!r,t,!1);return;case`textarea`:for(s in X(`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:Fd(e,t,s,c,n,null)}Wt(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:Fd(e,t,l,r,n,null)}return;case`dialog`:X(`beforetoggle`,e),X(`toggle`,e),X(`cancel`,e),X(`close`,e);break;case`iframe`:case`object`:X(`load`,e);break;case`video`:case`audio`:for(r=0;r<yd.length;r++)X(yd[r],e);break;case`image`:X(`error`,e),X(`load`,e);break;case`details`:X(`toggle`,e);break;case`embed`:case`source`:case`link`:X(`error`,e),X(`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:Fd(e,t,u,r,n,null)}return;default:if(z(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&Id(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&Fd(e,t,c,r,n,null))}function Rd(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)||Fd(e,t,m,null,r,f)}}for(var p in r){var m=r[p];if(f=n[p],r.hasOwnProperty(p)&&(m!=null||f!=null))switch(p){case`type`:o=m;break;case`name`:a=m;break;case`checked`:u=m;break;case`defaultChecked`:d=m;break;case`value`:s=m;break;case`defaultValue`:c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(i(137,t));break;default:m!==f&&Fd(e,t,p,m,r,f)}}Bt(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)||Fd(e,t,o,null,r,l)}for(a in r)if(o=r[a],l=n[a],r.hasOwnProperty(a)&&(o!=null||l!=null))switch(a){case`value`:p=o;break;case`defaultValue`:c=o;break;case`multiple`:s=o;default:o!==l&&Fd(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?Ht(e,!!n,n?[]:``,!1):Ht(e,!!n,t,!0)):Ht(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:Fd(e,t,c,null,r,a)}for(s in r)if(a=r[s],o=n[s],r.hasOwnProperty(s)&&(a!=null||o!=null))switch(s){case`value`:p=a;break;case`defaultValue`:m=a;break;case`children`:break;case`dangerouslySetInnerHTML`:if(a!=null)throw Error(i(91));break;default:a!==o&&Fd(e,t,s,a,r,o)}Ut(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:Fd(e,t,h,null,r,p)}for(l in r)if(p=r[l],m=n[l],r.hasOwnProperty(l)&&p!==m&&(p!=null||m!=null))switch(l){case`selected`:e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:Fd(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)&&Fd(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:Fd(e,t,u,p,r,m)}return;default:if(z(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&Id(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||Id(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&Fd(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||Fd(e,t,f,p,r,m)}function zd(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function Bd(){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&&zd(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&&zd(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 Vd=null,Hd=null;function Ud(e){return e.nodeType===9?e:e.ownerDocument}function Wd(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 Gd(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 Kd(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 qd=null;function Jd(){var e=window.event;return e&&e.type===`popstate`?e!==qd&&(qd=e,!0):(qd=null,!1)}var Yd=typeof setTimeout==`function`?setTimeout:void 0,Xd=typeof clearTimeout==`function`?clearTimeout:void 0,Zd=typeof Promise==`function`?Promise:void 0,Qd=typeof queueMicrotask==`function`?queueMicrotask:Zd===void 0?Yd:function(e){return Zd.resolve(null).then(e).catch($d)};function $d(e){setTimeout(function(){throw e})}function ef(e){return e===`head`}function tf(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),Fp(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)gf(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,gf(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[gt]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&gf(e.ownerDocument.body)}n=i}while(n);Fp(t)}function nf(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 rf(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`:rf(n),_t(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function af(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[gt])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=df(e.nextSibling),e===null)break}return null}function of(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=df(e.nextSibling),e===null))return null;return e}function sf(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=df(e.nextSibling),e===null))return null;return e}function cf(e){return e.data===`$?`||e.data===`$~`}function lf(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function uf(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 df(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 ff=null;function pf(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return df(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function mf(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 hf(e,t,n){switch(t=Ud(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 gf(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);_t(e)}var _f=new Map,vf=new Set;function yf(e){return typeof e.getRootNode==`function`?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var bf=j.d;j.d={f:xf,r:Sf,D:Tf,C:Ef,L:Df,m:Of,X:Af,S:kf,M:jf};function xf(){var e=bf.f(),t=xu();return e||t}function Sf(e){var t=yt(e);t!==null&&t.tag===5&&t.type===`form`?Cs(t):bf.r(e)}var Cf=typeof document>`u`?null:document;function wf(e,t,n){var r=Cf;if(r&&typeof t==`string`&&t){var i=zt(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),vf.has(i)||(vf.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),Ld(t,`link`,e),I(t),r.head.appendChild(t)))}}function Tf(e){bf.D(e),wf(`dns-prefetch`,e,null)}function Ef(e,t){bf.C(e,t),wf(`preconnect`,e,t)}function Df(e,t,n){bf.L(e,t,n);var r=Cf;if(r&&e&&t){var i=`link[rel="preload"][as="`+zt(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+zt(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+zt(n.imageSizes)+`"]`)):i+=`[href="`+zt(e)+`"]`;var a=i;switch(t){case`style`:a=Nf(e);break;case`script`:a=Lf(e)}_f.has(a)||(e=h({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),_f.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Pf(a))||t===`script`&&r.querySelector(Rf(a))||(t=r.createElement(`link`),Ld(t,`link`,e),I(t),r.head.appendChild(t)))}}function Of(e,t){bf.m(e,t);var n=Cf;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+zt(r)+`"][href="`+zt(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Lf(e)}if(!_f.has(a)&&(e=h({rel:`modulepreload`,href:e},t),_f.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Rf(a)))return}r=n.createElement(`link`),Ld(r,`link`,e),I(r),n.head.appendChild(r)}}}function kf(e,t,n){bf.S(e,t,n);var r=Cf;if(r&&e){var i=xt(r).hoistableStyles,a=Nf(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Pf(a)))s.loading=5;else{e=h({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=_f.get(a))&&Z(e,n);var c=o=r.createElement(`link`);I(c),Ld(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,Bf(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Af(e,t){bf.X(e,t);var n=Cf;if(n&&e){var r=xt(n).hoistableScripts,i=Lf(e),a=r.get(i);a||(a=n.querySelector(Rf(i)),a||(e=h({src:e,async:!0},t),(t=_f.get(i))&&Vf(e,t),a=n.createElement(`script`),I(a),Ld(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function jf(e,t){bf.M(e,t);var n=Cf;if(n&&e){var r=xt(n).hoistableScripts,i=Lf(e),a=r.get(i);a||(a=n.querySelector(Rf(i)),a||(e=h({src:e,async:!0,type:`module`},t),(t=_f.get(i))&&Vf(e,t),a=n.createElement(`script`),I(a),Ld(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Mf(e,t,n,r){var a=(a=de.current)?yf(a):null;if(!a)throw Error(i(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(t=Nf(n.href),n=xt(a).hoistableStyles,r=n.get(t),r||(r={type:`style`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=Nf(n.href);var o=xt(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(Pf(e)))&&!o._p&&(s.instance=o,s.state.loading=5),_f.has(e)||(n={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},_f.set(e,n),o||If(a,e,n,s.state))),t&&r===null)throw Error(i(528,``));return s}if(t&&r!==null)throw Error(i(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(t=Lf(n),n=xt(a).hoistableScripts,r=n.get(t),r||(r={type:`script`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(i(444,e))}}function Nf(e){return`href="`+zt(e)+`"`}function Pf(e){return`link[rel="stylesheet"][`+e+`]`}function Ff(e){return h({},e,{"data-precedence":e.precedence,precedence:null})}function If(e,t,n,r){e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)?r.loading=1:(t=e.createElement(`link`),r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2}),Ld(t,`link`,n),I(t),e.head.appendChild(t))}function Lf(e){return`[src="`+zt(e)+`"]`}function Rf(e){return`script[async]`+e}function zf(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+zt(n.href)+`"]`);if(r)return t.instance=r,I(r),r;var a=h({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),I(r),Ld(r,`style`,a),Bf(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Nf(n.href);var o=e.querySelector(Pf(a));if(o)return t.state.loading|=4,t.instance=o,I(o),o;r=Ff(n),(a=_f.get(a))&&Z(r,a),o=(e.ownerDocument||e).createElement(`link`),I(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),Ld(o,`link`,r),t.state.loading|=4,Bf(o,n.precedence,e),t.instance=o;case`script`:return o=Lf(n.src),(a=e.querySelector(Rf(o)))?(t.instance=a,I(a),a):(r=n,(a=_f.get(o))&&(r=h({},n),Vf(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),I(a),Ld(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,Bf(r,n.precedence,e));return t.instance}function Bf(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 Z(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function Vf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Hf=null;function Uf(e,t,n){if(Hf===null){var r=new Map,i=Hf=new Map;i.set(n,r)}else i=Hf,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[gt]||a[lt]||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 Wf(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function Gf(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 Kf(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function qf(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=Nf(r.href),a=t.querySelector(Pf(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=Xf.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,I(a);return}a=t.ownerDocument||t,r=Ff(r),(i=_f.get(i))&&Z(r,i),a=a.createElement(`link`),I(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),Ld(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=Xf.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var Jf=0;function Yf(e,t){return e.stylesheets&&e.count===0&&Qf(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&Qf(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&Jf===0&&(Jf=62500*Bd());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Qf(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>Jf?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function Xf(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Qf(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Zf=null;function Qf(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Zf=new Map,t.forEach($f,e),Zf=null,Xf.call(e))}function $f(e,t){if(!(t.state.loading&4)){var n=Zf.get(e);if(n)var r=n.get(null);else{n=new Map,Zf.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=Xf.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 ep={$$typeof:C,Provider:null,Consumer:null,_currentValue:oe,_currentValue2:oe,_threadCount:0};function tp(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=Qe(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Qe(0),this.hiddenUpdates=Qe(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.incompleteTransitions=new Map}function np(e,t,n,r,i,a,o,s,c,l,u,d){return e=new tp(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=ri(3,null,null,t),e.current=a,a.stateNode=e,t=na(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},Fa(a),e}function rp(e){return e?(e=ti,e):ti}function ip(e,t,n,r,i,a){i=rp(i),r.context===null?r.context=i:r.pendingContext=i,r=La(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=Ra(e,r,t),n!==null&&(gu(n,e,t),za(n,e,t))}function ap(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function op(e,t){ap(e,t),(e=e.alternate)&&ap(e,t)}function sp(e){if(e.tag===13||e.tag===31){var t=Qr(e,67108864);t!==null&&gu(t,e,67108864),op(e,67108864)}}function cp(e){if(e.tag===13||e.tag===31){var t=mu();t=it(t);var n=Qr(e,t);n!==null&&gu(n,e,t),op(e,t)}}var lp=!0;function up(e,t,n,r){var i=A.T;A.T=null;var a=j.p;try{j.p=2,fp(e,t,n,r)}finally{j.p=a,A.T=i}}function dp(e,t,n,r){var i=A.T;A.T=null;var a=j.p;try{j.p=8,fp(e,t,n,r)}finally{j.p=a,A.T=i}}function fp(e,t,n,r){if(lp){var i=pp(r);if(i===null)Ed(e,t,r,mp,n),Tp(e,r);else if(Dp(i,e,t,n,r))r.stopPropagation();else if(Tp(e,r),t&4&&-1<wp.indexOf(e)){for(;i!==null;){var a=yt(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=qe(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-Be(o);s.entanglements[1]|=c,o&=~c}ad(a),!(Rl&6)&&(ru=Oe()+500,od(0,!1))}}break;case 31:case 13:s=Qr(a,2),s!==null&&gu(s,a,2),xu(),op(a,2)}if(a=pp(r),a===null&&Ed(e,t,r,mp,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else Ed(e,t,r,null,n)}}function pp(e){return e=en(e),hp(e)}var mp=null;function hp(e){if(mp=null,e=vt(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 mp=e,null}function gp(e){switch(e){case`beforetoggle`:case`cancel`:case`click`:case`close`:case`contextmenu`:case`copy`:case`cut`:case`auxclick`:case`dblclick`:case`dragend`:case`dragstart`:case`drop`:case`focusin`:case`focusout`:case`input`:case`invalid`:case`keydown`:case`keypress`:case`keyup`:case`mousedown`:case`mouseup`:case`paste`:case`pause`:case`play`:case`pointercancel`:case`pointerdown`:case`pointerup`:case`ratechange`:case`reset`:case`resize`:case`seeked`:case`submit`:case`toggle`:case`touchcancel`:case`touchend`:case`touchstart`:case`volumechange`:case`change`:case`selectionchange`:case`textInput`:case`compositionstart`:case`compositionend`:case`compositionupdate`:case`beforeblur`:case`afterblur`:case`beforeinput`:case`blur`:case`fullscreenchange`:case`focus`:case`hashchange`:case`popstate`:case`select`:case`selectstart`:return 2;case`drag`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`mousemove`:case`mouseout`:case`mouseover`:case`pointermove`:case`pointerout`:case`pointerover`:case`scroll`:case`touchmove`:case`wheel`:case`mouseenter`:case`mouseleave`:case`pointerenter`:case`pointerleave`:return 8;case`message`:switch(ke()){case Ae:return 2;case je:return 8;case Me:case Ne:return 32;case Pe:return 268435456;default:return 32}default:return 32}}var _p=!1,vp=null,yp=null,bp=null,xp=new Map,Sp=new Map,Cp=[],wp=`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 Tp(e,t){switch(e){case`focusin`:case`focusout`:vp=null;break;case`dragenter`:case`dragleave`:yp=null;break;case`mouseover`:case`mouseout`:bp=null;break;case`pointerover`:case`pointerout`:xp.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:Sp.delete(t.pointerId)}}function Ep(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=yt(t),t!==null&&sp(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Dp(e,t,n,r,i){switch(t){case`focusin`:return vp=Ep(vp,e,t,n,r,i),!0;case`dragenter`:return yp=Ep(yp,e,t,n,r,i),!0;case`mouseover`:return bp=Ep(bp,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return xp.set(a,Ep(xp.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,Sp.set(a,Ep(Sp.get(a)||null,e,t,n,r,i)),!0}return!1}function Op(e){var t=vt(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,st(e.priority,function(){cp(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,st(e.priority,function(){cp(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 kp(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=pp(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);$t=r,n.target.dispatchEvent(r),$t=null}else return t=yt(n),t!==null&&sp(t),e.blockedOn=n,!1;t.shift()}return!0}function Ap(e,t,n){kp(e)&&n.delete(t)}function jp(){_p=!1,vp!==null&&kp(vp)&&(vp=null),yp!==null&&kp(yp)&&(yp=null),bp!==null&&kp(bp)&&(bp=null),xp.forEach(Ap),Sp.forEach(Ap)}function Mp(e,n){e.blockedOn===n&&(e.blockedOn=null,_p||(_p=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,jp)))}var Np=null;function Pp(e){Np!==e&&(Np=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Np===e&&(Np=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(hp(r||n)===null)continue;break}var a=yt(n);a!==null&&(e.splice(t,3),t-=3,xs(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Fp(e){function t(t){return Mp(t,e)}vp!==null&&Mp(vp,e),yp!==null&&Mp(yp,e),bp!==null&&Mp(bp,e),xp.forEach(t),Sp.forEach(t);for(var n=0;n<Cp.length;n++){var r=Cp[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Cp.length&&(n=Cp[0],n.blockedOn===null);)Op(n),n.blockedOn===null&&Cp.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[ut]||null;if(typeof a==`function`)o||Pp(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[ut]||null)s=o.formAction;else if(hp(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Pp(n)}}}function Ip(){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 Lp(e){this._internalRoot=e}Rp.prototype.render=Lp.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;ip(n,mu(),e,t,null,null)},Rp.prototype.unmount=Lp.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;ip(e.current,2,null,e,null,null),xu(),t[dt]=null}};function Rp(e){this._internalRoot=e}Rp.prototype.unstable_scheduleHydration=function(e){if(e){var t=ot();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Cp.length&&t!==0&&t<Cp[n].priority;n++);Cp.splice(n,0,e),n===0&&Op(e)}};var zp=n.version;if(zp!==`19.2.8`)throw Error(i(527,zp,`19.2.8`));j.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 Bp={bundleType:0,version:`19.2.8`,rendererPackageName:`react-dom`,currentDispatcherRef:A,reconcilerVersion:`19.2.8`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var Vp=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Vp.isDisabled&&Vp.supportsFiber)try{Le=Vp.inject(Bp),Re=Vp}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=Ws,s=Gs,c=Ks;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=np(e,1,!1,null,null,n,r,null,o,s,c,Ip),e[dt]=t.current,wd(e),new Lp(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(),y=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),b=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),x=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),S=e=>{let t=x(e);return t.charAt(0).toUpperCase()+t.slice(1)},C={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},w=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},T=(0,_.createContext)({}),E=()=>(0,_.useContext)(T),D=(0,_.forwardRef)(({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...s},c)=>{let{size:l=24,strokeWidth:u=2,absoluteStrokeWidth:d=!1,color:f=`currentColor`,className:p=``}=E()??{},m=r??d?Number(n??u)*24/Number(t??l):n??u;return(0,_.createElement)(`svg`,{ref:c,...C,width:t??l??C.width,height:t??l??C.height,stroke:e??f,strokeWidth:m,className:y(`lucide`,p,i),...!a&&!w(s)&&{"aria-hidden":`true`},...s},[...o.map(([e,t])=>(0,_.createElement)(e,t)),...Array.isArray(a)?a:[a]])}),O=(e,t)=>{let n=(0,_.forwardRef)(({className:n,...r},i)=>(0,_.createElement)(D,{ref:i,iconNode:t,className:y(`lucide-${b(S(e))}`,`lucide-${e}`,n),...r}));return n.displayName=S(e),n},ee=O(`activity`,[[`path`,{d:`M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2`,key:`169zse`}]]),te=O(`arrow-down`,[[`path`,{d:`M12 5v14`,key:`s699le`}],[`path`,{d:`m19 12-7 7-7-7`,key:`1idqje`}]]),k=O(`arrow-right`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`m12 5 7 7-7 7`,key:`xquz4c`}]]),ne=O(`arrow-up`,[[`path`,{d:`m5 12 7-7 7 7`,key:`hav0vg`}],[`path`,{d:`M12 19V5`,key:`x0mq9r`}]]),re=O(`brain`,[[`path`,{d:`M12 18V5`,key:`adv99a`}],[`path`,{d:`M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4`,key:`1e3is1`}],[`path`,{d:`M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5`,key:`1gqd8o`}],[`path`,{d:`M17.997 5.125a4 4 0 0 1 2.526 5.77`,key:`iwvgf7`}],[`path`,{d:`M18 18a4 4 0 0 0 2-7.464`,key:`efp6ie`}],[`path`,{d:`M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517`,key:`1gq6am`}],[`path`,{d:`M6 18a4 4 0 0 1-2-7.464`,key:`k1g0md`}],[`path`,{d:`M6.003 5.125a4 4 0 0 0-2.526 5.77`,key:`q97ue3`}]]),ie=O(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),ae=O(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),A=O(`chevron-left`,[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]),j=O(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),oe=O(`chevron-up`,[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]),M=O(`circle-arrow-up`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m16 12-4-4-4 4`,key:`177agl`}],[`path`,{d:`M12 16V8`,key:`1sbj14`}]]),se=O(`circle-check`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),ce=O(`copy`,[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]),N=O(`folder`,[[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]),P=O(`git-merge`,[[`circle`,{cx:`18`,cy:`18`,r:`3`,key:`1xkwt0`}],[`circle`,{cx:`6`,cy:`6`,r:`3`,key:`1lh9wr`}],[`path`,{d:`M6 21V9a9 9 0 0 0 9 9`,key:`7kw0sc`}]]),le=O(`heart`,[[`path`,{d:`M2 9.5a5.5 5.5 0 0 1 9.591-3.676.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 2.29-1.5 4-3 5.5l-5.492 5.313a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5`,key:`mvr1a0`}]]),ue=O(`info`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 16v-4`,key:`1dtifu`}],[`path`,{d:`M12 8h.01`,key:`e9boi3`}]]),de=O(`link`,[[`path`,{d:`M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71`,key:`1cjeqo`}],[`path`,{d:`M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71`,key:`19qd67`}]]),fe=O(`loader-circle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),pe=O(`loader`,[[`path`,{d:`M12 2v4`,key:`3427ic`}],[`path`,{d:`m16.2 7.8 2.9-2.9`,key:`r700ao`}],[`path`,{d:`M18 12h4`,key:`wj9ykh`}],[`path`,{d:`m16.2 16.2 2.9 2.9`,key:`1bxg5t`}],[`path`,{d:`M12 18v4`,key:`jadmvz`}],[`path`,{d:`m4.9 19.1 2.9-2.9`,key:`bwix9q`}],[`path`,{d:`M2 12h4`,key:`j09sii`}],[`path`,{d:`m4.9 4.9 2.9 2.9`,key:`giyufr`}]]),F=O(`menu`,[[`path`,{d:`M4 5h16`,key:`1tepv9`}],[`path`,{d:`M4 12h16`,key:`1lakjw`}],[`path`,{d:`M4 19h16`,key:`1djgab`}]]),me=O(`message-circle`,[[`path`,{d:`M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719`,key:`1sd12s`}]]),he=O(`moon`,[[`path`,{d:`M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401`,key:`kfwtm`}]]),ge=O(`octagon-x`,[[`path`,{d:`m15 9-6 6`,key:`1uzhvr`}],[`path`,{d:`M2.586 16.726A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2h6.624a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586z`,key:`2d38gg`}],[`path`,{d:`m9 9 6 6`,key:`z0biqf`}]]),_e=O(`panel-left-close`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}],[`path`,{d:`m16 15-3-3 3-3`,key:`14y99z`}]]),ve=O(`panel-left-open`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}],[`path`,{d:`m14 9 3 3-3 3`,key:`8010ee`}]]),ye=O(`pen-line`,[[`path`,{d:`M13 21h8`,key:`1jsn5i`}],[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}]]),be=O(`pencil`,[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}]]),xe=O(`pin`,[[`path`,{d:`M12 17v5`,key:`bb1du9`}],[`path`,{d:`M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z`,key:`1nkz8b`}]]),Se=O(`play`,[[`path`,{d:`M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z`,key:`10ikf1`}]]),Ce=O(`plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]),we=O(`power`,[[`path`,{d:`M12 2v10`,key:`mnfbl`}],[`path`,{d:`M18.4 6.6a9 9 0 1 1-12.77.04`,key:`obofu9`}]]),Te=O(`refresh-cw`,[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]),Ee=O(`rotate-ccw-clock`,[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}],[`path`,{d:`M12 7v5l4 2`,key:`1fdv2h`}]]),De=O(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]),Oe=O(`settings`,[[`path`,{d:`M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915`,key:`1i5ecw`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),ke=O(`sparkles`,[[`path`,{d:`M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z`,key:`1s2grr`}],[`path`,{d:`M20 2v4`,key:`1rf3ol`}],[`path`,{d:`M22 4h-4`,key:`gwowj6`}],[`circle`,{cx:`4`,cy:`20`,r:`2`,key:`6kqj1y`}]]),Ae=O(`sun`,[[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`m4.93 4.93 1.41 1.41`,key:`149t6j`}],[`path`,{d:`m17.66 17.66 1.41 1.41`,key:`ptbguv`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`m6.34 17.66-1.41 1.41`,key:`1m8zz5`}],[`path`,{d:`m19.07 4.93-1.41 1.41`,key:`1shlcs`}]]),je=O(`tags`,[[`path`,{d:`M13.172 2a2 2 0 0 1 1.414.586l6.71 6.71a2.4 2.4 0 0 1 0 3.408l-4.592 4.592a2.4 2.4 0 0 1-3.408 0l-6.71-6.71A2 2 0 0 1 6 9.172V3a1 1 0 0 1 1-1z`,key:`16rjxf`}],[`path`,{d:`M2 7v6.172a2 2 0 0 0 .586 1.414l6.71 6.71a2.4 2.4 0 0 0 3.191.193`,key:`178nd4`}],[`circle`,{cx:`10.5`,cy:`6.5`,r:`.5`,fill:`currentColor`,key:`12ikhr`}]]),Me=O(`target`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`circle`,{cx:`12`,cy:`12`,r:`6`,key:`1vlfrh`}],[`circle`,{cx:`12`,cy:`12`,r:`2`,key:`1c9p78`}]]),Ne=O(`trash-2`,[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]]),Pe=O(`trash`,[[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]]),Fe=O(`triangle-alert`,[[`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`,key:`wmoenq`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),Ie=O(`undo-2`,[[`path`,{d:`M9 14 4 9l5-5`,key:`102s5s`}],[`path`,{d:`M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11`,key:`f3b9sd`}]]),Le=O(`user-x`,[[`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`,key:`1yyitq`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}],[`line`,{x1:`17`,x2:`22`,y1:`8`,y2:`13`,key:`3nzzx3`}],[`line`,{x1:`22`,x2:`17`,y1:`8`,y2:`13`,key:`1swrse`}]]),Re=O(`user`,[[`path`,{d:`M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2`,key:`975kel`}],[`circle`,{cx:`12`,cy:`7`,r:`4`,key:`17ys0d`}]]),ze=O(`workflow`,[[`rect`,{width:`8`,height:`8`,x:`3`,y:`3`,rx:`2`,key:`by2w9f`}],[`path`,{d:`M7 11v4a2 2 0 0 0 2 2h4`,key:`xkn7yn`}],[`rect`,{width:`8`,height:`8`,x:`13`,y:`13`,rx:`2`,key:`1cgmvn`}]]),Be=O(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]);function Ve(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=Ve(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n)}return r}function He(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=Ve(e))&&(r&&(r+=` `),r+=t);return r}var Ue=(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},We=(e,t)=>({classGroupId:e,validator:t}),Ge=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),Ke=`-`,qe=[],Je=`arbitrary..`,Ye=e=>{let t=Qe(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith(`[`)&&e.endsWith(`]`))return Ze(e);let n=e.split(Ke);return Xe(n,+(n[0]===``&&n.length>1),t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=r[e],i=n[e];return t?i?Ue(i,t):t:i||qe}return n[e]||qe}}},Xe=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;let r=e[t],i=n.nextPart.get(r);if(i){let n=Xe(e,t+1,i);if(n)return n}let a=n.validators;if(a===null)return;let o=t===0?e.join(Ke):e.slice(t).join(Ke),s=a.length;for(let e=0;e<s;e++){let t=a[e];if(t.validator(o))return t.classGroupId}},Ze=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?Je+r:void 0})(),Qe=e=>{let{theme:t,classGroups:n}=e;return $e(n,t)},$e=(e,t)=>{let n=Ge();for(let r in e){let i=e[r];et(i,n,r,t)}return n},et=(e,t,n,r)=>{let i=e.length;for(let a=0;a<i;a++){let i=e[a];tt(i,t,n,r)}},tt=(e,t,n,r)=>{if(typeof e==`string`){nt(e,t,n);return}if(typeof e==`function`){rt(e,t,n,r);return}it(e,t,n,r)},nt=(e,t,n)=>{let r=e===``?t:at(t,e);r.classGroupId=n},rt=(e,t,n,r)=>{if(ot(e)){et(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(We(n,e))},it=(e,t,n,r)=>{let i=Object.entries(e),a=i.length;for(let e=0;e<a;e++){let[a,o]=i[e];et(o,at(t,a),n,r)}},at=(e,t)=>{let n=e,r=t.split(Ke),i=r.length;for(let e=0;e<i;e++){let t=r[e],i=n.nextPart.get(t);i||(i=Ge(),n.nextPart.set(t,i)),n=i}return n},ot=e=>`isThemeGetter`in e&&e.isThemeGetter===!0,st=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)}}},ct=`!`,lt=`:`,ut=[],dt=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),ft=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===lt){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(ct)?(c=s.slice(0,-1),l=!0):s.startsWith(ct)&&(c=s.slice(1),l=!0);let u=a&&a>i?a-i:void 0;return dt(t,l,c,u)};if(t){let e=t+lt,n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):dt(ut,!1,t,void 0,!0)}if(n){let e=r;r=t=>n({className:t,parseClassName:e})}return r},pt=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}},mt=e=>({cache:st(e.cacheSize),parseClassName:ft(e),sortModifiers:pt(e),postfixLookupClassGroupIds:ht(e),...Ye(e)}),ht=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},gt=/\s+/,_t=(e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a,postfixLookupClassGroupIds:o}=t,s=[],c=e.trim().split(gt),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?_+ct:_,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},vt=(...e)=>{let t=0,n,r,i=``;for(;t<e.length;)(n=e[t++])&&(r=yt(n))&&(i&&(i+=` `),i+=r);return i},yt=e=>{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r<e.length;r++)e[r]&&(t=yt(e[r]))&&(n&&(n+=` `),n+=t);return n},bt=(e,...t)=>{let n,r,i,a,o=o=>(n=mt(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=_t(e,n);return i(e,a),a};return a=o,(...e)=>a(vt(...e))},xt=[],I=e=>{let t=t=>t[e]||xt;return t.isThemeGetter=!0,t},St=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Ct=/^\((?:(\w[\w-]*):)?(.+)\)$/i,wt=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,Tt=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Et=/\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$/,Dt=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Ot=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,kt=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,At=e=>wt.test(e),L=e=>!!e&&!Number.isNaN(Number(e)),jt=e=>!!e&&Number.isInteger(Number(e)),Mt=e=>e.endsWith(`%`)&&L(e.slice(0,-1)),Nt=e=>Tt.test(e),Pt=()=>!0,Ft=e=>Et.test(e)&&!Dt.test(e),It=()=>!1,Lt=e=>Ot.test(e),Rt=e=>kt.test(e),zt=e=>!R(e)&&!z(e),Bt=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)),Vt=e=>nn(e,sn,It),R=e=>St.test(e),Ht=e=>nn(e,cn,Ft),Ut=e=>nn(e,ln,L),Wt=e=>nn(e,dn,Pt),Gt=e=>nn(e,un,It),Kt=e=>nn(e,an,It),qt=e=>nn(e,on,Rt),Jt=e=>nn(e,fn,Lt),z=e=>Ct.test(e),Yt=e=>rn(e,cn),Xt=e=>rn(e,un),Zt=e=>rn(e,an),Qt=e=>rn(e,sn),$t=e=>rn(e,on),en=e=>rn(e,fn,!0),tn=e=>rn(e,dn,!0),nn=(e,t,n)=>{let r=St.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},rn=(e,t,n=!1)=>{let r=Ct.exec(e);return r?r[1]?t(r[1]):n:!1},an=e=>e===`position`||e===`percentage`,on=e=>e===`image`||e===`url`,sn=e=>e===`length`||e===`size`||e===`bg-size`,cn=e=>e===`length`,ln=e=>e===`number`,un=e=>e===`family-name`,dn=e=>e===`number`||e===`weight`,fn=e=>e===`shadow`,pn=bt(()=>{let e=I(`color`),t=I(`font`),n=I(`text`),r=I(`font-weight`),i=I(`tracking`),a=I(`leading`),o=I(`breakpoint`),s=I(`container`),c=I(`spacing`),l=I(`radius`),u=I(`shadow`),d=I(`inset-shadow`),f=I(`text-shadow`),p=I(`drop-shadow`),m=I(`blur`),h=I(`perspective`),g=I(`aspect`),_=I(`ease`),v=I(`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(),z,R],S=()=>[`auto`,`hidden`,`clip`,`visible`,`scroll`],C=()=>[`auto`,`contain`,`none`],w=()=>[z,R,c],T=()=>[At,`full`,`auto`,...w()],E=()=>[jt,`none`,`subgrid`,z,R],D=()=>[`auto`,{span:[`full`,jt,z,R]},jt,z,R],O=()=>[jt,`auto`,z,R],ee=()=>[`auto`,`min`,`max`,`fr`,z,R],te=()=>[`start`,`end`,`center`,`between`,`around`,`evenly`,`stretch`,`baseline`,`center-safe`,`end-safe`],k=()=>[`start`,`end`,`center`,`stretch`,`center-safe`,`end-safe`],ne=()=>[`auto`,...w()],re=()=>[At,`auto`,`full`,`dvw`,`dvh`,`lvw`,`lvh`,`svw`,`svh`,`min`,`max`,`fit`,...w()],ie=()=>[At,`screen`,`full`,`dvw`,`lvw`,`svw`,`min`,`max`,`fit`,...w()],ae=()=>[At,`screen`,`full`,`lh`,`dvh`,`lvh`,`svh`,`min`,`max`,`fit`,...w()],A=()=>[e,z,R],j=()=>[...b(),Zt,Kt,{position:[z,R]}],oe=()=>[`no-repeat`,{repeat:[``,`x`,`y`,`space`,`round`]}],M=()=>[`auto`,`cover`,`contain`,Qt,Vt,{size:[z,R]}],se=()=>[Mt,Yt,Ht],ce=()=>[``,`none`,`full`,l,z,R],N=()=>[``,L,Yt,Ht],P=()=>[`solid`,`dashed`,`dotted`,`double`],le=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],ue=()=>[L,Mt,Zt,Kt],de=()=>[``,`none`,m,z,R],fe=()=>[`none`,L,z,R],pe=()=>[`none`,L,z,R],F=()=>[L,z,R],me=()=>[At,`full`,...w()];return{cacheSize:500,theme:{animate:[`spin`,`ping`,`pulse`,`bounce`],aspect:[`video`],blur:[Nt],breakpoint:[Nt],color:[Pt],container:[Nt],"drop-shadow":[Nt],ease:[`in`,`out`,`in-out`],font:[zt],"font-weight":[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`],"inset-shadow":[Nt],leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`],perspective:[`dramatic`,`near`,`normal`,`midrange`,`distant`,`none`],radius:[Nt],shadow:[Nt],spacing:[`px`,L],text:[Nt],"text-shadow":[Nt],tracking:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`]},classGroups:{aspect:[{aspect:[`auto`,`square`,At,R,z,g]}],container:[`container`],"container-type":[{"@container":[``,`normal`,`size`,z,R]}],"container-named":[Bt],columns:[{columns:[L,R,z,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:[jt,`auto`,z,R]}],basis:[{basis:[At,`full`,`auto`,s,...w()]}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`nowrap`,`wrap`,`wrap-reverse`]}],flex:[{flex:[L,At,`auto`,`initial`,`none`,R]}],grow:[{grow:[``,L,z,R]}],shrink:[{shrink:[``,L,z,R]}],order:[{order:[jt,`first`,`last`,`none`,z,R]}],"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":ee()}],"auto-rows":[{"auto-rows":ee()}],gap:[{gap:w()}],"gap-x":[{"gap-x":w()}],"gap-y":[{"gap-y":w()}],"justify-content":[{justify:[...te(),`normal`]}],"justify-items":[{"justify-items":[...k(),`normal`]}],"justify-self":[{"justify-self":[`auto`,...k()]}],"align-content":[{content:[`normal`,...te()]}],"align-items":[{items:[...k(),{baseline:[``,`last`]}]}],"align-self":[{self:[`auto`,...k(),{baseline:[``,`last`]}]}],"place-content":[{"place-content":te()}],"place-items":[{"place-items":[...k(),`baseline`]}],"place-self":[{"place-self":[`auto`,...k()]}],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:ne()}],mx:[{mx:ne()}],my:[{my:ne()}],ms:[{ms:ne()}],me:[{me:ne()}],mbs:[{mbs:ne()}],mbe:[{mbe:ne()}],mt:[{mt:ne()}],mr:[{mr:ne()}],mb:[{mb:ne()}],ml:[{ml:ne()}],"space-x":[{"space-x":w()}],"space-x-reverse":[`space-x-reverse`],"space-y":[{"space-y":w()}],"space-y-reverse":[`space-y-reverse`],size:[{size:re()}],"inline-size":[{inline:[`auto`,...ie()]}],"min-inline-size":[{"min-inline":[`auto`,...ie()]}],"max-inline-size":[{"max-inline":[`none`,...ie()]}],"block-size":[{block:[`auto`,...ae()]}],"min-block-size":[{"min-block":[`auto`,...ae()]}],"max-block-size":[{"max-block":[`none`,...ae()]}],w:[{w:[s,`screen`,...re()]}],"min-w":[{"min-w":[s,`screen`,`none`,...re()]}],"max-w":[{"max-w":[s,`screen`,`none`,`prose`,{screen:[o]},...re()]}],h:[{h:[`screen`,`lh`,...re()]}],"min-h":[{"min-h":[`screen`,`lh`,`none`,...re()]}],"max-h":[{"max-h":[`screen`,`lh`,...re()]}],"font-size":[{text:[`base`,n,Yt,Ht]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[r,tn,Wt]}],"font-stretch":[{"font-stretch":[`ultra-condensed`,`extra-condensed`,`condensed`,`semi-condensed`,`normal`,`semi-expanded`,`expanded`,`extra-expanded`,`ultra-expanded`,Mt,R]}],"font-family":[{font:[Xt,Gt,t]}],"font-features":[{"font-features":[R]}],"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,z,R]}],"line-clamp":[{"line-clamp":[L,`none`,z,Ut]}],leading:[{leading:[a,...w()]}],"list-image":[{"list-image":[`none`,z,R]}],"list-style-position":[{list:[`inside`,`outside`]}],"list-style-type":[{list:[`disc`,`decimal`,`none`,z,R]}],"text-alignment":[{text:[`left`,`center`,`right`,`justify`,`start`,`end`]}],"placeholder-color":[{placeholder:A()}],"text-color":[{text:A()}],"text-decoration":[`underline`,`overline`,`line-through`,`no-underline`],"text-decoration-style":[{decoration:[...P(),`wavy`]}],"text-decoration-thickness":[{decoration:[L,`from-font`,`auto`,z,Ht]}],"text-decoration-color":[{decoration:A()}],"underline-offset":[{"underline-offset":[L,`auto`,z,R]}],"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:[jt,z,R]}],"vertical-align":[{align:[`baseline`,`top`,`middle`,`bottom`,`text-top`,`text-bottom`,`sub`,`super`,z,R]}],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`,z,R]}],"bg-attachment":[{bg:[`fixed`,`local`,`scroll`]}],"bg-clip":[{"bg-clip":[`border`,`padding`,`content`,`text`]}],"bg-origin":[{"bg-origin":[`border`,`padding`,`content`]}],"bg-position":[{bg:j()}],"bg-repeat":[{bg:oe()}],"bg-size":[{bg:M()}],"bg-image":[{bg:[`none`,{linear:[{to:[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},jt,z,R],radial:[``,z,R],conic:[jt,z,R]},$t,qt]}],"bg-color":[{bg:A()}],"gradient-from-pos":[{from:se()}],"gradient-via-pos":[{via:se()}],"gradient-to-pos":[{to:se()}],"gradient-from":[{from:A()}],"gradient-via":[{via:A()}],"gradient-to":[{to:A()}],rounded:[{rounded:ce()}],"rounded-s":[{"rounded-s":ce()}],"rounded-e":[{"rounded-e":ce()}],"rounded-t":[{"rounded-t":ce()}],"rounded-r":[{"rounded-r":ce()}],"rounded-b":[{"rounded-b":ce()}],"rounded-l":[{"rounded-l":ce()}],"rounded-ss":[{"rounded-ss":ce()}],"rounded-se":[{"rounded-se":ce()}],"rounded-ee":[{"rounded-ee":ce()}],"rounded-es":[{"rounded-es":ce()}],"rounded-tl":[{"rounded-tl":ce()}],"rounded-tr":[{"rounded-tr":ce()}],"rounded-br":[{"rounded-br":ce()}],"rounded-bl":[{"rounded-bl":ce()}],"border-w":[{border:N()}],"border-w-x":[{"border-x":N()}],"border-w-y":[{"border-y":N()}],"border-w-s":[{"border-s":N()}],"border-w-e":[{"border-e":N()}],"border-w-bs":[{"border-bs":N()}],"border-w-be":[{"border-be":N()}],"border-w-t":[{"border-t":N()}],"border-w-r":[{"border-r":N()}],"border-w-b":[{"border-b":N()}],"border-w-l":[{"border-l":N()}],"divide-x":[{"divide-x":N()}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":N()}],"divide-y-reverse":[`divide-y-reverse`],"border-style":[{border:[...P(),`hidden`,`none`]}],"divide-style":[{divide:[...P(),`hidden`,`none`]}],"border-color":[{border:A()}],"border-color-x":[{"border-x":A()}],"border-color-y":[{"border-y":A()}],"border-color-s":[{"border-s":A()}],"border-color-e":[{"border-e":A()}],"border-color-bs":[{"border-bs":A()}],"border-color-be":[{"border-be":A()}],"border-color-t":[{"border-t":A()}],"border-color-r":[{"border-r":A()}],"border-color-b":[{"border-b":A()}],"border-color-l":[{"border-l":A()}],"divide-color":[{divide:A()}],"outline-style":[{outline:[...P(),`none`,`hidden`]}],"outline-offset":[{"outline-offset":[L,z,R]}],"outline-w":[{outline:[``,L,Yt,Ht]}],"outline-color":[{outline:A()}],shadow:[{shadow:[``,`none`,u,en,Jt]}],"shadow-color":[{shadow:A()}],"inset-shadow":[{"inset-shadow":[`none`,d,en,Jt]}],"inset-shadow-color":[{"inset-shadow":A()}],"ring-w":[{ring:N()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:A()}],"ring-offset-w":[{"ring-offset":[L,Ht]}],"ring-offset-color":[{"ring-offset":A()}],"inset-ring-w":[{"inset-ring":N()}],"inset-ring-color":[{"inset-ring":A()}],"text-shadow":[{"text-shadow":[`none`,f,en,Jt]}],"text-shadow-color":[{"text-shadow":A()}],opacity:[{opacity:[L,z,R]}],"mix-blend":[{"mix-blend":[...le(),`plus-darker`,`plus-lighter`]}],"bg-blend":[{"bg-blend":le()}],"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":[L]}],"mask-image-linear-from-pos":[{"mask-linear-from":ue()}],"mask-image-linear-to-pos":[{"mask-linear-to":ue()}],"mask-image-linear-from-color":[{"mask-linear-from":A()}],"mask-image-linear-to-color":[{"mask-linear-to":A()}],"mask-image-t-from-pos":[{"mask-t-from":ue()}],"mask-image-t-to-pos":[{"mask-t-to":ue()}],"mask-image-t-from-color":[{"mask-t-from":A()}],"mask-image-t-to-color":[{"mask-t-to":A()}],"mask-image-r-from-pos":[{"mask-r-from":ue()}],"mask-image-r-to-pos":[{"mask-r-to":ue()}],"mask-image-r-from-color":[{"mask-r-from":A()}],"mask-image-r-to-color":[{"mask-r-to":A()}],"mask-image-b-from-pos":[{"mask-b-from":ue()}],"mask-image-b-to-pos":[{"mask-b-to":ue()}],"mask-image-b-from-color":[{"mask-b-from":A()}],"mask-image-b-to-color":[{"mask-b-to":A()}],"mask-image-l-from-pos":[{"mask-l-from":ue()}],"mask-image-l-to-pos":[{"mask-l-to":ue()}],"mask-image-l-from-color":[{"mask-l-from":A()}],"mask-image-l-to-color":[{"mask-l-to":A()}],"mask-image-x-from-pos":[{"mask-x-from":ue()}],"mask-image-x-to-pos":[{"mask-x-to":ue()}],"mask-image-x-from-color":[{"mask-x-from":A()}],"mask-image-x-to-color":[{"mask-x-to":A()}],"mask-image-y-from-pos":[{"mask-y-from":ue()}],"mask-image-y-to-pos":[{"mask-y-to":ue()}],"mask-image-y-from-color":[{"mask-y-from":A()}],"mask-image-y-to-color":[{"mask-y-to":A()}],"mask-image-radial":[{"mask-radial":[z,R]}],"mask-image-radial-from-pos":[{"mask-radial-from":ue()}],"mask-image-radial-to-pos":[{"mask-radial-to":ue()}],"mask-image-radial-from-color":[{"mask-radial-from":A()}],"mask-image-radial-to-color":[{"mask-radial-to":A()}],"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":[L]}],"mask-image-conic-from-pos":[{"mask-conic-from":ue()}],"mask-image-conic-to-pos":[{"mask-conic-to":ue()}],"mask-image-conic-from-color":[{"mask-conic-from":A()}],"mask-image-conic-to-color":[{"mask-conic-to":A()}],"mask-mode":[{mask:[`alpha`,`luminance`,`match`]}],"mask-origin":[{"mask-origin":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]}],"mask-position":[{mask:j()}],"mask-repeat":[{mask:oe()}],"mask-size":[{mask:M()}],"mask-type":[{"mask-type":[`alpha`,`luminance`]}],"mask-image":[{mask:[`none`,z,R]}],filter:[{filter:[``,`none`,z,R]}],blur:[{blur:de()}],brightness:[{brightness:[L,z,R]}],contrast:[{contrast:[L,z,R]}],"drop-shadow":[{"drop-shadow":[``,`none`,p,en,Jt]}],"drop-shadow-color":[{"drop-shadow":A()}],grayscale:[{grayscale:[``,L,z,R]}],"hue-rotate":[{"hue-rotate":[L,z,R]}],invert:[{invert:[``,L,z,R]}],saturate:[{saturate:[L,z,R]}],sepia:[{sepia:[``,L,z,R]}],"backdrop-filter":[{"backdrop-filter":[``,`none`,z,R]}],"backdrop-blur":[{"backdrop-blur":de()}],"backdrop-brightness":[{"backdrop-brightness":[L,z,R]}],"backdrop-contrast":[{"backdrop-contrast":[L,z,R]}],"backdrop-grayscale":[{"backdrop-grayscale":[``,L,z,R]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[L,z,R]}],"backdrop-invert":[{"backdrop-invert":[``,L,z,R]}],"backdrop-opacity":[{"backdrop-opacity":[L,z,R]}],"backdrop-saturate":[{"backdrop-saturate":[L,z,R]}],"backdrop-sepia":[{"backdrop-sepia":[``,L,z,R]}],"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`,z,R]}],"transition-behavior":[{transition:[`normal`,`discrete`]}],duration:[{duration:[L,`initial`,z,R]}],ease:[{ease:[`linear`,`initial`,_,z,R]}],delay:[{delay:[L,z,R]}],animate:[{animate:[`none`,v,z,R]}],backface:[{backface:[`hidden`,`visible`]}],perspective:[{perspective:[h,z,R]}],"perspective-origin":[{"perspective-origin":x()}],rotate:[{rotate:fe()}],"rotate-x":[{"rotate-x":fe()}],"rotate-y":[{"rotate-y":fe()}],"rotate-z":[{"rotate-z":fe()}],scale:[{scale:pe()}],"scale-x":[{"scale-x":pe()}],"scale-y":[{"scale-y":pe()}],"scale-z":[{"scale-z":pe()}],"scale-3d":[`scale-3d`],skew:[{skew:F()}],"skew-x":[{"skew-x":F()}],"skew-y":[{"skew-y":F()}],transform:[{transform:[z,R,``,`none`,`gpu`,`cpu`]}],"transform-origin":[{origin:x()}],"transform-style":[{transform:[`3d`,`flat`]}],translate:[{translate:me()}],"translate-x":[{"translate-x":me()}],"translate-y":[{"translate-y":me()}],"translate-z":[{"translate-z":me()}],"translate-none":[`translate-none`],zoom:[{zoom:[jt,z,R]}],accent:[{accent:A()}],appearance:[{appearance:[`none`,`auto`]}],"caret-color":[{caret:A()}],"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`,z,R]}],"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":A()}],"scrollbar-track-color":[{"scrollbar-track":A()}],"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`,z,R]}],fill:[{fill:[`none`,...A()]}],"stroke-w":[{stroke:[L,Yt,Ht,Ut]}],stroke:[{stroke:[`none`,...A()]}],"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":[`right`,`left`],"inset-y":[`top`,`bottom`],flex:[`basis`,`grow`,`shrink`],gap:[`gap-x`,`gap-y`],p:[`px`,`py`,`ps`,`pe`,`pbs`,`pbe`,`pt`,`pr`,`pb`,`pl`],px:[`pr`,`pl`],py:[`pt`,`pb`],m:[`mx`,`my`,`ms`,`me`,`mbs`,`mbe`,`mt`,`mr`,`mb`,`ml`],mx:[`mr`,`ml`],my:[`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-r`,`border-w-l`],"border-w-y":[`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-r`,`border-color-l`],"border-color-y":[`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-mr`,`scroll-ml`],"scroll-my":[`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-pr`,`scroll-pl`],"scroll-py":[`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 B(...e){return pn(He(e))}var mn=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})),V=o(((e,t)=>{t.exports=mn()}))();function hn(e){let t=[];return _.Children.forEach(e,e=>{if(!_.isValidElement(e))return;if(e.type===_.Fragment){t.push(...hn(e.props.children));return}if(e.type!==`option`)return;let n=e.props;t.push({value:String(n.value??``),label:n.children,disabled:!!n.disabled})}),t}function gn({id:e,className:t,value:n,onChange:r,required:i,disabled:a,"aria-label":o,children:s}){let c=hn(s),l=String(n),u=c.find(e=>e.value===l),[d,f]=_.useState(!1),[p,m]=_.useState(-1),h=_.useRef(null),g=_.useRef(null),v=_.useRef(null),y=_.useId();_.useEffect(()=>{if(!d)return;let e=e=>{h.current?.contains(e.target)||f(!1)};return document.addEventListener(`pointerdown`,e),()=>document.removeEventListener(`pointerdown`,e)},[d]),_.useEffect(()=>{!d||p<0||v.current?.children[p]?.scrollIntoView({block:`nearest`})},[d,p]),_.useEffect(()=>{let e=v.current;if(!d||!e)return;let t=t=>{t.preventDefault(),Math.abs(t.deltaX)>Math.abs(t.deltaY)?e.scrollLeft+=t.deltaX:e.scrollTop+=t.shiftKey&&!t.deltaX?0:t.deltaY,t.shiftKey&&!t.deltaX&&(e.scrollLeft+=t.deltaY)};return e.addEventListener(`wheel`,t,{passive:!1}),()=>e.removeEventListener(`wheel`,t)},[d]);let b=()=>{a||(m(Math.max(0,c.findIndex(e=>e.value===l))),f(!0))},x=e=>{e.disabled||(f(!1),g.current?.focus(),e.value!==l&&r({target:{value:e.value},currentTarget:{value:e.value}}))},S=(e,t)=>{for(let n=e+t;n>=0&&n<c.length;n+=t)if(!c[n].disabled)return n;return e};return(0,V.jsxs)(`div`,{ref:h,className:B(`relative min-w-0 max-w-full`,t?.includes(`w-full`)&&`w-full`),children:[(0,V.jsxs)(`button`,{ref:g,id:e,type:`button`,role:`combobox`,"aria-label":o,"aria-haspopup":`listbox`,"aria-expanded":d,"aria-controls":y,"aria-required":i,"aria-activedescendant":d&&p>=0?`${y}-${p}`:void 0,disabled:a,onClick:()=>d?f(!1):b(),onKeyDown:e=>{if(!d){[`ArrowDown`,`ArrowUp`,`Enter`,` `].includes(e.key)&&(e.preventDefault(),b());return}switch(e.key){case`ArrowDown`:e.preventDefault(),m(e=>S(e,1));break;case`ArrowUp`:e.preventDefault(),m(e=>S(e,-1));break;case`Home`:e.preventDefault(),m(S(-1,1));break;case`End`:e.preventDefault(),m(S(c.length,-1));break;case`Enter`:case` `:e.preventDefault(),c[p]&&x(c[p]);break;case`Escape`:e.preventDefault(),f(!1);break;case`Tab`:f(!1)}},className:B(`flex h-9 max-w-full items-center justify-between gap-2 rounded-[10px] border border-input bg-card px-2.5 text-ui text-foreground text-start transition-colors duration-150 hover:bg-interactive-hover focus-visible:border-ring focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50`,t,`flex h-9 rounded-[10px] border-input bg-card text-ui`),children:[(0,V.jsx)(`span`,{className:`min-w-0 truncate`,children:u?.label??``}),(0,V.jsx)(ae,{className:B(`size-4 shrink-0 text-muted-foreground transition-transform duration-200`,d&&`rotate-180`)})]}),d?(0,V.jsx)(`ul`,{ref:v,id:y,role:`listbox`,"aria-label":o,className:`absolute start-0 top-full z-20 mt-1 max-h-64 w-max min-w-full max-w-[min(40rem,calc(100vw-2rem))] overflow-auto overscroll-contain rounded-[10px] border border-input bg-card p-1 shadow-sm`,children:c.map((e,t)=>(0,V.jsxs)(`li`,{id:`${y}-${t}`,role:`option`,"aria-selected":e.value===l,"aria-disabled":e.disabled||void 0,onPointerMove:()=>!e.disabled&&m(t),onPointerDown:e=>e.preventDefault(),onClick:()=>x(e),className:B(`flex w-max min-w-full cursor-pointer items-center justify-between gap-3 whitespace-nowrap rounded-md px-2.5 py-1.5 text-sm text-card-foreground transition-colors`,t===p&&`bg-selection text-foreground`,e.value===l&&`font-medium`,e.disabled&&`cursor-not-allowed opacity-50`),children:[(0,V.jsx)(`span`,{className:`shrink-0`,title:typeof e.label==`string`?e.label:void 0,children:e.label}),e.value===l?(0,V.jsx)(ie,{className:`size-3.5 shrink-0 text-primary`}):null]},`${e.value}-${t}`))}):null]})}var _n=c(m(),1);function vn(e){if(!e||typeof document>`u`)return;let t=document.head||document.getElementsByTagName(`head`)[0],n=document.createElement(`style`);n.type=`text/css`,t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}var yn=e=>{switch(e){case`success`:return Sn;case`info`:return wn;case`warning`:return Cn;case`error`:return Tn;default:return null}},bn=Array(12).fill(0),xn=({visible:e,className:t})=>_.createElement(`div`,{className:[`sonner-loading-wrapper`,t].filter(Boolean).join(` `),"data-visible":e},_.createElement(`div`,{className:`sonner-spinner`},bn.map((e,t)=>_.createElement(`div`,{className:`sonner-loading-bar`,key:`spinner-bar-${t}`})))),Sn=_.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`,"aria-hidden":`true`},_.createElement(`path`,{fillRule:`evenodd`,d:`M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z`,clipRule:`evenodd`})),Cn=_.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`currentColor`,height:`20`,width:`20`,"aria-hidden":`true`},_.createElement(`path`,{fillRule:`evenodd`,d:`M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z`,clipRule:`evenodd`})),wn=_.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`,"aria-hidden":`true`},_.createElement(`path`,{fillRule:`evenodd`,d:`M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z`,clipRule:`evenodd`})),Tn=_.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`,"aria-hidden":`true`},_.createElement(`path`,{fillRule:`evenodd`,d:`M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z`,clipRule:`evenodd`})),En=_.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`},_.createElement(`line`,{x1:`18`,y1:`6`,x2:`6`,y2:`18`}),_.createElement(`line`,{x1:`6`,y1:`6`,x2:`18`,y2:`18`})),Dn=()=>{let[e,t]=_.useState(document.hidden);return _.useEffect(()=>{let e=()=>{t(document.hidden)};return document.addEventListener(`visibilitychange`,e),()=>document.removeEventListener(`visibilitychange`,e)},[]),e},On=1,kn=100,An=e=>typeof e?.id==`number`||e?.id?.length>0?e.id:On++,jn=new class{constructor(){this.subscribe=e=>(this.subscribers.push(e),this.getActiveToasts().forEach(t=>e(t)),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e],this.trimHistory()},this.trimHistory=()=>{let e=this.toasts.length-kn;e<=0||(this.toasts=this.toasts.filter(t=>e>0&&this.dismissedToasts.has(t.id)?(this.dismissedToasts.delete(t.id),e--,!1):!0))},this.create=e=>{let{message:t,...n}=e,r=An(e),i=this.pendingDismissals.get(r);i!==void 0&&(cancelAnimationFrame(i),this.pendingDismissals.delete(r),this.dismissedToasts.delete(r));let a=this.dismissedToasts.has(r),o=e.dismissible===void 0||e.dismissible;return a&&(this.dismissedToasts.delete(r),this.toasts=this.toasts.filter(e=>e.id!==r)),!a&&this.toasts.find(e=>e.id===r)?this.toasts=this.toasts.map(n=>n.id===r?(this.publish({...n,...e,id:r,title:t}),{...n,...e,id:r,dismissible:o,title:t}):n):this.addToast({title:t,...n,dismissible:o,id:r}),r},this.dismiss=e=>{if(e==null)return this.getActiveToasts().forEach(e=>{this.dismissedToasts.add(e.id),this.subscribers.forEach(t=>t({id:e.id,dismiss:!0}))}),e;this.dismissedToasts.add(e);let t=this.pendingDismissals.get(e);return t!==void 0&&cancelAnimationFrame(t),this.pendingDismissals.set(e,requestAnimationFrame(()=>{this.pendingDismissals.delete(e),this.subscribers.forEach(t=>t({id:e,dismiss:!0}))})),e},this.message=(e,t)=>this.create({...t,message:e,type:void 0}),this.error=(e,t)=>this.create({...t,message:e,type:`error`}),this.success=(e,t)=>this.create({...t,type:`success`,message:e}),this.info=(e,t)=>this.create({...t,type:`info`,message:e}),this.warning=(e,t)=>this.create({...t,type:`warning`,message:e}),this.loading=(e,t)=>this.create({...t,type:`loading`,message:e}),this.promise=(e,t)=>{if(!t)return;let n;t.loading!==void 0&&(n=this.create({...t,promise:e,type:`loading`,message:t.loading,description:typeof t.description==`function`?void 0:t.description}));let r=Promise.resolve(e instanceof Function?e():e),i=n!==void 0,a,o=r.then(async e=>{if(a=[`resolve`,e],_.isValidElement(e))i=!1,this.create({id:n,type:`default`,message:e});else if(Nn(e)&&!e.ok){i=!1;let r=typeof t.error==`function`?await t.error(`HTTP error! status: ${e.status}`):t.error,a=typeof t.description==`function`?await t.description(`HTTP error! status: ${e.status}`):t.description,o=typeof r==`object`&&!_.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:a,...o})}else if(e instanceof Error){i=!1;let r=typeof t.error==`function`?await t.error(e):t.error,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!_.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:a,...o})}else if(t.success!==void 0){i=!1;let r=typeof t.success==`function`?await t.success(e):t.success,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!_.isValidElement(r)?r:{message:r};this.create({id:n,type:`success`,description:a,...o})}}).catch(async e=>{if(a=[`reject`,e],t.error!==void 0){i=!1;let r=typeof t.error==`function`?await t.error(e):t.error,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!_.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:a,...o})}}).finally(()=>{i&&(this.dismiss(n),n=void 0),t.finally==null||t.finally.call(t)}),s=()=>new Promise((e,t)=>o.then(()=>a[0]===`reject`?t(a[1]):e(a[1])).catch(t));return typeof n!=`string`&&typeof n!=`number`?{unwrap:s}:Object.assign(n,{unwrap:s})},this.custom=(e,t)=>{let n=An(t);return this.create({...t,jsx:e(n),id:n,type:void 0}),n},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set,this.pendingDismissals=new Map}},Mn=(e,t)=>jn.message(e,t),Nn=e=>e&&typeof e==`object`&&`ok`in e&&typeof e.ok==`boolean`&&`status`in e&&typeof e.status==`number`,H=Object.assign(Mn,{success:jn.success,info:jn.info,warning:jn.warning,error:jn.error,custom:jn.custom,message:jn.message,promise:jn.promise,dismiss:jn.dismiss,loading:jn.loading},{getHistory:()=>jn.toasts,getToasts:()=>jn.getActiveToasts()});vn(`[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px;flex:1;min-width:0}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--normal-text);background:var(--normal-bg);border:1px solid var(--normal-border);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{-webkit-user-select:none;user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}`);function Pn(e){return e.label!==void 0}var Fn=3,In=`24px`,Ln=`16px`,Rn=4e3,zn=356,Bn=14,Vn=45,Hn=200;function Un(...e){return e.filter(Boolean).join(` `)}function Wn(e){let[t,n]=e.split(`-`),r=[];return t&&r.push(t),n&&r.push(n),r}var Gn=e=>{let{invert:t,toast:n,unstyled:r,interacting:i,setHeights:a,visibleToasts:o,heights:s,index:c,toasts:l,expanded:u,removeToast:d,defaultRichColors:f,closeButton:p,style:m,cancelButtonStyle:h,actionButtonStyle:g,className:v=``,descriptionClassName:y=``,duration:b,position:x,gap:S,expandByDefault:C,classNames:w,icons:T,closeButtonAriaLabel:E=`Close toast`}=e,[D,O]=_.useState(null),[ee,te]=_.useState(null),[k,ne]=_.useState(!1),[re,ie]=_.useState(!1),[ae,A]=_.useState(!1),[j,oe]=_.useState(!1),[M,se]=_.useState(!1),[ce,N]=_.useState(0),[P,le]=_.useState(0),ue=_.useRef(n.duration||b||Rn),de=_.useRef(null),fe=_.useRef(null),pe=c===0,F=c+1<=o,me=n.type,he=me??`default`,ge=n.dismissible!==!1,_e=n.className||``,ve=n.descriptionClassName||``,ye=_.useMemo(()=>s.findIndex(e=>e.toastId===n.id)||0,[s,n.id]),be=_.useMemo(()=>n.closeButton??p,[n.closeButton,p]),xe=_.useMemo(()=>n.duration||b||Rn,[n.duration,b]),Se=_.useRef(0),Ce=_.useRef(0),we=_.useRef(0),Te=_.useRef(null),[Ee,De]=x.split(`-`),Oe=_.useMemo(()=>s.reduce((e,t,n)=>n>=ye?e:e+t.height,0),[s,ye]),ke=Dn(),Ae=_.useMemo(()=>e.swipeDirections??Wn(x),[e.swipeDirections,x]),je=n.invert||t,Me=me===`loading`;Ce.current=_.useMemo(()=>ye*S+Oe,[ye,Oe]),_.useEffect(()=>{ue.current=xe},[xe]),_.useEffect(()=>{ne(!0)},[]),_.useEffect(()=>{let e=fe.current;if(e){let t=e.getBoundingClientRect().height;return le(t),a(e=>[{toastId:n.id,height:t,position:n.position},...e]),()=>a(e=>e.filter(e=>e.toastId!==n.id))}},[a,n.id]),_.useLayoutEffect(()=>{if(!k)return;let e=fe.current,t=e.style.height;e.style.height=`auto`;let r=e.getBoundingClientRect().height;e.style.height=t,le(r),a(e=>e.find(e=>e.toastId===n.id)?e.map(e=>e.toastId===n.id?{...e,height:r}:e):[{toastId:n.id,height:r,position:n.position},...e])},[k,n.title,n.description,a,n.id,n.jsx,n.action,n.cancel]);let Ne=_.useCallback(()=>{ie(!0),N(Ce.current),a(e=>e.filter(e=>e.toastId!==n.id)),setTimeout(()=>{d(n)},Hn)},[n,d,a,Ce]);_.useEffect(()=>{if(n.promise&&me===`loading`||n.duration===1/0||n.type===`loading`)return;let e;return u||i||ke?(()=>{if(we.current<Se.current){let e=new Date().getTime()-Se.current;ue.current-=e}we.current=new Date().getTime()})():ue.current!==1/0&&(Se.current=new Date().getTime(),e=setTimeout(()=>{n.onAutoClose==null||n.onAutoClose.call(n,n),Ne()},ue.current)),()=>clearTimeout(e)},[u,i,n,me,ke,Ne]),_.useEffect(()=>{n.delete&&(Ne(),n.onDismiss==null||n.onDismiss.call(n,n))},[Ne,n.delete]);function Pe(){return T?.loading?_.createElement(`div`,{className:Un(w?.loader,n?.classNames?.loader,`sonner-loader`),"data-visible":me===`loading`},T.loading):_.createElement(xn,{className:Un(w?.loader,n?.classNames?.loader),visible:me===`loading`})}let Fe=n.icon||T?.[me]||yn(me);return _.createElement(`li`,{tabIndex:0,ref:fe,className:Un(v,_e,w?.toast,n?.classNames?.toast,w?.[he],n?.classNames?.[he]),"data-sonner-toast":``,"data-rich-colors":n.richColors??f,"data-styled":!(n.jsx||n.unstyled||r),"data-mounted":k,"data-promise":!!n.promise,"data-swiped":M,"data-removed":re,"data-visible":F,"data-y-position":Ee,"data-x-position":De,"data-index":c,"data-front":pe,"data-swiping":ae,"data-dismissible":ge,"data-type":me,"data-invert":je,"data-swipe-out":j,"data-swipe-direction":ee,"data-expanded":!!(u||C&&k),"data-testid":n.testId,style:{"--index":c,"--toasts-before":c,"--z-index":l.length-c,"--offset":`${re?ce:Ce.current}px`,"--initial-height":C?`auto`:`${P}px`,...m,...n.style},onDragEnd:()=>{A(!1),O(null),Te.current=null},onPointerDown:e=>{e.button!==2&&(Me||!ge||(de.current=new Date,N(Ce.current),e.target.setPointerCapture(e.pointerId),e.target.tagName!==`BUTTON`&&(A(!0),Te.current={x:e.clientX,y:e.clientY})))},onPointerUp:()=>{if(j||!ge)return;Te.current=null;let e=Number(fe.current?.style.getPropertyValue(`--swipe-amount-x`).replace(`px`,``)||0),t=Number(fe.current?.style.getPropertyValue(`--swipe-amount-y`).replace(`px`,``)||0),r=new Date().getTime()-de.current?.getTime(),i=D===`x`?e:t,a=Math.abs(i)/r;if((D===`x`?Ae.includes(e>0?`right`:`left`):Ae.includes(t>0?`bottom`:`top`))&&(Math.abs(i)>=Vn||a>.11)){N(Ce.current),n.onDismiss==null||n.onDismiss.call(n,n),te(D===`x`?e>0?`right`:`left`:t>0?`down`:`up`),Ne(),oe(!0);return}var o,s;(o=fe.current)==null||o.style.setProperty(`--swipe-amount-x`,`0px`),(s=fe.current)==null||s.style.setProperty(`--swipe-amount-y`,`0px`),se(!1),A(!1),O(null)},onPointerMove:e=>{var t,n;if(!Te.current||!ge||window.getSelection()?.toString().length>0)return;let r=e.clientY-Te.current.y,i=e.clientX-Te.current.x;!D&&(Math.abs(i)>1||Math.abs(r)>1)&&O(Math.abs(i)>Math.abs(r)?`x`:`y`);let a={x:0,y:0},o=e=>1/(1.5+Math.abs(e)/20);if(D===`y`){if(Ae.includes(`top`)||Ae.includes(`bottom`)){if(Ae.includes(`top`)&&r<0||Ae.includes(`bottom`)&&r>0)a.y=r;else{let e=r*o(r);a.y=Math.abs(e)<Math.abs(r)?e:r}}}else if(D===`x`&&(Ae.includes(`left`)||Ae.includes(`right`))){if(Ae.includes(`left`)&&i<0||Ae.includes(`right`)&&i>0)a.x=i;else{let e=i*o(i);a.x=Math.abs(e)<Math.abs(i)?e:i}}(Math.abs(a.x)>0||Math.abs(a.y)>0)&&se(!0),(t=fe.current)==null||t.style.setProperty(`--swipe-amount-x`,`${a.x}px`),(n=fe.current)==null||n.style.setProperty(`--swipe-amount-y`,`${a.y}px`)}},be&&!n.jsx&&me!==`loading`?_.createElement(`button`,{"aria-label":E,"data-disabled":Me,"data-close-button":!0,onClick:Me||!ge?()=>{}:()=>{Ne(),n.onDismiss==null||n.onDismiss.call(n,n)},className:Un(w?.closeButton,n?.classNames?.closeButton)},T?.close??En):null,(me||n.icon||n.promise)&&n.icon!==null&&(T?.[me]!==null||n.icon)?_.createElement(`div`,{"data-icon":``,className:Un(w?.icon,n?.classNames?.icon)},me===`loading`?n.icon||Pe():n.promise?Pe():null,me===`loading`?null:Fe):null,_.createElement(`div`,{"data-content":``,className:Un(w?.content,n?.classNames?.content)},_.createElement(`div`,{"data-title":``,className:Un(w?.title,n?.classNames?.title)},n.jsx?n.jsx:typeof n.title==`function`?n.title():n.title),n.description?_.createElement(`div`,{"data-description":``,className:Un(y,ve,w?.description,n?.classNames?.description)},typeof n.description==`function`?n.description():n.description):null),_.isValidElement(n.cancel)?n.cancel:n.cancel&&Pn(n.cancel)?_.createElement(`button`,{"data-button":!0,"data-cancel":!0,style:n.cancelButtonStyle||h,onClick:e=>{Pn(n.cancel)&&ge&&(n.cancel.onClick==null||n.cancel.onClick.call(n.cancel,e),Ne())},className:Un(w?.cancelButton,n?.classNames?.cancelButton)},n.cancel.label):null,_.isValidElement(n.action)?n.action:n.action&&Pn(n.action)?_.createElement(`button`,{"data-button":!0,"data-action":!0,style:n.actionButtonStyle||g,onClick:e=>{Pn(n.action)&&(n.action.onClick==null||n.action.onClick.call(n.action,e),!e.defaultPrevented&&Ne())},className:Un(w?.actionButton,n?.classNames?.actionButton)},n.action.label):null)};function Kn(){if(typeof window>`u`||typeof document>`u`)return`ltr`;let e=document.documentElement.getAttribute(`dir`);return e===`auto`||!e?window.getComputedStyle(document.documentElement).direction:e}function qn(e,t){let n={};return[e,t].forEach((e,t)=>{let r=t===1,i=r?`--mobile-offset`:`--offset`,a=r?Ln:In;function o(e){[`top`,`right`,`bottom`,`left`].forEach(t=>{n[`${i}-${t}`]=typeof e==`number`?`${e}px`:e})}typeof e==`number`||typeof e==`string`?o(e):typeof e==`object`?[`top`,`right`,`bottom`,`left`].forEach(t=>{e[t]===void 0?n[`${i}-${t}`]=a:n[`${i}-${t}`]=typeof e[t]==`number`?`${e[t]}px`:e[t]}):o(a)}),n}var Jn=_.forwardRef(function(e,t){let{id:n,invert:r,position:i=`bottom-right`,hotkey:a=[`altKey`,`KeyT`],expand:o,closeButton:s,className:c,offset:l,mobileOffset:u,theme:d=`light`,richColors:f,duration:p,style:m,visibleToasts:h=Fn,toastOptions:g,dir:v=Kn(),gap:y=Bn,icons:b,customAriaLabel:x,containerAriaLabel:S=`Notifications`}=e,[C,w]=_.useState([]),T=_.useMemo(()=>n?C.filter(e=>e.toasterId===n):C.filter(e=>!e.toasterId),[C,n]),E=_.useMemo(()=>Array.from(new Set([i].concat(T.filter(e=>e.position).map(e=>e.position)))),[T,i]),[D,O]=_.useState([]),[ee,te]=_.useState(!1),[k,ne]=_.useState(!1),[re,ie]=_.useState(d===`system`?typeof window<`u`&&window.matchMedia&&window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`:d),ae=_.useRef(null),A=a.join(`+`).replace(/Key/g,``).replace(/Digit/g,``),j=_.useRef(null),oe=_.useRef(!1),M=_.useCallback(e=>{w(t=>(t.find(t=>t.id===e.id)?.delete||jn.dismiss(e.id),t.filter(({id:t})=>t!==e.id)))},[]);return _.useEffect(()=>jn.subscribe(e=>{if(e.dismiss){requestAnimationFrame(()=>{w(t=>t.map(t=>t.id===e.id?{...t,delete:!0}:t))});return}setTimeout(()=>{_n.flushSync(()=>{w(t=>{let n=t.findIndex(t=>t.id===e.id);return n===-1?[e,...t]:[...t.slice(0,n),{...t[n],...e},...t.slice(n+1)]})})})}),[]),_.useEffect(()=>{if(d!==`system`){ie(d);return}if(d===`system`&&(window.matchMedia&&window.matchMedia(`(prefers-color-scheme: dark)`).matches?ie(`dark`):ie(`light`)),typeof window>`u`)return;let e=window.matchMedia(`(prefers-color-scheme: dark)`);try{e.addEventListener(`change`,({matches:e})=>{ie(e?`dark`:`light`)})}catch{e.addListener(({matches:e})=>{try{ie(e?`dark`:`light`)}catch(e){console.error(e)}})}},[d]),_.useEffect(()=>{C.length<=1&&te(!1)},[C]),_.useEffect(()=>{let e=e=>{if(a.length>0&&a.every(t=>e[t]||e.code===t)){var t;te(!0),(t=ae.current)==null||t.focus()}e.code===`Escape`&&(document.activeElement===ae.current||ae.current?.contains(document.activeElement))&&te(!1)};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[a]),_.useEffect(()=>{if(ae.current)return()=>{j.current&&(j.current.focus({preventScroll:!0}),j.current=null,oe.current=!1)}},[ae.current]),_.createElement(`section`,{ref:t,"aria-label":x??`${S} ${A}`,tabIndex:-1,"aria-live":`polite`,"aria-relevant":`additions text`,"aria-atomic":`false`,suppressHydrationWarning:!0,"data-react-aria-top-layer":!0},E.map((t,n)=>{let[i,a]=t.split(`-`);return T.length?_.createElement(`ol`,{key:t,dir:v===`auto`?Kn():v,tabIndex:-1,ref:ae,className:c,"data-sonner-toaster":!0,"data-sonner-theme":re,"data-y-position":i,"data-x-position":a,style:{"--front-toast-height":`${D[0]?.height||0}px`,"--width":`${zn}px`,"--gap":`${y}px`,...m,...qn(l,u)},onBlur:e=>{oe.current&&!e.currentTarget.contains(e.relatedTarget)&&(oe.current=!1,j.current&&=(j.current.focus({preventScroll:!0}),null))},onFocus:e=>{e.target instanceof HTMLElement&&e.target.dataset.dismissible===`false`||oe.current||(oe.current=!0,j.current=e.relatedTarget)},onMouseEnter:()=>te(!0),onMouseMove:()=>te(!0),onMouseLeave:()=>{k||te(!1)},onDragEnd:()=>te(!1),onPointerDown:e=>{e.target instanceof HTMLElement&&e.target.dataset.dismissible===`false`||ne(!0)},onPointerUp:()=>ne(!1)},T.filter(e=>!e.position&&n===0||e.position===t).map((n,i)=>_.createElement(Gn,{key:n.id,icons:b,index:i,toast:n,defaultRichColors:f,duration:g?.duration??p,className:g?.className,descriptionClassName:g?.descriptionClassName,invert:r,visibleToasts:h,closeButton:g?.closeButton??s,interacting:k,position:t,style:g?.style,unstyled:g?.unstyled,classNames:g?.classNames,cancelButtonStyle:g?.cancelButtonStyle,actionButtonStyle:g?.actionButtonStyle,closeButtonAriaLabel:g?.closeButtonAriaLabel,removeToast:M,toasts:T.filter(e=>e.position==n.position),heights:D.filter(e=>e.position==n.position),setHeights:O,expandByDefault:o,gap:y,expanded:ee,swipeDirections:e.swipeDirections}))):null}))});async function Yn(e,t={}){try{let n=new AbortController,r=t.timeout||6e4,{timeout:i,headers:a,...o}=t,s=setTimeout(()=>n.abort(),r),c=await fetch(e,{...o,headers:{...a,"x-omms-token":window.__OMMS_TOKEN__||``},signal:n.signal});return clearTimeout(s),await c.json()}catch(e){return console.error(`API Error:`,e),{success:!1,error:e instanceof Error?e.message:String(e)}}}var Xn=`/api/user-profile/ai-cleanup`,Zn={"Content-Type":`application/json`},Qn={start:(e,t)=>Yn(Xn,{method:`POST`,headers:Zn,body:JSON.stringify({includeIds:e,profileVersion:t})}),status:()=>Yn(Xn),stop:()=>Yn(Xn,{method:`DELETE`}),apply:(e,t)=>Yn(`${Xn}/apply`,{method:`POST`,headers:Zn,body:JSON.stringify({acceptedMerged:e,acceptedRemoved:t})})},$n=`/api/user-profile/auto-cleanup`,er={status:()=>Yn($n),undo:()=>Yn(`${$n}/undo`,{method:`POST`,headers:Zn,body:JSON.stringify({})})};function tr(e,t){try{let n=localStorage.getItem(e);if(n!==null)return n;let r=localStorage.getItem(t);return r!==null&&nr(e,r),r}catch{return null}}function nr(e,t){try{localStorage.setItem(e,t)}catch{}}var rr=`omms-tag-migration-closed-count`;function ir(e){if(e<=0)return!1;let t=Number(tr(rr,rr)??0);return!(Number.isFinite(t)&&e<=t)}function ar(e){nr(rr,String(e))}function or(){nr(rr,`0`)}var sr={en:{title:`omms Memory Explorer`,brand:`OMMS`,"tab-project":`PROJECT MEMORIES`,"tab-profile":`USER PROFILE`,"nav-menu":`Menu`,"nav-close":`Close menu`,"nav-collapse":`Collapse sidebar`,"nav-expand":`Expand sidebar`,"nav-language":`Language`,"nav-theme":`Theme`,"nav-settings":`Settings`,"power-button":`Web app power`,"power-dialog-title":`Restart or stop the web app`,"power-dialog-body":`Restart starts a fresh copy of the web app and reloads this page. Stop turns the web app off.`,"power-restart":`Restart`,"power-stop":`Stop`,"power-cancel":`Cancel`,"power-note":`A stop lasts until the next OpenCode start, Pi start, Claude Code prompt, om-memory-system web install, or login. Then the web app starts again.`,"power-restarting":`Restarting the web app…`,"power-stopped-title":`The web app has stopped`,"power-stopped-command":`To start it again, run this command in a terminal:`,"power-restart-timeout":`The web app did not answer after the restart.`,"power-restart-failed":`The restart failed. The web app still runs.`,"power-request-failed":`The request failed. The web app may still be running.`,"update-button":`Update available: {version}`,"update-label":`Update`,"update-dialog-title":`Update OMMS`,"update-versions":`Running: {running}. Newer release: {available}.`,"update-hosts-intro":`Update each host you use with its command:`,"update-host-claude":`Claude Code`,"update-host-opencode":`OpenCode`,"update-host-pi":`Pi`,"update-host-global":`Global command and web app`,"update-hosts-note":`OpenCode and Pi need their own update command and a restart.`,"update-copy":`Copy`,"update-copied":`Copied`,"update-install":`Update web app`,"update-install-note":`Installs the release globally with npm, then restarts the web app on it.`,"update-cannot-install":`This web app has no npm beside its Node.js. The commands above still work.`,"update-installing":`Installing the new release…`,"update-failed":`The update failed ({code}). The web app still runs.`,"update-request-failed":`The request failed. The web app still runs.`,"update-timeout":`The web app did not answer after the update.`,"update-close":`Close`,"theme-dark":`Dark`,"theme-light":`Light`,"label-tag":`Project:`,"label-type":`Type:`,"label-tags":`Tags:`,"label-content":`Content:`,"btn-cleanup":`Cleanup`,"btn-deduplicate":`Deduplicate`,"tooltip-filter-keyword":`Show all memories with this keyword`,"tooltip-memory-type":`Memory type`,"tooltip-tags":`Tags`,"label-label-filter":`Label:`,"opt-all-labels":`All labels`,"tooltip-cleanup":`Delete memories and prompts not updated in the retention period (30 days by default). Pinned memories are kept.`,"tooltip-deduplicate":`Delete exact duplicate memories in each project and keep the newest copy. Similar memories are only reported, not deleted.`,"btn-delete-selected":`Delete Selected`,"btn-select-all":`Select Page`,"btn-deselect-all":`Deselect All`,"btn-add-memory":`Add Memory`,"section-project":`Project Memories ({count})`,"section-profile":`User Profile`,"section-add":`Add New Memory`,"opt-all-tags":`All Projects`,"opt-select-tag":`Select project`,"opt-other":`other`,"opt-feature":`feature`,"opt-bug-fix":`bug-fix`,"opt-refactor":`refactor`,"opt-architecture":`architecture`,"opt-rule":`rule`,"opt-documentation":`documentation`,"opt-discussion":`discussion`,"opt-analysis":`analysis`,"opt-configuration":`configuration`,"modal-edit-title":`Edit Memory`,"dialog-close":`Close`,"modal-migration-title":`Memory Tagging Migration`,"modal-changelog-title":`Profile Version History`,"btn-cancel":`Cancel`,"btn-save":`Save Changes`,"btn-start-migration":`Start Migration`,"loading-init":`Initializing...`,"loading-profile":`Loading profile...`,"loading-changelog":`Loading changelog...`,"migration-mismatch":`Model dimension mismatch detected!`,"migration-understand":`I understand this operation is irreversible and will affect all stored memories`,"btn-fresh-start":`Fresh Start (Delete All)`,"btn-reembed":`Re-embed (Preserve Data)`,"migration-note":`Please don't close the browser. This will re-vectorize your memories with technical tags to improve search accuracy.`,"placeholder-search":`Search memories...`,"placeholder-tags":`react, hooks, auth (comma separated)`,"placeholder-content":`Enter memory content...`,"toast-add-success":`Memory added successfully`,"toast-add-error":`Content and tag are required`,"toast-add-failed":`Failed to add memory`,"toast-delete-success":`Memory deleted successfully`,"toast-delete-failed":`Failed to delete memory`,"toast-update-success":`Memory updated successfully`,"toast-update-failed":`Failed to update memory`,"toast-cleanup-success":`Cleanup completed successfully`,"toast-cleanup-failed":`Cleanup failed`,"toast-dedup-success":`Deduplication completed successfully`,"toast-dedup-failed":`Deduplication failed`,"toast-bulk-delete-success":`Selected memories deleted successfully`,"toast-bulk-delete-failed":`Failed to delete selected memories`,"toast-migration-success":`Migration completed successfully`,"toast-migration-failed":`Migration failed`,"toast-fresh-start-success":`Fresh start completed successfully`,"toast-fresh-start-failed":`Fresh start failed`,"confirm-delete":`Delete this memory?`,"confirm-delete-title":`Confirm Delete`,"confirm-delete-pair":`Delete this memory AND its linked prompt?`,"confirm-delete-prompt":`Delete this prompt AND its linked memory?`,"confirm-bulk-delete":`Delete {count} selected memories?`,"confirm-cleanup":`This deletes memories and prompts not updated in the retention period. Pinned memories are kept. Continue?`,"confirm-dedup":`This deletes exact duplicate memories and keeps the newest copy. Similar memories are only reported. Continue?`,"text-selected":`{count} selected`,"text-page":`Page {current} of {total}`,"text-total":`Total: {count}`,"empty-memories":`No memories found`,"empty-changelog":`No changelog available`,"status-cleanup":`Running cleanup...`,"status-dedup":`Running deduplication...`,"status-migration-init":`Initializing migration...`,"status-migration-progress":`Migrating... {current}/{total}`,"profile-version":`VERSION`,"profile-prompts":`PROMPTS`,"profile-updated":`LAST UPDATED`,"profile-preferences":`PREFERENCES`,"profile-type-pref":`Pref`,"profile-type-pat":`Pat`,"profile-type-wf":`Wf`,"profile-patterns":`PATTERNS`,"profile-workflows":`WORKFLOWS`,"label-evidence-tooltip":`AI analysis hit {count} times`,"label-confidence":`Confidence`,"badge-prompt":`USER PROMPT`,"badge-memory":`MEMORY`,"badge-pinned":`PINNED`,"badge-linked":`LINKED`,"date-created":`Created:`,"date-updated":`Updated:`,"empty-preferences":`No preferences learned yet`,"empty-patterns":`No patterns detected yet`,"empty-workflows":`No workflows identified yet`,"btn-delete-pair":`Delete Pair`,"tooltip-delete-pair":`Delete this memory AND its linked prompt`,"tooltip-delete-prompt-pair":`Delete this prompt AND its linked memory`,"btn-edit":`Edit`,"btn-delete":`Delete`,"label-category":`Category`,"label-description":`Description`,"label-steps":`Steps`,"btn-add-step":`+ Add Step`,"btn-see-more":`See more`,"btn-see-less":`See less`,"label-pasted-content":`Pasted content`,"text-generated-above":`Generated memory above`,"text-from-below":`From prompt below`,"btn-refresh":`Refresh`,"btn-ai-cleanup":`AI Cleanup`,"btn-category-cleanup":`Clean up categories`,"label-category-count-title":`Number of categories`,"label-category-cleanup-title":`Clean up categories`,"label-category-cleanup-loading":`Grouping category names by meaning…`,"label-category-cleanup-counts":`Categories now: {before}. After cleanup: {after}.`,"label-category-cleanup-note":`Applying only renames categories. After a cleanup more memories share a category, so later learning merges near-duplicate memories more readily.`,"label-category-cleanup-empty":`No category names to group.`,"label-category-cleanup-selected":`Selected groups: {selected} of {total}`,"label-category-cleanup-accept":`Use this group`,"label-category-cleanup-name":`Group name`,"label-category-cleanup-unchecked":`Not checked by the AI`,"btn-category-cleanup-apply":`Apply selected`,"btn-category-cleanup-undo":`Undo last cleanup`,"label-category-cleanup-progress":`Checking groups with the AI: batch {done} of {total}.`,"label-category-cleanup-background":`This runs in the background and can take several minutes. You can close this window and come back.`,"btn-category-cleanup-rebuild":`Build a new preview`,"label-category-cleanup-banner-ready":`A cleanup preview is ready ({groups} groups).`,"label-category-cleanup-banner-failed":`The cleanup preview failed:`,"btn-category-cleanup-banner-open":`Open review`,"toast-category-cleanup-applied":`Items renamed: {count}`,"toast-category-cleanup-undone":`Items restored: {restored}. Not found: {notFound}.`,"btn-auto-cleanup-undo":`Undo last automatic cleanup`,"btn-auto-cleanup-undo-confirm":`Undo cleanup`,"title-auto-cleanup-undo":`Undo the last automatic cleanup?`,"label-auto-cleanup-undo-body":`The automatic cleanup on {when} merged {merged} groups of memories and removed {removed}. Undo puts the original memories back. Other memories learned since stay. A later update to a merged memory is lost.`,"toast-auto-cleanup-undone":`Restored {restored} changes.`,"toast-auto-cleanup-undone-partial":`Restored {restored} changes. {notFound} not found, because the memories changed since.`,"toast-auto-cleanup-undo-failed":`Could not undo the automatic cleanup.`,"toast-category-cleanup-failed":`Category cleanup failed`,"label-ai-cleanup-title":`AI Profile Cleanup`,"label-ai-cleanup-loading":`AI is analyzing profile...`,"label-ai-cleanup-merged":`Merged`,"label-ai-cleanup-removed":`Removed`,"label-ai-cleanup-kept":`Remaining`,"label-ai-cleanup-none":`None`,"label-ai-cleanup-select-all":`Select All`,"label-ai-cleanup-deselect-all":`Deselect All`,"label-ai-cleanup-apply":`Apply Changes`,"label-ai-cleanup-merge-check":`Merge`,"label-ai-cleanup-remove-check":`Remove`,"label-ai-cleanup-changes-selected":`{selected}/{total} changes selected`,"label-ai-cleanup-merged-header":`Merged ({count} groups)`,"label-ai-cleanup-removed-header":`Removed ({count} items)`,"btn-apply":`Apply`,"toast-ai-cleanup-success":`Profile cleanup completed`,"toast-ai-cleanup-failed":`AI cleanup failed`,"label-ai-cleanup-progress":`Batch {done} of {total}`,"label-ai-cleanup-running-hint":`You can close this dialog. The cleanup keeps running.`,"label-ai-cleanup-failed-batches":`{batches} batch(es) failed. Their {items} items are unchanged.`,"btn-ai-cleanup-stop":`Stop`,"btn-ai-cleanup-retry":`Retry`,"btn-ai-cleanup-back":`Back`,"toast-ai-cleanup-skipped":`{applied} changes applied. {skipped} skipped because learning changed their items.`,"toast-cleanup-apply-failed":`Apply cleanup failed`,"label-ai-cleanup-select":`Select items for cleanup analysis`,"label-ai-cleanup-select-low":`Low Freq (≤3)`,"label-ai-cleanup-select-same-cat":`Same Category (3+)`,"label-ai-cleanup-analyze":`Analyze Selected`,"label-ai-cleanup-selected":`{count} selected`,"label-ai-cleanup-hint-low":`Picks memories seen 3 times or fewer. These are the most likely to be one-off notes or copies of another memory. Memories you repeat often stay out.`,"label-ai-cleanup-hint-same-cat":`Picks every memory whose category holds 3 or more memories. Memories under one category name are the most likely to be copies of each other. Names must match exactly, so run Clean up categories first to catch more. Memories with no category are left out.`,"label-more-info":`What does this do?`,"help-ai-cleanup":`Asks the AI to find memories that say the same thing and merge them. It can also remove memories that are too vague to help. You choose which memories it checks, then review every change. Nothing is saved until you press Apply Changes.`,"help-category-cleanup":`Finds category names that mean the same thing, such as "Execution" and "Direct execution", and gives each group one name. It only renames categories. No memory is merged or removed. You review the groups first, and you can undo the last cleanup.`,"migration-found-tags":`Found {count} memories needing technical tags.`,"migration-stopped":`Migration stopped: maximum attempts reached`,"migration-shards-mismatch":`{count} shard(s) have different dimensions`,"migration-dimension-mismatch":`dimension mismatch detected`,"migration-mismatch-details":`Model mismatch: Config uses {configDimensions}D ({configModel}), but {shardInfo}.`,"auth-warning-text":`Cross-origin editing disabled. Set webServerAuthPassword to enable.`},zh:{title:`omms Memory Explorer`,brand:`OMMS`,"tab-project":`项目记忆`,"tab-profile":`用户画像`,"nav-menu":`菜单`,"nav-close":`关闭菜单`,"nav-collapse":`收起侧边栏`,"nav-expand":`展开侧边栏`,"nav-language":`语言`,"nav-theme":`主题`,"nav-settings":`设置`,"power-button":`网页应用电源`,"power-dialog-title":`重启或停止网页应用`,"power-dialog-body":`重启会启动网页应用的新副本并重新加载此页面。停止会关闭网页应用。`,"power-restart":`重启`,"power-stop":`停止`,"power-cancel":`取消`,"power-note":`停止会一直持续到下一次启动 OpenCode、启动 Pi、在 Claude Code 中发送提示、运行 om-memory-system web install 或登录。之后网页应用会再次启动。`,"power-restarting":`正在重启网页应用…`,"power-stopped-title":`网页应用已停止`,"power-stopped-command":`要再次启动,请在终端中运行此命令:`,"power-restart-timeout":`重启后网页应用没有响应。`,"power-restart-failed":`重启失败。网页应用仍在运行。`,"power-request-failed":`请求失败。网页应用可能仍在运行。`,"update-button":`有可用更新:{version}`,"update-label":`更新`,"update-dialog-title":`更新 OMMS`,"update-versions":`当前运行:{running}。较新版本:{available}。`,"update-hosts-intro":`使用对应命令更新你使用的每个宿主:`,"update-host-claude":`Claude Code`,"update-host-opencode":`OpenCode`,"update-host-pi":`Pi`,"update-host-global":`全局命令和网页应用`,"update-hosts-note":`OpenCode 和 Pi 需要各自运行更新命令并重启。`,"update-copy":`复制`,"update-copied":`已复制`,"update-install":`更新网页应用`,"update-install-note":`使用 npm 全局安装该版本,然后在新版本上重启网页应用。`,"update-cannot-install":`此网页应用的 Node.js 旁没有 npm。上面的命令仍然可用。`,"update-installing":`正在安装新版本…`,"update-failed":`更新失败({code})。网页应用仍在运行。`,"update-request-failed":`请求失败。网页应用仍在运行。`,"update-timeout":`更新后网页应用没有响应。`,"update-close":`关闭`,"theme-dark":`深色`,"theme-light":`浅色`,"label-tag":`项目:`,"label-type":`类型:`,"label-tags":`标签:`,"label-content":`内容:`,"btn-cleanup":`清理`,"btn-deduplicate":`去重`,"tooltip-filter-keyword":`显示带有此关键词的所有记忆`,"tooltip-memory-type":`记忆类型`,"tooltip-tags":`标签`,"label-label-filter":`标签:`,"opt-all-labels":`所有标签`,"tooltip-cleanup":`删除在保留期内(默认 30 天)未更新的记忆和提示词。已置顶的记忆会保留。`,"tooltip-deduplicate":`删除每个项目中完全重复的记忆,只保留最新的一条。相似的记忆只会报告,不会删除。`,"btn-delete-selected":`删除选中`,"btn-select-all":`全选当前页`,"btn-deselect-all":`取消全选`,"btn-add-memory":`添加记忆`,"section-project":`项目记忆 ({count})`,"section-profile":`用户画像`,"section-add":`添加新记忆`,"opt-all-tags":`所有项目`,"opt-select-tag":`选择项目`,"opt-other":`其他 (other)`,"opt-feature":`功能 (feature)`,"opt-bug-fix":`修复 (bug-fix)`,"opt-refactor":`重构 (refactor)`,"opt-architecture":`架构 (architecture)`,"opt-rule":`规则 (rule)`,"opt-documentation":`文档 (documentation)`,"opt-discussion":`讨论 (discussion)`,"opt-analysis":`分析 (analysis)`,"opt-configuration":`配置 (configuration)`,"modal-edit-title":`编辑记忆`,"dialog-close":`关闭`,"modal-migration-title":`记忆标签迁移`,"modal-changelog-title":`画像版本历史`,"btn-cancel":`取消`,"btn-save":`保存更改`,"btn-start-migration":`开始迁移`,"loading-init":`初始化中...`,"loading-profile":`加载画像中...`,"loading-changelog":`加载更新日志中...`,"migration-mismatch":`检测到模型维度不匹配!`,"migration-understand":`我了解此操作不可逆,并将影响所有存储的记忆`,"btn-fresh-start":`重新开始 (删除所有)`,"btn-reembed":`重新向量化 (保留数据)`,"migration-note":`请不要关闭浏览器。这将使用技术标签重新向量化您的记忆,以提高搜索准确性。`,"placeholder-search":`搜索记忆...`,"placeholder-tags":`react, hooks, auth (逗号分隔)`,"placeholder-content":`输入记忆内容...`,"toast-add-success":`记忆添加成功`,"toast-add-error":`内容和标签为必填项`,"toast-add-failed":`添加记忆失败`,"toast-delete-success":`记忆删除成功`,"toast-delete-failed":`删除记忆失败`,"toast-update-success":`记忆更新成功`,"toast-update-failed":`更新记忆失败`,"toast-cleanup-success":`清理完成`,"toast-cleanup-failed":`清理失败`,"toast-dedup-success":`去重完成`,"toast-dedup-failed":`去重失败`,"toast-bulk-delete-success":`选中的记忆删除成功`,"toast-bulk-delete-failed":`删除选中的记忆失败`,"toast-migration-success":`迁移完成`,"toast-migration-failed":`迁移失败`,"toast-fresh-start-success":`重新开始完成`,"toast-fresh-start-failed":`重新开始失败`,"confirm-delete":`删除这条记忆?`,"confirm-delete-title":`确认删除`,"confirm-delete-pair":`删除这条记忆及其关联的提示词?`,"confirm-delete-prompt":`删除这条提示词及其关联的记忆?`,"confirm-bulk-delete":`删除选中的 {count} 条记忆?`,"confirm-cleanup":`这将删除在保留期内未更新的记忆和提示词。已置顶的记忆会保留。是否继续?`,"confirm-dedup":`这将删除完全重复的记忆,只保留最新的一条。相似的记忆只会报告。是否继续?`,"text-selected":`已选择 {count} 条`,"text-page":`第 {current} 页,共 {total} 页`,"text-total":`总计: {count}`,"empty-memories":`未找到记忆`,"empty-changelog":`暂无更新日志`,"status-cleanup":`正在运行清理...`,"status-dedup":`正在运行去重...`,"status-migration-init":`正在初始化迁移...`,"status-migration-progress":`迁移中... {current}/{total}`,"profile-version":`版本`,"profile-prompts":`提示词数`,"profile-updated":`最后更新`,"profile-preferences":`偏好设置`,"profile-type-pref":`偏好`,"profile-type-pat":`模式`,"profile-type-wf":`流程`,"profile-patterns":`行为模式`,"profile-workflows":`工作流程`,"label-evidence-tooltip":`AI 分析命中 {count} 次`,"label-confidence":`置信度`,"badge-prompt":`用户提示词`,"badge-memory":`记忆`,"badge-pinned":`已置顶`,"badge-linked":`已关联`,"date-created":`创建于:`,"date-updated":`更新于:`,"empty-preferences":`尚未学习到偏好设置`,"empty-patterns":`尚未检测到行为模式`,"empty-workflows":`尚未识别出工作流程`,"btn-delete-pair":`删除组合`,"tooltip-delete-pair":`删除这条记忆及其关联的提示词`,"tooltip-delete-prompt-pair":`删除这条提示词及其关联的记忆`,"btn-edit":`编辑`,"btn-delete":`删除`,"label-category":`类别`,"label-description":`描述`,"label-steps":`步骤`,"btn-add-step":`+ 添加步骤`,"btn-see-more":`查看更多`,"btn-see-less":`收起`,"label-pasted-content":`粘贴内容`,"text-generated-above":`由上方记忆生成`,"text-from-below":`来自下方提示词`,"btn-refresh":`刷新`,"btn-ai-cleanup":`AI 清理`,"btn-category-cleanup":`整理分类`,"label-category-count-title":`分类数量`,"label-category-cleanup-title":`整理分类`,"label-category-cleanup-loading":`正在按含义归类分类名称…`,"label-category-cleanup-counts":`当前分类:{before}。整理后:{after}。`,"label-category-cleanup-note":`应用只会重命名分类。整理后更多记忆共享同一分类,之后的学习会更容易合并几乎重复的记忆。`,"label-category-cleanup-empty":`没有可归类的分类名称。`,"label-category-cleanup-selected":`已选分组:{selected}/{total}`,"label-category-cleanup-accept":`采用此组`,"label-category-cleanup-name":`分组名称`,"label-category-cleanup-unchecked":`未经 AI 检查`,"btn-category-cleanup-apply":`应用所选`,"btn-category-cleanup-undo":`撤销上次整理`,"label-category-cleanup-progress":`正在用 AI 检查分组:第 {done} 批,共 {total} 批。`,"label-category-cleanup-background":`此任务在后台运行,可能需要几分钟。你可以关闭此窗口,稍后再回来。`,"btn-category-cleanup-rebuild":`重新生成预览`,"label-category-cleanup-banner-ready":`整理预览已就绪({groups} 组)。`,"label-category-cleanup-banner-failed":`整理预览失败:`,"btn-category-cleanup-banner-open":`打开审阅`,"toast-category-cleanup-applied":`已重命名的条目:{count}`,"toast-category-cleanup-undone":`已恢复:{restored}。未找到:{notFound}。`,"btn-auto-cleanup-undo":`撤销上次自动整理`,"btn-auto-cleanup-undo-confirm":`撤销整理`,"title-auto-cleanup-undo":`撤销上次自动整理?`,"label-auto-cleanup-undo-body":`{when} 的自动整理合并了 {merged} 组记忆,并删除了 {removed} 条。撤销会恢复原来的记忆。之后学到的其他记忆会保留。合并后记忆上的更新会丢失。`,"toast-auto-cleanup-undone":`已恢复 {restored} 项更改。`,"toast-auto-cleanup-undone-partial":`已恢复 {restored} 项更改。有 {notFound} 项未找到,因为记忆已发生变化。`,"toast-auto-cleanup-undo-failed":`无法撤销自动整理。`,"toast-category-cleanup-failed":`分类整理失败`,"label-ai-cleanup-title":`AI 画像清理`,"label-ai-cleanup-loading":`AI 正在分析画像...`,"label-ai-cleanup-merged":`合并项`,"label-ai-cleanup-removed":`删除项`,"label-ai-cleanup-kept":`保留`,"label-ai-cleanup-none":`无`,"label-ai-cleanup-select-all":`全选`,"label-ai-cleanup-deselect-all":`清空`,"label-ai-cleanup-apply":`应用变更`,"label-ai-cleanup-merge-check":`合并`,"label-ai-cleanup-remove-check":`删除`,"label-ai-cleanup-changes-selected":`已选 {selected}/{total} 项`,"label-ai-cleanup-merged-header":`合并 ({count} 组)`,"label-ai-cleanup-removed-header":`删除 ({count} 项)`,"btn-apply":`确认替换`,"toast-ai-cleanup-success":`画像清理完成`,"toast-ai-cleanup-failed":`AI 清理失败`,"label-ai-cleanup-progress":`第 {done} 批,共 {total} 批`,"label-ai-cleanup-running-hint":`可以关闭此对话框,清理会继续进行。`,"label-ai-cleanup-failed-batches":`{batches} 批失败,其中 {items} 项保持不变。`,"btn-ai-cleanup-stop":`停止`,"btn-ai-cleanup-retry":`重试`,"btn-ai-cleanup-back":`返回`,"toast-ai-cleanup-skipped":`已应用 {applied} 项更改,{skipped} 项因学习改动了相关条目而跳过。`,"toast-cleanup-apply-failed":`应用清理失败`,"label-ai-cleanup-select":`选择需要清理分析的条目`,"label-ai-cleanup-select-low":`低频 (≤3)`,"label-ai-cleanup-select-same-cat":`同分类 (3+)`,"label-ai-cleanup-analyze":`分析选中项`,"label-ai-cleanup-selected":`已选 {count} 项`,"label-ai-cleanup-hint-low":`选出出现 3 次或更少的记忆。它们最可能是一次性的记录,或是其他记忆的重复。经常出现的记忆不会被选中。`,"label-ai-cleanup-hint-same-cat":`选出所在分类包含 3 条或更多记忆的所有记忆。同一分类名下的记忆最可能互相重复。分类名必须完全一致,所以先运行“整理分类”可以选中更多。没有分类的记忆不会被选中。`,"label-more-info":`这是做什么的?`,"help-ai-cleanup":`让 AI 找出意思相同的记忆并合并。它也可以删除过于模糊、没有帮助的记忆。你先选择要检查的记忆,再逐项查看每个变更。点击“应用变更”之前不会保存任何内容。`,"help-category-cleanup":`找出意思相同的分类名称,例如“Execution”和“Direct execution”,并为每组选定一个名称。它只重命名分类,不合并或删除任何记忆。你可以先查看各组,并可撤销上次整理。`,"profile-actions":`操作`,"migration-found-tags":`发现 {count} 条需要技术标签的记忆。`,"migration-stopped":`迁移已停止:达到最大尝试次数`,"migration-shards-mismatch":`{count} 个分片具有不同的维度`,"migration-dimension-mismatch":`检测到维度不匹配`,"migration-mismatch-details":`模型不匹配:配置使用 {configDimensions}D ({configModel}),但{shardInfo}。`,"auth-warning-text":`跨源编辑已禁用. 设置 webServerAuthPassword 即可启用.`},ar:{title:`مستكشف ذاكرة omms`,brand:`OMMS`,"tab-project":`ذكريات المشروع`,"tab-profile":`ملف المستخدم`,"nav-menu":`القائمة`,"nav-close":`إغلاق القائمة`,"nav-collapse":`طي الشريط الجانبي`,"nav-expand":`توسيع الشريط الجانبي`,"nav-language":`اللغة`,"nav-theme":`المظهر`,"nav-settings":`الإعدادات`,"power-button":`تشغيل تطبيق الويب`,"power-dialog-title":`إعادة تشغيل تطبيق الويب أو إيقافه`,"power-dialog-body":`تبدأ إعادة التشغيل نسخة جديدة من تطبيق الويب وتعيد تحميل هذه الصفحة. ويطفئ الإيقاف تطبيق الويب.`,"power-restart":`إعادة التشغيل`,"power-stop":`إيقاف`,"power-cancel":`إلغاء`,"power-note":`يستمر الإيقاف حتى البدء التالي لـ OpenCode أو Pi، أو الرسالة التالية في Claude Code، أو تشغيل om-memory-system web install، أو تسجيل الدخول. بعد ذلك يبدأ تطبيق الويب من جديد.`,"power-restarting":`جارٍ إعادة تشغيل تطبيق الويب…`,"power-stopped-title":`توقف تطبيق الويب`,"power-stopped-command":`لبدئه من جديد، شغّل هذا الأمر في الطرفية:`,"power-restart-timeout":`لم يستجب تطبيق الويب بعد إعادة التشغيل.`,"power-restart-failed":`فشلت إعادة التشغيل. تطبيق الويب ما زال يعمل.`,"power-request-failed":`فشل الطلب. قد يكون تطبيق الويب ما زال يعمل.`,"update-button":`يتوفر تحديث: {version}`,"update-label":`تحديث`,"update-dialog-title":`تحديث OMMS`,"update-versions":`الإصدار الحالي: {running}. إصدار أحدث: {available}.`,"update-hosts-intro":`حدّث كل مضيف تستخدمه بالأمر الخاص به:`,"update-host-claude":`Claude Code`,"update-host-opencode":`OpenCode`,"update-host-pi":`Pi`,"update-host-global":`الأمر العام وتطبيق الويب`,"update-hosts-note":`يحتاج OpenCode وPi إلى أمر التحديث الخاص بكل منهما وإعادة التشغيل.`,"update-copy":`نسخ`,"update-copied":`تم النسخ`,"update-install":`تحديث تطبيق الويب`,"update-install-note":`يثبّت الإصدار عامًا عبر npm، ثم يعيد تشغيل تطبيق الويب عليه.`,"update-cannot-install":`لا يوجد npm بجانب Node.js الخاص بتطبيق الويب هذا. ما زالت الأوامر أعلاه تعمل.`,"update-installing":`جارٍ تثبيت الإصدار الجديد…`,"update-failed":`فشل التحديث ({code}). ما زال تطبيق الويب يعمل.`,"update-request-failed":`فشل الطلب. ما زال تطبيق الويب يعمل.`,"update-timeout":`لم يستجب تطبيق الويب بعد التحديث.`,"update-close":`إغلاق`,"theme-dark":`داكن`,"theme-light":`فاتح`,"label-tag":`المشروع:`,"label-type":`النوع:`,"label-tags":`الوسوم:`,"label-content":`المحتوى:`,"btn-cleanup":`تنظيف`,"btn-deduplicate":`إزالة التكرار`,"tooltip-filter-keyword":`عرض كل الذكريات التي تحمل هذه الكلمة المفتاحية`,"tooltip-memory-type":`نوع الذاكرة`,"tooltip-tags":`الوسوم`,"label-label-filter":`الوسم:`,"opt-all-labels":`جميع الوسوم`,"tooltip-cleanup":`حذف الذكريات والموجهات التي لم تُحدَّث خلال فترة الاحتفاظ (30 يومًا افتراضيًا). تبقى الذكريات المثبتة.`,"tooltip-deduplicate":`حذف الذكريات المكررة تمامًا في كل مشروع مع الإبقاء على أحدث نسخة. الذكريات المتشابهة يتم الإبلاغ عنها فقط ولا تُحذف.`,"btn-delete-selected":`حذف المحدد`,"btn-select-all":`تحديد الصفحة`,"btn-deselect-all":`إلغاء التحديد`,"btn-add-memory":`إضافة ذكرى`,"section-project":`ذكريات المشروع ({count})`,"section-profile":`ملف المستخدم`,"section-add":`إضافة ذكرى جديدة`,"opt-all-tags":`جميع المشاريع`,"opt-select-tag":`اختر مشروعًا`,"opt-other":`أخرى`,"opt-feature":`ميزة`,"opt-bug-fix":`إصلاح خطأ`,"opt-refactor":`إعادة هيكلة`,"opt-architecture":`معمارية`,"opt-rule":`قاعدة`,"opt-documentation":`توثيق`,"opt-discussion":`نقاش`,"opt-analysis":`تحليل`,"opt-configuration":`إعدادات`,"modal-edit-title":`تعديل الذكرى`,"dialog-close":`إغلاق`,"modal-migration-title":`ترحيل وسوم الذكريات`,"modal-changelog-title":`سجل إصدارات الملف الشخصي`,"btn-cancel":`إلغاء`,"btn-save":`حفظ التغييرات`,"btn-start-migration":`بدء الترحيل`,"loading-init":`جاري التهيئة...`,"loading-profile":`جاري تحميل الملف الشخصي...`,"loading-changelog":`جاري تحميل السجل...`,"migration-mismatch":`تم اكتشاف عدم تطابق في أبعاد النموذج!`,"migration-understand":`أفهم أن هذه العملية غير قابلة للتراجع وستؤثر على جميع الذكريات المخزنة`,"btn-fresh-start":`بداية جديدة (حذف الكل)`,"btn-reembed":`إعادة إنشاء المتجهات (مع الاحتفاظ بالبيانات)`,"migration-note":`يرجى عدم إغلاق المتصفح. سيتم إعادة فهرسة الذكريات باستخدام وسوم تقنية لتحسين دقة البحث.`,"placeholder-search":`ابحث في الذكريات...`,"placeholder-tags":`react, hooks, auth (مفصولة بفواصل)`,"placeholder-content":`أدخل محتوى الذكرى...`,"toast-add-success":`تمت إضافة الذكرى بنجاح`,"toast-add-error":`المحتوى والوسم مطلوبان`,"toast-add-failed":`فشلت إضافة الذكرى`,"toast-delete-success":`تم حذف الذكرى بنجاح`,"toast-delete-failed":`فشل حذف الذكرى`,"toast-update-success":`تم تحديث الذكرى بنجاح`,"toast-update-failed":`فشل تحديث الذكرى`,"toast-cleanup-success":`اكتملت عملية التنظيف بنجاح`,"toast-cleanup-failed":`فشلت عملية التنظيف`,"toast-dedup-success":`اكتملت إزالة التكرار بنجاح`,"toast-dedup-failed":`فشلت إزالة التكرار`,"toast-bulk-delete-success":`تم حذف الذكريات المحددة بنجاح`,"toast-bulk-delete-failed":`فشل حذف الذكريات المحددة`,"toast-migration-success":`اكتملت عملية الترحيل بنجاح`,"toast-migration-failed":`فشلت عملية الترحيل`,"toast-fresh-start-success":`تمت البداية الجديدة بنجاح`,"toast-fresh-start-failed":`فشلت البداية الجديدة`,"confirm-delete":`هل تريد حذف هذه الذكرى؟`,"confirm-delete-title":`تأكيد الحذف`,"confirm-delete-pair":`هل تريد حذف هذه الذكرى والموجه المرتبط بها؟`,"confirm-delete-prompt":`هل تريد حذف هذا الموجه والذكرى المرتبطة به؟`,"confirm-bulk-delete":`هل تريد حذف {count} من الذكريات المحددة؟`,"confirm-cleanup":`سيؤدي هذا إلى حذف الذكريات والموجهات التي لم تُحدَّث خلال فترة الاحتفاظ. تبقى الذكريات المثبتة. هل تريد المتابعة؟`,"confirm-dedup":`سيؤدي هذا إلى حذف الذكريات المكررة تمامًا مع الإبقاء على أحدث نسخة. الذكريات المتشابهة يتم الإبلاغ عنها فقط. هل تريد المتابعة؟`,"text-selected":`تم تحديد {count}`,"text-page":`الصفحة {current} من {total}`,"text-total":`الإجمالي: {count}`,"empty-memories":`لم يتم العثور على ذكريات`,"empty-changelog":`لا يوجد سجل تغييرات`,"status-cleanup":`جاري التنظيف...`,"status-dedup":`جاري إزالة التكرار...`,"status-migration-init":`جاري تهيئة الترحيل...`,"status-migration-progress":`جاري الترحيل... {current}/{total}`,"profile-version":`الإصدار`,"profile-prompts":`الموجهات`,"profile-updated":`آخر تحديث`,"profile-preferences":`التفضيلات`,"profile-type-pref":`تفضيل`,"profile-type-pat":`نمط`,"profile-type-wf":`سير`,"profile-patterns":`الأنماط`,"profile-workflows":`سير العمل`,"label-evidence-tooltip":`الذكاء الاصطناعي حدد هذا {count} مرات`,"label-confidence":`درجة الثقة`,"badge-prompt":`موجه المستخدم`,"badge-memory":`ذكرى`,"badge-pinned":`مثبتة`,"badge-linked":`مرتبطة`,"date-created":`تاريخ الإنشاء:`,"date-updated":`تاريخ التحديث:`,"empty-preferences":`لم يتم تعلم أي تفضيلات بعد`,"empty-patterns":`لم يتم اكتشاف أي أنماط بعد`,"empty-workflows":`لم يتم التعرف على أي سير عمل بعد`,"btn-delete-pair":`حذف الزوج`,"tooltip-delete-pair":`حذف هذه الذكرى والموجه المرتبط بها`,"tooltip-delete-prompt-pair":`حذف هذا الموجه والذكرى المرتبطة به`,"btn-edit":`تعديل`,"btn-delete":`حذف`,"label-category":`الفئة`,"label-description":`الوصف`,"label-steps":`الخطوات`,"btn-add-step":`+ أضف خطوة`,"btn-see-more":`عرض المزيد`,"btn-see-less":`عرض أقل`,"label-pasted-content":`المحتوى الملصق`,"text-generated-above":`تم إنشاء الذكرى أعلاه`,"text-from-below":`من الموجه أدناه`,"btn-refresh":`تحديث`,"btn-ai-cleanup":`تنظيف بالذكاء الاصطناعي`,"btn-category-cleanup":`تنظيف الفئات`,"label-category-count-title":`عدد الفئات`,"label-category-cleanup-title":`تنظيف الفئات`,"label-category-cleanup-loading":`جارٍ تجميع أسماء الفئات حسب المعنى…`,"label-category-cleanup-counts":`الفئات الآن: {before}. بعد التنظيف: {after}.`,"label-category-cleanup-note":`التطبيق يغيّر أسماء الفئات فقط. بعد التنظيف تشترك ذكريات أكثر في فئة واحدة، لذلك يدمج التعلّم اللاحق الذكريات شبه المكررة بسهولة أكبر.`,"label-category-cleanup-empty":`لا توجد أسماء فئات لتجميعها.`,"label-category-cleanup-selected":`المجموعات المحددة: {selected} من {total}`,"label-category-cleanup-accept":`استخدم هذه المجموعة`,"label-category-cleanup-name":`اسم المجموعة`,"label-category-cleanup-unchecked":`لم يتحقق منها الذكاء الاصطناعي`,"btn-category-cleanup-apply":`تطبيق المحدد`,"btn-category-cleanup-undo":`تراجع عن آخر تنظيف`,"label-category-cleanup-progress":`جارٍ فحص المجموعات بالذكاء الاصطناعي: الدفعة {done} من {total}.`,"label-category-cleanup-background":`يعمل هذا في الخلفية وقد يستغرق عدة دقائق. يمكنك إغلاق هذه النافذة والعودة لاحقًا.`,"btn-category-cleanup-rebuild":`إنشاء معاينة جديدة`,"label-category-cleanup-banner-ready":`معاينة التنظيف جاهزة ({groups} مجموعة).`,"label-category-cleanup-banner-failed":`فشلت معاينة التنظيف:`,"btn-category-cleanup-banner-open":`فتح المراجعة`,"toast-category-cleanup-applied":`العناصر المعاد تسميتها: {count}`,"toast-category-cleanup-undone":`المستعادة: {restored}. غير الموجودة: {notFound}.`,"btn-auto-cleanup-undo":`تراجع عن آخر تنظيف تلقائي`,"btn-auto-cleanup-undo-confirm":`تراجع عن التنظيف`,"title-auto-cleanup-undo":`هل تريد التراجع عن آخر تنظيف تلقائي؟`,"label-auto-cleanup-undo-body":`دمج التنظيف التلقائي في {when} عدد {merged} من مجموعات الذكريات وحذف {removed}. يعيد التراجع الذكريات الأصلية. تبقى الذكريات الأخرى التي تم تعلمها بعد ذلك. يُفقد أي تحديث لاحق على ذاكرة مدموجة.`,"toast-auto-cleanup-undone":`تمت استعادة {restored} من التغييرات.`,"toast-auto-cleanup-undone-partial":`تمت استعادة {restored} من التغييرات. لم يتم العثور على {notFound} لأن الذكريات تغيرت بعد ذلك.`,"toast-auto-cleanup-undo-failed":`تعذر التراجع عن التنظيف التلقائي.`,"toast-category-cleanup-failed":`فشل تنظيف الفئات`,"label-ai-cleanup-title":`تنظيف الملف الشخصي`,"label-ai-cleanup-loading":`الذكاء الاصطناعي يحلل الملف الشخصي...`,"label-ai-cleanup-merged":`مدموجة`,"label-ai-cleanup-removed":`محذوفة`,"label-ai-cleanup-kept":`متبقية`,"label-ai-cleanup-none":`لا يوجد`,"label-ai-cleanup-select-all":`تحديد الكل`,"label-ai-cleanup-deselect-all":`إلغاء الكل`,"label-ai-cleanup-apply":`تطبيق التغييرات`,"label-ai-cleanup-merge-check":`دمج`,"label-ai-cleanup-remove-check":`حذف`,"label-ai-cleanup-changes-selected":`تم تحديد {selected}/{total}`,"label-ai-cleanup-merged-header":`دمج ({count} مجموعة)`,"label-ai-cleanup-removed-header":`حذف ({count} عنصر)`,"btn-apply":`تأكيد الاستبدال`,"toast-ai-cleanup-success":`اكتمل تنظيف الملف الشخصي`,"toast-ai-cleanup-failed":`فشل تنظيف الملف الشخصي`,"label-ai-cleanup-progress":`الدفعة {done} من {total}`,"label-ai-cleanup-running-hint":`يمكنك إغلاق هذه النافذة، وسيستمر التنظيف.`,"label-ai-cleanup-failed-batches":`فشلت {batches} دفعة، وبقيت عناصرها البالغ عددها {items} دون تغيير.`,"btn-ai-cleanup-stop":`إيقاف`,"btn-ai-cleanup-retry":`إعادة المحاولة`,"btn-ai-cleanup-back":`رجوع`,"toast-ai-cleanup-skipped":`تم تطبيق {applied} تغيير، وتم تخطي {skipped} لأن التعلّم غيّر عناصرها.`,"toast-cleanup-apply-failed":`فشل تطبيق التنظيف`,"label-ai-cleanup-select":`حدد العناصر للتحليل`,"label-ai-cleanup-select-low":`تردد منخفض (≤3)`,"label-ai-cleanup-select-same-cat":`نفس الفئة (3+)`,"label-ai-cleanup-analyze":`تحليل المحدد`,"label-ai-cleanup-selected":`{count} محدد`,"label-ai-cleanup-hint-low":`يحدد الذكريات التي ظهرت 3 مرات أو أقل. هذه الذكريات هي الأكثر احتمالًا أن تكون ملاحظات لمرة واحدة أو نسخًا من ذكريات أخرى. الذكريات التي تتكرر كثيرًا تبقى خارج التحديد.`,"label-ai-cleanup-hint-same-cat":`يحدد كل ذكرى تنتمي إلى فئة فيها 3 ذكريات أو أكثر. الذكريات تحت اسم فئة واحد هي الأكثر احتمالًا أن تكون نسخًا من بعضها. يجب أن تتطابق الأسماء تمامًا، لذلك شغّل «تنظيف الفئات» أولًا لتحديد المزيد. الذكريات التي بلا فئة تُستبعد.`,"label-more-info":`ما وظيفة هذا؟`,"help-ai-cleanup":`يطلب من الذكاء الاصطناعي إيجاد الذكريات التي تقول الشيء نفسه ودمجها. ويمكنه أيضًا حذف الذكريات الغامضة جدًا بحيث لا تفيد. أنت تختار الذكريات التي يفحصها، ثم تراجع كل تغيير. لا يُحفظ شيء حتى تضغط «تطبيق التغييرات».`,"help-category-cleanup":`يجد أسماء الفئات التي لها المعنى نفسه، مثل «Execution» و«Direct execution»، ويعطي كل مجموعة اسمًا واحدًا. يعيد تسمية الفئات فقط، ولا يدمج أو يحذف أي ذكرى. تراجع المجموعات أولًا، ويمكنك التراجع عن آخر تنظيف.`,"migration-found-tags":`تم العثور على {count} من الذكريات التي تحتاج إلى وسوم تقنية.`,"migration-stopped":`تم إيقاف الترحيل: تم الوصول إلى الحد الأقصى للمحاولات`,"migration-shards-mismatch":`{count} من الأجزاء تحتوي على أبعاد مختلفة`,"migration-dimension-mismatch":`تم اكتشاف عدم تطابق في الأبعاد`,"migration-mismatch-details":`عدم تطابق النموذج: يستخدم الإعداد {configDimensions}D ({configModel}) بينما {shardInfo}.`,"auth-warning-text":`التحرير عبر المصادر معطّل. قم بتعيين webServerAuthPassword لتفعيله.`}},cr=`omms-lang`,lr=`opencode-mem-lang`;function ur(){if(typeof window>`u`)return`en`;let e=tr(cr,lr);return e===`en`||e===`zh`||e===`ar`?e:`en`}var dr=ur(),fr=new Set;function pr(){for(let e of fr)e()}function mr(e){dr=e,typeof document<`u`&&(nr(cr,e),document.documentElement.dir=e===`ar`?`rtl`:`ltr`,document.documentElement.lang=e),pr()}function hr(e){return fr.add(e),()=>{fr.delete(e)}}function gr(){return dr}function _r(){return`en`}function vr(){return dr}function yr(e){mr(e)}function U(e,t={},n=vr()){let r=sr[n][e]||sr.en[e]||e;for(let[e,n]of Object.entries(t))r=r.replace(RegExp(`\\{${e}\\}`,`g`),String(n));return r}var br=(0,_.createContext)(null);function xr(){return(0,_.useSyncExternalStore)(hr,gr,_r)}function Sr({children:e}){let t=xr(),n=(0,_.useMemo)(()=>({language:t,t:(e,n={})=>U(e,n,t)}),[t]);return(0,_.createElement)(br.Provider,{value:n},e)}function Cr(){let e=(0,_.useContext)(br),t=xr();return(0,_.useMemo)(()=>e??{language:t,t:(e,n={})=>U(e,n,t)},[e,t])}typeof document<`u`&&(document.documentElement.dir=dr===`ar`?`rtl`:`ltr`,document.documentElement.lang=dr);function wr(){let[e,t]=(0,_.useState)([]),[n,r]=(0,_.useState)([]),[i,a]=(0,_.useState)([]),[o,s]=(0,_.useState)(new Set),[c,l]=(0,_.useState)(``),[u,d]=(0,_.useState)(``),[f,p]=(0,_.useState)(``),[m,h]=(0,_.useState)(``),[g,v]=(0,_.useState)(!1),[y,b]=(0,_.useState)(1),[x,S]=(0,_.useState)(1),[C,w]=(0,_.useState)(0),[T,E]=(0,_.useState)(0),[D,O]=(0,_.useState)(!0),[ee,te]=(0,_.useState)(null),[k,ne]=(0,_.useState)(!1),[re,ie]=(0,_.useState)(!1),[ae,A]=(0,_.useState)(!1),[j,oe]=(0,_.useState)(``),[M,se]=(0,_.useState)(!1),[ce,N]=(0,_.useState)(!1),[P,le]=(0,_.useState)(0),[ue,de]=(0,_.useState)(!1),[fe,pe]=(0,_.useState)(``),[F,me]=(0,_.useState)(``),[he,ge]=(0,_.useState)(``),[_e,ve]=(0,_.useState)(``),[ye,be]=(0,_.useState)(``),[xe,Se]=(0,_.useState)(``),Ce=(0,_.useRef)({currentPage:y,isSearching:g,searchQuery:f,selectedTag:c,selectedKeyword:u});Ce.current={currentPage:y,isSearching:g,searchQuery:f,selectedTag:c,selectedKeyword:u};let we=(0,_.useCallback)(e=>{s(new Set(e))},[]),Te=(0,_.useCallback)(async()=>{let e=await Yn(`/api/tags`);e.success&&e.data&&t(e.data.project||[])},[]),Ee=(0,_.useCallback)(async e=>{let t=await Yn(e?`/api/keywords?tag=${encodeURIComponent(e)}`:`/api/keywords`);t.success&&t.data&&r(t.data.keywords||[])},[]),De=(0,_.useCallback)(async()=>{let e=await Yn(`/api/stats`);e.success&&e.data&&E(e.data.total)},[]),Oe=(0,_.useCallback)(async e=>{let{currentPage:t,isSearching:n,searchQuery:r,selectedTag:i,selectedKeyword:o}={...Ce.current,...e,currentPage:e?.page??Ce.current.currentPage};ne(!0),te(null),Ee(i);let s=`/api/memories?page=${t}&pageSize=20&includePrompts=true`;n?(s=`/api/search?q=${encodeURIComponent(r)}&page=${t}&pageSize=20`,i&&(s+=`&tag=${encodeURIComponent(i)}`)):(i&&(s+=`&tag=${encodeURIComponent(i)}`),o&&(s+=`&keyword=${encodeURIComponent(o)}`));let c=await Yn(s);ne(!1),O(!1),c.success&&c.data?(a(c.data.items),S(c.data.totalPages),w(c.data.total),b(c.data.page)):te(c.error||U(`toast-update-failed`))},[Ee]),ke=(0,_.useCallback)(async()=>{let e=await Yn(`/api/migration/detect`);if(e.success&&e.data?.needsMigration){let t=e.data.shardMismatches.length>0?U(`migration-shards-mismatch`,{count:e.data.shardMismatches.length}):U(`migration-dimension-mismatch`);oe(U(`migration-mismatch-details`,{configDimensions:e.data.configDimensions,configModel:e.data.configModel,shardInfo:t})),A(!0)}let t=await Yn(`/api/migration/tags/detect`);t.success&&t.data?.needsMigration&&ir(t.data.count)&&(le(t.data.count),N(!0))},[]),Ae=(0,_.useCallback)(async()=>{try{let e=await fetch(`/api/health`,{credentials:`same-origin`});if(!e.ok)return;if((await e.json())?.authEnabled===!0){ie(!1);return}let t=window.location.hostname.toLowerCase(),n=t===`localhost`||t===`127.0.0.1`||t===`[::1]`||t===`::1`||t.startsWith(`::ffff:`)&&t.endsWith(`127.0.0.1`);ie(!n)}catch{}},[]);function je(){let e=m.trim();if(!e){Me();return}p(e),v(!0),b(1),d(``),Oe({page:1,isSearching:!0,searchQuery:e,selectedKeyword:``})}function Me(){p(``),h(``),v(!1),b(1),Oe({page:1,isSearching:!1,searchQuery:``})}function Ne(e){l(e),b(1),v(!1),p(``),h(``),Oe({page:1,isSearching:!1,searchQuery:``,selectedTag:e})}function Pe(e){d(e),b(1),v(!1),p(``),h(``),Oe({page:1,isSearching:!1,searchQuery:``,selectedKeyword:e})}function Fe(e,t){let n=new Set(o);t?n.add(e):n.delete(e),we(n)}function Ie(){let e=new Set(o);for(let t of i)e.add(t.id);we(e)}function Le(){we(new Set)}async function Re(e){e.preventDefault();let t=xe.trim();if(!t||!he){H.error(U(`toast-add-error`));return}let n=ye.split(`,`).map(e=>e.trim()).filter(Boolean),r=await Yn(`/api/memories`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({content:t,containerTag:he,type:_e||void 0,tags:n})});r.success?(H.success(U(`toast-add-success`)),Se(``),be(``),ve(``),await Oe(),await De()):H.error(r.error||U(`toast-add-failed`))}function ze(e){let t=i.find(t=>t.id===e&&t.type===`memory`);t&&(pe(e),me(t.content),de(!0))}async function Be(e){let t=await Yn(`/api/memories/${fe}`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify({content:e})});t.success?(H.success(U(`toast-update-success`)),de(!1),await Oe()):H.error(t.error||U(`toast-update-failed`))}async function Ve(e,t){if(!confirm(U(t?`confirm-delete-pair`:`confirm-delete`)))return;let n=await Yn(`/api/memories/${e}?cascade=true`,{method:`DELETE`});if(n.success){H.success(U(`toast-delete-success`));let t=new Set(o);t.delete(e),we(t),await Oe(),await De()}else H.error(n.error||U(`toast-delete-failed`))}async function He(e,t){if(!confirm(U(t?`confirm-delete-prompt`:`confirm-delete`)))return;let n=await Yn(`/api/prompts/${e}?cascade=true`,{method:`DELETE`});if(n.success){H.success(U(`toast-delete-success`));let t=new Set(o);t.delete(e),we(t),await Oe(),await De()}else H.error(n.error||U(`toast-delete-failed`))}async function Ue(){if(o.size===0||!confirm(U(`confirm-bulk-delete`,{count:o.size})))return;let e=Array.from(o),t=e.filter(e=>e.startsWith(`prompt_`)),n=e.filter(e=>!e.startsWith(`prompt_`));t.length>0&&await Yn(`/api/prompts/bulk-delete`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({ids:t,cascade:!0})}),n.length>0&&await Yn(`/api/memories/bulk-delete`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({ids:n,cascade:!0})}),H.success(U(`toast-bulk-delete-success`)),we(new Set),await Oe(),await De()}async function We(e){let t=await Yn(`/api/memories/${e}/pin`,{method:`POST`});t.success?(H.success(U(`toast-update-success`)),await Oe()):H.error(t.error||U(`toast-update-failed`))}async function Ge(e){let t=await Yn(`/api/memories/${e}/unpin`,{method:`POST`});t.success?(H.success(U(`toast-update-success`)),await Oe()):H.error(t.error||U(`toast-update-failed`))}async function Ke(){if(!confirm(U(`confirm-cleanup`)))return;H.info(U(`status-cleanup`));let e=await Yn(`/api/cleanup`,{method:`POST`});e.success?(H.success(U(`toast-cleanup-success`)),await Oe(),await De()):H.error(e.error||U(`toast-cleanup-failed`))}async function qe(){if(!confirm(U(`confirm-dedup`)))return;H.info(U(`status-dedup`));let e=await Yn(`/api/deduplicate`,{method:`POST`});e.success?(H.success(U(`toast-dedup-success`)),await Oe(),await De()):H.error(e.error||U(`toast-dedup-failed`))}async function Je(e){if(!M){H.error(U(`toast-migration-failed`));return}if(!confirm(`Run ${e===`fresh-start`?`Fresh Start (Delete All)`:`Re-embed (Preserve Data)`} migration?\n\nThis operation is IRREVERSIBLE.\n\nContinue?`))return;H.info(U(`status-migration-init`));let t=await Yn(`/api/migration/run`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({strategy:e})});t.success?(H.success(U(`toast-migration-success`)),A(!1),se(!1),await Oe(),await De()):H.error(t.error||U(`toast-migration-failed`))}return{tags:e,memories:i,selectedIds:o,selectedTag:c,selectedKeyword:u,onKeywordFilterChange:Pe,searchInput:m,setSearchInput:h,isSearching:g,currentPage:y,setCurrentPage:b,totalPages:x,totalItems:C,statsTotal:T,loadingMemories:D,memoriesError:ee,refreshing:k,showAuthWarning:re,migrationNeeded:ae,migrationMessage:j,migrationConfirmed:M,setMigrationConfirmed:se,tagMigrationOpen:ce,setTagMigrationOpen:N,tagMigrationCount:P,editOpen:ue,setEditOpen:de,editContent:F,addTag:he,setAddTag:ge,addType:_e,setAddType:ve,addTags:ye,setAddTags:be,addContent:xe,setAddContent:Se,loadTags:Te,keywords:n,loadStats:De,loadMemories:Oe,checkMigrationStatus:ke,checkAuthWarning:Ae,performSearch:je,clearSearch:Me,onTagFilterChange:Ne,onSelect:Fe,selectAllCurrentPage:Ie,deselectAll:Le,addMemory:Re,openEdit:ze,saveEdit:Be,deleteMemory:Ve,deletePrompt:He,bulkDelete:Ue,pinMemory:We,unpinMemory:Ge,runCleanup:Ke,runDeduplication:qe,runMigration:Je}}function Tr(){let[e,t]=(0,_.useState)(null),[n,r]=(0,_.useState)(!1),[i,a]=(0,_.useState)(!1),[o,s]=(0,_.useState)(!1),c=(0,_.useCallback)(async()=>{r(!0);let e=await Yn(`/api/user-profile`);r(!1),e.success&&e.data?t(e.data):H.error(e.error||U(`toast-update-failed`))},[]);return{userProfile:e,loadingProfile:n,aiCleanupOpen:i,setAiCleanupOpen:a,categoryCleanupOpen:o,setCategoryCleanupOpen:s,loadUserProfile:c,refreshProfile:(0,_.useCallback)(async()=>{H.info(U(`loading-profile`));let e=await Yn(`/api/user-profile/refresh`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({})});e.success?(H.success(e.data?.message||U(`toast-update-success`)),await c()):H.error(e.error||U(`toast-update-failed`))},[c])}}function Er(e,t){if(!e)return t?{phase:`failed`,error:t}:{phase:`select`};let n=e.status;switch(n.state){case`running`:return{phase:`running`,done:n.done,total:n.total};case`done`:{let{failedBatches:e,failedItems:t}=n.result,r=e>0?{batches:e,items:t}:null;return{phase:`review`,result:n.result,notice:r}}case`failed`:return{phase:`failed`,error:n.error}}}function Dr(e,t){return t&&e?.status.state===`running`}function Or(e,t){let n=t.success?t.data??null:e;return{job:n,poll:Dr(n,!0)}}function kr(e,t){return e?new Set(e.selection):t}function Ar(e,t){return e?e.selection:[...t]}var jr=2e3;function Mr(e){let[t,n]=(0,_.useState)(null),r=(0,_.useRef)(null),i=(0,_.useCallback)(e=>{r.current=e,n(e)},[]),[a,o]=(0,_.useState)(),[s,c]=(0,_.useState)(0),l=(0,_.useRef)(0);return(0,_.useEffect)(()=>{if(!e)return;let t=!1,n,a=l.current,o=async()=>{let e=await Qn.status();if(t||l.current!==a)return;let s=Or(r.current,e);i(s.job),s.poll&&(n=setTimeout(()=>void o(),jr))};return o(),()=>{t=!0,clearTimeout(n)}},[e,s,i]),(0,_.useEffect)(()=>{e||o(void 0)},[e]),{job:t,startError:a,start:(0,_.useCallback)(async(e,t,n)=>{o(void 0);let r=await Qn.start(e,t);if(!r.success||!r.data){i(null),o(r.error||n);return}i(r.data),c(e=>e+1)},[i]),discard:(0,_.useCallback)(async()=>{l.current++,i(null),o(void 0),await Qn.stop()},[i]),clear:()=>i(null)}}var Nr=Object.defineProperty,Pr=(e,t)=>Nr(e,`name`,{value:t,configurable:!0});function Fr(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}Pr(Fr,`setRef`);function Ir(...e){return t=>{let n=!1,r=e.map(e=>{let r=Fr(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():Fr(e[t],null)}}}}Pr(Ir,`composeRefs`);function Lr(...e){return _.useCallback(Ir(...e),e)}Pr(Lr,`useComposedRefs`);var Rr=Object.defineProperty,zr=(e,t)=>Rr(e,`name`,{value:t,configurable:!0});function Br(e){let t=_.forwardRef((t,n)=>{let{children:r,...i}=t,a=null,o=!1,s=[];Yr(r)&&typeof $r==`function`&&(r=$r(r._payload)),_.Children.forEach(r,e=>{if(qr(e)){o=!0;let t=e,n=`child`in t.props?t.props.child:t.props.children;Yr(n)&&typeof $r==`function`&&(n=$r(n._payload)),a=Wr(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?Kr(a):void 0,l=Lr(n,c);if(!a){if(r||r===0)throw Error(o?Qr(e):Zr(e));return r}let u=Gr(i,a.props??{});return a.type!==_.Fragment&&(u.ref=n?l:c),_.cloneElement(a,u)});return t.displayName=`${e}.Slot`,t}zr(Br,`createSlot`);var Vr=Br(`Slot`),Hr=Symbol.for(`radix.slottable`);function Ur(e){let t=zr(e=>`child`in e?e.children(e.child):e.children,`Slottable`);return t.displayName=`${e}.Slottable`,t.__radixId=Hr,t}zr(Ur,`createSlottable`);var Wr=zr((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 Gr(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}}zr(Gr,`mergeProps`);function Kr(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)}zr(Kr,`getElementRef`);function qr(e){return _.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===Hr}zr(qr,`isSlottable`);var Jr=Symbol.for(`react.lazy`);function Yr(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===Jr&&`_payload`in e&&Xr(e._payload)}zr(Yr,`isLazyComponent`);function Xr(e){return typeof e==`object`&&!!e&&`then`in e}zr(Xr,`isPromiseLike`);var Zr=zr(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,`createSlotError`),Qr=zr(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,`createSlottableError`),$r=_.use,ei=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,ti=He,ni=(e,t)=>n=>{if(t?.variants==null)return ti(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=ei(t)||ei(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 ti(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)},ri=ni(`focus-visible:border-ring focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background aria-invalid:border-destructive aria-invalid:ring-destructive border border-transparent bg-clip-padding text-ui font-medium focus-visible:ring-2 aria-invalid:ring-1 [&_svg:not([class*='size-'])]:size-4 group/button inline-flex max-w-full shrink-0 items-center justify-center whitespace-nowrap transition-colors duration-150 outline-none select-none disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0`,{variants:{variant:{default:`bg-primary/10 border-primary/25 text-primary-label hover:bg-primary/16 active:bg-primary/22 dark:bg-primary/16 dark:hover:bg-primary/22 dark:active:bg-primary/30`,outline:`border-input bg-card text-foreground hover:bg-interactive-hover active:bg-interactive-active aria-expanded:bg-selection`,secondary:`border-border bg-secondary text-secondary-foreground hover:bg-interactive-hover active:bg-interactive-active aria-expanded:bg-selection`,ghost:`text-foreground hover:bg-interactive-hover active:bg-interactive-active aria-expanded:bg-selection`,destructive:`bg-destructive/10 border-destructive/25 text-destructive-label hover:bg-destructive/16 active:bg-destructive/22 dark:bg-destructive/16 dark:hover:bg-destructive/22 dark:active:bg-destructive/30`,link:`text-primary-label underline-offset-4 hover:underline`},size:{default:`h-9 rounded-[10px] gap-1.5 px-3 has-data-[icon=inline-end]:pe-2.5 has-data-[icon=inline-start]:ps-2.5`,xs:`h-6 rounded-[7px] gap-1 px-2.5 text-xs has-data-[icon=inline-end]:pe-2 has-data-[icon=inline-start]:ps-2 [&_svg:not([class*='size-'])]:size-3`,sm:`h-8 rounded-[9px] gap-1 px-3 has-data-[icon=inline-end]:pe-2 has-data-[icon=inline-start]:ps-2`,lg:`h-10 rounded-[12px] gap-1.5 px-4 has-data-[icon=inline-end]:pe-3 has-data-[icon=inline-start]:ps-3`,icon:`size-9 rounded-[10px]`,"icon-xs":`size-6 rounded-[7px] [&_svg:not([class*='size-'])]:size-3`,"icon-sm":`size-8 rounded-[9px]`,"icon-lg":`size-10 rounded-[12px]`}},defaultVariants:{variant:`default`,size:`default`}});function W({className:e,variant:t,size:n,asChild:r=!1,...i}){return(0,V.jsx)(r?Vr:`button`,{"data-slot":`button`,className:B(ri({variant:t,size:n,className:e})),...i})}function ii({onSelectAll:e,onSelectNone:t,onSelectLow:n,onSelectSameCat:r}){let{t:i}=Cr(),[a,o]=(0,_.useState)(null),s=(e,t)=>()=>{t(),o(e)};return(0,V.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-2`,children:[(0,V.jsxs)(`div`,{className:`flex flex-wrap gap-1.5`,children:[(0,V.jsx)(W,{variant:`secondary`,size:`xs`,onClick:s(null,e),children:i(`label-ai-cleanup-select-all`)}),(0,V.jsx)(W,{variant:`secondary`,size:`xs`,onClick:s(null,t),children:i(`label-ai-cleanup-deselect-all`)}),(0,V.jsx)(W,{variant:`secondary`,size:`xs`,"aria-pressed":a===`low`,onClick:s(`low`,n),children:i(`label-ai-cleanup-select-low`)}),(0,V.jsx)(W,{variant:`secondary`,size:`xs`,"aria-pressed":a===`same-cat`,onClick:s(`same-cat`,r),children:i(`label-ai-cleanup-select-same-cat`)})]}),a?(0,V.jsx)(`p`,{role:`status`,className:`rounded-lg border border-border bg-muted px-3 py-2 text-xs text-muted-foreground`,children:i(a===`low`?`label-ai-cleanup-hint-low`:`label-ai-cleanup-hint-same-cat`)}):null]})}function ai({steps:e}){return e?.length?(0,V.jsx)(`div`,{className:`flex flex-wrap gap-1 text-xs text-muted-foreground`,children:e.map((t,n)=>(0,V.jsxs)(`span`,{className:`contents`,children:[(0,V.jsxs)(`span`,{children:[n+1,`. `,t]}),n<e.length-1?(0,V.jsx)(k,{className:`size-3 inline`}):null]},n))}):null}var oi=Object.defineProperty,si=(e,t)=>oi(e,`name`,{value:t,configurable:!0});function ci(e,t){let n=_.createContext(t);n.displayName=e+`Context`;let r=si(e=>{let{children:t,...r}=e,i=_.useMemo(()=>r,Object.values(r));return(0,V.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 si(i,`useContext`),[r,i]}si(ci,`createContext`);function li(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=si(t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,c=_.useMemo(()=>o,Object.values(o));return(0,V.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 si(s,`useContext`),[o,s]}si(r,`createContext`);let i=si(()=>{let t=n.map(e=>_.createContext(e));return si(function(n){let r=n?.[e]||t;return _.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])},`useScope`)},`createScope`);return i.scopeName=e,[r,ui(i,...t)]}si(li,`createContextScope`);function ui(...e){let t=e[0];if(e.length===1)return t;let n=si(()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return si(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}si(ui,`composeContextScopes`);var di=Object.defineProperty,fi=(e,t)=>di(e,`name`,{value:t,configurable:!0}),pi=!!(typeof window<`u`&&window.document&&window.document.createElement);function mi(e,t,{checkForDefaultPrevented:n=!0}={}){return fi(function(r){if(e?.(r),n===!1||!r||!r.defaultPrevented)return t?.(r)},`handleEvent`)}fi(mi,`composeEventHandlers`);function hi(e){if(!pi)throw Error(`Cannot access window outside of the DOM`);return e?.ownerDocument?.defaultView??window}fi(hi,`getOwnerWindow`);function gi(e){if(!pi)throw Error(`Cannot access document outside of the DOM`);return e?.ownerDocument??document}fi(gi,`getOwnerDocument`);function _i(e,t=!1){let{activeElement:n}=gi(e);if(!n?.nodeName)return null;if(vi(n)&&n.contentDocument)return _i(n.contentDocument.body,t);if(t){let e=n.getAttribute(`aria-activedescendant`);if(e){let t=gi(n).getElementById(e);if(t)return t}}return n}fi(_i,`getActiveElement`);function vi(e){return e.tagName===`IFRAME`}fi(vi,`isFrame`);var yi=globalThis?.document?_.useLayoutEffect:()=>{},bi=Object.defineProperty,xi=(e,t)=>bi(e,`name`,{value:t,configurable:!0}),Si=_.useEffectEvent,Ci=_.useInsertionEffect;function wi(e){if(typeof Si==`function`)return Si(e);let t=_.useRef(()=>{throw Error(`Cannot call an event handler while rendering.`)});return typeof Ci==`function`?Ci(()=>{t.current=e}):yi(()=>{t.current=e}),_.useMemo(()=>((...e)=>t.current?.(...e)),[])}xi(wi,`useEffectEvent`);var Ti=Object.defineProperty,Ei=(e,t)=>Ti(e,`name`,{value:t,configurable:!0}),Di=_.useInsertionEffect||yi;function Oi({prop:e,defaultProp:t,onChange:n=Ei(()=>{},`onChange`),caller:r}){let[i,a,o]=G({defaultProp:t,onChange:n}),s=e!==void 0;return[s?e:i,_.useCallback(t=>{if(s){let n=ki(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}Ei(Oi,`useControllableState`);function G({defaultProp:e,onChange:t}){let[n,r]=_.useState(e),i=_.useRef(n),a=_.useRef(t);return Di(()=>{a.current=t},[t]),_.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}Ei(G,`useUncontrolledState`);function ki(e){return typeof e==`function`}Ei(ki,`isFunction`);var Ai=Symbol(`RADIX:SYNC_STATE`);function ji(e,t,n,r){let{prop:i,defaultProp:a,onChange:o,caller:s}=t,c=i!==void 0,l=wi(o),u=[{...n,state:a}];r&&u.push(r);let[d,f]=_.useReducer((t,n)=>{if(n.type===Ai)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:Ai,state:i})},[i,d.state,c]),[h,f]}Ei(ji,`useControllableStateReducer`);var Mi=Object.defineProperty,Ni=(e,t)=>Mi(e,`name`,{value:t,configurable:!0});function Pi(e){let[t,n]=_.useState(void 0);return yi(()=>{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}Ni(Pi,`useSize`);var Fi=Object.defineProperty,Ii=(e,t)=>Fi(e,`name`,{value:t,configurable:!0});function Li(e,t){return _.useReducer((e,n)=>t[e][n]??e,e)}Ii(Li,`useStateMachine`);var Ri=Ii(e=>{let{present:t,children:n}=e,r=zi(t),i=typeof n==`function`?n({present:r.isPresent}):_.Children.only(n),a=Vi(r.ref,Ui(i));return typeof n==`function`||r.isPresent?_.cloneElement(i,{ref:a}):null},`Presence`);function zi(e){let[t,n]=_.useState(),r=_.useRef(null),i=_.useRef(e),a=_.useRef(`none`),o=_.useRef(void 0),[s,c]=Li(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??Hi(r.current),o.current=void 0):a.current=`none`},[s]),yi(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,s=Hi(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]),yi(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=Ii(a=>{let o=Hi(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=Ii(e=>{e.target===t&&(a.current=Hi(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=Hi(t)}else r.current=null;n(e)},[])}}Ii(zi,`usePresence`);function Bi(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}Ii(Bi,`setRef`);function Vi(...e){let t=_.useRef(e);return t.current=e,_.useCallback(e=>{let n=t.current,r=!1,i=n.map(t=>{let n=Bi(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():Bi(n[e],null)}}},[])}Ii(Vi,`useStableComposedRefs`);function Hi(e){return e?.animationName||`none`}Ii(Hi,`getAnimationName`);function Ui(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)}Ii(Ui,`getElementRef`);var Wi=Object.defineProperty,Gi=(e,t)=>Wi(e,`name`,{value:t,configurable:!0}),Ki=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=Br(`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,V.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function qi(e,t){e&&_n.flushSync(()=>e.dispatchEvent(t))}Gi(qi,`dispatchDiscreteCustomEvent`);var Ji=Object.defineProperty,Yi=(e,t)=>Ji(e,`name`,{value:t,configurable:!0}),Xi=`Checkbox`,[Zi,Qi]=li(Xi),[$i,ea]=Zi(Xi);function ta(e){let{__scopeCheckbox:t,checked:n,children:r,defaultChecked:i,disabled:a,form:o,name:s,onCheckedChange:c,required:l,value:u=`on`,internal_do_not_use_render:d}=e,[f,p]=Oi({prop:n,defaultProp:i??!1,onChange:c,caller:Xi}),[m,h]=_.useState(null),[g,v]=_.useState(null),y=_.useRef(!1),[b,x]=_.useReducer(e=>e+1,0),S=!m||!!o||!!m.closest(`form`),C={checked:f,disabled:a,setChecked:p,control:m,setControl:h,name:s,form:o,value:u,hasConsumerStoppedPropagationRef:y,userInteractionCount:b,onUserInteraction:x,required:l,defaultChecked:!ua(i)&&i,isFormControl:S,bubbleInput:g,setBubbleInput:v};return(0,V.jsx)($i,{scope:t,...C,children:la(d)?d(C):r})}Yi(ta,`CheckboxProvider`);var na=`CheckboxTrigger`,ra=_.forwardRef(Yi(function({__scopeCheckbox:e,onKeyDown:t,onClick:n,...r},i){let{control:a,value:o,disabled:s,checked:c,required:l,setControl:u,setChecked:d,hasConsumerStoppedPropagationRef:f,onUserInteraction:p,isFormControl:m,bubbleInput:h}=ea(na,e),g=Lr(i,u),v=_.useRef(c);return _.useEffect(()=>{let e=a?.form;if(e){let t=Yi(()=>d(v.current),`reset`);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[a,d]),(0,V.jsx)(Ki.button,{type:`button`,role:`checkbox`,"aria-checked":ua(c)?`mixed`:c,"aria-required":l,"data-state":da(c),"data-disabled":s?``:void 0,disabled:s,value:o,...r,ref:g,onKeyDown:mi(t,e=>{e.key===`Enter`&&e.preventDefault()}),onClick:mi(n,e=>{p(),d(e=>ua(e)?!0:!e),h&&m&&(f.current=e.isPropagationStopped(),f.current||e.stopPropagation())})})},`CheckboxTrigger`)),ia=_.forwardRef(Yi(function(e,t){let{__scopeCheckbox:n,name:r,checked:i,defaultChecked:a,required:o,disabled:s,value:c,onCheckedChange:l,form:u,...d}=e;return(0,V.jsx)(ta,{__scopeCheckbox:n,checked:i,defaultChecked:a,disabled:s,required:o,onCheckedChange:l,name:r,form:u,value:c,internal_do_not_use_render:({isFormControl:e})=>(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(ra,{...d,ref:t,__scopeCheckbox:n}),e&&(0,V.jsx)(ca,{__scopeCheckbox:n})]})})},`Checkbox`)),aa=`CheckboxIndicator`,oa=_.forwardRef(Yi(function(e,t){let{__scopeCheckbox:n,forceMount:r,...i}=e,a=ea(aa,n);return(0,V.jsx)(Ri,{present:r||ua(a.checked)||a.checked===!0,children:(0,V.jsx)(Ki.span,{"data-state":da(a.checked),"data-disabled":a.disabled?``:void 0,...i,ref:t,style:{pointerEvents:`none`,...e.style}})})},`CheckboxIndicator`)),sa=`CheckboxBubbleInput`,ca=_.forwardRef(Yi(function({__scopeCheckbox:e,onClick:t,...n},r){let{control:i,hasConsumerStoppedPropagationRef:a,userInteractionCount:o,checked:s,defaultChecked:c,required:l,disabled:u,name:d,value:f,form:p,bubbleInput:m,setBubbleInput:h}=ea(sa,e),g=Lr(r,h),v=Pi(i),y=_.useRef(!1),b=_.useRef(s),x=_.useRef(o);_.useEffect(()=>{let e=m;if(!e)return;let t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,`checked`).set,r=o!==x.current;x.current=o;let i=b.current!==s;b.current=s;let c=!(r&&a.current);if(i&&n){y.current=!r;let t=new Event(`click`,{bubbles:c});e.indeterminate=ua(s),n.call(e,!ua(s)&&s),e.dispatchEvent(t),y.current=!1}},[m,s,a,o]);let S=_.useRef(!ua(s)&&s);return(0,V.jsx)(Ki.input,{type:`checkbox`,"aria-hidden":!0,defaultChecked:c??S.current,required:l,disabled:u,name:d,value:f,form:p,...n,tabIndex:-1,ref:g,onClick:mi(t,e=>{y.current&&e.stopPropagation()}),style:{...n.style,...v,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0,transform:`translateX(-100%)`}})},`CheckboxBubbleInput`));function la(e){return typeof e==`function`}Yi(la,`isFunction`);function ua(e){return e===`indeterminate`}Yi(ua,`isIndeterminate`);function da(e){return ua(e)?`indeterminate`:e?`checked`:`unchecked`}Yi(da,`getState`);function fa({className:e,...t}){return(0,V.jsx)(ia,{"data-slot":`checkbox`,className:B(`border-input bg-card data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background aria-invalid:ring-destructive aria-invalid:border-destructive peer size-4 shrink-0 rounded-[4px] border transition-colors duration-150 outline-none focus-visible:ring-2 disabled:cursor-not-allowed disabled:opacity-50`,e),...t,children:(0,V.jsx)(oa,{"data-slot":`checkbox-indicator`,className:`grid place-content-center text-current`,children:(0,V.jsx)(ie,{className:`size-3.5`})})})}var pa=Object.defineProperty,ma=(e,t)=>pa(e,`name`,{value:t,configurable:!0}),ha=_.useId||(()=>void 0),ga=0;function _a(e){let[t,n]=_.useState(ha());return yi(()=>{e||n(e=>e??String(ga++))},[e]),e||(t?`radix-${t}`:``)}ma(_a,`useId`);var va=Object.defineProperty,ya=(e,t)=>va(e,`name`,{value:t,configurable:!0});function ba(e){let t=_.useRef(e);return _.useEffect(()=>{t.current=e}),_.useMemo(()=>((...e)=>t.current?.(...e)),[])}ya(ba,`useCallbackRef`);var xa=Object.defineProperty,Sa=(e,t)=>xa(e,`name`,{value:t,configurable:!0}),Ca=`dismissableLayer.update`,wa=`dismissableLayer.pointerDownOutside`,Ta=`dismissableLayer.focusOutside`,Ea,Da=_.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),Oa=_.forwardRef(Sa(function(e,t){let{disableOutsidePointerEvents:n=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:o,onInteractOutside:s,onDismiss:c,...l}=e,u=_.useContext(Da),[d,f]=_.useState(null),p=d?.ownerDocument??globalThis?.document,[,m]=_.useState({}),h=Lr(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=ja(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=Ma(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=ba(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&&(Ea=p.body.style.pointerEvents,p.body.style.pointerEvents=`none`),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),Na(),()=>{n&&(u.layersWithOutsidePointerEventsDisabled.delete(d),u.layersWithOutsidePointerEventsDisabled.size===0&&(p.body.style.pointerEvents=Ea))}},[d,p,n,u]),_.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),Na())},[d,u]),_.useEffect(()=>{let e=Sa(()=>m({}),`handleUpdate`);return document.addEventListener(Ca,e),()=>document.removeEventListener(Ca,e)},[]),(0,V.jsx)(Ki.div,{...l,ref:h,style:{pointerEvents:x?S?`auto`:`none`:void 0,...e.style},onFocusCapture:mi(e.onFocusCapture,T.onFocusCapture),onBlurCapture:mi(e.onBlurCapture,T.onBlurCapture),onPointerDownCapture:mi(e.onPointerDownCapture,w.onPointerDownCapture)})},`DismissableLayer`));function ka(){let e=_.useContext(Da),[t,n]=_.useState(null);return _.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}Sa(ka,`useDismissableLayerSurface`);var Aa=Sa(()=>!0,`IS_TRUE`);function ja(e,t){let{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:i,dismissableSurfaces:a,shouldHandlePointerDownOutside:o=Aa}=t,s=ba(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()}Sa(e,`resetOutsideInteraction`);function t(){return Array.from(u.current.values()).some(Boolean)}Sa(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)}Sa(f,`handleInteractionCapture`);function p(e){l.current&&u.current.set(e.type,!1)}Sa(p,`handleInteractionBubble`);let m=Sa(a=>{if(a.target&&!c.current){let f=function(){n.removeEventListener(`click`,d.current);let r=t();e(),r||Pa(wa,s,p,{discrete:!0})};if(Sa(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:Sa(()=>c.current=!0,`onPointerDownCapture`)}}Sa(ja,`usePointerDownOutside`);function Ma(e,t=globalThis?.document){let n=ba(e),r=_.useRef(!1);return _.useEffect(()=>{let e=Sa(e=>{e.target&&!r.current&&Pa(Ta,n,{originalEvent:e},{discrete:!1})},`handleFocus`);return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:Sa(()=>r.current=!0,`onFocusCapture`),onBlurCapture:Sa(()=>r.current=!1,`onBlurCapture`)}}Sa(Ma,`useFocusOutside`);function Na(){let e=new CustomEvent(Ca);document.dispatchEvent(e)}Sa(Na,`dispatchUpdate`);function Pa(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?qi(i,a):i.dispatchEvent(a)}Sa(Pa,`handleAndDispatchCustomEvent`);var Fa=Object.defineProperty,Ia=(e,t)=>Fa(e,`name`,{value:t,configurable:!0}),La=`focusScope.autoFocusOnMount`,Ra=`focusScope.autoFocusOnUnmount`,za={bubbles:!1,cancelable:!0},Ba=_.forwardRef(Ia(function(e,t){let{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[s,c]=_.useState(null),l=ba(i),u=ba(a),d=_.useRef(null),f=Lr(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:qa(d.current,{select:!0})},t=function(e){if(p.paused||!s)return;let t=e.relatedTarget;t!==null&&(s.contains(t)||qa(d.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&qa(s)};Ia(e,`handleFocusIn`),Ia(t,`handleFocusOut`),Ia(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){Ja.add(p);let e=document.activeElement;if(!s.contains(e)){let t=new CustomEvent(La,za);s.addEventListener(La,l),s.dispatchEvent(t),t.defaultPrevented||(Va(Za(Ua(s)),{select:!0}),document.activeElement===e&&qa(s))}return()=>{s.removeEventListener(La,l),setTimeout(()=>{let t=new CustomEvent(Ra,za);s.addEventListener(Ra,u),s.dispatchEvent(t),t.defaultPrevented||qa(e??document.body,{select:!0}),s.removeEventListener(Ra,u),Ja.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]=Ha(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&qa(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&qa(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,p.paused]);return(0,V.jsx)(Ki.div,{tabIndex:-1,...o,ref:f,onKeyDown:m})},`FocusScope`));function Va(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(qa(r,{select:t}),document.activeElement!==n)return}Ia(Va,`focusFirst`);function Ha(e){let t=Ua(e);return[Wa(t,e),Wa(t.reverse(),e)]}Ia(Ha,`getTabbableEdges`);function Ua(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:Ia(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}Ia(Ua,`getTabbableCandidates`);function Wa(e,t){let n=typeof t.checkVisibility==`function`&&t.checkVisibility({checkVisibilityCSS:!0});for(let r of e)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):Ga(r,{upTo:t})))return r}Ia(Wa,`findVisible`);function Ga(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}Ia(Ga,`isHidden`);function Ka(e){return e instanceof HTMLInputElement&&`select`in e}Ia(Ka,`isSelectableInput`);function qa(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Ka(e)&&t&&e.select()}}Ia(qa,`focus`);var Ja=Ya();function Ya(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=Xa(e,t),e.unshift(t)},remove(t){e=Xa(e,t),e[0]?.resume()}}}Ia(Ya,`createFocusScopesStack`);function Xa(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}Ia(Xa,`arrayRemove`);function Za(e){return e.filter(e=>e.tagName!==`A`)}Ia(Za,`removeLinks`);var Qa=Object.defineProperty,$a=_.forwardRef(((e,t)=>Qa(e,`name`,{value:t,configurable:!0}))(function(e,t){let{container:n,...r}=e,[i,a]=_.useState(!1);yi(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?_n.createPortal((0,V.jsx)(Ki.div,{...r,ref:t}),o):null},`Portal`)),eo=Object.defineProperty,to=(e,t)=>eo(e,`name`,{value:t,configurable:!0}),no=0,ro=null;function io(e){return ao(),e.children}to(io,`FocusGuards`);function ao(){_.useEffect(()=>{ro||={start:oo(),end:oo()};let{start:e,end:t}=ro;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement(`afterbegin`,e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement(`beforeend`,t),no++,()=>{no===1&&(ro?.start.remove(),ro?.end.remove(),ro=null),no=Math.max(0,no-1)}},[])}to(ao,`useFocusGuards`);function oo(){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}to(oo,`createFocusGuard`);var K=function(){return K=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},K.apply(this,arguments)};function so(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 co(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 lo=`right-scroll-bar-position`,uo=`width-before-scroll-bar`,fo=`with-scroll-bars-hidden`,po=`--removed-body-scroll-bar-size`;function mo(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function ho(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 go=typeof window<`u`?_.useLayoutEffect:_.useEffect,_o=new WeakMap;function vo(e,t){var n=ho(t||null,function(t){return e.forEach(function(e){return mo(e,t)})});return go(function(){var t=_o.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||mo(e,null)}),i.forEach(function(e){r.has(e)||mo(e,a)})}_o.set(n,e)},[e]),n}function yo(e){return e}function bo(e,t){t===void 0&&(t=yo);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 xo(e){e===void 0&&(e={});var t=bo(null);return t.options=K({async:!0,ssr:!1},e),t}var So=function(e){var t=e.sideCar,n=so(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,K({},n))};So.isSideCarExport=!0;function Co(e,t){return e.useMedium(t),So}var wo=xo(),To=function(){},Eo=_.forwardRef(function(e,t){var n=_.useRef(null),r=_.useState({onScrollCapture:To,onWheelCapture:To,onTouchMoveCapture:To}),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=so(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),S=f,C=vo([n,t]),w=K(K({},x),i);return _.createElement(_.Fragment,null,u&&_.createElement(S,{sideCar:wo,removeScrollBar:l,shards:d,noRelative:p,noIsolation:m,inert:h,setCallbacks:a,allowPinchZoom:!!g,lockRef:n,gapMode:b}),o?_.cloneElement(_.Children.only(s),K(K({},w),{ref:C})):_.createElement(y,K({},w,{className:c,ref:C}),s))});Eo.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Eo.classNames={fullWidth:uo,zeroRight:lo};var Do,Oo=function(){if(Do)return Do;if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function ko(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=Oo();return t&&e.setAttribute(`nonce`,t),e}function Ao(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function jo(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var Mo=function(){var e=0,t=null;return{add:function(n){e==0&&(t=ko())&&(Ao(t,n),jo(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},No=function(){var e=Mo();return function(t,n){_.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Po=function(){var e=No();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},Fo={left:0,top:0,right:0,gap:0},Io=function(e){return parseInt(e||``,10)||0},Lo=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[Io(n),Io(r),Io(i)]},Ro=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return Fo;var t=Lo(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])}},zo=Po(),Bo=`data-scroll-locked`,Vo=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
10
+ .${fo} {
11
+ overflow: hidden ${r};
12
+ padding-right: ${s}px ${r};
13
+ }
14
+ body[${Bo}] {
15
+ overflow: hidden ${r};
16
+ overscroll-behavior: contain;
17
+ ${[t&&`position: relative ${r};`,n===`margin`&&`
18
+ padding-left: ${i}px;
19
+ padding-top: ${a}px;
20
+ padding-right: ${o}px;
21
+ margin-left:0;
22
+ margin-top:0;
23
+ margin-right: ${s}px ${r};
24
+ `,n===`padding`&&`padding-right: ${s}px ${r};`].filter(Boolean).join(``)}
25
+ }
26
+
27
+ .${lo} {
28
+ right: ${s}px ${r};
29
+ }
30
+
31
+ .${uo} {
32
+ margin-right: ${s}px ${r};
33
+ }
34
+
35
+ .${lo} .${lo} {
36
+ right: 0 ${r};
37
+ }
38
+
39
+ .${uo} .${uo} {
40
+ margin-right: 0 ${r};
41
+ }
42
+
43
+ body[${Bo}] {
44
+ ${po}: ${s}px;
45
+ }
46
+ `},Ho=function(){var e=parseInt(document.body.getAttribute(`data-scroll-locked`)||`0`,10);return isFinite(e)?e:0},Uo=function(){_.useEffect(function(){return document.body.setAttribute(Bo,(Ho()+1).toString()),function(){var e=Ho()-1;e<=0?document.body.removeAttribute(Bo):document.body.setAttribute(Bo,e.toString())}},[])},Wo=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?`margin`:r;Uo();var a=_.useMemo(function(){return Ro(i)},[i]);return _.createElement(zo,{styles:Vo(a,!t,i,n?``:`!important`)})},Go=!1;if(typeof window<`u`)try{var Ko=Object.defineProperty({},"passive",{get:function(){return Go=!0,!0}});window.addEventListener(`test`,Ko,Ko),window.removeEventListener(`test`,Ko,Ko)}catch{Go=!1}var qo=Go?{passive:!1}:!1,Jo=function(e){return e.tagName===`TEXTAREA`},Yo=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!==`hidden`&&!(n.overflowY===n.overflowX&&!Jo(e)&&n[t]===`visible`)},Xo=function(e){return Yo(e,`overflowY`)},Zo=function(e){return Yo(e,`overflowX`)},Qo=function(e,t){var n=t.ownerDocument,r=t;do{if(typeof ShadowRoot<`u`&&r instanceof ShadowRoot&&(r=r.host),ts(e,r)){var i=ns(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},$o=function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]},es=function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]},ts=function(e,t){return e===`v`?Xo(t):Zo(t)},ns=function(e,t){return e===`v`?$o(t):es(t)},rs=function(e,t){return e===`h`&&t===`rtl`?-1:1},is=function(e,t,n,r,i){var a=rs(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=ns(e,s),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&ts(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},as=function(e){return`changedTouches`in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},os=function(e){return[e.deltaX,e.deltaY]},ss=function(e){return e&&`current`in e?e.current:e},cs=function(e,t){return e[0]===t[0]&&e[1]===t[1]},ls=function(e){return`
47
+ .block-interactivity-${e} {pointer-events: none;}
48
+ .allow-interactivity-${e} {pointer-events: all;}
49
+ `},us=0,ds=[];function fs(e){var t=_.useRef([]),n=_.useRef([0,0]),r=_.useRef(),i=_.useState(us++)[0],a=_.useState(Po)[0],o=_.useRef(e);_.useEffect(function(){o.current=e},[e]),_.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=co([e.lockRef.current],(e.shards||[]).map(ss),!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=as(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=Qo(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=Qo(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 is(h,t,e,h===`h`?s:c,!0)},[]),c=_.useCallback(function(e){var n=e;if(!(!ds.length||ds[ds.length-1]!==a)){var r=`deltaY`in n?os(n):as(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&cs(e.delta,r)})[0];if(i&&i.should){n.cancelable&&n.preventDefault();return}if(!i){var c=(o.current.shards||[]).map(ss).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:ps(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),u=_.useCallback(function(e){n.current=as(e),r.current=void 0},[]),d=_.useCallback(function(t){l(t.type,os(t),t.target,s(t,e.lockRef.current))},[]),f=_.useCallback(function(t){l(t.type,as(t),t.target,s(t,e.lockRef.current))},[]);_.useEffect(function(){return ds.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener(`wheel`,c,qo),document.addEventListener(`touchmove`,c,qo),document.addEventListener(`touchstart`,u,qo),function(){ds=ds.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,c,qo),document.removeEventListener(`touchmove`,c,qo),document.removeEventListener(`touchstart`,u,qo)}},[]);var p=e.removeScrollBar,m=e.inert;return _.createElement(_.Fragment,null,m?_.createElement(a,{styles:ls(i)}):null,p?_.createElement(Wo,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function ps(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var ms=Co(wo,fs),hs=_.forwardRef(function(e,t){return _.createElement(Eo,K({},e,{ref:t,sideCar:ms}))});hs.classNames=Eo.classNames;var gs=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},_s=new WeakMap,vs=new WeakMap,ys={},bs=0,xs=function(e){return e&&(e.host||xs(e.parentNode))},Ss=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=xs(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})},Cs=function(e,t,n,r){var i=Ss(t,Array.isArray(e)?e:[e]);ys[n]||(ys[n]=new WeakMap);var a=ys[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=(_s.get(e)||0)+1,l=(a.get(e)||0)+1;_s.set(e,c),a.set(e,l),o.push(e),c===1&&i&&vs.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(),bs++,function(){o.forEach(function(e){var t=_s.get(e)-1,i=a.get(e)-1;_s.set(e,t),a.set(e,i),t||(vs.has(e)||e.removeAttribute(r),vs.delete(e)),i||e.removeAttribute(n)}),bs--,bs||(_s=new WeakMap,_s=new WeakMap,vs=new WeakMap,ys={})}},ws=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||gs(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),Cs(r,i,n,`aria-hidden`)):function(){return null}},Ts=Object.defineProperty,Es=(e,t)=>Ts(e,`name`,{value:t,configurable:!0}),Ds=`Dialog`,[Os,ks]=li(Ds),[As,js]=Os(Ds),Ms=Es(e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,s=_.useRef(null),c=_.useRef(null),[l,u]=Oi({prop:r,defaultProp:i??!1,onChange:a,caller:Ds}),[d,f]=_.useState(0),[p,m]=_.useState(0);return(0,V.jsx)(As,{scope:t,triggerRef:s,contentRef:c,contentId:_a(),titleId:_a(),descriptionId:_a(),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`),Ns=`DialogPortal`,[Ps,Fs]=Os(Ns,{forceMount:void 0}),Is=Es(e=>{let{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=js(Ns,t);return(0,V.jsx)(Ps,{scope:t,forceMount:n,children:_.Children.map(r,e=>(0,V.jsx)(Ri,{present:n||a.open,children:(0,V.jsx)($a,{asChild:!0,container:i,children:e})}))})},`DialogPortal`),Ls=`DialogOverlay`,Rs=_.forwardRef(Es(function(e,t){let n=Fs(Ls,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=js(Ls,e.__scopeDialog);return a.modal?(0,V.jsx)(Ri,{present:r||a.open,children:(0,V.jsx)(Bs,{...i,ref:t})}):null},`DialogOverlay`)),zs=Br(`DialogOverlay.RemoveScroll`),Bs=_.forwardRef(Es(function(e,t){let{__scopeDialog:n,...r}=e,i=js(Ls,n),a=Lr(t,ka());return(0,V.jsx)(hs,{as:zs,allowPinchZoom:!0,shards:[i.contentRef],children:(0,V.jsx)(Ki.div,{"data-state":Qs(i.open),...r,ref:a,style:{pointerEvents:`auto`,...r.style}})})},`DialogOverlayImpl`)),Vs=`DialogContent`,Hs=_.forwardRef(Es(function(e,t){let n=Fs(Vs,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=js(Vs,e.__scopeDialog);return(0,V.jsx)(Ri,{present:r||a.open,children:a.modal?(0,V.jsx)(Us,{...i,ref:t}):(0,V.jsx)(Ws,{...i,ref:t})})},`DialogContent`)),Us=_.forwardRef(Es(function(e,t){let n=js(Vs,e.__scopeDialog),r=_.useRef(null),i=Lr(t,n.contentRef,r);return _.useEffect(()=>{let e=r.current;if(e)return ws(e)},[]),(0,V.jsx)(Gs,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,onCloseAutoFocus:mi(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:mi(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:mi(e.onFocusOutside,e=>e.preventDefault())})},`DialogContentModal`)),Ws=_.forwardRef(Es(function(e,t){let n=js(Vs,e.__scopeDialog),r=_.useRef(!1),i=_.useRef(!1);return(0,V.jsx)(Gs,{...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`)),Gs=_.forwardRef(Es(function(e,t){let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,...o}=e,s=js(Vs,n);return ao(),(0,V.jsx)(V.Fragment,{children:(0,V.jsx)(Ba,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,V.jsx)(Oa,{role:`dialog`,id:s.contentId,"aria-describedby":s.descriptionPresent?s.descriptionId:void 0,"aria-labelledby":s.titlePresent?s.titleId:void 0,"data-state":Qs(s.open),...o,ref:t,deferPointerDownOutside:!0,onDismiss:()=>s.onOpenChange(!1)})})})},`DialogContentImpl`)),Ks=`DialogTitle`,qs=_.forwardRef(Es(function(e,t){let{__scopeDialog:n,...r}=e,i=js(Ks,n),{setTitleCount:a}=i;return yi(()=>(a(e=>e+1),()=>a(e=>e-1)),[a]),(0,V.jsx)(Ki.h2,{id:i.titleId,...r,ref:t})},`DialogTitle`)),Js=`DialogDescription`,Ys=_.forwardRef(Es(function(e,t){let{__scopeDialog:n,...r}=e,i=js(Js,n),{setDescriptionCount:a}=i;return yi(()=>(a(e=>e+1),()=>a(e=>e-1)),[a]),(0,V.jsx)(Ki.p,{id:i.descriptionId,...r,ref:t})},`DialogDescription`)),Xs=`DialogClose`,Zs=_.forwardRef(Es(function(e,t){let{__scopeDialog:n,...r}=e,i=js(Xs,n);return(0,V.jsx)(Ki.button,{type:`button`,...r,ref:t,onClick:mi(e.onClick,()=>i.onOpenChange(!1))})},`DialogClose`));function Qs(e){return e?`open`:`closed`}Es(Qs,`getState`);function $s({...e}){return(0,V.jsx)(Ms,{"data-slot":`dialog`,...e})}function ec({...e}){return(0,V.jsx)(Is,{"data-slot":`dialog-portal`,...e})}function tc({className:e,...t}){return(0,V.jsx)(Rs,{"data-slot":`dialog-overlay`,className:B(`data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50`,e),...t})}function nc({className:e,children:t,showCloseButton:n=!0,onOpenAutoFocus:r,onCloseAutoFocus:i,...a}){let{t:o}=Cr(),s=_.useRef(null);return(0,V.jsxs)(ec,{children:[(0,V.jsx)(tc,{}),(0,V.jsxs)(Hs,{"data-slot":`dialog-content`,className:B(`bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 grid max-h-[calc(100dvh-2rem)] max-w-[calc(100%-2rem)] overflow-y-auto gap-6 rounded-xl border border-border p-6 text-sm shadow-lg duration-150 sm:max-w-md fixed top-1/2 left-1/2 z-50 w-full -translate-x-1/2 -translate-y-1/2 outline-none`,e),...a,onOpenAutoFocus:e=>{s.current=document.activeElement instanceof HTMLElement?document.activeElement:null,r?.(e)},onCloseAutoFocus:e=>{i?.(e),!(e.defaultPrevented||!s.current?.isConnected)&&(e.preventDefault(),s.current.focus())},children:[t,n?(0,V.jsx)(Zs,{"data-slot":`dialog-close`,asChild:!0,children:(0,V.jsxs)(W,{variant:`ghost`,className:`bg-secondary absolute top-4 end-4`,size:`icon-sm`,children:[(0,V.jsx)(Be,{}),(0,V.jsx)(`span`,{className:`sr-only`,children:o(`dialog-close`)})]})}):null]})]})}function rc({className:e,...t}){return(0,V.jsx)(`div`,{"data-slot":`dialog-header`,className:B(`flex flex-col gap-2 pe-10 text-start`,e),...t})}function ic({className:e,...t}){return(0,V.jsx)(`div`,{"data-slot":`dialog-footer`,className:B(`flex flex-col-reverse gap-2 sm:flex-row sm:justify-end`,e),...t})}function ac({className:e,...t}){return(0,V.jsx)(qs,{"data-slot":`dialog-title`,className:B(`text-section-title font-semibold`,e),...t})}function oc({className:e,...t}){return(0,V.jsx)(Ys,{"data-slot":`dialog-description`,className:B(`text-muted-foreground text-sm`,e),...t})}function sc(e,t=3){let n=new Map;for(let t of e)t.category?.trim()&&n.set(t.category,[...n.get(t.category)??[],t._id]);let r=new Set;for(let e of n.values())if(e.length>=t)for(let t of e)r.add(t);return r}var cc=class extends Error{constructor(e,t){super(`${e} at position ${t}`),this.position=t}},lc=32,uc=10,dc=9,fc=13,pc=160,mc=6158,hc=8192,gc=8203,_c=8239,vc=8287,yc=12288,bc=65279;function xc(e){return/^[0-9A-Fa-f]$/.test(e)}function Sc(e){return e>=`0`&&e<=`9`}function Cc(e){return e>=` `}function wc(e){return`,:[]/{}()
50
+ +`.includes(e)}function Tc(e){return e>=`a`&&e<=`z`||e>=`A`&&e<=`Z`||e===`_`||e===`$`}function Ec(e){return e>=`a`&&e<=`z`||e>=`A`&&e<=`Z`||e===`_`||e===`$`||e>=`0`&&e<=`9`}var Dc=/^(http|https|ftp|mailto|file|data|irc):\/\/$/,Oc=/^[A-Za-z0-9-._~:/?#@!$&'()*+;=]$/;function kc(e){return`,[]/{}
51
+ +`.includes(e)}function Ac(e){return Ic(e)||jc.test(e)}var jc=/^[[{\w-]$/;function Mc(e){return e===`
52
+ `||e===`\r`||e===` `||e===`\b`||e===`\f`}function Nc(e,t){let n=e.charCodeAt(t);return n===lc||n===uc||n===dc||n===fc}function Pc(e,t){let n=e.charCodeAt(t);return n===lc||n===dc||n===fc}function Fc(e,t){let n=e.charCodeAt(t);return n===pc||n===mc||n>=hc&&n<=gc||n===_c||n===vc||n===yc||n===bc}function Ic(e){return Lc(e)||zc(e)}function Lc(e){return e===`"`||e===`“`||e===`”`}function Rc(e){return e===`"`}function zc(e){return e===`'`||e===`‘`||e===`’`||e==="`"||e===`´`}function Bc(e){return e===`'`}function Vc(e,t){let n=arguments.length>2&&arguments[2]!==void 0&&arguments[2],r=e.lastIndexOf(t);return r===-1?e:e.substring(0,r)+(n?``:e.substring(r+1))}function Hc(e,t){let n=e.length;if(!Nc(e,n-1))return e+t;for(;Nc(e,n-1);)n--;return e.substring(0,n)+t+e.substring(n)}function Uc(e,t,n){return e.substring(0,t)+e.substring(t+n)}function Wc(e){return/[,\n][ \t\r]*$/.test(e)}var Gc={"&quot;":`"`,"&amp;":`&`,"&lt;":`<`,"&gt;":`>`,"&apos;":`'`};function Kc(e){if(e.charAt(0)!==`&`)return null;let t=e.indexOf(`;`);if(t===-1)return null;let n=e.substring(0,t+1),r=Gc[n];if(r!==void 0)return{char:r,length:n.length};if(e.charAt(1)===`#`){let r=e.substring(2,t),i=r.charAt(0)===`x`||r.charAt(0)===`X`,a=i?r.substring(1):r;if(a.length>0){let e=Number.parseInt(a,i?16:10);if(!Number.isNaN(e)&&e>=0&&e<=1114111)return{char:String.fromCodePoint(e),length:n.length}}}return null}function qc(e){return e!==null&&e.char===`"`}function Jc(e){return e!==null&&e.char===`'`}function Yc(e,t){let n=0;for(let r=0;r<e.length;r++)e.charAt(r)===t&&n++;return n}function Xc(e,t){switch(t){case`)`:return Yc(e,`(`)>Yc(e,`)`);case`]`:return Yc(e,`[`)>Yc(e,`]`);case`}`:return Yc(e,`{`)>Yc(e,`}`);default:return!1}}var Zc={"\b":`\\b`,"\f":`\\f`,"\n":`\\n`,"\r":`\\r`," ":`\\t`},Qc={'"':`"`,"\\":`\\`,"/":`/`,b:`\b`,f:`\f`,n:`
53
+ `,r:`\r`,t:` `};function $c(e){let t=0,n=``;c(["```","[```","{```"]),i()||ee(),c(["```","```]","```}"]);let r=u(`,`);for(r&&a(),Ac(e[t])&&Wc(n)?(r||(n=Hc(n,`,`)),g()):r&&(n=Vc(n,`,`));e[t]===`}`||e[t]===`]`;)t++,a();if(t>=e.length)return n;O();function i(){a();let e=m()||h()||_()||y()||b()||S(!1)||C();return a(),e}function a(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,n=t,r=o(e);do r=s(),r&&=o(e);while(r);return t>n}function o(r){let i=r?Nc:Pc,a=``;for(;;)if(i(e,t))a+=e[t],t++;else if(Fc(e,t))a+=` `,t++;else break;return a.length>0&&(n+=a,!0)}function s(){if(e[t]===`/`&&e[t+1]===`*`){for(;t<e.length&&!el(e,t);)t++;return t+=2,!0}if(e[t]===`/`&&e[t+1]===`/`){for(;t<e.length&&e[t]!==`
54
+ `;)t++;return!0}return!1}function c(n){if(l(n)){if(Tc(e[t]))for(;t<e.length&&Ec(e[t]);)t++;return a(),!0}return!1}function l(n){o(!0);for(let r of n){let n=t+r.length;if(e.slice(t,n)===r)return t=n,!0}return!1}function u(r){return e[t]===r&&(n+=e[t],t++,!0)}function d(n){return e[t]===n&&(t++,!0)}function f(){return d(`\\`)}function p(){return a(),e[t]===`.`&&e[t+1]===`.`&&e[t+2]===`.`&&(t+=3,a(),d(`,`),!0)}function m(){if(e[t]===`{`){n+=`{`,t++,a(),d(`,`)&&a();let r=!0;for(;t<e.length&&e[t]!==`}`;){let o;if(r?o=!0:(o=u(`,`),o||(n=Hc(n,`,`)),a()),p(),!(_()||S(!0))){e[t]===`}`||e[t]===`{`||e[t]===`]`||e[t]===`[`||e[t]===void 0?r||(n=Vc(n,`,`)):te();break}a();let s=u(`:`),c=t>=e.length;s||(Ac(e[t])||c?n=Hc(n,`:`):k()),i()||(s||c?n+=`null`:k()),r=!1}return e[t]===`}`?(n+=`}`,t++):n=Hc(n,`}`),!0}return!1}function h(){if(e[t]===`[`){n+=`[`,t++,a(),d(`,`)&&a();let r=!0;for(;t<e.length&&e[t]!==`]`;){if(r||u(`,`)||(n=Hc(n,`,`)),p(),!i()){r||(n=Vc(n,`,`));break}r=!1}return e[t]===`]`?(n+=`]`,t++):n=Hc(n,`]`),!0}return!1}function g(){let e=!0,t=!0;for(;t;)e?e=!1:u(`,`)||(n=Hc(n,`,`)),t=i();t||(n=Vc(n,`,`)),n=`[\n${n}\n]`}function _(){let r=arguments.length>0&&arguments[0]!==void 0&&arguments[0],i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:-1,o=e[t]===`\\`;o&&(t++,Ic(e[t])||O());let s=e[t]===`&`?Kc(e.slice(t,t+12)):null,c=qc(s)||Jc(s);if(Ic(e[t])||c){let l=Rc(e[t])?Rc:Bc(e[t])?Bc:zc(e[t])?zc:Lc,u=t,d=n.length,p=`"`;for(t+=c&&s?s.length:1;;){if(t>=e.length){let i=w(t-1);return!r&&wc(e.charAt(i))?(t=u,n=n.substring(0,d),_(!0)):(p=Hc(p,`"`),n+=p,!0)}if(t===i)return p=Hc(p,`"`),n+=p,!0;let m=c&&e[t]===`&`?Kc(e.slice(t,t+12)):null;if(m&&s?m.char===s.char:l(e[t])){let i=t,o=p.length;if(p+=`"`,t+=m?m.length:1,n+=p,a(!1),r||t>=e.length||wc(e[t])&&!Xc(p,e[t])||Ic(e[t])&&!T(t)||Sc(e[t]))return v(),!0;e[t]===`\\`&&O();let s=w(i-1),c=e.charAt(s);if(c===`,`)return t=u,n=n.substring(0,d),_(!1,s);if(wc(c))return t=u,n=n.substring(0,d),_(!0);n=n.substring(0,d),t=i+(m?m.length:1),p=`${p.substring(0,o)}\\${p.substring(o)}`}else if(r&&kc(e[t])){if(e[t-1]===`:`&&Dc.test(e.substring(u+1,t+2)))for(;t<e.length&&Oc.test(e[t]);)p+=e[t],t++;return p=Hc(p,`"`),n+=p,v(),!0}else if(m){let e=m.char;e===`"`?p+=`\\"`:Mc(e)?p+=Zc[e]:p+=e,t+=m.length}else if(e[t]===`\\`){let n=e.charAt(t+1);if(Qc[n]!==void 0)p+=e.slice(t,t+2),t+=2;else if(n===`u`){let n=2;for(;n<6&&xc(e[t+n]);)n++;n===6?(p+=e.slice(t,t+6),t+=6):t+n>=e.length?t=e.length:ne()}else n===`
55
+ `?(p+=`\\n`,t+=2):(p+=n,t+=2)}else{let n=e.charAt(t);n===`"`&&e[t-1]!==`\\`?(p+=`\\${n}`,t++):Mc(n)?(p+=Zc[n],t++):(Cc(n)||D(n),p+=n,t++)}o&&f()}}return!1}function v(){let r=!1;for(a();e[t]===`+`;){r=!0,t++,a(),n=Vc(n,`"`,!0);let e=n.length;n=_()?Uc(n,e,1):Hc(n,`"`)}return r}function y(){let r=t,i=``,a=!1;for(e[t]===`-`&&(i+=e[t],t++,!Sc(e[t])&&E()&&(i+=`0`)),e[t]===`0`&&Sc(e[t+1])&&(a=!0);Sc(e[t]);)i+=e[t],t++;if(e[t]===`.`)for((i===``||i===`-`)&&(i+=`0`),i+=e[t],t++,Sc(e[t])||(i+=`0`);Sc(e[t]);)i+=e[t],t++;if(t>r){if(e[t]===`e`||e[t]===`E`)for(i===`-`&&(a=!0),i+=e[t],t++,(e[t]===`-`||e[t]===`+`)&&(i+=e[t],t++),Sc(e[t])||(i+=`0`);Sc(e[t]);)i+=e[t],t++;return E()?(n+=a?`"${e.substring(r,t)}"`:i,!0):(t=r,!1)}return!1}function b(){return x(`true`,`true`)||x(`false`,`false`)||x(`null`,`null`)||x(`True`,`true`)||x(`False`,`false`)||x(`None`,`null`)}function x(r,i){return e.slice(t,t+r.length)===r&&!Ec(e[t+r.length])&&(n+=i,t+=r.length,!0)}function S(r){let a=t;if(Tc(e[t])){for(;t<e.length&&Ec(e[t]);)t++;let n=t;for(;Nc(e,n);)n++;if(e[n]===`(`)return t=n+1,i(),e[t]===`)`&&(t++,e[t]===`;`&&t++),!0}for(;t<e.length&&!kc(e[t])&&!Ic(e[t])&&(!r||e[t]!==`:`);)t++;if(e[t-1]===`:`&&Dc.test(e.substring(a,t+2)))for(;t<e.length&&Oc.test(e[t]);)t++;if(t>a){for(;Nc(e,t-1)&&t>0;)t--;let r=e.slice(a,t);return n+=r===`undefined`?`null`:JSON.stringify(r),e[t]===`"`&&t++,!0}}function C(){if(e[t]===`/`){let r=t;for(t++;t<e.length&&(e[t]!==`/`||e[t-1]===`\\`);)t++;return t++,n+=JSON.stringify(e.substring(r,t)),!0}}function w(t){let n=t;for(;n>0&&Nc(e,n);)n--;return n}function T(t){let n=t+1;for(;n<e.length&&Nc(e,n);)n++;return n>=e.length||wc(e[n])}function E(){return t>=e.length||wc(e[t])||Nc(e,t)}function D(e){throw new cc(`Invalid character ${JSON.stringify(e)}`,t)}function O(){throw new cc(`Unexpected character ${JSON.stringify(e[t])}`,t)}function ee(){throw new cc(`Unexpected end of json string`,e.length)}function te(){throw new cc(`Object key expected`,t)}function k(){throw new cc(`Colon expected`,t)}function ne(){throw new cc(`Invalid unicode character "${e.slice(t,t+6)}"`,t)}}function el(e,t){return e[t]===`*`&&e[t+1]===`/`}function tl(e){if(!e)return[];let t=e,n=null;for(;typeof t==`string`&&t!==n;){n=t;try{t=JSON.parse($c(t))}catch{break}}if(!Array.isArray(t))return[];let r=[],i=e=>{Array.isArray(e)?e.forEach(i):e&&typeof e==`object`&&r.push(e)};return i(t),r}function nl(e,t){if(!t||!e.includes(`_`))return null;let[n,r]=e.split(`_`),i=parseInt(r,10);return Number.isNaN(i)?null:n===`pref`?t.preferences?.[i]?.description??null:n===`pat`?t.patterns?.[i]?.description??null:n===`wf`?t.workflows?.[i]?.description??null:null}function rl(e,t){if(!t||!e.includes(`_`))return null;let[n,r]=e.split(`_`),i=parseInt(r,10);return Number.isNaN(i)||n!==`wf`?null:t.workflows?.[i]?.steps||null}function il(e){return e>=80?`high`:e>=60?`medium`:e>=40?`low`:`poor`}var al={high:`border-green-600/40 bg-green-500/15 text-green-700 dark:text-green-400`,medium:`border-blue-600/40 bg-blue-500/15 text-blue-700 dark:text-blue-400`,low:`border-orange-600/40 bg-orange-500/15 text-orange-700 dark:text-orange-400`,poor:`border-red-600/40 bg-red-500/15 text-red-700 dark:text-red-400`};function ol(e,t){return e.length>t?e.substring(0,t)+`...`:e}function sl({open:e=!1,profile:t=null,onOpenChange:n,onApplied:r}){let{t:i}=Cr(),a=Mr(e),[o,s]=(0,_.useState)(!1),[c,l]=(0,_.useState)([]),[u,d]=(0,_.useState)(new Set),[f,p]=(0,_.useState)(new Set),[m,h]=(0,_.useState)(new Set),[g,v]=(0,_.useState)(!1),[y,b]=(0,_.useState)(!1),x=(0,_.useRef)(!1),S=a.job,C=Er(S,a.startError),w=o?{phase:`running`,done:0,total:0}:C,T=w.phase===`review`?w.result:null,E=(0,_.useMemo)(()=>{let e={};for(let t of c){let n=t.category||`(none)`;e[n]||(e[n]={pref:[],pat:[],wf:[]}),e[n][t._type].push(t)}return e},[c]),D=(0,_.useMemo)(()=>Object.keys(E).sort(),[E]),O=u.size,ee=f.size+m.size,te=(T?.changes.merged?.length||0)+(T?.changes.removed?.length||0);function k(){let e=t?.profileData;if(!e){H.error(`No profile data loaded`),re(!1);return}let n=(e.preferences||[]).map((e,t)=>({...e,_id:`pref_${t}`,_type:`pref`})),r=(e.patterns||[]).map((e,t)=>({...e,_id:`pat_${t}`,_type:`pat`})),i=(e.workflows||[]).map((e,t)=>({...e,_id:`wf_${t}`,_type:`wf`})),a=[...n,...r,...i];l(a),d(new Set(a.filter(e=>(e.frequency||0)<=3).map(e=>e._id))),v(!1)}(0,_.useEffect)(()=>{e&&!x.current?k():!e&&x.current&&b(!1),x.current=e},[e]);let ne=S?.status.state===`done`?S.id:null;(0,_.useEffect)(()=>{if(S?.status.state!==`done`)return;let{changes:e}=S.status.result;p(new Set((e.merged||[]).map((e,t)=>t))),h(new Set((e.removed||[]).map((e,t)=>t)))},[ne]);function re(e){n?.(e)}function ie(e,t){d(n=>{let r=new Set(n);return t?r.add(e):r.delete(e),r})}function A(){d(new Set(c.map(e=>e._id)))}function M(){d(new Set)}function se(){d(new Set(c.filter(e=>(e.frequency||0)<=3).map(e=>e._id)))}function ce(){d(sc(c))}async function N(e){if(e.length===0){H.warning(`No items selected`);return}s(!0),await a.start(e,t?.version,i(`toast-ai-cleanup-failed`)),s(!1)}function le(){d(kr(S,u)),a.discard()}function ue(e){if(!e.includes(`_`))return`?`;let t=e.split(`_`)[0];return t===`pref`?i(`profile-type-pref`)||`Pref`:t===`pat`?i(`profile-type-pat`)||`Pat`:t===`wf`?i(`profile-type-wf`)||`Wf`:`?`}function de(e,t){p(n=>{let r=new Set(n);return t?r.add(e):r.delete(e),r})}function fe(e,t){h(n=>{let r=new Set(n);return t?r.add(e):r.delete(e),r})}function F(){p(new Set((T?.changes.merged||[]).map((e,t)=>t))),h(new Set((T?.changes.removed||[]).map((e,t)=>t)))}function me(){p(new Set),h(new Set)}async function he(){if(!T||ee===0)return;b(!0);let e=[...f].map(e=>T.changes.merged?.[e]?.ids).filter(e=>!!e),t=[...m].map(e=>T.changes.removed?.[e]?.id).filter(e=>!!e),n=await Qn.apply(e,t);if(b(!1),n.success){let{applied:e=0,skipped:t=0}=n.data??{};H.success(t>0?i(`toast-ai-cleanup-skipped`,{applied:e,skipped:t}):i(`toast-ai-cleanup-success`)),a.clear(),re(!1),r?.()}else H.error(n.error||i(`toast-cleanup-apply-failed`))}return(0,V.jsx)($s,{open:e,onOpenChange:re,children:(0,V.jsxs)(nc,{className:`grid! sm:max-w-2xl max-h-[90vh] grid-rows-[auto_minmax(0,1fr)_auto] overflow-hidden gap-4`,children:[(0,V.jsx)(rc,{children:(0,V.jsx)(ac,{children:i(`label-ai-cleanup-title`)})}),w.phase===`running`?(0,V.jsxs)(`div`,{className:`flex flex-col items-center gap-3 py-10 text-muted-foreground`,children:[(0,V.jsx)(pe,{className:`size-6 animate-spin`}),(0,V.jsx)(`span`,{className:`text-sm`,children:i(`label-ai-cleanup-loading`)}),w.total>0?(0,V.jsx)(`span`,{className:`text-sm font-medium text-foreground`,"aria-live":`polite`,children:i(`label-ai-cleanup-progress`,{done:w.done,total:w.total})}):null,(0,V.jsx)(`span`,{className:`text-xs`,children:i(`label-ai-cleanup-running-hint`)})]}):w.phase===`failed`?(0,V.jsxs)(`div`,{className:`flex flex-col items-center gap-2 py-10 text-center`,role:`alert`,children:[(0,V.jsx)(`span`,{className:`text-sm font-medium text-destructive`,children:i(`toast-ai-cleanup-failed`)}),(0,V.jsx)(`span`,{className:`text-sm text-muted-foreground break-words`,children:w.error})]}):w.phase===`select`?(0,V.jsxs)(`div`,{className:`flex min-h-0 flex-col gap-3 overflow-hidden`,children:[(0,V.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,V.jsx)(`h3`,{className:`text-subsection-title font-semibold`,children:i(`label-ai-cleanup-select`)}),(0,V.jsx)(ii,{onSelectAll:A,onSelectNone:M,onSelectLow:se,onSelectSameCat:ce})]}),(0,V.jsx)(`div`,{className:`min-h-0 flex-1 space-y-4 overflow-y-auto pr-1`,children:D.map(e=>{let t=[...E[e].pref,...E[e].pat,...E[e].wf];return(0,V.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,V.jsx)(`span`,{className:`text-xs rounded-full bg-muted px-2 py-0.5`,children:e}),(0,V.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[t.length,` items`]})]}),t.map(e=>{let t=u.has(e._id);return(0,V.jsxs)(`div`,{className:`flex items-center gap-2 rounded-lg border border-border/60 px-2 py-1.5 text-sm cursor-pointer hover:bg-muted/40`,role:`checkbox`,"aria-checked":t,tabIndex:0,onClick:()=>ie(e._id,!t),onKeyDown:n=>{(n.key===`Enter`||n.key===` `)&&(n.preventDefault(),ie(e._id,!t))},children:[(0,V.jsx)(`span`,{className:`pointer-events-none inline-flex`,children:(0,V.jsx)(fa,{checked:t,tabIndex:-1})}),(0,V.jsx)(`span`,{className:`text-[10px] font-medium text-muted-foreground w-4`,children:e._type===`pref`?`P`:e._type===`pat`?`T`:`W`}),(0,V.jsx)(`span`,{className:`flex-1 truncate`,children:(e.description||``).substring(0,80)}),(0,V.jsxs)(`span`,{className:`inline-flex items-center gap-1 text-xs text-muted-foreground shrink-0`,children:[(0,V.jsx)(Me,{className:`size-3`}),e.frequency||0,e.confidence==null?``:` | ${Math.round(e.confidence*100)}%`]})]},e._id)})]},e)})}),(0,V.jsxs)(`div`,{className:`flex items-center justify-between gap-2 pt-1`,children:[(0,V.jsx)(`span`,{className:`rounded-md border border-status-success/30 bg-status-success/10 px-2 py-0.5 text-xs font-medium text-status-success`,children:i(`label-ai-cleanup-selected`,{count:O})}),(0,V.jsx)(W,{onClick:()=>N([...u]),children:i(`label-ai-cleanup-analyze`)})]})]}):w.phase===`review`&&T?(0,V.jsxs)(`div`,{className:`flex min-h-0 flex-col gap-3 overflow-hidden`,children:[w.notice?(0,V.jsx)(`div`,{className:`rounded-lg border border-status-warning/30 bg-status-warning/10 px-3 py-2 text-xs text-status-warning`,children:i(`label-ai-cleanup-failed-batches`,w.notice)}):null,(0,V.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,V.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:i(`label-ai-cleanup-changes-selected`,{selected:ee,total:te})}),(0,V.jsxs)(`div`,{className:`flex gap-2`,children:[(0,V.jsx)(W,{variant:`link`,size:`xs`,onClick:F,children:i(`label-ai-cleanup-select-all`)}),(0,V.jsx)(W,{variant:`link`,size:`xs`,onClick:me,children:i(`label-ai-cleanup-deselect-all`)})]})]}),(0,V.jsxs)(`div`,{className:`min-h-0 flex-1 space-y-4 overflow-y-auto pr-1`,children:[(T.changes.merged||[]).length>0?(0,V.jsxs)(`div`,{className:`space-y-2`,children:[(0,V.jsxs)(`h3`,{className:`flex items-center gap-1.5 text-subsection-title font-semibold`,children:[(0,V.jsx)(P,{className:`size-3.5`}),i(`label-ai-cleanup-merged-header`,{count:T.changes.merged?.length||0})]}),(T.changes.merged||[]).map((e,t)=>{let n=e.ids.slice(1),r=e.result||``,a=f.has(t);return(0,V.jsxs)(`div`,{className:`rounded-xl border border-border p-3 space-y-2`,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-2 text-sm cursor-pointer`,role:`checkbox`,"aria-checked":a,tabIndex:0,onClick:()=>de(t,!a),onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),de(t,!a))},children:[(0,V.jsx)(`span`,{className:`pointer-events-none inline-flex`,children:(0,V.jsx)(fa,{checked:a,tabIndex:-1})}),(0,V.jsx)(`span`,{children:i(`label-ai-cleanup-merge-check`)})]}),(0,V.jsxs)(`div`,{className:`grid gap-2 sm:grid-cols-[1fr_auto_1fr] items-start text-sm`,children:[(0,V.jsx)(`div`,{className:`space-y-1.5`,children:n.map(e=>{let t=nl(e,T.old);return t?(0,V.jsxs)(`div`,{className:`rounded-lg bg-muted/50 p-2 space-y-1`,children:[(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`span`,{className:`text-[10px] rounded bg-muted px-1.5 py-0.5`,children:ue(e)}),` `,ol(t,80)]}),(0,V.jsx)(ai,{steps:rl(e,T.old)})]},e):null})}),(0,V.jsx)(`div`,{className:`text-muted-foreground self-center grid place-items-center`,children:(0,V.jsx)(j,{className:`size-4`})}),(0,V.jsxs)(`div`,{className:`rounded-lg bg-primary/10 p-2 space-y-1`,children:[(0,V.jsx)(`div`,{children:ol(r,120)}),(0,V.jsx)(ai,{steps:rl(e.ids[0],T.old)})]})]})]},t)})]}):null,(T.changes.removed||[]).length>0?(0,V.jsxs)(`div`,{className:`space-y-2`,children:[(0,V.jsxs)(`h3`,{className:`flex items-center gap-1.5 text-subsection-title font-semibold`,children:[(0,V.jsx)(Ne,{className:`size-3.5`}),i(`label-ai-cleanup-removed-header`,{count:T.changes.removed?.length||0})]}),(T.changes.removed||[]).map((e,t)=>{let n=nl(e.id,T.old),r=m.has(t);return(0,V.jsxs)(`div`,{className:`rounded-xl border border-border p-3 space-y-2`,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-2 text-sm cursor-pointer`,role:`checkbox`,"aria-checked":r,tabIndex:0,onClick:()=>fe(t,!r),onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),fe(t,!r))},children:[(0,V.jsx)(`span`,{className:`pointer-events-none inline-flex`,children:(0,V.jsx)(fa,{checked:r,tabIndex:-1})}),(0,V.jsx)(`span`,{children:i(`label-ai-cleanup-remove-check`)})]}),(0,V.jsx)(`div`,{className:`text-sm`,children:n||e.id}),(0,V.jsx)(ai,{steps:rl(e.id,T.old)}),(0,V.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:e.reason})]},t)})]}):null,(T.changes.kept||[]).length>0?(0,V.jsxs)(`div`,{className:`space-y-2`,children:[(0,V.jsxs)(`button`,{type:`button`,className:`flex items-center gap-1.5 text-sm font-medium`,onClick:()=>v(e=>!e),children:[i(`label-ai-cleanup-kept`),(0,V.jsxs)(`span`,{className:`text-muted-foreground`,children:[`(`,T.changes.kept?.length||0,`)`]}),g?(0,V.jsx)(oe,{className:`size-3.5`}):(0,V.jsx)(ae,{className:`size-3.5`})]}),g?(0,V.jsx)(`div`,{className:`space-y-1`,children:(T.changes.kept||[]).map((e,t)=>(0,V.jsx)(`div`,{className:`text-xs text-muted-foreground rounded bg-muted/40 px-2 py-1`,children:e},t))}):null]}):null]})]}):null,(0,V.jsxs)(ic,{children:[(0,V.jsx)(W,{variant:`secondary`,onClick:()=>re(!1),children:i(`btn-cancel`)}),w.phase===`running`&&!o?(0,V.jsx)(W,{variant:`outline`,onClick:le,children:i(`btn-ai-cleanup-stop`)}):null,w.phase===`failed`||w.phase===`review`?(0,V.jsx)(W,{variant:`outline`,onClick:le,children:i(`btn-ai-cleanup-back`)}):null,w.phase===`failed`?(0,V.jsx)(W,{onClick:()=>N(Ar(S,u)),children:i(`btn-ai-cleanup-retry`)}):null,w.phase===`review`?(0,V.jsx)(W,{disabled:ee===0||y,onClick:he,children:ee>0?`${i(`label-ai-cleanup-apply`)} (${ee})`:i(`label-ai-cleanup-apply`)||`Apply`}):null]})]})})}function cl(e){let t=new Set;return e.forEach((e,n)=>{e.checked&&t.add(n)}),t}function ll(e,t){let n=new Set(e);return n.has(t)?n.delete(t):n.add(t),n}function ul(e,t,n){return t.reduce((e,t,r)=>e-(n.has(r)?t.labels.length-1:0),e)}function dl(e,t,n){return[...t].map(t=>({labels:e[t].labels.map(e=>e.label),name:n[t].trim()}))}function fl(e){let t=0;for(let n of e.trim().toLowerCase())t=t*31+n.codePointAt(0)|0;return Math.abs(t)%360}function pl({keyword:e,active:t=!1,title:n,onClick:r,"aria-describedby":i,"aria-label":a}){let o=fl(e);return(0,V.jsx)(`button`,{type:`button`,title:n,"aria-describedby":i,"aria-label":a,"aria-pressed":t,onClick:()=>r?.(e),className:B(`inline-flex min-h-6 max-w-full cursor-pointer items-center rounded-[7px] border px-2 text-xs break-words transition-colors duration-150 focus-visible:outline-2 focus-visible:outline-ring focus-visible:outline-offset-2`,`[color:oklch(0.42_0.13_var(--keyword-hue))] dark:[color:oklch(0.8_0.13_var(--keyword-hue))]`,t&&`ring-2 ring-offset-1 ring-offset-background`),style:{backgroundColor:`oklch(0.72 0.14 ${o} / 0.18)`,borderColor:`oklch(0.72 0.14 ${o} / 0.45)`,"--keyword-hue":String(o),"--tw-ring-color":`oklch(0.72 0.14 ${o} / 0.7)`},children:e})}var ml=ni(`h-5 gap-1 rounded-2xl border border-transparent px-2 py-0.5 text-xs font-medium transition-all has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&>svg]:size-3! focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive group/badge inline-flex w-fit shrink-0 items-center justify-center overflow-hidden whitespace-nowrap transition-colors focus-visible:ring-[3px] [&>svg]:pointer-events-none`,{variants:{variant:{default:`bg-primary/10 border-primary/25 text-primary-label [a]:hover:bg-primary/16`,secondary:`bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80`,destructive:`bg-destructive/10 border-destructive/25 [a]:hover:bg-destructive/16 text-destructive-label`,outline:`border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground`,ghost:`hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50`,link:`text-primary underline-offset-4 hover:underline`}},defaultVariants:{variant:`default`}});function hl({className:e,variant:t,asChild:n=!1,...r}){return(0,V.jsx)(n?Vr:`span`,{"data-slot":`badge`,className:B(ml({variant:t}),e),...r})}function gl({className:e,type:t,...n}){return(0,V.jsx)(`input`,{type:t,"data-slot":`input`,className:B(`border-input file:text-foreground placeholder:text-muted-foreground selection:bg-selection selection:text-foreground flex h-9 w-full min-w-0 rounded-[10px] border bg-card px-2.5 py-1 text-ui transition-colors duration-150 outline-none file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-ui file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50`,`focus-visible:border-ring focus-visible:ring-ring focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-offset-background`,`aria-invalid:ring-destructive aria-invalid:ring-1 aria-invalid:border-destructive`,e),...n})}var _l=3e3;function vl({label:e,count:t}){return(0,V.jsxs)(hl,{variant:`outline`,className:`bg-transparent border-current [color:oklch(0.42_0.13_var(--category-hue))] dark:[color:oklch(0.8_0.13_var(--category-hue))]`,style:{"--category-hue":String(fl(e))},children:[(0,V.jsx)(`bdi`,{children:e}),(0,V.jsx)(`span`,{className:`ms-1 font-mono opacity-70`,children:t})]})}function yl({open:e=!1,onOpenChange:t,onApplied:n}){let{t:r}=Cr(),[i,a]=(0,_.useState)(null),[o,s]=(0,_.useState)(new Set),[c,l]=(0,_.useState)([]),[u,d]=(0,_.useState)(!1),[f,p]=(0,_.useState)(null),[m,h]=(0,_.useState)(null),g=(0,_.useRef)(!1),v=(0,_.useRef)(0);(0,_.useEffect)(()=>{e&&!g.current&&b(!1),e||v.current++,g.current=e},[e]);function y(e){a(e),s(cl(e.groups)),l(e.groups.map(e=>e.name))}async function b(e){let t=++v.current;a(null),p(null),h(null);let n=null;if(!e){let e=await Yn(`/api/user-profile/category-cleanup`);n=e.success?e.data??null:null}if(!n||n.status.state===`failed`){let e=await Yn(`/api/user-profile/category-cleanup`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({})});if(!e.success||!e.data){h(e.error||r(`toast-category-cleanup-failed`));return}n=e.data}for(;t===v.current;){let e=n.status;if(e.state===`done`)return y(e.preview);if(e.state===`failed`)return h(e.error);p(e.state===`checking`&&e.total>0?{done:e.done,total:e.total}:null),await new Promise(e=>setTimeout(e,_l));let t=await Yn(`/api/user-profile/category-cleanup`);if(!t.success||!t.data)return h(t.error||r(`toast-category-cleanup-failed`));n=t.data}}function x(e){s(t=>ll(t,e))}let S=i?ul(i.before,i.groups,o):0,C=[...o].every(e=>(c[e]??``).trim().length>0);async function w(){if(!i||o.size===0||!C)return;d(!0);let e=dl(i.groups,o,c),a=await Yn(`/api/user-profile/category-cleanup/apply`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({groups:e})});if(d(!1),!a.success||!a.data){H.error(a.error||r(`toast-category-cleanup-failed`));return}H.success(r(`toast-category-cleanup-applied`,{count:a.data.renamed})),t?.(!1),n?.()}async function T(){d(!0);let e=await Yn(`/api/user-profile/category-cleanup/undo`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({})});if(d(!1),!e.success||!e.data){H.info(e.error||r(`toast-category-cleanup-failed`));return}H.success(r(`toast-category-cleanup-undone`,e.data)),t?.(!1),n?.()}return(0,V.jsx)($s,{open:e,onOpenChange:t,children:(0,V.jsxs)(nc,{className:`grid! sm:max-w-2xl max-h-[90vh] grid-rows-[auto_minmax(0,1fr)_auto] overflow-hidden gap-4`,children:[(0,V.jsx)(rc,{children:(0,V.jsx)(ac,{children:r(`label-category-cleanup-title`)})}),m?(0,V.jsxs)(`div`,{className:`flex flex-col items-center gap-3 py-10 text-sm`,children:[(0,V.jsx)(`span`,{className:`text-destructive`,children:m}),(0,V.jsx)(W,{variant:`secondary`,size:`sm`,onClick:()=>void b(!0),children:r(`btn-category-cleanup-rebuild`)})]}):i?(0,V.jsxs)(`div`,{className:`flex min-h-0 flex-col gap-3 overflow-hidden`,children:[(0,V.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,V.jsx)(`p`,{className:`text-sm`,children:r(`label-category-cleanup-counts`,{before:i.before,after:S})}),(0,V.jsx)(W,{variant:`link`,size:`xs`,onClick:()=>void b(!0),children:r(`btn-category-cleanup-rebuild`)})]}),(0,V.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:r(`label-category-cleanup-note`)}),i.groups.length===0?(0,V.jsx)(`p`,{className:`py-6 text-center text-sm text-muted-foreground`,children:r(`label-category-cleanup-empty`)}):(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:r(`label-category-cleanup-selected`,{selected:o.size,total:i.groups.length})}),(0,V.jsx)(`div`,{className:`min-h-0 flex-1 space-y-2 overflow-y-auto pe-1`,children:i.groups.map((e,t)=>(0,V.jsxs)(`div`,{className:`rounded-xl border border-border p-3 space-y-2`,children:[(0,V.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,V.jsx)(fa,{checked:o.has(t),onCheckedChange:()=>x(t),"aria-label":r(`label-category-cleanup-accept`)}),(0,V.jsx)(gl,{dir:`auto`,className:`h-8 min-w-0 flex-1 sm:max-w-64`,value:c[t]??``,"aria-label":r(`label-category-cleanup-name`),disabled:!o.has(t),onChange:e=>l(n=>n.map((n,r)=>r===t?e.target.value:n))}),e.checked?null:(0,V.jsx)(`span`,{className:`basis-full text-xs text-muted-foreground sm:basis-auto`,children:r(`label-category-cleanup-unchecked`)})]}),(0,V.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:e.labels.map(e=>(0,V.jsx)(vl,{label:e.label,count:e.count},e.label))})]},e.id))})]})]}):(0,V.jsxs)(`div`,{className:`flex flex-col items-center gap-3 py-10 text-center text-muted-foreground`,children:[(0,V.jsx)(pe,{className:`size-6 animate-spin`}),(0,V.jsx)(`span`,{className:`text-sm`,children:f?r(`label-category-cleanup-progress`,f):r(`label-category-cleanup-loading`)}),(0,V.jsx)(`span`,{className:`text-xs`,children:r(`label-category-cleanup-background`)})]}),(0,V.jsxs)(ic,{className:`gap-2 sm:justify-between`,children:[(0,V.jsxs)(W,{variant:`secondary`,size:`sm`,disabled:u,onClick:()=>void T(),children:[(0,V.jsx)(Ie,{className:`size-3.5`}),r(`btn-category-cleanup-undo`)]}),(0,V.jsxs)(`div`,{className:`flex gap-2`,children:[(0,V.jsx)(W,{variant:`secondary`,size:`sm`,onClick:()=>t?.(!1),children:r(`btn-cancel`)}),(0,V.jsx)(W,{size:`sm`,disabled:u||!i||o.size===0||!C,onClick:()=>void w(),children:r(`btn-category-cleanup-apply`)})]})]})]})})}function bl({className:e,...t}){return(0,V.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`currentColor`,"aria-hidden":`true`,className:B(`size-4 shrink-0`,e),...t,children:(0,V.jsx)(`path`,{d:`M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12`})})}var xl=15e3,Sl=5e3,Cl=500,wl=3e4,Tl=2e3,El=42e4,Dl=new Set([`idle`,`installing`,`restarting`,`failed`]);function Ol(e){if(!e||typeof e!=`object`)return;let t=e;if(!(typeof t.state!=`string`||!Dl.has(t.state)))return{available:typeof t.available==`string`?t.available:null,state:t.state,code:typeof t.code==`string`?t.code:null,canInstall:t.canInstall===!0}}var kl=()=>({"x-omms-token":window.__OMMS_TOKEN__??``});async function Al(){try{let e=await fetch(`/api/web/status`,{headers:kl(),signal:AbortSignal.timeout(Sl)});if(!e.ok)return null;let t=await e.json();if(typeof t.version!=`string`||typeof t.canControl!=`boolean`)return null;let n=Ol(t.update);return{version:t.version,canControl:t.canControl,...typeof t.instance==`string`?{instance:t.instance}:{},...n?{update:n}:{}}}catch{return null}}async function jl(e){try{return(await fetch(`/api/web/${e}`,{method:`POST`,headers:{...kl(),"Content-Type":`application/json`},body:`{}`,signal:AbortSignal.timeout(Sl)})).status===202}catch{return!1}}async function Ml(e,t={}){let n=t.sleep??(e=>new Promise(t=>setTimeout(t,e))),r;for(let t=0;;t+=Cl){if(r=await Al(),r&&r.instance!==e)return`restarted`;if(t>=wl)break;await n(Cl)}return r?`unchanged`:`down`}async function Nl(){try{return(await fetch(`/api/web/update`,{method:`POST`,headers:{...kl(),"Content-Type":`application/json`},body:`{}`,signal:AbortSignal.timeout(Sl)})).status===202}catch{return!1}}async function Pl(e,t={}){let n=t.sleep??(e=>new Promise(t=>setTimeout(t,e)));for(let t=0;t<=El;t+=Tl){let t=await Al();if(t&&t.instance!==e)return{kind:`restarted`};if(t?.update?.state===`failed`)return{kind:`failed`,code:t.update.code??`unknown`};await n(Tl)}return{kind:`timeout`}}var Fl={ok:!0,status:null},Il=new Set,Ll=null,Rl=0,zl=0;async function q(){let e=++Rl,t=await Al();if(!(e<zl)){zl=e,Fl=t?{ok:!0,status:t}:{...Fl,ok:!1};for(let e of Il)e(Fl)}}function J(e){return Il.add(e),e(Fl),q(),Ll??=setInterval(()=>void q(),xl),()=>{Il.delete(e),Il.size===0&&Ll!==null&&(clearInterval(Ll),Ll=null)}}var Bl=()=>Fl;function Vl(){return(0,_.useSyncExternalStore)(J,Bl,Bl)}var Hl=`om-memory-system web`;function Ul(){let{t:e}=Cr(),{ok:t,status:n}=Vl(),r=n?.canControl??!1,i=n?.instance??null,[a,o]=(0,_.useState)(!1),[s,c]=(0,_.useState)(`idle`),[l,u]=(0,_.useState)(``);async function d(e){if(s!==`idle`)return;if(c(`working`),u(``),!await jl(e)){c(`idle`),u(`power-request-failed`);return}if(o(!1),e===`stop`){c(`stopped`);return}c(`restarting`);let t=await Ml(i);if(t===`restarted`){window.location.reload();return}if(t===`unchanged`){u(`power-restart-failed`),c(`idle`),o(!0);return}u(`power-restart-timeout`),c(`stopped`)}return!r&&s===`idle`?null:(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`button`,{type:`button`,"data-power":t?`on`:`off`,className:`inline-flex min-h-11 min-w-11 md:min-h-8 md:min-w-7 items-center justify-center self-stretch border-s border-sidebar-border px-1.5 text-muted-foreground transition-colors duration-150 hover:bg-interactive-hover hover:text-foreground focus-visible:outline-2 focus-visible:outline-ring`,onClick:()=>{u(``),o(!0)},"aria-label":e(`power-button`),title:e(`power-button`),children:(0,V.jsx)(we,{className:B(`size-4`,t&&`text-emerald-500`)})}),(0,V.jsx)($s,{open:a,onOpenChange:e=>s===`idle`&&o(e),children:(0,V.jsxs)(nc,{showCloseButton:!1,children:[(0,V.jsx)(rc,{children:(0,V.jsx)(ac,{children:e(`power-dialog-title`)})}),(0,V.jsx)(`p`,{children:e(`power-dialog-body`)}),(0,V.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e(`power-note`)}),l?(0,V.jsx)(`p`,{role:`alert`,className:`text-sm text-destructive`,children:e(l)}):null,(0,V.jsxs)(`div`,{className:`flex flex-wrap justify-end gap-2`,children:[(0,V.jsx)(W,{variant:`ghost`,disabled:s!==`idle`,onClick:()=>o(!1),children:e(`power-cancel`)}),(0,V.jsx)(W,{variant:`destructive`,disabled:s!==`idle`,onClick:()=>void d(`stop`),children:e(`power-stop`)}),(0,V.jsx)(W,{autoFocus:!0,disabled:s!==`idle`,onClick:()=>void d(`restart`),children:e(`power-restart`)})]})]})}),s===`restarting`||s===`stopped`?(0,V.jsx)(`div`,{role:`alert`,className:`fixed inset-0 z-[60] flex flex-col items-center justify-center gap-3 bg-background p-6 text-center`,children:s===`restarting`?(0,V.jsx)(`p`,{children:e(`power-restarting`)}):(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`h2`,{className:`text-section-title font-semibold`,children:e(`power-stopped-title`)}),l?(0,V.jsx)(`p`,{children:e(l)}):null,(0,V.jsx)(`p`,{children:e(`power-stopped-command`)}),(0,V.jsx)(`code`,{className:`rounded-md bg-muted px-2 py-1`,children:Hl}),(0,V.jsx)(`p`,{className:`max-w-md text-xs text-muted-foreground`,children:e(`power-note`)})]})}):null]})}function Wl({brand:e,className:t}){let{status:n}=Vl();return(0,V.jsxs)(`span`,{className:B(`flex min-w-0 items-baseline gap-1.5`,t),children:[(0,V.jsx)(`span`,{className:`truncate text-ui font-medium tracking-wide text-brand-label`,children:e}),n?(0,V.jsxs)(`span`,{className:`shrink-0 text-xs text-foreground`,"data-testid":`sidebar-version`,children:[`v`,n.version]}):null]})}var Gl=[{label:`update-host-claude`,command:`claude plugin update omms@omms`},{label:`update-host-opencode`,command:`opencode plugin update om-memory-system`},{label:`update-host-pi`,command:`pi update npm:om-memory-system`},{label:`update-host-global`,command:`npm i -g om-memory-system@latest && om-memory-system web install`}],Kl={row:`mb-2 flex min-h-11 w-full rounded-lg border border-sidebar-border/80 bg-card/70 px-2`,inline:`inline-flex min-h-8 self-stretch border-s border-sidebar-border px-2`,icon:`inline-flex min-h-8 min-w-7 self-stretch px-1.5 py-1.5`};function ql(){let{ok:e,status:t}=Vl(),n=t?.update;return!t?.canControl||!n?.available?null:{ok:e,status:t,update:n,available:n.available}}function Jl({variant:e=`row`,className:t,onOpen:n}){let{t:r}=Cr(),i=ql();return i?.ok?(0,V.jsx)(`button`,{type:`button`,"data-update":i.available,"data-variant":e,className:B(`items-center justify-center text-xs font-medium text-brand-label transition-colors duration-150 hover:bg-interactive-hover hover:text-foreground focus-visible:outline-2 focus-visible:outline-ring`,Kl[e],t),onClick:n,"aria-label":r(`update-button`,{version:i.available}),title:r(`update-button`,{version:i.available}),children:e===`icon`?(0,V.jsx)(M,{className:`size-4`}):r(`update-label`)}):null}function Yl({open:e,onOpenChange:t}){let{t:n}=Cr(),r=ql(),[i,a]=(0,_.useState)(!1),[o,s]=(0,_.useState)(``),[c,l]=(0,_.useState)(null);if(!r)return null;let{status:u,update:d,available:f}=r,p=d.state===`failed`?d.code:null,m=i||d.state===`installing`||d.state===`restarting`;async function h(){if(m)return;if(a(!0),s(``),!await Nl()){a(!1),s(n(`update-request-failed`));return}let e=await Pl(u?.instance??null);if(e.kind===`restarted`){window.location.reload();return}a(!1),s(e.kind===`failed`?n(`update-failed`,{code:e.code}):n(`update-timeout`))}function g(e){navigator.clipboard?.writeText(e),l(e)}let v=o||(p?n(`update-failed`,{code:p}):``);return(0,V.jsx)(V.Fragment,{children:(0,V.jsx)($s,{open:e,onOpenChange:e=>!m&&t(e),children:(0,V.jsxs)(nc,{showCloseButton:!1,children:[(0,V.jsx)(rc,{children:(0,V.jsx)(ac,{children:n(`update-dialog-title`)})}),(0,V.jsx)(`p`,{children:n(`update-versions`,{running:u.version,available:f})}),(0,V.jsx)(`p`,{className:`text-sm`,children:n(`update-hosts-intro`)}),(0,V.jsx)(`ul`,{className:`flex flex-col gap-2`,children:Gl.map(({label:e,command:t})=>(0,V.jsxs)(`li`,{className:`flex min-w-0 flex-col gap-1`,children:[(0,V.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:n(e)}),(0,V.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,V.jsx)(`code`,{className:`min-w-0 flex-1 break-all rounded-md bg-muted px-2 py-1 text-xs`,children:t}),(0,V.jsxs)(W,{variant:`ghost`,size:`sm`,onClick:()=>g(t),"aria-label":`${n(`update-copy`)}: ${t}`,children:[(0,V.jsx)(ce,{className:`size-3.5`}),n(c===t?`update-copied`:`update-copy`)]})]})]},t))}),(0,V.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:n(`update-hosts-note`)}),(0,V.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:d.canInstall?n(`update-install-note`):n(`update-cannot-install`)}),m?(0,V.jsx)(`p`,{role:`status`,className:`text-sm`,children:n(`update-installing`)}):null,v&&!m?(0,V.jsx)(`p`,{role:`alert`,className:`text-sm text-destructive`,children:v}):null,(0,V.jsxs)(`div`,{className:`flex flex-wrap justify-end gap-2`,children:[(0,V.jsx)(W,{variant:`ghost`,disabled:m,onClick:()=>t(!1),children:n(`update-close`)}),(0,V.jsx)(W,{autoFocus:!0,disabled:m||!d.canInstall,onClick:()=>void h(),children:n(`update-install`)})]})]})})})}var Xl=Object.defineProperty,Zl=(e,t)=>Xl(e,`name`,{value:t,configurable:!0}),Ql=`horizontal`,$l=[`horizontal`,`vertical`],eu=_.forwardRef(Zl(function(e,t){let{decorative:n,orientation:r=Ql,...i}=e,a=tu(r)?r:Ql,o=n?{role:`none`}:{"aria-orientation":a===`vertical`?a:void 0,role:`separator`};return(0,V.jsx)(Ki.div,{"data-orientation":a,...o,...i,ref:t})},`Separator`));function tu(e){return $l.includes(e)}Zl(tu,`isValidOrientation`);var nu=eu;function ru({className:e,orientation:t=`horizontal`,decorative:n=!0,...r}){return(0,V.jsx)(nu,{"data-slot":`separator`,decorative:n,orientation:t,className:B(`bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px`,e),...r})}var iu=[{id:`memory-section-import`,title:`Import chat history`},{id:`memory-section-auto-import`,title:`Automatic import`},{id:`memory-section-profile`,title:`Profile learning`},{id:`memory-section-limits`,title:`Memory limits`},{id:`memory-section-reranker`,title:`Reranker`},{id:`memory-section-project-folders`,title:`Resolve missing project folders`}],au={"settings-section-import":`memory-section-import`,"settings-section-auto-import":`memory-section-auto-import`,"settings-section-profile":`memory-section-profile`,"settings-section-memory":`memory-section-limits`,"settings-section-directory-maps":`memory-section-project-folders`};function ou(e,t){if(e!==`/settings`)return null;let n=t.replace(/^#/,``);return au[n]?`#${au[n]}`:/^directory-maps-(pi|opencode|claude-code)$/.test(n)?t:null}function su(e,t){let n=e.startsWith(`#`)?e.slice(1):``;if(!/^(settings|memory)-section-[a-z0-9-]+$/.test(n))return!1;let r=t.getElementById(n);return r?(r.scrollIntoView({behavior:`smooth`,block:`start`}),!0):!1}function cu(e){if(typeof document>`u`||typeof requestAnimationFrame>`u`)return;let t=e.replace(/^#/,``);if(!/^(?:(?:settings|memory)-section-[a-z0-9-]+|directory-maps-(?:pi|opencode|claude-code)|profile-(?:preferences|patterns|workflows))$/.test(t))return;let n=0,r=()=>{let e=document.getElementById(t);if(!e){n++<50&&requestAnimationFrame(r);return}if(t.startsWith(`directory-maps-`)){let t=e.parentElement;t&&(t.open=!0),e.focus({preventScroll:!0})}e.scrollIntoView({behavior:`smooth`,block:`start`})};requestAnimationFrame(r)}var Y={home:`/`,project:`/project-memories`,profile:`/user-profile`,settings:`/settings`,memory:`/memory`};function lu(e){let t=e.replace(/\/+$/,``)||`/`;return t.startsWith(`/`)?t:`/${t}`}function uu(e){let t=lu(e);return t===Y.memory?`memory`:t===Y.settings?`settings`:t===Y.profile?`profile`:`project`}function du(e){let t=lu(e);return t===Y.home||t===Y.project||t===Y.profile||t===Y.settings||t===Y.memory}function fu(e){let t=lu(e);return t===Y.home?Y.project:du(t)?t:Y.project}function pu(e,t=``){let n=ou(lu(e),t);return n?`${Y.memory}${n}`:`${fu(e)}${t}`}var mu=typeof window<`u`?pu(window.location.pathname,window.location.hash):Y.project,hu=new Set;function gu(){for(let e of hu)e()}function _u(e){mu!==e&&(mu=e,gu())}function vu(e){return hu.add(e),()=>{hu.delete(e)}}function yu(){return mu}function bu(){return Y.project}function xu(e,t=!1){let[n,r=``]=e.split(/(?=#)/),i=pu(n,r),a=ou(lu(n),r);`${lu(window.location.pathname)}${window.location.hash}`!==i&&(t||a?window.history.replaceState({},``,i):window.history.pushState({},``,i)),_u(i),(r||a)&&cu(a??r)}function Su(){let e=()=>{let e=`${lu(window.location.pathname)}${window.location.hash}`,t=pu(window.location.pathname,window.location.hash);e!==t&&window.history.replaceState({},``,t),_u(t),window.location.hash&&cu(window.location.hash)};return e(),window.addEventListener(`popstate`,e),()=>window.removeEventListener(`popstate`,e)}function Cu(){return(0,_.useSyncExternalStore)(vu,yu,bu)}function wu(){return uu(Cu().split(`#`)[0])}var Tu=`omms-theme`,Eu=`opencode-mem-theme`;function Du(){if(typeof window>`u`)return`dark`;let e=tr(Tu,Eu);return e===`light`||e===`dark`?e:`dark`}var Ou=Du(),ku=new Set;function Au(){for(let e of ku)e()}function ju(e){Ou=e,typeof document<`u`&&(document.documentElement.classList.toggle(`dark`,e===`dark`),nr(Tu,e)),Au()}function Mu(e){return ku.add(e),()=>{ku.delete(e)}}function Nu(){return Ou}function Pu(){return`dark`}function Fu(e){ju(e)}function Iu(){let e=Ou===`dark`?`light`:`dark`;return Fu(e),e}function Lu(){ju(Du())}function Ru(){return(0,_.useSyncExternalStore)(Mu,Nu,Pu)}typeof document<`u`&&ju(Ou);var zu=[{code:`en`,label:`English (EN)`},{code:`zh`,label:`中文 (ZH)`},{code:`ar`,label:`العربية (AR)`}],Bu=`omms-sidebar-collapsed`,Vu=`omms-sidebar-settings-open`,Hu=`omms-sidebar-memory-open`,Uu=`inline-flex min-h-11 min-w-11 md:min-h-8 md:min-w-7 items-center justify-center text-muted-foreground transition-colors duration-150 hover:bg-interactive-hover hover:text-foreground focus-visible:outline-2 focus-visible:outline-ring`;function Wu(){try{let e=localStorage.getItem(Vu);return e===null?null:e===`1`}catch{return null}}function Gu(){try{return localStorage.getItem(Bu)===`1`}catch{return!1}}function Ku({open:e=!1,currentView:t,brand:n,projectLabel:r,profileLabel:i,profileSections:a,settingsSections:o=[],memoryLabel:s=`Memory`,memorySections:c=[],langLabel:l,languageLabel:u,themeLabel:d,settingsLabel:f,closeLabel:p,collapseLabel:m,expandLabel:h,onOpenChange:g,onLanguageSelect:v}){let y=Ru()===`dark`,[b,x]=(0,_.useState)(!1),[S,C]=(0,_.useState)(!1),w=(0,_.useRef)(null),T=(0,_.useRef)(null),[E,D]=(0,_.useState)(Gu),O=e=>E?e:``,[ee,te]=(0,_.useState)(()=>Wu()??t===`settings`),[k,ne]=(0,_.useState)(()=>{try{let e=localStorage.getItem(Hu);return e===null?t===`memory`:e===`1`}catch{return t===`memory`}});function ie(){let e=!k;ne(e);try{localStorage.setItem(Hu,e?`1`:`0`)}catch{}}function ae(){let e=!ee;te(e);try{localStorage.setItem(Vu,e?`1`:`0`)}catch{}}function A(){let e=!E;D(e);try{localStorage.setItem(Bu,e?`1`:`0`)}catch{}}(0,_.useEffect)(()=>{if(!b)return;w.current?.querySelector(`[aria-checked=true]`)?.focus();function e(e){w.current?.contains(e.target)||x(!1)}return document.addEventListener(`pointerdown`,e),()=>document.removeEventListener(`pointerdown`,e)},[b]);function oe(e){if(e.key===`Escape`&&(e.preventDefault(),x(!1),T.current?.focus()),![`ArrowDown`,`ArrowUp`,`Home`,`End`].includes(e.key))return;e.preventDefault();let t=Array.from(w.current?.querySelectorAll(`[role=menuitemradio]`)??[]),n=t.indexOf(document.activeElement);t[e.key===`Home`?0:e.key===`End`?t.length-1:(n+(e.key===`ArrowDown`?1:-1)+t.length)%t.length]?.focus()}function M(e){g?.(e)}function se(e,t){e.defaultPrevented||e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||(e.preventDefault(),xu(t),M(!1))}function ce(e,t,n=`profile`){e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||(e.preventDefault(),xu(`${Y[n]}#${t}`),M(!1))}function P(e){return B(`flex w-full min-w-0 min-h-11 md:min-h-9 items-center gap-2 rounded-[10px] px-3 py-2 text-ui transition-colors duration-150 focus-visible:outline-2 focus-visible:outline-ring focus-visible:outline-offset-2`,O(`md:justify-center md:px-0`),e?`bg-sidebar-accent text-sidebar-accent-foreground`:`text-sidebar-foreground hover:bg-interactive-hover active:bg-interactive-active`)}return(0,V.jsxs)(V.Fragment,{children:[e?(0,V.jsx)(`button`,{type:`button`,className:`fixed inset-0 z-40 bg-black/50 md:hidden`,"aria-label":p,onClick:()=>M(!1)}):null,(0,V.jsxs)(`aside`,{className:B(`inset-y-0 start-0 z-50 flex h-svh w-64 shrink-0 flex-col border-e border-sidebar-border bg-sidebar text-sidebar-foreground transition-[transform,width] duration-200`,O(`md:w-14`),`fixed md:sticky md:top-0 md:translate-x-0!`,e?`translate-x-0`:`max-md:-translate-x-full max-md:rtl:translate-x-full`),children:[(0,V.jsxs)(`div`,{className:B(`flex items-center gap-2 px-4 py-4`,O(`md:flex-col md:px-2`)),children:[(0,V.jsxs)(`a`,{href:Y.home,className:`flex min-w-0 flex-1 items-center gap-2 rounded-lg transition-colors hover:opacity-90`,onClick:e=>se(e,Y.home),children:[(0,V.jsx)(`img`,{src:`/omms-icon.svg`,alt:``,width:20,height:20,className:`size-5 shrink-0 rounded-sm`}),(0,V.jsx)(Wl,{brand:n,className:O(`md:hidden`)})]}),(0,V.jsx)(W,{variant:`ghost`,size:`icon-sm`,className:`hidden shrink-0 text-muted-foreground hover:text-primary md:inline-flex`,onClick:A,"aria-label":E?h:m,"aria-expanded":!E,title:E?h:m,children:E?(0,V.jsx)(ve,{className:`size-4 rtl:-scale-x-100`}):(0,V.jsx)(_e,{className:`size-4 rtl:-scale-x-100`})}),(0,V.jsx)(W,{variant:`ghost`,size:`icon-sm`,className:`md:hidden min-h-11 min-w-11 shrink-0`,onClick:()=>M(!1),"aria-label":p,children:(0,V.jsx)(Be,{className:`size-4`})})]}),(0,V.jsx)(ru,{className:`bg-sidebar-border`}),(0,V.jsxs)(`nav`,{className:B(`flex min-h-0 flex-1 flex-col gap-1 overflow-y-auto p-3`,O(`md:px-2`)),"aria-label":`Main`,children:[(0,V.jsxs)(`a`,{href:Y.project,className:P(t===`project`),"aria-current":t===`project`?`page`:void 0,title:E?r:void 0,onClick:e=>se(e,Y.project),children:[(0,V.jsx)(N,{className:`size-4 shrink-0`}),(0,V.jsx)(`span`,{className:B(`min-w-0 break-words text-start`,O(`md:sr-only`)),children:r})]}),(0,V.jsxs)(`a`,{href:Y.profile,className:P(t===`profile`),"aria-current":t===`profile`?`page`:void 0,title:E?i:void 0,onClick:e=>se(e,Y.profile),children:[(0,V.jsx)(Re,{className:`size-4 shrink-0`}),(0,V.jsx)(`span`,{className:B(`min-w-0 break-words text-start`,O(`md:sr-only`)),children:i})]}),(0,V.jsx)(`ul`,{className:B(`ms-5 space-y-0.5 border-s border-sidebar-border ps-2`,O(`md:hidden`)),children:a.map(e=>(0,V.jsx)(`li`,{children:(0,V.jsx)(`a`,{href:`${Y.profile}#${e.id}`,className:`flex min-h-11 md:min-h-7 items-center break-words rounded-lg px-2.5 py-1 text-xs text-muted-foreground transition-colors duration-150 hover:bg-interactive-hover hover:text-foreground focus-visible:outline-2 focus-visible:outline-ring focus-visible:outline-offset-2`,onClick:t=>ce(t,e.id),children:e.label})},e.id))}),(0,V.jsxs)(`div`,{className:`flex items-center gap-0.5`,children:[(0,V.jsxs)(`a`,{href:Y.memory,className:P(t===`memory`),"aria-current":t===`memory`?`page`:void 0,title:E?s:void 0,onClick:e=>se(e,Y.memory),children:[(0,V.jsx)(re,{className:`size-4 shrink-0`,"aria-hidden":`true`}),(0,V.jsx)(`span`,{className:B(`min-w-0 break-words text-start uppercase`,O(`md:sr-only`)),children:s})]}),c.length>0?(0,V.jsx)(`button`,{type:`button`,className:B(`inline-flex min-h-11 min-w-11 md:min-h-7 md:min-w-7 shrink-0 items-center justify-center rounded-lg p-1.5 text-muted-foreground hover:bg-interactive-hover focus-visible:outline-2 focus-visible:outline-ring`,O(`md:hidden`)),onClick:ie,"aria-expanded":k,"aria-controls":`sidebar-memory-tree`,"aria-label":s,title:s,children:(0,V.jsx)(j,{className:B(`size-4 transition-transform rtl:-scale-x-100`,k&&`rotate-90 rtl:rotate-90`)})}):null]}),k&&c.length>0?(0,V.jsx)(`ul`,{id:`sidebar-memory-tree`,className:B(`ms-5 space-y-0.5 border-s border-sidebar-border ps-2`,O(`md:hidden`)),children:c.map(e=>(0,V.jsx)(`li`,{children:(0,V.jsx)(`a`,{href:`${Y.memory}#${e.id}`,className:`flex min-h-11 md:min-h-7 items-center break-words rounded-lg px-2.5 py-1 text-xs text-muted-foreground hover:bg-interactive-hover focus-visible:outline-2 focus-visible:outline-ring`,onClick:t=>ce(t,e.id,`memory`),children:e.label})},e.id))}):null,(0,V.jsxs)(`div`,{className:`flex items-center gap-0.5`,children:[(0,V.jsxs)(`a`,{href:Y.settings,className:P(t===`settings`),"aria-current":t===`settings`?`page`:void 0,title:E?f:void 0,onClick:e=>se(e,Y.settings),children:[(0,V.jsx)(Oe,{className:`size-4 shrink-0`}),(0,V.jsx)(`span`,{className:B(`min-w-0 break-words text-start uppercase`,O(`md:sr-only`)),children:f})]}),o.length>0?(0,V.jsx)(`button`,{type:`button`,className:B(`inline-flex min-h-11 min-w-11 md:min-h-7 md:min-w-7 shrink-0 items-center justify-center rounded-lg p-1.5 text-muted-foreground transition-colors duration-150 hover:bg-interactive-hover hover:text-foreground focus-visible:outline-2 focus-visible:outline-ring`,O(`md:hidden`)),onClick:ae,"aria-expanded":ee,"aria-controls":`sidebar-settings-tree`,"aria-label":f,title:f,children:(0,V.jsx)(j,{className:B(`size-4 transition-transform rtl:-scale-x-100`,ee&&`rotate-90 rtl:rotate-90`)})}):null]}),ee&&o.length>0?(0,V.jsx)(`ul`,{id:`sidebar-settings-tree`,className:B(`ms-5 space-y-0.5 border-s border-sidebar-border ps-2`,O(`md:hidden`)),children:o.map(e=>(0,V.jsx)(`li`,{children:(0,V.jsx)(`a`,{href:`${Y.settings}#${e.id}`,className:`flex min-h-11 md:min-h-7 items-center break-words rounded-lg px-2.5 py-1 text-xs text-muted-foreground transition-colors duration-150 hover:bg-interactive-hover hover:text-foreground focus-visible:outline-2 focus-visible:outline-ring focus-visible:outline-offset-2`,onClick:t=>ce(t,e.id,`settings`),children:e.label})},e.id))}):null]}),(0,V.jsxs)(`div`,{className:B(`mt-auto p-3`,O(`md:px-2`)),children:[(0,V.jsx)(Jl,{variant:`row`,className:`md:hidden`,onOpen:()=>C(!0)}),(0,V.jsxs)(`div`,{className:B(`flex w-fit items-center rounded-lg border border-sidebar-border/80 bg-card/70`,O(`md:mx-auto md:flex-col md:[&>*]:justify-center md:[&>*]:py-1.5 md:[&>*+*]:border-s-0 md:[&>*+*]:border-t md:[&>*]:rounded-none`)),children:[(0,V.jsxs)(`div`,{ref:w,className:`relative flex self-stretch`,onBlur:e=>{w.current?.contains(e.relatedTarget)||x(!1)},children:[(0,V.jsx)(`button`,{ref:T,type:`button`,className:`${Uu} rounded-s-lg px-1.5 py-1.5 text-ui`,onClick:()=>x(e=>!e),"aria-label":`${u}: ${l}`,"aria-haspopup":`menu`,"aria-expanded":b,"aria-controls":`sidebar-language-menu`,title:u,children:(0,V.jsx)(`span`,{className:`text-xs tabular-nums`,children:l})}),b?(0,V.jsx)(`div`,{id:`sidebar-language-menu`,role:`menu`,"aria-label":u,onKeyDown:oe,className:`absolute bottom-full start-0 z-10 mb-2 w-44 max-h-[60vh] overflow-y-auto rounded-lg border border-sidebar-border bg-card p-1 shadow-lg`,children:zu.map(({code:e,label:t})=>(0,V.jsx)(`button`,{type:`button`,role:`menuitemradio`,"aria-checked":l.toLowerCase()===e,className:`flex min-h-11 md:min-h-9 w-full items-center rounded-md px-2.5 py-2 text-start text-ui text-card-foreground aria-checked:bg-selection hover:bg-interactive-hover focus-visible:bg-selection focus-visible:outline-2 focus-visible:outline-ring`,onClick:()=>{v?.(e),x(!1),T.current?.focus()},children:t},e))}):null]}),(0,V.jsx)(`button`,{type:`button`,className:`${Uu} self-stretch border-s border-sidebar-border px-1.5`,onClick:()=>Iu(),"aria-label":d,title:d,children:y?(0,V.jsx)(he,{className:`size-4 rounded-md p-0.5`}):(0,V.jsx)(Ae,{className:`size-4 rounded-md p-0.5`})}),(0,V.jsx)(`a`,{href:Y.settings,className:`${Uu} self-stretch border-s border-sidebar-border px-1.5`,onClick:e=>se(e,Y.settings),"aria-label":f,title:f,"aria-current":t===`settings`?`page`:void 0,children:(0,V.jsx)(Oe,{className:`size-4`})}),(0,V.jsx)(Ul,{}),(0,V.jsx)(`a`,{href:`https://github.com/cmdaltctr/omms`,target:`_blank`,rel:`noopener noreferrer`,className:`${Uu} self-stretch rounded-e-lg border-s border-sidebar-border px-1.5`,title:`GitHub`,"aria-label":`GitHub`,children:(0,V.jsx)(bl,{className:`size-4`})}),(0,V.jsx)(Jl,{onOpen:()=>C(!0),variant:E?`icon`:`inline`,className:B(`max-md:hidden`,E?`md:border-t md:border-sidebar-border`:`rounded-e-lg`)})]}),(0,V.jsx)(Yl,{open:S,onOpenChange:C})]})]})]})}var qu=Object.defineProperty,Ju=_.forwardRef(((e,t)=>qu(e,`name`,{value:t,configurable:!0}))(function(e,t){return(0,V.jsx)(Ki.label,{...e,ref:t,onMouseDown:t=>{t.target.closest(`button, input, select, textarea`)||(e.onMouseDown?.(t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}})},`Label`));function Yu({className:e,...t}){return(0,V.jsx)(Ju,{"data-slot":`label`,className:B(`flex items-center gap-2 text-ui leading-normal select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50`,e),...t})}function Xu({className:e,...t}){return(0,V.jsx)(`textarea`,{"data-slot":`textarea`,dir:`auto`,className:B(`border-input placeholder:text-muted-foreground selection:bg-selection selection:text-foreground flex field-sizing-content min-h-16 w-full min-w-0 rounded-[10px] border bg-card px-2.5 py-2 text-ui [unicode-bidi:plaintext] transition-colors duration-150 outline-none disabled:cursor-not-allowed disabled:opacity-50`,`focus-visible:border-ring focus-visible:ring-ring focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-offset-background`,`aria-invalid:ring-destructive aria-invalid:ring-1 aria-invalid:border-destructive`,e),...t})}function Zu({open:e=!1,content:t=``,onOpenChange:n,onSave:r}){let{t:i}=Cr(),[a,o]=(0,_.useState)(``);(0,_.useEffect)(()=>{e&&o(t)},[e,t]);function s(e){n?.(e)}function c(e){e.preventDefault();let t=a.trim();t&&r?.(t)}return(0,V.jsx)($s,{open:e,onOpenChange:s,children:(0,V.jsxs)(nc,{className:`sm:max-w-lg`,children:[(0,V.jsx)(rc,{children:(0,V.jsx)(ac,{children:i(`modal-edit-title`)})}),(0,V.jsxs)(`form`,{className:`space-y-4`,onSubmit:c,children:[(0,V.jsxs)(`div`,{className:`space-y-2`,children:[(0,V.jsx)(Yu,{htmlFor:`edit-content`,children:i(`label-content`)}),(0,V.jsx)(Xu,{id:`edit-content`,rows:6,value:a,onChange:e=>o(e.target.value),required:!0})]}),(0,V.jsxs)(ic,{children:[(0,V.jsx)(W,{type:`button`,variant:`secondary`,onClick:()=>s(!1),children:i(`btn-cancel`)}),(0,V.jsx)(W,{type:`submit`,children:i(`btn-save`)})]})]})]})})}function Qu({children:e,maxHeight:t,fade:n=`var(--card)`}){let{t:r}=Cr(),i=(0,_.useId)(),a=(0,_.useRef)(null),[o,s]=(0,_.useState)(!1),[c,l]=(0,_.useState)(!1);(0,_.useEffect)(()=>{let e=a.current;if(!e)return;let n=()=>l(e.offsetHeight>t);if(n(),typeof ResizeObserver>`u`)return;let r=new ResizeObserver(n);return r.observe(e),()=>r.disconnect()},[t]);let u=c&&!o;return(0,V.jsxs)(`div`,{className:`space-y-2`,children:[(0,V.jsxs)(`div`,{id:i,className:`relative overflow-hidden`,style:u?{maxHeight:t}:void 0,"data-collapsed":u?`true`:void 0,children:[(0,V.jsx)(`div`,{ref:a,children:e}),u?(0,V.jsx)(`div`,{"aria-hidden":`true`,className:`pointer-events-none absolute inset-x-0 bottom-0 h-12`,style:{background:`linear-gradient(to top, ${n}, transparent)`}}):null]}),c?(0,V.jsxs)(W,{variant:`ghost`,size:`xs`,"aria-expanded":o,"aria-controls":i,onClick:()=>s(e=>!e),children:[o?(0,V.jsx)(oe,{}):(0,V.jsx)(ae,{}),r(o?`btn-see-less`:`btn-see-more`)]}):null]})}var $u=8;function ed({content:e,children:t,className:n}){let r=_.useId(),i=_.useRef(null),[a,o]=_.useState(0),s=_.isValidElement(t)?_.cloneElement(t,{"aria-describedby":r}):t,c=()=>{let e=i.current;if(!e)return;let t=e.parentElement.getBoundingClientRect(),n=e.offsetWidth/2,r=t.left+t.width/2,a=document.documentElement.clientWidth,s=$u+n,c=a-$u-n;o(Math.min(Math.max(r,s),c)-r)};return(0,V.jsxs)(`span`,{className:B(`group/tooltip relative inline-flex`,n),onPointerEnter:c,onFocus:c,children:[s,(0,V.jsxs)(`span`,{ref:i,id:r,role:`tooltip`,style:{transform:`translateX(calc(-50% + ${a}px))`},className:`pointer-events-none absolute bottom-full left-1/2 z-30 mb-2 w-max max-w-[min(24rem,calc(100vw-1rem))] rounded-md border border-border bg-card px-2 py-1 text-xs whitespace-normal text-card-foreground opacity-0 shadow-sm transition-opacity duration-150 ease-in group-focus-within/tooltip:opacity-100 group-hover/tooltip:opacity-100`,children:[e,(0,V.jsx)(`span`,{"aria-hidden":`true`,style:{left:`calc(50% - ${a}px)`},className:`absolute top-full -mt-1 size-2 -translate-x-1/2 rotate-45 border-e border-b border-border bg-card`})]})]})}function td({type:e}){let{t}=Cr();return(0,V.jsx)(ed,{content:t(`tooltip-memory-type`),className:`min-w-0 max-w-full`,children:(0,V.jsx)(hl,{variant:`outline`,"data-memory-type":e,tabIndex:0,className:`h-auto min-h-5 max-w-full shrink break-all whitespace-normal bg-transparent border-current [color:oklch(0.42_0.13_var(--memory-type-hue))] dark:[color:oklch(0.8_0.13_var(--memory-type-hue))]`,style:{"--memory-type-hue":String(fl(e))},children:e})})}var nd=/<pasted_content\b[^>]*>([\s\S]*?)<\/pasted_content[^>]*>|```[^\n]*\n([\s\S]*?)```/g;function rd(e){return e.replace(/^\n+|\n+$/g,``)}function id(e){let t=[],n=e=>{let n=rd(e);n.trim()&&t.push({kind:`text`,text:n})},r=0;for(let i of e.matchAll(nd)){n(e.slice(r,i.index));let a=i[1]!==void 0;t.push({kind:a?`pasted`:`code`,text:rd(a?i[1]:i[2])}),r=i.index+i[0].length}return n(e.slice(r)),t}function ad(e){let t=[],n=0;for(let r of e.matchAll(/`([^`\n]+)`/g))r.index>n&&t.push({code:!1,text:e.slice(n,r.index)}),t.push({code:!0,text:r[1]}),n=r.index+r[0].length;return n<e.length&&t.push({code:!1,text:e.slice(n)}),t}function od({label:e,children:t}){return(0,V.jsxs)(`div`,{className:`overflow-hidden rounded-lg border border-border bg-background/60`,children:[e?(0,V.jsx)(`div`,{className:`border-b border-border px-3 py-1.5 text-xs font-semibold uppercase tracking-wide text-muted-foreground`,children:e}):null,(0,V.jsx)(`pre`,{dir:`ltr`,className:`overflow-x-auto p-3 font-mono text-code leading-relaxed whitespace-pre-wrap break-words`,children:t})]})}function sd({content:e}){let{t}=Cr();return(0,V.jsx)(`div`,{className:`space-y-3`,children:id(e).map((e,n)=>e.kind===`pasted`?(0,V.jsx)(od,{label:t(`label-pasted-content`),children:e.text},n):e.kind===`code`?(0,V.jsx)(od,{children:e.text},n):(0,V.jsx)(`p`,{className:`text-sm whitespace-pre-wrap break-words`,children:ad(e.text).map((e,t)=>e.code?(0,V.jsx)(`code`,{className:`inline-code`,children:e.text},t):(0,V.jsx)(_.Fragment,{children:e.text},t))},n))})}function cd(e){let t=new Date(e),n=vr(),r=n===`zh`?`zh-CN`:n===`ar`?`ar-SA`:`en-US`;return t.toLocaleString(r,{year:`numeric`,month:`short`,day:`numeric`,hour:`2-digit`,minute:`2-digit`})}function ld(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function ud(e){if(Array.isArray(e))return e}function dd(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function fd(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
56
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function pd(e,t){return ud(e)||dd(e,t)||md(e,t)||fd()}function md(e,t){if(e){if(typeof e==`string`)return ld(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ld(e,t):void 0}}var hd=Object.entries,gd=Object.setPrototypeOf,_d=Object.isFrozen,vd=Object.getPrototypeOf,yd=Object.getOwnPropertyDescriptor,bd=Object.freeze,xd=Object.seal,X=Object.create,Sd=typeof Reflect<`u`&&Reflect,Cd=Sd.apply,wd=Sd.construct;bd||=function(e){return e},xd||=function(e){return e},Cd||=function(e,t){var n=[...arguments].slice(2);return e.apply(t,n)},wd||=function(e){return new e(...[...arguments].slice(1))};var Td=Gd(Array.prototype.forEach),Ed=Gd(Array.prototype.lastIndexOf),Dd=Gd(Array.prototype.pop),Od=Gd(Array.prototype.push),kd=Gd(Array.prototype.splice),Ad=Array.isArray,jd=Gd(String.prototype.toLowerCase),Md=Gd(String.prototype.toString),Nd=Gd(String.prototype.match),Pd=Gd(String.prototype.replace),Fd=Gd(String.prototype.indexOf),Id=Gd(String.prototype.trim),Ld=Gd(Number.prototype.toString),Rd=Gd(Boolean.prototype.toString),zd=typeof BigInt>`u`?null:Gd(BigInt.prototype.toString),Bd=typeof Symbol>`u`?null:Gd(Symbol.prototype.toString),Vd=Gd(Object.prototype.hasOwnProperty),Hd=Gd(Object.prototype.toString),Ud=Gd(RegExp.prototype.test),Wd=Kd(TypeError);function Gd(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);var n=[...arguments].slice(1);return Cd(e,t,n)}}function Kd(e){return function(){return wd(e,[...arguments])}}function qd(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:jd;if(gd&&gd(e,null),!Ad(t))return e;let r=t.length;for(;r--;){let i=t[r];if(typeof i==`string`){let e=n(i);e!==i&&(_d(t)||(t[r]=e),i=e)}e[i]=!0}return e}function Jd(e){for(let t=0;t<e.length;t++)Vd(e,t)||(e[t]=null);return e}function Yd(e){let t=X(null);for(let r of hd(e)){var n=pd(r,2);let i=n[0],a=n[1];Vd(e,i)&&(t[i]=Ad(a)?Jd(a):a&&typeof a==`object`&&a.constructor===Object?Yd(a):a)}return t}function Xd(e){switch(typeof e){case`string`:return e;case`number`:return Ld(e);case`boolean`:return Rd(e);case`bigint`:return zd?zd(e):`0`;case`symbol`:return Bd?Bd(e):`Symbol()`;case`undefined`:return Hd(e);case`function`:case`object`:{if(e===null)return Hd(e);let t=e,n=Zd(t,`toString`);if(typeof n==`function`){let e=n(t);return typeof e==`string`?e:Hd(e)}return Hd(e)}default:return Hd(e)}}function Zd(e,t){for(;e!==null;){let n=yd(e,t);if(n){if(n.get)return Gd(n.get);if(typeof n.value==`function`)return Gd(n.value)}e=vd(e)}function n(){return null}return n}function Qd(e){try{return Ud(e,``),!0}catch{return!1}}var $d=bd(`a.abbr.acronym.address.area.article.aside.audio.b.bdi.bdo.big.blink.blockquote.body.br.button.canvas.caption.center.cite.code.col.colgroup.content.data.datalist.dd.decorator.del.details.dfn.dialog.dir.div.dl.dt.element.em.fieldset.figcaption.figure.font.footer.form.h1.h2.h3.h4.h5.h6.head.header.hgroup.hr.html.i.img.input.ins.kbd.label.legend.li.main.map.mark.marquee.menu.menuitem.meter.nav.nobr.ol.optgroup.option.output.p.picture.pre.progress.q.rp.rt.ruby.s.samp.search.section.select.shadow.slot.small.source.spacer.span.strike.strong.style.sub.summary.sup.table.tbody.td.template.textarea.tfoot.th.thead.time.tr.track.tt.u.ul.var.video.wbr`.split(`.`)),ef=bd(`svg.a.altglyph.altglyphdef.altglyphitem.animatecolor.animatemotion.animatetransform.circle.clippath.defs.desc.ellipse.enterkeyhint.exportparts.filter.font.g.glyph.glyphref.hkern.image.inputmode.line.lineargradient.marker.mask.metadata.mpath.part.path.pattern.polygon.polyline.radialgradient.rect.stop.style.switch.symbol.text.textpath.title.tref.tspan.view.vkern`.split(`.`)),tf=bd([`feBlend`,`feColorMatrix`,`feComponentTransfer`,`feComposite`,`feConvolveMatrix`,`feDiffuseLighting`,`feDisplacementMap`,`feDistantLight`,`feDropShadow`,`feFlood`,`feFuncA`,`feFuncB`,`feFuncG`,`feFuncR`,`feGaussianBlur`,`feImage`,`feMerge`,`feMergeNode`,`feMorphology`,`feOffset`,`fePointLight`,`feSpecularLighting`,`feSpotLight`,`feTile`,`feTurbulence`]),nf=bd([`animate`,`color-profile`,`cursor`,`discard`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`foreignobject`,`hatch`,`hatchpath`,`mesh`,`meshgradient`,`meshpatch`,`meshrow`,`missing-glyph`,`script`,`set`,`solidcolor`,`unknown`,`use`]),rf=bd(`math.menclose.merror.mfenced.mfrac.mglyph.mi.mlabeledtr.mmultiscripts.mn.mo.mover.mpadded.mphantom.mroot.mrow.ms.mspace.msqrt.mstyle.msub.msup.msubsup.mtable.mtd.mtext.mtr.munder.munderover.mprescripts`.split(`.`)),af=bd([`maction`,`maligngroup`,`malignmark`,`mlongdiv`,`mscarries`,`mscarry`,`msgroup`,`mstack`,`msline`,`msrow`,`semantics`,`annotation`,`annotation-xml`,`mprescripts`,`none`]),of=bd([`#text`]),sf=bd(`accept.action.align.alt.autocapitalize.autocomplete.autopictureinpicture.autoplay.background.bgcolor.border.capture.cellpadding.cellspacing.checked.cite.class.clear.color.cols.colspan.command.commandfor.controls.controlslist.coords.crossorigin.datetime.decoding.default.dir.disabled.disablepictureinpicture.disableremoteplayback.download.draggable.enctype.enterkeyhint.exportparts.face.for.headers.height.hidden.high.href.hreflang.id.inert.inputmode.integrity.ismap.kind.label.lang.list.loading.loop.low.max.maxlength.media.method.min.minlength.multiple.muted.name.nonce.noshade.novalidate.nowrap.open.optimum.part.pattern.placeholder.playsinline.popover.popovertarget.popovertargetaction.poster.preload.pubdate.radiogroup.readonly.rel.required.rev.reversed.role.rows.rowspan.spellcheck.scope.selected.shape.size.sizes.slot.span.srclang.start.src.srcset.step.style.summary.tabindex.title.translate.type.usemap.valign.value.width.wrap.xmlns`.split(`.`)),cf=bd(`accent-height.accumulate.additive.alignment-baseline.amplitude.ascent.attributename.attributetype.azimuth.basefrequency.baseline-shift.begin.bias.by.class.clip.clippathunits.clip-path.clip-rule.color.color-interpolation.color-interpolation-filters.color-profile.color-rendering.cx.cy.d.dx.dy.diffuseconstant.direction.display.divisor.dominant-baseline.dur.edgemode.elevation.end.exponent.fill.fill-opacity.fill-rule.filter.filterunits.flood-color.flood-opacity.font-family.font-size.font-size-adjust.font-stretch.font-style.font-variant.font-weight.fx.fy.g1.g2.glyph-name.glyphref.gradientunits.gradienttransform.height.href.id.image-rendering.in.in2.intercept.k.k1.k2.k3.k4.kerning.keypoints.keysplines.keytimes.lang.lengthadjust.letter-spacing.kernelmatrix.kernelunitlength.lighting-color.local.marker-end.marker-mid.marker-start.markerheight.markerunits.markerwidth.maskcontentunits.maskunits.max.mask.mask-type.media.method.mode.min.name.numoctaves.offset.operator.opacity.order.orient.orientation.origin.overflow.paint-order.path.pathlength.patterncontentunits.patterntransform.patternunits.pointer-events.points.preservealpha.preserveaspectratio.primitiveunits.r.rx.ry.radius.refx.refy.repeatcount.repeatdur.restart.result.rotate.scale.seed.shape-rendering.slope.specularconstant.specularexponent.spreadmethod.startoffset.stddeviation.stitchtiles.stop-color.stop-opacity.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke.stroke-width.style.surfacescale.systemlanguage.tabindex.tablevalues.targetx.targety.transform.transform-origin.text-anchor.text-decoration.text-orientation.text-rendering.textlength.type.u1.u2.unicode.values.vector-effect.viewbox.visibility.version.vert-adv-y.vert-origin-x.vert-origin-y.width.word-spacing.wrap.writing-mode.xchannelselector.ychannelselector.x.x1.x2.xmlns.y.y1.y2.z.zoomandpan`.split(`.`)),lf=bd(`accent.accentunder.align.bevelled.close.columnalign.columnlines.columnspacing.columnspan.denomalign.depth.dir.display.displaystyle.encoding.fence.frame.height.href.id.largeop.length.linethickness.lquote.lspace.mathbackground.mathcolor.mathsize.mathvariant.maxsize.minsize.movablelimits.notation.numalign.open.rowalign.rowlines.rowspacing.rowspan.rspace.rquote.scriptlevel.scriptminsize.scriptsizemultiplier.selection.separator.separators.stretchy.subscriptshift.supscriptshift.symmetric.voffset.width.xmlns`.split(`.`)),uf=bd([`xlink:href`,`xml:id`,`xlink:title`,`xml:space`,`xmlns:xlink`]),df=xd(/{{[\w\W]*|^[\w\W]*}}/g),ff=xd(/<%[\w\W]*|^[\w\W]*%>/g),pf=xd(/\${[\w\W]*/g),mf=xd(/^data-[\-\w.\u00B7-\uFFFF]+$/),hf=xd(/^aria-[\-\w]+$/),gf=xd(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),_f=xd(/^(?:\w+script|data):/i),vf=xd(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),yf=xd(/^html$/i),bf=xd(/^[a-z][.\w]*(-[.\w]+)+$/i),xf=xd(/<[/\w!]/g),Sf=xd(/<[/\w]/g),Cf=xd(/<\/no(script|embed|frames)/i),wf=xd(/\/>/i),Tf={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},Ef=[`style`,`script`,`xmp`,`iframe`,`noembed`,`noframes`,`plaintext`,`noscript`],Df=bd(qd({},Ef)),Of=function(){let e={};return Td(Ef,t=>{e[t]=xd(RegExp(`</`+t+`(?=[\\t\\n\\f\\r />])`,`i`))}),bd(e)}(),kf=function(){return typeof window>`u`?null:window},Af=function(e,t){if(typeof e!=`object`||typeof e.createPolicy!=`function`)return null;let n=null,r=`data-tt-policy-suffix`;t&&t.hasAttribute(r)&&(n=t.getAttribute(r));let i=`dompurify`+(n?`#`+n:``);try{return e.createPolicy(i,{createHTML(e){return e},createScriptURL(e){return e}})}catch{return console.warn(`TrustedTypes policy `+i+` could not be created.`),null}},jf=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},Mf=function(e,t,n,r){return Vd(e,t)&&Ad(e[t])?qd(r.base?Yd(r.base):{},e[t],r.transform):n},Nf=function(e,t,n){let r=Vd(e,t)?e[t]:void 0;return r&&typeof r==`object`?Yd(r):n()};function Pf(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:kf(),t=e=>Pf(e);if(t.version=`3.4.14`,t.removed=[],!e||!e.document||e.document.nodeType!==Tf.document||!e.Element)return t.isSupported=!1,t;let n=e.document,r=n,i=r.currentScript;e.DocumentFragment;let a=e.HTMLTemplateElement,o=e.Node,s=e.Element,c=e.NodeFilter;e.NamedNodeMap===void 0&&(e.NamedNodeMap||e.MozNamedAttrMap),e.HTMLFormElement;let l=e.DOMParser,u=e.trustedTypes,d=s.prototype,f=Zd(d,`cloneNode`),p=Zd(d,`remove`),m=Zd(d,`nextSibling`),h=Zd(d,`childNodes`),g=Zd(d,`parentNode`),_=Zd(d,`shadowRoot`),v=Zd(d,`attributes`),y=o&&o.prototype?Zd(o.prototype,`nodeType`):null,b=o&&o.prototype?Zd(o.prototype,`nodeName`):null,x=o&&o.prototype?Zd(o.prototype,`ownerDocument`):null,S=function(e){return y?y(e):e.nodeType},C=function(e){return b?b(e):e.nodeName};if(typeof a==`function`){let e=n.createElement(`template`);e.content&&e.content.ownerDocument&&(n=e.content.ownerDocument)}let w,T=``,E,D=!1,O=0,ee=function(){if(O>0)throw Wd(`A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.`)},te=function(e){ee(),O++;try{return w.createHTML(e)}finally{O--}},k=function(e){ee(),O++;try{return w.createScriptURL(e)}finally{O--}},ne=function(){return D||=(E=Af(u,i),!0),E},re=n,ie=re.implementation,ae=re.createNodeIterator,A=re.createDocumentFragment,j=re.getElementsByTagName,oe=r.importNode,M=jf();t.isSupported=typeof hd==`function`&&typeof g==`function`&&ie&&ie.createHTMLDocument!==void 0;let se=df,ce=ff,N=pf,P=mf,le=hf,ue=_f,de=vf,fe=bf,pe=gf,F=null,me=qd({},[...$d,...ef,...tf,...rf,...of]),he=null,ge=qd({},[...sf,...cf,...lf,...uf]),_e=Object.seal(X(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),ve=null,ye=null,be=Object.seal(X(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),xe=!0,Se=!0,Ce=!1,we=!0,Te=!1,Ee=!0,De=!1,Oe=!1,ke=null,Ae=null,je=!1,Me=!1,Ne=!1,Pe=!1,Fe=!0,Ie=!1,Le=`user-content-`,Re=!0,ze=!1,Be={},Ve=null,He=qd({},`annotation-xml.audio.colgroup.desc.foreignobject.head.iframe.math.mi.mn.mo.ms.mtext.noembed.noframes.noscript.plaintext.script.selectedcontent.style.svg.template.thead.title.video.xmp`.split(`.`)),Ue=null,We=qd({},[`audio`,`video`,`img`,`source`,`image`,`track`]),Ge=null,Ke=qd({},[`alt`,`class`,`for`,`id`,`label`,`name`,`pattern`,`placeholder`,`role`,`summary`,`title`,`value`,`style`,`xmlns`]),qe=`http://www.w3.org/1998/Math/MathML`,Je=`http://www.w3.org/2000/svg`,Ye=`http://www.w3.org/1999/xhtml`,Xe=Ye,Ze=!1,Qe=null,$e=qd({},[qe,Je,Ye],Md),et=bd([`mi`,`mo`,`mn`,`ms`,`mtext`]),tt=qd({},et),nt=bd([`annotation-xml`]),rt=qd({},nt),it=qd({},[`title`,`style`,`font`,`a`,`script`]),at=null,ot=[`application/xhtml+xml`,`text/html`],st=null,ct=null,lt=n.createElement(`form`),ut=function(e){return e instanceof RegExp||e instanceof Function},dt=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(ct&&ct===e)return;(!e||typeof e!=`object`)&&(e={}),e=Yd(e),at=ot.indexOf(e.PARSER_MEDIA_TYPE)===-1?`text/html`:e.PARSER_MEDIA_TYPE,st=at===`application/xhtml+xml`?Md:jd,F=Mf(e,`ALLOWED_TAGS`,me,{transform:st}),he=Mf(e,`ALLOWED_ATTR`,ge,{transform:st}),Qe=Mf(e,`ALLOWED_NAMESPACES`,$e,{transform:Md}),Ge=Mf(e,`ADD_URI_SAFE_ATTR`,Ke,{transform:st,base:Ke}),Ue=Mf(e,`ADD_DATA_URI_TAGS`,We,{transform:st,base:We}),Ve=Mf(e,`FORBID_CONTENTS`,He,{transform:st}),ve=Mf(e,`FORBID_TAGS`,Yd({}),{transform:st}),ye=Mf(e,`FORBID_ATTR`,Yd({}),{transform:st}),Be=Vd(e,`USE_PROFILES`)?e.USE_PROFILES&&typeof e.USE_PROFILES==`object`?Yd(e.USE_PROFILES):e.USE_PROFILES:!1,xe=e.ALLOW_ARIA_ATTR!==!1,Se=e.ALLOW_DATA_ATTR!==!1,Ce=e.ALLOW_UNKNOWN_PROTOCOLS||!1,we=e.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Te=e.SAFE_FOR_TEMPLATES||!1,Ee=e.SAFE_FOR_XML!==!1,De=e.WHOLE_DOCUMENT||!1,Me=e.RETURN_DOM||!1,Ne=e.RETURN_DOM_FRAGMENT||!1,Pe=e.RETURN_TRUSTED_TYPE||!1,je=e.FORCE_BODY||!1,Fe=e.SANITIZE_DOM!==!1,Ie=e.SANITIZE_NAMED_PROPS||!1,Re=e.KEEP_CONTENT!==!1,ze=e.IN_PLACE||!1,pe=Qd(e.ALLOWED_URI_REGEXP)?e.ALLOWED_URI_REGEXP:gf,Xe=typeof e.NAMESPACE==`string`?e.NAMESPACE:Ye,tt=Nf(e,`MATHML_TEXT_INTEGRATION_POINTS`,()=>qd({},et)),rt=Nf(e,`HTML_INTEGRATION_POINTS`,()=>qd({},nt));let t=Nf(e,`CUSTOM_ELEMENT_HANDLING`,()=>X(null));if(_e=X(null),Vd(t,`tagNameCheck`)&&ut(t.tagNameCheck)&&(_e.tagNameCheck=t.tagNameCheck),Vd(t,`attributeNameCheck`)&&ut(t.attributeNameCheck)&&(_e.attributeNameCheck=t.attributeNameCheck),Vd(t,`allowCustomizedBuiltInElements`)&&typeof t.allowCustomizedBuiltInElements==`boolean`&&(_e.allowCustomizedBuiltInElements=t.allowCustomizedBuiltInElements),xd(_e),Te&&(Se=!1),Ne&&(Me=!0),Be&&(F=qd({},of),he=X(null),Be.html===!0&&(qd(F,$d),qd(he,sf)),Be.svg===!0&&(qd(F,ef),qd(he,cf),qd(he,uf)),Be.svgFilters===!0&&(qd(F,tf),qd(he,cf),qd(he,uf)),Be.mathMl===!0&&(qd(F,rf),qd(he,lf),qd(he,uf))),be.tagCheck=null,be.attributeCheck=null,Vd(e,`ADD_TAGS`)&&(typeof e.ADD_TAGS==`function`?be.tagCheck=e.ADD_TAGS:Ad(e.ADD_TAGS)&&(F===me&&(F=Yd(F)),qd(F,e.ADD_TAGS,st))),Vd(e,`ADD_ATTR`)&&(typeof e.ADD_ATTR==`function`?be.attributeCheck=e.ADD_ATTR:Ad(e.ADD_ATTR)&&(he===ge&&(he=Yd(he)),qd(he,e.ADD_ATTR,st))),Vd(e,`ADD_FORBID_CONTENTS`)&&Ad(e.ADD_FORBID_CONTENTS)&&(Ve===He&&(Ve=Yd(Ve)),qd(Ve,e.ADD_FORBID_CONTENTS,st)),Re&&(F[`#text`]=!0),De&&qd(F,[`html`,`head`,`body`]),F.table&&(qd(F,[`tbody`]),delete ve.tbody),e.TRUSTED_TYPES_POLICY){if(typeof e.TRUSTED_TYPES_POLICY.createHTML!=`function`)throw Wd(`TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.`);if(typeof e.TRUSTED_TYPES_POLICY.createScriptURL!=`function`)throw Wd(`TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.`);let t=w;w=e.TRUSTED_TYPES_POLICY;try{T=te(``)}catch(e){throw w=t,e}}else e.TRUSTED_TYPES_POLICY===null?(w=void 0,T=``):(w===void 0&&(w=ne()),w&&typeof T==`string`&&(T=te(``)));bd&&bd(e),ct=e},ft=qd({},[...ef,...tf,...nf]),pt=qd({},[...rf,...af]),mt=function(e,t,n){return t.namespaceURI===Ye?e===`svg`:t.namespaceURI===qe?e===`svg`&&(n===`annotation-xml`||tt[n]):!!ft[e]},ht=function(e,t,n){return t.namespaceURI===Ye?e===`math`:t.namespaceURI===Je?e===`math`&&rt[n]:!!pt[e]},gt=function(e,t,n){return t.namespaceURI===Je&&!rt[n]||t.namespaceURI===qe&&!tt[n]?!1:!pt[e]&&(it[e]||!ft[e])},_t=function(e){let t=g(e);(!t||!t.tagName)&&(t={namespaceURI:Xe,tagName:`template`});let n=jd(e.tagName),r=jd(t.tagName);return Qe[e.namespaceURI]?e.namespaceURI===Je?mt(n,t,r):e.namespaceURI===qe?ht(n,t,r):e.namespaceURI===Ye?gt(n,t,r):!!(at===`application/xhtml+xml`&&Qe[e.namespaceURI]):!1},vt=function(e){Od(t.removed,{element:e});try{g(e).removeChild(e)}catch{if(p(e),!g(e))throw Wd(`a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place`)}},yt=function(e,t,n){try{e.removeAttributeNode(t)}catch{try{e.removeAttribute(n)}catch{}}},bt=function(e){St(e);let t=h(e);if(t){let e=[];Td(t,t=>{Od(e,t)}),Td(e,e=>{try{p(e)}catch{}})}let n=v(e);if(n)for(let t=n.length-1;t>=0;--t){let r=n[t],i=r&&r.name;typeof i==`string`&&yt(e,r,i)}},xt=function(e,n,r){if(!r)try{r=n.getAttributeNode(e)}catch{r=null}Od(t.removed,{attribute:r||null,from:n});try{r?n.removeAttributeNode(r):n.removeAttribute(e)}catch{try{n.removeAttribute(e)}catch{}}if(e===`is`){if(Me||Ne)try{vt(n)}catch{}else try{n.setAttribute(e,``)}catch{}}},I=function(e){let t=v(e);if(t)for(let n=t.length-1;n>=0;--n){let r=t[n],i=r&&r.name;typeof i!=`string`||he[st(i)]||yt(e,r,i)}},St=function(e){let t=[e];for(;t.length>0;){let e=t.pop();S(e)===Tf.element&&I(e);let n=h(e);if(n)for(let e=n.length-1;e>=0;--e)t.push(n[e])}},Ct=function(e,t){return Ee?e===`patchsrc`||e===`for`&&t!==`label`&&t!==`output`:!1},wt=function(e){if(!Ee)return;let t=[e];for(;t.length>0;){let e=t.pop(),n=S(e);if(n===Tf.processingInstruction||n===Tf.comment&&Ud(Sf,e.data)){try{p(e)}catch{}continue}if(n===Tf.element){let t=e,n=st(C(e));try{t.hasAttribute&&t.hasAttribute(`patchsrc`)&&t.removeAttribute(`patchsrc`),t.hasAttribute&&t.hasAttribute(`for`)&&Ct(`for`,n)&&t.removeAttribute(`for`)}catch{}}let r=h(e);if(r)for(let e=r.length-1;e>=0;--e)t.push(r[e])}},Tt=function(e){let t=null,r=null;if(je)e=`<remove></remove>`+e;else{let t=Nd(e,/^[\r\n\t ]+/);r=t&&t[0]}at===`application/xhtml+xml`&&Xe===Ye&&(e=`<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>`+e+`</body></html>`);let i=w?te(e):e;if(Xe===Ye)try{t=new l().parseFromString(i,at)}catch{}if(!t||!t.documentElement){t=ie.createDocument(Xe,`template`,null);try{t.documentElement.innerHTML=Ze?T:i}catch{}}let a=t.body||t.documentElement;return e&&r&&a.insertBefore(n.createTextNode(r),a.childNodes[0]||null),Xe===Ye?j.call(t,De?`html`:`body`)[0]:De?t.documentElement:a},Et=function(e){let t=x?x(e):e.ownerDocument;return ae.call(t||e,e,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},Dt=function(e){return e=Pd(e,se,` `),e=Pd(e,ce,` `),e=Pd(e,N,` `),e},Ot=function(e){e.normalize();let t=x?x(e):e.ownerDocument,n=ae.call(t||e,e,c.SHOW_TEXT|c.SHOW_COMMENT|c.SHOW_CDATA_SECTION|c.SHOW_PROCESSING_INSTRUCTION,null),r=n.nextNode();for(;r;)r.data=Dt(r.data),r=n.nextNode();let i=e.querySelectorAll?.call(e,`template`);i&&Td(i,e=>{At(e.content)&&Ot(e.content)})},kt=function(e){let t=b?b(e):null;return typeof t!=`string`||st(t)!==`form`?!1:typeof e.nodeName!=`string`||typeof e.textContent!=`string`||typeof e.removeChild!=`function`||e.attributes!==v(e)||typeof e.removeAttribute!=`function`||typeof e.setAttribute!=`function`||typeof e.namespaceURI!=`string`||typeof e.insertBefore!=`function`||typeof e.hasChildNodes!=`function`||e.nodeType!==y(e)||e.childNodes!==h(e)},At=function(e){if(!y||typeof e!=`object`||!e)return!1;try{return y(e)===Tf.documentFragment}catch{return!1}},L=function(e){if(!y||typeof e!=`object`||!e)return!1;try{return typeof y(e)==`number`}catch{return!1}};function jt(e,n,r){e.length!==0&&Td(e,e=>{e.call(t,n,r,ct)})}let Mt=function(e,t){return!!(Ee&&e.hasChildNodes()&&!L(e.firstElementChild)&&Ud(xf,e.textContent)&&Ud(xf,e.innerHTML)||Ee&&e.namespaceURI===Ye&&Df[t]&&(L(e.firstElementChild)||typeof e.textContent==`string`&&Ud(Of[t],e.textContent))||e.nodeType===Tf.processingInstruction||Ee&&e.nodeType===Tf.comment&&Ud(Sf,e.data))},Nt=function(e,t){return e instanceof RegExp?Ud(e,t):e instanceof Function&&!!e(t,...[...arguments].slice(2))},Pt=function(e,t,n){if(!ve[t]&&Bt(t)&&Nt(_e.tagNameCheck,t))return!1;if(Re&&!Ve[t]){let t=g(e),r=h(e);if(r&&t){let i=r.length;for(let a=i-1;a>=0;--a){let i=e===n?f(r[a],!0):r[a];t.insertBefore(i,m(e))}}}return vt(e),!0},Ft=function(e,t,n,r){return e.length===0?t:t===n||t===r?Yd(t):t},It=function(e,t){return e===t||g(e)!==null?!1:(ze&&St(e),!0)},Lt=function(e,n){if(jt(M.beforeSanitizeElements,e,null),It(e,n))return!0;if(kt(e))return vt(e),!0;let r=st(C(e));if(F=Ft(M.uponSanitizeElement,F,me,ke),jt(M.uponSanitizeElement,e,{tagName:r,allowedTags:F}),It(e,n))return!0;if(Mt(e,r))return vt(e),!0;if(ve[r]||!(be.tagCheck instanceof Function&&be.tagCheck(r))&&!F[r]){let t=Pt(e,r,n);return t===!1&&jt(M.afterSanitizeElements,e,null),t}if(S(e)===Tf.element&&!_t(e)||(r===`noscript`||r===`noembed`||r===`noframes`)&&Ud(Cf,e.innerHTML))return vt(e),!0;if(Te&&e.nodeType===Tf.text){let n=Dt(e.textContent);e.textContent!==n&&(Od(t.removed,{element:e.cloneNode()}),e.textContent=n)}return jt(M.afterSanitizeElements,e,null),!1},Rt=function(e,t,r){if(ye[t]||Ct(t,e)||Fe&&(t===`id`||t===`name`)&&(r in n||r in lt))return!1;let i=he[t]||be.attributeCheck instanceof Function&&be.attributeCheck(t,e);return Se&&Ud(P,t)||xe&&Ud(le,t)?!0:i?Ge[t]||Ud(pe,Pd(r,de,``))||(t===`src`||t===`xlink:href`||t===`href`)&&e!==`script`&&Fd(r,`data:`)===0&&Ue[e]||Ce&&!Ud(ue,Pd(r,de,``))?!0:!r:Bt(e)&&Nt(_e.tagNameCheck,e)&&Nt(_e.attributeNameCheck,t,e)||t===`is`&&_e.allowCustomizedBuiltInElements&&Nt(_e.tagNameCheck,r)},zt=qd({},[`annotation-xml`,`color-profile`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`missing-glyph`]),Bt=function(e){return!zt[jd(e)]&&Ud(fe,e)},Vt=function(e,t,n,r){if(w&&typeof u==`object`&&typeof u.getAttributeType==`function`&&!n)switch(u.getAttributeType(e,t)){case`TrustedHTML`:return te(r);case`TrustedScriptURL`:return k(r)}return r},R=function(e,n,r,i){try{r?e.setAttributeNS(r,n,i):e.setAttribute(n,i),kt(e)?vt(e):Dd(t.removed)}catch{xt(n,e)}},Ht=function(e){jt(M.beforeSanitizeAttributes,e,null);let t=e.attributes;if(!t||kt(e))return;he=Ft(M.uponSanitizeAttribute,he,ge,Ae);let n={attrName:``,attrValue:``,keepAttr:!0,allowedAttributes:he,forceKeepAttr:void 0},r=t.length,i=st(e.nodeName);for(;r--;){let a=t[r],o=a.name,s=a.namespaceURI,c=a.value,l=st(o),u=c,d=o===`value`?u:Id(u);if(n.attrName=l,n.attrValue=d,n.keepAttr=!0,n.forceKeepAttr=void 0,jt(M.uponSanitizeAttribute,e,n),d=n.attrValue,Ie&&(l===`id`||l===`name`)&&Fd(d,Le)!==0&&(xt(o,e,a),d=Le+d),Ee&&Ud(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,d)){xt(o,e,a);continue}if(l===`attributename`&&Nd(d,`href`)){xt(o,e,a);continue}if(!n.forceKeepAttr){if(!n.keepAttr){xt(o,e,a);continue}if(!we&&Ud(wf,d)){xt(o,e,a);continue}if(Te&&(d=Dt(d)),!Rt(i,l,d)){xt(o,e,a);continue}d=Vt(i,l,s,d),d!==u&&R(e,o,s,d)}}jt(M.afterSanitizeAttributes,e,null)},Ut=function(e){let t=null,n=Et(e);for(jt(M.beforeSanitizeShadowDOM,e,null);t=n.nextNode();)if(jt(M.uponSanitizeShadowNode,t,null),Lt(t,e),Ht(t),At(t.content)&&Ut(t.content),S(t)===Tf.element){let e=_(t);At(e)&&(Wt(e),Ut(e))}jt(M.afterSanitizeShadowDOM,e,null)},Wt=function(e){let t=[{node:e,shadow:null}];for(;t.length>0;){let e=t.pop();if(e.shadow){Ut(e.shadow);continue}let n=e.node,r=S(n)===Tf.element,i=h(n);if(i)for(let e=i.length-1;e>=0;--e)t.push({node:i[e],shadow:null});if(r){let e=b?b(n):null;if(typeof e==`string`&&st(e)===`template`){let e=n.content;At(e)&&t.push({node:e,shadow:null})}}if(r){let e=_(n);At(e)&&t.push({node:null,shadow:e},{node:e,shadow:null})}}};return t.sanitize=function(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=null,a=null,o=null,s=null;if(Ze=!e,Ze&&(e=`<!-->`),typeof e!=`string`&&!L(e)&&(e=Xd(e),typeof e!=`string`))throw Wd(`dirty is not a string, aborting`);if(!t.isSupported)return e;Oe?(F=ke,he=Ae):dt(n),(M.uponSanitizeElement.length>0||M.uponSanitizeAttribute.length>0)&&(F=Yd(F)),M.uponSanitizeAttribute.length>0&&(he=Yd(he)),t.removed=[];let c=ze&&typeof e!=`string`&&L(e);if(c){wt(e);let t=C(e);if(typeof t==`string`){let n=st(t);if(!F[n]||ve[n])throw bt(e),Wd(`root node is forbidden and cannot be sanitized in-place`)}if(kt(e))throw bt(e),Wd(`root node is clobbered and cannot be sanitized in-place`);try{Wt(e)}catch(t){throw bt(e),t}}else if(L(e))i=Tt(`<!---->`),a=i.ownerDocument.importNode(e,!0),a.nodeType===Tf.element&&a.nodeName===`BODY`||a.nodeName===`HTML`?i=a:i.appendChild(a),Wt(a);else{if(!Me&&!Te&&!De&&e.indexOf(`<`)===-1)return w&&Pe?te(e):e;if(i=Tt(e),!i)return Me?null:Pe?T:``}i&&je&&vt(i.firstChild);let l=c?e:i;try{let e=Et(l);for(;o=e.nextNode();)Lt(o,l),Ht(o),At(o.content)&&Ut(o.content)}catch(n){throw c&&(bt(e),Td(t.removed,e=>{e.element&&St(e.element)})),n}if(c)return Td(t.removed,e=>{e.element&&St(e.element)}),Te&&Ot(e),e;if(Me){if(Te&&Ot(i),Ne)for(s=A.call(i.ownerDocument);i.firstChild;)s.appendChild(i.firstChild);else s=i;return(he.shadowroot||he.shadowrootmode)&&(s=oe.call(r,s,!0)),s}let u=De?i.outerHTML:i.innerHTML;return De&&F[`!doctype`]&&i.ownerDocument&&i.ownerDocument.doctype&&i.ownerDocument.doctype.name&&Ud(yf,i.ownerDocument.doctype.name)&&(u=`<!DOCTYPE `+i.ownerDocument.doctype.name+`>
57
+ `+u),Te&&(u=Dt(u)),w&&Pe?te(u):u},t.setConfig=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};dt(e),Oe=!0,ke=F,Ae=he},t.clearConfig=function(){ct=null,Oe=!1,ke=null,Ae=null,w=E,T=``},t.isValidAttribute=function(e,t,n){ct||dt({});let r=st(e),i=st(t);return Rt(r,i,n)},t.addHook=function(e,t){typeof t==`function`&&Vd(M,e)&&Od(M[e],t)},t.removeHook=function(e,t){if(Vd(M,e)){if(t!==void 0){let n=Ed(M[e],t);return n===-1?void 0:kd(M[e],n,1)[0]}return Dd(M[e])}},t.removeHooks=function(e){Vd(M,e)&&(M[e]=[])},t.removeAllHooks=function(){M=jf()},t}var Ff=Pf();function If(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Lf=If();function Rf(e){Lf=e}var zf={exec:()=>null};function Bf(e){let t=[];return n=>{let r=Math.max(0,Math.min(3,n-1)),i=t[r];return i||(i=e(r),t[r]=i),i}}function Z(e,t=``){let n=typeof e==`string`?e:e.source,r={replace:(e,t)=>{let i=typeof t==`string`?t:t.source;return i=i.replace(Hf.caret,`$1`),n=n.replace(e,i),r},getRegex:()=>new RegExp(n,t)};return r}var Vf=((e=``)=>{try{return!!RegExp(`(?<=1)(?<!1)`+e)}catch{return!1}})(),Hf={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:Bf(e=>RegExp(`^ {0,${e}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:Bf(e=>RegExp(`^ {0,${e}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`)),fencesBeginRegex:Bf(e=>RegExp(`^ {0,${e}}(?:\`\`\`|~~~)`)),headingBeginRegex:Bf(e=>RegExp(`^ {0,${e}}#`)),htmlBeginRegex:Bf(e=>RegExp(`^ {0,${e}}<(?:[a-z].*>|!--)`,`i`)),blockquoteBeginRegex:Bf(e=>RegExp(`^ {0,${e}}>`))},Uf=/^(?:[ \t]*(?:\n|$))+/,Wf=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Gf=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Kf=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,qf=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Jf=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,Yf=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Xf=Z(Yf).replace(/bull/g,Jf).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,``).getRegex(),Zf=Z(Yf).replace(/bull/g,Jf).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),Qf=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/,$f=/^[^\n]+/,ep=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,tp=Z(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace(`label`,ep).replace(`title`,/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),np=Z(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,Jf).getRegex(),rp=`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|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul`,ip=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,ap=Z(`^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n*|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>[^\\n]*\\n*|$)|<![A-Z][\\s\\S]*?(?:>[^\\n]*\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>[^\\n]*\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))`,`i`).replace(`comment`,ip).replace(`tag`,rp).replace(`attribute`,/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),op=e=>Z(Qf).replace(`hr`,Kf).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace(`list`,e).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,rp).getRegex(),sp=op(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/),cp=op(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/),lp={blockquote:Z(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace(`paragraph`,cp).getRegex(),code:Wf,def:tp,fences:Gf,heading:qf,hr:Kf,html:ap,lheading:Xf,list:np,newline:Uf,paragraph:sp,table:zf,text:$f},up=Z(`^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)`).replace(`hr`,Kf).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`blockquote`,` {0,3}>`).replace(`code`,`(?: {4}| {0,3} )[^\\n]`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]`).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,rp).getRegex(),dp={...lp,lheading:Zf,table:up,paragraph:Z(Qf).replace(`hr`,Kf).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`table`,up).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]`).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,rp).getRegex()},fp={...lp,html:Z(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace(`comment`,ip).replace(/tag/g,`(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b`).getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:zf,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Z(Qf).replace(`hr`,Kf).replace(`heading`,` *#{1,6} *[^
58
+ ]`).replace(`lheading`,Xf).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`|fences`,``).replace(`|list`,``).replace(`|html`,``).replace(`|tag`,``).getRegex()},pp=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,mp=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,hp=/^( {2,}|\\)\n(?!\s*$)/,gp=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,_p=/[\p{P}\p{S}]/u,vp=/[\s\p{P}\p{S}]/u,yp=/[^\s\p{P}\p{S}]/u,bp=Z(/^((?![*_])punctSpace)/,`u`).replace(/punctSpace/g,vp).getRegex(),xp=/[\p{Pi}\p{Ps}"']/u,Sp=/(?!~)[\p{P}\p{S}]/u,Cp=/(?!~)[\s\p{P}\p{S}]/u,wp=/(?:[^\s\p{P}\p{S}]|~)/u,Tp=Z(/link|precode-code|html/,`g`).replace(`link`,/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace(`precode-`,Vf?"(?<!`)()":"(^^|[^`])").replace(`code`,/(?<b>`+)[^`]+\k<b>(?!`)/).replace(`html`,/<(?! )[^<>]*?>/).getRegex(),Ep=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,Dp=Z(Ep,`u`).replace(/punct/g,_p).getRegex(),Op=Z(Ep,`u`).replace(/punct/g,Sp).getRegex(),kp=Z(/^(?:\*+(?:((?!\*)(?!openQuote)punct)|([^\s*]))?)|^_+(?:((?!_)(?!openQuote)punct)|([^\s_]))?/,`u`).replace(/openQuote/g,xp).replace(/punct/g,_p).getRegex(),Ap=`^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)`,jp=Z(Ap,`gu`).replace(/notPunctSpace/g,yp).replace(/punctSpace/g,vp).replace(/punct/g,_p).getRegex(),Mp=Z(Ap,`gu`).replace(/notPunctSpace/g,wp).replace(/punctSpace/g,Cp).replace(/punct/g,Sp).getRegex(),Np=Z(`^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)[\\s](\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|(?:(?!\\*)punct|notPunctSpace)(\\*+)(?!\\*)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,yp).replace(/punctSpace/g,vp).replace(/punct/g,_p).getRegex(),Pp=Z(`^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)`,`gu`).replace(/notPunctSpace/g,yp).replace(/punctSpace/g,vp).replace(/punct/g,_p).getRegex(),Fp=Z(`^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)[\\s](_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)|(?:(?!_)punct|notPunctSpace)(_+)(?!_)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,yp).replace(/punctSpace/g,vp).replace(/punct/g,_p).getRegex(),Ip=Z(/^~~?(?:((?!~)punct)|[^\s~])/,`u`).replace(/punct/g,_p).getRegex(),Lp=Z(`^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,yp).replace(/punctSpace/g,vp).replace(/punct/g,_p).getRegex(),Rp=Z(/\\(punct)/,`gu`).replace(/punct/g,_p).getRegex(),zp=Z(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace(`scheme`,/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace(`email`,/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),Bp=Z(ip).replace(`(?:-->|$)`,`-->`).getRegex(),Vp=Z(`^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>`).replace(`comment`,Bp).replace(`attribute`,/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Hp=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,Up=Z(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace(`label`,Hp).replace(`href`,/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace(`title`,/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Wp=Z(/^!?\[(label)\]\[(ref)\]/).replace(`label`,Hp).replace(`ref`,ep).getRegex(),Gp=Z(/^!?\[(ref)\](?:\[\])?/).replace(`ref`,ep).getRegex(),Kp=Z(`reflink|nolink(?!\\()`,`g`).replace(`reflink`,Wp).replace(`nolink`,Gp).getRegex(),qp=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Jp={_backpedal:zf,anyPunctuation:Rp,autolink:zp,blockSkip:Tp,br:hp,code:mp,del:zf,delLDelim:zf,delRDelim:zf,emStrongLDelim:Dp,emStrongRDelimAst:jp,emStrongRDelimUnd:Pp,escape:pp,link:Up,nolink:Gp,punctuation:bp,reflink:Wp,reflinkSearch:Kp,tag:Vp,text:gp,url:zf},Yp={...Jp,emStrongLDelim:kp,emStrongRDelimAst:Np,emStrongRDelimUnd:Fp,link:Z(/^!?\[(label)\]\((.*?)\)/).replace(`label`,Hp).getRegex(),reflink:Z(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace(`label`,Hp).getRegex()},Xp={...Jp,emStrongRDelimAst:Mp,emStrongLDelim:Op,delLDelim:Ip,delRDelim:Lp,url:Z(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace(`protocol`,qp).replace(`email`,/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:Z(/^(`+|~+|[^`~])(?:(?=[`~])|(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace(`protocol`,qp).getRegex()},Zp={...Xp,br:Z(hp).replace(`{2,}`,`*`).getRegex(),text:Z(Xp.text).replace(`\\b_`,`\\b_| {2,}\\n`).replace(/\{2,\}/g,`*`).getRegex()},Qp={normal:lp,gfm:dp,pedantic:fp},$p={normal:Jp,gfm:Xp,breaks:Zp,pedantic:Yp},em={"&":`&amp;`,"<":`&lt;`,">":`&gt;`,'"':`&quot;`,"'":`&#39;`},tm=e=>em[e];function nm(e,t){if(t){if(Hf.escapeTest.test(e))return e.replace(Hf.escapeReplace,tm)}else if(Hf.escapeTestNoEncode.test(e))return e.replace(Hf.escapeReplaceNoEncode,tm);return e}function rm(e){try{e=encodeURI(e).replace(Hf.percentDecode,`%`)}catch{return null}return e}function im(e,t){let n=e.replace(Hf.findPipe,(e,t,n)=>{let r=!1,i=t;for(;--i>=0&&n[i]===`\\`;)r=!r;return r?`|`:` |`}).split(Hf.splitPipe),r=0;if(n[0].trim()||n.shift(),n.length>0&&!n.at(-1)?.trim()&&n.pop(),t){if(n.length>t)n.splice(t);else for(;n.length<t;)n.push(``)}for(;r<n.length;r++)n[r]=n[r].trim().replace(Hf.slashPipe,`|`);return n}function am(e,t,n){let r=e.length;if(r===0)return``;let i=0;for(;i<r;){let a=e.charAt(r-i-1);if(a===t&&!n)i++;else if(a!==t&&n)i++;else break}return e.slice(0,r-i)}function om(e){let t=e.split(`
59
+ `),n=t.length-1;for(;n>=0&&Hf.blankLine.test(t[n]);)n--;return t.length-n<=2?e:t.slice(0,n+1).join(`
60
+ `)}function sm(e,t){if(e.indexOf(t[1])===-1)return-1;let n=0;for(let r=0;r<e.length;r++)if(e[r]===`\\`)r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return n>0?-2:-1}function cm(e,t=0){let n=t,r=``;for(let t of e)if(t===` `){let e=4-n%4;r+=` `.repeat(e),n+=e}else r+=t,n++;return r}function lm(e,t,n,r,i){let a=t.href,o=t.title||null,s=e[1].replace(i.other.outputLinkReplace,`$1`),c=e[0].charAt(0)===`!`;r.state.inLink=!0;let l=r.state.linkEmitted,u=r.state.inRawBlock;r.state.linkEmitted=!1;let d=r.inlineTokens(s),f=r.state.linkEmitted;if(r.state.linkEmitted=l,r.state.inLink=!1,!c){if(f){r.state.inRawBlock=u;return}r.state.linkEmitted=!0}return{type:c?`image`:`link`,raw:n,href:a,title:o,text:s,tokens:d}}function um(e,t,n){let r=e.match(n.other.indentCodeCompensation);if(r===null)return t;let i=r[1];return t.split(`
61
+ `).map(e=>{let t=e.match(n.other.beginningSpace);if(t===null)return e;let[r]=t;return r.length>=i.length?e.slice(i.length):e}).join(`
62
+ `)}var dm=class{options;rules;lexer;constructor(e){this.options=e||Lf}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:`space`,raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let e=this.options.pedantic?t[0]:om(t[0]);return{type:`code`,raw:e,codeBlockStyle:`indented`,text:e.replace(this.rules.other.codeRemoveIndent,``)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let e=t[0],n=um(e,t[3]||``,this.rules);return{type:`code`,raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,`$1`):t[2],text:n}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(this.rules.other.endingHash.test(e)){let t=am(e,`#`);(this.options.pedantic||!t||this.rules.other.endingSpaceChar.test(t))&&(e=t.trim())}return{type:`heading`,raw:am(t[0],`
63
+ `),depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:`hr`,raw:am(t[0],`
64
+ `)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let e=am(t[0],`
65
+ `).split(`
66
+ `),n=``,r=``,i=[];for(;e.length>0;){let t=!1,a=[],o;for(o=0;o<e.length;o++)if(this.rules.other.blockquoteStart.test(e[o]))a.push(e[o]),t=!0;else if(!t)a.push(e[o]);else break;e=e.slice(o);let s=a.join(`
67
+ `),c=s.replace(this.rules.other.blockquoteSetextReplace,`
68
+ $1`).replace(this.rules.other.blockquoteSetextReplace2,``);n=n?`${n}
69
+ ${s}`:s,r=r?`${r}
70
+ ${c}`:c;let l=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(c,i,!0),this.lexer.state.top=l,e.length===0)break;let u=i.at(-1);if(u?.type===`code`)break;if(u?.type===`blockquote`){let t=u,a=e.join(`
71
+ `),o=t.raw+`
72
+ `+a.replace(this.rules.other.blockquoteSetextReplace2,``),s=this.blockquote(o);i[i.length-1]=s,n=`${n}
73
+ ${a}`,r=r.substring(0,r.length-t.text.length)+s.text;break}if(u?.type===`list`){let t=u,a=t.raw+`
74
+ `+e.join(`
75
+ `),o=this.list(a);i[i.length-1]=o,n=n.substring(0,n.length-u.raw.length)+o.raw,r=r.substring(0,r.length-t.raw.length)+o.raw,e=a.substring(i.at(-1).raw.length).split(`
76
+ `);continue}}return{type:`blockquote`,raw:n,tokens:i,text:r}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim(),r=n.length>1,i={type:`list`,raw:``,ordered:r,start:r?+n.slice(0,-1):``,loose:!1,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:`[*+-]`);let a=this.rules.other.listItemRegex(n),o=!1;for(;e;){let n=!1,r=``,s=``;if(!(t=a.exec(e))||this.rules.block.hr.test(e))break;r=t[0],e=e.substring(r.length);let c=cm(t[2].split(`
77
+ `,1)[0],t[1].length),l=e.split(`
78
+ `,1)[0],u=!c.trim(),d=0;if(this.options.pedantic?(d=2,s=c.trimStart()):u?d=t[1].length+1:(d=c.search(this.rules.other.nonSpaceChar),d=d>4?1:d,s=c.slice(d),d+=t[1].length),u&&this.rules.other.blankLine.test(l)&&(r+=l+`
79
+ `,e=e.substring(l.length+1),n=!0),!n){let t=this.rules.other.nextBulletRegex(d),n=this.rules.other.hrRegex(d),i=this.rules.other.fencesBeginRegex(d),a=this.rules.other.headingBeginRegex(d),o=this.rules.other.htmlBeginRegex(d),f=this.rules.other.blockquoteBeginRegex(d);for(;e;){let p=e.split(`
80
+ `,1)[0],m;if(l=p,this.options.pedantic?(l=l.replace(this.rules.other.listReplaceNesting,` `),m=l):m=l.replace(this.rules.other.tabCharGlobal,` `),i.test(l)||a.test(l)||o.test(l)||f.test(l)||t.test(l)||n.test(l))break;if(m.search(this.rules.other.nonSpaceChar)>=d||!l.trim())s+=`
81
+ `+m.slice(d);else{if(u||c.replace(this.rules.other.tabCharGlobal,` `).search(this.rules.other.nonSpaceChar)>=4||i.test(c)||a.test(c)||n.test(c))break;s+=`
82
+ `+l}u=!l.trim(),r+=p+`
83
+ `,e=e.substring(p.length+1),c=m.slice(d)}}i.loose||(o?i.loose=!0:this.rules.other.doubleBlankLine.test(r)&&(o=!0)),i.items.push({type:`list_item`,raw:r,task:!!this.options.gfm&&this.rules.other.listIsTask.test(s),loose:!1,text:s,tokens:[]}),i.raw+=r}let s=i.items.at(-1);if(s)s.raw=s.raw.trimEnd(),s.text=s.text.trimEnd();else return;i.raw=i.raw.trimEnd();for(let e of i.items)if(this.lexer.state.top=!1,e.tokens=this.lexer.blockTokens(e.text,[]),!i.loose){let t=e.tokens.filter(e=>e.type===`space`);i.loose=t.length>0&&t.some(e=>this.rules.other.anyLine.test(e.raw))}for(let e of i.items){let t=e.tokens[0];if(e.task&&(t?.type===`text`||t?.type===`paragraph`)){e.text=e.text.replace(this.rules.other.listReplaceTask,``),t.raw=t.raw.replace(this.rules.other.listReplaceTask,``),t.text=t.text.replace(this.rules.other.listReplaceTask,``);for(let e=this.lexer.inlineQueue.length-1;e>=0;e--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[e].src)){this.lexer.inlineQueue[e].src=this.lexer.inlineQueue[e].src.replace(this.rules.other.listReplaceTask,``);break}let n=this.rules.other.listTaskCheckbox.exec(e.raw);if(n){let t={type:`checkbox`,raw:n[0]+` `,checked:n[0]!==`[ ]`};e.checked=t.checked,i.loose?e.tokens[0]&&[`paragraph`,`text`].includes(e.tokens[0].type)&&`tokens`in e.tokens[0]&&e.tokens[0].tokens?(e.tokens[0].raw=t.raw+e.tokens[0].raw,e.tokens[0].text=t.raw+e.tokens[0].text,e.tokens[0].tokens.unshift(t)):e.tokens.unshift({type:`paragraph`,raw:t.raw,text:t.raw,tokens:[t]}):e.tokens.unshift(t)}}else e.task&&=!1}if(i.loose)for(let e of i.items){e.loose=!0;for(let t of e.tokens)t.type===`text`&&(t.type=`paragraph`)}return i}}html(e){let t=this.rules.block.html.exec(e);if(t){let e=om(t[0]);return{type:`html`,block:!0,raw:e,pre:t[1]===`pre`||t[1]===`script`||t[1]===`style`,text:e}}}def(e){let t=this.rules.block.def.exec(e);if(t){let e=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal,` `),n=t[2]?t[2].replace(this.rules.other.hrefBrackets,`$1`).replace(this.rules.inline.anyPunctuation,`$1`):``,r=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,`$1`):t[3];return{type:`def`,tag:e,raw:am(t[0],`
84
+ `),href:n,title:r}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let n=im(t[1]),r=t[2].replace(this.rules.other.tableAlignChars,``).split(`|`),i=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,``).split(`
85
+ `):[],a={type:`table`,raw:am(t[0],`
86
+ `),header:[],align:[],rows:[]};if(n.length===r.length){for(let e of r)this.rules.other.tableAlignRight.test(e)?a.align.push(`right`):this.rules.other.tableAlignCenter.test(e)?a.align.push(`center`):this.rules.other.tableAlignLeft.test(e)?a.align.push(`left`):a.align.push(null);for(let e=0;e<n.length;e++)a.header.push({text:n[e],tokens:this.lexer.inline(n[e]),header:!0,align:a.align[e]});for(let e of i)a.rows.push(im(e,a.header.length).map((e,t)=>({text:e,tokens:this.lexer.inline(e),header:!1,align:a.align[t]})));return a}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t){let e=t[1].trim();return{type:`heading`,raw:am(t[0],`
87
+ `),depth:t[2].charAt(0)===`=`?1:2,text:e,tokens:this.lexer.inline(e)}}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let e=t[1].charAt(t[1].length-1)===`
88
+ `?t[1].slice(0,-1):t[1];return{type:`paragraph`,raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:`text`,raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:`escape`,raw:t[0],text:t[1]}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:`html`,raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){let t=this.rules.inline.link.exec(e);if(t){let e=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(e)){if(!this.rules.other.endAngleBracket.test(e))return;let t=am(e.slice(0,-1),`\\`);if((e.length-t.length)%2==0)return}else{let e=sm(t[2],`()`);if(e===-2)return;if(e>-1){let n=(t[0].indexOf(`!`)===0?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,n).trim(),t[3]=``}}let n=t[2],r=``;if(this.options.pedantic){let e=this.rules.other.pedanticHrefTitle.exec(n);e&&(n=e[1],r=e[3])}else r=t[3]?t[3].slice(1,-1):``;return n=n.trim(),this.rules.other.startAngleBracket.test(n)&&(n=this.options.pedantic&&!this.rules.other.endAngleBracket.test(e)?n.slice(1):n.slice(1,-1)),lm(t,{href:n&&n.replace(this.rules.inline.anyPunctuation,`$1`),title:r&&r.replace(this.rules.inline.anyPunctuation,`$1`)},t[0],this.lexer,this.rules)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let e=t[(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal,` `).toLowerCase()];if(!e){let e=n[0].charAt(0);return{type:`text`,raw:e,text:e}}return lm(n,e,n[0],this.lexer,this.rules)}}emStrong(e,t,n=``){let r=this.rules.inline.emStrongLDelim.exec(e);if(!(!r||!r[1]&&!r[2]&&!r[3]&&!r[4]||r[4]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(r[1]||r[3])||!n||this.rules.inline.punctuation.exec(n))){let i=[...r[0]].length-1,a,o,s=i,c=0,l=r[0][0],u=n===l,d=l===`*`?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(d.lastIndex=0,t=t.slice(-1*e.length+i);(r=d.exec(t))!==null;){if(a=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!a)continue;if(o=[...a].length,r[3]||r[4]){s+=o;continue}if(r[5]||r[6]){if(i%3&&!((i+o)%3)){c+=o;continue}if(u)break}if(s-=o,s>0)continue;o=Math.min(o,o+s+c);let t=[...r[0]][0].length,n=e.slice(0,i+r.index+t+o);if(Math.min(i,o)%2){let e=n.slice(1,-1);return{type:`em`,raw:n,text:e,tokens:this.lexer.inlineTokens(e)}}let l=n.slice(2,-2);return{type:`strong`,raw:n,text:l,tokens:this.lexer.inlineTokens(l)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(this.rules.other.newLineCharGlobal,` `),n=this.rules.other.nonSpaceChar.test(e),r=this.rules.other.startingSpaceChar.test(e)&&this.rules.other.endingSpaceChar.test(e);return n&&r&&(e=e.substring(1,e.length-1)),{type:`codespan`,raw:t[0],text:e}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:`br`,raw:t[0]}}del(e,t,n=``){let r=this.rules.inline.delLDelim.exec(e);if(r&&(!r[1]||!n||this.rules.inline.punctuation.exec(n))){let n=[...r[0]].length-1,i,a,o=n,s=this.rules.inline.delRDelim;for(s.lastIndex=0,t=t.slice(-1*e.length+n);(r=s.exec(t))!==null;){if(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!i||(a=[...i].length,a!==n))continue;if(r[3]||r[4]){o+=a;continue}if(o-=a,o>0)continue;a=Math.min(a,a+o);let t=[...r[0]][0].length,s=e.slice(0,n+r.index+t+a),c=s.slice(n,-n);return{type:`del`,raw:s,text:c,tokens:this.lexer.inlineTokens(c)}}}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let e,n;return t[2]===`@`?(e=t[1],n=`mailto:`+e):(e=t[1],n=e),{type:`link`,raw:t[0],text:e,href:n,tokens:[{type:`text`,raw:e,text:e}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let e,n;if(t[2]===`@`)e=t[0],n=`mailto:`+e;else{let r;do r=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??``;while(r!==t[0]);e=t[0],n=t[1]===`www.`?`http://`+t[0]:t[0]}return{type:`link`,raw:t[0],text:e,href:n,tokens:[{type:`text`,raw:e,text:e}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let e=this.lexer.state.inRawBlock;return{type:`text`,raw:t[0],text:t[0],escaped:e}}}},fm=class e{tokens;options;state;inlineQueue;tokenizer;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||Lf,this.options.tokenizer=this.options.tokenizer||new dm,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,linkEmitted:!1,top:!0};let t={other:Hf,block:Qp.normal,inline:$p.normal};this.options.pedantic?(t.block=Qp.pedantic,t.inline=$p.pedantic):this.options.gfm&&(t.block=Qp.gfm,t.inline=this.options.breaks?$p.breaks:$p.gfm),this.tokenizer.rules=t}static get rules(){return{block:Qp,inline:$p}}static lex(t,n){return new e(n).lex(t)}static lexInline(t,n){return new e(n).inlineTokens(t)}lex(e){e=e.replace(Hf.carriageReturn,`
89
+ `),this.blockTokens(e,this.tokens);for(let e=0;e<this.inlineQueue.length;e++){let t=this.inlineQueue[e];this.inlineTokens(t.src,t.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],n=!1){this.tokenizer.lexer=this,this.options.pedantic&&(e=e.replace(Hf.tabCharGlobal,` `).replace(Hf.spaceLine,``));let r=1/0;for(;e;){if(e.length<r)r=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}let i;if(this.options.extensions?.block?.some(n=>(i=n.call({lexer:this},e,t))?(e=e.substring(i.raw.length),t.push(i),!0):!1))continue;if(i=this.tokenizer.space(e)){e=e.substring(i.raw.length);let n=t.at(-1);i.raw.length===1&&n!==void 0?n.raw+=`
90
+ `:t.push(i);continue}if(i=this.tokenizer.code(e)){e=e.substring(i.raw.length);let n=t.at(-1);n?.type===`paragraph`||n?.type===`text`?(n.raw+=(n.raw.endsWith(`
91
+ `)?``:`
92
+ `)+i.raw,n.text+=`
93
+ `+i.text,this.inlineQueue.at(-1).src=n.text):t.push(i);continue}if(i=this.tokenizer.fences(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.heading(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.hr(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.blockquote(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.list(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.html(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.def(e)){e=e.substring(i.raw.length);let n=t.at(-1);n?.type===`paragraph`||n?.type===`text`?(n.raw+=(n.raw.endsWith(`
94
+ `)?``:`
95
+ `)+i.raw,n.text+=`
96
+ `+i.raw,this.inlineQueue.at(-1).src=n.text):this.tokens.links[i.tag]||(this.tokens.links[i.tag]={href:i.href,title:i.title},t.push(i));continue}if(i=this.tokenizer.table(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.lheading(e)){e=e.substring(i.raw.length),t.push(i);continue}let a=e;if(this.options.extensions?.startBlock){let t=1/0,n=e.slice(1),r;this.options.extensions.startBlock.forEach(e=>{r=e.call({lexer:this},n),typeof r==`number`&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(a=e.substring(0,t+1))}if(this.state.top&&(i=this.tokenizer.paragraph(a))){let r=t.at(-1);n&&r?.type===`paragraph`?(r.raw+=(r.raw.endsWith(`
97
+ `)?``:`
98
+ `)+i.raw,r.text+=`
99
+ `+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=r.text):t.push(i),n=a.length!==e.length,e=e.substring(i.raw.length);continue}if(i=this.tokenizer.text(e)){e=e.substring(i.raw.length);let n=t.at(-1);n?.type===`text`?(n.raw+=(n.raw.endsWith(`
100
+ `)?``:`
101
+ `)+i.raw,n.text+=`
102
+ `+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=n.text):t.push(i);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}linkInText(e){if(!e.includes(`[`))return!1;let t=this.tokenizer.rules.inline.link;for(let n of e.matchAll(this.tokenizer.rules.inline.blockSkip))if(t.test(n[0])&&e.charAt(n.index-1)!==`!`)return!0;for(let t of e.matchAll(this.tokenizer.rules.inline.reflinkSearch)){let e=t[0],n=e.lastIndexOf(`[`);if(!(e.charAt(0)===`!`||!Object.hasOwn(this.tokens.links,e.slice(n+1,-1)))&&!(n>1&&this.linkInText(e.slice(1,n-1))))return!0}return!1}inlineTokens(e,t=[]){this.tokenizer.lexer=this;let n=e;if(this.tokens.links&&e.includes(`[`)){let e=this.tokenizer.rules.inline.reflinkSearch,t=n=>{let r=n.lastIndexOf(`[`);if(!Object.hasOwn(this.tokens.links,n.slice(r+1,-1)))return n;if(r>1&&n.charAt(0)!==`!`){let i=n.slice(1,r-1);if(this.linkInText(i))return`[`+i.replace(e,t)+`][`+`a`.repeat(n.length-r-2)+`]`}return`[`+`a`.repeat(n.length-2)+`]`};n=n.replace(e,t)}n=n.replace(this.tokenizer.rules.inline.anyPunctuation,e=>`+`.repeat(e.length)),n=n.replace(this.tokenizer.rules.inline.blockSkip,(e,t,n)=>{let r=n?n.length:0;return e.slice(0,r)+`[`+`a`.repeat(e.length-r-2)+`]`}),n=this.options.hooks?.emStrongMask?.call({lexer:this},n)??n;let r=!1,i=``,a=1/0;for(;e;){if(e.length<a)a=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}r||(i=``),r=!1;let o;if(this.options.extensions?.inline?.some(n=>(o=n.call({lexer:this},e,t))?(e=e.substring(o.raw.length),t.push(o),!0):!1))continue;if(o=this.tokenizer.escape(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.tag(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.link(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(o.raw.length);let n=t.at(-1);o.type===`text`&&n?.type===`text`?(n.raw+=o.raw,n.text+=o.text):t.push(o);continue}if(o=this.tokenizer.emStrong(e,n,i)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.codespan(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.br(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.del(e,n,i)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.autolink(e)){e=e.substring(o.raw.length),t.push(o);continue}if(!this.state.inLink&&(o=this.tokenizer.url(e))){e=e.substring(o.raw.length),t.push(o);continue}let s=e;if(this.options.extensions?.startInline){let t=1/0,n=e.slice(1),r;this.options.extensions.startInline.forEach(e=>{r=e.call({lexer:this},n),typeof r==`number`&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(s=e.substring(0,t+1))}if(o=this.tokenizer.inlineText(s)){e=e.substring(o.raw.length),o.raw.slice(-1)!==`_`&&(i=o.raw.slice(-1)),r=!0;let n=t.at(-1);n?.type===`text`?(n.raw+=o.raw,n.text+=o.text):t.push(o);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return t}infiniteLoopError(e){let t=`Infinite loop on byte: `+e;if(this.options.silent)console.error(t);else throw Error(t)}},pm=class{options;parser;constructor(e){this.options=e||Lf}space(e){return``}code({text:e,lang:t,escaped:n}){let r=(t||``).match(Hf.notSpaceStart)?.[0],i=e.replace(Hf.endingNewline,``)+`
103
+ `;return r?`<pre><code class="language-`+nm(r)+`">`+(n?i:nm(i,!0))+`</code></pre>
104
+ `:`<pre><code>`+(n?i:nm(i,!0))+`</code></pre>
105
+ `}blockquote({tokens:e}){return`<blockquote>
106
+ ${this.parser.parse(e)}</blockquote>
107
+ `}html({text:e}){return e}def(e){return``}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>
108
+ `}hr(e){return`<hr>
109
+ `}list(e){let t=e.ordered,n=e.start,r=``;for(let t=0;t<e.items.length;t++){let n=e.items[t];r+=this.listitem(n)}let i=t?`ol`:`ul`,a=t&&n!==1?` start="`+n+`"`:``;return`<`+i+a+`>
110
+ `+r+`</`+i+`>
111
+ `}listitem(e){return`<li>${this.parser.parse(e.tokens)}</li>
112
+ `}checkbox({checked:e}){return`<input `+(e?`checked="" `:``)+`disabled="" type="checkbox"> `}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>
113
+ `}table(e){let t=``,n=``;for(let t=0;t<e.header.length;t++)n+=this.tablecell(e.header[t]);t+=this.tablerow({text:n});let r=``;for(let t=0;t<e.rows.length;t++){let i=e.rows[t];n=``;for(let e=0;e<i.length;e++)n+=this.tablecell(i[e]);r+=this.tablerow({text:n})}return r&&=`<tbody>${r}</tbody>`,`<table>
114
+ <thead>
115
+ `+t+`</thead>
116
+ `+r+`</table>
117
+ `}tablerow({text:e}){return`<tr>
118
+ ${e}</tr>
119
+ `}tablecell(e){let t=this.parser.parseInline(e.tokens),n=e.header?`th`:`td`;return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`</${n}>
120
+ `}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${nm(e,!0)}</code>`}br(e){return`<br>`}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:n}){let r=this.parser.parseInline(n),i=rm(e);if(i===null)return r;e=i;let a=`<a href="`+e+`"`;return t&&(a+=` title="`+nm(t)+`"`),a+=`>`+r+`</a>`,a}image({href:e,title:t,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));let i=rm(e);if(i===null)return nm(n);e=i;let a=`<img src="${e}" alt="${nm(n)}"`;return t&&(a+=` title="${nm(t)}"`),a+=`>`,a}text(e){return`tokens`in e&&e.tokens?this.parser.parseInline(e.tokens):`escaped`in e&&e.escaped?e.text:nm(e.text)}},mm=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return``+e}image({text:e}){return``+e}br(){return``}checkbox({raw:e}){return e}},hm=class e{options;renderer;textRenderer;constructor(e){this.options=e||Lf,this.options.renderer=this.options.renderer||new pm,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new mm}static parse(t,n){return new e(n).parse(t)}static parseInline(t,n){return new e(n).parseInline(t)}parse(e){this.renderer.parser=this;let t=``;for(let n=0;n<e.length;n++){let r=e[n];if(this.options.extensions?.renderers?.[r.type]){let e=r,n=this.options.extensions.renderers[e.type].call({parser:this},e);if(n!==!1||![`space`,`hr`,`heading`,`code`,`table`,`blockquote`,`list`,`checkbox`,`html`,`def`,`paragraph`,`text`].includes(e.type)){t+=n||``;continue}}let i=r;switch(i.type){case`space`:t+=this.renderer.space(i);break;case`hr`:t+=this.renderer.hr(i);break;case`heading`:t+=this.renderer.heading(i);break;case`code`:t+=this.renderer.code(i);break;case`table`:t+=this.renderer.table(i);break;case`blockquote`:t+=this.renderer.blockquote(i);break;case`list`:t+=this.renderer.list(i);break;case`checkbox`:t+=this.renderer.checkbox(i);break;case`html`:t+=this.renderer.html(i);break;case`def`:t+=this.renderer.def(i);break;case`paragraph`:t+=this.renderer.paragraph(i);break;case`text`:t+=this.renderer.text(i);break;default:{let e=`Token with "`+i.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return t}parseInline(e,t=this.renderer){this.renderer.parser=this;let n=``;for(let r=0;r<e.length;r++){let i=e[r];if(this.options.extensions?.renderers?.[i.type]){let e=this.options.extensions.renderers[i.type].call({parser:this},i);if(e!==!1||![`escape`,`html`,`link`,`image`,`checkbox`,`strong`,`em`,`codespan`,`br`,`del`,`text`].includes(i.type)){n+=e||``;continue}}let a=i;switch(a.type){case`escape`:n+=t.text(a);break;case`html`:n+=t.html(a);break;case`link`:n+=t.link(a);break;case`image`:n+=t.image(a);break;case`checkbox`:n+=t.checkbox(a);break;case`strong`:n+=t.strong(a);break;case`em`:n+=t.em(a);break;case`codespan`:n+=t.codespan(a);break;case`br`:n+=t.br(a);break;case`del`:n+=t.del(a);break;case`text`:n+=t.text(a);break;default:{let e=`Token with "`+a.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return n}},gm=class{options;block;constructor(e){this.options=e||Lf}static passThroughHooks=new Set([`preprocess`,`postprocess`,`processAllTokens`,`emStrongMask`]);static passThroughHooksRespectAsync=new Set([`preprocess`,`postprocess`,`processAllTokens`]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(e=this.block){return e?fm.lex:fm.lexInline}provideParser(e=this.block){return e?hm.parse:hm.parseInline}},_m=new class{defaults=If();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=hm;Renderer=pm;TextRenderer=mm;Lexer=fm;Tokenizer=dm;Hooks=gm;constructor(...e){this.use(...e)}walkTokens(e,t){let n=[];for(let r of e)switch(n=n.concat(t.call(this,r)),r.type){case`table`:{let e=r;for(let r of e.header)n=n.concat(this.walkTokens(r.tokens,t));for(let r of e.rows)for(let e of r)n=n.concat(this.walkTokens(e.tokens,t));break}case`list`:{let e=r;n=n.concat(this.walkTokens(e.items,t));break}default:{let e=r;this.defaults.extensions?.childTokens?.[e.type]?this.defaults.extensions.childTokens[e.type].forEach(r=>{let i=e[r].flat(1/0);n=n.concat(this.walkTokens(i,t))}):e.tokens&&(n=n.concat(this.walkTokens(e.tokens,t)))}}return n}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(e=>{let n={...e};if(n.async=this.defaults.async||n.async||!1,e.extensions&&(e.extensions.forEach(e=>{if(!e.name)throw Error(`extension name required`);if(`renderer`in e){let n=t.renderers[e.name];n?t.renderers[e.name]=function(...t){let r=e.renderer.apply(this,t);return r===!1&&(r=n.apply(this,t)),r}:t.renderers[e.name]=e.renderer}if(`tokenizer`in e){if(!e.level||e.level!==`block`&&e.level!==`inline`)throw Error(`extension level must be 'block' or 'inline'`);let n=t[e.level];n?n.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&(e.level===`block`?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:e.level===`inline`&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}`childTokens`in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)}),n.extensions=t),e.renderer){let t=this.defaults.renderer||new pm(this.defaults);for(let n in e.renderer){if(!(n in t))throw Error(`renderer '${n}' does not exist`);if([`options`,`parser`].includes(n))continue;let r=n,i=e.renderer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n||``}}n.renderer=t}if(e.tokenizer){let t=this.defaults.tokenizer||new dm(this.defaults);for(let n in e.tokenizer){if(!(n in t))throw Error(`tokenizer '${n}' does not exist`);if([`options`,`rules`,`lexer`].includes(n))continue;let r=n,i=e.tokenizer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.tokenizer=t}if(e.hooks){let t=this.defaults.hooks||new gm;for(let n in e.hooks){if(!(n in t))throw Error(`hook '${n}' does not exist`);if([`options`,`block`].includes(n))continue;let r=n,i=e.hooks[r],a=t[r];t[r]=gm.passThroughHooks.has(n)?e=>{if(this.defaults.async&&gm.passThroughHooksRespectAsync.has(n))return(async()=>{let n=await i.call(t,e);return a.call(t,n)})();let r=i.call(t,e);return a.call(t,r)}:(...e)=>{if(this.defaults.async)return(async()=>{let n=await i.apply(t,e);return n===!1&&(n=await a.apply(t,e)),n})();let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.hooks=t}if(e.walkTokens){let t=this.defaults.walkTokens,r=e.walkTokens;n.walkTokens=function(e){let n=[];return n.push(r.call(this,e)),t&&(n=n.concat(t.call(this,e))),n}}this.defaults={...this.defaults,...n}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return fm.lex(e,t??this.defaults)}parser(e,t){return hm.parse(e,t??this.defaults)}parseMarkdown(e){return(t,n)=>{let r={...n},i={...this.defaults,...r},a=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&r.async===!1)return a(Error(`marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise.`));if(typeof t>`u`||t===null)return a(Error(`marked(): input parameter is undefined or null`));if(typeof t!=`string`)return a(Error(`marked(): input parameter is of type `+Object.prototype.toString.call(t)+`, string expected`));if(i.hooks&&(i.hooks.options=i,i.hooks.block=e),i.async)return(async()=>{let n=i.hooks?await i.hooks.preprocess(t):t,r=await(i.hooks?await i.hooks.provideLexer(e):e?fm.lex:fm.lexInline)(n,i),a=i.hooks?await i.hooks.processAllTokens(r):r;i.walkTokens&&await Promise.all(this.walkTokens(a,i.walkTokens));let o=await(i.hooks?await i.hooks.provideParser(e):e?hm.parse:hm.parseInline)(a,i);return i.hooks?await i.hooks.postprocess(o):o})().catch(a);try{i.hooks&&(t=i.hooks.preprocess(t));let n=(i.hooks?i.hooks.provideLexer(e):e?fm.lex:fm.lexInline)(t,i);i.hooks&&(n=i.hooks.processAllTokens(n)),i.walkTokens&&this.walkTokens(n,i.walkTokens);let r=(i.hooks?i.hooks.provideParser(e):e?hm.parse:hm.parseInline)(n,i);return i.hooks&&(r=i.hooks.postprocess(r)),r}catch(e){return a(e)}}}onError(e,t){return n=>{if(n.message+=`
121
+ Please report this to https://github.com/markedjs/marked.`,e){let e=`<p>An error occurred:</p><pre>`+nm(n.message+``,!0)+`</pre>`;return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}};function vm(e,t){return _m.parse(e,t)}vm.options=vm.setOptions=function(e){return _m.setOptions(e),vm.defaults=_m.defaults,Rf(vm.defaults),vm},vm.getDefaults=If,vm.defaults=Lf;function ym(...e){return _m.use(...e),vm.defaults=_m.defaults,Rf(vm.defaults),vm}vm.use=ym,vm.walkTokens=function(e,t){return _m.walkTokens(e,t)},vm.parseInline=_m.parseInline,vm.Parser=hm,vm.parser=hm.parse,vm.Renderer=pm,vm.TextRenderer=mm,vm.Lexer=fm,vm.lexer=fm.lex,vm.Tokenizer=dm,vm.Hooks=gm,vm.parse=vm,vm.options,vm.setOptions,vm.walkTokens,vm.parseInline,hm.parse,fm.lex,vm.setOptions({gfm:!0,breaks:!0});function bm(e){let t=vm.parse(e,{async:!1});return Ff.sanitize(t)}var xm=320,Sm=240;function Cm(e){if(e.projectPath){let t=e.projectPath.replace(/\\/g,`/`).split(`/`).filter(e=>e);return t[t.length-1]||e.projectPath}return e.displayName||e.id}function wm(e){return{createdDate:cd(e.createdAt),updatedDate:e.updatedAt&&e.updatedAt!==e.createdAt?cd(e.updatedAt):null}}function Tm(e,t){return e.similarity===void 0?null:t?`${Math.round(e.similarity*100)}%`:`${e.similarity}%`}function Em({variant:e,item:t,memory:n,prompt:r,selected:i=!1,onSelect:a,onPin:o,onUnpin:s,onEdit:c,onDeleteMemory:l,onDeletePrompt:u,activeKeyword:d,onKeywordClick:f}){let{t:p}=Cr();if(e===`pair`&&n&&r){let e=n.isPinned||!1,t=wm(n),u=Tm(n,!0);return(0,V.jsxs)(`div`,{className:`min-w-0 rounded-xl border border-border bg-card p-3 space-y-3 ${i?`ring-1 ring-input`:``} ${e?`border-primary/40`:``}`,"data-id":n.id,children:[(0,V.jsxs)(`div`,{className:`space-y-3 rounded-lg border border-border bg-muted p-3`,children:[(0,V.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,V.jsx)(`span`,{className:`text-xs font-semibold uppercase tracking-wide text-muted-foreground`,children:p(`badge-prompt`)}),(0,V.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:cd(r.createdAt)})]}),(0,V.jsx)(Qu,{maxHeight:Sm,fade:`var(--muted)`,children:(0,V.jsx)(sd,{content:r.content})})]}),(0,V.jsx)(`div`,{className:`flex justify-center text-muted-foreground`,children:(0,V.jsx)(te,{className:`size-4`})}),(0,V.jsxs)(`div`,{className:`space-y-2`,children:[(0,V.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-2`,children:[(0,V.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5 min-w-0`,children:[(0,V.jsx)(fa,{checked:i,onCheckedChange:e=>a?.(n.id,e===!0)}),(0,V.jsx)(hl,{children:p(`badge-memory`)}),n.memoryType?(0,V.jsx)(td,{type:n.memoryType}):null,u?(0,V.jsx)(`span`,{className:`text-xs text-primary`,children:u}):null,e?(0,V.jsx)(hl,{variant:`secondary`,children:p(`badge-pinned`)}):null,(0,V.jsx)(`span`,{dir:`auto`,className:`text-xs text-muted-foreground font-mono min-w-0 break-all`,children:n.displayName||n.id})]}),(0,V.jsxs)(`div`,{className:`flex items-center gap-1 shrink-0`,children:[e?(0,V.jsx)(W,{variant:`ghost`,size:`icon-xs`,title:`Unpin`,onClick:()=>s?.(n.id),children:(0,V.jsx)(xe,{className:`size-3.5 fill-current`})}):(0,V.jsx)(W,{variant:`ghost`,size:`icon-xs`,title:`Pin`,onClick:()=>o?.(n.id),children:(0,V.jsx)(xe,{className:`size-3.5`})}),(0,V.jsx)(W,{variant:`ghost`,size:`icon-xs`,onClick:()=>c?.(n.id),children:(0,V.jsx)(ye,{className:`size-3.5`})}),(0,V.jsx)(ed,{content:p(`tooltip-delete-pair`),children:(0,V.jsx)(W,{variant:`destructive`,size:`icon-xs`,"aria-label":p(`btn-delete-pair`),onClick:()=>l?.(n.id,!0),children:(0,V.jsx)(Ne,{className:`size-3.5`})})})]})]}),n.tags?.length?(0,V.jsx)(`div`,{className:`flex flex-wrap gap-1`,children:n.tags.map(e=>(0,V.jsx)(ed,{content:p(`tooltip-tags`),className:`min-w-0 max-w-full`,children:(0,V.jsx)(pl,{keyword:e,active:d?.toLowerCase()===e.toLowerCase(),"aria-label":`${p(`tooltip-filter-keyword`)}: ${e}`,onClick:f})},e))}):null,(0,V.jsx)(`div`,{className:`rounded-lg border border-border bg-muted p-3`,children:(0,V.jsx)(Qu,{maxHeight:xm,fade:`var(--muted)`,children:(0,V.jsx)(`div`,{className:`markdown-content text-sm prose-invert max-w-none`,dangerouslySetInnerHTML:{__html:bm(n.content)}})})}),(0,V.jsxs)(`div`,{className:`flex flex-wrap gap-3 text-xs text-muted-foreground`,children:[(0,V.jsxs)(`span`,{children:[p(`date-created`),` `,t.createdDate]}),t.updatedDate?(0,V.jsxs)(`span`,{children:[p(`date-updated`),` `,t.updatedDate]}):null,(0,V.jsxs)(`span`,{dir:`ltr`,className:`font-mono break-all`,children:[`ID: `,n.id]})]})]})]})}if(e===`prompt`&&t){let e=!!t.linkedMemoryId;return(0,V.jsxs)(`div`,{className:`min-w-0 rounded-xl border border-border bg-card p-3 space-y-2 ${i?`ring-1 ring-input`:``}`,"data-id":t.id,children:[(0,V.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-2`,children:[(0,V.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5`,children:[(0,V.jsx)(fa,{checked:i,onCheckedChange:e=>a?.(t.id,e===!0)}),(0,V.jsx)(me,{className:`size-3.5 text-muted-foreground`}),(0,V.jsx)(hl,{variant:`secondary`,children:p(`badge-prompt`)}),e?(0,V.jsxs)(hl,{variant:`outline`,className:`border-status-success text-status-success bg-transparent`,children:[(0,V.jsx)(de,{className:`size-3`}),p(`badge-linked`)]}):null,(0,V.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:cd(t.createdAt)})]}),e?(0,V.jsx)(ed,{content:p(`tooltip-delete-prompt-pair`),children:(0,V.jsx)(W,{variant:`destructive`,size:`icon-xs`,"aria-label":p(e?`btn-delete-pair`:`btn-delete`),onClick:()=>u?.(t.id,e),children:(0,V.jsx)(Ne,{className:`size-3.5`})})}):(0,V.jsx)(W,{variant:`destructive`,size:`icon-xs`,"aria-label":p(e?`btn-delete-pair`:`btn-delete`),title:p(`btn-delete`),onClick:()=>u?.(t.id,e),children:(0,V.jsx)(Ne,{className:`size-3.5`})})]}),(0,V.jsx)(Qu,{maxHeight:Sm,children:(0,V.jsx)(sd,{content:t.content})}),e?(0,V.jsxs)(`div`,{className:`flex items-center gap-1 text-xs text-muted-foreground`,children:[(0,V.jsx)(te,{className:`size-3`}),p(`text-generated-above`),(0,V.jsx)(ne,{className:`size-3`})]}):null]})}if(e===`memory`&&t){let e=t.isPinned||!1,n=!!t.linkedPromptId,r=wm(t),u=Tm(t,!1);return(0,V.jsxs)(`div`,{className:`min-w-0 rounded-xl border border-border bg-card p-3 space-y-2 ${i?`ring-1 ring-input`:``} ${e?`border-primary/40`:``}`,"data-id":t.id,children:[(0,V.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-2`,children:[(0,V.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5 min-w-0`,children:[(0,V.jsx)(fa,{checked:i,onCheckedChange:e=>a?.(t.id,e===!0)}),t.memoryType?(0,V.jsx)(td,{type:t.memoryType}):null,n?(0,V.jsxs)(hl,{variant:`outline`,className:`border-status-success text-status-success bg-transparent`,children:[(0,V.jsx)(de,{className:`size-3`}),p(`badge-linked`)]}):null,u?(0,V.jsx)(`span`,{className:`text-xs text-primary`,children:u}):null,e?(0,V.jsx)(hl,{variant:`secondary`,children:p(`badge-pinned`)}):null,(0,V.jsx)(`span`,{dir:`auto`,className:`text-xs text-muted-foreground font-mono min-w-0 break-all`,children:Cm(t)}),t.projectPath?(0,V.jsx)(`span`,{dir:`ltr`,className:`text-code text-muted-foreground font-mono break-all w-full`,children:t.projectPath}):null]}),(0,V.jsxs)(`div`,{className:`flex items-center gap-1 shrink-0`,children:[e?(0,V.jsx)(W,{variant:`ghost`,size:`icon-xs`,title:`Unpin`,onClick:()=>s?.(t.id),children:(0,V.jsx)(xe,{className:`size-3.5 fill-current`})}):(0,V.jsx)(W,{variant:`ghost`,size:`icon-xs`,title:`Pin`,onClick:()=>o?.(t.id),children:(0,V.jsx)(xe,{className:`size-3.5`})}),(0,V.jsx)(W,{variant:`ghost`,size:`icon-xs`,onClick:()=>c?.(t.id),children:(0,V.jsx)(ye,{className:`size-3.5`})}),n?(0,V.jsx)(ed,{content:p(`tooltip-delete-pair`),children:(0,V.jsx)(W,{variant:`destructive`,size:`icon-xs`,"aria-label":p(n?`btn-delete-pair`:`btn-delete`),onClick:()=>l?.(t.id,n),children:(0,V.jsx)(Ne,{className:`size-3.5`})})}):(0,V.jsx)(W,{variant:`destructive`,size:`icon-xs`,"aria-label":p(n?`btn-delete-pair`:`btn-delete`),title:p(`btn-delete`),onClick:()=>l?.(t.id,n),children:(0,V.jsx)(Ne,{className:`size-3.5`})})]})]}),t.tags?.length?(0,V.jsx)(`div`,{className:`flex flex-wrap gap-1`,children:t.tags.map(e=>(0,V.jsx)(ed,{content:p(`tooltip-tags`),className:`min-w-0 max-w-full`,children:(0,V.jsx)(pl,{keyword:e,active:d?.toLowerCase()===e.toLowerCase(),"aria-label":`${p(`tooltip-filter-keyword`)}: ${e}`,onClick:f})},e))}):null,(0,V.jsx)(`div`,{className:`rounded-lg border border-border bg-muted p-3`,children:(0,V.jsx)(Qu,{maxHeight:xm,fade:`var(--muted)`,children:(0,V.jsx)(`div`,{className:`markdown-content text-sm prose-invert max-w-none`,dangerouslySetInnerHTML:{__html:bm(t.content)}})})}),n?(0,V.jsxs)(`div`,{className:`flex items-center gap-1 text-xs text-muted-foreground`,children:[(0,V.jsx)(ne,{className:`size-3`}),p(`text-from-below`),(0,V.jsx)(te,{className:`size-3`})]}):null,(0,V.jsxs)(`div`,{className:`flex flex-wrap gap-3 text-xs text-muted-foreground`,children:[(0,V.jsxs)(`span`,{children:[p(`date-created`),` `,r.createdDate]}),r.updatedDate?(0,V.jsxs)(`span`,{children:[p(`date-updated`),` `,r.updatedDate]}):null,(0,V.jsxs)(`span`,{dir:`ltr`,className:`font-mono break-all`,children:[`ID: `,t.id]})]})]})}return null}function Dm(e){let t=new Map(e.map(e=>[e.id,e])),n=[],r=new Set;for(let i of e)if(!r.has(i.id)){if(i.type===`memory`&&i.linkedPromptId&&t.has(i.linkedPromptId)){let e=t.get(i.linkedPromptId);n.push({isPair:!0,memory:i,prompt:e}),r.add(i.id),r.add(e.id)}else if(i.type===`prompt`&&i.linkedMemoryId&&t.has(i.linkedMemoryId)){let e=t.get(i.linkedMemoryId);n.push({isPair:!0,memory:e,prompt:i}),r.add(i.id),r.add(e.id)}else n.push({isPair:!1,type:i.type,item:i}),r.add(i.id)}return n.sort((e,t)=>{let n=e.isPair?e.memory.createdAt:e.item.createdAt,r=t.isPair?t.memory.createdAt:t.item.createdAt;return new Date(r).getTime()-new Date(n).getTime()})}function Om({memories:e,selectedIds:t,currentPage:n,totalPages:r,loading:i=!1,error:a=null,onSelect:o,onPageChange:s,onPin:c,onUnpin:l,onEdit:u,onDeleteMemory:d,onDeletePrompt:f,activeKeyword:p,onKeywordClick:m}){let{t:h}=Cr(),g=(0,_.useMemo)(()=>Dm(e),[e]),v=h(`text-page`,{current:n,total:r}),y=(0,V.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,V.jsx)(W,{variant:`outline`,size:`icon-xs`,disabled:!(n>1),onClick:()=>s(-1),children:(0,V.jsx)(A,{className:`size-3.5`})}),(0,V.jsx)(`span`,{className:`text-xs text-muted-foreground tabular-nums`,children:v}),(0,V.jsx)(W,{variant:`outline`,size:`icon-xs`,disabled:!(n<r),onClick:()=>s(1),children:(0,V.jsx)(j,{className:`size-3.5`})})]});return(0,V.jsxs)(`div`,{className:`space-y-3`,children:[(0,V.jsx)(`div`,{className:`grid min-h-32 items-start gap-3 lg:grid-cols-2`,children:i&&e.length===0?(0,V.jsx)(`div`,{className:`text-sm text-muted-foreground py-8 text-center`,children:h(`loading-init`)}):a?(0,V.jsxs)(`div`,{className:`text-sm text-destructive py-8 text-center`,children:[`Error: `,a]}):g.length===0?(0,V.jsx)(`div`,{className:`text-sm text-muted-foreground py-8 text-center`,children:h(`empty-memories`)}):g.map(e=>e.isPair?(0,V.jsx)(Em,{variant:`pair`,memory:e.memory,prompt:e.prompt,selected:t.has(e.memory.id),onSelect:o,onPin:c,onUnpin:l,onEdit:u,onDeleteMemory:d,onDeletePrompt:f,activeKeyword:p,onKeywordClick:m},e.memory.id):e.type===`prompt`?(0,V.jsx)(Em,{variant:`prompt`,item:e.item,selected:t.has(e.item.id),onSelect:o,onPin:c,onUnpin:l,onEdit:u,onDeleteMemory:d,onDeletePrompt:f,activeKeyword:p,onKeywordClick:m},e.item.id):(0,V.jsx)(Em,{variant:`memory`,item:e.item,selected:t.has(e.item.id),onSelect:o,onPin:c,onUnpin:l,onEdit:u,onDeleteMemory:d,onDeletePrompt:f,activeKeyword:p,onKeywordClick:m},e.item.id))}),(0,V.jsx)(`div`,{className:`flex justify-end`,children:y})]})}function km(e){let[t,n]=(0,_.useState)(null),[r,i]=(0,_.useState)(0);return(0,_.useEffect)(()=>{let e=!1;return er.status().then(t=>{e||n(t.success?t.data??null:null)}),()=>{e=!0}},[e,r]),{record:t,reload:(0,_.useCallback)(()=>i(e=>e+1),[])}}function Am(e){return e!==null}function jm(e){return{createdAt:e.createdAt,merged:e.merged,removed:e.removed}}function Mm(e,t){return e===`idle`&&t===`open`?`confirming`:e===`confirming`&&t===`cancel`?`idle`:e===`confirming`&&t===`confirm`?`working`:e===`working`&&t===`done`?`idle`:e}function Nm(e,t){return e===`confirming`&&t===`confirm`}function Pm(e){return{key:e.notFound>0?`toast-auto-cleanup-undone-partial`:`toast-auto-cleanup-undone`,params:{restored:e.restored,notFound:e.notFound}}}function Fm({version:e,onUndone:t}){let{t:n}=Cr(),{record:r,reload:i}=km(e),[a,o]=(0,_.useState)(`idle`);if(!Am(r)||!r)return null;async function s(){if(!Nm(a,`confirm`))return;o(Mm(a,`confirm`));let e=await er.undo();if(o(`idle`),i(),!e.success||!e.data){H.info(e.error||n(`toast-auto-cleanup-undo-failed`));return}let r=Pm(e.data);H.success(n(r.key,r.params)),t?.()}let c=jm(r);return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(W,{variant:`secondary`,size:`sm`,onClick:()=>o(Mm(a,`open`)),children:[(0,V.jsx)(Ie,{className:`size-3.5`}),n(`btn-auto-cleanup-undo`)]}),(0,V.jsx)($s,{open:a!==`idle`,onOpenChange:e=>{e||o(Mm(a,`cancel`))},children:(0,V.jsxs)(nc,{className:`sm:max-w-md`,children:[(0,V.jsxs)(rc,{children:[(0,V.jsx)(ac,{children:n(`title-auto-cleanup-undo`)}),(0,V.jsx)(oc,{children:n(`label-auto-cleanup-undo-body`,{when:cd(new Date(c.createdAt).toISOString()),merged:c.merged,removed:c.removed})})]}),(0,V.jsxs)(ic,{className:`gap-2`,children:[(0,V.jsx)(W,{variant:`secondary`,size:`sm`,disabled:a===`working`,onClick:()=>o(Mm(a,`cancel`)),children:n(`btn-cancel`)}),(0,V.jsx)(W,{size:`sm`,disabled:a===`working`,onClick:()=>void s(),children:n(`btn-auto-cleanup-undo-confirm`)})]})]})})]})}var Im=ni(`grid min-w-0 gap-0.5 rounded-xl border px-4 py-3 text-start text-sm has-data-[slot=alert-action]:relative has-data-[slot=alert-action]:pe-18 has-[>svg]:grid-cols-[auto_minmax(0,1fr)] has-[>svg]:gap-x-2.5 *:[svg]:row-span-2 *:[svg]:translate-y-0.5 *:[svg]:text-current *:[svg:not([class*='size-'])]:size-4 group/alert relative w-full`,{variants:{variant:{default:`bg-card text-card-foreground`,destructive:`text-destructive-label bg-card *:data-[slot=alert-description]:text-destructive-label *:[svg]:text-current`}},defaultVariants:{variant:`default`}});function Lm({className:e,variant:t,...n}){return(0,V.jsx)(`div`,{"data-slot":`alert`,role:`alert`,className:B(Im({variant:t}),e),...n})}function Rm({className:e,...t}){return(0,V.jsx)(`div`,{"data-slot":`alert-description`,className:B(`text-muted-foreground text-sm [&_p]:leading-relaxed col-start-2`,e),...t})}function zm(e){if(!e)return null;let t=e.status;switch(t.state){case`grouping`:return{kind:`grouping`};case`checking`:return t.total>0?{kind:`checking`,done:t.done,total:t.total}:{kind:`grouping`};case`done`:return{kind:`ready`,groups:t.preview.groups.length};case`failed`:return{kind:`failed`,error:t.error}}}function Bm(e){return e?.status.state===`grouping`||e?.status.state===`checking`}var Vm=3e3;function Hm(e){let[t,n]=(0,_.useState)(null);return(0,_.useEffect)(()=>{if(e)return;let t=!1,r,i=async()=>{let e=await Yn(`/api/user-profile/category-cleanup`);if(t)return;let a=e.success?e.data??null:null;n(a),Bm(a)&&(r=setTimeout(()=>void i(),Vm))};return i(),()=>{t=!0,clearTimeout(r)}},[e]),t}function Um({paused:e,onOpen:t}){let{t:n}=Cr(),r=zm(Hm(e));if(e||!r)return null;let i=r.kind===`failed`;return(0,V.jsx)(Lm,{variant:i?`destructive`:`default`,role:i?`alert`:`status`,children:(0,V.jsxs)(`div`,{className:`col-start-1 flex min-w-0 flex-wrap items-center justify-between gap-2`,children:[(0,V.jsxs)(`span`,{className:`min-w-0 break-words`,children:[r.kind===`grouping`&&n(`label-category-cleanup-loading`),r.kind===`checking`&&n(`label-category-cleanup-progress`,{done:r.done,total:r.total}),r.kind===`ready`&&n(`label-category-cleanup-banner-ready`,{groups:r.groups}),r.kind===`failed`&&(0,V.jsxs)(V.Fragment,{children:[n(`label-category-cleanup-banner-failed`),` `,(0,V.jsx)(`bdi`,{children:r.error})]})]}),(0,V.jsx)(W,{variant:`outline`,size:`xs`,onClick:t,children:n(`btn-category-cleanup-banner-open`)})]})})}var Wm=Object.defineProperty,Gm=(e,t)=>Wm(e,`name`,{value:t,configurable:!0}),Km=_.createContext(void 0);function qm(e){let t=_.useContext(Km);return e||t||`ltr`}Gm(qm,`useDirection`);var Jm=Object.defineProperty,Ym=(e,t)=>Jm(e,`name`,{value:t,configurable:!0});function Xm(e,[t,n]){return Math.min(n,Math.max(t,e))}Ym(Xm,`clamp`);var Zm=Object.defineProperty,Qm=(e,t)=>Zm(e,`name`,{value:t,configurable:!0});function $m(e,t){return _.useReducer((e,n)=>t[e][n]??e,e)}Qm($m,`useStateMachine`);var eh=`ScrollArea`,[th,nh]=li(eh),[rh,ih]=th(eh),ah=_.forwardRef(Qm(function(e,t){let{__scopeScrollArea:n,type:r=`hover`,dir:i,scrollHideDelay:a=600,...o}=e,[s,c]=_.useState(null),[l,u]=_.useState(null),[d,f]=_.useState(null),[p,m]=_.useState(null),[h,g]=_.useState(null),[v,y]=_.useState(0),[b,x]=_.useState(0),[S,C]=_.useState(!1),[w,T]=_.useState(!1),E=Lr(t,c),D=qm(i);return(0,V.jsx)(rh,{scope:n,type:r,dir:D,scrollHideDelay:a,scrollArea:s,viewport:l,onViewportChange:u,content:d,onContentChange:f,scrollbarX:p,onScrollbarXChange:m,scrollbarXEnabled:S,onScrollbarXEnabledChange:C,scrollbarY:h,onScrollbarYChange:g,scrollbarYEnabled:w,onScrollbarYEnabledChange:T,onCornerWidthChange:y,onCornerHeightChange:x,children:(0,V.jsx)(Ki.div,{dir:D,...o,ref:E,style:{position:`relative`,"--radix-scroll-area-corner-width":v+`px`,"--radix-scroll-area-corner-height":b+`px`,...e.style}})})},`ScrollArea`)),oh=`ScrollAreaViewport`,sh=_.forwardRef(Qm(function(e,t){let{__scopeScrollArea:n,children:r,nonce:i,...a}=e,o=ih(oh,n),s=Lr(t,_.useRef(null),o.onViewportChange);return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(ch,{nonce:i}),(0,V.jsx)(Ki.div,{"data-radix-scroll-area-viewport":``,...a,ref:s,style:{overflowX:o.scrollbarXEnabled?`scroll`:`hidden`,overflowY:o.scrollbarYEnabled?`scroll`:`hidden`,...e.style},children:(0,V.jsx)(`div`,{ref:o.onContentChange,style:{minWidth:`100%`,display:`table`},children:r})})]})},`ScrollAreaViewport`)),ch=_.memo(Qm(function({nonce:e}){return(0,V.jsx)(`style`,{dangerouslySetInnerHTML:{__html:`[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}`},nonce:e})},`ScrollAreaViewportStyle`),(e,t)=>e.nonce===t.nonce),lh=`ScrollAreaScrollbar`,uh=_.forwardRef(Qm(function(e,t){let{forceMount:n,...r}=e,i=ih(lh,e.__scopeScrollArea),{onScrollbarXEnabledChange:a,onScrollbarYEnabledChange:o}=i,s=e.orientation===`horizontal`;return _.useEffect(()=>(s?a(!0):o(!0),()=>{s?a(!1):o(!1)}),[s,a,o]),i.type===`hover`?(0,V.jsx)(dh,{...r,ref:t,forceMount:n}):i.type===`scroll`?(0,V.jsx)(fh,{...r,ref:t,forceMount:n}):i.type===`auto`?(0,V.jsx)(ph,{...r,ref:t,forceMount:n}):i.type===`always`?(0,V.jsx)(mh,{...r,ref:t,"data-state":`visible`}):null},`ScrollAreaScrollbar`)),dh=_.forwardRef(Qm(function(e,t){let{forceMount:n,...r}=e,i=ih(lh,e.__scopeScrollArea),[a,o]=_.useState(!1);return _.useEffect(()=>{let e=i.scrollArea,t=0;if(e){let n=Qm(()=>{window.clearTimeout(t),o(!0)},`handlePointerEnter`),r=Qm(()=>{t=window.setTimeout(()=>o(!1),i.scrollHideDelay)},`handlePointerLeave`);return e.addEventListener(`pointerenter`,n),e.addEventListener(`pointerleave`,r),()=>{window.clearTimeout(t),e.removeEventListener(`pointerenter`,n),e.removeEventListener(`pointerleave`,r)}}},[i.scrollArea,i.scrollHideDelay]),(0,V.jsx)(Ri,{present:n||a,children:(0,V.jsx)(ph,{"data-state":a?`visible`:`hidden`,...r,ref:t})})},`ScrollAreaScrollbarHover`)),fh=_.forwardRef(Qm(function(e,t){let{forceMount:n,...r}=e,i=ih(lh,e.__scopeScrollArea),a=e.orientation===`horizontal`,o=Ph(()=>c(`SCROLL_END`),100),[s,c]=$m(`hidden`,{hidden:{SCROLL:`scrolling`},scrolling:{SCROLL_END:`idle`,POINTER_ENTER:`interacting`},interacting:{SCROLL:`interacting`,POINTER_LEAVE:`idle`},idle:{HIDE:`hidden`,SCROLL:`scrolling`,POINTER_ENTER:`interacting`}});return _.useEffect(()=>{if(s===`idle`){let e=window.setTimeout(()=>c(`HIDE`),i.scrollHideDelay);return()=>window.clearTimeout(e)}},[s,i.scrollHideDelay,c]),_.useEffect(()=>{let e=i.viewport,t=a?`scrollLeft`:`scrollTop`;if(e){let n=e[t],r=Qm(()=>{let r=e[t];n!==r&&(c(`SCROLL`),o()),n=r},`handleScroll`);return e.addEventListener(`scroll`,r),()=>e.removeEventListener(`scroll`,r)}},[i.viewport,a,c,o]),(0,V.jsx)(Ri,{present:n||s!==`hidden`,children:(0,V.jsx)(mh,{"data-state":s===`hidden`?`hidden`:`visible`,...r,ref:t,onPointerEnter:mi(e.onPointerEnter,()=>c(`POINTER_ENTER`)),onPointerLeave:mi(e.onPointerLeave,()=>c(`POINTER_LEAVE`))})})},`ScrollAreaScrollbarScroll`)),ph=_.forwardRef(Qm(function(e,t){let n=ih(lh,e.__scopeScrollArea),{forceMount:r,...i}=e,[a,o]=_.useState(!1),s=e.orientation===`horizontal`,c=Ph(()=>{if(n.viewport){let e=n.viewport.offsetWidth<n.viewport.scrollWidth,t=n.viewport.offsetHeight<n.viewport.scrollHeight;o(s?e:t)}},10);return Fh(n.viewport,c),Fh(n.content,c),(0,V.jsx)(Ri,{present:r||a,children:(0,V.jsx)(mh,{"data-state":a?`visible`:`hidden`,...i,ref:t})})},`ScrollAreaScrollbarAuto`)),mh=_.forwardRef(Qm(function(e,t){let{orientation:n=`vertical`,...r}=e,i=ih(lh,e.__scopeScrollArea),a=_.useRef(null),o=_.useRef(0),[s,c]=_.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),l=Dh(s.viewport,s.content),u={...r,sizes:s,onSizesChange:c,hasThumb:l>0&&l<1,onThumbChange:Qm(e=>a.current=e,`onThumbChange`),onThumbPointerUp:Qm(()=>o.current=0,`onThumbPointerUp`),onThumbPointerDown:Qm(e=>o.current=e,`onThumbPointerDown`)};function d(e,t){return kh(e,o.current,s,t)}return Qm(d,`getScrollPosition`),n===`horizontal`?(0,V.jsx)(hh,{...u,ref:t,onThumbPositionChange:()=>{if(i.viewport&&a.current){let e=i.viewport.scrollLeft,t=Ah(e,s,i.dir);a.current.style.transform=`translate3d(${t}px, 0, 0)`}},onWheelScroll:e=>{i.viewport&&(i.viewport.scrollLeft=e)},onDragScroll:e=>{i.viewport&&(i.viewport.scrollLeft=d(e,i.dir))}}):n===`vertical`?(0,V.jsx)(gh,{...u,ref:t,onThumbPositionChange:()=>{if(i.viewport&&a.current){let e=i.viewport.scrollTop,t=Ah(e,s);a.current.style.transform=`translate3d(0, ${t}px, 0)`}},onWheelScroll:e=>{i.viewport&&(i.viewport.scrollTop=e)},onDragScroll:e=>{i.viewport&&(i.viewport.scrollTop=d(e))}}):null},`ScrollAreaScrollbarVisible`)),hh=_.forwardRef(Qm(function(e,t){let{sizes:n,onSizesChange:r,...i}=e,a=ih(lh,e.__scopeScrollArea),[o,s]=_.useState(),c=_.useRef(null),l=Lr(t,c,a.onScrollbarXChange);return _.useEffect(()=>{c.current&&s(getComputedStyle(c.current))},[c]),(0,V.jsx)(yh,{"data-orientation":`horizontal`,...i,ref:l,sizes:n,style:{bottom:0,left:a.dir===`rtl`?`var(--radix-scroll-area-corner-width)`:0,right:a.dir===`ltr`?`var(--radix-scroll-area-corner-width)`:0,"--radix-scroll-area-thumb-width":Oh(n)+`px`,...e.style},onThumbPointerDown:t=>e.onThumbPointerDown(t.x),onDragScroll:t=>e.onDragScroll(t.x),onWheelScroll:(t,n)=>{if(a.viewport){let r=a.viewport.scrollLeft+t.deltaX;e.onWheelScroll(r),Mh(r,n)&&t.preventDefault()}},onResize:()=>{c.current&&a.viewport&&o&&r({content:a.viewport.scrollWidth,viewport:a.viewport.offsetWidth,scrollbar:{size:c.current.clientWidth,paddingStart:Eh(o.paddingLeft),paddingEnd:Eh(o.paddingRight)}})}})},`ScrollAreaScrollbarX`)),gh=_.forwardRef(Qm(function(e,t){let{sizes:n,onSizesChange:r,...i}=e,a=ih(lh,e.__scopeScrollArea),[o,s]=_.useState(),c=_.useRef(null),l=Lr(t,c,a.onScrollbarYChange);return _.useEffect(()=>{c.current&&s(getComputedStyle(c.current))},[c]),(0,V.jsx)(yh,{"data-orientation":`vertical`,...i,ref:l,sizes:n,style:{top:0,right:a.dir===`ltr`?0:void 0,left:a.dir===`rtl`?0:void 0,bottom:`var(--radix-scroll-area-corner-height)`,"--radix-scroll-area-thumb-height":Oh(n)+`px`,...e.style},onThumbPointerDown:t=>e.onThumbPointerDown(t.y),onDragScroll:t=>e.onDragScroll(t.y),onWheelScroll:(t,n)=>{if(a.viewport){let r=a.viewport.scrollTop+t.deltaY;e.onWheelScroll(r),Mh(r,n)&&t.preventDefault()}},onResize:()=>{c.current&&a.viewport&&o&&r({content:a.viewport.scrollHeight,viewport:a.viewport.offsetHeight,scrollbar:{size:c.current.clientHeight,paddingStart:Eh(o.paddingTop),paddingEnd:Eh(o.paddingBottom)}})}})},`ScrollAreaScrollbarY`)),[_h,vh]=th(lh),yh=_.forwardRef(Qm(function(e,t){let{__scopeScrollArea:n,sizes:r,hasThumb:i,onThumbChange:a,onThumbPointerUp:o,onThumbPointerDown:s,onThumbPositionChange:c,onDragScroll:l,onWheelScroll:u,onResize:d,...f}=e,p=ih(lh,n),[m,h]=_.useState(null),g=Lr(t,h),v=_.useRef(null),y=_.useRef(``),b=p.viewport,x=r.content-r.viewport,S=ba(u),C=ba(c),w=Ph(d,10);function T(e){if(v.current){let t=e.clientX-v.current.left,n=e.clientY-v.current.top;l({x:t,y:n})}}return Qm(T,`handleDragScroll`),_.useEffect(()=>{let e=Qm(e=>{let t=e.target;m?.contains(t)&&S(e,x)},`handleWheel`);return document.addEventListener(`wheel`,e,{passive:!1}),()=>document.removeEventListener(`wheel`,e,{passive:!1})},[b,m,x,S]),_.useEffect(C,[r,C]),Fh(m,w),Fh(p.content,w),(0,V.jsx)(_h,{scope:n,scrollbar:m,hasThumb:i,onThumbChange:ba(a),onThumbPointerUp:ba(o),onThumbPositionChange:C,onThumbPointerDown:ba(s),children:(0,V.jsx)(Ki.div,{...f,ref:g,style:{position:`absolute`,...f.style},onPointerDown:mi(e.onPointerDown,e=>{e.button===0&&(e.target.setPointerCapture(e.pointerId),v.current=m.getBoundingClientRect(),y.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect=`none`,p.viewport&&(p.viewport.style.scrollBehavior=`auto`),T(e))}),onPointerMove:mi(e.onPointerMove,T),onPointerUp:mi(e.onPointerUp,e=>{let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),document.body.style.webkitUserSelect=y.current,p.viewport&&(p.viewport.style.scrollBehavior=``),v.current=null})})})},`ScrollAreaScrollbarImpl`)),bh=`ScrollAreaThumb`,xh=_.forwardRef(Qm(function(e,t){let{forceMount:n,...r}=e,i=vh(bh,e.__scopeScrollArea);return(0,V.jsx)(Ri,{present:n||i.hasThumb,children:(0,V.jsx)(Sh,{ref:t,...r})})},`ScrollAreaThumb`)),Sh=_.forwardRef(Qm(function(e,t){let{__scopeScrollArea:n,style:r,...i}=e,a=ih(bh,n),o=vh(bh,n),{onThumbPositionChange:s}=o,c=Lr(t,o.onThumbChange),l=_.useRef(void 0),u=Ph(()=>{l.current&&=(l.current(),void 0)},100);return _.useEffect(()=>{let e=a.viewport;if(e){let t=Qm(()=>{if(u(),!l.current){let t=Nh(e,s);l.current=t,s()}},`handleScroll`);return s(),e.addEventListener(`scroll`,t),()=>e.removeEventListener(`scroll`,t)}},[a.viewport,u,s]),(0,V.jsx)(Ki.div,{"data-state":o.hasThumb?`visible`:`hidden`,...i,ref:c,style:{width:`var(--radix-scroll-area-thumb-width)`,height:`var(--radix-scroll-area-thumb-height)`,...r},onPointerDownCapture:mi(e.onPointerDownCapture,e=>{let t=e.target.getBoundingClientRect(),n=e.clientX-t.left,r=e.clientY-t.top;o.onThumbPointerDown({x:n,y:r})}),onPointerUp:mi(e.onPointerUp,o.onThumbPointerUp)})},`ScrollAreaThumbImpl`)),Ch=`ScrollAreaCorner`,wh=_.forwardRef(Qm(function(e,t){let n=ih(Ch,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!==`scroll`&&r?(0,V.jsx)(Th,{...e,ref:t}):null},`ScrollAreaCorner`)),Th=_.forwardRef(Qm(function(e,t){let{__scopeScrollArea:n,...r}=e,i=ih(Ch,n),[a,o]=_.useState(0),[s,c]=_.useState(0),l=!!(a&&s),{onCornerWidthChange:u,onCornerHeightChange:d}=i;return Fh(i.scrollbarX,()=>{let e=i.scrollbarX?.offsetHeight||0;i.onCornerHeightChange(e),c(e)}),Fh(i.scrollbarY,()=>{let e=i.scrollbarY?.offsetWidth||0;i.onCornerWidthChange(e),o(e)}),_.useEffect(()=>()=>{u(0),d(0)},[u,d]),l?(0,V.jsx)(Ki.div,{...r,ref:t,style:{width:a,height:s,position:`absolute`,right:i.dir===`ltr`?0:void 0,left:i.dir===`rtl`?0:void 0,bottom:0,...e.style}}):null},`ScrollAreaCornerImpl`));function Eh(e){return e?parseInt(e,10):0}Qm(Eh,`toInt`);function Dh(e,t){let n=e/t;return isNaN(n)?0:n}Qm(Dh,`getThumbRatio`);function Oh(e){let t=Dh(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}Qm(Oh,`getThumbSize`);function kh(e,t,n,r=`ltr`){let i=Oh(n),a=i/2,o=t||a,s=i-o,c=n.scrollbar.paddingStart+o,l=n.scrollbar.size-n.scrollbar.paddingEnd-s,u=n.content-n.viewport,d=r===`ltr`?[0,u]:[u*-1,0];return jh([c,l],d)(e)}Qm(kh,`getScrollPositionFromPointer`);function Ah(e,t,n=`ltr`){let r=Oh(t),i=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,a=t.scrollbar.size-i,o=t.content-t.viewport,s=a-r,c=Xm(e,n===`ltr`?[0,o]:[o*-1,0]);return jh([0,o],[0,s])(c)}Qm(Ah,`getThumbOffsetFromScroll`);function jh(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];let r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}Qm(jh,`linearScale`);function Mh(e,t){return e>0&&e<t}Qm(Mh,`isScrollingWithinScrollbarBounds`);var Nh=Qm((e,t=()=>{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return Qm((function i(){let a={left:e.scrollLeft,top:e.scrollTop},o=n.left!==a.left,s=n.top!==a.top;(o||s)&&t(),n=a,r=window.requestAnimationFrame(i)}),`loop`)(),()=>window.cancelAnimationFrame(r)},`addUnlinkedScrollListener`);function Ph(e,t){let n=ba(e),r=_.useRef(0);return _.useEffect(()=>()=>window.clearTimeout(r.current),[]),_.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}Qm(Ph,`useDebounceCallback`);function Fh(e,t){let n=ba(t);yi(()=>{let t=0;if(e){let r=new ResizeObserver(()=>{cancelAnimationFrame(t),t=window.requestAnimationFrame(n)});return r.observe(e),()=>{window.cancelAnimationFrame(t),r.unobserve(e)}}},[e,n])}Qm(Fh,`useResizeObserver`);var Ih=ah,Lh=sh,Rh=wh;function zh({className:e,children:t,...n}){return(0,V.jsxs)(Ih,{"data-slot":`scroll-area`,className:B(`relative`,e),...n,children:[(0,V.jsx)(Lh,{"data-slot":`scroll-area-viewport`,className:`focus-visible:ring-ring/50 size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:outline-1`,children:t}),(0,V.jsx)(Bh,{}),(0,V.jsx)(Rh,{})]})}function Bh({className:e,orientation:t=`vertical`,...n}){return(0,V.jsx)(uh,{"data-slot":`scroll-area-scrollbar`,orientation:t,className:B(`flex touch-none p-px transition-colors select-none`,t===`vertical`&&`h-full w-2.5 border-l border-l-transparent`,t===`horizontal`&&`h-2.5 flex-col border-t border-t-transparent`,e),...n,children:(0,V.jsx)(xh,{"data-slot":`scroll-area-thumb`,className:`bg-border relative flex-1 rounded-full`})})}function Vh({open:e=!1,profileId:t=``,onOpenChange:n}){let{t:r}=Cr(),[i,a]=(0,_.useState)(!1),[o,s]=(0,_.useState)([]);(0,_.useEffect)(()=>{e&&t&&c(t)},[e,t]);async function c(e){a(!0),s([]);let t=await Yn(`/api/user-profile/changelog?profileId=${encodeURIComponent(e)}&limit=10`);a(!1),t.success&&t.data?s(t.data):s([])}return(0,V.jsx)($s,{open:e,onOpenChange:n,children:(0,V.jsxs)(nc,{className:`sm:max-w-lg`,children:[(0,V.jsx)(rc,{children:(0,V.jsx)(ac,{children:r(`modal-changelog-title`)})}),(0,V.jsx)(zh,{className:`max-h-80`,children:i?(0,V.jsx)(`div`,{className:`text-sm text-muted-foreground py-6 text-center`,children:r(`loading-changelog`)}):o.length===0?(0,V.jsx)(`div`,{className:`text-sm text-muted-foreground py-6 text-center`,children:r(`empty-changelog`)}):(0,V.jsx)(`div`,{className:`space-y-3 pr-3`,children:o.map((e,t)=>(0,V.jsxs)(`div`,{className:`rounded-lg border border-border p-3 space-y-1`,children:[(0,V.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 text-xs`,children:[(0,V.jsxs)(`span`,{className:`font-medium`,children:[`v`,e.version]}),(0,V.jsx)(`span`,{className:`text-muted-foreground`,children:e.changeType}),(0,V.jsx)(`span`,{className:`text-muted-foreground ml-auto`,children:cd(e.createdAt)})]}),(0,V.jsx)(`p`,{className:`text-sm`,children:e.changeSummary})]},`${e.version}-${t}`))})})]})})}function Hh({open:e=!1,type:t=null,index:n=0,action:r=`edit`,item:i=null,onOpenChange:a,onSaved:o}){let{t:s}=Cr(),[c,l]=(0,_.useState)(``),[u,d]=(0,_.useState)(``),[f,p]=(0,_.useState)([``]),[m,h]=(0,_.useState)(`1`),[g,v]=(0,_.useState)(!1),y=r===`edit`,b=t===`workflows`;(0,_.useEffect)(()=>{e&&i&&(l(i.category||``),d(i.description||``),p(i.steps?.length?[...i.steps]:[``]),h(`1`))},[e,i]);let x=y?s(`btn-edit`)||`Edit Item`:m===`2`?s(`confirm-delete-title`)||`Confirm Delete`:s(`confirm-delete`)||`Delete Item?`;function S(e){a?.(e)}function C(){p(e=>[...e,``])}function w(e){p(t=>{let n=t.filter((t,n)=>n!==e);return n.length===0?[``]:n})}function T(e,t){p(n=>n.map((n,r)=>r===e?t:n))}async function E(e){if(e.preventDefault(),!t)return;if(r===`delete`){if(m===`1`){h(`2`);return}v(!0);let e=await Yn(`/api/user-profile/item`,{method:`PATCH`,headers:{"Content-Type":`application/json`},body:JSON.stringify({type:t,index:n,action:`delete`})});v(!1),e.success?(H.success(s(`toast-delete-success`)||`Item deleted`),S(!1),o?.()):H.error(e.error||s(`toast-delete-failed`)||`Delete failed`);return}v(!0);let i={type:t,index:n,action:`edit`,category:b?void 0:c,description:u};t===`workflows`&&(i.steps=f.map(e=>e.trim()).filter(Boolean));let a=await Yn(`/api/user-profile/item`,{method:`PATCH`,headers:{"Content-Type":`application/json`},body:JSON.stringify(i)});v(!1),a.success?(H.success(s(`toast-update-success`)||`Item updated`),S(!1),o?.()):H.error(a.error||s(`toast-update-failed`)||`Update failed`)}return(0,V.jsx)($s,{open:e,onOpenChange:S,children:(0,V.jsxs)(nc,{className:`sm:max-w-lg`,children:[(0,V.jsx)(rc,{children:(0,V.jsx)(ac,{children:x})}),(0,V.jsxs)(`form`,{className:`space-y-4`,onSubmit:E,children:[y||m===`1`?(0,V.jsxs)(V.Fragment,{children:[b?null:(0,V.jsxs)(`div`,{className:`space-y-2`,children:[(0,V.jsx)(Yu,{htmlFor:`profile-item-category`,children:s(`label-category`)}),(0,V.jsx)(gl,{id:`profile-item-category`,value:c,onChange:e=>l(e.target.value),disabled:!y})]}),(0,V.jsxs)(`div`,{className:`space-y-2`,children:[(0,V.jsx)(Yu,{htmlFor:`profile-item-description`,children:s(`label-description`)}),(0,V.jsx)(Xu,{id:`profile-item-description`,rows:4,value:u,onChange:e=>d(e.target.value),disabled:!y})]}),b&&y?(0,V.jsxs)(`div`,{className:`space-y-2`,children:[(0,V.jsx)(Yu,{children:s(`label-steps`)}),(0,V.jsx)(`div`,{className:`space-y-2`,children:f.map((e,t)=>(0,V.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,V.jsx)(`span`,{className:`text-xs text-muted-foreground w-5 tabular-nums`,children:t+1}),(0,V.jsx)(gl,{value:e,placeholder:`Step ${t+1}...`,onChange:e=>T(t,e.target.value)}),(0,V.jsx)(W,{type:`button`,variant:`ghost`,size:`icon-xs`,onClick:()=>w(t),children:`×`})]},t))}),(0,V.jsx)(W,{type:`button`,variant:`secondary`,size:`sm`,onClick:C,children:s(`btn-add-step`)})]}):null]}):null,(0,V.jsxs)(ic,{children:[(0,V.jsx)(W,{type:`button`,variant:`secondary`,onClick:()=>S(!1),children:s(`btn-cancel`)}),(0,V.jsx)(W,{type:`submit`,variant:y?`default`:`destructive`,disabled:g,children:y?s(`btn-save`)||`Save`:s(`btn-delete`)||`Delete`})]})]})]})})}var Uh=8;function Wh({label:e,children:t,className:n}){let r=_.useId(),i=_.useRef(null),a=_.useRef(null),[o,s]=_.useState(!1),[c,l]=_.useState(0);return _.useEffect(()=>{if(!o)return;let e=e=>{i.current?.contains(e.target)||s(!1)},t=e=>{e.key===`Escape`&&s(!1)};return document.addEventListener(`pointerdown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`pointerdown`,e),document.removeEventListener(`keydown`,t)}},[o]),_.useLayoutEffect(()=>{let e=a.current,t=i.current;if(!o||!e||!t)return;let n=t.getBoundingClientRect(),r=e.offsetWidth/2,s=n.left+n.width/2,c=document.documentElement.clientWidth,u=Math.min(Math.max(s,Uh+r),c-Uh-r);l(u-s)},[o]),(0,V.jsxs)(`span`,{ref:i,className:B(`relative inline-flex`,n),children:[(0,V.jsx)(`button`,{type:`button`,"aria-label":e,"aria-expanded":o,"aria-controls":r,onClick:()=>s(e=>!e),className:`inline-flex size-6 shrink-0 items-center justify-center rounded-full text-muted-foreground transition-colors duration-150 outline-none hover:bg-interactive-hover hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring aria-expanded:bg-selection aria-expanded:text-foreground`,children:(0,V.jsx)(ue,{className:`size-3.5`,"aria-hidden":`true`})}),o?(0,V.jsx)(`div`,{ref:a,id:r,style:{transform:`translateX(calc(-50% + ${c}px))`},className:`absolute top-full left-1/2 z-30 mt-2 w-72 max-w-[calc(100vw-1rem)] rounded-lg border border-border bg-card p-3 text-start text-xs whitespace-normal text-card-foreground shadow-sm`,children:t}):null]})}var Gh=20;function Kh(e,t){let n=e.length,r=Math.max(1,Math.ceil(n/Gh)),i=Math.min(t,r),a=(i-1)*Gh;return{items:e.slice(a,a+Gh),total:n,totalPages:r,page:i,start:a}}function qh(e){return Math.round((e.confidence||0)*100)}function Jh(e){return e.evidence?Array.isArray(e.evidence)?e.evidence.join(`
122
+ `):e.evidence:``}function Yh(e){return e.evidence?Array.isArray(e.evidence)?e.evidence.length:1:0}function Xh({profile:e,loading:t=!1,onRefresh:n,onCleanup:r,onCategoryCleanup:i,categoryCleanupOpen:a=!1}){let{t:o}=Cr(),[s,c]=(0,_.useState)({pref:1,pat:1,wf:1}),[l,u]=(0,_.useState)(!1),[d,f]=(0,_.useState)(!1),[p,m]=(0,_.useState)(null),[h,g]=(0,_.useState)(0),[v,y]=(0,_.useState)(`edit`),[b,x]=(0,_.useState)(null),S=(0,_.useMemo)(()=>{if(!e?.exists||!e.profileData)return null;let t=e.profileData;if(typeof t==`string`)try{t=JSON.parse(t)}catch{return null}return t},[e]),C=(0,_.useMemo)(()=>{let e=[...S?.preferences??[],...S?.patterns??[]];return new Set(e.map(e=>e.category||`General`)).size},[S]),w=(0,_.useMemo)(()=>tl(S?.preferences),[S]),T=(0,_.useMemo)(()=>tl(S?.patterns),[S]),E=(0,_.useMemo)(()=>tl(S?.workflows),[S]),D=(0,_.useMemo)(()=>E.map((e,t)=>({item:e,index:t})).sort((e,t)=>(t.item.frequency||0)-(e.item.frequency||0)),[E]),O=Kh(w,s.pref),te=Kh(T,s.pat),k=Kh(D,s.wf),ne=E.length;function re(e,t,n){let r=(e===`preferences`?w:e===`patterns`?T:E)[t];r&&(m(e),g(t),y(n),x(r),f(!0))}function ie(e,t){return e.indexOf(t)}function ae({page:e,pageKey:t}){return e.total<=Gh?null:(0,V.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5 pt-2`,children:[(0,V.jsxs)(`span`,{className:`text-xs text-muted-foreground me-2`,children:[e.start+1,`-`,Math.min(e.start+Gh,e.total),` / `,e.total]}),Array.from({length:e.totalPages},(e,t)=>t+1).map(n=>(0,V.jsx)(W,{size:`xs`,variant:n===e.page?`default`:`outline`,onClick:()=>c(e=>({...e,[t]:n})),children:n},n))]})}function A({item:e,type:t,fullList:n}){let r=ie(n,e),i=qh(e);return(0,V.jsxs)(`div`,{className:`min-w-0 rounded-xl border border-border bg-card p-4 space-y-3`,children:[(0,V.jsxs)(`div`,{className:`flex flex-wrap items-start gap-2`,children:[t!==`workflows`||e.category?(0,V.jsx)(hl,{variant:`outline`,className:`bg-transparent border-current [color:oklch(0.42_0.13_var(--category-hue))] dark:[color:oklch(0.8_0.13_var(--category-hue))]`,style:{"--category-hue":String(fl(e.category||`General`))},children:e.category||`General`}):null,(0,V.jsxs)(`div`,{className:`flex items-center gap-0.5 ms-auto`,children:[(0,V.jsx)(W,{variant:`ghost`,size:`icon-xs`,title:o(`btn-edit`)||`Edit`,onClick:()=>re(t,r,`edit`),children:(0,V.jsx)(be,{className:`size-3`})}),(0,V.jsx)(W,{variant:`ghost`,size:`icon-xs`,title:o(`btn-delete`)||`Delete`,onClick:()=>re(t,r,`delete`),children:(0,V.jsx)(Ne,{className:`size-3`})})]}),(0,V.jsxs)(`div`,{className:B(`shrink-0 rounded-md border px-1.5 py-0.5 text-xs font-medium tabular-nums`,al[il(i)]),title:`${o(`label-confidence`)}: ${i}%`,children:[i,`%`]})]}),(0,V.jsx)(`p`,{className:`text-sm break-words`,children:e.description||``}),e.steps?.length?(0,V.jsx)(`ol`,{className:`flex flex-col items-start gap-1.5`,children:e.steps.map((e,t)=>(0,V.jsxs)(`li`,{className:`flex min-w-0 max-w-full items-start gap-2 rounded-2xl border border-blue-600/40 bg-blue-500/15 py-1 ps-1 pe-3 text-xs leading-5 text-blue-700 dark:text-blue-400`,children:[(0,V.jsx)(`span`,{className:`flex size-5 shrink-0 items-center justify-center rounded-full bg-blue-500/30 text-[11px] font-medium tabular-nums dark:bg-blue-400/30`,children:t+1}),(0,V.jsx)(`span`,{className:`min-w-0 break-words`,children:e})]},t))}):null,e.evidence||e.frequency?(0,V.jsxs)(`div`,{className:`flex items-center gap-1.5 text-xs text-muted-foreground`,children:[(0,V.jsxs)(`span`,{className:`inline-flex items-center gap-1`,title:o(`label-evidence-tooltip`,{count:e.frequency||1}),children:[(0,V.jsx)(Me,{className:`size-3`}),e.frequency||1]}),Yh(e)>0?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`span`,{children:`·`}),(0,V.jsxs)(`span`,{className:`inline-flex items-center gap-1`,title:Jh(e),children:[(0,V.jsx)(ue,{className:`size-3`}),Yh(e),` evidence`]})]}):null]}):null]})}return t&&!e?(0,V.jsx)(`div`,{className:`text-sm text-muted-foreground py-8 text-center`,children:o(`loading-profile`)}):e?.exists?S?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(`div`,{className:`space-y-8`,children:[(0,V.jsxs)(`div`,{className:`space-y-3`,children:[(0,V.jsx)(`h2`,{dir:`auto`,className:`text-section-title font-semibold break-words`,children:e.displayName||e.userId}),(0,V.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,V.jsxs)(`span`,{className:`rounded-full bg-muted px-2.5 py-1 text-xs`,children:[(0,V.jsx)(`span`,{className:`text-muted-foreground`,children:o(`profile-version`)}),(0,V.jsx)(`span`,{className:`ms-1 font-mono`,children:e.version})]}),(0,V.jsxs)(`span`,{className:`rounded-full bg-muted px-2.5 py-1 text-xs`,children:[(0,V.jsx)(`span`,{className:`text-muted-foreground`,children:o(`profile-prompts`)}),(0,V.jsx)(`span`,{className:`ms-1 font-mono`,children:e.totalPromptsAnalyzed})]}),(0,V.jsxs)(`span`,{className:`rounded-full bg-muted px-2.5 py-1 text-xs`,children:[(0,V.jsx)(`span`,{className:`text-muted-foreground`,children:o(`profile-updated`)}),(0,V.jsx)(`span`,{className:`ms-1`,children:e.lastAnalyzedAt?cd(e.lastAnalyzedAt):`—`})]}),(0,V.jsxs)(`div`,{className:`ms-auto flex flex-wrap items-center gap-1.5`,children:[(0,V.jsxs)(`span`,{className:`inline-flex items-center gap-0.5`,children:[(0,V.jsxs)(W,{variant:`outline`,size:`sm`,onClick:()=>r?.(),children:[(0,V.jsx)(ke,{className:`size-3.5`}),o(`btn-ai-cleanup`)]}),(0,V.jsx)(Wh,{label:o(`label-more-info`),children:o(`help-ai-cleanup`)})]}),(0,V.jsxs)(`span`,{className:`inline-flex items-center gap-0.5`,children:[(0,V.jsxs)(W,{variant:`outline`,size:`sm`,onClick:()=>i?.(),children:[(0,V.jsx)(je,{className:`size-3.5`}),o(`btn-category-cleanup`),(0,V.jsx)(`span`,{className:`font-mono opacity-70`,title:o(`label-category-count-title`),children:C})]}),(0,V.jsx)(Wh,{label:o(`label-more-info`),children:o(`help-category-cleanup`)})]}),(0,V.jsx)(Fm,{version:e.version,onUndone:n}),(0,V.jsxs)(W,{variant:`secondary`,size:`sm`,onClick:()=>n?.(),children:[(0,V.jsx)(Te,{className:`size-3.5`}),o(`btn-refresh`)]}),(0,V.jsxs)(W,{variant:`secondary`,size:`sm`,onClick:()=>u(!0),children:[(0,V.jsx)(Ee,{className:`size-3.5`}),`History`]})]})]}),(0,V.jsx)(Um,{paused:a,onOpen:()=>i?.()})]}),(0,V.jsxs)(`div`,{className:`grid gap-8`,children:[(0,V.jsxs)(`section`,{id:`profile-preferences`,className:`scroll-mt-4 space-y-3`,children:[(0,V.jsxs)(`h2`,{className:`flex flex-wrap items-center gap-2 text-section-title font-semibold`,children:[(0,V.jsx)(le,{className:`size-4`}),o(`profile-preferences`),(0,V.jsx)(`span`,{className:`text-xs font-normal text-muted-foreground`,children:w.length})]}),w.length===0?(0,V.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:o(`empty-preferences`)}):(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`div`,{className:`grid gap-3 sm:grid-cols-2 lg:grid-cols-3`,children:O.items.map(e=>(0,V.jsx)(A,{item:e,type:`preferences`,fullList:w},ie(w,e)))}),(0,V.jsx)(ae,{page:O,pageKey:`pref`})]})]}),(0,V.jsxs)(`section`,{id:`profile-patterns`,className:`scroll-mt-4 space-y-3`,children:[(0,V.jsxs)(`h2`,{className:`flex flex-wrap items-center gap-2 text-section-title font-semibold`,children:[(0,V.jsx)(ee,{className:`size-4`}),o(`profile-patterns`),(0,V.jsx)(`span`,{className:`text-xs font-normal text-muted-foreground`,children:T.length})]}),T.length===0?(0,V.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:o(`empty-patterns`)}):(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`div`,{className:`grid gap-3 sm:grid-cols-2 lg:grid-cols-3`,children:te.items.map(e=>(0,V.jsx)(A,{item:e,type:`patterns`,fullList:T},ie(T,e)))}),(0,V.jsx)(ae,{page:te,pageKey:`pat`})]})]}),(0,V.jsxs)(`section`,{id:`profile-workflows`,className:`scroll-mt-4 space-y-3`,children:[(0,V.jsxs)(`h2`,{className:`flex flex-wrap items-center gap-2 text-section-title font-semibold`,children:[(0,V.jsx)(ze,{className:`size-4`}),o(`profile-workflows`),(0,V.jsx)(`span`,{className:`text-xs font-normal text-muted-foreground`,children:ne})]}),ne===0?(0,V.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:o(`empty-workflows`)}):(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`div`,{className:`grid items-start gap-3 lg:grid-cols-2`,children:k.items.map(e=>(0,V.jsx)(A,{item:e.item,type:`workflows`,fullList:E},e.index))}),(0,V.jsx)(ae,{page:k,pageKey:`wf`})]})]})]})]}),(0,V.jsx)(Vh,{open:l,onOpenChange:u,profileId:e?.id||``}),(0,V.jsx)(Hh,{open:d,onOpenChange:f,type:p,index:h,action:v,item:b,onSaved:n})]}):null:(0,V.jsxs)(`div`,{className:`flex flex-col items-center gap-2 py-10 text-muted-foreground`,children:[(0,V.jsx)(Le,{className:`size-8`}),(0,V.jsx)(`p`,{className:`text-sm`,children:e?.message||o(`empty-preferences`)})]})}function Zh({open:e=!1,count:t=0,onOpenChange:n,onComplete:r}){let{t:i}=Cr(),[a,o]=(0,_.useState)(!1),[s,c]=(0,_.useState)(``),[l,u]=(0,_.useState)(0);(0,_.useEffect)(()=>{e&&!a&&(c(i(`migration-found-tags`,{count:t})),u(0))},[e,a,t,i]);function d(e){a&&!e||n?.(e)}async function f(){o(!0),c(i(`status-migration-init`)),u(0);let e=!0,t=0,n=1e3;for(;e&&t<n;){t++;let n=await Yn(`/api/migration/tags/run-batch`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({batchSize:3})});if(!n.success||!n.data){c(i(`toast-migration-failed`)+`: `+(n.error||``)),o(!1);return}let r=n.data.processed;e=n.data.hasMore;let a=n.data.total;u(a>0?Math.round(r/a*100):0),c(i(`status-migration-progress`,{current:r,total:a})),e&&await new Promise(e=>setTimeout(e,100))}if(t>=n){c(i(`migration-stopped`)),o(!1);return}u(100),c(i(`toast-migration-success`)),H.success(i(`toast-migration-success`)),setTimeout(()=>{o(!1),d(!1),r?.()},2e3)}return(0,V.jsx)($s,{open:e,onOpenChange:d,children:(0,V.jsxs)(nc,{className:`sm:max-w-md`,showCloseButton:!a,children:[(0,V.jsx)(rc,{children:(0,V.jsx)(ac,{children:i(`modal-migration-title`)})}),(0,V.jsxs)(`div`,{className:`space-y-3`,children:[(0,V.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:s}),(0,V.jsx)(`div`,{className:`h-2 rounded-full bg-muted overflow-hidden`,children:(0,V.jsx)(`div`,{className:`h-full bg-primary transition-all duration-200`,style:{width:`${l}%`}})}),(0,V.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:i(`migration-note`)})]}),a?null:(0,V.jsx)(ic,{children:(0,V.jsxs)(W,{onClick:f,children:[(0,V.jsx)(Se,{className:`size-3.5`}),i(`btn-start-migration`)]})})]})})}var Qh=[{id:`settings-section-external-api`,title:`External API`},{id:`settings-section-models`,title:`Models`},{id:`settings-section-embedding`,title:`Embedding`},{id:`settings-section-keys`,title:`Keys and access`},{id:`settings-section-diagnostics`,title:`Capture diagnostics`},{id:`settings-section-health`,title:`Health`},{id:`settings-section-claude-folder`,title:`Claude Code folder`},{id:`settings-section-capture-language`,title:`Memory language`},{id:`settings-section-profiles`,title:`Profiles`},{id:`settings-section-web-app`,title:`Web app`},{id:`settings-section-log`,title:`Log`}],$h=class extends Error{status;constructor(e,t){super(e),this.name=`SettingsRequestError`,this.status=t}};async function Q(e,t={}){let n=(t.method??`GET`).toUpperCase(),r=n!==`GET`&&n!==`HEAD`,i=await fetch(e,{...t,headers:{"x-omms-token":window.__OMMS_TOKEN__??``,...r||t.body?{"Content-Type":`application/json`}:{},...t.headers}}),a=await i.json();if(!i.ok)throw new $h(a.error??`Request failed (${i.status})`,i.status);return a}var eg=new Set,tg=0;function ng(e){tg++;for(let t of eg)t(e)}function rg(){let e=tg;return{isCurrent:()=>tg===e}}async function ig(){try{let e=await Q(`/api/settings`);return ng(e),e}catch{return null}}function ag(e){return eg.add(e),()=>{eg.delete(e)}}function og(e,t){return`${e.replace(/\.+$/,``)}. ${t}`}function sg(){let e=0;return{begin(){let t=++e;return()=>t===e}}}async function cg(e,t){e(!0);try{return await t()}finally{e(!1)}}var lg={"Import chat history":[`导入聊天记录`,`استيراد سجل المحادثات`],"Memory limits":[`记忆限制`,`حدود الذاكرة`],"Resolve missing project folders":[`解析缺失的项目文件夹`,`حل مجلدات المشاريع المفقودة`],"Project memories":[`项目记忆`,`ذاكرة المشروع`],"User profile":[`用户画像`,`الملف الشخصي للمستخدم`],"(preferences, patterns, and workflows)":[`(偏好、模式和工作流程)`,`(التفضيلات والأنماط وسير العمل)`],"All hosts":[`所有宿主`,`جميع المضيفين`],"Selected hosts":[`已选宿主`,`المضيفون المحددون`],"Choose at least one output.":[`请至少选择一项输出。`,`اختر مخرجاً واحداً على الأقل.`],"Choose at least one host.":[`请至少选择一个宿主。`,`اختر مضيفاً واحداً على الأقل.`],"Re-analyse handled history":[`重新分析已处理的记录`,`إعادة تحليل السجل المعالج`],"Re-analysis applies to the selected outputs. Each profile prompt can be forcibly re-analysed once. Findings merge into the existing profile.":[`重新分析适用于所选输出。每条画像提示只能强制重新分析一次。结果合并到现有画像中。`,`تنطبق إعادة التحليل على المخرجات المحددة. يمكن إعادة تحليل كل مطالبة للملف الشخصي بالقوة مرة واحدة. تُدمج النتائج في الملف الحالي.`],"Preview the current selection before starting an import.":[`开始导入前,请预览当前选择。`,`عاين الاختيار الحالي قبل بدء الاستيراد.`],"This import makes model calls. Continue?":[`此次导入会调用模型。是否继续?`,`سيجري هذا الاستيراد اتصالات بالنموذج. هل تريد المتابعة؟`],"Conversations populate project facts. User prompts populate personal preferences, recurring patterns, and workflow steps.":[`对话生成项目事实。用户提示生成个人偏好、重复模式和工作流程步骤。`,`تضيف المحادثات حقائق المشروع. وتضيف مطالبات المستخدم التفضيلات الشخصية والأنماط المتكررة وخطوات سير العمل.`],"Profile identity in Settings":[`设置中的画像身份`,`هوية الملف الشخصي في الإعدادات`],"Hosts keep their existing user identities. All hosts does not merge profiles with different identities.":[`各宿主保留现有用户身份。选择所有宿主不会合并不同身份的画像。`,`يحتفظ المضيفون بهويات المستخدم الحالية. اختيار جميع المضيفين لا يدمج ملفات الهويات المختلفة.`],"Pi session reader is unavailable. Fix the reader or deselect Pi.":[`Pi 会话读取器不可用。请修复读取器或取消选择 Pi。`,`قارئ جلسات Pi غير متاح. أصلح القارئ أو ألغِ تحديد Pi.`],"Import results":[`导入结果`,`نتائج الاستيراد`],"Memory work failed.":[`记忆处理失败。`,`فشلت معالجة الذاكرة.`],"Profile learning failed.":[`画像学习失败。`,`فشل تعلّم الملف الشخصي.`],"Import preparation failed.":[`导入准备失败。`,`فشل تحضير الاستيراد.`],"Refresh the preview and retry.":[`请刷新预览后重试。`,`حدّث المعاينة ثم أعد المحاولة.`],"The session list is out of date. Refresh the list and try again.":[`会话列表已过期。请刷新列表后重试。`,`قائمة الجلسات قديمة. حدّث القائمة ثم أعد المحاولة.`],"The history source changed. Choose it again.":[`历史记录来源已更改。请重新选择。`,`تغيّر مصدر السجل. اختره مجدداً.`],"The history source is no longer valid. Choose it again.":[`历史记录来源已失效。请重新选择。`,`لم يعد مصدر السجل صالحاً. اختره مجدداً.`],"A Pi import is already running":[`已有 Pi 导入正在运行`,`استيراد Pi قيد التشغيل بالفعل`],"An OpenCode import is already running":[`已有 OpenCode 导入正在运行`,`استيراد OpenCode قيد التشغيل بالفعل`],"A Claude Code import is already running":[`已有 Claude Code 导入正在运行`,`استيراد Claude Code قيد التشغيل بالفعل`],"Combined counts":[`合计数量`,`الأعداد المجمعة`],"Current host":[`当前宿主`,`المضيف الحالي`],"Memory extraction":[`提取记忆`,`استخراج الذاكرة`],"Memory units":[`记忆单元`,`وحدات الذاكرة`],"Pending memory units":[`待处理记忆单元`,`وحدات الذاكرة المعلقة`],"Imported memory units":[`已导入记忆单元`,`وحدات الذاكرة المستوردة`],"Already handled memory units":[`已处理记忆单元`,`وحدات الذاكرة المعالجة سابقاً`],"Skipped memory units":[`已跳过记忆单元`,`وحدات الذاكرة المتخطاة`],"Failed memory units":[`失败的记忆单元`,`وحدات الذاكرة التي فشلت`],"Held-back turns":[`暂缓处理的轮次`,`الرسائل المؤجلة`],"Untimed turns":[`无时间戳的轮次`,`الرسائل بلا طابع زمني`],"Load errors":[`加载错误`,`أخطاء التحميل`],"Already handled profile prompts":[`已处理画像提示`,`مطالبات الملف الشخصي المعالجة سابقاً`],"Profile prompts":[`画像提示`,`مطالبات الملف الشخصي`],"Profile batches":[`画像批次`,`دفعات الملف الشخصي`],"Estimated profile analysis calls":[`预计画像分析调用次数`,`اتصالات تحليل الملف الشخصي المقدّرة`],"Waiting prompts inside OMMS":[`OMMS 内等待处理的提示`,`المطالبات المنتظرة داخل OMMS`],"No work to process":[`没有待处理工作`,`لا يوجد عمل للمعالجة`],queued:[`排队中`,`في الانتظار`],preparing:[`准备中`,`جارٍ التحضير`],"not-run":[`未运行`,`لم يُشغّل`],"Automatic profile cleanup":[`自动整理画像`,`التنظيف التلقائي للملف الشخصي`],"After a learning pass, OMMS merges duplicate profile items and removes vague ones by itself, in the background. Each run makes about one model call for every 100 items and takes several minutes on a large profile. Undo last automatic cleanup on the Profile page puts the changes back.":[`学习完成后,OMMS 会在后台自动合并重复的画像条目,并删除含糊的条目。每次运行大约每 100 个条目调用一次模型,在大型画像上需要几分钟。在“用户画像”页面选择“撤销上次自动整理”可恢复这些更改。`,`بعد كل جولة تعلّم، يدمج OMMS عناصر الملف الشخصي المكررة ويحذف العناصر الغامضة تلقائياً في الخلفية. تجري كل عملية نحو اتصال واحد بالنموذج لكل 100 عنصر وتستغرق عدة دقائق على الملف الكبير. يعيد خيار «تراجع عن آخر تنظيف تلقائي» في صفحة الملف الشخصي التغييرات.`],"Clean up the profile automatically":[`自动整理画像`,`تنظيف الملف الشخصي تلقائياً`],"Run every this many analysed prompts":[`每隔多少条已分析的提示运行一次`,`التشغيل كل عدد من المطالبات المحللة`],"Save interval":[`保存间隔`,`حفظ الفاصل`],"Enter a whole number from 50 to 100000.":[`请输入 50 到 100000 之间的整数。`,`أدخل عدداً صحيحاً من 50 إلى 100000.`],"Saved. Changes apply at the next learning pass.":[`已保存。更改将在下一次学习时生效。`,`تم الحفظ. تنطبق التغييرات في جولة التعلّم التالية.`],"Analyse waiting prompts":[`分析等待处理的提示`,`تحليل المطالبات المنتظرة`],"Re-analyse chat history":[`重新分析聊天记录`,`إعادة تحليل سجل المحادثات`],"Analyse waiting prompts reads prompts already inside OMMS with the saved external API, 50 eligible prompts per analysis call. Completed history is not re-analysed. Preferences, patterns, and workflows are the outputs.":[`分析等待处理的提示使用已保存的外部 API,读取 OMMS 内已有的提示,每次分析调用处理 50 条符合条件的提示。不会重新分析已完成的历史记录。输出包括偏好、模式和工作流程。`,`يقرأ تحليل المطالبات المنتظرة المطالبات الموجودة داخل OMMS عبر واجهة API الخارجية المحفوظة، بمعدل 50 مطالبة مؤهلة لكل اتصال تحليل. لا يُعاد تحليل السجل المكتمل. المخرجات هي التفضيلات والأنماط وسير العمل.`],"Analysis calls are an estimate. Matching, deduplication, retries, and newly waiting prompts can add calls.":[`分析调用次数为估计值。匹配、去重、重试和新增的等待提示可能增加调用次数。`,`اتصالات التحليل تقديرية. قد تضيف المطابقة وإزالة التكرار وإعادة المحاولة والمطالبات المنتظرة الجديدة اتصالات أخرى.`],"Re-analyse chat history opens a forced profile-only import. It preserves your profile and project memories. Preview and confirmation are required. Each profile prompt can be forcibly re-analysed once.":[`重新分析聊天记录会打开强制仅导入画像的流程。现有画像和项目记忆将保留。必须先预览并确认。每条画像提示只能强制重新分析一次。`,`تفتح إعادة تحليل سجل المحادثات استيراداً قسرياً للملف الشخصي فقط. تُحفظ ذاكرة المشروع وملفك الشخصي. تلزم المعاينة والتأكيد. يمكن إعادة تحليل كل مطالبة للملف الشخصي بالقوة مرة واحدة.`],"Automatic import reads older conversations when a host starts. It populates project memories and user profile input. The first backfill fixes a cutoff; later turns use live capture.":[`自动导入在宿主启动时读取较早的对话,填充项目记忆和用户画像输入。首次回填固定截止时间,之后的轮次使用实时捕获。`,`يقرأ الاستيراد التلقائي المحادثات الأقدم عند بدء المضيف. ويضيف ذاكرة المشروع ومدخلات الملف الشخصي. يثبت أول استيراد تاريخاً فاصلاً؛ وتستخدم الرسائل اللاحقة الالتقاط المباشر.`],"A directory map links a recorded project folder to its current folder. Saved maps apply globally to every host at the next import or backfill run. Review changes before saving.":[`目录映射将记录的项目文件夹链接到当前文件夹。保存的映射在下次导入或回填时全局应用于所有宿主。保存前请检查更改。`,`تربط خريطة المجلدات مجلد المشروع المسجل بمجلده الحالي. تنطبق الخرائط المحفوظة على جميع المضيفين في الاستيراد التالي. راجع التغييرات قبل الحفظ.`],"Prompt date from must not be after Prompt date to.":[`提示开始日期不能晚于结束日期。`,`يجب ألا يأتي تاريخ بدء المطالبات بعد تاريخ انتهائها.`],"Profile batch size must be a positive integer.":[`画像批次大小必须为正整数。`,`يجب أن يكون حجم دفعة الملف الشخصي عدداً صحيحاً موجباً.`],Models:[`模型`,`النماذج`],"External API fallback":[`外部 API 备用模型`,`النموذج الاحتياطي عبر واجهة API الخارجية`],none:[`无`,`لا يوجد`],ready:[`就绪`,`جاهز`],"not ready":[`未就绪`,`غير جاهز`],"Credentials (values hidden)":[`凭据(不显示内容)`,`بيانات الاعتماد (القيم مخفية)`],set:[`已设置`,`مضبوط`],"not set":[`未设置`,`غير مضبوط`],"Effective model":[`当前使用模型`,`النموذج المستخدم`],session:[`会话`,`الجلسة`],"external API":[`外部 API`,`واجهة API الخارجية`],unavailable:[`不可用`,`غير متاح`],"Project override is active. Changes to the global file may not take effect here.":[`项目设置优先。全局文件的更改可能不会在此生效。`,`إعدادات المشروع لها الأولوية. قد لا تسري تغييرات الملف العام هنا.`],"Model choice":[`模型选择`,`اختيار النموذج`],"Session model":[`会话模型`,`نموذج الجلسة`],"Manual model":[`手动选择模型`,`اختيار النموذج يدوياً`],"Manual provider/model":[`手动输入提供商/模型`,`إدخال المزوّد/النموذج يدوياً`],"Model list unavailable. Enter provider/model manually.":[`模型列表不可用。请手动输入提供商/模型。`,`قائمة النماذج غير متاحة. أدخل المزوّد/النموذج يدوياً.`],"OpenCode model list unavailable":[`OpenCode 模型列表不可用`,`قائمة نماذج OpenCode غير متاحة`],"OMMS could not find OpenCode on this computer, so it cannot list OpenCode's models here. Type the model as provider/model, for example zai-coding-plan/glm-5.3. If OpenCode is installed, open an OpenCode session and reload this page.":[`OMMS 在这台电脑上找不到 OpenCode,因此无法在此列出 OpenCode 的模型。请按 提供商/模型 格式输入模型,例如 zai-coding-plan/glm-5.3。如果已安装 OpenCode,请打开一个 OpenCode 会话,然后重新加载此页面。`,`لم يعثر OMMS على OpenCode في هذا الحاسوب، لذا لا يمكنه عرض نماذج OpenCode هنا. أدخل النموذج بصيغة المزوّد/النموذج، مثل zai-coding-plan/glm-5.3. إذا كان OpenCode مثبتاً، فافتح جلسة OpenCode ثم أعد تحميل هذه الصفحة.`],"OpenCode took too long to send its model list. Reload this page to try again, or type the model as provider/model.":[`OpenCode 发送模型列表的时间过长。请重新加载此页面重试,或按 提供商/模型 格式输入模型。`,`استغرق OpenCode وقتاً طويلاً لإرسال قائمة نماذجه. أعد تحميل هذه الصفحة للمحاولة مرة أخرى، أو أدخل النموذج بصيغة المزوّد/النموذج.`],"OpenCode has no signed-in models. Run `opencode auth login`, then reload this page.":["OpenCode 没有已登录的模型。请运行 `opencode auth login`,然后重新加载此页面。","لا توجد في OpenCode نماذج مسجَّل الدخول إليها. شغّل `opencode auth login` ثم أعد تحميل هذه الصفحة."],"This OpenCode version sent a model list OMMS cannot read. Type the model as provider/model. Update OMMS if this continues.":[`此版本的 OpenCode 发送的模型列表 OMMS 无法读取。请按 提供商/模型 格式输入模型。如果问题持续,请更新 OMMS。`,`أرسل هذا الإصدار من OpenCode قائمة نماذج لا يستطيع OMMS قراءتها. أدخل النموذج بصيغة المزوّد/النموذج. حدّث OMMS إذا استمرت المشكلة.`],"OMMS could not read Pi's model list. Type the model as provider/model.":[`OMMS 无法读取 Pi 的模型列表。请按 提供商/模型 格式输入模型。`,`تعذّر على OMMS قراءة قائمة نماذج Pi. أدخل النموذج بصيغة المزوّد/النموذج.`],"Pi has no signed-in models. Sign in to a provider in Pi, then reload this page.":[`Pi 没有已登录的模型。请在 Pi 中登录一个提供商,然后重新加载此页面。`,`لا توجد في Pi نماذج مسجَّل الدخول إليها. سجّل الدخول إلى مزوّد في Pi ثم أعد تحميل هذه الصفحة.`],"Save model":[`保存模型`,`حفظ النموذج`],"Enter a model as provider/model.":[`按 提供商/模型 格式输入。`,`أدخل النموذج بصيغة المزوّد/النموذج.`],"Saved. New capture and profile work uses these settings.":[`已保存。下一次捕获和用户画像将使用这些设置。`,`تم الحفظ. ستستخدم عمليات الالتقاط والملف الشخصي الجديدة هذه الإعدادات.`],"Saved. OMMS now reads ~/.config/omms/omms.jsonc. The legacy config was kept.":[`已保存。OMMS 现在读取 ~/.config/omms/omms.jsonc,旧配置保留。`,`تم الحفظ. يقرأ OMMS الآن الملف ~/.config/omms/omms.jsonc مع الاحتفاظ بالإعدادات القديمة.`],"Current settings were reloaded; check the values and save again.":[`已重新加载当前设置;检查数值后再次保存。`,`أُعيد تحميل الإعدادات الحالية. راجع القيم ثم احفظ مجدداً.`],"Capture diagnostics":[`捕获诊断`,`تشخيص الالتقاط`],"Time range":[`时间范围`,`الفترة الزمنية`],"24 hours":[`24 小时`,`24 ساعة`],"7 days":[`7 天`,`7 أيام`],"30 days":[`30 天`,`30 يوماً`],"90 days":[`90 天`,`90 يوماً`],"Host / model":[`主机 / 模型`,`المضيف / النموذج`],Saved:[`已保存`,`محفوظ`],Skipped:[`已跳过`,`متجاوز`],Failed:[`失败`,`فشل`],Total:[`总数`,`المجموع`],"Failure reasons":[`失败原因`,`أسباب الفشل`],"Recent attempts":[`最近尝试`,`المحاولات الأخيرة`],Time:[`时间`,`الوقت`],Host:[`主机`,`المضيف`],Source:[`来源`,`المصدر`],Session:[`会话`,`الجلسة`],Path:[`路径`,`المسار`],Model:[`模型`,`النموذج`],Stop:[`结束原因`,`سبب التوقف`],Blocks:[`区块`,`الكتل`],Prompt:[`提示词长度`,`طول الطلب`],Reply:[`回复长度`,`طول الرد`],Duration:[`耗时`,`المدة`],Outcome:[`结果`,`النتيجة`],Reason:[`原因`,`السبب`],"Save capture traces":[`保存捕获追踪`,`حفظ تتبعات الالتقاط`],"Traces can contain conversation content after redaction. Keep tracing off unless you need it for debugging.":[`追踪文件在脱敏后仍可能包含对话内容。仅在调试时开启。`,`قد تحتوي التتبعات على محتوى المحادثة بعد التنقيح. فعّلها عند التصحيح فقط.`],"This project turns tracing off. The global switch cannot turn it on here.":[`此项目已关闭追踪。全局开关无法在此开启。`,`أوقف هذا المشروع التتبع. لا يمكن للمفتاح العام تفعيله هنا.`],"Trace retention (days)":[`追踪保留天数`,`مدة حفظ التتبعات (بالأيام)`],"Attempt retention (days)":[`尝试记录保留天数`,`مدة حفظ المحاولات (بالأيام)`],"Retry retention (hours)":[`重试保留小时数`,`مدة حفظ إعادة المحاولة (بالساعات)`],"When the capture model cannot be reached, OMMS keeps the turn and tries again later. Queued turns can hold conversation content after redaction. 0 turns the queue off and deletes waiting turns.":[`捕获模型无法访问时,OMMS 会保留该轮对话并稍后重试。排队的对话在脱敏后仍可能包含对话内容。设为 0 会关闭队列并删除等待中的对话。`,`عندما يتعذر الوصول إلى نموذج الالتقاط، يحتفظ OMMS بالجولة ويعيد المحاولة لاحقاً. قد تحتوي الجولات المنتظرة على محتوى المحادثة بعد التنقيح. القيمة 0 توقف قائمة الانتظار وتحذف الجولات المنتظرة.`],"Turns waiting for retry":[`等待重试的对话`,`الجولات المنتظرة لإعادة المحاولة`],"Retry now":[`立即重试`,`أعد المحاولة الآن`],"Retrying now.":[`正在重试。`,`تجري إعادة المحاولة الآن.`],"A retry is already running.":[`重试已在运行。`,`إعادة المحاولة قيد التشغيل بالفعل.`],"These turns retry at the next Pi session start.":[`这些对话将在下次启动 Pi 会话时重试。`,`ستُعاد محاولة هذه الجولات عند بدء جلسة Pi التالية.`],"These turns retry at the next OpenCode session start.":[`这些对话将在下次启动 OpenCode 会话时重试。`,`ستُعاد محاولة هذه الجولات عند بدء جلسة OpenCode التالية.`],"These turns retry at the next Claude Code session start.":[`这些对话将在下次启动 Claude Code 会话时重试。`,`ستُعاد محاولة هذه الجولات عند بدء جلسة Claude Code التالية.`],"Claude Code capture uses the external API.":[`Claude Code 捕获使用外部 API。`,`يستخدم التقاط Claude Code واجهة API الخارجية.`],"Claude Code capture is off. Complete the external API settings.":[`Claude Code 捕获已关闭。请完成外部 API 设置。`,`التقاط Claude Code متوقف. أكمل إعدادات واجهة API الخارجية.`],"Missing settings":[`缺少的设置`,`الإعدادات الناقصة`],"memoryModel is not configured":[`未配置 memoryModel`,`لم يُضبط memoryModel`],"memoryApiUrl is not configured":[`未配置 memoryApiUrl`,`لم يُضبط memoryApiUrl`],"memoryApiKey is not configured":[`未配置 memoryApiKey`,`لم يُضبط memoryApiKey`],"memoryApiKey contains a placeholder value":[`memoryApiKey 包含占位值`,`يحتوي memoryApiKey على قيمة نائبة`],"Claude Code backfill always uses the external API. It has no backfill model setting.":[`Claude Code 回填始终使用外部 API,没有回填模型设置。`,`يستخدم استيراد Claude Code دائماً واجهة API الخارجية، ولا يوجد له إعداد لنموذج الاستيراد.`],"Claude Code transcripts folder":[`Claude Code 对话记录文件夹`,`مجلد سجلات محادثات Claude Code`],"Claude Code transcripts":[`Claude Code 对话记录`,`سجلات محادثات Claude Code`],found:[`已找到`,`موجود`],"not found":[`未找到`,`غير موجود`],"Claude Code imports always use the external API.":[`Claude Code 导入始终使用外部 API。`,`يستخدم استيراد Claude Code دائماً واجهة API الخارجية.`],"Claude Code imports use the external API. Complete the external API settings.":[`Claude Code 导入使用外部 API。请完成外部 API 设置。`,`يستخدم استيراد Claude Code واجهة API الخارجية. أكمل إعدادات واجهة API الخارجية.`],"Trace files":[`追踪文件`,`ملفات التتبع`],View:[`查看`,`عرض`],Delete:[`删除`,`حذف`],Health:[`健康检查`,`فحص الحالة`],"Config files":[`配置文件`,`ملفات الإعدادات`],"Memory store":[`记忆存储`,`مخزن الذاكرة`],Embedding:[`嵌入模型`,`نموذج التضمين`],"Web binding":[`网页服务绑定`,`ربط خادم الويب`],"OpenCode model":[`OpenCode 模型`,`نموذج OpenCode`],"Pi model":[`Pi 模型`,`نموذج Pi`],"Capture failures (24 hours)":[`捕获失败(24 小时)`,`فشل الالتقاط (24 ساعة)`],"OpenCode model test":[`OpenCode 模型测试`,`اختبار نموذج OpenCode`],"Pi model test":[`Pi 模型测试`,`اختبار نموذج Pi`],"Run checks":[`运行检查`,`تشغيل الفحوصات`],"Run checks and test models":[`运行检查并测试模型`,`تشغيل الفحوصات واختبار النماذج`],"Checking…":[`正在检查…`,`جارٍ الفحص…`],pass:[`通过`,`نجاح`],warn:[`警告`,`تحذير`],fail:[`失败`,`فشل`],"Import and backfill":[`导入和回填`,`الاستيراد والاستكمال`],"Automatic import":[`自动导入`,`الاستيراد التلقائي`],"Automatic import makes model calls. Changes apply at the next host start. Turning it off stops a running import after the current exchange.":[`自动导入会调用模型。更改在下次启动主机时生效。关闭后,正在运行的导入将在当前轮次结束后停止。`,`يستدعي الاستيراد التلقائي النموذج. تسري التغييرات عند بدء المضيف التالي. يوقف التعطيل الاستيراد بعد التبادل الحالي.`],"Import past chats automatically":[`自动导入过去的对话`,`استيراد المحادثات السابقة تلقائياً`],"Backfill model":[`历史导入模型`,`نموذج استيراد السجل`],"Same as live capture":[`与实时捕获相同`,`مثل الالتقاط المباشر`],"Saved. Changes apply at the next host start.":[`已保存。更改在下次启动主机时生效。`,`تم الحفظ. تسري التغييرات عند بدء المضيف التالي.`],State:[`状态`,`الحالة`],"not started":[`尚未开始`,`لم يبدأ`],"not-started":[`尚未开始`,`لم يبدأ`],Imported:[`已导入`,`مستورَد`],Pending:[`待处理`,`معلّق`],"Unresolved sessions":[`目录未解析的会话`,`جلسات بمجلدات غير محددة`],Cutoff:[`截止时间`,`وقت القطع`],stopped:[`已停止`,`توقف`],"Web app":[`网页应用`,`تطبيق الويب`],"Start web app at login":[`登录时启动网页应用`,`بدء تطبيق الويب عند تسجيل الدخول`],"Login item":[`登录启动项`,`عنصر بدء تسجيل الدخول`],"not installed":[`未安装`,`غير مثبّت`],"not-installed":[`未安装`,`غير مثبّت`],installed:[`已安装`,`مثبّت`],unsupported:[`不受支持`,`غير مدعوم`],"no-runtime":[`缺少运行环境`,`بيئة التشغيل غير متاحة`],"no-package":[`缺少软件包`,`الحزمة غير متاحة`],"no-launcher":[`缺少启动器`,`المشغّل غير متاح`],"Login items are unsupported on this platform.":[`此平台不支持登录启动项。`,`عناصر بدء تسجيل الدخول غير مدعومة على هذا النظام.`],"Install Node or Bun to start the web app at login.":[`安装 Node 或 Bun 后,网页应用才能在登录时启动。`,`ثبّت Node أو Bun لبدء تطبيق الويب عند تسجيل الدخول.`],"Use these commands to apply the change now:":[`使用以下命令立即应用更改:`,`استخدم هذه الأوامر لتطبيق التغيير الآن:`],"Saved. The login item changes at the next Pi or OpenCode start.":[`已保存。登录启动项将在下次启动 Pi 或 OpenCode 时更新。`,`تم الحفظ. يتغير عنصر بدء التشغيل عند بدء Pi أو OpenCode التالي.`],"History host":[`历史记录主机`,`مضيف السجل`],Scope:[`范围`,`النطاق`],"Current project":[`当前项目`,`المشروع الحالي`],"All projects":[`所有项目`,`كل المشاريع`],"Project directory":[`项目目录`,`مجلد المشروع`],"Current directory":[`当前目录`,`المجلد الحالي`],"Profile batch size":[`用户画像批量大小`,`حجم دفعة الملف الشخصي`],"Directory maps (old=new, one per line)":[`目录映射(旧=新,每行一条)`,`تعيين المجلدات (قديم=جديد، واحد في كل سطر)`],"Force reimport":[`强制重新导入`,`فرض إعادة الاستيراد`],"Skip memories":[`跳过记忆`,`تجاوز الذكريات`],"Skip profile":[`跳过用户画像`,`تجاوز الملف الشخصي`],"Import model":[`导入模型`,`نموذج الاستيراد`],"Saved external API":[`已保存的外部 API`,`واجهة API الخارجية المحفوظة`],"Preview (dry run)":[`预览(不写入)`,`معاينة (تشغيل تجريبي)`],"Start import":[`开始导入`,`بدء الاستيراد`],"Cancel after current unit":[`完成当前单元后取消`,`الإلغاء بعد الوحدة الحالية`],"Directory maps must be old=new, one per line":[`目录映射须为 旧=新,每行一条`,`يجب أن يكون تعيين المجلدات بصيغة قديم=جديد، واحد في كل سطر`],running:[`运行中`,`جارٍ التشغيل`],cancelling:[`正在取消`,`جارٍ الإلغاء`],cancelled:[`已取消`,`أُلغي`],done:[`已完成`,`اكتمل`],failed:[`失败`,`فشل`],units:[`单元`,`وحدات`],"List sessions":[`列出会话`,`عرض الجلسات`],"Refresh list":[`刷新列表`,`تحديث القائمة`],"Advanced options":[`高级选项`,`خيارات متقدمة`],"Hide advanced options":[`隐藏高级选项`,`إخفاء الخيارات المتقدمة`],"default location":[`默认位置`,`الموقع الافتراضي`],"Prompt date from":[`提示日期起`,`تاريخ الطلب من`],"Prompt date to":[`提示日期止`,`تاريخ الطلب إلى`],"Prompt dates are inclusive, use your time zone, and filter the turns inside each session, not the list. Empty dates include every turn.":[`提示日期包含首尾两天,按你所在时区计算,只筛选每个会话中的对话轮次,不筛选列表。留空则包含所有轮次。`,`تواريخ الطلب شاملة لليومين، وتُحسب بمنطقتك الزمنية، وتُصفّي الأدوار داخل كل جلسة لا القائمة. تركها فارغة يشمل كل الأدوار.`],"Sessions with directories that no longer exist":[`目录已不存在的会话`,`جلسات لم تعد مجلداتها موجودة`],"Show them and add a directory map":[`显示它们并添加目录映射`,`اعرضها وأضف تعيين مجلد`],Selected:[`已选择`,`المحدد`],"Select all matching":[`选择所有匹配项`,`تحديد كل المطابق`],"Clear selection":[`清除选择`,`مسح التحديد`],Select:[`选择`,`تحديد`],Created:[`创建时间`,`تاريخ الإنشاء`],"Resolved by":[`解析方式`,`طريقة التحديد`],recorded:[`记录的目录`,`المجلد المسجّل`],mapped:[`目录映射`,`تعيين مجلد`],"project root":[`项目根目录`,`جذر المشروع`],missing:[`缺失`,`مفقود`],"No sessions match.":[`没有匹配的会话。`,`لا توجد جلسات مطابقة.`],Previous:[`上一页`,`السابق`],Next:[`下一页`,`التالي`],None:[`无`,`لا شيء`],"Configured, not tested.":[`已配置,未测试。`,`مُعدّ، لم يُختبر.`],"An import with an OpenCode signed-in model runs from the terminal or with /import in OpenCode.":[`使用 OpenCode 已登录模型的导入需在终端运行,或在 OpenCode 中使用 /import。`,`يتم الاستيراد بنموذج OpenCode المسجَّل الدخول من الطرفية أو بالأمر /import داخل OpenCode.`],"The chosen OpenCode model is not connected here. An import with an OpenCode signed-in model runs from the terminal or with /import in OpenCode. Choose the external API for a web import.":[`所选 OpenCode 模型在此处未连接。使用 OpenCode 已登录模型的导入需在终端运行,或在 OpenCode 中使用 /import。网页导入请选择外部 API。`,`نموذج OpenCode المختار غير متصل هنا. يتم الاستيراد بنموذج OpenCode المسجَّل الدخول من الطرفية أو بالأمر /import داخل OpenCode. اختر واجهة API الخارجية للاستيراد من الصفحة.`],"Test models in Health":[`在健康检查中测试模型`,`اختبر النماذج في قسم السلامة`],Import:[`导入`,`استيراد`],sessions:[`个会话`,`جلسات`],"1 session":[`1 个会话`,`جلسة واحدة`],"List sessions first.":[`请先列出会话。`,`اعرض الجلسات أولاً.`],"Options changed. Refresh the session list first.":[`选项已更改。请先刷新会话列表。`,`تغيّرت الخيارات. حدّث قائمة الجلسات أولاً.`],"Select at least one session.":[`请至少选择一个会话。`,`حدّد جلسة واحدة على الأقل.`],"Select at most 1000 sessions one by one, or use Select all matching.":[`逐个选择最多 1000 个会话,或使用“选择所有匹配项”。`,`حدّد 1000 جلسة كحد أقصى واحدة تلو الأخرى، أو استخدم «تحديد كل المطابق».`],"Model readiness is unknown. Reload the page.":[`无法确定模型是否就绪。请重新加载页面。`,`حالة جاهزية النموذج غير معروفة. أعد تحميل الصفحة.`],"No import model is ready. Connect a model in OpenCode or complete the external API settings.":[`没有可用的导入模型。请在 OpenCode 中连接模型,或补全外部 API 设置。`,`لا يوجد نموذج استيراد جاهز. اربط نموذجاً في OpenCode أو أكمل إعدادات واجهة API الخارجية.`],"The external API is not ready":[`外部 API 未就绪`,`واجهة API الخارجية غير جاهزة`],"The external API has no memoryModel in the global config":[`全局配置中缺少外部 API 的 memoryModel`,`لا يحتوي الإعداد العام على memoryModel لواجهة API الخارجية`],"The external API has no memoryApiUrl in the global config":[`全局配置中缺少外部 API 的 memoryApiUrl`,`لا يحتوي الإعداد العام على memoryApiUrl لواجهة API الخارجية`],"The external API key is missing in the OpenCode process; check memoryApiKey and its env:// or file:// source":[`OpenCode 进程中缺少外部 API 密钥;请检查 memoryApiKey 及其 env:// 或 file:// 来源`,`مفتاح واجهة API الخارجية غير موجود في عملية OpenCode؛ تحقّق من memoryApiKey ومصدره env:// أو file://`],"The memoryProvider in the global config is not supported for imports":[`全局配置中的 memoryProvider 不支持导入`,`مزوّد memoryProvider في الإعداد العام غير مدعوم للاستيراد`],"Pi sessions folder or one .jsonl session file":[`Pi 会话文件夹或单个 .jsonl 会话文件`,`مجلد جلسات Pi أو ملف جلسة ‎.jsonl واحد`],"OpenCode database file":[`OpenCode 数据库文件`,`ملف قاعدة بيانات OpenCode`],"Absolute path, for example on a mounted volume":[`绝对路径,例如已挂载卷上的路径`,`مسار مطلق، مثلاً على وحدة تخزين مركّبة`],"Use this source":[`使用此来源`,`استخدم هذا المصدر`],Browse:[`浏览`,`استعراض`],"Use the default location":[`使用默认位置`,`استخدم الموقع الافتراضي`],"Chosen source":[`已选来源`,`المصدر المختار`],Choose:[`选择`,`اختيار`],"Only the first 500 entries are shown.":[`仅显示前 500 项。`,`تُعرض أول 500 عنصر فقط.`],"Reload the page before saving again.":[`再次保存前请重新加载页面。`,`أعد تحميل الصفحة قبل الحفظ مرة أخرى.`],"The current settings could not be reloaded. Reload the page.":[`无法重新加载当前设置。请重新加载页面。`,`تعذّر إعادة تحميل الإعدادات الحالية. أعد تحميل الصفحة.`],Log:[`日志`,`السجل`],"Capture attempts only":[`仅显示捕获尝试`,`محاولات الالتقاط فقط`],Refresh:[`刷新`,`تحديث`],"Copy log path":[`复制日志路径`,`نسخ مسار السجل`],"Log lines":[`日志行`,`أسطر السجل`],"No log has been written yet.":[`尚未写入日志。`,`لم يُكتب سجل بعد.`],"Loading log…":[`正在加载日志…`,`جارٍ تحميل السجل…`],"External API":[`外部 API`,`واجهة API الخارجية`],"An OpenAI- or Anthropic-compatible endpoint that either host can use for capture and backfill.":[`兼容 OpenAI 或 Anthropic 的端点,两个宿主都可用于捕获和回填。`,`نقطة نهاية متوافقة مع OpenAI أو Anthropic يمكن لأي مضيف استخدامها للالتقاط والاستيراد.`],Provider:[`提供商`,`المزوّد`],"API URL":[`API 地址`,`عنوان API`],"API key":[`API 密钥`,`مفتاح API`],"Save endpoint":[`保存端点`,`حفظ نقطة النهاية`],"Nothing to save.":[`没有需要保存的内容。`,`لا يوجد ما يُحفظ.`],"Key source":[`密钥来源`,`مصدر المفتاح`],"environment variable":[`环境变量`,`متغير البيئة`],"key file":[`密钥文件`,`ملف المفتاح`],"set in the config file":[`在配置文件中设置`,`مضبوط في ملف الإعدادات`],"resolves in the web app":[`可在网页应用中解析`,`يُقرأ في تطبيق الويب`],"does not resolve in the web app":[`无法在网页应用中解析`,`لا يُقرأ في تطبيق الويب`],"A login web app does not see variables set only in a shell profile; a key file works everywhere.":[`登录时启动的网页应用看不到仅在 shell 配置文件中设置的变量;密钥文件在任何地方都可用。`,`تطبيق الويب الذي يبدأ عند تسجيل الدخول لا يرى المتغيرات المضبوطة في ملف الصدفة فقط؛ ملف المفتاح يعمل في كل مكان.`],"The key does not resolve in this web app. Save it to a key file instead.":[`此网页应用无法解析该密钥。请改为保存到密钥文件。`,`لا يُقرأ المفتاح في تطبيق الويب هذا. احفظه في ملف مفتاح بدلاً من ذلك.`],"Environment variable":[`环境变量`,`متغير البيئة`],"Key file":[`密钥文件`,`ملف المفتاح`],"Save key to a private file":[`将密钥保存到私有文件`,`حفظ المفتاح في ملف خاص`],"Variable name":[`变量名`,`اسم المتغير`],"Key file path":[`密钥文件路径`,`مسار ملف المفتاح`],"Key file name":[`密钥文件名`,`اسم ملف المفتاح`],"The key is written to ~/.config/omms/secrets/ readable only by you. It is never shown again.":[`密钥写入 ~/.config/omms/secrets/,仅你可读,之后不再显示。`,`يُكتب المفتاح في ~/.config/omms/secrets/ ولا يقرؤه غيرك، ولن يُعرض مرة أخرى.`],"Save key source":[`保存密钥来源`,`حفظ مصدر المفتاح`],"Key source saved.":[`密钥来源已保存。`,`تم حفظ مصدر المفتاح.`],"A key file with this name exists. Replace it?":[`已存在同名密钥文件。要替换吗?`,`يوجد ملف مفتاح بهذا الاسم. هل تريد استبداله؟`],"Enter a variable name such as ZAI_API_KEY":[`请输入变量名,例如 ZAI_API_KEY`,`أدخل اسم متغير مثل ZAI_API_KEY`],"Enter the path of a key file":[`请输入密钥文件路径`,`أدخل مسار ملف المفتاح`],"Name the key file with letters, digits, dashes, or underscores":[`密钥文件名只能包含字母、数字、短横线或下划线`,`سمِّ ملف المفتاح بحروف أو أرقام أو شرطات أو شرطات سفلية`],"Paste the key":[`请粘贴密钥`,`الصق المفتاح`],Test:[`测试`,`اختبار`],"Test call succeeded":[`测试调用成功`,`نجح استدعاء الاختبار`],"Test call failed":[`测试调用失败`,`فشل استدعاء الاختبار`],"External API needs":[`外部 API 缺少`,`تحتاج واجهة API الخارجية إلى`],"Automatic import makes model calls. A model change applies at the next run. Turning it off stops a running import after the current exchange.":[`自动导入会调用模型。模型更改在下次运行时生效。关闭后,正在进行的导入会在当前对话完成后停止。`,`يستدعي الاستيراد التلقائي النماذج. يسري تغيير النموذج في التشغيل التالي. إيقافه يوقف الاستيراد الجاري بعد المحادثة الحالية.`],"Saved. Changes apply at the next run.":[`已保存。更改在下次运行时生效。`,`تم الحفظ. تسري التغييرات في التشغيل التالي.`],paused:[`已暂停`,`متوقف مؤقتاً`],"started from auto":[`自动启动`,`بدأ تلقائياً`],"started from web":[`从网页启动`,`بدأ من الويب`],"started from cli":[`从终端启动`,`بدأ من الطرفية`],"started from slash":[`从斜杠命令启动`,`بدأ من أمر الشرطة المائلة`],"Minutes left":[`剩余分钟`,`الدقائق المتبقية`],unknown:[`未知`,`غير معروف`],about:[`约`,`حوالي`],"Run now":[`立即运行`,`تشغيل الآن`],Pause:[`暂停`,`إيقاف مؤقت`],Resume:[`继续`,`استئناف`],"Pausing after the current exchange.":[`将在当前对话完成后暂停。`,`سيتوقف مؤقتاً بعد المحادثة الحالية.`],"Backfill started.":[`回填已开始。`,`بدأ الاستيراد.`],"Directory maps":[`目录映射`,`خرائط المجلدات`],"Map a directory that was moved or deleted to the project it belongs to. A change applies to the next import or backfill run.":[`将已移动或删除的目录映射到其所属项目。更改在下次导入或回填时生效。`,`اربط مجلداً نُقل أو حُذف بالمشروع الذي ينتمي إليه. يسري التغيير في الاستيراد التالي.`],"Saved maps":[`已保存的映射`,`الخرائط المحفوظة`],Keep:[`保留`,`إبقاء`],Remove:[`移除`,`إزالة`],"Unresolved directories":[`无法解析的目录`,`مجلدات غير محلولة`],"No unresolved directories in the latest run.":[`最近一次运行没有无法解析的目录。`,`لا توجد مجلدات غير محلولة في آخر تشغيل.`],"No suggestion found.":[`未找到建议。`,`لم يُعثر على اقتراح.`],"Target directory":[`目标目录`,`المجلد الهدف`],"Saved. Maps apply to the next import or backfill run.":[`已保存。映射在下次导入或回填时生效。`,`تم الحفظ. تسري الخرائط في الاستيراد التالي.`],"Memory language":[`记忆语言`,`لغة الذاكرة`],"The language that new memory summaries are written in. Automatic detects it from your prompt, but a Latin-script prompt under 100 characters counts as English.":[`新记忆摘要使用的语言。“自动”会根据你的提示检测语言,但少于 100 个字符的拉丁字母提示按英语处理。`,`اللغة التي تُكتب بها ملخصات الذاكرة الجديدة. يكتشفها الوضع التلقائي من موجّهك، لكن الموجّه بالأحرف اللاتينية الأقصر من 100 حرف يُعدّ إنجليزياً.`],"Summary language":[`摘要语言`,`لغة الملخص`],Automatic:[`自动`,`تلقائي`],"Saved. New memories use this language.":[`已保存。新记忆将使用此语言。`,`تم الحفظ. ستستخدم الذكريات الجديدة هذه اللغة.`],"Claude Code folder":[`Claude Code 文件夹`,`مجلد Claude Code`],"Set this when Claude Code does not use ~/.claude, for example when you start it with CLAUDE_CONFIG_DIR. Leave it empty to use the default.":[`当 Claude Code 不使用 ~/.claude 时(例如用 CLAUDE_CONFIG_DIR 启动它),请设置此项。留空则使用默认文件夹。`,`اضبط هذا عندما لا يستخدم Claude Code المجلد ‎~/.claude، مثلاً عند تشغيله مع CLAUDE_CONFIG_DIR. اتركه فارغاً لاستخدام المجلد الافتراضي.`],"Save folder":[`保存文件夹`,`حفظ المجلد`],"Transcripts folder in use":[`正在使用的会话记录文件夹`,`مجلد سجلات الجلسات المستخدم`],From:[`来源`,`المصدر`],"this setting":[`此设置`,`هذا الإعداد`],"the CLAUDE_CONFIG_DIR variable of the web app":[`网页应用的 CLAUDE_CONFIG_DIR 变量`,`متغير CLAUDE_CONFIG_DIR لتطبيق الويب`],"the default folder":[`默认文件夹`,`المجلد الافتراضي`],"This folder does not exist. Claude Code capture and import will not work:":[`此文件夹不存在。Claude Code 的捕获和导入将无法工作:`,`هذا المجلد غير موجود. لن يعمل الالتقاط والاستيراد في Claude Code:`],"Enter a full path, or a path that starts with ~/.":[`请输入完整路径,或以 ~/ 开头的路径。`,`أدخل مساراً كاملاً، أو مساراً يبدأ بـ ‎~/.`],"Saved. Capture and import use this folder now.":[`已保存。捕获和导入现在使用此文件夹。`,`تم الحفظ. يستخدم الالتقاط والاستيراد هذا المجلد الآن.`],"Running version":[`运行版本`,`الإصدار الجاري`],"Global command":[`全局命令`,`الأمر العام`],"not installed globally":[`未全局安装`,`غير مثبت عمومياً`],"A newer OMMS copy runs in place of the global install. The global install is optional. To update it:":[`正在运行的是更新的 OMMS 副本,而不是全局安装。全局安装是可选的。更新方法:`,`تعمل نسخة OMMS أحدث بدلاً من التثبيت العام. التثبيت العام اختياري. لتحديثه:`],"The global install is newer than the running OMMS. The next Pi or OpenCode start replaces the web app.":[`全局安装比正在运行的 OMMS 更新。下次启动 Pi 或 OpenCode 时将替换网页应用。`,`التثبيت العام أحدث من OMMS الجاري. سيستبدل التشغيل التالي لـ Pi أو OpenCode تطبيق الويب.`],"OMMS is not installed globally. A global install is optional.":[`OMMS 未全局安装。全局安装是可选的。`,`OMMS غير مثبت عمومياً. التثبيت العام اختياري.`],"Keys and access":[`密钥与访问`,`المفاتيح والوصول`],"not needed":[`不需要`,`غير مطلوب`],"External API key":[`外部 API 密钥`,`مفتاح واجهة API الخارجية`],"Embedding server key":[`嵌入服务器密钥`,`مفتاح خادم التضمين`],"Capture and profile learning through the external API. Claude Code always uses it.":[`通过外部 API 进行捕获和用户画像学习。Claude Code 始终使用它。`,`الالتقاط وتعلّم الملف الشخصي عبر واجهة API الخارجية. يستخدمه Claude Code دائماً.`],"Sent to an embedding server on another machine.":[`发送给另一台机器上的嵌入服务器。`,`يُرسَل إلى خادم تضمين على جهاز آخر.`],"Let scripts and other computers call the web app's API.":[`允许脚本和其他电脑调用网页应用的 API。`,`تتيح للبرامج النصية والحواسيب الأخرى استدعاء واجهة API لتطبيق الويب.`],"Asks for a user name and password before the page opens.":[`打开页面前要求输入用户名和密码。`,`يطلب اسم مستخدم وكلمة مرور قبل فتح الصفحة.`],"External API card":[`外部 API 卡片`,`بطاقة واجهة API الخارجية`],"Embedding card":[`嵌入卡片`,`بطاقة التضمين`],"Table below":[`下方表格`,`الجدول أدناه`],"Form below":[`下方表单`,`النموذج أدناه`],"API tokens":[`API 令牌`,`رموز API`],"Browser password":[`浏览器密码`,`كلمة مرور المتصفح`],"The config file still sets webServerApiToken. OMMS imported it once as the token “from config file” and no longer reads the key. Use the token table instead.":[`配置文件仍设置了 webServerApiToken。OMMS 已将其导入一次,作为令牌“from config file”,之后不再读取该键。请改用令牌表。`,`لا يزال ملف الإعدادات يضبط webServerApiToken. استورده OMMS مرة واحدة كرمز باسم “from config file” ولم يعد يقرأ هذا المفتاح. استخدم جدول الرموز بدلاً منه.`],"Open this page on the computer that runs OMMS to manage tokens and the password.":[`请在运行 OMMS 的电脑上打开此页面,以管理令牌和密码。`,`افتح هذه الصفحة على الحاسوب الذي يشغّل OMMS لإدارة الرموز وكلمة المرور.`],"Revoke this token? Scripts that use it stop working.":[`撤销此令牌?使用它的脚本将停止工作。`,`إلغاء هذا الرمز؟ ستتوقف البرامج النصية التي تستخدمه عن العمل.`],"No browser password is set.":[`未设置浏览器密码。`,`لم تُضبط كلمة مرور للمتصفح.`],"A browser password is set for user":[`已为以下用户设置浏览器密码:`,`ضُبطت كلمة مرور المتصفح للمستخدم`],"A browser password is set for your computer user name.":[`已为你的电脑用户名设置浏览器密码。`,`ضُبطت كلمة مرور المتصفح لاسم مستخدم حاسوبك.`],"User name":[`用户名`,`اسم المستخدم`],Password:[`密码`,`كلمة المرور`],"Save password":[`保存密码`,`حفظ كلمة المرور`],"Clear password":[`清除密码`,`مسح كلمة المرور`],"Saved. Restart the web app to use the new browser password.":[`已保存。重启网页应用以使用新的浏览器密码。`,`تم الحفظ. أعد تشغيل تطبيق الويب لاستخدام كلمة مرور المتصفح الجديدة.`],Name:[`名称`,`الاسم`],Expires:[`过期时间`,`تاريخ الانتهاء`],"Last used":[`上次使用`,`آخر استخدام`],Never:[`永不`,`أبداً`],Revoke:[`撤销`,`إلغاء`],Copy:[`复制`,`نسخ`],"Copy this token now. It will not be shown again.":[`请立即复制此令牌。它不会再次显示。`,`انسخ هذا الرمز الآن. لن يُعرض مرة أخرى.`],"Token name":[`令牌名称`,`اسم الرمز`],"Expires after":[`有效期`,`ينتهي بعد`],"Generate token":[`生成令牌`,`إنشاء رمز`],All:[`全部`,`الكل`],Kind:[`类型`,`النوع`],"Built-in model":[`内置模型`,`النموذج المدمج`],"OpenAI-compatible server":[`OpenAI 兼容服务器`,`خادم متوافق مع OpenAI`],"Server URL":[`服务器 URL`,`عنوان URL للخادم`],"Vector size":[`向量维度`,`حجم المتجه`],"Stored memories":[`已存储的记忆`,`الذكريات المخزنة`],"Re-embedding":[`正在重新嵌入`,`جارٍ إعادة التضمين`],"Re-embed finished.":[`重新嵌入已完成。`,`اكتملت إعادة التضمين.`],"Re-embed failed":[`重新嵌入失败`,`فشلت إعادة التضمين`],Retry:[`重试`,`إعادة المحاولة`],Lock:[`锁定`,`قفل`],"Unlock to change":[`解锁以更改`,`افتح القفل للتغيير`],"The model that turns memory text into search vectors. A change re-embeds every memory.":[`将记忆文本转换为搜索向量的模型。更改后会重新嵌入所有记忆。`,`النموذج الذي يحوّل نص الذكريات إلى متجهات بحث. يؤدي تغييره إلى إعادة تضمين كل الذكريات.`],Preset:[`预设`,`إعداد مسبق`],Custom:[`自定义`,`مخصص`],"No key":[`无密钥`,`بلا مفتاح`],"Keep the saved key":[`保留已保存的密钥`,`الاحتفاظ بالمفتاح المحفوظ`],Apply:[`应用`,`تطبيق`],Cancel:[`取消`,`إلغاء الأمر`],"Test passed. Vector size":[`测试通过。向量维度`,`نجح الاختبار. حجم المتجه`],"Test failed":[`测试失败`,`فشل الاختبار`],"Every stored memory will be re-embedded":[`所有已存储的记忆都将重新嵌入`,`ستُعاد عملية تضمين كل الذكريات المخزنة`],"The hosted server is called once for each memory, which may cost money.":[`托管服务器会为每条记忆调用一次,可能产生费用。`,`يُستدعى الخادم المستضاف مرة لكل ذكرى، وقد يكلّف ذلك مالاً.`],"Search results are poor until the re-embed ends.":[`在重新嵌入结束前,搜索结果质量较差。`,`تكون نتائج البحث ضعيفة حتى تنتهي إعادة التضمين.`],"Restart open OpenCode and Pi sessions after the change.":[`更改后请重启已打开的 OpenCode 和 Pi 会话。`,`أعد تشغيل جلسات OpenCode وPi المفتوحة بعد التغيير.`],"Profile learning":[`用户画像学习`,`تعلّم الملف الشخصي`],"Catch up analyses every waiting prompt with the saved external API, 50 prompts for each model call.":[`补齐会使用已保存的外部 API 分析所有等待中的提示词,每次模型调用处理 50 条。`,`يحلّل اللحاق كل الطلبات المنتظرة عبر واجهة API الخارجية المحفوظة، 50 طلباً لكل استدعاء للنموذج.`],"Open this page on the computer that runs OMMS to start a catch-up run.":[`请在运行 OMMS 的电脑上打开此页面以开始补齐。`,`افتح هذه الصفحة على الحاسوب الذي يشغّل OMMS لبدء اللحاق.`],"Prompts waiting for profile learning":[`等待用户画像学习的提示词`,`الطلبات المنتظرة لتعلّم الملف الشخصي`],"Model calls":[`模型调用次数`,`استدعاءات النموذج`],"Batches done":[`已完成批次`,`الدفعات المكتملة`],"Prompts waiting":[`等待中的提示词`,`الطلبات المنتظرة`],Paused:[`已暂停`,`متوقف مؤقتاً`],Finished:[`已完成`,`اكتمل`],Stopped:[`已停止`,`توقّف`],"Catch up profile":[`补齐用户画像`,`اللحاق بالملف الشخصي`],"Start profile learning for the waiting prompts? Model calls":[`为等待中的提示词开始用户画像学习?模型调用次数`,`بدء تعلّم الملف الشخصي للطلبات المنتظرة؟ عدد استدعاءات النموذج`],"never used before":[`从未使用`,`لم يُستخدم من قبل`],"A newer catch-up run took over.":[`较新的补齐任务已接管。`,`تولّت عملية لحاق أحدث المهمة.`],"Browser password cleared. Restart the web app to turn it off.":[`浏览器密码已清除。重启网页应用以关闭它。`,`تم مسح كلمة مرور المتصفح. أعد تشغيل تطبيق الويب لإيقافها.`],Actions:[`操作`,`الإجراءات`],"All exchanges are done. Learning the profile from the imported prompts":[`所有对话已完成。正在从导入的提示中学习画像`,`اكتملت كل المحادثات. يجري تعلّم الملف الشخصي من المطالبات المستوردة`],batches:[`批`,`دفعات`],"Change it in":[`修改位置`,`مكان التغيير`],"Check them, then press Save maps.":[`请检查后点击保存映射。`,`راجعها ثم اضغط حفظ الخرائط.`],Credential:[`凭据`,`بيانات الاعتماد`],Email:[`邮箱`,`البريد الإلكتروني`],Filled:[`已填写`,`تم الملء`],"Finds the project each missing directory belongs to, mostly the main repository of a deleted worktree, and fills it in for you to check. Nothing is saved until you press Save maps.":[`为每个缺失的目录找到所属项目(多为已删除工作树的主仓库),并填入供你检查。点击保存映射之前不会保存任何内容。`,`يعثر على المشروع الذي ينتمي إليه كل مجلد مفقود، وغالباً المستودع الرئيسي لشجرة عمل محذوفة، ويملؤه لتراجعه. لا يُحفظ شيء حتى تضغط حفظ الخرائط.`],Hosts:[`主机`,`المضيفات`],"Import status":[`导入状态`,`حالة الاستيراد`],"in use":[`使用中`,`قيد الاستخدام`],"Last run":[`上次运行`,`آخر تشغيل`],"Last update":[`最后更新`,`آخر تحديث`],"Learning profile":[`正在学习画像`,`يجري تعلّم الملف الشخصي`],"Merge into":[`合并到`,`دمج في`],"Merge this profile into the other one? The source profile is turned off, not deleted.":[`将此画像合并到另一个画像?源画像会被停用,不会被删除。`,`دمج هذا الملف الشخصي في الآخر؟ يُوقَف الملف المصدر ولا يُحذف.`],"Merged.":[`已合并。`,`تم الدمج.`],"model not recorded":[`未记录模型`,`لم يُسجَّل نموذج`],model:[`个模型`,`نموذج`],models:[`个模型`,`نماذج`],"No directory recorded":[`未记录目录`,`لم يُسجَّل مجلد`],"No suggestion":[`无建议`,`لا اقتراح`],"Not started":[`未开始`,`لم يبدأ`],"OMMS keeps one profile for each git email. A folder whose repository has its own email starts a second profile. Choose the profile that is yours, or merge the extra one into it.":[`OMMS 为每个 git 邮箱保留一个画像。若某文件夹的仓库设置了自己的邮箱,就会产生第二个画像。请选择属于你的画像,或把多余的画像合并进去。`,`يحتفظ OMMS بملف شخصي لكل بريد git. المجلد الذي يملك مستودعه بريداً خاصاً يبدأ ملفاً شخصياً ثانياً. اختر ملفك الشخصي، أو ادمج الملف الزائد فيه.`],"Outcomes by host":[`各主机结果`,`النتائج حسب المضيف`],"Partly imported":[`部分已导入`,`مستورد جزئياً`],Patterns:[`模式`,`الأنماط`],pending:[`待处理`,`معلّق`],Preferences:[`偏好`,`التفضيلات`],Profiles:[`画像`,`الملفات الشخصية`],"Prompts analysed":[`已分析提示`,`المطالبات المحلَّلة`],Running:[`运行中`,`قيد التشغيل`],"Saved maps apply to every host.":[`已保存的映射适用于所有主机。`,`تنطبق الخرائط المحفوظة على كل المضيفات.`],"Saved: a memory was stored. Skipped: the model or a rule found nothing worth keeping, or the turn was private or trivial. Failed: the attempt hit an error. Total: the three added up. Each percentage is a share of its row's total.":[`已保存:存储了一条记忆。已跳过:模型或规则认为没有值得保留的内容,或该轮为私密或琐碎内容。失败:尝试出错。总计:三者之和。每个百分比是该行总计中的占比。`,`محفوظ: خُزّنت ذاكرة. متجاوز: لم يجد النموذج أو قاعدة ما يستحق الحفظ، أو كانت الجولة خاصة أو تافهة. فشل: واجهت المحاولة خطأ. الإجمالي: مجموع الثلاثة. كل نسبة هي حصة من إجمالي صفها.`],"Saved. OMMS now uses this profile in every folder.":[`已保存。OMMS 现在在所有文件夹中使用此画像。`,`تم الحفظ. يستخدم OMMS هذا الملف الشخصي الآن في كل المجلدات.`],Directories:[`目录数`,`عدد المجلدات`],"No target chosen":[`尚未选择目标`,`لم يُختر مجلد مستهدف`],"Smart resolve directories":[`智能解析目录`,`حلّ المجلدات تلقائياً`],Exact:[`精确`,`مطابقة تامة`],"Name match":[`名称匹配`,`مطابقة بالاسم`],Guess:[`猜测`,`تخمين`],Confidence:[`可信度`,`درجة الثقة`],"Temporary folder":[`临时文件夹`,`مجلد مؤقت`],"node_modules folder":[`node_modules 文件夹`,`مجلد node_modules`],"App data folder":[`应用数据文件夹`,`مجلد بيانات التطبيقات`],"Skills folder":[`技能文件夹`,`مجلد المهارات`],"Rows with a target":[`已有目标的行数`,`عدد الصفوف ذات المجلد المستهدف`],"Smart resolve shows each proposed map and ignore in a dialog. Tick the ones to keep, then press Confirm. Nothing is saved before that.":[`智能解析会在对话框中列出每个建议的映射和忽略项。勾选要保留的项,然后点击确认。在此之前不会保存任何内容。`,`يعرض الحلّ التلقائي كل خريطة مقترحة وكل تجاهل مقترح في مربع حوار. حدّد ما تريد الاحتفاظ به، ثم اضغط تأكيد. لا يُحفظ شيء قبل ذلك.`],"Suggested to ignore":[`建议忽略`,`مقترح للتجاهل`],Ignore:[`忽略`,`تجاهل`],Restore:[`恢复`,`استعادة`],"No target":[`无目标`,`بلا مجلد مستهدف`],"Save this map":[`保存此映射`,`حفظ هذه الخريطة`],"Tick the maps and ignores to keep, then press Confirm to save them. Saved maps apply to every host on the next import or backfill run.":[`勾选要保留的映射和忽略项,然后点击确认保存。保存的映射将在所有主机的下一次导入或回填时生效。`,`حدّد الخرائط وعناصر التجاهل التي تريد الاحتفاظ بها، ثم اضغط تأكيد لحفظها. تسري الخرائط المحفوظة على كل المضيفات في عملية الاستيراد أو الاستكمال التالية.`],"Nothing to save. Type a target in a row, or press Ignore for folders that are not projects.":[`没有可保存的内容。请在行中输入目标,或对不是项目的文件夹点击忽略。`,`لا يوجد ما يُحفظ. اكتب مجلداً مستهدفاً في صف، أو اضغط تجاهل للمجلدات التي ليست مشاريع.`],"Ignored directories":[`已忽略的目录`,`المجلدات المتجاهَلة`],"Ignored directories stay unimported and leave the unresolved counts.":[`已忽略的目录保持未导入,并且不计入未解析数量。`,`تبقى المجلدات المتجاهَلة دون استيراد، ولا تُحسب ضمن الأعداد غير المحلولة.`],"They apply to the next import or backfill run. No sessions were imported.":[`它们将在下一次导入或回填时生效。未导入任何会话。`,`تسري في عملية الاستيراد أو الاستكمال التالية. لم تُستورد أي جلسات.`],"Keep a map after its sessions import. Every import checks the map before it skips a session, so removing a map makes its sessions unresolved again on the next run.":[`会话导入后请保留映射。每次导入在跳过会话之前都会先检查映射,因此删除映射会使其会话在下次运行时重新变为未解析。`,`احتفظ بالخريطة بعد استيراد جلساتها. يفحص كل استيراد الخريطة قبل أن يتجاوز جلسة، لذا فإن حذف الخريطة يجعل جلساتها غير محلولة مجدداً في التشغيل التالي.`],"Save removals":[`保存删除`,`حفظ عمليات الحذف`],"Settings changed elsewhere. Check the list and try again.":[`设置已在其他位置更改。请检查列表后再试。`,`تغيّرت الإعدادات في مكان آخر. راجع القائمة، ثم حاول مجدداً.`],"Settings changed elsewhere and could not be refreshed. Refresh the list, then try again.":[`设置已在其他位置更改,且无法刷新。请刷新列表后再试。`,`تغيّرت الإعدادات في مكان آخر وتعذّر تحديثها. حدّث القائمة، ثم حاول مجدداً.`],"Saved. Removed maps stop applying at the next import or backfill run.":[`已保存。删除的映射将从下一次导入或回填起不再生效。`,`تم الحفظ. تتوقف الخرائط المحذوفة عن السريان في عملية الاستيراد أو الاستكمال التالية.`],"Removals could not be saved. Try again.":[`无法保存删除。请重试。`,`تعذّر حفظ عمليات الحذف. حاول مجدداً.`],"Ignored. The directory stays unimported.":[`已忽略。该目录保持未导入。`,`تم التجاهل. يبقى المجلد دون استيراد.`],"The directory could not be ignored. Try again.":[`无法忽略该目录。请重试。`,`تعذّر تجاهل المجلد. حاول مجدداً.`],"Restored. The directory shows again in each host list that reported it.":[`已恢复。该目录会重新出现在报告它的每个主机列表中。`,`تمت الاستعادة. يظهر المجلد مجدداً في قائمة كل مضيف أبلغ عنه.`],"The directory could not be restored. Try again.":[`无法恢复该目录。请重试。`,`تعذّرت استعادة المجلد. حاول مجدداً.`],"Saved, but the list could not be refreshed. Refresh the list without saving again.":[`已保存,但无法刷新列表。请刷新列表,无需再次保存。`,`تم الحفظ، لكن تعذّر تحديث القائمة. حدّث القائمة دون الحفظ مجدداً.`],"Review directory maps":[`检查目录映射`,`مراجعة خرائط المجلدات`],"Proposed maps":[`建议映射数`,`عدد الخرائط المقترحة`],Sessions:[`会话数`,`عدد الجلسات`],Confirm:[`确认`,`تأكيد`],"Saving…":[`正在保存…`,`جارٍ الحفظ…`],"Settings refreshed. No maps were saved.":[`设置已刷新。未保存任何映射。`,`حُدّثت الإعدادات. لم تُحفظ أي خرائط.`],"Settings could not be refreshed. Try Refresh list again.":[`无法刷新设置。请再次点击刷新列表。`,`تعذّر تحديث الإعدادات. حاول تحديث القائمة مجدداً.`],"Maps could not be saved. Review the targets and confirm again.":[`无法保存映射。请检查目标后再次确认。`,`تعذّر حفظ الخرائط. راجع المجلدات المستهدفة، ثم أكّد مجدداً.`],"Settings changed elsewhere. Review these maps and confirm again.":[`设置已在其他位置更改。请检查这些映射后再次确认。`,`تغيّرت الإعدادات في مكان آخر. راجع هذه الخرائط، ثم أكّد مجدداً.`],"Settings changed elsewhere and could not be refreshed. Refresh the list before confirming again.":[`设置已在其他位置更改,且无法刷新。请刷新列表后再次确认。`,`تغيّرت الإعدادات في مكان آخر وتعذّر تحديثها. حدّث القائمة قبل التأكيد مجدداً.`],"Maps were saved, but the list could not be refreshed. Refresh the list without saving again.":[`映射已保存,但无法刷新列表。请刷新列表,无需再次保存。`,`حُفظت الخرائط، لكن تعذّر تحديث القائمة. حدّث القائمة دون الحفظ مجدداً.`],"No model was recorded for these attempts. This happens with records written by older OMMS versions, and when an attempt stops before a model is chosen.":[`这些尝试没有记录模型。旧版 OMMS 写入的记录,以及在选定模型之前就停止的尝试,会出现这种情况。`,`لم يُسجَّل نموذج لهذه المحاولات. يحدث ذلك في السجلات التي كتبتها إصدارات أقدم من OMMS، وعندما تتوقف المحاولة قبل اختيار نموذج.`],"These sessions cannot be mapped.":[`这些会话无法映射。`,`لا يمكن ربط هذه الجلسات.`],unresolved:[`未解析`,`غير محلول`],"Use this profile":[`使用此画像`,`استخدام هذا الملف الشخصي`],"Use this profile for every folder?":[`在所有文件夹中使用此画像?`,`استخدام هذا الملف الشخصي في كل المجلدات؟`],"Used for":[`用途`,`الاستخدام`],Workflows:[`工作流`,`سير العمل`],Memory:[`记忆`,`الذاكرة`],Setting:[`设置`,`الإعداد`],Value:[`数值`,`القيمة`],Default:[`默认值`,`القيمة الافتراضية`],Unit:[`单位`,`الوحدة`],Affects:[`影响`,`التأثير`],Results:[`条结果`,`نتائج`],Memories:[`条记忆`,`ذكريات`],Bytes:[`字节`,`بايت`],"Approximate tokens":[`约计令牌`,`رموز تقريبية`],"Maximum memory search results. Manual searches can request fewer; prompt retrieval uses this ceiling.":[`记忆搜索结果的最大数量。手动搜索可以请求更少;提示词检索使用此上限。`,`الحد الأقصى لنتائج بحث الذاكرة. يمكن للبحث اليدوي طلب عدد أقل؛ ويستخدم استرجاع الطلب هذا السقف.`],"Recent memories added at session start in OpenCode V1 and Claude Code. Pi and OpenCode V2 use prompt-based search instead.":[`会话开始时在 OpenCode V1 和 Claude Code 中加入的近期记忆。Pi 和 OpenCode V2 改用基于提示词的搜索。`,`الذكريات الحديثة التي تُضاف عند بدء الجلسة في OpenCode V1 و Claude Code. أما Pi و OpenCode V2 فيستخدمان البحث عبر الطلب بدلاً منها.`],"Conversation input sent to the memory-summary model through the shared capture pipeline. Smaller values can omit conversation text.":[`通过共享捕获管道发送给记忆摘要模型的对话输入。数值较小时可能省略部分对话文本。`,`مدخلات المحادثة التي تُرسل إلى نموذج تلخيص الذاكرة عبر مسار الالتقاط المشترك. القيم الأصغر قد تحذف نصاً من المحادثة.`],"OpenCode profile-learning input. Smaller values can omit prompts from that input. This control does not limit the other hosts' profile input.":[`OpenCode 画像学习的输入。数值较小时可能从该输入中省略部分提示词。此设置不限制其他主机的画像输入。`,`مدخلات تعلّم الملف الشخصي في OpenCode. القيم الأصغر قد تحذف مطالبات من هذه المدخلات. لا يقيّد هذا الإعداد مدخلات الملف الشخصي في المضيفات الأخرى.`],"Automatic memory context, including profile text and formatting, added to agent requests across all hosts. Smaller values can show fewer or shorter memories.":[`自动加入各主机代理请求的记忆上下文,包括画像文本和格式化内容。数值较小时会显示更少或更短的记忆。`,`سياق الذاكرة المُضاف تلقائياً إلى طلبات الوكيل في كل المضيفات، بما في ذلك نص الملف الشخصي والتنسيق. القيم الأصغر قد تعرض ذكريات أقل أو أقصر.`],"Enter a positive whole number.":[`请输入正整数。`,`أدخل رقماً صحيحاً موجباً.`],"Enter a whole number from 16,384 to 16,777,216.":[`请输入 16,384 到 16,777,216 之间的整数。`,`أدخل رقماً صحيحاً من 16,384 إلى 16,777,216.`],"Enter a whole number from 1,024 to 16,777,216.":[`请输入 1,024 到 16,777,216 之间的整数。`,`أدخل رقماً صحيحاً من 1,024 إلى 16,777,216.`],"Enter a whole number from 256 to 65,536.":[`请输入 256 到 65,536 之间的整数。`,`أدخل رقماً صحيحاً من 256 إلى 65,536.`],"Byte limits count UTF-8 bytes.":[`字节限制按 UTF-8 字节计数。`,`تُحتسب حدود البايت بوحدات بايت UTF-8.`],"Approximate tokens are estimated as ceil(UTF-8 bytes / 4). A provider can count more or fewer tokens for the same text.":[`约计令牌按 ceil(UTF-8 字节数 / 4) 估算。同一文本,提供商统计的令牌数可能更多或更少。`,`تُقدَّر الرموز التقريبية بالصيغة ceil(بايتات UTF-8 / 4). قد يحسب المزوّد للنص نفسه رموزاً أكثر أو أقل.`],"These controls do not delete stored data, set a spending limit, limit model replies, or control Graphify output.":[`这些设置不会删除已存储的数据、设定消费限额、限制模型回复,也不会控制 Graphify 输出。`,`لا تحذف هذه الإعدادات البيانات المخزنة، ولا تضع حد إنفاق، ولا تحدّ من ردود النموذج، ولا تتحكم في خرج Graphify.`],"Edit ~/.config/omms/omms.jsonc directly to set these limits without the web UI.":[`也可以直接编辑 ~/.config/omms/omms.jsonc 来设置这些限制,无需网页界面。`,`عدّل الملف ~/.config/omms/omms.jsonc مباشرة لضبط هذه الحدود دون واجهة الويب.`],"Save memory limits":[`保存记忆限制`,`حفظ حدود الذاكرة`],"Saved. New memory operations use these limits.":[`已保存。新的记忆操作将使用这些限制。`,`تم الحفظ. ستستخدم عمليات الذاكرة الجديدة هذه الحدود.`],"Invalid setting":[`无效的设置`,`إعداد غير صالح`],"Config changed. Reload settings and save again.":[`设置文件已更改。请重新加载设置后再次保存。`,`تغيّر ملف الإعدادات. أعد تحميل الإعدادات ثم احفظ مجدداً.`],"The memory settings could not be loaded. Reload the page to try again.":[`无法加载记忆设置。请重新加载页面重试。`,`تعذّر تحميل إعدادات الذاكرة. أعد تحميل الصفحة للمحاولة مجدداً.`],"The memory settings could not be saved.":[`无法保存记忆设置。`,`تعذّر حفظ إعدادات الذاكرة.`],"Effective value":[`生效值`,`القيمة السارية`],project:[`项目`,`المشروع`],"The project value stays in force. Saving edits the global file only.":[`项目值仍然生效。保存只修改全局文件。`,`تبقى قيمة المشروع سارية، والحفظ يعدّل الملف العام فقط.`],"Similarity score":[`相似度分数`,`درجة التشابه`],"Enter a number from 0 to 1.":[`请输入 0 到 1 之间的数字。`,`أدخل رقماً من 0 إلى 1.`],"Lowest score a memory needs to be returned by search. Lower values return more memories, including less relevant ones. Higher values can return none. The default depends on the embedder.":[`记忆被搜索返回所需的最低分数。较低的值会返回更多记忆,包括相关性较低的;较高的值可能一条也不返回。默认值取决于嵌入模型。`,`أدنى درجة تحتاجها الذاكرة لتُعاد في نتائج البحث. القيم الأدنى تعيد ذكريات أكثر بمن فيها الأقل صلة، والقيم الأعلى قد لا تعيد شيئاً. تعتمد القيمة الافتراضية على نموذج التضمين.`],"Reset to default":[`恢复默认`,`إعادة إلى الافتراضي`],"Differs from default":[`与默认值不同`,`يختلف عن الافتراضي`],Reranker:[`重排序器`,`إعادة الترتيب`],"Use a reranker":[`使用重排序器`,`استخدم معيد الترتيب`],Key:[`密钥`,`المفتاح`],Timeout:[`超时`,`مهلة الانتهاء`],"Search is unchanged while the switch is off.":[`开关关闭时,搜索行为保持不变。`,`يظل البحث دون تغيير أثناء إيقاف المفتاح.`],"The reranker reorders the best memory search results with your reranker server and keeps the top results.":[`重排序器使用您的重排序服务器对最佳记忆搜索结果重新排序,并保留最靠前的结果。`,`يعيد معيد الترتيب ترتيب أفضل نتائج بحث الذاكرة عبر خادم إعادة الترتيب لديك ويحتفظ بالنتائج العليا.`],"The reranker sends the prompt and the text of candidate memories to the server URL. A server on the same machine is recommended.":[`重排序器会将提示和候选记忆的文本发送到该服务器 URL。建议使用同一台机器上的服务器。`,`يرسل معيد الترتيب المطالبة ونص الذكريات المرشحة إلى عنوان URL للخادم. يُنصح بخادم على الجهاز نفسه.`],"This URL is not on this machine: memory text leaves this machine.":[`此 URL 不在本机上:记忆文本将离开本机。`,`هذا العنوان ليس على هذا الجهاز: نص الذاكرة يغادر جهازك.`],"A project file cannot change these settings.":[`项目文件无法更改这些设置。`,`لا يمكن لملف المشروع تغيير هذه الإعدادات.`],"The default of 4000 keeps the search inside OpenCode V2's 5-second wait. A value over 5000 can make OpenCode V2 send the request with no memory.":[`默认值 4000 使搜索保持在 OpenCode V2 的 5 秒等待之内。超过 5000 的值可能导致 OpenCode V2 在不注入记忆的情况下发送请求。`,`تحافظ القيمة الافتراضية 4000 على بقاء البحث داخل مهلة انتظار OpenCode V2 البالغة 5 ثوانٍ. القيمة الأعلى من 5000 قد تجعل OpenCode V2 يرسل الطلب دون ذاكرة.`],"Enter the server URL and model before turning the reranker on.":[`打开重排序器前,请先填写服务器 URL 和模型。`,`أدخل عنوان URL للخادم والنموذج قبل تشغيل معيد الترتيب.`],"The key must be an env:// or file:// reference, or left empty.":[`密钥必须是 env:// 或 file:// 引用,或留空。`,`يجب أن يكون المفتاح مرجع env:// أو file://، أو يُترك فارغاً.`],"Enter a whole number from 500 to 30,000.":[`请输入 500 到 30,000 之间的整数。`,`أدخل رقماً صحيحاً من 500 إلى 30,000.`],"Optional env:// or file:// key reference.":[`可选的 env:// 或 file:// 密钥引用。`,`مرجع مفتاح env:// أو file:// اختياري.`],milliseconds:[`毫秒`,`ميلي ثانية`],Save:[`保存`,`حفظ`],"Saved. New searches use these settings.":[`已保存。新的搜索将使用这些设置。`,`تم الحفظ. ستستخدم عمليات البحث الجديدة هذه الإعدادات.`],"The reranker settings could not be saved. Reload the page to try again.":[`无法保存重排序器设置。请重新加载页面重试。`,`تعذّر حفظ إعدادات معيد الترتيب. أعد تحميل الصفحة للمحاولة مجدداً.`],"The reranker settings could not be loaded. Reload the page to try again.":[`无法加载重排序器设置。请重新加载页面重试。`,`تعذّر تحميل إعدادات معيد الترتيب. أعد تحميل الصفحة للمحاولة مجدداً.`],"Test passed.":[`测试通过。`,`نجح الاختبار.`],"Test failed:":[`测试失败:`,`فشل الاختبار:`]};function ug(e,t){return t===`en`?e:lg[e]?.[t===`zh`?0:1]??e}function $(){let{language:e}=Cr();return t=>ug(t,e)}function dg(e,t){if(e===`env`){let n=(t.name??``).trim();if(!/^[A-Za-z_][A-Za-z0-9_]*$/.test(n))throw Error(`Enter a variable name such as ZAI_API_KEY`);return{source:e,name:n}}if(e===`file`){let n=(t.path??``).trim();if(!n)throw Error(`Enter the path of a key file`);return{source:e,path:n}}let n=(t.name??``).trim()||`memory-api`;if(!/^[A-Za-z0-9_-]{1,64}$/.test(n))throw Error(`Name the key file with letters, digits, dashes, or underscores`);if(!(t.value??``).trim())throw Error(`Paste the key`);return{source:e,name:n,value:t.value??``,replace:t.replace===!0}}function fg(e){let t=[],n=e.memoryProvider===`orcarouter`;return!n&&!e.memoryModel&&t.push(`memoryModel`),!n&&!e.memoryApiUrl&&t.push(`memoryApiUrl`),e.keySet||t.push(`memoryApiKey`),t}function pg(e,t){if(t===`inherit`||t===`external`)return{[`${e}Model`]:t};let n=t.indexOf(`/`);if(n<1||n===t.length-1)throw Error(`Enter a model as provider/model.`);return{[`${e}Provider`]:t.slice(0,n),[`${e}Model`]:t.slice(n+1)}}function mg(e){return{kind:e.relation,command:e.relation===`older`?`npm i -g om-memory-system@latest`:null}}function hg(e,t){return e.filter(e=>!t.has(e.from))}var gg={opencode:`OpenCode`,pi:`Pi`,"claude-code":`Claude Code`};function _g(e){return gg[e]}function vg(e){return Object.hasOwn(gg,e)?gg[e]:e}function yg({status:e}){let t=$();return(0,V.jsxs)(`div`,{className:`space-y-1 rounded-lg border border-border p-3`,children:[(0,V.jsx)(`h3`,{className:`text-subsection-title font-semibold`,children:_g(`claude-code`)}),e?.ready===!0&&(0,V.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:t(`Claude Code capture uses the external API.`)}),e?.ready===!1&&(0,V.jsxs)(`div`,{role:`alert`,className:`space-y-1 text-xs`,children:[(0,V.jsx)(`p`,{className:`text-amber-600`,children:t(`Claude Code capture is off. Complete the external API settings.`)}),(e.issues??[]).length>0&&(0,V.jsxs)(`p`,{children:[t(`Missing settings`),`: `,(e.issues??[]).map(e=>t(e)).join(`; `)]})]})]})}function bg(){let e=$(),[t,n]=(0,_.useState)(),[r,i]=(0,_.useState)({}),[a,o]=(0,_.useState)(``),[s,c]=(0,_.useState)(!1);(0,_.useEffect)(()=>{let e=!0,t=rg();Q(`/api/settings`).then(r=>{e&&t.isCurrent()&&n(r)}).catch(t=>{e&&o(t.message)});for(let t of[`opencode`,`pi`])Q(`/api/settings/models?host=${t}`).then(n=>{e&&i(e=>({...e,[t]:n}))}).catch(()=>{e&&i(e=>({...e,[t]:{available:!1}}))});let r=ag(t=>{e&&n(t)});return()=>{e=!1,r()}},[]);async function l(n,r){if(!t)return;let i;try{i=pg(n,r)}catch(t){o(e(t.message));return}c(!0);let a,s;try{a=await Q(`/api/settings`,{method:`PATCH`,body:JSON.stringify({edits:i,revision:t.revision})})}catch(e){s=e}let l=await ig()!==null;if(c(!1),a){let t=e(a.migratedLegacy?`Saved. OMMS now reads ~/.config/omms/omms.jsonc. The legacy config was kept.`:`Saved. New capture and profile work uses these settings.`);o(l?t:`${t} ${e(`Reload the page before saving again.`)}`)}else o(og(s?.message??``,e(l?`Current settings were reloaded; check the values and save again.`:`The current settings could not be reloaded. Reload the page.`)))}let u=fg({memoryProvider:t?.settings.memoryProvider?.globalValue,memoryModel:t?.settings.memoryModel?.globalValue,memoryApiUrl:t?.settings.memoryApiUrl?.globalValue,keySet:!!t?.secrets.memoryApiKey?.set});return(0,V.jsxs)(`section`,{className:`space-y-3 rounded-xl border border-border bg-card p-4`,"aria-label":e(`Models`),children:[(0,V.jsx)(`h2`,{className:`text-section-title font-semibold`,children:e(`Models`)}),(0,V.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[e(`External API fallback`),`: `,t?.fallback.model??e(`none`),` (`,e(t?.fallback.configured?`ready`:`not ready`),`).`]}),[`opencode`,`pi`].map(e=>(0,V.jsx)(xg,{host:e,model:t?.settings[`${e}Model`],provider:t?.settings[`${e}Provider`],effective:e===`pi`?t?.effective.pi.kind:t?.effective.opencode.mode??`unready`,list:r[e],externalMissing:u,busy:s||!t,onSave:t=>l(e,t)},e)),(0,V.jsx)(yg,{status:t?.effective[`claude-code`]}),a&&(0,V.jsx)(`p`,{role:`status`,className:`text-sm`,children:a})]})}function xg({host:e,model:t,provider:n,effective:r,list:i,externalMissing:a,busy:o,onSave:s}){let c=$(),l=t?.globalValue===`inherit`||!t?.globalValue?`inherit`:t.globalValue===`external`?`external`:`${n?.globalValue??``}/${t.globalValue}`,[u,d]=(0,_.useState)(),[f,p]=(0,_.useState)(),[m,h]=(0,_.useState)(),g=u??(l===`inherit`||l===`external`?l:`manual`),v=i?.models??[],y=l===`inherit`||l===`external`?``:l,b=m||y||(v[0]?`${v[0].provider}/${v[0].model}`:`typed`),x=!v.some(e=>`${e.provider}/${e.model}`===b),S=f??y;return(0,V.jsxs)(`div`,{className:`space-y-2 rounded-lg border border-border p-3`,children:[(0,V.jsx)(`h3`,{className:`text-subsection-title font-semibold`,children:_g(e)}),(0,V.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[c(`Effective model`),`:`,` `,t?.value===`external`&&r===`manual`?c(`external API`):t?.value===`inherit`||r===`session`?c(`session`):r===`manual`?c(`external API`):r===`unready`?c(`unavailable`):`${n?.value??``}/${t?.value??``}`]}),(t?.source===`project`||n?.source===`project`)&&(0,V.jsx)(`p`,{className:`text-xs text-amber-600`,children:c(`Project override is active. Changes to the global file may not take effect here.`)}),(0,V.jsx)(`label`,{className:`block text-sm`,htmlFor:`${e}-model`,children:c(`Model choice`)}),(0,V.jsxs)(gn,{id:`${e}-model`,className:`w-full rounded-lg border border-border bg-background p-2 text-sm`,value:g,onChange:e=>d(e.target.value),children:[(0,V.jsx)(`option`,{value:`inherit`,children:c(`Session model`)}),(0,V.jsx)(`option`,{value:`manual`,children:c(`Manual model`)}),(0,V.jsx)(`option`,{value:`external`,disabled:a.length>0,children:c(`External API`)})]}),a.length>0&&(0,V.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[c(`External API needs`),`: `,a.join(`, `)]}),g===`manual`&&i?.available&&v.length>0&&(0,V.jsxs)(gn,{className:`w-full rounded-lg border border-border bg-background p-2 text-sm`,"aria-label":`${_g(e)} ${c(`Model`)}`,value:x?`typed`:b,onChange:e=>h(e.target.value),children:[v.map(e=>(0,V.jsxs)(`option`,{value:`${e.provider}/${e.model}`,children:[e.name,` (`,e.provider,`/`,e.model,`)`]},`${e.provider}/${e.model}`)),(0,V.jsx)(`option`,{value:`typed`,children:c(`Manual provider/model`)})]}),g===`manual`&&x&&(0,V.jsx)(`input`,{className:`w-full rounded-lg border border-border bg-background p-2 text-sm`,"aria-label":`${e} ${c(`Manual provider/model`)}`,placeholder:`provider/model`,value:S,onChange:e=>{p(e.target.value),h(`typed`)}}),g===`manual`&&i&&!i.available&&(0,V.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:i.reason?c(i.reason):c(`Model list unavailable. Enter provider/model manually.`)}),(0,V.jsx)(`button`,{type:`button`,className:`rounded-lg border border-border px-3 py-1.5 text-sm`,disabled:o,onClick:()=>s(g===`manual`?x?S.trim():b:g),children:c(`Save model`)})]})}var Sg=[`openai-chat`,`openai-responses`,`anthropic`,`minimax`,`orcarouter`,`google-gemini`];function Cg(){let e=$(),[t,n]=(0,_.useState)(),[r,i]=(0,_.useState)({}),[a,o]=(0,_.useState)(`file`),[s,c]=(0,_.useState)({name:``,path:``,value:``}),[l,u]=(0,_.useState)(``),[d,f]=(0,_.useState)(!1);(0,_.useEffect)(()=>{let e=!0,t=rg();Q(`/api/settings`).then(r=>{e&&t.isCurrent()&&n(r)}).catch(t=>{e&&u(t.message)});let r=ag(t=>{e&&n(t)});return()=>{e=!1,r()}},[]);let p=e=>String(t?.settings[e]?.globalValue??``),m=e=>r[e]??p(e);async function h(){if(!t)return;let n={};for(let e of[`memoryProvider`,`memoryApiUrl`,`memoryModel`]){let t=m(e).trim();t&&t!==p(e)&&(n[e]=t)}if(!Object.keys(n).length){u(e(`Nothing to save.`));return}f(!0);try{await Q(`/api/settings`,{method:`PATCH`,body:JSON.stringify({edits:n,revision:t.revision})}),i({}),u(e(`Saved. New capture and profile work uses these settings.`))}catch(e){u(e.message)}await ig(),f(!1)}async function g(n=!1){if(!t)return;let r;try{r=dg(a,{...s,replace:n})}catch(t){u(e(t.message));return}f(!0);try{await Q(`/api/settings/external-api/key`,{method:`POST`,body:JSON.stringify({...r,revision:t.revision})}),c(e=>({...e,value:``})),u(e(`Key source saved.`))}catch(t){let r=t.message;if(a===`paste`&&!n&&r.includes(`Confirm to replace`)){f(!1),window.confirm(e(`A key file with this name exists. Replace it?`))&&await g(!0);return}u(r)}await ig(),f(!1)}async function v(){f(!0);try{let t=await Q(`/api/settings/external-api/test`,{method:`POST`,body:`{}`});u(t.ok?`${e(`Test call succeeded`)}: ${t.model??``}`:`${e(`Test call failed`)}: ${t.error??``}`)}catch(e){u(e.message)}f(!1)}let y=t?.externalKey;return(0,V.jsxs)(`section`,{className:`space-y-3 rounded-xl border border-border bg-card p-4`,"aria-label":e(`External API`),children:[(0,V.jsx)(`h2`,{className:`text-section-title font-semibold`,children:e(`External API`)}),(0,V.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:e(`An OpenAI- or Anthropic-compatible endpoint that either host can use for capture and backfill.`)}),(0,V.jsxs)(`label`,{className:`block text-sm`,children:[e(`Provider`),(0,V.jsx)(gn,{"aria-label":e(`Provider`),className:`mt-1 block w-full rounded border border-border bg-background p-2`,value:m(`memoryProvider`)||`openai-chat`,onChange:e=>i({...r,memoryProvider:e.target.value}),children:Sg.map(e=>(0,V.jsx)(`option`,{value:e,children:e},e))})]}),(0,V.jsxs)(`label`,{className:`block text-sm`,children:[e(`API URL`),(0,V.jsx)(`input`,{dir:`ltr`,className:`mt-1 block w-full rounded border border-border bg-background p-2 font-mono`,placeholder:`https://api.example.com/v1`,value:m(`memoryApiUrl`),onChange:e=>i({...r,memoryApiUrl:e.target.value})})]}),(0,V.jsxs)(`label`,{className:`block text-sm`,children:[e(`Model`),(0,V.jsx)(`input`,{dir:`ltr`,className:`mt-1 block w-full rounded border border-border bg-background p-2 font-mono`,placeholder:`glm-5-turbo`,value:m(`memoryModel`),onChange:e=>i({...r,memoryModel:e.target.value})})]}),(0,V.jsx)(`button`,{type:`button`,className:`rounded border border-border px-3 py-1.5 text-sm`,disabled:d||!t,onClick:()=>void h(),children:e(`Save endpoint`)}),(0,V.jsxs)(`fieldset`,{className:`space-y-2 rounded-lg border border-border p-3 text-sm`,children:[(0,V.jsx)(`legend`,{className:`px-1 font-medium`,children:e(`API key`)}),(0,V.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[e(`Key source`),`:`,` `,y?.source===`env`?`${e(`environment variable`)} ${y.reference}`:y?.source===`file`?`${e(`key file`)} ${y.reference}`:y?.source===`literal`?e(`set in the config file`):e(`not set`),y?.source&&` · ${e(y.resolvesInWebApp?`resolves in the web app`:`does not resolve in the web app`)}`]}),y?.source===`env`&&(0,V.jsx)(`p`,{className:`text-xs text-amber-600`,children:e(`A login web app does not see variables set only in a shell profile; a key file works everywhere.`)}),y?.source&&!y.resolvesInWebApp&&(0,V.jsx)(`p`,{className:`text-xs text-amber-600`,children:e(`The key does not resolve in this web app. Save it to a key file instead.`)}),[[`env`,`Environment variable`],[`file`,`Key file`],[`paste`,`Save key to a private file`]].map(([t,n])=>(0,V.jsxs)(`label`,{className:`flex items-center gap-2`,children:[(0,V.jsx)(`input`,{type:`radio`,name:`omms-key-source`,checked:a===t,onChange:()=>o(t)}),e(n)]},t)),a===`env`&&(0,V.jsx)(`input`,{"aria-label":e(`Variable name`),className:`w-full rounded border border-border bg-background p-2`,placeholder:`ZAI_API_KEY`,value:s.name,onChange:e=>c({...s,name:e.target.value})}),a===`file`&&(0,V.jsx)(`input`,{"aria-label":e(`Key file path`),className:`w-full rounded border border-border bg-background p-2`,placeholder:`~/.config/omms/secrets/zai.key`,value:s.path,onChange:e=>c({...s,path:e.target.value})}),a===`paste`&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`input`,{"aria-label":e(`Key file name`),className:`w-full rounded border border-border bg-background p-2`,placeholder:`memory-api`,value:s.name,onChange:e=>c({...s,name:e.target.value})}),(0,V.jsx)(`input`,{"aria-label":e(`API key`),type:`password`,autoComplete:`off`,className:`w-full rounded border border-border bg-background p-2`,value:s.value,onChange:e=>c({...s,value:e.target.value})}),(0,V.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e(`The key is written to ~/.config/omms/secrets/ readable only by you. It is never shown again.`)})]}),(0,V.jsx)(`button`,{type:`button`,className:`rounded border border-border px-3 py-1.5`,disabled:d||!t,onClick:()=>void g(),children:e(`Save key source`)})]}),(0,V.jsx)(`button`,{type:`button`,className:`rounded border border-border px-3 py-1.5 text-sm`,disabled:d,onClick:()=>void v(),children:e(`Test`)}),l&&(0,V.jsx)(`p`,{role:`status`,className:`text-sm`,children:l})]})}var wg=new Set([`localhost`,`127.0.0.1`,`::1`,`[::1]`,`0:0:0:0:0:0:0:1`]);function Tg(e){let t=e.trim().toLowerCase();return wg.has(t)||/^127(?:\.\d{1,3}){3}$/.test(t)}function Eg(e){try{return Tg(new URL(e).hostname)}catch{return!1}}function Dg(e,t){return e?`set`:t?`missing`:`not-needed`}function Og(e){let{access:t,secrets:n}=e,r=t.embeddingApiUrl;return{memoryApiKey:(e=>e===`not-needed`?`never-used`:e)(Dg(!!n.memoryApiKey?.set,e.externalUsed||e.claudeCodeInUse)),embeddingApiKey:Dg(!!n.embeddingApiKey?.set,!!r&&!Eg(r)),apiTokens:Dg(t.tokenAvailable,!Tg(t.host)&&!t.authEnabled),webPassword:Dg(!!n.webServerAuthPassword?.set,!1)}}function kg(e){return e?`Browser password cleared. Restart the web app to turn it off.`:`Saved. Restart the web app to use the new browser password.`}var Ag=[{id:`ollama`,label:`Ollama`,url:`http://localhost:11434/v1`},{id:`llamacpp`,label:`llama.cpp`,url:`http://localhost:8080/v1`},{id:`openrouter`,label:`OpenRouter`,url:`https://openrouter.ai/api/v1`},{id:`openai`,label:`OpenAI`,url:`https://api.openai.com/v1`},{id:`custom`,label:`Custom`,url:``}];function jg(e,t){let n=Ag.find(t=>t.id===e);return n&&n.url?n.url:t}function Mg(e){if(e.kind===`builtin`)return{kind:`builtin`,model:e.model.trim()};let t=e.key===`none`||e.key===`saved`?{source:e.key}:dg(e.key,{...e.keyInput,name:e.keyInput.name||`embedding-api`});return{kind:`server`,url:e.url.trim(),model:e.model.trim(),key:t}}function Ng(e){return JSON.stringify([e.kind,e.kind===`server`?e.url.trim():``,e.model.trim(),e.kind===`server`?e.key:`none`,e.kind===`server`?e.keyInput:null])}function Pg(e,t){return e!==void 0&&e===Ng(t)}function Fg(e,t){let n=t.kind===`server`&&!Eg(t.url);return{count:e.toLocaleString(`en-US`),risks:[...n?[`The hosted server is called once for each memory, which may cost money.`]:[],`Search results are poor until the re-embed ends.`,`Restart open OpenCode and Pi sessions after the change.`]}}var Ig=`Xenova/nomic-embed-text-v1`;function Lg(e,t=Ig){return e===`builtin`?{kind:e,model:t}:{kind:e}}function Rg(e,t){return e===`server`&&t?`saved`:`none`}function zg({current:e,keySet:t}){let n=$();return(0,V.jsxs)(`dl`,{className:`grid grid-cols-[auto_1fr] gap-x-3 gap-y-1 text-sm`,children:[(0,V.jsx)(`dt`,{children:n(`Kind`)}),(0,V.jsx)(`dd`,{children:n(e.kind===`server`?`OpenAI-compatible server`:`Built-in model`)}),e.url&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`dt`,{children:n(`Server URL`)}),(0,V.jsx)(`dd`,{className:`break-all`,children:e.url})]}),(0,V.jsx)(`dt`,{children:n(`Model`)}),(0,V.jsx)(`dd`,{className:`break-all`,children:e.model}),(0,V.jsx)(`dt`,{children:n(`Vector size`)}),(0,V.jsx)(`dd`,{children:e.dimensions}),(0,V.jsx)(`dt`,{children:n(`API key`)}),(0,V.jsx)(`dd`,{children:n(t?`set`:`not set`)}),(0,V.jsx)(`dt`,{children:n(`Stored memories`)}),(0,V.jsx)(`dd`,{children:e.memoryCount.toLocaleString(`en-US`)})]})}function Bg({run:e,onRetry:t}){let n=$();return e.state===`idle`?null:(0,V.jsxs)(`div`,{role:`status`,className:`space-y-1 text-sm`,children:[e.state===`running`&&(0,V.jsxs)(`p`,{children:[n(`Re-embedding`),`: `,e.progress.processed,`/`,e.progress.total]}),e.state===`done`&&(0,V.jsx)(`p`,{children:n(`Re-embed finished.`)}),e.state===`failed`&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(`p`,{className:`text-red-600`,children:[n(`Re-embed failed`),`: `,e.error??``]}),(0,V.jsx)(`button`,{type:`button`,className:`rounded border border-border px-3 py-1.5`,onClick:t,children:n(`Retry`)})]})]})}function Vg(e,t){return{kind:e.kind,url:e.url??``,model:e.model,key:Rg(e.kind,t),keyInput:{name:``,path:``,value:``}}}function Hg(){let e=$(),[t,n]=(0,_.useState)(),[r,i]=(0,_.useState)(),[a,o]=(0,_.useState)(!1),[s,c]=(0,_.useState)(!1),[l,u]=(0,_.useState)(),[d,f]=(0,_.useState)(),[p,m]=(0,_.useState)({state:`idle`,progress:{processed:0,total:0}}),[h,g]=(0,_.useState)(``),[v,y]=(0,_.useState)(!1);async function b(){let e=await Q(`/api/settings/embedding`);return n(e),m(e.run),e}(0,_.useEffect)(()=>{let e=!0,t=rg();b().catch(t=>e&&g(t.message)),Q(`/api/settings`).then(n=>e&&t.isCurrent()&&i(n)).catch(()=>{}),Q(`/api/web/status`).then(t=>e&&o(!!t.isLocal)).catch(()=>{});let n=ag(t=>e&&i(t));return()=>{e=!1,n()}},[]),(0,_.useEffect)(()=>{if(p.state!==`running`)return;let e=setInterval(()=>{Q(`/api/settings/embedding/run`).then(e=>{m(e),e.state!==`running`&&b()}).catch(()=>{})},1e3);return()=>clearInterval(e)},[p.state]);function x(){if(s||!t){c(!1),u(void 0),f(void 0);return}u(Vg(t,!!r?.secrets.embeddingApiKey?.set)),c(!0)}let S=e=>u(t=>t&&{...t,...e});async function C(){l&&await cg(y,async()=>{try{let t=await Q(`/api/settings/embedding/test`,{method:`POST`,body:JSON.stringify(Mg(l))});t.ok&&t.dimensions?(f({key:Ng(l),dimensions:t.dimensions}),g(`${e(`Test passed. Vector size`)}: ${t.dimensions}`)):(f(void 0),g(`${e(`Test failed`)}: ${t.reason??``}`))}catch(t){g(e(t.message))}})}async function w(){if(!l||!t||!r)return;let{count:n,risks:i}=Fg(t.memoryCount,l),a=[`${e(`Every stored memory will be re-embedded`)}: ${n}`,...i.map(t=>e(t))].join(`
123
+ `);window.confirm(a)&&await cg(y,async()=>{try{let e=await Q(`/api/settings/embedding/apply`,{method:`POST`,body:JSON.stringify({candidate:Mg(l),revision:r.revision})});m(e),c(!1),u(void 0),f(void 0),g(``)}catch(e){g(e.message)}await ig()})}async function T(){try{m(await Q(`/api/settings/embedding/run`,{method:`POST`,body:`{}`}))}catch(e){g(e.message)}}let E=!!r?.secrets.embeddingApiKey?.set;return(0,V.jsxs)(`section`,{className:`space-y-3 rounded-xl border border-border bg-card p-4`,"aria-label":e(`Embedding`),children:[(0,V.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,V.jsx)(`h2`,{className:`text-section-title font-semibold`,children:e(`Embedding`)}),a&&(0,V.jsx)(`button`,{type:`button`,"aria-label":e(s?`Lock`:`Unlock to change`),title:e(s?`Lock`:`Unlock to change`),className:`rounded border border-border px-2 py-1`,disabled:!t||p.state===`running`,onClick:x,children:s?`🔓`:`🔒`})]}),(0,V.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:e(`The model that turns memory text into search vectors. A change re-embeds every memory.`)}),t&&!s&&(0,V.jsx)(zg,{current:t,keySet:E}),s&&l&&(0,V.jsxs)(`div`,{className:`space-y-2 text-sm`,children:[[`builtin`,`server`].map(n=>(0,V.jsxs)(`label`,{className:`flex items-center gap-2`,children:[(0,V.jsx)(`input`,{type:`radio`,name:`omms-embedding-kind`,checked:l.kind===n,onChange:()=>S(Lg(n,t?.kind===`builtin`?t.model:`Xenova/nomic-embed-text-v1`))}),e(n===`server`?`OpenAI-compatible server`:`Built-in model`)]},n)),l.kind===`server`&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(`label`,{className:`block`,children:[e(`Preset`),(0,V.jsx)(gn,{"aria-label":e(`Preset`),className:`mt-1 block w-full rounded border border-border bg-background p-2`,value:Ag.find(e=>e.url===l.url)?.id??`custom`,onChange:e=>S({url:jg(e.target.value,l.url)}),children:Ag.map(t=>(0,V.jsx)(`option`,{value:t.id,children:t.id===`custom`?e(`Custom`):t.label},t.id))})]}),(0,V.jsxs)(`label`,{className:`block`,children:[e(`Server URL`),(0,V.jsx)(`input`,{className:`mt-1 block w-full rounded border border-border bg-background p-2`,value:l.url,onChange:e=>S({url:e.target.value})})]})]}),(0,V.jsxs)(`label`,{className:`block`,children:[e(`Model`),(0,V.jsx)(`input`,{className:`mt-1 block w-full rounded border border-border bg-background p-2`,placeholder:l.kind===`server`?`nomic-embed-text`:`Xenova/nomic-embed-text-v1`,value:l.model,onChange:e=>S({model:e.target.value})})]}),l.kind===`server`&&(0,V.jsxs)(`fieldset`,{className:`space-y-2 rounded-lg border border-border p-3`,children:[(0,V.jsx)(`legend`,{className:`px-1 font-medium`,children:e(`API key`)}),[[`none`,`No key`],...E?[[`saved`,`Keep the saved key`]]:[],[`env`,`Environment variable`],[`file`,`Key file`],[`paste`,`Save key to a private file`]].map(([t,n])=>(0,V.jsxs)(`label`,{className:`flex items-center gap-2`,children:[(0,V.jsx)(`input`,{type:`radio`,name:`omms-embedding-key`,checked:l.key===t,onChange:()=>S({key:t})}),e(n)]},t)),l.key===`env`&&(0,V.jsx)(`input`,{"aria-label":e(`Variable name`),className:`w-full rounded border border-border bg-background p-2`,placeholder:`OPENROUTER_API_KEY`,value:l.keyInput.name,onChange:e=>S({keyInput:{...l.keyInput,name:e.target.value}})}),l.key===`file`&&(0,V.jsx)(`input`,{"aria-label":e(`Key file path`),className:`w-full rounded border border-border bg-background p-2`,value:l.keyInput.path,onChange:e=>S({keyInput:{...l.keyInput,path:e.target.value}})}),l.key===`paste`&&(0,V.jsx)(`input`,{"aria-label":e(`API key`),type:`password`,autoComplete:`off`,className:`w-full rounded border border-border bg-background p-2`,value:l.keyInput.value,onChange:e=>S({keyInput:{...l.keyInput,value:e.target.value}})})]}),(0,V.jsxs)(`div`,{className:`flex gap-2`,children:[(0,V.jsx)(`button`,{type:`button`,className:`rounded border border-border px-3 py-1.5`,disabled:v||!l.model.trim(),onClick:()=>void C(),children:e(`Test`)}),(0,V.jsx)(`button`,{type:`button`,className:`rounded border border-border px-3 py-1.5`,disabled:v||!Pg(d?.key,l),onClick:()=>void w(),children:e(`Apply`)}),(0,V.jsx)(`button`,{type:`button`,className:`rounded border border-border px-3 py-1.5`,onClick:x,children:e(`Cancel`)})]})]}),(0,V.jsx)(Bg,{run:p,onRetry:()=>void T()}),h&&(0,V.jsx)(`p`,{className:`text-sm`,children:h})]})}async function Ug(e,t){return e()?(await t(),!0):!1}var Wg=[[`7`,`7 days`],[`30`,`30 days`],[`90`,`90 days`],[`never`,`Never`]];function Gg({tokens:e,newValue:t,busy:n,onGenerate:r,onRevoke:i}){let a=$(),[o,s]=(0,_.useState)(``),[c,l]=(0,_.useState)(`30`),u=e=>e===null?a(`Never`):new Date(e).toLocaleDateString();return(0,V.jsxs)(`div`,{className:`space-y-2`,children:[(0,V.jsxs)(`table`,{className:`w-full text-left text-xs`,children:[(0,V.jsx)(`thead`,{children:(0,V.jsxs)(`tr`,{children:[(0,V.jsx)(`th`,{children:a(`Name`)}),(0,V.jsx)(`th`,{children:a(`Created`)}),(0,V.jsx)(`th`,{children:a(`Expires`)}),(0,V.jsx)(`th`,{children:a(`Last used`)}),(0,V.jsx)(`th`,{})]})}),(0,V.jsx)(`tbody`,{children:e.map(e=>(0,V.jsxs)(`tr`,{children:[(0,V.jsx)(`td`,{children:e.name}),(0,V.jsx)(`td`,{children:u(e.createdAt)}),(0,V.jsx)(`td`,{children:u(e.expiresAt)}),(0,V.jsx)(`td`,{children:e.lastUsedAt===null?`-`:u(e.lastUsedAt)}),(0,V.jsx)(`td`,{children:(0,V.jsx)(`button`,{type:`button`,className:`rounded border border-border px-2 py-0.5`,disabled:n,onClick:()=>i(e),children:a(`Revoke`)})})]},e.id))})]}),t&&(0,V.jsxs)(`div`,{role:`status`,className:`space-y-1 rounded border border-border p-2 text-xs`,children:[(0,V.jsx)(`code`,{className:`block break-all`,children:t}),(0,V.jsx)(`button`,{type:`button`,className:`rounded border border-border px-2 py-0.5`,onClick:()=>void navigator.clipboard?.writeText(t),children:a(`Copy`)}),(0,V.jsx)(`p`,{className:`text-amber-600`,children:a(`Copy this token now. It will not be shown again.`)})]}),(0,V.jsxs)(`div`,{className:`flex flex-wrap items-end gap-2 text-sm`,children:[(0,V.jsxs)(`label`,{className:`block`,children:[a(`Token name`),(0,V.jsx)(`input`,{className:`mt-1 block rounded border border-border bg-background p-1.5`,placeholder:`ci`,value:o,onChange:e=>s(e.target.value)})]}),(0,V.jsxs)(`label`,{className:`block`,children:[a(`Expires after`),(0,V.jsx)(gn,{"aria-label":a(`Expires after`),className:`mt-1 block rounded border border-border bg-background p-1.5`,value:c,onChange:e=>l(e.target.value),children:Wg.map(([e,t])=>(0,V.jsx)(`option`,{value:e,children:a(t)},e))})]}),(0,V.jsx)(`button`,{type:`button`,className:`rounded border border-border px-3 py-1.5`,disabled:n||!o.trim(),onClick:()=>r(o.trim(),c===`never`?null:Number(c)),children:a(`Generate token`)})]})]})}var Kg=`relative overflow-x-auto rounded-lg border border-border`,qg=`px-3 py-2 text-start font-medium`,Jg=`bg-muted/50 text-xs text-muted-foreground`,Yg=`px-3 py-2 text-start font-medium`,Xg=`border-t border-border transition-colors hover:bg-muted/30`,Zg=`px-3 py-1.5`;function Qg(e){return{secrets:e.secrets??{},externalUsed:e.effective?.opencode?.mode===`manual`||e.effective?.pi?.kind===`manual`,claudeCodeInUse:!!(e.claudeCodeEvidence?.attempts||e.claudeCodeEvidence?.folderSet),access:e.access??{host:`127.0.0.1`,authEnabled:!1,tokenAvailable:!1,embeddingApiUrl:null}}}var $g=[{id:`memoryApiKey`,label:`External API key`,purpose:`Capture and profile learning through the external API. Claude Code always uses it.`,hosts:`OpenCode, Pi, Claude Code`,where:`External API card`},{id:`embeddingApiKey`,label:`Embedding server key`,purpose:`Sent to an embedding server on another machine.`,hosts:`OpenCode, Pi, Claude Code`,where:`Embedding card`},{id:`apiTokens`,label:`API tokens`,purpose:`Let scripts and other computers call the web app's API.`,hosts:`Web app`,where:`Table below`},{id:`webPassword`,label:`Browser password`,purpose:`Asks for a user name and password before the page opens.`,hosts:`Web app`,where:`Form below`}];function e_({state:e}){let t=$();return e===`set`?(0,V.jsxs)(`span`,{children:[`✅ `,t(`set`)]}):e===`missing`?(0,V.jsxs)(`span`,{className:`text-red-600`,children:[`⛔️ `,t(`missing`)]}):e===`never-used`?(0,V.jsx)(`span`,{className:`text-muted-foreground`,children:t(`never used before`)}):(0,V.jsx)(`span`,{className:`text-muted-foreground`,children:t(`not needed`)})}function t_({states:e}){let t=$();return(0,V.jsx)(`div`,{className:Kg,children:(0,V.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,V.jsx)(`caption`,{className:B(qg,`sr-only`),children:t(`Keys and access`)}),(0,V.jsx)(`thead`,{className:Jg,children:(0,V.jsxs)(`tr`,{children:[(0,V.jsx)(`th`,{className:Yg,children:t(`Credential`)}),(0,V.jsx)(`th`,{className:Yg,children:t(`State`)}),(0,V.jsx)(`th`,{className:Yg,children:t(`Used for`)}),(0,V.jsx)(`th`,{className:Yg,children:t(`Hosts`)}),(0,V.jsx)(`th`,{className:Yg,children:t(`Change it in`)})]})}),(0,V.jsx)(`tbody`,{children:$g.map(n=>(0,V.jsxs)(`tr`,{className:B(Xg,`align-top`),children:[(0,V.jsx)(`td`,{className:B(Zg,`font-medium`),children:t(n.label)}),(0,V.jsx)(`td`,{className:B(Zg,`whitespace-nowrap`),children:(0,V.jsx)(e_,{state:e[n.id]})}),(0,V.jsx)(`td`,{className:Zg,children:t(n.purpose)}),(0,V.jsx)(`td`,{className:Zg,children:n.hosts===`Web app`?t(`Web app`):n.hosts}),(0,V.jsx)(`td`,{className:Zg,children:t(n.where)})]},n.id))})]})})}function n_({value:e,onChange:t}){let n=$();return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(`label`,{className:`block`,children:[(0,V.jsx)(`span`,{children:n(`User name`)}),(0,V.jsx)(`input`,{className:`mt-1 block w-full rounded border border-border bg-background p-2`,autoComplete:`username`,value:e.username,onChange:n=>t({...e,username:n.target.value})})]}),(0,V.jsxs)(`label`,{className:`block`,children:[(0,V.jsx)(`span`,{children:n(`Password`)}),(0,V.jsx)(`input`,{type:`password`,autoComplete:`new-password`,className:`mt-1 block w-full rounded border border-border bg-background p-2`,value:e.value,onChange:n=>t({...e,value:n.target.value})})]})]})}function r_(){let e=$(),[t,n]=(0,_.useState)(),[r,i]=(0,_.useState)(!1),[a,o]=(0,_.useState)([]),[s,c]=(0,_.useState)(),[l,u]=(0,_.useState)({username:``,value:``}),[d,f]=(0,_.useState)(``),[p,m]=(0,_.useState)(!1);async function h(){let e=await Q(`/api/settings/tokens`);o(e.tokens)}(0,_.useEffect)(()=>{let e=!0,t=rg();Q(`/api/settings`).then(r=>{e&&t.isCurrent()&&n(r)}).catch(t=>{e&&f(t.message)}),Q(`/api/web/status`).then(async t=>{!e||!t.isLocal||(i(!0),await h())}).catch(()=>{});let r=ag(t=>{e&&n(t)});return()=>{e=!1,r()}},[]);async function g(e){await cg(m,async()=>{try{await e()}catch(e){f(e.message)}await ig()}).catch(()=>{})}let v=(e,t)=>g(async()=>{let n=await Q(`/api/settings/tokens`,{method:`POST`,body:JSON.stringify({name:e,expiresInDays:t})});c(n.value),f(``),await h()}),y=t=>g(async()=>{c(void 0),await Ug(()=>window.confirm(e(`Revoke this token? Scripts that use it stop working.`)),async()=>{await Q(`/api/settings/tokens/${t.id}`,{method:`DELETE`}),await h()})}),b=n=>g(async()=>{t&&(await Q(`/api/settings/web-password`,{method:`POST`,body:JSON.stringify(n?{clear:!0,revision:t.revision}:{password:l.value,username:l.username,revision:t.revision})}),u({username:``,value:``}),f(e(kg(n))))}),x=t?.access;return(0,V.jsxs)(`section`,{className:`space-y-3 rounded-xl border border-border bg-card p-4`,"aria-label":e(`Keys and access`),children:[(0,V.jsx)(`h2`,{className:`text-section-title font-semibold`,children:e(`Keys and access`)}),t&&(0,V.jsx)(t_,{states:Og(Qg(t))}),x?.configTokenIgnored&&(0,V.jsx)(`p`,{className:`text-xs text-amber-600`,children:e(`The config file still sets webServerApiToken. OMMS imported it once as the token “from config file” and no longer reads the key. Use the token table instead.`)}),r?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(`fieldset`,{className:`space-y-2 rounded-lg border border-border p-3 text-sm`,children:[(0,V.jsx)(`legend`,{className:`px-1 font-medium`,children:e(`API tokens`)}),(0,V.jsx)(Gg,{tokens:a,newValue:s,busy:p,onGenerate:(e,t)=>void v(e,t),onRevoke:e=>void y(e)})]}),(0,V.jsxs)(`fieldset`,{className:`space-y-2 rounded-lg border border-border p-3 text-sm`,children:[(0,V.jsx)(`legend`,{className:`px-1 font-medium`,children:e(`Browser password`)}),(0,V.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:x?.authEnabled?x.authUsername?`${e(`A browser password is set for user`)} ${x.authUsername}.`:e(`A browser password is set for your computer user name.`):e(`No browser password is set.`)}),(0,V.jsx)(n_,{value:l,onChange:u}),(0,V.jsxs)(`div`,{className:`flex gap-2`,children:[(0,V.jsx)(`button`,{type:`button`,className:`rounded border border-border px-3 py-1.5`,disabled:p||!t||!l.value,onClick:()=>void b(!1),children:e(`Save password`)}),(0,V.jsx)(`button`,{type:`button`,className:`rounded border border-border px-3 py-1.5`,disabled:p||!t||!x?.authEnabled,onClick:()=>void b(!0),children:e(`Clear password`)})]})]})]}):(0,V.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:e(`Open this page on the computer that runs OMMS to manage tokens and the password.`)}),d&&(0,V.jsx)(`p`,{role:`status`,className:`text-sm`,children:d})]})}function i_(){let e=$(),[t,n]=(0,_.useState)([]),[r,i]=(0,_.useState)({}),[a,o]=(0,_.useState)(!1),[s,c]=(0,_.useState)(``);async function l(){let e=await Q(`/api/settings/profiles`);n(e.profiles)}if((0,_.useEffect)(()=>{l().catch(e=>c(e.message))},[]),t.length<2)return null;let u=t=>cg(o,async()=>{if(window.confirm(`${e(`Use this profile for every folder?`)} ${t.userId}`))try{let n=await ig();await Q(`/api/settings/profiles/use`,{method:`POST`,body:JSON.stringify({userId:t.userId,revision:n?.revision})}),await ig(),await l(),c(e(`Saved. OMMS now uses this profile in every folder.`))}catch(e){c(e.message)}}),d=n=>cg(o,async()=>{let i=t.find(e=>e.id===(r[n.id]??t.find(e=>e.id!==n.id)?.id));if(i&&window.confirm(`${e(`Merge this profile into the other one? The source profile is turned off, not deleted.`)}\n${n.userId} → ${i.userId}`))try{await Q(`/api/settings/profiles/merge`,{method:`POST`,body:JSON.stringify({sourceId:n.id,targetId:i.id})}),await l(),c(e(`Merged.`))}catch(e){c(e.message)}});return(0,V.jsxs)(`section`,{className:`space-y-3 rounded-xl border border-border bg-card p-4`,"aria-label":e(`Profiles`),children:[(0,V.jsx)(`h2`,{className:`text-section-title font-semibold`,children:e(`Profiles`)}),(0,V.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:e(`OMMS keeps one profile for each git email. A folder whose repository has its own email starts a second profile. Choose the profile that is yours, or merge the extra one into it.`)}),(0,V.jsx)(`div`,{className:Kg,children:(0,V.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,V.jsx)(`caption`,{className:B(qg,`sr-only`),children:e(`Profiles`)}),(0,V.jsx)(`thead`,{className:Jg,children:(0,V.jsxs)(`tr`,{children:[(0,V.jsx)(`th`,{className:Yg,children:e(`Email`)}),(0,V.jsx)(`th`,{className:Yg,children:e(`Preferences`)}),(0,V.jsx)(`th`,{className:Yg,children:e(`Patterns`)}),(0,V.jsx)(`th`,{className:Yg,children:e(`Workflows`)}),(0,V.jsx)(`th`,{className:Yg,children:e(`Prompts analysed`)}),(0,V.jsx)(`th`,{className:Yg,children:e(`Last update`)}),(0,V.jsx)(`th`,{className:Yg,children:e(`Actions`)})]})}),(0,V.jsx)(`tbody`,{children:t.map(n=>(0,V.jsxs)(`tr`,{className:Xg,children:[(0,V.jsxs)(`td`,{className:B(Zg,`font-medium`),children:[n.userId,n.inUse&&(0,V.jsxs)(`span`,{className:`ms-2 text-xs text-green-700`,children:[`✅ `,e(`in use`)]})]}),(0,V.jsx)(`td`,{className:Zg,children:n.preferences}),(0,V.jsx)(`td`,{className:Zg,children:n.patterns}),(0,V.jsx)(`td`,{className:Zg,children:n.workflows}),(0,V.jsx)(`td`,{className:Zg,children:n.totalPromptsAnalyzed}),(0,V.jsx)(`td`,{className:Zg,children:new Date(n.lastAnalyzedAt).toLocaleString()}),(0,V.jsxs)(`td`,{className:B(Zg,`space-y-1`),children:[!n.inUse&&(0,V.jsx)(`button`,{type:`button`,className:`rounded border border-border px-2 py-1`,disabled:a,onClick:()=>void u(n),children:e(`Use this profile`)}),(0,V.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,V.jsx)(`label`,{className:`sr-only`,htmlFor:`merge-${n.id}`,children:e(`Merge into`)}),(0,V.jsx)(`select`,{id:`merge-${n.id}`,className:`rounded border border-border bg-background px-1 py-1 text-xs`,value:r[n.id]??``,onChange:e=>i(t=>({...t,[n.id]:e.target.value})),children:t.filter(e=>e.id!==n.id).map(e=>(0,V.jsx)(`option`,{value:e.id,children:e.userId},e.id))}),(0,V.jsx)(`button`,{type:`button`,className:`rounded border border-border px-2 py-1`,disabled:a,onClick:()=>void d(n),children:e(`Merge into`)})]})]})]},n.id))})]})}),s&&(0,V.jsx)(`p`,{role:`status`,className:`text-sm`,children:s})]})}var a_=[`opencode`,`pi`,`claude-code`];function o_(e){return!e.provider&&!e.model?null:`${e.provider??``}/${e.model??``}`}function s_(e){let t=new Map;for(let n of e){let e=t.get(n.host)??{host:n.host,total:0,saved:0,skipped:0,failed:0,models:[]};e.total+=n.total,e.saved+=n.saved,e.skipped+=n.skipped,e.failed+=n.failed;let r=o_(n),i=e.models.find(e=>e.label===r);i?(i.total+=n.total,i.saved+=n.saved,i.skipped+=n.skipped,i.failed+=n.failed):e.models.push({label:r,provider:n.provider,model:n.model,total:n.total,saved:n.saved,skipped:n.skipped,failed:n.failed}),t.set(n.host,e)}let n=e=>{let t=a_.indexOf(e);return t<0?a_.length:t};return[...t.values()].map(e=>({...e,models:e.models.sort((e,t)=>t.total-e.total)})).sort((e,t)=>n(e.host)-n(t.host))}function c_(e,t){return t>0?Math.round(100*e/t):0}function l_(e){let t=new Map;for(let n of e){let e=`${n.host}\u0000${n.reason}`,r=t.get(e)??{host:n.host,reason:n.reason,count:0};r.count+=n.count,t.set(e,r)}return[...t.values()].sort((e,t)=>t.count-e.count)}function u_({row:e}){return(0,V.jsxs)(V.Fragment,{children:[[e.saved,e.skipped,e.failed].map((t,n)=>(0,V.jsxs)(`td`,{className:B(Zg,`text-end tabular-nums`),children:[t,` `,(0,V.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[c_(t,e.total),`%`]})]},n)),(0,V.jsx)(`td`,{className:B(Zg,`text-end font-medium tabular-nums`),children:e.total})]})}function d_(e,t){return`/api/settings/diagnostics?days=${e}${t===`all`?``:`&host=${t}`}`}function f_(){let e=$(),[t,n]=(0,_.useState)(7),[r,i]=(0,_.useState)(`all`),[a,o]=(0,_.useState)(()=>new Set),[s,c]=(0,_.useState)(),[l,u]=(0,_.useState)([]),[d,f]=(0,_.useState)(),[p,m]=(0,_.useState)(``),[h,g]=(0,_.useState)(``),[v,y]=(0,_.useState)(``),[b]=(0,_.useState)(sg),x=(0,_.useCallback)(async(e,t)=>{let n=rg(),r=b.begin();try{let[i,a,o]=await Promise.all([Q(d_(e,t)),Q(`/api/settings/traces`),Q(`/api/settings`)]);if(!r())return;c(i),u(a.traces),n.isCurrent()&&f(o),g(``)}catch(e){if(!r())return;g(e.message)}},[b]);(0,_.useEffect)(()=>{x(t,r)},[t,r,x]),(0,_.useEffect)(()=>ag(e=>f(e)),[]);async function S(n){if(!d)return;let i;try{await Q(`/api/settings`,{method:`PATCH`,body:JSON.stringify({revision:d.revision,edits:n})})}catch(e){i=e}let a=await ig()!==null;if(!i){y(``),await x(t,r),a||g(e(`Reload the page before saving again.`));return}g(og(i.message,e(a?`Current settings were reloaded; check the values and save again.`:`The current settings could not be reloaded. Reload the page.`)))}async function C(e){try{let t=await Q(`/api/settings/traces/${encodeURIComponent(e)}`);m(t.content)}catch(e){g(e.message)}}async function w(n){if(window.confirm(`${e(`Delete`)} ${n}?`))try{await Q(`/api/settings/traces/${encodeURIComponent(n)}`,{method:`DELETE`}),m(``),await x(t,r)}catch(e){g(e.message)}}async function T(n){try{let{result:i}=await Q(`/api/settings/capture-retry/${n}/run`,{method:`POST`,body:`{}`});y(e(i===`scheduled`?n===`pi`?`These turns retry at the next Pi session start.`:n===`claude-code`?`These turns retry at the next Claude Code session start.`:`These turns retry at the next OpenCode session start.`:i===`running`?`A retry is already running.`:`Retrying now.`)),await x(t,r)}catch(e){g(e.message)}}let E=d?.settings.captureTrace,D=Number(d?.settings.captureRetryRetentionHours?.value??72);return(0,V.jsxs)(`section`,{className:`space-y-4 rounded-xl border border-border bg-card p-4`,"aria-label":e(`Capture diagnostics`),children:[(0,V.jsx)(`h2`,{className:`text-section-title font-semibold`,children:e(`Capture diagnostics`)}),(0,V.jsxs)(`label`,{className:`flex items-center gap-2 pb-2 text-sm`,children:[e(`Time range`),(0,V.jsxs)(gn,{"aria-label":e(`Time range`),className:`rounded-lg border border-border bg-background px-2 py-1`,value:t,onChange:e=>n(Number(e.target.value)),children:[(0,V.jsx)(`option`,{value:1,children:e(`24 hours`)}),(0,V.jsx)(`option`,{value:7,children:e(`7 days`)}),(0,V.jsx)(`option`,{value:30,children:e(`30 days`)}),(0,V.jsx)(`option`,{value:90,children:e(`90 days`)})]}),e(`Host`),(0,V.jsxs)(gn,{"aria-label":e(`Host`),className:`rounded-lg border border-border bg-background px-2 py-1`,value:r,onChange:e=>i(e.target.value),children:[(0,V.jsx)(`option`,{value:`all`,children:e(`All`)}),[`opencode`,`pi`,`claude-code`].map(e=>(0,V.jsx)(`option`,{value:e,children:_g(e)},e))]})]}),h&&(0,V.jsx)(`p`,{role:`alert`,children:h}),(0,V.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e(`Saved: a memory was stored. Skipped: the model or a rule found nothing worth keeping, or the turn was private or trivial. Failed: the attempt hit an error. Total: the three added up. Each percentage is a share of its row's total.`)}),(0,V.jsx)(`div`,{className:Kg,children:(0,V.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,V.jsx)(`caption`,{className:qg,children:e(`Outcomes by host`)}),(0,V.jsx)(`thead`,{className:Jg,children:(0,V.jsx)(`tr`,{children:[`Host / model`,`Saved`,`Skipped`,`Failed`,`Total`].map((t,n)=>(0,V.jsx)(`th`,{scope:`col`,className:B(Yg,n>0&&`text-end`),children:e(t)},t))})}),(0,V.jsx)(`tbody`,{children:s_(s?.byModel??[]).map(t=>{let n=a.has(t.host);return(0,V.jsxs)(_.Fragment,{children:[(0,V.jsxs)(`tr`,{className:B(Xg,`font-medium`),children:[(0,V.jsx)(`td`,{className:Zg,children:(0,V.jsxs)(`button`,{type:`button`,className:`inline-flex items-center gap-1`,"aria-expanded":n,onClick:()=>o(e=>{let r=new Set(e);return n?r.delete(t.host):r.add(t.host),r}),children:[(0,V.jsx)(`span`,{"aria-hidden":!0,children:n?`▾`:`▸`}),vg(t.host),(0,V.jsxs)(`span`,{className:`text-xs font-normal text-muted-foreground`,children:[`(`,t.models.length,` `,e(t.models.length===1?`model`:`models`),`)`]})]})}),(0,V.jsx)(u_,{row:t})]}),n&&t.models.map(n=>(0,V.jsxs)(`tr`,{className:`border-t border-border transition-colors hover:bg-muted/30`,children:[(0,V.jsx)(`td`,{className:B(`px-3 py-1.5`,`ps-8`),children:n.label?(0,V.jsx)(`span`,{className:`font-mono text-xs`,children:n.label}):(0,V.jsx)(`span`,{className:`text-xs italic text-muted-foreground`,title:e(`No model was recorded for these attempts. This happens with records written by older OMMS versions, and when an attempt stops before a model is chosen.`),children:e(`model not recorded`)})}),(0,V.jsx)(u_,{row:n})]},`${t.host}-${n.label??`none`}`))]},t.host)})})]})}),(0,V.jsx)(`div`,{className:Kg,children:(0,V.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,V.jsx)(`caption`,{className:qg,children:e(`Failure reasons`)}),(0,V.jsx)(`thead`,{className:Jg,children:(0,V.jsxs)(`tr`,{children:[(0,V.jsx)(`th`,{scope:`col`,className:Yg,children:e(`Host`)}),(0,V.jsx)(`th`,{scope:`col`,className:Yg,children:e(`Reason`)}),(0,V.jsx)(`th`,{scope:`col`,className:B(Yg,`text-end`),children:e(`Total`)})]})}),(0,V.jsx)(`tbody`,{children:l_(s?.byReason??[]).map((e,t)=>(0,V.jsxs)(`tr`,{className:Xg,children:[(0,V.jsx)(`td`,{className:B(Zg,`text-muted-foreground`),children:vg(e.host)}),(0,V.jsx)(`td`,{className:B(Zg,`font-mono text-xs`),children:e.reason}),(0,V.jsx)(`td`,{className:B(Zg,`text-end tabular-nums`),children:e.count})]},`${e.host}-${e.reason}-${t}`))})]})}),(0,V.jsx)(`div`,{className:B(Kg,`max-h-72 overflow-y-auto`),children:(0,V.jsxs)(`table`,{className:`w-full min-w-max text-sm`,children:[(0,V.jsx)(`caption`,{className:qg,children:e(`Recent attempts`)}),(0,V.jsx)(`thead`,{className:B(Jg,`sticky top-0`),children:(0,V.jsx)(`tr`,{children:[`Time`,`Host`,`Source`,`Session`,`Path`,`Model`,`Stop`,`Blocks`,`Prompt`,`Reply`,`Duration`,`Outcome`,`Reason`].map(t=>(0,V.jsx)(`th`,{scope:`col`,className:Yg,children:e(t)},t))})}),(0,V.jsx)(`tbody`,{children:s?.recent.map((e,t)=>(0,V.jsx)(`tr`,{className:Xg,children:[new Date(e.timestamp).toLocaleString(),vg(e.host),e.sourceType,e.sessionId,e.path,`${e.provider??``}/${e.model??``}`,e.stopReason,e.blockTypes?.join(`, `),e.promptChars,e.replyChars,e.durationMs,e.outcome,e.reason].map((e,t)=>(0,V.jsx)(`td`,{className:B(Zg,`whitespace-nowrap`),children:e??``},t))},`${e.timestamp}-${t}`))})]})}),(0,V.jsxs)(`div`,{className:`space-y-2 border-t border-border pt-3 text-sm`,children:[(0,V.jsxs)(`label`,{className:`flex items-center gap-2`,children:[(0,V.jsx)(`input`,{type:`checkbox`,checked:E?.value===!0,disabled:!d,onChange:t=>{t.target.checked&&!window.confirm(e(`Traces can contain conversation content after redaction. Keep tracing off unless you need it for debugging.`))||S({captureTrace:t.target.checked})}}),` `,e(`Save capture traces`)]}),(0,V.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e(`Traces can contain conversation content after redaction. Keep tracing off unless you need it for debugging.`)}),E?.source===`project`&&(0,V.jsx)(`p`,{className:`text-xs text-amber-600`,children:e(`This project turns tracing off. The global switch cannot turn it on here.`)}),[`captureTraceRetentionDays`,`captureAttemptRetentionDays`].map(t=>(0,V.jsxs)(`label`,{className:`block`,children:[e(t===`captureTraceRetentionDays`?`Trace retention (days)`:`Attempt retention (days)`),` `,(0,V.jsx)(`input`,{type:`number`,min:1,className:`ms-2 w-20 rounded border border-border bg-background p-1`,defaultValue:Number(d?.settings[t]?.value??30),onBlur:e=>{let n=Number(e.target.value);Number.isSafeInteger(n)&&n>0&&n!==d?.settings[t]?.value&&S({[t]:n})}},`${t}-${d?.settings[t]?.value}`)]},t)),(0,V.jsxs)(`label`,{className:`block`,children:[e(`Retry retention (hours)`),` `,(0,V.jsx)(`input`,{type:`number`,min:0,max:720,className:`ms-2 w-20 rounded border border-border bg-background p-1`,defaultValue:D,onBlur:e=>{let t=Number(e.target.value);Number.isSafeInteger(t)&&t>=0&&t<=720&&t!==D&&S({captureRetryRetentionHours:t})}},`captureRetryRetentionHours-${D}`)]}),(0,V.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e(`When the capture model cannot be reached, OMMS keeps the turn and tries again later. Queued turns can hold conversation content after redaction. 0 turns the queue off and deletes waiting turns.`)}),(0,V.jsx)(`h3`,{className:`text-subsection-title font-semibold`,children:e(`Turns waiting for retry`)}),[`pi`,`opencode`,`claude-code`].map(t=>{let n=s?.retryQueue?.[t]??0;return(0,V.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,V.jsx)(`span`,{className:`w-24`,children:_g(t)}),(0,V.jsx)(`span`,{className:`tabular-nums`,children:n}),(0,V.jsx)(`button`,{type:`button`,disabled:n===0||D===0,className:`disabled:opacity-50`,onClick:()=>void T(t),children:e(`Retry now`)})]},t)}),v&&(0,V.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:v}),(0,V.jsx)(`h3`,{className:`text-subsection-title font-semibold`,children:e(`Trace files`)}),l.map(t=>(0,V.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,V.jsxs)(`span`,{children:[t.file,` (`,t.size,` bytes)`]}),(0,V.jsx)(`button`,{type:`button`,onClick:()=>void C(t.file),children:e(`View`)}),(0,V.jsx)(`button`,{type:`button`,onClick:()=>void w(t.file),children:e(`Delete`)})]},t.file)),p&&(0,V.jsx)(`pre`,{className:`max-h-60 overflow-auto whitespace-pre-wrap break-words rounded bg-background p-2 text-xs`,children:p})]})]})}function p_(){let e=$(),[t,n]=(0,_.useState)([]),[r,i]=(0,_.useState)(!1),[a,o]=(0,_.useState)(``);async function s(e){i(!0);try{let t=await Q(`/api/settings/health`,{method:`POST`,body:JSON.stringify({testModels:e})});n(t.checks),o(``)}catch(e){o(e.message)}finally{i(!1)}}return(0,V.jsxs)(`section`,{id:`settings-health`,className:`space-y-3 rounded-xl border border-border bg-card p-4`,"aria-label":e(`Health`),children:[(0,V.jsx)(`h2`,{className:`text-section-title font-semibold`,children:e(`Health`)}),(0,V.jsxs)(`div`,{className:`flex gap-2`,children:[(0,V.jsx)(`button`,{className:`rounded-lg border border-border px-3 py-1.5 text-sm`,disabled:r,onClick:()=>void s(!1),children:e(`Run checks`)}),(0,V.jsx)(`button`,{className:`rounded-lg border border-border px-3 py-1.5 text-sm`,disabled:r,onClick:()=>void s(!0),children:e(`Run checks and test models`)})]}),r&&(0,V.jsx)(`p`,{role:`status`,children:e(`Checking…`)}),a&&(0,V.jsx)(`p`,{role:`alert`,children:a}),(0,V.jsx)(`ul`,{className:`space-y-2 text-sm`,children:t.map(t=>(0,V.jsxs)(`li`,{className:`rounded-lg border border-border p-2`,children:[(0,V.jsx)(`strong`,{className:t.status===`fail`?`text-red-600`:t.status===`warn`?`text-amber-600`:`text-green-600`,children:e(t.status).toUpperCase()}),` `,`· `,e(t.check),`: `,t.reason]},t.check))})]})}function m_(){let e=$(),[t,n]=(0,_.useState)(),[r,i]=(0,_.useState)(),[a,o]=(0,_.useState)(),[s,c]=(0,_.useState)(``),[l,u]=(0,_.useState)(!1);(0,_.useEffect)(()=>{let e=!0;Q(`/api/settings`).then(t=>{e&&n(t)}).catch(t=>{e&&c(t.message)}),Q(`/api/settings/web-autostart`).then(t=>{e&&i(t)}).catch(t=>{e&&c(t.message)}),Q(`/api/settings/version`).then(t=>{e&&o(t)}).catch(()=>{});let t=ag(t=>{e&&n(t)});return()=>{e=!1,t()}},[]);async function d(n){if(t){u(!0);try{await Q(`/api/settings`,{method:`PATCH`,body:JSON.stringify({edits:{webServerAutoStart:n},revision:t.revision})}),c(e(`Saved. The login item changes at the next Pi or OpenCode start.`))}catch(e){c(e.message)}await ig(),u(!1)}}return(0,V.jsxs)(`section`,{className:`space-y-3 rounded-xl border border-border bg-card p-4`,"aria-label":e(`Web app`),children:[(0,V.jsx)(`h2`,{className:`text-section-title font-semibold`,children:e(`Web app`)}),(0,V.jsxs)(`label`,{className:`flex items-center gap-2 text-sm`,children:[(0,V.jsx)(`input`,{type:`checkbox`,checked:!!t?.settings.webServerAutoStart?.globalValue,disabled:l||!t,onChange:e=>void d(e.target.checked)}),e(`Start web app at login`)]}),(0,V.jsxs)(`p`,{className:`text-sm`,children:[e(`Login item`),`: `,e(r?.state??`not installed`)]}),r?.state===`unsupported`&&(0,V.jsx)(`p`,{role:`status`,children:e(`Login items are unsupported on this platform.`)}),r?.state===`no-runtime`&&(0,V.jsx)(`p`,{role:`status`,children:e(`Install Node or Bun to start the web app at login.`)}),a&&(0,V.jsx)(h_,{info:a}),(0,V.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e(`Use these commands to apply the change now:`)}),(0,V.jsxs)(`div`,{className:`space-y-1 font-mono text-xs`,children:[(0,V.jsx)(`p`,{children:`om-memory-system web`}),(0,V.jsx)(`p`,{children:`om-memory-system web install`}),(0,V.jsx)(`p`,{children:`om-memory-system web uninstall`}),(0,V.jsx)(`p`,{children:`om-memory-system web status`})]}),s&&(0,V.jsx)(`p`,{role:`status`,className:`text-sm`,children:s})]})}function h_({info:e}){let t=$(),n=mg(e);return(0,V.jsxs)(`div`,{className:`space-y-1 text-sm`,children:[(0,V.jsxs)(`p`,{children:[t(`Running version`),`: `,e.running,` · `,t(`Global command`),`:`,` `,e.global??t(`not installed globally`)]}),n.kind===`older`&&(0,V.jsx)(`p`,{role:`status`,children:t(`A newer OMMS copy runs in place of the global install. The global install is optional. To update it:`)}),n.kind===`newer`&&(0,V.jsx)(`p`,{role:`status`,className:`text-amber-600`,children:t(`The global install is newer than the running OMMS. The next Pi or OpenCode start replaces the web app.`)}),n.kind===`missing`&&(0,V.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:t(`OMMS is not installed globally. A global install is optional.`)}),n.command&&(0,V.jsx)(`p`,{className:`font-mono text-xs`,children:n.command})]})}function g_(e){let t=e.trim();return t===``||t.startsWith(`~/`)||t.startsWith(`/`)||/^[A-Za-z]:[\\/]/.test(t)||t.startsWith(`\\\\`)}function __(e,t,n){return n?t:typeof e==`string`?e:``}function v_(){let e=$(),[t,n]=(0,_.useState)(),[r,i]=(0,_.useState)(``),[a,o]=(0,_.useState)(``),[s,c]=(0,_.useState)(!1),l=(0,_.useRef)(!1);(0,_.useEffect)(()=>{let e=!0,t=t=>{e&&(n(t),i(e=>__(t.settings.claudeConfigDir?.globalValue,e,l.current)))},r=rg();Q(`/api/settings`).then(e=>{r.isCurrent()&&t(e)}).catch(t=>{e&&o(t.message)});let a=ag(e=>t(e));return()=>{e=!1,a()}},[]);async function u(){if(t){if(!g_(r)){o(e(`Enter a full path, or a path that starts with ~/.`));return}c(!0);try{await Q(`/api/settings`,{method:`PATCH`,body:JSON.stringify({edits:{claudeConfigDir:r.trim()},revision:t.revision})}),l.current=!1,o(e(`Saved. Capture and import use this folder now.`))}catch(e){o(e.message)}await ig(),c(!1)}}return(0,V.jsxs)(`section`,{className:`space-y-3 rounded-xl border border-border bg-card p-4`,"aria-label":e(`Claude Code folder`),children:[(0,V.jsx)(`h2`,{className:`text-section-title font-semibold`,children:e(`Claude Code folder`)}),(0,V.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:e(`Set this when Claude Code does not use ~/.claude, for example when you start it with CLAUDE_CONFIG_DIR. Leave it empty to use the default.`)}),(0,V.jsxs)(`label`,{className:`block space-y-1 text-sm`,children:[(0,V.jsx)(`span`,{children:e(`Claude Code folder`)}),(0,V.jsx)(`input`,{className:`w-full rounded border border-border bg-background p-2 font-mono`,placeholder:`~/.claude`,value:r,disabled:s||!t,onChange:e=>{l.current=!0,i(e.target.value)}})]}),(0,V.jsx)(`button`,{type:`button`,className:`rounded border border-border px-3 py-1.5 text-sm`,disabled:s||!t,onClick:()=>void u(),children:e(`Save folder`)}),(0,V.jsx)(y_,{folder:t?.claudeFolder}),a&&(0,V.jsx)(`p`,{role:`status`,className:`text-sm`,children:a})]})}function y_({folder:e}){let t=$();if(!e)return null;let n={setting:t(`this setting`),env:t(`the CLAUDE_CONFIG_DIR variable of the web app`),default:t(`the default folder`)};return(0,V.jsxs)(`div`,{className:`space-y-1 text-sm`,children:[(0,V.jsxs)(`p`,{children:[t(`Transcripts folder in use`),`: `,(0,V.jsx)(`span`,{className:`font-mono`,children:e.root})]}),(0,V.jsxs)(`p`,{children:[t(`From`),`: `,n[e.source]]}),!e.exists&&(0,V.jsxs)(`p`,{role:`status`,className:`text-amber-600`,children:[t(`This folder does not exist. Claude Code capture and import will not work:`),` `,(0,V.jsx)(`span`,{className:`font-mono`,children:e.root})]})]})}function b_(){let e=$(),[t,n]=(0,_.useState)(!1),[r,i]=(0,_.useState)(),[a,o]=(0,_.useState)(``);async function s(e){try{i(await Q(`/api/settings/log?lines=200${e?`&filter=capture`:``}`)),o(``)}catch(e){o(e.message)}}return(0,_.useEffect)(()=>{s(t)},[t]),(0,V.jsxs)(`section`,{className:`space-y-3 rounded-xl border border-border bg-card p-4`,"aria-label":e(`Log`),children:[(0,V.jsx)(`h2`,{className:`text-section-title font-semibold`,children:e(`Log`)}),(0,V.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3 text-sm`,children:[(0,V.jsxs)(`label`,{children:[(0,V.jsx)(`input`,{type:`checkbox`,checked:t,onChange:e=>n(e.target.checked)}),` `,e(`Capture attempts only`)]}),(0,V.jsx)(`button`,{type:`button`,className:`rounded-lg border border-border px-3 py-1`,onClick:()=>void s(t),children:e(`Refresh`)}),r&&(0,V.jsx)(`button`,{type:`button`,className:`rounded-lg border border-border px-3 py-1`,onClick:()=>void navigator.clipboard.writeText(r.path),children:e(`Copy log path`)})]}),(0,V.jsx)(`p`,{className:`break-all text-xs text-muted-foreground`,children:r?.path}),a&&(0,V.jsx)(`p`,{role:`alert`,children:a}),(0,V.jsx)(`pre`,{className:`max-h-80 overflow-auto rounded-lg bg-background p-3 text-xs whitespace-pre-wrap break-words`,"aria-label":e(`Log lines`),children:r?r.lines.length?r.lines.join(`
124
+ `):e(`No log has been written yet.`):e(`Loading log…`)})]})}var x_=[{code:`en`,name:`English`},{code:`id`,name:`Bahasa Indonesia`},{code:`zh`,name:`中文`},{code:`ja`,name:`日本語`},{code:`es`,name:`Español`},{code:`fr`,name:`Français`},{code:`de`,name:`Deutsch`},{code:`ru`,name:`Русский`},{code:`pt`,name:`Português`},{code:`ar`,name:`العربية`},{code:`ko`,name:`한국어`}];function S_(e){return typeof e==`string`&&e?e:`auto`}function C_(e){let t=[...x_];return e!==`auto`&&!t.some(t=>t.code===e)&&t.push({code:e}),t}function w_({value:e,onChange:t,disabled:n}){let r=$();return(0,V.jsxs)(gn,{id:`capture-language`,className:`w-full rounded-lg border border-border bg-background p-2 text-sm`,value:e,disabled:n,onChange:e=>t(e.target.value),children:[(0,V.jsx)(`option`,{value:`auto`,children:r(`Automatic`)}),C_(e).map(e=>(0,V.jsx)(`option`,{value:e.code,children:e.name??e.code},e.code))]})}function T_(){let e=$(),[t,n]=(0,_.useState)(),[r,i]=(0,_.useState)(``),[a,o]=(0,_.useState)(!1);(0,_.useEffect)(()=>{let e=!0,t=rg();Q(`/api/settings`).then(r=>{e&&t.isCurrent()&&n(r)}).catch(t=>{e&&i(t.message)});let r=ag(t=>{e&&n(t)});return()=>{e=!1,r()}},[]);async function s(n){if(t){o(!0);try{await Q(`/api/settings`,{method:`PATCH`,body:JSON.stringify({edits:{autoCaptureLanguage:n},revision:t.revision})}),i(e(`Saved. New memories use this language.`))}catch(e){i(e.message)}await ig(),o(!1)}}return(0,V.jsxs)(`section`,{className:`space-y-3 rounded-xl border border-border bg-card p-4`,"aria-label":e(`Memory language`),children:[(0,V.jsx)(`h2`,{className:`text-section-title font-semibold`,children:e(`Memory language`)}),(0,V.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:e(`The language that new memory summaries are written in. Automatic detects it from your prompt, but a Latin-script prompt under 100 characters counts as English.`)}),(0,V.jsx)(`label`,{className:`block space-y-1 text-sm`,htmlFor:`capture-language`,children:e(`Summary language`)}),(0,V.jsx)(w_,{value:S_(t?.settings.autoCaptureLanguage?.value),disabled:a||!t,onChange:e=>void s(e)}),r&&(0,V.jsx)(`p`,{role:`status`,className:`text-sm`,children:r})]})}var E_={"settings-section-external-api":Cg,"settings-section-models":bg,"settings-section-embedding":Hg,"settings-section-keys":r_,"settings-section-diagnostics":f_,"settings-section-health":p_,"settings-section-claude-folder":v_,"settings-section-capture-language":T_,"settings-section-profiles":i_,"settings-section-web-app":m_,"settings-section-log":b_};function D_(){return(0,_.useEffect)(()=>{su(window.location.hash,document)},[]),(0,V.jsx)(`div`,{className:`settings-view space-y-6`,children:Qh.map(({id:e})=>{let t=E_[e];return(0,V.jsx)(`div`,{id:e,className:`scroll-mt-20 md:scroll-mt-4`,children:(0,V.jsx)(t,{})},e)})})}function O_(e,t,n){let r=!n&&e!==null&&e.revision===t.revision;return{page:r?{...t,listedAt:e.listedAt}:t,sameListing:r}}function k_(e){return!e||e.total<=0?null:{percent:e.percent,done:`${e.done.toLocaleString(`en-US`)} / ${e.total.toLocaleString(`en-US`)}`,minutesLeft:e.minutesLeft===null?`unknown`:`about ${e.minutesLeft}`}}function A_(e,t){let n=e?.state===`running`,r=e?.paused===!0;return{runNow:!n&&!r&&!t,pause:n&&!r,resume:r&&!t}}function j_(e){let t=t=>{let n=e[t]?.run;return n?.state===`running`||n?.paused===!0};return{pi:t(`pi`),opencode:t(`opencode`),"claude-code":t(`claude-code`)}}function M_(e,t){return e??!t}function N_(e,t){let n=t.indexOf(`/`);if(t!==`inherit`&&t!==`external`&&(n<1||n===t.length-1))throw Error(`Enter a model as provider/model.`);return{[`${e}BackfillModel`]:t}}function P_(e,t){if(t?.state===`running`)return t.phase===`profile`?{kind:`learning-profile`,done:t.profileDone??0,total:t.profileTotal??0}:{kind:`running`};if(t?.paused)return{kind:`paused`};if(t?.state===`failed`&&(t.updatedAt??t.startedAt??0)>=(e?.updatedAt??0))return{kind:`failed`,error:t.error??e?.error??null};if(!e||e.state===`not-started`)return t?.state===`done`?{kind:`imported`}:{kind:`not-started`};let n=t?.state===`done`&&(e.counts.failed??0)>0;return e.state===`failed`&&!n?{kind:`failed`,error:e.error}:e.state===`running`?{kind:`running`}:e.counts.pending>0?{kind:`stopped`,pending:e.counts.pending}:e.counts.unresolved>0?{kind:`partly`,unresolved:e.counts.unresolved}:{kind:`imported`}}function F_(e){return e?.state===`running`&&e.phase!==`profile`}function I_(e){return!e||e.state===`running`||!e.state||!e.updatedAt||!e.surface?null:{finishedAt:e.updatedAt,surface:e.surface,imported:e.imported??0,skipped:e.skipped??0,failed:e.failed??0,state:e.state}}function L_(e,t){let n=0;return async r=>{let i=++n;try{let t=await r;i===n&&e(t)}catch(e){i===n&&t?.(e)}}}function R_(e){let t=document.getElementById(`directory-maps-${e}`),n=t?.parentElement;if(!t||!n){typeof window<`u`&&window.location&&xu(`${Y.memory}#directory-maps-${e}`);return}n.open=!0,t.focus({preventScroll:!0}),t.scrollIntoView?.({behavior:`smooth`,block:`start`})}function z_({badge:e,host:t}){let n=$(),[r,i]=(()=>{switch(e.kind){case`imported`:return[`${n(`Imported`)} ✅`,`border-green-600/40 text-green-700`];case`partly`:return[`${n(`Partly imported`)} (${e.unresolved} ${n(`unresolved`)})`,`border-amber-500/50 text-amber-700`];case`running`:return[n(`Running`),`border-primary/50 text-primary`];case`learning-profile`:return[`${n(`Learning profile`)} ${e.done} / ${e.total}`,`border-primary/50 text-primary`];case`paused`:return[n(`Paused`),`border-border text-muted-foreground`];case`stopped`:return[`${n(`Stopped`)} (${e.pending} ${n(`pending`)})`,`border-amber-500/50 text-amber-700`];case`failed`:return[`${n(`Failed`)} ⛔️`,`border-red-600/40 text-red-700`];case`not-started`:return[n(`Not started`),`border-border text-muted-foreground`]}})(),a=B(`inline-block rounded-full border px-2 py-0.5 text-xs font-medium`,i);return e.kind===`partly`?(0,V.jsx)(`a`,{href:`/memory#directory-maps-${t}`,onClick:e=>{e.preventDefault(),R_(t)},"aria-label":`${_g(t)}: ${n(`Resolve missing project folders`)}. ${r}`,className:B(a,`underline focus-visible:outline-2 focus-visible:outline-ring`),children:r}):(0,V.jsx)(`span`,{className:a,title:e.kind===`failed`&&e.error?e.error:void 0,children:r})}var B_=[`pi`,`opencode`,`claude-code`];function V_(){let e=$(),[t,n]=(0,_.useState)({}),[r,i]=(0,_.useState)({});return(0,_.useEffect)(()=>{let e=L_(n),t=L_(i),r=()=>{e(Q(`/api/settings/backfill`)),t(Q(`/api/settings/backfill/runs`))};r();let a=setInterval(r,1e4),o=ag(r);return()=>{clearInterval(a),o()}},[]),(0,V.jsx)(`div`,{className:`flex flex-wrap gap-2`,"aria-label":e(`Import status`),children:B_.map(e=>(0,V.jsxs)(`div`,{className:`flex items-center gap-2 rounded-lg border border-border px-3 py-1.5 text-sm`,children:[(0,V.jsx)(`span`,{className:`font-medium`,children:_g(e)}),(0,V.jsx)(z_,{host:e,badge:P_(t[e]??null,r[e]?.run??null)})]},e))})}function H_(e){let t=$(),[n,r]=(0,_.useState)(``),[i,a]=(0,_.useState)(null),[o,s]=(0,_.useState)(null),[c,l]=(0,_.useState)(!1),[u,d]=(0,_.useState)(``),f=`rounded border border-border px-3 py-1.5 text-sm disabled:opacity-50`;async function p(t){try{let n=await Q(`/api/settings/imports/sources/validate`,{method:`POST`,body:JSON.stringify({host:e.host,path:t})});a(n),r(n.displayPath),e.onChoose(n),d(``)}catch(e){d(e.message)}}async function m(t){try{let n=await Q(`/api/settings/imports/sources/browse`,{method:`POST`,body:JSON.stringify({host:e.host,...t?{path:t}:{}})});s(n),d(``)}catch(e){let t=e.message;/loopback/i.test(t)&&l(!0),d(t)}}function h(){a(null),r(``),s(null),e.onChoose(null)}return(0,V.jsxs)(`div`,{className:`space-y-2 text-sm`,children:[(0,V.jsxs)(`label`,{className:`block`,children:[e.host===`pi`?t(`Pi sessions folder or one .jsonl session file`):e.host===`claude-code`?t(`Claude Code transcripts folder`):t(`OpenCode database file`),(0,V.jsx)(`input`,{className:`mt-1 block w-full rounded border border-border bg-background p-2 font-mono`,dir:`ltr`,value:n,placeholder:t(`Absolute path, for example on a mounted volume`),onChange:e=>r(e.target.value)})]}),(0,V.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,V.jsx)(`button`,{type:`button`,className:f,disabled:!n.trim(),onClick:()=>void p(n.trim()),children:t(`Use this source`)}),!c&&(0,V.jsx)(`button`,{type:`button`,className:f,onClick:()=>void m(o?.path),children:t(`Browse`)}),i&&(0,V.jsx)(`button`,{type:`button`,className:f,onClick:h,children:t(`Use the default location`)})]}),i&&(0,V.jsxs)(`p`,{role:`status`,children:[t(`Chosen source`),`:`,` `,(0,V.jsx)(`bdi`,{dir:`ltr`,className:`font-mono break-all`,children:i.displayPath})]}),u&&(0,V.jsx)(`p`,{role:`alert`,children:u}),o&&(0,V.jsxs)(`div`,{className:`rounded border border-border p-2`,children:[(0,V.jsx)(`p`,{dir:`ltr`,className:`font-mono text-xs break-all`,children:o.path}),(0,V.jsxs)(`ul`,{className:`max-h-60 overflow-auto`,children:[o.parent&&(0,V.jsx)(`li`,{children:(0,V.jsx)(`button`,{type:`button`,className:`underline`,onClick:()=>void m(o.parent),children:`..`})}),o.entries.map(n=>(0,V.jsxs)(`li`,{className:`flex items-center gap-2`,children:[n.kind===`folder`?(0,V.jsx)(`button`,{type:`button`,className:`underline`,onClick:()=>void m(n.path),children:(0,V.jsxs)(`bdi`,{dir:`ltr`,children:[n.name,`/`]})}):(0,V.jsx)(`bdi`,{dir:`ltr`,className:`font-mono text-xs`,children:n.name}),(n.kind!==`folder`||e.host!==`opencode`)&&(0,V.jsx)(`button`,{type:`button`,className:`text-xs underline`,onClick:()=>void p(n.path),children:t(`Choose`)})]},n.path))]}),o.truncated&&(0,V.jsx)(`p`,{className:`text-xs`,children:t(`Only the first 500 entries are shown.`)})]})]})}function U_(e){let t=/^(\d{4})-(\d{2})-(\d{2})$/.exec(e);return t?[Number(t[1]),Number(t[2])-1,Number(t[3])]:null}function W_(e){let t=U_(e);return t?new Date(t[0],t[1],t[2],0,0,0,0).getTime():void 0}function G_(e){let t=U_(e);return t?new Date(t[0],t[1],t[2],23,59,59,999).getTime():void 0}var K_=[`pi`,`opencode`,`claude-code`],q_=()=>({mode:`ids`,picked:new Map});function J_(){let e=e=>({enabled:e,source:null,page:null,listedWith:``,selection:q_(),modelChoice:`external`});return{hosts:{pi:e(!0),opencode:e(!1),"claude-code":e(!1)},scope:`current-project`,project:``,maps:``,since:``,until:``,profileBatch:``,force:!1,memories:!0,profile:!0}}function Y_(e,t){return JSON.stringify([e.hosts[t].source?.sourceToken,e.scope,e.project,e.maps])}function X_(e,t){let n=e.hosts[t].page;return n?n.total-(e.scope===`all-projects`?n.unresolvedCount:0):0}function Z_(e,t){let n=e.hosts[t].selection;return n.mode===`all`?X_(e,t)-n.excluded.size:n.picked.size}function Q_(e,t){if(!t.selectable||!t.directory)return e;if(e.mode===`all`){let n=new Set(e.excluded);return n.has(t.key)?n.delete(t.key):n.add(t.key),{mode:`all`,excluded:n}}let n=new Map(e.picked);return n.has(t.key)?n.delete(t.key):n.set(t.key,t.directory),{mode:`ids`,picked:n}}function $_(e){return e.split(`
125
+ `).map(e=>e.trim()).filter(Boolean).map(e=>{let t=e.indexOf(`=`);if(t<1||t===e.length-1)throw Error(`Directory maps must be old=new, one per line`);return{from:e.slice(0,t),to:e.slice(t+1)}})}function ev(e){if(!e.memories&&!e.profile)return`Choose at least one output.`;if(!K_.some(t=>e.hosts[t].enabled))return`Choose at least one host.`;try{$_(e.maps);let t=e.since?W_(e.since):void 0,n=e.until?G_(e.until):void 0;if(t!==void 0&&n!==void 0&&t>n)return`Prompt date from must not be after Prompt date to.`}catch(e){return e.message}return e.profileBatch&&(!Number.isInteger(Number(e.profileBatch))||Number(e.profileBatch)<1)?`Profile batch size must be a positive integer.`:null}function tv(e,t){let n=ev(e);if(n)throw Error(n);return{hosts:K_.filter(t=>e.hosts[t].enabled).map(t=>{let n=e.hosts[t];if(!n.page||n.listedWith!==Y_(e,t))throw Error(`Options changed. Refresh the session list first.`);let r=n.selection;return{host:t,source:n.page.source.sourceToken,modelChoice:n.modelChoice||void 0,selection:r.mode===`all`||X_(e,t)===0?{mode:`all`,excludedKeys:r.mode===`all`?[...r.excluded]:[],revision:n.page.revision,listedAt:n.page.listedAt}:{mode:`ids`,sessions:[...r.picked].map(([e,t])=>({key:e,directory:t})),listedAt:n.page.listedAt}}}),options:{dryRun:t,force:e.force,skipMemories:!e.memories,skipProfile:!e.profile,scope:e.scope,...e.scope===`current-project`&&e.project?{project:e.project}:{},...e.since?{since:W_(e.since)}:{},...e.until?{until:G_(e.until)}:{},...e.profileBatch?{profileBatch:Number(e.profileBatch)}:{},pathMaps:$_(e.maps)}}}function nv(e){return JSON.stringify({...e,hosts:K_.filter(t=>e.hosts[t].enabled).map(t=>{let n=e.hosts[t];return{host:t,...n,selection:n.selection.mode===`all`?{mode:`all`,excluded:[...n.selection.excluded].sort()}:{mode:`ids`,picked:[...n.selection.picked].sort()}}})})}var rv=`mt-1 block w-full min-w-0 rounded border border-border bg-background p-2`,iv=`rounded border border-border px-3 py-1.5 text-sm disabled:opacity-50`;function av({draft:e,advanced:t,onChange:n,onAdvanced:r}){let i=$();return(0,V.jsxs)(`div`,{className:`space-y-3`,children:[(0,V.jsxs)(`div`,{className:`flex flex-wrap gap-4 text-sm`,children:[(0,V.jsxs)(`label`,{children:[(0,V.jsx)(`input`,{type:`checkbox`,"aria-label":i(`Project memories`),checked:e.memories,onChange:e=>n({memories:e.target.checked})}),` `,i(`Project memories`)]}),(0,V.jsxs)(`label`,{children:[(0,V.jsx)(`input`,{type:`checkbox`,"aria-label":i(`User profile`),checked:e.profile,onChange:e=>n({profile:e.target.checked})}),` `,i(`User profile`),` `,i(`(preferences, patterns, and workflows)`)]})]}),(0,V.jsxs)(`label`,{className:`block text-sm`,children:[i(`Scope`),(0,V.jsxs)(gn,{"aria-label":i(`Scope`),className:rv,value:e.scope,onChange:e=>n({scope:e.target.value}),children:[(0,V.jsx)(`option`,{value:`current-project`,children:i(`Current project`)}),(0,V.jsx)(`option`,{value:`all-projects`,children:i(`All projects`)})]})]}),(0,V.jsx)(`button`,{type:`button`,className:iv,onClick:r,"aria-expanded":t,children:i(t?`Hide advanced options`:`Advanced options`)}),(0,V.jsxs)(`div`,{hidden:!t,className:`space-y-3 rounded-lg border border-border p-3`,children:[(0,V.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:[e.scope===`current-project`&&(0,V.jsxs)(`label`,{className:`text-sm`,children:[i(`Project directory`),(0,V.jsx)(`input`,{"aria-label":i(`Project directory`),className:`mt-1 block w-full min-w-0 rounded border border-border bg-background p-2`,dir:`ltr`,value:e.project,placeholder:i(`Current directory`),onChange:e=>n({project:e.target.value})})]}),[[`Prompt date from`,`since`],[`Prompt date to`,`until`],[`Profile batch size`,`profileBatch`]].map(([t,r])=>(0,V.jsxs)(`label`,{className:`text-sm`,children:[i(t),(0,V.jsx)(`input`,{"aria-label":i(t),type:r===`profileBatch`?`text`:`date`,inputMode:r===`profileBatch`?`numeric`:void 0,className:rv,value:e[r],onChange:e=>n({[r]:e.target.value})})]},r))]}),(0,V.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:i(`Prompt dates are inclusive, use your time zone, and filter the turns inside each session, not the list. Empty dates include every turn.`)}),(0,V.jsxs)(`label`,{className:`block text-sm`,children:[i(`Directory maps (old=new, one per line)`),(0,V.jsx)(`textarea`,{"aria-label":i(`Directory maps (old=new, one per line)`),dir:`ltr`,className:rv,rows:2,value:e.maps,onChange:e=>n({maps:e.target.value})})]}),(0,V.jsxs)(`label`,{className:`block text-sm`,children:[(0,V.jsx)(`input`,{type:`checkbox`,"aria-label":i(`Re-analyse handled history`),checked:e.force,onChange:e=>n({force:e.target.checked})}),` `,i(`Re-analyse handled history`)]}),(0,V.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:i(`Re-analysis applies to the selected outputs. Each profile prompt can be forcibly re-analysed once. Findings merge into the existing profile.`)})]})]})}function ov({host:e,draft:t,readiness:n,advanced:r,listing:i,onChange:a,onList:o,onUnresolved:s}){let c=$(),l=t.hosts[e],u=l.page,d=u&&l.listedWith!==Y_(t,e),f=X_(t,e),p=e=>l.selection.mode===`all`?!l.selection.excluded.has(e.key):l.selection.picked.has(e.key),m={recorded:c(`recorded`),mapped:c(`mapped`),worktree:c(`project root`),unresolved:c(`missing`)},h=e===`pi`&&n?.piReader.available===!1;return(0,V.jsxs)(`section`,{hidden:!l.enabled,"aria-label":_g(e),className:`space-y-3 rounded-lg border border-border p-3 min-w-0`,children:[(0,V.jsx)(`h3`,{className:`text-subsection-title font-semibold`,children:_g(e)}),(0,V.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[c(`Source`),`:`,` `,(0,V.jsx)(`bdi`,{dir:`ltr`,className:`break-all`,children:l.source?.displayPath??u?.source.displayPath??c(`default location`)})]}),h&&(0,V.jsx)(`p`,{role:`alert`,children:c(n?.piReader.reason??`Pi session reader is unavailable. Fix the reader or deselect Pi.`)}),e===`claude-code`&&n?.claudeCode&&(0,V.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[c(`Claude Code transcripts`),`:`,` `,(0,V.jsx)(`bdi`,{dir:`ltr`,className:`font-mono break-all`,children:n.claudeCode.defaultRoot}),` `,`(`,c(n.claudeCode.defaultRootFound?`found`:`not found`),`).`,` `,c(`Claude Code imports always use the external API.`)]}),(0,V.jsx)(`div`,{hidden:!r,children:(0,V.jsx)(H_,{host:e,onChoose:e=>a({source:e})})}),(0,V.jsx)(`button`,{type:`button`,className:iv,disabled:i||h,onClick:()=>o(0,!0),children:c(u?`Refresh list`:`List sessions`)}),d&&(0,V.jsx)(`p`,{role:`status`,className:`text-sm`,children:c(`Options changed. Refresh the session list first.`)}),u&&t.scope===`current-project`&&u.unresolvedCount>0&&(0,V.jsxs)(`p`,{className:`text-sm`,children:[c(`Sessions with directories that no longer exist`),`: `,u.unresolvedCount,`.`,` `,(0,V.jsx)(`button`,{type:`button`,className:`underline`,onClick:s,children:c(`Show them and add a directory map`)})]}),u&&(0,V.jsxs)(`div`,{className:`space-y-2`,children:[(0,V.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 text-sm`,children:[(0,V.jsxs)(`span`,{role:`status`,children:[c(`Selected`),`: `,Z_(t,e),` / `,f]}),(0,V.jsxs)(`button`,{type:`button`,className:`rounded border border-border px-3 py-1.5 text-sm disabled:opacity-50`,disabled:f===0,onClick:()=>a({selection:{mode:`all`,excluded:new Set}}),children:[c(`Select all matching`),` (`,f,`)`]}),(0,V.jsx)(`button`,{type:`button`,className:`rounded border border-border px-3 py-1.5 text-sm disabled:opacity-50`,onClick:()=>a({selection:q_()}),children:c(`Clear selection`)})]}),(0,V.jsxs)(`div`,{className:`max-w-full overflow-x-auto`,children:[(0,V.jsxs)(`table`,{className:`w-full text-start text-sm`,children:[(0,V.jsx)(`thead`,{children:(0,V.jsx)(`tr`,{className:`text-muted-foreground`,children:[`Select`,`Created`,`Session`,`Project directory`,`Resolved by`].map(e=>(0,V.jsx)(`th`,{className:`p-1`,children:c(e)},e))})}),(0,V.jsx)(`tbody`,{children:u.rows.map(t=>(0,V.jsxs)(`tr`,{className:`border-t border-border`,children:[(0,V.jsx)(`td`,{className:`p-1`,children:(0,V.jsx)(`input`,{type:`checkbox`,"aria-label":`${_g(e)}: ${c(`Select`)} ${t.sessionId??t.key}`,checked:t.selectable&&p(t),disabled:!t.selectable,onChange:()=>a({selection:Q_(l.selection,t)})})}),(0,V.jsx)(`td`,{className:`p-1 whitespace-nowrap`,children:t.createdAt?new Date(t.createdAt).toLocaleString():`—`}),(0,V.jsx)(`td`,{className:`p-1 font-mono text-xs`,children:(0,V.jsx)(`bdi`,{dir:`ltr`,children:t.sessionId??t.key})}),(0,V.jsx)(`td`,{className:`p-1 font-mono text-xs break-all`,children:(0,V.jsx)(`bdi`,{dir:`ltr`,children:t.directory??t.recordedDirectory??`—`})}),(0,V.jsx)(`td`,{className:`p-1`,children:m[t.via]})]},t.key))})]}),u.total===0&&(0,V.jsx)(`p`,{className:`text-sm`,children:c(`No sessions match.`)})]}),(0,V.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 text-sm`,children:[(0,V.jsx)(`button`,{type:`button`,className:`rounded border border-border px-3 py-1.5 text-sm disabled:opacity-50`,disabled:i||u.offset===0,onClick:()=>o(Math.max(0,u.offset-50),!1),children:c(`Previous`)}),(0,V.jsxs)(`span`,{children:[u.total?u.offset+1:0,`–`,Math.min(u.offset+50,u.total),` /`,` `,u.total]}),(0,V.jsx)(`button`,{type:`button`,className:`rounded border border-border px-3 py-1.5 text-sm disabled:opacity-50`,disabled:i||u.offset+50>=u.total,onClick:()=>o(u.offset+50,!1),children:c(`Next`)})]})]}),(0,V.jsxs)(`label`,{className:`block text-sm`,children:[c(`Import model`),(0,V.jsx)(`div`,{dir:`ltr`,children:(0,V.jsxs)(gn,{"aria-label":c(`Import model`),className:rv,value:l.modelChoice,onChange:e=>a({modelChoice:e.target.value}),children:[(0,V.jsx)(`option`,{value:``,children:c(`None`)}),e!==`claude-code`&&n?.opencode.models.map(e=>(0,V.jsxs)(`option`,{value:`${e.provider}/${e.model}`,children:[e.name,` (`,e.provider,`/`,e.model,`)`]},`${e.provider}/${e.model}`)),(0,V.jsxs)(`option`,{value:`external`,children:[c(`Saved external API`),n&&n.external.state!==`ready`?` (${c(`not ready`)})`:``]})]})})]}),e!==`claude-code`&&n&&!n.opencode.available&&(0,V.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:c(`An import with an OpenCode signed-in model runs from the terminal or with /import in OpenCode.`)}),(0,V.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:c(`Configured, not tested.`)})]})}function sv(e,t){let n=e.summary,r=n?.profile;return[[`sessions`,e.sessions],[`Memory units`,n?.unitsTotal??e.total],[`Pending memory units`,n?.unitsWouldImport],[`Imported memory units`,n?.unitsImported],[`Already handled memory units`,n?.unitsAlreadyHandled],[`Skipped memory units`,n?.unitsSkipped],[`Failed memory units`,n?.unitsFailed],[`Held-back turns`,n?.unitsHeldBack],[`Untimed turns`,n?.unitsUntimed],[`Load errors`,n?.loadErrors],[`Profile prompts`,r?r.promptsRecorded+r.promptsWouldRecord:void 0],[`Already handled profile prompts`,r?.promptsAlreadyHandled],[`Profile batches`,r?.batchesBuilt],[`Estimated profile analysis calls`,e.profileEstimate?.analysisCalls],[`Waiting prompts inside OMMS`,e.profileEstimate?.waitingPrompts],[`Unresolved sessions`,n?.unresolved]].filter(([,e])=>e!==void 0).map(([e,n])=>`${t(String(e))}: ${n}`).join(` · `)}function cv(e,t){let n=e.match(/^(Pi|OpenCode|Claude Code): /),r=n?e.slice(n[0].length):e,i=`Refresh the preview and retry.`,a=r.endsWith(` ${i}`),o=a?r.slice(0,-31):r,s=a&&/^[a-z][a-z0-9]*(?:-[a-z0-9]+)*\.$/.test(o),c=t(o);return(0,V.jsxs)(V.Fragment,{children:[n&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`bdi`,{dir:`ltr`,children:n[1]}),`: `]}),s?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`bdi`,{dir:`ltr`,children:o.slice(0,-1)}),`.`]}):c===o?(0,V.jsx)(`bdi`,{dir:`ltr`,children:o}):c.split(/(Pi|OpenCode|Claude Code)/).map((e,t)=>/^(Pi|OpenCode|Claude Code)$/.test(e)?(0,V.jsx)(`bdi`,{dir:`ltr`,children:e},t):e),a&&(0,V.jsxs)(V.Fragment,{children:[` `,t(i)]})]})}function lv({job:e}){let t=$();if(!e)return null;let n=e.hosts??(e.host?[{...e,host:e.host}]:[]);return(0,V.jsxs)(`div`,{role:`status`,className:`space-y-3 text-sm`,"aria-label":t(`Import results`),children:[(0,V.jsxs)(`p`,{children:[t(e.dryRun?`Preview (dry run)`:`Import`),` · `,t(e.state),e.activeHost&&(0,V.jsxs)(V.Fragment,{children:[` `,`· `,t(`Current host`),`: `,_g(e.activeHost)]})]}),(0,V.jsxs)(`p`,{children:[t(`Combined counts`),`: `,sv(e,t)]}),(0,V.jsx)(`ul`,{className:`space-y-2`,children:n.map(e=>(0,V.jsxs)(`li`,{className:`rounded border border-border p-2`,children:[(0,V.jsxs)(`p`,{children:[_g(e.host),` ·`,` `,t(e.state===`no-work`?`No work to process`:e.state),e.phase&&(0,V.jsxs)(V.Fragment,{children:[` `,`·`,` `,t(e.phase===`profile`?`Learning profile`:e.phase===`preparing`?`preparing`:`Memory extraction`)]})]}),e.phase===`profile`?(0,V.jsxs)(`p`,{children:[t(`Profile batches`),`: `,e.profileProcessed??0,`/`,e.profileTotal??0]}):e.phase===`memory`&&e.total!==void 0&&(0,V.jsxs)(`p`,{children:[t(`Memory units`),`: `,e.processed??0,`/`,e.total]}),(0,V.jsx)(`p`,{children:sv(e,t)}),(e.error||e.blocker)&&(0,V.jsx)(`p`,{role:`alert`,children:cv(e.error??e.blocker,t)}),e.report&&(0,V.jsx)(`pre`,{dir:`ltr`,className:`max-w-full overflow-auto whitespace-pre-wrap break-words rounded bg-background p-2 text-xs`,children:e.report})]},e.host))}),e.error&&(0,V.jsx)(`p`,{role:`alert`,children:cv(e.error,t)}),e.report&&(0,V.jsx)(`pre`,{dir:`ltr`,className:`max-w-full overflow-auto whitespace-pre-wrap break-words rounded bg-background p-2 text-xs`,children:e.report}),e.dryRun&&(0,V.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:t(`Analysis calls are an estimate. Matching, deduplication, retries, and newly waiting prompts can add calls.`)})]})}function uv(e){return ag(()=>e())}var dv={"missing-model":`The external API has no memoryModel in the global config`,"missing-url":`The external API has no memoryApiUrl in the global config`,"missing-key":`The external API key is missing in the OpenCode process; check memoryApiKey and its env:// or file:// source`,"unsupported-provider":`The memoryProvider in the global config is not supported for imports`};function fv({profilePreset:e=0}={}){let t=$(),[n,r]=(0,_.useState)(J_),[i,a]=(0,_.useState)(!1),[o,s]=(0,_.useState)(null),[c,l]=(0,_.useState)(null),[u,d]=(0,_.useState)(null),[f,p]=(0,_.useState)({}),[m,h]=(0,_.useState)(!1),[g,v]=(0,_.useState)(``),y=(0,_.useRef)(!1),b=(0,_.useRef)({pi:0,opencode:0,"claude-code":0}),x=(0,_.useRef)(!0),S=(0,_.useRef)(sg()),C=nv(n),w=(0,_.useRef)(C);w.current=C;let T=K_.filter(e=>n.hosts[e].enabled),E=c?.state===`running`||c?.state===`cancelling`||c?.state===`preparing`||c?.state===`queued`;function D(){let e=S.current.begin();return Q(`/api/settings/imports/current`).then(t=>{x.current&&e()&&l(t.job)})}(0,_.useEffect)(()=>{x.current=!0;let e=()=>{d(null),Q(`/api/settings/imports/readiness`).then(e=>{x.current&&s(e)}).catch(()=>{x.current&&s(null)})};e(),D().catch(()=>{});let t=uv(e);return()=>{x.current=!1,t()}},[]),(0,_.useEffect)(()=>{if(!E)return;let e=setInterval(()=>{y.current||D().catch(e=>{x.current&&v(e.message)})},1e3);return()=>clearInterval(e)},[E]),(0,_.useEffect)(()=>{e&&(r(e=>({...e,memories:!1,profile:!0,force:!0})),d(null))},[e]);function O(e){d(null),r(t=>({...t,...e}))}function ee(e,t){d(null),r(n=>({...n,hosts:{...n.hosts,[e]:{...n.hosts[e],...t}}}))}async function te(e,t,i){let a=++b.current[e],o=Y_(n,e);d(null),p(t=>({...t,[e]:!0}));try{let s=await Q(`/api/settings/imports/sessions`,{method:`POST`,body:JSON.stringify({host:e,...n.hosts[e].source?{source:n.hosts[e].source.sourceToken}:{},scope:n.scope,...n.scope===`current-project`&&n.project?{project:n.project}:{},pathMaps:$_(n.maps),offset:t,limit:50,refresh:i})});if(!x.current||b.current[e]!==a)return;r(t=>{if(Y_(t,e)!==o)return t;let n=t.hosts[e],r=O_(n.page,s,i);return{...t,hosts:{...t.hosts,[e]:{...n,page:r.page,listedWith:o,selection:r.sameListing?n.selection:q_()}}}}),v(``)}catch(t){x.current&&b.current[e]===a&&v(t.message)}finally{x.current&&b.current[e]===a&&p(t=>({...t,[e]:!1}))}}let k=ev(n),ne=T.some(e=>e===`pi`&&o?.piReader.available===!1),re=T.map(e=>{let r=n.hosts[e];return r.page?r.listedWith===Y_(n,e)?X_(n,e)>0&&Z_(n,e)===0?`${_g(e)}: ${t(`Select at least one session.`)}`:r.selection.mode===`ids`&&r.selection.picked.size>1e3?`${_g(e)}: ${t(`Select at most 1000 sessions one by one, or use Select all matching.`)}`:null:`${_g(e)}: ${t(`Options changed. Refresh the session list first.`)}`:`${_g(e)}: ${t(`List sessions first.`)}`}).find(Boolean),ie=T.map(e=>{let r=n.hosts[e].modelChoice,i=null;return o?r?r===`external`&&o.external.state!==`ready`?i=dv[o.external.state]??`The external API is not ready`:e===`claude-code`&&r!==`external`?i=`Claude Code imports use the external API. Complete the external API settings.`:r!==`external`&&!o.opencode.models.some(e=>`${e.provider}/${e.model}`===r)&&(i=`No import model is ready. Connect a model in OpenCode or complete the external API settings.`):i=`No import model is ready. Connect a model in OpenCode or complete the external API settings.`:i=`Model readiness is unknown. Reload the page.`,i?`${_g(e)}: ${t(i)}`:null}).find(Boolean),ae=!!(u&&u.fingerprint===C&&u.id===c?.id&&c.dryRun&&c.state===`done`&&!c.error&&!c.hosts?.some(e=>e.error||e.blocker||[`failed`,`cancelled`,`not-run`].includes(e.state))),A=m||E||T.some(e=>f[e])||ne||!!(k||re);async function j(e){if(y.current||A||!e&&(!ae||ie))return;if(!e){let e=[n.memories&&t(`Project memories`),n.profile&&t(`User profile`)].filter(Boolean).join(` · `),r=T.map(e=>`${_g(e)}: ${n.hosts[e].modelChoice===`external`?`${t(`Saved external API`)} (${o?.external.provider}/${o?.external.model})`:n.hosts[e].modelChoice}`).join(`
126
+ `);if(!window.confirm([t(`This import makes model calls. Continue?`),T.map(_g).join(` · `),t(n.scope===`current-project`?`Current project`:`All projects`),n.project,e,r,sv(c??{},t),...(c?.hosts??[]).map(e=>`${_g(e.host)}: ${sv(e,t)}`)].filter(Boolean).join(`
127
+ `)))return}y.current=!0,S.current.begin(),h(!0);let r=C;d(null);try{let t=await Q(`/api/settings/imports`,{method:`POST`,body:JSON.stringify(tv(n,e))});if(!x.current)return;l(t),e&&r===w.current&&d({id:t.id,fingerprint:r}),v(``)}catch(e){x.current&&v(e.message),D().catch(()=>{})}finally{y.current=!1,x.current&&h(!1)}}async function oe(){if(!y.current){y.current=!0,S.current.begin();try{let e=await Q(`/api/settings/imports/current/cancel`,{method:`POST`,body:`{}`});x.current&&l(e.job)}catch(e){x.current&&v(e.message)}finally{y.current=!1}}}return(0,V.jsxs)(`section`,{className:`space-y-3 rounded-xl border border-border bg-card p-4 min-w-0`,"aria-label":t(`Import chat history`),children:[(0,V.jsx)(`h2`,{className:`text-section-title font-semibold`,children:t(`Import chat history`)}),(0,V.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:t(`Conversations populate project facts. User prompts populate personal preferences, recurring patterns, and workflow steps.`)}),(0,V.jsxs)(`p`,{className:`flex flex-wrap gap-3 text-sm`,children:[(0,V.jsx)(`a`,{className:`underline`,href:Y.project,onClick:e=>{e.preventDefault(),xu(Y.project)},children:t(`Project memories`)}),(0,V.jsx)(`a`,{className:`underline`,href:Y.profile,onClick:e=>{e.preventDefault(),xu(Y.profile)},children:t(`User profile`)}),(0,V.jsx)(`a`,{className:`underline`,href:`${Y.settings}#settings-section-profiles`,onClick:e=>{e.preventDefault(),xu(`${Y.settings}#settings-section-profiles`)},children:t(`Profile identity in Settings`)})]}),(0,V.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:t(`Hosts keep their existing user identities. All hosts does not merge profiles with different identities.`)}),(0,V.jsx)(V_,{}),(0,V.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3 text-sm`,children:[K_.map(e=>(0,V.jsxs)(`label`,{children:[(0,V.jsx)(`input`,{type:`checkbox`,"aria-label":_g(e),checked:n.hosts[e].enabled,onChange:t=>ee(e,{enabled:t.target.checked})}),` `,_g(e)]},e)),(0,V.jsx)(`button`,{type:`button`,className:iv,onClick:()=>O({hosts:{pi:{...n.hosts.pi,enabled:!0},opencode:{...n.hosts.opencode,enabled:!0},"claude-code":{...n.hosts[`claude-code`],enabled:!0}}}),children:t(`All hosts`)}),(0,V.jsxs)(`span`,{role:`status`,children:[t(`Selected hosts`),`: `,T.length]})]}),(0,V.jsx)(av,{draft:n,advanced:i,onChange:O,onAdvanced:()=>a(e=>!e)}),K_.map(e=>(0,V.jsx)(ov,{host:e,draft:n,readiness:o,advanced:i,listing:!!f[e],onChange:t=>ee(e,t),onList:(t,n)=>te(e,t,n),onUnresolved:()=>{O({scope:`all-projects`}),a(!0)}},e)),k&&(0,V.jsx)(`p`,{role:`alert`,children:t(k)}),!E&&(re||ie)&&(0,V.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:re??ie}),!ae&&!E&&(0,V.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:t(`Preview the current selection before starting an import.`)}),(0,V.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,V.jsx)(`button`,{type:`button`,className:iv,disabled:A,onClick:()=>j(!0),children:t(`Preview (dry run)`)}),(0,V.jsx)(`button`,{type:`button`,className:iv,disabled:A||!ae||!!ie,onClick:()=>j(!1),children:t(`Start import`)}),E&&(0,V.jsx)(`button`,{type:`button`,className:`rounded border border-border px-3 py-1.5 text-sm disabled:opacity-50`,disabled:c?.state===`cancelling`,onClick:()=>oe(),children:t(`Cancel after current unit`)})]}),g&&(0,V.jsx)(`p`,{role:`alert`,children:cv(g,t)}),(0,V.jsx)(lv,{job:c})]})}var pv=[`pi`,`opencode`,`claude-code`];function mv(){let e=$(),[t,n]=(0,_.useState)(),[r,i]=(0,_.useState)({pi:null,opencode:null,"claude-code":null}),[a,o]=(0,_.useState)(),[s,c]=(0,_.useState)({}),[l,u]=(0,_.useState)({}),[d,f]=(0,_.useState)({}),[p,m]=(0,_.useState)(``),[h,g]=(0,_.useState)(!1),[v,y]=(0,_.useState)({}),b=(0,_.useRef)(!1),x=(0,_.useRef)(L_(i,e=>m(e.message))),S=()=>x.current(Q(`/api/settings/backfill`)),C=(0,_.useRef)(L_(o,e=>m(e.message))),w=()=>C.current(Q(`/api/settings/backfill/runs`));(0,_.useEffect)(()=>{let e=!0;Q(`/api/settings`).then(t=>{e&&n(t)}).catch(t=>{e&&m(t.message)}),S(),w();for(let t of[`pi`,`opencode`])Q(`/api/settings/models?host=${t}`).then(n=>{e&&c(e=>({...e,[t]:n}))}).catch(()=>{e&&c(e=>({...e,[t]:{available:!1}}))});let t=ag(t=>{e&&(n(t),S())});return()=>{e=!1,t()}},[]),(0,_.useEffect)(()=>{let e=!0,t=setInterval(()=>{e&&(S(),w())},3e3);return()=>{e=!1,clearInterval(t)}},[]),(0,_.useEffect)(()=>{b.current||!a||(b.current=!0,y(j_(a)))},[a]);async function T(n){if(t){g(!0);try{await Q(`/api/settings`,{method:`PATCH`,body:JSON.stringify({edits:n,revision:t.revision})}),m(e(`Saved. Changes apply at the next run.`))}catch(e){m(e.message)}await ig(),g(!1)}}async function E(t,n){g(!0);try{await Q(`/api/settings/backfill/${t}/${n}`,{method:`POST`,body:`{}`}),m(e(n===`pause`?`Pausing after the current exchange.`:`Backfill started.`))}catch(e){m(e.message)}await w(),g(!1)}function D(t,n){try{T(N_(t,n.trim()))}catch(t){m(e(t.message))}}return(0,V.jsxs)(`section`,{className:`space-y-3 rounded-xl border border-border bg-card p-4`,"aria-label":e(`Automatic import`),children:[(0,V.jsx)(`h2`,{className:`text-section-title font-semibold`,children:e(`Automatic import`)}),(0,V.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:e(`Automatic import makes model calls. A model change applies at the next run. Turning it off stops a running import after the current exchange.`)}),(0,V.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:e(`Automatic import reads older conversations when a host starts. It populates project memories and user profile input. The first backfill fixes a cutoff; later turns use live capture.`)}),(0,V.jsxs)(`label`,{className:`flex items-center gap-2 text-sm`,children:[(0,V.jsx)(`input`,{type:`checkbox`,checked:!!t?.settings.autoBackfill?.globalValue,disabled:h||!t,onChange:e=>void T({autoBackfill:e.target.checked})}),e(`Import past chats automatically`)]}),pv.map(n=>{let i=String(t?.settings[`${n}BackfillModel`]?.globalValue??`inherit`),o=l[n]??i,c=s[n]?.models??[],p=o===`inherit`||o===`external`||c.some(e=>`${e.provider}/${e.model}`===o),m=fg({memoryProvider:t?.settings.memoryProvider?.globalValue,memoryModel:t?.settings.memoryModel?.globalValue,memoryApiUrl:t?.settings.memoryApiUrl?.globalValue,keySet:!!t?.secrets?.memoryApiKey?.set}),g=a?.[n]?.run??null,_=a?.[n]?.runNowUnavailable??null,b=A_(g,_),x=F_(g)?k_(g):null,S=I_(g),C=P_(r[n],g),w=M_(d[n],p),T=g?.paused?e(`paused`):e(g?.state??r[n]?.state??`not started`);return(0,V.jsxs)(`details`,{className:`min-w-0 rounded-lg border border-border p-3 text-sm`,open:v[n]??!1,onToggle:e=>{let t=e.currentTarget.open;y(e=>({...e,[n]:t}))},children:[(0,V.jsxs)(`summary`,{className:`cursor-pointer rounded focus-visible:outline-2 focus-visible:outline-ring`,children:[(0,V.jsx)(`h3`,{className:`inline text-subsection-title font-semibold`,children:_g(n)}),(0,V.jsxs)(`span`,{className:`mt-1 block text-xs text-muted-foreground`,children:[e(`State`),`: `,T,` · `,e(`Pending`),`: `,r[n]?.counts.pending??0,` ·`,` `,e(`Unresolved sessions`),`: `,r[n]?.counts.unresolved??0]})]}),(0,V.jsxs)(`div`,{className:`mt-3 space-y-2`,children:[n===`claude-code`?(0,V.jsx)(`p`,{className:`text-muted-foreground`,children:e(`Claude Code backfill always uses the external API. It has no backfill model setting.`)}):(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(`label`,{className:`block`,children:[e(`Backfill model`),(0,V.jsx)(`div`,{dir:`ltr`,children:(0,V.jsxs)(gn,{"aria-label":`${_g(n)} ${e(`Backfill model`)}`,className:`mt-1 block w-full rounded border border-border bg-background p-2`,value:w?`typed`:o,onChange:e=>{let t=e.target.value;f(e=>({...e,[n]:t===`typed`})),u(e=>({...e,[n]:t}))},children:[(0,V.jsx)(`option`,{value:`inherit`,children:e(`Same as live capture`)}),(0,V.jsx)(`option`,{value:`external`,disabled:m.length>0,children:e(`External API`)}),c.map(e=>(0,V.jsxs)(`option`,{value:`${e.provider}/${e.model}`,children:[e.name,` (`,e.provider,`/`,e.model,`)`]},`${e.provider}/${e.model}`)),(0,V.jsx)(`option`,{value:`typed`,children:e(`Manual provider/model`)})]})})]}),w&&(0,V.jsx)(`input`,{"aria-label":`${n} ${e(`Manual provider/model`)}`,className:`w-full rounded border border-border bg-background p-2`,dir:`ltr`,placeholder:`provider/model`,value:o===`typed`?``:o,onChange:e=>u(t=>({...t,[n]:e.target.value}))}),m.length>0&&(0,V.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[e(`External API needs`),`: `,m.join(`, `)]}),s[n]?.available===!1&&(0,V.jsx)(`p`,{children:s[n].reason?e(s[n].reason):e(`Model list unavailable. Enter provider/model manually.`)}),(0,V.jsx)(`button`,{type:`button`,className:`rounded border border-border px-3 py-1.5`,disabled:h||!t,onClick:()=>D(n,o),children:e(`Save model`)})]}),(0,V.jsxs)(`p`,{children:[e(`State`),`: `,T,g?.state===`running`&&g.surface&&` (${e(`started from ${g.surface}`)})`]}),C.kind===`learning-profile`&&(0,V.jsxs)(`p`,{className:`text-muted-foreground`,children:[e(`All exchanges are done. Learning the profile from the imported prompts`),`:`,` `,C.done,` / `,C.total,` `,e(`batches`)]}),x&&(0,V.jsxs)(`div`,{className:`space-y-1`,children:[(0,V.jsx)(`div`,{role:`progressbar`,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":x.percent,className:`h-2 w-full overflow-hidden rounded bg-muted`,children:(0,V.jsx)(`div`,{className:`h-full bg-primary`,style:{width:`${x.percent}%`}})}),(0,V.jsxs)(`p`,{className:`text-muted-foreground`,children:[x.percent,`% · `,x.done,` · `,e(`Minutes left`),`:`,` `,x.minutesLeft===`unknown`?e(`unknown`):x.minutesLeft.replace(`about`,e(`about`))]})]}),(0,V.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,V.jsx)(`button`,{type:`button`,className:`rounded border border-border px-3 py-1.5`,disabled:h||!b.runNow,onClick:()=>void E(n,`run`),children:e(`Run now`)}),(0,V.jsx)(`button`,{type:`button`,className:`rounded border border-border px-3 py-1.5`,disabled:h||!b.pause,onClick:()=>void E(n,`pause`),children:e(`Pause`)}),(0,V.jsx)(`button`,{type:`button`,className:`rounded border border-border px-3 py-1.5`,disabled:h||!b.resume,onClick:()=>void E(n,`resume`),children:e(`Resume`)})]}),_&&(0,V.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:_}),S&&(0,V.jsxs)(`p`,{className:`text-muted-foreground`,children:[e(`Last run`),`: `,new Date(S.finishedAt).toLocaleString(),` ·`,` `,e(`started from ${S.surface}`),` · `,e(S.state),` · `,e(`Imported`),`:`,` `,S.imported,` · `,e(`Skipped`),`: `,S.skipped,` · `,e(`Failed`),`:`,` `,S.failed]}),r[n]&&(0,V.jsxs)(`div`,{className:`space-y-1 text-muted-foreground`,children:[!S&&(0,V.jsxs)(`p`,{children:[e(`Imported`),`: `,r[n].counts.imported,` · `,e(`Skipped`),`:`,` `,r[n].counts.skipped,` · `,e(`Failed`),`: `,r[n].counts.failed]}),(0,V.jsxs)(`p`,{children:[e(`Pending`),`: `,r[n].counts.pending,` · `,e(`Unresolved sessions`),`:`,` `,r[n].counts.unresolved,r[n].counts.unresolved>0&&(0,V.jsxs)(V.Fragment,{children:[` `,(0,V.jsx)(`a`,{className:`underline focus-visible:outline-2 focus-visible:outline-ring`,href:`/memory#directory-maps-${n}`,"aria-label":`${_g(n)}: ${e(`Resolve missing project folders`)}`,onClick:e=>{e.preventDefault(),R_(n)},children:e(`Resolve missing project folders`)})]})]}),(0,V.jsxs)(`p`,{children:[e(`Model`),`: `,(0,V.jsx)(`bdi`,{dir:`ltr`,children:r[n].model??e(`none`)})]}),(0,V.jsxs)(`p`,{children:[e(`Cutoff`),`: `,new Date(r[n].cutoff).toLocaleString()]}),r[n].error&&(0,V.jsx)(`p`,{role:`alert`,children:r[n].error})]})]})]},n)}),p&&(0,V.jsx)(`p`,{role:`status`,className:`text-sm`,children:p})]})}var hv=`Enter a whole number from 50 to 100000.`;function gv(e){let t=e.trim();if(!/^\d+$/.test(t))return{ok:!1,message:hv};let n=Number(t);return n<50||n>1e5?{ok:!1,message:hv}:{ok:!0,value:n}}function _v(e,t){let n=gv(t);return n.ok?n.value===e?{kind:`none`}:{kind:`edit`,edits:{userProfileAutoCleanupInterval:n.value}}:{kind:`error`,message:n.message}}function vv(e,t){return e===t?null:{userProfileAutoCleanupEnabled:t}}var yv=500;function bv(){let e=$(),[t,n]=(0,_.useState)(),[r,i]=(0,_.useState)(``),[a,o]=(0,_.useState)(``),[s,c]=(0,_.useState)(``),[l,u]=(0,_.useState)(!1),d=t?.settings.userProfileAutoCleanupEnabled?.globalValue!==!1,f=Number(t?.settings.userProfileAutoCleanupInterval?.globalValue??yv);(0,_.useEffect)(()=>{let e=!0;Q(`/api/settings`).then(t=>{e&&n(t)}).catch(t=>{e&&c(t.message)});let t=ag(t=>{e&&n(t)});return()=>{e=!1,t()}},[]),(0,_.useEffect)(()=>{t&&i(String(f))},[t,f]);async function p(n){if(t){u(!0);try{await Q(`/api/settings`,{method:`PATCH`,body:JSON.stringify({edits:n,revision:t.revision})}),c(e(`Saved. Changes apply at the next learning pass.`))}catch(e){c(e.message)}await ig(),u(!1)}}function m(){let t=_v(f,r);if(t.kind===`error`){o(e(t.message));return}o(``),t.kind===`edit`&&p(t.edits)}return(0,V.jsxs)(`div`,{className:`space-y-2 border-t border-border pt-3`,children:[(0,V.jsx)(`h3`,{className:`text-sm font-semibold`,children:e(`Automatic profile cleanup`)}),(0,V.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:e(`After a learning pass, OMMS merges duplicate profile items and removes vague ones by itself, in the background. Each run makes about one model call for every 100 items and takes several minutes on a large profile. Undo last automatic cleanup on the Profile page puts the changes back.`)}),(0,V.jsxs)(`label`,{className:`flex items-center gap-2 text-sm`,children:[(0,V.jsx)(`input`,{type:`checkbox`,checked:d,disabled:l||!t,onChange:e=>{let t=vv(d,e.target.checked);t&&p(t)}}),e(`Clean up the profile automatically`)]}),(0,V.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 text-sm`,children:[(0,V.jsx)(`label`,{htmlFor:`auto-cleanup-interval`,children:e(`Run every this many analysed prompts`)}),(0,V.jsx)(`input`,{id:`auto-cleanup-interval`,className:`w-28 rounded border border-border bg-background px-2 py-1`,inputMode:`numeric`,value:r,disabled:l||!t,"aria-invalid":a?!0:void 0,"aria-describedby":a?`auto-cleanup-interval-error`:void 0,onChange:e=>{i(e.target.value),o(``)}}),(0,V.jsx)(`button`,{type:`button`,className:`rounded border border-border px-3 py-1.5`,disabled:l||!t||r.trim()===String(f),onClick:m,children:e(`Save interval`)})]}),a&&(0,V.jsx)(`p`,{id:`auto-cleanup-interval-error`,role:`alert`,className:`text-sm text-destructive`,children:a}),s&&(0,V.jsx)(`p`,{role:`status`,className:`text-sm text-muted-foreground`,children:s})]})}function xv({preview:e,job:t,busy:n,onStart:r,onPause:i}){let a=$(),o=t.state===`running`;return(0,V.jsxs)(`div`,{className:`space-y-2 text-sm`,children:[(0,V.jsxs)(`p`,{children:[a(`Prompts waiting for profile learning`),`: `,e.waiting,` ·`,` `,a(`Estimated profile analysis calls`),`: `,e.calls]}),t.state!==`idle`&&(0,V.jsxs)(`p`,{role:`status`,children:[a(`Batches done`),`: `,t.batchesBuilt,` · `,a(`Prompts waiting`),`: `,t.remaining,t.state===`paused`&&` · ${a(`Paused`)}`,t.state===`done`&&` · ${a(`Finished`)}`]}),t.state===`superseded`&&(0,V.jsx)(`p`,{children:a(`A newer catch-up run took over.`)}),t.state===`failed`&&(0,V.jsxs)(`p`,{className:`text-red-600`,children:[a(`Stopped`),`: `,t.reason??`error`]}),o?(0,V.jsx)(`button`,{type:`button`,className:`rounded border border-border px-3 py-1.5`,onClick:i,children:a(`Pause`)}):(0,V.jsx)(`button`,{type:`button`,className:`rounded border border-border px-3 py-1.5`,disabled:n||e.waiting===0,onClick:r,children:a(t.state===`idle`||t.state===`done`?`Analyse waiting prompts`:`Resume`)})]})}function Sv({onReanalyse:e}={}){let t=$(),[n,r]=(0,_.useState)(),[i,a]=(0,_.useState)({state:`idle`,batchesBuilt:0,remaining:0}),[o,s]=(0,_.useState)(!1),[c,l]=(0,_.useState)(!1),[u,d]=(0,_.useState)(``);async function f(){let e=await Q(`/api/settings/profile/catch-up`);r(e.preview),a(e.job)}(0,_.useEffect)(()=>{f().catch(e=>d(e.message)),Q(`/api/web/status`).then(e=>s(!!e.isLocal)).catch(()=>{})},[]),(0,_.useEffect)(()=>{if(i.state!==`running`)return;let e=setInterval(()=>void f().catch(()=>{}),2e3);return()=>clearInterval(e)},[i.state]);async function p(){if(!n)return;let e=i.state!==`idle`&&i.state!==`done`;if(window.confirm(`${t(`Start profile learning for the waiting prompts? Model calls`)}: ${n.calls}`)){l(!0);try{a(await Q(`/api/settings/profile/catch-up/${e?`resume`:`start`}`,{method:`POST`,body:`{}`})),d(``)}catch(e){d(e.message)}l(!1)}}async function m(){try{a(await Q(`/api/settings/profile/catch-up/pause`,{method:`POST`,body:`{}`}))}catch(e){d(e.message)}}return(0,V.jsxs)(`section`,{className:`space-y-3 rounded-xl border border-border bg-card p-4`,"aria-label":t(`Profile learning`),children:[(0,V.jsx)(`h2`,{className:`text-section-title font-semibold`,children:t(`Profile learning`)}),(0,V.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:t(`Analyse waiting prompts reads prompts already inside OMMS with the saved external API, 50 eligible prompts per analysis call. Completed history is not re-analysed. Preferences, patterns, and workflows are the outputs.`)}),(0,V.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:t(`Analysis calls are an estimate. Matching, deduplication, retries, and newly waiting prompts can add calls.`)}),(0,V.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:t(`Re-analyse chat history opens a forced profile-only import. It preserves your profile and project memories. Preview and confirmation are required. Each profile prompt can be forcibly re-analysed once.`)}),e&&(0,V.jsx)(`button`,{type:`button`,className:`rounded border border-border px-3 py-1.5 text-sm`,onClick:e,children:t(`Re-analyse chat history`)}),n&&(o?(0,V.jsx)(xv,{preview:n,job:i,busy:c,onStart:()=>void p(),onPause:()=>void m()}):(0,V.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:t(`Open this page on the computer that runs OMMS to start a catch-up run.`)})),u&&(0,V.jsx)(`p`,{role:`alert`,children:u}),(0,V.jsx)(bv,{})]})}var Cv=`Enter a positive whole number.`,wv=[{key:`maxMemories`,id:`memory-maxMemories`,default:10,unit:`Results`,affects:`Maximum memory search results. Manual searches can request fewer; prompt retrieval uses this ceiling.`,min:1,max:2**53-1,accepted:Cv,kind:`integer`},{key:`chatMessage.maxMemories`,id:`memory-chatMessage-maxMemories`,default:3,unit:`Memories`,affects:`Recent memories added at session start in OpenCode V1 and Claude Code. Pi and OpenCode V2 use prompt-based search instead.`,min:1,max:2**53-1,accepted:Cv,kind:`integer`},{key:`autoCaptureMaxContextBytes`,id:`memory-autoCaptureMaxContextBytes`,default:131072,unit:`Bytes`,affects:`Conversation input sent to the memory-summary model through the shared capture pipeline. Smaller values can omit conversation text.`,min:16384,max:16777216,accepted:`Enter a whole number from 16,384 to 16,777,216.`,kind:`integer`},{key:`userProfileMaxContextBytes`,id:`memory-userProfileMaxContextBytes`,default:32768,unit:`Bytes`,affects:`OpenCode profile-learning input. Smaller values can omit prompts from that input. This control does not limit the other hosts' profile input.`,min:1024,max:16777216,accepted:`Enter a whole number from 1,024 to 16,777,216.`,kind:`integer`},{key:`retrievalMaxTokens`,id:`memory-retrievalMaxTokens`,default:2e3,unit:`Approximate tokens`,affects:`Automatic memory context, including profile text and formatting, added to agent requests across all hosts. Smaller values can show fewer or shorter memories.`,min:256,max:65536,accepted:`Enter a whole number from 256 to 65,536.`,kind:`integer`},{key:`similarityThreshold`,id:`memory-similarityThreshold`,default:.6,unit:`Similarity score`,affects:`Lowest score a memory needs to be returned by search. Lower values return more memories, including less relevant ones. Higher values can return none. The default depends on the embedder.`,min:0,max:1,accepted:`Enter a number from 0 to 1.`,kind:`decimal`}];[...wv.flatMap(e=>[e.unit,e.affects,e.accepted])];function Tv(e,t){let n=typeof t==`string`?t.trim():``;if(!n||!/^-?\d+(\.\d+)?$/.test(n))return;let r=Number(n);if(!(e.kind===`integer`&&!Number.isInteger(r)))return r>=e.min&&r<=e.max?r:void 0}function Ev(e){return e.toLocaleString(`en-US`)}function Dv(e,t,n){let r=t[e.key];return typeof r==`string`?r:String(n[e.key]??e.default)}function Ov(e,t){let n=!1;for(let r of wv){let i=e[r.key];if(typeof i!=`string`)continue;let a=Tv(r,i);if(a===void 0)return!1;a!==(t[r.key]??r.default)&&(n=!0)}return n}function kv(e,t){let n={};if(!Ov(e,t))return n;for(let r of wv){let i=e[r.key];if(typeof i!=`string`)continue;let a=Tv(r,i);a!==(t[r.key]??r.default)&&(n[r.key]=a)}return n}var Av=`Config changed. Reload settings and save again.`;function jv(e){if(e===`Config changed. Reload settings and save again.`)return{kind:`stale`};let t=wv.map(e=>e.key.replace(/\./g,`\\.`)).join(`|`),n=RegExp(`^Invalid (${t}) setting\\b`).exec(e);return n?{kind:`invalid`,key:n[1]}:{kind:`unknown`}}function Mv(){let e=$(),[t,n]=(0,_.useState)(),[r,i]=(0,_.useState)({}),[a,o]=(0,_.useState)(!1),[s,c]=(0,_.useState)(),l=(0,_.useRef)(!1);(0,_.useEffect)(()=>{let e=!0,t=rg();Q(`/api/settings`).then(r=>{e&&t.isCurrent()&&n(r)}).catch(()=>{e&&c({kind:`load-failed`})});let r=ag(t=>{e&&n(t)});return()=>{e=!1,r()}},[]);let u={},d={};for(let e of wv){let n=t?.settings[e.key];u[e.key]=typeof n?.globalValue==`number`?n.globalValue:void 0,d[e.key]=typeof n?.default==`number`?n.default:e.default}let f=Ov(r,u),p=`~/.config/omms/omms.jsonc`,m=e(`Edit ~/.config/omms/omms.jsonc directly to set these limits without the web UI.`).split(p);async function h(){if(!t||!f||l.current)return;let e=kv(r,u);Object.keys(e).length&&await v(e)}async function g(e){!t||a||l.current||t.settings[e]?.hasGlobal&&await v({[e]:null})}async function v(e){if(!t||l.current)return;l.current=!0,o(!0);let n=!1,r;try{await Q(`/api/settings`,{method:`PATCH`,body:JSON.stringify({edits:e,revision:t.revision})}),n=!0}catch(e){r=e}let a=await ig()!==null;o(!1),l.current=!1,n?(i(t=>{let n={...t};for(let t of Object.keys(e))delete n[t];return n}),c({kind:`saved`,reloaded:a})):c({kind:`save-failed`,failure:jv(r?.message??``),reloaded:a})}function y(t){if(t.kind===`load-failed`)return e(`The memory settings could not be loaded. Reload the page to try again.`);if(t.kind===`saved`)return t.reloaded?e(`Saved. New memory operations use these limits.`):`${e(`Saved. New memory operations use these limits.`)} ${e(`Reload the page before saving again.`)}`;let n=t.reloaded?e(`Current settings were reloaded; check the values and save again.`):e(`The current settings could not be reloaded. Reload the page.`);if(t.failure.kind===`stale`)return og(e(Av),n);if(t.failure.kind===`invalid`){let r=t.failure,i=wv.find(e=>e.key===r.key);return og(`${e(`Invalid setting`)} ${i.key}: ${e(i.accepted)}`,n)}return og(e(`The memory settings could not be saved.`),n)}return(0,V.jsxs)(`section`,{className:`space-y-3 rounded-xl border border-border bg-card p-4`,"aria-label":e(`Memory limits`),children:[(0,V.jsx)(`h2`,{className:`text-section-title font-semibold`,children:e(`Memory limits`)}),(0,V.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e(`Byte limits count UTF-8 bytes.`)}),(0,V.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e(`Approximate tokens are estimated as ceil(UTF-8 bytes / 4). A provider can count more or fewer tokens for the same text.`)}),(0,V.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e(`These controls do not delete stored data, set a spending limit, limit model replies, or control Graphify output.`)}),(0,V.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[m[0],(0,V.jsx)(`code`,{dir:`ltr`,children:p}),m[1]]}),(0,V.jsxs)(`form`,{className:`space-y-3`,onSubmit:e=>{e.preventDefault(),h()},children:[(0,V.jsx)(`div`,{className:Kg,children:(0,V.jsxs)(`table`,{className:`w-full min-w-[56rem] text-sm`,children:[(0,V.jsx)(`caption`,{className:`sr-only`,children:e(`Memory limits`)}),(0,V.jsx)(`thead`,{className:Jg,children:(0,V.jsx)(`tr`,{children:[`Setting`,`Value`,`Default`,`Unit`,`Affects`].map(t=>(0,V.jsx)(`th`,{className:Yg,children:e(t)},t))})}),(0,V.jsx)(`tbody`,{children:wv.map(n=>{let o=r[n.key],s=Dv(n,r,u),c=typeof o==`string`&&Tv(n,o)===void 0,l=t?.settings[n.key],f=l?.source===`project`,p=l?.hasGlobal===!0,m=p&&typeof l?.globalValue==`number`&&l.globalValue!==d[n.key];return(0,V.jsxs)(`tr`,{className:Xg,children:[(0,V.jsxs)(`td`,{className:Zg,children:[(0,V.jsx)(`code`,{dir:`ltr`,children:n.key}),f&&(0,V.jsxs)(`div`,{className:`mt-1 space-y-0.5 text-xs text-amber-600`,children:[(0,V.jsxs)(`p`,{children:[e(`Effective value`),`: `,String(l?.value??``),` (`,e(`project`),`)`]}),(0,V.jsx)(`p`,{children:e(`Project override is active. Changes to the global file may not take effect here.`)}),(0,V.jsx)(`p`,{children:e(`The project value stays in force. Saving edits the global file only.`)})]})]}),(0,V.jsxs)(`td`,{className:Zg,children:[(0,V.jsx)(`input`,{type:`number`,id:`${n.id}-input`,className:`w-36 tabular-nums`,inputMode:n.kind===`decimal`?`decimal`:`numeric`,step:n.kind===`decimal`?.01:1,min:n.min,max:n.max,"aria-label":`${n.key} ${e(`Value`)}`,"aria-describedby":`${n.id}-help`,"aria-invalid":c||void 0,disabled:a,value:s,onChange:e=>i(t=>({...t,[n.key]:e.target.value}))}),(0,V.jsx)(`span`,{id:`${n.id}-help`,className:`block text-xs ${c?`text-red-600`:`text-muted-foreground`}`,children:e(n.accepted)}),(0,V.jsx)(`button`,{type:`button`,"data-reset":n.key,className:`mt-1 block text-xs underline`,disabled:a||!p,"aria-label":`${n.key} ${e(`Reset to default`)}`,onClick:()=>void g(n.key),children:e(`Reset to default`)})]}),(0,V.jsxs)(`td`,{className:`${Zg} tabular-nums`,children:[Ev(d[n.key]),m&&(0,V.jsx)(`span`,{className:`block text-xs text-amber-600`,children:e(`Differs from default`)})]}),(0,V.jsx)(`td`,{className:Zg,children:e(n.unit)}),(0,V.jsx)(`td`,{className:Zg,children:e(n.affects)})]},n.key)})})]})}),(0,V.jsxs)(`div`,{className:`flex gap-2`,children:[(0,V.jsx)(`button`,{type:`submit`,disabled:a||!t||!f,onClick:()=>void h(),children:e(`Save memory limits`)}),(0,V.jsx)(`button`,{type:`button`,disabled:a,onClick:()=>i({}),children:e(`Cancel`)})]})]}),s&&(0,V.jsx)(`p`,{role:`status`,className:`text-sm`,children:y(s)})]})}function Nv(e){let t=typeof e==`string`?e.trim():``;if(!t||!/^\d+$/.test(t))return;let n=Number(t);return n>=500&&n<=3e4?n:void 0}function Pv(e){return/^(env:\/\/[A-Za-z_][A-Za-z0-9_]*|file:\/\/.+)$/.test(e.trim())}function Fv(e){try{let t=new URL(e.trim()).hostname.toLowerCase();return!(t===`localhost`||t===`::1`||t===`[::1]`||/^127\.\d+\.\d+\.\d+$/.test(t))}catch{return!1}}function Iv(e){if(e.enabled&&(e.url.trim().length===0||e.model.trim().length===0))return{field:`url-model`};if(e.key.trim().length>0&&!Pv(e.key))return{field:`key`};if(Nv(e.timeout)===void 0)return{field:`timeout`}}function Lv(e){return Iv(e)===void 0}function Rv(e){return{rerankerEnabled:e.enabled,rerankerApiUrl:e.url.trim()||null,rerankerModel:e.model.trim()||null,rerankerApiKey:e.key.trim()||null,rerankerTimeoutMs:Nv(e.timeout)??4e3}}function zv(e){let t=e?.settings,n=e?.secrets.rerankerApiKey?.reference;return{enabled:t?.rerankerEnabled?.value===!0,url:typeof t?.rerankerApiUrl?.value==`string`?t.rerankerApiUrl.value:``,model:typeof t?.rerankerModel?.value==`string`?t.rerankerModel.value:``,key:e?.secrets.rerankerApiKey?.set?`${e.secrets.rerankerApiKey.source}://${n??``}`:``,timeout:typeof t?.rerankerTimeoutMs?.value==`number`?String(t.rerankerTimeoutMs.value):`4000`}}function Bv(){let e=$(),[t,n]=(0,_.useState)(),[r,i]=(0,_.useState)({enabled:!1,url:``,model:``,key:``,timeout:`4000`}),[a,o]=(0,_.useState)(!1),[s,c]=(0,_.useState)(),l=(0,_.useRef)(!1),u=(0,_.useRef)(void 0);(0,_.useEffect)(()=>{let e=!0,t=rg();Q(`/api/settings`).then(r=>{e&&t.isCurrent()&&(u.current=r,n(r),i(zv(r)))}).catch(()=>{e&&c({kind:`load-failed`})});let r=ag(t=>{if(!e)return;let r=u.current,a=t;u.current=a,n(a),i(e=>!r||JSON.stringify(e)===JSON.stringify(zv(r))?zv(a):e)});return()=>{e=!1,r()}},[]);let d=Iv(r),f=Lv(r),p=r.url.trim().length>0&&Fv(r.url);function m(e){i(t=>({...t,...e}))}async function h(){if(a||l.current||!f)return;l.current=!0,o(!0);let e=!1,t;try{let n=await Q(`/api/settings/reranker/test`,{method:`POST`,body:JSON.stringify({rerankerApiUrl:r.url.trim()||void 0,rerankerModel:r.model.trim()||void 0,rerankerApiKey:r.key.trim()||void 0,rerankerTimeoutMs:Nv(r.timeout)??4e3})});e=n.success===!0,t=n.code}catch{t=`reranker_unreachable`}o(!1),l.current=!1,c({kind:`test`,ok:e,code:t})}async function g(){if(!t||!f||l.current)return;l.current=!0,o(!0);let e=!1,n=!1;try{await Q(`/api/settings`,{method:`PATCH`,body:JSON.stringify({edits:Rv(r),revision:t.revision})}),e=!0}catch(e){n=e?.message?.includes(`Config changed`)===!0}let i=await ig()!==null;o(!1),l.current=!1,c(n?{kind:`save`,ok:e,reloaded:i,stale:n}:{kind:`save`,ok:e,reloaded:i})}function v(t){if(t.kind===`load-failed`)return e(`The reranker settings could not be loaded. Reload the page to try again.`);if(t.kind===`test`)return t.ok?e(`Test passed.`):`${e(`Test failed:`)} ${t.code??`reranker_unreachable`}`;let n=t.reloaded?e(`Current settings were reloaded; check the values and save again.`):e(`The current settings could not be reloaded. Reload the page.`);return t.stale?og(e(`Config changed. Reload settings and save again.`),n):t.ok?e(`Saved. New searches use these settings.`):og(e(`The reranker settings could not be saved. Reload the page to try again.`),n)}return(0,V.jsxs)(`section`,{className:`space-y-3 rounded-xl border border-border bg-card p-4`,"aria-label":e(`Reranker`),children:[(0,V.jsx)(`h2`,{className:`text-section-title font-semibold`,children:e(`Reranker`)}),(0,V.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e(`The reranker reorders the best memory search results with your reranker server and keeps the top results.`)}),(0,V.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e(`The reranker sends the prompt and the text of candidate memories to the server URL. A server on the same machine is recommended.`)}),(0,V.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e(`A project file cannot change these settings.`)}),!r.enabled&&(0,V.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e(`Search is unchanged while the switch is off.`)}),(0,V.jsxs)(`form`,{className:`space-y-3`,onSubmit:e=>{e.preventDefault(),g()},children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,V.jsx)(`input`,{type:`checkbox`,id:`reranker-enabled`,role:`switch`,checked:r.enabled,disabled:a,"aria-label":e(`Use a reranker`),onChange:e=>m({enabled:e.target.checked})}),(0,V.jsx)(`label`,{htmlFor:`reranker-enabled`,children:e(`Use a reranker`)})]}),(0,V.jsxs)(`div`,{className:`grid gap-3 md:grid-cols-2`,children:[(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`label`,{htmlFor:`reranker-url`,children:e(`Server URL`)}),(0,V.jsx)(`input`,{type:`url`,id:`reranker-url`,dir:`ltr`,placeholder:`http://127.0.0.1:3008/v1`,disabled:a,value:r.url,"aria-invalid":d?.field===`url-model`||void 0,"aria-describedby":`reranker-url-help`,onChange:e=>m({url:e.target.value})}),(0,V.jsx)(`span`,{id:`reranker-url-help`,className:`block text-xs text-muted-foreground`,children:d?.field===`url-model`?e(`Enter the server URL and model before turning the reranker on.`):`rerankerApiUrl`}),p&&(0,V.jsx)(`p`,{className:`text-xs text-amber-600`,children:e(`This URL is not on this machine: memory text leaves this machine.`)})]}),(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`label`,{htmlFor:`reranker-model`,children:e(`Model`)}),(0,V.jsx)(`input`,{type:`text`,id:`reranker-model`,dir:`ltr`,disabled:a,value:r.model,"aria-invalid":d?.field===`url-model`||void 0,onChange:e=>m({model:e.target.value})}),(0,V.jsx)(`span`,{className:`block text-xs text-muted-foreground`,children:`rerankerModel`})]}),(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`label`,{htmlFor:`reranker-key`,children:e(`Key`)}),(0,V.jsx)(`input`,{type:`text`,id:`reranker-key`,dir:`ltr`,disabled:a,value:r.key,"aria-invalid":d?.field===`key`||void 0,"aria-describedby":`reranker-key-help`,onChange:e=>m({key:e.target.value})}),(0,V.jsx)(`span`,{id:`reranker-key-help`,className:`block text-xs text-muted-foreground`,children:d?.field===`key`?e(`The key must be an env:// or file:// reference, or left empty.`):e(`Optional env:// or file:// key reference.`)})]}),(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`label`,{htmlFor:`reranker-timeout`,children:e(`Timeout`)}),(0,V.jsx)(`input`,{type:`number`,id:`reranker-timeout`,className:`tabular-nums`,inputMode:`numeric`,step:1,min:500,max:3e4,disabled:a,value:r.timeout,"aria-invalid":d?.field===`timeout`||void 0,"aria-describedby":`reranker-timeout-help`,onChange:e=>m({timeout:e.target.value})}),(0,V.jsx)(`span`,{id:`reranker-timeout-help`,className:`block text-xs text-muted-foreground`,children:d?.field===`timeout`?e(`Enter a whole number from 500 to 30,000.`):e(`milliseconds`)}),(0,V.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e(`The default of 4000 keeps the search inside OpenCode V2's 5-second wait. A value over 5000 can make OpenCode V2 send the request with no memory.`)})]})]}),(0,V.jsxs)(`div`,{className:`flex gap-2`,children:[(0,V.jsx)(`button`,{type:`submit`,disabled:a||!t||!f,onClick:()=>void g(),children:e(`Save`)}),(0,V.jsx)(`button`,{type:`button`,disabled:a||!f,onClick:()=>void h(),children:e(`Test`)}),(0,V.jsx)(`button`,{type:`button`,disabled:a,onClick:()=>i(zv(t)),children:e(`Cancel`)})]})]}),s&&(0,V.jsx)(`p`,{role:`status`,className:`text-sm`,children:v(s)})]})}function Vv(e,t){return t?t.target:e.suggestion?.kind===`map`?e.suggestion.target:``}function Hv(e,t){let n=new Map,r=new Map,i=[];for(let a of e){let e=t[a.directory],o=Vv(a,e).trim();if(a.directory!==``&&o){let t=e||a.suggestion?.kind!==`map`?`exact`:a.suggestion.confidence,r=(n.get(a.directory)?.sessions??0)+a.sessions;n.set(a.directory,{from:a.directory,to:o,sessions:r,confidence:t})}else if(a.directory!==``&&!e&&a.suggestion?.kind===`ignore`){let e=(r.get(a.directory)?.sessions??0)+a.sessions;r.set(a.directory,{directory:a.directory,sessions:e,reason:a.suggestion.reason})}else i.push({...a})}return{maps:[...n.values()],ignores:[...r.values()],unmapped:i}}function Uv(e){return new Set([...e.maps.filter(e=>e.confidence!==`guess`).map(e=>e.from),...e.ignores.map(e=>e.directory)])}function Wv(e,t,n,r){let i={},a=n.maps.filter(e=>r.has(e.from));if(a.length){let t=new Map(e.map(e=>[e.from,{...e}]));for(let e of a)t.set(e.from,{from:e.from,to:e.to});i.importPathMaps=[...t.values()]}let o=n.ignores.filter(e=>r.has(e.directory));return o.length&&(i.importIgnoredDirectories=[...new Set([...t,...o.map(e=>e.directory)])]),i}function Gv(e){let t=new Map;for(let n of e)t.set(n.to,[...t.get(n.to)??[],n]);return[...t].map(([e,t])=>({target:e,maps:t.sort((e,t)=>e.from.localeCompare(t.from))})).sort((e,t)=>t.maps.length-e.maps.length||e.target.localeCompare(t.target))}function Kv(e,t){return e(t===`exact`?`Exact`:t===`name`?`Name match`:`Guess`)}function qv(e,t){return e(t===`temporary`?`Temporary folder`:t===`node_modules`?`node_modules folder`:t===`app-data`?`App data folder`:`Skills folder`)}function Jv({host:e,rows:t,decisions:n,busy:r,onDecide:i,onResolve:a,onIgnore:o}){let s=$(),c=t.filter(e=>e.directory!==``),l=c.filter(e=>Vv(e,n[e.directory]).trim()).length;return(0,V.jsxs)(`details`,{className:`min-w-0 rounded-lg border border-border p-3`,children:[(0,V.jsxs)(`summary`,{id:`directory-maps-${e}`,className:`scroll-mt-20 cursor-pointer rounded font-medium focus-visible:outline-2 focus-visible:outline-ring`,children:[(0,V.jsxs)(`h3`,{className:`inline text-subsection-title font-semibold`,children:[_g(e),`: `,s(`Unresolved directories`)]}),(0,V.jsxs)(`span`,{className:`mt-1 block text-xs font-normal text-muted-foreground`,children:[s(`Directories`),`: `,c.length,` · `,s(`Unresolved sessions`),`:`,` `,t.reduce((e,t)=>e+t.sessions,0),` · `,s(`Rows with a target`),`:`,` `,l]})]}),(0,V.jsxs)(`div`,{className:`mt-3 space-y-2`,children:[t.length===0?(0,V.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:s(`No unresolved directories in the latest run.`)}):(0,V.jsxs)(`div`,{className:`space-y-2`,children:[(0,V.jsx)(`div`,{className:`[&_button]:h-auto [&_button]:min-h-8 [&_button]:whitespace-normal [&_button]:py-1.5`,children:(0,V.jsx)(W,{type:`button`,variant:`outline`,size:`sm`,disabled:r||c.length===0,onClick:a,children:s(`Smart resolve directories`)})}),(0,V.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:s(`Smart resolve shows each proposed map and ignore in a dialog. Tick the ones to keep, then press Confirm. Nothing is saved before that.`)})]}),t.map(e=>{if(e.directory===``)return(0,V.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[s(`No directory recorded`),` ·`,` `,e.sessions===1?s(`1 session`):`${e.sessions} ${s(`sessions`)}`,` ·`,` `,s(`These sessions cannot be mapped.`)]},`no-directory`);let t=n[e.directory],a=Vv(e,t),c=!t&&e.suggestion?.kind===`ignore`?e.suggestion:null;return(0,V.jsxs)(`div`,{className:`flex min-w-0 items-start gap-2 border-t border-border pt-2 text-sm`,children:[(0,V.jsxs)(`details`,{className:`min-w-0 flex-1`,children:[(0,V.jsxs)(`summary`,{className:`cursor-pointer rounded focus-visible:outline-2 focus-visible:outline-ring`,children:[(0,V.jsx)(`code`,{dir:`ltr`,className:`break-all`,children:e.directory}),` `,`· `,e.sessions===1?s(`1 session`):`${e.sessions} ${s(`sessions`)}`,(0,V.jsx)(`span`,{className:`mt-1 block text-xs text-muted-foreground`,children:c?(0,V.jsxs)(V.Fragment,{children:[s(`Suggested to ignore`),`: `,qv(s,c.reason)]}):(0,V.jsxs)(V.Fragment,{children:[s(`Target directory`),`:`,` `,a?(0,V.jsx)(`code`,{dir:`ltr`,className:`break-all`,children:a}):s(`No target chosen`)]})})]}),(0,V.jsxs)(`div`,{className:`mt-2 space-y-2`,children:[!e.suggestion&&(0,V.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:s(`No suggestion found.`)}),(0,V.jsx)(gl,{"aria-label":`${e.directory} ${s(`Target directory`)}`,dir:`ltr`,placeholder:s(`Target directory`),value:a,disabled:r,onChange:t=>i(e,t.target.value)})]})]}),(0,V.jsx)(W,{type:`button`,variant:`outline`,size:`sm`,className:`shrink-0`,"aria-label":`${s(`Ignore`)} ${e.directory}`,disabled:r,onClick:()=>o(e),children:s(`Ignore`)})]},e.directory)})]})]})}function Yv({host:e,review:t,busy:n,canConfirm:r,onRefresh:i,error:a,onClose:o,onConfirm:s}){let c=$(),[l,u]=(0,_.useState)(()=>({review:t,ticked:Uv(t)})),d=l.review===t?l.ticked:Uv(t),f=(e,n)=>u(r=>{let i=new Set(r.review===t?r.ticked:Uv(t));return n?i.add(e):i.delete(e),{review:t,ticked:i}}),p=[...t.maps.map(e=>e.from),...t.ignores.map(e=>e.directory)],m=p.filter(e=>d.has(e)).length,h=e=>(0,V.jsxs)(`div`,{className:`text-xs text-muted-foreground`,children:[c(`Sessions`),`: `,e]});return(0,V.jsx)($s,{open:!0,onOpenChange:e=>{!e&&!n&&o()},children:(0,V.jsxs)(nc,{className:`sm:max-w-2xl flex flex-col overflow-hidden`,showCloseButton:!n,onEscapeKeyDown:e=>{n&&e.preventDefault()},onInteractOutside:e=>{n&&e.preventDefault()},children:[(0,V.jsxs)(rc,{children:[(0,V.jsxs)(ac,{children:[c(`Review directory maps`),`: `,_g(e)]}),(0,V.jsx)(oc,{children:c(`Tick the maps and ignores to keep, then press Confirm to save them. Saved maps apply to every host on the next import or backfill run.`)})]}),(0,V.jsxs)(`div`,{className:`min-h-0 overflow-y-auto space-y-4`,children:[(0,V.jsxs)(`p`,{className:`text-sm`,children:[c(`Proposed maps`),`: `,t.maps.length,` · `,c(`Suggested to ignore`),`:`,` `,t.ignores.length,` · `,c(`No target`),`: `,t.unmapped.length]}),!p.length&&(0,V.jsx)(`p`,{className:`text-sm`,children:c(`Nothing to save. Type a target in a row, or press Ignore for folders that are not projects.`)}),t.maps.length>0&&(0,V.jsxs)(`section`,{className:`space-y-2`,children:[(0,V.jsx)(`h3`,{className:`text-subsection-title font-semibold`,children:c(`Proposed maps`)}),(0,V.jsx)(`ul`,{className:`space-y-3`,children:t.maps.map(e=>(0,V.jsxs)(`li`,{className:`flex min-w-0 items-start gap-2 border-t border-border pt-2 text-sm`,children:[(0,V.jsx)(`input`,{type:`checkbox`,className:`mt-1 shrink-0`,"aria-label":`${c(`Save this map`)} ${e.from}`,checked:d.has(e.from),disabled:n,onChange:t=>f(e.from,t.target.checked)}),(0,V.jsxs)(`div`,{className:`min-w-0`,children:[(0,V.jsx)(`code`,{dir:`ltr`,className:`block break-all`,children:e.from}),(0,V.jsxs)(`div`,{className:`mt-1`,children:[c(`Target directory`),`:`,` `,(0,V.jsx)(`code`,{dir:`ltr`,className:`break-all`,children:e.to})]}),(0,V.jsxs)(`div`,{className:`text-xs`,children:[c(`Confidence`),`: `,Kv(c,e.confidence)]}),h(e.sessions)]})]},e.from))})]}),t.ignores.length>0&&(0,V.jsxs)(`section`,{className:`space-y-2`,children:[(0,V.jsx)(`h3`,{className:`text-subsection-title font-semibold`,children:c(`Suggested to ignore`)}),(0,V.jsx)(`ul`,{className:`space-y-3`,children:t.ignores.map(e=>(0,V.jsxs)(`li`,{className:`flex min-w-0 items-start gap-2 border-t border-border pt-2 text-sm`,children:[(0,V.jsx)(`input`,{type:`checkbox`,className:`mt-1 shrink-0`,"aria-label":`${c(`Ignore`)} ${e.directory}`,checked:d.has(e.directory),disabled:n,onChange:t=>f(e.directory,t.target.checked)}),(0,V.jsxs)(`div`,{className:`min-w-0`,children:[(0,V.jsx)(`code`,{dir:`ltr`,className:`block break-all`,children:e.directory}),(0,V.jsx)(`div`,{className:`mt-1`,children:qv(c,e.reason)}),h(e.sessions)]})]},e.directory))})]}),t.unmapped.length>0&&(0,V.jsxs)(`section`,{className:`space-y-2`,children:[(0,V.jsx)(`h3`,{className:`text-subsection-title font-semibold`,children:c(`No target`)}),(0,V.jsx)(`ul`,{className:`space-y-3`,children:t.unmapped.map((e,t)=>(0,V.jsxs)(`li`,{className:`min-w-0 border-t border-border pt-2 text-sm`,children:[e.directory===``?c(`No directory recorded`):(0,V.jsx)(`code`,{dir:`ltr`,className:`block break-all`,children:e.directory}),(0,V.jsx)(`div`,{children:e.directory===``?c(`These sessions cannot be mapped.`):c(`No target chosen`)}),h(e.sessions)]},`${e.directory}-${t}`))})]})]}),a&&(0,V.jsx)(`p`,{role:`alert`,className:`text-sm text-destructive`,children:a}),(0,V.jsxs)(ic,{children:[(0,V.jsx)(W,{type:`button`,variant:`outline`,disabled:n,onClick:o,children:c(`Cancel`)}),!r&&(0,V.jsx)(W,{type:`button`,variant:`outline`,disabled:n,onClick:i,children:c(`Refresh list`)}),(0,V.jsx)(W,{type:`button`,disabled:n||!r||m===0,onClick:()=>s(new Set(p.filter(e=>d.has(e)))),children:c(n?`Saving…`:`Confirm`)})]})]})})}function Xv(){let e=$(),[t,n]=(0,_.useState)(),[r,i]=(0,_.useState)(),[a,o]=(0,_.useState)(new Set),[s,c]=(0,_.useState)({}),[l,u]=(0,_.useState)(``),[d,f]=(0,_.useState)(!1),[p,m]=(0,_.useState)(),[h,g]=(0,_.useState)(``),[v,y]=(0,_.useState)(),b=(0,_.useRef)(!1),x=(0,_.useRef)(void 0),S=()=>Q(`/api/settings/import-maps`).then(e=>{i(e),o(new Set),c({})}).catch(e=>u(e.message));(0,_.useEffect)(()=>{let e=!0;Q(`/api/settings`).then(t=>{e&&(x.current=t.revision,n(t))}).catch(t=>{e&&u(t.message)}),S();let t=ag(t=>{if(!e)return;let r=t;n(r),r.revision!==x.current&&(x.current=r.revision,Q(`/api/settings/import-maps`).then(t=>{e&&x.current===r.revision&&i(t)}).catch(()=>{}))});return()=>{e=!1,t()}},[]);function C(e,t){b.current||v||(g(``),m({host:e,review:Hv(t,s)}))}function w(e,t){c(n=>({...n,[e.directory]:{directory:e.directory,target:t}}))}let T=()=>t?.settings?.importPathMaps?.globalValue??r?.saved??[],E=()=>r?.ignored??[];async function D(e,n,i){if(!t||!r||b.current||v)return!1;b.current=!0,f(!0);try{await Q(`/api/settings`,{method:`PATCH`,body:JSON.stringify({edits:e,revision:t.revision})})}catch(e){let t=e instanceof $h&&e.status===409;try{if(!t)return u(i),await ig(),!1;u(`Settings changed elsewhere. Check the list and try again.`);try{await k()}catch{y(`conflict`),u(`Settings changed elsewhere and could not be refreshed. Refresh the list, then try again.`)}return!1}finally{b.current=!1,f(!1)}}u(n);try{await k()}catch{y(`saved`),u(`Saved, but the list could not be refreshed. Refresh the list without saving again.`)}finally{b.current=!1,f(!1)}return!0}function O(){D({importPathMaps:hg(r?.saved??[],a)},`Saved. Removed maps stop applying at the next import or backfill run.`,`Removals could not be saved. Try again.`).then(e=>{e&&o(new Set)})}function ee(e){D({importIgnoredDirectories:[...new Set([...E(),e.directory])]},`Ignored. The directory stays unimported.`,`The directory could not be ignored. Try again.`)}function te(e){D({importIgnoredDirectories:E().filter(t=>t!==e)},`Restored. The directory shows again in each host list that reported it.`,`The directory could not be restored. Try again.`)}async function k(){let[e,t]=await Promise.all([Q(`/api/settings`),Q(`/api/settings/import-maps`)]);x.current=e.revision,ng(e),i(t),y(void 0)}async function ne(){if(b.current)return;b.current=!0,f(!0);let e=v===`saved`;try{await k(),e?u(`Saved. Maps apply to the next import or backfill run.`):p?g(`Settings changed elsewhere. Review these maps and confirm again.`):u(`Settings refreshed. No maps were saved.`)}catch{e?u(`Maps were saved, but the list could not be refreshed. Refresh the list without saving again.`):p?g(`Settings changed elsewhere and could not be refreshed. Refresh the list before confirming again.`):u(`Settings could not be refreshed. Try Refresh list again.`)}finally{b.current=!1,f(!1)}}async function re(n){if(!t||!r||!p||b.current||v)return;let a=Wv(T(),E(),p.review,n);if(!a.importPathMaps&&!a.importIgnoredDirectories)return;b.current=!0,f(!0),g(``);try{await Q(`/api/settings`,{method:`PATCH`,body:JSON.stringify({edits:a,revision:t.revision})})}catch(e){let t=e instanceof $h&&e.status===409;if(g(t?`Settings changed elsewhere. Review these maps and confirm again.`:`Maps could not be saved. Review the targets and confirm again.`),t)try{await k()}catch{y(`conflict`),g(`Settings changed elsewhere and could not be refreshed. Refresh the list before confirming again.`)}b.current=!1,f(!1);return}let s=new Set(n);c(e=>Object.fromEntries(Object.entries(e).filter(([e])=>!s.has(e)))),o(e=>new Set([...e].filter(e=>!s.has(e)))),i(e=>e&&{...e,saved:a.importPathMaps??e.saved,ignored:a.importIgnoredDirectories??e.ignored}),m(void 0);let l=p.review.maps.filter(e=>n.has(e.from)).length,d=p.review.ignores.filter(e=>n.has(e.directory)).length;u(`${e(`Saved maps`)}: ${l} · ${e(`Ignored directories`)}: ${d}. ${e(`They apply to the next import or backfill run. No sessions were imported.`)}`);try{await k()}catch{y(`saved`),u(`Maps were saved, but the list could not be refreshed. Refresh the list without saving again.`)}finally{b.current=!1,f(!1)}}return(0,V.jsxs)(`section`,{id:`directory-maps`,className:`space-y-3 rounded-xl border border-border bg-card p-4`,"aria-label":e(`Resolve missing project folders`),children:[(0,V.jsx)(`h2`,{className:`text-section-title font-semibold`,children:e(`Resolve missing project folders`)}),(0,V.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:e(`A directory map links a recorded project folder to its current folder. Saved maps apply globally to every host at the next import or backfill run. Review changes before saving.`)}),(0,V.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:e(`Map a directory that was moved or deleted to the project it belongs to. A change applies to the next import or backfill run.`)}),(0,V.jsxs)(`details`,{className:`min-w-0 rounded-lg border border-border p-3`,children:[(0,V.jsxs)(`summary`,{className:`cursor-pointer rounded font-medium focus-visible:outline-2 focus-visible:outline-ring`,children:[(0,V.jsx)(`h3`,{className:`inline text-subsection-title font-semibold`,children:e(`Saved maps`)}),` ·`,` `,r?.saved.length??0,(0,V.jsx)(`span`,{className:`mt-1 block text-xs font-normal text-muted-foreground`,children:e(`Saved maps apply to every host.`)})]}),(0,V.jsxs)(`div`,{className:`mt-3 space-y-2`,children:[(0,V.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e(`Keep a map after its sessions import. Every import checks the map before it skips a session, so removing a map makes its sessions unresolved again on the next run.`)}),(0,V.jsx)(W,{type:`button`,variant:`outline`,size:`sm`,disabled:d||!!v||!t||!r||a.size===0,onClick:O,children:e(`Save removals`)}),!r?.saved.length&&(0,V.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:e(`none`)}),Gv(r?.saved??[]).map(t=>(0,V.jsxs)(`details`,{className:`min-w-0 border-t border-border pt-2`,children:[(0,V.jsxs)(`summary`,{className:`cursor-pointer rounded text-sm focus-visible:outline-2 focus-visible:outline-ring`,children:[(0,V.jsx)(`code`,{dir:`ltr`,className:`break-all`,children:t.target}),` `,`· `,t.maps.length]}),(0,V.jsx)(`ul`,{className:`mt-2 space-y-1 text-sm`,children:t.maps.map(t=>(0,V.jsxs)(`li`,{className:`flex min-w-0 items-start gap-2`,children:[(0,V.jsx)(`code`,{dir:`ltr`,className:`min-w-0 flex-1 break-all ${a.has(t.from)?`line-through`:``}`,children:t.from}),(0,V.jsx)(`button`,{type:`button`,className:`shrink-0 rounded border border-border px-2 py-0.5 text-xs`,"aria-label":`${a.has(t.from)?e(`Keep`):e(`Remove`)} ${t.from}`,disabled:d,onClick:()=>o(e=>{let n=new Set(e);return n.has(t.from)?n.delete(t.from):n.add(t.from),n}),children:a.has(t.from)?e(`Keep`):e(`Remove`)})]},t.from))})]},t.target))]})]}),(0,V.jsxs)(`details`,{className:`min-w-0 rounded-lg border border-border p-3`,children:[(0,V.jsxs)(`summary`,{className:`cursor-pointer rounded font-medium focus-visible:outline-2 focus-visible:outline-ring`,children:[(0,V.jsx)(`h3`,{className:`inline text-subsection-title font-semibold`,children:e(`Ignored directories`)}),` `,`· `,r?.ignored?.length??0,(0,V.jsx)(`span`,{className:`mt-1 block text-xs font-normal text-muted-foreground`,children:e(`Ignored directories stay unimported and leave the unresolved counts.`)})]}),(0,V.jsxs)(`ul`,{className:`mt-3 space-y-1 text-sm`,children:[!r?.ignored?.length&&(0,V.jsx)(`li`,{className:`text-muted-foreground`,children:e(`none`)}),r?.ignored?.map(n=>(0,V.jsxs)(`li`,{className:`flex min-w-0 items-start gap-2`,children:[(0,V.jsx)(`code`,{dir:`ltr`,className:`min-w-0 flex-1 break-all`,children:n}),(0,V.jsx)(`button`,{type:`button`,className:`shrink-0 rounded border border-border px-2 py-0.5 text-xs`,"aria-label":`${e(`Restore`)} ${n}`,disabled:d||!!v||!t,onClick:()=>te(n),children:e(`Restore`)})]},n))]})]}),[`pi`,`opencode`,`claude-code`].map(e=>{let n=r?.[e]??[];return(0,V.jsx)(Jv,{host:e,rows:n,decisions:s,busy:d||!!v||!t||!r,onDecide:w,onResolve:()=>C(e,n),onIgnore:ee},e)}),p&&(0,V.jsx)(Yv,{host:p.host,review:p.review,busy:d,canConfirm:!v,error:e(h),onRefresh:()=>void ne(),onClose:()=>{b.current||m(void 0)},onConfirm:e=>void re(e)}),v&&!p&&(0,V.jsx)(`button`,{type:`button`,className:`rounded border border-border px-3 py-1.5 text-sm`,disabled:d,onClick:()=>void ne(),children:e(`Refresh list`)}),l&&(0,V.jsx)(`p`,{role:`status`,className:`text-sm`,children:e(l)})]})}function Zv(){let[e,t]=(0,_.useState)(0);(0,_.useEffect)(()=>{cu(window.location.hash)},[]);function n(){t(e=>e+1),xu(`${Y.memory}#memory-section-import`)}let r={"memory-section-import":(0,V.jsx)(fv,{profilePreset:e}),"memory-section-auto-import":(0,V.jsx)(mv,{}),"memory-section-profile":(0,V.jsx)(Sv,{onReanalyse:n}),"memory-section-limits":(0,V.jsx)(Mv,{}),"memory-section-reranker":(0,V.jsx)(Bv,{}),"memory-section-project-folders":(0,V.jsx)(Xv,{})};return(0,V.jsx)(`div`,{className:`settings-view space-y-8`,children:iu.map(({id:e})=>(0,V.jsx)(`div`,{id:e,className:`scroll-mt-20 md:scroll-mt-4`,children:r[e]},e))})}function Qv({...e}){let t=Ru();return(0,V.jsx)(Jn,{theme:t,className:`toaster group`,style:{"--normal-bg":`var(--color-popover)`,"--normal-text":`var(--color-popover-foreground)`,"--normal-border":`var(--color-border)`},icons:{loading:(0,V.jsx)(fe,{className:`size-4 animate-spin`}),success:(0,V.jsx)(se,{className:`size-4`}),error:(0,V.jsx)(ge,{className:`size-4`}),info:(0,V.jsx)(ue,{className:`size-4`}),warning:(0,V.jsx)(Fe,{className:`size-4`})},...e})}function $v(e,t,n){return e?t:n}var ey=[``,`feature`,`bug-fix`,`refactor`,`architecture`,`rule`,`documentation`,`discussion`,`analysis`,`configuration`];function ty(){let{t:e,language:t}=Cr(),n=wu(),[r,i]=(0,_.useState)(!1),a=wr(),o=Tr();(0,_.useEffect)(()=>{let e=Su();(async()=>{await a.loadTags(),await a.loadMemories(),await a.loadStats(),await a.checkMigrationStatus(),await a.checkAuthWarning()})();let t=setInterval(()=>{a.loadStats(),!a.isSearching&&n===`project`&&a.loadMemories()},3e4);return()=>{e(),clearInterval(t)}},[]);let s=o.loadUserProfile;(0,_.useEffect)(()=>{n===`profile`&&s()},[n,s]);function c(e){e!==t&&(yr(e),a.loadMemories(),a.loadStats(),n===`profile`&&o.loadUserProfile())}function l(e){e.defaultPrevented||e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||(e.preventDefault(),xu(Y.home))}return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(Qv,{richColors:!0,position:`bottom-right`}),(0,V.jsxs)(`div`,{className:`flex min-h-svh bg-background text-foreground overflow-x-clip`,children:[(0,V.jsx)(Ku,{open:r,onOpenChange:i,currentView:n,brand:e(`brand`),projectLabel:e(`tab-project`),profileLabel:e(`tab-profile`),profileSections:[{id:`profile-preferences`,label:e(`profile-preferences`)},{id:`profile-patterns`,label:e(`profile-patterns`)},{id:`profile-workflows`,label:e(`profile-workflows`)}],memoryLabel:ug(`Memory`,t),memorySections:iu.map(e=>({id:e.id,label:ug(e.title,t)})),settingsSections:Qh.map(e=>({id:e.id,label:ug(e.title,t)})),langLabel:t.toUpperCase(),languageLabel:e(`nav-language`),themeLabel:e(`nav-theme`),settingsLabel:e(`nav-settings`),closeLabel:e(`nav-close`),collapseLabel:e(`nav-collapse`),expandLabel:e(`nav-expand`),onLanguageSelect:c}),(0,V.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col`,children:[(0,V.jsxs)(`div`,{className:`sticky top-0 z-30 flex items-center gap-2 border-b border-border bg-background/95 px-3 py-2 backdrop-blur md:hidden`,children:[(0,V.jsx)(W,{variant:`ghost`,size:`icon-sm`,className:`min-h-11 min-w-11`,onClick:()=>i(!0),"aria-label":e(`nav-menu`),children:(0,V.jsx)(F,{className:`size-4`})}),(0,V.jsx)(`a`,{href:Y.home,className:`min-w-0`,onClick:l,children:(0,V.jsx)(Wl,{brand:e(`brand`)})})]}),(0,V.jsxs)(`div`,{className:`mx-auto w-full max-w-6xl flex-1 space-y-4 p-4 md:p-6`,children:[a.showAuthWarning?(0,V.jsxs)(Lm,{variant:`destructive`,children:[(0,V.jsx)(Fe,{}),(0,V.jsx)(Rm,{children:e(`auth-warning-text`)})]}):null,(0,V.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,V.jsx)(`h1`,{className:`text-page-title font-semibold text-foreground${t===`en`&&(n===`memory`||n===`settings`)?` uppercase`:``}`,children:n===`project`?e(`tab-project`):n===`profile`?e(`tab-profile`):n===`memory`?ug(`Memory`,t):e(`nav-settings`)}),n===`project`?(0,V.jsxs)(`div`,{className:`flex items-center gap-2 text-xs text-muted-foreground`,children:[(0,V.jsx)(`span`,{children:e(`text-total`,{count:$v(a.isSearching,a.totalItems,a.statsTotal)})}),a.refreshing?(0,V.jsx)(pe,{className:`size-3.5 animate-spin`}):null]}):null]}),n===`project`?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(`div`,{className:`flex flex-wrap items-end gap-3 rounded-xl border border-border bg-card p-3`,children:[(0,V.jsxs)(`div`,{className:`min-w-0 max-w-full space-y-1`,children:[(0,V.jsx)(Yu,{htmlFor:`tag-filter`,children:e(`label-tag`)}),(0,V.jsxs)(gn,{id:`tag-filter`,className:`w-64 max-w-full`,value:a.selectedTag,onChange:e=>a.onTagFilterChange(e.currentTarget.value),children:[(0,V.jsx)(`option`,{value:``,children:e(`opt-all-tags`)}),a.tags.map(e=>(0,V.jsx)(`option`,{value:e.tag,children:e.displayName||e.tag},e.tag))]})]}),(0,V.jsxs)(`div`,{className:`min-w-0 max-w-full space-y-1`,children:[(0,V.jsx)(Yu,{htmlFor:`keyword-filter`,children:e(`label-label-filter`)}),(0,V.jsxs)(gn,{id:`keyword-filter`,className:`w-56 max-w-full`,value:a.selectedKeyword.toLowerCase(),onChange:e=>a.onKeywordFilterChange(e.currentTarget.value),children:[(0,V.jsx)(`option`,{value:``,children:e(`opt-all-labels`)}),a.selectedKeyword&&!a.keywords.some(e=>e.keyword===a.selectedKeyword.toLowerCase())?(0,V.jsxs)(`option`,{value:a.selectedKeyword.toLowerCase(),children:[a.selectedKeyword,` (0)`]}):null,a.keywords.map(e=>(0,V.jsxs)(`option`,{value:e.keyword,children:[e.keyword,` (`,e.count,`)`]},e.keyword))]})]}),(0,V.jsxs)(`div`,{className:`flex flex-1 items-end gap-1.5 min-w-0 basis-56`,children:[(0,V.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-1`,children:[(0,V.jsx)(Yu,{htmlFor:`search-input`,className:`sr-only`,children:e(`placeholder-search`)}),(0,V.jsx)(gl,{id:`search-input`,placeholder:e(`placeholder-search`),value:a.searchInput,onChange:e=>a.setSearchInput(e.target.value),onKeyDown:e=>e.key===`Enter`&&a.performSearch()})]}),(0,V.jsx)(W,{variant:`outline`,size:`icon`,onClick:a.performSearch,children:(0,V.jsx)(De,{className:`size-4`})}),a.isSearching?(0,V.jsx)(W,{variant:`outline`,size:`icon`,onClick:a.clearSearch,children:(0,V.jsx)(Be,{className:`size-4`})}):null]}),(0,V.jsxs)(`div`,{className:`flex flex-wrap gap-1.5`,children:[(0,V.jsx)(ed,{content:e(`tooltip-cleanup`),children:(0,V.jsxs)(W,{variant:`outline`,size:`sm`,onClick:a.runCleanup,children:[(0,V.jsx)(Pe,{className:`size-3.5`}),e(`btn-cleanup`)]})}),(0,V.jsx)(ed,{content:e(`tooltip-deduplicate`),children:(0,V.jsxs)(W,{variant:`outline`,size:`sm`,onClick:a.runDeduplication,children:[(0,V.jsx)(Te,{className:`size-3.5`}),e(`btn-deduplicate`)]})})]}),a.selectedIds.size>0?(0,V.jsxs)(`div`,{className:`flex w-full flex-wrap items-center gap-2 border-t border-border pt-3`,children:[(0,V.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:e(`text-selected`,{count:a.selectedIds.size})}),(0,V.jsx)(W,{variant:`secondary`,size:`xs`,onClick:a.selectAllCurrentPage,children:e(`btn-select-all`)}),(0,V.jsx)(W,{variant:`destructive`,size:`xs`,onClick:a.bulkDelete,children:e(`btn-delete-selected`)}),(0,V.jsx)(W,{variant:`ghost`,size:`xs`,onClick:a.deselectAll,children:e(`btn-deselect-all`)})]}):null]}),a.migrationNeeded?(0,V.jsxs)(Lm,{variant:`destructive`,className:`space-y-3`,children:[(0,V.jsx)(Fe,{}),(0,V.jsxs)(Rm,{className:`space-y-3`,children:[(0,V.jsx)(`p`,{children:a.migrationMessage||e(`migration-mismatch`)}),(0,V.jsxs)(`label`,{className:`flex items-start gap-2 text-sm`,children:[(0,V.jsx)(fa,{checked:a.migrationConfirmed,onCheckedChange:e=>a.setMigrationConfirmed(e===!0),className:`mt-0.5`}),(0,V.jsx)(`span`,{children:e(`migration-understand`)})]}),(0,V.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,V.jsx)(W,{variant:`destructive`,size:`sm`,disabled:!a.migrationConfirmed,onClick:()=>a.runMigration(`fresh-start`),children:e(`btn-fresh-start`)}),(0,V.jsx)(W,{variant:`secondary`,size:`sm`,disabled:!a.migrationConfirmed,onClick:()=>a.runMigration(`re-embed`),children:e(`btn-reembed`)})]})]})]}):null,(0,V.jsx)(Om,{memories:a.memories,selectedIds:a.selectedIds,currentPage:a.currentPage,totalPages:a.totalPages,totalItems:a.totalItems,isSearching:a.isSearching,loading:a.loadingMemories,error:a.memoriesError,onSelect:a.onSelect,onPageChange:e=>{let t=a.currentPage+e;a.setCurrentPage(t),a.loadMemories({page:t})},onPin:a.pinMemory,onUnpin:a.unpinMemory,onEdit:a.openEdit,onDeleteMemory:a.deleteMemory,onDeletePrompt:a.deletePrompt,activeKeyword:a.selectedKeyword,onKeywordClick:e=>a.onKeywordFilterChange(a.selectedKeyword.toLowerCase()===e.toLowerCase()?``:e)}),(0,V.jsxs)(`section`,{className:`rounded-xl border border-border bg-card p-4 space-y-3`,children:[(0,V.jsx)(`h2`,{className:`text-section-title font-semibold text-muted-foreground`,children:e(`section-add`)}),(0,V.jsxs)(`form`,{className:`space-y-3`,onSubmit:a.addMemory,children:[(0,V.jsxs)(`div`,{className:`grid gap-3 md:grid-cols-3`,children:[(0,V.jsxs)(`div`,{className:`space-y-1`,children:[(0,V.jsx)(Yu,{htmlFor:`add-tag`,children:e(`label-tag`)}),(0,V.jsxs)(gn,{id:`add-tag`,required:!0,className:`w-full`,value:a.addTag,onChange:e=>a.setAddTag(e.target.value),children:[(0,V.jsx)(`option`,{value:``,children:e(`opt-select-tag`)}),a.tags.map(e=>(0,V.jsx)(`option`,{value:e.tag,children:e.displayName||e.tag},e.tag))]})]}),(0,V.jsxs)(`div`,{className:`space-y-1`,children:[(0,V.jsx)(Yu,{htmlFor:`add-type`,children:e(`label-type`)}),(0,V.jsx)(gn,{id:`add-type`,className:`w-full`,value:a.addType,onChange:e=>a.setAddType(e.target.value),children:ey.map(t=>(0,V.jsx)(`option`,{value:t,children:e(t?`opt-${t}`:`opt-other`)},t||`other`))})]}),(0,V.jsxs)(`div`,{className:`space-y-1`,children:[(0,V.jsx)(Yu,{htmlFor:`add-tags`,children:e(`label-tags`)}),(0,V.jsx)(gl,{id:`add-tags`,placeholder:e(`placeholder-tags`),value:a.addTags,onChange:e=>a.setAddTags(e.target.value)})]})]}),(0,V.jsxs)(`div`,{className:`space-y-1`,children:[(0,V.jsx)(Yu,{htmlFor:`add-content`,children:e(`label-content`)}),(0,V.jsx)(Xu,{id:`add-content`,rows:4,required:!0,placeholder:e(`placeholder-content`),value:a.addContent,onChange:e=>a.setAddContent(e.target.value)})]}),(0,V.jsxs)(W,{type:`submit`,children:[(0,V.jsx)(Ce,{className:`size-3.5`}),e(`btn-add-memory`)]})]})]})]}):n===`memory`?(0,V.jsx)(Zv,{}):n===`settings`?(0,V.jsx)(D_,{}):(0,V.jsx)(Xh,{profile:o.userProfile,loading:o.loadingProfile,onRefresh:o.refreshProfile,onCleanup:()=>o.setAiCleanupOpen(!0),onCategoryCleanup:()=>o.setCategoryCleanupOpen(!0),categoryCleanupOpen:o.categoryCleanupOpen})]})]})]}),(0,V.jsx)(Zu,{open:a.editOpen,onOpenChange:a.setEditOpen,content:a.editContent,onSave:a.saveEdit}),(0,V.jsx)(Zh,{open:a.tagMigrationOpen,onOpenChange:e=>{e||ar(a.tagMigrationCount),a.setTagMigrationOpen(e)},count:a.tagMigrationCount,onComplete:()=>{or(),a.loadMemories(),a.loadStats()}}),(0,V.jsx)(sl,{open:o.aiCleanupOpen,onOpenChange:o.setAiCleanupOpen,profile:o.userProfile,onApplied:o.loadUserProfile}),(0,V.jsx)(yl,{open:o.categoryCleanupOpen,onOpenChange:o.setCategoryCleanupOpen,onApplied:o.loadUserProfile})]})}Lu();var ny=document.getElementById(`app`);if(!ny)throw Error(`Root element #app not found`);(0,v.createRoot)(ny).render((0,V.jsx)(_.StrictMode,{children:(0,V.jsx)(Sr,{children:(0,V.jsx)(ty,{})})}));