@clauderecallhq/cli 0.12.5 → 0.61.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +37 -17
- package/README.md +110 -22
- package/dist/cli.js +1641 -353
- package/dist/daemon/entrypoint.js +1872 -54
- package/dist/mcp-server.js +930 -0
- package/dist/share/fonts/Inter-Bold.woff +0 -0
- package/dist/share/fonts/Inter-Regular.woff +0 -0
- package/dist/share/fonts/JetBrainsMono-Regular.woff +0 -0
- package/dist/web/assets/_brand-Bw9uSB4O.js +1 -0
- package/dist/web/assets/captureNode-9CVj9vYC.js +2 -0
- package/dist/web/assets/card-a-minimal-ujNERzX7.js +1 -0
- package/dist/web/assets/card-b-terminal-DpJ_tVpg.js +1 -0
- package/dist/web/assets/card-c-gradient-CZXVGuNd.js +1 -0
- package/dist/web/assets/card-d-dashboard-CHKD-PnB.js +1 -0
- package/dist/web/assets/dist-CWaokT35.js +56 -0
- package/dist/web/assets/index-B-HrjaDy.css +1 -0
- package/dist/web/assets/index-BZYcD76T.js +633 -0
- package/dist/web/assets/jetbrains-mono-latin-700-normal-D3wTyLJW.woff +0 -0
- package/dist/web/assets/patterns-BPeZb9N0.js +1 -0
- package/dist/web/assets/stats-BSwqSiFU.js +1 -0
- package/dist/web/assets/thread-D2AXyhOx.js +1 -0
- package/dist/web/index.html +8 -2
- package/package.json +58 -18
- package/scripts/postinstall.mjs +38 -0
- package/dist/cli.js.map +0 -1
- package/dist/commands/activate.js +0 -69
- package/dist/commands/activate.js.map +0 -1
- package/dist/commands/audit-secrets.js +0 -103
- package/dist/commands/audit-secrets.js.map +0 -1
- package/dist/commands/blame.js +0 -35
- package/dist/commands/blame.js.map +0 -1
- package/dist/commands/config-verification.js +0 -18
- package/dist/commands/config-verification.js.map +0 -1
- package/dist/commands/context.js +0 -144
- package/dist/commands/context.js.map +0 -1
- package/dist/commands/correlate.js +0 -70
- package/dist/commands/correlate.js.map +0 -1
- package/dist/commands/digest.js +0 -78
- package/dist/commands/digest.js.map +0 -1
- package/dist/commands/health.js +0 -62
- package/dist/commands/health.js.map +0 -1
- package/dist/commands/index.js +0 -247
- package/dist/commands/index.js.map +0 -1
- package/dist/commands/install-extension.js +0 -138
- package/dist/commands/install-extension.js.map +0 -1
- package/dist/commands/license.js +0 -39
- package/dist/commands/license.js.map +0 -1
- package/dist/commands/list.js +0 -47
- package/dist/commands/list.js.map +0 -1
- package/dist/commands/mcp.js +0 -29
- package/dist/commands/mcp.js.map +0 -1
- package/dist/commands/open.js +0 -28
- package/dist/commands/open.js.map +0 -1
- package/dist/commands/paste.js +0 -154
- package/dist/commands/paste.js.map +0 -1
- package/dist/commands/projects.js +0 -36
- package/dist/commands/projects.js.map +0 -1
- package/dist/commands/search.js +0 -67
- package/dist/commands/search.js.map +0 -1
- package/dist/commands/semantic.js +0 -173
- package/dist/commands/semantic.js.map +0 -1
- package/dist/commands/show.js +0 -121
- package/dist/commands/show.js.map +0 -1
- package/dist/commands/start.js +0 -47
- package/dist/commands/start.js.map +0 -1
- package/dist/commands/stats.js +0 -133
- package/dist/commands/stats.js.map +0 -1
- package/dist/commands/status.js +0 -45
- package/dist/commands/status.js.map +0 -1
- package/dist/commands/stop.js +0 -29
- package/dist/commands/stop.js.map +0 -1
- package/dist/commands/thread.js +0 -396
- package/dist/commands/thread.js.map +0 -1
- package/dist/context/formatter.js +0 -103
- package/dist/context/formatter.js.map +0 -1
- package/dist/daemon/auto-tag-config.js +0 -103
- package/dist/daemon/auto-tag-config.js.map +0 -1
- package/dist/daemon/auto-tag-config.test.js +0 -72
- package/dist/daemon/auto-tag-config.test.js.map +0 -1
- package/dist/daemon/auto-title-config.js +0 -70
- package/dist/daemon/auto-title-config.js.map +0 -1
- package/dist/daemon/bulk-title-jobs.js +0 -170
- package/dist/daemon/bulk-title-jobs.js.map +0 -1
- package/dist/daemon/correlator.js +0 -320
- package/dist/daemon/correlator.js.map +0 -1
- package/dist/daemon/discover.js +0 -316
- package/dist/daemon/discover.js.map +0 -1
- package/dist/daemon/editor-detection.js +0 -186
- package/dist/daemon/editor-detection.js.map +0 -1
- package/dist/daemon/entrypoint.js.map +0 -1
- package/dist/daemon/git-correlator.js +0 -256
- package/dist/daemon/git-correlator.js.map +0 -1
- package/dist/daemon/mcp-installer.js +0 -108
- package/dist/daemon/mcp-installer.js.map +0 -1
- package/dist/daemon/onboarding-state.js +0 -140
- package/dist/daemon/onboarding-state.js.map +0 -1
- package/dist/daemon/pidfile.js +0 -57
- package/dist/daemon/pidfile.js.map +0 -1
- package/dist/daemon/ports.js +0 -48
- package/dist/daemon/ports.js.map +0 -1
- package/dist/daemon/scanProgressRegistry.js +0 -62
- package/dist/daemon/scanProgressRegistry.js.map +0 -1
- package/dist/daemon/server.js +0 -2010
- package/dist/daemon/server.js.map +0 -1
- package/dist/daemon/tag-scanner/anthropic-client.js +0 -40
- package/dist/daemon/tag-scanner/anthropic-client.js.map +0 -1
- package/dist/daemon/tag-scanner/autopilot.js +0 -131
- package/dist/daemon/tag-scanner/autopilot.js.map +0 -1
- package/dist/daemon/tag-scanner/claude-cli-driver.js +0 -250
- package/dist/daemon/tag-scanner/claude-cli-driver.js.map +0 -1
- package/dist/daemon/tag-scanner/orchestrator.js +0 -88
- package/dist/daemon/tag-scanner/orchestrator.js.map +0 -1
- package/dist/daemon/tag-scanner/prompt.js +0 -46
- package/dist/daemon/tag-scanner/prompt.js.map +0 -1
- package/dist/daemon/tag-scanner/prompt.test.js +0 -48
- package/dist/daemon/tag-scanner/prompt.test.js.map +0 -1
- package/dist/daemon/tag-scanner/scan-state.js +0 -49
- package/dist/daemon/tag-scanner/scan-state.js.map +0 -1
- package/dist/daemon/tag-scanner/session-fetcher.js +0 -82
- package/dist/daemon/tag-scanner/session-fetcher.js.map +0 -1
- package/dist/daemon/tag-scanner/session-fetcher.test.js +0 -34
- package/dist/daemon/tag-scanner/session-fetcher.test.js.map +0 -1
- package/dist/daemon/tag-scanner/validator.js +0 -50
- package/dist/daemon/tag-scanner/validator.js.map +0 -1
- package/dist/daemon/tag-scanner/validator.test.js +0 -41
- package/dist/daemon/tag-scanner/validator.test.js.map +0 -1
- package/dist/daemon/terminal-registry.js +0 -443
- package/dist/daemon/terminal-registry.js.map +0 -1
- package/dist/daemon/ui.js +0 -64
- package/dist/daemon/ui.js.map +0 -1
- package/dist/daemon/watcher.js +0 -256
- package/dist/daemon/watcher.js.map +0 -1
- package/dist/db/client.js +0 -22
- package/dist/db/client.js.map +0 -1
- package/dist/db/schema.js +0 -496
- package/dist/db/schema.js.map +0 -1
- package/dist/license/api-base.js +0 -13
- package/dist/license/api-base.js.map +0 -1
- package/dist/license/manager.js +0 -43
- package/dist/license/manager.js.map +0 -1
- package/dist/license/public-key.js +0 -19
- package/dist/license/public-key.js.map +0 -1
- package/dist/license/storage.js +0 -27
- package/dist/license/storage.js.map +0 -1
- package/dist/license/verify.js +0 -23
- package/dist/license/verify.js.map +0 -1
- package/dist/mcp/audit.js +0 -126
- package/dist/mcp/audit.js.map +0 -1
- package/dist/mcp/prompts.js +0 -180
- package/dist/mcp/prompts.js.map +0 -1
- package/dist/mcp/server.js +0 -502
- package/dist/mcp/server.js.map +0 -1
- package/dist/mcp/thread-tools.js +0 -363
- package/dist/mcp/thread-tools.js.map +0 -1
- package/dist/mcp/write-tools.js +0 -239
- package/dist/mcp/write-tools.js.map +0 -1
- package/dist/parser/jsonl.js +0 -150
- package/dist/parser/jsonl.js.map +0 -1
- package/dist/semantic/chunker.js +0 -47
- package/dist/semantic/chunker.js.map +0 -1
- package/dist/semantic/config.js +0 -74
- package/dist/semantic/config.js.map +0 -1
- package/dist/semantic/embedder.js +0 -54
- package/dist/semantic/embedder.js.map +0 -1
- package/dist/semantic/fusion.js +0 -38
- package/dist/semantic/fusion.js.map +0 -1
- package/dist/semantic/model-download.js +0 -69
- package/dist/semantic/model-download.js.map +0 -1
- package/dist/semantic/pipeline.js +0 -375
- package/dist/semantic/pipeline.js.map +0 -1
- package/dist/semantic/query.js +0 -42
- package/dist/semantic/query.js.map +0 -1
- package/dist/semantic/worker.js +0 -78
- package/dist/semantic/worker.js.map +0 -1
- package/dist/stats/backfill.js +0 -151
- package/dist/stats/backfill.js.map +0 -1
- package/dist/stats/health.js +0 -102
- package/dist/stats/health.js.map +0 -1
- package/dist/stats/query.js +0 -385
- package/dist/stats/query.js.map +0 -1
- package/dist/utils/aliases.js +0 -107
- package/dist/utils/aliases.js.map +0 -1
- package/dist/utils/autoCollections.js +0 -635
- package/dist/utils/autoCollections.js.map +0 -1
- package/dist/utils/autoTitle.js +0 -348
- package/dist/utils/autoTitle.js.map +0 -1
- package/dist/utils/collections.js +0 -446
- package/dist/utils/collections.js.map +0 -1
- package/dist/utils/format.js +0 -46
- package/dist/utils/format.js.map +0 -1
- package/dist/utils/notes.js +0 -270
- package/dist/utils/notes.js.map +0 -1
- package/dist/utils/paths.js +0 -50
- package/dist/utils/paths.js.map +0 -1
- package/dist/utils/pricing.js +0 -257
- package/dist/utils/pricing.js.map +0 -1
- package/dist/utils/secret-scanner.js +0 -166
- package/dist/utils/secret-scanner.js.map +0 -1
- package/dist/utils/sessionLabel.js +0 -64
- package/dist/utils/sessionLabel.js.map +0 -1
- package/dist/utils/tags.js +0 -97
- package/dist/utils/tags.js.map +0 -1
- package/dist/utils/thread-context.js +0 -129
- package/dist/utils/thread-context.js.map +0 -1
- package/dist/utils/threadFilter.js +0 -18
- package/dist/utils/threadFilter.js.map +0 -1
- package/dist/utils/threads-titler.js +0 -298
- package/dist/utils/threads-titler.js.map +0 -1
- package/dist/utils/threads.js +0 -383
- package/dist/utils/threads.js.map +0 -1
- package/dist/utils/usage.js +0 -76
- package/dist/utils/usage.js.map +0 -1
- package/dist/verification/compute.js +0 -88
- package/dist/verification/compute.js.map +0 -1
- package/dist/verification/config.js +0 -34
- package/dist/verification/config.js.map +0 -1
- package/dist/web/assets/index-CIr6J4Fw.js +0 -1201
- package/dist/web/assets/index-Ctc8g9Jw.css +0 -1
|
@@ -1,1201 +0,0 @@
|
|
|
1
|
-
var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),s=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},c=(n,r,a)=>(a=n==null?{}:e(i(n)),s(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var l=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.iterator;function m(e){return typeof e!=`object`||!e?null:(e=p&&e[p]||e[`@@iterator`],typeof e==`function`?e:null)}var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,_={};function v(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}v.prototype.isReactComponent={},v.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function y(){}y.prototype=v.prototype;function b(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}var x=b.prototype=new y;x.constructor=b,g(x,v.prototype),x.isPureReactComponent=!0;var S=Array.isArray;function C(){}var w={H:null,A:null,T:null,S:null},T=Object.prototype.hasOwnProperty;function E(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function D(e,t){return E(e.type,t,e.props)}function O(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function k(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var A=/\/+/g;function ee(e,t){return typeof e==`object`&&e&&e.key!=null?k(``+e.key):t.toString(36)}function j(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 te(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,te(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+ee(e,0):a,S(o)?(i=``,c!=null&&(i=c.replace(A,`$&/`)+`/`),te(o,r,i,``,function(e){return e})):o!=null&&(O(o)&&(o=D(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(A,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(S(e))for(var u=0;u<e.length;u++)a=e[u],s=l+ee(a,u),c+=te(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+ee(a,u++),c+=te(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return te(j(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 M(e,t,n){if(e==null)return e;var r=[],i=0;return te(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function ne(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 N=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)},P={map:M,forEach:function(e,t,n){M(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return M(e,function(){t++}),t},toArray:function(e){return M(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=P,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:ne}},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,N)}catch(e){N(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),w.T=t}},e.unstable_useCacheRefresh=function(){return w.H.useCacheRefresh()},e.use=function(e){return w.H.use(e)},e.useActionState=function(e,t,n){return w.H.useActionState(e,t,n)},e.useCallback=function(e,t){return w.H.useCallback(e,t)},e.useContext=function(e){return w.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return w.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return w.H.useEffect(e,t)},e.useEffectEvent=function(e){return w.H.useEffectEvent(e)},e.useId=function(){return w.H.useId()},e.useImperativeHandle=function(e,t,n){return w.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return w.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return w.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return w.H.useMemo(e,t)},e.useOptimistic=function(e,t){return w.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return w.H.useReducer(e,t,n)},e.useRef=function(e){return w.H.useRef(e)},e.useState=function(e){return w.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return w.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return w.H.useTransition()},e.version=`19.2.5`})),u=o(((e,t)=>{t.exports=l()})),d=o((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m)if(n(c)!==null)m=!0,S||(S=!0,O());else{var t=n(l);t!==null&&ee(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&&ee(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?O():S=!1}}}var O;if(typeof y==`function`)O=function(){y(D)};else if(typeof MessageChannel<`u`){var k=new MessageChannel,A=k.port2;k.port1.onmessage=D,O=function(){A.postMessage(null)}}else O=function(){_(D,0)};function ee(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,ee(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,O()))),r},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),f=o(((e,t)=>{t.exports=d()})),p=o((e=>{var t=u();function n(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function r(){}var i={d:{f:r,r:function(){throw Error(n(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},a=Symbol.for(`react.portal`);function o(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:r==null?null:``+r,children:e,containerInfo:t,implementation:n}}var s=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function c(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,e.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(n(299));return o(e,t,null,r)},e.flushSync=function(e){var t=s.T,n=i.p;try{if(s.T=null,i.p=2,e)return e()}finally{s.T=t,i.p=n,i.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,i.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&i.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=c(n,t.crossOrigin),a=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?i.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:a,fetchPriority:o}):n===`script`&&i.d.X(e,{crossOrigin:r,integrity:a,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`)if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=c(t.as,t.crossOrigin);i.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0})}}else t??i.d.M(e)},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=c(n,t.crossOrigin);i.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`)if(t){var n=c(t.as,t.crossOrigin);i.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0})}else i.d.m(e)},e.requestFormReset=function(e){i.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return s.H.useFormState(e,t,n)},e.useFormStatus=function(){return s.H.useHostTransitionStatus()},e.version=`19.2.5`})),m=o(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=p()})),h=o((e=>{var t=f(),n=u(),r=m();function i(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function a(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function o(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function s(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function c(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function l(e){if(o(e)!==e)throw Error(i(188))}function d(e){var t=e.alternate;if(!t){if(t=o(e),t===null)throw Error(i(188));return t===e?e:null}for(var n=e,r=t;;){var a=n.return;if(a===null)break;var s=a.alternate;if(s===null){if(r=a.return,r!==null){n=r;continue}break}if(a.child===s.child){for(s=a.child;s;){if(s===n)return l(a),e;if(s===r)return l(a),t;s=s.sibling}throw Error(i(188))}if(n.return!==r.return)n=a,r=s;else{for(var c=!1,u=a.child;u;){if(u===n){c=!0,n=a,r=s;break}if(u===r){c=!0,r=a,n=s;break}u=u.sibling}if(!c){for(u=s.child;u;){if(u===n){c=!0,n=s,r=a;break}if(u===r){c=!0,r=s,n=a;break}u=u.sibling}if(!c)throw Error(i(189))}}if(n.alternate!==r)throw Error(i(190))}if(n.tag!==3)throw Error(i(188));return n.stateNode.current===n?e:t}function p(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=p(e),t!==null)return t;e=e.sibling}return null}var h=Object.assign,g=Symbol.for(`react.element`),_=Symbol.for(`react.transitional.element`),v=Symbol.for(`react.portal`),y=Symbol.for(`react.fragment`),b=Symbol.for(`react.strict_mode`),x=Symbol.for(`react.profiler`),S=Symbol.for(`react.consumer`),C=Symbol.for(`react.context`),w=Symbol.for(`react.forward_ref`),T=Symbol.for(`react.suspense`),E=Symbol.for(`react.suspense_list`),D=Symbol.for(`react.memo`),O=Symbol.for(`react.lazy`),k=Symbol.for(`react.activity`),A=Symbol.for(`react.memo_cache_sentinel`),ee=Symbol.iterator;function j(e){return typeof e!=`object`||!e?null:(e=ee&&e[ee]||e[`@@iterator`],typeof e==`function`?e:null)}var te=Symbol.for(`react.client.reference`);function M(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===te?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case y:return`Fragment`;case x:return`Profiler`;case b:return`StrictMode`;case T:return`Suspense`;case E:return`SuspenseList`;case k:return`Activity`}if(typeof e==`object`)switch(e.$$typeof){case v:return`Portal`;case C:return e.displayName||`Context`;case S:return(e._context.displayName||`Context`)+`.Consumer`;case w:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case D:return t=e.displayName||null,t===null?M(e.type)||`Memo`:t;case O:t=e._payload,e=e._init;try{return M(e(t))}catch{}}return null}var ne=Array.isArray,N=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,P=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,re={pending:!1,data:null,method:null,action:null},F=[],ie=-1;function I(e){return{current:e}}function ae(e){0>ie||(e.current=F[ie],F[ie]=null,ie--)}function L(e,t){ie++,F[ie]=e.current,e.current=t}var oe=I(null),se=I(null),ce=I(null),le=I(null);function ue(e,t){switch(L(ce,t),L(se,e),L(oe,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Vd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Vd(t),e=Hd(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}ae(oe),L(oe,e)}function de(){ae(oe),ae(se),ae(ce)}function fe(e){e.memoizedState!==null&&L(le,e);var t=oe.current,n=Hd(t,e.type);t!==n&&(L(se,e),L(oe,n))}function pe(e){se.current===e&&(ae(oe),ae(se)),le.current===e&&(ae(le),Qf._currentValue=re)}var me,he;function ge(e){if(me===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);me=t&&t[1]||``,he=-1<e.stack.indexOf(`
|
|
2
|
-
at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
|
|
3
|
-
`+me+e+he}var _e=!1;function ve(e,t){if(!e||_e)return``;_e=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,`props`,{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}e.call(n.prototype)}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,`name`,{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(`
|
|
4
|
-
`),l=s.split(`
|
|
5
|
-
`);for(i=r=0;r<c.length&&!c[r].includes(`DetermineComponentFrameRoot`);)r++;for(;i<l.length&&!l[i].includes(`DetermineComponentFrameRoot`);)i++;if(r===c.length||i===l.length)for(r=c.length-1,i=l.length-1;1<=r&&0<=i&&c[r]!==l[i];)i--;for(;1<=r&&0<=i;r--,i--)if(c[r]!==l[i]){if(r!==1||i!==1)do if(r--,i--,0>i||c[r]!==l[i]){var u=`
|
|
6
|
-
`+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(`<anonymous>`)&&(u=u.replace(`<anonymous>`,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{_e=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?ge(n):``}function ye(e,t){switch(e.tag){case 26:case 27:case 5:return ge(e.type);case 16:return ge(`Lazy`);case 13:return e.child!==t&&t!==null?ge(`Suspense Fallback`):ge(`Suspense`);case 19:return ge(`SuspenseList`);case 0:case 15:return ve(e.type,!1);case 11:return ve(e.type.render,!1);case 1:return ve(e.type,!0);case 31:return ge(`Activity`);default:return``}}function be(e){try{var t=``,n=null;do t+=ye(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
|
|
7
|
-
Error generating stack: `+e.message+`
|
|
8
|
-
`+e.stack}}var xe=Object.prototype.hasOwnProperty,Se=t.unstable_scheduleCallback,Ce=t.unstable_cancelCallback,we=t.unstable_shouldYield,Te=t.unstable_requestPaint,Ee=t.unstable_now,De=t.unstable_getCurrentPriorityLevel,Oe=t.unstable_ImmediatePriority,ke=t.unstable_UserBlockingPriority,Ae=t.unstable_NormalPriority,je=t.unstable_LowPriority,Me=t.unstable_IdlePriority,Ne=t.log,Pe=t.unstable_setDisableYieldValue,Fe=null,Ie=null;function Le(e){if(typeof Ne==`function`&&Pe(e),Ie&&typeof Ie.setStrictMode==`function`)try{Ie.setStrictMode(Fe,e)}catch{}}var Re=Math.clz32?Math.clz32:Ve,ze=Math.log,Be=Math.LN2;function Ve(e){return e>>>=0,e===0?32:31-(ze(e)/Be|0)|0}var He=256,Ue=262144,R=4194304;function z(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function We(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=r&134217727;return s===0?(s=r&~a,s===0?o===0?n||(n=r&~e,n!==0&&(i=z(n))):i=z(o):i=z(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=z(n))):i=z(o)):i=z(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 B(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Ge(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 Ke(){var e=R;return R<<=1,!(R&62914560)&&(R=4194304),e}function qe(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Je(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Ye(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-Re(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&&Xe(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function Xe(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-Re(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function Ze(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Re(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function Qe(e,t){var n=t&-t;return n=n&42?1:$e(n),(n&(e.suspendedLanes|t))===0?n:0}function $e(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function et(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function tt(){var e=P.p;return e===0?(e=window.event,e===void 0?32:mp(e.type)):e}function nt(e,t){var n=P.p;try{return P.p=e,t()}finally{P.p=n}}var rt=Math.random().toString(36).slice(2),it=`__reactFiber$`+rt,V=`__reactProps$`+rt,at=`__reactContainer$`+rt,ot=`__reactEvents$`+rt,H=`__reactListeners$`+rt,U=`__reactHandles$`+rt,W=`__reactResources$`+rt,st=`__reactMarker$`+rt;function ct(e){delete e[it],delete e[V],delete e[ot],delete e[H],delete e[U]}function lt(e){var t=e[it];if(t)return t;for(var n=e.parentNode;n;){if(t=n[at]||n[it]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=df(e);e!==null;){if(n=e[it])return n;e=df(e)}return t}e=n,n=e.parentNode}return null}function ut(e){if(e=e[it]||e[at]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function dt(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function ft(e){var t=e[W];return t||=e[W]={hoistableStyles:new Map,hoistableScripts:new Map},t}function pt(e){e[st]=!0}var mt=new Set,ht={};function gt(e,t){_t(e,t),_t(e+`Capture`,t)}function _t(e,t){for(ht[e]=t,e=0;e<t.length;e++)mt.add(t[e])}var vt=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]*$`),yt={},bt={};function G(e){return xe.call(bt,e)?!0:xe.call(yt,e)?!1:vt.test(e)?bt[e]=!0:(yt[e]=!0,!1)}function xt(e,t,n){if(G(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 St(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 Ct(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 wt(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function Tt(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function K(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 Et(e){if(!e._valueTracker){var t=Tt(e)?`checked`:`value`;e._valueTracker=K(e,t,``+e[t])}}function Dt(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=Tt(e)?e.checked?`true`:`false`:e.value),e=r,e===n?!1:(t.setValue(e),!0)}function Ot(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 kt=/[\n"\\]/g;function At(e){return e.replace(kt,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function jt(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=``+wt(t)):e.value!==``+wt(t)&&(e.value=``+wt(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):Nt(e,o,wt(n)):Nt(e,o,wt(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=``+wt(s):e.removeAttribute(`name`)}function Mt(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)){Et(e);return}n=n==null?``:``+wt(n),t=t==null?n:``+wt(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),Et(e)}function Nt(e,t,n){t===`number`&&Ot(e.ownerDocument)===e||e.defaultValue===``+n||(e.defaultValue=``+n)}function Pt(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=``+wt(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 Ft(e,t,n){if(t!=null&&(t=``+wt(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n==null?``:``+wt(n)}function It(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(ne(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n??=``,t=n}n=wt(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),Et(e)}function Lt(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Rt=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 zt(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||Rt.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function Bt(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&&zt(e,a,r)}else for(var o in t)t.hasOwnProperty(o)&&zt(e,o,t[o])}function Vt(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 Ht=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`]]),Ut=/^[\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 Wt(e){return Ut.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function Gt(){}var Kt=null;function qt(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Jt=null,Yt=null;function Xt(e){var t=ut(e);if(t&&(e=t.stateNode)){var n=e[V]||null;a:switch(e=t.stateNode,t.type){case`input`:if(jt(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="`+At(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[V]||null;if(!a)throw Error(i(90));jt(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&&Dt(r)}break a;case`textarea`:Ft(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&Pt(e,!!n.multiple,t,!1)}}}var Zt=!1;function Qt(e,t,n){if(Zt)return e(t,n);Zt=!0;try{return e(t)}finally{if(Zt=!1,(Jt!==null||Yt!==null)&&(_u(),Jt&&(t=Jt,e=Yt,Yt=Jt=null,Xt(t),e)))for(t=0;t<e.length;t++)Xt(e[t])}}function $t(e,t){var n=e.stateNode;if(n===null)return null;var r=n[V]||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 en=!(typeof window>`u`||window.document===void 0||window.document.createElement===void 0),tn=!1;if(en)try{var nn={};Object.defineProperty(nn,`passive`,{get:function(){tn=!0}}),window.addEventListener(`test`,nn,nn),window.removeEventListener(`test`,nn,nn)}catch{tn=!1}var rn=null,an=null,on=null;function sn(){if(on)return on;var e,t=an,n=t.length,r,i=`value`in rn?rn.value:rn.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 on=i.slice(e,1<r?1-r:void 0)}function cn(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 ln(){return!0}function un(){return!1}function dn(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)?ln:un,this.isPropagationStopped=un,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=ln)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=ln)},persist:function(){},isPersistent:ln}),t}var fn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},pn=dn(fn),mn=h({},fn,{view:0,detail:0}),hn=dn(mn),gn,_n,vn,yn=h({},mn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:An,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!==vn&&(vn&&e.type===`mousemove`?(gn=e.screenX-vn.screenX,_n=e.screenY-vn.screenY):_n=gn=0,vn=e),gn)},movementY:function(e){return`movementY`in e?e.movementY:_n}}),bn=dn(yn),xn=dn(h({},yn,{dataTransfer:0})),Sn=dn(h({},mn,{relatedTarget:0})),Cn=dn(h({},fn,{animationName:0,elapsedTime:0,pseudoElement:0})),wn=dn(h({},fn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),Tn=dn(h({},fn,{data:0})),En={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},Dn={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`},On={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function kn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=On[e])?!!t[e]:!1}function An(){return kn}var jn=dn(h({},mn,{key:function(e){if(e.key){var t=En[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=cn(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?Dn[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:An,charCode:function(e){return e.type===`keypress`?cn(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?cn(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),Mn=dn(h({},yn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),Nn=dn(h({},mn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:An})),Pn=dn(h({},fn,{propertyName:0,elapsedTime:0,pseudoElement:0})),Fn=dn(h({},yn,{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})),In=dn(h({},fn,{newState:0,oldState:0})),Ln=[9,13,27,32],Rn=en&&`CompositionEvent`in window,zn=null;en&&`documentMode`in document&&(zn=document.documentMode);var Bn=en&&`TextEvent`in window&&!zn,Vn=en&&(!Rn||zn&&8<zn&&11>=zn),Hn=` `,Un=!1;function Wn(e,t){switch(e){case`keyup`:return Ln.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function Gn(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var Kn=!1;function qn(e,t){switch(e){case`compositionend`:return Gn(t);case`keypress`:return t.which===32?(Un=!0,Hn):null;case`textInput`:return e=t.data,e===Hn&&Un?null:e;default:return null}}function Jn(e,t){if(Kn)return e===`compositionend`||!Rn&&Wn(e,t)?(e=sn(),on=an=rn=null,Kn=!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 Vn&&t.locale!==`ko`?null:t.data;default:return null}}var Yn={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 Xn(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!Yn[e.type]:t===`textarea`}function Zn(e,t,n,r){Jt?Yt?Yt.push(r):Yt=[r]:Jt=r,t=Td(t,`onChange`),0<t.length&&(n=new pn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var Qn=null,$n=null;function er(e){_d(e,0)}function tr(e){if(Dt(dt(e)))return e}function nr(e,t){if(e===`change`)return t}var rr=!1;if(en){var ir;if(en){var ar=`oninput`in document;if(!ar){var or=document.createElement(`div`);or.setAttribute(`oninput`,`return;`),ar=typeof or.oninput==`function`}ir=ar}else ir=!1;rr=ir&&(!document.documentMode||9<document.documentMode)}function sr(){Qn&&(Qn.detachEvent(`onpropertychange`,cr),$n=Qn=null)}function cr(e){if(e.propertyName===`value`&&tr($n)){var t=[];Zn(t,$n,e,qt(e)),Qt(er,t)}}function lr(e,t,n){e===`focusin`?(sr(),Qn=t,$n=n,Qn.attachEvent(`onpropertychange`,cr)):e===`focusout`&&sr()}function ur(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return tr($n)}function dr(e,t){if(e===`click`)return tr(t)}function fr(e,t){if(e===`input`||e===`change`)return tr(t)}function pr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var mr=typeof Object.is==`function`?Object.is:pr;function q(e,t){if(mr(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!xe.call(t,i)||!mr(e[i],t[i]))return!1}return!0}function hr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function gr(e,t){var n=hr(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=hr(n)}}function _r(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?_r(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function vr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Ot(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=Ot(e.document)}return t}function yr(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 br=en&&`documentMode`in document&&11>=document.documentMode,xr=null,Sr=null,Cr=null,wr=!1;function Tr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;wr||xr==null||xr!==Ot(r)||(r=xr,`selectionStart`in r&&yr(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}),Cr&&q(Cr,r)||(Cr=r,r=Td(Sr,`onSelect`),0<r.length&&(t=new pn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=xr)))}function Er(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var Dr={animationend:Er(`Animation`,`AnimationEnd`),animationiteration:Er(`Animation`,`AnimationIteration`),animationstart:Er(`Animation`,`AnimationStart`),transitionrun:Er(`Transition`,`TransitionRun`),transitionstart:Er(`Transition`,`TransitionStart`),transitioncancel:Er(`Transition`,`TransitionCancel`),transitionend:Er(`Transition`,`TransitionEnd`)},Or={},kr={};en&&(kr=document.createElement(`div`).style,`AnimationEvent`in window||(delete Dr.animationend.animation,delete Dr.animationiteration.animation,delete Dr.animationstart.animation),`TransitionEvent`in window||delete Dr.transitionend.transition);function Ar(e){if(Or[e])return Or[e];if(!Dr[e])return e;var t=Dr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in kr)return Or[e]=t[n];return e}var jr=Ar(`animationend`),Mr=Ar(`animationiteration`),Nr=Ar(`animationstart`),Pr=Ar(`transitionrun`),Fr=Ar(`transitionstart`),Ir=Ar(`transitioncancel`),Lr=Ar(`transitionend`),Rr=new Map,zr=`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(` `);zr.push(`scrollEnd`);function Br(e,t){Rr.set(e,t),gt(t,[e])}var Vr=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)},Hr=[],Ur=0,Wr=0;function Gr(){for(var e=Ur,t=Wr=Ur=0;t<e;){var n=Hr[t];Hr[t++]=null;var r=Hr[t];Hr[t++]=null;var i=Hr[t];Hr[t++]=null;var a=Hr[t];if(Hr[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&&Yr(n,i,a)}}function Kr(e,t,n,r){Hr[Ur++]=e,Hr[Ur++]=t,Hr[Ur++]=n,Hr[Ur++]=r,Wr|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function qr(e,t,n,r){return Kr(e,t,n,r),Xr(e)}function Jr(e,t){return Kr(e,null,null,t),Xr(e)}function Yr(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-Re(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function Xr(e){if(50<cu)throw cu=0,lu=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Zr={};function Qr(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 $r(e,t,n,r){return new Qr(e,t,n,r)}function ei(e){return e=e.prototype,!(!e||!e.isReactComponent)}function ti(e,t){var n=e.alternate;return n===null?(n=$r(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 ni(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 ri(e,t,n,r,a,o){var s=0;if(r=e,typeof e==`function`)ei(e)&&(s=1);else if(typeof e==`string`)s=Uf(e,n,oe.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(e){case k:return e=$r(31,n,t,a),e.elementType=k,e.lanes=o,e;case y:return ii(n.children,a,o,t);case b:s=8,a|=24;break;case x:return e=$r(12,n,t,a|2),e.elementType=x,e.lanes=o,e;case T:return e=$r(13,n,t,a),e.elementType=T,e.lanes=o,e;case E:return e=$r(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=$r(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function ii(e,t,n,r){return e=$r(7,e,r,t),e.lanes=n,e}function ai(e,t,n){return e=$r(6,e,null,t),e.lanes=n,e}function oi(e){var t=$r(18,null,null,0);return t.stateNode=e,t}function si(e,t,n){return t=$r(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var ci=new WeakMap;function li(e,t){if(typeof e==`object`&&e){var n=ci.get(e);return n===void 0?(t={value:e,source:t,stack:be(t)},ci.set(e,t),t):n}return{value:e,source:t,stack:be(t)}}var ui=[],di=0,fi=null,pi=0,mi=[],hi=0,gi=null,_i=1,vi=``;function yi(e,t){ui[di++]=pi,ui[di++]=fi,fi=e,pi=t}function bi(e,t,n){mi[hi++]=_i,mi[hi++]=vi,mi[hi++]=gi,gi=e;var r=_i;e=vi;var i=32-Re(r)-1;r&=~(1<<i),n+=1;var a=32-Re(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,_i=1<<32-Re(t)+i|n<<i|r,vi=a+e}else _i=1<<a|n<<i|r,vi=e}function xi(e){e.return!==null&&(yi(e,1),bi(e,1,0))}function Si(e){for(;e===fi;)fi=ui[--di],ui[di]=null,pi=ui[--di],ui[di]=null;for(;e===gi;)gi=mi[--hi],mi[hi]=null,vi=mi[--hi],mi[hi]=null,_i=mi[--hi],mi[hi]=null}function Ci(e,t){mi[hi++]=_i,mi[hi++]=vi,mi[hi++]=gi,_i=t.id,vi=t.overflow,gi=e}var wi=null,Ti=null,J=!1,Ei=null,Di=!1,Oi=Error(i(519));function ki(e){throw Fi(li(Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),Oi}function Ai(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[it]=e,t[V]=r,n){case`dialog`:vd(`cancel`,t),vd(`close`,t);break;case`iframe`:case`object`:case`embed`:vd(`load`,t);break;case`video`:case`audio`:for(n=0;n<hd.length;n++)vd(hd[n],t);break;case`source`:vd(`error`,t);break;case`img`:case`image`:case`link`:vd(`error`,t),vd(`load`,t);break;case`details`:vd(`toggle`,t);break;case`input`:vd(`invalid`,t),Mt(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:vd(`invalid`,t);break;case`textarea`:vd(`invalid`,t),It(t,r.value,r.defaultValue,r.children)}n=r.children,typeof n!=`string`&&typeof n!=`number`&&typeof n!=`bigint`||t.textContent===``+n||!0===r.suppressHydrationWarning||jd(t.textContent,n)?(r.popover!=null&&(vd(`beforetoggle`,t),vd(`toggle`,t)),r.onScroll!=null&&vd(`scroll`,t),r.onScrollEnd!=null&&vd(`scrollend`,t),r.onClick!=null&&(t.onclick=Gt),t=!0):t=!1,t||ki(e,!0)}function ji(e){for(wi=e.return;wi;)switch(wi.tag){case 5:case 31:case 13:Di=!1;return;case 27:case 3:Di=!0;return;default:wi=wi.return}}function Mi(e){if(e!==wi)return!1;if(!J)return ji(e),J=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!==`form`&&n!==`button`)||Ud(e.type,e.memoizedProps)),n=!n),n&&Ti&&ki(e),ji(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));Ti=uf(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));Ti=uf(e)}else t===27?(t=Ti,Zd(e.type)?(e=lf,lf=null,Ti=e):Ti=t):Ti=wi?cf(e.stateNode.nextSibling):null;return!0}function Ni(){Ti=wi=null,J=!1}function Pi(){var e=Ei;return e!==null&&(Jl===null?Jl=e:Jl.push.apply(Jl,e),Ei=null),e}function Fi(e){Ei===null?Ei=[e]:Ei.push(e)}var Ii=I(null),Li=null,Ri=null;function Y(e,t,n){L(Ii,t._currentValue),t._currentValue=n}function zi(e){e._currentValue=Ii.current,ae(Ii)}function Bi(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 Vi(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),Bi(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),Bi(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 Hi(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;mr(a.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(a===le.current){if(s=a.alternate,s===null)throw Error(i(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e===null?e=[Qf]:e.push(Qf))}a=a.return}e!==null&&Vi(t,e,n,r),t.flags|=262144}function Ui(e){for(e=e.firstContext;e!==null;){if(!mr(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Wi(e){Li=e,Ri=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Gi(e){return qi(Li,e)}function Ki(e,t){return Li===null&&Wi(e),qi(e,t)}function qi(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},Ri===null){if(e===null)throw Error(i(308));Ri=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Ri=Ri.next=t;return n}var Ji=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()})}},Yi=t.unstable_scheduleCallback,Xi=t.unstable_NormalPriority,Zi={$$typeof:C,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Qi(){return{controller:new Ji,data:new Map,refCount:0}}function $i(e){e.refCount--,e.refCount===0&&Yi(Xi,function(){e.controller.abort()})}var ea=null,ta=0,na=0,ra=null;function ia(e,t){if(ea===null){var n=ea=[];ta=0,na=ld(),ra={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return ta++,t.then(aa,aa),t}function aa(){if(--ta===0&&ea!==null){ra!==null&&(ra.status=`fulfilled`);var e=ea;ea=null,na=0,ra=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function oa(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 sa=N.S;N.S=function(e,t){Zl=Ee(),typeof t==`object`&&t&&typeof t.then==`function`&&ia(e,t),sa!==null&&sa(e,t)};var ca=I(null);function la(){var e=ca.current;return e===null?Pl.pooledCache:e}function ua(e,t){t===null?L(ca,ca.current):L(ca,t.pool)}function da(){var e=la();return e===null?null:{parent:Zi._currentValue,pool:e}}var fa=Error(i(460)),pa=Error(i(474)),ma=Error(i(542)),ha={then:function(){}};function ga(e){return e=e.status,e===`fulfilled`||e===`rejected`}function X(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(Gt,Gt),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,ba(e),e;default:if(typeof t.status==`string`)t.then(Gt,Gt);else{if(e=Pl,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,ba(e),e}throw va=t,fa}}function _a(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(va=e,fa):e}}var va=null;function ya(){if(va===null)throw Error(i(459));var e=va;return va=null,e}function ba(e){if(e===fa||e===ma)throw Error(i(483))}var xa=null,Sa=0;function Ca(e){var t=Sa;return Sa+=1,xa===null&&(xa=[]),X(xa,e,t)}function wa(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function Ta(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 Ea(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=ti(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=ai(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&&_a(i)===t.type)?(t=a(t,n.props),wa(t,n),t.return=e,t):(t=ri(n.type,n.key,n.props,null,e.mode,r),wa(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=si(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=ii(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=ai(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case _:return n=ri(t.type,t.key,t.props,null,e.mode,n),wa(n,t),n.return=e,n;case v:return t=si(t,e.mode,n),t.return=e,t;case O:return t=_a(t),f(e,t,n)}if(ne(t)||j(t))return t=ii(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,Ca(t),n);if(t.$$typeof===C)return f(e,Ki(e,t),n);Ta(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=_a(n),p(e,t,n,r)}if(ne(n)||j(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,Ca(n),r);if(n.$$typeof===C)return p(e,t,Ki(e,n),r);Ta(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=_a(r),m(e,t,n,r,i)}if(ne(r)||j(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,Ca(r),i);if(r.$$typeof===C)return m(e,t,n,Ki(t,r),i);Ta(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),J&&yi(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 J&&yi(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)}),J&&yi(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),J&&yi(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 J&&yi(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)}),J&&yi(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&&_a(l)===r.type){n(e,r.sibling),c=a(r,o.props),wa(c,o),c.return=e,e=c;break a}n(e,r);break}else t(e,r);r=r.sibling}o.type===y?(c=ii(o.props.children,e.mode,c,o.key),c.return=e,e=c):(c=ri(o.type,o.key,o.props,null,e.mode,c),wa(c,o),c.return=e,e=c)}return s(e);case v:a:{for(l=o.key;r!==null;){if(r.key===l)if(r.tag===4&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),c=a(r,o.children||[]),c.return=e,e=c;break a}else{n(e,r);break}else t(e,r);r=r.sibling}c=si(o,e.mode,c),c.return=e,e=c}return s(e);case O:return o=_a(o),b(e,r,o,c)}if(ne(o))return h(e,r,o,c);if(j(o)){if(l=j(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,Ca(o),c);if(o.$$typeof===C)return b(e,r,Ki(e,o),c);Ta(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=ai(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{Sa=0;var i=b(e,t,n,r);return xa=null,i}catch(t){if(t===fa||t===ma)throw t;var a=$r(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var Da=Ea(!0),Oa=Ea(!1),ka=!1;function Aa(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function ja(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 Ma(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Na(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Nl&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=Xr(e),Yr(e,null,n),t}return Kr(e,r,t,n),Xr(e)}function Pa(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,Ze(e,n)}}function Fa(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 Ia=!1;function La(){if(Ia){var e=ra;if(e!==null)throw e}}function Ra(e,t,n,r){Ia=!1;var i=e.updateQueue;ka=!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?($&f)===f:(r&f)===f){f!==0&&f===na&&(Ia=!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:ka=!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),Hl|=o,e.lanes=o,e.memoizedState=d}}function za(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function Ba(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)za(n[e],t)}var Va=I(null),Ha=I(0);function Ua(e,t){e=Bl,L(Ha,e),L(Va,t),Bl=e|t.baseLanes}function Wa(){L(Ha,Bl),L(Va,Va.current)}function Ga(){Bl=Ha.current,ae(Va),ae(Ha)}var Ka=I(null),qa=null;function Ja(e){var t=e.alternate;L($a,$a.current&1),L(Ka,e),qa===null&&(t===null||Va.current!==null||t.memoizedState!==null)&&(qa=e)}function Ya(e){L($a,$a.current),L(Ka,e),qa===null&&(qa=e)}function Xa(e){e.tag===22?(L($a,$a.current),L(Ka,e),qa===null&&(qa=e)):Za(e)}function Za(){L($a,$a.current),L(Ka,Ka.current)}function Qa(e){ae(Ka),qa===e&&(qa=null),ae($a)}var $a=I(0);function eo(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||af(n)||of(n)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder===`forwards`||t.memoizedProps.revealOrder===`backwards`||t.memoizedProps.revealOrder===`unstable_legacy-backwards`||t.memoizedProps.revealOrder===`together`)){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var to=0,Z=null,no=null,ro=null,io=!1,ao=!1,oo=!1,so=0,co=0,lo=null,uo=0;function fo(){throw Error(i(321))}function po(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!mr(e[n],t[n]))return!1;return!0}function mo(e,t,n,r,i,a){return to=a,Z=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,N.H=e===null||e.memoizedState===null?js:Ms,oo=!1,a=n(r,i),oo=!1,ao&&(a=go(t,n,r,i)),ho(e),a}function ho(e){N.H=As;var t=no!==null&&no.next!==null;if(to=0,ro=no=Z=null,io=!1,co=0,lo=null,t)throw Error(i(300));e===null||Ys||(e=e.dependencies,e!==null&&Ui(e)&&(Ys=!0))}function go(e,t,n,r){Z=e;var a=0;do{if(ao&&(lo=null),co=0,ao=!1,25<=a)throw Error(i(301));if(a+=1,ro=no=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}N.H=Ns,o=t(n,r)}while(ao);return o}function _o(){var e=N.H,t=e.useState()[0];return t=typeof t.then==`function`?wo(t):t,e=e.useState()[0],(no===null?null:no.memoizedState)!==e&&(Z.flags|=1024),t}function vo(){var e=so!==0;return so=0,e}function yo(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function bo(e){if(io){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}io=!1}to=0,ro=no=Z=null,ao=!1,co=so=0,lo=null}function xo(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return ro===null?Z.memoizedState=ro=e:ro=ro.next=e,ro}function So(){if(no===null){var e=Z.alternate;e=e===null?null:e.memoizedState}else e=no.next;var t=ro===null?Z.memoizedState:ro.next;if(t!==null)ro=t,no=e;else{if(e===null)throw Z.alternate===null?Error(i(467)):Error(i(310));no=e,e={memoizedState:no.memoizedState,baseState:no.baseState,baseQueue:no.baseQueue,queue:no.queue,next:null},ro===null?Z.memoizedState=ro=e:ro=ro.next=e}return ro}function Co(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function wo(e){var t=co;return co+=1,lo===null&&(lo=[]),e=X(lo,e,t),t=Z,(ro===null?t.memoizedState:ro.next)===null&&(t=t.alternate,N.H=t===null||t.memoizedState===null?js:Ms),e}function To(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return wo(e);if(e.$$typeof===C)return Gi(e)}throw Error(i(438,String(e)))}function Eo(e){var t=null,n=Z.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=Z.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=Co(),Z.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),r=0;r<e;r++)n[r]=A;return t.index++,n}function Do(e,t){return typeof t==`function`?t(e):t}function Oo(e){return ko(So(),no,e)}function ko(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?(to&f)===f:($&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===na&&(d=!0);else if((to&p)===p){u=u.next,p===na&&(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,Z.lanes|=p,Hl|=p;f=u.action,oo&&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,Z.lanes|=f,Hl|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!mr(o,e.memoizedState)&&(Ys=!0,d&&(n=ra,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 Ao(e){var t=So(),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);mr(o,t.memoizedState)||(Ys=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function jo(e,t,n){var r=Z,a=So(),o=J;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!mr((no||a).memoizedState,n);if(s&&(a.memoizedState=n,Ys=!0),a=a.queue,ns(Po.bind(null,r,a,e),[e]),a.getSnapshot!==t||s||ro!==null&&ro.memoizedState.tag&1){if(r.flags|=2048,Zo(9,{destroy:void 0},No.bind(null,r,a,n,t),null),Pl===null)throw Error(i(349));o||to&127||Mo(r,t,n)}return n}function Mo(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Z.updateQueue,t===null?(t=Co(),Z.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function No(e,t,n,r){t.value=n,t.getSnapshot=r,Fo(t)&&Io(e)}function Po(e,t,n){return n(function(){Fo(t)&&Io(e)})}function Fo(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!mr(e,n)}catch{return!0}}function Io(e){var t=Jr(e,2);t!==null&&fu(t,e,2)}function Lo(e){var t=xo();if(typeof e==`function`){var n=e;if(e=n(),oo){Le(!0);try{n()}finally{Le(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Do,lastRenderedState:e},t}function Ro(e,t,n,r){return e.baseState=n,ko(e,no,typeof r==`function`?r:Do)}function zo(e,t,n,r,a){if(Ds(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)}};N.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,Bo(t,o)):(o.next=n.next,t.pending=n.next=o)}}function Bo(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=N.T,o={};N.T=o;try{var s=n(i,r),c=N.S;c!==null&&c(o,s),Vo(e,t,s)}catch(n){Uo(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),N.T=a}}else try{a=n(i,r),Vo(e,t,a)}catch(n){Uo(e,t,n)}}function Vo(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){Ho(e,t,n)},function(n){return Uo(e,t,n)}):Ho(e,t,n)}function Ho(e,t,n){t.status=`fulfilled`,t.value=n,Wo(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Bo(e,n)))}function Uo(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,Wo(t),t=t.next;while(t!==r)}e.action=null}function Wo(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Go(e,t){return t}function Ko(e,t){if(J){var n=Pl.formState;if(n!==null){a:{var r=Z;if(J){if(Ti){b:{for(var i=Ti,a=Di;i.nodeType!==8;){if(!a){i=null;break b}if(i=cf(i.nextSibling),i===null){i=null;break b}}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){Ti=cf(i.nextSibling),r=i.data===`F!`;break a}}ki(r)}r=!1}r&&(t=n[0])}}return n=xo(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Go,lastRenderedState:t},n.queue=r,n=ws.bind(null,Z,r),r.dispatch=n,r=Lo(!1),a=Es.bind(null,Z,!1,r.queue),r=xo(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=zo.bind(null,Z,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function qo(e){return Jo(So(),no,e)}function Jo(e,t,n){if(t=ko(e,t,Go)[0],e=Oo(Do)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=wo(t)}catch(e){throw e===fa?ma:e}else r=t;t=So();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(Z.flags|=2048,Zo(9,{destroy:void 0},Yo.bind(null,i,n),null)),[r,a,e]}function Yo(e,t){e.action=t}function Xo(e){var t=So(),n=no;if(n!==null)return Jo(t,n,e);So(),t=t.memoizedState,n=So();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function Zo(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=Z.updateQueue,t===null&&(t=Co(),Z.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 Qo(){return So().memoizedState}function $o(e,t,n,r){var i=xo();Z.flags|=e,i.memoizedState=Zo(1|t,{destroy:void 0},n,r===void 0?null:r)}function es(e,t,n,r){var i=So();r=r===void 0?null:r;var a=i.memoizedState.inst;no!==null&&r!==null&&po(r,no.memoizedState.deps)?i.memoizedState=Zo(t,a,n,r):(Z.flags|=e,i.memoizedState=Zo(1|t,a,n,r))}function ts(e,t){$o(8390656,8,e,t)}function ns(e,t){es(2048,8,e,t)}function rs(e){Z.flags|=4;var t=Z.updateQueue;if(t===null)t=Co(),Z.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function is(e){var t=So().memoizedState;return rs({ref:t,nextImpl:e}),function(){if(Nl&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function as(e,t){return es(4,2,e,t)}function os(e,t){return es(4,4,e,t)}function ss(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 cs(e,t,n){n=n==null?null:n.concat([e]),es(4,4,ss.bind(null,t,e),n)}function ls(){}function us(e,t){var n=So();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&po(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function ds(e,t){var n=So();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&po(t,r[1]))return r[0];if(r=e(),oo){Le(!0);try{e()}finally{Le(!1)}}return n.memoizedState=[r,t],r}function fs(e,t,n){return n===void 0||to&1073741824&&!($&261930)?e.memoizedState=t:(e.memoizedState=n,e=du(),Z.lanes|=e,Hl|=e,n)}function ps(e,t,n,r){return mr(n,t)?n:Va.current===null?!(to&42)||to&1073741824&&!($&261930)?(Ys=!0,e.memoizedState=n):(e=du(),Z.lanes|=e,Hl|=e,t):(e=fs(e,n,r),mr(e,t)||(Ys=!0),e)}function ms(e,t,n,r,i){var a=P.p;P.p=a!==0&&8>a?a:8;var o=N.T,s={};N.T=s,Es(e,!1,t,n);try{var c=i(),l=N.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?Ts(e,t,oa(c,r),uu(e)):Ts(e,t,r,uu(e))}catch(n){Ts(e,t,{then:function(){},status:`rejected`,reason:n},uu())}finally{P.p=a,o!==null&&s.types!==null&&(o.types=s.types),N.T=o}}function hs(){}function gs(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=_s(e).queue;ms(e,a,t,re,n===null?hs:function(){return vs(e),n(r)})}function _s(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:re,baseState:re,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Do,lastRenderedState:re},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Do,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function vs(e){var t=_s(e);t.next===null&&(t=e.alternate.memoizedState),Ts(e,t.next.queue,{},uu())}function ys(){return Gi(Qf)}function bs(){return So().memoizedState}function xs(){return So().memoizedState}function Ss(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=uu();e=Ma(n);var r=Na(t,e,n);r!==null&&(fu(r,t,n),Pa(r,t,n)),t={cache:Qi()},e.payload=t;return}t=t.return}}function Cs(e,t,n){var r=uu();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Ds(e)?Os(t,n):(n=qr(e,t,n,r),n!==null&&(fu(n,e,r),ks(n,t,r)))}function ws(e,t,n){Ts(e,t,n,uu())}function Ts(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Ds(e))Os(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,mr(s,o))return Kr(e,t,i,0),Pl===null&&Gr(),!1}catch{}if(n=qr(e,t,i,r),n!==null)return fu(n,e,r),ks(n,t,r),!0}return!1}function Es(e,t,n,r){if(r={lane:2,revertLane:ld(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Ds(e)){if(t)throw Error(i(479))}else t=qr(e,n,r,2),t!==null&&fu(t,e,2)}function Ds(e){var t=e.alternate;return e===Z||t!==null&&t===Z}function Os(e,t){ao=io=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function ks(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Ze(e,n)}}var As={readContext:Gi,use:To,useCallback:fo,useContext:fo,useEffect:fo,useImperativeHandle:fo,useLayoutEffect:fo,useInsertionEffect:fo,useMemo:fo,useReducer:fo,useRef:fo,useState:fo,useDebugValue:fo,useDeferredValue:fo,useTransition:fo,useSyncExternalStore:fo,useId:fo,useHostTransitionStatus:fo,useFormState:fo,useActionState:fo,useOptimistic:fo,useMemoCache:fo,useCacheRefresh:fo};As.useEffectEvent=fo;var js={readContext:Gi,use:To,useCallback:function(e,t){return xo().memoizedState=[e,t===void 0?null:t],e},useContext:Gi,useEffect:ts,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),$o(4194308,4,ss.bind(null,t,e),n)},useLayoutEffect:function(e,t){return $o(4194308,4,e,t)},useInsertionEffect:function(e,t){$o(4,2,e,t)},useMemo:function(e,t){var n=xo();t=t===void 0?null:t;var r=e();if(oo){Le(!0);try{e()}finally{Le(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=xo();if(n!==void 0){var i=n(t);if(oo){Le(!0);try{n(t)}finally{Le(!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=Cs.bind(null,Z,e),[r.memoizedState,e]},useRef:function(e){var t=xo();return e={current:e},t.memoizedState=e},useState:function(e){e=Lo(e);var t=e.queue,n=ws.bind(null,Z,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:ls,useDeferredValue:function(e,t){return fs(xo(),e,t)},useTransition:function(){var e=Lo(!1);return e=ms.bind(null,Z,e.queue,!0,!1),xo().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=Z,a=xo();if(J){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),Pl===null)throw Error(i(349));$&127||Mo(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,ts(Po.bind(null,r,o,e),[e]),r.flags|=2048,Zo(9,{destroy:void 0},No.bind(null,r,o,n,t),null),n},useId:function(){var e=xo(),t=Pl.identifierPrefix;if(J){var n=vi,r=_i;n=(r&~(1<<32-Re(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=so++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=uo++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:ys,useFormState:Ko,useActionState:Ko,useOptimistic:function(e){var t=xo();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=Es.bind(null,Z,!0,n),n.dispatch=t,[e,t]},useMemoCache:Eo,useCacheRefresh:function(){return xo().memoizedState=Ss.bind(null,Z)},useEffectEvent:function(e){var t=xo(),n={impl:e};return t.memoizedState=n,function(){if(Nl&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},Ms={readContext:Gi,use:To,useCallback:us,useContext:Gi,useEffect:ns,useImperativeHandle:cs,useInsertionEffect:as,useLayoutEffect:os,useMemo:ds,useReducer:Oo,useRef:Qo,useState:function(){return Oo(Do)},useDebugValue:ls,useDeferredValue:function(e,t){return ps(So(),no.memoizedState,e,t)},useTransition:function(){var e=Oo(Do)[0],t=So().memoizedState;return[typeof e==`boolean`?e:wo(e),t]},useSyncExternalStore:jo,useId:bs,useHostTransitionStatus:ys,useFormState:qo,useActionState:qo,useOptimistic:function(e,t){return Ro(So(),no,e,t)},useMemoCache:Eo,useCacheRefresh:xs};Ms.useEffectEvent=is;var Ns={readContext:Gi,use:To,useCallback:us,useContext:Gi,useEffect:ns,useImperativeHandle:cs,useInsertionEffect:as,useLayoutEffect:os,useMemo:ds,useReducer:Ao,useRef:Qo,useState:function(){return Ao(Do)},useDebugValue:ls,useDeferredValue:function(e,t){var n=So();return no===null?fs(n,e,t):ps(n,no.memoizedState,e,t)},useTransition:function(){var e=Ao(Do)[0],t=So().memoizedState;return[typeof e==`boolean`?e:wo(e),t]},useSyncExternalStore:jo,useId:bs,useHostTransitionStatus:ys,useFormState:Xo,useActionState:Xo,useOptimistic:function(e,t){var n=So();return no===null?(n.baseState=e,[e,n.queue.dispatch]):Ro(n,no,e,t)},useMemoCache:Eo,useCacheRefresh:xs};Ns.useEffectEvent=is;function Ps(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 Fs={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=uu(),i=Ma(r);i.payload=t,n!=null&&(i.callback=n),t=Na(e,i,r),t!==null&&(fu(t,e,r),Pa(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=uu(),i=Ma(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=Na(e,i,r),t!==null&&(fu(t,e,r),Pa(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=uu(),r=Ma(n);r.tag=2,t!=null&&(r.callback=t),t=Na(e,r,n),t!==null&&(fu(t,e,n),Pa(t,e,n))}};function Is(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?!q(n,r)||!q(i,a):!0}function Ls(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&&Fs.enqueueReplaceState(t,t.state,null)}function Rs(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 zs(e){Vr(e)}function Bs(e){console.error(e)}function Vs(e){Vr(e)}function Hs(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function Us(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 Ws(e,t,n){return n=Ma(n),n.tag=3,n.payload={element:null},n.callback=function(){Hs(e,t)},n}function Gs(e){return e=Ma(e),e.tag=3,e}function Ks(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(){Us(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){Us(t,n,r),typeof i!=`function`&&(eu===null?eu=new Set([this]):eu.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&&Hi(t,n,a,!0),n=Ka.current,n!==null){switch(n.tag){case 31:case 13:return qa===null?wu():n.alternate===null&&Vl===0&&(Vl=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===ha?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),Uu(e,r,a)),!1;case 22:return n.flags|=65536,r===ha?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)),Uu(e,r,a)),!1}throw Error(i(435,n.tag))}return Uu(e,r,a),wu(),!1}if(J)return t=Ka.current,t===null?(r!==Oi&&(t=Error(i(423),{cause:r}),Fi(li(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=li(r,n),a=Ws(e.stateNode,r,a),Fa(e,a),Vl!==4&&(Vl=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==Oi&&(e=Error(i(422),{cause:r}),Fi(li(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=li(o,n),ql===null?ql=[o]:ql.push(o),Vl!==4&&(Vl=2),t===null)return!0;r=li(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=Ws(n.stateNode,r,e),Fa(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`&&(eu===null||!eu.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=Gs(a),Ks(a,e,n,r),Fa(n,a),!1}n=n.return}while(n!==null);return!1}var Js=Error(i(461)),Ys=!1;function Xs(e,t,n,r){t.child=e===null?Oa(t,null,n,r):Da(t,e.child,n,r)}function Zs(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 Wi(t),r=mo(e,t,n,o,a,i),s=vo(),e!==null&&!Ys?(yo(e,t,i),xc(e,t,i)):(J&&s&&xi(t),t.flags|=1,Xs(e,t,r,i),t.child)}function Qs(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!ei(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,$s(e,t,a,r,i)):(e=ri(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!Sc(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?q:n,n(o,r)&&e.ref===t.ref)return xc(e,t,i)}return t.flags|=1,e=ti(a,r),e.ref=t.ref,e.return=t,t.child=e}function $s(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(q(a,r)&&e.ref===t.ref)if(Ys=!1,t.pendingProps=r=a,Sc(e,i))e.flags&131072&&(Ys=!0);else return t.lanes=e.lanes,xc(e,t,i)}return sc(e,t,n,r,i)}function ec(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 nc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&ua(t,a===null?null:a.cachePool),a===null?Wa():Ua(t,a),Xa(t);else return r=t.lanes=536870912,nc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&ua(t,null),Wa(),Za(t)):(ua(t,a.cachePool),Ua(t,a),Za(t),t.memoizedState=null);return Xs(e,t,i,n),t.child}function tc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function nc(e,t,n,r,i){var a=la();return a=a===null?null:{parent:Zi._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&ua(t,null),Wa(),Xa(t),e!==null&&Hi(e,t,r,!0),t.childLanes=i,null}function rc(e,t){return t=gc({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function ic(e,t,n){return Da(t,e.child,null,n),e=rc(t,t.pendingProps),e.flags|=2,Qa(t),t.memoizedState=null,e}function ac(e,t,n){var r=t.pendingProps,a=(t.flags&128)!=0;if(t.flags&=-129,e===null){if(J){if(r.mode===`hidden`)return e=rc(t,r),t.lanes=536870912,tc(null,e);if(Ya(t),(e=Ti)?(e=rf(e,Di),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:gi===null?null:{id:_i,overflow:vi},retryLane:536870912,hydrationErrors:null},n=oi(e),n.return=t,t.child=n,wi=t,Ti=null)):e=null,e===null)throw ki(t);return t.lanes=536870912,null}return rc(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(Ya(t),a)if(t.flags&256)t.flags&=-257,t=ic(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558));else if(Ys||Hi(e,t,n,!1),a=(n&e.childLanes)!==0,Ys||a){if(r=Pl,r!==null&&(s=Qe(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,Jr(e,s),fu(r,e,s),Js;wu(),t=ic(e,t,n)}else e=o.treeContext,Ti=cf(s.nextSibling),wi=t,J=!0,Ei=null,Di=!1,e!==null&&Ci(t,e),t=rc(t,r),t.flags|=4096;return t}return e=ti(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function oc(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 sc(e,t,n,r,i){return Wi(t),n=mo(e,t,n,r,void 0,i),r=vo(),e!==null&&!Ys?(yo(e,t,i),xc(e,t,i)):(J&&r&&xi(t),t.flags|=1,Xs(e,t,n,i),t.child)}function cc(e,t,n,r,i,a){return Wi(t),t.updateQueue=null,n=go(t,r,n,i),ho(e),r=vo(),e!==null&&!Ys?(yo(e,t,a),xc(e,t,a)):(J&&r&&xi(t),t.flags|=1,Xs(e,t,n,a),t.child)}function lc(e,t,n,r,i){if(Wi(t),t.stateNode===null){var a=Zr,o=n.contextType;typeof o==`object`&&o&&(a=Gi(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=Fs,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},Aa(t),o=n.contextType,a.context=typeof o==`object`&&o?Gi(o):Zr,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(Ps(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&&Fs.enqueueReplaceState(a,a.state,null),Ra(t,r,a,i),La(),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=Rs(n,s);a.props=c;var l=a.context,u=n.contextType;o=Zr,typeof u==`object`&&u&&(o=Gi(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)&&Ls(t,a,r,o),ka=!1;var f=t.memoizedState;a.state=f,Ra(t,r,a,i),La(),l=t.memoizedState,s||f!==l||ka?(typeof d==`function`&&(Ps(t,n,d,r),l=t.memoizedState),(c=ka||Is(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,ja(e,t),o=t.memoizedProps,u=Rs(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=Zr,typeof l==`object`&&l&&(c=Gi(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)&&Ls(t,a,r,c),ka=!1,f=t.memoizedState,a.state=f,Ra(t,r,a,i),La();var p=t.memoizedState;o!==d||f!==p||ka||e!==null&&e.dependencies!==null&&Ui(e.dependencies)?(typeof s==`function`&&(Ps(t,n,s,r),p=t.memoizedState),(u=ka||Is(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&Ui(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,oc(e,t),r=(t.flags&128)!=0,a||r?(a=t.stateNode,n=r&&typeof n.getDerivedStateFromError!=`function`?null:a.render(),t.flags|=1,e!==null&&r?(t.child=Da(t,e.child,null,i),t.child=Da(t,null,n,i)):Xs(e,t,n,i),t.memoizedState=a.state,e=t.child):e=xc(e,t,i),e}function uc(e,t,n,r){return Ni(),t.flags|=256,Xs(e,t,n,r),t.child}var dc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function fc(e){return{baseLanes:e,cachePool:da()}}function pc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=Gl),e}function mc(e,t,n){var r=t.pendingProps,a=!1,o=(t.flags&128)!=0,s;if((s=o)||(s=e!==null&&e.memoizedState===null?!1:($a.current&2)!=0),s&&(a=!0,t.flags&=-129),s=(t.flags&32)!=0,t.flags&=-33,e===null){if(J){if(a?Ja(t):Za(t),(e=Ti)?(e=rf(e,Di),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:gi===null?null:{id:_i,overflow:vi},retryLane:536870912,hydrationErrors:null},n=oi(e),n.return=t,t.child=n,wi=t,Ti=null)):e=null,e===null)throw ki(t);return of(e)?t.lanes=32:t.lanes=536870912,null}var c=r.children;return r=r.fallback,a?(Za(t),a=t.mode,c=gc({mode:`hidden`,children:c},a),r=ii(r,a,n,null),c.return=t,r.return=t,c.sibling=r,t.child=c,r=t.child,r.memoizedState=fc(n),r.childLanes=pc(e,s,n),t.memoizedState=dc,tc(null,r)):(Ja(t),hc(t,c))}var l=e.memoizedState;if(l!==null&&(c=l.dehydrated,c!==null)){if(o)t.flags&256?(Ja(t),t.flags&=-257,t=_c(e,t,n)):t.memoizedState===null?(Za(t),c=r.fallback,a=t.mode,r=gc({mode:`visible`,children:r.children},a),c=ii(c,a,n,null),c.flags|=2,r.return=t,c.return=t,r.sibling=c,t.child=r,Da(t,e.child,null,n),r=t.child,r.memoizedState=fc(n),r.childLanes=pc(e,s,n),t.memoizedState=dc,t=tc(null,r)):(Za(t),t.child=e.child,t.flags|=128,t=null);else if(Ja(t),of(c)){if(s=c.nextSibling&&c.nextSibling.dataset,s)var u=s.dgst;s=u,r=Error(i(419)),r.stack=``,r.digest=s,Fi({value:r,source:null,stack:null}),t=_c(e,t,n)}else if(Ys||Hi(e,t,n,!1),s=(n&e.childLanes)!==0,Ys||s){if(s=Pl,s!==null&&(r=Qe(s,n),r!==0&&r!==l.retryLane))throw l.retryLane=r,Jr(e,r),fu(s,e,r),Js;af(c)||wu(),t=_c(e,t,n)}else af(c)?(t.flags|=192,t.child=e.child,t=null):(e=l.treeContext,Ti=cf(c.nextSibling),wi=t,J=!0,Ei=null,Di=!1,e!==null&&Ci(t,e),t=hc(t,r.children),t.flags|=4096);return t}return a?(Za(t),c=r.fallback,a=t.mode,l=e.child,u=l.sibling,r=ti(l,{mode:`hidden`,children:r.children}),r.subtreeFlags=l.subtreeFlags&65011712,u===null?(c=ii(c,a,n,null),c.flags|=2):c=ti(u,c),c.return=t,r.return=t,r.sibling=c,t.child=r,tc(null,r),r=t.child,c=e.child.memoizedState,c===null?c=fc(n):(a=c.cachePool,a===null?a=da():(l=Zi._currentValue,a=a.parent===l?a:{parent:l,pool:l}),c={baseLanes:c.baseLanes|n,cachePool:a}),r.memoizedState=c,r.childLanes=pc(e,s,n),t.memoizedState=dc,tc(e.child,r)):(Ja(t),n=e.child,e=n.sibling,n=ti(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 hc(e,t){return t=gc({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function gc(e,t){return e=$r(22,e,null,t),e.lanes=0,e}function _c(e,t,n){return Da(t,e.child,null,n),e=hc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function vc(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Bi(e.return,t,n)}function yc(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 bc(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=$a.current,s=(o&2)!=0;if(s?(o=o&1|2,t.flags|=128):o&=1,L($a,o),Xs(e,t,r,n),r=J?pi:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&vc(e,n,t);else if(e.tag===19)vc(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&&eo(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),yc(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&&eo(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}yc(t,!0,n,null,a,r);break;case`together`:yc(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function xc(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Hl|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(Hi(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=ti(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=ti(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Sc(e,t){return(e.lanes&t)===0?(e=e.dependencies,!!(e!==null&&Ui(e))):!0}function Cc(e,t,n){switch(t.tag){case 3:ue(t,t.stateNode.containerInfo),Y(t,Zi,e.memoizedState.cache),Ni();break;case 27:case 5:fe(t);break;case 4:ue(t,t.stateNode.containerInfo);break;case 10:Y(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Ya(t),null;break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated===null?(n&t.child.childLanes)===0?(Ja(t),e=xc(e,t,n),e===null?null:e.sibling):mc(e,t,n):(Ja(t),t.flags|=128,null);Ja(t);break;case 19:var i=(e.flags&128)!=0;if(r=(n&t.childLanes)!==0,r||=(Hi(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return bc(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),L($a,$a.current),r)break;return null;case 22:return t.lanes=0,ec(e,t,n,t.pendingProps);case 24:Y(t,Zi,e.memoizedState.cache)}return xc(e,t,n)}function wc(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)Ys=!0;else{if(!Sc(e,n)&&!(t.flags&128))return Ys=!1,Cc(e,t,n);Ys=!!(e.flags&131072)}else Ys=!1,J&&t.flags&1048576&&bi(t,pi,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=_a(t.elementType),t.type=e,typeof e==`function`)ei(e)?(r=Rs(e,r),t.tag=1,t=lc(null,t,e,r,n)):(t.tag=0,t=sc(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===w){t.tag=11,t=Zs(null,t,e,r,n);break a}else if(a===D){t.tag=14,t=Qs(null,t,e,r,n);break a}}throw t=M(e)||e,Error(i(306,t,``))}}return t;case 0:return sc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=Rs(r,t.pendingProps),lc(e,t,r,a,n);case 3:a:{if(ue(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var o=t.memoizedState;a=o.element,ja(e,t),Ra(t,r,null,n);var s=t.memoizedState;if(r=s.cache,Y(t,Zi,r),r!==o.cache&&Vi(t,[Zi],n,!0),La(),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=uc(e,t,r,n);break a}else if(r!==a){a=li(Error(i(424)),t),Fi(a),t=uc(e,t,r,n);break a}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName===`HTML`?e.ownerDocument.body:e}for(Ti=cf(e.firstChild),wi=t,J=!0,Ei=null,Di=!0,n=Oa(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(Ni(),r===a){t=xc(e,t,n);break a}Xs(e,t,r,n)}t=t.child}return t;case 26:return oc(e,t),e===null?(n=kf(t.type,null,t.pendingProps,null))?t.memoizedState=n:J||(n=t.type,e=t.pendingProps,r=Bd(ce.current).createElement(n),r[it]=t,r[V]=e,Pd(r,n,e),pt(r),t.stateNode=r):t.memoizedState=kf(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return fe(t),e===null&&J&&(r=t.stateNode=ff(t.type,t.pendingProps,ce.current),wi=t,Di=!0,a=Ti,Zd(t.type)?(lf=a,Ti=cf(r.firstChild)):Ti=a),Xs(e,t,t.pendingProps.children,n),oc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&J&&((a=r=Ti)&&(r=tf(r,t.type,t.pendingProps,Di),r===null?a=!1:(t.stateNode=r,wi=t,Ti=cf(r.firstChild),Di=!1,a=!0)),a||ki(t)),fe(t),a=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,Ud(a,o)?r=null:s!==null&&Ud(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=mo(e,t,_o,null,null,n),Qf._currentValue=a),oc(e,t),Xs(e,t,r,n),t.child;case 6:return e===null&&J&&((e=n=Ti)&&(n=nf(n,t.pendingProps,Di),n===null?e=!1:(t.stateNode=n,wi=t,Ti=null,e=!0)),e||ki(t)),null;case 13:return mc(e,t,n);case 4:return ue(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Da(t,null,r,n):Xs(e,t,r,n),t.child;case 11:return Zs(e,t,t.type,t.pendingProps,n);case 7:return Xs(e,t,t.pendingProps,n),t.child;case 8:return Xs(e,t,t.pendingProps.children,n),t.child;case 12:return Xs(e,t,t.pendingProps.children,n),t.child;case 10:return r=t.pendingProps,Y(t,t.type,r.value),Xs(e,t,r.children,n),t.child;case 9:return a=t.type._context,r=t.pendingProps.children,Wi(t),a=Gi(a),r=r(a),t.flags|=1,Xs(e,t,r,n),t.child;case 14:return Qs(e,t,t.type,t.pendingProps,n);case 15:return $s(e,t,t.type,t.pendingProps,n);case 19:return bc(e,t,n);case 31:return ac(e,t,n);case 22:return ec(e,t,n,t.pendingProps);case 24:return Wi(t),r=Gi(Zi),e===null?(a=la(),a===null&&(a=Pl,o=Qi(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},Aa(t),Y(t,Zi,a)):((e.lanes&n)!==0&&(ja(e,t),Ra(t,null,null,n),La()),a=e.memoizedState,o=t.memoizedState,a.parent===r?(r=o.cache,Y(t,Zi,r),r!==a.cache&&Vi(t,[Zi],n,!0)):(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),Y(t,Zi,r))),Xs(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function Tc(e){e.flags|=4}function Ec(e,t,n,r,i){if((t=(e.mode&32)!=0)&&(t=!1),t){if(e.flags|=16777216,(i&335544128)===i)if(e.stateNode.complete)e.flags|=8192;else if(xu())e.flags|=8192;else throw va=ha,pa}else e.flags&=-16777217}function Dc(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!Wf(t))if(xu())e.flags|=8192;else throw va=ha,pa}function Oc(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:Ke(),e.lanes|=t,Kl|=t)}function kc(e,t){if(!J)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 Ac(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 jc(e,t,n){var r=t.pendingProps;switch(Si(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ac(t),null;case 1:return Ac(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),zi(Zi),de(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Mi(t)?Tc(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Pi())),Ac(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(Tc(t),o===null?(Ac(t),Ec(t,a,null,r,n)):(Ac(t),Dc(t,o))):o?o===e.memoizedState?(Ac(t),t.flags&=-16777217):(Tc(t),Ac(t),Dc(t,o)):(e=e.memoizedProps,e!==r&&Tc(t),Ac(t),Ec(t,a,e,r,n)),null;case 27:if(pe(t),n=ce.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Tc(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Ac(t),null}e=oe.current,Mi(t)?Ai(t,e):(e=ff(a,r,n),t.stateNode=e,Tc(t))}return Ac(t),null;case 5:if(pe(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Tc(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Ac(t),null}if(o=oe.current,Mi(t))Ai(t,o);else{var s=Bd(ce.current);switch(o){case 1:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case 2:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;default:switch(a){case`svg`:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case`math`:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;case`script`:o=s.createElement(`div`),o.innerHTML=`<script><\/script>`,o=o.removeChild(o.firstChild);break;case`select`:o=typeof r.is==`string`?s.createElement(`select`,{is:r.is}):s.createElement(`select`),r.multiple?o.multiple=!0:r.size&&(o.size=r.size);break;default:o=typeof r.is==`string`?s.createElement(a,{is:r.is}):s.createElement(a)}}o[it]=t,o[V]=r;a:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)o.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break a;for(;s.sibling===null;){if(s.return===null||s.return===t)break a;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=o;a:switch(Pd(o,a,r),a){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&Tc(t)}}return Ac(t),Ec(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&Tc(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=ce.current,Mi(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=wi,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[it]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||jd(e.nodeValue,n)),e||ki(t,!0)}else e=Bd(e).createTextNode(r),e[it]=t,t.stateNode=e}return Ac(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=Mi(t),n!==null){if(e===null){if(!r)throw Error(i(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(557));e[it]=t}else Ni(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Ac(t),e=!1}else n=Pi(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(Qa(t),t):(Qa(t),null);if(t.flags&128)throw Error(i(558))}return Ac(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=Mi(t),r!==null&&r.dehydrated!==null){if(e===null){if(!a)throw Error(i(318));if(a=t.memoizedState,a=a===null?null:a.dehydrated,!a)throw Error(i(317));a[it]=t}else Ni(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Ac(t),a=!1}else a=Pi(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(Qa(t),t):(Qa(t),null)}return Qa(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),Oc(t,t.updateQueue),Ac(t),null);case 4:return de(),e===null&&xd(t.stateNode.containerInfo),Ac(t),null;case 10:return zi(t.type),Ac(t),null;case 19:if(ae($a),r=t.memoizedState,r===null)return Ac(t),null;if(a=(t.flags&128)!=0,o=r.rendering,o===null)if(a)kc(r,!1);else{if(Vl!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=eo(e),o!==null){for(t.flags|=128,kc(r,!1),e=o.updateQueue,t.updateQueue=e,Oc(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)ni(n,e),n=n.sibling;return L($a,$a.current&1|2),J&&yi(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Ee()>Ql&&(t.flags|=128,a=!0,kc(r,!1),t.lanes=4194304)}else{if(!a)if(e=eo(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,Oc(t,e),kc(r,!0),r.tail===null&&r.tailMode===`hidden`&&!o.alternate&&!J)return Ac(t),null}else 2*Ee()-r.renderingStartTime>Ql&&n!==536870912&&(t.flags|=128,a=!0,kc(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?(Ac(t),null):(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=Ee(),e.sibling=null,n=$a.current,L($a,a?n&1|2:n&1),J&&yi(t,r.treeForkCount),e);case 22:case 23:return Qa(t),Ga(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(Ac(t),t.subtreeFlags&6&&(t.flags|=8192)):Ac(t),n=t.updateQueue,n!==null&&Oc(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&&ae(ca),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),zi(Zi),Ac(t),null;case 25:return null;case 30:return null}throw Error(i(156,t.tag))}function Mc(e,t){switch(Si(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return zi(Zi),de(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return pe(t),null;case 31:if(t.memoizedState!==null){if(Qa(t),t.alternate===null)throw Error(i(340));Ni()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Qa(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));Ni()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return ae($a),null;case 4:return de(),null;case 10:return zi(t.type),null;case 22:case 23:return Qa(t),Ga(),e!==null&&ae(ca),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return zi(Zi),null;case 25:return null;default:return null}}function Nc(e,t){switch(Si(t),t.tag){case 3:zi(Zi),de();break;case 26:case 27:case 5:pe(t);break;case 4:de();break;case 31:t.memoizedState!==null&&Qa(t);break;case 13:Qa(t);break;case 19:ae($a);break;case 10:zi(t.type);break;case 22:case 23:Qa(t),Ga(),e!==null&&ae(ca);break;case 24:zi(Zi)}}function Pc(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){Hu(t,t.return,e)}}function Fc(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){Hu(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){Hu(t,t.return,e)}}function Ic(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Ba(t,n)}catch(t){Hu(e,e.return,t)}}}function Lc(e,t,n){n.props=Rs(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){Hu(e,t,n)}}function Rc(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){Hu(e,t,n)}}function zc(e,t){var n=e.ref,r=e.refCleanup;if(n!==null)if(typeof r==`function`)try{r()}catch(n){Hu(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){Hu(e,t,n)}else n.current=null}function Bc(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){Hu(e,e.return,t)}}function Vc(e,t,n){try{var r=e.stateNode;Fd(r,e.type,n,t),r[V]=t}catch(t){Hu(e,e.return,t)}}function Hc(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Zd(e.type)||e.tag===4}function Uc(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Hc(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&Zd(e.type)||e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Wc(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=Gt));else if(r!==4&&(r===27&&Zd(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(Wc(e,t,n),e=e.sibling;e!==null;)Wc(e,t,n),e=e.sibling}function Gc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(r===27&&Zd(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(Gc(e,t,n),e=e.sibling;e!==null;)Gc(e,t,n),e=e.sibling}function Kc(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);Pd(t,r,n),t[it]=e,t[V]=n}catch(t){Hu(e,e.return,t)}}var qc=!1,Jc=!1,Yc=!1,Xc=typeof WeakSet==`function`?WeakSet:Set,Zc=null;function Qc(e,t){if(e=e.containerInfo,Rd=sp,e=vr(e),yr(e)){if(`selectionStart`in e)var n={start:e.selectionStart,end:e.selectionEnd};else a:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var a=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==n||a!==0&&f.nodeType!==3||(c=s+a),f!==o||r!==0&&f.nodeType!==3||(l=s+r),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===n&&++u===a&&(c=s),p===o&&++d===r&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}n=c===-1||l===-1?null:{start:c,end:l}}else n=null}n||={start:0,end:0}}else n=null;for(zd={focusedElem:e,selectionRange:n},sp=!1,Zc=t;Zc!==null;)if(t=Zc,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,Zc=e;else for(;Zc!==null;){switch(t=Zc,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=Rs(n.type,a);e=r.getSnapshotBeforeUpdate(h,o),r.__reactInternalSnapshotBeforeUpdate=e}catch(e){Hu(n,n.return,e)}}break;case 3:if(e&1024){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)ef(e);else if(n===1)switch(e.nodeName){case`HEAD`:case`HTML`:case`BODY`:ef(e);break;default:e.textContent=``}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if(e&1024)throw Error(i(163))}if(e=t.sibling,e!==null){e.return=t.return,Zc=e;break}Zc=t.return}}function $c(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:ml(e,n),r&4&&Pc(5,n);break;case 1:if(ml(e,n),r&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){Hu(n,n.return,e)}else{var i=Rs(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){Hu(n,n.return,e)}}r&64&&Ic(n),r&512&&Rc(n,n.return);break;case 3:if(ml(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{Ba(e,t)}catch(e){Hu(n,n.return,e)}}break;case 27:t===null&&r&4&&Kc(n);case 26:case 5:ml(e,n),t===null&&r&4&&Bc(n),r&512&&Rc(n,n.return);break;case 12:ml(e,n);break;case 31:ml(e,n),r&4&&al(e,n);break;case 13:ml(e,n),r&4&&ol(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=Ku.bind(null,n),sf(e,n))));break;case 22:if(r=n.memoizedState!==null||qc,!r){t=t!==null&&t.memoizedState!==null||Jc,i=qc;var a=Jc;qc=r,(Jc=t)&&!a?gl(e,n,(n.subtreeFlags&8772)!=0):ml(e,n),qc=i,Jc=a}break;case 30:break;default:ml(e,n)}}function el(e){var t=e.alternate;t!==null&&(e.alternate=null,el(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&ct(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 tl=null,nl=!1;function rl(e,t,n){for(n=n.child;n!==null;)il(e,t,n),n=n.sibling}function il(e,t,n){if(Ie&&typeof Ie.onCommitFiberUnmount==`function`)try{Ie.onCommitFiberUnmount(Fe,n)}catch{}switch(n.tag){case 26:Jc||zc(n,t),rl(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:Jc||zc(n,t);var r=tl,i=nl;Zd(n.type)&&(tl=n.stateNode,nl=!1),rl(e,t,n),pf(n.stateNode),tl=r,nl=i;break;case 5:Jc||zc(n,t);case 6:if(r=tl,i=nl,tl=null,rl(e,t,n),tl=r,nl=i,tl!==null)if(nl)try{(tl.nodeType===9?tl.body:tl.nodeName===`HTML`?tl.ownerDocument.body:tl).removeChild(n.stateNode)}catch(e){Hu(n,t,e)}else try{tl.removeChild(n.stateNode)}catch(e){Hu(n,t,e)}break;case 18:tl!==null&&(nl?(e=tl,Qd(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Np(e)):Qd(tl,n.stateNode));break;case 4:r=tl,i=nl,tl=n.stateNode.containerInfo,nl=!0,rl(e,t,n),tl=r,nl=i;break;case 0:case 11:case 14:case 15:Fc(2,n,t),Jc||Fc(4,n,t),rl(e,t,n);break;case 1:Jc||(zc(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&Lc(n,t,r)),rl(e,t,n);break;case 21:rl(e,t,n);break;case 22:Jc=(r=Jc)||n.memoizedState!==null,rl(e,t,n),Jc=r;break;default:rl(e,t,n)}}function al(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Np(e)}catch(e){Hu(t,t.return,e)}}}function ol(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Np(e)}catch(e){Hu(t,t.return,e)}}function sl(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Xc),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Xc),t;default:throw Error(i(435,e.tag))}}function cl(e,t){var n=sl(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=qu.bind(null,e,t);t.then(r,r)}})}function ll(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var a=n[r],o=e,s=t,c=s;a:for(;c!==null;){switch(c.tag){case 27:if(Zd(c.type)){tl=c.stateNode,nl=!1;break a}break;case 5:tl=c.stateNode,nl=!1;break a;case 3:case 4:tl=c.stateNode.containerInfo,nl=!0;break a}c=c.return}if(tl===null)throw Error(i(160));il(o,s,a),tl=null,nl=!1,o=a.alternate,o!==null&&(o.return=null),a.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)dl(t,e),t=t.sibling}var ul=null;function dl(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:ll(t,e),fl(e),r&4&&(Fc(3,e,e.return),Pc(3,e),Fc(5,e,e.return));break;case 1:ll(t,e),fl(e),r&512&&(Jc||n===null||zc(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=ul;if(ll(t,e),fl(e),r&512&&(Jc||n===null||zc(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[st]||o[it]||o.namespaceURI===`http://www.w3.org/2000/svg`||o.hasAttribute(`itemprop`))&&(o=a.createElement(r),a.head.insertBefore(o,a.querySelector(`head > title`))),Pd(o,r,n),o[it]=e,pt(o),r=o;break a;case`link`:var s=Vf(`link`,`href`,a).get(r+(n.href||``));if(s){for(var c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`href`)===(n.href==null||n.href===``?null:n.href)&&o.getAttribute(`rel`)===(n.rel==null?null:n.rel)&&o.getAttribute(`title`)===(n.title==null?null:n.title)&&o.getAttribute(`crossorigin`)===(n.crossOrigin==null?null:n.crossOrigin)){s.splice(c,1);break b}}o=a.createElement(r),Pd(o,r,n),a.head.appendChild(o);break;case`meta`:if(s=Vf(`meta`,`content`,a).get(r+(n.content||``))){for(c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`content`)===(n.content==null?null:``+n.content)&&o.getAttribute(`name`)===(n.name==null?null:n.name)&&o.getAttribute(`property`)===(n.property==null?null:n.property)&&o.getAttribute(`http-equiv`)===(n.httpEquiv==null?null:n.httpEquiv)&&o.getAttribute(`charset`)===(n.charSet==null?null:n.charSet)){s.splice(c,1);break b}}o=a.createElement(r),Pd(o,r,n),a.head.appendChild(o);break;default:throw Error(i(468,r))}o[it]=e,pt(o),r=o}e.stateNode=r}else Hf(a,e.type,e.stateNode);else e.stateNode=If(a,r,e.memoizedProps);else o===r?r===null&&e.stateNode!==null&&Vc(e,e.memoizedProps,n.memoizedProps):(o===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):o.count--,r===null?Hf(a,e.type,e.stateNode):If(a,r,e.memoizedProps))}break;case 27:ll(t,e),fl(e),r&512&&(Jc||n===null||zc(n,n.return)),n!==null&&r&4&&Vc(e,e.memoizedProps,n.memoizedProps);break;case 5:if(ll(t,e),fl(e),r&512&&(Jc||n===null||zc(n,n.return)),e.flags&32){a=e.stateNode;try{Lt(a,``)}catch(t){Hu(e,e.return,t)}}r&4&&e.stateNode!=null&&(a=e.memoizedProps,Vc(e,a,n===null?a:n.memoizedProps)),r&1024&&(Yc=!0);break;case 6:if(ll(t,e),fl(e),r&4){if(e.stateNode===null)throw Error(i(162));r=e.memoizedProps,n=e.stateNode;try{n.nodeValue=r}catch(t){Hu(e,e.return,t)}}break;case 3:if(Bf=null,a=ul,ul=gf(t.containerInfo),ll(t,e),ul=a,fl(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Np(t.containerInfo)}catch(t){Hu(e,e.return,t)}Yc&&(Yc=!1,pl(e));break;case 4:r=ul,ul=gf(e.stateNode.containerInfo),ll(t,e),fl(e),ul=r;break;case 12:ll(t,e),fl(e);break;case 31:ll(t,e),fl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,cl(e,r)));break;case 13:ll(t,e),fl(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(Xl=Ee()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,cl(e,r)));break;case 22:a=e.memoizedState!==null;var l=n!==null&&n.memoizedState!==null,u=qc,d=Jc;if(qc=u||a,Jc=d||l,ll(t,e),Jc=d,qc=u,fl(e),r&8192)a:for(t=e.stateNode,t._visibility=a?t._visibility&-2:t._visibility|1,a&&(n===null||l||qc||Jc||hl(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){Hu(l,l.return,e)}}}else if(t.tag===6){if(n===null){l=t;try{l.stateNode.nodeValue=a?``:l.memoizedProps}catch(e){Hu(l,l.return,e)}}}else if(t.tag===18){if(n===null){l=t;try{var m=l.stateNode;a?$d(m,!0):$d(l.stateNode,!1)}catch(e){Hu(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,cl(e,n))));break;case 19:ll(t,e),fl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,cl(e,r)));break;case 30:break;case 21:break;default:ll(t,e),fl(e)}}function fl(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(Hc(r)){n=r;break}r=r.return}if(n==null)throw Error(i(160));switch(n.tag){case 27:var a=n.stateNode;Gc(e,Uc(e),a);break;case 5:var o=n.stateNode;n.flags&32&&(Lt(o,``),n.flags&=-33),Gc(e,Uc(e),o);break;case 3:case 4:var s=n.stateNode.containerInfo;Wc(e,Uc(e),s);break;default:throw Error(i(161))}}catch(t){Hu(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function pl(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;pl(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function ml(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)$c(e,t.alternate,t),t=t.sibling}function hl(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Fc(4,t,t.return),hl(t);break;case 1:zc(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount==`function`&&Lc(t,t.return,n),hl(t);break;case 27:pf(t.stateNode);case 26:case 5:zc(t,t.return),hl(t);break;case 22:t.memoizedState===null&&hl(t);break;case 30:hl(t);break;default:hl(t)}e=e.sibling}}function gl(e,t,n){for(n&&=(t.subtreeFlags&8772)!=0,t=t.child;t!==null;){var r=t.alternate,i=e,a=t,o=a.flags;switch(a.tag){case 0:case 11:case 15:gl(i,a,n),Pc(4,a);break;case 1:if(gl(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){Hu(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++)za(c[i],s)}catch(e){Hu(r,r.return,e)}}n&&o&64&&Ic(a),Rc(a,a.return);break;case 27:Kc(a);case 26:case 5:gl(i,a,n),n&&r===null&&o&4&&Bc(a),Rc(a,a.return);break;case 12:gl(i,a,n);break;case 31:gl(i,a,n),n&&o&4&&al(i,a);break;case 13:gl(i,a,n),n&&o&4&&ol(i,a);break;case 22:a.memoizedState===null&&gl(i,a,n),Rc(a,a.return);break;case 30:break;default:gl(i,a,n)}t=t.sibling}}function _l(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&&$i(n))}function vl(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&$i(e))}function yl(e,t,n,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)bl(e,t,n,r),t=t.sibling}function bl(e,t,n,r){var i=t.flags;switch(t.tag){case 0:case 11:case 15:yl(e,t,n,r),i&2048&&Pc(9,t);break;case 1:yl(e,t,n,r);break;case 3:yl(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&&$i(e)));break;case 12:if(i&2048){yl(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){Hu(t,t.return,e)}}else yl(e,t,n,r);break;case 31:yl(e,t,n,r);break;case 13:yl(e,t,n,r);break;case 23:break;case 22:a=t.stateNode,o=t.alternate,t.memoizedState===null?a._visibility&2?yl(e,t,n,r):(a._visibility|=2,xl(e,t,n,r,(t.subtreeFlags&10256)!=0||!1)):a._visibility&2?yl(e,t,n,r):Sl(e,t),i&2048&&_l(o,t);break;case 24:yl(e,t,n,r),i&2048&&vl(t.alternate,t);break;default:yl(e,t,n,r)}}function xl(e,t,n,r,i){for(i&&=(t.subtreeFlags&10256)!=0||!1,t=t.child;t!==null;){var a=e,o=t,s=n,c=r,l=o.flags;switch(o.tag){case 0:case 11:case 15:xl(a,o,s,c,i),Pc(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,xl(a,o,s,c,i)):u._visibility&2?xl(a,o,s,c,i):Sl(a,o),i&&l&2048&&_l(o.alternate,o);break;case 24:xl(a,o,s,c,i),i&&l&2048&&vl(o.alternate,o);break;default:xl(a,o,s,c,i)}t=t.sibling}}function Sl(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:Sl(n,r),i&2048&&_l(r.alternate,r);break;case 24:Sl(n,r),i&2048&&vl(r.alternate,r);break;default:Sl(n,r)}t=t.sibling}}var Cl=8192;function wl(e,t,n){if(e.subtreeFlags&Cl)for(e=e.child;e!==null;)Tl(e,t,n),e=e.sibling}function Tl(e,t,n){switch(e.tag){case 26:wl(e,t,n),e.flags&Cl&&e.memoizedState!==null&&Gf(n,ul,e.memoizedState,e.memoizedProps);break;case 5:wl(e,t,n);break;case 3:case 4:var r=ul;ul=gf(e.stateNode.containerInfo),wl(e,t,n),ul=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Cl,Cl=16777216,wl(e,t,n),Cl=r):wl(e,t,n));break;default:wl(e,t,n)}}function El(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 Dl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];Zc=r,Al(r,e)}El(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Ol(e),e=e.sibling}function Ol(e){switch(e.tag){case 0:case 11:case 15:Dl(e),e.flags&2048&&Fc(9,e,e.return);break;case 3:Dl(e);break;case 12:Dl(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,kl(e)):Dl(e);break;default:Dl(e)}}function kl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];Zc=r,Al(r,e)}El(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Fc(8,t,t.return),kl(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,kl(t));break;default:kl(t)}e=e.sibling}}function Al(e,t){for(;Zc!==null;){var n=Zc;switch(n.tag){case 0:case 11:case 15:Fc(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:$i(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,Zc=r;else a:for(n=e;Zc!==null;){r=Zc;var i=r.sibling,a=r.return;if(el(r),r===n){Zc=null;break a}if(i!==null){i.return=a,Zc=i;break a}Zc=a}}}var jl={getCacheForType:function(e){var t=Gi(Zi),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return Gi(Zi).controller.signal}},Ml=typeof WeakMap==`function`?WeakMap:Map,Nl=0,Pl=null,Q=null,$=0,Fl=0,Il=null,Ll=!1,Rl=!1,zl=!1,Bl=0,Vl=0,Hl=0,Ul=0,Wl=0,Gl=0,Kl=0,ql=null,Jl=null,Yl=!1,Xl=0,Zl=0,Ql=1/0,$l=null,eu=null,tu=0,nu=null,ru=null,iu=0,au=0,ou=null,su=null,cu=0,lu=null;function uu(){return Nl&2&&$!==0?$&-$:N.T===null?tt():ld()}function du(){if(Gl===0)if(!($&536870912)||J){var e=Ue;Ue<<=1,!(Ue&3932160)&&(Ue=262144),Gl=e}else Gl=536870912;return e=Ka.current,e!==null&&(e.flags|=32),Gl}function fu(e,t,n){(e===Pl&&(Fl===2||Fl===9)||e.cancelPendingCommit!==null)&&(yu(e,0),gu(e,$,Gl,!1)),Je(e,n),(!(Nl&2)||e!==Pl)&&(e===Pl&&(!(Nl&2)&&(Ul|=n),Vl===4&&gu(e,$,Gl,!1)),td(e))}function pu(e,t,n){if(Nl&6)throw Error(i(327));var r=!n&&(t&127)==0&&(t&e.expiredLanes)===0||B(e,t),a=r?Du(e,t):Tu(e,t,!0),o=r;do{if(a===0){Rl&&!r&&gu(e,t,0,!1);break}else{if(n=e.current.alternate,o&&!hu(n)){a=Tu(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&&(yu(c,s).flags|=256),s=Tu(c,s,!1),s!==2){if(zl&&!l){c.errorRecoveryDisabledLanes|=o,Ul|=o,a=4;break a}o=Jl,Jl=a,o!==null&&(Jl===null?Jl=o:Jl.push.apply(Jl,o))}a=s}if(o=!1,a!==2)continue}}if(a===1){yu(e,0),gu(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:gu(r,t,Gl,!Ll);break a;case 2:Jl=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(a=Xl+300-Ee(),10<a)){if(gu(r,t,Gl,!Ll),We(r,0,!0)!==0)break a;iu=t,r.timeoutHandle=Kd(mu.bind(null,r,n,Jl,$l,Yl,t,Gl,Ul,Kl,Ll,o,`Throttled`,-0,0),a);break a}mu(r,n,Jl,$l,Yl,t,Gl,Ul,Kl,Ll,o,null,-0,0)}}break}while(1);td(e)}function mu(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:Gt},Tl(t,a,d);var m=(a&62914560)===a?Xl-Ee():(a&4194048)===a?Zl-Ee():0;if(m=qf(d,m),m!==null){iu=a,e.cancelPendingCommit=m(Pu.bind(null,e,t,a,n,r,i,o,s,c,u,d,null,f,p)),gu(e,a,o,!l);return}}Pu(e,t,a,n,r,i,o,s,c)}function hu(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(!mr(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 gu(e,t,n,r){t&=~Wl,t&=~Ul,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-Re(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&Xe(e,n,t)}function _u(){return Nl&6?!0:(nd(0,!1),!1)}function vu(){if(Q!==null){if(Fl===0)var e=Q.return;else e=Q,Ri=Li=null,bo(e),xa=null,Sa=0,e=Q;for(;e!==null;)Nc(e.alternate,e),e=e.return;Q=null}}function yu(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,qd(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),iu=0,vu(),Pl=e,Q=n=ti(e.current,null),$=t,Fl=0,Il=null,Ll=!1,Rl=B(e,t),zl=!1,Kl=Gl=Wl=Ul=Hl=Vl=0,Jl=ql=null,Yl=!1,t&8&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0<r;){var i=31-Re(r),a=1<<i;t|=e[i],r&=~a}return Bl=t,Gr(),n}function bu(e,t){Z=null,N.H=As,t===fa||t===ma?(t=ya(),Fl=3):t===pa?(t=ya(),Fl=4):Fl=t===Js?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,Il=t,Q===null&&(Vl=1,Hs(e,li(t,e.current)))}function xu(){var e=Ka.current;return e===null?!0:($&4194048)===$?qa===null:($&62914560)===$||$&536870912?e===qa:!1}function Su(){var e=N.H;return N.H=As,e===null?As:e}function Cu(){var e=N.A;return N.A=jl,e}function wu(){Vl=4,Ll||($&4194048)!==$&&Ka.current!==null||(Rl=!0),!(Hl&134217727)&&!(Ul&134217727)||Pl===null||gu(Pl,$,Gl,!1)}function Tu(e,t,n){var r=Nl;Nl|=2;var i=Su(),a=Cu();(Pl!==e||$!==t)&&($l=null,yu(e,t)),t=!1;var o=Vl;a:do try{if(Fl!==0&&Q!==null){var s=Q,c=Il;switch(Fl){case 8:vu(),o=6;break a;case 3:case 2:case 9:case 6:Ka.current===null&&(t=!0);var l=Fl;if(Fl=0,Il=null,ju(e,s,c,l),n&&Rl){o=0;break a}break;default:l=Fl,Fl=0,Il=null,ju(e,s,c,l)}}Eu(),o=Vl;break}catch(t){bu(e,t)}while(1);return t&&e.shellSuspendCounter++,Ri=Li=null,Nl=r,N.H=i,N.A=a,Q===null&&(Pl=null,$=0,Gr()),o}function Eu(){for(;Q!==null;)ku(Q)}function Du(e,t){var n=Nl;Nl|=2;var r=Su(),a=Cu();Pl!==e||$!==t?($l=null,Ql=Ee()+500,yu(e,t)):Rl=B(e,t);a:do try{if(Fl!==0&&Q!==null){t=Q;var o=Il;b:switch(Fl){case 1:Fl=0,Il=null,ju(e,t,o,1);break;case 2:case 9:if(ga(o)){Fl=0,Il=null,Au(t);break}t=function(){Fl!==2&&Fl!==9||Pl!==e||(Fl=7),td(e)},o.then(t,t);break a;case 3:Fl=7;break a;case 4:Fl=5;break a;case 7:ga(o)?(Fl=0,Il=null,Au(t)):(Fl=0,Il=null,ju(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?Wf(s):c.stateNode.complete){Fl=0,Il=null;var l=c.sibling;if(l!==null)Q=l;else{var u=c.return;u===null?Q=null:(Q=u,Mu(u))}break b}}Fl=0,Il=null,ju(e,t,o,5);break;case 6:Fl=0,Il=null,ju(e,t,o,6);break;case 8:vu(),Vl=6;break a;default:throw Error(i(462))}}Ou();break}catch(t){bu(e,t)}while(1);return Ri=Li=null,N.H=r,N.A=a,Nl=n,Q===null?(Pl=null,$=0,Gr(),Vl):0}function Ou(){for(;Q!==null&&!we();)ku(Q)}function ku(e){var t=wc(e.alternate,e,Bl);e.memoizedProps=e.pendingProps,t===null?Mu(e):Q=t}function Au(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=cc(n,t,t.pendingProps,t.type,void 0,$);break;case 11:t=cc(n,t,t.pendingProps,t.type.render,t.ref,$);break;case 5:bo(t);default:Nc(n,t),t=Q=ni(t,Bl),t=wc(n,t,Bl)}e.memoizedProps=e.pendingProps,t===null?Mu(e):Q=t}function ju(e,t,n,r){Ri=Li=null,bo(t),xa=null,Sa=0;var i=t.return;try{if(qs(e,i,t,n,$)){Vl=1,Hs(e,li(n,e.current)),Q=null;return}}catch(t){if(i!==null)throw Q=i,t;Vl=1,Hs(e,li(n,e.current)),Q=null;return}t.flags&32768?(J||r===1?e=!0:Rl||$&536870912?e=!1:(Ll=e=!0,(r===2||r===9||r===3||r===6)&&(r=Ka.current,r!==null&&r.tag===13&&(r.flags|=16384))),Nu(t,e)):Mu(t)}function Mu(e){var t=e;do{if(t.flags&32768){Nu(t,Ll);return}e=t.return;var n=jc(t.alternate,t,Bl);if(n!==null){Q=n;return}if(t=t.sibling,t!==null){Q=t;return}Q=t=e}while(t!==null);Vl===0&&(Vl=5)}function Nu(e,t){do{var n=Mc(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);Vl=6,Q=null}function Pu(e,t,n,r,a,o,s,c,l){e.cancelPendingCommit=null;do zu();while(tu!==0);if(Nl&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));if(o=t.lanes|t.childLanes,o|=Wr,Ye(e,n,o,s,c,l),e===Pl&&(Q=Pl=null,$=0),ru=t,nu=e,iu=n,au=o,ou=a,su=r,t.subtreeFlags&10256||t.flags&10256?(e.callbackNode=null,e.callbackPriority=0,Ju(Ae,function(){return Bu(),null})):(e.callbackNode=null,e.callbackPriority=0),r=(t.flags&13878)!=0,t.subtreeFlags&13878||r){r=N.T,N.T=null,a=P.p,P.p=2,s=Nl,Nl|=4;try{Qc(e,t,n)}finally{Nl=s,P.p=a,N.T=r}}tu=1,Fu(),Iu(),Lu()}}function Fu(){if(tu===1){tu=0;var e=nu,t=ru,n=(t.flags&13878)!=0;if(t.subtreeFlags&13878||n){n=N.T,N.T=null;var r=P.p;P.p=2;var i=Nl;Nl|=4;try{dl(t,e);var a=zd,o=vr(e.containerInfo),s=a.focusedElem,c=a.selectionRange;if(o!==s&&s&&s.ownerDocument&&_r(s.ownerDocument.documentElement,s)){if(c!==null&&yr(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 _=gr(s,h),v=gr(s,g);if(_&&v&&(p.rangeCount!==1||p.anchorNode!==_.node||p.anchorOffset!==_.offset||p.focusNode!==v.node||p.focusOffset!==v.offset)){var y=d.createRange();y.setStart(_.node,_.offset),p.removeAllRanges(),h>g?(p.addRange(y),p.extend(v.node,v.offset)):(y.setEnd(v.node,v.offset),p.addRange(y))}}}}for(d=[],p=s;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof s.focus==`function`&&s.focus(),s=0;s<d.length;s++){var b=d[s];b.element.scrollLeft=b.left,b.element.scrollTop=b.top}}sp=!!Rd,zd=Rd=null}finally{Nl=i,P.p=r,N.T=n}}e.current=t,tu=2}}function Iu(){if(tu===2){tu=0;var e=nu,t=ru,n=(t.flags&8772)!=0;if(t.subtreeFlags&8772||n){n=N.T,N.T=null;var r=P.p;P.p=2;var i=Nl;Nl|=4;try{$c(e,t.alternate,t)}finally{Nl=i,P.p=r,N.T=n}}tu=3}}function Lu(){if(tu===4||tu===3){tu=0,Te();var e=nu,t=ru,n=iu,r=su;t.subtreeFlags&10256||t.flags&10256?tu=5:(tu=0,ru=nu=null,Ru(e,e.pendingLanes));var i=e.pendingLanes;if(i===0&&(eu=null),et(n),t=t.stateNode,Ie&&typeof Ie.onCommitFiberRoot==`function`)try{Ie.onCommitFiberRoot(Fe,t,void 0,(t.current.flags&128)==128)}catch{}if(r!==null){t=N.T,i=P.p,P.p=2,N.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{N.T=t,P.p=i}}iu&3&&zu(),td(e),i=e.pendingLanes,n&261930&&i&42?e===lu?cu++:(cu=0,lu=e):cu=0,nd(0,!1)}}function Ru(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,$i(t)))}function zu(){return Fu(),Iu(),Lu(),Bu()}function Bu(){if(tu!==5)return!1;var e=nu,t=au;au=0;var n=et(iu),r=N.T,a=P.p;try{P.p=32>n?32:n,N.T=null,n=ou,ou=null;var o=nu,s=iu;if(tu=0,ru=nu=null,iu=0,Nl&6)throw Error(i(331));var c=Nl;if(Nl|=4,Ol(o.current),bl(o,o.current,s,n),Nl=c,nd(0,!1),Ie&&typeof Ie.onPostCommitFiberRoot==`function`)try{Ie.onPostCommitFiberRoot(Fe,o)}catch{}return!0}finally{P.p=a,N.T=r,Ru(e,t)}}function Vu(e,t,n){t=li(n,t),t=Ws(e.stateNode,t,2),e=Na(e,t,2),e!==null&&(Je(e,2),td(e))}function Hu(e,t,n){if(e.tag===3)Vu(e,e,n);else for(;t!==null;){if(t.tag===3){Vu(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(eu===null||!eu.has(r))){e=li(n,e),n=Gs(2),r=Na(t,n,2),r!==null&&(Ks(n,r,t,e),Je(r,2),td(r));break}}t=t.return}}function Uu(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Ml;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)||(zl=!0,i.add(n),e=Wu.bind(null,e,t,n),t.then(e,e))}function Wu(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Pl===e&&($&n)===n&&(Vl===4||Vl===3&&($&62914560)===$&&300>Ee()-Xl?!(Nl&2)&&yu(e,0):Wl|=n,Kl===$&&(Kl=0)),td(e)}function Gu(e,t){t===0&&(t=Ke()),e=Jr(e,t),e!==null&&(Je(e,t),td(e))}function Ku(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Gu(e,n)}function qu(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),Gu(e,n)}function Ju(e,t){return Se(e,t)}var Yu=null,Xu=null,Zu=!1,Qu=!1,$u=!1,ed=0;function td(e){e!==Xu&&e.next===null&&(Xu===null?Yu=Xu=e:Xu=Xu.next=e),Qu=!0,Zu||(Zu=!0,cd())}function nd(e,t){if(!$u&&Qu){$u=!0;do for(var n=!1,r=Yu;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-Re(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,sd(r,a))}else a=$,a=We(r,r===Pl?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||B(r,a)||(n=!0,sd(r,a));r=r.next}while(n);$u=!1}}function rd(){id()}function id(){Qu=Zu=!1;var e=0;ed!==0&&Gd()&&(e=ed);for(var t=Ee(),n=null,r=Yu;r!==null;){var i=r.next,a=ad(r,t);a===0?(r.next=null,n===null?Yu=i:n.next=i,i===null&&(Xu=n)):(n=r,(e!==0||a&3)&&(Qu=!0)),r=i}tu!==0&&tu!==5||nd(e,!1),ed!==0&&(ed=0)}function ad(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-Re(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=Ge(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=Pl,n=$,n=We(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(Fl===2||Fl===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&Ce(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||B(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&Ce(r),et(n)){case 2:case 8:n=ke;break;case 32:n=Ae;break;case 268435456:n=Me;break;default:n=Ae}return r=od.bind(null,e),n=Se(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&Ce(r),e.callbackPriority=2,e.callbackNode=null,2}function od(e,t){if(tu!==0&&tu!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(zu()&&e.callbackNode!==n)return null;var r=$;return r=We(e,e===Pl?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(pu(e,r,t),ad(e,Ee()),e.callbackNode!=null&&e.callbackNode===n?od.bind(null,e):null)}function sd(e,t){if(zu())return null;pu(e,t,!0)}function cd(){Yd(function(){Nl&6?Se(Oe,rd):id()})}function ld(){if(ed===0){var e=na;e===0&&(e=He,He<<=1,!(He&261888)&&(He=256)),ed=e}return ed}function ud(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:Wt(``+e)}function dd(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 fd(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=ud((i[V]||null).action),o=r.submitter;o&&(t=(t=o[V]||null)?ud(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new pn(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(ed!==0){var e=o?dd(i,o):new FormData(i);gs(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=o?dd(i,o):new FormData(i),gs(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var pd=0;pd<zr.length;pd++){var md=zr[pd];Br(md.toLowerCase(),`on`+(md[0].toUpperCase()+md.slice(1)))}Br(jr,`onAnimationEnd`),Br(Mr,`onAnimationIteration`),Br(Nr,`onAnimationStart`),Br(`dblclick`,`onDoubleClick`),Br(`focusin`,`onFocus`),Br(`focusout`,`onBlur`),Br(Pr,`onTransitionRun`),Br(Fr,`onTransitionStart`),Br(Ir,`onTransitionCancel`),Br(Lr,`onTransitionEnd`),_t(`onMouseEnter`,[`mouseout`,`mouseover`]),_t(`onMouseLeave`,[`mouseout`,`mouseover`]),_t(`onPointerEnter`,[`pointerout`,`pointerover`]),_t(`onPointerLeave`,[`pointerout`,`pointerover`]),gt(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),gt(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),gt(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),gt(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),gt(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),gt(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var hd=`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(` `),gd=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(hd));function _d(e,t){t=(t&4)!=0;for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;a:{var a=void 0;if(t)for(var o=r.length-1;0<=o;o--){var s=r[o],c=s.instance,l=s.currentTarget;if(s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){Vr(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){Vr(e)}i.currentTarget=null,a=c}}}}function vd(e,t){var n=t[ot];n===void 0&&(n=t[ot]=new Set);var r=e+`__bubble`;n.has(r)||(Sd(t,e,2,!1),n.add(r))}function yd(e,t,n){var r=0;t&&(r|=4),Sd(n,e,r,t)}var bd=`_reactListening`+Math.random().toString(36).slice(2);function xd(e){if(!e[bd]){e[bd]=!0,mt.forEach(function(t){t!==`selectionchange`&&(gd.has(t)||yd(t,!1,e),yd(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[bd]||(t[bd]=!0,yd(`selectionchange`,!1,t))}}function Sd(e,t,n,r){switch(mp(t)){case 2:var i=cp;break;case 8:i=lp;break;default:i=up}n=i.bind(null,t,n,e),i=void 0,!tn||t!==`touchstart`&&t!==`touchmove`&&t!==`wheel`||(i=!0),r?i===void 0?e.addEventListener(t,n,!0):e.addEventListener(t,n,{capture:!0,passive:i}):i===void 0?e.addEventListener(t,n,!1):e.addEventListener(t,n,{passive:i})}function Cd(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)a:for(;;){if(r===null)return;var s=r.tag;if(s===3||s===4){var c=r.stateNode.containerInfo;if(c===i)break;if(s===4)for(s=r.return;s!==null;){var l=s.tag;if((l===3||l===4)&&s.stateNode.containerInfo===i)return;s=s.return}for(;c!==null;){if(s=lt(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}Qt(function(){var r=a,i=qt(n),s=[];a:{var c=Rr.get(e);if(c!==void 0){var l=pn,u=e;switch(e){case`keypress`:if(cn(n)===0)break a;case`keydown`:case`keyup`:l=jn;break;case`focusin`:u=`focus`,l=Sn;break;case`focusout`:u=`blur`,l=Sn;break;case`beforeblur`:case`afterblur`:l=Sn;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=bn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=xn;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=Nn;break;case jr:case Mr:case Nr:l=Cn;break;case Lr:l=Pn;break;case`scroll`:case`scrollend`:l=hn;break;case`wheel`:l=Fn;break;case`copy`:case`cut`:case`paste`:l=wn;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=Mn;break;case`toggle`:case`beforetoggle`:l=In}var d=(t&4)!=0,f=!d&&(e===`scroll`||e===`scrollend`),p=d?c===null?null:c+`Capture`:c;d=[];for(var m=r,h;m!==null;){var g=m;if(h=g.stateNode,g=g.tag,g!==5&&g!==26&&g!==27||h===null||p===null||(g=$t(m,p),g!=null&&d.push(wd(m,g,h))),f)break;m=m.return}0<d.length&&(c=new l(c,u,null,n,i),s.push({event:c,listeners:d}))}}if(!(t&7)){a:{if(c=e===`mouseover`||e===`pointerover`,l=e===`mouseout`||e===`pointerout`,c&&n!==Kt&&(u=n.relatedTarget||n.fromElement)&&(lt(u)||u[at]))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?lt(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=bn,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=Mn,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=l==null?c:dt(l),h=u==null?c:dt(u),c=new d(g,m+`leave`,l,n,i),c.target=f,c.relatedTarget=h,g=null,lt(i)===r&&(d=new d(p,m+`enter`,u,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,l&&u)b:{for(d=Ed,p=l,m=u,h=0,g=p;g;g=d(g))h++;g=0;for(var _=m;_;_=d(_))g++;for(;0<h-g;)p=d(p),h--;for(;0<g-h;)m=d(m),g--;for(;h--;){if(p===m||m!==null&&p===m.alternate){d=p;break b}p=d(p),m=d(m)}d=null}else d=null;l!==null&&Dd(s,c,l,d,!1),u!==null&&f!==null&&Dd(s,f,u,d,!0)}}a:{if(c=r?dt(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var v=nr;else if(Xn(c))if(rr)v=fr;else{v=ur;var y=lr}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&Vt(r.elementType)&&(v=nr):v=dr;if(v&&=v(e,r)){Zn(s,v,n,i);break a}y&&y(e,c,r),e===`focusout`&&r&&c.type===`number`&&r.memoizedProps.value!=null&&Nt(c,`number`,c.value)}switch(y=r?dt(r):window,e){case`focusin`:(Xn(y)||y.contentEditable===`true`)&&(xr=y,Sr=r,Cr=null);break;case`focusout`:Cr=Sr=xr=null;break;case`mousedown`:wr=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:wr=!1,Tr(s,n,i);break;case`selectionchange`:if(br)break;case`keydown`:case`keyup`:Tr(s,n,i)}var b;if(Rn)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 Kn?Wn(e,n)&&(x=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(x=`onCompositionStart`);x&&(Vn&&n.locale!==`ko`&&(Kn||x!==`onCompositionStart`?x===`onCompositionEnd`&&Kn&&(b=sn()):(rn=i,an=`value`in rn?rn.value:rn.textContent,Kn=!0)),y=Td(r,x),0<y.length&&(x=new Tn(x,e,null,n,i),s.push({event:x,listeners:y}),b?x.data=b:(b=Gn(n),b!==null&&(x.data=b)))),(b=Bn?qn(e,n):Jn(e,n))&&(x=Td(r,`onBeforeInput`),0<x.length&&(y=new Tn(`onBeforeInput`,`beforeinput`,null,n,i),s.push({event:y,listeners:x}),y.data=b)),fd(s,e,r,n,i)}_d(s,t)})}function wd(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Td(e,t){for(var n=t+`Capture`,r=[];e!==null;){var i=e,a=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||a===null||(i=$t(e,n),i!=null&&r.unshift(wd(e,i,a)),i=$t(e,t),i!=null&&r.push(wd(e,i,a))),e.tag===3)return r;e=e.return}return[]}function Ed(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Dd(e,t,n,r,i){for(var a=t._reactName,o=[];n!==null&&n!==r;){var s=n,c=s.alternate,l=s.stateNode;if(s=s.tag,c!==null&&c===r)break;s!==5&&s!==26&&s!==27||l===null||(c=l,i?(l=$t(n,a),l!=null&&o.unshift(wd(n,l,c))):i||(l=$t(n,a),l!=null&&o.push(wd(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var Od=/\r\n?/g,kd=/\u0000|\uFFFD/g;function Ad(e){return(typeof e==`string`?e:``+e).replace(Od,`
|
|
9
|
-
`).replace(kd,``)}function jd(e,t){return t=Ad(t),Ad(e)===t}function Md(e,t,n,r,a,o){switch(n){case`children`:typeof r==`string`?t===`body`||t===`textarea`&&r===``||Lt(e,r):(typeof r==`number`||typeof r==`bigint`)&&t!==`body`&&Lt(e,``+r);break;case`className`:St(e,`class`,r);break;case`tabIndex`:St(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:St(e,n,r);break;case`style`:Bt(e,r,o);break;case`data`:if(t!==`object`){St(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=Wt(``+r),e.setAttribute(n,r);break;case`action`:case`formAction`:if(typeof r==`function`){e.setAttribute(n,`javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')`);break}else typeof o==`function`&&(n===`formAction`?(t!==`input`&&Md(e,t,`name`,a.name,a,null),Md(e,t,`formEncType`,a.formEncType,a,null),Md(e,t,`formMethod`,a.formMethod,a,null),Md(e,t,`formTarget`,a.formTarget,a,null)):(Md(e,t,`encType`,a.encType,a,null),Md(e,t,`method`,a.method,a,null),Md(e,t,`target`,a.target,a,null)));if(r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=Wt(``+r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=Gt);break;case`onScroll`:r!=null&&vd(`scroll`,e);break;case`onScrollEnd`:r!=null&&vd(`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=Wt(``+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`:vd(`beforetoggle`,e),vd(`toggle`,e),xt(e,`popover`,r);break;case`xlinkActuate`:Ct(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:Ct(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:Ct(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:Ct(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:Ct(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:Ct(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:Ct(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:Ct(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:Ct(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:xt(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=Ht.get(n)||n,xt(e,n,r))}}function Nd(e,t,n,r,a,o){switch(n){case`style`:Bt(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`?Lt(e,r):(typeof r==`number`||typeof r==`bigint`)&&Lt(e,``+r);break;case`onScroll`:r!=null&&vd(`scroll`,e);break;case`onScrollEnd`:r!=null&&vd(`scrollend`,e);break;case`onClick`:r!=null&&(e.onclick=Gt);break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:break;case`innerText`:case`textContent`:break;default:if(!ht.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[V]||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,``):xt(e,n,r)}}}function Pd(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:vd(`error`,e),vd(`load`,e);var r=!1,a=!1,o;for(o in n)if(n.hasOwnProperty(o)){var s=n[o];if(s!=null)switch(o){case`src`:r=!0;break;case`srcSet`:a=!0;break;case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:Md(e,t,o,s,n,null)}}a&&Md(e,t,`srcSet`,n.srcSet,n,null),r&&Md(e,t,`src`,n.src,n,null);return;case`input`:vd(`invalid`,e);var c=o=s=a=null,l=null,u=null;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case`name`:a=d;break;case`type`:s=d;break;case`checked`:l=d;break;case`defaultChecked`:u=d;break;case`value`:o=d;break;case`defaultValue`:c=d;break;case`children`:case`dangerouslySetInnerHTML`:if(d!=null)throw Error(i(137,t));break;default:Md(e,t,r,d,n,null)}}Mt(e,o,c,l,u,s,a,!1);return;case`select`:for(a in vd(`invalid`,e),r=s=o=null,n)if(n.hasOwnProperty(a)&&(c=n[a],c!=null))switch(a){case`value`:o=c;break;case`defaultValue`:s=c;break;case`multiple`:r=c;default:Md(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&Pt(e,!!r,n,!0):Pt(e,!!r,t,!1);return;case`textarea`:for(s in vd(`invalid`,e),o=a=r=null,n)if(n.hasOwnProperty(s)&&(c=n[s],c!=null))switch(s){case`value`:r=c;break;case`defaultValue`:a=c;break;case`children`:o=c;break;case`dangerouslySetInnerHTML`:if(c!=null)throw Error(i(91));break;default:Md(e,t,s,c,n,null)}It(e,r,a,o);return;case`option`:for(l in n)if(n.hasOwnProperty(l)&&(r=n[l],r!=null))switch(l){case`selected`:e.selected=r&&typeof r!=`function`&&typeof r!=`symbol`;break;default:Md(e,t,l,r,n,null)}return;case`dialog`:vd(`beforetoggle`,e),vd(`toggle`,e),vd(`cancel`,e),vd(`close`,e);break;case`iframe`:case`object`:vd(`load`,e);break;case`video`:case`audio`:for(r=0;r<hd.length;r++)vd(hd[r],e);break;case`image`:vd(`error`,e),vd(`load`,e);break;case`details`:vd(`toggle`,e);break;case`embed`:case`source`:case`link`:vd(`error`,e),vd(`load`,e);case`area`:case`base`:case`br`:case`col`:case`hr`:case`keygen`:case`meta`:case`param`:case`track`:case`wbr`:case`menuitem`:for(u in n)if(n.hasOwnProperty(u)&&(r=n[u],r!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:Md(e,t,u,r,n,null)}return;default:if(Vt(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&Nd(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&Md(e,t,c,r,n,null))}function Fd(e,t,n,r){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`input`:var a=null,o=null,s=null,c=null,l=null,u=null,d=null;for(m in n){var f=n[m];if(n.hasOwnProperty(m)&&f!=null)switch(m){case`checked`:break;case`value`:break;case`defaultValue`:l=f;default:r.hasOwnProperty(m)||Md(e,t,m,null,r,f)}}for(var p in r){var m=r[p];if(f=n[p],r.hasOwnProperty(p)&&(m!=null||f!=null))switch(p){case`type`:o=m;break;case`name`:a=m;break;case`checked`:u=m;break;case`defaultChecked`:d=m;break;case`value`:s=m;break;case`defaultValue`:c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(i(137,t));break;default:m!==f&&Md(e,t,p,m,r,f)}}jt(e,s,c,l,u,d,o,a);return;case`select`:for(o in m=s=c=p=null,n)if(l=n[o],n.hasOwnProperty(o)&&l!=null)switch(o){case`value`:break;case`multiple`:m=l;default:r.hasOwnProperty(o)||Md(e,t,o,null,r,l)}for(a in r)if(o=r[a],l=n[a],r.hasOwnProperty(a)&&(o!=null||l!=null))switch(a){case`value`:p=o;break;case`defaultValue`:c=o;break;case`multiple`:s=o;default:o!==l&&Md(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?Pt(e,!!n,n?[]:``,!1):Pt(e,!!n,t,!0)):Pt(e,!!n,p,!1);return;case`textarea`:for(c in m=p=null,n)if(a=n[c],n.hasOwnProperty(c)&&a!=null&&!r.hasOwnProperty(c))switch(c){case`value`:break;case`children`:break;default:Md(e,t,c,null,r,a)}for(s in r)if(a=r[s],o=n[s],r.hasOwnProperty(s)&&(a!=null||o!=null))switch(s){case`value`:p=a;break;case`defaultValue`:m=a;break;case`children`:break;case`dangerouslySetInnerHTML`:if(a!=null)throw Error(i(91));break;default:a!==o&&Md(e,t,s,a,r,o)}Ft(e,p,m);return;case`option`:for(var h in n)if(p=n[h],n.hasOwnProperty(h)&&p!=null&&!r.hasOwnProperty(h))switch(h){case`selected`:e.selected=!1;break;default:Md(e,t,h,null,r,p)}for(l in r)if(p=r[l],m=n[l],r.hasOwnProperty(l)&&p!==m&&(p!=null||m!=null))switch(l){case`selected`:e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:Md(e,t,l,p,r,m)}return;case`img`:case`link`:case`area`:case`base`:case`br`:case`col`:case`embed`:case`hr`:case`keygen`:case`meta`:case`param`:case`source`:case`track`:case`wbr`:case`menuitem`:for(var g in n)p=n[g],n.hasOwnProperty(g)&&p!=null&&!r.hasOwnProperty(g)&&Md(e,t,g,null,r,p);for(u in r)if(p=r[u],m=n[u],r.hasOwnProperty(u)&&p!==m&&(p!=null||m!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:if(p!=null)throw Error(i(137,t));break;default:Md(e,t,u,p,r,m)}return;default:if(Vt(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&Nd(e,t,_,void 0,r,p);for(d in r)p=r[d],m=n[d],!r.hasOwnProperty(d)||p===m||p===void 0&&m===void 0||Nd(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&Md(e,t,v,null,r,p);for(f in r)p=r[f],m=n[f],!r.hasOwnProperty(f)||p===m||p==null&&m==null||Md(e,t,f,p,r,m)}function Id(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function Ld(){if(typeof performance.getEntriesByType==`function`){for(var e=0,t=0,n=performance.getEntriesByType(`resource`),r=0;r<n.length;r++){var i=n[r],a=i.transferSize,o=i.initiatorType,s=i.duration;if(a&&s&&Id(o)){for(o=0,s=i.responseEnd,r+=1;r<n.length;r++){var c=n[r],l=c.startTime;if(l>s)break;var u=c.transferSize,d=c.initiatorType;u&&Id(d)&&(c=c.responseEnd,o+=u*(c<s?1:(s-l)/(c-l)))}if(--r,t+=8*(a+o)/(i.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e==`number`)?e:5}var Rd=null,zd=null;function Bd(e){return e.nodeType===9?e:e.ownerDocument}function Vd(e){switch(e){case`http://www.w3.org/2000/svg`:return 1;case`http://www.w3.org/1998/Math/MathML`:return 2;default:return 0}}function Hd(e,t){if(e===0)switch(t){case`svg`:return 1;case`math`:return 2;default:return 0}return e===1&&t===`foreignObject`?0:e}function Ud(e,t){return e===`textarea`||e===`noscript`||typeof t.children==`string`||typeof t.children==`number`||typeof t.children==`bigint`||typeof t.dangerouslySetInnerHTML==`object`&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Wd=null;function Gd(){var e=window.event;return e&&e.type===`popstate`?e===Wd?!1:(Wd=e,!0):(Wd=null,!1)}var Kd=typeof setTimeout==`function`?setTimeout:void 0,qd=typeof clearTimeout==`function`?clearTimeout:void 0,Jd=typeof Promise==`function`?Promise:void 0,Yd=typeof queueMicrotask==`function`?queueMicrotask:Jd===void 0?Kd:function(e){return Jd.resolve(null).then(e).catch(Xd)};function Xd(e){setTimeout(function(){throw e})}function Zd(e){return e===`head`}function Qd(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8)if(n=i.data,n===`/$`||n===`/&`){if(r===0){e.removeChild(i),Np(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)pf(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,pf(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[st]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&pf(e.ownerDocument.body);n=i}while(n);Np(t)}function $d(e,t){var n=e;e=0;do{var r=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display=`none`):(n.style.display=n._stashedDisplay||``,n.getAttribute(`style`)===``&&n.removeAttribute(`style`)):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=``):n.nodeValue=n._stashedText||``),r&&r.nodeType===8)if(n=r.data,n===`/$`){if(e===0)break;e--}else n!==`$`&&n!==`$?`&&n!==`$~`&&n!==`$!`||e++;n=r}while(n)}function ef(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case`HTML`:case`HEAD`:case`BODY`:ef(n),ct(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function tf(e,t,n,r){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!==`INPUT`||e.type!==`hidden`))break}else if(!r)if(t===`input`&&e.type===`hidden`){var a=i.name==null?null:``+i.name;if(i.type===`hidden`&&e.getAttribute(`name`)===a)return e}else return e;else if(!e[st])switch(t){case`meta`:if(!e.hasAttribute(`itemprop`))break;return e;case`link`:if(a=e.getAttribute(`rel`),a===`stylesheet`&&e.hasAttribute(`data-precedence`)||a!==i.rel||e.getAttribute(`href`)!==(i.href==null||i.href===``?null:i.href)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute(`title`)!==(i.title==null?null:i.title))break;return e;case`style`:if(e.hasAttribute(`data-precedence`))break;return e;case`script`:if(a=e.getAttribute(`src`),(a!==(i.src==null?null:i.src)||e.getAttribute(`type`)!==(i.type==null?null:i.type)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin))&&a&&e.hasAttribute(`async`)&&!e.hasAttribute(`itemprop`))break;return e;default:return e}if(e=cf(e.nextSibling),e===null)break}return null}function nf(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=cf(e.nextSibling),e===null))return null;return e}function rf(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=cf(e.nextSibling),e===null))return null;return e}function af(e){return e.data===`$?`||e.data===`$~`}function of(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function sf(e,t){var n=e.ownerDocument;if(e.data===`$~`)e._reactRetry=t;else if(e.data!==`$?`||n.readyState!==`loading`)t();else{var r=function(){t(),n.removeEventListener(`DOMContentLoaded`,r)};n.addEventListener(`DOMContentLoaded`,r),e._reactRetry=r}}function cf(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t===`$`||t===`$!`||t===`$?`||t===`$~`||t===`&`||t===`F!`||t===`F`)break;if(t===`/$`||t===`/&`)return null}}return e}var lf=null;function uf(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return cf(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function df(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`$`||n===`$!`||n===`$?`||n===`$~`||n===`&`){if(t===0)return e;t--}else n!==`/$`&&n!==`/&`||t++}e=e.previousSibling}return null}function ff(e,t,n){switch(t=Bd(n),e){case`html`:if(e=t.documentElement,!e)throw Error(i(452));return e;case`head`:if(e=t.head,!e)throw Error(i(453));return e;case`body`:if(e=t.body,!e)throw Error(i(454));return e;default:throw Error(i(451))}}function pf(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);ct(e)}var mf=new Map,hf=new Set;function gf(e){return typeof e.getRootNode==`function`?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var _f=P.d;P.d={f:vf,r:yf,D:Sf,C:Cf,L:wf,m:Tf,X:Df,S:Ef,M:Of};function vf(){var e=_f.f(),t=_u();return e||t}function yf(e){var t=ut(e);t!==null&&t.tag===5&&t.type===`form`?vs(t):_f.r(e)}var bf=typeof document>`u`?null:document;function xf(e,t,n){var r=bf;if(r&&typeof t==`string`&&t){var i=At(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),hf.has(i)||(hf.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),Pd(t,`link`,e),pt(t),r.head.appendChild(t)))}}function Sf(e){_f.D(e),xf(`dns-prefetch`,e,null)}function Cf(e,t){_f.C(e,t),xf(`preconnect`,e,t)}function wf(e,t,n){_f.L(e,t,n);var r=bf;if(r&&e&&t){var i=`link[rel="preload"][as="`+At(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+At(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+At(n.imageSizes)+`"]`)):i+=`[href="`+At(e)+`"]`;var a=i;switch(t){case`style`:a=Af(e);break;case`script`:a=Pf(e)}mf.has(a)||(e=h({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),mf.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(jf(a))||t===`script`&&r.querySelector(Ff(a))||(t=r.createElement(`link`),Pd(t,`link`,e),pt(t),r.head.appendChild(t)))}}function Tf(e,t){_f.m(e,t);var n=bf;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+At(r)+`"][href="`+At(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Pf(e)}if(!mf.has(a)&&(e=h({rel:`modulepreload`,href:e},t),mf.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Ff(a)))return}r=n.createElement(`link`),Pd(r,`link`,e),pt(r),n.head.appendChild(r)}}}function Ef(e,t,n){_f.S(e,t,n);var r=bf;if(r&&e){var i=ft(r).hoistableStyles,a=Af(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(jf(a)))s.loading=5;else{e=h({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=mf.get(a))&&Rf(e,n);var c=o=r.createElement(`link`);pt(c),Pd(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,Lf(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Df(e,t){_f.X(e,t);var n=bf;if(n&&e){var r=ft(n).hoistableScripts,i=Pf(e),a=r.get(i);a||(a=n.querySelector(Ff(i)),a||(e=h({src:e,async:!0},t),(t=mf.get(i))&&zf(e,t),a=n.createElement(`script`),pt(a),Pd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Of(e,t){_f.M(e,t);var n=bf;if(n&&e){var r=ft(n).hoistableScripts,i=Pf(e),a=r.get(i);a||(a=n.querySelector(Ff(i)),a||(e=h({src:e,async:!0,type:`module`},t),(t=mf.get(i))&&zf(e,t),a=n.createElement(`script`),pt(a),Pd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function kf(e,t,n,r){var a=(a=ce.current)?gf(a):null;if(!a)throw Error(i(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(t=Af(n.href),n=ft(a).hoistableStyles,r=n.get(t),r||(r={type:`style`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=Af(n.href);var o=ft(a).hoistableStyles,s=o.get(e);if(s||(a=a.ownerDocument||a,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=a.querySelector(jf(e)))&&!o._p&&(s.instance=o,s.state.loading=5),mf.has(e)||(n={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},mf.set(e,n),o||Nf(a,e,n,s.state))),t&&r===null)throw Error(i(528,``));return s}if(t&&r!==null)throw Error(i(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(t=Pf(n),n=ft(a).hoistableScripts,r=n.get(t),r||(r={type:`script`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(i(444,e))}}function Af(e){return`href="`+At(e)+`"`}function jf(e){return`link[rel="stylesheet"][`+e+`]`}function Mf(e){return h({},e,{"data-precedence":e.precedence,precedence:null})}function Nf(e,t,n,r){e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)?r.loading=1:(t=e.createElement(`link`),r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2}),Pd(t,`link`,n),pt(t),e.head.appendChild(t))}function Pf(e){return`[src="`+At(e)+`"]`}function Ff(e){return`script[async]`+e}function If(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+At(n.href)+`"]`);if(r)return t.instance=r,pt(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`),pt(r),Pd(r,`style`,a),Lf(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Af(n.href);var o=e.querySelector(jf(a));if(o)return t.state.loading|=4,t.instance=o,pt(o),o;r=Mf(n),(a=mf.get(a))&&Rf(r,a),o=(e.ownerDocument||e).createElement(`link`),pt(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),Pd(o,`link`,r),t.state.loading|=4,Lf(o,n.precedence,e),t.instance=o;case`script`:return o=Pf(n.src),(a=e.querySelector(Ff(o)))?(t.instance=a,pt(a),a):(r=n,(a=mf.get(o))&&(r=h({},n),zf(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),pt(a),Pd(a,`link`,r),e.head.appendChild(a),t.instance=a);case`void`:return null;default:throw Error(i(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Lf(r,n.precedence,e));return t.instance}function Lf(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o<r.length;o++){var s=r[o];if(s.dataset.precedence===t)a=s;else if(a!==i)break}a?a.parentNode.insertBefore(e,a.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function Rf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function zf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Bf=null;function Vf(e,t,n){if(Bf===null){var r=new Map,i=Bf=new Map;i.set(n,r)}else i=Bf,r=i.get(n),r||(r=new Map,i.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var a=n[i];if(!(a[st]||a[it]||e===`link`&&a.getAttribute(`rel`)===`stylesheet`)&&a.namespaceURI!==`http://www.w3.org/2000/svg`){var o=a.getAttribute(t)||``;o=e+o;var s=r.get(o);s?s.push(a):r.set(o,[a])}}return r}function Hf(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function Uf(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case`meta`:case`title`:return!0;case`style`:if(typeof t.precedence!=`string`||typeof t.href!=`string`||t.href===``)break;return!0;case`link`:if(typeof t.rel!=`string`||typeof t.href!=`string`||t.href===``||t.onLoad||t.onError)break;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!0}case`script`:if(t.async&&typeof t.async!=`function`&&typeof t.async!=`symbol`&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==`string`)return!0}return!1}function Wf(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function Gf(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=Af(r.href),a=t.querySelector(jf(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=Jf.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,pt(a);return}a=t.ownerDocument||t,r=Mf(r),(i=mf.get(i))&&Rf(r,i),a=a.createElement(`link`),pt(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),Pd(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=Jf.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var Kf=0;function qf(e,t){return e.stylesheets&&e.count===0&&Xf(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&Xf(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&Kf===0&&(Kf=62500*Ld());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Xf(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>Kf?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function Jf(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Xf(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Yf=null;function Xf(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Yf=new Map,t.forEach(Zf,e),Yf=null,Jf.call(e))}function Zf(e,t){if(!(t.state.loading&4)){var n=Yf.get(e);if(n)var r=n.get(null);else{n=new Map,Yf.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a<i.length;a++){var o=i[a];(o.nodeName===`LINK`||o.getAttribute(`media`)!==`not all`)&&(n.set(o.dataset.precedence,o),r=o)}r&&n.set(null,r)}i=t.instance,o=i.getAttribute(`data-precedence`),a=n.get(o)||r,a===r&&n.set(null,i),n.set(o,i),this.count++,r=Jf.bind(this),i.addEventListener(`load`,r),i.addEventListener(`error`,r),a?a.parentNode.insertBefore(i,a.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var Qf={$$typeof:C,Provider:null,Consumer:null,_currentValue:re,_currentValue2:re,_threadCount:0};function $f(e,t,n,r,i,a,o,s,c){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=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 ep(e,t,n,r,i,a,o,s,c,l,u,d){return e=new $f(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=$r(3,null,null,t),e.current=a,a.stateNode=e,t=Qi(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},Aa(a),e}function tp(e){return e?(e=Zr,e):Zr}function np(e,t,n,r,i,a){i=tp(i),r.context===null?r.context=i:r.pendingContext=i,r=Ma(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=Na(e,r,t),n!==null&&(fu(n,e,t),Pa(n,e,t))}function rp(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function ip(e,t){rp(e,t),(e=e.alternate)&&rp(e,t)}function ap(e){if(e.tag===13||e.tag===31){var t=Jr(e,67108864);t!==null&&fu(t,e,67108864),ip(e,67108864)}}function op(e){if(e.tag===13||e.tag===31){var t=uu();t=$e(t);var n=Jr(e,t);n!==null&&fu(n,e,t),ip(e,t)}}var sp=!0;function cp(e,t,n,r){var i=N.T;N.T=null;var a=P.p;try{P.p=2,up(e,t,n,r)}finally{P.p=a,N.T=i}}function lp(e,t,n,r){var i=N.T;N.T=null;var a=P.p;try{P.p=8,up(e,t,n,r)}finally{P.p=a,N.T=i}}function up(e,t,n,r){if(sp){var i=dp(r);if(i===null)Cd(e,t,r,fp,n),Cp(e,r);else if(Tp(i,e,t,n,r))r.stopPropagation();else if(Cp(e,r),t&4&&-1<Sp.indexOf(e)){for(;i!==null;){var a=ut(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=z(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-Re(o);s.entanglements[1]|=c,o&=~c}td(a),!(Nl&6)&&(Ql=Ee()+500,nd(0,!1))}}break;case 31:case 13:s=Jr(a,2),s!==null&&fu(s,a,2),_u(),ip(a,2)}if(a=dp(r),a===null&&Cd(e,t,r,fp,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else Cd(e,t,r,null,n)}}function dp(e){return e=qt(e),pp(e)}var fp=null;function pp(e){if(fp=null,e=lt(e),e!==null){var t=o(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=s(t),e!==null)return e;e=null}else if(n===31){if(e=c(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return fp=e,null}function mp(e){switch(e){case`beforetoggle`:case`cancel`:case`click`:case`close`:case`contextmenu`:case`copy`:case`cut`:case`auxclick`:case`dblclick`:case`dragend`:case`dragstart`:case`drop`:case`focusin`:case`focusout`:case`input`:case`invalid`:case`keydown`:case`keypress`:case`keyup`:case`mousedown`:case`mouseup`:case`paste`:case`pause`:case`play`:case`pointercancel`:case`pointerdown`:case`pointerup`:case`ratechange`:case`reset`:case`resize`:case`seeked`:case`submit`:case`toggle`:case`touchcancel`:case`touchend`:case`touchstart`:case`volumechange`:case`change`:case`selectionchange`:case`textInput`:case`compositionstart`:case`compositionend`:case`compositionupdate`:case`beforeblur`:case`afterblur`:case`beforeinput`:case`blur`:case`fullscreenchange`:case`focus`:case`hashchange`:case`popstate`:case`select`:case`selectstart`:return 2;case`drag`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`mousemove`:case`mouseout`:case`mouseover`:case`pointermove`:case`pointerout`:case`pointerover`:case`scroll`:case`touchmove`:case`wheel`:case`mouseenter`:case`mouseleave`:case`pointerenter`:case`pointerleave`:return 8;case`message`:switch(De()){case Oe:return 2;case ke:return 8;case Ae:case je:return 32;case Me:return 268435456;default:return 32}default:return 32}}var hp=!1,gp=null,_p=null,vp=null,yp=new Map,bp=new Map,xp=[],Sp=`mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset`.split(` `);function Cp(e,t){switch(e){case`focusin`:case`focusout`:gp=null;break;case`dragenter`:case`dragleave`:_p=null;break;case`mouseover`:case`mouseout`:vp=null;break;case`pointerover`:case`pointerout`:yp.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:bp.delete(t.pointerId)}}function wp(e,t,n,r,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},t!==null&&(t=ut(t),t!==null&&ap(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Tp(e,t,n,r,i){switch(t){case`focusin`:return gp=wp(gp,e,t,n,r,i),!0;case`dragenter`:return _p=wp(_p,e,t,n,r,i),!0;case`mouseover`:return vp=wp(vp,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return yp.set(a,wp(yp.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,bp.set(a,wp(bp.get(a)||null,e,t,n,r,i)),!0}return!1}function Ep(e){var t=lt(e.target);if(t!==null){var n=o(t);if(n!==null){if(t=n.tag,t===13){if(t=s(n),t!==null){e.blockedOn=t,nt(e.priority,function(){op(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,nt(e.priority,function(){op(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Dp(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=dp(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Kt=r,n.target.dispatchEvent(r),Kt=null}else return t=ut(n),t!==null&&ap(t),e.blockedOn=n,!1;t.shift()}return!0}function Op(e,t,n){Dp(e)&&n.delete(t)}function kp(){hp=!1,gp!==null&&Dp(gp)&&(gp=null),_p!==null&&Dp(_p)&&(_p=null),vp!==null&&Dp(vp)&&(vp=null),yp.forEach(Op),bp.forEach(Op)}function Ap(e,n){e.blockedOn===n&&(e.blockedOn=null,hp||(hp=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,kp)))}var jp=null;function Mp(e){jp!==e&&(jp=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){jp===e&&(jp=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],i=e[t+2];if(typeof r!=`function`){if(pp(r||n)===null)continue;break}var a=ut(n);a!==null&&(e.splice(t,3),t-=3,gs(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Np(e){function t(t){return Ap(t,e)}gp!==null&&Ap(gp,e),_p!==null&&Ap(_p,e),vp!==null&&Ap(vp,e),yp.forEach(t),bp.forEach(t);for(var n=0;n<xp.length;n++){var r=xp[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<xp.length&&(n=xp[0],n.blockedOn===null);)Ep(n),n.blockedOn===null&&xp.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var i=n[r],a=n[r+1],o=i[V]||null;if(typeof a==`function`)o||Mp(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[V]||null)s=o.formAction;else if(pp(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Mp(n)}}}function Pp(){function e(e){e.canIntercept&&e.info===`react-transition`&&e.intercept({handler:function(){return new Promise(function(e){return i=e})},focusReset:`manual`,scroll:`manual`})}function t(){i!==null&&(i(),i=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var e=navigation.currentEntry;e&&e.url!=null&&navigation.navigate(e.url,{state:e.getState(),info:`react-transition`,history:`replace`})}}if(typeof navigation==`object`){var r=!1,i=null;return navigation.addEventListener(`navigate`,e),navigation.addEventListener(`navigatesuccess`,t),navigation.addEventListener(`navigateerror`,t),setTimeout(n,100),function(){r=!0,navigation.removeEventListener(`navigate`,e),navigation.removeEventListener(`navigatesuccess`,t),navigation.removeEventListener(`navigateerror`,t),i!==null&&(i(),i=null)}}}function Fp(e){this._internalRoot=e}Ip.prototype.render=Fp.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;np(n,uu(),e,t,null,null)},Ip.prototype.unmount=Fp.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;np(e.current,2,null,e,null,null),_u(),t[at]=null}};function Ip(e){this._internalRoot=e}Ip.prototype.unstable_scheduleHydration=function(e){if(e){var t=tt();e={blockedOn:null,target:e,priority:t};for(var n=0;n<xp.length&&t!==0&&t<xp[n].priority;n++);xp.splice(n,0,e),n===0&&Ep(e)}};var Lp=n.version;if(Lp!==`19.2.5`)throw Error(i(527,Lp,`19.2.5`));P.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(i(188)):(e=Object.keys(e).join(`,`),Error(i(268,e)));return e=d(t),e=e===null?null:p(e),e=e===null?null:e.stateNode,e};var Rp={bundleType:0,version:`19.2.5`,rendererPackageName:`react-dom`,currentDispatcherRef:N,reconcilerVersion:`19.2.5`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var zp=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!zp.isDisabled&&zp.supportsFiber)try{Fe=zp.inject(Rp),Ie=zp}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=zs,s=Bs,c=Vs;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(o=t.onUncaughtError),t.onCaughtError!==void 0&&(s=t.onCaughtError),t.onRecoverableError!==void 0&&(c=t.onRecoverableError)),t=ep(e,1,!1,null,null,n,r,null,o,s,c,Pp),e[at]=t.current,xd(e),new Fp(t)}})),g=o(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=h()})),_=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},v=new class extends _{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e();return window.addEventListener(`visibilitychange`,t,!1),()=>{window.removeEventListener(`visibilitychange`,t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(e=>{typeof e==`boolean`?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e==`boolean`?this.#e:globalThis.document?.visibilityState!==`hidden`}},y={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},b=new class{#e=y;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}};function x(e){setTimeout(e,0)}var S=typeof window>`u`||`Deno`in globalThis;function C(){}function w(e,t){return typeof e==`function`?e(t):e}function T(e){return typeof e==`number`&&e>=0&&e!==1/0}function E(e,t){return Math.max(e+(t||0)-Date.now(),0)}function D(e,t){return typeof e==`function`?e(t):e}function O(e,t){return typeof e==`function`?e(t):e}function k(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==ee(o,t.options))return!1}else if(!te(t.queryKey,o))return!1}if(n!==`all`){let e=t.isActive();if(n===`active`&&!e||n===`inactive`&&e)return!1}return!(typeof s==`boolean`&&t.isStale()!==s||i&&i!==t.state.fetchStatus||a&&!a(t))}function A(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(j(t.options.mutationKey)!==j(a))return!1}else if(!te(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function ee(e,t){return(t?.queryKeyHashFn||j)(e)}function j(e){return JSON.stringify(e,(e,t)=>re(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function te(e,t){return e===t?!0:typeof e==typeof t&&e&&t&&typeof e==`object`&&typeof t==`object`?Object.keys(t).every(n=>te(e[n],t[n])):!1}var M=Object.prototype.hasOwnProperty;function ne(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=P(e)&&P(t);if(!r&&!(re(e)&&re(t)))return t;let i=(r?e:Object.keys(e)).length,a=r?t:Object.keys(t),o=a.length,s=r?Array(o):{},c=0;for(let l=0;l<o;l++){let o=r?l:a[l],u=e[o],d=t[o];if(u===d){s[o]=u,(r?l<i:M.call(e,o))&&c++;continue}if(u===null||d===null||typeof u!=`object`||typeof d!=`object`){s[o]=d;continue}let f=ne(u,d,n+1);s[o]=f,f===u&&c++}return i===o&&c===i?e:s}function N(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(e[n]!==t[n])return!1;return!0}function P(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function re(e){if(!F(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!F(n)||!n.hasOwnProperty(`isPrototypeOf`)||Object.getPrototypeOf(e)!==Object.prototype)}function F(e){return Object.prototype.toString.call(e)===`[object Object]`}function ie(e){return new Promise(t=>{b.setTimeout(t,e)})}function I(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:ne(e,t)}function ae(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function L(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var oe=Symbol();function se(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===oe?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function ce(e,t){return typeof e==`function`?e(...t):!!e}function le(e,t,n){let r=!1,i;return Object.defineProperty(e,`signal`,{enumerable:!0,get:()=>(i??=t(),r?i:(r=!0,i.aborted?n():i.addEventListener(`abort`,n,{once:!0}),i))}),e}var ue=(()=>{let e=()=>S;return{isServer(){return e()},setIsServer(t){e=t}}})();function de(){let e,t,n=new Promise((n,r)=>{e=n,t=r});n.status=`pending`,n.catch(()=>{});function r(e){Object.assign(n,e),delete n.resolve,delete n.reject}return n.resolve=t=>{r({status:`fulfilled`,value:t}),e(t)},n.reject=e=>{r({status:`rejected`,reason:e}),t(e)},n}var fe=x;function pe(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=fe,a=r=>{t?e.push(r):i(()=>{n(r)})},o=()=>{let t=e;e=[],t.length&&i(()=>{r(()=>{t.forEach(e=>{n(e)})})})};return{batch:e=>{let n;t++;try{n=e()}finally{t--,t||o()}return n},batchCalls:e=>(...t)=>{a(()=>{e(...t)})},schedule:a,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{i=e}}}var me=pe(),he=new class extends _{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e(!0),n=()=>e(!1);return window.addEventListener(`online`,t,!1),window.addEventListener(`offline`,n,!1),()=>{window.removeEventListener(`online`,t),window.removeEventListener(`offline`,n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#e}};function ge(e){return Math.min(1e3*2**e,3e4)}function _e(e){return(e??`online`)===`online`?he.isOnline():!0}var ve=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function ye(e){let t=!1,n=0,r,i=de(),a=()=>i.status!==`pending`,o=t=>{if(!a()){let n=new ve(t);f(n),e.onCancel?.(n)}},s=()=>{t=!0},c=()=>{t=!1},l=()=>v.isFocused()&&(e.networkMode===`always`||he.isOnline())&&e.canRun(),u=()=>_e(e.networkMode)&&e.canRun(),d=e=>{a()||(r?.(),i.resolve(e))},f=e=>{a()||(r?.(),i.reject(e))},p=()=>new Promise(t=>{r=e=>{(a()||l())&&t(e)},e.onPause?.()}).then(()=>{r=void 0,a()||e.onContinue?.()}),m=()=>{if(a())return;let r,i=n===0?e.initialPromise:void 0;try{r=i??e.fn()}catch(e){r=Promise.reject(e)}Promise.resolve(r).then(d).catch(r=>{if(a())return;let i=e.retry??(ue.isServer()?0:3),o=e.retryDelay??ge,s=typeof o==`function`?o(n,r):o,c=i===!0||typeof i==`number`&&n<i||typeof i==`function`&&i(n,r);if(t||!c){f(r);return}n++,e.onFail?.(n,r),ie(s).then(()=>l()?void 0:p()).then(()=>{t?f(r):m()})})};return{promise:i,status:()=>i.status,cancel:o,continue:()=>(r?.(),i),cancelRetry:s,continueRetry:c,canStart:u,start:()=>(u()?m():p().then(m),i)}}var be=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),T(this.gcTime)&&(this.#e=b.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(ue.isServer()?1/0:300*1e3))}clearGcTimeout(){this.#e!==void 0&&(b.clearTimeout(this.#e),this.#e=void 0)}};function xe(e){return{onFetch:(t,n)=>{let r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[],s={pages:[],pageParams:[]},c=0,l=async()=>{let n=!1,l=e=>{le(e,()=>t.signal,()=>n=!0)},u=se(t.options,t.fetchOptions),d=async(e,r,i)=>{if(n)return Promise.reject(t.signal.reason);if(r==null&&e.pages.length)return Promise.resolve(e);let a=await u((()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:i?`backward`:`forward`,meta:t.options.meta};return l(e),e})()),{maxPages:o}=t.options,s=i?L:ae;return{pages:s(e.pages,a,o),pageParams:s(e.pageParams,r,o)}};if(i&&a.length){let e=i===`backward`,t=e?Ce:Se,n={pages:a,pageParams:o};s=await d(n,t(r,n),e)}else{let t=e??a.length;do{let e=c===0?o[0]??r.initialPageParam:Se(r,s);if(c>0&&e==null)break;s=await d(s,e),c++}while(c<t)}return s};t.options.persister?t.fetchFn=()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=l}}}function Se(e,{pages:t,pageParams:n}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function Ce(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var we=class extends be{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e){super(),this.#s=!1,this.#o=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#i=e.client,this.#r=this.#i.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=De(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#a?.promise}setOptions(e){if(this.options={...this.#o,...e},e?._type&&(this.#e=e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let e=De(this.options);e.data!==void 0&&(this.setState(Ee(e.data,e.dataUpdatedAt)),this.#t=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#r.remove(this)}setData(e,t){let n=I(this.state.data,e,this.options);return this.#l({data:n,type:`success`,dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e){this.#l({type:`setState`,state:e})}cancel(e){let t=this.#a?.promise;return this.#a?.cancel(e),t?t.then(C).catch(C):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>O(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===oe||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>D(e.options.staleTime,this)===`static`):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e===`static`?!1:this.state.isInvalidated?!0:!E(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#a?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#a?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#r.notify({type:`observerAdded`,query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#a&&(this.#s||this.#c()?this.#a.cancel({revert:!0}):this.#a.cancelRetry()),this.scheduleGc()),this.#r.notify({type:`observerRemoved`,query:this,observer:e}))}getObserversCount(){return this.observers.length}#c(){return this.state.fetchStatus===`paused`&&this.state.status===`pending`}invalidate(){this.state.isInvalidated||this.#l({type:`invalidate`})}async fetch(e,t){if(this.state.fetchStatus!==`idle`&&this.#a?.status()!==`rejected`){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#a)return this.#a.continueRetry(),this.#a.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let n=new AbortController,r=e=>{Object.defineProperty(e,`signal`,{enumerable:!0,get:()=>(this.#s=!0,n.signal)})},i=()=>{let e=se(this.options,t),n=(()=>{let e={client:this.#i,queryKey:this.queryKey,meta:this.meta};return r(e),e})();return this.#s=!1,this.options.persister?this.options.persister(e,n,this):e(n)},a=(()=>{let e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:i};return r(e),e})();(this.#e===`infinite`?xe(this.options.pages):this.options.behavior)?.onFetch(a,this),this.#n=this.state,(this.state.fetchStatus===`idle`||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#l({type:`fetch`,meta:a.fetchOptions?.meta}),this.#a=ye({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof ve&&e.revert&&this.setState({...this.#n,fetchStatus:`idle`}),n.abort()},onFail:(e,t)=>{this.#l({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#l({type:`pause`})},onContinue:()=>{this.#l({type:`continue`})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{let e=await this.#a.start();if(e===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#r.config.onSuccess?.(e,this),this.#r.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof ve){if(e.silent)return this.#a.promise;if(e.revert){if(this.state.data===void 0)throw e;return this.state.data}}throw this.#l({type:`error`,error:e}),this.#r.config.onError?.(e,this),this.#r.config.onSettled?.(this.state.data,e,this),e}finally{this.scheduleGc()}}#l(e){let t=t=>{switch(e.type){case`failed`:return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case`pause`:return{...t,fetchStatus:`paused`};case`continue`:return{...t,fetchStatus:`fetching`};case`fetch`:return{...t,...Te(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...Ee(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:`idle`,fetchFailureCount:0,fetchFailureReason:null}};return this.#n=e.manual?n:void 0,n;case`error`:let r=e.error;return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:`idle`,status:`error`,isInvalidated:!0};case`invalidate`:return{...t,isInvalidated:!0};case`setState`:return{...t,...e.state}}};this.state=t(this.state),me.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),this.#r.notify({query:this,type:`updated`,action:e})})}};function Te(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:_e(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function Ee(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function De(e){let t=typeof e.initialData==`function`?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt==`function`?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?`success`:`pending`,fetchStatus:`idle`}}var Oe=class extends _{constructor(e,t){super(),this.options=t,this.#e=e,this.#s=null,this.#o=de(),this.bindMethods(),this.setOptions(t)}#e;#t=void 0;#n=void 0;#r=void 0;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p;#m=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),Ae(this.#t,this.options)?this.#h():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return je(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return je(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#x(),this.#t.removeObserver(this)}setOptions(e){let t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!=`boolean`&&typeof this.options.enabled!=`function`&&typeof O(this.options.enabled,this.#t)!=`boolean`)throw Error(`Expected enabled to be a boolean or a callback that returns a boolean`);this.#S(),this.#t.setOptions(this.options),t._defaulted&&!N(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let r=this.hasListeners();r&&Me(this.#t,n,this.options,t)&&this.#h(),this.updateResult(),r&&(this.#t!==n||O(this.options.enabled,this.#t)!==O(t.enabled,this.#t)||D(this.options.staleTime,this.#t)!==D(t.staleTime,this.#t))&&this.#g();let i=this.#_();r&&(this.#t!==n||O(this.options.enabled,this.#t)!==O(t.enabled,this.#t)||i!==this.#p)&&this.#v(i)}getOptimisticResult(e){let t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return Pe(this,n)&&(this.#r=n,this.#a=this.options,this.#i=this.#t.state),n}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(e,n)=>(this.trackProp(n),t?.(n),n===`promise`&&(this.trackProp(`data`),!this.options.experimental_prefetchInRender&&this.#o.status===`pending`&&this.#o.reject(Error(`experimental_prefetchInRender feature flag is not enabled`))),Reflect.get(e,n))})}trackProp(e){this.#m.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t);return n.fetch().then(()=>this.createResult(n,t))}fetch(e){return this.#h({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#h(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(C)),t}#g(){this.#b();let e=D(this.options.staleTime,this.#t);if(ue.isServer()||this.#r.isStale||!T(e))return;let t=E(this.#r.dataUpdatedAt,e)+1;this.#d=b.setTimeout(()=>{this.#r.isStale||this.updateResult()},t)}#_(){return(typeof this.options.refetchInterval==`function`?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#v(e){this.#x(),this.#p=e,!(ue.isServer()||O(this.options.enabled,this.#t)===!1||!T(this.#p)||this.#p===0)&&(this.#f=b.setInterval(()=>{(this.options.refetchIntervalInBackground||v.isFocused())&&this.#h()},this.#p))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#d!==void 0&&(b.clearTimeout(this.#d),this.#d=void 0)}#x(){this.#f!==void 0&&(b.clearInterval(this.#f),this.#f=void 0)}createResult(e,t){let n=this.#t,r=this.options,i=this.#r,a=this.#i,o=this.#a,s=e===n?this.#n:e.state,{state:c}=e,l={...c},u=!1,d;if(t._optimisticResults){let i=this.hasListeners(),a=!i&&Ae(e,t),o=i&&Me(e,n,t,r);(a||o)&&(l={...l,...Te(c.data,e.options)}),t._optimisticResults===`isRestoring`&&(l.fetchStatus=`idle`)}let{error:f,errorUpdatedAt:p,status:m}=l;d=l.data;let h=!1;if(t.placeholderData!==void 0&&d===void 0&&m===`pending`){let e;i?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(e=i.data,h=!0):e=typeof t.placeholderData==`function`?t.placeholderData(this.#u?.state.data,this.#u):t.placeholderData,e!==void 0&&(m=`success`,d=I(i?.data,e,t),u=!0)}if(t.select&&d!==void 0&&!h)if(i&&d===a?.data&&t.select===this.#c)d=this.#l;else try{this.#c=t.select,d=t.select(d),d=I(i?.data,d,t),this.#l=d,this.#s=null}catch(e){this.#s=e}this.#s&&(f=this.#s,d=this.#l,p=Date.now(),m=`error`);let g=l.fetchStatus===`fetching`,_=m===`pending`,v=m===`error`,y=_&&g,b=d!==void 0,x={status:m,fetchStatus:l.fetchStatus,isPending:_,isSuccess:m===`success`,isError:v,isInitialLoading:y,isLoading:y,data:d,dataUpdatedAt:l.dataUpdatedAt,error:f,errorUpdatedAt:p,failureCount:l.fetchFailureCount,failureReason:l.fetchFailureReason,errorUpdateCount:l.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:l.dataUpdateCount>s.dataUpdateCount||l.errorUpdateCount>s.errorUpdateCount,isFetching:g,isRefetching:g&&!_,isLoadingError:v&&!b,isPaused:l.fetchStatus===`paused`,isPlaceholderData:u,isRefetchError:v&&b,isStale:Ne(e,t),refetch:this.refetch,promise:this.#o,isEnabled:O(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){let t=x.data!==void 0,r=x.status===`error`&&!t,i=e=>{r?e.reject(x.error):t&&e.resolve(x.data)},a=()=>{i(this.#o=x.promise=de())},o=this.#o;switch(o.status){case`pending`:e.queryHash===n.queryHash&&i(o);break;case`fulfilled`:(r||x.data!==o.value)&&a();break;case`rejected`:(!r||x.error!==o.reason)&&a();break}}return x}updateResult(){let e=this.#r,t=this.createResult(this.#t,this.options);this.#i=this.#t.state,this.#a=this.options,this.#i.data!==void 0&&(this.#u=this.#t),!N(t,e)&&(this.#r=t,this.#C({listeners:(()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,n=typeof t==`function`?t():t;if(n===`all`||!n&&!this.#m.size)return!0;let r=new Set(n??this.#m);return this.options.throwOnError&&r.add(`error`),Object.keys(this.#r).some(t=>{let n=t;return this.#r[n]!==e[n]&&r.has(n)})})()}))}#S(){let e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;let t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}#C(e){me.batch(()=>{e.listeners&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}};function ke(e,t){return O(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status===`error`&&O(t.retryOnMount,e)===!1)}function Ae(e,t){return ke(e,t)||e.state.data!==void 0&&je(e,t,t.refetchOnMount)}function je(e,t,n){if(O(t.enabled,e)!==!1&&D(t.staleTime,e)!==`static`){let r=typeof n==`function`?n(e):n;return r===`always`||r!==!1&&Ne(e,t)}return!1}function Me(e,t,n,r){return(e!==t||O(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&Ne(e,n)}function Ne(e,t){return O(t.enabled,e)!==!1&&e.isStaleByTime(D(t.staleTime,e))}function Pe(e,t){return!N(e.getCurrentResult(),t)}var Fe=class extends be{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||Ie(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:`observerRemoved`,mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status===`pending`?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??this.execute(this.state.variables)}async execute(e){let t=()=>{this.#i({type:`continue`})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#r=ye({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(Error(`No mutationFn found`)),onFail:(e,t)=>{this.#i({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#i({type:`pause`})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});let r=this.state.status===`pending`,i=!this.#r.canStart();try{if(r)t();else{this.#i({type:`pending`,variables:e,isPaused:i}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);let t=await this.options.onMutate?.(e,n);t!==this.state.context&&this.#i({type:`pending`,context:t,variables:e,isPaused:i})}let a=await this.#r.start();return await this.#n.config.onSuccess?.(a,e,this.state.context,this,n),await this.options.onSuccess?.(a,e,this.state.context,n),await this.#n.config.onSettled?.(a,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(a,null,e,this.state.context,n),this.#i({type:`success`,data:a}),a}catch(t){try{await this.#n.config.onError?.(t,e,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,n)}catch(e){Promise.reject(e)}try{await this.#n.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,n)}catch(e){Promise.reject(e)}throw this.#i({type:`error`,error:t}),t}finally{this.#n.runNext(this)}}#i(e){let t=t=>{switch(e.type){case`failed`:return{...t,failureCount:e.failureCount,failureReason:e.error};case`pause`:return{...t,isPaused:!0};case`continue`:return{...t,isPaused:!1};case`pending`:return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:`pending`,variables:e.variables,submittedAt:Date.now()};case`success`:return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:`success`,isPaused:!1};case`error`:return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:`error`}}};this.state=t(this.state),me.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function Ie(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var Le=class extends _{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,t,n){let r=new Fe({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);let t=Re(e);if(typeof t==`string`){let n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:`added`,mutation:e})}remove(e){if(this.#e.delete(e)){let t=Re(e);if(typeof t==`string`){let n=this.#t.get(t);if(n)if(n.length>1){let t=n.indexOf(e);t!==-1&&n.splice(t,1)}else n[0]===e&&this.#t.delete(t)}}this.notify({type:`removed`,mutation:e})}canRun(e){let t=Re(e);if(typeof t==`string`){let n=this.#t.get(t)?.find(e=>e.state.status===`pending`);return!n||n===e}else return!0}runNext(e){let t=Re(e);return typeof t==`string`?(this.#t.get(t)?.find(t=>t!==e&&t.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){me.batch(()=>{this.#e.forEach(e=>{this.notify({type:`removed`,mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>A(t,e))}findAll(e={}){return this.getAll().filter(t=>A(e,t))}notify(e){me.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return me.batch(()=>Promise.all(e.map(e=>e.continue().catch(C))))}};function Re(e){return e.options.scope?.id}var ze=class extends _{#e;#t=void 0;#n;#r;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#i()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){let t=this.options;this.options=this.#e.defaultMutationOptions(e),N(this.options,t)||this.#e.getMutationCache().notify({type:`observerOptionsUpdated`,mutation:this.#n,observer:this}),t?.mutationKey&&this.options.mutationKey&&j(t.mutationKey)!==j(this.options.mutationKey)?this.reset():this.#n?.state.status===`pending`&&this.#n.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(e){this.#i(),this.#a(e)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#i(),this.#a()}mutate(e,t){return this.#r=t,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(e)}#i(){let e=this.#n?.state??Ie();this.#t={...e,isPending:e.status===`pending`,isSuccess:e.status===`success`,isError:e.status===`error`,isIdle:e.status===`idle`,mutate:this.mutate,reset:this.reset}}#a(e){me.batch(()=>{if(this.#r&&this.hasListeners()){let t=this.#t.variables,n=this.#t.context,r={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(e?.type===`success`){try{this.#r.onSuccess?.(e.data,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(e.data,null,t,n,r)}catch(e){Promise.reject(e)}}else if(e?.type===`error`){try{this.#r.onError?.(e.error,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(void 0,e.error,t,n,r)}catch(e){Promise.reject(e)}}}this.listeners.forEach(e=>{e(this.#t)})})}},Be=class extends _{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){let r=t.queryKey,i=t.queryHash??ee(r,t),a=this.get(i);return a||(a=new we({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(a)),a}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:`added`,query:e}))}remove(e){let t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:`removed`,query:e}))}clear(){me.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>k(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>k(e,t)):t}notify(e){me.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){me.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){me.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},Ve=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new Be,this.#t=e.mutationCache||new Le,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=v.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=he.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#o?.(),this.#o=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:`fetching`}).length}isMutating(e){return this.#t.findAll({...e,status:`pending`}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(D(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,n){let r=this.defaultQueryOptions({queryKey:e}),i=this.#e.get(r.queryHash)?.state.data,a=w(t,i);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return me.batch(()=>this.#e.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,n)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){let t=this.#e;me.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#e;return me.batch(()=>(n.findAll(e).forEach(e=>{e.reset()}),this.refetchQueries({type:`active`,...e},t)))}cancelQueries(e,t={}){let n={revert:!0,...t},r=me.batch(()=>this.#e.findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(C).catch(C)}invalidateQueries(e,t={}){return me.batch(()=>(this.#e.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType===`none`?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??`active`},t)))}refetchQueries(e,t={}){let n={...t,cancelRefetch:t.cancelRefetch??!0},r=me.batch(()=>this.#e.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,n);return n.throwOnError||(t=t.catch(C)),e.state.fetchStatus===`paused`?Promise.resolve():t}));return Promise.all(r).then(C)}fetchQuery(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t);return n.isStaleByTime(D(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(C).catch(C)}fetchInfiniteQuery(e){return e._type=`infinite`,this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(C).catch(C)}ensureInfiniteQueryData(e){return e._type=`infinite`,this.ensureQueryData(e)}resumePausedMutations(){return he.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#r.set(j(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#r.values()],n={};return t.forEach(t=>{te(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set(j(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#i.values()],n={};return t.forEach(t=>{te(e,t.mutationKey)&&Object.assign(n,t.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||=ee(t.queryKey,t),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!==`always`),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode=`offlineFirst`),t.queryFn===oe&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},He=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})),Ue=o(((e,t)=>{t.exports=He()})),R=c(u(),1),z=Ue(),We=R.createContext(void 0),B=e=>{let t=R.useContext(We);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},Ge=({client:e,children:t})=>(R.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,z.jsx)(We.Provider,{value:e,children:t})),Ke=R.createContext(!1),qe=()=>R.useContext(Ke);Ke.Provider;function Je(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var Ye=R.createContext(Je()),Xe=()=>R.useContext(Ye),Ze=(e,t,n)=>{let r=n?.state.error&&typeof e.throwOnError==`function`?ce(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},Qe=e=>{R.useEffect(()=>{e.clearReset()},[e])},$e=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||ce(n,[e.error,r])),et=e=>{if(e.suspense){let t=1e3,n=e=>e===`static`?e:Math.max(e??t,t),r=e.staleTime;e.staleTime=typeof r==`function`?(...e)=>n(r(...e)):n(r),typeof e.gcTime==`number`&&(e.gcTime=Math.max(e.gcTime,t))}},tt=(e,t)=>e.isLoading&&e.isFetching&&!t,nt=(e,t)=>e?.suspense&&t.isPending,rt=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function it(e,t,n){let r=qe(),i=Xe(),a=B(n),o=a.defaultQueryOptions(e);a.getDefaultOptions().queries?._experimental_beforeQuery?.(o);let s=a.getQueryCache().get(o.queryHash);o._optimisticResults=r?`isRestoring`:`optimistic`,et(o),Ze(o,i,s),Qe(i);let c=!a.getQueryCache().get(o.queryHash),[l]=R.useState(()=>new t(a,o)),u=l.getOptimisticResult(o),d=!r&&e.subscribed!==!1;if(R.useSyncExternalStore(R.useCallback(e=>{let t=d?l.subscribe(me.batchCalls(e)):C;return l.updateResult(),t},[l,d]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),R.useEffect(()=>{l.setOptions(o)},[o,l]),nt(o,u))throw rt(o,l,i);if($e({result:u,errorResetBoundary:i,throwOnError:o.throwOnError,query:s,suspense:o.suspense}))throw u.error;return a.getDefaultOptions().queries?._experimental_afterQuery?.(o,u),o.experimental_prefetchInRender&&!ue.isServer()&&tt(u,r)&&(c?rt(o,l,i):s?.promise)?.catch(C).finally(()=>{l.updateResult()}),o.notifyOnChangeProps?u:l.trackResult(u)}function V(e,t){return it(e,Oe,t)}function at(e,t){let n=B(t),[r]=R.useState(()=>new ze(n,e));R.useEffect(()=>{r.setOptions(e)},[r,e]);let i=R.useSyncExternalStore(R.useCallback(e=>r.subscribe(me.batchCalls(e)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),a=R.useCallback((e,t)=>{r.mutate(e,t).catch(C)},[r]);if(i.error&&ce(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:a,mutateAsync:i.mutate}}var ot=c(g(),1);async function H(e){let t=await fetch(e);if(!t.ok){let e=await t.text().catch(()=>``);throw Error(`${t.status} ${t.statusText}: ${e.slice(0,200)}`)}return await t.json()}async function U(e,t,n){let r=await fetch(t,{method:e,headers:n===void 0?void 0:{"content-type":`application/json`},body:n===void 0?void 0:JSON.stringify(n)});if(!r.ok){let e=await r.text().catch(()=>``);throw Error(`${r.status} ${r.statusText}: ${e.slice(0,200)}`)}return await r.json()}var W={stats:()=>H(`/api/stats`),projects:()=>H(`/api/projects`),sessions:(e={})=>{let t=new URLSearchParams({limit:String(e.limit??200)});return e.projectName&&t.set(`project`,e.projectName),e.since&&t.set(`since`,e.since),e.until&&t.set(`until`,e.until),e.collectionId&&t.set(`collection`,e.collectionId),H(`/api/sessions?${t}`)},session:e=>H(`/api/sessions/${encodeURIComponent(e)}`),search:(e,t=40,n,r)=>{let i=new URLSearchParams({q:e,limit:String(t)});return n&&i.set(`project`,n),r&&i.set(`mode`,r),H(`/api/search?${i}`)},allTags:()=>H(`/api/tags`),sessionTags:e=>H(`/api/sessions/${encodeURIComponent(e)}/tags`),addSessionTag:async(e,t)=>{let n=await fetch(`/api/sessions/${encodeURIComponent(e)}/tags`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({tag:t})});if(!n.ok)throw Error(`${n.status}: ${await n.text()}`);return await n.json()},removeSessionTag:async(e,t)=>{let n=await fetch(`/api/sessions/${encodeURIComponent(e)}/tags/${encodeURIComponent(t)}`,{method:`DELETE`});if(!n.ok)throw Error(`${n.status}: ${await n.text()}`);return await n.json()},listCollections:(e=!1)=>{let t=new URLSearchParams;e&&t.set(`archived`,`1`);let n=t.toString();return H(`/api/collections${n?`?${n}`:``}`)},getCollection:e=>H(`/api/collections/${encodeURIComponent(e)}`),createCollection:e=>U(`POST`,`/api/collections`,e),patchCollection:(e,t)=>U(`PATCH`,`/api/collections/${encodeURIComponent(e)}`,t),archiveCollection:e=>U(`POST`,`/api/collections/${encodeURIComponent(e)}/archive`),restoreCollection:e=>U(`POST`,`/api/collections/${encodeURIComponent(e)}/restore`),addSessionToCollection:(e,t,n)=>U(`POST`,`/api/collections/${encodeURIComponent(e)}/members`,{session_id:t,note:n??null}),removeSessionFromCollection:(e,t)=>U(`DELETE`,`/api/collections/${encodeURIComponent(e)}/members/${encodeURIComponent(t)}`),sessionCollections:e=>H(`/api/sessions/${encodeURIComponent(e)}/collections`),getAutoTagConfig:()=>H(`/api/config/auto-tag`),putAutoTagConfig:e=>U(`PUT`,`/api/config/auto-tag`,e),startScan:e=>U(`POST`,`/api/tags/scan`,{scope:e}),getScan:e=>H(`/api/tags/scan/${encodeURIComponent(e)}`),applyScan:(e,t)=>U(`POST`,`/api/tags/scan/${encodeURIComponent(e)}/apply`,{selection:t}),cancelScan:e=>U(`DELETE`,`/api/tags/scan/${encodeURIComponent(e)}`),getMcpInstallStatus:()=>H(`/api/config/mcp-install`),installMcp:()=>U(`POST`,`/api/config/mcp-install`),uninstallMcp:()=>U(`DELETE`,`/api/config/mcp-install`),getAutopilotStatus:()=>H(`/api/autopilot/status`),kickAutopilot:()=>U(`POST`,`/api/autopilot/kick`),runClaudeCliScan:(e,t={})=>U(`POST`,`/api/tags/scan/claude-cli`,t.scanId?{scope:e,scanId:t.scanId}:{scope:e}),subscribeToScanProgress:e=>new EventSource(`/api/claude-cli/scan/${encodeURIComponent(e)}/progress`),listPrompts:()=>H(`/api/prompts`),runPrompt:(e,t)=>U(`POST`,`/api/prompts/run`,{name:e,args:t}),getSemanticStatus:()=>H(`/api/semantic/status`),setSemanticEnabled:e=>U(`PUT`,`/api/semantic/config`,{enabled:e}),triggerSemanticBackfill:(e=200)=>U(`POST`,`/api/semantic/backfill`,{limit:e}),getSessionStats:e=>H(`/api/stats/session/${encodeURIComponent(e)}`),getProjectStats:e=>H(`/api/stats/project/${encodeURIComponent(e)}`),getOverviewStats:(e=`all`)=>H(`/api/stats/overview?range=${e}`),triggerStatsBackfill:e=>U(`POST`,`/api/stats/backfill`,e?{limit:e}:{}),getOnboarding:()=>H(`/api/onboarding`),patchOnboarding:e=>U(`PUT`,`/api/onboarding`,e),resetOnboarding:()=>U(`POST`,`/api/onboarding/reset`),getSessionCommits:e=>H(`/api/sessions/${encodeURIComponent(e)}/commits`),refreshSessionCommits:e=>H(`/api/sessions/${encodeURIComponent(e)}/commits?refresh=1`),getCommitSessions:e=>H(`/api/commits/${encodeURIComponent(e)}/session`),getDiscoverToday:()=>H(`/api/discover/today`),getAutoTitleConfig:()=>H(`/api/config/auto-title`),putAutoTitleConfig:e=>U(`PUT`,`/api/config/auto-title`,e),generateAutoTitle:e=>U(`POST`,`/api/sessions/${encodeURIComponent(e)}/auto-title`),listAutoRules:()=>H(`/api/auto-collections/rules`),createAutoRule:e=>U(`POST`,`/api/auto-collections/rules`,e),patchAutoRule:(e,t)=>U(`PATCH`,`/api/auto-collections/rules/${encodeURIComponent(e)}`,t),deleteAutoRule:e=>U(`DELETE`,`/api/auto-collections/rules/${encodeURIComponent(e)}`),listAutoSuggestions:(e=!1)=>H(`/api/auto-collections/suggestions${e?`?dismissed=1`:``}`),acceptAutoSuggestion:e=>U(`POST`,`/api/auto-collections/suggestions/${encodeURIComponent(e)}/accept`),dismissAutoSuggestion:e=>U(`POST`,`/api/auto-collections/suggestions/${encodeURIComponent(e)}/dismiss`),detectAutoSuggestionsNow:()=>U(`POST`,`/api/auto-collections/detect`),previewAutoSuggestion:(e,t=3)=>H(`/api/auto-collections/suggestions/${encodeURIComponent(e)}/preview?limit=${t}`),listAutoCollectionIds:()=>H(`/api/auto-collections/parents`),healthScores:()=>H(`/api/stats/health`),healthScore:e=>H(`/api/stats/health/${e}`),getVerificationConfig:()=>H(`/api/config/verification`),setVerificationConfig:e=>U(`PUT`,`/api/config/verification`,{enabled:e}),getVerificationDetail:e=>H(`/api/sessions/${encodeURIComponent(e)}/verification`),listThreads:(e=!1)=>H(`/api/threads${e?`?archived=1`:``}`),getThread:e=>H(`/api/threads/${encodeURIComponent(e)}`),createThread:e=>U(`POST`,`/api/threads`,e),patchThread:(e,t)=>U(`PATCH`,`/api/threads/${encodeURIComponent(e)}`,t),addSessionToThread:(e,t)=>U(`POST`,`/api/threads/${encodeURIComponent(e)}/sessions`,t),removeSessionFromThread:(e,t)=>U(`DELETE`,`/api/threads/${encodeURIComponent(e)}/sessions/${encodeURIComponent(t)}`),setThreadSessionParent:(e,t,n)=>U(`PATCH`,`/api/threads/${encodeURIComponent(e)}/sessions/${encodeURIComponent(t)}`,{parentSessionId:n}),threadsForSession:e=>H(`/api/sessions/${encodeURIComponent(e)}/threads`),threadTitlesPreflight:e=>H(`/api/threads/${encodeURIComponent(e)}/titles/preflight`),startThreadTitlesJob:(e,t)=>U(`POST`,`/api/threads/${encodeURIComponent(e)}/titles/generate`,{force:t}),cancelJob:e=>U(`DELETE`,`/api/jobs/${encodeURIComponent(e)}`)};function st(e){return e?e.slice(0,8):``}function ct(e,t){if(!e)return``;let n=e.replace(/\s+/g,` `).trim();return n.length<=t?n:n.slice(0,t-1)+`…`}function lt(e){if(!e)return``;let t=new Date(e).getTime();if(Number.isNaN(t))return``;let n=Date.now()-t,r=Math.floor(n/1e3);if(r<60)return`${r}s ago`;let i=Math.floor(r/60);if(i<60)return`${i}m ago`;let a=Math.floor(i/60);if(a<24)return`${a}h ago`;let o=Math.floor(a/24);if(o<30)return`${o}d ago`;let s=Math.floor(o/30);return s<12?`${s}mo ago`:`${Math.floor(o/365)}y ago`}function ut(e){return e==null?`0`:e.toLocaleString()}function dt(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function ft(e){let t=e.split(/\s+/).filter(e=>e.length>1).map(dt);return t.length===0?null:RegExp(`(${t.join(`|`)})`,`gi`)}function pt(){let[e,t]=(0,R.useState)(null),n=(0,R.useRef)(null);return(0,R.useEffect)(()=>{let e=new EventSource(`/api/autopilot/events`);return n.current=e,e.addEventListener(`state`,e=>{try{t(JSON.parse(e.data))}catch(e){console.error(`autopilot state parse failed`,e)}}),e.onerror=()=>{},()=>e.close()},[]),e}function mt(){return V({queryKey:[`auto-tag-config`],queryFn:()=>W.getAutoTagConfig()})}function ht(){let e=B();return at({mutationFn:e=>W.putAutoTagConfig(e),onSuccess:()=>void e.invalidateQueries({queryKey:[`auto-tag-config`]})})}function gt(){let e=mt(),t=pt();return!e.data?.autopilot||!t||t.status===`idle`?null:t.status===`error`?(0,z.jsx)(`div`,{className:`text-[11px] px-2 py-1 rounded-full border border-role-user/40 bg-role-user/10 text-role-user`,title:t.lastError??`autopilot error`,children:`⚠ autopilot error`}):(0,z.jsxs)(`div`,{className:`text-[11px] px-2 py-1 rounded-full border border-accent/40 bg-accent/10 text-accent flex items-center gap-1.5`,title:`Autopilot is tagging untagged sessions in the background.`,children:[(0,z.jsx)(`span`,{className:`inline-block w-1.5 h-1.5 rounded-full bg-accent animate-pulse`}),`tagging `,t.processed,`/`,t.total]})}var _t=new Set,vt=[],yt=1;function bt(){for(let e of _t)e([...vt])}function G(e){let t=e.id??`t-${yt++}`,n={id:t,message:e.message,tone:e.tone??`info`,duration:e.duration??4e3,action:e.action};return vt=[...vt.filter(e=>e.id!==t),n],bt(),n.duration>0&&setTimeout(()=>xt(t),n.duration),t}function xt(e){vt=vt.filter(t=>t.id!==e),bt()}function St(){let[e,t]=(0,R.useState)([]);return(0,R.useEffect)(()=>(_t.add(t),()=>{_t.delete(t)}),[]),e.length===0?null:(0,z.jsx)(`div`,{className:`fixed bottom-4 right-4 z-50 flex flex-col gap-2 items-end max-w-[calc(100vw-2rem)]`,children:e.map(e=>(0,z.jsxs)(`div`,{className:`min-w-[260px] max-w-[420px] rounded-lg border shadow-lg px-3 py-2 text-xs flex items-start gap-3 ${e.tone===`error`?`bg-bg-elevated border-role-user/60 text-fg`:e.tone===`success`?`bg-bg-elevated border-accent/60 text-fg`:`bg-bg-elevated border-line text-fg`}`,children:[(0,z.jsx)(`div`,{className:`flex-1 break-words`,children:e.message}),e.action&&(0,z.jsx)(`button`,{type:`button`,onClick:()=>{e.action.onClick(),xt(e.id)},className:`text-accent hover:underline whitespace-nowrap`,children:e.action.label}),(0,z.jsx)(`button`,{type:`button`,onClick:()=>xt(e.id),className:`text-fg-muted hover:text-fg leading-none`,title:`dismiss`,children:`×`})]},e.id))})}var Ct=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2064%2064'%20width='64'%20height='64'%20role='img'%20aria-label='Claude%20Recall'%3e%3ctitle%3eClaude%20Recall%20—%20Scrollback%20mark%20(dark%20bg)%3c/title%3e%3cg%20stroke='%23e7e9ee'%20stroke-width='3'%20stroke-linecap='round'%20fill='none'%3e%3cline%20x1='14'%20y1='16'%20x2='46'%20y2='16'/%3e%3cline%20x1='14'%20y1='24'%20x2='38'%20y2='24'/%3e%3c/g%3e%3cline%20x1='10'%20y1='32'%20x2='54'%20y2='32'%20stroke='%23f97316'%20stroke-width='5'%20stroke-linecap='round'/%3e%3cg%20stroke='%23e7e9ee'%20stroke-width='3'%20stroke-linecap='round'%20fill='none'%3e%3cline%20x1='14'%20y1='40'%20x2='42'%20y2='40'/%3e%3cline%20x1='14'%20y1='48'%20x2='36'%20y2='48'/%3e%3c/g%3e%3c/svg%3e`;function wt({query:e,onQueryChange:t,matchCount:n,scope:r,onScopeChange:i,canScope:a,projectName:o,onOpenHelp:s,helpActive:c,onOpenStats:l,statsActive:u,onOpenThreads:d,threadsActive:f,semanticMode:p,onSemanticModeChange:m,semanticAvailable:h}){let g=V({queryKey:[`stats`],queryFn:W.stats,refetchInterval:15e3}).data,_=B(),[v,y]=(0,R.useState)(!1),b=async()=>{if(!v){y(!0);try{await _.invalidateQueries(),await _.refetchQueries({type:`active`}),G({message:`Refreshed all data from the daemon`,tone:`success`,duration:1500})}catch(e){G({message:`Refresh failed: ${e instanceof Error?e.message:String(e)}`,tone:`error`})}finally{y(!1)}}};return(0,z.jsxs)(`header`,{className:`flex items-center gap-5 px-5 py-3 border-b border-line bg-bg shrink-0`,children:[(0,z.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[(0,z.jsx)(`img`,{src:Ct,alt:``,className:`h-9 w-9 rounded-md shrink-0`}),(0,z.jsxs)(`div`,{children:[(0,z.jsxs)(`div`,{className:`text-base font-bold leading-none`,children:[`Claude `,(0,z.jsx)(`span`,{className:`text-accent`,children:`Recall`})]}),(0,z.jsx)(`div`,{className:`text-xs text-fg-muted mt-1`,children:`local · offline · yours`})]})]}),g&&(0,z.jsxs)(`div`,{className:`hidden md:flex items-center gap-5 text-xs text-fg-dim`,children:[(0,z.jsxs)(`div`,{children:[(0,z.jsx)(`span`,{className:`text-fg font-medium`,children:ut(g.projects)}),` projects`]}),(0,z.jsxs)(`div`,{children:[(0,z.jsx)(`span`,{className:`text-fg font-medium`,children:ut(g.sessions)}),` sessions`]}),(0,z.jsxs)(`div`,{children:[(0,z.jsx)(`span`,{className:`text-fg font-medium`,children:ut(g.messages)}),` messages`]})]}),(0,z.jsxs)(`div`,{className:`flex-1 flex items-center justify-end gap-3`,children:[a&&e&&(0,z.jsxs)(`div`,{className:`flex items-center text-xs border border-line rounded-lg overflow-hidden`,children:[(0,z.jsx)(`button`,{type:`button`,onClick:()=>i(`all`),className:`px-3 py-1.5 transition-colors `+(r===`all`?`bg-accent text-bg font-medium`:`bg-bg-elevated text-fg-dim hover:text-fg`),children:`All projects`}),(0,z.jsxs)(`button`,{type:`button`,onClick:()=>i(`project`),className:`px-3 py-1.5 transition-colors border-l border-line `+(r===`project`?`bg-accent text-bg font-medium`:`bg-bg-elevated text-fg-dim hover:text-fg`),title:o?`search only within ${o}`:void 0,children:[`In `,o??`project`]})]}),(0,z.jsxs)(`div`,{className:`relative w-full max-w-xl`,children:[(0,z.jsx)(`input`,{type:`search`,placeholder:`Search every session…`,value:e,onChange:e=>t(e.target.value),className:`w-full bg-bg-elevated border border-line rounded-lg pl-10 pr-14 py-2 text-sm focus:outline-none focus:border-accent focus:ring-1 focus:ring-accent placeholder:text-fg-muted`}),(0,z.jsxs)(`svg`,{className:`absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-fg-muted`,fill:`none`,stroke:`currentColor`,strokeWidth:2,viewBox:`0 0 24 24`,children:[(0,z.jsx)(`circle`,{cx:`11`,cy:`11`,r:`8`}),(0,z.jsx)(`path`,{d:`m21 21-4.3-4.3`})]}),!e&&(0,z.jsx)(`kbd`,{className:`absolute right-3 top-1/2 -translate-y-1/2 text-[10px] font-mono text-fg-muted border border-line rounded px-1.5 py-0.5`,children:`/`}),e&&n!=null&&(0,z.jsxs)(`div`,{className:`absolute right-3 top-1/2 -translate-y-1/2 text-xs text-fg-muted`,children:[n,` `,n===1?`match`:`matches`]})]}),h&&m&&(0,z.jsx)(`button`,{type:`button`,onClick:()=>m(!p),className:`text-xs px-2.5 py-1 border rounded-md font-medium transition-colors `+(p?`bg-accent text-bg border-accent`:`text-fg-dim hover:text-fg border-line hover:border-accent/60`),title:`Toggle semantic search — also matches sessions by AI-generated summary + keywords (v0.11)`,children:`Semantic`}),(0,z.jsx)(gt,{}),(0,z.jsx)(`button`,{type:`button`,onClick:()=>void b(),disabled:v,className:`text-fg-muted hover:text-fg text-xs px-2 py-1 border border-line rounded-md disabled:opacity-60 disabled:cursor-wait`,title:`refresh all data from the daemon`,children:(0,z.jsx)(`span`,{className:`inline-block `+(v?`animate-spin`:`transition-transform`),"aria-hidden":`true`,children:`↻`})}),(0,z.jsx)(`button`,{type:`button`,onClick:d,className:`text-xs px-2.5 py-1 border rounded-md font-medium transition-colors `+(f?`bg-accent text-bg border-accent`:`text-fg-dim hover:text-fg border-line hover:border-accent/60`),title:`Threads — group sessions by intent (planning + children)`,children:`🧵 Threads`}),(0,z.jsx)(`button`,{type:`button`,onClick:l,className:`text-xs px-2.5 py-1 border rounded-md font-medium transition-colors `+(u?`bg-accent text-bg border-accent`:`text-fg-dim hover:text-fg border-line hover:border-accent/60`),title:`Cost & token dashboard (v0.10a)`,children:`📊 Stats`}),(0,z.jsx)(`button`,{type:`button`,onClick:s,className:`text-xs px-2.5 py-1 border rounded-md font-medium transition-colors `+(c?`bg-accent text-bg border-accent`:`text-fg-dim hover:text-fg border-line hover:border-accent/60`),title:`open Command Center — docs, CLI reference, keyboard shortcuts (press ?)`,children:`Help`})]})]})}function Tt(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=Tt(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n);return r}function K(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=Tt(e))&&(r&&(r+=` `),r+=t);return r}function Et(){return V({queryKey:[`tags`],queryFn:W.allTags,staleTime:1e4})}function Dt(e){e.invalidateQueries({queryKey:[`tags`]}),e.invalidateQueries({queryKey:[`sessions`]}),e.invalidateQueries({queryKey:[`session`]}),e.invalidateQueries({queryKey:[`search`]})}function Ot(){let e=B();return at({mutationFn:({sessionId:e,tag:t})=>W.addSessionTag(e,t),onSuccess:()=>Dt(e)})}function kt(){let e=B();return at({mutationFn:({sessionId:e,tag:t})=>W.removeSessionTag(e,t),onSuccess:()=>Dt(e)})}var At=new Set;function jt(){for(let e of At)e()}function Mt(){let e=window.location.hash.replace(/^#/,``);if(!e)return{project:null,session:null,msg:null,q:``,view:null,helpSection:null,compareWith:null,col:null,thread:null};let t=new URLSearchParams(e),n=t.get(`view`);return{project:t.get(`p`),session:t.get(`s`),msg:t.get(`m`),q:t.get(`q`)??``,view:n===`help`?`help`:n===`stats`?`stats`:n===`auto-rules`?`auto-rules`:n===`threads`?`threads`:null,helpSection:t.get(`h`),compareWith:t.get(`cmp`),col:t.get(`col`),thread:t.get(`t`)}}function Nt(e){let t=new URLSearchParams;e.project&&t.set(`p`,e.project),e.session&&t.set(`s`,e.session),e.msg&&t.set(`m`,e.msg),e.q&&t.set(`q`,e.q),e.view&&t.set(`view`,e.view),e.helpSection&&t.set(`h`,e.helpSection),e.compareWith&&t.set(`cmp`,e.compareWith),e.col&&t.set(`col`,e.col),e.thread&&t.set(`t`,e.thread);let n=t.toString();return n?`#${n}`:``}function Pt(){let[e,t]=(0,R.useState)(Mt);return(0,R.useEffect)(()=>{let e=()=>t(Mt());return window.addEventListener(`hashchange`,e),()=>window.removeEventListener(`hashchange`,e)},[]),(0,R.useEffect)(()=>{let e=()=>t(Mt());return At.add(e),()=>{At.delete(e)}},[]),[e,(0,R.useCallback)(e=>{let n={...Mt(),...e},r=Nt(n);window.location.hash!==r&&window.history.replaceState(null,``,r||window.location.pathname),t(n),jt()},[])]}function Ft(e){e.invalidateQueries({queryKey:[`collections`]}),e.invalidateQueries({queryKey:[`collection`]}),e.invalidateQueries({queryKey:[`sessionCollections`]}),e.invalidateQueries({queryKey:[`sessions`]})}function It(e=!1){return V({queryKey:[`collections`,{archived:e}],queryFn:()=>W.listCollections(e),staleTime:5e3})}function Lt(e){return V({queryKey:[`collection`,e],queryFn:()=>W.getCollection(e),enabled:!!e,staleTime:3e3})}function Rt(e){return V({queryKey:[`sessionCollections`,e],queryFn:()=>W.sessionCollections(e),enabled:!!e,staleTime:3e3})}function zt(){let e=B();return at({mutationFn:e=>W.createCollection(e),onSuccess:()=>Ft(e)})}function Bt(){let e=B();return at({mutationFn:({id:e,patch:t})=>W.patchCollection(e,t),onSuccess:()=>Ft(e)})}function Vt(){let e=B();return at({mutationFn:e=>W.archiveCollection(e),onSuccess:()=>Ft(e)})}function Ht(){let e=B();return at({mutationFn:e=>W.restoreCollection(e),onSuccess:()=>Ft(e)})}function Ut(){let e=B();return at({mutationFn:({collectionId:e,sessionId:t,note:n})=>W.addSessionToCollection(e,t,n),onSuccess:()=>Ft(e)})}function Wt(){let e=B();return at({mutationFn:({collectionId:e,sessionId:t})=>W.removeSessionFromCollection(e,t),onSuccess:()=>Ft(e)})}function Gt(e){if(!e||e.length===0)return[];let t=new Map;for(let n of e)t.set(n.id,{...n,children:[],depth:0,total_session_count:n.session_count});let n=[];for(let e of t.values()){let r=e.parent_id?t.get(e.parent_id):null;r?r.children.push(e):n.push(e)}let r=(e,t)=>{e.sort((e,t)=>e.sort_key===t.sort_key?e.name.toLowerCase().localeCompare(t.name.toLowerCase()):e.sort_key.localeCompare(t.sort_key));for(let n of e)n.depth=t,r(n.children,t+1)};r(n,0);let i=e=>{let t=e.session_count;for(let n of e.children)t+=i(n);return e.total_session_count=t,t};for(let e of n)i(e);return n}function Kt(e,t){let n=[],r=e=>{for(let i of e)n.push(i),i.children.length>0&&t.has(i.id)&&r(i.children)};return r(e),n}function qt(e=!1){let t=It(e),n=(0,R.useMemo)(()=>Gt(t.data?.collections),[t.data]);return{...t,tree:n}}function Jt(e){return[e.id,...e.children.flatMap(Jt)]}var Yt=[{value:``,label:`default`},{value:`#f97316`,label:`orange`},{value:`#eab308`,label:`yellow`},{value:`#10b981`,label:`green`},{value:`#06b6d4`,label:`cyan`},{value:`#3b82f6`,label:`blue`},{value:`#a855f7`,label:`purple`},{value:`#ec4899`,label:`pink`},{value:`#64748b`,label:`slate`}],Xt=`📂.📁.🗂.📦.🗃.🛠.🔧.🧪.🔬.⚗️.🏗.🎨.🎯.🚀.🧩.🧠.💡.📝.📊.📈.🐛.🔒.🔑.⚡.🔥.❤️.⭐.✨.🌿.🏠`.split(`.`);function Zt({mode:e,existing:t,initialParentId:n,pinnedSessionId:r,onClose:i,onCreated:a,onUpdated:o}){let[s,c]=(0,R.useState)(t?.name??``),[l,u]=(0,R.useState)(t?.description??``),[d,f]=(0,R.useState)(t?.icon??`📂`),[p,m]=(0,R.useState)(t?.color??``),[h,g]=(0,R.useState)(e===`rename`?t?.parent_id??null:n??null),[_,v]=(0,R.useState)(null),y=(0,R.useRef)(null),b=qt(!1),x=zt(),S=Bt();(0,R.useEffect)(()=>{requestAnimationFrame(()=>y.current?.focus())},[]),(0,R.useEffect)(()=>{let e=e=>{e.key===`Escape`&&i()};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[i]);let C=(0,R.useMemo)(()=>{let n=new Set(b.tree.flatMap(Jt)),r=Kt(b.tree,n);if(e===`rename`&&t){let e=new Set,n=t=>{e.add(t);for(let e of r)e.parent_id===t&&n(e.id)};return n(t.id),r.filter(t=>!e.has(t.id))}return r},[b.tree,e,t]),w=async()=>{let n=s.trim();if(!n){v(`name required`);return}try{if(e===`create`){let e=await x.mutateAsync({name:n,description:l.trim()||null,icon:d||null,color:p||null,parent_id:h});if(r)try{await fetch(`/api/collections/${encodeURIComponent(e.id)}/members`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({session_id:r})})}catch{}a?.(e)}else if(t){let e=await S.mutateAsync({id:t.id,patch:{name:n,description:l.trim()||null,icon:d||null,color:p||null,parent_id:h}});o?.(e)}i()}catch(e){v(e.message)}};return(0,z.jsx)(`div`,{className:`fixed inset-0 z-30 bg-black/50 flex items-center justify-center`,onClick:i,children:(0,z.jsxs)(`div`,{className:`bg-bg-elevated border border-line rounded-lg shadow-xl w-[440px] max-w-[90vw] p-5`,onClick:e=>e.stopPropagation(),role:`dialog`,"aria-modal":`true`,children:[(0,z.jsxs)(`div`,{className:`flex items-center justify-between mb-4`,children:[(0,z.jsx)(`h2`,{className:`text-lg font-semibold`,children:e===`create`?`New collection`:`Rename collection`}),(0,z.jsx)(`button`,{type:`button`,onClick:i,className:`text-fg-muted hover:text-fg`,"aria-label":`close`,children:`✕`})]}),(0,z.jsxs)(`div`,{className:`relative flex items-center gap-2 px-3 py-2 mb-4 rounded border border-line bg-bg`,style:{background:p?`linear-gradient(90deg, ${p}1a 0%, transparent 50%)`:void 0},children:[p&&(0,z.jsx)(`span`,{className:`absolute top-1 bottom-1 left-0 w-[3px] rounded-full`,style:{background:p},"aria-hidden":`true`}),(0,z.jsx)(`span`,{className:`text-base`,children:d||`📂`}),(0,z.jsx)(`span`,{className:`text-sm text-fg truncate flex-1`,children:s.trim()||(0,z.jsx)(`span`,{className:`italic text-fg-muted`,children:`(name)`})}),(0,z.jsx)(`span`,{className:`text-[10px] font-medium`,style:{color:p||void 0},children:`preview`})]}),(0,z.jsxs)(`div`,{className:`space-y-4`,children:[(0,z.jsxs)(`div`,{children:[(0,z.jsx)(`label`,{className:`block text-xs text-fg-muted mb-1`,children:`Name`}),(0,z.jsx)(`input`,{ref:y,type:`text`,value:s,onChange:e=>c(e.target.value),onKeyDown:e=>{e.key===`Enter`&&w()},maxLength:120,placeholder:`Pest Control — Scraping`,className:`w-full bg-bg border border-line rounded px-3 py-2 text-sm text-fg focus:outline-none focus:border-accent`})]}),(0,z.jsxs)(`div`,{children:[(0,z.jsx)(`label`,{className:`block text-xs text-fg-muted mb-1`,children:`Description (optional)`}),(0,z.jsx)(`textarea`,{value:l,onChange:e=>u(e.target.value),rows:2,maxLength:500,placeholder:`Short summary — shows on hover`,className:`w-full bg-bg border border-line rounded px-3 py-2 text-sm text-fg focus:outline-none focus:border-accent resize-none`})]}),(0,z.jsxs)(`div`,{className:`grid grid-cols-2 gap-3`,children:[(0,z.jsxs)(`div`,{children:[(0,z.jsx)(`label`,{className:`block text-xs text-fg-muted mb-1`,children:`Icon`}),(0,z.jsx)(`div`,{className:`flex flex-wrap gap-1`,children:Xt.map(e=>(0,z.jsx)(`button`,{type:`button`,onClick:()=>f(e),className:K(`w-7 h-7 rounded flex items-center justify-center text-sm hover:bg-bg-hover`,d===e&&`bg-accent/20 border border-accent`),title:e,children:e},e))}),(0,z.jsx)(`input`,{type:`text`,value:d,onChange:e=>f(e.target.value.slice(0,4)),className:`mt-1 w-full bg-bg border border-line rounded px-2 py-1 text-sm text-fg focus:outline-none focus:border-accent`,placeholder:`or paste your own`})]}),(0,z.jsxs)(`div`,{children:[(0,z.jsx)(`label`,{className:`block text-xs text-fg-muted mb-1`,children:`Color`}),(0,z.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:Yt.map(e=>(0,z.jsx)(`button`,{type:`button`,onClick:()=>m(e.value),className:K(`w-7 h-7 rounded border transition-colors`,p===e.value?`border-accent ring-2 ring-accent/40`:`border-line hover:border-fg-muted`),style:{background:e.value||`transparent`},title:e.label},e.value||`default`))})]})]}),(0,z.jsxs)(`div`,{children:[(0,z.jsx)(`label`,{className:`block text-xs text-fg-muted mb-1`,children:`Parent collection`}),(0,z.jsxs)(`select`,{value:h??``,onChange:e=>g(e.target.value||null),className:`w-full bg-bg border border-line rounded px-2 py-2 text-sm text-fg focus:outline-none focus:border-accent`,children:[(0,z.jsx)(`option`,{value:``,children:`— no parent (root) —`}),C.map(e=>(0,z.jsxs)(`option`,{value:e.id,children:[` `.repeat(e.depth),e.icon??`📂`,` `,e.name]},e.id))]}),(0,z.jsx)(`p`,{className:`mt-1 text-[10px] text-fg-muted leading-snug`,children:C.length===0?`No other collections yet — this one will live at the root. Once you have two or more, you can nest them.`:`Parent = another collection, not a repo. Collections cut across projects — one collection can hold sessions from many repos.`})]}),_&&(0,z.jsx)(`div`,{className:`text-xs text-role-user bg-role-user/10 border border-role-user/30 rounded px-2 py-1.5`,children:_}),(0,z.jsxs)(`div`,{className:`flex items-center justify-end gap-2 pt-2`,children:[(0,z.jsx)(`button`,{type:`button`,onClick:i,className:`px-3 py-1.5 text-sm text-fg-dim border border-line rounded hover:text-fg`,children:`Cancel`}),(0,z.jsx)(`button`,{type:`button`,onClick:w,disabled:!s.trim()||x.isPending||S.isPending,className:`px-4 py-1.5 text-sm bg-accent text-bg rounded font-medium hover:bg-accent/90 disabled:opacity-50`,children:e===`create`?`Create`:`Save`})]})]})]})})}function Qt(e){e.invalidateQueries({queryKey:[`autoRules`]}),e.invalidateQueries({queryKey:[`autoSuggestions`]}),e.invalidateQueries({queryKey:[`autoCollectionIds`]}),e.invalidateQueries({queryKey:[`collections`]}),e.invalidateQueries({queryKey:[`collection`]}),e.invalidateQueries({queryKey:[`sessionCollections`]}),e.invalidateQueries({queryKey:[`sessions`]})}function $t(){return V({queryKey:[`autoRules`],queryFn:()=>W.listAutoRules(),staleTime:5e3})}function en(e=!1){return V({queryKey:[`autoSuggestions`,{dismissed:e}],queryFn:()=>W.listAutoSuggestions(e),staleTime:3e4})}function tn(){return V({queryKey:[`autoCollectionIds`],queryFn:()=>W.listAutoCollectionIds(),staleTime:3e4})}function nn(){let e=B();return at({mutationFn:e=>W.createAutoRule(e),onSuccess:()=>Qt(e)})}function rn(){let e=B();return at({mutationFn:({id:e,patch:t})=>W.patchAutoRule(e,t),onSuccess:()=>Qt(e)})}function an(){let e=B();return at({mutationFn:e=>W.deleteAutoRule(e),onSuccess:()=>Qt(e)})}function on(){let e=B();return at({mutationFn:e=>W.acceptAutoSuggestion(e),onSuccess:()=>Qt(e)})}function sn(){let e=B();return at({mutationFn:e=>W.dismissAutoSuggestion(e),onSuccess:()=>Qt(e)})}function cn(){let e=B();return at({mutationFn:()=>W.detectAutoSuggestionsNow(),onSuccess:()=>Qt(e)})}function ln(e,t=!0){return V({queryKey:[`autoSuggestionPreview`,e],queryFn:()=>W.previewAutoSuggestion(e,3),enabled:!!e&&t,staleTime:6e4})}function un(){let{data:e,isLoading:t}=en(),[,n]=Pt(),r=e?.suggestions??[];return t||r.length===0?null:(0,z.jsxs)(`button`,{type:`button`,onClick:()=>n({view:`auto-rules`}),className:`mx-2 my-1 w-[calc(100%-1rem)] flex items-center justify-between gap-2 rounded border border-accent/30 bg-accent/5 px-2 py-1 text-[11px] text-fg-muted hover:bg-accent/10 hover:text-accent`,title:`Open Auto-rules to review suggestions`,children:[(0,z.jsxs)(`span`,{className:`truncate`,children:[`💡 `,r.length,` auto-collection`,` `,r.length===1?`suggestion`:`suggestions`,` pending`]}),(0,z.jsx)(`span`,{className:`text-accent shrink-0`,children:`Review →`})]})}var dn=`application/x-recall-collection`,fn=`application/x-recall-session`;function pn({selectedCollection:e,onSelect:t,onCreateCollection:n}){let[r,i]=(0,R.useState)(!1),[a,o]=(0,R.useState)(()=>new Set),[s,c]=(0,R.useState)(null),[l,u]=(0,R.useState)(null),[d,f]=(0,R.useState)(null),{tree:p,isLoading:m,isError:h,error:g,data:_}=qt(r),v=Vt(),y=Ht(),b=Bt(),x=Ut(),[,S]=Pt(),C=tn(),w=(0,R.useMemo)(()=>new Set(C.data?.auto_collection_ids??[]),[C.data]),[T,E]=(0,R.useState)(null),[D,O]=(0,R.useState)(null),k=(0,R.useRef)(new Map),A=(0,R.useCallback)(e=>{let t=k.current.get(e);t&&(window.clearTimeout(t),k.current.delete(e))},[]),ee=(0,R.useCallback)(e=>{if(a.has(e)||k.current.has(e))return;let t=window.setTimeout(()=>{o(t=>{let n=new Set(t);return n.add(e),n}),k.current.delete(e)},450);k.current.set(e,t)},[a]);(0,R.useEffect)(()=>()=>{for(let e of k.current.values())window.clearTimeout(e);k.current.clear()},[]);let j=(0,R.useRef)(!1);(0,R.useEffect)(()=>{if(!_||j.current)return;let e=new Set;for(let t of p)e.add(t.id);o(e),j.current=!0},[_,p]);let te=(0,R.useCallback)(e=>{o(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]),M=(0,R.useCallback)((e,t)=>{t.preventDefault(),f({id:e,x:t.clientX,y:t.clientY})},[]);(0,R.useEffect)(()=>{if(!d)return;let e=()=>f(null),t=e=>{e.key===`Escape`&&f(null)};return window.addEventListener(`click`,e),window.addEventListener(`keydown`,t),()=>{window.removeEventListener(`click`,e),window.removeEventListener(`keydown`,t)}},[d]);let ne=(0,R.useMemo)(()=>{let e=new Map,t=n=>{for(let r of n)e.set(r.id,r),t(r.children)};return t(p),e},[p]),N=e?ne.get(e)??null:null,P=async(e,t)=>{if(!e||e===t)return;let n=ne.get(e),r=ne.get(t);if(!n||!r||n.parent_id!==r.parent_id)return;let i=n.parent_id?ne.get(n.parent_id)?.children:p;if(!i)return;let a=[...i].sort((e,t)=>e.sort_key.localeCompare(t.sort_key)),o=a.findIndex(e=>e.id===t);if(o===-1)return;let s=a[o-1]?.sort_key??``,c=a[o].sort_key,l=gn(s,c);try{await b.mutateAsync({id:e,patch:{sort_key:l}})}catch(e){console.error(`reorder failed`,e)}},re=async(e,t)=>{let n=ne.get(t);try{let r=await x.mutateAsync({collectionId:t,sessionId:e});o(e=>{let n=new Set(e);return n.add(t),n});let i=n?.name??`collection`;O(r.added?`Added session to "${i}"`:`Already in "${i}"`),window.setTimeout(()=>O(null),2600)}catch(e){console.error(`add session via drop failed`,e),O(`Failed: ${e.message.slice(0,80)}`),window.setTimeout(()=>O(null),3500)}};return(0,z.jsxs)(`div`,{className:`border-t border-line mt-2`,children:[(0,z.jsxs)(`div`,{className:`pane-header flex items-center justify-between`,children:[(0,z.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,z.jsx)(`span`,{children:`📂 Collections`}),(0,z.jsx)(`button`,{type:`button`,onClick:()=>S({view:`help`,helpSection:`taxonomy`}),className:`text-[10px] font-normal normal-case tracking-normal text-fg-muted/70 hover:text-accent`,title:`Collection vs Tag vs Project — what's the difference?`,children:`(?)`})]}),(0,z.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,z.jsx)(`button`,{type:`button`,onClick:()=>S({view:`auto-rules`}),className:`text-xs font-medium normal-case tracking-normal px-2 py-1 rounded border border-line text-fg-muted hover:text-accent hover:border-accent/60 hover:bg-accent/5`,title:`Auto-collections — rules that group sessions automatically by repo / tag / plan file`,children:`⚙ Auto-rules`}),(0,z.jsx)(`button`,{type:`button`,onClick:n,className:`text-xs font-medium normal-case tracking-normal px-2 py-1 rounded bg-accent/10 text-accent hover:bg-accent/20`,title:`new collection (c)`,"data-collections-focus":!0,children:`+ New`})]})]}),(0,z.jsx)(un,{}),(0,z.jsxs)(`div`,{className:`px-2 pt-1 pb-2`,children:[m&&(0,z.jsx)(`div`,{className:`px-2 py-1 text-xs text-fg-muted`,children:`Loading…`}),h&&(0,z.jsxs)(`div`,{className:`px-2 py-1 text-xs text-role-user`,children:[`Failed: `,g?.message]}),_&&p.length===0&&(0,z.jsx)(`div`,{className:`px-2 py-1 text-xs text-fg-muted italic`,children:`No collections yet. Hit "+ new" to curate sessions that belong together.`}),p.map(n=>(0,z.jsx)(hn,{node:n,selected:e,expanded:a,onToggle:te,onSelect:e=>t(e),onContext:M,onReorder:P,onSessionDrop:re,dropTargetId:T,setDropTargetId:E,onDragEnter:ee,onDragLeaveRow:A,autoIds:w},n.id)),D&&(0,z.jsx)(`div`,{className:`fixed bottom-6 left-1/2 -translate-x-1/2 z-50 bg-accent text-bg text-sm font-medium px-4 py-2 rounded-full shadow-xl animate-in fade-in slide-in-from-bottom-2`,role:`status`,"aria-live":`polite`,children:D}),(0,z.jsx)(`button`,{type:`button`,onClick:()=>i(e=>!e),className:`w-full mt-2 text-xs text-fg-muted hover:text-fg text-left px-2 py-1`,children:r?`☑ hide archived`:`☐ show archived`})]}),d&&(()=>{let t=ne.get(d.id);if(!t)return null;let n=!!t.archived_at;return(0,z.jsxs)(`div`,{className:`fixed z-40 bg-bg-elevated border border-line rounded-md shadow-lg py-1 min-w-[180px]`,style:{top:d.y,left:d.x},onClick:e=>e.stopPropagation(),children:[(0,z.jsx)(mn,{label:`New child collection`,onClick:()=>{f(null),u(t.id)}}),(0,z.jsx)(mn,{label:`Rename / edit…`,onClick:()=>{f(null),c(t)}}),(0,z.jsx)(mn,{label:`Copy link to this collection`,onClick:()=>{f(null);let e=new URL(window.location.href),n=new URLSearchParams(e.hash.replace(/^#/,``));n.set(`col`,t.id),e.hash=`#${n.toString()}`,navigator.clipboard.writeText(e.toString())}}),(0,z.jsx)(`div`,{className:`border-t border-line my-1`}),n?(0,z.jsx)(mn,{label:`Restore`,onClick:()=>{f(null),y.mutateAsync(t.id)}}):(0,z.jsx)(mn,{label:`Archive (soft-delete)`,onClick:()=>{f(null),v.mutateAsync(t.id),e===t.id&&S({col:null})}})]})})(),s&&(0,z.jsx)(Zt,{mode:`rename`,existing:s,onClose:()=>c(null),onUpdated:()=>c(null)}),l&&(0,z.jsx)(Zt,{mode:`create`,initialParentId:l,onClose:()=>u(null),onCreated:()=>u(null)}),N&&(0,z.jsxs)(`div`,{className:`px-4 py-2 text-[10px] text-fg-muted border-t border-line mt-2`,children:[(0,z.jsxs)(`span`,{className:`block truncate`,children:[`Filtering: `,(0,z.jsx)(`span`,{className:`text-fg`,children:N.name})]}),(0,z.jsx)(`button`,{type:`button`,onClick:()=>t(null),className:`mt-1 text-accent hover:underline`,children:`clear collection filter`})]})]})}function mn({label:e,onClick:t}){return(0,z.jsx)(`button`,{type:`button`,onClick:t,className:`block w-full text-left px-3 py-1.5 text-xs hover:bg-bg-hover`,children:e})}function hn({node:e,selected:t,expanded:n,onToggle:r,onSelect:i,onContext:a,onReorder:o,onSessionDrop:s,dropTargetId:c,setDropTargetId:l,onDragEnter:u,onDragLeaveRow:d,autoIds:f}){let p=n.has(e.id),m=e.children.length>0,h=!!e.archived_at,g=c===e.id,_=f.has(e.id);return(0,z.jsxs)(`div`,{children:[(0,z.jsxs)(`div`,{className:`relative group flex items-stretch`,onDragEnter:t=>{Array.from(t.dataTransfer.types).includes(`application/x-recall-session`)&&u(e.id)},onDragOver:t=>{let n=Array.from(t.dataTransfer.types),r=n.includes(fn),i=n.includes(dn);!r&&!i||(t.preventDefault(),t.dataTransfer.dropEffect=r?`copy`:`move`,c!==e.id&&l(e.id))},onDragLeave:t=>{let n=t.relatedTarget;(!n||!t.currentTarget.contains(n))&&(c===e.id&&l(null),d(e.id))},onDrop:t=>{t.preventDefault(),l(null),d(e.id);let n=t.dataTransfer.getData(fn);if(n){s(n,e.id);return}let r=t.dataTransfer.getData(dn);r&&r!==e.id&&o(r,e.id)},children:[(0,z.jsxs)(`button`,{type:`button`,onClick:()=>i(e.id),onContextMenu:t=>a(e.id,t),className:K(`relative flex-1 min-w-0 flex items-center gap-1.5 py-1 pr-1 rounded text-sm text-left transition-colors`,t===e.id?`bg-accent/15 text-fg`:`hover:bg-bg-hover`,g&&`outline outline-2 outline-accent bg-accent/30 text-fg font-semibold shadow-[0_0_0_4px_rgba(249,115,22,0.15)]`,h&&`opacity-50 italic`),style:{paddingLeft:`${8+e.depth*12}px`,background:e.color?t===e.id?`linear-gradient(90deg, ${e.color}33 0%, transparent 40%)`:`linear-gradient(90deg, ${e.color}1a 0%, transparent 40%)`:void 0},title:e.description??e.name,children:[e.color&&(0,z.jsx)(`span`,{className:`absolute top-1 bottom-1 left-0 w-[3px] rounded-full`,style:{background:e.color},"aria-hidden":`true`}),m?(0,z.jsx)(`span`,{role:`button`,tabIndex:-1,onClick:t=>{t.stopPropagation(),r(e.id)},className:K(`inline-block w-3 text-fg-muted text-[10px] transition-transform`,p&&`rotate-90`),"aria-hidden":`true`,children:`▸`}):(0,z.jsx)(`span`,{className:`inline-block w-3`,"aria-hidden":`true`}),(0,z.jsx)(`span`,{className:`shrink-0`,children:e.icon??`📂`}),(0,z.jsx)(`span`,{className:`flex-1 truncate`,children:e.name}),g?(0,z.jsx)(`span`,{className:`text-[10px] shrink-0 font-semibold text-accent px-1.5 py-0.5 rounded-full bg-accent/20 whitespace-nowrap`,children:`← drop here`}):(0,z.jsxs)(z.Fragment,{children:[_&&(0,z.jsx)(`span`,{className:`text-[10px] shrink-0 text-fg-muted/70`,title:`auto-collection (rule-managed). Manual memberships are never overwritten.`,"aria-label":`auto-managed`,children:`⚙`}),(0,z.jsx)(`span`,{className:K(`text-[10px] shrink-0 font-medium`,!e.color&&`text-fg-muted`),style:{color:e.color??void 0},children:e.total_session_count===e.session_count?e.session_count:`${e.session_count}/${e.total_session_count}`})]})]}),!h&&(0,z.jsx)(`span`,{draggable:!0,onDragStart:t=>{t.dataTransfer.effectAllowed=`move`,t.dataTransfer.setData(`application/x-recall-collection`,e.id),t.dataTransfer.setData(`text/plain`,`recall-collection:${e.id}`)},className:`shrink-0 px-1.5 flex items-center text-fg-muted/40 hover:text-fg-muted cursor-grab active:cursor-grabbing text-[11px] select-none opacity-0 group-hover:opacity-100 transition-opacity`,title:`drag to reorder this collection among its siblings`,"aria-label":`drag to reorder ${e.name}`,children:`⋮⋮`})]}),p&&m&&(0,z.jsx)(`div`,{children:e.children.map(e=>(0,z.jsx)(hn,{node:e,selected:t,expanded:n,onToggle:r,onSelect:i,onContext:a,onReorder:o,onSessionDrop:s,dropTargetId:c,setDropTargetId:l,onDragEnter:u,onDragLeaveRow:d,autoIds:f},e.id))})]})}function gn(e,t){return e?`${e}m`:`${t?t.charAt(0):`n`}0`}var _n=`claude-recall:foryou`;function vn(e=new Date){return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,`0`)}-${String(e.getDate()).padStart(2,`0`)}`}function yn(e){try{let t=window.localStorage.getItem(`${_n}:${e}`);if(!t)return new Set;let n=JSON.parse(t);return Array.isArray(n)?new Set(n.filter(e=>e===`rediscovered`||e===`expensive`||e===`authored`)):new Set}catch{return new Set}}function bn(e,t){try{window.localStorage.setItem(`${_n}:${e}`,JSON.stringify([...t]))}catch{}}function xn(){let[e,t]=(0,R.useState)(()=>vn()),[n,r]=(0,R.useState)(()=>yn(vn())),[i,a]=(0,R.useState)(!1);return(0,R.useEffect)(()=>{a(!0)},[]),(0,R.useEffect)(()=>{let n=()=>{let n=vn();n!==e&&(t(n),r(yn(n)))};return window.addEventListener(`focus`,n),document.addEventListener(`visibilitychange`,n),()=>{window.removeEventListener(`focus`,n),document.removeEventListener(`visibilitychange`,n)}},[e]),{dismissed:n,dismiss:(0,R.useCallback)(t=>{r(n=>{if(n.has(t))return n;let r=new Set(n);return r.add(t),bn(e,r),r})},[e]),isReady:i}}function Sn(e){return{id:`rediscovered`,icon:`✦`,label:`Rediscovered`,accent:`text-role-tool border-role-tool/40`,title:e.alias??ct(e.firstUserMessage,60)??e.sessionId.slice(0,8),subtitle:`${e.daysAgo} day${e.daysAgo===1?``:`s`} ago`+(e.project?` · ${e.project}`:``),trailing:e.matchedKeywords.length>0?(0,z.jsx)(`div`,{className:`flex flex-wrap gap-1 mt-1`,children:e.matchedKeywords.slice(0,4).map(e=>(0,z.jsxs)(`span`,{className:`inline-flex items-center px-1.5 py-0.5 rounded bg-role-tool/10 text-role-tool text-[10px] border border-role-tool/30`,children:[`#`,e]},e))}):void 0,sessionId:e.sessionId}}function Cn(e){return{id:`expensive`,icon:`$`,label:`Most expensive · 7d`,accent:`text-accent border-accent/40`,title:e.alias??ct(e.firstUserMessage,60)??e.sessionId.slice(0,8),subtitle:(e.project?`${e.project} · `:``)+`${e.costDisplay} · ${e.tokensDisplay} · ${e.primaryModelLabel}`+(e.startedAt?` · ${lt(e.startedAt)}`:``),sessionId:e.sessionId}}function wn(e){return{id:`authored`,icon:`⎇`,label:`Authored current HEAD`,accent:`text-role-assistant border-role-assistant/40`,title:e.alias??ct(e.firstUserMessage,60)??e.sessionId.slice(0,8),subtitle:`${e.shortSha} · `+(e.subject?ct(e.subject,50):`current HEAD`)+(e.committedAt?` · ${lt(e.committedAt)}`:``),sessionId:e.sessionId}}function Tn({onSelectSession:e}){let t=V({queryKey:[`discover`,`today`],queryFn:()=>W.getDiscoverToday(),staleTime:300*1e3,refetchOnWindowFocus:!1,retry:1}),{dismissed:n,dismiss:r,isReady:i}=xn();if(!i||!t.data)return null;let a=[];return t.data.rediscovered&&!n.has(`rediscovered`)&&a.push(Sn(t.data.rediscovered)),t.data.expensive&&!n.has(`expensive`)&&a.push(Cn(t.data.expensive)),t.data.authored&&!n.has(`authored`)&&a.push(wn(t.data.authored)),a.length===0?null:(0,z.jsxs)(`div`,{className:`border-b border-line`,children:[(0,z.jsxs)(`div`,{className:`pane-header`,children:[(0,z.jsx)(`span`,{children:`For you`}),(0,z.jsx)(`span`,{children:a.length})]}),(0,z.jsx)(`div`,{className:`flex flex-col`,children:a.map(t=>(0,z.jsxs)(`div`,{className:K(`group relative px-4 py-2.5 border-b border-line/50 hover:bg-bg-hover transition-colors cursor-pointer`),role:`button`,tabIndex:0,onClick:()=>e(t.sessionId),onKeyDown:n=>{(n.key===`Enter`||n.key===` `)&&(n.preventDefault(),e(t.sessionId))},title:`Open ${t.title}`,children:[(0,z.jsxs)(`div`,{className:`flex items-center justify-between gap-2 mb-0.5`,children:[(0,z.jsxs)(`span`,{className:K(`inline-flex items-center gap-1.5 text-[10px] uppercase tracking-wider font-medium px-1.5 py-0.5 rounded border`,t.accent),children:[(0,z.jsx)(`span`,{"aria-hidden":!0,children:t.icon}),(0,z.jsx)(`span`,{children:t.label})]}),(0,z.jsx)(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),r(t.id)},className:`opacity-0 group-hover:opacity-100 focus:opacity-100 text-fg-muted/70 hover:text-role-user transition-opacity text-sm leading-none px-1`,title:`Dismiss for today`,"aria-label":`Dismiss ${t.label} for today`,children:`×`})]}),(0,z.jsx)(`div`,{className:`text-sm font-medium text-fg truncate`,children:t.title}),(0,z.jsx)(`div`,{className:`text-xs text-fg-muted truncate mt-0.5`,children:t.subtitle}),t.trailing]},t.id))})]})}function En(e){return e>=70?`text-green-500`:e>=40?`text-yellow-500`:`text-red-500`}function Dn(e){return e>=70?`bg-green-500`:e>=40?`bg-yellow-500`:`bg-red-500`}function On({projectId:e}){let t=V({queryKey:[`health`,e],queryFn:()=>W.healthScore(e),staleTime:3e4,refetchInterval:6e4});if(!t.data)return null;let{score:n}=t.data;return(0,z.jsxs)(`span`,{className:`inline-flex items-center gap-1 text-xs ${En(n)}`,title:`Memory health: ${n}/100`,children:[(0,z.jsx)(`span`,{className:`inline-block w-1.5 h-1.5 rounded-full ${Dn(n)}`}),n]})}function kn({selected:e,selectedCollection:t,onSelect:n,onCreateCollection:r,onSelectSession:i}){let a=V({queryKey:[`projects`],queryFn:W.projects,refetchInterval:8e3,refetchIntervalInBackground:!1,staleTime:0}),o=Et(),[,s]=Pt(),[c,l]=(0,R.useState)(!0),[u,d]=(0,R.useState)(()=>{if(typeof window>`u`)return 256;let e=window.localStorage.getItem(`claude-recall:projects-pane-width`),t=e?Number(e):NaN;return Number.isFinite(t)&&t>=200&&t<=600?t:256}),f=(0,R.useRef)(null),p=(0,R.useCallback)(e=>{e.preventDefault(),e.currentTarget.setPointerCapture?.(e.pointerId),f.current={startX:e.clientX,startW:u}},[u]),m=(0,R.useCallback)(e=>{let t=f.current;t&&d(Math.max(200,Math.min(600,t.startW+(e.clientX-t.startX))))},[]),h=(0,R.useCallback)(e=>{f.current&&(f.current=null,e.currentTarget.releasePointerCapture?.(e.pointerId))},[]);return(0,R.useEffect)(()=>{window.localStorage.setItem(`claude-recall:projects-pane-width`,String(u))},[u]),(0,z.jsxs)(`aside`,{className:`pane shrink-0 relative`,style:{width:u},children:[(0,z.jsx)(`div`,{role:`separator`,"aria-orientation":`vertical`,"aria-label":`Resize projects pane`,onPointerDown:p,onPointerMove:m,onPointerUp:h,onPointerCancel:h,onDoubleClick:()=>d(256),className:`absolute top-0 right-0 bottom-0 w-1.5 cursor-col-resize hover:bg-accent/40 active:bg-accent/60 z-10`,title:`Drag to resize · double-click to reset`}),(0,z.jsxs)(`div`,{className:`pane-header`,children:[(0,z.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,z.jsx)(`span`,{children:`Projects`}),(0,z.jsx)(`button`,{type:`button`,onClick:()=>s({view:`help`,helpSection:`taxonomy`}),className:`text-[10px] font-normal normal-case tracking-normal text-fg-muted/70 hover:text-accent`,title:`Project vs Collection vs Tag vs Pin vs Alias vs Note — what's the difference?`,children:`(?)`})]}),a.data&&(0,z.jsx)(`span`,{children:a.data.length})]}),(0,z.jsxs)(`div`,{className:`flex-1 overflow-y-auto`,children:[(0,z.jsx)(Tn,{onSelectSession:i}),(0,z.jsx)(pn,{selectedCollection:t,onSelect:e=>{s({col:e,project:null,session:null,msg:null})},onCreateCollection:r}),(0,z.jsxs)(`button`,{type:`button`,onClick:()=>n(null),className:K(`list-item text-sm flex items-center justify-between gap-2`,e===null&&!t&&`list-item-active`),children:[(0,z.jsx)(`span`,{className:`text-fg font-medium`,children:`All sessions`}),(0,z.jsx)(`span`,{className:`text-xs text-fg-muted`,children:a.data?a.data.reduce((e,t)=>e+t.session_count,0):`—`})]}),a.isLoading&&(0,z.jsx)(`div`,{className:`px-4 py-6 text-xs text-fg-muted`,children:`Loading…`}),a.isError&&(0,z.jsxs)(`div`,{className:`px-4 py-6 text-xs text-role-user`,children:[`Failed to load: `,a.error.message]}),a.data?.map(t=>(0,z.jsxs)(`button`,{type:`button`,onClick:()=>n(t.name),className:K(`list-item`,e===t.name&&`list-item-active`),title:t.decoded_path,children:[(0,z.jsxs)(`div`,{className:`flex items-center justify-between gap-2 mb-1`,children:[(0,z.jsx)(`span`,{className:`text-sm font-medium truncate`,children:t.name}),(0,z.jsxs)(`span`,{className:`flex items-center gap-2 text-xs text-fg-muted shrink-0`,children:[(0,z.jsx)(On,{projectId:t.id}),ut(t.session_count)]})]}),(0,z.jsx)(`div`,{className:`text-xs text-fg-muted truncate font-mono`,children:ct(t.decoded_path,44)}),t.latest&&(0,z.jsx)(`div`,{className:`text-xs text-fg-muted mt-1`,children:lt(t.latest)})]},t.id)),o.data&&o.data.length>0&&(0,z.jsxs)(`div`,{className:`border-t border-line mt-2`,children:[(0,z.jsxs)(`button`,{type:`button`,onClick:()=>l(e=>!e),className:`w-full pane-header hover:bg-bg-hover`,children:[(0,z.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,z.jsx)(`span`,{className:K(`transition-transform`,c&&`rotate-90`),children:`▸`}),`Tags`]}),(0,z.jsx)(`span`,{children:o.data.length})]}),c&&(0,z.jsx)(`div`,{className:`flex flex-wrap gap-1 px-4 py-2`,children:o.data.map(e=>(0,z.jsxs)(`button`,{type:`button`,onClick:()=>s({q:`#${e.tag}`,session:null,msg:null}),className:`inline-flex items-center gap-1 px-2 py-0.5 rounded-full bg-role-tool/10 text-role-tool text-xs border border-role-tool/30 hover:bg-role-tool/20 transition-colors`,title:`filter to ${e.count} session${e.count===1?``:`s`} tagged #${e.tag}`,children:[(0,z.jsxs)(`span`,{children:[`#`,e.tag]}),(0,z.jsx)(`span`,{className:`text-fg-muted/60 text-[10px]`,children:e.count})]},e.tag))})]})]})]})}var An=`claude-recall:pinned-sessions:v1`;function jn(){try{let e=localStorage.getItem(An);if(!e)return[];let t=JSON.parse(e);return Array.isArray(t)?t.filter(e=>typeof e==`string`):[]}catch{return[]}}function Mn(e){try{localStorage.setItem(An,JSON.stringify(e))}catch{}}var Nn=new Set;function Pn(){for(let e of Nn)e()}function Fn(){let[e,t]=(0,R.useState)(()=>jn());return(0,R.useEffect)(()=>{let e=()=>t(jn());return Nn.add(e),()=>{Nn.delete(e)}},[]),(0,R.useEffect)(()=>{let e=e=>{e.key===An&&t(jn())};return window.addEventListener(`storage`,e),()=>window.removeEventListener(`storage`,e)},[]),{pinned:e,isPinned:(0,R.useCallback)(t=>e.includes(t),[e]),togglePin:(0,R.useCallback)(e=>{let t=jn();Mn(t.includes(e)?t.filter(t=>t!==e):[...t,e]),Pn()},[])}}function In(e,t,n){return Math.max(t,Math.min(n,e))}function Ln(e,t){try{let n=localStorage.getItem(e);if(n==null)return t;let r=Number(n);return Number.isFinite(r)?r:t}catch{return t}}function Rn(e){try{return localStorage.getItem(e)===`1`}catch{return!1}}var zn=new Map;function Bn(e){zn.get(e)?.forEach(e=>e())}function Vn(e){let t=e.minWidth??240,n=e.maxWidth??640,r=e.collapsedWidth??36,i=`${e.storageKey}:width`,a=`${e.storageKey}:collapsed`,[o,s]=(0,R.useState)(()=>In(Ln(i,e.defaultWidth),t,n)),[c,l]=(0,R.useState)(()=>Rn(a));(0,R.useEffect)(()=>{let r=zn.get(e.storageKey);r||(r=new Set,zn.set(e.storageKey,r));let o=()=>{s(In(Ln(i,e.defaultWidth),t,n)),l(Rn(a))};return r.add(o),()=>{r?.delete(o)}},[e.storageKey,i,a,e.defaultWidth,t,n]),(0,R.useEffect)(()=>{let t=t=>{(t.key===i||t.key===a)&&Bn(e.storageKey)};return window.addEventListener(`storage`,t),()=>window.removeEventListener(`storage`,t)},[i,a,e.storageKey]);let u=(0,R.useCallback)(r=>{let a=In(r,t,n);s(a);try{localStorage.setItem(i,String(a))}catch{}Bn(e.storageKey)},[t,n,i,e.storageKey]),d=(0,R.useCallback)(t=>{l(t);try{localStorage.setItem(a,t?`1`:`0`)}catch{}Bn(e.storageKey)},[a,e.storageKey]),f=(0,R.useCallback)((e,t)=>{let n=n=>{u(t+(n.clientX-e))},r=()=>{window.removeEventListener(`mousemove`,n),window.removeEventListener(`mouseup`,r),document.body.style.cursor=``,document.body.style.userSelect=``};window.addEventListener(`mousemove`,n),window.addEventListener(`mouseup`,r),document.body.style.cursor=`col-resize`,document.body.style.userSelect=`none`},[u]),p=(0,R.useCallback)(()=>{d(!c)},[d,c]);return{width:o,effectiveWidth:c?r:o,collapsed:c,minWidth:t,maxWidth:n,collapsedWidth:r,setWidth:u,setCollapsed:d,toggleCollapsed:p,beginResize:f}}function Hn({status:e}){return!e||e===`neutral`?null:e===`verified`?(0,z.jsxs)(`span`,{className:`inline-flex items-center gap-0.5 text-[10px] text-green-500`,title:`Verified: completion claim backed by 2+ evidence categories`,children:[(0,z.jsx)(`svg`,{width:`12`,height:`12`,viewBox:`0 0 16 16`,fill:`none`,className:`shrink-0`,children:(0,z.jsx)(`path`,{d:`M6 10.8L3.2 8l-.9.9L6 12.6l8-8-.9-.9L6 10.8z`,fill:`currentColor`})}),`verified`]}):(0,z.jsxs)(`span`,{className:`inline-flex items-center gap-0.5 text-[10px] text-yellow-500`,title:`Unverified: completion claimed but insufficient evidence`,children:[(0,z.jsx)(`svg`,{width:`12`,height:`12`,viewBox:`0 0 16 16`,fill:`none`,className:`shrink-0`,children:(0,z.jsx)(`path`,{d:`M8 1L1 14h14L8 1zm0 3.5l4.9 8.5H3.1L8 4.5zM7.25 7v3h1.5V7h-1.5zm0 4v1.5h1.5V11h-1.5z`,fill:`currentColor`})}),`unverified`]})}function Un(e){return e.trim().toLowerCase().replace(/^#+/,``).replace(/[\s/\\]+/g,`-`).replace(/[^a-z0-9\-._]/g,``).slice(0,40)}function Wn({sessionId:e,existingTags:t,onDone:n,variant:r=`bar`,placeholder:i=`tag-name`}){let[a,o]=(0,R.useState)(``),s=(0,R.useRef)(null),c=(0,R.useRef)(null),l=Ot(),u=Et();(0,R.useEffect)(()=>{requestAnimationFrame(()=>s.current?.focus())},[]),(0,R.useEffect)(()=>{let e=e=>{c.current&&!c.current.contains(e.target)&&n()};return window.addEventListener(`mousedown`,e),()=>window.removeEventListener(`mousedown`,e)},[n]);let d=Un(a),f=u.data?d?u.data.filter(e=>!t.includes(e.tag)&&e.tag.includes(d)).slice(0,8):u.data.filter(e=>!t.includes(e.tag)).slice(0,8):[],p=async t=>{let r=Un(t);if(r)try{await l.mutateAsync({sessionId:e,tag:r}),n()}catch(e){console.error(`add tag failed`,e)}},m=r===`row`?`w-48 text-[10px] px-2`:`w-56 text-xs px-3`,h=r===`row`?`text-[10px]`:`text-xs`,g=i===`tag-name`?`type new tag + Enter`:i,_=d.length>0;return(0,z.jsxs)(`div`,{ref:c,className:`relative inline-flex`,children:[(0,z.jsx)(`input`,{ref:s,type:`text`,value:a,onChange:e=>o(e.target.value),onKeyDown:e=>{e.key===`Enter`?(e.preventDefault(),p(a)):e.key===`Escape`?(e.preventDefault(),n()):e.key===`Tab`&&f.length>0&&(e.preventDefault(),o(f[0].tag))},placeholder:g,maxLength:40,className:`bg-bg-elevated border border-accent rounded-full py-0.5 text-fg focus:outline-none placeholder:text-fg-muted ${m}`}),(0,z.jsxs)(`div`,{className:`absolute left-0 top-full mt-1 min-w-full w-56 bg-bg-elevated border border-line rounded-lg shadow-lg py-1 z-30 ${h}`,children:[(0,z.jsx)(`div`,{className:`px-3 py-1 text-fg-muted text-[10px] uppercase tracking-wider border-b border-line/50 mb-1`,children:_?(0,z.jsxs)(z.Fragment,{children:[`Press `,(0,z.jsx)(`span`,{className:`font-mono text-accent`,children:`Enter`}),` to create`,` `,(0,z.jsxs)(`span`,{className:`text-role-tool`,children:[`#`,d]})]}):(0,z.jsx)(z.Fragment,{children:`Type to create, or pick existing:`})}),f.length>0?f.map(e=>(0,z.jsxs)(`button`,{type:`button`,onClick:()=>void p(e.tag),className:`block w-full text-left px-3 py-1 hover:bg-bg-hover`,children:[(0,z.jsxs)(`span`,{className:`text-role-tool`,children:[`#`,e.tag]}),(0,z.jsx)(`span`,{className:`text-fg-muted ml-2`,children:e.count})]},e.tag)):(0,z.jsx)(`div`,{className:`px-3 py-1 text-fg-muted italic`,children:_?`no matches — hit Enter to create`:`no tags yet — type one above`})]})]})}function Gn(){let[e,t]=(0,R.useState)({id:null,snapshot:null,error:null}),n=(0,R.useRef)(null),r=async e=>{try{let{scanId:n}=await W.startScan(e);return t({id:n,snapshot:{id:n,status:`running`,createdAt:new Date().toISOString(),finishedAt:null,total:0,completed:0,results:[],error:null},error:null}),i(n),n}catch(e){return t(t=>({...t,error:e instanceof Error?e.message:String(e)})),null}},i=e=>{n.current&&n.current.close();let r=new EventSource(`/api/tags/scan/${encodeURIComponent(e)}/events`);n.current=r,r.addEventListener(`state`,e=>{let n=JSON.parse(e.data);t(e=>e.snapshot?{...e,snapshot:{...e.snapshot,...n}}:e)}),r.addEventListener(`result`,e=>{let n=JSON.parse(e.data);t(e=>e.snapshot?{...e,snapshot:{...e.snapshot,results:[...e.snapshot.results,n]}}:e)}),r.addEventListener(`progress`,e=>{let{completed:n,total:r}=JSON.parse(e.data);t(e=>e.snapshot?{...e,snapshot:{...e.snapshot,completed:n,total:r}}:e)}),r.addEventListener(`status`,e=>{let{status:n}=JSON.parse(e.data);t(e=>e.snapshot?{...e,snapshot:{...e.snapshot,status:n}}:e)}),r.addEventListener(`done`,()=>{t(e=>e.snapshot?{...e,snapshot:{...e.snapshot,status:`completed`,finishedAt:new Date().toISOString()}}:e),r.close()}),r.onerror=()=>{r.close()}},a=async t=>e.id?W.applyScan(e.id,t):null,o=async()=>{e.id&&(await W.cancelScan(e.id),n.current?.close())},s=()=>{n.current?.close(),t({id:null,snapshot:null,error:null})};return(0,R.useEffect)(()=>()=>n.current?.close(),[]),{...e,start:r,apply:a,cancel:o,reset:s}}function Kn(e,t){(0,R.useEffect)(()=>{if(!e)return;let n=e=>{e.key===`Escape`&&(e.stopPropagation(),t())};return window.addEventListener(`keydown`,n),()=>window.removeEventListener(`keydown`,n)},[e,t])}var qn=[{id:`claude-opus-4-7`,label:`Opus 4.7 (recommended for quality)`},{id:`claude-sonnet-4-6`,label:`Sonnet 4.6 (balanced)`},{id:`claude-haiku-4-5-20251001`,label:`Haiku 4.5 (fast, cheap)`}];function Jn({open:e,onClose:t}){let n=mt(),r=ht(),i=B();Kn(e,t);let[a,o]=(0,R.useState)(!1),[s,c]=(0,R.useState)(`api`),[l,u]=(0,R.useState)(``),[d,f]=(0,R.useState)(`claude-opus-4-7`),[p,m]=(0,R.useState)([2,4]),[h,g]=(0,R.useState)(!1),_=n.data&&!n.data.enabled&&!n.data.hasApiKey,v=V({queryKey:[`mcp-install-status`],queryFn:()=>W.getMcpInstallStatus(),enabled:e&&s===`mcp`});if((0,R.useEffect)(()=>{n.data&&(o(n.data.enabled),c(n.data.backend),f(n.data.model),m([n.data.minTagsPerSession,n.data.maxTagsPerSession]),g(n.data.autopilot))},[n.data]),!e)return null;let y=async()=>{await r.mutateAsync({enabled:a,backend:s,model:d,minTagsPerSession:p[0],maxTagsPerSession:p[1],autopilot:h,...l?{apiKey:l}:{}}),t()},b=async()=>{try{await W.installMcp(),await i.invalidateQueries({queryKey:[`mcp-install-status`]}),G({message:`Claude Recall MCP installed. Restart Claude Code to load it.`,tone:`success`,duration:8e3})}catch(e){G({message:`Install failed: ${e instanceof Error?e.message:String(e)}`,tone:`error`})}},x=async()=>{try{await W.uninstallMcp(),await i.invalidateQueries({queryKey:[`mcp-install-status`]}),G({message:`MCP entry removed from Claude Code config.`,tone:`info`})}catch(e){G({message:`Uninstall failed: ${e instanceof Error?e.message:String(e)}`,tone:`error`})}},S=a&&s===`api`&&(l.length>0||!!n.data?.hasApiKey);return(0,z.jsx)(`div`,{className:`fixed inset-0 z-40 bg-black/40 flex items-center justify-center`,children:(0,z.jsxs)(`div`,{className:`bg-bg border border-line rounded-lg w-[560px] max-w-[calc(100vw-2rem)] max-h-[calc(100vh-4rem)] overflow-y-auto shadow-xl`,children:[(0,z.jsxs)(`div`,{className:`px-5 py-4 border-b border-line flex items-center justify-between sticky top-0 bg-bg`,children:[(0,z.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:`Auto-tagging settings`}),(0,z.jsx)(`button`,{type:`button`,onClick:t,className:`text-fg-muted hover:text-fg text-lg leading-none`,children:`×`})]}),(0,z.jsxs)(`div`,{className:`px-5 py-4 space-y-4 text-xs`,children:[_&&(0,z.jsxs)(`div`,{className:`rounded border border-accent/40 bg-accent/10 px-3 py-2 text-[11px] leading-relaxed text-fg`,children:[(0,z.jsx)(`div`,{className:`font-semibold text-accent mb-1`,children:`First time here?`}),`Auto-tag picks 2–4 tags per session using an LLM. Two ways to run it: pay Anthropic per scan (API key) or use your existing Claude Code agent (MCP, free). Both are opt-in. Turn on `,(0,z.jsx)(`strong`,{children:`Autopilot`}),` `,`to let the daemon tag every session automatically in the background — then forget this dialog exists.`]}),(0,z.jsxs)(`label`,{className:`flex items-center gap-2`,children:[(0,z.jsx)(`input`,{type:`checkbox`,checked:a,onChange:e=>o(e.target.checked)}),(0,z.jsx)(`span`,{className:`text-fg`,children:`Enable auto-tagging`})]}),(0,z.jsx)(`p`,{className:`text-fg-muted text-[11px] leading-relaxed`,children:`When enabled, scanning sends session content (first message + sampled messages) to your chosen backend. Nothing is sent automatically — every scan is user-triggered. (Unless you turn on Autopilot below.)`}),(0,z.jsxs)(`fieldset`,{className:`border border-line rounded p-3 space-y-2`,children:[(0,z.jsx)(`legend`,{className:`px-1 text-fg-muted`,children:`Backend`}),(0,z.jsxs)(`label`,{className:`flex items-start gap-2`,children:[(0,z.jsx)(`input`,{type:`radio`,name:`backend`,checked:s===`api`,onChange:()=>c(`api`)}),(0,z.jsxs)(`div`,{children:[(0,z.jsx)(`div`,{className:`text-fg`,children:`Anthropic API key`}),(0,z.jsx)(`div`,{className:`text-fg-muted text-[11px]`,children:`Recall calls Anthropic directly. You pay per scan. Works with Autopilot.`})]})]}),(0,z.jsxs)(`label`,{className:`flex items-start gap-2`,children:[(0,z.jsx)(`input`,{type:`radio`,name:`backend`,checked:s===`mcp`,onChange:()=>c(`mcp`)}),(0,z.jsxs)(`div`,{children:[(0,z.jsx)(`div`,{className:`text-fg`,children:`Claude Code (via MCP)`}),(0,z.jsx)(`div`,{className:`text-fg-muted text-[11px]`,children:`Use your existing Claude Code agent. Zero extra cost. Manual trigger only (no Autopilot).`})]})]})]}),s===`api`&&(0,z.jsxs)(`label`,{className:`block`,children:[(0,z.jsx)(`div`,{className:`text-fg-muted mb-1`,children:`Anthropic API key`}),(0,z.jsx)(`input`,{type:`password`,value:l,onChange:e=>u(e.target.value),placeholder:n.data?.hasApiKey?`sk-ant-… (key on file, leave blank to keep)`:`sk-ant-…`,className:`w-full bg-bg-elevated border border-line rounded px-2 py-1 text-fg`})]}),s===`mcp`&&(0,z.jsxs)(`div`,{className:`border border-line rounded p-3 space-y-2`,children:[(0,z.jsx)(`div`,{className:`text-fg-muted text-[11px]`,children:"Install Claude Recall into your Claude Code MCP config (`~/.claude.json`) with one click — no copy-paste required."}),v.isLoading?(0,z.jsx)(`div`,{className:`text-fg-muted text-[11px]`,children:`Checking install status…`}):v.data?.installed?(0,z.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,z.jsxs)(`div`,{className:`text-accent text-[11px]`,children:[`✓ Installed in `,(0,z.jsx)(`span`,{className:`font-mono text-fg`,children:v.data.configPath.replace(/^.*\//,`~/…/`)}),(0,z.jsx)(`div`,{className:`text-fg-muted`,children:`Restart Claude Code if it's running.`})]}),(0,z.jsx)(`button`,{type:`button`,onClick:()=>void x(),className:`text-[11px] text-fg-muted hover:text-role-user px-2 py-1`,children:`Uninstall`})]}):(0,z.jsx)(`button`,{type:`button`,onClick:()=>void b(),className:`bg-accent text-bg rounded px-3 py-1 text-xs font-medium hover:opacity-90`,children:`Install in Claude Code`})]}),(0,z.jsxs)(`label`,{className:`block`,children:[(0,z.jsxs)(`div`,{className:`text-fg-muted mb-1`,children:[`Model`,(0,z.jsx)(`span`,{className:`text-[10px] ml-2 font-normal`,children:`— used for both API-key scans and the MCP one-click run`})]}),(0,z.jsx)(`select`,{value:d,onChange:e=>f(e.target.value),className:`w-full bg-bg-elevated border border-line rounded px-2 py-1 text-fg`,children:qn.map(e=>(0,z.jsx)(`option`,{value:e.id,children:e.label},e.id))})]}),(0,z.jsxs)(`div`,{className:`grid grid-cols-2 gap-3`,children:[(0,z.jsxs)(`label`,{className:`block`,children:[(0,z.jsx)(`div`,{className:`text-fg-muted mb-1`,children:`Min tags / session`}),(0,z.jsx)(`input`,{type:`number`,min:1,max:10,value:p[0],onChange:e=>m([Math.max(1,Number(e.target.value)),Math.max(Number(e.target.value),p[1])]),className:`w-full bg-bg-elevated border border-line rounded px-2 py-1 text-fg`})]}),(0,z.jsxs)(`label`,{className:`block`,children:[(0,z.jsx)(`div`,{className:`text-fg-muted mb-1`,children:`Max tags / session`}),(0,z.jsx)(`input`,{type:`number`,min:1,max:10,value:p[1],onChange:e=>m([Math.min(p[0],Number(e.target.value)),Number(e.target.value)]),className:`w-full bg-bg-elevated border border-line rounded px-2 py-1 text-fg`})]})]}),(0,z.jsxs)(`fieldset`,{className:`border rounded p-3 ${S?`border-accent/50`:`border-line opacity-60`}`,children:[(0,z.jsx)(`legend`,{className:`px-1 text-fg-muted`,children:`Autopilot`}),(0,z.jsxs)(`label`,{className:`flex items-start gap-2`,children:[(0,z.jsx)(`input`,{type:`checkbox`,checked:h,disabled:!S,onChange:e=>g(e.target.checked)}),(0,z.jsxs)(`div`,{children:[(0,z.jsx)(`div`,{className:`text-fg`,children:`Tag sessions automatically in the background`}),(0,z.jsxs)(`div`,{className:`text-fg-muted text-[11px] leading-relaxed`,children:[`When on, the daemon scans every untagged session (existing + new) and applies tags without a review step. You can still × any tag on any session. Costs ~$0.01–0.05 per session at Opus pricing. `,S?``:`Requires backend = Anthropic API key + a saved key.`]})]})]})]})]}),(0,z.jsxs)(`div`,{className:`px-5 py-3 border-t border-line flex items-center justify-end gap-2 sticky bottom-0 bg-bg`,children:[(0,z.jsx)(`button`,{type:`button`,onClick:t,className:`text-fg-muted hover:text-fg text-xs px-3 py-1`,children:`Cancel`}),(0,z.jsx)(`button`,{type:`button`,onClick:()=>void y(),disabled:r.isPending,className:`bg-accent text-bg rounded px-3 py-1 text-xs font-medium hover:opacity-90 disabled:opacity-50`,children:r.isPending?`Saving…`:`Save`})]})]})})}function Yn({open:e,snapshot:t,onApply:n,onCancel:r,onClose:i,onRetryFailed:a}){let[o,s]=(0,R.useState)({}),[c,l]=(0,R.useState)(!1);Kn(e,i),(0,R.useEffect)(()=>{t&&s(e=>{let n={...e};for(let e of t.results)n[e.sessionId]||(n[e.sessionId]={enabled:!!e.suggestion,rejected:new Set});return n})},[t?.results.length,t]);let u=(0,R.useMemo)(()=>t?t.results.map(e=>{let t=o[e.sessionId];if(!t||!t.enabled||!e.suggestion)return null;let n=e.suggestion.tags.filter(e=>!t.rejected.has(e));return n.length===0?null:{sessionId:e.sessionId,tags:n}}).filter(e=>e!==null):[],[t,o]);if(!e||!t)return null;let d=e=>{s(t=>{let n=t[e]??{enabled:!1,rejected:new Set};return{...t,[e]:{...n,enabled:!n.enabled}}})},f=(e,t)=>{s(n=>{let r=n[e]??{enabled:!0,rejected:new Set},i=new Set(r.rejected);return i.has(t)?i.delete(t):i.add(t),{...n,[e]:{...r,rejected:i}}})},p=async()=>{l(!0);try{await n(u)&&i()}finally{l(!1)}},m=t.status===`running`||t.status===`pending`,h=t.results.filter(e=>e.error).length;return(0,z.jsx)(`div`,{className:`fixed inset-0 z-40 bg-black/40 flex items-center justify-center`,children:(0,z.jsxs)(`div`,{className:`bg-bg border border-line rounded-lg w-[900px] max-w-[calc(100vw-2rem)] max-h-[85vh] flex flex-col shadow-xl`,children:[(0,z.jsxs)(`div`,{className:`px-5 py-4 border-b border-line flex items-center justify-between`,children:[(0,z.jsxs)(`h2`,{className:`text-sm font-semibold text-fg`,children:[`Auto-tag review — `,t.completed,`/`,t.total,m&&(0,z.jsx)(`span`,{className:`ml-2 text-fg-muted text-xs`,children:`(scanning…)`})]}),(0,z.jsx)(`button`,{type:`button`,onClick:i,className:`text-fg-muted hover:text-fg text-lg leading-none`,children:`×`})]}),(0,z.jsx)(`div`,{className:`flex-1 overflow-y-auto`,children:(0,z.jsxs)(`table`,{className:`w-full text-xs`,children:[(0,z.jsx)(`thead`,{className:`sticky top-0 bg-bg border-b border-line`,children:(0,z.jsxs)(`tr`,{className:`text-left text-fg-muted`,children:[(0,z.jsx)(`th`,{className:`px-3 py-2 w-8`}),(0,z.jsx)(`th`,{className:`px-3 py-2`,children:`Session`}),(0,z.jsx)(`th`,{className:`px-3 py-2`,children:`Current`}),(0,z.jsx)(`th`,{className:`px-3 py-2`,children:`Suggested`}),(0,z.jsx)(`th`,{className:`px-3 py-2 w-20 text-right`,children:`Confidence`})]})}),(0,z.jsxs)(`tbody`,{children:[t.results.map(e=>(0,z.jsx)(Xn,{r:e,enabled:o[e.sessionId]?.enabled??!1,rejected:o[e.sessionId]?.rejected??new Set,onToggleRow:()=>d(e.sessionId),onToggleTag:t=>f(e.sessionId,t)},e.sessionId)),m&&t.results.length<t.total&&(0,z.jsx)(`tr`,{children:(0,z.jsxs)(`td`,{colSpan:5,className:`px-3 py-3 text-center text-fg-muted italic`,children:[`scanning `,t.total-t.results.length,` more…`]})})]})]})}),(0,z.jsxs)(`div`,{className:`px-5 py-3 border-t border-line flex items-center justify-between`,children:[(0,z.jsxs)(`div`,{className:`text-fg-muted text-xs`,children:[u.length,` session`,u.length===1?``:`s`,` selected`,` `,`(`,(0,z.jsxs)(`span`,{children:[u.reduce((e,t)=>e+t.tags.length,0),` tags`]}),`)`]}),(0,z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[m&&(0,z.jsx)(`button`,{type:`button`,onClick:r,className:`text-role-user hover:text-role-user/80 text-xs px-3 py-1`,children:`Cancel scan`}),!m&&h>0&&a&&(0,z.jsxs)(`button`,{type:`button`,onClick:a,className:`text-xs border border-role-user/40 text-role-user hover:bg-role-user/10 rounded px-3 py-1`,title:`re-run the ${h} session${h===1?``:`s`} that failed`,children:[`Retry `,h,` failed`]}),(0,z.jsx)(`button`,{type:`button`,onClick:i,className:`text-fg-muted hover:text-fg text-xs px-3 py-1`,children:`Close`}),(0,z.jsx)(`button`,{type:`button`,onClick:()=>void p(),disabled:u.length===0||c,className:`bg-accent text-bg rounded px-3 py-1 text-xs font-medium hover:opacity-90 disabled:opacity-40`,children:c?`Applying…`:`Apply ${u.length}`})]})]})]})})}function Xn({r:e,enabled:t,rejected:n,onToggleRow:r,onToggleTag:i}){let a=!!e.error;return(0,z.jsxs)(`tr`,{className:K(`border-b border-line/50`,a&&`opacity-60`),children:[(0,z.jsx)(`td`,{className:`px-3 py-2`,children:(0,z.jsx)(`input`,{type:`checkbox`,checked:t,onChange:r,disabled:a||!e.suggestion})}),(0,z.jsxs)(`td`,{className:`px-3 py-2`,children:[(0,z.jsx)(`div`,{className:`text-fg font-medium truncate max-w-[280px]`,title:e.first_user_message,children:e.alias||e.first_user_message.slice(0,60)||`(no prompt)`}),(0,z.jsxs)(`div`,{className:`font-mono text-[10px] text-fg-muted`,children:[e.sessionId.slice(0,8),` · `,e.project]})]}),(0,z.jsx)(`td`,{className:`px-3 py-2`,children:e.current_tags.length===0?(0,z.jsx)(`span`,{className:`text-fg-muted`,children:`—`}):(0,z.jsx)(`div`,{className:`flex flex-wrap gap-1`,children:e.current_tags.map(e=>(0,z.jsxs)(`span`,{className:`px-1.5 py-0.5 rounded-full bg-role-tool/15 text-role-tool text-[10px]`,children:[`#`,e]},e))})}),(0,z.jsx)(`td`,{className:`px-3 py-2`,children:a?(0,z.jsxs)(`span`,{className:`text-role-user text-[11px]`,children:[`⚠ `,e.error]}):e.suggestion?(0,z.jsx)(`div`,{className:`flex flex-wrap gap-1`,children:e.suggestion.tags.map(e=>(0,z.jsxs)(`button`,{type:`button`,onClick:()=>i(e),className:K(`px-1.5 py-0.5 rounded-full text-[10px] border transition-colors`,n.has(e)?`line-through text-fg-muted border-line bg-transparent`:`bg-accent/10 text-accent border-accent/40 hover:bg-accent/20`),title:n.has(e)?`click to re-include`:`click to reject`,children:[`#`,e]},e))}):(0,z.jsx)(`span`,{className:`text-fg-muted italic`,children:`pending…`})}),(0,z.jsx)(`td`,{className:`px-3 py-2 text-right font-mono text-[10px] text-fg-muted`,children:e.suggestion?e.suggestion.confidence.toFixed(2):`—`})]})}function Zn({open:e,sessionId:t,projectName:n,onClose:r,onOpenSettings:i}){let[a,o]=(0,R.useState)(!1),[s,c]=(0,R.useState)(!1),[l,u]=(0,R.useState)(null),[d,f]=(0,R.useState)(0),[p,m]=(0,R.useState)(null),h=B();Kn(e,r),(0,R.useEffect)(()=>{if(!s||l===null)return;let e=setInterval(()=>f(Date.now()-l),250);return()=>clearInterval(e)},[s,l]);let g=V({queryKey:[`mcp-install-status`],queryFn:()=>W.getMcpInstallStatus(),enabled:e}),_=!!g.data?.claudeCliAvailable,v=async()=>{c(!0),m(null);let e=Date.now();u(e),f(0);try{let r=t?{sessionIds:[t]}:n?{project:n,untaggedOnly:!0}:{untaggedOnly:!0},i=await W.runClaudeCliScan(r);m({success:i.success,tagsAdded:i.tagsAdded,stderrTail:i.stderrTail,elapsedMs:Date.now()-e}),h.invalidateQueries({queryKey:[`sessions`]}),h.invalidateQueries({queryKey:[`tags`]}),t&&h.invalidateQueries({queryKey:[`session`,t]}),G({message:i.success?`Auto-tag complete — ${i.tagsAdded} new tag${i.tagsAdded===1?``:`s`} written.`:`Auto-tag finished with errors (exit ${i.exitCode}). See dialog for details.`,tone:i.success?`success`:`error`,duration:8e3})}catch(e){G({message:`Run failed: ${e instanceof Error?e.message:String(e)}`,tone:`error`})}finally{c(!1)}};if(!e)return null;let y=t?`Using my Recall MCP tools, auto-tag session ${t}. First call list_tags to see existing tags I already use (prefer those for consistency). Then call list_sessions_to_tag with limit 1 and match the session. Pick 2–4 tags based on the content. Finally call apply_tags to write them.`:`Using my Recall MCP tools, scan and tag my sessions. First call list_tags to see existing tags (prefer those for consistency). Then call list_sessions_to_tag with untaggedOnly: true. For each session, pick 2–4 tags based on the content. Finally call apply_tags for each session to write them.`,b=async()=>{try{await navigator.clipboard.writeText(y),o(!0),setTimeout(()=>o(!1),1800)}catch(e){console.error(`copy failed`,e)}},x=async()=>{try{await W.installMcp(),await h.invalidateQueries({queryKey:[`mcp-install-status`]}),G({message:`Claude Recall MCP installed. Restart Claude Code to load it.`,tone:`success`,duration:8e3})}catch(e){G({message:`Install failed: ${e instanceof Error?e.message:String(e)}`,tone:`error`})}};return(0,z.jsx)(`div`,{className:`fixed inset-0 z-40 bg-black/40 flex items-center justify-center`,children:(0,z.jsxs)(`div`,{className:`bg-bg border border-line rounded-lg w-[600px] max-w-[calc(100vw-2rem)] max-h-[calc(100vh-4rem)] overflow-y-auto shadow-xl`,children:[(0,z.jsxs)(`div`,{className:`px-5 py-4 border-b border-line flex items-start justify-between gap-3`,children:[(0,z.jsxs)(`div`,{children:[(0,z.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:`MCP-mode auto-tagging`}),(0,z.jsx)(`p`,{className:`text-fg-muted text-[11px] mt-1`,children:`You're set to use your Claude Code agent (no Anthropic key needed). The web UI can't call your agent directly — you trigger it from Claude Code.`})]}),i&&(0,z.jsx)(`button`,{type:`button`,onClick:i,className:`text-[11px] text-fg-muted hover:text-fg px-2 py-1 shrink-0`,title:`change auto-tagging settings`,children:`⚙ Settings`})]}),(0,z.jsxs)(`div`,{className:`px-5 py-4 space-y-4 text-xs`,children:[(0,z.jsxs)(`div`,{className:`border border-line rounded p-3 space-y-2`,children:[(0,z.jsx)(`div`,{className:`text-fg-muted text-[11px] font-semibold uppercase tracking-wider`,children:`Step 1 — install Recall in Claude Code`}),g.isLoading?(0,z.jsx)(`div`,{className:`text-fg-muted text-[11px]`,children:`Checking…`}):g.data?.installed?(0,z.jsxs)(`div`,{className:`text-accent text-[11px]`,children:[`✓ Installed in `,(0,z.jsx)(`span`,{className:`font-mono text-fg`,children:`~/.claude.json`}),`. If you haven't already, restart Claude Code to load it.`]}):(0,z.jsxs)(z.Fragment,{children:[(0,z.jsxs)(`div`,{className:`text-fg-muted text-[11px]`,children:[`One click — no copy-paste JSON. Writes `,(0,z.jsx)(`span`,{className:`font-mono text-fg`,children:`{ "mcpServers": { "recall": … } }`}),` into your Claude Code config at `,(0,z.jsx)(`span`,{className:`font-mono text-fg`,children:`~/.claude.json`}),`, preserving every other key you already have.`]}),(0,z.jsx)(`button`,{type:`button`,onClick:()=>void x(),className:`bg-accent text-bg rounded px-3 py-1 text-xs font-medium hover:opacity-90`,children:`Install in Claude Code`})]})]}),g.data?.installed&&_&&(0,z.jsxs)(`div`,{className:`border border-accent/50 bg-accent/5 rounded p-3 space-y-2`,children:[(0,z.jsx)(`div`,{className:`text-accent text-[11px] font-semibold uppercase tracking-wider`,children:`Step 2 — one click (recommended)`}),(0,z.jsxs)(`div`,{className:`text-fg-muted text-[11px] leading-relaxed`,children:[`Recall will spawn your local `,(0,z.jsx)(`span`,{className:`font-mono text-fg`,children:`claude`}),` CLI in the background and have it tag `,t?`this session`:n?(0,z.jsxs)(z.Fragment,{children:[`every untagged session in `,(0,z.jsx)(`span`,{className:`text-fg`,children:n})]}):`every untagged session`,` via the Recall MCP tools. Uses your Claude Code subscription — `,(0,z.jsx)(`strong`,{className:`text-fg`,children:`no API key, no copy-paste`}),`.`]}),(0,z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,z.jsxs)(`button`,{type:`button`,onClick:()=>void v(),disabled:s,className:`bg-accent text-bg rounded px-3 py-1 text-xs font-medium hover:opacity-90 disabled:opacity-50 disabled:cursor-wait inline-flex items-center gap-2`,children:[s&&(0,z.jsx)(`span`,{className:`inline-block w-3 h-3 border-2 border-bg border-t-transparent rounded-full animate-spin`}),s?`Running…`:`🏷 Auto-run via Claude Code`]}),s&&(0,z.jsxs)(`span`,{className:`text-[11px] text-fg-muted font-mono tabular-nums`,children:[Qn(d),` elapsed · typical 30s–3min`]})]}),p&&(0,z.jsx)(`div`,{className:`text-[11px] mt-2 p-2 rounded border ${p.success?`border-accent/40 bg-accent/10 text-accent`:`border-role-user/40 bg-role-user/10 text-role-user`}`,children:p.success?(0,z.jsxs)(z.Fragment,{children:[`✓ Done in `,Qn(p.elapsedMs),` — `,p.tagsAdded,` new tag`,p.tagsAdded===1?``:`s`,` written.`]}):(0,z.jsxs)(z.Fragment,{children:[`Exit with errors after `,Qn(p.elapsedMs),`. Tail of stderr:`,(0,z.jsx)(`pre`,{className:`mt-1 font-mono text-[10px] whitespace-pre-wrap overflow-auto max-h-40`,children:p.stderrTail||`(empty)`})]})})]}),(0,z.jsxs)(`div`,{className:`border border-line rounded p-3 space-y-2`,children:[(0,z.jsx)(`div`,{className:`text-fg-muted text-[11px] font-semibold uppercase tracking-wider`,children:g.data?.installed&&_?`Or — paste the prompt into an open Claude Code session`:`Step 2 — ask your agent (in Claude Code)`}),!_&&g.data?.installed&&(0,z.jsxs)(`div`,{className:`text-role-user text-[11px]`,children:[`⚠ `,(0,z.jsx)(`span`,{className:`font-mono text-fg`,children:`claude`}),` CLI not found on PATH, so one-click auto-run isn't available. Install Claude Code locally to enable it, or use the copy-paste path below.`]}),(0,z.jsx)(`pre`,{className:`bg-bg-elevated border border-line rounded p-2 text-[11px] whitespace-pre-wrap`,children:y}),(0,z.jsx)(`button`,{type:`button`,onClick:()=>void b(),className:`text-[11px] bg-accent/10 text-accent hover:bg-accent hover:text-bg border border-accent/40 rounded px-2 py-1`,children:a?`✓ copied`:`📋 copy prompt`})]}),(0,z.jsxs)(`div`,{className:`text-fg-muted text-[11px]`,children:[`Your agent will use the `,(0,z.jsx)(`span`,{className:`font-mono text-fg`,children:`list_tags`}),`,`,` `,(0,z.jsx)(`span`,{className:`font-mono text-fg`,children:`list_sessions_to_tag`}),`, and`,` `,(0,z.jsx)(`span`,{className:`font-mono text-fg`,children:`apply_tags`}),` MCP tools. Tags appear in Recall on the next poll (≤4 seconds).`]}),(0,z.jsxs)(`div`,{className:`text-fg-muted text-[11px] pt-2 border-t border-line`,children:[`Want hands-off tagging that doesn't need Claude Code running?`,` `,i?(0,z.jsx)(`button`,{type:`button`,onClick:i,className:`text-accent hover:underline`,children:`Switch to API-key mode + enable Autopilot`}):(0,z.jsx)(`span`,{children:`Switch backend to API key in settings and enable Autopilot.`}),`.`]})]}),(0,z.jsx)(`div`,{className:`px-5 py-3 border-t border-line flex items-center justify-end gap-2`,children:(0,z.jsx)(`button`,{type:`button`,onClick:r,className:`text-fg-muted hover:text-fg text-xs px-3 py-1`,children:`Close`})})]})})}function Qn(e){let t=Math.floor(e/1e3),n=Math.floor(t/60),r=t%60;return n===0?`${r}s`:`${n}m ${String(r).padStart(2,`0`)}s`}function $n({projectName:e,collectionId:t}){let n=mt(),r=Gn(),i=B(),[a,o]=(0,R.useState)(!1),[s,c]=(0,R.useState)(!1),[l,u]=(0,R.useState)(!1),[d,f]=(0,R.useState)(`untagged`);Kn(s,()=>c(!1)),Kn(!!r.error,()=>r.reset());let p=()=>{let e=n.data;if(!e||!e.enabled){o(!0);return}if(e.backend===`api`&&!e.hasApiKey){o(!0);return}if(e.backend===`mcp`){u(!0);return}c(!0)},m=async()=>{let n={};d===`untagged`&&(n.untaggedOnly=!0),d===`project`&&e&&(n.project=e),d===`collection`&&t&&(n.collectionId=t),c(!1),await r.start(n)},h=()=>{i.invalidateQueries({queryKey:[`sessions`]}),i.invalidateQueries({queryKey:[`tags`]}),i.invalidateQueries({queryKey:[`session`]})},g=async e=>{let t=await r.apply(e);if(t&&t.applied>0){h();let n=e.reduce((e,t)=>e+t.tags.length,0);G({message:`Applied ${t.applied} tag${t.applied===1?``:`s`} across ${e.length} session${e.length===1?``:`s`}.`,tone:`success`,duration:1e4,action:{label:`Undo`,onClick:()=>{_(e,n)}}})}else t&&G({message:`Nothing to apply — all selected tags were already on those sessions.`,tone:`info`});return t},_=async(e,t)=>{let n=0;for(let t of e)for(let e of t.tags)try{await W.removeSessionTag(t.sessionId,e),n+=1}catch(n){console.error(`undo: remove failed`,t.sessionId,e,n)}h(),G({message:`Undone — removed ${n} of ${t} tag${t===1?``:`s`}.`,tone:`info`})},v=async()=>{if(!r.snapshot)return;let e=r.snapshot.results.filter(e=>e.error).map(e=>e.sessionId);e.length!==0&&(r.reset(),await r.start({sessionIds:e}))};return(0,z.jsxs)(z.Fragment,{children:[(0,z.jsxs)(`div`,{className:`inline-flex items-center rounded border border-accent/40 bg-accent/10 overflow-hidden`,children:[(0,z.jsx)(`button`,{type:`button`,onClick:p,className:`text-xs text-accent hover:bg-accent hover:text-bg px-2 py-1 font-medium border-r border-accent/40`,title:n.data?.enabled?`auto-tag sessions with an LLM`:`configure auto-tagging`,children:`🏷 auto-tag`}),(0,z.jsx)(`button`,{type:`button`,onClick:()=>o(!0),className:`text-xs text-accent hover:bg-accent hover:text-bg px-1.5 py-1`,title:`auto-tag settings (enable autopilot, install MCP, change model, paste API key)`,"aria-label":`auto-tag settings`,children:`⚙`})]}),(0,z.jsx)(Jn,{open:a,onClose:()=>o(!1)}),(0,z.jsx)(Zn,{open:l,projectName:e,onClose:()=>{u(!1),G({message:`MCP scan triggered. New tags will appear here as your Claude Code agent writes them.`,tone:`info`,duration:8e3})},onOpenSettings:()=>{u(!1),o(!0)}}),r.error&&(0,z.jsx)(`div`,{className:`fixed inset-0 z-40 bg-black/40 flex items-center justify-center`,children:(0,z.jsxs)(`div`,{className:`bg-bg border border-role-user/60 rounded-lg w-[440px] shadow-xl p-4 text-xs`,children:[(0,z.jsx)(`div`,{className:`text-role-user font-semibold mb-2`,children:`Scan failed`}),(0,z.jsx)(`div`,{className:`text-fg-muted mb-3 break-words`,children:r.error}),(0,z.jsx)(`div`,{className:`flex justify-end`,children:(0,z.jsx)(`button`,{type:`button`,onClick:()=>r.reset(),className:`text-fg-muted hover:text-fg text-xs px-3 py-1`,children:`Close`})})]})}),s&&(0,z.jsx)(`div`,{className:`fixed inset-0 z-40 bg-black/40 flex items-center justify-center`,children:(0,z.jsxs)(`div`,{className:`bg-bg border border-line rounded-lg w-[480px] shadow-xl`,children:[(0,z.jsxs)(`div`,{className:`px-5 py-4 border-b border-line`,children:[(0,z.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:`Auto-tag sessions`}),(0,z.jsx)(`p`,{className:`text-fg-muted text-[11px] mt-1`,children:`Pick how many sessions to send to the LLM. Each session is one model call.`})]}),(0,z.jsxs)(`div`,{className:`px-5 py-4 space-y-3 text-xs`,children:[[{id:`untagged`,label:`Untagged sessions only`,desc:`Every session with zero tags, across ALL projects. Usually what you want for the first run.`,available:!0},{id:`all`,label:`All sessions`,desc:`Every indexed session, across ALL projects. Includes sessions that already have tags (new tags will merge, never replace).`,available:!0},{id:`project`,label:`Current project${e?` — ${e}`:``}`,desc:e?`Only sessions in "${e}".`:`Not available — click a project in the left pane first.`,available:!!e},{id:`collection`,label:`Current collection`,desc:t?`Only sessions in the collection you are currently viewing.`:`Not available — open a collection in the left pane first.`,available:!!t}].map(e=>(0,z.jsxs)(`label`,{className:`flex items-start gap-2 ${e.available?`cursor-pointer`:`opacity-40`}`,children:[(0,z.jsx)(`input`,{type:`radio`,name:`scope`,className:`mt-0.5`,checked:d===e.id,disabled:!e.available,onChange:()=>f(e.id)}),(0,z.jsxs)(`div`,{children:[(0,z.jsx)(`div`,{className:`text-fg`,children:e.label}),(0,z.jsx)(`div`,{className:`text-fg-muted text-[11px]`,children:e.desc})]})]},e.id)),(0,z.jsxs)(`div`,{className:`mt-3 pt-3 border-t border-line text-[11px] text-fg-muted space-y-1`,children:[(0,z.jsxs)(`div`,{children:[`• Capped at `,(0,z.jsx)(`span`,{className:`text-fg`,children:`500 sessions per scan`}),` (safety rail).`]}),(0,z.jsxs)(`div`,{children:[`• Uses model `,(0,z.jsx)(`span`,{className:`font-mono text-fg`,children:n.data?.model??`claude-opus-4-7`}),`.`,n.data?.backend===`api`&&(0,z.jsxs)(z.Fragment,{children:[` API-key mode: roughly `,(0,z.jsx)(`span`,{className:`text-fg`,children:`$0.01–0.05`}),` per session at Opus pricing.`]}),n.data?.backend===`mcp`&&(0,z.jsx)(z.Fragment,{children:` MCP mode: uses your Claude Code subscription, no extra cost.`})]}),(0,z.jsx)(`div`,{children:`• Nothing is written until you Apply in the review step.`}),(0,z.jsxs)(`div`,{children:[`• Press `,(0,z.jsx)(`span`,{className:`font-mono text-fg`,children:`Esc`}),` to cancel any dialog.`]})]})]}),(0,z.jsxs)(`div`,{className:`px-5 py-3 border-t border-line flex items-center justify-end gap-2`,children:[(0,z.jsx)(`button`,{type:`button`,onClick:()=>c(!1),className:`text-fg-muted hover:text-fg text-xs px-3 py-1`,children:`Cancel`}),(0,z.jsx)(`button`,{type:`button`,onClick:()=>void m(),className:`bg-accent text-bg rounded px-3 py-1 text-xs font-medium hover:opacity-90`,children:`Start scan`})]})]})}),(0,z.jsx)(Yn,{open:!!r.id&&!r.error,snapshot:r.snapshot,onApply:g,onCancel:()=>void r.cancel(),onClose:()=>r.reset(),onRetryFailed:()=>void v()})]})}function er({sessionId:e,x:t,y:n,pinned:r,recallPromptsAvailable:i,onClose:a,onTogglePin:o,onAddToCollection:s,onCompareWith:c,onOpen:l,onRunPrompt:u}){let d=(0,R.useRef)(null);(0,R.useEffect)(()=>{let e=e=>{d.current&&!d.current.contains(e.target)&&a()},t=e=>{e.key===`Escape`&&a()};return window.addEventListener(`mousedown`,e),window.addEventListener(`keydown`,t),()=>{window.removeEventListener(`mousedown`,e),window.removeEventListener(`keydown`,t)}},[a]);let f=Math.min(t,window.innerWidth-240-8),p=Math.min(n,window.innerHeight-300-8),m=()=>{navigator.clipboard.writeText(e),G({message:`Session ID copied: ${e.slice(0,8)}…`,tone:`info`}),a()},h=async t=>{a();try{let n=await fetch(`/api/sessions/${encodeURIComponent(e)}/context?mode=${t}`);if(!n.ok)throw Error(`${n.status} ${n.statusText}`);let r=await n.text();await navigator.clipboard.writeText(r),G({message:`Copied ${r.length.toLocaleString()} chars (${t}). Paste into a new Claude session.`,tone:`success`,duration:6e3})}catch(e){G({message:`Copy failed: ${e instanceof Error?e.message:String(e)}`,tone:`error`})}};return(0,z.jsxs)(`div`,{ref:d,role:`menu`,"aria-label":`session actions`,className:`fixed z-50 bg-bg-elevated border border-line rounded-lg shadow-xl py-1 text-xs`,style:{left:f,top:p,width:240},children:[(0,z.jsx)(tr,{label:`Open session`,hint:`jump to transcript`,onClick:()=>{a(),l()}}),(0,z.jsx)(tr,{label:r?`★ Unpin`:`☆ Pin to top`,onClick:()=>{a(),o()}}),(0,z.jsx)(nr,{}),(0,z.jsx)(tr,{label:`Copy session ID`,hint:`${e.slice(0,8)}…`,onClick:m}),(0,z.jsx)(tr,{label:`📋 Copy as context`,hint:`condensed markdown, paste into new Claude`,onClick:()=>void h(`condensed`)}),(0,z.jsx)(tr,{label:`📋 Copy full markdown`,hint:`uncondensed transcript with tool I/O`,onClick:()=>void h(`full`)}),(0,z.jsx)(nr,{}),(0,z.jsx)(tr,{label:`📂 Add to collection…`,onClick:()=>{a(),s()}}),(0,z.jsx)(tr,{label:`⇄ Compare with another session`,onClick:()=>{a(),c()}}),u&&i&&(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(nr,{}),(0,z.jsx)(`div`,{className:`px-3 pt-1 pb-0.5 text-[10px] uppercase tracking-wider text-fg-muted`,children:`Ask Claude Code (via MCP)`}),(0,z.jsx)(tr,{label:`📝 Summarize this session`,hint:`3–5 bullets of what shipped / was tried / is open`,onClick:()=>{a(),u(`summarize_session`,`Summarize this session`,{sessionId:e})}}),(0,z.jsx)(tr,{label:`🎯 Extract decisions`,hint:`architectural / product decisions with why + alternatives`,onClick:()=>{a(),u(`extract_decisions`,`Extract decisions`,{sessionId:e})}}),(0,z.jsx)(tr,{label:`🔍 Find similar sessions`,hint:`5 sessions that touched the same topic, with reasons`,onClick:()=>{a(),u(`find_similar_sessions`,`Find similar sessions`,{sessionId:e})}})]})]})}function tr({label:e,hint:t,onClick:n}){return(0,z.jsxs)(`button`,{type:`button`,role:`menuitem`,onClick:n,className:`block w-full text-left px-3 py-1.5 hover:bg-bg-hover`,children:[(0,z.jsx)(`div`,{className:`text-fg`,children:e}),t&&(0,z.jsx)(`div`,{className:`text-[10px] text-fg-muted`,children:t})]})}function nr(){return(0,z.jsx)(`div`,{className:`border-t border-line my-1`})}function rr({sessionIds:e,x:t,y:n,onClose:r,onClearSelection:i}){let a=(0,R.useRef)(null),o=e.length;(0,R.useEffect)(()=>{let e=e=>{a.current&&!a.current.contains(e.target)&&r()},t=e=>{e.key===`Escape`&&r()};return window.addEventListener(`mousedown`,e),window.addEventListener(`keydown`,t),()=>{window.removeEventListener(`mousedown`,e),window.removeEventListener(`keydown`,t)}},[r]);let s=Math.min(t,window.innerWidth-260-8),c=Math.min(n,window.innerHeight-180-8),l=async(e,t)=>{try{await navigator.clipboard.writeText(e),G({message:`Copied ${o} session ID${o===1?``:`s`} (${t})`,tone:`success`})}catch(e){G({message:`Copy failed: ${e instanceof Error?e.message:String(e)}`,tone:`error`})}};return(0,z.jsxs)(`div`,{ref:a,role:`menu`,"aria-label":`multi-select session actions`,className:`fixed z-50 bg-bg-elevated border border-line rounded-lg shadow-xl py-1 text-xs`,style:{left:s,top:c,width:260},children:[(0,z.jsxs)(`div`,{className:`px-3 pt-1 pb-1 text-[10px] uppercase tracking-wider text-fg-muted`,children:[o,` session`,o===1?``:`s`,` selected`]}),(0,z.jsx)(ar,{}),(0,z.jsx)(ir,{label:`Copy session IDs`,hint:`one per line`,onClick:()=>{r(),l(e.join(`
|
|
10
|
-
`),`one per line`)}}),(0,z.jsx)(ir,{label:`Copy IDs (space-separated)`,hint:`ready to paste into a prompt`,onClick:()=>{r(),l(e.join(` `),`space-separated`)}}),(0,z.jsx)(ir,{label:`Copy IDs (comma-separated)`,hint:`for CSV / lists`,onClick:()=>{r(),l(e.join(`, `),`comma-separated`)}}),(0,z.jsx)(ar,{}),(0,z.jsx)(ir,{label:`Clear selection`,hint:`esc`,onClick:()=>{r(),i()}})]})}function ir({label:e,hint:t,onClick:n}){return(0,z.jsxs)(`button`,{type:`button`,role:`menuitem`,onClick:n,className:`block w-full text-left px-3 py-1.5 hover:bg-bg-hover`,children:[(0,z.jsx)(`div`,{className:`text-fg`,children:e}),t&&(0,z.jsx)(`div`,{className:`text-[10px] text-fg-muted`,children:t})]})}function ar(){return(0,z.jsx)(`div`,{className:`border-t border-line my-1`})}function or({sessionId:e,onClose:t,anchor:n=`center`,position:r=null}){let[i,a]=(0,R.useState)(``),[o,s]=(0,R.useState)(!1),c=(0,R.useRef)(null),l=qt(!1),u=Rt(e),d=Ut();(0,R.useEffect)(()=>{requestAnimationFrame(()=>c.current?.focus())},[]),(0,R.useEffect)(()=>{let e=e=>{e.key===`Escape`&&t()};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[t]);let f=(0,R.useMemo)(()=>{let e=Kt(l.tree,new Set(l.tree.flatMap(e=>sr(e)))),t=i.trim().toLowerCase();return t?e.filter(e=>e.name.toLowerCase().includes(t)||e.description&&e.description.toLowerCase().includes(t)):e},[l.tree,i]),p=(0,R.useMemo)(()=>new Set((u.data?.collections??[]).map(e=>e.id)),[u.data]),m=async n=>{try{await d.mutateAsync({collectionId:n,sessionId:e})}catch(e){console.error(`add to collection failed`,e)}t()},h=(0,z.jsxs)(`div`,{className:K(`bg-bg-elevated border border-line rounded-lg shadow-xl overflow-hidden`,n===`center`?`w-[400px] max-w-[90vw]`:`w-[320px]`),onClick:e=>e.stopPropagation(),children:[(0,z.jsxs)(`div`,{className:`flex items-center gap-2 px-3 py-2.5 border-b border-line`,children:[(0,z.jsx)(`span`,{className:`text-fg-muted`,children:`📂`}),(0,z.jsx)(`input`,{ref:c,type:`text`,value:i,onChange:e=>a(e.target.value),placeholder:`Search collections…`,className:`flex-1 bg-transparent text-sm text-fg placeholder:text-fg-muted focus:outline-none`}),(0,z.jsx)(`button`,{type:`button`,onClick:t,className:`text-fg-muted hover:text-fg text-xs`,"aria-label":`close`,children:`✕`})]}),(0,z.jsxs)(`div`,{className:`max-h-72 overflow-y-auto`,children:[(0,z.jsxs)(`button`,{type:`button`,onClick:()=>s(!0),className:`w-full px-3 py-2 text-left text-sm text-accent hover:bg-bg-hover flex items-center gap-2 border-b border-line`,children:[(0,z.jsx)(`span`,{children:`+`}),(0,z.jsx)(`span`,{children:`Create new collection…`})]}),l.isLoading&&(0,z.jsx)(`div`,{className:`px-3 py-4 text-xs text-fg-muted`,children:`Loading…`}),l.data&&f.length===0&&(0,z.jsx)(`div`,{className:`px-3 py-4 text-xs text-fg-muted`,children:`No collections match. Try "Create new collection".`}),f.map(e=>{let t=p.has(e.id);return(0,z.jsxs)(`button`,{type:`button`,disabled:t,onClick:()=>m(e.id),className:K(`w-full text-left px-3 py-2 text-sm flex items-center gap-2 transition-colors`,t?`text-fg-muted cursor-not-allowed opacity-70`:`text-fg hover:bg-bg-hover`),style:{paddingLeft:`${12+e.depth*16}px`},title:t?`already in this collection`:void 0,children:[(0,z.jsx)(`span`,{children:e.icon??`📂`}),(0,z.jsx)(`span`,{className:`flex-1 truncate`,children:e.name}),t&&(0,z.jsx)(`span`,{className:`text-xs text-accent`,children:`✓`}),!t&&(0,z.jsx)(`span`,{className:`text-xs text-fg-muted`,children:e.session_count})]},e.id)})]})]});return n===`center`?(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(`div`,{className:`fixed inset-0 z-30 bg-black/40 flex items-center justify-center`,onClick:t,children:h}),o&&(0,z.jsx)(Zt,{mode:`create`,pinnedSessionId:e,onClose:()=>s(!1),onCreated:()=>{s(!1),t()}})]}):(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(`div`,{className:`fixed inset-0 z-30`,onClick:t,"aria-hidden":`true`}),(0,z.jsx)(`div`,{className:`fixed z-40`,style:{top:r?.top??100,left:r?.left??100},children:h}),o&&(0,z.jsx)(Zt,{mode:`create`,pinnedSessionId:e,onClose:()=>s(!1),onCreated:()=>{s(!1),t()}})]})}function sr(e){return[e.id,...e.children.flatMap(e=>sr(e))]}function cr(e){return V({queryKey:[`note`,e],queryFn:async()=>{if(!e)return null;let t=await fetch(`/api/sessions/${encodeURIComponent(e)}/notes`);if(t.status===204)return null;if(!t.ok)throw Error(`${t.status}: ${await t.text()}`);return await t.json()},enabled:!!e,staleTime:2e3})}function lr(){let e=B();return at({mutationFn:async({sessionId:e,content:t})=>{let n=await fetch(`/api/sessions/${encodeURIComponent(e)}/notes`,{method:`PUT`,headers:{"content-type":`application/json`},body:JSON.stringify({content:t})});if(!n.ok)throw Error(`${n.status}: ${await n.text()}`);return await n.json()},onSuccess:t=>{e.setQueryData([`note`,t.session_id],t),e.invalidateQueries({queryKey:[`sessions`]}),e.invalidateQueries({queryKey:[`session`]})}})}function ur(){let e=B();return at({mutationFn:async e=>{let t=await fetch(`/api/sessions/${encodeURIComponent(e)}/generate-note`,{method:`POST`});if(!t.ok){let e=await t.text();throw Error(`${t.status}: ${e}`)}return await t.json()},onSuccess:t=>{e.setQueryData([`note`,t.session_id],t),e.invalidateQueries({queryKey:[`sessions`]})}})}function dr(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var fr=dr();function pr(e){fr=e}var mr={exec:()=>null};function q(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(gr.caret,`$1`),n=n.replace(e,i),r},getRegex:()=>new RegExp(n,t)};return r}var hr=((e=``)=>{try{return!!RegExp(`(?<=1)(?<!1)`+e)}catch{return!1}})(),gr={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:e=>RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,`i`),blockquoteBeginRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}>`)},_r=/^(?:[ \t]*(?:\n|$))+/,vr=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,yr=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,br=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,xr=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Sr=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,Cr=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,wr=q(Cr).replace(/bull/g,Sr).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}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,``).getRegex(),Tr=q(Cr).replace(/bull/g,Sr).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}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),Er=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Dr=/^[^\n]+/,Or=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,kr=q(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace(`label`,Or).replace(`title`,/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Ar=q(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Sr).getRegex(),jr=`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`,Mr=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Nr=q(`^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\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`,Mr).replace(`tag`,jr).replace(`attribute`,/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Pr=q(Er).replace(`hr`,br).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]`).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,jr).getRegex(),Fr={blockquote:q(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace(`paragraph`,Pr).getRegex(),code:vr,def:kr,fences:yr,heading:xr,hr:br,html:Nr,lheading:wr,list:Ar,newline:_r,paragraph:Pr,table:mr,text:Dr},Ir=q(`^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)`).replace(`hr`,br).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`blockquote`,` {0,3}>`).replace(`code`,`(?: {4}| {0,3} )[^\\n]`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]`).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,jr).getRegex(),Lr={...Fr,lheading:Tr,table:Ir,paragraph:q(Er).replace(`hr`,br).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`table`,Ir).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]`).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,jr).getRegex()},Rr={...Fr,html:q(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace(`comment`,Mr).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:mr,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:q(Er).replace(`hr`,br).replace(`heading`,` *#{1,6} *[^
|
|
11
|
-
]`).replace(`lheading`,wr).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`|fences`,``).replace(`|list`,``).replace(`|html`,``).replace(`|tag`,``).getRegex()},zr=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Br=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Vr=/^( {2,}|\\)\n(?!\s*$)/,Hr=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Ur=/[\p{P}\p{S}]/u,Wr=/[\s\p{P}\p{S}]/u,Gr=/[^\s\p{P}\p{S}]/u,Kr=q(/^((?![*_])punctSpace)/,`u`).replace(/punctSpace/g,Wr).getRegex(),qr=/(?!~)[\p{P}\p{S}]/u,Jr=/(?!~)[\s\p{P}\p{S}]/u,Yr=/(?:[^\s\p{P}\p{S}]|~)/u,Xr=q(/link|precode-code|html/,`g`).replace(`link`,/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace(`precode-`,hr?"(?<!`)()":"(^^|[^`])").replace(`code`,/(?<b>`+)[^`]+\k<b>(?!`)/).replace(`html`,/<(?! )[^<>]*?>/).getRegex(),Zr=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,Qr=q(Zr,`u`).replace(/punct/g,Ur).getRegex(),$r=q(Zr,`u`).replace(/punct/g,qr).getRegex(),ei=`^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)`,ti=q(ei,`gu`).replace(/notPunctSpace/g,Gr).replace(/punctSpace/g,Wr).replace(/punct/g,Ur).getRegex(),ni=q(ei,`gu`).replace(/notPunctSpace/g,Yr).replace(/punctSpace/g,Jr).replace(/punct/g,qr).getRegex(),ri=q(`^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)`,`gu`).replace(/notPunctSpace/g,Gr).replace(/punctSpace/g,Wr).replace(/punct/g,Ur).getRegex(),ii=q(/^~~?(?:((?!~)punct)|[^\s~])/,`u`).replace(/punct/g,Ur).getRegex(),ai=q(`^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,Gr).replace(/punctSpace/g,Wr).replace(/punct/g,Ur).getRegex(),oi=q(/\\(punct)/,`gu`).replace(/punct/g,Ur).getRegex(),si=q(/^<(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(),ci=q(Mr).replace(`(?:-->|$)`,`-->`).getRegex(),li=q(`^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`,ci).replace(`attribute`,/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),ui=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,di=q(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace(`label`,ui).replace(`href`,/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace(`title`,/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),fi=q(/^!?\[(label)\]\[(ref)\]/).replace(`label`,ui).replace(`ref`,Or).getRegex(),pi=q(/^!?\[(ref)\](?:\[\])?/).replace(`ref`,Or).getRegex(),mi=q(`reflink|nolink(?!\\()`,`g`).replace(`reflink`,fi).replace(`nolink`,pi).getRegex(),hi=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,gi={_backpedal:mr,anyPunctuation:oi,autolink:si,blockSkip:Xr,br:Vr,code:Br,del:mr,delLDelim:mr,delRDelim:mr,emStrongLDelim:Qr,emStrongRDelimAst:ti,emStrongRDelimUnd:ri,escape:zr,link:di,nolink:pi,punctuation:Kr,reflink:fi,reflinkSearch:mi,tag:li,text:Hr,url:mr},_i={...gi,link:q(/^!?\[(label)\]\((.*?)\)/).replace(`label`,ui).getRegex(),reflink:q(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace(`label`,ui).getRegex()},vi={...gi,emStrongRDelimAst:ni,emStrongLDelim:$r,delLDelim:ii,delRDelim:ai,url:q(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace(`protocol`,hi).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:q(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace(`protocol`,hi).getRegex()},yi={...vi,br:q(Vr).replace(`{2,}`,`*`).getRegex(),text:q(vi.text).replace(`\\b_`,`\\b_| {2,}\\n`).replace(/\{2,\}/g,`*`).getRegex()},bi={normal:Fr,gfm:Lr,pedantic:Rr},xi={normal:gi,gfm:vi,breaks:yi,pedantic:_i},Si={"&":`&`,"<":`<`,">":`>`,'"':`"`,"'":`'`},Ci=e=>Si[e];function wi(e,t){if(t){if(gr.escapeTest.test(e))return e.replace(gr.escapeReplace,Ci)}else if(gr.escapeTestNoEncode.test(e))return e.replace(gr.escapeReplaceNoEncode,Ci);return e}function Ti(e){try{e=encodeURI(e).replace(gr.percentDecode,`%`)}catch{return null}return e}function J(e,t){let n=e.replace(gr.findPipe,(e,t,n)=>{let r=!1,i=t;for(;--i>=0&&n[i]===`\\`;)r=!r;return r?`|`:` |`}).split(gr.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(gr.slashPipe,`|`);return n}function Ei(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 Di(e){let t=e.split(`
|
|
12
|
-
`),n=t.length-1;for(;n>=0&&gr.blankLine.test(t[n]);)n--;return t.length-n<=2?e:t.slice(0,n+1).join(`
|
|
13
|
-
`)}function Oi(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 ki(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 Ai(e,t,n,r,i){let a=t.href,o=t.title||null,s=e[1].replace(i.other.outputLinkReplace,`$1`);r.state.inLink=!0;let c={type:e[0].charAt(0)===`!`?`image`:`link`,raw:n,href:a,title:o,text:s,tokens:r.inlineTokens(s)};return r.state.inLink=!1,c}function ji(e,t,n){let r=e.match(n.other.indentCodeCompensation);if(r===null)return t;let i=r[1];return t.split(`
|
|
14
|
-
`).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(`
|
|
15
|
-
`)}var Mi=class{options;rules;lexer;constructor(e){this.options=e||fr}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]:Di(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=ji(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=Ei(e,`#`);(this.options.pedantic||!t||this.rules.other.endingSpaceChar.test(t))&&(e=t.trim())}return{type:`heading`,raw:Ei(t[0],`
|
|
16
|
-
`),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:Ei(t[0],`
|
|
17
|
-
`)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let e=Ei(t[0],`
|
|
18
|
-
`).split(`
|
|
19
|
-
`),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(`
|
|
20
|
-
`),c=s.replace(this.rules.other.blockquoteSetextReplace,`
|
|
21
|
-
$1`).replace(this.rules.other.blockquoteSetextReplace2,``);n=n?`${n}
|
|
22
|
-
${s}`:s,r=r?`${r}
|
|
23
|
-
${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=t.raw+`
|
|
24
|
-
`+e.join(`
|
|
25
|
-
`),o=this.blockquote(a);i[i.length-1]=o,n=n.substring(0,n.length-t.raw.length)+o.raw,r=r.substring(0,r.length-t.text.length)+o.text;break}else if(u?.type===`list`){let t=u,a=t.raw+`
|
|
26
|
-
`+e.join(`
|
|
27
|
-
`),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(`
|
|
28
|
-
`);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=ki(t[2].split(`
|
|
29
|
-
`,1)[0],t[1].length),l=e.split(`
|
|
30
|
-
`,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+`
|
|
31
|
-
`,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(`
|
|
32
|
-
`,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+=`
|
|
33
|
-
`+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+=`
|
|
34
|
-
`+l}u=!l.trim(),r+=p+`
|
|
35
|
-
`,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,[]),e.task){if(e.text=e.text.replace(this.rules.other.listReplaceTask,``),e.tokens[0]?.type===`text`||e.tokens[0]?.type===`paragraph`){e.tokens[0].raw=e.tokens[0].raw.replace(this.rules.other.listReplaceTask,``),e.tokens[0].text=e.tokens[0].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 t=this.rules.other.listTaskCheckbox.exec(e.raw);if(t){let n={type:`checkbox`,raw:t[0]+` `,checked:t[0]!==`[ ]`};e.checked=n.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=n.raw+e.tokens[0].raw,e.tokens[0].text=n.raw+e.tokens[0].text,e.tokens[0].tokens.unshift(n)):e.tokens.unshift({type:`paragraph`,raw:n.raw,text:n.raw,tokens:[n]}):e.tokens.unshift(n)}}if(!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))}}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=Di(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:Ei(t[0],`
|
|
36
|
-
`),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=J(t[1]),r=t[2].replace(this.rules.other.tableAlignChars,``).split(`|`),i=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,``).split(`
|
|
37
|
-
`):[],a={type:`table`,raw:Ei(t[0],`
|
|
38
|
-
`),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(J(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:Ei(t[0],`
|
|
39
|
-
`),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)===`
|
|
40
|
-
`?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=Ei(e.slice(0,-1),`\\`);if((e.length-t.length)%2==0)return}else{let e=Oi(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)),Ai(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 Ai(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 n=[...r[0]].length-1,i,a,o=n,s=0,c=r[0][0]===`*`?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(c.lastIndex=0,t=t.slice(-1*e.length+n);(r=c.exec(t))!==null;){if(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!i)continue;if(a=[...i].length,r[3]||r[4]){o+=a;continue}else if((r[5]||r[6])&&n%3&&!((n+a)%3)){s+=a;continue}if(o-=a,o>0)continue;a=Math.min(a,a+o+s);let t=[...r[0]][0].length,c=e.slice(0,n+r.index+t+a);if(Math.min(n,a)%2){let e=c.slice(1,-1);return{type:`em`,raw:c,text:e,tokens:this.lexer.inlineTokens(e)}}let l=c.slice(2,-2);return{type:`strong`,raw:c,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}}}},Ni=class e{tokens;options;state;inlineQueue;tokenizer;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||fr,this.options.tokenizer=this.options.tokenizer||new Mi,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let t={other:gr,block:bi.normal,inline:xi.normal};this.options.pedantic?(t.block=bi.pedantic,t.inline=xi.pedantic):this.options.gfm&&(t.block=bi.gfm,this.options.breaks?t.inline=xi.breaks:t.inline=xi.gfm),this.tokenizer.rules=t}static get rules(){return{block:bi,inline:xi}}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(gr.carriageReturn,`
|
|
41
|
-
`),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(gr.tabCharGlobal,` `).replace(gr.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+=`
|
|
42
|
-
`: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(`
|
|
43
|
-
`)?``:`
|
|
44
|
-
`)+i.raw,n.text+=`
|
|
45
|
-
`+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(`
|
|
46
|
-
`)?``:`
|
|
47
|
-
`)+i.raw,n.text+=`
|
|
48
|
-
`+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(`
|
|
49
|
-
`)?``:`
|
|
50
|
-
`)+i.raw,r.text+=`
|
|
51
|
-
`+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(`
|
|
52
|
-
`)?``:`
|
|
53
|
-
`)+i.raw,n.text+=`
|
|
54
|
-
`+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}inlineTokens(e,t=[]){this.tokenizer.lexer=this;let n=e,r=null;if(this.tokens.links){let e=Object.keys(this.tokens.links);if(e.length>0)for(;(r=this.tokenizer.rules.inline.reflinkSearch.exec(n))!==null;)e.includes(r[0].slice(r[0].lastIndexOf(`[`)+1,-1))&&(n=n.slice(0,r.index)+`[`+`a`.repeat(r[0].length-2)+`]`+n.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(r=this.tokenizer.rules.inline.anyPunctuation.exec(n))!==null;)n=n.slice(0,r.index)+`++`+n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let i;for(;(r=this.tokenizer.rules.inline.blockSkip.exec(n))!==null;)i=r[2]?r[2].length:0,n=n.slice(0,r.index+i)+`[`+`a`.repeat(r[0].length-i-2)+`]`+n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);n=this.options.hooks?.emStrongMask?.call({lexer:this},n)??n;let a=!1,o=``,s=1/0;for(;e;){if(e.length<s)s=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}a||(o=``),a=!1;let r;if(this.options.extensions?.inline?.some(n=>(r=n.call({lexer:this},e,t))?(e=e.substring(r.raw.length),t.push(r),!0):!1))continue;if(r=this.tokenizer.escape(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.tag(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.link(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(r.raw.length);let n=t.at(-1);r.type===`text`&&n?.type===`text`?(n.raw+=r.raw,n.text+=r.text):t.push(r);continue}if(r=this.tokenizer.emStrong(e,n,o)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.codespan(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.br(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.del(e,n,o)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.autolink(e)){e=e.substring(r.raw.length),t.push(r);continue}if(!this.state.inLink&&(r=this.tokenizer.url(e))){e=e.substring(r.raw.length),t.push(r);continue}let i=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&&(i=e.substring(0,t+1))}if(r=this.tokenizer.inlineText(i)){e=e.substring(r.raw.length),r.raw.slice(-1)!==`_`&&(o=r.raw.slice(-1)),a=!0;let n=t.at(-1);n?.type===`text`?(n.raw+=r.raw,n.text+=r.text):t.push(r);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)}},Pi=class{options;parser;constructor(e){this.options=e||fr}space(e){return``}code({text:e,lang:t,escaped:n}){let r=(t||``).match(gr.notSpaceStart)?.[0],i=e.replace(gr.endingNewline,``)+`
|
|
55
|
-
`;return r?`<pre><code class="language-`+wi(r)+`">`+(n?i:wi(i,!0))+`</code></pre>
|
|
56
|
-
`:`<pre><code>`+(n?i:wi(i,!0))+`</code></pre>
|
|
57
|
-
`}blockquote({tokens:e}){return`<blockquote>
|
|
58
|
-
${this.parser.parse(e)}</blockquote>
|
|
59
|
-
`}html({text:e}){return e}def(e){return``}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>
|
|
60
|
-
`}hr(e){return`<hr>
|
|
61
|
-
`}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+`>
|
|
62
|
-
`+r+`</`+i+`>
|
|
63
|
-
`}listitem(e){return`<li>${this.parser.parse(e.tokens)}</li>
|
|
64
|
-
`}checkbox({checked:e}){return`<input `+(e?`checked="" `:``)+`disabled="" type="checkbox"> `}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>
|
|
65
|
-
`}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>
|
|
66
|
-
<thead>
|
|
67
|
-
`+t+`</thead>
|
|
68
|
-
`+r+`</table>
|
|
69
|
-
`}tablerow({text:e}){return`<tr>
|
|
70
|
-
${e}</tr>
|
|
71
|
-
`}tablecell(e){let t=this.parser.parseInline(e.tokens),n=e.header?`th`:`td`;return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`</${n}>
|
|
72
|
-
`}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>${wi(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=Ti(e);if(i===null)return r;e=i;let a=`<a href="`+e+`"`;return t&&(a+=` title="`+wi(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=Ti(e);if(i===null)return wi(n);e=i;let a=`<img src="${e}" alt="${wi(n)}"`;return t&&(a+=` title="${wi(t)}"`),a+=`>`,a}text(e){return`tokens`in e&&e.tokens?this.parser.parseInline(e.tokens):`escaped`in e&&e.escaped?e.text:wi(e.text)}},Fi=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}},Ii=class e{options;renderer;textRenderer;constructor(e){this.options=e||fr,this.options.renderer=this.options.renderer||new Pi,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Fi}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`,`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`,`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}},Li=class{options;block;constructor(e){this.options=e||fr}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?Ni.lex:Ni.lexInline}provideParser(e=this.block){return e?Ii.parse:Ii.parseInline}},Ri=new class{defaults=dr();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=Ii;Renderer=Pi;TextRenderer=Fi;Lexer=Ni;Tokenizer=Mi;Hooks=Li;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 Pi(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 Mi(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 Li;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];Li.passThroughHooks.has(n)?t[r]=e=>{if(this.defaults.async&&Li.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)}: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 Ni.lex(e,t??this.defaults)}parser(e,t){return Ii.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?Ni.lex:Ni.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?Ii.parse:Ii.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?Ni.lex:Ni.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?Ii.parse:Ii.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+=`
|
|
73
|
-
Please report this to https://github.com/markedjs/marked.`,e){let e=`<p>An error occurred:</p><pre>`+wi(n.message+``,!0)+`</pre>`;return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}};function Y(e,t){return Ri.parse(e,t)}Y.options=Y.setOptions=function(e){return Ri.setOptions(e),Y.defaults=Ri.defaults,pr(Y.defaults),Y},Y.getDefaults=dr,Y.defaults=fr,Y.use=function(...e){return Ri.use(...e),Y.defaults=Ri.defaults,pr(Y.defaults),Y},Y.walkTokens=function(e,t){return Ri.walkTokens(e,t)},Y.parseInline=Ri.parseInline,Y.Parser=Ii,Y.parser=Ii.parse,Y.Renderer=Pi,Y.TextRenderer=Fi,Y.Lexer=Ni,Y.lexer=Ni.lex,Y.Tokenizer=Mi,Y.Hooks=Li,Y.parse=Y,Y.options,Y.setOptions,Y.use,Y.walkTokens,Y.parseInline,Ii.parse,Ni.lex;var{entries:zi,setPrototypeOf:Bi,isFrozen:Vi,getPrototypeOf:Hi,getOwnPropertyDescriptor:Ui}=Object,{freeze:Wi,seal:Gi,create:Ki}=Object,{apply:qi,construct:Ji}=typeof Reflect<`u`&&Reflect;Wi||=function(e){return e},Gi||=function(e){return e},qi||=function(e,t){var n=[...arguments].slice(2);return e.apply(t,n)},Ji||=function(e){return new e(...[...arguments].slice(1))};var Yi=ha(Array.prototype.forEach),Xi=ha(Array.prototype.lastIndexOf),Zi=ha(Array.prototype.pop),Qi=ha(Array.prototype.push),$i=ha(Array.prototype.splice),ea=Array.isArray,ta=ha(String.prototype.toLowerCase),na=ha(String.prototype.toString),ra=ha(String.prototype.match),ia=ha(String.prototype.replace),aa=ha(String.prototype.indexOf),oa=ha(String.prototype.trim),sa=ha(Number.prototype.toString),ca=ha(Boolean.prototype.toString),la=typeof BigInt>`u`?null:ha(BigInt.prototype.toString),ua=typeof Symbol>`u`?null:ha(Symbol.prototype.toString),da=ha(Object.prototype.hasOwnProperty),fa=ha(Object.prototype.toString),pa=ha(RegExp.prototype.test),ma=ga(TypeError);function ha(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);var n=[...arguments].slice(1);return qi(e,t,n)}}function ga(e){return function(){return Ji(e,[...arguments])}}function X(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:ta;if(Bi&&Bi(e,null),!ea(t))return e;let r=t.length;for(;r--;){let i=t[r];if(typeof i==`string`){let e=n(i);e!==i&&(Vi(t)||(t[r]=e),i=e)}e[i]=!0}return e}function _a(e){for(let t=0;t<e.length;t++)da(e,t)||(e[t]=null);return e}function va(e){let t=Ki(null);for(let[n,r]of zi(e))da(e,n)&&(ea(r)?t[n]=_a(r):r&&typeof r==`object`&&r.constructor===Object?t[n]=va(r):t[n]=r);return t}function ya(e){switch(typeof e){case`string`:return e;case`number`:return sa(e);case`boolean`:return ca(e);case`bigint`:return la?la(e):`0`;case`symbol`:return ua?ua(e):`Symbol()`;case`undefined`:return fa(e);case`function`:case`object`:{if(e===null)return fa(e);let t=e,n=ba(t,`toString`);if(typeof n==`function`){let e=n(t);return typeof e==`string`?e:fa(e)}return fa(e)}default:return fa(e)}}function ba(e,t){for(;e!==null;){let n=Ui(e,t);if(n){if(n.get)return ha(n.get);if(typeof n.value==`function`)return ha(n.value)}e=Hi(e)}function n(){return null}return n}function xa(e){try{return pa(e,``),!0}catch{return!1}}var Sa=Wi(`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(`.`)),Ca=Wi(`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(`.`)),wa=Wi([`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`]),Ta=Wi([`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`]),Ea=Wi(`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(`.`)),Da=Wi([`maction`,`maligngroup`,`malignmark`,`mlongdiv`,`mscarries`,`mscarry`,`msgroup`,`mstack`,`msline`,`msrow`,`semantics`,`annotation`,`annotation-xml`,`mprescripts`,`none`]),Oa=Wi([`#text`]),ka=Wi(`accept.action.align.alt.autocapitalize.autocomplete.autopictureinpicture.autoplay.background.bgcolor.border.capture.cellpadding.cellspacing.checked.cite.class.clear.color.cols.colspan.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(`.`)),Aa=Wi(`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.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.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-rendering.textlength.type.u1.u2.unicode.values.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(`.`)),ja=Wi(`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(`.`)),Ma=Wi([`xlink:href`,`xml:id`,`xlink:title`,`xml:space`,`xmlns:xlink`]),Na=Gi(/\{\{[\w\W]*|[\w\W]*\}\}/gm),Pa=Gi(/<%[\w\W]*|[\w\W]*%>/gm),Fa=Gi(/\$\{[\w\W]*/gm),Ia=Gi(/^data-[\-\w.\u00B7-\uFFFF]+$/),La=Gi(/^aria-[\-\w]+$/),Ra=Gi(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),za=Gi(/^(?:\w+script|data):/i),Ba=Gi(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Va=Gi(/^html$/i),Ha=Gi(/^[a-z][.\w]*(-[.\w]+)+$/i),Ua=Object.freeze({__proto__:null,ARIA_ATTR:La,ATTR_WHITESPACE:Ba,CUSTOM_ELEMENT:Ha,DATA_ATTR:Ia,DOCTYPE_NAME:Va,ERB_EXPR:Pa,IS_ALLOWED_URI:Ra,IS_SCRIPT_OR_DATA:za,MUSTACHE_EXPR:Na,TMPLIT_EXPR:Fa}),Wa={element:1,text:3,progressingInstruction:7,comment:8,document:9},Ga=function(){return typeof window>`u`?null:window},Ka=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}},qa=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function Ja(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Ga(),t=e=>Ja(e);if(t.version=`3.4.1`,t.removed=[],!e||!e.document||e.document.nodeType!==Wa.document||!e.Element)return t.isSupported=!1,t;let{document:n}=e,r=n,i=r.currentScript,{DocumentFragment:a,HTMLTemplateElement:o,Node:s,Element:c,NodeFilter:l,NamedNodeMap:u=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:d,DOMParser:f,trustedTypes:p}=e,m=c.prototype,h=ba(m,`cloneNode`),g=ba(m,`remove`),_=ba(m,`nextSibling`),v=ba(m,`childNodes`),y=ba(m,`parentNode`);if(typeof o==`function`){let e=n.createElement(`template`);e.content&&e.content.ownerDocument&&(n=e.content.ownerDocument)}let b,x=``,{implementation:S,createNodeIterator:C,createDocumentFragment:w,getElementsByTagName:T}=n,{importNode:E}=r,D=qa();t.isSupported=typeof zi==`function`&&typeof y==`function`&&S&&S.createHTMLDocument!==void 0;let{MUSTACHE_EXPR:O,ERB_EXPR:k,TMPLIT_EXPR:A,DATA_ATTR:ee,ARIA_ATTR:j,IS_SCRIPT_OR_DATA:te,ATTR_WHITESPACE:M,CUSTOM_ELEMENT:ne}=Ua,{IS_ALLOWED_URI:N}=Ua,P=null,re=X({},[...Sa,...Ca,...wa,...Ea,...Oa]),F=null,ie=X({},[...ka,...Aa,...ja,...Ma]),I=Object.seal(Ki(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}})),ae=null,L=null,oe=Object.seal(Ki(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),se=!0,ce=!0,le=!1,ue=!0,de=!1,fe=!0,pe=!1,me=!1,he=!1,ge=!1,_e=!1,ve=!1,ye=!0,be=!1,xe=`user-content-`,Se=!0,Ce=!1,we={},Te=null,Ee=X({},[`annotation-xml`,`audio`,`colgroup`,`desc`,`foreignobject`,`head`,`iframe`,`math`,`mi`,`mn`,`mo`,`ms`,`mtext`,`noembed`,`noframes`,`noscript`,`plaintext`,`script`,`style`,`svg`,`template`,`thead`,`title`,`video`,`xmp`]),De=null,Oe=X({},[`audio`,`video`,`img`,`source`,`image`,`track`]),ke=null,Ae=X({},[`alt`,`class`,`for`,`id`,`label`,`name`,`pattern`,`placeholder`,`role`,`summary`,`title`,`value`,`style`,`xmlns`]),je=`http://www.w3.org/1998/Math/MathML`,Me=`http://www.w3.org/2000/svg`,Ne=`http://www.w3.org/1999/xhtml`,Pe=Ne,Fe=!1,Ie=null,Le=X({},[je,Me,Ne],na),Re=X({},[`mi`,`mo`,`mn`,`ms`,`mtext`]),ze=X({},[`annotation-xml`]),Be=X({},[`title`,`style`,`font`,`a`,`script`]),Ve=null,He=[`application/xhtml+xml`,`text/html`],Ue=null,R=null,z=n.createElement(`form`),We=function(e){return e instanceof RegExp||e instanceof Function},B=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(R&&R===e)return;(!e||typeof e!=`object`)&&(e={}),e=va(e),Ve=He.indexOf(e.PARSER_MEDIA_TYPE)===-1?`text/html`:e.PARSER_MEDIA_TYPE,Ue=Ve===`application/xhtml+xml`?na:ta,P=da(e,`ALLOWED_TAGS`)&&ea(e.ALLOWED_TAGS)?X({},e.ALLOWED_TAGS,Ue):re,F=da(e,`ALLOWED_ATTR`)&&ea(e.ALLOWED_ATTR)?X({},e.ALLOWED_ATTR,Ue):ie,Ie=da(e,`ALLOWED_NAMESPACES`)&&ea(e.ALLOWED_NAMESPACES)?X({},e.ALLOWED_NAMESPACES,na):Le,ke=da(e,`ADD_URI_SAFE_ATTR`)&&ea(e.ADD_URI_SAFE_ATTR)?X(va(Ae),e.ADD_URI_SAFE_ATTR,Ue):Ae,De=da(e,`ADD_DATA_URI_TAGS`)&&ea(e.ADD_DATA_URI_TAGS)?X(va(Oe),e.ADD_DATA_URI_TAGS,Ue):Oe,Te=da(e,`FORBID_CONTENTS`)&&ea(e.FORBID_CONTENTS)?X({},e.FORBID_CONTENTS,Ue):Ee,ae=da(e,`FORBID_TAGS`)&&ea(e.FORBID_TAGS)?X({},e.FORBID_TAGS,Ue):va({}),L=da(e,`FORBID_ATTR`)&&ea(e.FORBID_ATTR)?X({},e.FORBID_ATTR,Ue):va({}),we=da(e,`USE_PROFILES`)?e.USE_PROFILES&&typeof e.USE_PROFILES==`object`?va(e.USE_PROFILES):e.USE_PROFILES:!1,se=e.ALLOW_ARIA_ATTR!==!1,ce=e.ALLOW_DATA_ATTR!==!1,le=e.ALLOW_UNKNOWN_PROTOCOLS||!1,ue=e.ALLOW_SELF_CLOSE_IN_ATTR!==!1,de=e.SAFE_FOR_TEMPLATES||!1,fe=e.SAFE_FOR_XML!==!1,pe=e.WHOLE_DOCUMENT||!1,ge=e.RETURN_DOM||!1,_e=e.RETURN_DOM_FRAGMENT||!1,ve=e.RETURN_TRUSTED_TYPE||!1,he=e.FORCE_BODY||!1,ye=e.SANITIZE_DOM!==!1,be=e.SANITIZE_NAMED_PROPS||!1,Se=e.KEEP_CONTENT!==!1,Ce=e.IN_PLACE||!1,N=xa(e.ALLOWED_URI_REGEXP)?e.ALLOWED_URI_REGEXP:Ra,Pe=typeof e.NAMESPACE==`string`?e.NAMESPACE:Ne,Re=da(e,`MATHML_TEXT_INTEGRATION_POINTS`)&&e.MATHML_TEXT_INTEGRATION_POINTS&&typeof e.MATHML_TEXT_INTEGRATION_POINTS==`object`?va(e.MATHML_TEXT_INTEGRATION_POINTS):X({},[`mi`,`mo`,`mn`,`ms`,`mtext`]),ze=da(e,`HTML_INTEGRATION_POINTS`)&&e.HTML_INTEGRATION_POINTS&&typeof e.HTML_INTEGRATION_POINTS==`object`?va(e.HTML_INTEGRATION_POINTS):X({},[`annotation-xml`]);let t=da(e,`CUSTOM_ELEMENT_HANDLING`)&&e.CUSTOM_ELEMENT_HANDLING&&typeof e.CUSTOM_ELEMENT_HANDLING==`object`?va(e.CUSTOM_ELEMENT_HANDLING):Ki(null);if(I=Ki(null),da(t,`tagNameCheck`)&&We(t.tagNameCheck)&&(I.tagNameCheck=t.tagNameCheck),da(t,`attributeNameCheck`)&&We(t.attributeNameCheck)&&(I.attributeNameCheck=t.attributeNameCheck),da(t,`allowCustomizedBuiltInElements`)&&typeof t.allowCustomizedBuiltInElements==`boolean`&&(I.allowCustomizedBuiltInElements=t.allowCustomizedBuiltInElements),de&&(ce=!1),_e&&(ge=!0),we&&(P=X({},Oa),F=Ki(null),we.html===!0&&(X(P,Sa),X(F,ka)),we.svg===!0&&(X(P,Ca),X(F,Aa),X(F,Ma)),we.svgFilters===!0&&(X(P,wa),X(F,Aa),X(F,Ma)),we.mathMl===!0&&(X(P,Ea),X(F,ja),X(F,Ma))),oe.tagCheck=null,oe.attributeCheck=null,da(e,`ADD_TAGS`)&&(typeof e.ADD_TAGS==`function`?oe.tagCheck=e.ADD_TAGS:ea(e.ADD_TAGS)&&(P===re&&(P=va(P)),X(P,e.ADD_TAGS,Ue))),da(e,`ADD_ATTR`)&&(typeof e.ADD_ATTR==`function`?oe.attributeCheck=e.ADD_ATTR:ea(e.ADD_ATTR)&&(F===ie&&(F=va(F)),X(F,e.ADD_ATTR,Ue))),da(e,`ADD_URI_SAFE_ATTR`)&&ea(e.ADD_URI_SAFE_ATTR)&&X(ke,e.ADD_URI_SAFE_ATTR,Ue),da(e,`FORBID_CONTENTS`)&&ea(e.FORBID_CONTENTS)&&(Te===Ee&&(Te=va(Te)),X(Te,e.FORBID_CONTENTS,Ue)),da(e,`ADD_FORBID_CONTENTS`)&&ea(e.ADD_FORBID_CONTENTS)&&(Te===Ee&&(Te=va(Te)),X(Te,e.ADD_FORBID_CONTENTS,Ue)),Se&&(P[`#text`]=!0),pe&&X(P,[`html`,`head`,`body`]),P.table&&(X(P,[`tbody`]),delete ae.tbody),e.TRUSTED_TYPES_POLICY){if(typeof e.TRUSTED_TYPES_POLICY.createHTML!=`function`)throw ma(`TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.`);if(typeof e.TRUSTED_TYPES_POLICY.createScriptURL!=`function`)throw ma(`TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.`);b=e.TRUSTED_TYPES_POLICY,x=b.createHTML(``)}else b===void 0&&(b=Ka(p,i)),b!==null&&typeof x==`string`&&(x=b.createHTML(``));Wi&&Wi(e),R=e},Ge=X({},[...Ca,...wa,...Ta]),Ke=X({},[...Ea,...Da]),qe=function(e){let t=y(e);(!t||!t.tagName)&&(t={namespaceURI:Pe,tagName:`template`});let n=ta(e.tagName),r=ta(t.tagName);return Ie[e.namespaceURI]?e.namespaceURI===Me?t.namespaceURI===Ne?n===`svg`:t.namespaceURI===je?n===`svg`&&(r===`annotation-xml`||Re[r]):!!Ge[n]:e.namespaceURI===je?t.namespaceURI===Ne?n===`math`:t.namespaceURI===Me?n===`math`&&ze[r]:!!Ke[n]:e.namespaceURI===Ne?t.namespaceURI===Me&&!ze[r]||t.namespaceURI===je&&!Re[r]?!1:!Ke[n]&&(Be[n]||!Ge[n]):!!(Ve===`application/xhtml+xml`&&Ie[e.namespaceURI]):!1},Je=function(e){Qi(t.removed,{element:e});try{y(e).removeChild(e)}catch{g(e)}},Ye=function(e,n){try{Qi(t.removed,{attribute:n.getAttributeNode(e),from:n})}catch{Qi(t.removed,{attribute:null,from:n})}if(n.removeAttribute(e),e===`is`)if(ge||_e)try{Je(n)}catch{}else try{n.setAttribute(e,``)}catch{}},Xe=function(e){let t=null,r=null;if(he)e=`<remove></remove>`+e;else{let t=ra(e,/^[\r\n\t ]+/);r=t&&t[0]}Ve===`application/xhtml+xml`&&Pe===Ne&&(e=`<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>`+e+`</body></html>`);let i=b?b.createHTML(e):e;if(Pe===Ne)try{t=new f().parseFromString(i,Ve)}catch{}if(!t||!t.documentElement){t=S.createDocument(Pe,`template`,null);try{t.documentElement.innerHTML=Fe?x:i}catch{}}let a=t.body||t.documentElement;return e&&r&&a.insertBefore(n.createTextNode(r),a.childNodes[0]||null),Pe===Ne?T.call(t,pe?`html`:`body`)[0]:pe?t.documentElement:a},Ze=function(e){return C.call(e.ownerDocument||e,e,l.SHOW_ELEMENT|l.SHOW_COMMENT|l.SHOW_TEXT|l.SHOW_PROCESSING_INSTRUCTION|l.SHOW_CDATA_SECTION,null)},Qe=function(e){return e instanceof d&&(typeof e.nodeName!=`string`||typeof e.textContent!=`string`||typeof e.removeChild!=`function`||!(e.attributes instanceof u)||typeof e.removeAttribute!=`function`||typeof e.setAttribute!=`function`||typeof e.namespaceURI!=`string`||typeof e.insertBefore!=`function`||typeof e.hasChildNodes!=`function`)},$e=function(e){return typeof s==`function`&&e instanceof s};function et(e,n,r){Yi(e,e=>{e.call(t,n,r,R)})}let tt=function(e){let n=null;if(et(D.beforeSanitizeElements,e,null),Qe(e))return Je(e),!0;let r=Ue(e.nodeName);if(et(D.uponSanitizeElement,e,{tagName:r,allowedTags:P}),fe&&e.hasChildNodes()&&!$e(e.firstElementChild)&&pa(/<[/\w!]/g,e.innerHTML)&&pa(/<[/\w!]/g,e.textContent)||fe&&e.namespaceURI===Ne&&r===`style`&&$e(e.firstElementChild)||e.nodeType===Wa.progressingInstruction||fe&&e.nodeType===Wa.comment&&pa(/<[/\w]/g,e.data))return Je(e),!0;if(ae[r]||!(oe.tagCheck instanceof Function&&oe.tagCheck(r))&&!P[r]){if(!ae[r]&&it(r)&&(I.tagNameCheck instanceof RegExp&&pa(I.tagNameCheck,r)||I.tagNameCheck instanceof Function&&I.tagNameCheck(r)))return!1;if(Se&&!Te[r]){let t=y(e)||e.parentNode,n=v(e)||e.childNodes;if(n&&t){let r=n.length;for(let i=r-1;i>=0;--i){let r=h(n[i],!0);t.insertBefore(r,_(e))}}}return Je(e),!0}return e instanceof c&&!qe(e)||(r===`noscript`||r===`noembed`||r===`noframes`)&&pa(/<\/no(script|embed|frames)/i,e.innerHTML)?(Je(e),!0):(de&&e.nodeType===Wa.text&&(n=e.textContent,Yi([O,k,A],e=>{n=ia(n,e,` `)}),e.textContent!==n&&(Qi(t.removed,{element:e.cloneNode()}),e.textContent=n)),et(D.afterSanitizeElements,e,null),!1)},nt=function(e,t,r){if(L[t]||ye&&(t===`id`||t===`name`)&&(r in n||r in z))return!1;if(!(ce&&!L[t]&&pa(ee,t))&&!(se&&pa(j,t))&&!(oe.attributeCheck instanceof Function&&oe.attributeCheck(t,e))){if(!F[t]||L[t]){if(!(it(e)&&(I.tagNameCheck instanceof RegExp&&pa(I.tagNameCheck,e)||I.tagNameCheck instanceof Function&&I.tagNameCheck(e))&&(I.attributeNameCheck instanceof RegExp&&pa(I.attributeNameCheck,t)||I.attributeNameCheck instanceof Function&&I.attributeNameCheck(t,e))||t===`is`&&I.allowCustomizedBuiltInElements&&(I.tagNameCheck instanceof RegExp&&pa(I.tagNameCheck,r)||I.tagNameCheck instanceof Function&&I.tagNameCheck(r))))return!1}else if(!ke[t]&&!pa(N,ia(r,M,``))&&!((t===`src`||t===`xlink:href`||t===`href`)&&e!==`script`&&aa(r,`data:`)===0&&De[e])&&!(le&&!pa(te,ia(r,M,``)))&&r)return!1}return!0},rt=X({},[`annotation-xml`,`color-profile`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`missing-glyph`]),it=function(e){return!rt[ta(e)]&&pa(ne,e)},V=function(e){et(D.beforeSanitizeAttributes,e,null);let{attributes:n}=e;if(!n||Qe(e))return;let r={attrName:``,attrValue:``,keepAttr:!0,allowedAttributes:F,forceKeepAttr:void 0},i=n.length;for(;i--;){let{name:a,namespaceURI:o,value:s}=n[i],c=Ue(a),l=s,u=a===`value`?l:oa(l);if(r.attrName=c,r.attrValue=u,r.keepAttr=!0,r.forceKeepAttr=void 0,et(D.uponSanitizeAttribute,e,r),u=r.attrValue,be&&(c===`id`||c===`name`)&&aa(u,xe)!==0&&(Ye(a,e),u=xe+u),fe&&pa(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,u)){Ye(a,e);continue}if(c===`attributename`&&ra(u,`href`)){Ye(a,e);continue}if(r.forceKeepAttr)continue;if(!r.keepAttr){Ye(a,e);continue}if(!ue&&pa(/\/>/i,u)){Ye(a,e);continue}de&&Yi([O,k,A],e=>{u=ia(u,e,` `)});let d=Ue(e.nodeName);if(!nt(d,c,u)){Ye(a,e);continue}if(b&&typeof p==`object`&&typeof p.getAttributeType==`function`&&!o)switch(p.getAttributeType(d,c)){case`TrustedHTML`:u=b.createHTML(u);break;case`TrustedScriptURL`:u=b.createScriptURL(u);break}if(u!==l)try{o?e.setAttributeNS(o,a,u):e.setAttribute(a,u),Qe(e)?Je(e):Zi(t.removed)}catch{Ye(a,e)}}et(D.afterSanitizeAttributes,e,null)},at=function(e){let t=null,n=Ze(e);for(et(D.beforeSanitizeShadowDOM,e,null);t=n.nextNode();)et(D.uponSanitizeShadowNode,t,null),tt(t),V(t),t.content instanceof a&&at(t.content);et(D.afterSanitizeShadowDOM,e,null)};return t.sanitize=function(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=null,o=null,c=null,l=null;if(Fe=!e,Fe&&(e=`<!-->`),typeof e!=`string`&&!$e(e)&&(e=ya(e),typeof e!=`string`))throw ma(`dirty is not a string, aborting`);if(!t.isSupported)return e;if(me||B(n),t.removed=[],typeof e==`string`&&(Ce=!1),Ce){let t=e.nodeName;if(typeof t==`string`){let e=Ue(t);if(!P[e]||ae[e])throw ma(`root node is forbidden and cannot be sanitized in-place`)}}else if(e instanceof s)i=Xe(`<!---->`),o=i.ownerDocument.importNode(e,!0),o.nodeType===Wa.element&&o.nodeName===`BODY`||o.nodeName===`HTML`?i=o:i.appendChild(o);else{if(!ge&&!de&&!pe&&e.indexOf(`<`)===-1)return b&&ve?b.createHTML(e):e;if(i=Xe(e),!i)return ge?null:ve?x:``}i&&he&&Je(i.firstChild);let u=Ze(Ce?e:i);for(;c=u.nextNode();)tt(c),V(c),c.content instanceof a&&at(c.content);if(Ce)return e;if(ge){if(de){i.normalize();let e=i.innerHTML;Yi([O,k,A],t=>{e=ia(e,t,` `)}),i.innerHTML=e}if(_e)for(l=w.call(i.ownerDocument);i.firstChild;)l.appendChild(i.firstChild);else l=i;return(F.shadowroot||F.shadowrootmode)&&(l=E.call(r,l,!0)),l}let d=pe?i.outerHTML:i.innerHTML;return pe&&P[`!doctype`]&&i.ownerDocument&&i.ownerDocument.doctype&&i.ownerDocument.doctype.name&&pa(Va,i.ownerDocument.doctype.name)&&(d=`<!DOCTYPE `+i.ownerDocument.doctype.name+`>
|
|
74
|
-
`+d),de&&Yi([O,k,A],e=>{d=ia(d,e,` `)}),b&&ve?b.createHTML(d):d},t.setConfig=function(){B(arguments.length>0&&arguments[0]!==void 0?arguments[0]:{}),me=!0},t.clearConfig=function(){R=null,me=!1},t.isValidAttribute=function(e,t,n){return R||B({}),nt(Ue(e),Ue(t),n)},t.addHook=function(e,t){typeof t==`function`&&Qi(D[e],t)},t.removeHook=function(e,t){if(t!==void 0){let n=Xi(D[e],t);return n===-1?void 0:$i(D[e],n,1)[0]}return Zi(D[e])},t.removeHooks=function(e){D[e]=[]},t.removeAllHooks=function(){D=qa()},t}var Ya=Ja();Y.setOptions({gfm:!0,breaks:!1});var Xa={ALLOWED_ATTR:[`class`,`title`],FORBID_TAGS:[`style`,`form`,`input`,`button`,`iframe`,`object`,`embed`,`script`],FORBID_ATTR:[`style`,`onerror`,`onload`,`onclick`,`href`,`src`],ALLOW_DATA_ATTR:!1};function Za(e){let t=Y.parse(e??``,{async:!1});return Ya.sanitize(t,Xa)}function Qa({text:e,className:t}){let n=(0,R.useMemo)(()=>Za(e??``),[e]);return!e||!e.trim()?null:(0,z.jsx)(`article`,{className:[`prose-message`,t??``].join(` `),dangerouslySetInnerHTML:{__html:n}})}function $a({open:e,promptName:t,title:n,args:r,sessionId:i,onClose:a}){let[o,s]=(0,R.useState)(!1),[c,l]=(0,R.useState)(null),[u,d]=(0,R.useState)(0),[f,p]=(0,R.useState)(null),[m,h]=(0,R.useState)(!1),g=B(),_=lr();if(Kn(e,a),(0,R.useEffect)(()=>{e||(s(!1),l(null),d(0),p(null),h(!1))},[e]),(0,R.useEffect)(()=>{if(!o||c===null)return;let e=setInterval(()=>d(Date.now()-c),250);return()=>clearInterval(e)},[o,c]),(0,R.useEffect)(()=>{!e||f||o||v()},[e]),!e)return null;let v=async()=>{s(!0),l(Date.now());try{let e=await W.runPrompt(t,r),n=to(e.stdout);p({success:e.success,stdout:n,stderrTail:e.stderrTail,model:e.model})}catch(e){p({success:!1,stdout:``,stderrTail:e instanceof Error?e.message:String(e),model:``})}finally{s(!1)}},y=async()=>{if(f)try{await navigator.clipboard.writeText(f.stdout),h(!0),setTimeout(()=>h(!1),1800)}catch(e){console.error(`copy failed`,e)}},b=async()=>{if(!(!f||!i))try{let e=`# ${n}\n_Generated ${new Date().toLocaleString()} via ${f.model}_\n\n`;await _.mutateAsync({sessionId:i,content:e+f.stdout}),g.invalidateQueries({queryKey:[`session`,i]}),G({message:`Saved as session note.`,tone:`success`})}catch(e){G({message:`Save failed: ${e instanceof Error?e.message:String(e)}`,tone:`error`})}};return(0,z.jsx)(`div`,{className:`fixed inset-0 z-40 bg-black/40 flex items-center justify-center`,children:(0,z.jsxs)(`div`,{className:`bg-bg border border-line rounded-lg w-[720px] max-w-[calc(100vw-2rem)] max-h-[calc(100vh-4rem)] flex flex-col shadow-xl`,children:[(0,z.jsxs)(`div`,{className:`px-5 py-4 border-b border-line flex items-center justify-between`,children:[(0,z.jsxs)(`div`,{children:[(0,z.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:n}),(0,z.jsxs)(`p`,{className:`text-fg-muted text-[11px] mt-0.5 font-mono`,children:[`prompt: `,t,f?.model&&(0,z.jsxs)(z.Fragment,{children:[` · model: `,f.model]})]})]}),(0,z.jsx)(`button`,{type:`button`,onClick:a,className:`text-fg-muted hover:text-fg text-lg leading-none`,children:`×`})]}),(0,z.jsxs)(`div`,{className:`flex-1 overflow-y-auto px-5 py-4`,children:[o&&(0,z.jsxs)(`div`,{className:`flex items-center gap-3 text-xs text-fg-muted`,children:[(0,z.jsx)(`span`,{className:`inline-block w-3 h-3 border-2 border-accent border-t-transparent rounded-full animate-spin`}),(0,z.jsxs)(`span`,{className:`font-mono tabular-nums`,children:[eo(u),` elapsed`]}),(0,z.jsx)(`span`,{children:`· running claude with the Recall MCP tools…`})]}),f&&(0,z.jsx)(z.Fragment,{children:f.success?f.stdout?(0,z.jsx)(Qa,{text:f.stdout}):(0,z.jsx)(`div`,{className:`text-xs italic text-fg-muted`,children:`(empty output)`}):(0,z.jsxs)(`div`,{className:`text-xs`,children:[(0,z.jsx)(`div`,{className:`text-role-user font-semibold mb-2`,children:`Run failed.`}),(0,z.jsx)(`div`,{className:`text-fg-muted mb-1`,children:`Tail of stderr:`}),(0,z.jsx)(`pre`,{className:`font-mono text-[11px] whitespace-pre-wrap overflow-auto max-h-64 bg-bg-elevated border border-line rounded p-2`,children:f.stderrTail||`(empty)`})]})})]}),(0,z.jsxs)(`div`,{className:`px-5 py-3 border-t border-line flex items-center justify-between gap-2`,children:[(0,z.jsx)(`div`,{className:`text-[11px] text-fg-muted`,children:o?`Typical: 20s–3min depending on model and session size.`:f?.success?`Output above is what the model returned verbatim.`:f?`Adjust the scope / model and retry, or check that Recall MCP is installed.`:``}),(0,z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[f?.success&&(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(`button`,{type:`button`,onClick:()=>void y(),className:`text-[11px] bg-accent/10 text-accent hover:bg-accent hover:text-bg border border-accent/40 rounded px-2 py-1`,children:m?`✓ copied`:`📋 copy`}),i&&(0,z.jsx)(`button`,{type:`button`,onClick:()=>void b(),disabled:_.isPending,className:`text-[11px] bg-accent/10 text-accent hover:bg-accent hover:text-bg border border-accent/40 rounded px-2 py-1 disabled:opacity-50`,children:`📝 save as note`})]}),f&&(0,z.jsx)(`button`,{type:`button`,onClick:()=>void v(),disabled:o,className:`text-[11px] text-fg-muted hover:text-fg px-2 py-1`,children:`↻ re-run`}),(0,z.jsx)(`button`,{type:`button`,onClick:a,className:`text-xs text-fg-muted hover:text-fg px-3 py-1`,children:`Close`})]})]})]})})}function eo(e){let t=Math.floor(e/1e3),n=Math.floor(t/60),r=t%60;return n===0?`${r}s`:`${n}m ${String(r).padStart(2,`0`)}s`}function to(e){if(!e)return``;try{let t=JSON.parse(e);if(t&&typeof t==`object`&&typeof t.result==`string`)return t.result}catch{}return e}function Z(){let[e,t]=(0,R.useState)(()=>new Set),[n,r]=(0,R.useState)(null),i=(0,R.useCallback)(t=>e.has(t),[e]),a=(0,R.useCallback)(()=>{t(new Set),r(null)},[]),o=(0,R.useCallback)((i,a,o)=>{let s=o.metaKey||o.ctrlKey;if(o.shiftKey&&n&&n!==i){let e=a.indexOf(n),r=a.indexOf(i);if(e>=0&&r>=0){let[n,i]=e<r?[e,r]:[r,e];return t(e=>{let t=new Set(e);for(let e=n;e<=i;e++){let n=a[e];n&&t.add(n)}return t}),!0}}return s?(t(e=>{let t=new Set(e);return t.has(i)?t.delete(i):t.add(i),t}),r(i),!0):(e.size>0&&t(new Set),r(i),!1)},[n,e]);return(0,R.useEffect)(()=>{let t=t=>{if(t.key!==`Escape`||e.size===0)return;let n=t.target;n&&(n.tagName===`INPUT`||n.tagName===`TEXTAREA`||n.isContentEditable)||a()};return window.addEventListener(`keydown`,t),()=>window.removeEventListener(`keydown`,t)},[e.size,a]),{selected:e,ids:(0,R.useMemo)(()=>Array.from(e),[e]),count:e.size,isSelected:i,handleRowClick:o,clear:a}}function no({projectName:e,collectionId:t,selectedSessionId:n,onSelect:r,searchQuery:i,searchScope:a,semanticMode:o}){let s=i.trim().length>1,c=!!t&&!s,l=a===`project`&&e?e:void 0,[u,d]=(0,R.useState)(``),[f,p]=(0,R.useState)(``),[m,h]=(0,R.useState)(!1),{isPinned:g,togglePin:_}=Fn(),[,v]=Pt(),y=Z(),b=Vn({storageKey:`claude-recall:sessions-pane`,defaultWidth:384,minWidth:260,maxWidth:680,collapsedWidth:40}),x=Lt(t),S=It(!1),C=Wt(),w=V({queryKey:[`sessions`,e??`all`,u,f,t??`none`],queryFn:()=>W.sessions({projectName:e??void 0,since:u||void 0,until:f||void 0,collectionId:t??void 0,limit:300}),enabled:!s,refetchInterval:4e3,refetchIntervalInBackground:!1,staleTime:0}),T=V({queryKey:[`search`,i,l??`global`,o?`semantic`:`fts`],queryFn:()=>W.search(i,60,l,o?`semantic`:void 0),enabled:s}),E=(()=>{let e=w.data;if(!e)return e;let t=[],n=[];for(let r of e)(g(r.id)?t:n).push(r);return[...t,...n]})(),D=E?E.map(e=>e.id):[],[O,k]=(0,R.useState)(null);if(b.collapsed)return(0,z.jsxs)(`section`,{className:`pane shrink-0 border-r border-line relative flex flex-col items-center`,style:{width:`${b.effectiveWidth}px`},children:[(0,z.jsx)(`button`,{type:`button`,onClick:b.toggleCollapsed,className:`w-full py-2 text-xs text-fg-muted hover:text-fg hover:bg-bg-hover border-b border-line`,title:`expand sessions pane (Cmd+\\\\)`,children:`»`}),(0,z.jsxs)(`div`,{className:`flex-1 w-full flex items-center justify-center px-1 text-[10px] text-fg-muted tracking-wider`,style:{writingMode:`vertical-rl`,transform:`rotate(180deg)`},children:[`Sessions`,E?` (${E.length})`:``]})]});if(s)return(0,z.jsxs)(`section`,{className:`pane shrink-0 relative`,style:{width:`${b.effectiveWidth}px`},children:[(0,z.jsxs)(`div`,{className:`pane-header`,children:[(0,z.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,z.jsx)(`button`,{type:`button`,onClick:b.toggleCollapsed,className:`text-fg-muted hover:text-fg text-xs normal-case tracking-normal`,title:`collapse sessions pane (Cmd+\\\\)`,children:`«`}),(0,z.jsx)(`span`,{children:l?`Results in ${l}`:`Results across all projects`})]}),T.data&&(0,z.jsx)(`span`,{children:T.data.hits.length})]}),(0,z.jsxs)(`div`,{className:`flex-1 overflow-y-auto`,children:[T.isFetching&&!T.data&&(0,z.jsx)(`div`,{className:`px-4 py-6 text-xs text-fg-muted`,children:`Searching…`}),T.isError&&(0,z.jsxs)(`div`,{className:`px-4 py-6 text-xs text-role-user`,children:[`Search failed: `,T.error.message]}),T.data?.hits.length===0&&(0,z.jsxs)(`div`,{className:`px-4 py-6 text-xs text-fg-muted`,children:[`No matches for "`,i,`"`,l?` in ${l}`:``,`.`]}),T.data?.hits.map((e,t)=>(0,z.jsx)(oo,{hit:e,active:e.session_id===n,onSelect:()=>r(e.session_id,e.message_uuid)},`${e.session_id}-${e.message_uuid??t}`))]}),(0,z.jsx)(ro,{onStart:e=>b.beginResize(e,b.width)})]});let A=x.data?.collection??null,ee=io(A,S.data?.collections??[]);return(0,z.jsxs)(`section`,{className:`pane shrink-0 relative`,style:{width:`${b.effectiveWidth}px`},children:[c&&A?(0,z.jsxs)(`div`,{className:`border-b border-line bg-bg-elevated`,children:[(0,z.jsxs)(`div`,{className:`flex items-center justify-between px-4 py-2 text-xs text-fg-muted normal-case tracking-normal`,children:[(0,z.jsx)(`div`,{className:`flex items-center gap-1 min-w-0`,children:ee.map((e,t)=>(0,z.jsxs)(`span`,{className:`inline-flex items-center gap-1 min-w-0`,children:[t>0&&(0,z.jsx)(`span`,{className:`text-fg-muted/60`,children:`›`}),(0,z.jsxs)(`button`,{type:`button`,onClick:()=>v({col:e.id,session:null,msg:null}),className:K(`truncate`,t===ee.length-1?`text-fg font-medium`:`hover:text-fg`),children:[e.icon??`📂`,` `,e.name]})]},e.id))}),(0,z.jsx)(`button`,{type:`button`,onClick:()=>v({col:null,session:null,msg:null}),className:`text-fg-muted hover:text-fg shrink-0`,title:`exit collection view`,children:`✕ clear`})]}),A.description&&(0,z.jsx)(`div`,{className:`px-4 pb-2 text-xs text-fg-muted italic`,children:A.description})]}):null,(0,z.jsxs)(`div`,{className:`pane-header`,children:[(0,z.jsxs)(`span`,{className:`flex items-center gap-2 min-w-0`,children:[(0,z.jsx)(`button`,{type:`button`,onClick:b.toggleCollapsed,className:`text-fg-muted hover:text-fg text-xs normal-case tracking-normal shrink-0`,title:`collapse sessions pane (Cmd+\\\\)`,children:`«`}),(0,z.jsx)(`span`,{className:`truncate`,children:c&&A?`${A.icon??`📂`} ${A.name}`:e||`All sessions`}),(0,z.jsx)(`button`,{type:`button`,onClick:()=>v({view:`help`,helpSection:`taxonomy`}),className:`text-[10px] font-normal normal-case tracking-normal text-fg-muted/70 hover:text-accent shrink-0`,title:`Session vs Project vs Collection vs Tag — what's the difference?`,children:`(?)`})]}),(0,z.jsxs)(`div`,{className:`flex items-center gap-3 normal-case tracking-normal`,children:[(0,z.jsx)($n,{projectName:e,collectionId:t}),(0,z.jsx)(`button`,{type:`button`,onClick:()=>h(e=>!e),className:K(`text-xs hover:text-fg`,m?`text-accent`:`text-fg-muted`),children:m?`hide dates`:`dates`}),E&&(0,z.jsx)(`span`,{className:`text-xs`,children:E.length})]})]}),m&&(0,z.jsxs)(`div`,{className:`flex items-center gap-2 px-4 py-2.5 border-b border-line bg-bg text-xs`,children:[(0,z.jsx)(`input`,{type:`date`,value:u,onChange:e=>d(e.target.value),className:`flex-1 bg-bg-elevated border border-line rounded px-2 py-1 text-fg`}),(0,z.jsx)(`span`,{className:`text-fg-muted`,children:`to`}),(0,z.jsx)(`input`,{type:`date`,value:f,onChange:e=>p(e.target.value),className:`flex-1 bg-bg-elevated border border-line rounded px-2 py-1 text-fg`}),(u||f)&&(0,z.jsx)(`button`,{type:`button`,onClick:()=>{d(``),p(``)},className:`text-fg-muted hover:text-fg`,title:`clear date filter`,children:`×`})]}),y.count>0&&(0,z.jsxs)(`div`,{className:`flex items-center justify-between gap-2 px-4 py-1.5 border-b border-line bg-accent/10 text-xs normal-case tracking-normal`,children:[(0,z.jsxs)(`span`,{className:`text-accent`,children:[y.count,` selected`,(0,z.jsx)(`span`,{className:`text-fg-muted ml-2`,children:`right-click for actions · esc to clear`})]}),(0,z.jsxs)(`div`,{className:`flex items-center gap-3 shrink-0`,children:[(0,z.jsx)(`button`,{type:`button`,className:`text-accent hover:text-fg`,onClick:()=>{navigator.clipboard.writeText(y.ids.join(`
|
|
75
|
-
`))},title:`copy selected session IDs (one per line)`,children:`copy IDs`}),(0,z.jsx)(`button`,{type:`button`,className:`text-fg-muted hover:text-fg`,onClick:y.clear,title:`clear selection (esc)`,children:`clear`})]})]}),(0,z.jsxs)(`div`,{className:`flex-1 overflow-y-auto`,children:[w.isLoading&&(0,z.jsx)(`div`,{className:`px-4 py-6 text-xs text-fg-muted`,children:`Loading sessions…`}),w.isError&&(0,z.jsxs)(`div`,{className:`px-4 py-6 text-xs text-role-user`,children:[`Failed to load: `,w.error.message]}),E?.length===0&&(0,z.jsx)(`div`,{className:`px-4 py-6 text-xs text-fg-muted`,children:`No sessions match the current filter.`}),E?.map(i=>(0,z.jsx)(ao,{session:i,active:i.id===n,onSelect:()=>r(i.id),showProject:!e,pinned:g(i.id),onTogglePin:()=>_(i.id),removableFrom:c&&t?t:null,onRemoveFromCollection:c&&t?async()=>{try{await C.mutateAsync({collectionId:t,sessionId:i.id})}catch(e){console.error(`remove from collection failed`,e)}}:void 0,selection:y,orderedIds:D,onMultiContext:(e,t)=>k({x:e,y:t})},i.id))]}),(0,z.jsx)(ro,{onStart:e=>b.beginResize(e,b.width)}),O&&y.count>1&&(0,z.jsx)(rr,{sessionIds:y.ids,x:O.x,y:O.y,onClose:()=>k(null),onClearSelection:y.clear})]})}function ro({onStart:e}){return(0,z.jsx)(`div`,{className:`absolute top-0 right-0 h-full w-2 cursor-col-resize group z-10`,onMouseDown:t=>{t.preventDefault(),e(t.clientX)},role:`separator`,"aria-orientation":`vertical`,title:`drag to resize sessions pane`,children:(0,z.jsx)(`div`,{className:`absolute top-0 right-0 h-full w-px bg-line group-hover:bg-accent transition-colors`})})}function io(e,t){if(!e)return[];let n=new Map;for(let e of t)n.set(e.id,e);n.has(e.id)||n.set(e.id,e);let r=[],i=n.get(e.id),a=new Set;for(;i&&!a.has(i.id);)a.add(i.id),r.unshift(i),i=i.parent_id?n.get(i.parent_id):void 0;return r}function ao({session:e,active:t,onSelect:n,showProject:r,pinned:i,onTogglePin:a,removableFrom:o,onRemoveFromCollection:s,selection:c,orderedIds:l,onMultiContext:u}){let[d,f]=(0,R.useState)(!1),[p,m]=(0,R.useState)(null),[h,g]=(0,R.useState)(!1),[_,v]=(0,R.useState)(null),[,y]=Pt(),b=V({queryKey:[`mcp-install-status`],queryFn:()=>W.getMcpInstallStatus(),staleTime:3e4}),x=!!(b.data?.installed&&b.data?.claudeCliAvailable),S=c.isSelected(e.id),C=t=>c.handleRowClick(e.id,l,{metaKey:t.metaKey,ctrlKey:t.ctrlKey,shiftKey:t.shiftKey})?(t.preventDefault(),t.stopPropagation(),!0):!1;return(0,z.jsxs)(`div`,{className:K(`list-item group !cursor-default`,t&&`list-item-active`,S&&`ring-2 ring-accent/60 ring-inset bg-accent/5`),draggable:!0,onContextMenu:e=>{if(e.preventDefault(),S&&c.count>1){u(e.clientX,e.clientY);return}m({x:e.clientX,y:e.clientY})},onDragStart:t=>{t.dataTransfer.effectAllowed=`copy`,t.dataTransfer.setData(fn,e.id),t.dataTransfer.setData(`text/plain`,`recall-session:${e.id}`)},title:`drag onto a collection in the left pane to add this session to it`,children:[(0,z.jsxs)(`div`,{className:`flex items-center justify-between gap-3 mb-1.5`,children:[(0,z.jsxs)(`div`,{className:`flex items-center gap-2 min-w-0`,children:[(0,z.jsx)(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),a()},className:K(`shrink-0 text-sm transition-colors`,i?`text-accent`:`text-fg-muted hover:text-fg opacity-60 hover:opacity-100`),title:i?`unpin`:`pin to top`,children:i?`★`:`☆`}),(0,z.jsx)(`button`,{type:`button`,onClick:e=>{C(e)||n()},className:`font-mono text-xs text-accent shrink-0 hover:underline cursor-pointer`,children:st(e.id)}),r&&(0,z.jsx)(`span`,{className:`badge bg-bg-active text-fg-dim shrink-0 truncate`,children:e.project})]}),(0,z.jsxs)(`div`,{className:`flex items-center gap-2 shrink-0`,children:[o&&s&&(0,z.jsx)(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),s()},className:`text-[10px] text-fg-muted hover:text-role-user opacity-0 group-hover:opacity-100 transition-opacity`,title:`remove from this collection (session itself is preserved)`,children:`remove`}),(0,z.jsxs)(`div`,{className:`text-xs text-right`,title:`started ${lt(e.started_at)}${e.ended_at&&e.ended_at!==e.started_at?`\nlast activity ${lt(e.ended_at)}`:``}`,children:[(0,z.jsx)(`div`,{className:e.ended_at?`text-accent`:`text-fg-muted`,children:lt(e.ended_at??e.started_at)}),e.ended_at&&e.started_at&&e.ended_at!==e.started_at&&(0,z.jsxs)(`div`,{className:`text-fg-muted text-[10px] mt-0.5`,children:[`started `,lt(e.started_at)]})]})]})]}),(0,z.jsxs)(`button`,{type:`button`,onClick:e=>{C(e)||n()},className:`text-left w-full cursor-pointer`,children:[(()=>{let t=e.alias_source===`auto`,n=e.auto_title&&e.auto_title_source===`agent`?e.auto_title:e.alias&&e.alias_source===`manual`?e.alias:e.auto_title?e.auto_title:e.alias??null,r=!!e.auto_title&&n===e.auto_title,i=r&&e.auto_title_source===`agent`,a=r?e.alias?`${e.auto_title_source??`heuristic`} title · overriding ${t?`auto-alias`:`manual alias`} "${e.alias}"`:`auto-generated title (${e.auto_title_source??`heuristic`})`:void 0,o=!!n,s=e.first_user_message;return(0,z.jsxs)(z.Fragment,{children:[o&&(0,z.jsxs)(`div`,{className:K(`text-sm font-semibold text-fg leading-snug mb-1`,i&&`flex items-center gap-1.5`),title:a,children:[i&&(0,z.jsx)(`span`,{className:`text-accent text-[11px]`,"aria-hidden":`true`,children:`✨`}),(0,z.jsx)(`span`,{className:`truncate`,children:n})]}),(0,z.jsx)(`div`,{className:K(`leading-snug`,o?`text-xs text-fg-muted line-clamp-1`:`text-sm text-fg/90 line-clamp-2`),children:ct(s,240)||(0,z.jsx)(`span`,{className:`italic text-fg-muted`,children:`(no user prompt captured)`})})]})})(),(0,z.jsxs)(`div`,{className:`flex items-center gap-3 mt-2 text-xs text-fg-muted`,children:[(0,z.jsxs)(`span`,{children:[e.message_count,` msgs`]}),e.git_branch&&(0,z.jsxs)(`span`,{className:`font-mono`,children:[`⎇ `,e.git_branch]}),e.origin&&(0,z.jsx)(`span`,{className:`text-xs bg-accent/10 text-accent px-1.5 py-0.5 rounded`,title:`started from ${e.origin.label} (v0.15 auto-detected)`,children:e.origin.label}),e.has_notes===1&&(0,z.jsx)(`span`,{className:`text-accent`,title:`this session has notes`,children:`📝`}),e.verification_status&&(0,z.jsx)(Hn,{status:e.verification_status})]})]}),(0,z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1 mt-2 normal-case tracking-normal`,onClick:e=>e.stopPropagation(),children:[e.tags?.slice(0,5).map(e=>(0,z.jsxs)(`span`,{className:`inline-flex items-center px-1.5 py-0.5 rounded-full bg-role-tool/15 text-role-tool text-[10px] font-medium`,children:[`#`,e]},e)),e.tags&&e.tags.length>5&&(0,z.jsxs)(`span`,{className:`text-[10px] text-fg-muted`,children:[`+`,e.tags.length-5]}),d?(0,z.jsx)(Wn,{sessionId:e.id,existingTags:e.tags??[],onDone:()=>f(!1),variant:`row`}):(0,z.jsx)(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),f(!0)},className:`inline-flex items-center px-1.5 py-0.5 rounded-full border border-dashed border-line/60 text-[10px] text-fg-muted opacity-0 group-hover:opacity-70 hover:!opacity-100 hover:text-fg transition-opacity`,title:`add tag`,children:`+ tag`})]}),p&&(0,z.jsx)(er,{sessionId:e.id,x:p.x,y:p.y,pinned:i,recallPromptsAvailable:x,onClose:()=>m(null),onTogglePin:a,onAddToCollection:()=>g(!0),onCompareWith:()=>y({session:e.id,compareWith:null}),onOpen:n,onRunPrompt:(e,t,n)=>v({name:e,title:t,args:n})}),h&&(0,z.jsx)(or,{sessionId:e.id,onClose:()=>g(!1),anchor:`center`}),_&&(0,z.jsx)($a,{open:!!_,promptName:_.name,title:_.title,args:_.args,sessionId:e.id,onClose:()=>v(null)})]})}function oo({hit:e,active:t,onSelect:n}){let r=e.snippet.replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`).replace(/<</g,`<mark>`).replace(/>>/g,`</mark>`);return(0,z.jsxs)(`button`,{type:`button`,onClick:n,draggable:!0,onDragStart:t=>{t.dataTransfer.effectAllowed=`copy`,t.dataTransfer.setData(fn,e.session_id),t.dataTransfer.setData(`text/plain`,`recall-session:${e.session_id}`)},title:`drag onto a collection in the left pane to add this session`,className:K(`list-item`,t&&`list-item-active`),children:[e.alias&&(0,z.jsx)(`div`,{className:`text-sm font-semibold text-fg leading-snug mb-1`,children:e.alias}),(0,z.jsxs)(`div`,{className:`flex items-center justify-between gap-3 mb-1.5`,children:[(0,z.jsxs)(`div`,{className:`flex items-center gap-2 min-w-0`,children:[(0,z.jsx)(`span`,{className:`font-mono text-xs text-accent shrink-0`,children:st(e.session_id)}),(0,z.jsx)(`span`,{className:`badge bg-bg-active text-fg-dim shrink-0 truncate`,children:e.project}),e.role&&(0,z.jsx)(`span`,{className:K(`badge shrink-0`,e.role===`user`&&`bg-role-user/15 text-role-user`,e.role===`assistant`&&`bg-role-assistant/15 text-role-assistant`,e.role===`system`&&`bg-role-system/15 text-fg-dim`),children:e.role}),e.matched_via===`semantic`&&(0,z.jsx)(`span`,{className:`badge shrink-0 bg-accent/20 text-accent`,title:`Matched via semantic summary (v0.11)`,children:`AI`})]}),(0,z.jsx)(`div`,{className:`text-xs text-fg-muted shrink-0`,children:lt(e.started_at)})]}),(0,z.jsx)(`div`,{className:`text-sm text-fg/90 leading-snug whitespace-pre-wrap [&_mark]:bg-accent/40 [&_mark]:text-fg [&_mark]:rounded [&_mark]:px-0.5`,dangerouslySetInnerHTML:{__html:r}})]})}var so=m();function co(e,t,n){let r=n.initialDeps??[],i,a=!0;function o(){let o;n.key&&n.debug?.call(n)&&(o=Date.now());let s=e();if(!(s.length!==r.length||s.some((e,t)=>r[t]!==e)))return i;r=s;let c;if(n.key&&n.debug?.call(n)&&(c=Date.now()),i=t(...s),n.key&&n.debug?.call(n)){let e=Math.round((Date.now()-o)*100)/100,t=Math.round((Date.now()-c)*100)/100,r=t/16,i=(e,t)=>{for(e=String(e);e.length<t;)e=` `+e;return e};console.info(`%c⏱ ${i(t,5)} /${i(e,5)} ms`,`
|
|
76
|
-
font-size: .6rem;
|
|
77
|
-
font-weight: bold;
|
|
78
|
-
color: hsl(${Math.max(0,Math.min(120-120*r,120))}deg 100% 31%);`,n?.key)}return n?.onChange&&!(a&&n.skipInitialOnChange)&&n.onChange(i),a=!1,i}return o.updateDeps=e=>{r=e},o}function lo(e,t){if(e===void 0)throw Error(`Unexpected undefined${t?`: ${t}`:``}`);return e}var uo=(e,t)=>Math.abs(e-t)<1.01,fo=(e,t,n)=>{let r;return function(...i){e.clearTimeout(r),r=e.setTimeout(()=>t.apply(this,i),n)}},po=e=>{let{offsetWidth:t,offsetHeight:n}=e;return{width:t,height:n}},mo=e=>e,ho=e=>{let t=Math.max(e.startIndex-e.overscan,0),n=Math.min(e.endIndex+e.overscan,e.count-1),r=[];for(let e=t;e<=n;e++)r.push(e);return r},go=(e,t)=>{let n=e.scrollElement;if(!n)return;let r=e.targetWindow;if(!r)return;let i=e=>{let{width:n,height:r}=e;t({width:Math.round(n),height:Math.round(r)})};if(i(po(n)),!r.ResizeObserver)return()=>{};let a=new r.ResizeObserver(t=>{let r=()=>{let e=t[0];if(e?.borderBoxSize){let t=e.borderBoxSize[0];if(t){i({width:t.inlineSize,height:t.blockSize});return}}i(po(n))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(r):r()});return a.observe(n,{box:`border-box`}),()=>{a.unobserve(n)}},_o={passive:!0},vo=typeof window>`u`?!0:`onscrollend`in window,yo=(e,t)=>{let n=e.scrollElement;if(!n)return;let r=e.targetWindow;if(!r)return;let i=0,a=e.options.useScrollendEvent&&vo?()=>void 0:fo(r,()=>{t(i,!1)},e.options.isScrollingResetDelay),o=r=>()=>{let{horizontal:o,isRtl:s}=e.options;i=o?n.scrollLeft*(s&&-1||1):n.scrollTop,a(),t(i,r)},s=o(!0),c=o(!1);n.addEventListener(`scroll`,s,_o);let l=e.options.useScrollendEvent&&vo;return l&&n.addEventListener(`scrollend`,c,_o),()=>{n.removeEventListener(`scroll`,s),l&&n.removeEventListener(`scrollend`,c)}},bo=(e,t,n)=>{if(t?.borderBoxSize){let e=t.borderBoxSize[0];if(e)return Math.round(e[n.options.horizontal?`inlineSize`:`blockSize`])}return e[n.options.horizontal?`offsetWidth`:`offsetHeight`]},xo=(e,{adjustments:t=0,behavior:n},r)=>{var i,a;let o=e+t;(a=(i=r.scrollElement)?.scrollTo)==null||a.call(i,{[r.options.horizontal?`left`:`top`]:o,behavior:n})},So=class{constructor(e){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this.itemSizeCache=new Map,this.laneAssignments=new Map,this.pendingMeasuredCacheIndexes=[],this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.now=()=>{var e;return((e=this.targetWindow?.performance)?.now)?.call(e)??Date.now()},this.observer=(()=>{let e=null,t=()=>e||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:e=new this.targetWindow.ResizeObserver(e=>{e.forEach(e=>{let t=()=>{let t=e.target,n=this.indexFromElement(t);if(!t.isConnected){this.observer.unobserve(t);return}this.shouldMeasureDuringScroll(n)&&this.resizeItem(n,this.options.measureElement(t,e,this))};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(t):t()})}));return{disconnect:()=>{var n;(n=t())==null||n.disconnect(),e=null},observe:e=>t()?.observe(e,{box:`border-box`}),unobserve:e=>t()?.unobserve(e)}})(),this.range=null,this.setOptions=e=>{Object.entries(e).forEach(([t,n])=>{n===void 0&&delete e[t]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:mo,rangeExtractor:ho,onChange:()=>{},measureElement:bo,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:`data-index`,initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,laneAssignmentMode:`estimate`,...e}},this.notify=e=>{var t,n;(n=(t=this.options).onChange)==null||n.call(t,this,e)},this.maybeNotify=co(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),e=>{this.notify(e)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(e=>e()),this.unsubs=[],this.observer.disconnect(),this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{let e=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==e){if(this.cleanup(),!e){this.maybeNotify();return}this.scrollElement=e,this.scrollElement&&`ownerDocument`in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=this.scrollElement?.window??null,this.elementsCache.forEach(e=>{this.observer.observe(e)}),this.unsubs.push(this.options.observeElementRect(this,e=>{this.scrollRect=e,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(e,t)=>{this.scrollAdjustments=0,this.scrollDirection=t?this.getScrollOffset()<e?`forward`:`backward`:null,this.scrollOffset=e,this.isScrolling=t,this.scrollState&&this.scheduleScrollReconcile(),this.maybeNotify()})),this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}},this.rafId=null,this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?`width`:`height`]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset==`function`?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(e,t)=>{let n=new Map,r=new Map;for(let i=t-1;i>=0;i--){let t=e[i];if(n.has(t.lane))continue;let a=r.get(t.lane);if(a==null||t.end>a.end?r.set(t.lane,t):t.end<a.end&&n.set(t.lane,!0),n.size===this.options.lanes)break}return r.size===this.options.lanes?Array.from(r.values()).sort((e,t)=>e.end===t.end?e.index-t.index:e.end-t.end)[0]:void 0},this.getMeasurementOptions=co(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes,this.options.laneAssignmentMode],(e,t,n,r,i,a,o)=>(this.prevLanes!==void 0&&this.prevLanes!==a&&(this.lanesChangedFlag=!0),this.prevLanes=a,this.pendingMeasuredCacheIndexes=[],{count:e,paddingStart:t,scrollMargin:n,getItemKey:r,enabled:i,lanes:a,laneAssignmentMode:o}),{key:!1}),this.getMeasurements=co(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:e,paddingStart:t,scrollMargin:n,getItemKey:r,enabled:i,lanes:a,laneAssignmentMode:o},s)=>{if(!i)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>e)for(let t of this.laneAssignments.keys())t>=e&&this.laneAssignments.delete(t);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMeasuredCacheIndexes=[]),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(e=>{this.itemSizeCache.set(e.key,e.size)}));let c=this.lanesSettling?0:this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[],this.lanesSettling&&this.measurementsCache.length===e&&(this.lanesSettling=!1);let l=this.measurementsCache.slice(0,c),u=Array(a).fill(void 0);for(let e=0;e<c;e++){let t=l[e];t&&(u[t.lane]=e)}for(let i=c;i<e;i++){let e=r(i),a=this.laneAssignments.get(i),c,d,f=o===`estimate`||s.has(e);if(a!==void 0&&this.options.lanes>1){c=a;let e=u[c],r=e===void 0?void 0:l[e];d=r?r.end+this.options.gap:t+n}else{let e=this.options.lanes===1?l[i-1]:this.getFurthestMeasurement(l,i);d=e?e.end+this.options.gap:t+n,c=e?e.lane:i%this.options.lanes,this.options.lanes>1&&f&&this.laneAssignments.set(i,c)}let p=s.get(e),m=typeof p==`number`?p:this.options.estimateSize(i),h=d+m;l[i]={index:i,start:d,size:m,end:h,key:e,lane:c},u[c]=i}return this.measurementsCache=l,l},{key:!1,debug:()=>this.options.debug}),this.calculateRange=co(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(e,t,n,r)=>this.range=e.length>0&&t>0?wo({measurements:e,outerSize:t,scrollOffset:n,lanes:r}):null,{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=co(()=>{let e=null,t=null,n=this.calculateRange();return n&&(e=n.startIndex,t=n.endIndex),this.maybeNotify.updateDeps([this.isScrolling,e,t]),[this.options.rangeExtractor,this.options.overscan,this.options.count,e,t]},(e,t,n,r,i)=>r===null||i===null?[]:e({startIndex:r,endIndex:i,overscan:t,count:n}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=e=>{let t=this.options.indexAttribute,n=e.getAttribute(t);return n?parseInt(n,10):(console.warn(`Missing attribute name '${t}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=e=>{if(!this.scrollState||this.scrollState.behavior!==`smooth`)return!0;let t=this.scrollState.index??this.getVirtualItemForOffset(this.scrollState.lastTargetOffset)?.index;if(t!==void 0&&this.range){let n=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),r=Math.max(0,t-n),i=Math.min(this.options.count-1,t+n);return e>=r&&e<=i}return!0},this.measureElement=e=>{if(!e){this.elementsCache.forEach((e,t)=>{e.isConnected||(this.observer.unobserve(e),this.elementsCache.delete(t))});return}let t=this.indexFromElement(e),n=this.options.getItemKey(t),r=this.elementsCache.get(n);r!==e&&(r&&this.observer.unobserve(r),this.observer.observe(e),this.elementsCache.set(n,e)),(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(t)&&this.resizeItem(t,this.options.measureElement(e,void 0,this))},this.resizeItem=(e,t)=>{let n=this.measurementsCache[e];if(!n)return;let r=t-(this.itemSizeCache.get(n.key)??n.size);r!==0&&(this.scrollState?.behavior!==`smooth`&&(this.shouldAdjustScrollPositionOnItemSizeChange===void 0?n.start<this.getScrollOffset()+this.scrollAdjustments:this.shouldAdjustScrollPositionOnItemSizeChange(n,r,this))&&this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=r,behavior:void 0}),this.pendingMeasuredCacheIndexes.push(n.index),this.itemSizeCache=new Map(this.itemSizeCache.set(n.key,t)),this.notify(!1))},this.getVirtualItems=co(()=>[this.getVirtualIndexes(),this.getMeasurements()],(e,t)=>{let n=[];for(let r=0,i=e.length;r<i;r++){let i=t[e[r]];n.push(i)}return n},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=e=>{let t=this.getMeasurements();if(t.length!==0)return lo(t[Co(0,t.length-1,e=>lo(t[e]).start,e)])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if(`scrollHeight`in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{let e=this.scrollElement.document.documentElement;return this.options.horizontal?e.scrollWidth-this.scrollElement.innerWidth:e.scrollHeight-this.scrollElement.innerHeight}},this.getOffsetForAlignment=(e,t,n=0)=>{if(!this.scrollElement)return 0;let r=this.getSize(),i=this.getScrollOffset();t===`auto`&&(t=e>=i+r?`end`:`start`),t===`center`?e+=(n-r)/2:t===`end`&&(e-=r);let a=this.getMaxScrollOffset();return Math.max(Math.min(a,e),0)},this.getOffsetForIndex=(e,t=`auto`)=>{e=Math.max(0,Math.min(e,this.options.count-1));let n=this.getSize(),r=this.getScrollOffset(),i=this.measurementsCache[e];if(!i)return;if(t===`auto`)if(i.end>=r+n-this.options.scrollPaddingEnd)t=`end`;else if(i.start<=r+this.options.scrollPaddingStart)t=`start`;else return[r,t];if(t===`end`&&e===this.options.count-1)return[this.getMaxScrollOffset(),t];let a=t===`end`?i.end+this.options.scrollPaddingEnd:i.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(a,t,i.size),t]},this.scrollToOffset=(e,{align:t=`start`,behavior:n=`auto`}={})=>{let r=this.getOffsetForAlignment(e,t),i=this.now();this.scrollState={index:null,align:t,behavior:n,startedAt:i,lastTargetOffset:r,stableFrames:0},this._scrollToOffset(r,{adjustments:void 0,behavior:n}),this.scheduleScrollReconcile()},this.scrollToIndex=(e,{align:t=`auto`,behavior:n=`auto`}={})=>{e=Math.max(0,Math.min(e,this.options.count-1));let r=this.getOffsetForIndex(e,t);if(!r)return;let[i,a]=r,o=this.now();this.scrollState={index:e,align:a,behavior:n,startedAt:o,lastTargetOffset:i,stableFrames:0},this._scrollToOffset(i,{adjustments:void 0,behavior:n}),this.scheduleScrollReconcile()},this.scrollBy=(e,{behavior:t=`auto`}={})=>{let n=this.getScrollOffset()+e,r=this.now();this.scrollState={index:null,align:`start`,behavior:t,startedAt:r,lastTargetOffset:n,stableFrames:0},this._scrollToOffset(n,{adjustments:void 0,behavior:t}),this.scheduleScrollReconcile()},this.getTotalSize=()=>{let e=this.getMeasurements(),t;if(e.length===0)t=this.options.paddingStart;else if(this.options.lanes===1)t=e[e.length-1]?.end??0;else{let n=Array(this.options.lanes).fill(null),r=e.length-1;for(;r>=0&&n.some(e=>e===null);){let t=e[r];n[t.lane]===null&&(n[t.lane]=t.end),r--}t=Math.max(...n.filter(e=>e!==null))}return Math.max(t-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(e,{adjustments:t,behavior:n})=>{this.options.scrollToFn(e,{behavior:n,adjustments:t},this)},this.measure=()=>{this.itemSizeCache=new Map,this.laneAssignments=new Map,this.notify(!1)},this.setOptions(e)}scheduleScrollReconcile(){if(!this.targetWindow){this.scrollState=null;return}this.rafId??=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()})}reconcileScroll(){if(!this.scrollState||!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3){this.scrollState=null;return}let e=this.scrollState.index==null?void 0:this.getOffsetForIndex(this.scrollState.index,this.scrollState.align),t=e?e[0]:this.scrollState.lastTargetOffset,n=t!==this.scrollState.lastTargetOffset;if(!n&&uo(t,this.getScrollOffset())){if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=1){this.scrollState=null;return}}else this.scrollState.stableFrames=0,n&&(this.scrollState.lastTargetOffset=t,this.scrollState.behavior=`auto`,this._scrollToOffset(t,{adjustments:void 0,behavior:`auto`}));this.scheduleScrollReconcile()}},Co=(e,t,n,r)=>{for(;e<=t;){let i=(e+t)/2|0,a=n(i);if(a<r)e=i+1;else if(a>r)t=i-1;else return i}return e>0?e-1:0};function wo({measurements:e,outerSize:t,scrollOffset:n,lanes:r}){let i=e.length-1,a=t=>e[t].start;if(e.length<=r)return{startIndex:0,endIndex:i};let o=Co(0,i,a,n),s=o;if(r===1)for(;s<i&&e[s].end<n+t;)s++;else if(r>1){let a=Array(r).fill(0);for(;s<i&&a.some(e=>e<n+t);){let t=e[s];a[t.lane]=t.end,s++}let c=Array(r).fill(n+t);for(;o>=0&&c.some(e=>e>=n);){let t=e[o];c[t.lane]=t.start,o--}o=Math.max(0,o-o%r),s=Math.min(i,s+(r-1-s%r))}return{startIndex:o,endIndex:s}}var To=typeof document<`u`?R.useLayoutEffect:R.useEffect;function Eo({useFlushSync:e=!0,...t}){let n=R.useReducer(()=>({}),{})[1],r={...t,onChange:(r,i)=>{var a;e&&i?(0,so.flushSync)(n):n(),(a=t.onChange)==null||a.call(t,r,i)}},[i]=R.useState(()=>new So(r));return i.setOptions(r),To(()=>i._didMount(),[]),To(()=>i._willUpdate()),i}function Do(e){return Eo({observeElementRect:go,observeElementOffset:yo,scrollToFn:xo,...e})}var Oo=o(((e,t)=>{function n(e){return e instanceof Map?e.clear=e.delete=e.set=function(){throw Error(`map is read-only`)}:e instanceof Set&&(e.add=e.clear=e.delete=function(){throw Error(`set is read-only`)}),Object.freeze(e),Object.getOwnPropertyNames(e).forEach(t=>{let r=e[t],i=typeof r;(i===`object`||i===`function`)&&!Object.isFrozen(r)&&n(r)}),e}var r=class{constructor(e){e.data===void 0&&(e.data={}),this.data=e.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}};function i(e){return e.replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`).replace(/"/g,`"`).replace(/'/g,`'`)}function a(e,...t){let n=Object.create(null);for(let t in e)n[t]=e[t];return t.forEach(function(e){for(let t in e)n[t]=e[t]}),n}var o=`</span>`,s=e=>!!e.scope,c=(e,{prefix:t})=>{if(e.startsWith(`language:`))return e.replace(`language:`,`language-`);if(e.includes(`.`)){let n=e.split(`.`);return[`${t}${n.shift()}`,...n.map((e,t)=>`${e}${`_`.repeat(t+1)}`)].join(` `)}return`${t}${e}`},l=class{constructor(e,t){this.buffer=``,this.classPrefix=t.classPrefix,e.walk(this)}addText(e){this.buffer+=i(e)}openNode(e){if(!s(e))return;let t=c(e.scope,{prefix:this.classPrefix});this.span(t)}closeNode(e){s(e)&&(this.buffer+=o)}value(){return this.buffer}span(e){this.buffer+=`<span class="${e}">`}},u=(e={})=>{let t={children:[]};return Object.assign(t,e),t},d=class e{constructor(){this.rootNode=u(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(e){this.top.children.push(e)}openNode(e){let t=u({scope:e});this.add(t),this.stack.push(t)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(e){return this.constructor._walk(e,this.rootNode)}static _walk(e,t){return typeof t==`string`?e.addText(t):t.children&&(e.openNode(t),t.children.forEach(t=>this._walk(e,t)),e.closeNode(t)),e}static _collapse(t){typeof t!=`string`&&t.children&&(t.children.every(e=>typeof e==`string`)?t.children=[t.children.join(``)]:t.children.forEach(t=>{e._collapse(t)}))}},f=class extends d{constructor(e){super(),this.options=e}addText(e){e!==``&&this.add(e)}startScope(e){this.openNode(e)}endScope(){this.closeNode()}__addSublanguage(e,t){let n=e.root;t&&(n.scope=`language:${t}`),this.add(n)}toHTML(){return new l(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}};function p(e){return e?typeof e==`string`?e:e.source:null}function m(e){return _(`(?=`,e,`)`)}function h(e){return _(`(?:`,e,`)*`)}function g(e){return _(`(?:`,e,`)?`)}function _(...e){return e.map(e=>p(e)).join(``)}function v(e){let t=e[e.length-1];return typeof t==`object`&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function y(...e){return`(`+(v(e).capture?``:`?:`)+e.map(e=>p(e)).join(`|`)+`)`}function b(e){return RegExp(e.toString()+`|`).exec(``).length-1}function x(e,t){let n=e&&e.exec(t);return n&&n.index===0}var S=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function C(e,{joinWith:t}){let n=0;return e.map(e=>{n+=1;let t=n,r=p(e),i=``;for(;r.length>0;){let e=S.exec(r);if(!e){i+=r;break}i+=r.substring(0,e.index),r=r.substring(e.index+e[0].length),e[0][0]===`\\`&&e[1]?i+=`\\`+String(Number(e[1])+t):(i+=e[0],e[0]===`(`&&n++)}return i}).map(e=>`(${e})`).join(t)}var w=/\b\B/,T=`[a-zA-Z]\\w*`,E=`[a-zA-Z_]\\w*`,D=`\\b\\d+(\\.\\d+)?`,O=`(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)`,k=`\\b(0b[01]+)`,A=`!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~`,ee=(e={})=>{let t=/^#![ ]*\//;return e.binary&&(e.begin=_(t,/.*\b/,e.binary,/\b.*/)),a({scope:`meta`,begin:t,end:/$/,relevance:0,"on:begin":(e,t)=>{e.index!==0&&t.ignoreMatch()}},e)},j={begin:`\\\\[\\s\\S]`,relevance:0},te={scope:`string`,begin:`'`,end:`'`,illegal:`\\n`,contains:[j]},M={scope:`string`,begin:`"`,end:`"`,illegal:`\\n`,contains:[j]},ne={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},N=function(e,t,n={}){let r=a({scope:`comment`,begin:e,end:t,contains:[]},n);r.contains.push({scope:`doctag`,begin:`[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)`,end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});let i=y(`I`,`a`,`is`,`so`,`us`,`to`,`at`,`if`,`in`,`it`,`on`,/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return r.contains.push({begin:_(/[ ]+/,`(`,i,/[.]?[:]?([.][ ]|[ ])/,`){3}`)}),r},P=N(`//`,`$`),re=N(`/\\*`,`\\*/`),F=N(`#`,`$`),ie={scope:`number`,begin:D,relevance:0},I={scope:`number`,begin:O,relevance:0},ae={scope:`number`,begin:k,relevance:0},L={scope:`regexp`,begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[j,{begin:/\[/,end:/\]/,relevance:0,contains:[j]}]},oe={scope:`title`,begin:T,relevance:0},se={scope:`title`,begin:E,relevance:0},ce={begin:`\\.\\s*`+E,relevance:0},le=Object.freeze({__proto__:null,APOS_STRING_MODE:te,BACKSLASH_ESCAPE:j,BINARY_NUMBER_MODE:ae,BINARY_NUMBER_RE:k,COMMENT:N,C_BLOCK_COMMENT_MODE:re,C_LINE_COMMENT_MODE:P,C_NUMBER_MODE:I,C_NUMBER_RE:O,END_SAME_AS_BEGIN:function(e){return Object.assign(e,{"on:begin":(e,t)=>{t.data._beginMatch=e[1]},"on:end":(e,t)=>{t.data._beginMatch!==e[1]&&t.ignoreMatch()}})},HASH_COMMENT_MODE:F,IDENT_RE:T,MATCH_NOTHING_RE:w,METHOD_GUARD:ce,NUMBER_MODE:ie,NUMBER_RE:D,PHRASAL_WORDS_MODE:ne,QUOTE_STRING_MODE:M,REGEXP_MODE:L,RE_STARTERS_RE:A,SHEBANG:ee,TITLE_MODE:oe,UNDERSCORE_IDENT_RE:E,UNDERSCORE_TITLE_MODE:se});function ue(e,t){e.input[e.index-1]===`.`&&t.ignoreMatch()}function de(e,t){e.className!==void 0&&(e.scope=e.className,delete e.className)}function fe(e,t){t&&e.beginKeywords&&(e.begin=`\\b(`+e.beginKeywords.split(` `).join(`|`)+`)(?!\\.)(?=\\b|\\s)`,e.__beforeBegin=ue,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,e.relevance===void 0&&(e.relevance=0))}function pe(e,t){Array.isArray(e.illegal)&&(e.illegal=y(...e.illegal))}function me(e,t){if(e.match){if(e.begin||e.end)throw Error(`begin & end are not supported with match`);e.begin=e.match,delete e.match}}function he(e,t){e.relevance===void 0&&(e.relevance=1)}var ge=(e,t)=>{if(!e.beforeMatch)return;if(e.starts)throw Error(`beforeMatch cannot be used with starts`);let n=Object.assign({},e);Object.keys(e).forEach(t=>{delete e[t]}),e.keywords=n.keywords,e.begin=_(n.beforeMatch,m(n.begin)),e.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},e.relevance=0,delete n.beforeMatch},_e=[`of`,`and`,`for`,`in`,`not`,`or`,`if`,`then`,`parent`,`list`,`value`],ve=`keyword`;function ye(e,t,n=ve){let r=Object.create(null);return typeof e==`string`?i(n,e.split(` `)):Array.isArray(e)?i(n,e):Object.keys(e).forEach(function(n){Object.assign(r,ye(e[n],t,n))}),r;function i(e,n){t&&(n=n.map(e=>e.toLowerCase())),n.forEach(function(t){let n=t.split(`|`);r[n[0]]=[e,be(n[0],n[1])]})}}function be(e,t){return t?Number(t):+!xe(e)}function xe(e){return _e.includes(e.toLowerCase())}var Se={},Ce=e=>{console.error(e)},we=(e,...t)=>{console.log(`WARN: ${e}`,...t)},Te=(e,t)=>{Se[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),Se[`${e}/${t}`]=!0)},Ee=Error();function De(e,t,{key:n}){let r=0,i=e[n],a={},o={};for(let e=1;e<=t.length;e++)o[e+r]=i[e],a[e+r]=!0,r+=b(t[e-1]);e[n]=o,e[n]._emit=a,e[n]._multi=!0}function Oe(e){if(Array.isArray(e.begin)){if(e.skip||e.excludeBegin||e.returnBegin)throw Ce(`skip, excludeBegin, returnBegin not compatible with beginScope: {}`),Ee;if(typeof e.beginScope!=`object`||e.beginScope===null)throw Ce(`beginScope must be object`),Ee;De(e,e.begin,{key:`beginScope`}),e.begin=C(e.begin,{joinWith:``})}}function ke(e){if(Array.isArray(e.end)){if(e.skip||e.excludeEnd||e.returnEnd)throw Ce(`skip, excludeEnd, returnEnd not compatible with endScope: {}`),Ee;if(typeof e.endScope!=`object`||e.endScope===null)throw Ce(`endScope must be object`),Ee;De(e,e.end,{key:`endScope`}),e.end=C(e.end,{joinWith:``})}}function Ae(e){e.scope&&typeof e.scope==`object`&&e.scope!==null&&(e.beginScope=e.scope,delete e.scope)}function je(e){Ae(e),typeof e.beginScope==`string`&&(e.beginScope={_wrap:e.beginScope}),typeof e.endScope==`string`&&(e.endScope={_wrap:e.endScope}),Oe(e),ke(e)}function Me(e){function t(t,n){return new RegExp(p(t),`m`+(e.case_insensitive?`i`:``)+(e.unicodeRegex?`u`:``)+(n?`g`:``))}class n{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(e,t){t.position=this.position++,this.matchIndexes[this.matchAt]=t,this.regexes.push([t,e]),this.matchAt+=b(e)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);let e=this.regexes.map(e=>e[1]);this.matcherRe=t(C(e,{joinWith:`|`}),!0),this.lastIndex=0}exec(e){this.matcherRe.lastIndex=this.lastIndex;let t=this.matcherRe.exec(e);if(!t)return null;let n=t.findIndex((e,t)=>t>0&&e!==void 0),r=this.matchIndexes[n];return t.splice(0,n),Object.assign(t,r)}}class r{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(e){if(this.multiRegexes[e])return this.multiRegexes[e];let t=new n;return this.rules.slice(e).forEach(([e,n])=>t.addRule(e,n)),t.compile(),this.multiRegexes[e]=t,t}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(e,t){this.rules.push([e,t]),t.type===`begin`&&this.count++}exec(e){let t=this.getMatcher(this.regexIndex);t.lastIndex=this.lastIndex;let n=t.exec(e);if(this.resumingScanAtSamePosition()&&!(n&&n.index===this.lastIndex)){let t=this.getMatcher(0);t.lastIndex=this.lastIndex+1,n=t.exec(e)}return n&&(this.regexIndex+=n.position+1,this.regexIndex===this.count&&this.considerAll()),n}}function i(e){let t=new r;return e.contains.forEach(e=>t.addRule(e.begin,{rule:e,type:`begin`})),e.terminatorEnd&&t.addRule(e.terminatorEnd,{type:`end`}),e.illegal&&t.addRule(e.illegal,{type:`illegal`}),t}function o(n,r){let a=n;if(n.isCompiled)return a;[de,me,je,ge].forEach(e=>e(n,r)),e.compilerExtensions.forEach(e=>e(n,r)),n.__beforeBegin=null,[fe,pe,he].forEach(e=>e(n,r)),n.isCompiled=!0;let s=null;return typeof n.keywords==`object`&&n.keywords.$pattern&&(n.keywords=Object.assign({},n.keywords),s=n.keywords.$pattern,delete n.keywords.$pattern),s||=/\w+/,n.keywords&&=ye(n.keywords,e.case_insensitive),a.keywordPatternRe=t(s,!0),r&&(n.begin||=/\B|\b/,a.beginRe=t(a.begin),!n.end&&!n.endsWithParent&&(n.end=/\B|\b/),n.end&&(a.endRe=t(a.end)),a.terminatorEnd=p(a.end)||``,n.endsWithParent&&r.terminatorEnd&&(a.terminatorEnd+=(n.end?`|`:``)+r.terminatorEnd)),n.illegal&&(a.illegalRe=t(n.illegal)),n.contains||=[],n.contains=[].concat(...n.contains.map(function(e){return Pe(e===`self`?n:e)})),n.contains.forEach(function(e){o(e,a)}),n.starts&&o(n.starts,r),a.matcher=i(a),a}if(e.compilerExtensions||=[],e.contains&&e.contains.includes(`self`))throw Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return e.classNameAliases=a(e.classNameAliases||{}),o(e)}function Ne(e){return e?e.endsWithParent||Ne(e.starts):!1}function Pe(e){return e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map(function(t){return a(e,{variants:null},t)})),e.cachedVariants?e.cachedVariants:Ne(e)?a(e,{starts:e.starts?a(e.starts):null}):Object.isFrozen(e)?a(e):e}var Fe=`11.11.1`,Ie=class extends Error{constructor(e,t){super(e),this.name=`HTMLInjectionError`,this.html=t}},Le=i,Re=a,ze=Symbol(`nomatch`),Be=7,Ve=function(e){let t=Object.create(null),i=Object.create(null),a=[],o=!0,s=`Could not find the language '{}', did you forget to load/include a language module?`,c={disableAutodetect:!0,name:`Plain text`,contains:[]},l={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:`hljs-`,cssSelector:`pre code`,languages:null,__emitter:f};function u(e){return l.noHighlightRe.test(e)}function d(e){let t=e.className+` `;t+=e.parentNode?e.parentNode.className:``;let n=l.languageDetectRe.exec(t);if(n){let t=te(n[1]);return t||(we(s.replace(`{}`,n[1])),we(`Falling back to no-highlight mode for this block.`,e)),t?n[1]:`no-highlight`}return t.split(/\s+/).find(e=>u(e)||te(e))}function p(e,t,n){let r=``,i=``;typeof t==`object`?(r=e,n=t.ignoreIllegals,i=t.language):(Te(`10.7.0`,`highlight(lang, code, ...args) has been deprecated.`),Te(`10.7.0`,`Please use highlight(code, options) instead.
|
|
79
|
-
https://github.com/highlightjs/highlight.js/issues/2277`),i=e,r=t),n===void 0&&(n=!0);let a={code:r,language:i};F(`before:highlight`,a);let o=a.result?a.result:v(a.language,a.code,n);return o.code=a.code,F(`after:highlight`,o),o}function v(e,n,i,a){let c=Object.create(null);function u(e,t){return e.keywords[t]}function d(){if(!A.keywords){j.addText(M);return}let e=0;A.keywordPatternRe.lastIndex=0;let t=A.keywordPatternRe.exec(M),n=``;for(;t;){n+=M.substring(e,t.index);let r=D.case_insensitive?t[0].toLowerCase():t[0],i=u(A,r);if(i){let[e,a]=i;if(j.addText(n),n=``,c[r]=(c[r]||0)+1,c[r]<=Be&&(ne+=a),e.startsWith(`_`))n+=t[0];else{let n=D.classNameAliases[e]||e;m(t[0],n)}}else n+=t[0];e=A.keywordPatternRe.lastIndex,t=A.keywordPatternRe.exec(M)}n+=M.substring(e),j.addText(n)}function f(){if(M===``)return;let e=null;if(typeof A.subLanguage==`string`){if(!t[A.subLanguage]){j.addText(M);return}e=v(A.subLanguage,M,!0,ee[A.subLanguage]),ee[A.subLanguage]=e._top}else e=S(M,A.subLanguage.length?A.subLanguage:null);A.relevance>0&&(ne+=e.relevance),j.__addSublanguage(e._emitter,e.language)}function p(){A.subLanguage==null?d():f(),M=``}function m(e,t){e!==``&&(j.startScope(t),j.addText(e),j.endScope())}function h(e,t){let n=1,r=t.length-1;for(;n<=r;){if(!e._emit[n]){n++;continue}let r=D.classNameAliases[e[n]]||e[n],i=t[n];r?m(i,r):(M=i,d(),M=``),n++}}function g(e,t){return e.scope&&typeof e.scope==`string`&&j.openNode(D.classNameAliases[e.scope]||e.scope),e.beginScope&&(e.beginScope._wrap?(m(M,D.classNameAliases[e.beginScope._wrap]||e.beginScope._wrap),M=``):e.beginScope._multi&&(h(e.beginScope,t),M=``)),A=Object.create(e,{parent:{value:A}}),A}function _(e,t,n){let i=x(e.endRe,n);if(i){if(e[`on:end`]){let n=new r(e);e[`on:end`](t,n),n.isMatchIgnored&&(i=!1)}if(i){for(;e.endsParent&&e.parent;)e=e.parent;return e}}if(e.endsWithParent)return _(e.parent,t,n)}function y(e){return A.matcher.regexIndex===0?(M+=e[0],1):(re=!0,0)}function b(e){let t=e[0],n=e.rule,i=new r(n),a=[n.__beforeBegin,n[`on:begin`]];for(let n of a)if(n&&(n(e,i),i.isMatchIgnored))return y(t);return n.skip?M+=t:(n.excludeBegin&&(M+=t),p(),!n.returnBegin&&!n.excludeBegin&&(M=t)),g(n,e),n.returnBegin?0:t.length}function C(e){let t=e[0],r=n.substring(e.index),i=_(A,e,r);if(!i)return ze;let a=A;A.endScope&&A.endScope._wrap?(p(),m(t,A.endScope._wrap)):A.endScope&&A.endScope._multi?(p(),h(A.endScope,e)):a.skip?M+=t:(a.returnEnd||a.excludeEnd||(M+=t),p(),a.excludeEnd&&(M=t));do A.scope&&j.closeNode(),!A.skip&&!A.subLanguage&&(ne+=A.relevance),A=A.parent;while(A!==i.parent);return i.starts&&g(i.starts,e),a.returnEnd?0:t.length}function w(){let e=[];for(let t=A;t!==D;t=t.parent)t.scope&&e.unshift(t.scope);e.forEach(e=>j.openNode(e))}let T={};function E(t,r){let a=r&&r[0];if(M+=t,a==null)return p(),0;if(T.type===`begin`&&r.type===`end`&&T.index===r.index&&a===``){if(M+=n.slice(r.index,r.index+1),!o){let t=Error(`0 width match regex (${e})`);throw t.languageName=e,t.badRule=T.rule,t}return 1}if(T=r,r.type===`begin`)return b(r);if(r.type===`illegal`&&!i){let e=Error(`Illegal lexeme "`+a+`" for mode "`+(A.scope||`<unnamed>`)+`"`);throw e.mode=A,e}else if(r.type===`end`){let e=C(r);if(e!==ze)return e}if(r.type===`illegal`&&a===``)return M+=`
|
|
80
|
-
`,1;if(P>1e5&&P>r.index*3)throw Error(`potential infinite loop, way more iterations than matches`);return M+=a,a.length}let D=te(e);if(!D)throw Ce(s.replace(`{}`,e)),Error(`Unknown language: "`+e+`"`);let O=Me(D),k=``,A=a||O,ee={},j=new l.__emitter(l);w();let M=``,ne=0,N=0,P=0,re=!1;try{if(D.__emitTokens)D.__emitTokens(n,j);else{for(A.matcher.considerAll();;){P++,re?re=!1:A.matcher.considerAll(),A.matcher.lastIndex=N;let e=A.matcher.exec(n);if(!e)break;let t=E(n.substring(N,e.index),e);N=e.index+t}E(n.substring(N))}return j.finalize(),k=j.toHTML(),{language:e,value:k,relevance:ne,illegal:!1,_emitter:j,_top:A}}catch(t){if(t.message&&t.message.includes(`Illegal`))return{language:e,value:Le(n),illegal:!0,relevance:0,_illegalBy:{message:t.message,index:N,context:n.slice(N-100,N+100),mode:t.mode,resultSoFar:k},_emitter:j};if(o)return{language:e,value:Le(n),illegal:!1,relevance:0,errorRaised:t,_emitter:j,_top:A};throw t}}function b(e){let t={value:Le(e),illegal:!1,relevance:0,_top:c,_emitter:new l.__emitter(l)};return t._emitter.addText(e),t}function S(e,n){n=n||l.languages||Object.keys(t);let r=b(e),i=n.filter(te).filter(ne).map(t=>v(t,e,!1));i.unshift(r);let[a,o]=i.sort((e,t)=>{if(e.relevance!==t.relevance)return t.relevance-e.relevance;if(e.language&&t.language){if(te(e.language).supersetOf===t.language)return 1;if(te(t.language).supersetOf===e.language)return-1}return 0}),s=a;return s.secondBest=o,s}function C(e,t,n){let r=t&&i[t]||n;e.classList.add(`hljs`),e.classList.add(`language-${r}`)}function w(e){let t=null,n=d(e);if(u(n))return;if(F(`before:highlightElement`,{el:e,language:n}),e.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",e);return}if(e.children.length>0&&(l.ignoreUnescapedHTML||(console.warn(`One of your code blocks includes unescaped HTML. This is a potentially serious security risk.`),console.warn(`https://github.com/highlightjs/highlight.js/wiki/security`),console.warn(`The element with unescaped HTML:`),console.warn(e)),l.throwUnescapedHTML))throw new Ie(`One of your code blocks includes unescaped HTML.`,e.innerHTML);t=e;let r=t.textContent,i=n?p(r,{language:n,ignoreIllegals:!0}):S(r);e.innerHTML=i.value,e.dataset.highlighted=`yes`,C(e,n,i.language),e.result={language:i.language,re:i.relevance,relevance:i.relevance},i.secondBest&&(e.secondBest={language:i.secondBest.language,relevance:i.secondBest.relevance}),F(`after:highlightElement`,{el:e,result:i,text:r})}function T(e){l=Re(l,e)}let E=()=>{k(),Te(`10.6.0`,`initHighlighting() deprecated. Use highlightAll() now.`)};function D(){k(),Te(`10.6.0`,`initHighlightingOnLoad() deprecated. Use highlightAll() now.`)}let O=!1;function k(){function e(){k()}if(document.readyState===`loading`){O||window.addEventListener(`DOMContentLoaded`,e,!1),O=!0;return}document.querySelectorAll(l.cssSelector).forEach(w)}function A(n,r){let i=null;try{i=r(e)}catch(e){if(Ce(`Language definition for '{}' could not be registered.`.replace(`{}`,n)),o)Ce(e);else throw e;i=c}i.name||=n,t[n]=i,i.rawDefinition=r.bind(null,e),i.aliases&&M(i.aliases,{languageName:n})}function ee(e){delete t[e];for(let t of Object.keys(i))i[t]===e&&delete i[t]}function j(){return Object.keys(t)}function te(e){return e=(e||``).toLowerCase(),t[e]||t[i[e]]}function M(e,{languageName:t}){typeof e==`string`&&(e=[e]),e.forEach(e=>{i[e.toLowerCase()]=t})}function ne(e){let t=te(e);return t&&!t.disableAutodetect}function N(e){e[`before:highlightBlock`]&&!e[`before:highlightElement`]&&(e[`before:highlightElement`]=t=>{e[`before:highlightBlock`](Object.assign({block:t.el},t))}),e[`after:highlightBlock`]&&!e[`after:highlightElement`]&&(e[`after:highlightElement`]=t=>{e[`after:highlightBlock`](Object.assign({block:t.el},t))})}function P(e){N(e),a.push(e)}function re(e){let t=a.indexOf(e);t!==-1&&a.splice(t,1)}function F(e,t){let n=e;a.forEach(function(e){e[n]&&e[n](t)})}function ie(e){return Te(`10.7.0`,`highlightBlock will be removed entirely in v12.0`),Te(`10.7.0`,`Please use highlightElement now.`),w(e)}Object.assign(e,{highlight:p,highlightAuto:S,highlightAll:k,highlightElement:w,highlightBlock:ie,configure:T,initHighlighting:E,initHighlightingOnLoad:D,registerLanguage:A,unregisterLanguage:ee,listLanguages:j,getLanguage:te,registerAliases:M,autoDetection:ne,inherit:Re,addPlugin:P,removePlugin:re}),e.debugMode=function(){o=!1},e.safeMode=function(){o=!0},e.versionString=Fe,e.regex={concat:_,lookahead:m,either:y,optional:g,anyNumberOfTimes:h};for(let e in le)typeof le[e]==`object`&&n(le[e]);return Object.assign(e,le),e},He=Ve({});He.newInstance=()=>Ve({}),t.exports=He,He.HighlightJS=He,He.default=He})),ko=o(((e,t)=>{function n(e){let t=e.regex,n=t.concat(/[\p{L}_]/u,t.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),r=/[\p{L}0-9._:-]+/u,i={className:`symbol`,begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},a={begin:/\s/,contains:[{className:`keyword`,begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},o=e.inherit(a,{begin:/\(/,end:/\)/}),s=e.inherit(e.APOS_STRING_MODE,{className:`string`}),c=e.inherit(e.QUOTE_STRING_MODE,{className:`string`}),l={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:`attr`,begin:r,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:`string`,endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[i]},{begin:/'/,end:/'/,contains:[i]},{begin:/[^\s"'=<>`]+/}]}]}]};return{name:`HTML, XML`,aliases:[`html`,`xhtml`,`rss`,`atom`,`xjb`,`xsd`,`xsl`,`plist`,`wsf`,`svg`],case_insensitive:!0,unicodeRegex:!0,contains:[{className:`meta`,begin:/<![a-z]/,end:/>/,relevance:10,contains:[a,c,s,o,{begin:/\[/,end:/\]/,contains:[{className:`meta`,begin:/<![a-z]/,end:/>/,contains:[a,o,c,s]}]}]},e.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},i,{className:`meta`,end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[c]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:`tag`,begin:/<style(?=\s|>)/,end:/>/,keywords:{name:`style`},contains:[l],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:[`css`,`xml`]}},{className:`tag`,begin:/<script(?=\s|>)/,end:/>/,keywords:{name:`script`},contains:[l],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:[`javascript`,`handlebars`,`xml`]}},{className:`tag`,begin:/<>|<\/>/},{className:`tag`,begin:t.concat(/</,t.lookahead(t.concat(n,t.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:`name`,begin:n,relevance:0,starts:l}]},{className:`tag`,begin:t.concat(/<\//,t.lookahead(t.concat(n,/>/))),contains:[{className:`name`,begin:n,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}t.exports=n})),Ao=o(((e,t)=>{function n(e){let t=e.regex,n={},r={begin:/\$\{/,end:/\}/,contains:[`self`,{begin:/:-/,contains:[n]}]};Object.assign(n,{className:`variable`,variants:[{begin:t.concat(/\$[\w\d#@][\w\d_]*/,`(?![\\w\\d])(?![$])`)},r]});let i={className:`subst`,begin:/\$\(/,end:/\)/,contains:[e.BACKSLASH_ESCAPE]},a=e.inherit(e.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:`comment`}}),o={begin:/<<-?\s*(?=\w+)/,starts:{contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:`string`})]}},s={className:`string`,begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,n,i]};i.contains.push(s);let c={match:/\\"/},l={className:`string`,begin:/'/,end:/'/},u={match:/\\'/},d={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:`number`},e.NUMBER_MODE,n]},f=e.SHEBANG({binary:`(${[`fish`,`bash`,`zsh`,`sh`,`csh`,`ksh`,`tcsh`,`dash`,`scsh`].join(`|`)})`,relevance:10}),p={className:`function`,begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[e.inherit(e.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},m=[`if`,`then`,`else`,`elif`,`fi`,`time`,`for`,`while`,`until`,`in`,`do`,`done`,`case`,`esac`,`coproc`,`function`,`select`],h=[`true`,`false`],g={match:/(\/[a-z._-]+)+/},_=[`break`,`cd`,`continue`,`eval`,`exec`,`exit`,`export`,`getopts`,`hash`,`pwd`,`readonly`,`return`,`shift`,`test`,`times`,`trap`,`umask`,`unset`],v=[`alias`,`bind`,`builtin`,`caller`,`command`,`declare`,`echo`,`enable`,`help`,`let`,`local`,`logout`,`mapfile`,`printf`,`read`,`readarray`,`source`,`sudo`,`type`,`typeset`,`ulimit`,`unalias`],y=`autoload.bg.bindkey.bye.cap.chdir.clone.comparguments.compcall.compctl.compdescribe.compfiles.compgroups.compquote.comptags.comptry.compvalues.dirs.disable.disown.echotc.echoti.emulate.fc.fg.float.functions.getcap.getln.history.integer.jobs.kill.limit.log.noglob.popd.print.pushd.pushln.rehash.sched.setcap.setopt.stat.suspend.ttyctl.unfunction.unhash.unlimit.unsetopt.vared.wait.whence.where.which.zcompile.zformat.zftp.zle.zmodload.zparseopts.zprof.zpty.zregexparse.zsocket.zstyle.ztcp`.split(`.`),b=`chcon.chgrp.chown.chmod.cp.dd.df.dir.dircolors.ln.ls.mkdir.mkfifo.mknod.mktemp.mv.realpath.rm.rmdir.shred.sync.touch.truncate.vdir.b2sum.base32.base64.cat.cksum.comm.csplit.cut.expand.fmt.fold.head.join.md5sum.nl.numfmt.od.paste.ptx.pr.sha1sum.sha224sum.sha256sum.sha384sum.sha512sum.shuf.sort.split.sum.tac.tail.tr.tsort.unexpand.uniq.wc.arch.basename.chroot.date.dirname.du.echo.env.expr.factor.groups.hostid.id.link.logname.nice.nohup.nproc.pathchk.pinky.printenv.printf.pwd.readlink.runcon.seq.sleep.stat.stdbuf.stty.tee.test.timeout.tty.uname.unlink.uptime.users.who.whoami.yes`.split(`.`);return{name:`Bash`,aliases:[`sh`,`zsh`],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:m,literal:h,built_in:[..._,...v,`set`,`shopt`,...y,...b]},contains:[f,e.SHEBANG(),p,d,a,o,g,s,c,l,u,n]}}t.exports=n})),jo=o(((e,t)=>{function n(e){let t=e.regex,n=e.COMMENT(`//`,`$`,{contains:[{begin:/\\\n/}]}),r=`decltype\\(auto\\)`,i=`[a-zA-Z_]\\w*::`,a=`(`+r+`|`+t.optional(i)+`[a-zA-Z_]\\w*`+t.optional(`<[^<>]+>`)+`)`,o={className:`type`,variants:[{begin:`\\b[a-z\\d_]*_t\\b`},{match:/\batomic_[a-z]{3,6}\b/}]},s={className:`string`,variants:[{begin:`(u8?|U|L)?"`,end:`"`,illegal:`\\n`,contains:[e.BACKSLASH_ESCAPE]},{begin:`(u8?|U|L)?'(\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)|.)`,end:`'`,illegal:`.`},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},c={className:`number`,variants:[{match:/\b(0b[01']+)/},{match:/(-?)\b([\d']+(\.[\d']*)?|\.[\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)/},{match:/(-?)\b(0[xX][a-fA-F0-9]+(?:'[a-fA-F0-9]+)*(?:\.[a-fA-F0-9]*(?:'[a-fA-F0-9]*)*)?(?:[pP][-+]?[0-9]+)?(l|L)?(u|U)?)/},{match:/(-?)\b\d+(?:'\d+)*(?:\.\d*(?:'\d*)*)?(?:[eE][-+]?\d+)?/}],relevance:0},l={className:`meta`,begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:`if else elif endif define undef warning error line pragma _Pragma ifdef ifndef elifdef elifndef include`},contains:[{begin:/\\\n/,relevance:0},e.inherit(s,{className:`string`}),{className:`string`,begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},u={className:`title`,begin:t.optional(i)+e.IDENT_RE,relevance:0},d=t.optional(i)+e.IDENT_RE+`\\s*\\(`,f={keyword:`asm.auto.break.case.continue.default.do.else.enum.extern.for.fortran.goto.if.inline.register.restrict.return.sizeof.typeof.typeof_unqual.struct.switch.typedef.union.volatile.while._Alignas._Alignof._Atomic._Generic._Noreturn._Static_assert._Thread_local.alignas.alignof.noreturn.static_assert.thread_local._Pragma`.split(`.`),type:`float.double.signed.unsigned.int.short.long.char.void._Bool._BitInt._Complex._Imaginary._Decimal32._Decimal64._Decimal96._Decimal128._Decimal64x._Decimal128x._Float16._Float32._Float64._Float128._Float32x._Float64x._Float128x.const.static.constexpr.complex.bool.imaginary`.split(`.`),literal:`true false NULL`,built_in:`std string wstring cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set pair bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap priority_queue make_pair array shared_ptr abort terminate abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf future isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf endl initializer_list unique_ptr`},p=[l,o,n,e.C_BLOCK_COMMENT_MODE,c,s],m={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:`new throw return else`,end:/;/}],keywords:f,contains:p.concat([{begin:/\(/,end:/\)/,keywords:f,contains:p.concat([`self`]),relevance:0}]),relevance:0},h={begin:`(`+a+`[\\*&\\s]+)+`+d,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:f,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:f,relevance:0},{begin:d,returnBegin:!0,contains:[e.inherit(u,{className:`title.function`})],relevance:0},{relevance:0,match:/,/},{className:`params`,begin:/\(/,end:/\)/,keywords:f,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,s,c,o,{begin:/\(/,end:/\)/,keywords:f,relevance:0,contains:[`self`,n,e.C_BLOCK_COMMENT_MODE,s,c,o]}]},o,n,e.C_BLOCK_COMMENT_MODE,l]};return{name:`C`,aliases:[`h`],keywords:f,disableAutodetect:!0,illegal:`</`,contains:[].concat(m,h,p,[l,{begin:e.IDENT_RE+`::`,keywords:f},{className:`class`,beginKeywords:`enum class struct union`,end:/[{;:<>=]/,contains:[{beginKeywords:`final class struct`},e.TITLE_MODE]}]),exports:{preprocessor:l,strings:s,keywords:f}}}t.exports=n})),Mo=o(((e,t)=>{function n(e){let t=e.regex,n=e.COMMENT(`//`,`$`,{contains:[{begin:/\\\n/}]}),r=`decltype\\(auto\\)`,i=`[a-zA-Z_]\\w*::`,a=`(?!struct)(`+r+`|`+t.optional(i)+`[a-zA-Z_]\\w*`+t.optional(`<[^<>]+>`)+`)`,o={className:`type`,begin:`\\b[a-z\\d_]*_t\\b`},s={className:`string`,variants:[{begin:`(u8?|U|L)?"`,end:`"`,illegal:`\\n`,contains:[e.BACKSLASH_ESCAPE]},{begin:`(u8?|U|L)?'(\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)|.)`,end:`'`,illegal:`.`},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},c={className:`number`,variants:[{begin:`[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)`},{begin:`[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)`}],relevance:0},l={className:`meta`,begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:`if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include`},contains:[{begin:/\\\n/,relevance:0},e.inherit(s,{className:`string`}),{className:`string`,begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},u={className:`title`,begin:t.optional(i)+e.IDENT_RE,relevance:0},d=t.optional(i)+e.IDENT_RE+`\\s*\\(`,f=`alignas.alignof.and.and_eq.asm.atomic_cancel.atomic_commit.atomic_noexcept.auto.bitand.bitor.break.case.catch.class.co_await.co_return.co_yield.compl.concept.const_cast|10.consteval.constexpr.constinit.continue.decltype.default.delete.do.dynamic_cast|10.else.enum.explicit.export.extern.false.final.for.friend.goto.if.import.inline.module.mutable.namespace.new.noexcept.not.not_eq.nullptr.operator.or.or_eq.override.private.protected.public.reflexpr.register.reinterpret_cast|10.requires.return.sizeof.static_assert.static_cast|10.struct.switch.synchronized.template.this.thread_local.throw.transaction_safe.transaction_safe_dynamic.true.try.typedef.typeid.typename.union.using.virtual.volatile.while.xor.xor_eq`.split(`.`),p=[`bool`,`char`,`char16_t`,`char32_t`,`char8_t`,`double`,`float`,`int`,`long`,`short`,`void`,`wchar_t`,`unsigned`,`signed`,`const`,`static`],m=`any.auto_ptr.barrier.binary_semaphore.bitset.complex.condition_variable.condition_variable_any.counting_semaphore.deque.false_type.flat_map.flat_set.future.imaginary.initializer_list.istringstream.jthread.latch.lock_guard.multimap.multiset.mutex.optional.ostringstream.packaged_task.pair.promise.priority_queue.queue.recursive_mutex.recursive_timed_mutex.scoped_lock.set.shared_future.shared_lock.shared_mutex.shared_timed_mutex.shared_ptr.stack.string_view.stringstream.timed_mutex.thread.true_type.tuple.unique_lock.unique_ptr.unordered_map.unordered_multimap.unordered_multiset.unordered_set.variant.vector.weak_ptr.wstring.wstring_view`.split(`.`),h=`abort.abs.acos.apply.as_const.asin.atan.atan2.calloc.ceil.cerr.cin.clog.cos.cosh.cout.declval.endl.exchange.exit.exp.fabs.floor.fmod.forward.fprintf.fputs.free.frexp.fscanf.future.invoke.isalnum.isalpha.iscntrl.isdigit.isgraph.islower.isprint.ispunct.isspace.isupper.isxdigit.labs.launder.ldexp.log.log10.make_pair.make_shared.make_shared_for_overwrite.make_tuple.make_unique.malloc.memchr.memcmp.memcpy.memset.modf.move.pow.printf.putchar.puts.realloc.scanf.sin.sinh.snprintf.sprintf.sqrt.sscanf.std.stderr.stdin.stdout.strcat.strchr.strcmp.strcpy.strcspn.strlen.strncat.strncmp.strncpy.strpbrk.strrchr.strspn.strstr.swap.tan.tanh.terminate.to_underlying.tolower.toupper.vfprintf.visit.vprintf.vsprintf`.split(`.`),g={type:p,keyword:f,literal:[`NULL`,`false`,`nullopt`,`nullptr`,`true`],built_in:[`_Pragma`],_type_hints:m},_={className:`function.dispatch`,relevance:0,keywords:{_hint:h},begin:t.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},v=[_,l,o,n,e.C_BLOCK_COMMENT_MODE,c,s],y={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:`new throw return else`,end:/;/}],keywords:g,contains:v.concat([{begin:/\(/,end:/\)/,keywords:g,contains:v.concat([`self`]),relevance:0}]),relevance:0},b={className:`function`,begin:`(`+a+`[\\*&\\s]+)+`+d,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:g,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:g,relevance:0},{begin:d,returnBegin:!0,contains:[u],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[s,c]},{relevance:0,match:/,/},{className:`params`,begin:/\(/,end:/\)/,keywords:g,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,s,c,o,{begin:/\(/,end:/\)/,keywords:g,relevance:0,contains:[`self`,n,e.C_BLOCK_COMMENT_MODE,s,c,o]}]},o,n,e.C_BLOCK_COMMENT_MODE,l]};return{name:`C++`,aliases:[`cc`,`c++`,`h++`,`hpp`,`hh`,`hxx`,`cxx`],keywords:g,illegal:`</`,classNameAliases:{"function.dispatch":`built_in`},contains:[].concat(y,b,_,v,[l,{begin:`\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function|flat_map|flat_set)\\s*<(?!<)`,end:`>`,keywords:g,contains:[`self`,o]},{begin:e.IDENT_RE+`::`,keywords:g},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:`keyword`,3:`title.class`}}])}}t.exports=n})),No=o(((e,t)=>{function n(e){let t=[`bool`,`byte`,`char`,`decimal`,`delegate`,`double`,`dynamic`,`enum`,`float`,`int`,`long`,`nint`,`nuint`,`object`,`sbyte`,`short`,`string`,`ulong`,`uint`,`ushort`],n=[`public`,`private`,`protected`,`static`,`internal`,`protected`,`abstract`,`async`,`extern`,`override`,`unsafe`,`virtual`,`new`,`sealed`,`partial`],r={keyword:`abstract.as.base.break.case.catch.class.const.continue.do.else.event.explicit.extern.finally.fixed.for.foreach.goto.if.implicit.in.interface.internal.is.lock.namespace.new.operator.out.override.params.private.protected.public.readonly.record.ref.return.scoped.sealed.sizeof.stackalloc.static.struct.switch.this.throw.try.typeof.unchecked.unsafe.using.virtual.void.volatile.while`.split(`.`).concat(`add.alias.and.ascending.args.async.await.by.descending.dynamic.equals.file.from.get.global.group.init.into.join.let.nameof.not.notnull.on.or.orderby.partial.record.remove.required.scoped.select.set.unmanaged.value|0.var.when.where.with.yield`.split(`.`)),built_in:t,literal:[`default`,`false`,`null`,`true`]},i=e.inherit(e.TITLE_MODE,{begin:`[a-zA-Z](\\.?\\w)*`}),a={className:`number`,variants:[{begin:`\\b(0b[01']+)`},{begin:`(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)(u|U|l|L|ul|UL|f|F|b|B)`},{begin:`(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)`}],relevance:0},o={className:`string`,begin:/"""("*)(?!")(.|\n)*?"""\1/,relevance:1},s={className:`string`,begin:`@"`,end:`"`,contains:[{begin:`""`}]},c=e.inherit(s,{illegal:/\n/}),l={className:`subst`,begin:/\{/,end:/\}/,keywords:r},u=e.inherit(l,{illegal:/\n/}),d={className:`string`,begin:/\$"/,end:`"`,illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},e.BACKSLASH_ESCAPE,u]},f={className:`string`,begin:/\$@"/,end:`"`,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:`""`},l]},p=e.inherit(f,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:`""`},u]});l.contains=[f,d,s,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,a,e.C_BLOCK_COMMENT_MODE],u.contains=[p,d,c,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,a,e.inherit(e.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];let m={variants:[o,f,d,s,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},h={begin:`<`,end:`>`,contains:[{beginKeywords:`in out`},i]},g=e.IDENT_RE+`(<`+e.IDENT_RE+`(\\s*,\\s*`+e.IDENT_RE+`)*>)?(\\[\\])?`,_={begin:`@`+e.IDENT_RE,relevance:0};return{name:`C#`,aliases:[`cs`,`c#`],keywords:r,illegal:/::/,contains:[e.COMMENT(`///`,`$`,{returnBegin:!0,contains:[{className:`doctag`,variants:[{begin:`///`,relevance:0},{begin:`<!--|-->`},{begin:`</?`,end:`>`}]}]}),e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:`meta`,begin:`#`,end:`$`,keywords:{keyword:`if else elif endif define undef warning error line region endregion pragma checksum`}},m,a,{beginKeywords:`class interface`,relevance:0,end:/[{;=]/,illegal:/[^\s:,]/,contains:[{beginKeywords:`where class`},i,h,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:`namespace`,relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[i,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:`record`,relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[i,h,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:`meta`,begin:`^\\s*\\[(?=[\\w])`,excludeBegin:!0,end:`\\]`,excludeEnd:!0,contains:[{className:`string`,begin:/"/,end:/"/}]},{beginKeywords:`new return throw await else`,relevance:0},{className:`function`,begin:`(`+g+`\\s+)+`+e.IDENT_RE+`\\s*(<[^=]+>\\s*)?\\(`,returnBegin:!0,end:/\s*[{;=]/,excludeEnd:!0,keywords:r,contains:[{beginKeywords:n.join(` `),relevance:0},{begin:e.IDENT_RE+`\\s*(<[^=]+>\\s*)?\\(`,returnBegin:!0,contains:[e.TITLE_MODE,h],relevance:0},{match:/\(\)/},{className:`params`,begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:r,relevance:0,contains:[m,a,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},_]}}t.exports=n})),Po=o(((e,t)=>{var n=e=>({IMPORTANT:{scope:`meta`,begin:`!important`},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:`number`,begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:`built_in`,begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:`selector-attr`,begin:/\[/,end:/\]/,illegal:`$`,contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:`number`,begin:e.NUMBER_RE+`(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?`,relevance:0},CSS_VARIABLE:{className:`attr`,begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),r=`a.abbr.address.article.aside.audio.b.blockquote.body.button.canvas.caption.cite.code.dd.del.details.dfn.div.dl.dt.em.fieldset.figcaption.figure.footer.form.h1.h2.h3.h4.h5.h6.header.hgroup.html.i.iframe.img.input.ins.kbd.label.legend.li.main.mark.menu.nav.object.ol.optgroup.option.p.picture.q.quote.samp.section.select.source.span.strong.summary.sup.table.tbody.td.textarea.tfoot.th.thead.time.tr.ul.var.video`.split(`.`),i=`defs.g.marker.mask.pattern.svg.switch.symbol.feBlend.feColorMatrix.feComponentTransfer.feComposite.feConvolveMatrix.feDiffuseLighting.feDisplacementMap.feFlood.feGaussianBlur.feImage.feMerge.feMorphology.feOffset.feSpecularLighting.feTile.feTurbulence.linearGradient.radialGradient.stop.circle.ellipse.image.line.path.polygon.polyline.rect.text.use.textPath.tspan.foreignObject.clipPath`.split(`.`),a=[...r,...i],o=`any-hover.any-pointer.aspect-ratio.color.color-gamut.color-index.device-aspect-ratio.device-height.device-width.display-mode.forced-colors.grid.height.hover.inverted-colors.monochrome.orientation.overflow-block.overflow-inline.pointer.prefers-color-scheme.prefers-contrast.prefers-reduced-motion.prefers-reduced-transparency.resolution.scan.scripting.update.width.min-width.max-width.min-height.max-height`.split(`.`).sort().reverse(),s=`active.any-link.blank.checked.current.default.defined.dir.disabled.drop.empty.enabled.first.first-child.first-of-type.fullscreen.future.focus.focus-visible.focus-within.has.host.host-context.hover.indeterminate.in-range.invalid.is.lang.last-child.last-of-type.left.link.local-link.not.nth-child.nth-col.nth-last-child.nth-last-col.nth-last-of-type.nth-of-type.only-child.only-of-type.optional.out-of-range.past.placeholder-shown.read-only.read-write.required.right.root.scope.target.target-within.user-invalid.valid.visited.where`.split(`.`).sort().reverse(),c=[`after`,`backdrop`,`before`,`cue`,`cue-region`,`first-letter`,`first-line`,`grammar-error`,`marker`,`part`,`placeholder`,`selection`,`slotted`,`spelling-error`].sort().reverse(),l=`accent-color.align-content.align-items.align-self.alignment-baseline.all.anchor-name.animation.animation-composition.animation-delay.animation-direction.animation-duration.animation-fill-mode.animation-iteration-count.animation-name.animation-play-state.animation-range.animation-range-end.animation-range-start.animation-timeline.animation-timing-function.appearance.aspect-ratio.backdrop-filter.backface-visibility.background.background-attachment.background-blend-mode.background-clip.background-color.background-image.background-origin.background-position.background-position-x.background-position-y.background-repeat.background-size.baseline-shift.block-size.border.border-block.border-block-color.border-block-end.border-block-end-color.border-block-end-style.border-block-end-width.border-block-start.border-block-start-color.border-block-start-style.border-block-start-width.border-block-style.border-block-width.border-bottom.border-bottom-color.border-bottom-left-radius.border-bottom-right-radius.border-bottom-style.border-bottom-width.border-collapse.border-color.border-end-end-radius.border-end-start-radius.border-image.border-image-outset.border-image-repeat.border-image-slice.border-image-source.border-image-width.border-inline.border-inline-color.border-inline-end.border-inline-end-color.border-inline-end-style.border-inline-end-width.border-inline-start.border-inline-start-color.border-inline-start-style.border-inline-start-width.border-inline-style.border-inline-width.border-left.border-left-color.border-left-style.border-left-width.border-radius.border-right.border-right-color.border-right-style.border-right-width.border-spacing.border-start-end-radius.border-start-start-radius.border-style.border-top.border-top-color.border-top-left-radius.border-top-right-radius.border-top-style.border-top-width.border-width.bottom.box-align.box-decoration-break.box-direction.box-flex.box-flex-group.box-lines.box-ordinal-group.box-orient.box-pack.box-shadow.box-sizing.break-after.break-before.break-inside.caption-side.caret-color.clear.clip.clip-path.clip-rule.color.color-interpolation.color-interpolation-filters.color-profile.color-rendering.color-scheme.column-count.column-fill.column-gap.column-rule.column-rule-color.column-rule-style.column-rule-width.column-span.column-width.columns.contain.contain-intrinsic-block-size.contain-intrinsic-height.contain-intrinsic-inline-size.contain-intrinsic-size.contain-intrinsic-width.container.container-name.container-type.content.content-visibility.counter-increment.counter-reset.counter-set.cue.cue-after.cue-before.cursor.cx.cy.direction.display.dominant-baseline.empty-cells.enable-background.field-sizing.fill.fill-opacity.fill-rule.filter.flex.flex-basis.flex-direction.flex-flow.flex-grow.flex-shrink.flex-wrap.float.flood-color.flood-opacity.flow.font.font-display.font-family.font-feature-settings.font-kerning.font-language-override.font-optical-sizing.font-palette.font-size.font-size-adjust.font-smooth.font-smoothing.font-stretch.font-style.font-synthesis.font-synthesis-position.font-synthesis-small-caps.font-synthesis-style.font-synthesis-weight.font-variant.font-variant-alternates.font-variant-caps.font-variant-east-asian.font-variant-emoji.font-variant-ligatures.font-variant-numeric.font-variant-position.font-variation-settings.font-weight.forced-color-adjust.gap.glyph-orientation-horizontal.glyph-orientation-vertical.grid.grid-area.grid-auto-columns.grid-auto-flow.grid-auto-rows.grid-column.grid-column-end.grid-column-start.grid-gap.grid-row.grid-row-end.grid-row-start.grid-template.grid-template-areas.grid-template-columns.grid-template-rows.hanging-punctuation.height.hyphenate-character.hyphenate-limit-chars.hyphens.icon.image-orientation.image-rendering.image-resolution.ime-mode.initial-letter.initial-letter-align.inline-size.inset.inset-area.inset-block.inset-block-end.inset-block-start.inset-inline.inset-inline-end.inset-inline-start.isolation.justify-content.justify-items.justify-self.kerning.left.letter-spacing.lighting-color.line-break.line-height.line-height-step.list-style.list-style-image.list-style-position.list-style-type.margin.margin-block.margin-block-end.margin-block-start.margin-bottom.margin-inline.margin-inline-end.margin-inline-start.margin-left.margin-right.margin-top.margin-trim.marker.marker-end.marker-mid.marker-start.marks.mask.mask-border.mask-border-mode.mask-border-outset.mask-border-repeat.mask-border-slice.mask-border-source.mask-border-width.mask-clip.mask-composite.mask-image.mask-mode.mask-origin.mask-position.mask-repeat.mask-size.mask-type.masonry-auto-flow.math-depth.math-shift.math-style.max-block-size.max-height.max-inline-size.max-width.min-block-size.min-height.min-inline-size.min-width.mix-blend-mode.nav-down.nav-index.nav-left.nav-right.nav-up.none.normal.object-fit.object-position.offset.offset-anchor.offset-distance.offset-path.offset-position.offset-rotate.opacity.order.orphans.outline.outline-color.outline-offset.outline-style.outline-width.overflow.overflow-anchor.overflow-block.overflow-clip-margin.overflow-inline.overflow-wrap.overflow-x.overflow-y.overlay.overscroll-behavior.overscroll-behavior-block.overscroll-behavior-inline.overscroll-behavior-x.overscroll-behavior-y.padding.padding-block.padding-block-end.padding-block-start.padding-bottom.padding-inline.padding-inline-end.padding-inline-start.padding-left.padding-right.padding-top.page.page-break-after.page-break-before.page-break-inside.paint-order.pause.pause-after.pause-before.perspective.perspective-origin.place-content.place-items.place-self.pointer-events.position.position-anchor.position-visibility.print-color-adjust.quotes.r.resize.rest.rest-after.rest-before.right.rotate.row-gap.ruby-align.ruby-position.scale.scroll-behavior.scroll-margin.scroll-margin-block.scroll-margin-block-end.scroll-margin-block-start.scroll-margin-bottom.scroll-margin-inline.scroll-margin-inline-end.scroll-margin-inline-start.scroll-margin-left.scroll-margin-right.scroll-margin-top.scroll-padding.scroll-padding-block.scroll-padding-block-end.scroll-padding-block-start.scroll-padding-bottom.scroll-padding-inline.scroll-padding-inline-end.scroll-padding-inline-start.scroll-padding-left.scroll-padding-right.scroll-padding-top.scroll-snap-align.scroll-snap-stop.scroll-snap-type.scroll-timeline.scroll-timeline-axis.scroll-timeline-name.scrollbar-color.scrollbar-gutter.scrollbar-width.shape-image-threshold.shape-margin.shape-outside.shape-rendering.speak.speak-as.src.stop-color.stop-opacity.stroke.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke-width.tab-size.table-layout.text-align.text-align-all.text-align-last.text-anchor.text-combine-upright.text-decoration.text-decoration-color.text-decoration-line.text-decoration-skip.text-decoration-skip-ink.text-decoration-style.text-decoration-thickness.text-emphasis.text-emphasis-color.text-emphasis-position.text-emphasis-style.text-indent.text-justify.text-orientation.text-overflow.text-rendering.text-shadow.text-size-adjust.text-transform.text-underline-offset.text-underline-position.text-wrap.text-wrap-mode.text-wrap-style.timeline-scope.top.touch-action.transform.transform-box.transform-origin.transform-style.transition.transition-behavior.transition-delay.transition-duration.transition-property.transition-timing-function.translate.unicode-bidi.user-modify.user-select.vector-effect.vertical-align.view-timeline.view-timeline-axis.view-timeline-inset.view-timeline-name.view-transition-name.visibility.voice-balance.voice-duration.voice-family.voice-pitch.voice-range.voice-rate.voice-stress.voice-volume.white-space.white-space-collapse.widows.width.will-change.word-break.word-spacing.word-wrap.writing-mode.x.y.z-index.zoom`.split(`.`).sort().reverse();function u(e){let t=e.regex,r=n(e),i={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},u=/@-?\w[\w]*(-\w+)*/,d=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE];return{name:`CSS`,case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:`from to`},classNameAliases:{keyframePosition:`selector-tag`},contains:[r.BLOCK_COMMENT,i,r.CSS_NUMBER_MODE,{className:`selector-id`,begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:`selector-class`,begin:`\\.[a-zA-Z-][a-zA-Z0-9_-]*`,relevance:0},r.ATTRIBUTE_SELECTOR_MODE,{className:`selector-pseudo`,variants:[{begin:`:(`+s.join(`|`)+`)`},{begin:`:(:)?(`+c.join(`|`)+`)`}]},r.CSS_VARIABLE,{className:`attribute`,begin:`\\b(`+l.join(`|`)+`)\\b`},{begin:/:/,end:/[;}{]/,contains:[r.BLOCK_COMMENT,r.HEXCOLOR,r.IMPORTANT,r.CSS_NUMBER_MODE,...d,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:`url data-uri`},contains:[...d,{className:`string`,begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},r.FUNCTION_DISPATCH]},{begin:t.lookahead(/@/),end:`[{;]`,relevance:0,illegal:/:/,contains:[{className:`keyword`,begin:u},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:`and or not only`,attribute:o.join(` `)},contains:[{begin:/[a-z-]+(?=:)/,className:`attribute`},...d,r.CSS_NUMBER_MODE]}]},{className:`selector-tag`,begin:`\\b(`+a.join(`|`)+`)\\b`}]}}t.exports=u})),Fo=o(((e,t)=>{function n(e){let t=e.regex,n={begin:/<\/?[A-Za-z_]/,end:`>`,subLanguage:`xml`,relevance:0},r={begin:`^[-\\*]{3,}`,end:`$`},i={className:`code`,variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:`(~{3,})[^~](.|\\n)*?\\1~*[ ]*`},{begin:"```",end:"```+[ ]*$"},{begin:`~~~`,end:`~~~+[ ]*$`},{begin:"`.+?`"},{begin:`(?=^( {4}|\\t))`,contains:[{begin:`^( {4}|\\t)`,end:`(\\n)$`}],relevance:0}]},a={className:`bullet`,begin:`^[ ]*([*+-]|(\\d+\\.))(?=\\s+)`,end:`\\s+`,excludeEnd:!0},o={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:`symbol`,begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:`link`,begin:/:\s*/,end:/$/,excludeBegin:!0}]},s={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:t.concat(/\[.+?\]\(/,/[A-Za-z][A-Za-z0-9+.-]*/,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:`string`,relevance:0,begin:`\\[`,end:`\\]`,excludeBegin:!0,returnEnd:!0},{className:`link`,relevance:0,begin:`\\]\\(`,end:`\\)`,excludeBegin:!0,excludeEnd:!0},{className:`symbol`,relevance:0,begin:`\\]\\[`,end:`\\]`,excludeBegin:!0,excludeEnd:!0}]},c={className:`strong`,contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},l={className:`emphasis`,contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},u=e.inherit(c,{contains:[]}),d=e.inherit(l,{contains:[]});c.contains.push(d),l.contains.push(u);let f=[n,s];return[c,l,u,d].forEach(e=>{e.contains=e.contains.concat(f)}),f=f.concat(c,l),{name:`Markdown`,aliases:[`md`,`mkdown`,`mkd`],contains:[{className:`section`,variants:[{begin:`^#{1,6}`,end:`$`,contains:f},{begin:`(?=^.+?\\n[=-]{2,}$)`,contains:[{begin:`^[=-]*$`},{begin:`^`,end:`\\n`,contains:f}]}]},n,a,c,l,{className:`quote`,begin:`^>\\s+`,contains:f,end:`$`},i,r,s,o,{scope:`literal`,match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}t.exports=n})),Io=o(((e,t)=>{function n(e){let t=e.regex;return{name:`Diff`,aliases:[`patch`],contains:[{className:`meta`,relevance:10,match:t.either(/^@@ +-\d+,\d+ +\+\d+,\d+ +@@/,/^\*\*\* +\d+,\d+ +\*\*\*\*$/,/^--- +\d+,\d+ +----$/)},{className:`comment`,variants:[{begin:t.either(/Index: /,/^index/,/={3,}/,/^-{3}/,/^\*{3} /,/^\+{3}/,/^diff --git/),end:/$/},{match:/^\*{15}$/}]},{className:`addition`,begin:/^\+/,end:/$/},{className:`deletion`,begin:/^-/,end:/$/},{className:`addition`,begin:/^!/,end:/$/}]}}t.exports=n})),Lo=o(((e,t)=>{function n(e){let t=e.regex,n="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",r=t.either(/\b([A-Z]+[a-z0-9]+)+/,/\b([A-Z]+[a-z0-9]+)+[A-Z]+/),i=t.concat(r,/(::\w+)*/),a={"variable.constant":[`__FILE__`,`__LINE__`,`__ENCODING__`],"variable.language":[`self`,`super`],keyword:[`alias`,`and`,`begin`,`BEGIN`,`break`,`case`,`class`,`defined`,`do`,`else`,`elsif`,`end`,`END`,`ensure`,`for`,`if`,`in`,`module`,`next`,`not`,`or`,`redo`,`require`,`rescue`,`retry`,`return`,`then`,`undef`,`unless`,`until`,`when`,`while`,`yield`,...[`include`,`extend`,`prepend`,`public`,`private`,`protected`,`raise`,`throw`]],built_in:[`proc`,`lambda`,`attr_accessor`,`attr_reader`,`attr_writer`,`define_method`,`private_constant`,`module_function`],literal:[`true`,`false`,`nil`]},o={className:`doctag`,begin:`@[A-Za-z]+`},s={begin:`#<`,end:`>`},c=[e.COMMENT(`#`,`$`,{contains:[o]}),e.COMMENT(`^=begin`,`^=end`,{contains:[o],relevance:10}),e.COMMENT(`^__END__`,e.MATCH_NOTHING_RE)],l={className:`subst`,begin:/#\{/,end:/\}/,keywords:a},u={className:`string`,contains:[e.BACKSLASH_ESCAPE,l],variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/`/,end:/`/},{begin:/%[qQwWx]?\(/,end:/\)/},{begin:/%[qQwWx]?\[/,end:/\]/},{begin:/%[qQwWx]?\{/,end:/\}/},{begin:/%[qQwWx]?</,end:/>/},{begin:/%[qQwWx]?\//,end:/\//},{begin:/%[qQwWx]?%/,end:/%/},{begin:/%[qQwWx]?-/,end:/-/},{begin:/%[qQwWx]?\|/,end:/\|/},{begin:/\B\?(\\\d{1,3})/},{begin:/\B\?(\\x[A-Fa-f0-9]{1,2})/},{begin:/\B\?(\\u\{?[A-Fa-f0-9]{1,6}\}?)/},{begin:/\B\?(\\M-\\C-|\\M-\\c|\\c\\M-|\\M-|\\C-\\M-)[\x20-\x7e]/},{begin:/\B\?\\(c|C-)[\x20-\x7e]/},{begin:/\B\?\\?\S/},{begin:t.concat(/<<[-~]?'?/,t.lookahead(/(\w+)(?=\W)[^\n]*\n(?:[^\n]*\n)*?\s*\1\b/)),contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,contains:[e.BACKSLASH_ESCAPE,l]})]}]},d=`[0-9](_?[0-9])*`,f={className:`number`,relevance:0,variants:[{begin:`\\b([1-9](_?[0-9])*|0)(\\.(${d}))?([eE][+-]?(${d})|r)?i?\\b`},{begin:`\\b0[dD][0-9](_?[0-9])*r?i?\\b`},{begin:`\\b0[bB][0-1](_?[0-1])*r?i?\\b`},{begin:`\\b0[oO][0-7](_?[0-7])*r?i?\\b`},{begin:`\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*r?i?\\b`},{begin:`\\b0(_?[0-7])+r?i?\\b`}]},p={variants:[{match:/\(\)/},{className:`params`,begin:/\(/,end:/(?=\))/,excludeBegin:!0,endsParent:!0,keywords:a}]},m=[u,{variants:[{match:[/class\s+/,i,/\s+<\s+/,i]},{match:[/\b(class|module)\s+/,i]}],scope:{2:`title.class`,4:`title.class.inherited`},keywords:a},{match:[/(include|extend)\s+/,i],scope:{2:`title.class`},keywords:a},{relevance:0,match:[i,/\.new[. (]/],scope:{1:`title.class`}},{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:`variable.constant`},{relevance:0,match:r,scope:`title.class`},{match:[/def/,/\s+/,n],scope:{1:`keyword`,3:`title.function`},contains:[p]},{begin:e.IDENT_RE+`::`},{className:`symbol`,begin:e.UNDERSCORE_IDENT_RE+`(!|\\?)?:`,relevance:0},{className:`symbol`,begin:`:(?!\\s)`,contains:[u,{begin:n}],relevance:0},f,{className:`variable`,begin:`(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])(?![A-Za-z])(?![@$?'])`},{className:`params`,begin:/\|(?!=)/,end:/\|/,excludeBegin:!0,excludeEnd:!0,relevance:0,keywords:a},{begin:`(`+e.RE_STARTERS_RE+`|unless)\\s*`,keywords:`unless`,contains:[{className:`regexp`,contains:[e.BACKSLASH_ESCAPE,l],illegal:/\n/,variants:[{begin:`/`,end:`/[a-z]*`},{begin:/%r\{/,end:/\}[a-z]*/},{begin:`%r\\(`,end:`\\)[a-z]*`},{begin:`%r!`,end:`![a-z]*`},{begin:`%r\\[`,end:`\\][a-z]*`}]}].concat(s,c),relevance:0}].concat(s,c);l.contains=m,p.contains=m;let h=[{begin:/^\s*=>/,starts:{end:`$`,contains:m}},{className:`meta.prompt`,begin:`^([>?]>|[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]|(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>)(?=[ ])`,starts:{end:`$`,keywords:a,contains:m}}];return c.unshift(s),{name:`Ruby`,aliases:[`rb`,`gemspec`,`podspec`,`thor`,`irb`],keywords:a,illegal:/\/\*/,contains:[e.SHEBANG({binary:`ruby`})].concat(h,c,m)}}t.exports=n})),Ro=o(((e,t)=>{function n(e){let t={keyword:[`break`,`case`,`chan`,`const`,`continue`,`default`,`defer`,`else`,`fallthrough`,`for`,`func`,`go`,`goto`,`if`,`import`,`interface`,`map`,`package`,`range`,`return`,`select`,`struct`,`switch`,`type`,`var`],type:[`bool`,`byte`,`complex64`,`complex128`,`error`,`float32`,`float64`,`int8`,`int16`,`int32`,`int64`,`string`,`uint8`,`uint16`,`uint32`,`uint64`,`int`,`uint`,`uintptr`,`rune`],literal:[`true`,`false`,`iota`,`nil`],built_in:[`append`,`cap`,`close`,`complex`,`copy`,`imag`,`len`,`make`,`new`,`panic`,`print`,`println`,`real`,`recover`,`delete`]};return{name:`Go`,aliases:[`golang`],keywords:t,illegal:`</`,contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:`string`,variants:[e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,{begin:"`",end:"`"}]},{className:`number`,variants:[{match:/-?\b0[xX]\.[a-fA-F0-9](_?[a-fA-F0-9])*[pP][+-]?\d(_?\d)*i?/,relevance:0},{match:/-?\b0[xX](_?[a-fA-F0-9])+((\.([a-fA-F0-9](_?[a-fA-F0-9])*)?)?[pP][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b0[oO](_?[0-7])*i?/,relevance:0},{match:/-?\.\d(_?\d)*([eE][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b\d(_?\d)*(\.(\d(_?\d)*)?)?([eE][+-]?\d(_?\d)*)?i?/,relevance:0}]},{begin:/:=/},{className:`function`,beginKeywords:`func`,end:`\\s*(\\{|$)`,excludeEnd:!0,contains:[e.TITLE_MODE,{className:`params`,begin:/\(/,end:/\)/,endsParent:!0,keywords:t,illegal:/["']/}]}]}}t.exports=n})),zo=o(((e,t)=>{function n(e){let t=e.regex;return{name:`GraphQL`,aliases:[`gql`],case_insensitive:!0,disableAutodetect:!1,keywords:{keyword:[`query`,`mutation`,`subscription`,`type`,`input`,`schema`,`directive`,`interface`,`union`,`scalar`,`fragment`,`enum`,`on`],literal:[`true`,`false`,`null`]},contains:[e.HASH_COMMENT_MODE,e.QUOTE_STRING_MODE,e.NUMBER_MODE,{scope:`punctuation`,match:/[.]{3}/,relevance:0},{scope:`punctuation`,begin:/[\!\(\)\:\=\[\]\{\|\}]{1}/,relevance:0},{scope:`variable`,begin:/\$/,end:/\W/,excludeEnd:!0,relevance:0},{scope:`meta`,match:/@\w+/,excludeEnd:!0},{scope:`symbol`,begin:t.concat(/[_A-Za-z][_0-9A-Za-z]*/,t.lookahead(/\s*:/)),relevance:0}],illegal:[/[;<']/,/BEGIN/]}}t.exports=n})),Bo=o(((e,t)=>{function n(e){let t=e.regex,n={className:`number`,relevance:0,variants:[{begin:/([+-]+)?[\d]+_[\d_]+/},{begin:e.NUMBER_RE}]},r=e.COMMENT();r.variants=[{begin:/;/,end:/$/},{begin:/#/,end:/$/}];let i={className:`variable`,variants:[{begin:/\$[\w\d"][\w\d_]*/},{begin:/\$\{(.*?)\}/}]},a={className:`literal`,begin:/\bon|off|true|false|yes|no\b/},o={className:`string`,contains:[e.BACKSLASH_ESCAPE],variants:[{begin:`'''`,end:`'''`,relevance:10},{begin:`"""`,end:`"""`,relevance:10},{begin:`"`,end:`"`},{begin:`'`,end:`'`}]},s={begin:/\[/,end:/\]/,contains:[r,a,i,o,n,`self`],relevance:0},c=t.either(/[A-Za-z0-9_-]+/,/"(\\"|[^"])*"/,/'[^']*'/);return{name:`TOML, also INI`,aliases:[`toml`],case_insensitive:!0,illegal:/\S/,contains:[r,{className:`section`,begin:/\[+/,end:/\]+/},{begin:t.concat(c,`(\\s*\\.\\s*`,c,`)*`,t.lookahead(/\s*=\s*[^#\s]/)),className:`attr`,starts:{end:/$/,contains:[r,s,a,i,o,n]}}]}}t.exports=n})),Vo=o(((e,t)=>{var n=`[0-9](_*[0-9])*`,r=`\\.(${n})`,i=`[0-9a-fA-F](_*[0-9a-fA-F])*`,a={className:`number`,variants:[{begin:`(\\b(${n})((${r})|\\.)?|(${r}))[eE][+-]?(${n})[fFdD]?\\b`},{begin:`\\b(${n})((${r})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${r})[fFdD]?\\b`},{begin:`\\b(${n})[fFdD]\\b`},{begin:`\\b0[xX]((${i})\\.?|(${i})?\\.(${i}))[pP][+-]?(${n})[fFdD]?\\b`},{begin:`\\b(0|[1-9](_*[0-9])*)[lL]?\\b`},{begin:`\\b0[xX](${i})[lL]?\\b`},{begin:`\\b0(_*[0-7])*[lL]?\\b`},{begin:`\\b0[bB][01](_*[01])*[lL]?\\b`}],relevance:0};function o(e,t,n){return n===-1?``:e.replace(t,r=>o(e,t,n-1))}function s(e){let t=e.regex,n=`[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*`,r=n+o(`(?:<`+n+`~~~(?:\\s*,\\s*[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*~~~)*>)?`,/~~~/g,2),i={keyword:`synchronized.abstract.private.var.static.if.const .for.while.strictfp.finally.protected.import.native.final.void.enum.else.break.transient.catch.instanceof.volatile.case.assert.package.default.public.try.switch.continue.throws.protected.public.private.module.requires.exports.do.sealed.yield.permits.goto.when`.split(`.`),literal:[`false`,`true`,`null`],type:[`char`,`boolean`,`long`,`float`,`int`,`byte`,`short`,`double`],built_in:[`super`,`this`]},s={className:`meta`,begin:`@`+n,contains:[{begin:/\(/,end:/\)/,contains:[`self`]}]},c={className:`params`,begin:/\(/,end:/\)/,keywords:i,relevance:0,contains:[e.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:`Java`,aliases:[`jsp`],keywords:i,illegal:/<\/|#/,contains:[e.COMMENT(`/\\*\\*`,`\\*/`,{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:`doctag`,begin:`@[A-Za-z]+`}]}),{begin:/import java\.[a-z]+\./,keywords:`import`,relevance:2},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{begin:/"""/,end:/"""/,className:`string`,contains:[e.BACKSLASH_ESCAPE]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{match:[/\b(?:class|interface|enum|extends|implements|new)/,/\s+/,n],className:{1:`keyword`,3:`title.class`}},{match:/non-sealed/,scope:`keyword`},{begin:[t.concat(/(?!else)/,n),/\s+/,n,/\s+/,/=(?!=)/],className:{1:`type`,3:`variable`,5:`operator`}},{begin:[/record/,/\s+/,n],className:{1:`keyword`,3:`title.class`},contains:[c,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:`new throw return else`,relevance:0},{begin:[`(?:`+r+`\\s+)`,e.UNDERSCORE_IDENT_RE,/\s*(?=\()/],className:{2:`title.function`},keywords:i,contains:[{className:`params`,begin:/\(/,end:/\)/,keywords:i,relevance:0,contains:[s,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,a,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},a,s]}}t.exports=s})),Ho=o(((e,t)=>{var n=`[A-Za-z$_][0-9A-Za-z$_]*`,r=`as.in.of.if.for.while.finally.var.new.function.do.return.void.else.break.catch.instanceof.with.throw.case.default.try.switch.continue.typeof.delete.let.yield.const.class.debugger.async.await.static.import.from.export.extends.using`.split(`.`),i=[`true`,`false`,`null`,`undefined`,`NaN`,`Infinity`],a=`Object.Function.Boolean.Symbol.Math.Date.Number.BigInt.String.RegExp.Array.Float32Array.Float64Array.Int8Array.Uint8Array.Uint8ClampedArray.Int16Array.Int32Array.Uint16Array.Uint32Array.BigInt64Array.BigUint64Array.Set.Map.WeakSet.WeakMap.ArrayBuffer.SharedArrayBuffer.Atomics.DataView.JSON.Promise.Generator.GeneratorFunction.AsyncFunction.Reflect.Proxy.Intl.WebAssembly`.split(`.`),o=[`Error`,`EvalError`,`InternalError`,`RangeError`,`ReferenceError`,`SyntaxError`,`TypeError`,`URIError`],s=[`setInterval`,`setTimeout`,`clearInterval`,`clearTimeout`,`require`,`exports`,`eval`,`isFinite`,`isNaN`,`parseFloat`,`parseInt`,`decodeURI`,`decodeURIComponent`,`encodeURI`,`encodeURIComponent`,`escape`,`unescape`],c=[`arguments`,`this`,`super`,`console`,`window`,`document`,`localStorage`,`sessionStorage`,`module`,`global`],l=[].concat(s,a,o);function u(e){let t=e.regex,u=(e,{after:t})=>{let n=`</`+e[0].slice(1);return e.input.indexOf(n,t)!==-1},d=n,f={begin:`<>`,end:`</>`},p=/<[A-Za-z0-9\\._:-]+\s*\/>/,m={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(e,t)=>{let n=e[0].length+e.index,r=e.input[n];if(r===`<`||r===`,`){t.ignoreMatch();return}r===`>`&&(u(e,{after:n})||t.ignoreMatch());let i,a=e.input.substring(n);if(i=a.match(/^\s*=/)){t.ignoreMatch();return}if((i=a.match(/^\s+extends\s+/))&&i.index===0){t.ignoreMatch();return}}},h={$pattern:n,keyword:r,literal:i,built_in:l,"variable.language":c},g=`[0-9](_?[0-9])*`,_=`\\.(${g})`,v=`0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*`,y={className:`number`,variants:[{begin:`(\\b(${v})((${_})|\\.)?|(${_}))[eE][+-]?(${g})\\b`},{begin:`\\b(${v})\\b((${_})\\b|\\.)?|(${_})\\b`},{begin:`\\b(0|[1-9](_?[0-9])*)n\\b`},{begin:`\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b`},{begin:`\\b0[bB][0-1](_?[0-1])*n?\\b`},{begin:`\\b0[oO][0-7](_?[0-7])*n?\\b`},{begin:`\\b0[0-7]+n?\\b`}],relevance:0},b={className:`subst`,begin:`\\$\\{`,end:`\\}`,keywords:h,contains:[]},x={begin:".?html`",end:``,starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,b],subLanguage:`xml`}},S={begin:".?css`",end:``,starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,b],subLanguage:`css`}},C={begin:".?gql`",end:``,starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,b],subLanguage:`graphql`}},w={className:`string`,begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,b]},T={className:`comment`,variants:[e.COMMENT(/\/\*\*(?!\/)/,`\\*/`,{relevance:0,contains:[{begin:`(?=@[A-Za-z]+)`,relevance:0,contains:[{className:`doctag`,begin:`@[A-Za-z]+`},{className:`type`,begin:`\\{`,end:`\\}`,excludeEnd:!0,excludeBegin:!0,relevance:0},{className:`variable`,begin:d+`(?=\\s*(-)|$)`,endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},E=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,x,S,C,w,{match:/\$\d+/},y];b.contains=E.concat({begin:/\{/,end:/\}/,keywords:h,contains:[`self`].concat(E)});let D=[].concat(T,b.contains),O=D.concat([{begin:/(\s*)\(/,end:/\)/,keywords:h,contains:[`self`].concat(D)}]),k={className:`params`,begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:h,contains:O},A={variants:[{match:[/class/,/\s+/,d,/\s+/,/extends/,/\s+/,t.concat(d,`(`,t.concat(/\./,d),`)*`)],scope:{1:`keyword`,3:`title.class`,5:`keyword`,7:`title.class.inherited`}},{match:[/class/,/\s+/,d],scope:{1:`keyword`,3:`title.class`}}]},ee={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:`title.class`,keywords:{_:[...a,...o]}},j={label:`use_strict`,className:`meta`,relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},te={variants:[{match:[/function/,/\s+/,d,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:`keyword`,3:`title.function`},label:`func.def`,contains:[k],illegal:/%/},M={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:`variable.constant`};function ne(e){return t.concat(`(?!`,e.join(`|`),`)`)}let N={match:t.concat(/\b/,ne([...s,`super`,`import`].map(e=>`${e}\\s*\\(`)),d,t.lookahead(/\s*\(/)),className:`title.function`,relevance:0},P={begin:t.concat(/\./,t.lookahead(t.concat(d,/(?![0-9A-Za-z$_(])/))),end:d,excludeBegin:!0,keywords:`prototype`,className:`property`,relevance:0},re={match:[/get|set/,/\s+/,d,/(?=\()/],className:{1:`keyword`,3:`title.function`},contains:[{begin:/\(\)/},k]},F=`(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|`+e.UNDERSCORE_IDENT_RE+`)\\s*=>`,ie={match:[/const|var|let/,/\s+/,d,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(F)],keywords:`async`,className:{1:`keyword`,3:`title.function`},contains:[k]};return{name:`JavaScript`,aliases:[`js`,`jsx`,`mjs`,`cjs`],keywords:h,exports:{PARAMS_CONTAINS:O,CLASS_REFERENCE:ee},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:`shebang`,binary:`node`,relevance:5}),j,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,x,S,C,w,T,{match:/\$\d+/},y,ee,{scope:`attr`,match:d+t.lookahead(`:`),relevance:0},ie,{begin:`(`+e.RE_STARTERS_RE+`|\\b(case|return|throw)\\b)\\s*`,keywords:`return throw case`,relevance:0,contains:[T,e.REGEXP_MODE,{className:`function`,begin:F,returnBegin:!0,end:`\\s*=>`,contains:[{className:`params`,variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:h,contains:O}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:f.begin,end:f.end},{match:p},{begin:m.begin,"on:begin":m.isTrulyOpeningTag,end:m.end}],subLanguage:`xml`,contains:[{begin:m.begin,end:m.end,skip:!0,contains:[`self`]}]}]},te,{beginKeywords:`while if switch catch for`},{begin:`\\b(?!function)`+e.UNDERSCORE_IDENT_RE+`\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{`,returnBegin:!0,label:`func.def`,contains:[k,e.inherit(e.TITLE_MODE,{begin:d,className:`title.function`})]},{match:/\.\.\./,relevance:0},P,{match:`\\$`+d,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:`title.function`},contains:[k]},N,M,A,re,{match:/\$[(.]/}]}}t.exports=u})),Uo=o(((e,t)=>{function n(e){let t={className:`attr`,begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},n={match:/[{}[\],:]/,className:`punctuation`,relevance:0},r=[`true`,`false`,`null`],i={scope:`literal`,beginKeywords:r.join(` `)};return{name:`JSON`,aliases:[`jsonc`],keywords:{literal:r},contains:[t,n,e.QUOTE_STRING_MODE,i,e.C_NUMBER_MODE,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:`\\S`}}t.exports=n})),Wo=o(((e,t)=>{var n=`[0-9](_*[0-9])*`,r=`\\.(${n})`,i=`[0-9a-fA-F](_*[0-9a-fA-F])*`,a={className:`number`,variants:[{begin:`(\\b(${n})((${r})|\\.)?|(${r}))[eE][+-]?(${n})[fFdD]?\\b`},{begin:`\\b(${n})((${r})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${r})[fFdD]?\\b`},{begin:`\\b(${n})[fFdD]\\b`},{begin:`\\b0[xX]((${i})\\.?|(${i})?\\.(${i}))[pP][+-]?(${n})[fFdD]?\\b`},{begin:`\\b(0|[1-9](_*[0-9])*)[lL]?\\b`},{begin:`\\b0[xX](${i})[lL]?\\b`},{begin:`\\b0(_*[0-7])*[lL]?\\b`},{begin:`\\b0[bB][01](_*[01])*[lL]?\\b`}],relevance:0};function o(e){let t={keyword:`abstract as val var vararg get set class object open private protected public noinline crossinline dynamic final enum if else do while for when throw try catch finally import package is in fun override companion reified inline lateinit init interface annotation data sealed internal infix operator out by constructor super tailrec where const inner suspend typealias external expect actual`,built_in:`Byte Short Char Int Long Boolean Float Double Void Unit Nothing`,literal:`true false null`},n={className:`keyword`,begin:/\b(break|continue|return|this)\b/,starts:{contains:[{className:`symbol`,begin:/@\w+/}]}},r={className:`symbol`,begin:e.UNDERSCORE_IDENT_RE+`@`},i={className:`subst`,begin:/\$\{/,end:/\}/,contains:[e.C_NUMBER_MODE]},o={className:`variable`,begin:`\\$`+e.UNDERSCORE_IDENT_RE},s={className:`string`,variants:[{begin:`"""`,end:`"""(?=[^"])`,contains:[o,i]},{begin:`'`,end:`'`,illegal:/\n/,contains:[e.BACKSLASH_ESCAPE]},{begin:`"`,end:`"`,illegal:/\n/,contains:[e.BACKSLASH_ESCAPE,o,i]}]};i.contains.push(s);let c={className:`meta`,begin:`@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\s*:(?:\\s*`+e.UNDERSCORE_IDENT_RE+`)?`},l={className:`meta`,begin:`@`+e.UNDERSCORE_IDENT_RE,contains:[{begin:/\(/,end:/\)/,contains:[e.inherit(s,{className:`string`}),`self`]}]},u=a,d=e.COMMENT(`/\\*`,`\\*/`,{contains:[e.C_BLOCK_COMMENT_MODE]}),f={variants:[{className:`type`,begin:e.UNDERSCORE_IDENT_RE},{begin:/\(/,end:/\)/,contains:[]}]},p=f;return p.variants[1].contains=[f],f.variants[1].contains=[p],{name:`Kotlin`,aliases:[`kt`,`kts`],keywords:t,contains:[e.COMMENT(`/\\*\\*`,`\\*/`,{relevance:0,contains:[{className:`doctag`,begin:`@[A-Za-z]+`}]}),e.C_LINE_COMMENT_MODE,d,n,r,c,l,{className:`function`,beginKeywords:`fun`,end:`[(]|$`,returnBegin:!0,excludeEnd:!0,keywords:t,relevance:5,contains:[{begin:e.UNDERSCORE_IDENT_RE+`\\s*\\(`,returnBegin:!0,relevance:0,contains:[e.UNDERSCORE_TITLE_MODE]},{className:`type`,begin:/</,end:/>/,keywords:`reified`,relevance:0},{className:`params`,begin:/\(/,end:/\)/,endsParent:!0,keywords:t,relevance:0,contains:[{begin:/:/,end:/[=,\/]/,endsWithParent:!0,contains:[f,e.C_LINE_COMMENT_MODE,d],relevance:0},e.C_LINE_COMMENT_MODE,d,c,l,s,e.C_NUMBER_MODE]},d]},{begin:[/class|interface|trait/,/\s+/,e.UNDERSCORE_IDENT_RE],beginScope:{3:`title.class`},keywords:`class interface trait`,end:/[:\{(]|$/,excludeEnd:!0,illegal:`extends implements`,contains:[{beginKeywords:`public protected internal private constructor`},e.UNDERSCORE_TITLE_MODE,{className:`type`,begin:/</,end:/>/,excludeBegin:!0,excludeEnd:!0,relevance:0},{className:`type`,begin:/[,:]\s*/,end:/[<\(,){\s]|$/,excludeBegin:!0,returnEnd:!0},c,l]},s,{className:`meta`,begin:`^#!/usr/bin/env`,end:`$`,illegal:`
|
|
81
|
-
`},u]}}t.exports=o})),Go=o(((e,t)=>{var n=e=>({IMPORTANT:{scope:`meta`,begin:`!important`},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:`number`,begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:`built_in`,begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:`selector-attr`,begin:/\[/,end:/\]/,illegal:`$`,contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:`number`,begin:e.NUMBER_RE+`(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?`,relevance:0},CSS_VARIABLE:{className:`attr`,begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),r=`a.abbr.address.article.aside.audio.b.blockquote.body.button.canvas.caption.cite.code.dd.del.details.dfn.div.dl.dt.em.fieldset.figcaption.figure.footer.form.h1.h2.h3.h4.h5.h6.header.hgroup.html.i.iframe.img.input.ins.kbd.label.legend.li.main.mark.menu.nav.object.ol.optgroup.option.p.picture.q.quote.samp.section.select.source.span.strong.summary.sup.table.tbody.td.textarea.tfoot.th.thead.time.tr.ul.var.video`.split(`.`),i=`defs.g.marker.mask.pattern.svg.switch.symbol.feBlend.feColorMatrix.feComponentTransfer.feComposite.feConvolveMatrix.feDiffuseLighting.feDisplacementMap.feFlood.feGaussianBlur.feImage.feMerge.feMorphology.feOffset.feSpecularLighting.feTile.feTurbulence.linearGradient.radialGradient.stop.circle.ellipse.image.line.path.polygon.polyline.rect.text.use.textPath.tspan.foreignObject.clipPath`.split(`.`),a=[...r,...i],o=`any-hover.any-pointer.aspect-ratio.color.color-gamut.color-index.device-aspect-ratio.device-height.device-width.display-mode.forced-colors.grid.height.hover.inverted-colors.monochrome.orientation.overflow-block.overflow-inline.pointer.prefers-color-scheme.prefers-contrast.prefers-reduced-motion.prefers-reduced-transparency.resolution.scan.scripting.update.width.min-width.max-width.min-height.max-height`.split(`.`).sort().reverse(),s=`active.any-link.blank.checked.current.default.defined.dir.disabled.drop.empty.enabled.first.first-child.first-of-type.fullscreen.future.focus.focus-visible.focus-within.has.host.host-context.hover.indeterminate.in-range.invalid.is.lang.last-child.last-of-type.left.link.local-link.not.nth-child.nth-col.nth-last-child.nth-last-col.nth-last-of-type.nth-of-type.only-child.only-of-type.optional.out-of-range.past.placeholder-shown.read-only.read-write.required.right.root.scope.target.target-within.user-invalid.valid.visited.where`.split(`.`).sort().reverse(),c=[`after`,`backdrop`,`before`,`cue`,`cue-region`,`first-letter`,`first-line`,`grammar-error`,`marker`,`part`,`placeholder`,`selection`,`slotted`,`spelling-error`].sort().reverse(),l=`accent-color.align-content.align-items.align-self.alignment-baseline.all.anchor-name.animation.animation-composition.animation-delay.animation-direction.animation-duration.animation-fill-mode.animation-iteration-count.animation-name.animation-play-state.animation-range.animation-range-end.animation-range-start.animation-timeline.animation-timing-function.appearance.aspect-ratio.backdrop-filter.backface-visibility.background.background-attachment.background-blend-mode.background-clip.background-color.background-image.background-origin.background-position.background-position-x.background-position-y.background-repeat.background-size.baseline-shift.block-size.border.border-block.border-block-color.border-block-end.border-block-end-color.border-block-end-style.border-block-end-width.border-block-start.border-block-start-color.border-block-start-style.border-block-start-width.border-block-style.border-block-width.border-bottom.border-bottom-color.border-bottom-left-radius.border-bottom-right-radius.border-bottom-style.border-bottom-width.border-collapse.border-color.border-end-end-radius.border-end-start-radius.border-image.border-image-outset.border-image-repeat.border-image-slice.border-image-source.border-image-width.border-inline.border-inline-color.border-inline-end.border-inline-end-color.border-inline-end-style.border-inline-end-width.border-inline-start.border-inline-start-color.border-inline-start-style.border-inline-start-width.border-inline-style.border-inline-width.border-left.border-left-color.border-left-style.border-left-width.border-radius.border-right.border-right-color.border-right-style.border-right-width.border-spacing.border-start-end-radius.border-start-start-radius.border-style.border-top.border-top-color.border-top-left-radius.border-top-right-radius.border-top-style.border-top-width.border-width.bottom.box-align.box-decoration-break.box-direction.box-flex.box-flex-group.box-lines.box-ordinal-group.box-orient.box-pack.box-shadow.box-sizing.break-after.break-before.break-inside.caption-side.caret-color.clear.clip.clip-path.clip-rule.color.color-interpolation.color-interpolation-filters.color-profile.color-rendering.color-scheme.column-count.column-fill.column-gap.column-rule.column-rule-color.column-rule-style.column-rule-width.column-span.column-width.columns.contain.contain-intrinsic-block-size.contain-intrinsic-height.contain-intrinsic-inline-size.contain-intrinsic-size.contain-intrinsic-width.container.container-name.container-type.content.content-visibility.counter-increment.counter-reset.counter-set.cue.cue-after.cue-before.cursor.cx.cy.direction.display.dominant-baseline.empty-cells.enable-background.field-sizing.fill.fill-opacity.fill-rule.filter.flex.flex-basis.flex-direction.flex-flow.flex-grow.flex-shrink.flex-wrap.float.flood-color.flood-opacity.flow.font.font-display.font-family.font-feature-settings.font-kerning.font-language-override.font-optical-sizing.font-palette.font-size.font-size-adjust.font-smooth.font-smoothing.font-stretch.font-style.font-synthesis.font-synthesis-position.font-synthesis-small-caps.font-synthesis-style.font-synthesis-weight.font-variant.font-variant-alternates.font-variant-caps.font-variant-east-asian.font-variant-emoji.font-variant-ligatures.font-variant-numeric.font-variant-position.font-variation-settings.font-weight.forced-color-adjust.gap.glyph-orientation-horizontal.glyph-orientation-vertical.grid.grid-area.grid-auto-columns.grid-auto-flow.grid-auto-rows.grid-column.grid-column-end.grid-column-start.grid-gap.grid-row.grid-row-end.grid-row-start.grid-template.grid-template-areas.grid-template-columns.grid-template-rows.hanging-punctuation.height.hyphenate-character.hyphenate-limit-chars.hyphens.icon.image-orientation.image-rendering.image-resolution.ime-mode.initial-letter.initial-letter-align.inline-size.inset.inset-area.inset-block.inset-block-end.inset-block-start.inset-inline.inset-inline-end.inset-inline-start.isolation.justify-content.justify-items.justify-self.kerning.left.letter-spacing.lighting-color.line-break.line-height.line-height-step.list-style.list-style-image.list-style-position.list-style-type.margin.margin-block.margin-block-end.margin-block-start.margin-bottom.margin-inline.margin-inline-end.margin-inline-start.margin-left.margin-right.margin-top.margin-trim.marker.marker-end.marker-mid.marker-start.marks.mask.mask-border.mask-border-mode.mask-border-outset.mask-border-repeat.mask-border-slice.mask-border-source.mask-border-width.mask-clip.mask-composite.mask-image.mask-mode.mask-origin.mask-position.mask-repeat.mask-size.mask-type.masonry-auto-flow.math-depth.math-shift.math-style.max-block-size.max-height.max-inline-size.max-width.min-block-size.min-height.min-inline-size.min-width.mix-blend-mode.nav-down.nav-index.nav-left.nav-right.nav-up.none.normal.object-fit.object-position.offset.offset-anchor.offset-distance.offset-path.offset-position.offset-rotate.opacity.order.orphans.outline.outline-color.outline-offset.outline-style.outline-width.overflow.overflow-anchor.overflow-block.overflow-clip-margin.overflow-inline.overflow-wrap.overflow-x.overflow-y.overlay.overscroll-behavior.overscroll-behavior-block.overscroll-behavior-inline.overscroll-behavior-x.overscroll-behavior-y.padding.padding-block.padding-block-end.padding-block-start.padding-bottom.padding-inline.padding-inline-end.padding-inline-start.padding-left.padding-right.padding-top.page.page-break-after.page-break-before.page-break-inside.paint-order.pause.pause-after.pause-before.perspective.perspective-origin.place-content.place-items.place-self.pointer-events.position.position-anchor.position-visibility.print-color-adjust.quotes.r.resize.rest.rest-after.rest-before.right.rotate.row-gap.ruby-align.ruby-position.scale.scroll-behavior.scroll-margin.scroll-margin-block.scroll-margin-block-end.scroll-margin-block-start.scroll-margin-bottom.scroll-margin-inline.scroll-margin-inline-end.scroll-margin-inline-start.scroll-margin-left.scroll-margin-right.scroll-margin-top.scroll-padding.scroll-padding-block.scroll-padding-block-end.scroll-padding-block-start.scroll-padding-bottom.scroll-padding-inline.scroll-padding-inline-end.scroll-padding-inline-start.scroll-padding-left.scroll-padding-right.scroll-padding-top.scroll-snap-align.scroll-snap-stop.scroll-snap-type.scroll-timeline.scroll-timeline-axis.scroll-timeline-name.scrollbar-color.scrollbar-gutter.scrollbar-width.shape-image-threshold.shape-margin.shape-outside.shape-rendering.speak.speak-as.src.stop-color.stop-opacity.stroke.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke-width.tab-size.table-layout.text-align.text-align-all.text-align-last.text-anchor.text-combine-upright.text-decoration.text-decoration-color.text-decoration-line.text-decoration-skip.text-decoration-skip-ink.text-decoration-style.text-decoration-thickness.text-emphasis.text-emphasis-color.text-emphasis-position.text-emphasis-style.text-indent.text-justify.text-orientation.text-overflow.text-rendering.text-shadow.text-size-adjust.text-transform.text-underline-offset.text-underline-position.text-wrap.text-wrap-mode.text-wrap-style.timeline-scope.top.touch-action.transform.transform-box.transform-origin.transform-style.transition.transition-behavior.transition-delay.transition-duration.transition-property.transition-timing-function.translate.unicode-bidi.user-modify.user-select.vector-effect.vertical-align.view-timeline.view-timeline-axis.view-timeline-inset.view-timeline-name.view-transition-name.visibility.voice-balance.voice-duration.voice-family.voice-pitch.voice-range.voice-rate.voice-stress.voice-volume.white-space.white-space-collapse.widows.width.will-change.word-break.word-spacing.word-wrap.writing-mode.x.y.z-index.zoom`.split(`.`).sort().reverse(),u=s.concat(c).sort().reverse();function d(e){let t=n(e),r=u,i=`[\\w-]+`,d=`(`+i+`|@\\{[\\w-]+\\})`,f=[],p=[],m=function(e){return{className:`string`,begin:`~?`+e+`.*?`+e}},h=function(e,t,n){return{className:e,begin:t,relevance:n}},g={$pattern:/[a-z-]+/,keyword:`and or not only`,attribute:o.join(` `)},_={begin:`\\(`,end:`\\)`,contains:p,keywords:g,relevance:0};p.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,m(`'`),m(`"`),t.CSS_NUMBER_MODE,{begin:`(url|data-uri)\\(`,starts:{className:`string`,end:`[\\)\\n]`,excludeEnd:!0}},t.HEXCOLOR,_,h(`variable`,`@@?`+i,10),h(`variable`,`@\\{`+i+`\\}`),h(`built_in`,"~?`[^`]*?`"),{className:`attribute`,begin:i+`\\s*:`,end:`:`,returnBegin:!0,excludeEnd:!0},t.IMPORTANT,{beginKeywords:`and not`},t.FUNCTION_DISPATCH);let v=p.concat({begin:/\{/,end:/\}/,contains:f}),y={beginKeywords:`when`,endsWithParent:!0,contains:[{beginKeywords:`and not`}].concat(p)},b={begin:d+`\\s*:`,returnBegin:!0,end:/[;}]/,relevance:0,contains:[{begin:/-(webkit|moz|ms|o)-/},t.CSS_VARIABLE,{className:`attribute`,begin:`\\b(`+l.join(`|`)+`)\\b`,end:/(?=:)/,starts:{endsWithParent:!0,illegal:`[<=$]`,relevance:0,contains:p}}]},x={className:`keyword`,begin:`@(import|media|charset|font-face|(-[a-z]+-)?keyframes|supports|document|namespace|page|viewport|host)\\b`,starts:{end:`[;{}]`,keywords:g,returnEnd:!0,contains:p,relevance:0}},S={className:`variable`,variants:[{begin:`@`+i+`\\s*:`,relevance:15},{begin:`@`+i}],starts:{end:`[;}]`,returnEnd:!0,contains:v}},C={variants:[{begin:`[\\.#:&\\[>]`,end:`[;{}]`},{begin:d,end:/\{/}],returnBegin:!0,returnEnd:!0,illegal:`[<='$"]`,relevance:0,contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,y,h(`keyword`,`all\\b`),h(`variable`,`@\\{`+i+`\\}`),{begin:`\\b(`+a.join(`|`)+`)\\b`,className:`selector-tag`},t.CSS_NUMBER_MODE,h(`selector-tag`,d,0),h(`selector-id`,`#`+d),h(`selector-class`,`\\.`+d,0),h(`selector-tag`,`&`,0),t.ATTRIBUTE_SELECTOR_MODE,{className:`selector-pseudo`,begin:`:(`+s.join(`|`)+`)`},{className:`selector-pseudo`,begin:`:(:)?(`+c.join(`|`)+`)`},{begin:/\(/,end:/\)/,relevance:0,contains:v},{begin:`!important`},t.FUNCTION_DISPATCH]},w={begin:`[\\w-]+:(:)?(${r.join(`|`)})`,returnBegin:!0,contains:[C]};return f.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,x,S,w,b,C,y,t.FUNCTION_DISPATCH),{name:`Less`,case_insensitive:!0,illegal:`[=>'/<($"]`,contains:f}}t.exports=d})),Ko=o(((e,t)=>{function n(e){let t=`\\[=*\\[`,n=`\\]=*\\]`,r={begin:t,end:n,contains:[`self`]},i=[e.COMMENT(`--(?!`+t+`)`,`$`),e.COMMENT(`--`+t,n,{contains:[r],relevance:10})];return{name:`Lua`,aliases:[`pluto`],keywords:{$pattern:e.UNDERSCORE_IDENT_RE,literal:`true false nil`,keyword:`and break do else elseif end for goto if in local not or repeat return then until while`,built_in:`_G _ENV _VERSION __index __newindex __mode __call __metatable __tostring __len __gc __add __sub __mul __div __mod __pow __concat __unm __eq __lt __le assert collectgarbage dofile error getfenv getmetatable ipairs load loadfile loadstring module next pairs pcall print rawequal rawget rawset require select setfenv setmetatable tonumber tostring type unpack xpcall arg self coroutine resume yield status wrap create running debug getupvalue debug sethook getmetatable gethook setmetatable setlocal traceback setfenv getinfo setupvalue getlocal getregistry getfenv io lines write close flush open output type read stderr stdin input stdout popen tmpfile math log max acos huge ldexp pi cos tanh pow deg tan cosh sinh random randomseed frexp ceil floor rad abs sqrt modf asin min mod fmod log10 atan2 exp sin atan os exit setlocale date getenv difftime remove time clock tmpname rename execute package preload loadlib loaded loaders cpath config path seeall string sub upper len gfind rep find match char dump gmatch reverse byte format gsub lower table setn insert getn foreachi maxn foreach concat sort remove`},contains:i.concat([{className:`function`,beginKeywords:`function`,end:`\\)`,contains:[e.inherit(e.TITLE_MODE,{begin:`([_a-zA-Z]\\w*\\.)*([_a-zA-Z]\\w*:)?[_a-zA-Z]\\w*`}),{className:`params`,begin:`\\(`,endsWithParent:!0,contains:i}].concat(i)},e.C_NUMBER_MODE,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{className:`string`,begin:t,end:n,contains:[r],relevance:5}])}}t.exports=n})),qo=o(((e,t)=>{function n(e){let t={className:`variable`,variants:[{begin:`\\$\\(`+e.UNDERSCORE_IDENT_RE+`\\)`,contains:[e.BACKSLASH_ESCAPE]},{begin:/\$[@%<?\^\+\*]/}]},n={className:`string`,begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,t]},r={className:`variable`,begin:/\$\([\w-]+\s/,end:/\)/,keywords:{built_in:`subst patsubst strip findstring filter filter-out sort word wordlist firstword lastword dir notdir suffix basename addsuffix addprefix join wildcard realpath abspath error warning shell origin flavor foreach if or and call eval file value`},contains:[t,n]},i={begin:`^`+e.UNDERSCORE_IDENT_RE+`\\s*(?=[:+?]?=)`},a={className:`meta`,begin:/^\.PHONY:/,end:/$/,keywords:{$pattern:/[\.\w]+/,keyword:`.PHONY`}},o={className:`section`,begin:/^[^\s]+:/,end:/$/,contains:[t]};return{name:`Makefile`,aliases:[`mk`,`mak`,`make`],keywords:{$pattern:/[\w-]+/,keyword:`define endef undefine ifdef ifndef ifeq ifneq else endif include -include sinclude override export unexport private vpath`},contains:[e.HASH_COMMENT_MODE,t,n,r,i,a,o]}}t.exports=n})),Jo=o(((e,t)=>{function n(e){let t=e.regex,n=`abs.accept.alarm.and.atan2.bind.binmode.bless.break.caller.chdir.chmod.chomp.chop.chown.chr.chroot.class.close.closedir.connect.continue.cos.crypt.dbmclose.dbmopen.defined.delete.die.do.dump.each.else.elsif.endgrent.endhostent.endnetent.endprotoent.endpwent.endservent.eof.eval.exec.exists.exit.exp.fcntl.field.fileno.flock.for.foreach.fork.format.formline.getc.getgrent.getgrgid.getgrnam.gethostbyaddr.gethostbyname.gethostent.getlogin.getnetbyaddr.getnetbyname.getnetent.getpeername.getpgrp.getpriority.getprotobyname.getprotobynumber.getprotoent.getpwent.getpwnam.getpwuid.getservbyname.getservbyport.getservent.getsockname.getsockopt.given.glob.gmtime.goto.grep.gt.hex.if.index.int.ioctl.join.keys.kill.last.lc.lcfirst.length.link.listen.local.localtime.log.lstat.lt.ma.map.method.mkdir.msgctl.msgget.msgrcv.msgsnd.my.ne.next.no.not.oct.open.opendir.or.ord.our.pack.package.pipe.pop.pos.print.printf.prototype.push.q|0.qq.quotemeta.qw.qx.rand.read.readdir.readline.readlink.readpipe.recv.redo.ref.rename.require.reset.return.reverse.rewinddir.rindex.rmdir.say.scalar.seek.seekdir.select.semctl.semget.semop.send.setgrent.sethostent.setnetent.setpgrp.setpriority.setprotoent.setpwent.setservent.setsockopt.shift.shmctl.shmget.shmread.shmwrite.shutdown.sin.sleep.socket.socketpair.sort.splice.split.sprintf.sqrt.srand.stat.state.study.sub.substr.symlink.syscall.sysopen.sysread.sysseek.system.syswrite.tell.telldir.tie.tied.time.times.tr.truncate.uc.ucfirst.umask.undef.unless.unlink.unpack.unshift.untie.until.use.utime.values.vec.wait.waitpid.wantarray.warn.when.while.write.x|0.xor.y|0`.split(`.`),r=/[dualxmsipngr]{0,12}/,i={$pattern:/[\w.]+/,keyword:n.join(` `)},a={className:`subst`,begin:`[$@]\\{`,end:`\\}`,keywords:i},o={begin:/->\{/,end:/\}/},s={scope:`attr`,match:/\s+:\s*\w+(\s*\(.*?\))?/},c={scope:`variable`,variants:[{begin:/\$\d/},{begin:t.concat(/[$%@](?!")(\^\w\b|#\w+(::\w+)*|\{\w+\}|\w+(::\w*)*)/,`(?![A-Za-z])(?![@$%])`)},{begin:/[$%@](?!")[^\s\w{=]|\$=/,relevance:0}],contains:[s]},l={className:`number`,variants:[{match:/0?\.[0-9][0-9_]+\b/},{match:/\bv?(0|[1-9][0-9_]*(\.[0-9_]+)?|[1-9][0-9_]*)\b/},{match:/\b0[0-7][0-7_]*\b/},{match:/\b0x[0-9a-fA-F][0-9a-fA-F_]*\b/},{match:/\b0b[0-1][0-1_]*\b/}],relevance:0},u=[e.BACKSLASH_ESCAPE,a,c],d=[/!/,/\//,/\|/,/\?/,/'/,/"/,/#/],f=(e,n,i=`\\1`)=>{let a=i===`\\1`?i:t.concat(i,n);return t.concat(t.concat(`(?:`,e,`)`),n,/(?:\\.|[^\\\/])*?/,a,/(?:\\.|[^\\\/])*?/,i,r)},p=(e,n,i)=>t.concat(t.concat(`(?:`,e,`)`),n,/(?:\\.|[^\\\/])*?/,i,r),m=[c,e.HASH_COMMENT_MODE,e.COMMENT(/^=\w/,/=cut/,{endsWithParent:!0}),o,{className:`string`,contains:u,variants:[{begin:`q[qwxr]?\\s*\\(`,end:`\\)`,relevance:5},{begin:`q[qwxr]?\\s*\\[`,end:`\\]`,relevance:5},{begin:`q[qwxr]?\\s*\\{`,end:`\\}`,relevance:5},{begin:`q[qwxr]?\\s*\\|`,end:`\\|`,relevance:5},{begin:`q[qwxr]?\\s*<`,end:`>`,relevance:5},{begin:`qw\\s+q`,end:`q`,relevance:5},{begin:`'`,end:`'`,contains:[e.BACKSLASH_ESCAPE]},{begin:`"`,end:`"`},{begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE]},{begin:/\{\w+\}/,relevance:0},{begin:`-?\\w+\\s*=>`,relevance:0}]},l,{begin:`(\\/\\/|`+e.RE_STARTERS_RE+`|\\b(split|return|print|reverse|grep)\\b)\\s*`,keywords:`split return print reverse grep`,relevance:0,contains:[e.HASH_COMMENT_MODE,{className:`regexp`,variants:[{begin:f(`s|tr|y`,t.either(...d,{capture:!0}))},{begin:f(`s|tr|y`,`\\(`,`\\)`)},{begin:f(`s|tr|y`,`\\[`,`\\]`)},{begin:f(`s|tr|y`,`\\{`,`\\}`)}],relevance:2},{className:`regexp`,variants:[{begin:/(m|qr)\/\//,relevance:0},{begin:p(`(?:m|qr)?`,/\//,/\//)},{begin:p(`m|qr`,t.either(...d,{capture:!0}),/\1/)},{begin:p(`m|qr`,/\(/,/\)/)},{begin:p(`m|qr`,/\[/,/\]/)},{begin:p(`m|qr`,/\{/,/\}/)}]}]},{className:`function`,beginKeywords:`sub method`,end:`(\\s*\\(.*?\\))?[;{]`,excludeEnd:!0,relevance:5,contains:[e.TITLE_MODE,s]},{className:`class`,beginKeywords:`class`,end:`[;{]`,excludeEnd:!0,relevance:5,contains:[e.TITLE_MODE,s,l]},{begin:`-\\w\\b`,relevance:0},{begin:`^__DATA__$`,end:`^__END__$`,subLanguage:`mojolicious`,contains:[{begin:`^@@.*`,end:`$`,className:`comment`}]}];return a.contains=m,o.contains=m,{name:`Perl`,aliases:[`pl`,`pm`],keywords:i,contains:m}}t.exports=n})),Yo=o(((e,t)=>{function n(e){let t={className:`built_in`,begin:`\\b(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)\\w+`},n=/[a-zA-Z@][a-zA-Z0-9_]*/,r={"variable.language":[`this`,`super`],$pattern:n,keyword:`while.export.sizeof.typedef.const.struct.for.union.volatile.static.mutable.if.do.return.goto.enum.else.break.extern.asm.case.default.register.explicit.typename.switch.continue.inline.readonly.assign.readwrite.self.@synchronized.id.typeof.nonatomic.IBOutlet.IBAction.strong.weak.copy.in.out.inout.bycopy.byref.oneway.__strong.__weak.__block.__autoreleasing.@private.@protected.@public.@try.@property.@end.@throw.@catch.@finally.@autoreleasepool.@synthesize.@dynamic.@selector.@optional.@required.@encode.@package.@import.@defs.@compatibility_alias.__bridge.__bridge_transfer.__bridge_retained.__bridge_retain.__covariant.__contravariant.__kindof._Nonnull._Nullable._Null_unspecified.__FUNCTION__.__PRETTY_FUNCTION__.__attribute__.getter.setter.retain.unsafe_unretained.nonnull.nullable.null_unspecified.null_resettable.class.instancetype.NS_DESIGNATED_INITIALIZER.NS_UNAVAILABLE.NS_REQUIRES_SUPER.NS_RETURNS_INNER_POINTER.NS_INLINE.NS_AVAILABLE.NS_DEPRECATED.NS_ENUM.NS_OPTIONS.NS_SWIFT_UNAVAILABLE.NS_ASSUME_NONNULL_BEGIN.NS_ASSUME_NONNULL_END.NS_REFINED_FOR_SWIFT.NS_SWIFT_NAME.NS_SWIFT_NOTHROW.NS_DURING.NS_HANDLER.NS_ENDHANDLER.NS_VALUERETURN.NS_VOIDRETURN`.split(`.`),literal:[`false`,`true`,`FALSE`,`TRUE`,`nil`,`YES`,`NO`,`NULL`],built_in:[`dispatch_once_t`,`dispatch_queue_t`,`dispatch_sync`,`dispatch_async`,`dispatch_once`],type:[`int`,`float`,`char`,`unsigned`,`signed`,`short`,`long`,`double`,`wchar_t`,`unichar`,`void`,`bool`,`BOOL`,`id|0`,`_Bool`]},i={$pattern:n,keyword:[`@interface`,`@class`,`@protocol`,`@implementation`]};return{name:`Objective-C`,aliases:[`mm`,`objc`,`obj-c`,`obj-c++`,`objective-c++`],keywords:r,illegal:`</`,contains:[t,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,e.C_NUMBER_MODE,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,{className:`string`,variants:[{begin:`@"`,end:`"`,illegal:`\\n`,contains:[e.BACKSLASH_ESCAPE]}]},{className:`meta`,begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:`if else elif endif define undef warning error line pragma ifdef ifndef include`},contains:[{begin:/\\\n/,relevance:0},e.inherit(e.QUOTE_STRING_MODE,{className:`string`}),{className:`string`,begin:/<.*?>/,end:/$/,illegal:`\\n`},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:`class`,begin:`(`+i.keyword.join(`|`)+`)\\b`,end:/(\{|$)/,excludeEnd:!0,keywords:i,contains:[e.UNDERSCORE_TITLE_MODE]},{begin:`\\.`+e.UNDERSCORE_IDENT_RE,relevance:0}]}}t.exports=n})),Xo=o(((e,t)=>{function n(e){let t=e.regex,n=/(?![A-Za-z0-9])(?![$])/,r=t.concat(/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/,n),i=t.concat(/(\\?[A-Z][a-z0-9_\x7f-\xff]+|\\?[A-Z]+(?=[A-Z][a-z0-9_\x7f-\xff])){1,}/,n),a=t.concat(/[A-Z]+/,n),o={scope:`variable`,match:`\\$+`+r},s={scope:`meta`,variants:[{begin:/<\?php/,relevance:10},{begin:/<\?=/},{begin:/<\?/,relevance:.1},{begin:/\?>/}]},c={scope:`subst`,variants:[{begin:/\$\w+/},{begin:/\{\$/,end:/\}/}]},l=e.inherit(e.APOS_STRING_MODE,{illegal:null}),u=e.inherit(e.QUOTE_STRING_MODE,{illegal:null,contains:e.QUOTE_STRING_MODE.contains.concat(c)}),d={begin:/<<<[ \t]*(?:(\w+)|"(\w+)")\n/,end:/[ \t]*(\w+)\b/,contains:e.QUOTE_STRING_MODE.contains.concat(c),"on:begin":(e,t)=>{t.data._beginMatch=e[1]||e[2]},"on:end":(e,t)=>{t.data._beginMatch!==e[1]&&t.ignoreMatch()}},f=e.END_SAME_AS_BEGIN({begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/}),p=`[
|
|
82
|
-
]`,m={scope:`string`,variants:[u,l,d,f]},h={scope:`number`,variants:[{begin:`\\b0[bB][01]+(?:_[01]+)*\\b`},{begin:`\\b0[oO][0-7]+(?:_[0-7]+)*\\b`},{begin:`\\b0[xX][\\da-fA-F]+(?:_[\\da-fA-F]+)*\\b`},{begin:`(?:\\b\\d+(?:_\\d+)*(\\.(?:\\d+(?:_\\d+)*))?|\\B\\.\\d+)(?:[eE][+-]?\\d+)?`}],relevance:0},g=[`false`,`null`,`true`],_=`__CLASS__.__DIR__.__FILE__.__FUNCTION__.__COMPILER_HALT_OFFSET__.__LINE__.__METHOD__.__NAMESPACE__.__TRAIT__.die.echo.exit.include.include_once.print.require.require_once.array.abstract.and.as.binary.bool.boolean.break.callable.case.catch.class.clone.const.continue.declare.default.do.double.else.elseif.empty.enddeclare.endfor.endforeach.endif.endswitch.endwhile.enum.eval.extends.final.finally.float.for.foreach.from.global.goto.if.implements.instanceof.insteadof.int.integer.interface.isset.iterable.list.match|0.mixed.new.never.object.or.private.protected.public.readonly.real.return.string.switch.throw.trait.try.unset.use.var.void.while.xor.yield`.split(`.`),v=`Error|0.AppendIterator.ArgumentCountError.ArithmeticError.ArrayIterator.ArrayObject.AssertionError.BadFunctionCallException.BadMethodCallException.CachingIterator.CallbackFilterIterator.CompileError.Countable.DirectoryIterator.DivisionByZeroError.DomainException.EmptyIterator.ErrorException.Exception.FilesystemIterator.FilterIterator.GlobIterator.InfiniteIterator.InvalidArgumentException.IteratorIterator.LengthException.LimitIterator.LogicException.MultipleIterator.NoRewindIterator.OutOfBoundsException.OutOfRangeException.OuterIterator.OverflowException.ParentIterator.ParseError.RangeException.RecursiveArrayIterator.RecursiveCachingIterator.RecursiveCallbackFilterIterator.RecursiveDirectoryIterator.RecursiveFilterIterator.RecursiveIterator.RecursiveIteratorIterator.RecursiveRegexIterator.RecursiveTreeIterator.RegexIterator.RuntimeException.SeekableIterator.SplDoublyLinkedList.SplFileInfo.SplFileObject.SplFixedArray.SplHeap.SplMaxHeap.SplMinHeap.SplObjectStorage.SplObserver.SplPriorityQueue.SplQueue.SplStack.SplSubject.SplTempFileObject.TypeError.UnderflowException.UnexpectedValueException.UnhandledMatchError.ArrayAccess.BackedEnum.Closure.Fiber.Generator.Iterator.IteratorAggregate.Serializable.Stringable.Throwable.Traversable.UnitEnum.WeakReference.WeakMap.Directory.__PHP_Incomplete_Class.parent.php_user_filter.self.static.stdClass`.split(`.`),y={keyword:_,literal:(e=>{let t=[];return e.forEach(e=>{t.push(e),e.toLowerCase()===e?t.push(e.toUpperCase()):t.push(e.toLowerCase())}),t})(g),built_in:v},b=e=>e.map(e=>e.replace(/\|\d+$/,``)),x={variants:[{match:[/new/,t.concat(p,`+`),t.concat(`(?!`,b(v).join(`\\b|`),`\\b)`),i],scope:{1:`keyword`,4:`title.class`}}]},S=t.concat(r,`\\b(?!\\()`),C={variants:[{match:[t.concat(/::/,t.lookahead(/(?!class\b)/)),S],scope:{2:`variable.constant`}},{match:[/::/,/class/],scope:{2:`variable.language`}},{match:[i,t.concat(/::/,t.lookahead(/(?!class\b)/)),S],scope:{1:`title.class`,3:`variable.constant`}},{match:[i,t.concat(`::`,t.lookahead(/(?!class\b)/))],scope:{1:`title.class`}},{match:[i,/::/,/class/],scope:{1:`title.class`,3:`variable.language`}}]},w={scope:`attr`,match:t.concat(r,t.lookahead(`:`),t.lookahead(/(?!::)/))},T={relevance:0,begin:/\(/,end:/\)/,keywords:y,contains:[w,o,C,e.C_BLOCK_COMMENT_MODE,m,h,x]},E={relevance:0,match:[/\b/,t.concat(`(?!fn\\b|function\\b|`,b(_).join(`\\b|`),`|`,b(v).join(`\\b|`),`\\b)`),r,t.concat(p,`*`),t.lookahead(/(?=\()/)],scope:{3:`title.function.invoke`},contains:[T]};T.contains.push(E);let D=[w,C,e.C_BLOCK_COMMENT_MODE,m,h,x],O={begin:t.concat(/#\[\s*\\?/,t.either(i,a)),beginScope:`meta`,end:/]/,endScope:`meta`,keywords:{literal:g,keyword:[`new`,`array`]},contains:[{begin:/\[/,end:/]/,keywords:{literal:g,keyword:[`new`,`array`]},contains:[`self`,...D]},...D,{scope:`meta`,variants:[{match:i},{match:a}]}]};return{case_insensitive:!1,keywords:y,contains:[O,e.HASH_COMMENT_MODE,e.COMMENT(`//`,`$`),e.COMMENT(`/\\*`,`\\*/`,{contains:[{scope:`doctag`,match:`@[A-Za-z]+`}]}),{match:/__halt_compiler\(\);/,keywords:`__halt_compiler`,starts:{scope:`comment`,end:e.MATCH_NOTHING_RE,contains:[{match:/\?>/,scope:`meta`,endsParent:!0}]}},s,{scope:`variable.language`,match:/\$this\b/},o,E,C,{match:[/const/,/\s/,r],scope:{1:`keyword`,3:`variable.constant`}},x,{scope:`function`,relevance:0,beginKeywords:`fn function`,end:/[;{]/,excludeEnd:!0,illegal:`[$%\\[]`,contains:[{beginKeywords:`use`},e.UNDERSCORE_TITLE_MODE,{begin:`=>`,endsParent:!0},{scope:`params`,begin:`\\(`,end:`\\)`,excludeBegin:!0,excludeEnd:!0,keywords:y,contains:[`self`,O,o,C,e.C_BLOCK_COMMENT_MODE,m,h]}]},{scope:`class`,variants:[{beginKeywords:`enum`,illegal:/[($"]/},{beginKeywords:`class interface trait`,illegal:/[:($"]/}],relevance:0,end:/\{/,excludeEnd:!0,contains:[{beginKeywords:`extends implements`},e.UNDERSCORE_TITLE_MODE]},{beginKeywords:`namespace`,relevance:0,end:`;`,illegal:/[.']/,contains:[e.inherit(e.UNDERSCORE_TITLE_MODE,{scope:`title.class`})]},{beginKeywords:`use`,relevance:0,end:`;`,contains:[{match:/\b(as|const|function)\b/,scope:`keyword`},e.UNDERSCORE_TITLE_MODE]},m,h]}}t.exports=n})),Zo=o(((e,t)=>{function n(e){return{name:`PHP template`,subLanguage:`xml`,contains:[{begin:/<\?(php|=)?/,end:/\?>/,subLanguage:`php`,contains:[{begin:`/\\*`,end:`\\*/`,skip:!0},{begin:`b"`,end:`"`,skip:!0},{begin:`b'`,end:`'`,skip:!0},e.inherit(e.APOS_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0}),e.inherit(e.QUOTE_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0})]}]}}t.exports=n})),Qo=o(((e,t)=>{function n(e){return{name:`Plain text`,aliases:[`text`,`txt`],disableAutodetect:!0}}t.exports=n})),$o=o(((e,t)=>{function n(e){let t=e.regex,n=/[\p{XID_Start}_]\p{XID_Continue}*/u,r=`and.as.assert.async.await.break.case.class.continue.def.del.elif.else.except.finally.for.from.global.if.import.in.is.lambda.match.nonlocal|10.not.or.pass.raise.return.try.while.with.yield`.split(`.`),i={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:r,built_in:`__import__.abs.all.any.ascii.bin.bool.breakpoint.bytearray.bytes.callable.chr.classmethod.compile.complex.delattr.dict.dir.divmod.enumerate.eval.exec.filter.float.format.frozenset.getattr.globals.hasattr.hash.help.hex.id.input.int.isinstance.issubclass.iter.len.list.locals.map.max.memoryview.min.next.object.oct.open.ord.pow.print.property.range.repr.reversed.round.set.setattr.slice.sorted.staticmethod.str.sum.super.tuple.type.vars.zip`.split(`.`),literal:[`__debug__`,`Ellipsis`,`False`,`None`,`NotImplemented`,`True`],type:[`Any`,`Callable`,`Coroutine`,`Dict`,`List`,`Literal`,`Generic`,`Optional`,`Sequence`,`Set`,`Tuple`,`Type`,`Union`]},a={className:`meta`,begin:/^(>>>|\.\.\.) /},o={className:`subst`,begin:/\{/,end:/\}/,keywords:i,illegal:/#/},s={begin:/\{\{/,relevance:0},c={className:`string`,contains:[e.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,a],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,a],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,a,s,o]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,a,s,o]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[e.BACKSLASH_ESCAPE,s,o]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,s,o]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},l=`[0-9](_?[0-9])*`,u=`(\\b(${l}))?\\.(${l})|\\b(${l})\\.`,d=`\\b|${r.join(`|`)}`,f={className:`number`,relevance:0,variants:[{begin:`(\\b(${l})|(${u}))[eE][+-]?(${l})[jJ]?(?=${d})`},{begin:`(${u})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${d})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${d})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${d})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${d})`},{begin:`\\b(${l})[jJ](?=${d})`}]},p={className:`comment`,begin:t.lookahead(/# type:/),end:/$/,keywords:i,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},m={className:`params`,variants:[{className:``,begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:i,contains:[`self`,a,f,c,e.HASH_COMMENT_MODE]}]};return o.contains=[c,f,a],{name:`Python`,aliases:[`py`,`gyp`,`ipython`],unicodeRegex:!0,keywords:i,illegal:/(<\/|\?)|=>/,contains:[a,f,{scope:`variable.language`,match:/\bself\b/},{beginKeywords:`if`,relevance:0},{match:/\bor\b/,scope:`keyword`},c,p,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,n],scope:{1:`keyword`,3:`title.function`},contains:[m]},{variants:[{match:[/\bclass/,/\s+/,n,/\s*/,/\(\s*/,n,/\s*\)/]},{match:[/\bclass/,/\s+/,n]}],scope:{1:`keyword`,3:`title.class`,6:`title.class.inherited`}},{className:`meta`,begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[f,m,c]}]}}t.exports=n})),es=o(((e,t)=>{function n(e){return{aliases:[`pycon`],contains:[{className:`meta.prompt`,starts:{end:/ |$/,starts:{end:`$`,subLanguage:`python`}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}}t.exports=n})),ts=o(((e,t)=>{function n(e){let t=e.regex,n=/(?:(?:[a-zA-Z]|\.[._a-zA-Z])[._a-zA-Z0-9]*)|\.(?!\d)/,r=t.either(/0[xX][0-9a-fA-F]+\.[0-9a-fA-F]*[pP][+-]?\d+i?/,/0[xX][0-9a-fA-F]+(?:[pP][+-]?\d+)?[Li]?/,/(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?[Li]?/),i=/[=!<>:]=|\|\||&&|:::?|<-|<<-|->>|->|\|>|[-+*\/?!$&|:<=>@^~]|\*\*/,a=t.either(/[()]/,/[{}]/,/\[\[/,/[[\]]/,/\\/,/,/);return{name:`R`,keywords:{$pattern:n,keyword:`function if in break next repeat else for while`,literal:`NULL NA TRUE FALSE Inf NaN NA_integer_|10 NA_real_|10 NA_character_|10 NA_complex_|10`,built_in:`LETTERS letters month.abb month.name pi T F abs acos acosh all any anyNA Arg as.call as.character as.complex as.double as.environment as.integer as.logical as.null.default as.numeric as.raw asin asinh atan atanh attr attributes baseenv browser c call ceiling class Conj cos cosh cospi cummax cummin cumprod cumsum digamma dim dimnames emptyenv exp expression floor forceAndCall gamma gc.time globalenv Im interactive invisible is.array is.atomic is.call is.character is.complex is.double is.environment is.expression is.finite is.function is.infinite is.integer is.language is.list is.logical is.matrix is.na is.name is.nan is.null is.numeric is.object is.pairlist is.raw is.recursive is.single is.symbol lazyLoadDBfetch length lgamma list log max min missing Mod names nargs nzchar oldClass on.exit pos.to.env proc.time prod quote range Re rep retracemem return round seq_along seq_len seq.int sign signif sin sinh sinpi sqrt standardGeneric substitute sum switch tan tanh tanpi tracemem trigamma trunc unclass untracemem UseMethod xtfrm`},contains:[e.COMMENT(/#'/,/$/,{contains:[{scope:`doctag`,match:/@examples/,starts:{end:t.lookahead(t.either(/\n^#'\s*(?=@[a-zA-Z]+)/,/\n^(?!#')/)),endsParent:!0}},{scope:`doctag`,begin:`@param`,end:/$/,contains:[{scope:`variable`,variants:[{match:n},{match:/`(?:\\.|[^`\\])+`/}],endsParent:!0}]},{scope:`doctag`,match:/@[a-zA-Z]+/},{scope:`keyword`,match:/\\[a-zA-Z]+/}]}),e.HASH_COMMENT_MODE,{scope:`string`,contains:[e.BACKSLASH_ESCAPE],variants:[e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\(/,end:/\)(-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\{/,end:/\}(-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\[/,end:/\](-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\(/,end:/\)(-*)'/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\{/,end:/\}(-*)'/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\[/,end:/\](-*)'/}),{begin:`"`,end:`"`,relevance:0},{begin:`'`,end:`'`,relevance:0}]},{relevance:0,variants:[{scope:{1:`operator`,2:`number`},match:[i,r]},{scope:{1:`operator`,2:`number`},match:[/%[^%]*%/,r]},{scope:{1:`punctuation`,2:`number`},match:[a,r]},{scope:{2:`number`},match:[/[^a-zA-Z0-9._]|^/,r]}]},{scope:{3:`operator`},match:[n,/\s+/,/<-/,/\s+/]},{scope:`operator`,relevance:0,variants:[{match:i},{match:/%[^%]*%/}]},{scope:`punctuation`,relevance:0,match:a},{begin:"`",end:"`",contains:[{begin:/\\./}]}]}}t.exports=n})),ns=o(((e,t)=>{function n(e){let t=e.regex,n=/(r#)?/,r=t.concat(n,e.UNDERSCORE_IDENT_RE),i=t.concat(n,e.IDENT_RE),a={className:`title.function.invoke`,relevance:0,begin:t.concat(/\b/,/(?!let|for|while|if|else|match\b)/,i,t.lookahead(/\s*\(/))},o=`([ui](8|16|32|64|128|size)|f(32|64))?`,s=`abstract.as.async.await.become.box.break.const.continue.crate.do.dyn.else.enum.extern.false.final.fn.for.if.impl.in.let.loop.macro.match.mod.move.mut.override.priv.pub.ref.return.self.Self.static.struct.super.trait.true.try.type.typeof.union.unsafe.unsized.use.virtual.where.while.yield`.split(`.`),c=[`true`,`false`,`Some`,`None`,`Ok`,`Err`],l=`drop .Copy.Send.Sized.Sync.Drop.Fn.FnMut.FnOnce.ToOwned.Clone.Debug.PartialEq.PartialOrd.Eq.Ord.AsRef.AsMut.Into.From.Default.Iterator.Extend.IntoIterator.DoubleEndedIterator.ExactSizeIterator.SliceConcatExt.ToString.assert!.assert_eq!.bitflags!.bytes!.cfg!.col!.concat!.concat_idents!.debug_assert!.debug_assert_eq!.env!.eprintln!.panic!.file!.format!.format_args!.include_bytes!.include_str!.line!.local_data_key!.module_path!.option_env!.print!.println!.select!.stringify!.try!.unimplemented!.unreachable!.vec!.write!.writeln!.macro_rules!.assert_ne!.debug_assert_ne!`.split(`.`),u=[`i8`,`i16`,`i32`,`i64`,`i128`,`isize`,`u8`,`u16`,`u32`,`u64`,`u128`,`usize`,`f32`,`f64`,`str`,`char`,`bool`,`Box`,`Option`,`Result`,`String`,`Vec`];return{name:`Rust`,aliases:[`rs`],keywords:{$pattern:e.IDENT_RE+`!?`,type:u,keyword:s,literal:c,built_in:l},illegal:`</`,contains:[e.C_LINE_COMMENT_MODE,e.COMMENT(`/\\*`,`\\*/`,{contains:[`self`]}),e.inherit(e.QUOTE_STRING_MODE,{begin:/b?"/,illegal:null}),{className:`symbol`,begin:/'[a-zA-Z_][a-zA-Z0-9_]*(?!')/},{scope:`string`,variants:[{begin:/b?r(#*)"(.|\n)*?"\1(?!#)/},{begin:/b?'/,end:/'/,contains:[{scope:`char.escape`,match:/\\('|\w|x\w{2}|u\w{4}|U\w{8})/}]}]},{className:`number`,variants:[{begin:`\\b0b([01_]+)`+o},{begin:`\\b0o([0-7_]+)`+o},{begin:`\\b0x([A-Fa-f0-9_]+)`+o},{begin:`\\b(\\d[\\d_]*(\\.[0-9_]+)?([eE][+-]?[0-9_]+)?)`+o}],relevance:0},{begin:[/fn/,/\s+/,r],className:{1:`keyword`,3:`title.function`}},{className:`meta`,begin:`#!?\\[`,end:`\\]`,contains:[{className:`string`,begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE]}]},{begin:[/let/,/\s+/,/(?:mut\s+)?/,r],className:{1:`keyword`,3:`keyword`,4:`variable`}},{begin:[/for/,/\s+/,r,/\s+/,/in/],className:{1:`keyword`,3:`variable`,5:`keyword`}},{begin:[/type/,/\s+/,r],className:{1:`keyword`,3:`title.class`}},{begin:[/(?:trait|enum|struct|union|impl|for)/,/\s+/,r],className:{1:`keyword`,3:`title.class`}},{begin:e.IDENT_RE+`::`,keywords:{keyword:`Self`,built_in:l,type:u}},{className:`punctuation`,begin:`->`},a]}}t.exports=n})),rs=o(((e,t)=>{var n=e=>({IMPORTANT:{scope:`meta`,begin:`!important`},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:`number`,begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:`built_in`,begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:`selector-attr`,begin:/\[/,end:/\]/,illegal:`$`,contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:`number`,begin:e.NUMBER_RE+`(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?`,relevance:0},CSS_VARIABLE:{className:`attr`,begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),r=`a.abbr.address.article.aside.audio.b.blockquote.body.button.canvas.caption.cite.code.dd.del.details.dfn.div.dl.dt.em.fieldset.figcaption.figure.footer.form.h1.h2.h3.h4.h5.h6.header.hgroup.html.i.iframe.img.input.ins.kbd.label.legend.li.main.mark.menu.nav.object.ol.optgroup.option.p.picture.q.quote.samp.section.select.source.span.strong.summary.sup.table.tbody.td.textarea.tfoot.th.thead.time.tr.ul.var.video`.split(`.`),i=`defs.g.marker.mask.pattern.svg.switch.symbol.feBlend.feColorMatrix.feComponentTransfer.feComposite.feConvolveMatrix.feDiffuseLighting.feDisplacementMap.feFlood.feGaussianBlur.feImage.feMerge.feMorphology.feOffset.feSpecularLighting.feTile.feTurbulence.linearGradient.radialGradient.stop.circle.ellipse.image.line.path.polygon.polyline.rect.text.use.textPath.tspan.foreignObject.clipPath`.split(`.`),a=[...r,...i],o=`any-hover.any-pointer.aspect-ratio.color.color-gamut.color-index.device-aspect-ratio.device-height.device-width.display-mode.forced-colors.grid.height.hover.inverted-colors.monochrome.orientation.overflow-block.overflow-inline.pointer.prefers-color-scheme.prefers-contrast.prefers-reduced-motion.prefers-reduced-transparency.resolution.scan.scripting.update.width.min-width.max-width.min-height.max-height`.split(`.`).sort().reverse(),s=`active.any-link.blank.checked.current.default.defined.dir.disabled.drop.empty.enabled.first.first-child.first-of-type.fullscreen.future.focus.focus-visible.focus-within.has.host.host-context.hover.indeterminate.in-range.invalid.is.lang.last-child.last-of-type.left.link.local-link.not.nth-child.nth-col.nth-last-child.nth-last-col.nth-last-of-type.nth-of-type.only-child.only-of-type.optional.out-of-range.past.placeholder-shown.read-only.read-write.required.right.root.scope.target.target-within.user-invalid.valid.visited.where`.split(`.`).sort().reverse(),c=[`after`,`backdrop`,`before`,`cue`,`cue-region`,`first-letter`,`first-line`,`grammar-error`,`marker`,`part`,`placeholder`,`selection`,`slotted`,`spelling-error`].sort().reverse(),l=`accent-color.align-content.align-items.align-self.alignment-baseline.all.anchor-name.animation.animation-composition.animation-delay.animation-direction.animation-duration.animation-fill-mode.animation-iteration-count.animation-name.animation-play-state.animation-range.animation-range-end.animation-range-start.animation-timeline.animation-timing-function.appearance.aspect-ratio.backdrop-filter.backface-visibility.background.background-attachment.background-blend-mode.background-clip.background-color.background-image.background-origin.background-position.background-position-x.background-position-y.background-repeat.background-size.baseline-shift.block-size.border.border-block.border-block-color.border-block-end.border-block-end-color.border-block-end-style.border-block-end-width.border-block-start.border-block-start-color.border-block-start-style.border-block-start-width.border-block-style.border-block-width.border-bottom.border-bottom-color.border-bottom-left-radius.border-bottom-right-radius.border-bottom-style.border-bottom-width.border-collapse.border-color.border-end-end-radius.border-end-start-radius.border-image.border-image-outset.border-image-repeat.border-image-slice.border-image-source.border-image-width.border-inline.border-inline-color.border-inline-end.border-inline-end-color.border-inline-end-style.border-inline-end-width.border-inline-start.border-inline-start-color.border-inline-start-style.border-inline-start-width.border-inline-style.border-inline-width.border-left.border-left-color.border-left-style.border-left-width.border-radius.border-right.border-right-color.border-right-style.border-right-width.border-spacing.border-start-end-radius.border-start-start-radius.border-style.border-top.border-top-color.border-top-left-radius.border-top-right-radius.border-top-style.border-top-width.border-width.bottom.box-align.box-decoration-break.box-direction.box-flex.box-flex-group.box-lines.box-ordinal-group.box-orient.box-pack.box-shadow.box-sizing.break-after.break-before.break-inside.caption-side.caret-color.clear.clip.clip-path.clip-rule.color.color-interpolation.color-interpolation-filters.color-profile.color-rendering.color-scheme.column-count.column-fill.column-gap.column-rule.column-rule-color.column-rule-style.column-rule-width.column-span.column-width.columns.contain.contain-intrinsic-block-size.contain-intrinsic-height.contain-intrinsic-inline-size.contain-intrinsic-size.contain-intrinsic-width.container.container-name.container-type.content.content-visibility.counter-increment.counter-reset.counter-set.cue.cue-after.cue-before.cursor.cx.cy.direction.display.dominant-baseline.empty-cells.enable-background.field-sizing.fill.fill-opacity.fill-rule.filter.flex.flex-basis.flex-direction.flex-flow.flex-grow.flex-shrink.flex-wrap.float.flood-color.flood-opacity.flow.font.font-display.font-family.font-feature-settings.font-kerning.font-language-override.font-optical-sizing.font-palette.font-size.font-size-adjust.font-smooth.font-smoothing.font-stretch.font-style.font-synthesis.font-synthesis-position.font-synthesis-small-caps.font-synthesis-style.font-synthesis-weight.font-variant.font-variant-alternates.font-variant-caps.font-variant-east-asian.font-variant-emoji.font-variant-ligatures.font-variant-numeric.font-variant-position.font-variation-settings.font-weight.forced-color-adjust.gap.glyph-orientation-horizontal.glyph-orientation-vertical.grid.grid-area.grid-auto-columns.grid-auto-flow.grid-auto-rows.grid-column.grid-column-end.grid-column-start.grid-gap.grid-row.grid-row-end.grid-row-start.grid-template.grid-template-areas.grid-template-columns.grid-template-rows.hanging-punctuation.height.hyphenate-character.hyphenate-limit-chars.hyphens.icon.image-orientation.image-rendering.image-resolution.ime-mode.initial-letter.initial-letter-align.inline-size.inset.inset-area.inset-block.inset-block-end.inset-block-start.inset-inline.inset-inline-end.inset-inline-start.isolation.justify-content.justify-items.justify-self.kerning.left.letter-spacing.lighting-color.line-break.line-height.line-height-step.list-style.list-style-image.list-style-position.list-style-type.margin.margin-block.margin-block-end.margin-block-start.margin-bottom.margin-inline.margin-inline-end.margin-inline-start.margin-left.margin-right.margin-top.margin-trim.marker.marker-end.marker-mid.marker-start.marks.mask.mask-border.mask-border-mode.mask-border-outset.mask-border-repeat.mask-border-slice.mask-border-source.mask-border-width.mask-clip.mask-composite.mask-image.mask-mode.mask-origin.mask-position.mask-repeat.mask-size.mask-type.masonry-auto-flow.math-depth.math-shift.math-style.max-block-size.max-height.max-inline-size.max-width.min-block-size.min-height.min-inline-size.min-width.mix-blend-mode.nav-down.nav-index.nav-left.nav-right.nav-up.none.normal.object-fit.object-position.offset.offset-anchor.offset-distance.offset-path.offset-position.offset-rotate.opacity.order.orphans.outline.outline-color.outline-offset.outline-style.outline-width.overflow.overflow-anchor.overflow-block.overflow-clip-margin.overflow-inline.overflow-wrap.overflow-x.overflow-y.overlay.overscroll-behavior.overscroll-behavior-block.overscroll-behavior-inline.overscroll-behavior-x.overscroll-behavior-y.padding.padding-block.padding-block-end.padding-block-start.padding-bottom.padding-inline.padding-inline-end.padding-inline-start.padding-left.padding-right.padding-top.page.page-break-after.page-break-before.page-break-inside.paint-order.pause.pause-after.pause-before.perspective.perspective-origin.place-content.place-items.place-self.pointer-events.position.position-anchor.position-visibility.print-color-adjust.quotes.r.resize.rest.rest-after.rest-before.right.rotate.row-gap.ruby-align.ruby-position.scale.scroll-behavior.scroll-margin.scroll-margin-block.scroll-margin-block-end.scroll-margin-block-start.scroll-margin-bottom.scroll-margin-inline.scroll-margin-inline-end.scroll-margin-inline-start.scroll-margin-left.scroll-margin-right.scroll-margin-top.scroll-padding.scroll-padding-block.scroll-padding-block-end.scroll-padding-block-start.scroll-padding-bottom.scroll-padding-inline.scroll-padding-inline-end.scroll-padding-inline-start.scroll-padding-left.scroll-padding-right.scroll-padding-top.scroll-snap-align.scroll-snap-stop.scroll-snap-type.scroll-timeline.scroll-timeline-axis.scroll-timeline-name.scrollbar-color.scrollbar-gutter.scrollbar-width.shape-image-threshold.shape-margin.shape-outside.shape-rendering.speak.speak-as.src.stop-color.stop-opacity.stroke.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke-width.tab-size.table-layout.text-align.text-align-all.text-align-last.text-anchor.text-combine-upright.text-decoration.text-decoration-color.text-decoration-line.text-decoration-skip.text-decoration-skip-ink.text-decoration-style.text-decoration-thickness.text-emphasis.text-emphasis-color.text-emphasis-position.text-emphasis-style.text-indent.text-justify.text-orientation.text-overflow.text-rendering.text-shadow.text-size-adjust.text-transform.text-underline-offset.text-underline-position.text-wrap.text-wrap-mode.text-wrap-style.timeline-scope.top.touch-action.transform.transform-box.transform-origin.transform-style.transition.transition-behavior.transition-delay.transition-duration.transition-property.transition-timing-function.translate.unicode-bidi.user-modify.user-select.vector-effect.vertical-align.view-timeline.view-timeline-axis.view-timeline-inset.view-timeline-name.view-transition-name.visibility.voice-balance.voice-duration.voice-family.voice-pitch.voice-range.voice-rate.voice-stress.voice-volume.white-space.white-space-collapse.widows.width.will-change.word-break.word-spacing.word-wrap.writing-mode.x.y.z-index.zoom`.split(`.`).sort().reverse();function u(e){let t=n(e),r=c,i=s,u=`@[a-z-]+`,d={className:`variable`,begin:`(\\$[a-zA-Z-][a-zA-Z0-9_-]*)\\b`,relevance:0};return{name:`SCSS`,case_insensitive:!0,illegal:`[=/|']`,contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,t.CSS_NUMBER_MODE,{className:`selector-id`,begin:`#[A-Za-z0-9_-]+`,relevance:0},{className:`selector-class`,begin:`\\.[A-Za-z0-9_-]+`,relevance:0},t.ATTRIBUTE_SELECTOR_MODE,{className:`selector-tag`,begin:`\\b(`+a.join(`|`)+`)\\b`,relevance:0},{className:`selector-pseudo`,begin:`:(`+i.join(`|`)+`)`},{className:`selector-pseudo`,begin:`:(:)?(`+r.join(`|`)+`)`},d,{begin:/\(/,end:/\)/,contains:[t.CSS_NUMBER_MODE]},t.CSS_VARIABLE,{className:`attribute`,begin:`\\b(`+l.join(`|`)+`)\\b`},{begin:`\\b(whitespace|wait|w-resize|visible|vertical-text|vertical-ideographic|uppercase|upper-roman|upper-alpha|underline|transparent|top|thin|thick|text|text-top|text-bottom|tb-rl|table-header-group|table-footer-group|sw-resize|super|strict|static|square|solid|small-caps|separate|se-resize|scroll|s-resize|rtl|row-resize|ridge|right|repeat|repeat-y|repeat-x|relative|progress|pointer|overline|outside|outset|oblique|nowrap|not-allowed|normal|none|nw-resize|no-repeat|no-drop|newspaper|ne-resize|n-resize|move|middle|medium|ltr|lr-tb|lowercase|lower-roman|lower-alpha|loose|list-item|line|line-through|line-edge|lighter|left|keep-all|justify|italic|inter-word|inter-ideograph|inside|inset|inline|inline-block|inherit|inactive|ideograph-space|ideograph-parenthesis|ideograph-numeric|ideograph-alpha|horizontal|hidden|help|hand|groove|fixed|ellipsis|e-resize|double|dotted|distribute|distribute-space|distribute-letter|distribute-all-lines|disc|disabled|default|decimal|dashed|crosshair|collapse|col-resize|circle|char|center|capitalize|break-word|break-all|bottom|both|bolder|bold|block|bidi-override|below|baseline|auto|always|all-scroll|absolute|table|table-cell)\\b`},{begin:/:/,end:/[;}{]/,relevance:0,contains:[t.BLOCK_COMMENT,d,t.HEXCOLOR,t.CSS_NUMBER_MODE,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,t.IMPORTANT,t.FUNCTION_DISPATCH]},{begin:`@(page|font-face)`,keywords:{$pattern:u,keyword:`@page @font-face`}},{begin:`@`,end:`[{;]`,returnBegin:!0,keywords:{$pattern:/[a-z-]+/,keyword:`and or not only`,attribute:o.join(` `)},contains:[{begin:u,className:`keyword`},{begin:/[a-z-]+(?=:)/,className:`attribute`},d,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,t.HEXCOLOR,t.CSS_NUMBER_MODE]},t.FUNCTION_DISPATCH]}}t.exports=u})),is=o(((e,t)=>{function n(e){return{name:`Shell Session`,aliases:[`console`,`shellsession`],contains:[{className:`meta.prompt`,begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:`bash`}}]}}t.exports=n})),as=o(((e,t)=>{function n(e){let t=e.regex,n=e.COMMENT(`--`,`$`),r={scope:`string`,variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},i={begin:/"/,end:/"/,contains:[{match:/""/}]},a=[`true`,`false`,`unknown`],o=[`double precision`,`large object`,`with timezone`,`without timezone`],s=`bigint.binary.blob.boolean.char.character.clob.date.dec.decfloat.decimal.float.int.integer.interval.nchar.nclob.national.numeric.real.row.smallint.time.timestamp.varchar.varying.varbinary`.split(`.`),c=[`add`,`asc`,`collation`,`desc`,`final`,`first`,`last`,`view`],l=`abs.acos.all.allocate.alter.and.any.are.array.array_agg.array_max_cardinality.as.asensitive.asin.asymmetric.at.atan.atomic.authorization.avg.begin.begin_frame.begin_partition.between.bigint.binary.blob.boolean.both.by.call.called.cardinality.cascaded.case.cast.ceil.ceiling.char.char_length.character.character_length.check.classifier.clob.close.coalesce.collate.collect.column.commit.condition.connect.constraint.contains.convert.copy.corr.corresponding.cos.cosh.count.covar_pop.covar_samp.create.cross.cube.cume_dist.current.current_catalog.current_date.current_default_transform_group.current_path.current_role.current_row.current_schema.current_time.current_timestamp.current_path.current_role.current_transform_group_for_type.current_user.cursor.cycle.date.day.deallocate.dec.decimal.decfloat.declare.default.define.delete.dense_rank.deref.describe.deterministic.disconnect.distinct.double.drop.dynamic.each.element.else.empty.end.end_frame.end_partition.end-exec.equals.escape.every.except.exec.execute.exists.exp.external.extract.false.fetch.filter.first_value.float.floor.for.foreign.frame_row.free.from.full.function.fusion.get.global.grant.group.grouping.groups.having.hold.hour.identity.in.indicator.initial.inner.inout.insensitive.insert.int.integer.intersect.intersection.interval.into.is.join.json_array.json_arrayagg.json_exists.json_object.json_objectagg.json_query.json_table.json_table_primitive.json_value.lag.language.large.last_value.lateral.lead.leading.left.like.like_regex.listagg.ln.local.localtime.localtimestamp.log.log10.lower.match.match_number.match_recognize.matches.max.member.merge.method.min.minute.mod.modifies.module.month.multiset.national.natural.nchar.nclob.new.no.none.normalize.not.nth_value.ntile.null.nullif.numeric.octet_length.occurrences_regex.of.offset.old.omit.on.one.only.open.or.order.out.outer.over.overlaps.overlay.parameter.partition.pattern.per.percent.percent_rank.percentile_cont.percentile_disc.period.portion.position.position_regex.power.precedes.precision.prepare.primary.procedure.ptf.range.rank.reads.real.recursive.ref.references.referencing.regr_avgx.regr_avgy.regr_count.regr_intercept.regr_r2.regr_slope.regr_sxx.regr_sxy.regr_syy.release.result.return.returns.revoke.right.rollback.rollup.row.row_number.rows.running.savepoint.scope.scroll.search.second.seek.select.sensitive.session_user.set.show.similar.sin.sinh.skip.smallint.some.specific.specifictype.sql.sqlexception.sqlstate.sqlwarning.sqrt.start.static.stddev_pop.stddev_samp.submultiset.subset.substring.substring_regex.succeeds.sum.symmetric.system.system_time.system_user.table.tablesample.tan.tanh.then.time.timestamp.timezone_hour.timezone_minute.to.trailing.translate.translate_regex.translation.treat.trigger.trim.trim_array.true.truncate.uescape.union.unique.unknown.unnest.update.upper.user.using.value.values.value_of.var_pop.var_samp.varbinary.varchar.varying.versioning.when.whenever.where.width_bucket.window.with.within.without.year`.split(`.`),u=`abs.acos.array_agg.asin.atan.avg.cast.ceil.ceiling.coalesce.corr.cos.cosh.count.covar_pop.covar_samp.cume_dist.dense_rank.deref.element.exp.extract.first_value.floor.json_array.json_arrayagg.json_exists.json_object.json_objectagg.json_query.json_table.json_table_primitive.json_value.lag.last_value.lead.listagg.ln.log.log10.lower.max.min.mod.nth_value.ntile.nullif.percent_rank.percentile_cont.percentile_disc.position.position_regex.power.rank.regr_avgx.regr_avgy.regr_count.regr_intercept.regr_r2.regr_slope.regr_sxx.regr_sxy.regr_syy.row_number.sin.sinh.sqrt.stddev_pop.stddev_samp.substring.substring_regex.sum.tan.tanh.translate.translate_regex.treat.trim.trim_array.unnest.upper.value_of.var_pop.var_samp.width_bucket`.split(`.`),d=[`current_catalog`,`current_date`,`current_default_transform_group`,`current_path`,`current_role`,`current_schema`,`current_transform_group_for_type`,`current_user`,`session_user`,`system_time`,`system_user`,`current_time`,`localtime`,`current_timestamp`,`localtimestamp`],f=[`create table`,`insert into`,`primary key`,`foreign key`,`not null`,`alter table`,`add constraint`,`grouping sets`,`on overflow`,`character set`,`respect nulls`,`ignore nulls`,`nulls first`,`nulls last`,`depth first`,`breadth first`],p=u,m=[...l,...c].filter(e=>!u.includes(e)),h={scope:`variable`,match:/@[a-z0-9][a-z0-9_]*/},g={scope:`operator`,match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},_={match:t.concat(/\b/,t.either(...p),/\s*\(/),relevance:0,keywords:{built_in:p}};function v(e){return t.concat(/\b/,t.either(...e.map(e=>e.replace(/\s+/,`\\s+`))),/\b/)}let y={scope:`keyword`,match:v(f),relevance:0};function b(e,{exceptions:t,when:n}={}){let r=n;return t||=[],e.map(e=>e.match(/\|\d+$/)||t.includes(e)?e:r(e)?`${e}|0`:e)}return{name:`SQL`,case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:b(m,{when:e=>e.length<3}),literal:a,type:s,built_in:d},contains:[{scope:`type`,match:v(o)},y,_,h,r,i,e.C_NUMBER_MODE,e.C_BLOCK_COMMENT_MODE,n,g]}}t.exports=n})),os=o(((e,t)=>{function n(e){return e?typeof e==`string`?e:e.source:null}function r(e){return i(`(?=`,e,`)`)}function i(...e){return e.map(e=>n(e)).join(``)}function a(e){let t=e[e.length-1];return typeof t==`object`&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function o(...e){return`(`+(a(e).capture?``:`?:`)+e.map(e=>n(e)).join(`|`)+`)`}var s=e=>i(/\b/,e,/\w$/.test(e)?/\b/:/\B/),c=[`Protocol`,`Type`].map(s),l=[`init`,`self`].map(s),u=[`Any`,`Self`],d=[`actor`,`any`,`associatedtype`,`async`,`await`,/as\?/,/as!/,`as`,`borrowing`,`break`,`case`,`catch`,`class`,`consume`,`consuming`,`continue`,`convenience`,`copy`,`default`,`defer`,`deinit`,`didSet`,`distributed`,`do`,`dynamic`,`each`,`else`,`enum`,`extension`,`fallthrough`,/fileprivate\(set\)/,`fileprivate`,`final`,`for`,`func`,`get`,`guard`,`if`,`import`,`indirect`,`infix`,/init\?/,/init!/,`inout`,/internal\(set\)/,`internal`,`in`,`is`,`isolated`,`nonisolated`,`lazy`,`let`,`macro`,`mutating`,`nonmutating`,/open\(set\)/,`open`,`operator`,`optional`,`override`,`package`,`postfix`,`precedencegroup`,`prefix`,/private\(set\)/,`private`,`protocol`,/public\(set\)/,`public`,`repeat`,`required`,`rethrows`,`return`,`set`,`some`,`static`,`struct`,`subscript`,`super`,`switch`,`throws`,`throw`,/try\?/,/try!/,`try`,`typealias`,/unowned\(safe\)/,/unowned\(unsafe\)/,`unowned`,`var`,`weak`,`where`,`while`,`willSet`],f=[`false`,`nil`,`true`],p=[`assignment`,`associativity`,`higherThan`,`left`,`lowerThan`,`none`,`right`],m=[`#colorLiteral`,`#column`,`#dsohandle`,`#else`,`#elseif`,`#endif`,`#error`,`#file`,`#fileID`,`#fileLiteral`,`#filePath`,`#function`,`#if`,`#imageLiteral`,`#keyPath`,`#line`,`#selector`,`#sourceLocation`,`#warning`],h=`abs.all.any.assert.assertionFailure.debugPrint.dump.fatalError.getVaList.isKnownUniquelyReferenced.max.min.numericCast.pointwiseMax.pointwiseMin.precondition.preconditionFailure.print.readLine.repeatElement.sequence.stride.swap.swift_unboxFromSwiftValueWithType.transcode.type.unsafeBitCast.unsafeDowncast.withExtendedLifetime.withUnsafeMutablePointer.withUnsafePointer.withVaList.withoutActuallyEscaping.zip`.split(`.`),g=o(/[/=\-+!*%<>&|^~?]/,/[\u00A1-\u00A7]/,/[\u00A9\u00AB]/,/[\u00AC\u00AE]/,/[\u00B0\u00B1]/,/[\u00B6\u00BB\u00BF\u00D7\u00F7]/,/[\u2016-\u2017]/,/[\u2020-\u2027]/,/[\u2030-\u203E]/,/[\u2041-\u2053]/,/[\u2055-\u205E]/,/[\u2190-\u23FF]/,/[\u2500-\u2775]/,/[\u2794-\u2BFF]/,/[\u2E00-\u2E7F]/,/[\u3001-\u3003]/,/[\u3008-\u3020]/,/[\u3030]/),_=o(g,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),v=i(g,_,`*`),y=o(/[a-zA-Z_]/,/[\u00A8\u00AA\u00AD\u00AF\u00B2-\u00B5\u00B7-\u00BA]/,/[\u00BC-\u00BE\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF]/,/[\u0100-\u02FF\u0370-\u167F\u1681-\u180D\u180F-\u1DBF]/,/[\u1E00-\u1FFF]/,/[\u200B-\u200D\u202A-\u202E\u203F-\u2040\u2054\u2060-\u206F]/,/[\u2070-\u20CF\u2100-\u218F\u2460-\u24FF\u2776-\u2793]/,/[\u2C00-\u2DFF\u2E80-\u2FFF]/,/[\u3004-\u3007\u3021-\u302F\u3031-\u303F\u3040-\uD7FF]/,/[\uF900-\uFD3D\uFD40-\uFDCF\uFDF0-\uFE1F\uFE30-\uFE44]/,/[\uFE47-\uFEFE\uFF00-\uFFFD]/),b=o(y,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),x=i(y,b,`*`),S=i(/[A-Z]/,b,`*`),C=[`attached`,`autoclosure`,i(/convention\(/,o(`swift`,`block`,`c`),/\)/),`discardableResult`,`dynamicCallable`,`dynamicMemberLookup`,`escaping`,`freestanding`,`frozen`,`GKInspectable`,`IBAction`,`IBDesignable`,`IBInspectable`,`IBOutlet`,`IBSegueAction`,`inlinable`,`main`,`nonobjc`,`NSApplicationMain`,`NSCopying`,`NSManaged`,i(/objc\(/,x,/\)/),`objc`,`objcMembers`,`propertyWrapper`,`requires_stored_property_inits`,`resultBuilder`,`Sendable`,`testable`,`UIApplicationMain`,`unchecked`,`unknown`,`usableFromInline`,`warn_unqualified_access`],w=[`iOS`,`iOSApplicationExtension`,`macOS`,`macOSApplicationExtension`,`macCatalyst`,`macCatalystApplicationExtension`,`watchOS`,`watchOSApplicationExtension`,`tvOS`,`tvOSApplicationExtension`,`swift`];function T(e){let t={match:/\s+/,relevance:0},n=e.COMMENT(`/\\*`,`\\*/`,{contains:[`self`]}),a=[e.C_LINE_COMMENT_MODE,n],g={match:[/\./,o(...c,...l)],className:{2:`keyword`}},y={match:i(/\./,o(...d)),relevance:0},T=d.filter(e=>typeof e==`string`).concat([`_|0`]),E={variants:[{className:`keyword`,match:o(...d.filter(e=>typeof e!=`string`).concat(u).map(s),...l)}]},D={$pattern:o(/\b\w+/,/#\w+/),keyword:T.concat(m),literal:f},O=[g,y,E],k=[{match:i(/\./,o(...h)),relevance:0},{className:`built_in`,match:i(/\b/,o(...h),/(?=\()/)}],A={match:/->/,relevance:0},ee=[A,{className:`operator`,relevance:0,variants:[{match:v},{match:`\\.(\\.|${_})+`}]}],j=`([0-9]_*)+`,te=`([0-9a-fA-F]_*)+`,M={className:`number`,relevance:0,variants:[{match:`\\b(${j})(\\.(${j}))?([eE][+-]?(${j}))?\\b`},{match:`\\b0x(${te})(\\.(${te}))?([pP][+-]?(${j}))?\\b`},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},ne=(e=``)=>({className:`subst`,variants:[{match:i(/\\/,e,/[0\\tnr"']/)},{match:i(/\\/,e,/u\{[0-9a-fA-F]{1,8}\}/)}]}),N=(e=``)=>({className:`subst`,match:i(/\\/,e,/[\t ]*(?:[\r\n]|\r\n)/)}),P=(e=``)=>({className:`subst`,label:`interpol`,begin:i(/\\/,e,/\(/),end:/\)/}),re=(e=``)=>({begin:i(e,/"""/),end:i(/"""/,e),contains:[ne(e),N(e),P(e)]}),F=(e=``)=>({begin:i(e,/"/),end:i(/"/,e),contains:[ne(e),P(e)]}),ie={className:`string`,variants:[re(),re(`#`),re(`##`),re(`###`),F(),F(`#`),F(`##`),F(`###`)]},I=[e.BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[e.BACKSLASH_ESCAPE]}],ae={begin:/\/[^\s](?=[^/\n]*\/)/,end:/\//,contains:I},L=e=>{let t=i(e,/\//),n=i(/\//,e);return{begin:t,end:n,contains:[...I,{scope:`comment`,begin:`#(?!.*${n})`,end:/$/}]}},oe={scope:`regexp`,variants:[L(`###`),L(`##`),L(`#`),ae]},se={match:i(/`/,x,/`/)},ce=[se,{className:`variable`,match:/\$\d+/},{className:`variable`,match:`\\$${b}+`}],le=[{match:/(@|#(un)?)available/,scope:`keyword`,starts:{contains:[{begin:/\(/,end:/\)/,keywords:w,contains:[...ee,M,ie]}]}},{scope:`keyword`,match:i(/@/,o(...C),r(o(/\(/,/\s+/)))},{scope:`meta`,match:i(/@/,x)}],ue={match:r(/\b[A-Z]/),relevance:0,contains:[{className:`type`,match:i(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,b,`+`)},{className:`type`,match:S,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:i(/\s+&\s+/,r(S)),relevance:0}]},de={begin:/</,end:/>/,keywords:D,contains:[...a,...O,...le,A,ue]};ue.contains.push(de);let fe={begin:/\(/,end:/\)/,relevance:0,keywords:D,contains:[`self`,{match:i(x,/\s*:/),keywords:`_|0`,relevance:0},...a,oe,...O,...k,...ee,M,ie,...ce,...le,ue]},pe={begin:/</,end:/>/,keywords:`repeat each`,contains:[...a,ue]},me={begin:/\(/,end:/\)/,keywords:D,contains:[{begin:o(r(i(x,/\s*:/)),r(i(x,/\s+/,x,/\s*:/))),end:/:/,relevance:0,contains:[{className:`keyword`,match:/\b_\b/},{className:`params`,match:x}]},...a,...O,...ee,M,ie,...le,ue,fe],endsParent:!0,illegal:/["']/},he={match:[/(func|macro)/,/\s+/,o(se.match,x,v)],className:{1:`keyword`,3:`title.function`},contains:[pe,me,t],illegal:[/\[/,/%/]},ge={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:`keyword`},contains:[pe,me,t],illegal:/\[|%/},_e={match:[/operator/,/\s+/,v],className:{1:`keyword`,3:`title`}},ve={begin:[/precedencegroup/,/\s+/,S],className:{1:`keyword`,3:`title`},contains:[ue],keywords:[...p,...f],end:/}/},ye={match:[/class\b/,/\s+/,/func\b/,/\s+/,/\b[A-Za-z_][A-Za-z0-9_]*\b/],scope:{1:`keyword`,3:`keyword`,5:`title.function`}},be={match:[/class\b/,/\s+/,/var\b/],scope:{1:`keyword`,3:`keyword`}},xe={begin:[/(struct|protocol|class|extension|enum|actor)/,/\s+/,x,/\s*/],beginScope:{1:`keyword`,3:`title.class`},keywords:D,contains:[pe,...O,{begin:/:/,end:/\{/,keywords:D,contains:[{scope:`title.class.inherited`,match:S},...O],relevance:0}]};for(let e of ie.variants){let t=e.contains.find(e=>e.label===`interpol`);t.keywords=D;let n=[...O,...k,...ee,M,ie,...ce];t.contains=[...n,{begin:/\(/,end:/\)/,contains:[`self`,...n]}]}return{name:`Swift`,keywords:D,contains:[...a,he,ge,ye,be,xe,_e,ve,{beginKeywords:`import`,end:/$/,contains:[...a],relevance:0},oe,...O,...k,...ee,M,ie,...ce,...le,ue,fe]}}t.exports=T})),ss=o(((e,t)=>{function n(e){let t=`true false yes no null`,n=`[\\w#;/?:@&=+$,.~*'()[\\]]+`,r={className:`attr`,variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},i={className:`template-variable`,variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},a={className:`string`,relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:`char.escape`,relevance:0}]},o={className:`string`,relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[e.BACKSLASH_ESCAPE,i]},s=e.inherit(o,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),c={className:`number`,begin:`\\b[0-9]{4}(-[0-9][0-9]){0,2}([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?(\\.[0-9]*)?([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?\\b`},l={end:`,`,endsWithParent:!0,excludeEnd:!0,keywords:t,relevance:0},u={begin:/\{/,end:/\}/,contains:[l],illegal:`\\n`,relevance:0},d={begin:`\\[`,end:`\\]`,contains:[l],illegal:`\\n`,relevance:0},f=[r,{className:`meta`,begin:`^---\\s*$`,relevance:10},{className:`string`,begin:`[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*`},{begin:`<%[%=-]?`,end:`[%-]?%>`,subLanguage:`ruby`,excludeBegin:!0,excludeEnd:!0,relevance:0},{className:`type`,begin:`!\\w+!`+n},{className:`type`,begin:`!<`+n+`>`},{className:`type`,begin:`!`+n},{className:`type`,begin:`!!`+n},{className:`meta`,begin:`&`+e.UNDERSCORE_IDENT_RE+`$`},{className:`meta`,begin:`\\*`+e.UNDERSCORE_IDENT_RE+`$`},{className:`bullet`,begin:`-(?=[ ]|$)`,relevance:0},e.HASH_COMMENT_MODE,{beginKeywords:t,keywords:{literal:t}},c,{className:`number`,begin:e.C_NUMBER_RE+`\\b`,relevance:0},u,d,a,o],p=[...f];return p.pop(),p.push(s),l.contains=p,{name:`YAML`,case_insensitive:!0,aliases:[`yml`],contains:f}}t.exports=n})),cs=o(((e,t)=>{var n=`[A-Za-z$_][0-9A-Za-z$_]*`,r=`as.in.of.if.for.while.finally.var.new.function.do.return.void.else.break.catch.instanceof.with.throw.case.default.try.switch.continue.typeof.delete.let.yield.const.class.debugger.async.await.static.import.from.export.extends.using`.split(`.`),i=[`true`,`false`,`null`,`undefined`,`NaN`,`Infinity`],a=`Object.Function.Boolean.Symbol.Math.Date.Number.BigInt.String.RegExp.Array.Float32Array.Float64Array.Int8Array.Uint8Array.Uint8ClampedArray.Int16Array.Int32Array.Uint16Array.Uint32Array.BigInt64Array.BigUint64Array.Set.Map.WeakSet.WeakMap.ArrayBuffer.SharedArrayBuffer.Atomics.DataView.JSON.Promise.Generator.GeneratorFunction.AsyncFunction.Reflect.Proxy.Intl.WebAssembly`.split(`.`),o=[`Error`,`EvalError`,`InternalError`,`RangeError`,`ReferenceError`,`SyntaxError`,`TypeError`,`URIError`],s=[`setInterval`,`setTimeout`,`clearInterval`,`clearTimeout`,`require`,`exports`,`eval`,`isFinite`,`isNaN`,`parseFloat`,`parseInt`,`decodeURI`,`decodeURIComponent`,`encodeURI`,`encodeURIComponent`,`escape`,`unescape`],c=[`arguments`,`this`,`super`,`console`,`window`,`document`,`localStorage`,`sessionStorage`,`module`,`global`],l=[].concat(s,a,o);function u(e){let t=e.regex,u=(e,{after:t})=>{let n=`</`+e[0].slice(1);return e.input.indexOf(n,t)!==-1},d=n,f={begin:`<>`,end:`</>`},p=/<[A-Za-z0-9\\._:-]+\s*\/>/,m={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(e,t)=>{let n=e[0].length+e.index,r=e.input[n];if(r===`<`||r===`,`){t.ignoreMatch();return}r===`>`&&(u(e,{after:n})||t.ignoreMatch());let i,a=e.input.substring(n);if(i=a.match(/^\s*=/)){t.ignoreMatch();return}if((i=a.match(/^\s+extends\s+/))&&i.index===0){t.ignoreMatch();return}}},h={$pattern:n,keyword:r,literal:i,built_in:l,"variable.language":c},g=`[0-9](_?[0-9])*`,_=`\\.(${g})`,v=`0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*`,y={className:`number`,variants:[{begin:`(\\b(${v})((${_})|\\.)?|(${_}))[eE][+-]?(${g})\\b`},{begin:`\\b(${v})\\b((${_})\\b|\\.)?|(${_})\\b`},{begin:`\\b(0|[1-9](_?[0-9])*)n\\b`},{begin:`\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b`},{begin:`\\b0[bB][0-1](_?[0-1])*n?\\b`},{begin:`\\b0[oO][0-7](_?[0-7])*n?\\b`},{begin:`\\b0[0-7]+n?\\b`}],relevance:0},b={className:`subst`,begin:`\\$\\{`,end:`\\}`,keywords:h,contains:[]},x={begin:".?html`",end:``,starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,b],subLanguage:`xml`}},S={begin:".?css`",end:``,starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,b],subLanguage:`css`}},C={begin:".?gql`",end:``,starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,b],subLanguage:`graphql`}},w={className:`string`,begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,b]},T={className:`comment`,variants:[e.COMMENT(/\/\*\*(?!\/)/,`\\*/`,{relevance:0,contains:[{begin:`(?=@[A-Za-z]+)`,relevance:0,contains:[{className:`doctag`,begin:`@[A-Za-z]+`},{className:`type`,begin:`\\{`,end:`\\}`,excludeEnd:!0,excludeBegin:!0,relevance:0},{className:`variable`,begin:d+`(?=\\s*(-)|$)`,endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},E=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,x,S,C,w,{match:/\$\d+/},y];b.contains=E.concat({begin:/\{/,end:/\}/,keywords:h,contains:[`self`].concat(E)});let D=[].concat(T,b.contains),O=D.concat([{begin:/(\s*)\(/,end:/\)/,keywords:h,contains:[`self`].concat(D)}]),k={className:`params`,begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:h,contains:O},A={variants:[{match:[/class/,/\s+/,d,/\s+/,/extends/,/\s+/,t.concat(d,`(`,t.concat(/\./,d),`)*`)],scope:{1:`keyword`,3:`title.class`,5:`keyword`,7:`title.class.inherited`}},{match:[/class/,/\s+/,d],scope:{1:`keyword`,3:`title.class`}}]},ee={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:`title.class`,keywords:{_:[...a,...o]}},j={label:`use_strict`,className:`meta`,relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},te={variants:[{match:[/function/,/\s+/,d,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:`keyword`,3:`title.function`},label:`func.def`,contains:[k],illegal:/%/},M={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:`variable.constant`};function ne(e){return t.concat(`(?!`,e.join(`|`),`)`)}let N={match:t.concat(/\b/,ne([...s,`super`,`import`].map(e=>`${e}\\s*\\(`)),d,t.lookahead(/\s*\(/)),className:`title.function`,relevance:0},P={begin:t.concat(/\./,t.lookahead(t.concat(d,/(?![0-9A-Za-z$_(])/))),end:d,excludeBegin:!0,keywords:`prototype`,className:`property`,relevance:0},re={match:[/get|set/,/\s+/,d,/(?=\()/],className:{1:`keyword`,3:`title.function`},contains:[{begin:/\(\)/},k]},F=`(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|`+e.UNDERSCORE_IDENT_RE+`)\\s*=>`,ie={match:[/const|var|let/,/\s+/,d,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(F)],keywords:`async`,className:{1:`keyword`,3:`title.function`},contains:[k]};return{name:`JavaScript`,aliases:[`js`,`jsx`,`mjs`,`cjs`],keywords:h,exports:{PARAMS_CONTAINS:O,CLASS_REFERENCE:ee},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:`shebang`,binary:`node`,relevance:5}),j,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,x,S,C,w,T,{match:/\$\d+/},y,ee,{scope:`attr`,match:d+t.lookahead(`:`),relevance:0},ie,{begin:`(`+e.RE_STARTERS_RE+`|\\b(case|return|throw)\\b)\\s*`,keywords:`return throw case`,relevance:0,contains:[T,e.REGEXP_MODE,{className:`function`,begin:F,returnBegin:!0,end:`\\s*=>`,contains:[{className:`params`,variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:h,contains:O}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:f.begin,end:f.end},{match:p},{begin:m.begin,"on:begin":m.isTrulyOpeningTag,end:m.end}],subLanguage:`xml`,contains:[{begin:m.begin,end:m.end,skip:!0,contains:[`self`]}]}]},te,{beginKeywords:`while if switch catch for`},{begin:`\\b(?!function)`+e.UNDERSCORE_IDENT_RE+`\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{`,returnBegin:!0,label:`func.def`,contains:[k,e.inherit(e.TITLE_MODE,{begin:d,className:`title.function`})]},{match:/\.\.\./,relevance:0},P,{match:`\\$`+d,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:`title.function`},contains:[k]},N,M,A,re,{match:/\$[(.]/}]}}function d(e){let t=e.regex,a=u(e),o=n,s=[`any`,`void`,`number`,`boolean`,`string`,`object`,`never`,`symbol`,`bigint`,`unknown`],d={begin:[/namespace/,/\s+/,e.IDENT_RE],beginScope:{1:`keyword`,3:`title.class`}},f={beginKeywords:`interface`,end:/\{/,excludeEnd:!0,keywords:{keyword:`interface extends`,built_in:s},contains:[a.exports.CLASS_REFERENCE]},p={className:`meta`,relevance:10,begin:/^\s*['"]use strict['"]/},m={$pattern:n,keyword:r.concat([`type`,`interface`,`public`,`private`,`protected`,`implements`,`declare`,`abstract`,`readonly`,`enum`,`override`,`satisfies`]),literal:i,built_in:l.concat(s),"variable.language":c},h={className:`meta`,begin:`@`+o},g=(e,t,n)=>{let r=e.contains.findIndex(e=>e.label===t);if(r===-1)throw Error(`can not find mode to replace`);e.contains.splice(r,1,n)};Object.assign(a.keywords,m),a.exports.PARAMS_CONTAINS.push(h);let _=a.contains.find(e=>e.scope===`attr`),v=Object.assign({},_,{match:t.concat(o,t.lookahead(/\s*\?:/))});a.exports.PARAMS_CONTAINS.push([a.exports.CLASS_REFERENCE,_,v]),a.contains=a.contains.concat([h,d,f,v]),g(a,`shebang`,e.SHEBANG()),g(a,`use_strict`,p);let y=a.contains.find(e=>e.label===`func.def`);return y.relevance=0,Object.assign(a,{name:`TypeScript`,aliases:[`ts`,`tsx`,`mts`,`cts`]}),a}t.exports=d})),ls=o(((e,t)=>{function n(e){let t=e.regex,n={className:`string`,begin:/"(""|[^/n])"C\b/},r={className:`string`,begin:/"/,end:/"/,illegal:/\n/,contains:[{begin:/""/}]},i=/\d{1,2}\/\d{1,2}\/\d{4}/,a=/\d{4}-\d{1,2}-\d{1,2}/,o=/(\d|1[012])(:\d+){0,2} *(AM|PM)/,s=/\d{1,2}(:\d{1,2}){1,2}/,c={className:`literal`,variants:[{begin:t.concat(/# */,t.either(a,i),/ *#/)},{begin:t.concat(/# */,s,/ *#/)},{begin:t.concat(/# */,o,/ *#/)},{begin:t.concat(/# */,t.either(a,i),/ +/,t.either(o,s),/ *#/)}]},l={className:`number`,relevance:0,variants:[{begin:/\b\d[\d_]*((\.[\d_]+(E[+-]?[\d_]+)?)|(E[+-]?[\d_]+))[RFD@!#]?/},{begin:/\b\d[\d_]*((U?[SIL])|[%&])?/},{begin:/&H[\dA-F_]+((U?[SIL])|[%&])?/},{begin:/&O[0-7_]+((U?[SIL])|[%&])?/},{begin:/&B[01_]+((U?[SIL])|[%&])?/}]},u={className:`label`,begin:/^\w+:/},d=e.COMMENT(/'''/,/$/,{contains:[{className:`doctag`,begin:/<\/?/,end:/>/}]}),f=e.COMMENT(null,/$/,{variants:[{begin:/'/},{begin:/([\t ]|^)REM(?=\s)/}]});return{name:`Visual Basic .NET`,aliases:[`vb`],case_insensitive:!0,classNameAliases:{label:`symbol`},keywords:{keyword:`addhandler alias aggregate ansi as async assembly auto binary by byref byval call case catch class compare const continue custom declare default delegate dim distinct do each equals else elseif end enum erase error event exit explicit finally for friend from function get global goto group handles if implements imports in inherits interface into iterator join key let lib loop me mid module mustinherit mustoverride mybase myclass namespace narrowing new next notinheritable notoverridable of off on operator option optional order overloads overridable overrides paramarray partial preserve private property protected public raiseevent readonly redim removehandler resume return select set shadows shared skip static step stop structure strict sub synclock take text then throw to try unicode until using when where while widening with withevents writeonly yield`,built_in:`addressof and andalso await directcast gettype getxmlnamespace is isfalse isnot istrue like mod nameof new not or orelse trycast typeof xor cbool cbyte cchar cdate cdbl cdec cint clng cobj csbyte cshort csng cstr cuint culng cushort`,type:`boolean byte char date decimal double integer long object sbyte short single string uinteger ulong ushort`,literal:`true false nothing`},illegal:`//|\\{|\\}|endif|gosub|variant|wend|^\\$ `,contains:[n,r,c,l,u,d,f,{className:`meta`,begin:/[\t ]*#(const|disable|else|elseif|enable|end|externalsource|if|region)\b/,end:/$/,keywords:{keyword:`const disable else elseif enable end externalsource if region then`},contains:[f]}]}}t.exports=n})),us=o(((e,t)=>{function n(e){e.regex;let t=e.COMMENT(/\(;/,/;\)/);return t.contains.push(`self`),{name:`WebAssembly`,keywords:{$pattern:/[\w.]+/,keyword:`anyfunc,block,br,br_if,br_table,call,call_indirect,data,drop,elem,else,end,export,func,global.get,global.set,local.get,local.set,local.tee,get_global,get_local,global,if,import,local,loop,memory,memory.grow,memory.size,module,mut,nop,offset,param,result,return,select,set_global,set_local,start,table,tee_local,then,type,unreachable`.split(`,`)},contains:[e.COMMENT(/;;/,/$/),t,{match:[/(?:offset|align)/,/\s*/,/=/],className:{1:`keyword`,3:`operator`}},{className:`variable`,begin:/\$[\w_]+/},{match:/(\((?!;)|\))+/,className:`punctuation`,relevance:0},{begin:[/(?:func|call|call_indirect)/,/\s+/,/\$[^\s)]+/],className:{1:`keyword`,3:`title.function`}},e.QUOTE_STRING_MODE,{match:/(i32|i64|f32|f64)(?!\.)/,className:`type`},{className:`keyword`,match:/\b(f32|f64|i32|i64)(?:\.(?:abs|add|and|ceil|clz|const|convert_[su]\/i(?:32|64)|copysign|ctz|demote\/f64|div(?:_[su])?|eqz?|extend_[su]\/i32|floor|ge(?:_[su])?|gt(?:_[su])?|le(?:_[su])?|load(?:(?:8|16|32)_[su])?|lt(?:_[su])?|max|min|mul|nearest|neg?|or|popcnt|promote\/f32|reinterpret\/[fi](?:32|64)|rem_[su]|rot[lr]|shl|shr_[su]|store(?:8|16|32)?|sqrt|sub|trunc(?:_[su]\/f(?:32|64))?|wrap\/i64|xor))\b/},{className:`number`,relevance:0,match:/[+-]?\b(?:\d(?:_?\d)*(?:\.\d(?:_?\d)*)?(?:[eE][+-]?\d(?:_?\d)*)?|0x[\da-fA-F](?:_?[\da-fA-F])*(?:\.[\da-fA-F](?:_?[\da-fA-D])*)?(?:[pP][+-]?\d(?:_?\d)*)?)\b|\binf\b|\bnan(?::0x[\da-fA-F](?:_?[\da-fA-D])*)?\b/}]}}t.exports=n})),ds=c(o(((e,t)=>{var n=Oo();n.registerLanguage(`xml`,ko()),n.registerLanguage(`bash`,Ao()),n.registerLanguage(`c`,jo()),n.registerLanguage(`cpp`,Mo()),n.registerLanguage(`csharp`,No()),n.registerLanguage(`css`,Po()),n.registerLanguage(`markdown`,Fo()),n.registerLanguage(`diff`,Io()),n.registerLanguage(`ruby`,Lo()),n.registerLanguage(`go`,Ro()),n.registerLanguage(`graphql`,zo()),n.registerLanguage(`ini`,Bo()),n.registerLanguage(`java`,Vo()),n.registerLanguage(`javascript`,Ho()),n.registerLanguage(`json`,Uo()),n.registerLanguage(`kotlin`,Wo()),n.registerLanguage(`less`,Go()),n.registerLanguage(`lua`,Ko()),n.registerLanguage(`makefile`,qo()),n.registerLanguage(`perl`,Jo()),n.registerLanguage(`objectivec`,Yo()),n.registerLanguage(`php`,Xo()),n.registerLanguage(`php-template`,Zo()),n.registerLanguage(`plaintext`,Qo()),n.registerLanguage(`python`,$o()),n.registerLanguage(`python-repl`,es()),n.registerLanguage(`r`,ts()),n.registerLanguage(`rust`,ns()),n.registerLanguage(`scss`,rs()),n.registerLanguage(`shell`,is()),n.registerLanguage(`sql`,as()),n.registerLanguage(`swift`,os()),n.registerLanguage(`yaml`,ss()),n.registerLanguage(`typescript`,cs()),n.registerLanguage(`vbnet`,ls()),n.registerLanguage(`wasm`,us()),n.HighlightJS=n,n.default=n,t.exports=n}))()).default;function fs({sessionId:e,messageUuid:t,pasteNumber:n,lineCount:r,filePath:i}){let[a,o]=(0,R.useState)(!1),[s,c]=(0,R.useState)(!1),[l,u]=(0,R.useState)(null),d=i&&i.length>60?`…`+i.slice(i.length-58):i;async function f(){let n=!a;if(o(n),!(!n||l||!i)){c(!0);try{let n=`/api/paste-expand?session=${encodeURIComponent(e)}&message=${encodeURIComponent(t)}&path=${encodeURIComponent(i)}`;u(await(await fetch(n)).json())}catch(e){u({source:`missing`,error:e.message})}finally{c(!1)}}}return(0,z.jsxs)(`div`,{className:`my-2 border border-line rounded-lg bg-bg-elevated overflow-hidden`,children:[(0,z.jsxs)(`button`,{type:`button`,onClick:f,disabled:!i,className:K(`w-full flex items-center justify-between gap-3 px-4 py-2.5 text-left transition-colors`,i?`hover:bg-bg-hover cursor-pointer`:`opacity-60 cursor-default`),title:i??`Claude Code did not record a file path for this paste`,children:[(0,z.jsxs)(`div`,{className:`flex items-center gap-3 min-w-0`,children:[(0,z.jsx)(`span`,{className:`text-lg`,children:`📎`}),(0,z.jsxs)(`div`,{className:`min-w-0`,children:[(0,z.jsxs)(`div`,{className:`text-sm font-semibold text-fg`,children:[`Pasted file · `,r.toLocaleString(),` line`,r===1?``:`s`,(0,z.jsxs)(`span`,{className:`text-fg-muted font-normal ml-2`,children:[`#`,n]})]}),i?(0,z.jsx)(`div`,{className:`text-xs font-mono text-fg-muted truncate`,children:d}):(0,z.jsx)(`div`,{className:`text-xs text-fg-muted italic`,children:`free-text paste — content not recorded by Claude Code`})]})]}),i&&(0,z.jsx)(`span`,{className:`text-xs text-accent shrink-0`,children:a?`collapse ▲`:`expand ▼`})]}),a&&i&&(0,z.jsxs)(`div`,{className:`border-t border-line`,children:[s&&(0,z.jsx)(`div`,{className:`px-4 py-6 text-sm text-fg-muted`,children:`Loading content…`}),!s&&l&&l.content&&(0,z.jsxs)(z.Fragment,{children:[(0,z.jsxs)(`div`,{className:`px-4 py-2 text-[10px] uppercase tracking-wider text-fg-muted border-b border-line bg-bg/50 flex justify-between items-center`,children:[(0,z.jsxs)(`span`,{children:[`source:`,` `,(0,z.jsx)(`span`,{className:`text-fg-dim`,children:l.source===`tool-result`?`in-session tool result (no disk access)`:l.source===`disk`?`live file on disk`:`unknown`})]}),(0,z.jsx)(`button`,{type:`button`,onClick:()=>navigator.clipboard.writeText(l.content??``),className:`text-fg-muted hover:text-fg`,children:`copy`})]}),(0,z.jsx)(`pre`,{className:`text-sm font-mono text-fg/90 leading-relaxed px-4 py-3 overflow-x-auto max-h-96 whitespace-pre-wrap`,children:l.content})]}),!s&&l&&!l.content&&(0,z.jsxs)(`div`,{className:`px-4 py-4 text-sm text-fg-muted`,children:[l.source===`missing`?`Cannot recover — file no longer at ${i} and no matching tool result in this session.`:l.error??`Unknown error.`,l.size!=null&&l.max!=null&&(0,z.jsxs)(`div`,{className:`text-xs mt-1`,children:[`File is `,(l.size/1024).toFixed(0),` KB; limit is `,(l.max/1024/1024).toFixed(0),` MB.`]})]})]})]})}var ps=/^\[Pasted text #(\d+) \+(\d+) lines\](?:\s+(\S.*))?$/;function ms(e){let t=e.trim().match(ps);return t?{pasteNumber:Number.parseInt(t[1],10),lineCount:Number.parseInt(t[2],10),filePath:t[3]?.trim()||null}:null}Y.setOptions({gfm:!0,breaks:!1});var hs=/<(local-command-caveat|local-command-stdout|command-name|command-message|command-args|system-reminder|user-prompt-submit-hook|task-notification)[\s\S]*?<\/\1>/gi,gs=/<(local-command-caveat|local-command-stdout|command-name|command-message|command-args|system-reminder|user-prompt-submit-hook|task-notification)[^>]*\/>/gi;function _s(e){let t=0,n=e.replace(hs,()=>(t+=1,``));return n=n.replace(gs,()=>(t+=1,``)),{cleaned:n.trim(),stripped:t}}function vs(e){return e.replace(/<pre><code(?:\s+class="language-([^"]+)")?>([\s\S]*?)<\/code><\/pre>/g,(e,t,n)=>{let r=n.replace(/</g,`<`).replace(/>/g,`>`).replace(/"/g,`"`).replace(/'/g,`'`).replace(/&/g,`&`);try{let e=t&&ds.getLanguage(t)?ds.highlight(r,{language:t,ignoreIllegals:!0}):ds.highlightAuto(r);return`<pre><code class="hljs language-${e.language??`plaintext`}">${e.value}</code></pre>`}catch{return`<pre><code class="hljs">${n}</code></pre>`}})}var ys={ALLOWED_ATTR:[`class`,`title`],FORBID_TAGS:[`style`,`form`,`input`,`button`,`iframe`,`object`,`embed`],FORBID_ATTR:[`style`,`onerror`,`onload`,`onclick`,`href`,`src`],ALLOW_DATA_ATTR:!1};function bs(e){return Ya.sanitize(e,ys)}function xs(e){return Ss(bs(vs(Y.parse(e,{async:!1}))))}function Ss(e){return e.replace(/(<pre><code[^>]*>[\s\S]*?<\/code><\/pre>)/g,(e,t)=>`<div class="recall-code-block group/code relative">
|
|
83
|
-
<button type="button" data-copy-code="1"
|
|
84
|
-
class="absolute top-2 right-2 text-[10px] font-medium uppercase tracking-wider text-fg-muted hover:text-fg bg-bg-elevated border border-line rounded px-1.5 py-0.5 opacity-0 group-hover/code:opacity-100 transition-opacity z-10"
|
|
85
|
-
title="copy this code block to clipboard">copy</button>
|
|
86
|
-
${t}
|
|
87
|
-
</div>`)}function Cs(e,t){let n=ft(t);return n?e.replace(/(>)([^<]+)(<)/g,(e,t,r,i)=>t+r.replace(n,`<mark>$1</mark>`)+i):e}function ws(e){return e.replace(/[&<>"']/g,e=>({"&":`&`,"<":`<`,">":`>`,'"':`"`,"'":`'`})[e])}var Ts=(0,R.forwardRef)(function({message:e,searchQuery:t,sessionId:n,isMatch:r,isActiveMatch:i,activationTick:a,collapseDefault:o=!1},s){let[c,l]=(0,R.useState)(`pretty`),[u,d]=(0,R.useState)(!1),[f,p]=(0,R.useState)(o);(0,R.useEffect)(()=>{p(o)},[o]);let m=(0,R.useMemo)(()=>ms(e.content_text??``),[e.content_text]),h=(0,R.useMemo)(()=>{let t=e.content_text??``;if(!t)return{html:``,strippedCount:0,rawLen:0};if(c===`raw`)return{html:`<pre>${ws(t)}</pre>`,strippedCount:0,rawLen:t.length};let{cleaned:n,stripped:r}=c===`include-system`?{cleaned:t,stripped:0}:_s(t);return{html:xs(n||`_(content was entirely system-only)_`),strippedCount:r,rawLen:t.length}},[e.content_text,c]),g=(0,R.useMemo)(()=>h.html?c===`raw`?h.html:t?Cs(h.html,t):h.html:``,[h.html,t,c]),_=h.strippedCount,v=h.rawLen,y=e.role===`user`?`text-role-user border-role-user/40`:e.role===`assistant`?`text-role-assistant border-role-assistant/40`:`text-fg-dim border-line`,b=e.role===`user`?`user`:e.role===`assistant`?`assistant`:e.type,x=e.tool_names?e.tool_names.split(`,`).filter(Boolean):[],S=(e.content_text??``).slice(0,64),C=e.role===`user`&&(S.startsWith(`**Tool result**`)||S.startsWith(`_(tool result was empty`)),w=x.length>0||C,T=v>6e3,E=T&&!u&&c!==`raw`&&!f;return(0,z.jsxs)(`article`,{ref:s,className:K(`border-l-2 pl-4 py-3 group scroll-mt-4`,y,e.is_sidechain&&`opacity-70`,r&&`match-highlight-border rounded`,i&&`match-flash`),children:[(0,z.jsxs)(`header`,{className:`flex items-center gap-2 text-xs mb-2 flex-wrap`,children:[(0,z.jsx)(`span`,{className:K(`font-semibold uppercase tracking-wider`,y),children:b}),e.is_sidechain===1&&(0,z.jsx)(`span`,{className:`badge bg-bg-active text-fg-muted`,children:`subagent`}),e.timestamp&&(0,z.jsx)(`span`,{className:`text-fg-muted font-mono`,children:new Date(e.timestamp).toLocaleTimeString()}),x.length>0&&(0,z.jsxs)(`span`,{className:`badge bg-role-tool/15 text-role-tool`,children:[`⚡ `,x.join(`, `)]}),_>0&&(0,z.jsx)(`button`,{type:`button`,onClick:()=>l(e=>e===`include-system`?`pretty`:`include-system`),className:`badge bg-bg-active text-fg-muted hover:text-fg`,title:`some system-injected content was hidden — click to toggle`,children:c===`include-system`?`— hide system`:`+ ${_} system`}),w&&(0,z.jsx)(`button`,{type:`button`,onClick:()=>p(e=>!e),className:`text-fg-muted hover:text-fg text-xs border border-line rounded px-1.5 py-0.5`,title:f?`expand this tool message`:`collapse this tool message`,"aria-expanded":!f,children:f?`▸ expand`:`▾ collapse`}),(0,z.jsxs)(`div`,{className:`ml-auto flex items-center gap-2 text-fg-muted opacity-0 group-hover:opacity-100 transition-opacity`,children:[(0,z.jsx)(`button`,{type:`button`,onClick:()=>{e.content_text&&navigator.clipboard.writeText(e.content_text)},className:`hover:text-fg-dim text-xs`,title:`copy message content`,children:`copy`}),(0,z.jsx)(`button`,{type:`button`,onClick:()=>l(e=>e===`raw`?`pretty`:`raw`),className:`hover:text-fg-dim text-xs`,title:`toggle raw plain-text view`,children:c===`raw`?`rendered`:`raw`})]})]}),f?(0,z.jsxs)(`div`,{className:`text-xs italic text-fg-muted`,children:[`(collapsed`,v?` · ${v.toLocaleString()} chars`:``,` — click expand to view)`]}):m&&c!==`raw`?(0,z.jsx)(fs,{sessionId:n,messageUuid:e.uuid,pasteNumber:m.pasteNumber,lineCount:m.lineCount,filePath:m.filePath}):g?(0,z.jsx)(`div`,{className:K(`prose-message relative`,E&&`max-h-72 overflow-hidden`),onClick:e=>{let t=e.target;if(t.dataset?.copyCode!==`1`)return;e.preventDefault(),e.stopPropagation();let n=t.closest(`.recall-code-block`);if(!n)return;let r=n.querySelector(`code`)?.textContent??``;navigator.clipboard.writeText(r).then(()=>{let e=t.textContent;t.textContent=`copied!`,t.classList.add(`!text-accent`),setTimeout(()=>{t.textContent=e,t.classList.remove(`!text-accent`)},1200)})},dangerouslySetInnerHTML:{__html:g}}):(0,z.jsx)(`div`,{className:`text-xs italic text-fg-muted`,children:`(empty message)`}),E&&(0,z.jsxs)(`button`,{type:`button`,onClick:()=>d(!0),className:`mt-2 text-xs text-accent hover:underline`,children:[`expand full message (`,v.toLocaleString(),` chars)`]}),T&&u&&c!==`raw`&&!f&&(0,z.jsx)(`button`,{type:`button`,onClick:()=>d(!1),className:`mt-2 text-xs text-fg-muted hover:text-fg-dim`,children:`collapse`})]},a??0)}),Es=(0,R.memo)(Ts,(e,t)=>e.message===t.message&&e.searchQuery===t.searchQuery&&e.sessionId===t.sessionId&&e.isMatch===t.isMatch&&e.isActiveMatch===t.isActiveMatch&&e.activationTick===t.activationTick&&e.collapseDefault===t.collapseDefault);function Ds(){let e=B();return at({mutationFn:async({sessionId:e,alias:t})=>{let n=await fetch(`/api/sessions/${encodeURIComponent(e)}/alias`,{method:`PUT`,headers:{"content-type":`application/json`},body:JSON.stringify({alias:t})});if(!n.ok){let e=await n.text().catch(()=>``);throw Error(`${n.status}: ${e.slice(0,200)}`)}return n.json()},onSuccess:()=>{e.invalidateQueries({queryKey:[`sessions`]}),e.invalidateQueries({queryKey:[`session`]}),e.invalidateQueries({queryKey:[`search`]}),e.invalidateQueries({queryKey:[`searchCount`]}),e.invalidateQueries({queryKey:[`thread`]}),e.invalidateQueries({queryKey:[`sessionThreads`]})}})}function Os(){let e=B();return at({mutationFn:async e=>{let t=await fetch(`/api/sessions/${encodeURIComponent(e)}/alias`,{method:`DELETE`});if(!t.ok){let e=await t.text().catch(()=>``);throw Error(`${t.status}: ${e.slice(0,200)}`)}},onSuccess:()=>{e.invalidateQueries({queryKey:[`sessions`]}),e.invalidateQueries({queryKey:[`session`]}),e.invalidateQueries({queryKey:[`search`]}),e.invalidateQueries({queryKey:[`searchCount`]}),e.invalidateQueries({queryKey:[`thread`]}),e.invalidateQueries({queryKey:[`sessionThreads`]})}})}function ks(){return V({queryKey:[`auto-title-config`],queryFn:()=>W.getAutoTitleConfig()})}function As(){let e=B();return at({mutationFn:e=>W.putAutoTitleConfig(e),onSuccess:()=>void e.invalidateQueries({queryKey:[`auto-title-config`]})})}function js({sessionId:e}){let t=cr(e),n=lr(),r=ur(),i=t.data,a=i?.content??``,o=a.length>0,s=i?.auto_synopsis??null,c=i?.auto_synopsis_generated_at??null,l=!!s&&s.length>0,u=o||l,[d,f]=(0,R.useState)(!1),[p,m]=(0,R.useState)(!1),[h,g]=(0,R.useState)(``),[_,v]=(0,R.useState)(!1);(0,R.useEffect)(()=>{v(!1)},[e]);let y=(0,R.useRef)(null);(0,R.useEffect)(()=>{m(!1),f(u),g(a)},[e,u,a]),(0,R.useEffect)(()=>{p&&(g(a),requestAnimationFrame(()=>{y.current?.focus();let e=y.current;e&&(e.selectionStart=e.selectionEnd=e.value.length)}))},[p,a]);let b=async()=>{try{await n.mutateAsync({sessionId:e,content:h}),m(!1)}catch(e){console.error(`note save failed`,e)}},x=()=>{g(a),m(!1)},S=async()=>{try{await r.mutateAsync(e),G({message:`Synopsis generated`,tone:`success`,duration:4e3})}catch(e){let t=e?.message??`unknown error`;G({message:/403/.test(t)?`Agent generation disabled — open a session and click ✨ on the title bar to enable`:`Synopsis generation failed: ${t}`,tone:`error`,duration:6e3})}},C=h!==a,w=i?.updated_at?new Date(i.updated_at):null,T=c?new Date(c):null;return(0,z.jsxs)(`div`,{className:`border-b border-line bg-bg/30`,children:[(0,z.jsxs)(`button`,{type:`button`,onClick:()=>f(e=>!e),className:`w-full flex items-center justify-between px-5 py-2 text-xs text-fg-dim hover:text-fg transition-colors`,children:[(0,z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,z.jsx)(`span`,{className:K(`transition-transform`,d&&`rotate-90`),children:`▸`}),(0,z.jsx)(`span`,{className:`font-medium uppercase tracking-wider`,children:`📝 Notes`}),o&&!d&&(0,z.jsx)(`span`,{className:`text-fg-muted normal-case tracking-normal truncate max-w-lg`,children:a.split(`
|
|
88
|
-
`)[0].slice(0,120)}),!o&&!d&&(0,z.jsx)(`span`,{className:`text-fg-muted normal-case tracking-normal italic`,children:`none yet — click to add`})]}),w&&o&&(0,z.jsxs)(`span`,{className:`text-fg-muted normal-case tracking-normal font-mono`,children:[`updated `,w.toLocaleString()]})]}),d&&(0,z.jsx)(`div`,{className:`px-5 pb-3`,children:p?(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(`textarea`,{ref:y,value:h,onChange:e=>g(e.target.value),onKeyDown:e=>{(e.metaKey||e.ctrlKey)&&e.key===`Enter`?(e.preventDefault(),b()):e.key===`Escape`&&(e.preventDefault(),x())},placeholder:`Your markdown notes for this session…\\n\\nCmd/Ctrl+Enter saves. Esc cancels.`,rows:8,className:`w-full bg-bg-elevated border border-line rounded p-3 text-sm text-fg font-mono leading-relaxed focus:outline-none focus:border-accent placeholder:text-fg-muted resize-y`,spellCheck:!0}),(0,z.jsxs)(`div`,{className:`flex items-center justify-between mt-2 text-xs`,children:[(0,z.jsxs)(`div`,{className:`text-fg-muted`,children:[h.length.toLocaleString(),` chars`,C&&(0,z.jsx)(`span`,{className:`text-accent ml-2`,children:`· unsaved`}),(0,z.jsxs)(`span`,{className:`ml-3 text-fg-muted`,children:[`mirrored to `,(0,z.jsxs)(`span`,{className:`font-mono`,children:[`~/.recall/notes/`,e.slice(0,8),`.md`]})]})]}),(0,z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,z.jsx)(`button`,{type:`button`,onClick:x,className:`px-3 py-1 text-fg-muted hover:text-fg`,children:`cancel`}),(0,z.jsx)(`button`,{type:`button`,onClick:b,disabled:!C||n.isPending,className:`px-3 py-1 rounded border border-accent bg-accent/10 text-accent font-medium hover:bg-accent hover:text-bg disabled:opacity-50 disabled:cursor-not-allowed`,children:n.isPending?`saving…`:`save`})]})]})]}):(0,z.jsxs)(z.Fragment,{children:[o?(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(`div`,{className:`bg-bg-elevated border border-line rounded p-3 max-h-72 overflow-y-auto`,children:(0,z.jsx)(Qa,{text:a})}),(0,z.jsxs)(`div`,{className:`flex items-center justify-end gap-3 mt-2`,children:[(0,z.jsx)(Ms,{hasSynopsis:l,pending:r.isPending,onClick:S}),(0,z.jsx)(`button`,{type:`button`,onClick:()=>m(!0),className:`text-xs text-accent hover:underline`,children:`✎ edit`})]})]}):(0,z.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,z.jsx)(`button`,{type:`button`,onClick:()=>m(!0),className:`w-full border border-dashed border-line rounded p-4 text-sm text-fg-muted hover:border-accent hover:text-fg-dim transition-colors`,children:`+ add a note for this session`}),(0,z.jsx)(`div`,{className:`flex items-center justify-end`,children:(0,z.jsx)(Ms,{hasSynopsis:l,pending:r.isPending,onClick:S})})]}),l&&(0,z.jsxs)(`div`,{className:`mt-4`,children:[(0,z.jsxs)(`div`,{className:`flex items-center justify-between mb-1.5 text-xs`,children:[(0,z.jsxs)(`button`,{type:`button`,onClick:()=>v(e=>!e),className:`flex items-center gap-1.5 text-fg-muted hover:text-fg transition-colors`,title:_?`expand auto-synopsis`:`collapse auto-synopsis`,"aria-expanded":!_,children:[(0,z.jsx)(`span`,{className:K(`transition-transform`,!_&&`rotate-90`),"aria-hidden":`true`,children:`▸`}),(0,z.jsx)(`span`,{className:`text-accent`,"aria-hidden":`true`,children:`✨`}),(0,z.jsx)(`span`,{className:`font-medium uppercase tracking-wider`,children:`Auto-synopsis`}),T&&(0,z.jsxs)(`span`,{className:`text-fg-muted normal-case tracking-normal font-mono`,children:[`· generated `,T.toLocaleString()]})]}),(0,z.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,z.jsx)(`button`,{type:`button`,onClick:()=>v(e=>!e),className:`text-xs text-fg-muted hover:text-fg`,title:_?`expand auto-synopsis`:`collapse auto-synopsis`,children:_?`▸ expand`:`▾ collapse`}),(0,z.jsx)(`button`,{type:`button`,onClick:S,disabled:r.isPending,className:`text-xs text-accent hover:underline disabled:opacity-50`,title:`run claude -p again over the latest transcript`,children:r.isPending?`regenerating…`:`↻ regenerate`})]})]}),!_&&(0,z.jsx)(`div`,{className:`bg-bg-elevated border border-accent/40 rounded p-3 border-l-2 max-h-96 overflow-y-auto`,children:(0,z.jsx)(Qa,{text:s??``})})]})]})})]})}function Ms({hasSynopsis:e,pending:t,onClick:n}){return e?null:(0,z.jsx)(`button`,{type:`button`,onClick:n,disabled:t,className:`text-xs text-accent hover:underline disabled:opacity-50`,title:`reads this session's transcript and writes a markdown synopsis below your note`,children:t?`generating…`:`✨ generate synopsis`})}function Ns({sessionId:e,tags:t}){let[n,r]=(0,R.useState)(!1),i=kt(),[,a]=Pt();return(0,z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5 normal-case tracking-normal`,children:[t.map(t=>(0,z.jsxs)(`span`,{className:`group inline-flex items-center gap-1 px-2 py-0.5 rounded-full bg-role-tool/15 text-role-tool text-xs font-medium border border-role-tool/30`,children:[(0,z.jsxs)(`span`,{children:[`#`,t]}),(0,z.jsx)(`button`,{type:`button`,onClick:()=>i.mutate({sessionId:e,tag:t}),className:`opacity-60 hover:opacity-100 transition-opacity`,title:`remove #${t}`,children:`×`})]},t)),n?(0,z.jsx)(Wn,{sessionId:e,existingTags:t,onDone:()=>r(!1),variant:`bar`}):(0,z.jsx)(`button`,{type:`button`,onClick:()=>r(!0),className:K(`inline-flex items-center gap-1 px-2 py-0.5 rounded-full border border-dashed text-xs transition-colors`,t.length===0?`border-line text-fg-muted hover:text-fg hover:border-accent`:`border-line/50 text-fg-muted opacity-60 hover:opacity-100 hover:text-fg`),title:`add a tag — typing #tagname in the search box also filters by tag`,children:`+ tag`}),(0,z.jsx)(`button`,{type:`button`,onClick:()=>a({view:`help`,helpSection:`taxonomy`}),className:`inline-flex items-center justify-center w-4 h-4 rounded-full text-[10px] text-fg-muted/70 hover:text-accent hover:bg-accent/10 transition-colors`,title:`Tag vs Collection vs Alias vs Note — what's the difference?`,"aria-label":`Tag vs other organizers — what's the difference?`,children:`?`})]})}function Ps({sessionId:e}){let t=mt(),n=Gn(),r=B(),[i,a]=(0,R.useState)(!1),[o,s]=(0,R.useState)(!1);Kn(!!n.error,()=>n.reset());let c=()=>{let r=t.data;if(!r||!r.enabled){a(!0);return}if(r.backend===`api`&&!r.hasApiKey){a(!0);return}if(r.backend===`mcp`){s(!0);return}n.start({sessionIds:[e]})},l=()=>{r.invalidateQueries({queryKey:[`sessions`]}),r.invalidateQueries({queryKey:[`session`,e]}),r.invalidateQueries({queryKey:[`tags`]})},u=async e=>{let t=await n.apply(e);if(t&&t.applied>0){l();let n=e.reduce((e,t)=>e+t.tags.length,0);G({message:`Applied ${t.applied} tag${t.applied===1?``:`s`} to this session.`,tone:`success`,duration:1e4,action:{label:`Undo`,onClick:()=>{d(e,n)}}})}else t&&G({message:`Nothing to apply — all selected tags were already present.`,tone:`info`});return t},d=async(e,t)=>{let n=0;for(let t of e)for(let e of t.tags)try{await W.removeSessionTag(t.sessionId,e),n+=1}catch(n){console.error(`undo: remove failed`,t.sessionId,e,n)}l(),G({message:`Undone — removed ${n} of ${t} tag${t===1?``:`s`}.`,tone:`info`})},f=async()=>{if(!n.snapshot)return;let e=n.snapshot.results.filter(e=>e.error).map(e=>e.sessionId);e.length!==0&&(n.reset(),await n.start({sessionIds:e}))};return(0,z.jsxs)(z.Fragment,{children:[(0,z.jsxs)(`div`,{className:`inline-flex items-center rounded border border-accent/40 bg-accent/10 overflow-hidden`,children:[(0,z.jsx)(`button`,{type:`button`,onClick:c,disabled:!!n.id,className:`text-xs text-accent hover:bg-accent hover:text-bg px-2 py-1 font-medium border-r border-accent/40 disabled:opacity-50 disabled:cursor-wait`,title:t.data?.enabled?`auto-tag this session with an LLM`:`configure auto-tagging`,children:n.id?`🏷 scanning…`:`🏷 auto-tag`}),(0,z.jsx)(`button`,{type:`button`,onClick:()=>a(!0),className:`text-xs text-accent hover:bg-accent hover:text-bg px-1.5 py-1`,title:`auto-tag settings (enable autopilot, install MCP, change model, paste API key)`,"aria-label":`auto-tag settings`,children:`⚙`})]}),(0,z.jsx)(Jn,{open:i,onClose:()=>a(!1)}),(0,z.jsx)(Zn,{open:o,sessionId:e,onClose:()=>{s(!1),G({message:`MCP scan triggered. New tags will appear on this session as your Claude Code agent writes them.`,tone:`info`,duration:8e3})},onOpenSettings:()=>{s(!1),a(!0)}}),n.error&&(0,z.jsx)(`div`,{className:`fixed inset-0 z-40 bg-black/40 flex items-center justify-center`,children:(0,z.jsxs)(`div`,{className:`bg-bg border border-role-user/60 rounded-lg w-[440px] shadow-xl p-4 text-xs`,children:[(0,z.jsx)(`div`,{className:`text-role-user font-semibold mb-2`,children:`Scan failed`}),(0,z.jsx)(`div`,{className:`text-fg-muted mb-3 break-words`,children:n.error}),(0,z.jsx)(`div`,{className:`flex justify-end`,children:(0,z.jsx)(`button`,{type:`button`,onClick:()=>n.reset(),className:`text-fg-muted hover:text-fg text-xs px-3 py-1`,children:`Close`})})]})}),(0,z.jsx)(Yn,{open:!!n.id&&!n.error,snapshot:n.snapshot,onApply:u,onCancel:()=>void n.cancel(),onClose:()=>n.reset(),onRetryFailed:()=>void f()})]})}function Fs({sessionId:e}){let t=V({queryKey:[`sessionStats`,e],queryFn:()=>W.getSessionStats(e),staleTime:3e4}).data;return!t||t.totalTokens===0?null:(0,z.jsxs)(`a`,{href:`#/stats`,className:`normal-case tracking-normal shrink-0 inline-flex items-center gap-1.5 text-[11px] font-medium text-fg-dim hover:text-accent border border-line hover:border-accent/60 rounded px-2 py-0.5 transition-colors`,title:`session cost — derived from token counts (pricing may change)\n\ninput: ${t.inputTokens.toLocaleString()}\noutput: ${t.outputTokens.toLocaleString()}\ncache write: ${t.cacheCreateTokens.toLocaleString()}\ncache read: ${t.cacheReadTokens.toLocaleString()}\ntotal: ${t.totalTokens.toLocaleString()}\n\nmodel: ${t.primaryModelLabel}${t.primaryModel?` (${t.primaryModel})`:``}`+(t.byModel.length>1?`\n\n${t.byModel.length} models used — click to view dashboard`:``),children:[(0,z.jsx)(`span`,{className:`text-accent font-semibold`,children:t.display.dollars}),(0,z.jsx)(`span`,{className:`text-fg-muted`,children:`·`}),(0,z.jsxs)(`span`,{children:[t.display.tokens,` tok`]}),(0,z.jsx)(`span`,{className:`text-fg-muted`,children:`·`}),(0,z.jsx)(`span`,{className:`text-fg-muted`,children:t.primaryModelLabel})]})}function Is({sessionId:e}){let[t,n]=(0,R.useState)(!1),r=V({queryKey:[`sessionCommits`,e],queryFn:()=>W.getSessionCommits(e),staleTime:3e4}).data?.commits??[];if(r.length===0)return null;let i=`${r.length} commit${r.length===1?``:`s`}`;return(0,z.jsxs)(`div`,{className:`px-5 py-2 border-b border-line bg-bg/60 normal-case tracking-normal text-xs`,children:[(0,z.jsxs)(`button`,{type:`button`,onClick:()=>n(e=>!e),className:`flex items-center gap-1.5 text-fg-muted hover:text-fg`,title:`commits authored during this session`,children:[(0,z.jsx)(`span`,{className:`text-[10px]`,children:t?`▾`:`▸`}),(0,z.jsx)(`span`,{className:`font-medium text-fg-dim`,children:`⎇`}),(0,z.jsxs)(`span`,{children:[i,` authored during this session`]})]}),t&&(0,z.jsx)(`ul`,{className:`mt-2 space-y-1.5 pl-5`,children:r.map(e=>(0,z.jsxs)(`li`,{className:`flex items-start gap-2 text-[11px]`,children:[(0,z.jsx)(`code`,{className:`font-mono text-accent shrink-0`,title:e.commit_sha,children:e.commit_sha.slice(0,8)}),(0,z.jsx)(`span`,{className:`text-fg truncate min-w-0 flex-1`,children:e.subject??(0,z.jsx)(`span`,{className:`italic text-fg-muted`,children:`(no subject)`})}),e.committed_at&&(0,z.jsx)(`time`,{className:`text-fg-muted shrink-0 font-mono`,children:e.committed_at.replace(`T`,` `).slice(0,19)})]},e.commit_sha))})]})}function Ls(e,t){e.invalidateQueries({queryKey:[`threads`]}),t&&e.invalidateQueries({queryKey:[`thread`,t]}),e.invalidateQueries({queryKey:[`sessionThreads`]})}function Rs(e=!1){return V({queryKey:[`threads`,{archived:e}],queryFn:()=>W.listThreads(e),staleTime:1e4})}function zs(e){return V({queryKey:[`thread`,e],queryFn:()=>W.getThread(e),enabled:!!e,staleTime:1e4})}function Bs(e){return V({queryKey:[`sessionThreads`,e],queryFn:()=>W.threadsForSession(e),enabled:!!e,staleTime:3e4})}function Vs(){let e=B();return at({mutationFn:e=>W.createThread(e),onSuccess:t=>Ls(e,t.thread.id)})}function Hs(){let e=B();return at({mutationFn:({id:e,patch:t})=>W.patchThread(e,t),onSuccess:t=>Ls(e,t.thread.id)})}function Us(){let e=B();return at({mutationFn:({threadId:e,sessionId:t,parentSessionId:n,role:r})=>W.addSessionToThread(e,{sessionId:t,parentSessionId:n,role:r}),onSuccess:(t,n)=>Ls(e,n.threadId)})}function Ws(){let e=B();return at({mutationFn:({threadId:e,sessionId:t})=>W.removeSessionFromThread(e,t),onSuccess:(t,n)=>Ls(e,n.threadId)})}function Gs(){let e=B();return at({mutationFn:({threadId:e,sessionId:t,parentSessionId:n})=>W.setThreadSessionParent(e,t,n),onSuccess:(t,n)=>Ls(e,n.threadId)})}function Ks(e,t){let n=t.trim().toLowerCase();return n?e.filter(e=>e.name.toLowerCase().includes(n)):[...e]}function qs({sessionId:e}){let[,t]=Pt(),n=Bs(e),r=Rs(),i=Vs(),a=Us(),o=Ws(),[s,c]=(0,R.useState)(!1),[l,u]=(0,R.useState)(``),d=n.data?.threads??[],f=new Set(d.map(e=>e.id)),p=(r.data?.threads??[]).filter(e=>!f.has(e.id));return(0,z.jsxs)(`div`,{className:`flex flex-wrap items-start gap-1.5 px-5 py-2 border-b border-line bg-bg/60 normal-case tracking-normal`,children:[(0,z.jsx)(`span`,{className:`text-[10px] uppercase tracking-wider text-fg-muted mr-1 pt-0.5`,title:`Threads group a session with related sessions (for example, a planning session plus the execution sessions it spawned).`,children:`🧵 Threads`}),d.map(n=>(0,z.jsxs)(`span`,{className:`inline-flex items-center gap-1 px-2 py-0.5 rounded-full bg-accent/10 text-accent text-xs border border-accent/30`,title:`${n.session_count} session${n.session_count===1?``:`s`} in this thread`,children:[(0,z.jsx)(`button`,{type:`button`,onClick:()=>t({view:`threads`,thread:n.id}),className:`hover:underline`,title:`open the "${n.name}" thread graph`,children:n.name}),(0,z.jsx)(`button`,{type:`button`,onClick:()=>o.mutate({threadId:n.id,sessionId:e}),className:`text-fg-muted hover:text-role-user text-[11px]`,title:`unlink this session from the thread (thread keeps existing)`,children:`✕`})]},n.id)),s?(0,z.jsx)(Js,{sessionId:e,available:p,activeCount:d.length,newName:l,setNewName:u,creating:i.isPending,adding:a.isPending,onPickExisting:t=>{a.mutate({threadId:t,sessionId:e},{onSuccess:()=>c(!1)})},onCreate:()=>{let t=l.trim();t&&i.mutate({name:t,originSessionId:e},{onSuccess:()=>{u(``),c(!1)}})},onCancel:()=>{c(!1),u(``)}}):(0,z.jsx)(`button`,{type:`button`,onClick:()=>c(!0),className:`text-xs text-accent hover:underline`,title:`Link this session into an existing thread, or create a new one with this session as the origin (reverse path is + Add session from the thread detail page).`,children:`+ Add to thread`})]})}function Js({available:e,activeCount:t,newName:n,setNewName:r,creating:i,adding:a,onPickExisting:o,onCreate:s,onCancel:c}){let[l,u]=(0,R.useState)(``),d=(0,R.useMemo)(()=>Ks(e,l),[e,l]),f=l.trim().length>0;return(0,z.jsxs)(`div`,{className:`w-full mt-1 rounded border border-accent/30 bg-accent/5 p-2 space-y-2`,children:[(0,z.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,z.jsx)(`span`,{className:`text-[11px] uppercase tracking-wider font-medium text-fg-muted`,children:`Link to a thread`}),(0,z.jsx)(`button`,{type:`button`,onClick:c,className:`text-[11px] text-fg-muted hover:text-fg`,title:`Close the picker without linking this session to any thread.`,children:`cancel`})]}),e.length>0&&(0,z.jsx)(`input`,{autoFocus:!0,type:`text`,value:l,onChange:e=>u(e.target.value),onKeyDown:e=>{e.key===`Enter`&&d.length===1?(e.preventDefault(),o(d[0].id)):e.key===`Escape`&&(e.preventDefault(),l?u(``):c())},placeholder:`search threads by name`,"aria-label":`Search threads by name`,className:`w-full text-xs bg-bg-elevated border border-line rounded px-2 py-1`}),e.length>0?d.length>0?(0,z.jsxs)(`div`,{children:[(0,z.jsx)(`div`,{className:`text-[11px] text-fg-muted mb-1`,children:f?`${d.length} match${d.length===1?``:`es`}: click to link this session.`:`Click an existing thread to link this session into it:`}),(0,z.jsx)(`div`,{className:`flex flex-wrap gap-1`,children:d.map(e=>(0,z.jsxs)(`button`,{type:`button`,onClick:()=>o(e.id),disabled:a,className:`inline-flex items-center gap-1 px-2 py-1 rounded-full border border-line hover:border-accent hover:bg-accent/10 text-xs disabled:opacity-50`,title:`Link this session into "${e.name}" (${e.session_count} session${e.session_count===1?``:`s`}, ${e.closed_at?`closed`:`open`})`,children:[(0,z.jsx)(`span`,{className:`font-medium`,children:e.name}),(0,z.jsx)(`span`,{className:`text-fg-muted`,children:e.session_count})]},e.id))})]}):(0,z.jsxs)(`div`,{className:`text-[11px] text-fg-muted italic`,children:[`No threads match "`,l.trim(),`". Create a new one below.`]}):(0,z.jsx)(`div`,{className:`text-[11px] text-fg-muted italic`,children:t>0?`No other threads available. Create a new one below.`:`No threads exist yet. Create the first one below.`}),(0,z.jsxs)(`form`,{onSubmit:e=>{e.preventDefault(),s()},className:`flex items-center gap-1.5 pt-1 border-t border-accent/20`,children:[(0,z.jsx)(`span`,{className:`text-[11px] text-fg-muted`,title:`Creating a new thread with this session as the first member (origin)`,children:`Or create new:`}),(0,z.jsx)(`input`,{value:n,onChange:e=>r(e.target.value),placeholder:`thread name (this session becomes the origin)`,className:`flex-1 text-xs bg-bg-elevated border border-line rounded px-2 py-1`}),(0,z.jsx)(`button`,{type:`submit`,disabled:!n.trim()||i,className:`text-xs px-2 py-1 rounded bg-accent text-bg font-medium disabled:opacity-50`,title:`Create a new thread with this session set as the origin`,children:`Create`})]})]})}function Ys({sessionId:e}){let t=V({queryKey:[`verification-detail`,e],queryFn:()=>W.getVerificationDetail(e),staleTime:6e4});if(!t.data||t.data.status===`neutral`)return null;let{status:n,evidence:r}=t.data,i=[[`File writes`,r.fileWrites],[`Test runs`,r.testRuns],[`Git commits`,r.commits],[`Build success`,r.buildSuccess]];return(0,z.jsxs)(`div`,{className:`mt-3 p-3 rounded-lg bg-surface-2 text-xs`,children:[(0,z.jsxs)(`div`,{className:`flex items-center gap-2 mb-2`,children:[(0,z.jsx)(`span`,{className:`font-medium ${n===`verified`?`text-green-500`:`text-yellow-500`}`,children:n===`verified`?`Verified`:`Unverified`}),(0,z.jsx)(`span`,{className:`text-fg-muted`,children:`completion evidence`})]}),(0,z.jsx)(`div`,{className:`grid grid-cols-2 gap-1`,children:i.map(([e,t])=>(0,z.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,z.jsx)(`span`,{className:t?`text-green-500`:`text-fg-muted/40`,children:t?`✓`:`✗`}),(0,z.jsx)(`span`,{className:t?`text-fg`:`text-fg-muted`,children:e})]},e))})]})}function Xs({excludeSessionId:e,onPick:t,onClose:n}){let[r,i]=(0,R.useState)(``),a=(0,R.useRef)(null);(0,R.useEffect)(()=>{requestAnimationFrame(()=>a.current?.focus());let e=e=>{e.key===`Escape`&&n()};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[n]);let o=V({queryKey:[`sessions`,`picker`],queryFn:()=>W.sessions({limit:300})}),s=r.trim().toLowerCase(),c=(o.data??[]).filter(t=>e&&t.id===e?!1:s?[t.alias,t.project,t.first_user_message,t.id,...t.tags.map(e=>`#${e}`)].filter(Boolean).join(` `).toLowerCase().includes(s):!0);return(0,z.jsx)(`div`,{className:`fixed inset-0 bg-black/60 z-40 flex items-start justify-center pt-24 px-6`,onClick:n,children:(0,z.jsxs)(`div`,{className:`bg-bg-elevated border border-line rounded-xl shadow-2xl w-full max-w-2xl max-h-[70vh] flex flex-col overflow-hidden`,onClick:e=>e.stopPropagation(),children:[(0,z.jsxs)(`div`,{className:`p-4 border-b border-line`,children:[(0,z.jsx)(`div`,{className:`text-xs uppercase tracking-wider text-fg-dim mb-2`,children:`Compare with another session`}),(0,z.jsx)(`input`,{ref:a,type:`text`,value:r,onChange:e=>i(e.target.value),placeholder:`filter by alias, project, tag, prompt, id…`,className:`w-full bg-bg border border-line rounded px-3 py-2 text-sm focus:outline-none focus:border-accent`})]}),(0,z.jsxs)(`div`,{className:`flex-1 overflow-y-auto`,children:[o.isLoading&&(0,z.jsx)(`div`,{className:`p-6 text-sm text-fg-muted`,children:`Loading sessions…`}),c.length===0&&!o.isLoading&&(0,z.jsx)(`div`,{className:`p-6 text-sm text-fg-muted`,children:`No sessions match.`}),c.map(e=>(0,z.jsx)(Zs,{session:e,onPick:()=>t(e.id)},e.id))]}),(0,z.jsxs)(`div`,{className:`p-3 border-t border-line text-xs text-fg-muted flex justify-between`,children:[(0,z.jsxs)(`span`,{children:[(0,z.jsx)(`kbd`,{className:`font-mono border border-line rounded px-1`,children:`Esc`}),` to close`]}),(0,z.jsxs)(`span`,{children:[c.length,` available`]})]})]})})}function Zs({session:e,onPick:t}){return(0,z.jsxs)(`button`,{type:`button`,onClick:t,className:K(`block w-full text-left px-4 py-3 border-b border-line/60 hover:bg-bg-hover transition-colors`),children:[(0,z.jsxs)(`div`,{className:`flex items-center justify-between gap-3 mb-1`,children:[(0,z.jsxs)(`div`,{className:`flex items-center gap-2 min-w-0 flex-1`,children:[(0,z.jsx)(`span`,{className:`font-mono text-xs text-accent shrink-0`,children:st(e.id)}),(0,z.jsx)(`span`,{className:`badge bg-bg-active text-fg-dim shrink-0 truncate`,children:e.project}),e.alias&&(0,z.jsx)(`span`,{className:`font-semibold text-sm text-fg truncate`,children:e.alias})]}),(0,z.jsx)(`div`,{className:`text-xs text-fg-muted shrink-0`,children:lt(e.started_at)})]}),!e.alias&&(0,z.jsx)(`div`,{className:`text-xs text-fg-dim line-clamp-1`,children:ct(e.first_user_message,160)||(0,z.jsx)(`span`,{className:`italic text-fg-muted`,children:`(no prompt)`})}),(0,z.jsxs)(`div`,{className:`flex items-center gap-3 mt-1 text-xs text-fg-muted`,children:[(0,z.jsxs)(`span`,{children:[e.message_count,` msgs`]}),e.tags.slice(0,3).map(e=>(0,z.jsxs)(`span`,{className:`text-role-tool`,children:[`#`,e]},e))]})]})}function Qs({size:e=16}){return(0,z.jsxs)(`svg`,{"aria-hidden":`true`,className:`${e===24?`h-6 w-6`:`h-4 w-4`} animate-spin`,viewBox:`0 0 24 24`,fill:`none`,children:[(0,z.jsx)(`circle`,{cx:`12`,cy:`12`,r:`10`,stroke:`currentColor`,strokeOpacity:`0.25`,strokeWidth:`3`}),(0,z.jsx)(`path`,{d:`M12 2a10 10 0 0 1 10 10`,stroke:`currentColor`,strokeWidth:`3`,strokeLinecap:`round`})]})}var $s=150;function ec({label:e,hint:t,onClick:n}){return(0,z.jsxs)(`button`,{type:`button`,onClick:n,className:`block w-full text-left px-3 py-1.5 text-xs hover:bg-bg-hover transition-colors`,children:[(0,z.jsx)(`div`,{className:`text-fg`,children:e}),t&&(0,z.jsx)(`div`,{className:`text-fg-muted text-[10px] mt-0.5 font-mono truncate`,children:t})]})}function tc({sessionId:e,currentAlias:t,aliasSource:n,autoTitle:r,autoTitleSource:i}){let[a,o]=(0,R.useState)(!1),[s,c]=(0,R.useState)(``),l=Ds(),u=Os(),d=(0,R.useRef)(null);(0,R.useEffect)(()=>{a&&(c(t??``),requestAnimationFrame(()=>d.current?.select()))},[a,t]);let f=async()=>{let n=s.trim();try{n?n!==t&&await l.mutateAsync({sessionId:e,alias:n}):t&&await u.mutateAsync(e)}catch(e){console.error(`alias save failed`,e)}finally{o(!1)}};if(a)return(0,z.jsx)(`input`,{ref:d,type:`text`,value:s,onChange:e=>c(e.target.value),onBlur:f,onKeyDown:e=>{e.key===`Enter`?(e.preventDefault(),f()):e.key===`Escape`&&(e.preventDefault(),o(!1))},placeholder:`give this session a name…`,className:`bg-bg-elevated border border-accent rounded px-2 py-0.5 text-sm text-fg normal-case tracking-normal min-w-[14rem] focus:outline-none`,maxLength:80});let p=n===`auto`,m=r&&i===`agent`?r:t&&n===`manual`?t:r||(t??null),h=m===r&&i===`agent`&&!!r,g=m??`Click to name this session`,_=(()=>{if(m===r&&r){let e=i??`heuristic`;return t?`${e} title · overriding ${p?`auto-alias`:`manual alias`} "${t}" — click to set a custom alias`:`auto-generated title (${e}) — click to override with a custom alias`}return t?`click to rename this session`:`give this session a custom name — click to edit`})();return(0,z.jsxs)(`button`,{type:`button`,onClick:()=>o(!0),className:`group flex items-center gap-1.5 normal-case tracking-normal text-left min-w-0 px-2 py-0.5 rounded border border-dashed hover:border-accent transition-colors `+(m?`text-fg font-semibold border-transparent hover:bg-bg-hover`:`text-fg-muted italic border-line hover:text-fg hover:bg-bg-hover`),title:_,children:[h&&(0,z.jsx)(`span`,{className:`text-accent text-xs shrink-0`,"aria-hidden":`true`,children:`✨`}),(0,z.jsx)(`span`,{className:`truncate`,children:g}),(0,z.jsx)(`span`,{className:`text-xs shrink-0 `+(m?`text-fg-muted opacity-0 group-hover:opacity-100 transition-opacity`:`text-accent`),children:`✎`})]})}function nc({sessionId:e,currentSource:t}){let n=B(),r=ks(),i=As(),[a,o]=(0,R.useState)(!1),s=(0,R.useRef)(null),c=(0,R.useRef)(null),[l,u]=(0,R.useState)(null),d=at({mutationFn:()=>W.generateAutoTitle(e),onSuccess:t=>{n.invalidateQueries({queryKey:[`session`,e]}),n.invalidateQueries({queryKey:[`sessions`]}),G({message:t?.auto_title?`Generated title: "${t.auto_title}"`:`Title generated`,tone:`success`,duration:4e3})},onError:e=>{let t=e?.message??`unknown error`;G({message:/403/.test(t)?`Agent titles disabled — click ✨ to enable`:`Title generation failed: ${t}`,tone:`error`,duration:6e3})}}),f=(0,R.useCallback)(()=>{let e=s.current;if(!e)return;let t=e.getBoundingClientRect();u({top:t.bottom+4,right:Math.max(8,window.innerWidth-t.right)})},[]);if((0,R.useLayoutEffect)(()=>{if(!a){u(null);return}f()},[a,f]),(0,R.useEffect)(()=>{if(!a)return;let e=()=>f(),t=()=>f(),n=e=>{let t=e.target;c.current&&!c.current.contains(t)&&s.current&&!s.current.contains(t)&&o(!1)},r=e=>{e.key===`Escape`&&o(!1)};return window.addEventListener(`resize`,e),window.addEventListener(`scroll`,t,!0),window.addEventListener(`mousedown`,n),window.addEventListener(`keydown`,r),()=>{window.removeEventListener(`resize`,e),window.removeEventListener(`scroll`,t,!0),window.removeEventListener(`mousedown`,n),window.removeEventListener(`keydown`,r)}},[a,f]),t===`agent`&&!d.isError)return null;let p=r.data?.agentEnabled??!1,m=d.isError&&/403/.test(d.error?.message??``),h=()=>{if(!p){o(e=>!e);return}d.mutate()},g=async()=>{try{await i.mutateAsync({agentEnabled:!0}),o(!1),d.mutate()}catch{}},_=d.isPending||i.isPending;return(0,z.jsxs)(`div`,{className:`relative shrink-0`,children:[(0,z.jsx)(`button`,{ref:s,type:`button`,onClick:h,disabled:_||r.isLoading,className:`flex items-center gap-1 text-xs bg-accent/10 text-accent hover:bg-accent hover:text-bg border border-accent/40 rounded px-2 py-1 font-medium disabled:opacity-60 disabled:cursor-not-allowed normal-case tracking-normal`,title:p?`Generate a descriptive title with claude -p (uses your Claude Code subscription)`:`Enable agent-generated titles (requires confirmation) and generate one now`,children:_?(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(Qs,{size:16}),(0,z.jsx)(`span`,{className:`hidden md:inline`,children:`generating…`})]}):(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(`span`,{"aria-hidden":`true`,children:`✨`}),(0,z.jsx)(`span`,{className:`hidden md:inline`,children:`Generate title`})]})}),a&&l&&(0,so.createPortal)((0,z.jsxs)(`div`,{ref:c,className:`fixed w-72 bg-bg-elevated border border-line rounded shadow-xl p-3 z-50 normal-case tracking-normal`,style:{top:l.top,right:l.right},role:`dialog`,"aria-label":`Enable agent-generated titles`,children:[(0,z.jsx)(`p`,{className:`text-xs text-fg mb-2 font-medium`,children:`Enable agent-generated titles?`}),(0,z.jsxs)(`p`,{className:`text-[11px] text-fg-dim leading-snug mb-3`,children:[`This shells out to your local `,(0,z.jsx)(`code`,{className:`text-fg`,children:`claude`}),` `,`CLI and uses your Claude Code subscription to summarise the first 20 user messages. Runs only when you click ✨. You can flip it off later via the`,` `,(0,z.jsx)(`code`,{className:`text-fg`,children:`autoTitle.agentEnabled`}),` key in`,` `,(0,z.jsx)(`code`,{className:`text-fg`,children:`$RECALL_HOME/config.json`}),`.`]}),(0,z.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,z.jsx)(`button`,{type:`button`,onClick:()=>o(!1),disabled:_,className:`text-[11px] text-fg-dim hover:text-fg px-2 py-1 rounded disabled:opacity-60`,children:`Cancel`}),(0,z.jsx)(`button`,{type:`button`,onClick:g,disabled:_,className:`text-[11px] bg-accent text-bg hover:bg-accent/90 px-2 py-1 rounded font-medium disabled:opacity-60`,children:i.isPending?`Enabling…`:`Enable and generate`})]}),i.isError&&(0,z.jsxs)(`p`,{className:`mt-2 text-[10px] text-role-user`,role:`alert`,children:[`Failed to enable: `,i.error.message]})]}),document.body),d.isError&&!a&&(0,z.jsx)(`div`,{className:`absolute top-full right-0 mt-1 text-[10px] text-role-user bg-bg-elevated border border-role-user/40 rounded px-2 py-1 shadow-lg z-20 whitespace-nowrap`,role:`alert`,children:m?`Agent titles disabled — click ✨ to enable`:`title generation failed`})]})}function rc(e,t){if(!e.content_text||t.length===0)return!1;let n=e.content_text.toLowerCase();return t.every(e=>n.includes(e))}function ic(e){return e.toLowerCase().split(/\s+/).filter(e=>e.length>1)}function ac(e){return e.replace(/[&<>"']/g,e=>({"&":`&`,"<":`<`,">":`>`,'"':`"`,"'":`'`})[e])}function oc(e){if(!e)return!1;let t=e.slice(0,64);return t.startsWith(`**Tool result**`)||t.startsWith(`_(tool result was empty`)}var sc=`recall:collapseToolCalls`,cc=`recall:collapseToolResults`;function lc(e){try{return localStorage.getItem(e)===`1`}catch{return!1}}function uc(e,t){try{localStorage.setItem(e,t?`1`:`0`)}catch{}}function dc({sessionId:e,targetMessageUuid:t,onTargetChange:n,searchQuery:r,isCompareLeft:i=!1,isCompareRight:a=!1,onExitCompare:o}){let[s,c]=(0,R.useState)(!1),[l,u]=(0,R.useState)(!1),[d,f]=(0,R.useState)(0),[p,m]=(0,R.useState)(!1),[h,g]=(0,R.useState)(!1),[_,v]=(0,R.useState)(!0),[y,b]=(0,R.useState)(!1),[,x]=Pt(),[S,C]=(0,R.useState)(()=>lc(sc)),[w,T]=(0,R.useState)(()=>lc(cc));(0,R.useEffect)(()=>{uc(sc,S)},[S]),(0,R.useEffect)(()=>{uc(cc,w)},[w]);let E=Rt(e),D=Wt(),O=(0,R.useRef)(null),k=(0,R.useRef)(new Map),A=(0,R.useRef)(null),{isPinned:ee,togglePin:j}=Fn();(0,R.useEffect)(()=>{if(!p)return;let e=e=>{A.current&&!A.current.contains(e.target)&&m(!1)},t=e=>{e.key===`Escape`&&m(!1)};return window.addEventListener(`mousedown`,e),window.addEventListener(`keydown`,t),()=>{window.removeEventListener(`mousedown`,e),window.removeEventListener(`keydown`,t)}},[p]);let te=V({queryKey:[`session`,e],queryFn:()=>W.session(e),enabled:!!e,refetchInterval:3e3,staleTime:0});(0,R.useEffect)(()=>{u(!1),O.current&&(O.current.scrollTop=0),k.current.clear()},[e]);let M=(0,R.useMemo)(()=>te.data?te.data.messages.filter(e=>{if(!s&&e.is_sidechain===1)return!1;let t=!!(e.content_text&&e.content_text.trim()),n=!!(e.tool_names&&e.tool_names.length>0);return!(!t&&!n)}):[],[te.data,s]),ne=(0,R.useMemo)(()=>ic(r),[r]),N=(0,R.useMemo)(()=>{if(ne.length===0)return[];let e=[];for(let t of M)rc(t,ne)&&e.push(t.uuid);return e},[M,ne]),P=(0,R.useMemo)(()=>l?M:M.slice(0,$s),[M,l]),re=Do({count:P.length,getScrollElement:()=>O.current,estimateSize:()=>220,overscan:6,getItemKey:e=>P[e]?.uuid??e});(0,R.useEffect)(()=>{t&&M.findIndex(e=>e.uuid===t)>=$s&&u(!0)},[t,M]),(0,R.useEffect)(()=>{if(!t)return;let e=P.findIndex(e=>e.uuid===t);if(e<0)return;let n=requestAnimationFrame(()=>{re.scrollToIndex(e,{align:`center`,behavior:`smooth`}),f(e=>e+1)});return()=>cancelAnimationFrame(n)},[t,P,re,l]),(0,R.useEffect)(()=>{let e=O.current;if(!e)return;let t=()=>{v(e.scrollHeight-(e.scrollTop+e.clientHeight)<120)};return t(),e.addEventListener(`scroll`,t,{passive:!0}),()=>e.removeEventListener(`scroll`,t)},[e,P.length]);let F=(0,R.useCallback)(()=>{P.length!==0&&(!l&&M.length>P.length&&u(!0),re.scrollToIndex(P.length-1,{align:`end`,behavior:`smooth`}))},[P.length,re,l,M.length]),ie=(0,R.useCallback)(()=>{O.current&&O.current.scrollTo({top:0,behavior:`smooth`})},[]);(0,R.useEffect)(()=>{if(!e)return;let t=e=>{let t=e.target;t&&(t.tagName===`INPUT`||t.tagName===`TEXTAREA`||t.isContentEditable)||(e.key===`End`?(e.preventDefault(),F()):e.key===`Home`&&(e.preventDefault(),ie()))};return window.addEventListener(`keydown`,t),()=>window.removeEventListener(`keydown`,t)},[e,F,ie]);let I=t&&N.includes(t)?N.indexOf(t):-1,ae=(0,R.useCallback)(e=>{N.length!==0&&n(N[((I===-1?e===1?-1:0:I)+e+N.length)%N.length])},[I,N,n]);if((0,R.useEffect)(()=>{if(N.length===0)return;let e=e=>{let t=e.target;t&&(t.tagName===`INPUT`||t.tagName===`TEXTAREA`||t.isContentEditable)||(e.key===`n`?(e.preventDefault(),ae(e.shiftKey?-1:1)):e.key===`p`&&(e.preventDefault(),ae(-1)))};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[ae,N.length]),!e)return(0,z.jsx)(`section`,{className:`pane flex-1 border-r-0`,children:(0,z.jsx)(`div`,{className:`flex-1 flex items-center justify-center text-center px-8`,children:(0,z.jsxs)(`div`,{className:`max-w-sm`,children:[(0,z.jsx)(`div`,{className:`text-fg-muted text-sm mb-2`,children:`No session selected`}),(0,z.jsx)(`div`,{className:`text-fg-muted text-xs`,children:`Pick a project on the left, then a session from the middle. Or type in the search box above — your data never leaves this machine.`})]})})});if(te.isLoading)return(0,z.jsx)(`section`,{className:`pane flex-1 border-r-0`,children:(0,z.jsx)(`div`,{className:`flex-1 flex items-center justify-center text-fg-muted text-sm`,children:`Loading session…`})});if(te.isError)return(0,z.jsx)(`section`,{className:`pane flex-1 border-r-0`,children:(0,z.jsxs)(`div`,{className:`flex-1 flex items-center justify-center text-role-user text-sm`,children:[`Failed: `,te.error.message]})});let{session:L,messages:oe}=te.data,se=ee(L.id),ce=()=>{let e=[];e.push(`# Claude Code session · ${L.project_name}`),e.push(``),e.push(`- session id: \`${L.id}\``),L.started_at&&e.push(`- started: ${L.started_at}`),L.git_branch&&e.push(`- branch: \`${L.git_branch}\``),e.push(`- messages: ${oe.length}`),e.push(``),e.push(`---`),e.push(``);for(let t of M){let n=t.role??t.type,r=t.timestamp?` \`${t.timestamp}\``:``;e.push(`## ${n}${r}`),t.tool_names&&e.push(`\n_tools: ${t.tool_names}_\n`),t.content_text&&e.push(t.content_text),e.push(``)}navigator.clipboard.writeText(e.join(`
|
|
89
|
-
`))},le=()=>{let e=`${`<!doctype html><html><head><meta charset="utf-8"><title>${ac(L.project_name)} · ${L.id}</title>
|
|
90
|
-
<link rel="preconnect" href="https://fonts.googleapis.com">
|
|
91
|
-
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
|
92
|
-
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap">
|
|
93
|
-
<style>
|
|
94
|
-
:root { color-scheme: dark; }
|
|
95
|
-
body {
|
|
96
|
-
font-family: Inter, -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;
|
|
97
|
-
font-size: 15px; line-height: 1.6;
|
|
98
|
-
max-width: 900px; margin: 2em auto; padding: 0 1.5em;
|
|
99
|
-
color: #e7e9ee; background: #0b0c0f;
|
|
100
|
-
font-feature-settings: 'cv11', 'ss01', 'ss03';
|
|
101
|
-
}
|
|
102
|
-
h1 { margin: 0 0 0.3em; font-size: 1.5em; color: #e7e9ee; font-weight: 700; letter-spacing: -0.01em; }
|
|
103
|
-
.meta { color: #8b9098; font-size: 0.85em; margin-bottom: 2em; line-height: 1.8; padding-bottom: 1em; border-bottom: 1px solid #22252d; }
|
|
104
|
-
.meta code { background: #15171c; border: 1px solid #22252d; padding: 0.12em 0.42em; border-radius: 4px; }
|
|
105
|
-
article { border-left: 3px solid #22252d; padding: 0.6em 0 0.6em 1.1em; margin: 0.85em 0; page-break-inside: avoid; }
|
|
106
|
-
article.user { border-left-color: #3b82f6; }
|
|
107
|
-
article.assistant { border-left-color: #10b981; }
|
|
108
|
-
article.system, article.attachment, article.progress { border-left-color: #6b6f78; color: #8b9098; }
|
|
109
|
-
.role { text-transform: uppercase; font-size: 0.7em; letter-spacing: 0.08em; font-weight: 700; color: #8b9098; margin-bottom: 0.4em; font-family: "JetBrains Mono", "SF Mono", Menlo, Monaco, Consolas, monospace; }
|
|
110
|
-
article.user .role { color: #3b82f6; }
|
|
111
|
-
article.assistant .role { color: #10b981; }
|
|
112
|
-
pre {
|
|
113
|
-
background: #15171c; border: 1px solid #22252d; border-radius: 8px;
|
|
114
|
-
padding: 0.75em 1em; overflow-x: auto;
|
|
115
|
-
font-family: "JetBrains Mono", "SF Mono", Menlo, Monaco, Consolas, monospace;
|
|
116
|
-
font-size: 0.85em; line-height: 1.5;
|
|
117
|
-
white-space: pre-wrap; word-break: break-word; color: #e7e9ee;
|
|
118
|
-
}
|
|
119
|
-
code { font-family: "JetBrains Mono", "SF Mono", Menlo, Monaco, Consolas, monospace; }
|
|
120
|
-
.tools { color: #a855f7; font-size: 0.8em; margin-bottom: 0.5em; font-weight: 500; }
|
|
121
|
-
::selection { background: rgba(249, 115, 22, 0.3); color: #fff; }
|
|
122
|
-
</style></head><body>`}${`<h1>${ac(L.project_name)}</h1>
|
|
123
|
-
<div class="meta">
|
|
124
|
-
session <code>${ac(L.id)}</code><br>
|
|
125
|
-
${L.started_at?`started ${ac(L.started_at)}<br>`:``}
|
|
126
|
-
${L.git_branch?`branch <code>${ac(L.git_branch)}</code><br>`:``}
|
|
127
|
-
${M.length} messages
|
|
128
|
-
</div>`}${M.map(e=>{let t=e.role??e.type??`system`;return`<article class="${ac(t)}">
|
|
129
|
-
<div class="role">${ac(t)}${e.timestamp?` · ${ac(e.timestamp)}`:``}</div>
|
|
130
|
-
${e.tool_names?`<div class="tools">⚡ ${ac(e.tool_names)}</div>`:``}
|
|
131
|
-
<pre>${ac(e.content_text??``)}</pre>
|
|
132
|
-
</article>`}).join(`
|
|
133
|
-
`)}</body></html>`,t=new Blob([e],{type:`text/html;charset=utf-8`}),n=URL.createObjectURL(t),r=document.createElement(`a`);r.href=n,r.download=`claude-recall-${L.project_name.replace(/[^a-z0-9-]+/gi,`-`)}-${L.id.slice(0,8)}.html`,document.body.appendChild(r),r.click(),r.remove(),setTimeout(()=>URL.revokeObjectURL(n),1e3)},ue=ne.length>0&&N.length>0;return(0,z.jsxs)(`section`,{className:`pane flex-1 border-r-0 min-w-0`,children:[(0,z.jsxs)(`div`,{className:`px-4 py-3 border-b border-line text-xs uppercase tracking-wider text-fg-dim flex flex-col gap-2`,children:[(0,z.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,z.jsxs)(`div`,{className:`flex items-center gap-3 min-w-0 flex-1 truncate`,children:[(0,z.jsx)(`button`,{type:`button`,onClick:()=>j(L.id),className:`text-lg leading-none normal-case tracking-normal shrink-0 `+(se?`text-accent`:`text-fg-muted hover:text-fg`),title:se?`unpin this session`:`pin this session`,children:se?`★`:`☆`}),(0,z.jsx)(tc,{sessionId:L.id,currentAlias:L.alias,aliasSource:L.alias_source??null,autoTitle:L.auto_title,autoTitleSource:L.auto_title_source}),(0,z.jsx)(nc,{sessionId:L.id,currentSource:L.auto_title_source}),(0,z.jsx)(`span`,{className:`font-mono text-accent shrink-0`,children:st(L.id)}),(0,z.jsx)(`span`,{className:`text-fg font-medium normal-case tracking-normal truncate min-w-0`,title:L.project_name,children:L.project_name})]}),(0,z.jsxs)(`div`,{className:`flex items-center gap-3 normal-case tracking-normal shrink-0`,children:[(0,z.jsxs)(`label`,{className:`flex items-center gap-1.5 text-fg-dim text-xs cursor-pointer`,title:`subagents = Claude's internal Task-tool invocations. Claude sometimes dispatches sub-agents to do focused research; they generate extra messages in the transcript that are usually noise. Off by default.`,children:[(0,z.jsx)(`input`,{type:`checkbox`,checked:s,onChange:e=>c(e.target.checked),className:`accent-accent`}),(0,z.jsx)(`span`,{className:`hidden lg:inline`,children:`subagents`})]}),(0,z.jsxs)(`button`,{type:`button`,onClick:()=>C(e=>!e),className:`text-xs px-2 py-1 border rounded font-medium transition-colors `+(S?`bg-accent/15 text-accent border-accent/50`:`text-fg-dim hover:text-fg border-line hover:border-accent/40`),title:`auto-collapse assistant tool calls — keeps the transcript scannable; click any individual call to expand it`,"aria-pressed":S,children:[(0,z.jsx)(`span`,{"aria-hidden":`true`,children:`⚡`}),(0,z.jsx)(`span`,{className:`hidden lg:inline ml-1`,children:`tool calls`})]}),(0,z.jsxs)(`button`,{type:`button`,onClick:()=>T(e=>!e),className:`text-xs px-2 py-1 border rounded font-medium transition-colors `+(w?`bg-accent/15 text-accent border-accent/50`:`text-fg-dim hover:text-fg border-line hover:border-accent/40`),title:`auto-collapse tool results — hides large user-side tool outputs; click any individual result to expand it`,"aria-pressed":w,children:[(0,z.jsx)(`span`,{"aria-hidden":`true`,children:`📥`}),(0,z.jsx)(`span`,{className:`hidden lg:inline ml-1`,children:`tool results`})]}),(0,z.jsxs)(`button`,{type:`button`,onClick:async()=>{try{let e=await(await fetch(`/api/sessions/${encodeURIComponent(L.id)}/context?mode=condensed`)).text();await navigator.clipboard.writeText(e);let t=document.getElementById(`recall-copy-flash`);t&&(t.textContent=`Copied ${e.length.toLocaleString()} chars — paste into new Claude session`,t.classList.remove(`opacity-0`),setTimeout(()=>t.classList.add(`opacity-0`),2200))}catch(e){console.error(`copy as context failed`,e)}},className:`text-xs bg-accent/10 text-accent hover:bg-accent hover:text-bg border border-accent/40 rounded px-2 py-1 font-medium`,title:`copy condensed markdown context — paste into a new Claude Code conversation`,children:[`📋 `,(0,z.jsx)(`span`,{className:`hidden md:inline`,children:`copy as context`})]}),(0,z.jsxs)(`div`,{ref:A,className:`relative`,children:[(0,z.jsx)(`button`,{type:`button`,onClick:()=>m(e=>!e),className:`text-xs text-fg-dim hover:text-fg border border-line rounded px-2 py-1`,title:`more session actions`,"aria-expanded":p,children:`⋯`}),p&&(0,z.jsxs)(`div`,{className:`absolute right-0 top-full mt-1 w-56 bg-bg-elevated border border-line rounded-lg shadow-lg py-1 z-20`,children:[(0,z.jsx)(ec,{label:`Copy full markdown`,hint:`uncondensed transcript`,onClick:()=>{m(!1),ce()}}),(0,z.jsx)(ec,{label:`Export as HTML`,hint:`self-contained, dark mode`,onClick:()=>{m(!1),le()}}),(0,z.jsx)(ec,{label:`Print`,hint:`opens print dialog`,onClick:()=>{m(!1),window.print()}}),(0,z.jsx)(`div`,{className:`border-t border-line my-1`}),!a&&(0,z.jsx)(ec,{label:`⇄ Compare with another session`,hint:`side-by-side diff view`,onClick:()=>{m(!1),g(!0)}}),(0,z.jsx)(ec,{label:`📂 Add to collection…`,hint:`group this session into a curated list`,onClick:()=>{m(!1),b(!0)}}),(0,z.jsx)(ec,{label:`Copy session ID`,hint:L.id.slice(0,16)+`…`,onClick:()=>{m(!1),L.id&&navigator.clipboard.writeText(L.id)}})]})]}),a&&o&&(0,z.jsxs)(`button`,{type:`button`,onClick:o,className:`flex-shrink-0 text-xs text-fg-dim hover:text-fg hover:bg-bg-elevated border border-line rounded px-2 py-1 focus:outline-none focus:ring-2 focus:ring-accent/60`,title:`exit compare view — or press Esc, or use the banner above`,"aria-label":`Exit compare view`,children:[`✕ `,(0,z.jsx)(`span`,{className:`hidden md:inline`,children:`close`})]})]})]}),(0,z.jsxs)(`div`,{className:`flex items-center gap-x-3 gap-y-1 normal-case tracking-normal flex-wrap text-fg-muted`,children:[(0,z.jsxs)(`span`,{children:[ut(oe.length),` msgs · `,lt(L.ended_at??L.started_at),L.ended_at&&L.started_at&&L.ended_at!==L.started_at&&(0,z.jsxs)(`span`,{className:`text-fg-muted`,title:`started ${L.started_at}\nlast activity ${L.ended_at}`,children:[` `,`(started `,lt(L.started_at),`)`]})]}),L.git_branch&&(0,z.jsxs)(`span`,{className:`font-mono`,title:`branch: ${L.git_branch}`,children:[`⎇ `,L.git_branch]}),(0,z.jsx)(`span`,{className:`ml-auto shrink-0`,children:(0,z.jsx)(Fs,{sessionId:L.id})})]}),(0,z.jsxs)(`div`,{className:`flex items-center gap-2 normal-case tracking-normal flex-wrap`,children:[(0,z.jsx)(Ns,{sessionId:L.id,tags:L.tags??[]}),(0,z.jsx)(`div`,{className:`ml-auto shrink-0`,children:(0,z.jsx)(Ps,{sessionId:L.id})})]})]}),h&&(0,z.jsx)(Xs,{excludeSessionId:L.id,onPick:e=>{g(!1),x({compareWith:e})},onClose:()=>g(!1)}),(0,z.jsx)(js,{sessionId:L.id}),(0,z.jsx)(Is,{sessionId:L.id}),(0,z.jsx)(qs,{sessionId:L.id}),(0,z.jsx)(`div`,{className:`px-5`,children:(0,z.jsx)(Ys,{sessionId:L.id})}),E.data&&E.data.collections.length>0&&(0,z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5 px-5 py-2 border-b border-line bg-bg/60 normal-case tracking-normal`,children:[(0,z.jsx)(`span`,{className:`text-[10px] uppercase tracking-wider text-fg-muted mr-1`,children:`in collections`}),E.data.collections.map(e=>(0,z.jsxs)(`span`,{className:`inline-flex items-center gap-1 px-2 py-0.5 rounded-full bg-accent/10 text-accent text-xs border border-accent/30`,style:{borderColor:e.color?`${e.color}66`:void 0},children:[(0,z.jsxs)(`button`,{type:`button`,onClick:()=>x({col:e.id,session:null,msg:null}),className:`hover:underline`,title:`filter sessions in "${e.name}"`,children:[e.icon??`📂`,` `,e.name]}),(0,z.jsx)(`button`,{type:`button`,onClick:async()=>{try{await D.mutateAsync({collectionId:e.id,sessionId:L.id})}catch(e){console.error(`remove from collection failed`,e)}},className:`text-fg-muted hover:text-role-user text-[10px]`,title:`remove from "${e.name}"`,"aria-label":`remove from ${e.name}`,children:`✕`})]},e.id)),(0,z.jsx)(`button`,{type:`button`,onClick:()=>b(!0),className:`inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-xs text-fg-muted hover:text-fg border border-dashed border-line hover:border-accent`,title:`add to another collection`,children:`+ add`})]}),E.data&&E.data.collections.length===0&&!a&&(0,z.jsx)(`div`,{className:`flex items-center gap-2 px-5 py-1 text-[10px] text-fg-muted border-b border-line bg-bg/40 normal-case tracking-normal`,children:(0,z.jsx)(`button`,{type:`button`,onClick:()=>b(!0),className:`hover:text-fg`,title:`group this session into a curated collection`,children:`+ add to collection`})}),y&&(0,z.jsx)(or,{sessionId:L.id,onClose:()=>b(!1),anchor:`center`}),ue&&(0,z.jsxs)(`div`,{className:`flex items-center justify-between px-5 py-2 border-b border-line bg-bg/70 text-xs`,children:[(0,z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,z.jsxs)(`span`,{className:`text-fg-dim`,children:[`Matches for `,(0,z.jsxs)(`span`,{className:`font-mono text-fg`,children:[`"`,r,`"`]}),`:`]}),(0,z.jsxs)(`span`,{className:`font-medium`,children:[I===-1?0:I+1,` / `,N.length]}),(0,z.jsxs)(`span`,{className:`text-fg-muted`,children:[`(`,N.length,` in this session)`]})]}),(0,z.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,z.jsx)(`button`,{type:`button`,onClick:()=>ae(-1),className:`px-2 py-1 border border-line rounded hover:text-fg text-fg-dim`,title:`previous match (p)`,children:`↑ prev`}),(0,z.jsx)(`button`,{type:`button`,onClick:()=>ae(1),className:`px-2 py-1 border border-line rounded hover:text-fg text-fg-dim`,title:`next match (n)`,children:`next ↓`})]})]}),(0,z.jsx)(`div`,{id:`recall-copy-flash`,className:`absolute top-20 left-1/2 -translate-x-1/2 z-10 bg-accent text-bg text-xs font-medium px-3 py-1.5 rounded-full shadow-lg opacity-0 transition-opacity pointer-events-none`}),!_&&P.length>0&&(0,z.jsxs)(`button`,{type:`button`,onClick:F,className:`absolute bottom-6 right-8 z-10 bg-accent text-bg text-xs font-medium px-3.5 py-2 rounded-full shadow-lg hover:bg-accent/90 flex items-center gap-1.5 transition-transform hover:scale-105`,title:`jump to latest message (End key)`,children:[(0,z.jsx)(`span`,{children:`↓ latest`}),(0,z.jsx)(`kbd`,{className:`text-[10px] bg-bg/20 rounded px-1 py-0.5 font-mono`,children:`End`})]}),(0,z.jsxs)(`div`,{ref:O,className:`flex-1 overflow-y-auto px-5`,children:[(0,z.jsx)(`div`,{style:{height:`${re.getTotalSize()}px`,position:`relative`,width:`100%`},children:re.getVirtualItems().map(e=>{let n=P[e.index];if(!n)return null;let i=ne.length>0&&N.includes(n.uuid),a=n.uuid===t;return(0,z.jsx)(`div`,{"data-index":e.index,ref:e=>{e?(re.measureElement(e),k.current.set(n.uuid,e)):k.current.delete(n.uuid)},style:{position:`absolute`,top:0,left:0,width:`100%`,transform:`translateY(${e.start}px)`},children:(0,z.jsx)(Es,{message:n,sessionId:L.id,searchQuery:r,isMatch:i,isActiveMatch:a,activationTick:a?d:void 0,collapseDefault:n.role===`assistant`&&!!n.tool_names&&S||n.role===`user`&&oc(n.content_text)&&w})},n.uuid)})}),!l&&M.length>$s&&(0,z.jsxs)(`div`,{className:`py-6 text-center`,children:[(0,z.jsxs)(`button`,{type:`button`,onClick:()=>u(!0),className:`text-sm text-accent hover:underline`,children:[`Load remaining `,ut(M.length-$s),` messages`]}),(0,z.jsx)(`div`,{className:`text-xs text-fg-muted mt-1`,children:`(rendering large sessions may take a moment)`})]})]})]})}var fc=`data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAzMjAgODAiIHdpZHRoPSIzMjAiIGhlaWdodD0iODAiIHJvbGU9ImltZyIgYXJpYS1sYWJlbD0iQ2xhdWRlIFJlY2FsbCI+CiAgPHRpdGxlPkNsYXVkZSBSZWNhbGwg4oCUIGhvcml6b250YWwgd29yZG1hcmsgKGRhcmsgYmcpPC90aXRsZT4KICA8cmVjdCB3aWR0aD0iMzIwIiBoZWlnaHQ9IjgwIiBmaWxsPSIjMGIwYzBmIi8+CiAgPGcgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoOCwgOCkiPgogICAgPGcgc3Ryb2tlPSIjZTdlOWVlIiBzdHJva2Utd2lkdGg9IjMiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgZmlsbD0ibm9uZSI+CiAgICAgIDxsaW5lIHgxPSIxNCIgeTE9IjE2IiB4Mj0iNDYiIHkyPSIxNiIvPgogICAgICA8bGluZSB4MT0iMTQiIHkxPSIyNCIgeDI9IjM4IiB5Mj0iMjQiLz4KICAgIDwvZz4KICAgIDxsaW5lIHgxPSIxMCIgeTE9IjMyIiB4Mj0iNTQiIHkyPSIzMiIgc3Ryb2tlPSIjZjk3MzE2IiBzdHJva2Utd2lkdGg9IjUiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIvPgogICAgPGcgc3Ryb2tlPSIjZTdlOWVlIiBzdHJva2Utd2lkdGg9IjMiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgZmlsbD0ibm9uZSI+CiAgICAgIDxsaW5lIHgxPSIxNCIgeTE9IjQwIiB4Mj0iNDIiIHkyPSI0MCIvPgogICAgICA8bGluZSB4MT0iMTQiIHkxPSI0OCIgeDI9IjM2IiB5Mj0iNDgiLz4KICAgIDwvZz4KICA8L2c+CiAgPHRleHQgeD0iOTAiIHk9IjUyIiBmb250LWZhbWlseT0iSW50ZXIsICdIZWx2ZXRpY2EgTmV1ZScsIHN5c3RlbS11aSwgLWFwcGxlLXN5c3RlbSwgQXJpYWwsIHNhbnMtc2VyaWYiIGZvbnQtd2VpZ2h0PSI4MDAiIGZvbnQtc2l6ZT0iMzIiIGZpbGw9IiNlN2U5ZWUiIGxldHRlci1zcGFjaW5nPSItMC44Ij5DbGF1ZGUgPHRzcGFuIGZpbGw9IiNmOTczMTYiPlJlY2FsbDwvdHNwYW4+PC90ZXh0Pgo8L3N2Zz4K`,pc=[{id:`taxonomy`,title:`How things are organized`,emoji:`🗺️`,md:`# How things are organized
|
|
134
|
-
|
|
135
|
-
Seven concepts underpin every view in Claude Recall. Knowing which to reach for is the difference between a tidy library and a pile.
|
|
136
|
-
|
|
137
|
-
## The map
|
|
138
|
-
|
|
139
|
-
See the diagram above. **Session** is the atom — one Claude Code conversation, identified by an immutable UUID. Every other concept attaches to it.
|
|
140
|
-
|
|
141
|
-
## One-liners
|
|
142
|
-
|
|
143
|
-
- **Session** - one conversation with Claude Code. Identified by an immutable UUID.
|
|
144
|
-
- **Project** - auto-derived from the session's \`cwd\` (working directory). Coarse; one per session.
|
|
145
|
-
- **Alias** - the human-readable nickname you give a session (e.g. \`auth-middleware-refactor\`). Replaces the UUID in the UI.
|
|
146
|
-
- **Tag** - a flat \`#keyword\` label. Many per session. Cross-project.
|
|
147
|
-
- **Collection** - a hand-picked, hierarchical bundle of sessions (tree, up to 8 levels deep). Many per session. Cross-project.
|
|
148
|
-
- **Thread** - a DAG of sessions connected by intent (a planning session plus the execution sessions it spawned). Many per session. Cross-project. Navigable as a node graph. See the Threads section for the full story.
|
|
149
|
-
- **Pin** - a local ★ that floats a session to the top of the list. Per-browser.
|
|
150
|
-
- **Note** - markdown you write about a session. One per session, with full edit history.
|
|
151
|
-
|
|
152
|
-
## Comparison matrix
|
|
153
|
-
|
|
154
|
-
| Concept | Auto or manual? | One or many per session? | Cross-project? | Hierarchical? |
|
|
155
|
-
|---|---|---|---|---|
|
|
156
|
-
| **Project** | auto (from \`cwd\`) | one | - | no |
|
|
157
|
-
| **Alias** | manual | one (prior values archived) | n/a | no |
|
|
158
|
-
| **Tag** | manual (or auto-scan) | many | yes | no (flat) |
|
|
159
|
-
| **Collection** | manual | many | yes | yes (tree, max 8 deep) |
|
|
160
|
-
| **Thread** | manual now; auto in v0.15b Pro | many | yes | yes (DAG, multiple origins allowed) |
|
|
161
|
-
| **Pin** | manual | one (boolean) | n/a | no |
|
|
162
|
-
| **Note** | manual | one (with history) | n/a | no |
|
|
163
|
-
|
|
164
|
-
## Which one when?
|
|
165
|
-
|
|
166
|
-
- **Tag** keywords that might repeat across sessions — \`#auth\`, \`#migration\`, \`#bug-fix\`.
|
|
167
|
-
- **Collection** the handful of sessions that mattered for a milestone — "v1.0 launch decisions", "Scraping — current state".
|
|
168
|
-
- **Alias** the one session you'll look for by memory — \`auth-middleware-refactor\`.
|
|
169
|
-
- **Pin** your canonical sessions so they sit at the top of their project.
|
|
170
|
-
- **Note** the 3-bullet takeaway you'll re-read in 3 months.
|
|
171
|
-
|
|
172
|
-
## Rules of thumb
|
|
173
|
-
|
|
174
|
-
- If two sessions share a concept and might show up in unrelated projects: **tag**.
|
|
175
|
-
- If you want a named, curated, nestable bundle you'll open directly: **collection**.
|
|
176
|
-
- If the answer is "this one particular session", name it with an **alias** and pin it.
|
|
177
|
-
- If the sessions are a **connected unit of work** (a planning session plus the execution sessions it spawned), use a **thread** (see the Threads section below).`},{id:`threads`,title:`Threads`,emoji:`🧵`,md:`# Threads
|
|
178
|
-
|
|
179
|
-
A **thread** is a DAG (directed acyclic graph) of sessions that make up one unit of intent. Unlike Projects (which group by *where* a session ran) or Collections (which group by *manual curation*), threads capture the *why* behind a cluster of sessions.
|
|
180
|
-
|
|
181
|
-
## When to reach for a thread
|
|
182
|
-
|
|
183
|
-
Classic shape: you open a "planning" session, write a ROADMAP.md, then spawn 3-8 child sessions to execute each phase. Every child is a continuation of the plan. Threads let you see all of them as one node graph, jump between them, and pipe the whole thread back into a new Claude Code run.
|
|
184
|
-
|
|
185
|
-
## Anatomy
|
|
186
|
-
|
|
187
|
-
- **Origin** - the seed session of the thread (the planning session, usually). A thread can have multiple origins.
|
|
188
|
-
- **Child** - any session that continues the work. Children have a parent session.
|
|
189
|
-
- **Edge** - the relationship (parent → child). Manual edges have confidence 1.0. Auto-detected edges (v0.15b Pro tier, coming) carry a confidence score and a source chip so you always know why the link exists.
|
|
190
|
-
|
|
191
|
-
Threads is a **DAG not a tree**: a session can belong to multiple threads, and a thread can have several origins. No single-parent restriction.
|
|
192
|
-
|
|
193
|
-
## Three ways to add a session to a thread
|
|
194
|
-
|
|
195
|
-
1. **From a session header** - open any session, find the \`🧵 Threads\` row above "in collections", click \`+ Add to thread\`. The picker shows every existing thread as a clickable chip. Click one to link, or type a name in "Or create new" to spin up a new thread with this session as the origin.
|
|
196
|
-
2. **From the Threads page** - click the 🧵 Threads button in the top bar, pick a thread on the left, click \`+ Add session\` in the top-right of "Sessions in this thread". A search picker drops down; filter by alias, project, or first message.
|
|
197
|
-
3. **From the CLI** - \`recall thread link <session-id> --thread <id-prefix>\`. Use \`--parent <other-session-id>\` to make it a child of a specific node.
|
|
198
|
-
|
|
199
|
-
## Three ways to navigate a thread
|
|
200
|
-
|
|
201
|
-
- **Node graph** - the main Threads page shows the DAG as an SVG graph. Origins pinned at top, children below, edges thicker for higher confidence. Drag a node onto another node to re-parent. Drop on empty canvas to promote back to origin. Every drag shows an undo toast.
|
|
202
|
-
- **Click a node** - opens that session in the transcript pane.
|
|
203
|
-
- **CLI tree** - \`recall thread show <id-prefix>\` prints an ASCII tree.
|
|
204
|
-
|
|
205
|
-
## Removing a session from a thread
|
|
206
|
-
|
|
207
|
-
- **Right-click a node** in the graph → **Remove from thread**. Confirm the prompt and the edge is unlinked.
|
|
208
|
-
- On a narrow viewport (the flat-list fallback), hover a row and click the **remove** affordance on the right edge.
|
|
209
|
-
- The session itself stays in Recall — only the link to this thread is dropped. If the removed session had children, they're re-parented (to the grandparent if it had one, otherwise promoted to origin).
|
|
210
|
-
|
|
211
|
-
## Piping a whole thread back into Claude Code
|
|
212
|
-
|
|
213
|
-
The killer move. Once you have a thread with the origin plus N children:
|
|
214
|
-
|
|
215
|
-
\`\`\`bash
|
|
216
|
-
recall context thread:<id-prefix> | claude
|
|
217
|
-
\`\`\`
|
|
218
|
-
|
|
219
|
-
Concatenates every session in the thread (origin first, then children in add order), separated by \`---\`. New Claude Code session starts with the entire thread's context pre-injected.
|
|
220
|
-
|
|
221
|
-
## Auto-detection (v0.15b, coming)
|
|
222
|
-
|
|
223
|
-
In a future Pro-tier release, threads will self-assemble from signals already sitting in the codebase: plan-file references, UUID cross-references in transcripts, git branch overlap, semantic keyword similarity. Auto-linked edges carry a confidence score and an AI chip so manual edges stay distinguishable. Every auto-link is always undoable.
|
|
224
|
-
|
|
225
|
-
## Cycle protection
|
|
226
|
-
|
|
227
|
-
Threads are acyclic by construction. The daemon rejects any \`setParent\` call that would create a cycle (self-parent, A↔B, or longer chains). If you see a cycle rejection in the UI, it means your re-parent would have made the graph circular.`},{id:`quickstart`,title:`Quickstart`,emoji:`⚡`,md:`# Stop re-explaining your project to Claude every morning
|
|
228
|
-
|
|
229
|
-
Claude Code is magic until the conversation ends. Then you're back to three problems Recall is built to fix:
|
|
230
|
-
|
|
231
|
-
- **Context amnesia** — every \`claude\` invocation starts from zero. Fixed by \`recall context <id> | claude\`: pipe any past session into a new one as condensed markdown, so Claude picks up where you left off.
|
|
232
|
-
- **Cost anxiety** — you never know which session burned the budget. Fixed by the 📊 pill in every transcript and the \`recall stats\` command: tokens, dollars, primary model, daily sparkline.
|
|
233
|
-
- **Org sprawl** — Claude Code scatters everything into \`~/.claude/projects/**/*.jsonl\` with no titles, no search, no way to find anything. Fixed by full-text search, semantic search, \`#tag\` filters, collections, and \`Cmd+K\`.
|
|
234
|
-
|
|
235
|
-
Everything runs on your laptop. Nothing leaves the machine.
|
|
236
|
-
|
|
237
|
-
## Quickstart — 60 seconds
|
|
238
|
-
|
|
239
|
-
### 1. Start the background daemon
|
|
240
|
-
|
|
241
|
-
\`\`\`bash
|
|
242
|
-
recall start
|
|
243
|
-
\`\`\`
|
|
244
|
-
|
|
245
|
-
The daemon watches your \`~/.claude/projects/\` folder and serves this web UI on localhost. Run this once. It keeps running in the background.
|
|
246
|
-
|
|
247
|
-
### 2. Open the UI
|
|
248
|
-
|
|
249
|
-
\`\`\`bash
|
|
250
|
-
recall open
|
|
251
|
-
\`\`\`
|
|
252
|
-
|
|
253
|
-
That's the command that opened this page.
|
|
254
|
-
|
|
255
|
-
### 3. Find a session — three ways
|
|
256
|
-
|
|
257
|
-
- **Browse** — pick a project on the left, click a session in the middle
|
|
258
|
-
- **Search** — type any word in the search bar; full-text match across every message you've ever run (try \`#tag-name\` to filter by tag)
|
|
259
|
-
- **Jump** — hit \`Cmd+K\` / \`Ctrl+K\` to fuzzy-jump to any recent session or action
|
|
260
|
-
|
|
261
|
-
### 4. Check the cost
|
|
262
|
-
|
|
263
|
-
Open any transcript. The **📊 pill** in the header shows tokens, dollars, and the primary model for that session. Top bar **Stats** opens the dashboard with the 7/30-day sparkline and top-10 heaviest sessions.
|
|
264
|
-
|
|
265
|
-
### 5. Name the ones that matter
|
|
266
|
-
|
|
267
|
-
Click **"Click to name this session ✎"** in any transcript header to add a memorable alias like \`auth-bug-fix\`. Bare session UUIDs are forgettable; aliases aren't. Renames are archived forever — Recall never deletes user data.
|
|
268
|
-
|
|
269
|
-
### 6. Pipe a past session into a new Claude conversation — the moat
|
|
270
|
-
|
|
271
|
-
Click **📋 copy as context** in any transcript header → paste into a new Claude Code conversation. Claude starts with full context of what you discussed before.
|
|
272
|
-
|
|
273
|
-
Or from the terminal:
|
|
274
|
-
|
|
275
|
-
\`\`\`bash
|
|
276
|
-
recall context abc12345 | pbcopy # condensed markdown → clipboard
|
|
277
|
-
recall context abc12345 | claude # pipe straight into a new session
|
|
278
|
-
recall context abc12345 --prelude "continue this" \\
|
|
279
|
-
| claude # tell Claude what to do with it
|
|
280
|
-
\`\`\`
|
|
281
|
-
|
|
282
|
-
That's the move you'll make every morning so you stop re-explaining the project.`},{id:`web-ui`,title:`Web UI tour`,emoji:`🧭`,md:`# Web UI
|
|
283
|
-
|
|
284
|
-
Three panes, top to bottom, left to right.
|
|
285
|
-
|
|
286
|
-
## Top bar
|
|
287
|
-
|
|
288
|
-
- **Project/session/message counters** — live, updates every 15s from the daemon
|
|
289
|
-
- **Search box** — press \`/\` anywhere to focus it. Type any word — it runs full-text search across every message in every session you have indexed. Matches show with orange highlights
|
|
290
|
-
- **All projects / In <project>** toggle — appears when a project is selected. Flip to scope search to just that project
|
|
291
|
-
- **↻ refresh** — re-fetch everything from the daemon (normally not needed; auto-refresh every 15s)
|
|
292
|
-
|
|
293
|
-
## Left pane — Projects
|
|
294
|
-
|
|
295
|
-
Every directory you've run Claude Code in. Ordered by most-recent activity. Click **All sessions** to stop filtering. Click any project to filter the middle pane.
|
|
296
|
-
|
|
297
|
-
## Middle pane — Sessions
|
|
298
|
-
|
|
299
|
-
Sessions in the selected project, newest first. Each row shows:
|
|
300
|
-
- Session UUID (8-char prefix, clickable)
|
|
301
|
-
- ★ star to pin (pinned ones rise to the top)
|
|
302
|
-
- Custom alias, if you've named it
|
|
303
|
-
- Opening prompt preview
|
|
304
|
-
- 📝 badge if the session has notes
|
|
305
|
-
|
|
306
|
-
Filter by date range with the **dates** toggle in the header.
|
|
307
|
-
|
|
308
|
-
## Right pane — Transcript
|
|
309
|
-
|
|
310
|
-
Full message-by-message replay of the session.
|
|
311
|
-
|
|
312
|
-
- Header shows alias / UUID / project / stats + action buttons
|
|
313
|
-
- 📝 Notes section is collapsible — your markdown notes for this session
|
|
314
|
-
- Messages render markdown, syntax-highlight code, and include per-code-block **copy** buttons on hover
|
|
315
|
-
- Search match bar appears when you're searching — prev/next cycle through matches
|
|
316
|
-
- Load more kicks in after 500 messages in big sessions`},{id:`cli`,title:`CLI commands`,emoji:`⌨️`,md:`# CLI commands
|
|
317
|
-
|
|
318
|
-
The \`recall\` binary is on your PATH after \`npm link\`. Every command has \`--help\`.
|
|
319
|
-
|
|
320
|
-
## Index
|
|
321
|
-
|
|
322
|
-
\`\`\`bash
|
|
323
|
-
recall index # scan for new/changed sessions and ingest them
|
|
324
|
-
recall index --force # reindex everything from scratch
|
|
325
|
-
recall index -v # verbose output per file
|
|
326
|
-
\`\`\`
|
|
327
|
-
|
|
328
|
-
The daemon watcher does this automatically in the background. Manual \`recall index\` is a fallback.
|
|
329
|
-
|
|
330
|
-
## Daemon lifecycle
|
|
331
|
-
|
|
332
|
-
\`\`\`bash
|
|
333
|
-
recall start # start background daemon (watcher + localhost HTTP)
|
|
334
|
-
recall stop # stop daemon cleanly
|
|
335
|
-
recall open # open the web UI; auto-starts daemon if needed
|
|
336
|
-
recall status # db path, size, session counts, daemon state
|
|
337
|
-
\`\`\`
|
|
338
|
-
|
|
339
|
-
## Explore from the terminal
|
|
340
|
-
|
|
341
|
-
\`\`\`bash
|
|
342
|
-
recall projects # project list with session counts
|
|
343
|
-
recall list # 30 most-recent sessions (all projects)
|
|
344
|
-
recall list -p Tools # filter by project-name substring
|
|
345
|
-
recall list -n 100 # limit
|
|
346
|
-
\`\`\`
|
|
347
|
-
|
|
348
|
-
## Read a session
|
|
349
|
-
|
|
350
|
-
\`\`\`bash
|
|
351
|
-
recall show abc12345 # pretty transcript; auto-pages through \`less\` if long
|
|
352
|
-
recall show abc12345 --raw # raw JSONL lines (debug)
|
|
353
|
-
recall show abc12345 --no-pager # dump to stdout without pager
|
|
354
|
-
\`\`\`
|
|
355
|
-
|
|
356
|
-
## Search
|
|
357
|
-
|
|
358
|
-
\`\`\`bash
|
|
359
|
-
recall search "zod schema" # full-text search across everything
|
|
360
|
-
recall search "auth flow" -p Pest-Control # scope to one project
|
|
361
|
-
recall search bug -n 50 # up to 50 hits
|
|
362
|
-
\`\`\`
|
|
363
|
-
|
|
364
|
-
## Context re-injection (the moat)
|
|
365
|
-
|
|
366
|
-
\`\`\`bash
|
|
367
|
-
recall context abc12345 # condensed markdown to stdout
|
|
368
|
-
recall context abc12345 | pbcopy # to clipboard (macOS)
|
|
369
|
-
recall context abc12345 | claude # pipe into new Claude session
|
|
370
|
-
recall context abc12345 --full # full transcript (huge)
|
|
371
|
-
recall context abc12345 --since 2h # only last 2 hours
|
|
372
|
-
recall context abc12345 --since 1d # only last day
|
|
373
|
-
recall context abc12345 --since 2026-04-18 # only since date
|
|
374
|
-
recall context abc12345 --prelude "continue this conversation"
|
|
375
|
-
recall context abc12345 --subagents # include subagent messages
|
|
376
|
-
\`\`\`
|
|
377
|
-
|
|
378
|
-
## Cost and token analytics (v0.10a)
|
|
379
|
-
|
|
380
|
-
\`\`\`bash
|
|
381
|
-
recall stats abc12345 # tokens + dollars for one session
|
|
382
|
-
recall stats --project Tools # per-project rollup
|
|
383
|
-
recall stats --days 7 # 7-day overview
|
|
384
|
-
recall stats --backfill # one-shot usage backfill for older messages
|
|
385
|
-
recall stats --json # machine-readable output
|
|
386
|
-
\`\`\`
|
|
387
|
-
|
|
388
|
-
## Git correlation (v0.10b)
|
|
389
|
-
|
|
390
|
-
\`\`\`bash
|
|
391
|
-
recall correlate # link sessions to commits in their cwd
|
|
392
|
-
recall correlate <id> # correlate a single session
|
|
393
|
-
recall blame <sha> # reverse lookup: commit to session
|
|
394
|
-
\`\`\`
|
|
395
|
-
|
|
396
|
-
## Semantic search (v0.11)
|
|
397
|
-
|
|
398
|
-
\`\`\`bash
|
|
399
|
-
recall semantic on # enable conceptual search
|
|
400
|
-
recall semantic off # disable
|
|
401
|
-
recall semantic status # backfill progress + model info
|
|
402
|
-
recall semantic backfill # run backfill now
|
|
403
|
-
recall semantic pause # pause background worker
|
|
404
|
-
recall semantic resume # resume worker
|
|
405
|
-
recall semantic install # download the local embedding model
|
|
406
|
-
recall semantic uninstall # remove the local model
|
|
407
|
-
recall semantic reindex # regenerate all summaries
|
|
408
|
-
\`\`\`
|
|
409
|
-
|
|
410
|
-
## Similar sessions (Pro, requires vector model)
|
|
411
|
-
|
|
412
|
-
\`\`\`bash
|
|
413
|
-
recall similar <id> # sessions related to this one
|
|
414
|
-
recall similar <id> -n 5 # top 5 results
|
|
415
|
-
\`\`\`
|
|
416
|
-
|
|
417
|
-
## Clipboard archiving (opt-in)
|
|
418
|
-
|
|
419
|
-
\`\`\`bash
|
|
420
|
-
recall paste # archive clipboard contents
|
|
421
|
-
recall paste --label "zod fix" # attach a short description
|
|
422
|
-
recall paste --dry-run # preview without writing
|
|
423
|
-
recall paste --pipe # echo content to stdout after archiving
|
|
424
|
-
recall paste --force # skip secret-scan confirmation
|
|
425
|
-
recall paste --list # list archived pastes
|
|
426
|
-
recall paste --purge <id> # permanently delete one paste
|
|
427
|
-
\`\`\`
|
|
428
|
-
|
|
429
|
-
## Security scanning
|
|
430
|
-
|
|
431
|
-
\`\`\`bash
|
|
432
|
-
recall audit-secrets # scan db for leaked secrets (read-only)
|
|
433
|
-
recall audit-secrets --redact # scrub hits in place (source JSONLs untouched)
|
|
434
|
-
recall audit-secrets -v # verbose per-session output
|
|
435
|
-
\`\`\`
|
|
436
|
-
|
|
437
|
-
## Rediscovery digest
|
|
438
|
-
|
|
439
|
-
\`\`\`bash
|
|
440
|
-
recall digest # today's picks (rediscovered session, costliest, HEAD author)
|
|
441
|
-
recall digest --json # machine-readable output
|
|
442
|
-
\`\`\`
|
|
443
|
-
|
|
444
|
-
## VS Code extension sideloading
|
|
445
|
-
|
|
446
|
-
\`\`\`bash
|
|
447
|
-
recall install-extension # install into all detected editors
|
|
448
|
-
recall install-extension --editor cursor # target one editor
|
|
449
|
-
recall install-extension --print-path # print .vsix path and exit
|
|
450
|
-
\`\`\`
|
|
451
|
-
|
|
452
|
-
## Memory health scores
|
|
453
|
-
|
|
454
|
-
\`\`\`bash
|
|
455
|
-
recall health # all projects, worst health first
|
|
456
|
-
recall health "My Project" # single-project breakdown
|
|
457
|
-
recall health --json # machine-readable output
|
|
458
|
-
\`\`\`
|
|
459
|
-
|
|
460
|
-
## Verification badges (opt-in preview)
|
|
461
|
-
|
|
462
|
-
\`\`\`bash
|
|
463
|
-
recall verify # show current status (default)
|
|
464
|
-
recall verify on # enable
|
|
465
|
-
recall verify off # disable
|
|
466
|
-
\`\`\`
|
|
467
|
-
|
|
468
|
-
## Pro licensing
|
|
469
|
-
|
|
470
|
-
\`\`\`bash
|
|
471
|
-
recall activate <license-key> # activate a Pro license (one-time)
|
|
472
|
-
recall license # show current tier (default: status)
|
|
473
|
-
recall license status # same as above
|
|
474
|
-
recall license deactivate # remove license from this machine
|
|
475
|
-
\`\`\`
|
|
476
|
-
|
|
477
|
-
## MCP server
|
|
478
|
-
|
|
479
|
-
\`\`\`bash
|
|
480
|
-
recall mcp # start MCP server over stdio
|
|
481
|
-
recall mcp --allow-writes # enable write tools (off by default)
|
|
482
|
-
\`\`\`
|
|
483
|
-
|
|
484
|
-
## Threads (v0.15a)
|
|
485
|
-
|
|
486
|
-
\`\`\`bash
|
|
487
|
-
recall thread list # list threads (most recent first)
|
|
488
|
-
recall thread list --archived # include archived threads
|
|
489
|
-
recall thread show <id> # thread header + session tree
|
|
490
|
-
recall thread new "Auth refactor" # create a thread
|
|
491
|
-
recall thread new "Auth" --origin <sid> # create with an origin session
|
|
492
|
-
recall thread link <sid> --thread <tid> # link session into a thread
|
|
493
|
-
recall thread link <sid> --thread <tid> --parent <pid> # link as child
|
|
494
|
-
recall thread unlink <sid> --thread <tid> # remove session from thread
|
|
495
|
-
recall thread set-parent <sid> --thread <tid> --parent <pid> # re-parent
|
|
496
|
-
recall thread rename <id> "New name" # rename a thread
|
|
497
|
-
recall thread close <id> # mark work complete
|
|
498
|
-
recall thread reopen <id> # reopen a closed thread
|
|
499
|
-
recall thread archive <id> # soft-delete (hidden, not hard-deleted)
|
|
500
|
-
recall thread merge <source> --into <dest> # merge two threads
|
|
501
|
-
recall thread split <id> --sessions s1,s2 --name "New thread" # split sessions out
|
|
502
|
-
\`\`\``},{id:`shortcuts`,title:`Keyboard shortcuts`,emoji:`⌘`,md:"# Keyboard shortcuts\n\n## Anywhere in the web UI\n\n| Key | Action |\n|---|---|\n| `/` | Focus the search box |\n| `Esc` | Clear search + blur |\n| `?` | Open this help page |\n| `Cmd+K` (mac) / `Ctrl+K` | Open the command palette |\n| `c` | New collection |\n| `Cmd+Shift+A` (mac) / `Ctrl+Shift+A` | Add current session to a collection |\n| `Cmd+Shift+C` (mac) / `Ctrl+Shift+C` | Jump to the collections tree |\n| `Cmd+\\` (mac) / `Ctrl+\\` | Collapse / expand the sessions pane |\n\n## In the sessions list (middle pane)\n\n| Key | Action |\n|---|---|\n| Click a row | Open that session in the transcript pane |\n| `Cmd+Click` (mac) / `Ctrl+Click` | Toggle that row in/out of a multi-selection |\n| `Shift+Click` | Extend the multi-selection as a contiguous range from the last click |\n| `Esc` | Clear the multi-selection |\n| Right-click a selected row (with 2+ selected) | Open the multi-select menu — copy session IDs (newline / space / comma separated), clear |\n| Right-click any single row | Open the per-session menu — open, pin, copy ID, copy as context, add to collection, compare, run MCP prompts |\n\nWhen 2+ rows are selected, an accent strip appears below the pane header with the count and a one-click **copy IDs** button (newline-separated, ready to paste into a new Claude prompt).\n\n## Inside a transcript with an active search\n\n| Key | Action |\n|---|---|\n| `n` | Jump to next match |\n| `p` or `Shift+n` | Jump to previous match |\n| `End` | Jump to the latest message |\n| `Home` | Jump to the first message |\n\n## Editing an alias\n\n| Key | Action |\n|---|---|\n| `Enter` | Save the new alias |\n| `Esc` | Cancel |\n\n## Editing a note\n\n| Key | Action |\n|---|---|\n| `Cmd+Enter` (mac) / `Ctrl+Enter` | Save |\n| `Esc` | Cancel |"},{id:`collections`,title:`Collections`,emoji:`📂`,md:`# Collections (v0.8)
|
|
503
|
-
|
|
504
|
-
**Hand-picked groupings of sessions that cut across projects.** Tags are flat and auto-filter; projects are coarse \`cwd\` buckets. Collections are the middle layer: a curated, hierarchical taxonomy *you* build.
|
|
505
|
-
|
|
506
|
-
## When to use them
|
|
507
|
-
|
|
508
|
-
- A monorepo internally splits into sub-projects (e.g. \`Pest-Control-Automation → scraping / sales-flow / ingestion\`) but \`cwd\` makes them one project.
|
|
509
|
-
- You want "the 8 sessions that mattered for the migration" pulled out of 200 noisy sessions in the same project.
|
|
510
|
-
- You're preparing context for a colleague: name a collection "Scraping — current state", drop the relevant sessions in, share the URL.
|
|
511
|
-
|
|
512
|
-
## How they're structured
|
|
513
|
-
|
|
514
|
-
- A **tree** — each collection has an optional \`parent_id\`. Nesting limited to 8 levels.
|
|
515
|
-
- A **hand-picked membership list** — you explicitly add sessions; nothing auto-populates.
|
|
516
|
-
- **Soft-deletion only** — "archive" hides without erasing. Collections can always be restored.
|
|
517
|
-
- **Icon + color** — one emoji + an optional color for visual scanning.
|
|
518
|
-
|
|
519
|
-
## How to use them
|
|
520
|
-
|
|
521
|
-
1. Hit **\`c\`** (or the \`+ new\` button in the left pane) to create a collection.
|
|
522
|
-
2. **Drag any session row (from the middle pane) onto a collection in the left pane** to add it. Works from plain lists and from search results. The target collection flashes orange while you hover.
|
|
523
|
-
3. Or: from any transcript, open the \`⋯\` menu → **📂 Add to collection…** or use **\`Cmd+Shift+A\`**.
|
|
524
|
-
4. Click a collection in the left pane to filter the middle pane. The breadcrumb shows the full path. Selecting a parent automatically includes sessions from every child collection.
|
|
525
|
-
5. To move a session between collections, drag it onto the new one (that adds it), then remove it from the old one via the chip \`×\` in the transcript header — or the \`remove\` affordance on each row while the old collection is open.
|
|
526
|
-
6. Right-click any collection for: new child · rename · archive · copy link · restore.
|
|
527
|
-
7. Drag one collection onto a sibling to reorder them.
|
|
528
|
-
|
|
529
|
-
## Pane controls
|
|
530
|
-
|
|
531
|
-
- The sessions pane (middle) is **resizable** — grab its right edge and drag. Width persists per-browser.
|
|
532
|
-
- Click the **«** in the sessions pane header (or hit \`Cmd+\\\`) to collapse it to a thin rail. Click **»** to expand again. Handy when you want the transcript to take the whole screen.
|
|
533
|
-
|
|
534
|
-
## URL sharing
|
|
535
|
-
|
|
536
|
-
The active collection is in the URL hash as \`col=<uuid>\`. Paste the URL anywhere — clicking it opens the app filtered to that collection.
|
|
537
|
-
|
|
538
|
-
## Durability — same three layers as tags / notes / aliases
|
|
539
|
-
|
|
540
|
-
1. **SQLite** — \`collections\`, \`collection_sessions\`, \`collection_events\` (append-only audit log of every mutation).
|
|
541
|
-
2. **Plain-text mirror** — \`~/.recall/collections.json\`, rewritten on every change. Contains both the current state and the full event log, so the tree can be reconstructed from this file alone.
|
|
542
|
-
3. **Source JSONLs untouched** — \`~/.claude/projects/**\` remains read-only to Recall.
|
|
543
|
-
|
|
544
|
-
If you delete the SQLite database, collections are recoverable via:
|
|
545
|
-
|
|
546
|
-
\`\`\`bash
|
|
547
|
-
recall restore-collections # planned, reads the mirror file
|
|
548
|
-
\`\`\`
|
|
549
|
-
|
|
550
|
-
Until that subcommand lands, the JSON mirror is still an authoritative backup you can rebuild from.
|
|
551
|
-
|
|
552
|
-
## What they're NOT
|
|
553
|
-
|
|
554
|
-
- Not tags. Tags are flat, keyword-ish, and can auto-filter via \`#tag\`. Collections are hand-picked and hierarchical. Keep both.
|
|
555
|
-
- Not projects. Projects still reflect \`cwd\`; collections cross project boundaries freely.
|
|
556
|
-
- Not folders on disk. Nothing moves in the filesystem.`},{id:`data`,title:`Your data`,emoji:`💾`,md:`# Where your data lives
|
|
557
|
-
|
|
558
|
-
Everything is local. Nothing ever leaves your machine.
|
|
559
|
-
|
|
560
|
-
## Source of truth (read-only to Recall)
|
|
561
|
-
|
|
562
|
-
- \`~/.claude/projects/<encoded-path>/<session-uuid>.jsonl\` — Claude Code's own session files. We read these; we never modify them.
|
|
563
|
-
|
|
564
|
-
## Our own data
|
|
565
|
-
|
|
566
|
-
- \`~/.recall/db.sqlite\` — the indexed database (projects, sessions, messages, FTS5 search index, aliases, notes)
|
|
567
|
-
- \`~/.recall/aliases.json\` — plain-text mirror of every alias (with full edit history). Automatically rewritten on every alias change
|
|
568
|
-
- \`~/.recall/notes/<session-uuid>.md\` — one plain-markdown file per note. You can edit these in your favorite editor
|
|
569
|
-
- \`~/.recall/daemon.pid\` — running daemon metadata
|
|
570
|
-
- \`~/.recall/daemon.log\` — daemon logs (troubleshooting)
|
|
571
|
-
|
|
572
|
-
## Back up
|
|
573
|
-
|
|
574
|
-
Everything Recall owns lives under \`~/.recall/\`. Tar it up:
|
|
575
|
-
|
|
576
|
-
\`\`\`bash
|
|
577
|
-
tar czf recall-backup.tgz ~/.recall/
|
|
578
|
-
\`\`\`
|
|
579
|
-
|
|
580
|
-
To restore on a new machine: untar into the new \`~/.recall/\`, then run \`recall start\`. Your aliases, notes, pins all return.
|
|
581
|
-
|
|
582
|
-
## Reset without data loss
|
|
583
|
-
|
|
584
|
-
Want to rebuild the SQLite index from scratch?
|
|
585
|
-
|
|
586
|
-
\`\`\`bash
|
|
587
|
-
recall stop
|
|
588
|
-
rm ~/.recall/db.sqlite*
|
|
589
|
-
recall start
|
|
590
|
-
recall index
|
|
591
|
-
\`\`\`
|
|
592
|
-
|
|
593
|
-
Your aliases survive because \`~/.recall/aliases.json\` mirrors them. Same for notes (each sits in its own \`.md\` file). Tree stays intact.
|
|
594
|
-
|
|
595
|
-
## Never-delete guarantee
|
|
596
|
-
|
|
597
|
-
Claude Recall **never deletes user-created data**. Every rename archives the prior value. Every note save keeps the previous version. If you "clear" something, you get an empty value with the history still readable.`},{id:`export`,title:`Exporting & sharing`,emoji:`📤`,md:`# Exporting & sharing
|
|
598
|
-
|
|
599
|
-
Four ways to get a session out of Recall.
|
|
600
|
-
|
|
601
|
-
## 1. Copy as context (the killer feature)
|
|
602
|
-
|
|
603
|
-
Click **📋 copy as context** in the transcript header. Condensed markdown lands on your clipboard — stripped tool-call JSON, stripped thinking blocks, but every user prompt and assistant response preserved. Perfect for pasting into a new Claude session so it starts with full context.
|
|
604
|
-
|
|
605
|
-
Equivalent CLI:
|
|
606
|
-
|
|
607
|
-
\`\`\`bash
|
|
608
|
-
recall context <id> | pbcopy
|
|
609
|
-
\`\`\`
|
|
610
|
-
|
|
611
|
-
## 2. Copy as full markdown
|
|
612
|
-
|
|
613
|
-
Click **copy md** in the transcript header. Full transcript including tool call JSON, tool results, everything. Bigger, more faithful, less Claude-friendly.
|
|
614
|
-
|
|
615
|
-
## 3. Export HTML
|
|
616
|
-
|
|
617
|
-
Click **export html**. Downloads a self-contained HTML file (all styles inlined) in dark mode. Open in any browser, commit to git, email it, archive it. Works offline forever.
|
|
618
|
-
|
|
619
|
-
## 4. Print
|
|
620
|
-
|
|
621
|
-
Click **print**. Opens your browser's print dialog with a print-friendly layout — chrome hidden, transcript only, light background, page breaks between messages. Save to PDF from the print dialog.`},{id:`security`,title:`Security & privacy`,emoji:`🔒`,md:`# Security & privacy
|
|
622
|
-
|
|
623
|
-
**Short version: your Claude conversations never leave your computer.** No cloud, no telemetry, no analytics, no account. Recall is a program that runs on your laptop, reads files that already exist on your laptop, and shows them to you in your browser — and that's it.
|
|
624
|
-
|
|
625
|
-
## At a glance
|
|
626
|
-
|
|
627
|
-
| ✅ Safe | 🚫 Can't happen |
|
|
628
|
-
|---|---|
|
|
629
|
-
| Everything stays local on your machine | Your sessions get uploaded anywhere |
|
|
630
|
-
| The web UI is only reachable from your own computer | Someone on your Wi-Fi browsing your history |
|
|
631
|
-
| Your original Claude Code files are never modified | A website you visit reading your conversations |
|
|
632
|
-
| Pasted secrets (API keys, passwords) are caught before saving | Secret keys ending up in plain text by accident |
|
|
633
|
-
| You can verify everything yourself with the commands below | Silent updates phoning home — we don't have telemetry |
|
|
634
|
-
|
|
635
|
-
## How we keep you safe — in plain English
|
|
636
|
-
|
|
637
|
-
- **Nothing leaves your computer.** Recall has no servers to send data to. We couldn't see your sessions if we tried.
|
|
638
|
-
- **The web app only works on your machine.** The address starts with \`127.0.0.1\` — that's the universal "this computer only" address. Other devices on your home or office network literally cannot reach it.
|
|
639
|
-
- **Other websites can't sneak in.** Even if you visit a malicious site while Recall is running, it's blocked by three independent safety checks (see "DNS rebinding" below if you're curious).
|
|
640
|
-
- **Your data survives mistakes.** Deleting an alias or note doesn't truly delete it — the history is kept so you can always recover.
|
|
641
|
-
- **Pasting secrets is a first-class concern.** Before the \`recall paste\` command stores anything, it scans for API keys, passwords, and private keys. If it finds one, it stops and asks.
|
|
642
|
-
- **Secrets pasted *inside* a Claude Code session** (API keys you dropped into your terminal mid-conversation) are **auto-redacted at index time** — replaced with \`[REDACTED …]\` markers before they ever touch Recall's database or search index.
|
|
643
|
-
- **No accounts, no telemetry, no trackers.** We don't know if you're using Recall and we don't want to.
|
|
644
|
-
|
|
645
|
-
## Trust boundary
|
|
646
|
-
|
|
647
|
-
| Stays on your machine | Leaves your machine |
|
|
648
|
-
|---|---|
|
|
649
|
-
| Every session JSONL Recall reads | Nothing during normal use |
|
|
650
|
-
| Your SQLite database at \`~/.recall/db.sqlite\` | — |
|
|
651
|
-
| Your notes at \`~/.recall/notes/*.md\` | — |
|
|
652
|
-
| Your aliases / tags / pins / paste archive | — |
|
|
653
|
-
| The web UI (served from \`127.0.0.1\`) | — |
|
|
654
|
-
| | **Only ever**: one HTTPS call to validate your license key (v0.6+). Offline forever after that. |
|
|
655
|
-
|
|
656
|
-
There are no analytics, no crash reporters, no telemetry pings. We don't know if you're using the product and we don't want to.
|
|
657
|
-
|
|
658
|
-
## Network posture
|
|
659
|
-
|
|
660
|
-
- The daemon HTTP server binds to \`127.0.0.1\` **only** — never \`0.0.0.0\`. A packet from another machine, even on your own LAN, cannot reach it.
|
|
661
|
-
- No outbound requests are made by the daemon or CLI during indexing, browsing, searching, or context export.
|
|
662
|
-
- The browser UI talks to \`http://127.0.0.1:<port>\` where the port is chosen dynamically at daemon start (avoiding common dev ports so we don't collide with your other local services).
|
|
663
|
-
|
|
664
|
-
## DNS rebinding & cross-origin defense
|
|
665
|
-
|
|
666
|
-
Binding to loopback is necessary but not sufficient. A malicious website the user visits could otherwise reach a loopback daemon via **DNS rebinding** (the attacker's domain first resolves to their server, delivers JavaScript, then re-resolves to \`127.0.0.1\` — bypassing the same-origin policy). Recall defends in three layers:
|
|
667
|
-
|
|
668
|
-
1. **Host header allowlist** — every request is rejected unless its \`Host\` header is \`127.0.0.1\` or \`localhost\` (with optional port). DNS-rebinding attacks send the attacker's hostname, which fails this check.
|
|
669
|
-
2. **Origin header validation** — browser requests always include \`Origin\`; any cross-origin value is rejected with 403. Non-browser tools (curl, the CLI) omit it and are allowed through as normal.
|
|
670
|
-
3. **Strict Content-Security-Policy** on every response: \`default-src 'self'; script-src 'self'; connect-src 'self'; frame-ancestors 'none'\`. Even if attacker content ever rendered, it cannot load external resources, run inline scripts, or be embedded in an iframe.
|
|
671
|
-
|
|
672
|
-
Additional response headers: \`X-Content-Type-Options: nosniff\`, \`X-Frame-Options: DENY\`, \`Referrer-Policy: no-referrer\`, \`Cross-Origin-Resource-Policy: same-origin\`.
|
|
673
|
-
|
|
674
|
-
## XSS hardening in the UI
|
|
675
|
-
|
|
676
|
-
Session content is rendered as markdown, which means it could in theory contain raw HTML from tool outputs or pasted text. Every markdown render pipes through **DOMPurify** with a strict allowlist before hitting the DOM:
|
|
677
|
-
|
|
678
|
-
- Scripts, iframes, forms, buttons (from untrusted sources), styles, and event handlers are all stripped.
|
|
679
|
-
- \`href\` and \`src\` attributes are forbidden — \`javascript:\` and \`data:\` URI vectors are impossible by construction.
|
|
680
|
-
- The only attributes that survive are \`class\` and \`title\`.
|
|
681
|
-
|
|
682
|
-
The copy-code button on each code block is trusted markup injected **after** sanitization, so our own UI keeps working while attacker HTML never does.
|
|
683
|
-
|
|
684
|
-
## Path-traversal defense (paste expand)
|
|
685
|
-
|
|
686
|
-
The \`/api/paste-expand\` endpoint, which can optionally read files referenced by paste placeholders, applies two layered checks: (a) the requested path must actually appear in an indexed paste placeholder within the user's session, and (b) the resolved real path (after symlink resolution) must live under the user's home directory. Requests targeting \`/etc/passwd\`, other users' homes, or arbitrary absolute paths are rejected with 403.
|
|
687
|
-
|
|
688
|
-
## Auto-redaction at ingest (session secrets)
|
|
689
|
-
|
|
690
|
-
When you paste an API key, password, or private key into your terminal during a Claude Code session, Claude Code writes that secret verbatim into the session's JSONL file under \`~/.claude/projects/\`. By default, Recall's indexer would copy that into its own database — making your secret searchable across every session forever.
|
|
691
|
-
|
|
692
|
-
**We don't do that.** The indexer runs every message through the same secret scanner used by \`recall paste\` **before** anything lands in SQLite. Matches are replaced with a masked marker like \`[REDACTED OpenAI API key: sk-pr•••••xyz9]\` in both:
|
|
693
|
-
|
|
694
|
-
- \`content_text\` (what the web UI and search see)
|
|
695
|
-
- \`raw_json\` (the preserved full record)
|
|
696
|
-
- \`first_user_message\` (the session preview shown in lists)
|
|
697
|
-
|
|
698
|
-
Patterns scrubbed: Anthropic / OpenAI / AWS / GitHub / Stripe / Slack / Google keys, JWTs, SSH-family private key headers, URLs with embedded passwords, and assignment-style secrets (\`password=\`, \`token:\`, \`api_key=\`).
|
|
699
|
-
|
|
700
|
-
The original JSONL at \`~/.claude/projects/\` is **never** modified — that's the durability invariant. Only our derived store is scrubbed, so if you ever need the cleartext for a legitimate reason, it's still in the source file.
|
|
701
|
-
|
|
702
|
-
### Already-indexed sessions (retroactive redaction)
|
|
703
|
-
|
|
704
|
-
Sessions indexed before this feature landed still have cleartext in \`~/.recall/db.sqlite\`. To retroactively scrub them, run:
|
|
705
|
-
|
|
706
|
-
\`\`\`bash
|
|
707
|
-
recall index --force
|
|
708
|
-
\`\`\`
|
|
709
|
-
|
|
710
|
-
This re-ingests every session with the redactor active. Runs locally, takes a few seconds per 1,000 messages.
|
|
711
|
-
|
|
712
|
-
## "Never delete" data durability (aliases, notes, tags)
|
|
713
|
-
|
|
714
|
-
Every user-created write feature keeps history and mirrors to plain text on disk:
|
|
715
|
-
|
|
716
|
-
| Feature | SQLite | Plain-text mirror | History |
|
|
717
|
-
|---|---|---|---|
|
|
718
|
-
| Aliases | \`session_aliases\` | \`~/.recall/aliases.json\` | \`previous_aliases[]\` + JSON audit |
|
|
719
|
-
| Notes | \`session_notes\` | \`~/.recall/notes/<id>.md\` | \`previous_versions[]\` + full file |
|
|
720
|
-
| Tags | \`session_tags\` + \`tag_events\` | \`~/.recall/tags.json\` | append-only event log |
|
|
721
|
-
|
|
722
|
-
A "cleared" value is stored as an empty string, never hard-deleted. If you nuke the SQLite file, the plain-text mirrors reconstruct everything. **This is a deliberate trade-off**: your data survives local disasters at the cost of being plain-text-on-disk. See below for the one carve-out.
|
|
723
|
-
|
|
724
|
-
## The paste archive carve-out (v0.4.5)
|
|
725
|
-
|
|
726
|
-
The opt-in \`recall paste\` command is the **one** feature where you can truly \`--purge\` a row. Justification: clipboard content is far more likely to contain secrets than a note or alias, and no "soft-delete" for a leaked API key is acceptable. The carve-out is documented, bounded to one table, and explicitly mentioned here and in the ROADMAP's hard-rules section.
|
|
727
|
-
|
|
728
|
-
## Secret scanner
|
|
729
|
-
|
|
730
|
-
Before archiving clipboard content, \`recall paste\` runs a regex sweep for:
|
|
731
|
-
|
|
732
|
-
- Anthropic / OpenAI / AWS / GitHub / Stripe / Slack / Google API keys
|
|
733
|
-
- JWTs
|
|
734
|
-
- SSH / RSA / DSA / EC / OpenSSH / encrypted private key headers
|
|
735
|
-
- URLs with embedded passwords (\`https://user:pass@host\`)
|
|
736
|
-
- Assignment-style secrets (\`password=\`, \`token:\`, \`api_key=\`)
|
|
737
|
-
|
|
738
|
-
When a match fires, the archive is **blocked** until you explicitly confirm with \`y\` or pass \`--force\`. In non-interactive mode (piped through a script), a detected secret blocks the archive by default — the content still echoes to stdout so your paste pipeline isn't broken, but nothing is stored.
|
|
739
|
-
|
|
740
|
-
If something slipped through or you archived something you shouldn't have:
|
|
741
|
-
|
|
742
|
-
\`\`\`bash
|
|
743
|
-
recall paste --list # see what's archived
|
|
744
|
-
recall paste --purge <id> # permanently destroy one
|
|
745
|
-
\`\`\`
|
|
746
|
-
|
|
747
|
-
## What we deliberately chose NOT to build
|
|
748
|
-
|
|
749
|
-
Locked into the roadmap as non-goals:
|
|
750
|
-
|
|
751
|
-
- **No VS Code / Cursor / Windsurf paste-hook extension.** A compromised marketplace update could become a global paste keylogger for every install. Mitigations don't close the distribution-channel attack vector. The v0.7 IDE extension is scoped to non-sensitive metadata only (terminal tab name + shell PID for UUID correlation). It will never touch clipboard contents.
|
|
752
|
-
- **No global clipboard monitor daemon.** Reads more than it needs, requires OS-level accessibility permissions, becomes a privilege-escalation magnet.
|
|
753
|
-
- **No cloud sync by default.** The v0.8+ team-sharing feature will be opt-in, end-to-end encrypted, and still local-first — the local DB stays the source of truth; sync is additive.
|
|
754
|
-
- **No telemetry, analytics, or crash reporting.** We don't track you because we can't — we don't ship the code that would.
|
|
755
|
-
|
|
756
|
-
## Dangerous APIs — audit notes
|
|
757
|
-
|
|
758
|
-
A small number of surfaces use \`dangerouslySetInnerHTML\`. Each is safe by construction:
|
|
759
|
-
|
|
760
|
-
- **Message body (\`Message.tsx\`)** — renders markdown via \`marked\`, then passes the output through DOMPurify with a strict allowlist (no scripts, no iframes, no \`href\`/\`src\`, no event handlers). The term-highlight regex only matches inside text nodes (\`>text<\`), never inside HTML attributes. No XSS route.
|
|
761
|
-
- **Search snippet (\`SessionsPane.tsx\`)** — the server escapes all HTML entities first, then re-introduces \`<mark>\` where FTS marked hits with \`<<...>>\`. Attribute-injection is impossible because \`<\` and \`>\` are already escaped.
|
|
762
|
-
- **Help view (this page)** — the markdown source is embedded at build time, never user-controlled.
|
|
763
|
-
|
|
764
|
-
## Your data on disk — plain-text reality
|
|
765
|
-
|
|
766
|
-
Some things you should know by default:
|
|
767
|
-
|
|
768
|
-
- Notes are stored as **plain markdown files** under \`~/.recall/notes/\`. If you write an API key into a note, that key is plain text on disk under your user account. Treat these files like a dotfile — they're your data.
|
|
769
|
-
- Aliases and tags likewise end up in plain-text mirrors (\`~/.recall/aliases.json\`, \`~/.recall/tags.json\`).
|
|
770
|
-
- The SQLite database has no row-level encryption. Anything you can read in the UI is readable by any process running as your user.
|
|
771
|
-
|
|
772
|
-
This is the same posture as every "local-first" tool (Obsidian, TextMate snippets, git dotfiles). Recall does not pretend to be a password manager.
|
|
773
|
-
|
|
774
|
-
## Verifying it yourself
|
|
775
|
-
|
|
776
|
-
You can confirm the network posture at any time:
|
|
777
|
-
|
|
778
|
-
\`\`\`bash
|
|
779
|
-
# See what the daemon is bound to — should be 127.0.0.1 only
|
|
780
|
-
lsof -iTCP -sTCP:LISTEN -P | grep recall
|
|
781
|
-
|
|
782
|
-
# Watch for any outbound traffic while using Recall — should be zero
|
|
783
|
-
sudo tcpdump -i any -n "host not 127.0.0.1 and not 0.0.0.0"
|
|
784
|
-
|
|
785
|
-
# Confirm Host-header allowlist rejects rebinding attacks (expect 403)
|
|
786
|
-
curl -s -o /dev/null -w "%{http_code}\\n" \\
|
|
787
|
-
-H "Host: attacker.example.com" http://127.0.0.1:<port>/api/health
|
|
788
|
-
|
|
789
|
-
# Confirm cross-origin requests are rejected (expect 403)
|
|
790
|
-
curl -s -o /dev/null -w "%{http_code}\\n" \\
|
|
791
|
-
-H "Origin: https://evil.example.com" http://127.0.0.1:<port>/api/stats
|
|
792
|
-
|
|
793
|
-
# Confirm CSP is present on every response
|
|
794
|
-
curl -sI http://127.0.0.1:<port>/ | grep -i content-security-policy
|
|
795
|
-
\`\`\`
|
|
796
|
-
|
|
797
|
-
If either of the above ever shows Recall reaching the network, that's a bug — please tell us.`},{id:`tips`,title:`Pro tips`,emoji:`⚡`,md:`# Pro tips
|
|
798
|
-
|
|
799
|
-
## Search first, never scroll
|
|
800
|
-
|
|
801
|
-
The reflex from scrollback-limited terminals is to scroll through sessions looking for something. Don't. Use the search box. With 150,000+ indexed messages, a typed word is faster than your scroll wheel.
|
|
802
|
-
|
|
803
|
-
## Alias your sessions the day you finish them
|
|
804
|
-
|
|
805
|
-
A session with no alias is \`abc12345\` — useless a week from now. Spend 5 seconds naming it \`"auth middleware refactor"\` while the context is fresh. Your future self thanks you.
|
|
806
|
-
|
|
807
|
-
## Pin sessions you reference often
|
|
808
|
-
|
|
809
|
-
The ★ in every session row pins it to the top of the project list. Pin your "canonical decisions" sessions so they're always first.
|
|
810
|
-
|
|
811
|
-
## Use notes as an executive summary
|
|
812
|
-
|
|
813
|
-
After finishing a session, write a 3-bullet note: what did we decide, what code changed, what's unresolved. In 3 months you'll re-read that note in 30 seconds instead of scrolling 10,000 lines.
|
|
814
|
-
|
|
815
|
-
## Chain context re-injection with prelude
|
|
816
|
-
|
|
817
|
-
\`\`\`bash
|
|
818
|
-
recall context abc12345 \\
|
|
819
|
-
--prelude "This is context from last week. Continue from where we left off and help me finish the migration." \\
|
|
820
|
-
| claude
|
|
821
|
-
\`\`\`
|
|
822
|
-
|
|
823
|
-
The prelude instructs Claude about how to use the context — otherwise it might just summarize the transcript instead of continuing the work.
|
|
824
|
-
|
|
825
|
-
## Keep \`~/.recall/\` in a dotfiles repo
|
|
826
|
-
|
|
827
|
-
Commit your \`~/.recall/aliases.json\` and \`~/.recall/notes/\` to your dotfiles repo. Your session names and personal notes follow you across machines.
|
|
828
|
-
|
|
829
|
-
## Search for decisions, not just keywords
|
|
830
|
-
|
|
831
|
-
\`\`\`
|
|
832
|
-
recall search "decided"
|
|
833
|
-
recall search "final answer"
|
|
834
|
-
recall search "lets go with"
|
|
835
|
-
\`\`\`
|
|
836
|
-
|
|
837
|
-
You write these phrases when you commit to something. Searching for them surfaces the decision moments buried in long sessions.`},{id:`mcp`,title:`MCP server`,emoji:`🔌`,md:`# MCP server
|
|
838
|
-
|
|
839
|
-
New in **v0.5**. Expose Recall to Claude Desktop, Claude Code, or any other Model Context Protocol client so the model can search and pull in your past sessions natively — no copy-paste required.
|
|
840
|
-
|
|
841
|
-
## What it exposes
|
|
842
|
-
|
|
843
|
-
Six read-only tools (the server never writes):
|
|
844
|
-
|
|
845
|
-
| Tool | What it does |
|
|
846
|
-
|---|---|
|
|
847
|
-
| \`list_projects\` | Every indexed project with session + message counts |
|
|
848
|
-
| \`list_sessions\` | Recent sessions, optionally filtered by project / tag / date |
|
|
849
|
-
| \`list_tags\` | Every tag currently in use with counts |
|
|
850
|
-
| \`search\` | Full-text search; supports \`#tag-name\` tokens inline |
|
|
851
|
-
| \`get_session\` | Full transcript for a session (accepts 8+-char id prefix) |
|
|
852
|
-
| \`context_for_session\` | The moat: condensed or full markdown ready to paste as context |
|
|
853
|
-
|
|
854
|
-
## Claude Code
|
|
855
|
-
|
|
856
|
-
Add to \`~/.claude.json\` (or the equivalent per-project \`.mcp.json\`):
|
|
857
|
-
|
|
858
|
-
\`\`\`json
|
|
859
|
-
{
|
|
860
|
-
"mcpServers": {
|
|
861
|
-
"recall": {
|
|
862
|
-
"command": "claude-recall-mcp"
|
|
863
|
-
}
|
|
864
|
-
}
|
|
865
|
-
}
|
|
866
|
-
\`\`\`
|
|
867
|
-
|
|
868
|
-
If you installed via \`npm link\`, the \`claude-recall-mcp\` binary is on your PATH. Otherwise point \`command\` at the built entry: \`node\` + \`args: ["/abs/path/to/dist/mcp/server.js"]\`.
|
|
869
|
-
|
|
870
|
-
## Claude Desktop
|
|
871
|
-
|
|
872
|
-
Add the same block to \`~/Library/Application Support/Claude/claude_desktop_config.json\` (macOS) or the Windows equivalent, then restart Claude Desktop.
|
|
873
|
-
|
|
874
|
-
## Try it
|
|
875
|
-
|
|
876
|
-
Once wired in, ask the model:
|
|
877
|
-
|
|
878
|
-
- *"Search my past sessions for Hono server setup and show me what we decided."*
|
|
879
|
-
- *"Pull in the context from session abc12345 and continue from there."*
|
|
880
|
-
- *"What tags do I have?"*
|
|
881
|
-
|
|
882
|
-
## Local-only, always
|
|
883
|
-
|
|
884
|
-
The MCP server speaks stdio only — no network ports, no outbound calls. The same SQLite file and the same condensed-context formatter power it, so whatever the web UI shows, the MCP client sees.`},{id:`vscode`,title:`VS Code extension`,emoji:`🧩`,md:`# VS Code / Cursor / Windsurf extension (v0.7)
|
|
885
|
-
|
|
886
|
-
Automatically names Claude Code sessions with the terminal tab name you started them in.
|
|
887
|
-
|
|
888
|
-
## Install
|
|
889
|
-
|
|
890
|
-
**From the Marketplace (recommended):** search *Claude Recall* in the VS Code / Cursor / Windsurf Extensions panel and install \`clauderecallhq.clauderecall-vscode\`. Direct link: [marketplace.visualstudio.com/.../clauderecall-vscode](https://marketplace.visualstudio.com/items?itemName=clauderecallhq.clauderecall-vscode).
|
|
891
|
-
|
|
892
|
-
**Via the \`recall\` CLI (offline sideload):** ships the bundled \`.vsix\` into every editor CLI it detects on your PATH.
|
|
893
|
-
|
|
894
|
-
\`\`\`bash
|
|
895
|
-
recall install-extension # installs into every detected editor
|
|
896
|
-
recall install-extension --editor cursor
|
|
897
|
-
\`\`\`
|
|
898
|
-
|
|
899
|
-
**From a local build:**
|
|
900
|
-
|
|
901
|
-
\`\`\`bash
|
|
902
|
-
cd extensions/vscode
|
|
903
|
-
npm install
|
|
904
|
-
npm run build
|
|
905
|
-
npm run package # produces clauderecall-vscode-<version>.vsix
|
|
906
|
-
code --install-extension clauderecall-vscode-*.vsix
|
|
907
|
-
# Cursor: cursor --install-extension …
|
|
908
|
-
# Windsurf: windsurf --install-extension …
|
|
909
|
-
\`\`\`
|
|
910
|
-
|
|
911
|
-
Or via GUI: **Extensions → "..." menu → Install from VSIX**.
|
|
912
|
-
|
|
913
|
-
## Enable
|
|
914
|
-
|
|
915
|
-
VS Code settings (\`Cmd+,\`):
|
|
916
|
-
|
|
917
|
-
\`\`\`
|
|
918
|
-
claude-recall.autoAlias: true
|
|
919
|
-
\`\`\`
|
|
920
|
-
|
|
921
|
-
A \`⟳ Recall · N\` indicator appears in the status bar — that's the number of terminals it has registered with the local daemon.
|
|
922
|
-
|
|
923
|
-
## What it does
|
|
924
|
-
|
|
925
|
-
- Watches VS Code's own terminal events (\`onDidOpenTerminal\`, rename, close)
|
|
926
|
-
- POSTs \`{ shell_pid, tab_name, cwd, opened_at }\` to your local daemon on \`127.0.0.1:<port>\`
|
|
927
|
-
- Daemon correlates: when a new Claude Code JSONL appears, \`lsof\` → parent-shell PID → registered tab name → auto-alias
|
|
928
|
-
|
|
929
|
-
## What it does NOT do
|
|
930
|
-
|
|
931
|
-
- **Never** reads terminal buffer / output
|
|
932
|
-
- **Never** touches clipboard
|
|
933
|
-
- **Never** reads editor buffers or files
|
|
934
|
-
- **Never** makes outbound network calls — hardcoded to 127.0.0.1 / localhost only
|
|
935
|
-
|
|
936
|
-
Inspect the source at \`extensions/vscode/src/\` — no minified or bundled third-party code.
|
|
937
|
-
|
|
938
|
-
## Commands
|
|
939
|
-
|
|
940
|
-
| Palette entry | Purpose |
|
|
941
|
-
|---|---|
|
|
942
|
-
| Claude Recall: Show daemon status | Confirm the daemon is reachable |
|
|
943
|
-
| Claude Recall: Re-register all open terminals | Manual refresh if daemon restarted |
|
|
944
|
-
|
|
945
|
-
## Troubleshooting
|
|
946
|
-
|
|
947
|
-
- **Status bar shows \`⊘ Recall\`** — autoAlias is off in settings. Turn it on.
|
|
948
|
-
- **Status bar missing** — daemon isn't running. \`recall start\`.
|
|
949
|
-
- **Tab named X but session aliased differently** — a stale correlation. Run "Re-register all open terminals" from the palette.`},{id:`pricing`,title:`Pricing`,emoji:`💎`,md:`# Pricing
|
|
950
|
-
|
|
951
|
-
Honest, local-first pricing. One tier is free forever. One tier is a **one-time** purchase that works offline for life — even if we disappear. One tier is a monthly plan, but only for teams that want shared infrastructure.
|
|
952
|
-
|
|
953
|
-
## Free — \`$0\`
|
|
954
|
-
|
|
955
|
-
**Keep every session you've ever run, browsable forever.**
|
|
956
|
-
|
|
957
|
-
- Full indexing of every \`~/.claude/projects/\` JSONL — no cap on number of sessions
|
|
958
|
-
- CLI: \`recall list\`, \`recall show\`, \`recall projects\`, \`recall status\`
|
|
959
|
-
- Web UI: browse projects, read transcripts, per-code-block copy
|
|
960
|
-
- All your history preserved — three-layer durability (SQLite + plain-text mirror + source files untouched)
|
|
961
|
-
- No time limits. No feature expiry. No dark-pattern upsells.
|
|
962
|
-
|
|
963
|
-
## Pro — \`$29.69\` one-time
|
|
964
|
-
|
|
965
|
-
**Everything above, plus the features that make this a daily driver:**
|
|
966
|
-
|
|
967
|
-
| Feature | What it gives you |
|
|
968
|
-
|---|---|
|
|
969
|
-
| **Full-text search** | BM25-ranked hit results across every message in every session, in milliseconds |
|
|
970
|
-
| **\`recall context\` re-injection** | Pipe any past session into a new Claude Code conversation — the feature nobody else has |
|
|
971
|
-
| **MCP server** | Claude Desktop / Claude Code calls \`search\`, \`get_session\`, \`context_for_session\` as native tools |
|
|
972
|
-
| **VS Code / Cursor / Windsurf extension** | Auto-name sessions with your terminal tab name |
|
|
973
|
-
| **Organize** | Aliases, tags (\`#auth-fix\`), markdown notes, pins, date range filters, cross-session diff |
|
|
974
|
-
| **Export** | Clean markdown, self-contained dark-mode HTML, print-ready |
|
|
975
|
-
| **Virtualized transcript** | 10,000-message sessions open instantly |
|
|
976
|
-
| **Every personal-use feature we ever ship** | One price, all future updates for personal use included |
|
|
977
|
-
|
|
978
|
-
**Why one-time, not monthly?** Your data lives on your disk. There's no cloud server we have to run for you. Charging monthly for software that runs locally would be unfair. Pay once, use forever.
|
|
979
|
-
|
|
980
|
-
**The dead-man clause.** Your license key validates against our server exactly once — at activation. After that, Recall works offline forever. **If clauderecall.com ever disappears, every existing license stays valid.** We'll publish the validation secret if we ever shut down, so you're never stranded.
|
|
981
|
-
|
|
982
|
-
> Launch discount planned: **\`$19\`** for the first 1,000 Pro customers.
|
|
983
|
-
|
|
984
|
-
## Team — \`$9\` per seat / month (minimum 3 seats)
|
|
985
|
-
|
|
986
|
-
**For teams that want shared session memory across humans, not just machines.**
|
|
987
|
-
|
|
988
|
-
- Everything in Pro for every seat
|
|
989
|
-
- **Shared session library** with automatic secrets redaction before anyone else sees your sessions
|
|
990
|
-
- **Team-wide tags and naming conventions** — say \`#auth-fix\` means the same thing for everyone
|
|
991
|
-
- **Audit log** of who viewed which session (for compliance, not surveillance — the log lives on your team server, not ours)
|
|
992
|
-
- **Priority support** with 24h first-response SLA
|
|
993
|
-
- Future: SSO, per-project access control
|
|
994
|
-
|
|
995
|
-
The team tier is monthly because it requires an optional sync service we do have to run. The local-first core is unchanged — every teammate still has the full DB on their own laptop; team sync is additive, end-to-end encrypted, and opt-in per session.
|
|
996
|
-
|
|
997
|
-
## FAQ
|
|
998
|
-
|
|
999
|
-
### Can I upgrade from Free to Pro without losing data?
|
|
1000
|
-
Yes. Your \`~/.recall/\` directory is identical across tiers. Paying the license unlocks features; it doesn't migrate any data.
|
|
1001
|
-
|
|
1002
|
-
### What payment methods?
|
|
1003
|
-
Stripe + Apple Pay + Google Pay via LemonSqueezy (our Merchant of Record — they handle global tax so we don't have to). No crypto.
|
|
1004
|
-
|
|
1005
|
-
### Can I use one license on two machines?
|
|
1006
|
-
Yes — the license is per-user, not per-machine. Use it on your laptop + your desktop. Team tier has explicit seat counting.
|
|
1007
|
-
|
|
1008
|
-
### Refund policy?
|
|
1009
|
-
30 days, no questions asked. Email and we refund — no survey, no "are you sure" dialog.
|
|
1010
|
-
|
|
1011
|
-
### Is there an educational discount?
|
|
1012
|
-
Yes: **\`$9\`** for verified students and open-source maintainers (GitHub \`@\` with 100+ stars on any repo). Email after purchase, we refund the difference.
|
|
1013
|
-
|
|
1014
|
-
### What if Anthropic ships this natively in Claude Code?
|
|
1015
|
-
Three things:
|
|
1016
|
-
1. **Our moat isn't the indexing** — that's the easy part. It's the \`recall context\` re-injection, tags, notes, team sharing, cross-AI support, MCP server, and the fact that **your data stays local forever.**
|
|
1017
|
-
2. **Anthropic can't build the "even if we disappear" promise** — they're a cloud company.
|
|
1018
|
-
3. **If they do ship and it's better than ours, your Pro license still works offline forever** (dead-man clause). You lose nothing.
|
|
1019
|
-
|
|
1020
|
-
## Why this pricing works — the honest math
|
|
1021
|
-
|
|
1022
|
-
- **Free tier exists because indexing is cheap for us** (we don't run servers for it) and generous free tiers win adoption for developer tools. Raycast, Obsidian, TablePlus, Proxyman all proved this.
|
|
1023
|
-
- **\`$29.69\` Pro is priced against comparable one-time dev tools**: TablePlus \`$89\`, Proxyman \`$59\`, Dash \`$30\`, Tower annual \`$69\`. We're cheaper because search + context are the value — polish comes with updates over time.
|
|
1024
|
-
- **Team \`$9\`/seat** undercuts Notion (\`$10\`), Linear (\`$8–16\`), and most team dev tools. Fair share for the sync infrastructure we'd actually run.
|
|
1025
|
-
|
|
1026
|
-
## What we are NOT doing (on principle)
|
|
1027
|
-
|
|
1028
|
-
- **No subscription-only pricing for Pro.** Your software shouldn't expire when your card does.
|
|
1029
|
-
- **No feature gates that disable things you already used.** Upgrade = unlock, never lock-out.
|
|
1030
|
-
- **No anti-piracy DRM.** We respect you. The dead-man clause + one-time price model makes piracy unnecessary.
|
|
1031
|
-
- **No ads, upsells, or dark patterns in the product.**
|
|
1032
|
-
- **No selling your data.** We literally cannot — we don't have it.
|
|
1033
|
-
|
|
1034
|
-
Pricing last updated: April 2026. If this page changes, your existing license terms don't.`},{id:`faq`,title:`FAQ`,emoji:`💬`,md:`# FAQ
|
|
1035
|
-
|
|
1036
|
-
### Does any of my data leave my machine?
|
|
1037
|
-
|
|
1038
|
-
No. The daemon listens on \`127.0.0.1\` (localhost only) — never on a public interface. The only outbound request Recall will ever make is a one-time license-validation call when you activate a Pro key (optional, and not until v0.6).
|
|
1039
|
-
|
|
1040
|
-
### Can I use this if I'm offline?
|
|
1041
|
-
|
|
1042
|
-
Yes. Works on a plane, works behind firewalls, works on air-gapped machines. The browser talks to \`http://127.0.0.1\` — your own laptop.
|
|
1043
|
-
|
|
1044
|
-
### What happens if I delete \`~/.claude/projects/<something>.jsonl\`?
|
|
1045
|
-
|
|
1046
|
-
Our SQLite copy persists. We only *add* and *update*; we never delete session rows because the source file disappeared. Your indexed memory outlives the source JSONL files.
|
|
1047
|
-
|
|
1048
|
-
### Can I use this with Cursor / Cline / Windsurf?
|
|
1049
|
-
|
|
1050
|
-
Today: no, because those tools don't write to \`~/.claude/projects/\`. Future: adapters for each (v0.8+).
|
|
1051
|
-
|
|
1052
|
-
### Will Anthropic just ship this natively?
|
|
1053
|
-
|
|
1054
|
-
Maybe. If they do, our moat is: team sharing, redaction, cross-AI support, and the features they won't prioritize. Your aliases and notes stay yours regardless.
|
|
1055
|
-
|
|
1056
|
-
### How big does the database get?
|
|
1057
|
-
|
|
1058
|
-
~800 MB for 1,100+ sessions and 150,000 messages in our reference environment. Storage is cheap; this isn't a problem. Compression coming if it ever becomes one.
|
|
1059
|
-
|
|
1060
|
-
### Can I run multiple machines with the same index?
|
|
1061
|
-
|
|
1062
|
-
Not yet — each machine has its own \`~/.recall/db.sqlite\`. Team sync is on the roadmap (opt-in, end-to-end encrypted, and still local-first).
|
|
1063
|
-
|
|
1064
|
-
### What's the license model?
|
|
1065
|
-
|
|
1066
|
-
Free tier: index, list, show, search, basic browsing. Pro tier ($29.69 one-time, planned for v0.6): the full web UI, context re-injection, MCP server, advanced search. License key validates once, then offline forever. Dead-man clause: if our servers disappear, existing keys stay valid.`},{id:`semantic-vectors`,title:`Semantic vector search`,emoji:`🧠`,md:`# Semantic vector search
|
|
1067
|
-
|
|
1068
|
-
New in **v0.7** (Pro). On-device semantic embeddings that find sessions by meaning, not just keywords.
|
|
1069
|
-
|
|
1070
|
-
## What it solves
|
|
1071
|
-
|
|
1072
|
-
Keyword search fails when your query uses different words than the session content. "How do I expire user logins" won't match a session about "JWT refresh rotation" because there is zero keyword overlap. Semantic vectors close this gap.
|
|
1073
|
-
|
|
1074
|
-
## How it works
|
|
1075
|
-
|
|
1076
|
-
1. Every conversation turn is chunked (3-5 messages) and embedded into a 768-dimension vector using \`bge-base-en-v1.5\`, a local ONNX model running on your CPU.
|
|
1077
|
-
2. Queries are embedded with the same model.
|
|
1078
|
-
3. Results from three search lanes are fused using Reciprocal Rank Fusion (RRF, k=60):
|
|
1079
|
-
- **Lane 1:** BM25 full-text search over messages (FTS5)
|
|
1080
|
-
- **Lane 2:** FTS5 over session summaries
|
|
1081
|
-
- **Lane 3:** Cosine kNN over vector chunks (sqlite-vec)
|
|
1082
|
-
|
|
1083
|
-
The fused ranking is automatic when semantic search is active.
|
|
1084
|
-
|
|
1085
|
-
## Setup
|
|
1086
|
-
|
|
1087
|
-
1. Activate a Pro license.
|
|
1088
|
-
2. Install the embedding model:
|
|
1089
|
-
|
|
1090
|
-
\`\`\`bash
|
|
1091
|
-
recall semantic install
|
|
1092
|
-
\`\`\`
|
|
1093
|
-
|
|
1094
|
-
This downloads ~110MB once to \`~/.recall/models/bge-base-en-v1.5/\`. Background embedding starts automatically.
|
|
1095
|
-
|
|
1096
|
-
3. Check status:
|
|
1097
|
-
|
|
1098
|
-
\`\`\`bash
|
|
1099
|
-
recall semantic status
|
|
1100
|
-
\`\`\`
|
|
1101
|
-
|
|
1102
|
-
## CLI commands
|
|
1103
|
-
|
|
1104
|
-
\`\`\`bash
|
|
1105
|
-
recall search "expire user logins" # auto-fuses all three lanes on Pro
|
|
1106
|
-
recall search "expire user logins" --no-semantic # BM25-only fallback
|
|
1107
|
-
recall similar abc12345 # find sessions similar to this one
|
|
1108
|
-
recall semantic install # download the embedding model (~110MB)
|
|
1109
|
-
recall semantic status # model + queue health
|
|
1110
|
-
recall semantic reindex # re-embed everything (rarely needed)
|
|
1111
|
-
recall semantic uninstall # remove model files, free disk
|
|
1112
|
-
\`\`\`
|
|
1113
|
-
|
|
1114
|
-
## MCP tools
|
|
1115
|
-
|
|
1116
|
-
| Tool | What it does |
|
|
1117
|
-
|---|---|
|
|
1118
|
-
| \`search\` (existing) | Automatically gains three-lane vector fusion on Pro. No schema change. |
|
|
1119
|
-
| \`find_similar_sessions\` | Cosine-ranked related sessions. Pro only; returns upgrade CTA on Free. |
|
|
1120
|
-
| \`semantic_status\` | Model health snapshot for agent orchestration. |
|
|
1121
|
-
|
|
1122
|
-
## HTTP endpoints
|
|
1123
|
-
|
|
1124
|
-
| Endpoint | What it does |
|
|
1125
|
-
|---|---|
|
|
1126
|
-
| \`GET /api/semantic/status\` | Model ID, dimension, chunk count, queue depth, license state |
|
|
1127
|
-
| \`POST /api/semantic/install\` | Kick off background model download |
|
|
1128
|
-
| \`GET /api/sessions/:id/similar?limit=N\` | Cosine-ranked related sessions |
|
|
1129
|
-
|
|
1130
|
-
## Privacy
|
|
1131
|
-
|
|
1132
|
-
- The embedding model runs entirely on your device. No cloud API calls, ever.
|
|
1133
|
-
- No data leaves your machine. Same local-first posture as everything else in Recall.
|
|
1134
|
-
- Vectors are a derived cache. If lost, they recompute from your original messages.
|
|
1135
|
-
|
|
1136
|
-
## FAQ
|
|
1137
|
-
|
|
1138
|
-
### Is my code sent anywhere?
|
|
1139
|
-
|
|
1140
|
-
No. The model runs locally on your CPU.
|
|
1141
|
-
|
|
1142
|
-
### What does the model cost?
|
|
1143
|
-
|
|
1144
|
-
Zero ongoing. One ~110MB download, no API fees, no token charges.
|
|
1145
|
-
|
|
1146
|
-
### Can I use semantic search on Free tier?
|
|
1147
|
-
|
|
1148
|
-
No. Semantic search is Pro only. Free tier keeps full BM25 keyword search.
|
|
1149
|
-
|
|
1150
|
-
### What happens if I delete the model?
|
|
1151
|
-
|
|
1152
|
-
Graceful fallback to keyword search. Re-download anytime via \`recall semantic install\`.
|
|
1153
|
-
|
|
1154
|
-
### Does it work in languages other than English?
|
|
1155
|
-
|
|
1156
|
-
The current model (\`bge-base-en-v1.5\`) is English-optimized. Multilingual support is planned for a future release.`},{id:`troubleshoot`,title:`Troubleshooting`,emoji:`🛠`,md:`# Troubleshooting
|
|
1157
|
-
|
|
1158
|
-
## Daemon won't start
|
|
1159
|
-
|
|
1160
|
-
\`\`\`bash
|
|
1161
|
-
cat ~/.recall/daemon.log | tail -50
|
|
1162
|
-
\`\`\`
|
|
1163
|
-
|
|
1164
|
-
Common causes:
|
|
1165
|
-
- **Port conflict** — rare because we pick a free ephemeral port, but if something's broken, try \`recall stop && recall start\`
|
|
1166
|
-
- **SQLite lock** — leftover \`.sqlite-wal\` / \`.sqlite-shm\` files. Safe to delete when the daemon is stopped
|
|
1167
|
-
|
|
1168
|
-
## Browser opens but page is blank
|
|
1169
|
-
|
|
1170
|
-
- Check devtools console for errors
|
|
1171
|
-
- \`recall stop && recall start\` to bounce the daemon
|
|
1172
|
-
- Hard-refresh (Cmd+Shift+R / Ctrl+Shift+R)
|
|
1173
|
-
|
|
1174
|
-
## Search returns nothing for a term I know exists
|
|
1175
|
-
|
|
1176
|
-
- Terms shorter than 2 chars are ignored (they produce garbage)
|
|
1177
|
-
- FTS5 uses porter stemming — "running" matches "run" but quoted exact phrases don't stem
|
|
1178
|
-
- Try reindexing: \`recall index --force\`
|
|
1179
|
-
|
|
1180
|
-
## "Empty" assistant messages in older sessions
|
|
1181
|
-
|
|
1182
|
-
If you indexed before v0.4.0 and see lots of empty assistant messages, reindex:
|
|
1183
|
-
|
|
1184
|
-
\`\`\`bash
|
|
1185
|
-
recall index --force
|
|
1186
|
-
\`\`\`
|
|
1187
|
-
|
|
1188
|
-
The v0.4.0 parser captures tool calls as inline markdown — the old indexer dropped them.
|
|
1189
|
-
|
|
1190
|
-
## Want to start completely fresh
|
|
1191
|
-
|
|
1192
|
-
\`\`\`bash
|
|
1193
|
-
recall stop
|
|
1194
|
-
rm -rf ~/.recall
|
|
1195
|
-
recall start
|
|
1196
|
-
recall index
|
|
1197
|
-
\`\`\`
|
|
1198
|
-
|
|
1199
|
-
This wipes aliases, notes, pins, the database. Only do this if you want a truly clean slate — there's no undo.`}];Y.setOptions({gfm:!0,breaks:!1});function mc(e){return e.replace(/<pre><code(?:\s+class="language-([^"]+)")?>([\s\S]*?)<\/code><\/pre>/g,(e,t,n)=>{let r=n.replace(/</g,`<`).replace(/>/g,`>`).replace(/"/g,`"`).replace(/'/g,`'`).replace(/&/g,`&`);try{let e=t&&ds.getLanguage(t)?ds.highlight(r,{language:t,ignoreIllegals:!0}):ds.highlightAuto(r);return`<pre><code class="hljs language-${e.language??`plaintext`}">${e.value}</code></pre>`}catch{return`<pre><code class="hljs">${n}</code></pre>`}})}function hc({initialSectionId:e,onClose:t,onSectionChange:n,onReplayOnboarding:r,onReplayThreadsIntro:i}){let a=pc[0].id,[o,s]=(0,R.useState)(()=>e&&pc.some(t=>t.id===e)?e:a),c=(0,R.useRef)(null),l=(0,R.useRef)(n);(0,R.useEffect)(()=>{l.current=n}),(0,R.useEffect)(()=>{e&&pc.some(t=>t.id===e)&&s(e)},[e]),(0,R.useEffect)(()=>{let e=e=>{if(e.key===`Escape`){let n=e.target;if(n&&(n.tagName===`INPUT`||n.tagName===`TEXTAREA`||n.isContentEditable))return;t()}};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[t]),(0,R.useEffect)(()=>{c.current&&(c.current.scrollTop=0),l.current?.(o)},[o]);let u=(0,R.useMemo)(()=>{let e={};for(let t of pc){let n=Y.parse(t.md,{async:!1});e[t.id]=mc(n)}return e},[]);return(0,z.jsxs)(`div`,{className:`absolute inset-0 bg-bg flex flex-col z-20`,children:[(0,z.jsxs)(`div`,{className:`flex items-center justify-between px-5 py-3 border-b border-line bg-bg shrink-0`,children:[(0,z.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[(0,z.jsx)(`img`,{src:Ct,alt:``,className:`h-7 w-7 rounded-md shrink-0`}),(0,z.jsxs)(`div`,{children:[(0,z.jsxs)(`div`,{className:`leading-none flex items-center gap-1.5`,children:[(0,z.jsx)(`img`,{src:fc,alt:`Claude Recall`,className:`h-4 w-auto`}),(0,z.jsx)(`span`,{className:`text-sm font-semibold text-fg-dim`,children:`· Command Center`})]}),(0,z.jsx)(`div`,{className:`text-xs text-fg-muted mt-1`,children:`Everything you need to drive the product like a pro.`})]})]}),(0,z.jsx)(`button`,{type:`button`,onClick:t,className:`text-xs text-fg-dim hover:text-fg border border-line rounded px-3 py-1.5`,title:`close command center (Esc)`,children:`← back to sessions`})]}),(0,z.jsxs)(`div`,{className:`flex flex-1 min-h-0`,children:[(0,z.jsxs)(`aside`,{className:`w-64 shrink-0 border-r border-line bg-bg-elevated overflow-y-auto flex flex-col`,children:[(0,z.jsx)(`nav`,{className:`py-4 flex-1`,children:pc.map(e=>(0,z.jsxs)(`button`,{type:`button`,onClick:()=>s(e.id),className:K(`w-full text-left px-5 py-2.5 text-sm flex items-center gap-2.5 transition-colors`,o===e.id?`bg-bg-active text-fg border-l-2 border-l-accent font-medium`:`text-fg-dim hover:bg-bg-hover hover:text-fg border-l-2 border-l-transparent`),children:[(0,z.jsx)(`span`,{className:`w-4 text-center`,children:e.emoji}),(0,z.jsx)(`span`,{children:e.title})]},e.id))}),(r||i)&&(0,z.jsxs)(`div`,{className:`border-t border-line px-5 py-4 space-y-2`,children:[(0,z.jsx)(`div`,{className:`text-[10px] uppercase tracking-widest text-fg-dim`,children:`Replay tours`}),r&&(0,z.jsxs)(`button`,{type:`button`,onClick:r,className:`w-full text-left text-xs text-fg-muted hover:text-fg flex items-center gap-2`,title:`Play the 3-step first-run tour again`,children:[(0,z.jsx)(`span`,{"aria-hidden":`true`,children:`↺`}),(0,z.jsx)(`span`,{children:`Replay first-run tour`})]}),i&&(0,z.jsxs)(`button`,{type:`button`,onClick:i,className:`w-full text-left text-xs text-fg-muted hover:text-fg flex items-center gap-2`,title:`Play the 3-step Threads explainer again`,children:[(0,z.jsx)(`span`,{"aria-hidden":`true`,children:`🧵`}),(0,z.jsx)(`span`,{children:`Replay threads tour`})]})]})]}),(0,z.jsx)(`main`,{ref:c,className:`flex-1 overflow-y-auto`,children:(0,z.jsxs)(`div`,{className:`max-w-3xl mx-auto px-10 py-10`,children:[o===`taxonomy`&&(0,z.jsx)(Sc,{}),o===`security`&&(0,z.jsx)(_c,{}),(0,z.jsx)(`article`,{className:`prose-message prose-help`,dangerouslySetInnerHTML:{__html:u[o]}}),(0,z.jsxs)(`div`,{className:`mt-12 pt-6 border-t border-line flex items-center justify-between text-xs text-fg-muted`,children:[(0,z.jsxs)(`div`,{children:[`Section`,` `,(0,z.jsx)(`span`,{className:`text-fg font-medium`,children:pc.findIndex(e=>e.id===o)+1}),` `,`of `,pc.length]}),(0,z.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,z.jsx)(gc,{active:o,direction:-1,onJump:e=>s(e),label:`← prev`}),(0,z.jsx)(gc,{active:o,direction:1,onJump:e=>s(e),label:`next →`})]})]})]})})]})]})}function gc({active:e,direction:t,onJump:n,label:r}){let i=pc[pc.findIndex(t=>t.id===e)+t];return i?(0,z.jsxs)(`button`,{type:`button`,onClick:()=>n(i.id),className:`text-fg-dim hover:text-fg`,children:[r,` `,i.title]}):(0,z.jsx)(`span`,{className:`text-fg-muted opacity-30`,children:r})}function _c(){return(0,z.jsxs)(`div`,{className:`mb-10 space-y-6`,children:[(0,z.jsxs)(`div`,{className:`relative overflow-hidden rounded-xl border border-line bg-gradient-to-br from-bg-elevated via-bg to-bg-elevated p-8 animate-[fadeInUp_0.5s_ease-out]`,children:[(0,z.jsx)(`div`,{className:`absolute -right-10 -top-10 h-40 w-40 rounded-full bg-accent/5 blur-3xl`}),(0,z.jsx)(`div`,{className:`absolute -left-6 -bottom-6 h-32 w-32 rounded-full bg-accent/10 blur-2xl`}),(0,z.jsxs)(`div`,{className:`relative flex items-start gap-5`,children:[(0,z.jsx)(`div`,{className:`shrink-0 h-14 w-14 rounded-xl bg-accent/15 flex items-center justify-center text-3xl`,children:`🛡️`}),(0,z.jsxs)(`div`,{children:[(0,z.jsx)(`div`,{className:`text-xs uppercase tracking-widest text-accent font-semibold mb-1`,children:`Tier-1 local-first security`}),(0,z.jsx)(`h2`,{className:`text-2xl font-bold text-fg m-0`,children:`Your Claude conversations never leave your computer.`}),(0,z.jsx)(`p`,{className:`text-sm text-fg-dim mt-2 m-0`,children:`No cloud. No telemetry. No account. Recall runs entirely on your laptop — even we can't see your sessions.`})]})]})]}),(0,z.jsx)(`div`,{className:`grid grid-cols-2 md:grid-cols-4 gap-3`,children:vc.map((e,t)=>(0,z.jsxs)(`div`,{className:`rounded-lg border border-line bg-bg-elevated p-4 hover:border-accent/40 hover:-translate-y-0.5 transition-all animate-[fadeInUp_0.5s_ease-out_both]`,style:{animationDelay:`${120+t*80}ms`},children:[(0,z.jsx)(`div`,{className:`text-2xl mb-2`,children:e.icon}),(0,z.jsx)(`div`,{className:`text-xs font-semibold text-fg`,children:e.label}),(0,z.jsx)(`div`,{className:`text-[11px] text-fg-muted mt-1 leading-snug`,children:e.sub})]},e.label))}),(0,z.jsxs)(`div`,{className:`rounded-xl border border-line bg-bg-elevated p-6 animate-[fadeInUp_0.5s_ease-out_500ms_both]`,children:[(0,z.jsx)(`div`,{className:`text-xs uppercase tracking-widest text-fg-muted font-semibold mb-4`,children:`How we block every known attack path`}),(0,z.jsx)(bc,{})]}),(0,z.jsx)(`div`,{className:`grid grid-cols-2 md:grid-cols-4 gap-3`,children:yc.map((e,t)=>(0,z.jsxs)(`div`,{className:`rounded-lg border border-line bg-bg-elevated p-4 text-center animate-[fadeInUp_0.5s_ease-out_both]`,style:{animationDelay:`${700+t*80}ms`},children:[(0,z.jsx)(`div`,{className:`text-2xl font-bold text-accent`,children:e.value}),(0,z.jsx)(`div`,{className:`text-[11px] uppercase tracking-wider text-fg-muted mt-1`,children:e.label})]},e.label))})]})}var vc=[{icon:`🏠`,label:`100% on-device`,sub:`Nothing uploads, ever`},{icon:`📡`,label:`Zero telemetry`,sub:`No analytics or tracking`},{icon:`🔐`,label:`Auto-redact secrets`,sub:`Keys scrubbed at ingest + paste`},{icon:`🧱`,label:`3-layer defense`,sub:`Host, Origin, CSP enforced`}],yc=[{value:`0`,label:`Servers we run`},{value:`0`,label:`Outbound calls`},{value:`127.0.0.1`,label:`Only reachable from`},{value:`3×`,label:`Layered rebinding defense`}];function bc(){return(0,z.jsxs)(`svg`,{viewBox:`0 0 640 180`,className:`w-full h-auto`,role:`img`,"aria-label":`Defense diagram`,children:[(0,z.jsxs)(`g`,{children:[(0,z.jsx)(`rect`,{x:`10`,y:`60`,width:`110`,height:`60`,rx:`8`,className:`fill-red-500/10 stroke-red-500/40`,strokeWidth:`1`}),(0,z.jsx)(`text`,{x:`65`,y:`85`,textAnchor:`middle`,className:`fill-red-400`,fontSize:`11`,fontWeight:`600`,children:`Malicious`}),(0,z.jsx)(`text`,{x:`65`,y:`102`,textAnchor:`middle`,className:`fill-red-400`,fontSize:`11`,fontWeight:`600`,children:`website`})]}),(0,z.jsx)(`line`,{x1:`120`,y1:`90`,x2:`155`,y2:`90`,className:`stroke-red-500/40`,strokeWidth:`2`,strokeDasharray:`4 3`}),(0,z.jsx)(xc,{x:160,label:`Host`,sub:`allowlist`,delay:`0s`}),(0,z.jsx)(xc,{x:280,label:`Origin`,sub:`check`,delay:`0.3s`}),(0,z.jsx)(xc,{x:400,label:`CSP`,sub:`+ sanitize`,delay:`0.6s`}),(0,z.jsxs)(`g`,{transform:`translate(510, 90)`,children:[(0,z.jsx)(`circle`,{r:`18`,className:`fill-red-500/15 stroke-red-500/50`,strokeWidth:`1.5`}),(0,z.jsx)(`text`,{y:`5`,textAnchor:`middle`,className:`fill-red-400`,fontSize:`18`,fontWeight:`700`,children:`✕`})]}),(0,z.jsxs)(`g`,{children:[(0,z.jsx)(`rect`,{x:`540`,y:`60`,width:`90`,height:`60`,rx:`8`,className:`fill-accent/10 stroke-accent/50`,strokeWidth:`1`}),(0,z.jsx)(`text`,{x:`585`,y:`85`,textAnchor:`middle`,className:`fill-accent`,fontSize:`11`,fontWeight:`600`,children:`Your`}),(0,z.jsx)(`text`,{x:`585`,y:`102`,textAnchor:`middle`,className:`fill-accent`,fontSize:`11`,fontWeight:`600`,children:`sessions`})]}),(0,z.jsx)(`text`,{x:`320`,y:`155`,textAnchor:`middle`,className:`fill-fg-muted`,fontSize:`10`,children:`Every request must pass all three layers. Any failure = instant 403.`})]})}function xc({x:e,label:t,sub:n,delay:r}){return(0,z.jsxs)(`g`,{transform:`translate(${e}, 55)`,style:{animation:`shieldPulse 2.4s ease-in-out ${r} infinite`},children:[(0,z.jsx)(`path`,{d:`M 35 0 L 70 12 L 70 42 Q 70 62 35 72 Q 0 62 0 42 L 0 12 Z`,className:`fill-accent/10 stroke-accent/60`,strokeWidth:`1.5`}),(0,z.jsx)(`text`,{x:`35`,y:`32`,textAnchor:`middle`,className:`fill-accent`,fontSize:`11`,fontWeight:`700`,children:t}),(0,z.jsx)(`text`,{x:`35`,y:`48`,textAnchor:`middle`,className:`fill-fg-muted`,fontSize:`9`,children:n})]})}function Sc(){return(0,z.jsx)(`div`,{className:`mb-10`,children:(0,z.jsxs)(`div`,{className:`rounded-xl border border-line bg-bg-elevated p-6`,children:[(0,z.jsx)(`div`,{className:`text-xs uppercase tracking-widest text-fg-muted font-semibold mb-4`,children:`Session is the atom. Everything else attaches to it.`}),(0,z.jsx)(Cc,{})]})})}function Cc(){let e=[{angle:-90,label:`Project`,sub:`auto · one`,emoji:`📁`},{angle:-30,label:`Tag`,sub:`manual · many`,emoji:`🏷️`},{angle:30,label:`Collection`,sub:`manual · tree`,emoji:`📂`},{angle:90,label:`Note`,sub:`manual · one`,emoji:`📝`},{angle:150,label:`Pin`,sub:`manual · ★`,emoji:`⭐`},{angle:210,label:`Alias`,sub:`manual · one`,emoji:`✎`}];return(0,z.jsxs)(`svg`,{viewBox:`0 0 640 360`,className:`w-full h-auto`,role:`img`,"aria-label":`Taxonomy diagram: Session at the center with six attached concepts (Project, Tag, Collection, Note, Pin, Alias)`,children:[(0,z.jsx)(`defs`,{children:(0,z.jsx)(`marker`,{id:`taxonomy-arrow`,viewBox:`0 0 10 10`,refX:`8`,refY:`5`,markerWidth:`6`,markerHeight:`6`,orient:`auto-start-reverse`,children:(0,z.jsx)(`path`,{d:`M 0 0 L 10 5 L 0 10 z`,className:`fill-accent/50`})})}),e.map(e=>{let t=e.angle*Math.PI/180;return(0,z.jsx)(`line`,{x1:320+70*Math.cos(t),y1:180+26*Math.sin(t),x2:320+82*Math.cos(t),y2:180+108*Math.sin(t),className:`stroke-accent/40`,strokeWidth:`1.5`,markerEnd:`url(#taxonomy-arrow)`},`line-${e.label}`)}),(0,z.jsxs)(`g`,{children:[(0,z.jsx)(`rect`,{x:248,y:152,width:`144`,height:`56`,rx:`10`,className:`fill-accent/15 stroke-accent`,strokeWidth:`1.5`}),(0,z.jsx)(`text`,{x:320,y:176,textAnchor:`middle`,className:`fill-accent`,fontSize:`14`,fontWeight:`700`,children:`Session`}),(0,z.jsx)(`text`,{x:320,y:194,textAnchor:`middle`,className:`fill-fg-muted`,fontSize:`10`,children:`one conversation · immutable UUID`})]}),e.map(e=>{let t=e.angle*Math.PI/180,n=320+130*Math.cos(t),r=180+130*Math.sin(t);return(0,z.jsxs)(`g`,{transform:`translate(${n-56}, ${r-22})`,children:[(0,z.jsx)(`rect`,{width:`112`,height:`44`,rx:`8`,className:`fill-bg stroke-accent/50`,strokeWidth:`1`}),(0,z.jsxs)(`text`,{x:`56`,y:`19`,textAnchor:`middle`,className:`fill-fg`,fontSize:`12`,fontWeight:`600`,children:[(0,z.jsxs)(`tspan`,{children:[e.emoji,` `]}),(0,z.jsx)(`tspan`,{children:e.label})]}),(0,z.jsx)(`text`,{x:`56`,y:`33`,textAnchor:`middle`,className:`fill-fg-muted`,fontSize:`9`,children:e.sub})]},e.label)})]})}var wc={"cwd-prefix":`Folder path`,"project-id":`Project`,tag:`Tag`,"plan-file":`Plan file`,"git-branch-prefix":`Git branch`},Tc={"cwd-prefix":`Match sessions whose working directory starts with this path.`,"project-id":`Match every session under a specific Claude Code project (by its internal id).`,tag:`Match sessions that carry this tag.`,"plan-file":`Match sessions that reference this plan/doc filename in their transcript.`,"git-branch-prefix":`Match sessions authored on git branches starting with this prefix.`};function Ec(){let e=$t(),t=en(),n=cn(),r=e.data?.rules??[],i=t.data?.suggestions??[];return(0,z.jsxs)(`div`,{className:`max-w-3xl mx-auto p-6 space-y-8`,children:[(0,z.jsxs)(`header`,{className:`space-y-2`,children:[(0,z.jsx)(`h1`,{className:`text-xl font-semibold`,children:`Auto-collections`}),(0,z.jsx)(`p`,{className:`text-sm text-fg-muted`,children:`Auto-collections group your Claude Code sessions into folders automatically, based on a rule you accept. One click on a suggestion turns into a live folder in the left sidebar that keeps itself populated forever.`}),(0,z.jsxs)(`div`,{className:`rounded border border-line bg-bg-elevated p-3 text-xs text-fg-muted space-y-2`,children:[(0,z.jsx)(`div`,{className:`font-medium text-fg text-sm`,children:`Three common rule shapes`}),(0,z.jsxs)(`ul`,{className:`space-y-1.5`,children:[(0,z.jsxs)(`li`,{children:[(0,z.jsx)(`span`,{className:`font-mono text-fg`,children:`Tag`}),` #bugfix →`,(0,z.jsx)(`span`,{className:`text-fg`,children:` folder named "bugfix"`}),` that collects every session you tag #bugfix, forever.`]}),(0,z.jsxs)(`li`,{children:[(0,z.jsx)(`span`,{className:`font-mono text-fg`,children:`Folder path`}),` /Users/you/code/monorepo/packages/web →`,(0,z.jsx)(`span`,{className:`text-fg`,children:` folder named "web"`}),` that collects only the monorepo subfolder sessions, separate from the rest of the repo.`]}),(0,z.jsxs)(`li`,{children:[(0,z.jsx)(`span`,{className:`font-mono text-fg`,children:`Plan file`}),` ROADMAP.md →`,(0,z.jsx)(`span`,{className:`text-fg`,children:` folder named "ROADMAP.md"`}),`that collects every session whose transcript mentions that file. Lets you thread planning across repos.`]})]}),(0,z.jsx)(`div`,{className:`border-t border-line pt-2`,children:`Manually added sessions are never removed. Deleting a rule only removes the rows the rule itself added.`})]})]}),(0,z.jsxs)(`section`,{className:`space-y-3`,children:[(0,z.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,z.jsx)(`h2`,{className:`text-sm font-semibold uppercase tracking-wider text-fg-muted`,children:`Pending suggestions`}),(0,z.jsx)(`button`,{type:`button`,onClick:()=>n.mutate(),disabled:n.isPending,className:`text-xs text-accent hover:underline disabled:opacity-50`,title:`Re-scan your sessions right now to surface fresh grouping suggestions.`,children:n.isPending?`scanning…`:`scan now`})]}),i.length===0?(0,z.jsx)(`div`,{className:`text-xs text-fg-muted italic`,children:`No pending suggestions. New clusters will appear after the next scan.`}):(0,z.jsx)(`ul`,{className:`border border-line rounded divide-y divide-line`,children:i.map(e=>(0,z.jsx)(Dc,{suggestion:e},e.id))})]}),(0,z.jsxs)(`section`,{className:`space-y-3`,children:[(0,z.jsx)(`h2`,{className:`text-sm font-semibold uppercase tracking-wider text-fg-muted`,children:`Active rules`}),r.length===0?(0,z.jsx)(`div`,{className:`text-xs text-fg-muted italic`,children:`No active rules yet. Accept a suggestion above or add one below.`}):(0,z.jsx)(`ul`,{className:`border border-line rounded divide-y divide-line`,children:r.map(e=>(0,z.jsx)(kc,{rule:e},e.id))})]}),(0,z.jsx)(Ac,{})]})}function Dc({suggestion:e}){let t=on(),n=sn(),[,r]=Pt(),[i,a]=(0,R.useState)(!1),o=ln(e.id,i),s=e.suggested_name||e.pattern,c=e.session_count,l=`${c} ${c===1?`session`:`sessions`}`,u=e=>r({session:e,view:null,col:null,project:null});return(0,z.jsxs)(`li`,{className:`px-3 py-2 text-sm space-y-1.5`,children:[(0,z.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,z.jsx)(`span`,{className:`text-[10px] font-medium uppercase tracking-wider text-fg-muted w-20 shrink-0`,title:Tc[e.type],children:wc[e.type]}),(0,z.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,z.jsx)(`div`,{className:`truncate font-medium`,title:s,children:s}),(0,z.jsx)(`div`,{className:`truncate text-[11px] text-fg-muted font-mono`,title:e.pattern,children:e.pattern})]}),(0,z.jsx)(`span`,{className:`text-xs text-fg-muted shrink-0`,children:l}),(0,z.jsx)(`button`,{type:`button`,onClick:()=>t.mutate(e.id),disabled:t.isPending,className:`px-2 py-1 rounded bg-accent text-bg text-xs font-medium disabled:opacity-50`,title:`Turn this suggestion into an active rule and create the matching sidebar folder.`,children:`Accept`}),(0,z.jsx)(`button`,{type:`button`,onClick:()=>n.mutate(e.id),disabled:n.isPending,className:`px-2 py-1 rounded border border-line text-xs hover:bg-bg-hover disabled:opacity-50`,title:`Hide this suggestion so the scanner stops proposing it.`,children:`Dismiss`})]}),(0,z.jsx)(`p`,{className:`text-xs text-fg-muted pl-[calc(5rem+0.75rem)]`,children:Oc(e)}),(0,z.jsxs)(`div`,{className:`pl-[calc(5rem+0.75rem)]`,children:[(0,z.jsx)(`button`,{type:`button`,onClick:()=>a(e=>!e),className:`text-[11px] text-accent hover:underline`,"aria-expanded":i,title:`Preview a handful of sessions that this rule would pull in before you accept it.`,children:i?`Hide example sessions`:`See ${Math.min(3,c)} example session${c===1?``:`s`} that will join`}),i&&(0,z.jsxs)(`ul`,{className:`mt-1 space-y-0.5 text-[11px]`,children:[o.isLoading&&(0,z.jsx)(`li`,{className:`text-fg-muted italic`,children:`Loading…`}),o.data?.sessions.map(e=>(0,z.jsx)(`li`,{children:(0,z.jsxs)(`button`,{type:`button`,onClick:()=>u(e.id),className:`w-full text-left flex items-center gap-2 px-1 py-0.5 rounded hover:bg-accent/10 hover:text-accent`,title:`Open session: ${e.title}`,children:[(0,z.jsx)(`span`,{className:`text-fg-muted shrink-0`,children:`→`}),(0,z.jsx)(`span`,{className:`truncate flex-1`,children:e.title}),e.started_at&&(0,z.jsx)(`span`,{className:`text-fg-muted shrink-0`,children:new Date(e.started_at).toLocaleDateString()})]})},e.id)),o.data&&o.data.sessions.length===0&&(0,z.jsx)(`li`,{className:`text-fg-muted italic`,children:`No sessions currently match (may have been dismissed).`})]})]})]})}function Oc(e){let t=e.suggested_name||e.pattern,n=e.session_count,r=n===1?`session`:`sessions`;switch(e.type){case`cwd-prefix`:return`Creates a folder "${t}" in the sidebar grouping the ${n} ${r} whose working directory is (or is inside) "${e.pattern}". Every future session recorded under that path joins automatically.`;case`project-id`:return`Creates a folder "${t}" grouping every session from the Claude Code project with id ${e.pattern}. Current match: ${n} ${r}.`;case`tag`:return`Creates a folder "${t}" grouping every session tagged #${e.pattern}. Current match: ${n} ${r}. Any future session tagged the same way joins automatically.`;case`plan-file`:return`Creates a folder "${t}" grouping every session whose transcript references "${e.pattern}". Current match: ${n} ${r}.`;case`git-branch-prefix`:return`Creates a folder "${t}" grouping every session whose git branch starts with "${e.pattern}". Current match: ${n} ${r}.`}}function kc({rule:e}){let t=rn(),n=an(),[r,i]=(0,R.useState)(!1),[a,o]=(0,R.useState)(e.pattern),s=()=>{if(a===e.pattern){i(!1);return}t.mutate({id:e.id,patch:{pattern:a}},{onSuccess:()=>i(!1)})};return(0,z.jsxs)(`li`,{className:`flex items-center gap-3 px-3 py-2 text-sm`,children:[(0,z.jsx)(`label`,{className:`flex items-center gap-2 shrink-0`,title:`enable / disable`,children:(0,z.jsx)(`input`,{type:`checkbox`,checked:e.enabled,onChange:n=>t.mutate({id:e.id,patch:{enabled:n.target.checked}})})}),(0,z.jsx)(`span`,{className:`text-xs text-fg-muted w-28 shrink-0`,title:Tc[e.type],children:wc[e.type]}),r?(0,z.jsx)(`input`,{className:`min-w-0 flex-1 px-2 py-1 bg-bg-elevated border border-line rounded text-xs font-mono`,value:a,onChange:e=>o(e.target.value),onKeyDown:t=>{t.key===`Enter`&&s(),t.key===`Escape`&&(o(e.pattern),i(!1))},autoFocus:!0}):(0,z.jsx)(`button`,{type:`button`,onClick:()=>i(!0),className:`min-w-0 flex-1 text-left font-mono text-xs truncate hover:text-accent`,title:`click to edit pattern`,children:e.pattern}),(0,z.jsx)(`span`,{className:K(`text-[10px] uppercase px-1.5 py-0.5 rounded-full shrink-0`,e.created_by===`suggestion-accepted`?`bg-role-tool/15 text-role-tool`:`bg-bg-hover text-fg-muted`),title:e.created_by===`suggestion-accepted`?`This rule started as an auto-detected suggestion that you accepted.`:`This rule was added manually through the form below.`,children:e.created_by===`suggestion-accepted`?`✨`:`⚙`}),r?(0,z.jsx)(`button`,{type:`button`,onClick:s,disabled:t.isPending,className:`px-2 py-1 rounded bg-accent text-bg text-xs font-medium disabled:opacity-50`,title:`Save the updated pattern and re-match sessions against it.`,children:`Save`}):(0,z.jsx)(`button`,{type:`button`,onClick:()=>{confirm(`Delete rule "${e.name}"? The collection stays; only rule-added rows are removed.`)&&n.mutate(e.id)},disabled:n.isPending,className:`px-2 py-1 rounded border border-line text-xs hover:bg-bg-hover disabled:opacity-50`,title:`Remove this rule; the sidebar folder stays and any sessions you added manually remain.`,children:`Delete`})]})}function Ac(){let e=nn(),[t,n]=(0,R.useState)(``),[r,i]=(0,R.useState)(`cwd-prefix`),[a,o]=(0,R.useState)(``);return(0,z.jsxs)(`section`,{className:`space-y-3`,children:[(0,z.jsxs)(`div`,{children:[(0,z.jsx)(`h2`,{className:`text-sm font-semibold uppercase tracking-wider text-fg-muted`,children:`Add rule manually`}),(0,z.jsx)(`p`,{className:`text-xs text-fg-muted mt-1`,children:`Use this when no suggestion matches what you want. Pick a rule type, set a name (this becomes the collection name in the sidebar), and enter the pattern to match.`})]}),(0,z.jsxs)(`form`,{onSubmit:i=>{i.preventDefault(),!(!t.trim()||!a.trim())&&e.mutate({name:t.trim(),type:r,pattern:a.trim()},{onSuccess:()=>{n(``),o(``)}})},className:`flex flex-wrap gap-2 items-end`,children:[(0,z.jsxs)(`label`,{className:`flex flex-col gap-1 text-xs`,children:[(0,z.jsx)(`span`,{className:`text-fg-muted`,children:`Collection name`}),(0,z.jsx)(`input`,{className:`px-2 py-1 bg-bg-elevated border border-line rounded text-sm`,value:t,onChange:e=>n(e.target.value),placeholder:`e.g. my-repo`,title:`Shown as the collection label in the sidebar.`})]}),(0,z.jsxs)(`label`,{className:`flex flex-col gap-1 text-xs`,children:[(0,z.jsx)(`span`,{className:`text-fg-muted`,children:`Match by`}),(0,z.jsx)(`select`,{className:`px-2 py-1 bg-bg-elevated border border-line rounded text-sm`,value:r,onChange:e=>i(e.target.value),title:Tc[r],children:Object.keys(wc).map(e=>(0,z.jsx)(`option`,{value:e,title:Tc[e],children:wc[e]},e))})]}),(0,z.jsxs)(`label`,{className:`flex flex-col gap-1 text-xs min-w-[16rem] flex-1`,children:[(0,z.jsx)(`span`,{className:`text-fg-muted`,children:`Pattern`}),(0,z.jsx)(`input`,{className:`px-2 py-1 bg-bg-elevated border border-line rounded text-sm font-mono`,value:a,onChange:e=>o(e.target.value),placeholder:jc(r),title:Tc[r]})]}),(0,z.jsx)(`button`,{type:`submit`,disabled:e.isPending||!t.trim()||!a.trim(),className:`px-3 py-1.5 rounded bg-accent text-bg text-sm font-medium disabled:opacity-50`,title:`Create this rule and add the matching sidebar folder; it will keep itself populated going forward.`,children:`Create`})]}),(0,z.jsx)(`div`,{className:`text-xs text-fg-muted italic`,children:Tc[r]}),e.isError&&(0,z.jsx)(`div`,{className:`text-xs text-role-user`,children:e.error.message})]})}function jc(e){switch(e){case`cwd-prefix`:return`/Users/you/code/my-repo`;case`project-id`:return`42`;case`tag`:return`security`;case`plan-file`:return`ROADMAP.md`;case`git-branch-prefix`:return`feature/`}}var Mc={status:`idle`,jobId:null,current:0,total:0,lastTitled:null,failures:[],summary:null,error:null};function Nc(e){let t=B(),[n,r]=(0,R.useState)(Mc),i=(0,R.useRef)(null),a=(0,R.useCallback)(()=>{i.current&&=(i.current.close(),null)},[]);return(0,R.useEffect)(()=>()=>a(),[a]),{state:n,start:(0,R.useCallback)(async n=>{a(),r({...Mc,status:`starting`});let o;try{o=(await W.startThreadTitlesJob(e,n)).jobId}catch(e){r({...Mc,status:`error`,error:e instanceof Error?e.message:String(e)});return}r(e=>({...e,status:`running`,jobId:o}));let s=`/api/jobs/${encodeURIComponent(o)}/stream`,c=new EventSource(s);i.current=c,c.addEventListener(`progress`,n=>{let i=JSON.parse(n.data);r(e=>({...e,current:i.current,total:i.total,lastTitled:i})),t.invalidateQueries({queryKey:[`thread`,e]})}),c.addEventListener(`skipped`,()=>{}),c.addEventListener(`error`,e=>{if(typeof e.data==`string`)try{let t=JSON.parse(e.data);r(e=>({...e,failures:[...e.failures,t]}))}catch{}}),c.addEventListener(`done`,n=>{let i=JSON.parse(n.data);r(e=>({...e,status:`done`,summary:i})),a(),t.invalidateQueries({queryKey:[`thread`,e]})})},[a,t,e]),cancel:(0,R.useCallback)(async()=>{if(r(e=>({...e,status:`cancelling`})),n.jobId)try{await W.cancelJob(n.jobId)}catch{}},[n.jobId]),reset:(0,R.useCallback)(()=>{a(),r(Mc)},[a])}}var Pc=60;function Fc(e){if(e==null)return null;let t=e.trim();return t.length>0?t:null}function Ic(e){let t=e.split(`
|
|
1200
|
-
`,1)[0].trim();return t?t.length>Pc?t.slice(0,Pc):t:null}function Lc(e){let t=Fc(e.alias),n=Fc(e.autoTitle),r=Fc(e.firstUserMessage),i=e.aliasSource??null,a=e.autoTitleSource??null;if(n&&a===`agent`)return n;if(t&&i===`manual`)return t;if(n&&(i===`auto`||t===null))return n;if(t)return t;if(n)return n;if(r){let e=Ic(r);if(e)return e}return e.sessionId.slice(0,8)}var Rc=260,zc=92,Bc=24,Vc=124,Hc=24,Uc=900;function Wc(e){let t=new Map;for(let n of e)t.set(n.session_id,n);let n=new Map,r=[];for(let i of e){let e=i.parent_session_id;if(e&&t.has(e)&&e!==i.session_id){let t=n.get(e)??[];t.push(i),n.set(e,t)}else r.push(i)}let i=(e,t)=>{let n=e.role===`origin`?0:1,r=t.role===`origin`?0:1;return n===r?e.added_at.localeCompare(t.added_at):n-r};r.sort(i);for(let e of n.values())e.sort(i);let a=new Map,o=new Set;function s(e){if(a.has(e))return a.get(e);if(o.has(e))return a.set(e,1),1;o.add(e);let t=n.get(e)??[],r=0;for(let e of t)r+=s(e.session_id);o.delete(e);let i=Math.max(1,r);return a.set(e,i),i}for(let e of r)s(e.session_id);let c=[],l=new Set,u=0;function d(e,t,r){if(l.has(e.session_id))return;l.add(e.session_id);let i=Hc+(r+(a.get(e.session_id)??1)/2)*(Rc+Bc)-Rc/2,o=Hc+t*Vc;c.push({edge:e,x:i,y:o,depth:t});let s=n.get(e.session_id)??[],u=r;for(let e of s){let n=a.get(e.session_id)??1;d(e,t+1,u),u+=n}}for(let e of r){let t=a.get(e.session_id)??1;d(e,0,u),u+=t}let f=new Map,p=0,m=0;for(let e of c)f.set(e.edge.session_id,e),e.x+Rc>p&&(p=e.x+Rc),e.y+zc>m&&(m=e.y+zc);return{nodes:c,byId:f,width:Math.max(p+Hc,400),height:Math.max(m+Hc,200)}}function Gc(e){return Lc({sessionId:e.session_id,alias:e.alias,autoTitle:e.auto_title,firstUserMessage:e.first_user_message,aliasSource:e.alias_source,autoTitleSource:e.auto_title_source})}var Kc={manual:`you linked this session to its parent yourself`,"plan-file":`both sessions reference the same plan or spec file`,"uuid-ref":`one session refers directly to the other by UUID`,"recall-context-ref":`one session was piped into the other via recall context`,semantic:`transcript content overlaps in meaning`,git:`the sessions share a git branch or commit range`,temporal:`the sessions ran close together on related work`};function qc(e){let t=Math.round(e.confidence*100);return e.source===`manual`?`Manual link (${Kc.manual}).`:`Auto-linked via ${e.source} at ${t}% confidence (${Kc[e.source]}); 100% would mean manually linked.`}function Jc(e,t,n){let r=new Map;for(let e of n)r.set(e.session_id,e);let i=new Set,a=t;for(;a;){if(i.has(a))return!1;i.add(a);let t=r.get(a);if(!t)return!1;if(t.parent_session_id===e)return!0;a=t.parent_session_id}return!1}function Yc({thread:e}){let t=(0,R.useRef)(null),[n,r]=(0,R.useState)(1024);return(0,R.useEffect)(()=>{if(!t.current)return;let e=new ResizeObserver(e=>{for(let t of e)r(t.contentRect.width)});return e.observe(t.current),()=>e.disconnect()},[]),(0,z.jsx)(`div`,{ref:t,className:`w-full`,children:n>0&&n<Uc?(0,z.jsx)(Qc,{thread:e}):(0,z.jsx)(Xc,{thread:e})})}function Xc({thread:e}){let[,t]=Pt(),n=Gs(),r=Ws(),i=Ds(),{nodes:a,byId:o,width:s,height:c}=(0,R.useMemo)(()=>Wc(e.edges),[e.edges]),[l,u]=(0,R.useState)(null),[d,f]=(0,R.useState)(null),p=(0,R.useMemo)(()=>{let t=0,n=0;for(let r of e.edges)r.role===`origin`&&t++,r.source!==`manual`&&r.confidence<1&&n++;return{total:e.edges.length,origins:t,autoPending:n}},[e.edges]),m=(0,R.useRef)(null),[h,g]=(0,R.useState)(null),[_,v]=(0,R.useState)(null),[y,b]=(0,R.useState)(!1),x=(0,R.useCallback)(n=>{t({session:n,view:null,thread:null,project:e.edges.find(e=>e.session_id===n)?.project??null,msg:null,col:null})},[t,e.edges]),S=(0,R.useCallback)((t,r)=>{let i=e.edges.find(e=>e.session_id===t);if(!i)return;let a=i.parent_session_id;a!==r&&n.mutate({threadId:e.id,sessionId:t,parentSessionId:r},{onSuccess:()=>{G({message:r?`Re-parented ${t.slice(0,8)} to ${r.slice(0,8)}`:`Promoted ${t.slice(0,8)} to origin`,tone:`success`,duration:6e3,action:{label:`Undo`,onClick:()=>{n.mutate({threadId:e.id,sessionId:t,parentSessionId:a})}}})},onError:e=>{G({message:`Re-parent failed: ${e instanceof Error?e.message:`unknown error`}`,tone:`error`})}})},[e.edges,e.id,n]),C=(0,R.useCallback)(t=>{let n=e.edges.find(e=>e.session_id===t),i=e.edges.filter(e=>e.parent_session_id===t).length,a=n?.alias??t.slice(0,8),o=i>0?`\n\n${i} child session${i===1?``:`s`} will be re-parented to ${n?.parent_session_id?`its grandparent`:`origin`}.`:``;confirm(`Remove "${a}" from this thread?${o}\n\nThe session itself stays in Recall — only the link to this thread is removed.`)&&r.mutate({threadId:e.id,sessionId:t},{onSuccess:()=>{G({message:`Removed ${a} from thread`,tone:`success`})},onError:e=>{G({message:`Remove failed: ${e instanceof Error?e.message:`unknown error`}`,tone:`error`})}})},[e.edges,e.id,r]),w=(0,R.useCallback)(t=>{f({sessionId:t,value:e.edges.find(e=>e.session_id===t)?.alias??``}),u(null)},[e.edges]),T=(0,R.useCallback)(()=>f(null),[]),E=(0,R.useCallback)(()=>{if(!d)return;let e=d.value.trim();if(!e){f(null);return}let t=d.sessionId;f(null),i.mutate({sessionId:t,alias:e},{onSuccess:()=>{G({message:`Renamed session to "${e}"`,tone:`success`})},onError:e=>{G({message:`Rename failed: ${e instanceof Error?e.message:`unknown error`}`,tone:`error`})}})},[d,i]),D=(0,R.useCallback)((e,t)=>{let n=m.current?.getBoundingClientRect();return n?{x:e-n.left,y:t-n.top}:{x:0,y:0}},[]),O=(0,R.useCallback)((e,t,n)=>{for(let r of a)if(r.edge.session_id!==n&&e>=r.x&&e<=r.x+Rc&&t>=r.y&&t<=r.y+zc)return r.edge.session_id;return null},[a]),k=(e,t)=>{if(e.button!==0)return;e.currentTarget.setPointerCapture(e.pointerId);let n=D(e.clientX,e.clientY);g({sessionId:t,pointerX:n.x,pointerY:n.y}),b(!1)},A=e=>{if(!h)return;let t=D(e.clientX,e.clientY),n=t.x-h.pointerX,r=t.y-h.pointerY;!y&&Math.hypot(n,r)>4&&b(!0),g({...h,pointerX:t.x,pointerY:t.y}),v(O(t.x,t.y,h.sessionId))},ee=t=>{if(!h)return;try{t.currentTarget.releasePointerCapture(t.pointerId)}catch{}let n=y,r=D(t.clientX,t.clientY),i=O(r.x,r.y,h.sessionId),a=h.sessionId;if(g(null),v(null),b(!1),!n){x(a);return}if(i!==a)if(i){if(Jc(a,i,e.edges)){G({message:`Cannot re-parent: that would create a cycle. A thread is a DAG.`,tone:`error`});return}S(a,i)}else S(a,null)},j=()=>{g(null),v(null),b(!1)},te=(0,R.useMemo)(()=>{let t=[];for(let n of e.edges){let e=n.parent_session_id;if(!e)continue;let r=o.get(n.session_id),i=o.get(e);if(!r||!i)continue;let a=i.x+Rc/2,s=i.y+zc,c=r.x+Rc/2,l=r.y;t.push({key:`${e}->${n.session_id}`,x1:a,y1:s,x2:c,y2:l,confidence:n.confidence,source:n.source,midX:(a+c)/2,midY:(s+l)/2,title:qc(n)})}return t},[e.edges,o]),M=h?o.get(h.sessionId)??null:null;return(0,z.jsxs)(`div`,{className:`space-y-3`,children:[(0,z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-4 gap-y-1 text-xs text-fg-muted`,children:[(0,z.jsxs)(`span`,{title:`Total sessions pulled into this thread.`,children:[(0,z.jsx)(`strong`,{className:`text-fg`,children:p.total}),` session`,p.total===1?``:`s`,` linked`]}),(0,z.jsxs)(`span`,{title:`Threads can have multiple origins; these are the seed sessions the thread grew from.`,children:[(0,z.jsx)(`strong`,{className:`text-fg`,children:p.origins}),` origin`,p.origins===1?``:`s`]}),p.autoPending>0&&(0,z.jsxs)(`span`,{title:`Auto-detected links below full confidence that you have not confirmed yet.`,children:[(0,z.jsx)(`strong`,{className:`text-fg`,children:p.autoPending}),` `,`auto-suggested`]}),(0,z.jsx)(`span`,{className:`ml-auto italic`,children:`Drag a node onto another to re-parent. Drop on empty canvas to promote to origin.`})]}),(0,z.jsx)(`div`,{ref:m,className:`relative border border-line rounded bg-bg-elevated overflow-auto`,style:{height:Math.min(c+40,700)},onPointerMove:A,onPointerUp:ee,onPointerCancel:j,children:(0,z.jsxs)(`div`,{style:{width:s,height:c,position:`relative`},children:[(0,z.jsx)(`svg`,{width:s,height:c,className:`absolute inset-0 pointer-events-none`,children:te.map(e=>{let t=e.source!==`manual`,n=e.confidence>=1?3:Math.max(1,e.confidence*2.5);return(0,z.jsxs)(`g`,{children:[(0,z.jsx)(`path`,{d:`M ${e.x1} ${e.y1} C ${e.x1} ${(e.y1+e.y2)/2}, ${e.x2} ${(e.y1+e.y2)/2}, ${e.x2} ${e.y2}`,fill:`none`,stroke:`currentColor`,strokeOpacity:.6,strokeWidth:n,strokeDasharray:t?`5 4`:void 0,className:`text-fg-muted`,style:{pointerEvents:`stroke`},children:(0,z.jsx)(`title`,{children:e.title})}),t&&(0,z.jsxs)(`g`,{transform:`translate(${e.midX-10} ${e.midY-8})`,style:{pointerEvents:`auto`},children:[(0,z.jsx)(`title`,{children:e.title}),(0,z.jsx)(`rect`,{width:20,height:14,rx:3,className:`fill-bg-elevated`,stroke:`currentColor`,strokeOpacity:.5}),(0,z.jsx)(`text`,{x:10,y:10,textAnchor:`middle`,className:`fill-fg-muted`,style:{fontSize:9,fontWeight:600},children:`AI`})]})]},e.key)})}),a.map(e=>{let t=h?.sessionId===e.edge.session_id,n=_===e.edge.session_id,r=e.edge.role===`origin`,i=d?.sessionId===e.edge.session_id,a=Math.round(e.edge.confidence*100),o=e.edge.source===`manual`?`added manually`:`auto-linked via ${e.edge.source} at ${a}% confidence`,s=`${r?`Origin`:`Child`} session ${e.edge.session_id}, ${o}; click to open, drag to re-parent, right-click to rename.`,c=r?`Origin: one of the seed sessions this thread grew from.`:`Child: a session linked under a parent.`,l=e.edge.source===`manual`?``:`Auto-linked via ${e.edge.source} at ${a}% confidence (${Kc[e.edge.source]}); 100% would mean manually linked.`;return(0,z.jsxs)(`div`,{role:`button`,tabIndex:0,onPointerDown:t=>{i||k(t,e.edge.session_id)},onContextMenu:t=>{t.preventDefault(),g(null),v(null),b(!1),u({sessionId:e.edge.session_id,x:t.clientX,y:t.clientY})},onKeyDown:t=>{i||(t.key===`Enter`||t.key===` `?(t.preventDefault(),x(e.edge.session_id)):t.key===`F2`&&(t.preventDefault(),w(e.edge.session_id)))},className:K(`absolute select-none rounded border shadow-sm flex flex-col justify-center px-3 py-2 text-left transition-colors`,`focus:outline-none focus:ring-2 focus:ring-accent/60`,r?`bg-accent/20 border-accent/60 text-fg`:`bg-bg border-line text-fg`,t&&`opacity-50 cursor-grabbing`,n&&`ring-2 ring-accent`,i&&`ring-2 ring-accent cursor-text`,!t&&!i&&`cursor-grab hover:border-accent/60`),style:{left:e.x,top:e.y,width:Rc,height:zc,touchAction:`none`},title:s,children:[(0,z.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,z.jsx)(`span`,{className:K(`text-[9px] uppercase tracking-wider px-1 py-0.5 rounded shrink-0`,r?`bg-accent text-bg`:`bg-bg-hover text-fg-muted`),title:c,children:e.edge.role}),e.edge.source!==`manual`&&(0,z.jsx)(`span`,{className:`text-[9px] uppercase tracking-wider px-1 py-0.5 rounded bg-bg-hover text-fg-muted shrink-0`,title:l,children:`AI`})]}),i?(0,z.jsx)(`input`,{autoFocus:!0,type:`text`,value:d.value,onChange:e=>f({sessionId:d.sessionId,value:e.target.value}),onPointerDown:e=>e.stopPropagation(),onKeyDown:e=>{e.stopPropagation(),e.key===`Enter`?(e.preventDefault(),E()):e.key===`Escape`&&(e.preventDefault(),T())},onBlur:E,placeholder:Gc(e.edge),"aria-label":`Rename session`,className:`text-sm bg-bg-elevated border border-accent rounded px-1 py-0.5 mt-0.5 outline-none w-full`}):(0,z.jsx)(`div`,{className:`text-[12.5px] leading-snug mt-0.5 break-words overflow-hidden`,children:Gc(e.edge)})]},e.edge.session_id)}),M&&h&&y&&(0,z.jsx)(`div`,{className:`absolute pointer-events-none rounded border border-accent bg-bg shadow-lg px-3 py-2 opacity-80`,style:{left:h.pointerX-Rc/2,top:h.pointerY-zc/2,width:Rc,height:zc},children:(0,z.jsx)(`div`,{className:`text-[12.5px] leading-snug break-words overflow-hidden`,children:Gc(M.edge)})})]})}),l&&(0,z.jsx)($c,{x:l.x,y:l.y,sessionId:l.sessionId,onRename:()=>w(l.sessionId),onRemoveFromThread:()=>C(l.sessionId),onClose:()=>u(null)})]})}function Zc(e){let t=new Map;for(let n of e)t.set(n.session_id,{edge:n,children:[]});let n=[];for(let e of t.values()){let r=e.edge.parent_session_id;r&&t.has(r)&&r!==e.edge.session_id?t.get(r).children.push(e):n.push(e)}return n}function Qc({thread:e}){let t=(0,R.useMemo)(()=>Zc(e.edges),[e.edges]),[,n]=Pt(),r=Ws();if(t.length===0)return(0,z.jsx)(`div`,{className:`text-xs text-fg-muted italic p-3 border border-line rounded`,children:`No sessions yet.`});let i=(t,n)=>{let i=n??t.slice(0,8),a=e.edges.filter(e=>e.parent_session_id===t).length,o=a>0?`\n\n${a} child session${a===1?``:`s`} will be re-parented.`:``;confirm(`Remove "${i}" from this thread?${o}\n\nThe session itself stays in Recall — only the link to this thread is removed.`)&&r.mutate({threadId:e.id,sessionId:t},{onSuccess:()=>{G({message:`Removed ${i} from thread`,tone:`success`})},onError:e=>{G({message:`Remove failed: ${e instanceof Error?e.message:`unknown error`}`,tone:`error`})}})},a=(e,t)=>{let r=e.edge.role===`origin`,o=Math.round(e.edge.confidence*100),s=e.edge.source===`manual`?`added manually`:`auto-linked via ${e.edge.source} at ${o}% confidence`,c=`${r?`Origin`:`Child`} session ${e.edge.session_id}, ${s}; click to open.`,l=r?`Origin: one of the seed sessions this thread grew from.`:`Child: a session linked under a parent.`,u=e.edge.project??null;return(0,z.jsxs)(`div`,{children:[(0,z.jsxs)(`div`,{className:`group flex items-center gap-2 border-b border-line/50 hover:bg-bg-hover`,style:{paddingLeft:`${12+t*20}px`,paddingRight:`8px`},children:[(0,z.jsxs)(`button`,{type:`button`,onClick:()=>n({session:e.edge.session_id,view:null,thread:null,project:u,msg:null,col:null}),className:`flex-1 flex items-center gap-2 py-2 text-sm text-left min-w-0`,title:c,children:[(0,z.jsx)(`span`,{className:K(`text-[10px] uppercase tracking-wider px-1.5 py-0.5 rounded shrink-0`,r?`bg-accent/20 text-accent`:`bg-bg-hover text-fg-muted`),title:l,children:e.edge.role}),(0,z.jsx)(`span`,{className:`truncate`,children:Gc(e.edge)})]}),(0,z.jsx)(`button`,{type:`button`,onClick:t=>{t.stopPropagation(),i(e.edge.session_id,e.edge.alias??null)},className:`text-[10px] text-fg-muted hover:text-role-user opacity-0 group-hover:opacity-100 transition-opacity shrink-0`,title:`remove from this thread (session itself is preserved)`,"aria-label":`remove from thread`,children:`remove`})]}),e.children.map(e=>a(e,t+1))]},e.edge.session_id)};return(0,z.jsx)(`div`,{className:`border border-line rounded`,children:t.map(e=>a(e,0))})}function $c({x:e,y:t,sessionId:n,onRename:r,onRemoveFromThread:i,onClose:a}){let o=(0,R.useRef)(null);return(0,R.useEffect)(()=>{let e=e=>{o.current&&!o.current.contains(e.target)&&a()},t=e=>{e.key===`Escape`&&a()};return window.addEventListener(`mousedown`,e),window.addEventListener(`keydown`,t),()=>{window.removeEventListener(`mousedown`,e),window.removeEventListener(`keydown`,t)}},[a]),(0,z.jsxs)(`div`,{ref:o,role:`menu`,"aria-label":`thread node actions`,className:`fixed z-50 bg-bg-elevated border border-line rounded-lg shadow-xl py-1 text-xs`,style:{left:Math.min(e,window.innerWidth-240-8),top:Math.min(t,window.innerHeight-140-8),width:240},children:[(0,z.jsxs)(`div`,{className:`px-3 pt-1 pb-1 text-[10px] uppercase tracking-wider text-fg-muted`,children:[`session `,n.slice(0,8)]}),(0,z.jsx)(`div`,{className:`border-t border-line my-1`}),(0,z.jsxs)(`button`,{type:`button`,role:`menuitem`,onClick:()=>{r(),a()},className:`block w-full text-left px-3 py-1.5 hover:bg-bg-hover`,children:[(0,z.jsx)(`div`,{className:`text-fg`,children:`Rename session`}),(0,z.jsx)(`div`,{className:`text-[10px] text-fg-muted`,children:`set an alias that overrides the auto-title`})]}),(0,z.jsx)(`div`,{className:`border-t border-line my-1`}),(0,z.jsxs)(`button`,{type:`button`,role:`menuitem`,onClick:()=>{a(),i()},className:`block w-full text-left px-3 py-1.5 hover:bg-role-user/10`,children:[(0,z.jsx)(`div`,{className:`text-role-user`,children:`Remove from thread`}),(0,z.jsx)(`div`,{className:`text-[10px] text-fg-muted`,children:`unlinks this session; the session itself is preserved`})]})]})}function el(){let[e,t]=Pt(),n=Rs(),r=e.thread,i=zs(r),a=Vs(),o=Hs(),s=n.data?.threads??[],c=i.data?.thread??null,[l,u]=(0,R.useState)(``),[d,f]=(0,R.useState)(null),[p,m]=(0,R.useState)(null),h=(e,t)=>{let n=t.trim();n&&o.mutate({id:e,patch:{name:n}},{onSuccess:()=>{G({message:`Renamed thread to "${n}"`,tone:`success`})},onError:e=>{G({message:`Rename failed: ${e instanceof Error?e.message:`unknown error`}`,tone:`error`})}})};return(0,z.jsxs)(`div`,{className:`flex-1 flex min-h-0`,children:[(0,z.jsxs)(`aside`,{className:`pane w-72 shrink-0`,children:[(0,z.jsxs)(`div`,{className:`pane-header`,children:[(0,z.jsx)(`span`,{children:`🧵 Threads`}),(0,z.jsx)(`span`,{children:s.length})]}),(0,z.jsxs)(`form`,{onSubmit:e=>{e.preventDefault();let n=l.trim();n&&a.mutate({name:n},{onSuccess:e=>{u(``),t({thread:e.thread.id})}})},className:`px-3 pt-2 pb-3 border-b border-line flex gap-2`,children:[(0,z.jsx)(`input`,{value:l,onChange:e=>u(e.target.value),placeholder:`New thread name`,className:`flex-1 px-2 py-1 bg-bg-elevated border border-line rounded text-sm`}),(0,z.jsx)(`button`,{type:`submit`,disabled:a.isPending||!l.trim(),className:`px-2 py-1 rounded bg-accent text-bg text-xs font-medium disabled:opacity-50`,title:`Create a new empty thread with this name; add sessions to it afterwards.`,children:`Create`})]}),(0,z.jsxs)(`div`,{className:`flex-1 overflow-y-auto`,children:[n.isLoading&&(0,z.jsx)(`div`,{className:`px-4 py-6 text-xs text-fg-muted`,children:`Loading threads…`}),s.length===0&&!n.isLoading&&(0,z.jsx)(`div`,{className:`px-4 py-6 text-xs text-fg-muted italic`,children:`No threads yet. A thread is one unit of work spanning many sessions (planning session plus its children). Create one with the form above, then add sessions to it from any session's transcript header.`}),s.map(e=>(0,z.jsx)(tl,{thread:e,active:e.id===r,renaming:p===e.id,onSelect:()=>t({thread:e.id}),onContextMenu:(t,n)=>f({threadId:e.id,name:e.name,x:t,y:n}),onCommitRename:t=>{m(null),t.trim()&&t.trim()!==e.name&&h(e.id,t)},onCancelRename:()=>m(null)},e.id))]})]}),(0,z.jsx)(`section`,{className:`flex-1 min-w-0 overflow-y-auto`,children:c?(0,z.jsx)(nl,{thread:c,onPatch:o.mutate}):(0,z.jsxs)(`div`,{className:`p-8 text-sm text-fg-muted`,children:[(0,z.jsx)(`h1`,{className:`text-xl font-semibold text-fg mb-2`,children:`Threads`}),(0,z.jsxs)(`p`,{className:`max-w-prose`,children:[`A `,(0,z.jsx)(`strong`,{children:`thread`}),` groups the sessions that make up one unit of work. Pick a thread on the left, or create a new one. When you have a parent planning session plus child execution sessions, Threads is where you see them all together and pipe the whole thing back into a new Claude Code run.`]})]})}),d&&(0,z.jsx)(il,{x:d.x,y:d.y,threadName:d.name,onRename:()=>{m(d.threadId),f(null)},onClose:()=>f(null)})]})}function tl({thread:e,active:t,renaming:n,onSelect:r,onContextMenu:i,onCommitRename:a,onCancelRename:o}){let[s,c]=(0,R.useState)(e.name);return(0,R.useEffect)(()=>{n&&c(e.name)},[n,e.name]),n?(0,z.jsxs)(`div`,{className:K(`w-full text-left px-3 py-2 border-b border-line/50`,t&&`bg-accent/10`),children:[(0,z.jsx)(`input`,{autoFocus:!0,value:s,onChange:e=>c(e.target.value),onKeyDown:e=>{e.key===`Enter`?(e.preventDefault(),a(s)):e.key===`Escape`&&(e.preventDefault(),o())},onBlur:()=>a(s),"aria-label":`Rename thread`,className:`w-full px-2 py-1 bg-bg-elevated border border-accent rounded text-sm font-medium outline-none`}),(0,z.jsx)(`div`,{className:`text-[10px] text-fg-muted mt-1`,children:`Enter to save, Esc to cancel`})]}):(0,z.jsxs)(`button`,{type:`button`,onClick:r,onContextMenu:e=>{e.preventDefault(),i(e.clientX,e.clientY)},className:K(`w-full text-left px-3 py-2 border-b border-line/50 hover:bg-bg-hover`,t&&`bg-accent/10`),title:`Open the "${e.name}" thread detail view with its session graph (right-click to rename).`,children:[(0,z.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,z.jsx)(`span`,{className:`font-medium truncate`,title:e.name,children:e.name}),(0,z.jsx)(`span`,{className:`text-[10px] text-fg-muted shrink-0`,title:`${e.session_count} session${e.session_count===1?``:`s`} currently linked into this thread.`,children:e.session_count})]}),(0,z.jsxs)(`div`,{className:`text-[11px] text-fg-muted truncate`,children:[e.origin_count,` origin`,e.origin_count===1?``:`s`,` ·`,` `,e.closed_at?`closed`:`open`,e.summary?` · ${e.summary}`:``]})]})}function nl({thread:e,onPatch:t}){let[,n]=Pt(),[r,i]=(0,R.useState)(!1),[a,o]=(0,R.useState)(e.name);(0,R.useEffect)(()=>{r||o(e.name)},[e.name,r]);let s=()=>{let n=a.trim();if(i(!1),!n||n===e.name){o(e.name);return}t({id:e.id,patch:{name:n}}),G({message:`Renamed thread to "${n}"`,tone:`success`})},c=()=>{i(!1),o(e.name)};return(0,z.jsxs)(`div`,{className:`p-6 space-y-6`,children:[(0,z.jsxs)(`header`,{className:`space-y-1 max-w-3xl`,children:[(0,z.jsxs)(`div`,{className:`flex items-center gap-3`,children:[r?(0,z.jsx)(`input`,{autoFocus:!0,value:a,onChange:e=>o(e.target.value),onKeyDown:e=>{e.key===`Enter`?(e.preventDefault(),s()):e.key===`Escape`&&(e.preventDefault(),c())},onBlur:s,"aria-label":`Rename thread`,className:`text-2xl font-semibold bg-bg-elevated border border-accent rounded px-2 py-0.5 outline-none flex-1`}):(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(`h1`,{className:`text-2xl font-semibold cursor-text`,onDoubleClick:()=>i(!0),title:`Double-click (or use the pencil button) to rename this thread.`,children:e.name}),(0,z.jsx)(`button`,{type:`button`,onClick:()=>i(!0),className:`text-xs text-fg-muted hover:text-accent px-1.5 py-0.5 rounded border border-transparent hover:border-line`,title:`Rename this thread`,"aria-label":`Rename thread`,children:`✎`})]}),(0,z.jsxs)(`span`,{className:`text-xs text-fg-muted`,children:[e.session_count,` session`,e.session_count===1?``:`s`,` ·`,` `,e.closed_at?`closed`:`open`]})]}),e.summary&&(0,z.jsx)(`p`,{className:`text-sm text-fg-muted`,children:e.summary}),(0,z.jsxs)(`div`,{className:`flex gap-2 pt-1`,children:[e.closed_at?(0,z.jsx)(`button`,{type:`button`,onClick:()=>t({id:e.id,patch:{reopen:!0}}),className:`px-2 py-1 text-xs rounded border border-line hover:bg-bg-hover`,title:`Mark this thread as active again so new sessions can be added.`,children:`Reopen`}):(0,z.jsx)(`button`,{type:`button`,onClick:()=>t({id:e.id,patch:{close:!0}}),className:`px-2 py-1 text-xs rounded border border-line hover:bg-bg-hover`,title:`Mark this thread as finished; sessions stay linked and you can reopen it at any time.`,children:`Close thread`}),(0,z.jsx)(`button`,{type:`button`,onClick:()=>{confirm(`Archive "${e.name}"? You can still find it with Show archived.`)&&(t({id:e.id,patch:{archive:!0}}),n({thread:null}))},className:`px-2 py-1 text-xs rounded border border-line hover:bg-bg-hover`,title:`Hide this thread from the main list; it stays in the database and reappears under Show archived.`,children:`Archive`}),(0,z.jsx)(al,{thread:e})]})]}),(0,z.jsxs)(`section`,{children:[(0,z.jsxs)(`div`,{className:`flex items-center justify-between mb-2 max-w-3xl`,children:[(0,z.jsx)(`h2`,{className:`text-sm font-semibold uppercase tracking-wider text-fg-muted`,children:`Sessions in this thread`}),(0,z.jsx)(rl,{threadId:e.id,existingIds:new Set(e.edges.map(e=>e.session_id))})]}),e.edges.length===0?(0,z.jsxs)(`div`,{className:`text-xs text-fg-muted p-3 border border-line rounded max-w-3xl space-y-2`,children:[(0,z.jsx)(`div`,{className:`italic`,children:`No sessions in this thread yet. Two ways to add:`}),(0,z.jsxs)(`ol`,{className:`list-decimal pl-5 space-y-1 not-italic`,children:[(0,z.jsxs)(`li`,{children:[`Use the `,(0,z.jsx)(`strong`,{className:`text-fg`,children:`+ Add session`}),` `,`button above to search and link any session.`]}),(0,z.jsxs)(`li`,{children:[`Open any session from the sidebar and click`,` `,(0,z.jsx)(`strong`,{className:`text-fg`,children:`+ Add to thread`}),` in its transcript header.`]})]})]}):(0,z.jsx)(Yc,{thread:e})]}),(0,z.jsxs)(`section`,{className:`rounded border border-line bg-bg-elevated p-3 text-xs text-fg-muted space-y-1 max-w-3xl`,children:[(0,z.jsx)(`div`,{className:`font-medium text-fg text-sm`,children:`How Threads work`}),(0,z.jsx)(`p`,{children:`A thread is a DAG (not a tree). It can have multiple origins. A session can belong to multiple threads. Manual edges are always authoritative. Auto-detected edges (v0.7 Pro) will show up with a confidence score and will always be undoable.`}),(0,z.jsxs)(`p`,{children:[(0,z.jsx)(`strong`,{className:`text-fg`,children:`Tip:`}),` pipe a whole thread back into Claude Code with `,(0,z.jsxs)(`span`,{className:`font-mono`,children:[`recall context thread:`,e.id.slice(0,8)]}),`(CLI command landing in v0.15a.2).`]})]})]})}function rl({threadId:e,existingIds:t}){let[n,r]=(0,R.useState)(!1),[i,a]=(0,R.useState)(``),o=Us(),s=V({queryKey:[`sessions`,{limit:500}],queryFn:()=>W.sessions({limit:500}),enabled:n,staleTime:3e4}),c=s.data??[],l=(0,R.useMemo)(()=>{let e=i.trim().toLowerCase(),n=c.filter(e=>!t.has(e.id));return e?n.filter(t=>[t.alias??``,t.first_user_message??``,t.project??``,t.id].join(` `).toLowerCase().includes(e)).slice(0,10):n.slice(0,10)},[c,t,i]);return n?(0,z.jsxs)(`div`,{className:`relative`,children:[(0,z.jsxs)(`div`,{className:`flex gap-2 items-center`,children:[(0,z.jsx)(`input`,{autoFocus:!0,value:i,onChange:e=>a(e.target.value),placeholder:`search sessions by alias, project, or first message`,className:`text-xs bg-bg-elevated border border-line rounded px-2 py-1 w-80`}),(0,z.jsx)(`button`,{type:`button`,onClick:()=>{r(!1),a(``)},className:`text-xs text-fg-muted hover:text-fg`,title:`Close the search without linking any session.`,children:`cancel`})]}),(0,z.jsxs)(`div`,{className:`absolute right-0 top-8 z-20 w-96 max-h-80 overflow-y-auto bg-bg border border-line rounded shadow-lg`,children:[s.isLoading&&(0,z.jsx)(`div`,{className:`p-3 text-xs text-fg-muted`,children:`Loading sessions...`}),l.length===0&&!s.isLoading&&(0,z.jsx)(`div`,{className:`p-3 text-xs text-fg-muted italic`,children:i?`no matches`:`all sessions are already in this thread`}),l.map(t=>{let n=t.alias||t.first_user_message?.split(`
|
|
1201
|
-
`)[0].slice(0,80)||t.id.slice(0,8);return(0,z.jsxs)(`button`,{type:`button`,onClick:()=>{o.mutate({threadId:e,sessionId:t.id},{onSuccess:()=>a(``)})},className:`w-full text-left px-3 py-2 border-b border-line/40 hover:bg-accent/10 text-xs`,title:`Link ${t.id}`,children:[(0,z.jsx)(`div`,{className:`font-medium truncate`,children:n}),(0,z.jsxs)(`div`,{className:`text-fg-muted truncate`,children:[t.project||`—`,` · `,t.id.slice(0,8)]})]},t.id)})]})]}):(0,z.jsx)(`button`,{type:`button`,onClick:()=>r(!0),className:`text-xs px-2 py-1 rounded bg-accent text-bg font-medium`,title:`Search and link any session into this thread (you can also start from a session's transcript header with + Add to thread).`,children:`+ Add session`})}function il({x:e,y:t,threadName:n,onRename:r,onClose:i}){let a=(0,R.useRef)(null);return(0,R.useEffect)(()=>{let e=e=>{a.current&&!a.current.contains(e.target)&&i()},t=e=>{e.key===`Escape`&&i()};return window.addEventListener(`mousedown`,e),window.addEventListener(`keydown`,t),()=>{window.removeEventListener(`mousedown`,e),window.removeEventListener(`keydown`,t)}},[i]),(0,z.jsxs)(`div`,{ref:a,role:`menu`,"aria-label":`thread actions`,className:`fixed z-50 bg-bg-elevated border border-line rounded-lg shadow-xl py-1 text-xs`,style:{left:Math.min(e,window.innerWidth-220-8),top:Math.min(t,window.innerHeight-80-8),width:220},children:[(0,z.jsx)(`div`,{className:`px-3 pt-1 pb-1 text-[10px] uppercase tracking-wider text-fg-muted truncate`,children:n}),(0,z.jsx)(`div`,{className:`border-t border-line my-1`}),(0,z.jsxs)(`button`,{type:`button`,role:`menuitem`,onClick:()=>{r(),i()},className:`block w-full text-left px-3 py-1.5 hover:bg-bg-hover`,children:[(0,z.jsx)(`div`,{className:`text-fg`,children:`Rename thread`}),(0,z.jsx)(`div`,{className:`text-[10px] text-fg-muted`,children:`inline edit, Enter to save`})]})]})}function al({thread:e}){let{state:t,start:n,cancel:r,reset:i}=Nc(e.id),[a,o]=(0,R.useState)(!1),[s,c]=(0,R.useState)(!1);return(0,R.useEffect)(()=>{if(t.status!==`done`||!t.summary)return;let{generated:e,skipped:n,failed:r}=t.summary;r.length>0?G({message:`Generated ${e.length}, skipped ${n.length}, ${r.length} failed`,tone:`error`}):G({message:`Generated ${e.length} title${e.length===1?``:`s`}, skipped ${n.length}`,tone:`success`})},[t.status,t.summary]),t.status===`running`||t.status===`starting`||t.status===`cancelling`?(0,z.jsxs)(`span`,{className:`inline-flex items-center gap-2 px-2 py-1 text-xs rounded border border-accent bg-bg-elevated`,children:[(0,z.jsx)(`span`,{"aria-hidden":!0,className:`inline-block animate-spin`,children:`⋮`}),(0,z.jsx)(`span`,{children:t.status===`cancelling`?`Cancelling...`:`Titling ${t.current} of ${t.total||`?`}...`}),(0,z.jsx)(`button`,{type:`button`,onClick:r,className:`text-fg-muted hover:text-accent underline`,title:`Stop the bulk titler. Already-generated titles stay; the rest are skipped.`,children:`Cancel`})]}):(0,z.jsxs)(`span`,{className:`relative`,children:[(0,z.jsx)(`button`,{type:`button`,onClick:async()=>{if(!(t.status===`running`||t.status===`starting`)){c(!0);try{(await W.threadTitlesPreflight(e.id)).alreadyTitled===0?await n(!1):o(!0)}catch(e){G({message:`Could not prepare bulk titler: ${e instanceof Error?e.message:String(e)}`,tone:`error`})}finally{c(!1)}}},disabled:s,className:`px-2 py-1 text-xs rounded border border-line hover:bg-bg-hover disabled:opacity-50`,title:`Generate a coherent title for every session in this thread, walking the DAG so children inherit the parent's naming pattern.`,children:s?`Checking...`:`🪄 Title whole thread`}),a&&(0,z.jsx)(ol,{thread:e,onPick:e=>{o(!1),n(e)},onClose:()=>o(!1)}),t.status===`done`&&t.summary&&t.summary.failed.length>0&&(0,z.jsx)(sl,{failures:t.summary.failed,onDismiss:i})]})}function ol({thread:e,onPick:t,onClose:n}){let r=(0,R.useRef)(null);return(0,R.useEffect)(()=>{function e(e){r.current&&!r.current.contains(e.target)&&n()}return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[n]),(0,z.jsxs)(`div`,{ref:r,role:`dialog`,"aria-label":`Bulk title confirmation`,className:`absolute right-0 top-full mt-1 z-50 w-72 rounded border border-line bg-bg-elevated p-3 shadow-lg text-xs space-y-2`,children:[(0,z.jsxs)(`p`,{className:`text-fg`,children:[`Some sessions in “`,e.name,`” already have agent titles. Pick what to do:`]}),(0,z.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,z.jsxs)(`button`,{type:`button`,onClick:()=>t(!1),className:`px-2 py-1 rounded border border-line hover:bg-bg-hover text-left`,children:[`Skip already-titled`,(0,z.jsx)(`span`,{className:`block text-[10px] text-fg-muted`,children:`Only title the untitled sessions. Recommended.`})]}),(0,z.jsxs)(`button`,{type:`button`,onClick:()=>t(!0),className:`px-2 py-1 rounded border border-line hover:bg-bg-hover text-left`,children:[`Regenerate all`,(0,z.jsx)(`span`,{className:`block text-[10px] text-fg-muted`,children:`Replace every title. Old titles stay in auto_title_history.`})]}),(0,z.jsx)(`button`,{type:`button`,onClick:n,className:`px-2 py-1 rounded border border-transparent hover:bg-bg-hover text-fg-muted text-left`,children:`Cancel`})]})]})}function sl({failures:e,onDismiss:t}){return(0,z.jsxs)(`div`,{role:`alert`,className:`absolute right-0 top-full mt-1 z-50 w-80 rounded border border-line bg-bg-elevated p-3 shadow-lg text-xs space-y-1`,children:[(0,z.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,z.jsx)(`strong`,{className:`text-fg`,children:`Some sessions failed to title`}),(0,z.jsx)(`button`,{type:`button`,onClick:t,className:`text-fg-muted hover:text-accent`,"aria-label":`Dismiss failure panel`,children:`Dismiss`})]}),(0,z.jsx)(`ul`,{className:`max-h-40 overflow-auto space-y-1`,children:e.map(e=>(0,z.jsxs)(`li`,{className:`font-mono text-[10px] text-fg-muted`,children:[(0,z.jsx)(`span`,{className:`text-fg`,children:e.sessionId.slice(0,8)}),`: `,e.error]},e.sessionId))})]})}var cl=[`onboarding`];function ll(){let e=B(),t=V({queryKey:cl,queryFn:()=>W.getOnboarding(),staleTime:6e4,refetchOnWindowFocus:!1}),n=at({mutationFn:e=>W.patchOnboarding(e),onSuccess:t=>{e.setQueryData(cl,e=>e&&{...e,state:t})}}),r=at({mutationFn:()=>W.resetOnboarding(),onSuccess:t=>{e.setQueryData(cl,e=>e&&{...e,state:t})}}),i=!!t.data&&!t.data.state.completed&&!t.data.state.skipped;return{data:t.data,isLoading:t.isLoading,shouldShow:i,patch:e=>n.mutateAsync(e),reset:()=>r.mutateAsync()}}var ul=[{id:`intro`,title:`Your most recent session`},{id:`resume`,title:`Resume it in Claude Code`},{id:`auto-tag`,title:`Let Recall organize it`}];function dl({onSelectSession:e,onOpenAutoTagSettings:t,onClose:n}){let r=ll(),i=r.data?.mostRecentSession??null,[a,o]=(0,R.useState)(0),s=ul[a].id,c=V({queryKey:[`mcp-install-status`],queryFn:()=>W.getMcpInstallStatus(),enabled:a>=1,staleTime:3e4}),[l,u]=(0,R.useState)(!1);(0,R.useEffect)(()=>{l||s!==`intro`||!i||(e(i.id),u(!0))},[l,s,i,e]),(0,R.useEffect)(()=>{r.patch({completedSteps:[s]})},[s]);let d=(0,R.useCallback)(()=>{n(),r.patch({completed:!0,finishedAt:new Date().toISOString(),completedSteps:ul.map(e=>e.id)}).catch(()=>{})},[r,n]),f=(0,R.useCallback)(()=>{n(),r.patch({skipped:!0,finishedAt:new Date().toISOString()}).catch(()=>{})},[r,n]);Kn(!0,f);let p=(0,R.useCallback)(()=>{a<ul.length-1?o(e=>e+1):d()},[a,d]),m=(0,R.useCallback)(()=>{a>0&&o(e=>e-1)},[a]);return(0,z.jsx)(`div`,{className:`fixed inset-0 z-40 bg-black/60 flex items-end sm:items-center justify-center p-4 sm:p-6`,role:`dialog`,"aria-labelledby":`onboarding-title`,"aria-modal":`true`,children:(0,z.jsxs)(`div`,{className:`bg-bg border border-line rounded-lg w-[520px] max-w-[calc(100vw-2rem)] max-h-[calc(100vh-4rem)] overflow-y-auto shadow-2xl flex flex-col`,children:[(0,z.jsx)(fl,{stepIdx:a,onSkip:()=>void f()}),(0,z.jsxs)(`div`,{className:`flex-1 px-6 py-5`,children:[s===`intro`&&(0,z.jsx)(ml,{session:i,isLoading:r.isLoading,onReveal:()=>{i&&e(i.id)}}),s===`resume`&&(0,z.jsx)(hl,{session:i}),s===`auto-tag`&&(0,z.jsx)(gl,{claudeCliAvailable:!!c.data?.claudeCliAvailable,mcpInstalled:!!c.data?.installed,onOpenSettings:()=>{t(),d()},onFinish:d})]}),(0,z.jsx)(pl,{stepIdx:a,canBack:a>0,onBack:m,onNext:p,onSkip:()=>void f(),isFinalStep:a===ul.length-1})]})})}function fl({stepIdx:e,onSkip:t}){return(0,z.jsxs)(`div`,{className:`px-6 py-4 border-b border-line flex items-center justify-between gap-3`,children:[(0,z.jsxs)(`div`,{className:`flex items-center gap-2.5 min-w-0`,children:[(0,z.jsx)(`img`,{src:Ct,alt:``,className:`h-7 w-7 rounded-md shrink-0`}),(0,z.jsxs)(`div`,{className:`min-w-0`,children:[(0,z.jsxs)(`div`,{id:`onboarding-title`,className:`text-sm font-semibold text-fg leading-none`,children:[`Welcome to `,(0,z.jsxs)(`span`,{className:`text-base font-extrabold`,children:[`Claude `,(0,z.jsx)(`span`,{className:`text-accent`,children:`Recall`})]})]}),(0,z.jsxs)(`div`,{className:`text-[11px] text-fg-muted mt-1`,children:[`Step `,e+1,` of `,ul.length,` · `,ul[e].title]})]})]}),(0,z.jsx)(`button`,{type:`button`,onClick:t,className:`text-xs text-fg-muted hover:text-fg whitespace-nowrap`,title:`dismiss the tour (Esc)`,children:`I’ll explore myself →`})]})}function pl({stepIdx:e,canBack:t,onBack:n,onNext:r,onSkip:i,isFinalStep:a}){return(0,z.jsxs)(`div`,{className:`px-6 py-3 border-t border-line flex items-center justify-between gap-2 bg-bg-elevated`,children:[(0,z.jsx)(`div`,{className:`flex items-center gap-1.5`,"aria-hidden":`true`,children:ul.map((t,n)=>(0,z.jsx)(`span`,{className:`h-1.5 w-6 rounded-full transition-colors ${n<=e?`bg-accent`:`bg-line`}`},t.id))}),(0,z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,z.jsx)(`button`,{type:`button`,onClick:i,className:`text-fg-muted hover:text-fg text-xs px-3 py-1`,children:`Skip`}),t&&(0,z.jsx)(`button`,{type:`button`,onClick:n,className:`text-fg-muted hover:text-fg text-xs px-3 py-1 border border-line rounded`,children:`← Back`}),(0,z.jsx)(`button`,{type:`button`,onClick:r,className:`bg-accent text-bg rounded px-4 py-1.5 text-xs font-semibold hover:opacity-90`,children:a?`Finish`:`Next →`})]})]})}function ml({session:e,isLoading:t,onReveal:n}){if(t)return(0,z.jsx)(`p`,{className:`text-sm text-fg-muted`,children:`Looking for your most recent session…`});if(!e)return(0,z.jsxs)(`div`,{className:`space-y-3 text-sm`,children:[(0,z.jsxs)(`p`,{className:`text-fg`,children:[`Claude Recall watches `,(0,z.jsx)(`code`,{className:`font-mono text-xs text-fg-muted`,children:`~/.claude/projects/`}),` `,`and indexes every session Claude Code has written — automatically, in the background, offline.`]}),(0,z.jsx)(`p`,{className:`text-fg-muted`,children:`No sessions are indexed yet. Start a Claude Code conversation anywhere on this machine, then come back — Recall will pick it up within seconds.`})]});let r=e.alias??e.first_user_message??e.id.slice(0,8),i=e.ended_at??e.started_at;return(0,z.jsxs)(`div`,{className:`space-y-4`,children:[(0,z.jsxs)(`p`,{className:`text-sm text-fg leading-relaxed`,children:[`Here’s your `,(0,z.jsx)(`span`,{className:`text-accent font-semibold`,children:`most recent Claude Code session`}),` — already indexed and searchable. Nothing left the machine; Recall just watches the files Claude Code was already writing.`]}),(0,z.jsxs)(`div`,{className:`rounded-md border border-accent/40 bg-accent/10 px-4 py-3`,children:[(0,z.jsx)(`div`,{className:`text-[11px] uppercase tracking-wide text-accent font-semibold mb-1`,children:`Highlighted behind this dialog`}),(0,z.jsx)(`div`,{className:`text-sm text-fg font-medium truncate`,title:r,children:r}),(0,z.jsxs)(`div`,{className:`text-[11px] text-fg-muted mt-1 flex flex-wrap gap-x-3 gap-y-0.5`,children:[(0,z.jsx)(`span`,{children:e.project}),(0,z.jsx)(`span`,{children:`·`}),(0,z.jsxs)(`span`,{children:[e.message_count,` messages`]}),i&&(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(`span`,{children:`·`}),(0,z.jsx)(`span`,{children:_l(i)})]}),(0,z.jsx)(`span`,{children:`·`}),(0,z.jsx)(`span`,{className:`font-mono`,children:e.id.slice(0,8)})]})]}),(0,z.jsx)(`button`,{type:`button`,onClick:n,className:`text-xs text-accent hover:underline`,children:`Re-highlight the transcript behind this dialog →`})]})}function hl({session:e}){let[t,n]=(0,R.useState)(!1),r=(0,R.useMemo)(()=>e?`recall context ${e.id.slice(0,8)} | claude`:``,[e]),i=(0,R.useCallback)(async()=>{if(r)try{await navigator.clipboard.writeText(r),n(!0),G({message:`Command copied. Paste it in a terminal to start a fresh Claude Code session with full context.`,tone:`success`,duration:8e3}),setTimeout(()=>n(!1),2500)}catch(e){G({message:`Clipboard blocked: ${e instanceof Error?e.message:String(e)}. Copy the command manually.`,tone:`error`})}},[r]);return(0,z.jsxs)(`div`,{className:`space-y-4`,children:[(0,z.jsxs)(`p`,{className:`text-sm text-fg leading-relaxed`,children:[`This is the feature nobody else has: `,(0,z.jsx)(`span`,{className:`text-accent font-semibold`,children:`pipe any past session back into a new Claude Code conversation`}),`. Claude wakes up already knowing everything you discussed before.`]}),e?(0,z.jsx)(`div`,{className:`rounded-md border border-line bg-bg-elevated px-3 py-2`,children:(0,z.jsx)(`div`,{className:`font-mono text-xs text-fg break-all`,children:r})}):(0,z.jsx)(`p`,{className:`text-sm text-fg-muted`,children:`Once you have indexed sessions, this step shows a one-click copy for the most recent one.`}),(0,z.jsx)(`button`,{type:`button`,onClick:()=>void i(),disabled:!r,className:`w-full bg-accent text-bg rounded px-4 py-2.5 text-sm font-semibold hover:opacity-90 disabled:opacity-40 disabled:cursor-not-allowed`,children:t?`✓ Copied — paste into a terminal`:`📋 Copy resume command to clipboard`}),(0,z.jsx)(`div`,{className:`text-[11px] text-fg-muted leading-relaxed`,children:(0,z.jsxs)(`p`,{children:[`Paste the command in any terminal to launch a fresh `,(0,z.jsx)(`code`,{className:`font-mono text-fg`,children:`claude`}),` `,`session with the prior context preinjected. You can also run`,` `,(0,z.jsx)(`code`,{className:`font-mono text-fg`,children:`recall context <id> --full`}),` for the complete transcript or `,(0,z.jsx)(`code`,{className:`font-mono text-fg`,children:`--since 2h`}),` to clip just the last two hours.`]})})]})}function gl({claudeCliAvailable:e,mcpInstalled:t,onOpenSettings:n,onFinish:r}){let[i,a]=(0,R.useState)(!1),[o,s]=(0,R.useState)(null),[c,l]=(0,R.useState)(null),[u,d]=(0,R.useState)(0),f=(0,R.useRef)(null),p=e&&t;(0,R.useEffect)(()=>{if(!i)return;let e=f.current??Date.now();f.current=e,d(Math.floor((Date.now()-e)/1e3));let t=window.setInterval(()=>{d(Math.floor((Date.now()-e)/1e3))},1e3);return()=>window.clearInterval(t)},[i]);let m=(0,R.useCallback)(async()=>{if(!p||i)return;let e=typeof crypto<`u`&&`randomUUID`in crypto?crypto.randomUUID():`scan-${Date.now()}-${Math.random().toString(36).slice(2,8)}`;a(!0),s(null),l(null),f.current=Date.now(),d(0);let t=W.subscribeToScanProgress(e);t.addEventListener(`progress`,e=>{try{let t=JSON.parse(e.data);l({current:t.current,total:t.total,sessionLabel:t.sessionLabel})}catch{}}),t.addEventListener(`done`,()=>{t.close()}),t.onerror=()=>{t.close()};try{let t=await W.runClaudeCliScan({untaggedOnly:!0,limit:10},{scanId:e});s({tagsAdded:t.tagsAdded,success:t.success}),t.success?G({message:`Auto-tag added ${t.tagsAdded} tag${t.tagsAdded===1?``:`s`} across your 10 most recent sessions.`,tone:`success`,duration:8e3}):G({message:`Auto-tag run finished with exit ${t.exitCode??`?`}. Check the ⚙ button on the top bar for details.`,tone:`error`})}catch(e){G({message:`Auto-tag failed: ${e instanceof Error?e.message:String(e)}`,tone:`error`})}finally{t.close(),a(!1),f.current=null}},[p,i]),h=(0,R.useMemo)(()=>{if(!c||c.current<2||c.total<=c.current)return null;let e=u/c.current;return Math.max(1,Math.round(e*(c.total-c.current)))},[c,u]);return(0,z.jsxs)(`div`,{className:`space-y-4`,children:[(0,z.jsxs)(`p`,{className:`text-sm text-fg leading-relaxed`,children:[`Let Claude Recall `,(0,z.jsx)(`span`,{className:`text-accent font-semibold`,children:`auto-tag`}),` your last`,` `,`10 sessions so you can find them by topic later —`,` `,(0,z.jsx)(`code`,{className:`font-mono text-xs`,children:`#auth-fix`}),`,`,` `,(0,z.jsx)(`code`,{className:`font-mono text-xs`,children:`#migration`}),`, and so on. Opt-in, local, reversible.`]}),p?(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(`button`,{type:`button`,onClick:()=>void m(),disabled:i,className:`w-full bg-accent text-bg rounded px-4 py-2.5 text-sm font-semibold hover:opacity-90 disabled:opacity-60 disabled:cursor-wait flex items-center justify-center gap-2`,children:i?(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(Qs,{size:16}),(0,z.jsx)(`span`,{children:`Tagging via your Claude Code agent…`})]}):(0,z.jsx)(`span`,{children:`🏷 Tag my 10 most recent sessions`})}),i&&(0,z.jsxs)(`div`,{className:`text-xs rounded border border-line bg-bg-elevated px-3 py-2 text-fg-muted`,role:`status`,"aria-live":`polite`,children:[(0,z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,z.jsx)(Qs,{size:16}),(0,z.jsx)(`span`,{className:`text-fg`,children:c?`Tagging session ${c.current} of ${c.total}`:`Preparing…`})]}),(0,z.jsxs)(`div`,{className:`mt-1 flex flex-wrap gap-x-2 text-[11px]`,children:[(0,z.jsxs)(`span`,{children:[u,`s elapsed`]}),h!==null&&(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(`span`,{children:`·`}),(0,z.jsxs)(`span`,{children:[`~`,h,`s remaining`]})]}),c?.sessionLabel&&(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(`span`,{children:`·`}),(0,z.jsx)(`span`,{className:`truncate max-w-[24ch]`,title:c.sessionLabel,children:c.sessionLabel})]})]})]}),o&&!i&&(0,z.jsx)(`div`,{className:`text-xs rounded border px-3 py-2 ${o.success?`border-accent/40 bg-accent/10 text-fg`:`border-role-user/40 bg-role-user/10 text-fg`}`,children:o.success?`Added ${o.tagsAdded} tag${o.tagsAdded===1?``:`s`}. You can review or remove them anytime from the session transcript.`:`The agent exited with an error. Open ⚙ on the 🏷 auto-tag button for logs.`}),(0,z.jsx)(`div`,{className:`text-[11px] text-fg-muted`,children:`Uses your existing Claude Code subscription via the Recall MCP server — no extra API cost.`}),(0,z.jsx)(`button`,{type:`button`,onClick:()=>void r(),className:`text-xs text-fg-muted hover:text-fg`,children:`Skip this — I’ll tag sessions myself →`})]}):(0,z.jsxs)(z.Fragment,{children:[(0,z.jsxs)(`div`,{className:`rounded-md border border-line bg-bg-elevated px-3 py-2.5 text-xs text-fg-muted space-y-1`,children:[(0,z.jsx)(`div`,{children:`One-click auto-tagging needs two things already set up:`}),(0,z.jsxs)(`ul`,{className:`pl-4 list-disc marker:text-fg-muted space-y-0.5`,children:[(0,z.jsxs)(`li`,{children:[`Recall’s MCP server installed in Claude Code —`,` `,(0,z.jsx)(`span`,{className:t?`text-accent`:`text-role-user`,children:t?`installed ✓`:`not installed`})]}),(0,z.jsxs)(`li`,{children:[`The `,(0,z.jsx)(`code`,{className:`font-mono text-fg`,children:`claude`}),` CLI on your PATH —`,` `,(0,z.jsx)(`span`,{className:e?`text-accent`:`text-role-user`,children:e?`found ✓`:`not found`})]})]})]}),(0,z.jsx)(`button`,{type:`button`,onClick:n,className:`w-full bg-accent text-bg rounded px-4 py-2.5 text-sm font-semibold hover:opacity-90`,children:`Set up auto-tagging →`}),(0,z.jsx)(`div`,{className:`text-[11px] text-fg-muted`,children:`You can also paste an Anthropic API key in the same settings dialog if you prefer an API-backed scan.`})]})]})}function _l(e){try{let t=new Date(e),n=Date.now()-t.getTime(),r=Math.round(n/6e4);if(r<1)return`just now`;if(r<60)return`${r}m ago`;let i=Math.round(r/60);if(i<24)return`${i}h ago`;let a=Math.round(i/24);return a<30?`${a}d ago`:t.toLocaleDateString()}catch{return e}}var vl=[{id:`what`,title:`A thread groups sessions by intent`},{id:`how`,title:`Three ways to add a session to a thread`},{id:`pipe`,title:`Pipe a whole thread back into Claude Code`}];function yl({onClose:e}){let t=ll(),[n,r]=(0,R.useState)(0),i=vl[n].id,a=(0,R.useCallback)(()=>{e(),t.patch({threadsIntroSeen:!0}).catch(()=>{})},[t,e]);Kn(!0,a);let o=(0,R.useCallback)(()=>{n<vl.length-1?r(e=>e+1):a()},[n,a]),s=(0,R.useCallback)(()=>{n>0&&r(e=>e-1)},[n]);return(0,z.jsx)(`div`,{className:`fixed inset-0 z-40 bg-black/60 flex items-end sm:items-center justify-center p-4 sm:p-6`,role:`dialog`,"aria-labelledby":`threads-intro-title`,"aria-modal":`true`,children:(0,z.jsxs)(`div`,{className:`bg-bg border border-line rounded-lg w-[560px] max-w-[calc(100vw-2rem)] max-h-[calc(100vh-4rem)] overflow-y-auto shadow-2xl flex flex-col`,children:[(0,z.jsx)(bl,{stepIdx:n,onSkip:a}),(0,z.jsxs)(`div`,{className:`flex-1 px-6 py-5`,children:[i===`what`&&(0,z.jsx)(Sl,{}),i===`how`&&(0,z.jsx)(wl,{}),i===`pipe`&&(0,z.jsx)(Tl,{})]}),(0,z.jsx)(xl,{stepIdx:n,canBack:n>0,onBack:s,onNext:o,onSkip:a,isFinalStep:n===vl.length-1})]})})}function bl({stepIdx:e,onSkip:t}){return(0,z.jsxs)(`div`,{className:`px-6 py-4 border-b border-line flex items-center justify-between gap-3`,children:[(0,z.jsxs)(`div`,{className:`flex items-center gap-2.5 min-w-0`,children:[(0,z.jsx)(`div`,{className:`h-7 w-7 rounded-md bg-accent flex items-center justify-center text-bg font-bold text-sm shrink-0`,children:`🧵`}),(0,z.jsxs)(`div`,{className:`min-w-0`,children:[(0,z.jsx)(`div`,{id:`threads-intro-title`,className:`text-sm font-semibold text-fg leading-none`,children:`Welcome to Threads`}),(0,z.jsxs)(`div`,{className:`text-[11px] text-fg-muted mt-1`,children:[`Step `,e+1,` of `,vl.length,` · `,vl[e].title]})]})]}),(0,z.jsx)(`button`,{type:`button`,onClick:t,className:`text-xs text-fg-muted hover:text-fg whitespace-nowrap`,title:`dismiss the tour (Esc)`,children:`I can explore on my own →`})]})}function xl({stepIdx:e,canBack:t,onBack:n,onNext:r,onSkip:i,isFinalStep:a}){return(0,z.jsxs)(`div`,{className:`px-6 py-3 border-t border-line flex items-center justify-between gap-2 bg-bg-elevated`,children:[(0,z.jsx)(`div`,{className:`flex items-center gap-1.5`,"aria-hidden":`true`,children:vl.map((t,n)=>(0,z.jsx)(`span`,{className:`h-1.5 w-6 rounded-full transition-colors ${n<=e?`bg-accent`:`bg-line`}`},t.id))}),(0,z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,z.jsx)(`button`,{type:`button`,onClick:i,className:`text-fg-muted hover:text-fg text-xs px-3 py-1`,children:`Skip`}),t&&(0,z.jsx)(`button`,{type:`button`,onClick:n,className:`text-fg-muted hover:text-fg text-xs px-3 py-1 border border-line rounded`,children:`← Back`}),(0,z.jsx)(`button`,{type:`button`,onClick:r,className:`bg-accent text-bg rounded px-4 py-1.5 text-xs font-semibold hover:opacity-90`,children:a?`Done`:`Next →`})]})]})}function Sl(){return(0,z.jsxs)(`div`,{className:`space-y-4`,children:[(0,z.jsx)(`p`,{className:`text-sm text-fg leading-relaxed`,children:`A thread is the unit of work you remember afterwards. It links one planning session to every session that acts on the plan, so you can keep working across days, branches, and machines, and still pull it all back together in one view.`}),(0,z.jsx)(`div`,{className:`rounded-md border border-line bg-bg-elevated p-4 flex justify-center`,children:(0,z.jsx)(Cl,{})}),(0,z.jsx)(`p`,{className:`text-[11px] text-fg-muted leading-relaxed`,children:`One origin session at the top. Three child sessions below. The thread is the shape, not any single session.`})]})}function Cl(){return(0,z.jsx)(`svg`,{viewBox:`0 0 340 200`,width:`100%`,height:`180`,role:`img`,"aria-label":`Sketch of a thread: one origin session with three child sessions branching below it.`,className:`text-fg`,children:(0,z.jsxs)(`g`,{fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,z.jsxs)(`g`,{transform:`translate(170 32) rotate(-0.8)`,children:[(0,z.jsx)(`rect`,{x:`-60`,y:`-18`,width:`120`,height:`36`,rx:`6`,ry:`6`,strokeWidth:`1.75`}),(0,z.jsx)(`text`,{x:`0`,y:`5`,textAnchor:`middle`,fontSize:`12`,fontFamily:`ui-sans-serif, system-ui, sans-serif`,fill:`currentColor`,stroke:`none`,children:`Planning session`})]}),(0,z.jsx)(`path`,{d:`M 150 60 C 140 90, 80 90, 70 130`,strokeWidth:`1.4`}),(0,z.jsx)(`path`,{d:`M 170 62 C 170 95, 170 100, 170 130`,strokeWidth:`1.4`}),(0,z.jsx)(`path`,{d:`M 190 60 C 200 90, 260 90, 270 130`,strokeWidth:`1.4`}),(0,z.jsxs)(`g`,{transform:`translate(70 150) rotate(1.1)`,children:[(0,z.jsx)(`rect`,{x:`-45`,y:`-16`,width:`90`,height:`32`,rx:`6`,ry:`6`,strokeWidth:`1.6`}),(0,z.jsx)(`text`,{x:`0`,y:`4`,textAnchor:`middle`,fontSize:`11`,fontFamily:`ui-sans-serif, system-ui, sans-serif`,fill:`currentColor`,stroke:`none`,children:`Execution 1`})]}),(0,z.jsxs)(`g`,{transform:`translate(170 150) rotate(-0.6)`,children:[(0,z.jsx)(`rect`,{x:`-45`,y:`-16`,width:`90`,height:`32`,rx:`6`,ry:`6`,strokeWidth:`1.6`}),(0,z.jsx)(`text`,{x:`0`,y:`4`,textAnchor:`middle`,fontSize:`11`,fontFamily:`ui-sans-serif, system-ui, sans-serif`,fill:`currentColor`,stroke:`none`,children:`Execution 2`})]}),(0,z.jsxs)(`g`,{transform:`translate(270 150) rotate(0.9)`,children:[(0,z.jsx)(`rect`,{x:`-45`,y:`-16`,width:`90`,height:`32`,rx:`6`,ry:`6`,strokeWidth:`1.6`}),(0,z.jsx)(`text`,{x:`0`,y:`4`,textAnchor:`middle`,fontSize:`11`,fontFamily:`ui-sans-serif, system-ui, sans-serif`,fill:`currentColor`,stroke:`none`,children:`Execution 3`})]})]})})}function wl(){return(0,z.jsxs)(`div`,{className:`space-y-4`,children:[(0,z.jsx)(`p`,{className:`text-sm text-fg leading-relaxed`,children:`You can add a session to a thread from three places. Pick whichever one is closest to where you already are.`}),(0,z.jsxs)(`ol`,{className:`space-y-3 text-sm text-fg`,children:[(0,z.jsxs)(`li`,{className:`flex gap-3`,children:[(0,z.jsx)(`span`,{className:`shrink-0 h-6 w-6 rounded-full bg-accent/20 text-accent flex items-center justify-center text-xs font-semibold`,"aria-hidden":`true`,children:`1`}),(0,z.jsxs)(`div`,{children:[(0,z.jsx)(`div`,{className:`font-medium`,children:`From a session transcript`}),(0,z.jsxs)(`p`,{className:`text-xs text-fg-muted mt-0.5 leading-relaxed`,children:[`Open any session from the sidebar. In the transcript header, click`,` `,(0,z.jsx)(`span`,{className:`font-mono text-fg`,children:`+ Add to thread`}),` and pick the thread you want.`]})]})]}),(0,z.jsxs)(`li`,{className:`flex gap-3`,children:[(0,z.jsx)(`span`,{className:`shrink-0 h-6 w-6 rounded-full bg-accent/20 text-accent flex items-center justify-center text-xs font-semibold`,"aria-hidden":`true`,children:`2`}),(0,z.jsxs)(`div`,{children:[(0,z.jsx)(`div`,{className:`font-medium`,children:`From this Threads page`}),(0,z.jsxs)(`p`,{className:`text-xs text-fg-muted mt-0.5 leading-relaxed`,children:[`Select a thread on the left. Click`,` `,(0,z.jsx)(`span`,{className:`font-mono text-fg`,children:`+ Add session`}),` on the top right and search for the session by alias, project, or first message.`]})]})]}),(0,z.jsxs)(`li`,{className:`flex gap-3`,children:[(0,z.jsx)(`span`,{className:`shrink-0 h-6 w-6 rounded-full bg-accent/20 text-accent flex items-center justify-center text-xs font-semibold`,"aria-hidden":`true`,children:`3`}),(0,z.jsxs)(`div`,{children:[(0,z.jsx)(`div`,{className:`font-medium`,children:`From a terminal`}),(0,z.jsxs)(`p`,{className:`text-xs text-fg-muted mt-0.5 leading-relaxed`,children:[`Run`,` `,(0,z.jsx)(`span`,{className:`font-mono text-fg`,children:`recall thread link <session-id> --thread <thread-id>`}),` `,`in a shell. Works in scripts. Short identifiers are fine as long as they are unambiguous.`]})]})]})]})]})}function Tl(){return(0,z.jsxs)(`div`,{className:`space-y-4`,children:[(0,z.jsx)(`p`,{className:`text-sm text-fg leading-relaxed`,children:`When you start a fresh conversation, you can load every session in a thread as context for Claude Code with one command. It wakes up knowing the plan and every execution session that followed, so you pick up exactly where the thread left off.`}),(0,z.jsx)(`div`,{className:`rounded-md border border-line bg-bg-elevated px-3 py-2`,children:(0,z.jsx)(`div`,{className:`font-mono text-xs text-fg break-all`,children:`recall context thread:<id> | claude`})}),(0,z.jsxs)(`ul`,{className:`text-[11px] text-fg-muted leading-relaxed space-y-1 list-disc pl-4 marker:text-fg-muted`,children:[(0,z.jsxs)(`li`,{children:[`Replace`,` `,(0,z.jsx)(`span`,{className:`font-mono text-fg`,children:`<id>`}),` `,`with the thread identifier shown in the list on the left. The first few characters are enough as long as they are unambiguous.`]}),(0,z.jsx)(`li`,{children:`Sessions are concatenated in thread order: origins first, then children in the order they were added.`}),(0,z.jsx)(`li`,{children:`Nothing leaves your machine. The pipe is between two local programs.`})]})]})}function El(e){let t=e/100;return t===0?`$0.00`:t<.01?`<$0.01`:t<100?`$${t.toFixed(2)}`:t<1e4?`$${t.toFixed(0)}`:`$${(t/1e3).toFixed(1)}k`}function Dl(e){let t=e/100;return t===0?`$0.00`:t<1?`$${t.toFixed(4)}`:t<100?`$${t.toFixed(2)}`:`$${t.toLocaleString(void 0,{maximumFractionDigits:2})}`}function Ol(e){return!Number.isFinite(e)||e<0?`0`:e<1e3?String(Math.round(e)):e<1e6?`${(e/1e3).toFixed(1)}k`:e<1e9?`${(e/1e6).toFixed(2)}M`:e<0xe8d4a51000?`${(e/1e9).toFixed(2)}B`:`${(e/0xe8d4a51000).toFixed(2)}T`}function kl(e){return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,`0`)}-${String(e.getDate()).padStart(2,`0`)}`}function Al(e){let[t,n,r]=e.split(`-`).map(Number);return new Date(t,n-1,r).toLocaleDateString(void 0,{month:`short`,day:`numeric`})}function jl(e,t){let n=new Map;for(let t of e)n.set(t.day,{tokens:t.tokens,cents:t.cents});if(t===`7d`||t===`30d`){let e=t===`7d`?7:30,r=new Date;r.setHours(0,0,0,0);let i=[];for(let t=e-1;t>=0;t--){let e=new Date(r);e.setDate(e.getDate()-t);let a=kl(e),o=n.get(a);i.push({day:a,tokens:o?.tokens??0,cents:o?.cents??0})}return i}if(e.length===0)return[];let[r,i,a]=[...e].sort((e,t)=>e.day.localeCompare(t.day))[0].day.split(`-`).map(Number),o=new Date(r,i-1,a),s=new Date;s.setHours(0,0,0,0);let c=Math.floor((s.getTime()-o.getTime())/864e5)+1,l=Math.min(90,Math.max(1,c)),u=[];for(let e=l-1;e>=0;e--){let t=new Date(s);t.setDate(t.getDate()-e);let r=kl(t),i=n.get(r);u.push({day:r,tokens:i?.tokens??0,cents:i?.cents??0})}return u}function Ml({axis:e,range:t}){let[n,r]=(0,R.useState)(null);if(e.length===0)return(0,z.jsx)(`div`,{className:`text-xs text-fg-muted text-center py-6`,children:`No usage data in this range.`});let i=Math.max(1,...e.map(e=>e.cents)),a=704/e.length,o=Math.max(2,a-2),s=e.length<=7?1:e.length<=14?2:e.length<=30?5:10;return(0,z.jsxs)(`div`,{className:`relative`,children:[(0,z.jsxs)(`svg`,{width:720,height:120,viewBox:`0 0 720 120`,className:`w-full h-auto`,role:`img`,"aria-label":`Daily cost chart`,onMouseLeave:()=>r(null),children:[(0,z.jsx)(`line`,{x1:8,x2:712,y1:102,y2:102,className:`stroke-line`,strokeWidth:1}),e.map((e,t)=>{let s=8+t*a+(a-o)/2,c=e.cents>0?Math.max(2,e.cents/i*98):0,l=102-c,u=n?.i===t,d=e.cents===0;return(0,z.jsxs)(`g`,{children:[(0,z.jsx)(`rect`,{x:8+t*a,y:0,width:a,height:102,fill:`transparent`,onMouseEnter:()=>r({i:t,day:e.day,tokens:e.tokens,cents:e.cents,x:8+t*a+a/2})}),(0,z.jsx)(`rect`,{x:s,y:d?100:l,width:o,height:d?2:c,rx:1,className:d?`fill-line`:u?`fill-accent`:`fill-accent/70`,pointerEvents:`none`})]},e.day)}),e.map((t,n)=>n%s!==0&&n!==e.length-1?null:(0,z.jsx)(`text`,{x:8+n*a+a/2,y:116,textAnchor:`middle`,className:`fill-fg-muted`,fontSize:9,children:Al(t.day)},`tick-${t.day}`))]}),n&&(0,z.jsxs)(`div`,{className:`absolute pointer-events-none bg-bg-elevated border border-line rounded-lg shadow-xl px-3 py-2 text-xs -translate-x-1/2`,style:{left:`${n.x/720*100}%`,top:4},children:[(0,z.jsx)(`div`,{className:`font-medium text-fg`,children:Al(n.day)}),(0,z.jsx)(`div`,{className:`text-accent font-semibold tabular-nums mt-0.5`,children:Dl(n.cents)}),(0,z.jsxs)(`div`,{className:`text-fg-muted tabular-nums`,children:[Ol(n.tokens),` tokens`]})]}),(0,z.jsxs)(`div`,{className:`flex items-center justify-between text-[10px] text-fg-muted mt-2`,children:[(0,z.jsxs)(`span`,{children:[t===`7d`?`Last 7 days`:t===`30d`?`Last 30 days`:e.length>=90?`Last 90 days (capped for readability)`:`Last ${e.length} days`,` `,`· local time · hover for detail`]}),(0,z.jsxs)(`span`,{className:`tabular-nums`,children:[`peak `,Dl(i)]})]})]})}function Nl({text:e,align:t=`center`}){let[n,r]=(0,R.useState)(!1);return(0,z.jsxs)(`span`,{className:`relative inline-block ml-1 align-middle`,onMouseEnter:()=>r(!0),onMouseLeave:()=>r(!1),children:[(0,z.jsx)(`span`,{tabIndex:0,role:`button`,"aria-label":e,onFocus:()=>r(!0),onBlur:()=>r(!1),className:`inline-flex items-center justify-center w-[14px] h-[14px] rounded-full border border-line text-fg-muted text-[9px] font-medium cursor-help hover:text-fg hover:border-fg-dim`,children:`?`}),n&&(0,z.jsx)(`span`,{role:`tooltip`,className:`absolute z-50 top-full mt-2 w-64 px-3 py-2 text-xs leading-relaxed bg-bg-elevated border border-line rounded-lg shadow-xl text-fg-muted pointer-events-none whitespace-normal normal-case tracking-normal font-normal `+(t===`left`?`left-0`:t===`right`?`right-0`:`left-1/2 -translate-x-1/2`),children:e})]})}function Pl({input:e,output:t,cacheCreate:n,cacheRead:r}){return e+t+n+r===0?(0,z.jsx)(`div`,{className:`text-[10px] text-fg-muted mt-2`,children:`no tokens in range`}):(0,z.jsx)(`div`,{className:`mt-2 space-y-1`,children:[{key:`output`,label:`Output`,sub:`what the model wrote`,value:t,cls:`bg-accent`},{key:`cache-r`,label:`Cache read`,sub:`cached prefix re-read each turn · 10× cheaper`,value:r,cls:`bg-fg-muted`},{key:`cache-w`,label:`Cache write`,sub:`first-time cache fills`,value:n,cls:`bg-role-tool`},{key:`input`,label:`Input`,sub:`fresh text sent to the model`,value:e,cls:`bg-role-user`}].sort((e,t)=>t.value-e.value).map(e=>(0,z.jsxs)(`div`,{className:`flex items-center gap-2 text-[11px]`,children:[(0,z.jsx)(`span`,{className:`inline-block w-2 h-2 rounded-sm shrink-0 `+e.cls}),(0,z.jsx)(`span`,{className:`text-fg w-20 shrink-0`,children:e.label}),(0,z.jsx)(`span`,{className:`text-fg-muted flex-1 truncate`,children:e.sub}),(0,z.jsx)(`span`,{className:`text-fg font-medium tabular-nums`,children:Ol(e.value)})]},e.key))})}function Q({onClose:e,onSelectSession:t}){let[n,r]=(0,R.useState)(`30d`),i=B(),a=V({queryKey:[`statsOverview`,n],queryFn:()=>W.getOverviewStats(n),refetchInterval:3e4,refetchIntervalInBackground:!1,refetchOnWindowFocus:!0}),[o,s]=(0,R.useState)(null),[c,l]=(0,R.useState)(!1),u=at({mutationFn:()=>W.triggerStatsBackfill(),onMutate:()=>{s({kind:`info`,text:`Scanning…`})},onSuccess:e=>{i.invalidateQueries({queryKey:[`statsOverview`]}),i.invalidateQueries({queryKey:[`sessionStats`]});let t=e.result??null;if(e.mode===`background`){s({kind:`info`,text:`Large backlog — scanning in background. Refresh in a moment.`});return}t&&t.inserted>0?s({kind:`success`,text:`Recovered ${t.inserted.toLocaleString()} usage rows across ${t.sessionsTouched.toLocaleString()} sessions.`}):t&&s({kind:`noop`,text:`Scanned ${t.scanned.toLocaleString()} message${t.scanned===1?``:`s`} — none carried recoverable usage data. These messages are aborted/cancelled assistant turns or pre-v0.10 Claude Code output and can't be priced.`})},onError:e=>{s({kind:`noop`,text:`Backfill failed: ${e.message}`})}}),d=a.data,f=(0,R.useMemo)(()=>d?jl(d.daily,n):[],[d,n]),[p,m]=(0,R.useState)(()=>Date.now());(0,R.useEffect)(()=>{let e=window.setInterval(()=>m(Date.now()),1e3);return()=>window.clearInterval(e)},[]);let h=a.dataUpdatedAt?Math.max(0,Math.floor((p-a.dataUpdatedAt)/1e3)):null,g=h===null?`—`:h<5?`just now`:h<60?`${h}s ago`:h<3600?`${Math.floor(h/60)}m ago`:`${Math.floor(h/3600)}h ago`;return(0,z.jsx)(`div`,{className:`absolute inset-0 z-30 bg-bg/95 backdrop-blur-sm flex items-start justify-center overflow-y-auto`,children:(0,z.jsxs)(`div`,{className:`w-full max-w-4xl p-6`,children:[(0,z.jsxs)(`div`,{className:`flex items-center justify-between mb-6`,children:[(0,z.jsxs)(`div`,{children:[(0,z.jsx)(`h1`,{className:`text-lg font-semibold`,children:`Cost & tokens`}),(0,z.jsxs)(`div`,{className:`text-xs text-fg-muted mt-1 flex items-center gap-2`,children:[(0,z.jsx)(`span`,{children:`Local-only — derived from the usage counters Claude Code writes into your session files. No telemetry.`}),(0,z.jsxs)(`button`,{type:`button`,onClick:()=>a.refetch(),disabled:a.isFetching,title:`Refresh now`,className:`inline-flex items-center gap-1 text-[10px] text-fg-dim hover:text-fg disabled:opacity-50 border-l border-line pl-2`,children:[(0,z.jsx)(`span`,{className:`inline-block `+(a.isFetching?`animate-spin`:``),children:`↻`}),(0,z.jsx)(`span`,{className:`tabular-nums`,children:a.isFetching?`refreshing…`:`updated ${g}`})]})]})]}),(0,z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,z.jsx)(`div`,{className:`flex items-center text-xs border border-line rounded-lg overflow-hidden`,children:[`7d`,`30d`,`all`].map((e,t)=>(0,z.jsx)(`button`,{type:`button`,onClick:()=>r(e),className:(t===0?``:`border-l border-line `)+`px-3 py-1.5 transition-colors `+(n===e?`bg-accent text-bg font-medium`:`bg-bg-elevated text-fg-dim hover:text-fg`),children:e===`all`?`all-time`:e},e))}),(0,z.jsx)(`button`,{type:`button`,onClick:e,className:`text-xs px-2.5 py-1.5 text-fg-dim hover:text-fg border border-line rounded-lg`,children:`✕ close`})]})]}),a.isLoading&&(0,z.jsx)(`div`,{className:`text-sm text-fg-muted`,children:`loading…`}),a.error&&(0,z.jsxs)(`div`,{className:`text-sm text-red-400`,children:[`failed to load: `,a.error.message]}),d&&(0,z.jsxs)(z.Fragment,{children:[(0,z.jsxs)(`div`,{className:`grid grid-cols-2 md:grid-cols-4 gap-3 mb-6`,children:[(0,z.jsx)($,{label:`Estimated cost`,value:d.display.dollars,accent:!0,info:`Sum of all priced tokens × Anthropic list price for each model. Cache reads are 10× cheaper than fresh input. List-price estimate — actual billing may differ.`}),(0,z.jsx)($,{label:`Total tokens`,value:d.display.tokens,hint:`${Ol(d.outputTokens)} output · ${Ol(d.cacheReadTokens)} cache read`,info:`Sum of all four token buckets Anthropic's API reports: input + output + cache-write + cache-read. The big number is usually dominated by cache-read, which re-counts the entire cached prompt prefix on every turn. Cache-read is priced ~10× cheaper than fresh input — see the composition panel below for the full breakdown.`}),(0,z.jsx)($,{label:`Sessions`,value:`${d.sessionsWithUsage.toLocaleString()} / ${d.totalSessions.toLocaleString()}`,hint:`with usage / active`,info:n===`all`?`Sessions Claude Recall has indexed: those with at least one priced message vs the total in the database.`:`Sessions active in this window (any message) and the subset that had at least one priced assistant message.`}),(0,z.jsx)($,{label:`Primary model`,value:d.byModel[0]?.modelLabel??`—`,hint:d.byModel.length>1?`+${d.byModel.length-1} more`:void 0,info:`Model that produced the most spend in this range. See the By-model table below for the full split.`,infoAlign:`right`})]}),(0,z.jsxs)(`section`,{className:`mb-6`,children:[(0,z.jsxs)(`div`,{className:`flex items-center mb-2`,children:[(0,z.jsx)(`h2`,{className:`text-xs uppercase tracking-wider text-fg-dim`,children:`Token composition`}),(0,z.jsx)(Nl,{text:`The same total, split by what Anthropic counted. Cache-read dominates because every assistant turn reports the full cached prompt prefix as tokens read — priced 10× cheaper than fresh input.`})]}),(0,z.jsx)(`div`,{className:`bg-bg-elevated border border-line rounded-lg p-4`,children:(0,z.jsx)(Pl,{input:d.inputTokens,output:d.outputTokens,cacheCreate:d.cacheCreateTokens,cacheRead:d.cacheReadTokens})})]}),(d.backfill.pending>0||o)&&!c&&(0,z.jsxs)(`div`,{className:`mb-6 flex items-start justify-between gap-3 rounded-lg px-4 py-3 border `+(o?.kind===`success`?`bg-green-500/10 border-green-500/40`:`bg-bg-elevated border-line`),children:[(0,z.jsxs)(`div`,{className:`text-xs flex-1`,children:[d.backfill.pending>0&&(0,z.jsx)(`div`,{className:`text-fg font-medium`,children:(()=>{let e=Math.max(0,d.backfill.pending-(d.backfill.unrecoverable??0));return e===0?`${d.backfill.pending.toLocaleString()} message${d.backfill.pending===1?``:`s`} can't be priced — nothing to recover.`:`${e.toLocaleString()} of ${d.backfill.pending.toLocaleString()} assistant message${d.backfill.pending===1?``:`s`} missing usage data.`})()}),(0,z.jsx)(`div`,{className:`text-fg-muted mt-0.5`,children:u.isPending?`Scanning… this may take a few seconds.`:o?.text??(d.backfill.pending>0&&Math.max(0,d.backfill.pending-(d.backfill.unrecoverable??0))===0?`These are aborted/cancelled assistant turns or pre-v0.10 Claude Code output — Anthropic never recorded their token counts.`:`Backfill re-parses the messages' raw JSON to recover token counts. Local only — no reindex, no network.`)})]}),Math.max(0,d.backfill.pending-(d.backfill.unrecoverable??0))>0?(0,z.jsx)(`button`,{type:`button`,onClick:()=>u.mutate(),disabled:u.isPending,className:`text-xs bg-accent text-bg font-medium rounded px-3 py-1.5 disabled:opacity-50 whitespace-nowrap`,children:u.isPending?`scanning…`:`run backfill`}):(0,z.jsx)(`button`,{type:`button`,onClick:()=>l(!0),className:`text-xs text-fg-dim hover:text-fg px-2 py-1.5 whitespace-nowrap`,"aria-label":`Dismiss`,children:`✕`})]}),(0,z.jsxs)(`section`,{className:`mb-6`,children:[(0,z.jsxs)(`div`,{className:`flex items-center mb-2`,children:[(0,z.jsx)(`h2`,{className:`text-xs uppercase tracking-wider text-fg-dim`,children:`Daily spend`}),(0,z.jsx)(Nl,{text:`One bar per local-time day. Empty bars = no priced activity that day. Hover any day for the exact dollar amount and token count. Cost = Σ(tokens × model price).`})]}),(0,z.jsx)(`div`,{className:`bg-bg-elevated border border-line rounded-lg p-3`,children:(0,z.jsx)(Ml,{axis:f,range:n})})]}),d.byModel.length>0&&(0,z.jsxs)(`section`,{className:`mb-6`,children:[(0,z.jsxs)(`div`,{className:`flex items-center mb-2`,children:[(0,z.jsx)(`h2`,{className:`text-xs uppercase tracking-wider text-fg-dim`,children:`By model`}),(0,z.jsx)(Nl,{text:`Per-model token counts and cost in this range. Cache write = first-time cache fill (priced like input). Cache read = subsequent hits (10× cheaper).`})]}),(0,z.jsx)(`div`,{className:`bg-bg-elevated border border-line rounded-lg overflow-hidden`,children:(0,z.jsxs)(`table`,{className:`w-full text-xs`,children:[(0,z.jsx)(`thead`,{className:`bg-bg/60 text-fg-muted`,children:(0,z.jsxs)(`tr`,{children:[(0,z.jsx)(`th`,{className:`text-left px-3 py-2`,children:`model`}),(0,z.jsx)(`th`,{className:`text-right px-3 py-2`,title:`Fresh tokens sent to the model`,children:`input`}),(0,z.jsx)(`th`,{className:`text-right px-3 py-2`,title:`Tokens generated by the model`,children:`output`}),(0,z.jsx)(`th`,{className:`text-right px-3 py-2`,title:`Cache create — first-time cache fill, priced like input`,children:`cache w`}),(0,z.jsx)(`th`,{className:`text-right px-3 py-2`,title:`Cache read — subsequent cache hits, ~10× cheaper than input`,children:`cache r`}),(0,z.jsx)(`th`,{className:`text-right px-3 py-2`,children:`cost`})]})}),(0,z.jsx)(`tbody`,{children:d.byModel.map(e=>(0,z.jsxs)(`tr`,{className:`border-t border-line`,children:[(0,z.jsx)(`td`,{className:`px-3 py-2 font-medium`,children:e.modelLabel}),(0,z.jsx)(`td`,{className:`text-right px-3 py-2 tabular-nums`,children:Ol(e.inputTokens)}),(0,z.jsx)(`td`,{className:`text-right px-3 py-2 tabular-nums`,children:Ol(e.outputTokens)}),(0,z.jsx)(`td`,{className:`text-right px-3 py-2 tabular-nums`,children:Ol(e.cacheCreateTokens)}),(0,z.jsx)(`td`,{className:`text-right px-3 py-2 tabular-nums`,children:Ol(e.cacheReadTokens)}),(0,z.jsx)(`td`,{className:`text-right px-3 py-2 font-semibold text-accent`,children:El(e.cost.cents)})]},e.model??`__unknown__`))})]})})]}),d.topSessions.length>0&&(0,z.jsxs)(`section`,{className:`mb-6`,children:[(0,z.jsxs)(`div`,{className:`flex items-center mb-2`,children:[(0,z.jsx)(`h2`,{className:`text-xs uppercase tracking-wider text-fg-dim`,children:`Top sessions`}),(0,z.jsx)(Nl,{text:`The 10 most expensive sessions in this range, ranked by tokens used inside the window. Click any row to open the transcript.`})]}),(0,z.jsx)(`div`,{className:`bg-bg-elevated border border-line rounded-lg overflow-hidden`,children:(0,z.jsxs)(`table`,{className:`w-full text-xs`,children:[(0,z.jsx)(`thead`,{className:`bg-bg/60 text-fg-muted`,children:(0,z.jsxs)(`tr`,{children:[(0,z.jsx)(`th`,{className:`text-left px-3 py-2`,children:`session`}),(0,z.jsx)(`th`,{className:`text-left px-3 py-2`,children:`project`}),(0,z.jsx)(`th`,{className:`text-right px-3 py-2`,children:`tokens`}),(0,z.jsx)(`th`,{className:`text-right px-3 py-2`,children:`cost`})]})}),(0,z.jsx)(`tbody`,{children:d.topSessions.map(e=>(0,z.jsxs)(`tr`,{className:`border-t border-line hover:bg-bg-hover cursor-pointer`,onClick:()=>t(e.sessionId),children:[(0,z.jsx)(`td`,{className:`px-3 py-2 font-mono truncate max-w-[200px]`,children:e.alias??e.sessionId.slice(0,12)}),(0,z.jsx)(`td`,{className:`px-3 py-2 text-fg-muted truncate max-w-[200px]`,children:e.project??`—`}),(0,z.jsx)(`td`,{className:`text-right px-3 py-2 tabular-nums`,children:Ol(e.totalTokens)}),(0,z.jsx)(`td`,{className:`text-right px-3 py-2 font-semibold text-accent`,children:El(e.cost.cents)})]},e.sessionId))})]})}),(0,z.jsx)(`p`,{className:`text-[10px] text-fg-muted mt-2`,children:`Showing the top 10 sessions by tokens. Smaller projects with only a few sessions won't appear here even though they're fully indexed — every project shows up in the per-project view (and in the daily chart total).`})]})]})]})})}function $({label:e,value:t,accent:n,hint:r,info:i,infoAlign:a=`left`,extra:o}){return(0,z.jsxs)(`div`,{className:`bg-bg-elevated border border-line rounded-lg px-4 py-3`,children:[(0,z.jsxs)(`div`,{className:`flex items-center text-[10px] uppercase tracking-wider text-fg-muted`,children:[(0,z.jsx)(`span`,{children:e}),i&&(0,z.jsx)(Nl,{text:i,align:a})]}),(0,z.jsx)(`div`,{className:`text-lg font-semibold mt-1 `+(n?`text-accent`:`text-fg`),children:t}),r&&(0,z.jsx)(`div`,{className:`text-[10px] text-fg-muted mt-0.5`,children:r}),o]})}var Fl=[],Il=[];function Ll(e){Fl.some(t=>t.id===e.id)||Fl.push(e)}function Rl(e){Il.push(e)}function zl(e){let t=[];for(let n of Il)try{t.push(...n(e))}catch{}return[...Fl,...t]}function Bl(e,t){let n=e.trim().toLowerCase();if(!n)return 1;let r=t.title.toLowerCase(),i=(t.subtitle??``).toLowerCase(),a=(t.keywords??[]).join(` `).toLowerCase(),o=t.section.toLowerCase(),s=0;return r===n&&(s=Math.max(s,1e3)),r.startsWith(n)&&(s=Math.max(s,500)),RegExp(`\\b`+Hl(n)).test(r)&&(s=Math.max(s,300)),r.includes(n)&&(s=Math.max(s,200)),a.includes(n)&&(s=Math.max(s,150)),i.includes(n)&&(s=Math.max(s,100)),o.includes(n)&&(s=Math.max(s,50)),s===0&&Vl(n,r)&&(s=25),s===0&&Vl(n,a)&&(s=10),s}function Vl(e,t){if(!e)return!0;let n=0;for(let r=0;r<t.length&&n<e.length;r++)t[r]===e[n]&&n++;return n===e.length}function Hl(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function Ul(e,t){let n=zl(t),r=e.trim();return r?n.map(e=>({c:e,s:Bl(r,e)})).filter(e=>e.s>0).sort((e,t)=>t.s-e.s).map(e=>e.c):n}function Wl(e){let t=[`Jump`,`Search`,`Actions`,`Settings`],n=new Map;for(let e of t)n.set(e,[]);for(let t of e){let e=n.get(t.section)??[];e.push(t),n.set(t.section,e)}return t.map(e=>[e,n.get(e)??[]]).filter(([,e])=>e.length>0)}function Gl({ctx:e,onClose:t}){let[n,r]=(0,R.useState)(``),[i,a]=(0,R.useState)(0),o=(0,R.useRef)(null),s=(0,R.useRef)(null),c=V({queryKey:[`sessions`,`palette`],queryFn:()=>W.sessions({limit:60}),staleTime:3e4}),l=(0,R.useMemo)(()=>({...e,sessions:c.data??[],openPalette:()=>{},closePalette:t}),[e,c.data,t]),u=(0,R.useMemo)(()=>Ul(n,l),[n,l]),d=(0,R.useMemo)(()=>Wl(u),[u]),f=(0,R.useMemo)(()=>d.flatMap(([,e])=>e),[d]);return(0,R.useEffect)(()=>{a(0)},[n,u.length]),(0,R.useEffect)(()=>{requestAnimationFrame(()=>o.current?.focus())},[]),(0,R.useEffect)(()=>{let e=e=>{if(e.key===`Escape`){e.preventDefault(),t();return}if(e.key===`ArrowDown`)e.preventDefault(),a(e=>Math.min(e+1,Math.max(f.length-1,0)));else if(e.key===`ArrowUp`)e.preventDefault(),a(e=>Math.max(e-1,0));else if(e.key===`Enter`){e.preventDefault();let n=f[i];n&&ql(n,l,t)}else if(e.key===`Tab`){if(e.preventDefault(),d.length===0)return;let t=f[i],[,n]=d[((t?d.findIndex(([e])=>e===t.section):0)+(e.shiftKey?-1:1)+d.length)%d.length],r=n[0];if(r){let e=f.findIndex(e=>e.id===r.id);e>=0&&a(e)}}};return window.addEventListener(`keydown`,e,!0),()=>window.removeEventListener(`keydown`,e,!0)},[f,d,i,l,t]),(0,R.useEffect)(()=>{(s.current?.querySelector(`[data-cmd-idx="${i}"]`))?.scrollIntoView({block:`nearest`})},[i]),(0,z.jsx)(`div`,{className:`fixed inset-0 bg-black/60 z-50 flex items-start justify-center pt-24 px-6`,onClick:t,role:`dialog`,"aria-modal":`true`,"aria-label":`Command palette`,children:(0,z.jsxs)(`div`,{className:`bg-bg-elevated border border-line rounded-xl shadow-2xl w-full max-w-2xl max-h-[70vh] flex flex-col overflow-hidden`,onClick:e=>e.stopPropagation(),"data-testid":`command-palette`,children:[(0,z.jsxs)(`div`,{className:`p-4 border-b border-line`,children:[(0,z.jsx)(`div`,{className:`text-xs uppercase tracking-wider text-fg-dim mb-2`,children:`Command palette`}),(0,z.jsx)(`input`,{ref:o,type:`text`,value:n,onChange:e=>r(e.target.value),placeholder:`Type a command or session… ↑↓ navigate · Enter run · Esc close · Tab section`,className:`w-full bg-bg border border-line rounded px-3 py-2 text-sm focus:outline-none focus:border-accent`,"data-testid":`command-palette-input`,"aria-label":`Command palette search`,autoComplete:`off`,spellCheck:!1})]}),(0,z.jsxs)(`div`,{ref:s,className:`flex-1 overflow-y-auto`,children:[f.length===0&&(0,z.jsx)(`div`,{className:`p-6 text-sm text-fg-muted`,children:`No commands match.`}),d.map(([e,n])=>(0,z.jsx)(Kl,{section:e,cmds:n,activeIdx:i,flat:f,onRun:e=>ql(e,l,t),onHover:e=>{let t=f.findIndex(t=>t.id===e.id);t>=0&&a(t)}},e))]}),(0,z.jsxs)(`div`,{className:`p-3 border-t border-line text-xs text-fg-muted flex justify-between`,children:[(0,z.jsxs)(`span`,{children:[(0,z.jsx)(`kbd`,{className:`font-mono border border-line rounded px-1`,children:`↑↓`}),` `,(0,z.jsx)(`kbd`,{className:`font-mono border border-line rounded px-1`,children:`Enter`}),` `,(0,z.jsx)(`kbd`,{className:`font-mono border border-line rounded px-1`,children:`Tab`}),` `,(0,z.jsx)(`kbd`,{className:`font-mono border border-line rounded px-1`,children:`Esc`})]}),(0,z.jsxs)(`span`,{children:[f.length,` commands`]})]})]})})}function Kl({section:e,cmds:t,activeIdx:n,flat:r,onRun:i,onHover:a}){return(0,z.jsxs)(`div`,{children:[(0,z.jsx)(`div`,{className:`px-4 pt-3 pb-1 text-[10px] uppercase tracking-widest text-fg-dim`,children:e}),t.map(e=>{let t=r.findIndex(t=>t.id===e.id),o=t===n;return(0,z.jsxs)(`button`,{type:`button`,"data-cmd-idx":t,"data-cmd-id":e.id,onMouseEnter:()=>a(e),onClick:()=>i(e),className:K(`block w-full text-left px-4 py-2 border-b border-line/40 transition-colors`,o?`bg-bg-active`:`hover:bg-bg-hover`),children:[(0,z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[e.icon&&(0,z.jsx)(`span`,{className:`shrink-0 text-fg-muted w-5 text-center`,children:e.icon}),(0,z.jsx)(`span`,{className:`text-sm text-fg truncate`,children:e.title})]}),e.subtitle&&(0,z.jsx)(`div`,{className:`pl-7 text-xs text-fg-muted truncate`,children:e.subtitle})]},e.id)})]})}async function ql(e,t,n){try{await e.run(t)}finally{n()}}function Jl({onExit:e}){return(0,z.jsxs)(`div`,{"data-testid":`compare-banner`,className:`flex items-center justify-between gap-3 px-4 py-2 bg-accent/10 border-b border-accent/30 text-sm normal-case tracking-normal`,children:[(0,z.jsxs)(`span`,{className:`text-fg-dim truncate`,children:[`Compare mode · two sessions open · press`,` `,(0,z.jsx)(`kbd`,{className:`px-1.5 py-0.5 border border-line rounded text-xs font-mono`,children:`Esc`}),` `,`to exit`]}),(0,z.jsx)(`button`,{type:`button`,onClick:e,"data-testid":`compare-banner-exit`,"aria-label":`Exit compare view`,className:`shrink-0 px-3 py-1 bg-accent text-bg rounded text-xs font-semibold hover:opacity-90 focus:outline-none focus:ring-2 focus:ring-accent/60`,children:`Exit compare ⤫`})]})}function Yl(e,t=250){let[n,r]=(0,R.useState)(e);return(0,R.useEffect)(()=>{let n=setTimeout(()=>r(e),t);return()=>clearTimeout(n)},[e,t]),n}var Xl=!1;function Zl(){Xl||(Xl=!0,Ll({id:`palette.close`,title:`Close command palette`,section:`Actions`,keywords:[`dismiss`,`escape`],icon:`✕`,run:e=>e.closePalette()}),Ll({id:`help.open`,title:`Open Command Center`,subtitle:`Full help & keyboard reference`,section:`Settings`,keywords:[`help`,`?`,`docs`,`shortcuts`,`center`],icon:`?`,run:e=>e.openHelp()}),Ll({id:`collections.create`,title:`New collection`,subtitle:`Create a new collection to group sessions`,section:`Actions`,keywords:[`new`,`collection`,`group`,`folder`],icon:`📁`,run:e=>e.openCreateCollection()}),Ll({id:`collections.add-current-session`,title:`Add current session to a collection`,section:`Actions`,keywords:[`collection`,`add`,`organize`],icon:`➕`,run:e=>{e.currentSessionId&&e.openAddToCollection()}}),Ll({id:`compare.start`,title:`Start compare — pick a second session`,subtitle:`Open side-by-side transcript diff`,section:`Actions`,keywords:[`compare`,`diff`,`side`,`split`],icon:`⇆`,run:e=>e.startCompare()}),Ll({id:`compare.exit`,title:`Exit compare view`,section:`Actions`,keywords:[`compare`,`close`,`exit`],icon:`✕`,run:e=>e.exitCompare()}),Ll({id:`session.export`,title:`Export current session as context`,subtitle:`Copy condensed markdown to clipboard`,section:`Actions`,keywords:[`export`,`copy`,`context`,`clipboard`,`markdown`],icon:`📋`,run:e=>{e.currentSessionId&&e.exportCurrentSession()}}),Ll({id:`semantic.toggle`,title:`Toggle semantic search`,subtitle:`AI-powered search by concept (requires v0.11)`,section:`Settings`,keywords:[`semantic`,`ai`,`search`,`mode`],icon:`✨`,run:e=>e.toggleSemantic()}),Ll({id:`threads.intro.replay`,title:`Replay threads tour`,subtitle:`Play the 3-step Threads explainer again`,section:`Settings`,keywords:[`threads`,`intro`,`tour`,`replay`,`onboarding`,`help`],icon:`🧵`,run:e=>e.replayThreadsIntro()}),Ll({id:`nav.home`,title:`Go home — clear filters`,subtitle:`Clear project, session, search`,section:`Jump`,keywords:[`home`,`reset`,`clear`],icon:`⌂`,run:e=>e.navigate({project:null,session:null,msg:null,q:``,col:null,view:null})}),Rl(e=>e.sessions.slice(0,10).map((e,t)=>{let n=e.alias||(e.first_user_message?e.first_user_message.slice(0,80).replace(/\s+/g,` `).trim():``)||`(no prompt)`;return{id:`jump.session.${e.id}`,title:`Jump to: ${n}`,subtitle:`${e.project} · ${e.message_count} msgs · ${e.id.slice(0,8)}`,section:`Jump`,keywords:[e.id,e.id.slice(0,8),e.project,e.alias??``,...e.tags.map(e=>`#${e}`),`recent${t+1}`].filter(Boolean),icon:`↳`,run:t=>t.navigate({session:e.id,project:e.project,msg:null,view:null})}})))}Zl();function Ql(){let[e,t]=Pt(),n=Yl(e.q,120),[r,i]=(0,R.useState)(`all`),[a,o]=(0,R.useState)(!1),s=!!V({queryKey:[`semanticStatus`],queryFn:()=>W.getSemanticStatus(),refetchInterval:3e4}).data?.enabled,c=a&&s,[l,u]=(0,R.useState)(!1),[d,f]=(0,R.useState)(!1),[p,m]=(0,R.useState)(!1),[h,g]=(0,R.useState)(null),_=ll(),[v,y]=(0,R.useState)(null),b=_.data?.state.threadsIntroSeen===!0,x=null;h===`show`?x=`onboarding`:v===`show`&&e.view===`threads`?x=`threadsIntro`:h!==`hide`&&_.shouldShow?x=`onboarding`:v!==`hide`&&_.data&&!b&&e.view===`threads`&&(x=`threadsIntro`);let S=x===`onboarding`,C=x===`threadsIntro`,[w,T]=(0,R.useState)(!1),[E,D]=(0,R.useState)(!1);(0,R.useEffect)(()=>{let n=n=>{let r=n.target,i=!!r&&(r.tagName===`INPUT`||r.tagName===`TEXTAREA`||r.isContentEditable);if(n.key===`/`&&!i){n.preventDefault();let e=document.querySelector(`input[type="search"]`);e?.focus(),e?.select()}else if(n.key===`?`&&!i)n.preventDefault(),t({view:`help`});else if(n.key===`Escape`&&i&&r?.getAttribute(`type`)===`search`)t({q:``}),r.blur();else if(n.key===`c`&&!i&&!n.metaKey&&!n.ctrlKey)n.preventDefault(),u(!0);else if((n.metaKey||n.ctrlKey)&&n.shiftKey&&(n.key===`A`||n.key===`a`))e.session&&(n.preventDefault(),f(!0));else if((n.metaKey||n.ctrlKey)&&n.shiftKey&&(n.key===`C`||n.key===`c`)){n.preventDefault();let e=document.querySelector(`[data-collections-focus]`);e?.focus(),e?.scrollIntoView({block:`nearest`})}else if((n.metaKey||n.ctrlKey)&&!n.shiftKey&&!n.altKey&&(n.key===`k`||n.key===`K`))n.preventDefault(),T(e=>!e);else if((n.metaKey||n.ctrlKey)&&n.key===`\\`){n.preventDefault();let e=`claude-recall:sessions-pane`,t=`${e}:collapsed`,r=localStorage.getItem(t)===`1`?`0`:`1`;localStorage.setItem(t,r),Bn(e)}};return window.addEventListener(`keydown`,n),()=>window.removeEventListener(`keydown`,n)},[t,e.session]),(0,R.useEffect)(()=>{if(!e.compareWith)return;let n=e=>{if(e.key!==`Escape`)return;let n=e.target;n&&(n.tagName===`INPUT`||n.tagName===`TEXTAREA`||n.isContentEditable)||t({compareWith:null})};return window.addEventListener(`keydown`,n),()=>window.removeEventListener(`keydown`,n)},[e.compareWith,t]);let O=n.trim().length>1,k=r===`project`?e.project:null,A=V({queryKey:[`searchCount`,n,k,c?`semantic`:`fts`],queryFn:()=>W.search(n,60,k??void 0,c?`semantic`:void 0),enabled:O}),ee=(0,R.useMemo)(()=>O?A.data?.hits.length??null:null,[O,A.data]),j=(0,R.useCallback)(e=>t({q:e}),[t]),te=(0,R.useCallback)(()=>t({view:`help`}),[t]),M=(0,R.useCallback)(()=>t({view:null,helpSection:null}),[t]),ne=(0,R.useCallback)(()=>t({view:`stats`}),[t]),N=(0,R.useCallback)(()=>t({view:`threads`}),[t]),P=(0,R.useCallback)(()=>t({view:null}),[t]),re=(0,R.useCallback)(e=>t({helpSection:e}),[t]),F=(0,R.useCallback)(e=>t({project:e,session:null,msg:null,col:null}),[t]),ie=(0,R.useCallback)((e,n)=>t({session:e,msg:n??null}),[t]),I=(0,R.useCallback)(async()=>{await _.reset(),g(`show`),t({view:null,helpSection:null})},[_,t]),ae=(0,R.useCallback)(()=>{g(`hide`),y(`hide`)},[]),L=(0,R.useCallback)(async()=>{await _.patch({threadsIntroSeen:!1}),y(`show`),t({view:`threads`,helpSection:null})},[_,t]),oe=(0,R.useCallback)(()=>{y(`hide`),g(`hide`)},[]),se=(0,R.useCallback)(()=>m(!0),[]),ce=(0,R.useCallback)(e=>t({msg:e}),[t]);return(0,z.jsxs)(`div`,{className:`h-full flex flex-col relative`,children:[(0,z.jsx)(wt,{query:e.q,onQueryChange:j,matchCount:ee,scope:r,onScopeChange:i,canScope:!!e.project,projectName:e.project,onOpenHelp:te,helpActive:e.view===`help`,onOpenStats:ne,statsActive:e.view===`stats`,onOpenThreads:N,threadsActive:e.view===`threads`,semanticAvailable:s,semanticMode:c,onSemanticModeChange:o}),(0,z.jsxs)(`div`,{className:`flex-1 flex min-h-0`,children:[(0,z.jsx)(kn,{selected:e.project,selectedCollection:e.col,onSelect:F,onCreateCollection:()=>u(!0),onSelectSession:ie}),(0,z.jsx)(no,{projectName:e.project,collectionId:e.col,selectedSessionId:e.session,onSelect:ie,searchQuery:n,searchScope:r,semanticMode:c}),(0,z.jsxs)(`div`,{className:`flex-1 flex flex-col min-w-0 min-h-0`,"data-compare-wrapper":e.compareWith?`1`:void 0,children:[e.compareWith&&(0,z.jsx)(Jl,{onExit:()=>t({compareWith:null})}),(0,z.jsxs)(`div`,{className:`flex-1 flex min-w-0 min-h-0 max-[1100px]:flex-col min-[1101px]:flex-row`,children:[(0,z.jsx)(`div`,{className:`flex-1 flex min-w-0 min-h-0`,children:(0,z.jsx)(dc,{sessionId:e.session,targetMessageUuid:e.msg,onTargetChange:ce,searchQuery:n,isCompareLeft:!!e.compareWith})}),e.compareWith&&(0,z.jsx)(`div`,{className:`flex-1 flex min-w-0 min-h-0 border-t border-line min-[1101px]:border-t-0 min-[1101px]:border-l`,children:(0,z.jsx)(dc,{sessionId:e.compareWith,targetMessageUuid:null,onTargetChange:()=>{},searchQuery:n,isCompareRight:!0,onExitCompare:()=>t({compareWith:null})})})]})]})]}),e.view===`stats`&&(0,z.jsx)(Q,{onClose:P,onSelectSession:e=>ie(e)}),e.view===`help`&&(0,z.jsx)(hc,{initialSectionId:e.helpSection,onClose:M,onSectionChange:re,onReplayOnboarding:I,onReplayThreadsIntro:()=>void L()}),e.view===`auto-rules`&&(0,z.jsxs)(`div`,{className:`fixed inset-0 z-30 bg-bg overflow-auto`,children:[(0,z.jsxs)(`div`,{className:`sticky top-0 z-10 bg-bg border-b border-line px-4 py-2 flex items-center justify-between`,children:[(0,z.jsx)(`span`,{className:`text-sm font-semibold`,children:`Auto-collections`}),(0,z.jsx)(`button`,{type:`button`,onClick:()=>t({view:null}),className:`text-xs text-accent hover:underline`,children:`close`})]}),(0,z.jsx)(Ec,{})]}),e.view===`threads`&&(0,z.jsxs)(`div`,{className:`fixed inset-0 z-30 bg-bg flex flex-col`,children:[(0,z.jsxs)(`div`,{className:`sticky top-0 z-10 bg-bg border-b border-line px-4 py-2 flex items-center justify-between shrink-0`,children:[(0,z.jsx)(`span`,{className:`text-sm font-semibold`,children:`🧵 Threads`}),(0,z.jsx)(`button`,{type:`button`,onClick:()=>t({view:null,thread:null}),className:`text-xs text-accent hover:underline`,children:`close`})]}),(0,z.jsx)(el,{})]}),l&&(0,z.jsx)(Zt,{mode:`create`,onClose:()=>u(!1),onCreated:e=>{u(!1),t({col:e.id,session:null,msg:null})}}),d&&e.session&&(0,z.jsx)(or,{sessionId:e.session,onClose:()=>f(!1),anchor:`center`}),S&&(0,z.jsx)(dl,{onSelectSession:e=>ie(e),onOpenAutoTagSettings:se,onClose:ae}),C&&(0,z.jsx)(yl,{onClose:oe}),(0,z.jsx)(Jn,{open:p,onClose:()=>m(!1)}),(0,z.jsx)(St,{}),w&&(0,z.jsx)(Gl,{onClose:()=>T(!1),ctx:{navigate:e=>t(e),openHelp:()=>t({view:`help`}),openCreateCollection:()=>u(!0),openAddToCollection:()=>{e.session&&f(!0)},startCompare:()=>D(!0),exitCompare:()=>t({compareWith:null}),exportCurrentSession:()=>{if(!e.session)return;let t=`recall context ${e.session} | claude`;navigator.clipboard?.writeText(t).catch(()=>void 0)},toggleSemantic:()=>{let e=`claude-recall:semantic-mode`,t=localStorage.getItem(e)===`1`?`0`:`1`;localStorage.setItem(e,t)},replayThreadsIntro:()=>{L()},currentSessionId:e.session,compareSessionId:e.compareWith}}),E&&(0,z.jsx)(Xs,{excludeSessionId:e.session,onPick:e=>{D(!1),t({compareWith:e})},onClose:()=>D(!1)})]})}var $l=new Ve({defaultOptions:{queries:{staleTime:3e4,refetchOnWindowFocus:!1,retry:1}}}),eu=document.getElementById(`root`);if(!eu)throw Error(`root element not found`);ot.createRoot(eu).render((0,z.jsx)(R.StrictMode,{children:(0,z.jsx)(Ge,{client:$l,children:(0,z.jsx)(Ql,{})})}));
|