spiracha 1.1.1 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. package/AGENTS.md +13 -7
  2. package/README.md +6 -2
  3. package/apps/ui/AGENTS.md +2 -0
  4. package/apps/ui/README.md +3 -1
  5. package/apps/ui/dist/client/assets/{analytics-CqWZmyV6.js → analytics-Cv0JMDN2.js} +1 -1
  6. package/apps/ui/dist/client/assets/{checkbox-DXM4lkJq.js → checkbox-DjHij7DJ.js} +1 -1
  7. package/apps/ui/dist/client/assets/{data-table-DnPYMPCD.js → data-table-Bgnh7phF.js} +1 -1
  8. package/apps/ui/dist/client/assets/{delete-confirm-dialog-CcZaRX33.js → delete-confirm-dialog-CIZy_LXD.js} +1 -1
  9. package/apps/ui/dist/client/assets/download-DQtfva4z.js +1 -0
  10. package/apps/ui/dist/client/assets/{es2015-Bm0kEzx2.js → es2015-DsDKdYCE.js} +1 -1
  11. package/apps/ui/dist/client/assets/{formatters-C12LmYaa.js → formatters-CWFrMKSn.js} +1 -1
  12. package/apps/ui/dist/client/assets/{index-DdJ7ahIt.js → index-C_-e0lDI.js} +2 -2
  13. package/apps/ui/dist/client/assets/{input-CEsI7EpI.js → input-BbgApiqZ.js} +1 -1
  14. package/apps/ui/dist/client/assets/{metric-card-9jwBF7rG.js → metric-card-BJX5rkHK.js} +1 -1
  15. package/apps/ui/dist/client/assets/{page-header-Dr_h1CVv.js → page-header-ODLuGLAB.js} +1 -1
  16. package/apps/ui/dist/client/assets/{projects._project-uyNGnpjH.js → projects._project-C2Pys_bB.js} +1 -1
  17. package/apps/ui/dist/client/assets/{projects._project-zoM8d2nH.js → projects._project-CHvAKvlu.js} +1 -1
  18. package/apps/ui/dist/client/assets/{projects.index-D1CWVN-O.js → projects.index-BmwtS1x-.js} +1 -1
  19. package/apps/ui/dist/client/assets/{projects.index-DukMuny6.js → projects.index-CuLw73mt.js} +1 -1
  20. package/apps/ui/dist/client/assets/{routes-Gr2Wwh83.js → routes-CfnaTOlj.js} +1 -1
  21. package/apps/ui/dist/client/assets/{select-CFim44gT.js → select-B1kH_5lx.js} +1 -1
  22. package/apps/ui/dist/client/assets/{settings-DqhyDxo2.js → settings-mYTB3sso.js} +1 -1
  23. package/apps/ui/dist/client/assets/{threads._threadId-DT75NiBa.js → threads._threadId-CUiCZSwo.js} +1 -1
  24. package/apps/ui/dist/client/assets/{threads._threadId-Df5VXIuZ.js → threads._threadId-C_47okme.js} +1 -1
  25. package/apps/ui/dist/server/assets/_tanstack-start-manifest_v-kj_QB_26.js +99 -0
  26. package/apps/ui/dist/server/assets/{analytics-BMxW_bZL.js → analytics-2QpLKjlG.js} +1 -1
  27. package/apps/ui/dist/server/assets/{codex-queries-CAF6HYiG.js → codex-queries-BH4Cb0v3.js} +2 -2
  28. package/apps/ui/dist/server/assets/{codex-server-BFZq2Y2O.js → codex-server-DqzruLmg.js} +35 -87
  29. package/apps/ui/dist/server/assets/{download-C5rkk_Bo.js → download-Drctxary.js} +7 -7
  30. package/apps/ui/dist/server/assets/{projects._project-CcJLp_A8.js → projects._project-DreIU5b0.js} +3 -3
  31. package/apps/ui/dist/server/assets/{projects._project-CJ7l0ynC.js → projects._project-gT01HBqH.js} +2 -2
  32. package/apps/ui/dist/server/assets/{projects.index-srtogpuF.js → projects.index-BYmgSGAj.js} +1 -1
  33. package/apps/ui/dist/server/assets/{router-C_w-haH6.js → router-Qj5Kn7bl.js} +6 -6
  34. package/apps/ui/dist/server/assets/{routes-BhbxvJE7.js → routes-BtcXuK0x.js} +2 -2
  35. package/apps/ui/dist/server/assets/{routes-CPe-ppmC.js → routes-_LbCIjtJ.js} +2 -2
  36. package/apps/ui/dist/server/assets/{threads._threadId-euyNckhj.js → threads._threadId-D5m6ypGw.js} +3 -3
  37. package/apps/ui/dist/server/assets/{threads._threadId-Ba7vv6-K.js → threads._threadId-DcbAJkwf.js} +2 -2
  38. package/apps/ui/dist/server/server.js +19 -36
  39. package/bin/codex-chats-claude.js +5 -0
  40. package/bin/codex-chats.js +5 -0
  41. package/bin/spiracha.js +5 -0
  42. package/package.json +9 -6
  43. package/src/lib/codex-browser-export.ts +28 -3
  44. package/src/lib/codex-exporter-cli.ts +9 -9
  45. package/src/lib/codex-exporter-transcript.ts +16 -190
  46. package/src/lib/codex-exporter-types.ts +1 -1
  47. package/src/lib/codex-exporter.ts +0 -1
  48. package/src/lib/interactive-cli.ts +2 -2
  49. package/src/mcp-server.ts +2 -2
  50. package/apps/ui/dist/client/assets/download-DOwxk-cG.js +0 -1
  51. package/apps/ui/dist/server/assets/_tanstack-start-manifest_v-C0V305Nt.js +0 -99
@@ -1,4 +1,4 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/settings-DqhyDxo2.js","assets/page-header-Dr_h1CVv.js","assets/checkbox-DXM4lkJq.js","assets/analytics-CqWZmyV6.js","assets/data-table-DnPYMPCD.js","assets/metric-card-9jwBF7rG.js","assets/select-CFim44gT.js","assets/es2015-Bm0kEzx2.js","assets/formatters-C12LmYaa.js","assets/routes-Gr2Wwh83.js","assets/projects.index-D1CWVN-O.js","assets/delete-confirm-dialog-CcZaRX33.js","assets/input-CEsI7EpI.js","assets/threads._threadId-Df5VXIuZ.js","assets/download-DOwxk-cG.js","assets/projects._project-uyNGnpjH.js"])))=>i.map(i=>d[i]);
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/settings-mYTB3sso.js","assets/page-header-ODLuGLAB.js","assets/checkbox-DjHij7DJ.js","assets/analytics-Cv0JMDN2.js","assets/data-table-Bgnh7phF.js","assets/metric-card-BJX5rkHK.js","assets/select-B1kH_5lx.js","assets/es2015-DsDKdYCE.js","assets/formatters-CWFrMKSn.js","assets/routes-CfnaTOlj.js","assets/projects.index-BmwtS1x-.js","assets/delete-confirm-dialog-CIZy_LXD.js","assets/input-BbgApiqZ.js","assets/threads._threadId-C_47okme.js","assets/download-DQtfva4z.js","assets/projects._project-C2Pys_bB.js"])))=>i.map(i=>d[i]);
2
2
  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)),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},E=Object.prototype.hasOwnProperty;function ee(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function te(e,t){return ee(e.type,t,e.props)}function D(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function ne(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var re=/\/+/g;function ie(e,t){return typeof e==`object`&&e&&e.key!=null?ne(``+e.key):t.toString(36)}function O(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 k(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,k(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+ie(e,0):a,S(o)?(i=``,c!=null&&(i=c.replace(re,`$&/`)+`/`),k(o,r,i,``,function(e){return e})):o!=null&&(D(o)&&(o=te(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(re,`$&/`)+`/`)+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+ie(a,u),c+=k(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+ie(a,u++),c+=k(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return k(O(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 ae(e,t,n){if(e==null)return e;var r=[],i=0;return k(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function oe(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t)},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var A=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},j={map:ae,forEach:function(e,t,n){ae(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return ae(e,function(){t++}),t},toArray:function(e){return ae(e,function(e){return e})||[]},only:function(e){if(!D(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=j,e.Component=v,e.Fragment=r,e.Profiler=a,e.PureComponent=b,e.StrictMode=i,e.Suspense=l,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=w,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return w.H.useMemoCache(e)}},e.cache=function(e){return function(){return e.apply(null,arguments)}},e.cacheSignal=function(){return null},e.cloneElement=function(e,t,n){if(e==null)throw Error(`The argument must be a React element, but you passed `+e+`.`);var r=g({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!E.call(t,a)||a===`key`||a===`__self`||a===`__source`||a===`ref`&&t.ref===void 0||(r[a]=t[a]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];r.children=o}return ee(e.type,i,r)},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:o,_context:e},e},e.createElement=function(e,t,n){var r,i={},a=null;if(t!=null)for(r in t.key!==void 0&&(a=``+t.key),t)E.call(t,r)&&r!==`key`&&r!==`__self`&&r!==`__source`&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var s=Array(o),c=0;c<o;c++)s[c]=arguments[c+2];i.children=s}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return ee(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=D,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:oe}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=function(e){var t=w.T,n={};w.T=n;try{var r=e(),i=w.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(C,A)}catch(e){A(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),w.T=t}},e.unstable_useCacheRefresh=function(){return w.H.useCacheRefresh()},e.use=function(e){return w.H.use(e)},e.useActionState=function(e,t,n){return w.H.useActionState(e,t,n)},e.useCallback=function(e,t){return w.H.useCallback(e,t)},e.useContext=function(e){return w.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return w.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return w.H.useEffect(e,t)},e.useEffectEvent=function(e){return w.H.useEffectEvent(e)},e.useId=function(){return w.H.useId()},e.useImperativeHandle=function(e,t,n){return w.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return w.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return w.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return w.H.useMemo(e,t)},e.useOptimistic=function(e,t){return w.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return w.H.useReducer(e,t,n)},e.useRef=function(e){return w.H.useRef(e)},e.useState=function(e){return w.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return w.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return w.H.useTransition()},e.version=`19.2.6`})),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,D());else{var t=n(l);t!==null&&ie(x,t.startTime-e)}}var S=!1,C=-1,w=5,E=-1;function ee(){return g?!0:!(e.unstable_now()-E<w)}function te(){if(g=!1,S){var t=e.unstable_now();E=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&&ee());){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&&ie(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?D():S=!1}}}var D;if(typeof y==`function`)D=function(){y(te)};else if(typeof MessageChannel<`u`){var ne=new MessageChannel,re=ne.port2;ne.port1.onmessage=te,D=function(){re.postMessage(null)}}else D=function(){_(te,0)};function ie(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,ie(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,D()))),r},e.unstable_shouldYield=ee,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.6`})),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`),E=Symbol.for(`react.suspense`),ee=Symbol.for(`react.suspense_list`),te=Symbol.for(`react.memo`),D=Symbol.for(`react.lazy`),ne=Symbol.for(`react.activity`),re=Symbol.for(`react.memo_cache_sentinel`),ie=Symbol.iterator;function O(e){return typeof e!=`object`||!e?null:(e=ie&&e[ie]||e[`@@iterator`],typeof e==`function`?e:null)}var k=Symbol.for(`react.client.reference`);function ae(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===k?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 E:return`Suspense`;case ee:return`SuspenseList`;case ne: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 te:return t=e.displayName||null,t===null?ae(e.type)||`Memo`:t;case D:t=e._payload,e=e._init;try{return ae(e(t))}catch{}}return null}var oe=Array.isArray,A=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,j=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,se={pending:!1,data:null,method:null,action:null},ce=[],le=-1;function M(e){return{current:e}}function N(e){0>le||(e.current=ce[le],ce[le]=null,le--)}function P(e,t){le++,ce[le]=e.current,e.current=t}var ue=M(null),de=M(null),fe=M(null),pe=M(null);function me(e,t){switch(P(fe,t),P(de,e),P(ue,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Hd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Hd(t),e=Ud(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}N(ue),P(ue,e)}function he(){N(ue),N(de),N(fe)}function ge(e){e.memoizedState!==null&&P(pe,e);var t=ue.current,n=Ud(t,e.type);t!==n&&(P(de,e),P(ue,n))}function _e(e){de.current===e&&(N(ue),N(de)),pe.current===e&&(N(pe),$f._currentValue=se)}var ve,ye;function be(e){if(ve===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);ve=t&&t[1]||``,ye=-1<e.stack.indexOf(`
3
3
  at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
4
4
  `+ve+e+ye}var xe=!1;function Se(e,t){if(!e||xe)return``;xe=!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(`
@@ -19,4 +19,4 @@ Error generating stack: `+e.message+`
19
19
  document.documentElement.style.colorScheme = mode
20
20
  } catch {}
21
21
  })()
22
- `;function Fg({error:e}){let t=e.message.includes(`unable to open database`)||e.message.includes(`database is locked`)||e.message.includes(`SQLITE_`);return(0,H.jsx)(`div`,{className:`flex min-h-screen items-center justify-center bg-[#101418] px-4 text-[#eef3f7]`,children:(0,H.jsxs)(`div`,{className:`max-w-[30rem] text-center`,children:[(0,H.jsx)(`h1`,{className:`mb-3 font-semibold text-base`,children:t?`Database unavailable`:`Something went wrong`}),t?(0,H.jsx)(`p`,{className:`my-2 text-[#99a3af] text-[0.875rem] leading-6`,children:`Spiracha could not open the Codex SQLite database. Codex may have an exclusive lock on the file, or the database does not exist yet. Close Codex or wait a moment, then reload.`}):(0,H.jsx)(`p`,{className:`my-2 text-[#99a3af] text-[0.875rem] leading-6`,children:(0,H.jsx)(`code`,{className:`rounded border border-white/10 bg-[#12181e] px-1.5 py-1 text-[0.8em]`,children:e.message})}),(0,H.jsx)(`button`,{className:`mt-6 rounded-full border border-white/15 bg-[#1a222b] px-5 py-2 text-sm hover:bg-[#222e3a]`,type:`button`,onClick:()=>window.location.reload(),children:`Reload`})]})})}var Ig=Oc()({component:Lg,errorComponent:Fg,head:()=>({links:[{href:Ng,rel:`stylesheet`}],meta:[{charSet:`utf-8`},{content:`width=device-width, initial-scale=1`,name:`viewport`},{content:`Browse local Codex threads, projects, tool calls, and analytics through a compact workspace UI.`,name:`description`},{title:`Spiracha UI`}]})});function Lg(){return(0,H.jsx)(Rg,{children:(0,H.jsx)(jg,{children:(0,H.jsx)(Eg,{children:(0,H.jsx)(Tg,{children:(0,H.jsx)(Hc,{})})})})})}function Rg({children:e}){return(0,H.jsxs)(`html`,{lang:`en`,suppressHydrationWarning:!0,children:[(0,H.jsxs)(`head`,{children:[(0,H.jsx)(`script`,{children:Pg}),(0,H.jsx)(nl,{})]}),(0,H.jsxs)(`body`,{children:[e,(0,H.jsx)(rl,{})]})]})}var zg=`modulepreload`,Bg=function(e){return`/`+e},Vg={},Hg=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=function(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))},i=document.getElementsByTagName(`link`),a=document.querySelector(`meta[property=csp-nonce]`),o=a?.nonce||a?.getAttribute(`nonce`);r=e(t.map(e=>{if(e=Bg(e,n),e in Vg)return;Vg[e]=!0;let t=e.endsWith(`.css`),r=t?`[rel="stylesheet"]`:``;if(n)for(let n=i.length-1;n>=0;n--){let r=i[n];if(r.href===e&&(!t||r.rel===`stylesheet`))return}else if(document.querySelector(`link[href="${e}"]${r}`))return;let a=document.createElement(`link`);if(a.rel=t?`stylesheet`:zg,t||(a.as=`script`),a.crossOrigin=``,a.href=e,o&&a.setAttribute(`nonce`,o),document.head.appendChild(a),t)return new Promise((t,n)=>{a.addEventListener(`load`,t),a.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${e}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},Ug=jc(`/settings`)({component:Nc(()=>Hg(()=>import(`./settings-DqhyDxo2.js`),__vite__mapDeps([0,1,2])),`component`)}),Wg=[/unable to open database file/iu,/database is locked/iu,/SQLITE_BUSY/iu,/SQLITE_CANTOPEN/iu],Gg=e=>e instanceof Error?Wg.some(t=>t.test(e.message)):!1;function Kg(e){return e!==`__proto__`&&e!==`constructor`&&e!==`prototype`}function qg(e,t){let n=Object.create(null);if(e)for(let t of Object.keys(e))Kg(t)&&(n[t]=e[t]);if(t&&typeof t==`object`)for(let e of Object.keys(t))Kg(e)&&(n[e]=t[e]);return n}function Jg(e){if(!e)return Object.create(null);let t=Object.create(null);for(let n of Object.keys(e))Kg(n)&&(t[n]=e[n]);return t}var Yg=()=>{throw Error(`createServerOnlyFn() functions can only be called on the server!`)},Xg=(e,t)=>{let n=t||e||{};return n.method===void 0&&(n.method=`GET`),Object.assign(e=>Xg(void 0,{...n,...e}),{options:n,middleware:e=>{let t=[...n.middleware||[]];e.map(e=>{y in e?e.options.middleware&&t.push(...e.options.middleware):t.push(e)});let r=Xg(void 0,{...n,middleware:t});return r[y]=!0,r},inputValidator:e=>Xg(void 0,{...n,inputValidator:e}),handler:(...e)=>{let[t,r]=e,i={...n,extractedFn:t,serverFn:r},a=[...i.middleware||[],e_(i)];return t.method=n.method,Object.assign(async e=>{let n=await Zg(a,`client`,{...t,...i,data:e?.data,headers:e?.headers,signal:e?.signal,fetch:e?.fetch,context:Jg()}),r=ht(n.error);if(r)throw r;if(n.error)throw n.error;return n.result},{...t,method:n.method,__executeServer:async e=>{let n=Yg(),r=n.contextAfterGlobalMiddlewares;return await Zg(a,`server`,{...t,...e,serverFnMeta:t.serverFnMeta,context:qg(e.context,r),request:n.request}).then(e=>({result:e.result,error:e.error,context:e.sendContext}))}})}})};async function Zg(e,t,n){let r=Qg([...E()?.functionMiddleware||[],...e]);if(t===`server`){let e=Yg({throwIfNotFound:!1});e?.executedRequestMiddlewares&&(r=r.filter(t=>!e.executedRequestMiddlewares.has(t)))}let i=async e=>{let n=r.shift();if(!n)return e;try{`inputValidator`in n.options&&n.options.inputValidator&&t===`server`&&(e.data=await $g(n.options.inputValidator,e.data));let r;if(t===`client`?`client`in n.options&&(r=n.options.client):`server`in n.options&&(r=n.options.server),r){let t=async(t={})=>{let n=await i({...e,...t,context:qg(e.context,t.context),sendContext:qg(e.sendContext,t.sendContext),headers:ls(e.headers,t.headers),_callSiteFetch:e._callSiteFetch,fetch:e._callSiteFetch??t.fetch??e.fetch,result:t.result===void 0?t instanceof Response?t:e.result:t.result,error:t.error??e.error});if(n.error)throw n.error;return n},n=await r({...e,next:t});if(mt(n))return{...e,error:n};if(n instanceof Response)return{...e,result:n};if(!n)throw Error(`User middleware returned undefined. You must call next() or return a result in your middlewares.`);return n}return i(e)}catch(t){return{...e,error:t}}};return i({...n,headers:n.headers||{},sendContext:n.sendContext||{},context:n.context||Jg(),_callSiteFetch:n.fetch})}function Qg(e,t=100){let n=new Set,r=[],i=(e,a)=>{if(a>t)throw Error(`Middleware nesting depth exceeded maximum of ${t}. Check for circular references.`);e.forEach(e=>{e.options.middleware&&i(e.options.middleware,a+1),n.has(e)||(n.add(e),r.push(e))})};return i(e,0),r}async function $g(e,t){if(e==null)return{};if(`~standard`in e){let n=await e[`~standard`].validate(t);if(n.issues)throw Error(JSON.stringify(n.issues,void 0,2));return n.value}if(`parse`in e)return e.parse(t);if(typeof e==`function`)return e(t);throw Error(`Invalid validator type!`)}function e_(e){return{"~types":void 0,options:{inputValidator:e.inputValidator,client:async({next:t,sendContext:n,fetch:r,...i})=>{let a={...i,context:n,fetch:r};return t(await e.extractedFn?.(a))},server:async({next:t,...n})=>{let r=await e.serverFn?.(n);return t({...n,result:r})}}}}var t_=Xg({method:`GET`}).handler(as(`792690638a3b10035a5b7368c3d98bdc70cbfe1e36a4aa5f45b1c49b8b1025b0`)),n_=Xg({method:`GET`}).handler(as(`ccefccb816ba13508f23db4e31067b3403e750225257592d3ae11071ffc3fd6f`)),r_=Xg({method:`GET`}).handler(as(`59fb2cb4d60c8e7d47e0afcc914ee6f9d9f4bf076c8e66eab1693066753655b3`)),i_=Xg({method:`GET`}).handler(as(`72991e2b6e0adbf8d63bb8b139dad88a00b77b7030ec28ceac36c3cce7846b4c`)),a_=Xg({method:`GET`}).handler(as(`5da27045f7e28ded6353bc16aace284af7ef1b4010ef04d0186a6feadb466497`)),o_=Xg({method:`GET`}).handler(as(`4712520da0f07bbd1f0907e5a162fe518516ff4caca3fd23876cc65539d87d7a`)),s_=Xg({method:`POST`}).handler(as(`0814663c3bdc58135f97d210d145ef0be5ca54ef9a5f1e3030be9b1bfc901e30`)),c_=Xg({method:`POST`}).handler(as(`b4e15c006e9a277470958bb008f89b5b0acc7256109581de44cf17d587d174a5`)),l_=Xg({method:`POST`}).handler(as(`29727b7ad5b8fe42e83817376653e064d9fe8888799f056b2e59296b3396568b`)),u_=Xg({method:`POST`}).handler(as(`96aa60bf7dd9b5bde415bcf3ad6f6955a975eecd9aa0516cf401cc39bebebe6c`)),d_=Xg({method:`POST`}).handler(as(`164ee82cdd565ed96591a64312f0f7bd961040baf066a89d9f5636330d11360b`)),f_=(e,t)=>e<3&&Gg(t),p_=e=>[150,400][e]??800,m_=()=>ou({queryFn:()=>t_(),queryKey:[`dashboard`],retry:f_,retryDelay:p_}),h_=()=>ou({queryFn:()=>n_(),queryKey:[`projects`],retry:f_,retryDelay:p_}),g_=e=>ou({queryFn:()=>r_({data:{project:e}}),queryKey:[`project-threads`,e],retry:f_,retryDelay:p_}),__=e=>ou({queryFn:()=>i_({data:{threadId:e}}),queryKey:[`thread`,e],retry:f_,retryDelay:p_}),v_=e=>ou({queryFn:()=>a_({data:{threadId:e}}),queryKey:[`thread-transcript`,e],retry:f_,retryDelay:p_}),y_=e=>ou({queryFn:()=>o_({data:{project:e}}),queryKey:[`analytics`,e??`all`],retry:f_,retryDelay:p_}),b_=jc(`/analytics`)({component:Nc(()=>Hg(()=>import(`./analytics-CqWZmyV6.js`),__vite__mapDeps([3,4,2,5,1,6,7,8])),`component`),loader:({context:e})=>Promise.all([e.queryClient.ensureQueryData(h_()),e.queryClient.ensureQueryData(y_(null))])}),x_=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/iu,S_=e=>x_.test(e),C_=jc(`/$threadId`)({beforeLoad:({params:e})=>{throw S_(e.threadId)?pt({params:{threadId:e.threadId},to:`/threads/$threadId`}):rt()},component:Nc(()=>Hg(()=>import(`./_threadId-CAIeH5mq.js`),[]),`component`)}),w_=jc(`/`)({component:Nc(()=>Hg(()=>import(`./routes-Gr2Wwh83.js`),__vite__mapDeps([9,5,1,8])),`component`),loader:({context:e})=>e.queryClient.ensureQueryData(m_())});function T_({error:e}){let t=e.message.includes(`unable to open database`)||e.message.includes(`database is locked`);return(0,H.jsxs)(`div`,{className:`rounded-xl border border-[var(--border)] bg-[var(--panel)] px-6 py-10 text-center`,children:[(0,H.jsx)(`p`,{className:`font-medium text-[var(--destructive)] text-sm`,children:t?`Database unavailable`:`Failed to load dashboard`}),(0,H.jsx)(`p`,{className:`mt-2 text-[var(--muted-foreground)] text-sm`,children:t?`Codex may have an exclusive lock on the database. Reload to retry.`:e.message}),(0,H.jsx)(`button`,{className:`mt-4 text-[var(--accent)] text-sm underline-offset-2 hover:underline`,type:`button`,onClick:()=>window.location.reload(),children:`Reload`})]})}w_.update({errorComponent:T_});var E_=jc(`/projects/`)({component:Nc(()=>Hg(()=>import(`./projects.index-D1CWVN-O.js`),__vite__mapDeps([10,4,2,11,7,1,12,8])),`component`),errorComponent:Nc(()=>Hg(()=>import(`./projects.index-DukMuny6.js`),[]),`errorComponent`),loader:({context:e})=>e.queryClient.ensureQueryData(h_())});function D_({description:e=`Fetching local Codex data. Larger projects can take a moment.`,title:t=`Loading`}){return(0,H.jsxs)(`div`,{className:`rounded-[1.6rem] border border-[var(--border)] bg-[var(--panel)] px-6 py-10 text-center shadow-[var(--panel-shadow)]`,children:[(0,H.jsx)(`div`,{className:`flex justify-center`,children:(0,H.jsx)(`div`,{className:`rounded-full border border-[var(--border)] bg-[var(--panel-secondary)] p-3`,children:(0,H.jsx)(Cu,{className:`size-5 animate-spin text-[var(--accent)]`})})}),(0,H.jsx)(`p`,{className:`mt-4 font-medium text-sm`,children:t}),(0,H.jsx)(`p`,{className:`mt-2 text-[var(--muted-foreground)] text-sm`,children:e})]})}var O_=jc(`/threads/$threadId`)({component:Nc(()=>Hg(()=>import(`./threads._threadId-Df5VXIuZ.js`),__vite__mapDeps([13,11,2,7,14,6,5,1,8])),`component`),errorComponent:Nc(()=>Hg(()=>import(`./threads._threadId-DT75NiBa.js`),[]),`errorComponent`),loader:({context:e,params:t})=>e.queryClient.ensureQueryData(__(t.threadId)),pendingComponent:()=>(0,H.jsx)(D_,{description:`Loading the transcript, metadata, and parsed event stream for this thread.`,title:`Loading thread`})}),k_=jc(`/projects/$project`)({component:Nc(()=>Hg(()=>import(`./projects._project-uyNGnpjH.js`),__vite__mapDeps([15,4,2,11,7,14,6,1,12,8])),`component`),errorComponent:Nc(()=>Hg(()=>import(`./projects._project-zoM8d2nH.js`),[]),`errorComponent`),loader:({context:e,params:t})=>e.queryClient.ensureQueryData(g_(t.project)),pendingComponent:()=>(0,H.jsx)(D_,{description:`Loading project threads and transcript summaries. Large projects can take a moment.`,title:`Loading project`})}),A_=Ug.update({id:`/settings`,path:`/settings`,getParentRoute:()=>Ig}),j_=b_.update({id:`/analytics`,path:`/analytics`,getParentRoute:()=>Ig}),M_=C_.update({id:`/$threadId`,path:`/$threadId`,getParentRoute:()=>Ig}),N_=w_.update({id:`/`,path:`/`,getParentRoute:()=>Ig}),P_=E_.update({id:`/projects/`,path:`/projects/`,getParentRoute:()=>Ig}),F_=O_.update({id:`/threads/$threadId`,path:`/threads/$threadId`,getParentRoute:()=>Ig}),I_={IndexRoute:N_,ThreadIdRoute:M_,AnalyticsRoute:j_,SettingsRoute:A_,ProjectsProjectRoute:k_.update({id:`/projects/$project`,path:`/projects/$project`,getParentRoute:()=>Ig}),ThreadsThreadIdRoute:F_,ProjectsIndexRoute:P_},L_=Ig._addFileChildren(I_);function R_(){let e=lu(),t=qc({context:e,defaultPreload:`intent`,defaultPreloadStaleTime:0,routeTree:L_,scrollRestoration:!0});return cu({queryClient:e.queryClient,router:t}),t}async function z_(){let e=await R_(),t=[];return window.__TSS_START_OPTIONS__={serializationAdapters:t},t.push(os),e.options.serializationAdapters&&t.push(...e.options.serializationAdapters),e.update({basepath:``,serializationAdapters:t}),e.stores.matchesId.get().length||await fs(e),e}var B_=z_;async function V_(){let e=await B_();return window.$_TSR?.h(),e}var H_;function U_(){return H_||=V_(),(0,H.jsx)(xs,{promise:H_,children:e=>(0,H.jsx)(Xc,{router:e})})}var W_=g();(0,V.startTransition)(()=>{(0,W_.hydrateRoot)(document,(0,H.jsx)(V.StrictMode,{children:(0,H.jsx)(U_,{})}))});export{U as $,Cf as A,af as B,$f as C,Af as D,If as E,hf as F,iu as G,Qd as H,sf as I,W as J,Ql as K,of as L,xf as M,gf as N,Ef as O,mf as P,fl as Q,uf as R,ep as S,Lf as T,Tu as U,tf as V,yu as W,Fl as X,Il as Y,yl as Z,Fh as _,m_ as a,pl as at,Ph as b,__ as c,al as ct,l_ as d,ys as dt,Ol as et,u_ as f,m as ft,bg as g,Mg as h,y_ as i,Nl as it,bf as j,wf as k,v_ as l,wc as lt,c_ as m,c as mt,O_ as n,ml as nt,g_ as o,cl as ot,s_ as p,u as pt,Jl as q,w_ as r,Cl as rt,h_ as s,ol as st,k_ as t,hl as tt,d_ as u,uc as ut,Lh as v,Gf as w,vh as x,Ih as y,rf as z};
22
+ `;function Fg({error:e}){let t=e.message.includes(`unable to open database`)||e.message.includes(`database is locked`)||e.message.includes(`SQLITE_`);return(0,H.jsx)(`div`,{className:`flex min-h-screen items-center justify-center bg-[#101418] px-4 text-[#eef3f7]`,children:(0,H.jsxs)(`div`,{className:`max-w-[30rem] text-center`,children:[(0,H.jsx)(`h1`,{className:`mb-3 font-semibold text-base`,children:t?`Database unavailable`:`Something went wrong`}),t?(0,H.jsx)(`p`,{className:`my-2 text-[#99a3af] text-[0.875rem] leading-6`,children:`Spiracha could not open the Codex SQLite database. Codex may have an exclusive lock on the file, or the database does not exist yet. Close Codex or wait a moment, then reload.`}):(0,H.jsx)(`p`,{className:`my-2 text-[#99a3af] text-[0.875rem] leading-6`,children:(0,H.jsx)(`code`,{className:`rounded border border-white/10 bg-[#12181e] px-1.5 py-1 text-[0.8em]`,children:e.message})}),(0,H.jsx)(`button`,{className:`mt-6 rounded-full border border-white/15 bg-[#1a222b] px-5 py-2 text-sm hover:bg-[#222e3a]`,type:`button`,onClick:()=>window.location.reload(),children:`Reload`})]})})}var Ig=Oc()({component:Lg,errorComponent:Fg,head:()=>({links:[{href:Ng,rel:`stylesheet`}],meta:[{charSet:`utf-8`},{content:`width=device-width, initial-scale=1`,name:`viewport`},{content:`Browse local Codex threads, projects, tool calls, and analytics through a compact workspace UI.`,name:`description`},{title:`Spiracha UI`}]})});function Lg(){return(0,H.jsx)(Rg,{children:(0,H.jsx)(jg,{children:(0,H.jsx)(Eg,{children:(0,H.jsx)(Tg,{children:(0,H.jsx)(Hc,{})})})})})}function Rg({children:e}){return(0,H.jsxs)(`html`,{lang:`en`,suppressHydrationWarning:!0,children:[(0,H.jsxs)(`head`,{children:[(0,H.jsx)(`script`,{children:Pg}),(0,H.jsx)(nl,{})]}),(0,H.jsxs)(`body`,{children:[e,(0,H.jsx)(rl,{})]})]})}var zg=`modulepreload`,Bg=function(e){return`/`+e},Vg={},Hg=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=function(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))},i=document.getElementsByTagName(`link`),a=document.querySelector(`meta[property=csp-nonce]`),o=a?.nonce||a?.getAttribute(`nonce`);r=e(t.map(e=>{if(e=Bg(e,n),e in Vg)return;Vg[e]=!0;let t=e.endsWith(`.css`),r=t?`[rel="stylesheet"]`:``;if(n)for(let n=i.length-1;n>=0;n--){let r=i[n];if(r.href===e&&(!t||r.rel===`stylesheet`))return}else if(document.querySelector(`link[href="${e}"]${r}`))return;let a=document.createElement(`link`);if(a.rel=t?`stylesheet`:zg,t||(a.as=`script`),a.crossOrigin=``,a.href=e,o&&a.setAttribute(`nonce`,o),document.head.appendChild(a),t)return new Promise((t,n)=>{a.addEventListener(`load`,t),a.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${e}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},Ug=jc(`/settings`)({component:Nc(()=>Hg(()=>import(`./settings-mYTB3sso.js`),__vite__mapDeps([0,1,2])),`component`)}),Wg=[/unable to open database file/iu,/database is locked/iu,/SQLITE_BUSY/iu,/SQLITE_CANTOPEN/iu],Gg=e=>e instanceof Error?Wg.some(t=>t.test(e.message)):!1;function Kg(e){return e!==`__proto__`&&e!==`constructor`&&e!==`prototype`}function qg(e,t){let n=Object.create(null);if(e)for(let t of Object.keys(e))Kg(t)&&(n[t]=e[t]);if(t&&typeof t==`object`)for(let e of Object.keys(t))Kg(e)&&(n[e]=t[e]);return n}function Jg(e){if(!e)return Object.create(null);let t=Object.create(null);for(let n of Object.keys(e))Kg(n)&&(t[n]=e[n]);return t}var Yg=()=>{throw Error(`createServerOnlyFn() functions can only be called on the server!`)},Xg=(e,t)=>{let n=t||e||{};return n.method===void 0&&(n.method=`GET`),Object.assign(e=>Xg(void 0,{...n,...e}),{options:n,middleware:e=>{let t=[...n.middleware||[]];e.map(e=>{y in e?e.options.middleware&&t.push(...e.options.middleware):t.push(e)});let r=Xg(void 0,{...n,middleware:t});return r[y]=!0,r},inputValidator:e=>Xg(void 0,{...n,inputValidator:e}),handler:(...e)=>{let[t,r]=e,i={...n,extractedFn:t,serverFn:r},a=[...i.middleware||[],e_(i)];return t.method=n.method,Object.assign(async e=>{let n=await Zg(a,`client`,{...t,...i,data:e?.data,headers:e?.headers,signal:e?.signal,fetch:e?.fetch,context:Jg()}),r=ht(n.error);if(r)throw r;if(n.error)throw n.error;return n.result},{...t,method:n.method,__executeServer:async e=>{let n=Yg(),r=n.contextAfterGlobalMiddlewares;return await Zg(a,`server`,{...t,...e,serverFnMeta:t.serverFnMeta,context:qg(e.context,r),request:n.request}).then(e=>({result:e.result,error:e.error,context:e.sendContext}))}})}})};async function Zg(e,t,n){let r=Qg([...E()?.functionMiddleware||[],...e]);if(t===`server`){let e=Yg({throwIfNotFound:!1});e?.executedRequestMiddlewares&&(r=r.filter(t=>!e.executedRequestMiddlewares.has(t)))}let i=async e=>{let n=r.shift();if(!n)return e;try{`inputValidator`in n.options&&n.options.inputValidator&&t===`server`&&(e.data=await $g(n.options.inputValidator,e.data));let r;if(t===`client`?`client`in n.options&&(r=n.options.client):`server`in n.options&&(r=n.options.server),r){let t=async(t={})=>{let n=await i({...e,...t,context:qg(e.context,t.context),sendContext:qg(e.sendContext,t.sendContext),headers:ls(e.headers,t.headers),_callSiteFetch:e._callSiteFetch,fetch:e._callSiteFetch??t.fetch??e.fetch,result:t.result===void 0?t instanceof Response?t:e.result:t.result,error:t.error??e.error});if(n.error)throw n.error;return n},n=await r({...e,next:t});if(mt(n))return{...e,error:n};if(n instanceof Response)return{...e,result:n};if(!n)throw Error(`User middleware returned undefined. You must call next() or return a result in your middlewares.`);return n}return i(e)}catch(t){return{...e,error:t}}};return i({...n,headers:n.headers||{},sendContext:n.sendContext||{},context:n.context||Jg(),_callSiteFetch:n.fetch})}function Qg(e,t=100){let n=new Set,r=[],i=(e,a)=>{if(a>t)throw Error(`Middleware nesting depth exceeded maximum of ${t}. Check for circular references.`);e.forEach(e=>{e.options.middleware&&i(e.options.middleware,a+1),n.has(e)||(n.add(e),r.push(e))})};return i(e,0),r}async function $g(e,t){if(e==null)return{};if(`~standard`in e){let n=await e[`~standard`].validate(t);if(n.issues)throw Error(JSON.stringify(n.issues,void 0,2));return n.value}if(`parse`in e)return e.parse(t);if(typeof e==`function`)return e(t);throw Error(`Invalid validator type!`)}function e_(e){return{"~types":void 0,options:{inputValidator:e.inputValidator,client:async({next:t,sendContext:n,fetch:r,...i})=>{let a={...i,context:n,fetch:r};return t(await e.extractedFn?.(a))},server:async({next:t,...n})=>{let r=await e.serverFn?.(n);return t({...n,result:r})}}}}var t_=Xg({method:`GET`}).handler(as(`792690638a3b10035a5b7368c3d98bdc70cbfe1e36a4aa5f45b1c49b8b1025b0`)),n_=Xg({method:`GET`}).handler(as(`ccefccb816ba13508f23db4e31067b3403e750225257592d3ae11071ffc3fd6f`)),r_=Xg({method:`GET`}).handler(as(`59fb2cb4d60c8e7d47e0afcc914ee6f9d9f4bf076c8e66eab1693066753655b3`)),i_=Xg({method:`GET`}).handler(as(`72991e2b6e0adbf8d63bb8b139dad88a00b77b7030ec28ceac36c3cce7846b4c`)),a_=Xg({method:`GET`}).handler(as(`5da27045f7e28ded6353bc16aace284af7ef1b4010ef04d0186a6feadb466497`)),o_=Xg({method:`GET`}).handler(as(`4712520da0f07bbd1f0907e5a162fe518516ff4caca3fd23876cc65539d87d7a`)),s_=Xg({method:`POST`}).handler(as(`0814663c3bdc58135f97d210d145ef0be5ca54ef9a5f1e3030be9b1bfc901e30`)),c_=Xg({method:`POST`}).handler(as(`b4e15c006e9a277470958bb008f89b5b0acc7256109581de44cf17d587d174a5`)),l_=Xg({method:`POST`}).handler(as(`29727b7ad5b8fe42e83817376653e064d9fe8888799f056b2e59296b3396568b`)),u_=Xg({method:`POST`}).handler(as(`96aa60bf7dd9b5bde415bcf3ad6f6955a975eecd9aa0516cf401cc39bebebe6c`)),d_=Xg({method:`POST`}).handler(as(`164ee82cdd565ed96591a64312f0f7bd961040baf066a89d9f5636330d11360b`)),f_=(e,t)=>e<3&&Gg(t),p_=e=>[150,400][e]??800,m_=()=>ou({queryFn:()=>t_(),queryKey:[`dashboard`],retry:f_,retryDelay:p_}),h_=()=>ou({queryFn:()=>n_(),queryKey:[`projects`],retry:f_,retryDelay:p_}),g_=e=>ou({queryFn:()=>r_({data:{project:e}}),queryKey:[`project-threads`,e],retry:f_,retryDelay:p_}),__=e=>ou({queryFn:()=>i_({data:{threadId:e}}),queryKey:[`thread`,e],retry:f_,retryDelay:p_}),v_=e=>ou({queryFn:()=>a_({data:{threadId:e}}),queryKey:[`thread-transcript`,e],retry:f_,retryDelay:p_}),y_=e=>ou({queryFn:()=>o_({data:{project:e}}),queryKey:[`analytics`,e??`all`],retry:f_,retryDelay:p_}),b_=jc(`/analytics`)({component:Nc(()=>Hg(()=>import(`./analytics-Cv0JMDN2.js`),__vite__mapDeps([3,4,2,5,1,6,7,8])),`component`),loader:({context:e})=>Promise.all([e.queryClient.ensureQueryData(h_()),e.queryClient.ensureQueryData(y_(null))])}),x_=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/iu,S_=e=>x_.test(e),C_=jc(`/$threadId`)({beforeLoad:({params:e})=>{throw S_(e.threadId)?pt({params:{threadId:e.threadId},to:`/threads/$threadId`}):rt()},component:Nc(()=>Hg(()=>import(`./_threadId-CAIeH5mq.js`),[]),`component`)}),w_=jc(`/`)({component:Nc(()=>Hg(()=>import(`./routes-CfnaTOlj.js`),__vite__mapDeps([9,5,1,8])),`component`),loader:({context:e})=>e.queryClient.ensureQueryData(m_())});function T_({error:e}){let t=e.message.includes(`unable to open database`)||e.message.includes(`database is locked`);return(0,H.jsxs)(`div`,{className:`rounded-xl border border-[var(--border)] bg-[var(--panel)] px-6 py-10 text-center`,children:[(0,H.jsx)(`p`,{className:`font-medium text-[var(--destructive)] text-sm`,children:t?`Database unavailable`:`Failed to load dashboard`}),(0,H.jsx)(`p`,{className:`mt-2 text-[var(--muted-foreground)] text-sm`,children:t?`Codex may have an exclusive lock on the database. Reload to retry.`:e.message}),(0,H.jsx)(`button`,{className:`mt-4 text-[var(--accent)] text-sm underline-offset-2 hover:underline`,type:`button`,onClick:()=>window.location.reload(),children:`Reload`})]})}w_.update({errorComponent:T_});var E_=jc(`/projects/`)({component:Nc(()=>Hg(()=>import(`./projects.index-BmwtS1x-.js`),__vite__mapDeps([10,4,2,11,7,1,12,8])),`component`),errorComponent:Nc(()=>Hg(()=>import(`./projects.index-CuLw73mt.js`),[]),`errorComponent`),loader:({context:e})=>e.queryClient.ensureQueryData(h_())});function D_({description:e=`Fetching local Codex data. Larger projects can take a moment.`,title:t=`Loading`}){return(0,H.jsxs)(`div`,{className:`rounded-[1.6rem] border border-[var(--border)] bg-[var(--panel)] px-6 py-10 text-center shadow-[var(--panel-shadow)]`,children:[(0,H.jsx)(`div`,{className:`flex justify-center`,children:(0,H.jsx)(`div`,{className:`rounded-full border border-[var(--border)] bg-[var(--panel-secondary)] p-3`,children:(0,H.jsx)(Cu,{className:`size-5 animate-spin text-[var(--accent)]`})})}),(0,H.jsx)(`p`,{className:`mt-4 font-medium text-sm`,children:t}),(0,H.jsx)(`p`,{className:`mt-2 text-[var(--muted-foreground)] text-sm`,children:e})]})}var O_=jc(`/threads/$threadId`)({component:Nc(()=>Hg(()=>import(`./threads._threadId-C_47okme.js`),__vite__mapDeps([13,11,2,7,14,6,5,1,8])),`component`),errorComponent:Nc(()=>Hg(()=>import(`./threads._threadId-CUiCZSwo.js`),[]),`errorComponent`),loader:({context:e,params:t})=>e.queryClient.ensureQueryData(__(t.threadId)),pendingComponent:()=>(0,H.jsx)(D_,{description:`Loading the transcript, metadata, and parsed event stream for this thread.`,title:`Loading thread`})}),k_=jc(`/projects/$project`)({component:Nc(()=>Hg(()=>import(`./projects._project-C2Pys_bB.js`),__vite__mapDeps([15,4,2,11,7,14,6,1,12,8])),`component`),errorComponent:Nc(()=>Hg(()=>import(`./projects._project-CHvAKvlu.js`),[]),`errorComponent`),loader:({context:e,params:t})=>e.queryClient.ensureQueryData(g_(t.project)),pendingComponent:()=>(0,H.jsx)(D_,{description:`Loading project threads and transcript summaries. Large projects can take a moment.`,title:`Loading project`})}),A_=Ug.update({id:`/settings`,path:`/settings`,getParentRoute:()=>Ig}),j_=b_.update({id:`/analytics`,path:`/analytics`,getParentRoute:()=>Ig}),M_=C_.update({id:`/$threadId`,path:`/$threadId`,getParentRoute:()=>Ig}),N_=w_.update({id:`/`,path:`/`,getParentRoute:()=>Ig}),P_=E_.update({id:`/projects/`,path:`/projects/`,getParentRoute:()=>Ig}),F_=O_.update({id:`/threads/$threadId`,path:`/threads/$threadId`,getParentRoute:()=>Ig}),I_={IndexRoute:N_,ThreadIdRoute:M_,AnalyticsRoute:j_,SettingsRoute:A_,ProjectsProjectRoute:k_.update({id:`/projects/$project`,path:`/projects/$project`,getParentRoute:()=>Ig}),ThreadsThreadIdRoute:F_,ProjectsIndexRoute:P_},L_=Ig._addFileChildren(I_);function R_(){let e=lu(),t=qc({context:e,defaultPreload:`intent`,defaultPreloadStaleTime:0,routeTree:L_,scrollRestoration:!0});return cu({queryClient:e.queryClient,router:t}),t}async function z_(){let e=await R_(),t=[];return window.__TSS_START_OPTIONS__={serializationAdapters:t},t.push(os),e.options.serializationAdapters&&t.push(...e.options.serializationAdapters),e.update({basepath:``,serializationAdapters:t}),e.stores.matchesId.get().length||await fs(e),e}var B_=z_;async function V_(){let e=await B_();return window.$_TSR?.h(),e}var H_;function U_(){return H_||=V_(),(0,H.jsx)(xs,{promise:H_,children:e=>(0,H.jsx)(Xc,{router:e})})}var W_=g();(0,V.startTransition)(()=>{(0,W_.hydrateRoot)(document,(0,H.jsx)(V.StrictMode,{children:(0,H.jsx)(U_,{})}))});export{U as $,Cf as A,af as B,$f as C,Af as D,If as E,hf as F,iu as G,Qd as H,sf as I,W as J,Ql as K,of as L,xf as M,gf as N,Ef as O,mf as P,fl as Q,uf as R,ep as S,Lf as T,Tu as U,tf as V,yu as W,Fl as X,Il as Y,yl as Z,Fh as _,m_ as a,pl as at,Ph as b,__ as c,al as ct,l_ as d,ys as dt,Ol as et,u_ as f,m as ft,bg as g,Mg as h,y_ as i,Nl as it,bf as j,wf as k,v_ as l,wc as lt,c_ as m,c as mt,O_ as n,ml as nt,g_ as o,cl as ot,s_ as p,u as pt,Jl as q,w_ as r,Cl as rt,h_ as s,ol as st,k_ as t,hl as tt,d_ as u,uc as ut,Lh as v,Gf as w,vh as x,Ih as y,rf as z};
@@ -1 +1 @@
1
- import{i as e,n as t,r as n}from"./delete-confirm-dialog-CcZaRX33.js";import{a as r,i,n as a,o,r as s,t as c}from"./es2015-Bm0kEzx2.js";import{A as l,B as u,C as d,D as f,E as p,F as m,H as h,L as g,M as _,O as ee,P as v,T as y,W as b,_ as x,b as S,dt as te,mt as ne,pt as re,v as ie,w as ae,x as C,y as oe,z as w}from"./index-DdJ7ahIt.js";var se=b(`ellipsis`,[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`19`,cy:`12`,r:`1`,key:`1wjl8i`}],[`circle`,{cx:`5`,cy:`12`,r:`1`,key:`1pcz8c`}]]),T=ne(re(),1),E=te(),D=[`Enter`,` `],O=[`ArrowDown`,`PageUp`,`Home`],ce=[`ArrowUp`,`PageDown`,`End`],le=[...O,...ce],ue={ltr:[...D,`ArrowRight`],rtl:[...D,`ArrowLeft`]},k={ltr:[`ArrowLeft`],rtl:[`ArrowRight`]},A=`Menu`,[j,de,fe]=o(A),[M,N]=_(A,[fe,C,e]),P=C(),pe=e(),[F,I]=M(A),[me,L]=M(A),he=e=>{let{__scopeMenu:t,open:n=!1,children:i,dir:a,onOpenChange:o,modal:s=!0}=e,c=P(t),[l,u]=T.useState(null),d=T.useRef(!1),f=y(o),p=r(a);return T.useEffect(()=>{let e=()=>{d.current=!0,document.addEventListener(`pointerdown`,t,{capture:!0,once:!0}),document.addEventListener(`pointermove`,t,{capture:!0,once:!0})},t=()=>d.current=!1;return document.addEventListener(`keydown`,e,{capture:!0}),()=>{document.removeEventListener(`keydown`,e,{capture:!0}),document.removeEventListener(`pointerdown`,t,{capture:!0}),document.removeEventListener(`pointermove`,t,{capture:!0})}},[]),(0,E.jsx)(S,{...c,children:(0,E.jsx)(F,{scope:t,open:n,onOpenChange:f,content:l,onContentChange:u,children:(0,E.jsx)(me,{scope:t,onClose:T.useCallback(()=>f(!1),[f]),isUsingKeyboardRef:d,dir:p,modal:s,children:i})})})};he.displayName=A;var ge=`MenuAnchor`,R=T.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e,i=P(n);return(0,E.jsx)(x,{...i,...r,ref:t})});R.displayName=ge;var z=`MenuPortal`,[_e,ve]=M(z,{forceMount:void 0}),ye=e=>{let{__scopeMenu:t,forceMount:n,children:r,container:i}=e,a=I(z,t);return(0,E.jsx)(_e,{scope:t,forceMount:n,children:(0,E.jsx)(f,{present:n||a.open,children:(0,E.jsx)(d,{asChild:!0,container:i,children:r})})})};ye.displayName=z;var B=`MenuContent`,[be,V]=M(B),xe=T.forwardRef((e,t)=>{let n=ve(B,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=I(B,e.__scopeMenu),o=L(B,e.__scopeMenu);return(0,E.jsx)(j.Provider,{scope:e.__scopeMenu,children:(0,E.jsx)(f,{present:r||a.open,children:(0,E.jsx)(j.Slot,{scope:e.__scopeMenu,children:o.modal?(0,E.jsx)(Se,{...i,ref:t}):(0,E.jsx)(Ce,{...i,ref:t})})})})}),Se=T.forwardRef((e,t)=>{let n=I(B,e.__scopeMenu),r=T.useRef(null),i=u(t,r);return T.useEffect(()=>{let e=r.current;if(e)return c(e)},[]),(0,E.jsx)(H,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:l(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),Ce=T.forwardRef((e,t)=>{let n=I(B,e.__scopeMenu);return(0,E.jsx)(H,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),we=g(`MenuContent.ScrollLock`),H=T.forwardRef((e,t)=>{let{__scopeMenu:r,loop:o=!1,trapFocus:c,onOpenAutoFocus:d,onCloseAutoFocus:f,disableOutsidePointerEvents:p,onEntryFocus:m,onEscapeKeyDown:h,onPointerDownOutside:g,onFocusOutside:_,onInteractOutside:ee,onDismiss:v,disableOutsideScroll:y,...b}=e,x=I(B,r),S=L(B,r),te=P(r),ne=pe(r),re=de(r),[ie,C]=T.useState(null),w=T.useRef(null),se=u(t,w,x.onContentChange),D=T.useRef(0),O=T.useRef(``),ue=T.useRef(0),k=T.useRef(null),A=T.useRef(`right`),j=T.useRef(0),fe=y?a:T.Fragment,M=y?{as:we,allowPinchZoom:!0}:void 0,N=e=>{let t=O.current+e,n=re().filter(e=>!e.disabled),r=document.activeElement,i=n.find(e=>e.ref.current===r)?.textValue,a=et(n.map(e=>e.textValue),t,i),o=n.find(e=>e.textValue===a)?.ref.current;(function e(t){O.current=t,window.clearTimeout(D.current),t!==``&&(D.current=window.setTimeout(()=>e(``),1e3))})(t),o&&setTimeout(()=>o.focus())};T.useEffect(()=>()=>window.clearTimeout(D.current),[]),s();let F=T.useCallback(e=>A.current===k.current?.side&&nt(e,k.current?.area),[]);return(0,E.jsx)(be,{scope:r,searchRef:O,onItemEnter:T.useCallback(e=>{F(e)&&e.preventDefault()},[F]),onItemLeave:T.useCallback(e=>{F(e)||(w.current?.focus(),C(null))},[F]),onTriggerLeave:T.useCallback(e=>{F(e)&&e.preventDefault()},[F]),pointerGraceTimerRef:ue,onPointerGraceIntentChange:T.useCallback(e=>{k.current=e},[]),children:(0,E.jsx)(fe,{...M,children:(0,E.jsx)(i,{asChild:!0,trapped:c,onMountAutoFocus:l(d,e=>{e.preventDefault(),w.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:f,children:(0,E.jsx)(ae,{asChild:!0,disableOutsidePointerEvents:p,onEscapeKeyDown:h,onPointerDownOutside:g,onFocusOutside:_,onInteractOutside:ee,onDismiss:v,children:(0,E.jsx)(n,{asChild:!0,...ne,dir:S.dir,orientation:`vertical`,loop:o,currentTabStopId:ie,onCurrentTabStopIdChange:C,onEntryFocus:l(m,e=>{S.isUsingKeyboardRef.current||e.preventDefault()}),preventScrollOnEntryFocus:!0,children:(0,E.jsx)(oe,{role:`menu`,"aria-orientation":`vertical`,"data-state":Ze(x.open),"data-radix-menu-content":``,dir:S.dir,...te,...b,ref:se,style:{outline:`none`,...b.style},onKeyDown:l(b.onKeyDown,e=>{let t=e.target.closest(`[data-radix-menu-content]`)===e.currentTarget,n=e.ctrlKey||e.altKey||e.metaKey,r=e.key.length===1;t&&(e.key===`Tab`&&e.preventDefault(),!n&&r&&N(e.key));let i=w.current;if(e.target!==i||!le.includes(e.key))return;e.preventDefault();let a=re().filter(e=>!e.disabled).map(e=>e.ref.current);ce.includes(e.key)&&a.reverse(),Qe(a)}),onBlur:l(e.onBlur,e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(D.current),O.current=``)}),onPointerMove:l(e.onPointerMove,Z(e=>{let t=e.target,n=j.current!==e.clientX;e.currentTarget.contains(t)&&n&&(A.current=e.clientX>j.current?`right`:`left`,j.current=e.clientX)}))})})})})})})});xe.displayName=B;var Te=`MenuGroup`,U=T.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,E.jsx)(v.div,{role:`group`,...r,ref:t})});U.displayName=Te;var Ee=`MenuLabel`,De=T.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,E.jsx)(v.div,{...r,ref:t})});De.displayName=Ee;var W=`MenuItem`,Oe=`menu.itemSelect`,G=T.forwardRef((e,t)=>{let{disabled:n=!1,onSelect:r,...i}=e,a=T.useRef(null),o=L(W,e.__scopeMenu),s=V(W,e.__scopeMenu),c=u(t,a),d=T.useRef(!1),f=()=>{let e=a.current;if(!n&&e){let t=new CustomEvent(Oe,{bubbles:!0,cancelable:!0});e.addEventListener(Oe,e=>r?.(e),{once:!0}),m(e,t),t.defaultPrevented?d.current=!1:o.onClose()}};return(0,E.jsx)(ke,{...i,ref:c,disabled:n,onClick:l(e.onClick,f),onPointerDown:t=>{e.onPointerDown?.(t),d.current=!0},onPointerUp:l(e.onPointerUp,e=>{d.current||e.currentTarget?.click()}),onKeyDown:l(e.onKeyDown,e=>{let t=s.searchRef.current!==``;n||t&&e.key===` `||D.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())})})});G.displayName=W;var ke=T.forwardRef((e,n)=>{let{__scopeMenu:r,disabled:i=!1,textValue:a,...o}=e,s=V(W,r),c=pe(r),d=T.useRef(null),f=u(n,d),[p,m]=T.useState(!1),[h,g]=T.useState(``);return T.useEffect(()=>{let e=d.current;e&&g((e.textContent??``).trim())},[o.children]),(0,E.jsx)(j.ItemSlot,{scope:r,disabled:i,textValue:a??h,children:(0,E.jsx)(t,{asChild:!0,...c,focusable:!i,children:(0,E.jsx)(v.div,{role:`menuitem`,"data-highlighted":p?``:void 0,"aria-disabled":i||void 0,"data-disabled":i?``:void 0,...o,ref:f,onPointerMove:l(e.onPointerMove,Z(e=>{i?s.onItemLeave(e):(s.onItemEnter(e),e.defaultPrevented||e.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:l(e.onPointerLeave,Z(e=>s.onItemLeave(e))),onFocus:l(e.onFocus,()=>m(!0)),onBlur:l(e.onBlur,()=>m(!1))})})})}),Ae=`MenuCheckboxItem`,je=T.forwardRef((e,t)=>{let{checked:n=!1,onCheckedChange:r,...i}=e;return(0,E.jsx)(Re,{scope:e.__scopeMenu,checked:n,children:(0,E.jsx)(G,{role:`menuitemcheckbox`,"aria-checked":Y(n)?`mixed`:n,...i,ref:t,"data-state":X(n),onSelect:l(i.onSelect,()=>r?.(Y(n)?!0:!n),{checkForDefaultPrevented:!1})})})});je.displayName=Ae;var Me=`MenuRadioGroup`,[Ne,Pe]=M(Me,{value:void 0,onValueChange:()=>{}}),Fe=T.forwardRef((e,t)=>{let{value:n,onValueChange:r,...i}=e,a=y(r);return(0,E.jsx)(Ne,{scope:e.__scopeMenu,value:n,onValueChange:a,children:(0,E.jsx)(U,{...i,ref:t})})});Fe.displayName=Me;var Ie=`MenuRadioItem`,Le=T.forwardRef((e,t)=>{let{value:n,...r}=e,i=Pe(Ie,e.__scopeMenu),a=n===i.value;return(0,E.jsx)(Re,{scope:e.__scopeMenu,checked:a,children:(0,E.jsx)(G,{role:`menuitemradio`,"aria-checked":a,...r,ref:t,"data-state":X(a),onSelect:l(r.onSelect,()=>i.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});Le.displayName=Ie;var K=`MenuItemIndicator`,[Re,ze]=M(K,{checked:!1}),Be=T.forwardRef((e,t)=>{let{__scopeMenu:n,forceMount:r,...i}=e,a=ze(K,n);return(0,E.jsx)(f,{present:r||Y(a.checked)||a.checked===!0,children:(0,E.jsx)(v.span,{...i,ref:t,"data-state":X(a.checked)})})});Be.displayName=K;var Ve=`MenuSeparator`,He=T.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,E.jsx)(v.div,{role:`separator`,"aria-orientation":`horizontal`,...r,ref:t})});He.displayName=Ve;var Ue=`MenuArrow`,We=T.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e,i=P(n);return(0,E.jsx)(ie,{...i,...r,ref:t})});We.displayName=Ue;var q=`MenuSub`,[Ge,Ke]=M(q),qe=e=>{let{__scopeMenu:t,children:n,open:r=!1,onOpenChange:i}=e,a=I(q,t),o=P(t),[s,c]=T.useState(null),[l,u]=T.useState(null),d=y(i);return T.useEffect(()=>(a.open===!1&&d(!1),()=>d(!1)),[a.open,d]),(0,E.jsx)(S,{...o,children:(0,E.jsx)(F,{scope:t,open:r,onOpenChange:d,content:l,onContentChange:u,children:(0,E.jsx)(Ge,{scope:t,contentId:p(),triggerId:p(),trigger:s,onTriggerChange:c,children:n})})})};qe.displayName=q;var J=`MenuSubTrigger`,Je=T.forwardRef((e,t)=>{let n=I(J,e.__scopeMenu),r=L(J,e.__scopeMenu),i=Ke(J,e.__scopeMenu),a=V(J,e.__scopeMenu),o=T.useRef(null),{pointerGraceTimerRef:s,onPointerGraceIntentChange:c}=a,u={__scopeMenu:e.__scopeMenu},d=T.useCallback(()=>{o.current&&window.clearTimeout(o.current),o.current=null},[]);return T.useEffect(()=>d,[d]),T.useEffect(()=>{let e=s.current;return()=>{window.clearTimeout(e),c(null)}},[s,c]),(0,E.jsx)(R,{asChild:!0,...u,children:(0,E.jsx)(ke,{id:i.triggerId,"aria-haspopup":`menu`,"aria-expanded":n.open,"aria-controls":i.contentId,"data-state":Ze(n.open),...e,ref:w(t,i.onTriggerChange),onClick:t=>{e.onClick?.(t),!(e.disabled||t.defaultPrevented)&&(t.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:l(e.onPointerMove,Z(t=>{a.onItemEnter(t),!t.defaultPrevented&&!e.disabled&&!n.open&&!o.current&&(a.onPointerGraceIntentChange(null),o.current=window.setTimeout(()=>{n.onOpenChange(!0),d()},100))})),onPointerLeave:l(e.onPointerLeave,Z(e=>{d();let t=n.content?.getBoundingClientRect();if(t){let r=n.content?.dataset.side,i=r===`right`,o=i?-5:5,c=t[i?`left`:`right`],l=t[i?`right`:`left`];a.onPointerGraceIntentChange({area:[{x:e.clientX+o,y:e.clientY},{x:c,y:t.top},{x:l,y:t.top},{x:l,y:t.bottom},{x:c,y:t.bottom}],side:r}),window.clearTimeout(s.current),s.current=window.setTimeout(()=>a.onPointerGraceIntentChange(null),300)}else{if(a.onTriggerLeave(e),e.defaultPrevented)return;a.onPointerGraceIntentChange(null)}})),onKeyDown:l(e.onKeyDown,t=>{let i=a.searchRef.current!==``;e.disabled||i&&t.key===` `||ue[r.dir].includes(t.key)&&(n.onOpenChange(!0),n.content?.focus(),t.preventDefault())})})})});Je.displayName=J;var Ye=`MenuSubContent`,Xe=T.forwardRef((e,t)=>{let n=ve(B,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=I(B,e.__scopeMenu),o=L(B,e.__scopeMenu),s=Ke(Ye,e.__scopeMenu),c=T.useRef(null),d=u(t,c);return(0,E.jsx)(j.Provider,{scope:e.__scopeMenu,children:(0,E.jsx)(f,{present:r||a.open,children:(0,E.jsx)(j.Slot,{scope:e.__scopeMenu,children:(0,E.jsx)(H,{id:s.contentId,"aria-labelledby":s.triggerId,...i,ref:d,align:`start`,side:o.dir===`rtl`?`left`:`right`,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:e=>{o.isUsingKeyboardRef.current&&c.current?.focus(),e.preventDefault()},onCloseAutoFocus:e=>e.preventDefault(),onFocusOutside:l(e.onFocusOutside,e=>{e.target!==s.trigger&&a.onOpenChange(!1)}),onEscapeKeyDown:l(e.onEscapeKeyDown,e=>{o.onClose(),e.preventDefault()}),onKeyDown:l(e.onKeyDown,e=>{let t=e.currentTarget.contains(e.target),n=k[o.dir].includes(e.key);t&&n&&(a.onOpenChange(!1),s.trigger?.focus(),e.preventDefault())})})})})})});Xe.displayName=Ye;function Ze(e){return e?`open`:`closed`}function Y(e){return e===`indeterminate`}function X(e){return Y(e)?`indeterminate`:e?`checked`:`unchecked`}function Qe(e){let t=document.activeElement;for(let n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function $e(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function et(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=$e(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}function tt(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}function nt(e,t){return t?tt({x:e.clientX,y:e.clientY},t):!1}function Z(e){return t=>t.pointerType===`mouse`?e(t):void 0}var rt=he,it=R,at=ye,ot=xe,st=U,ct=De,lt=G,ut=je,dt=Fe,ft=Le,pt=Be,mt=He,ht=We,gt=Je,_t=Xe,Q=`DropdownMenu`,[vt,yt]=_(Q,[N]),$=N(),[bt,xt]=vt(Q),St=e=>{let{__scopeDropdownMenu:t,children:n,dir:r,open:i,defaultOpen:a,onOpenChange:o,modal:s=!0}=e,c=$(t),l=T.useRef(null),[u,d]=ee({prop:i,defaultProp:a??!1,onChange:o,caller:Q});return(0,E.jsx)(bt,{scope:t,triggerId:p(),triggerRef:l,contentId:p(),open:u,onOpenChange:d,onOpenToggle:T.useCallback(()=>d(e=>!e),[d]),modal:s,children:(0,E.jsx)(rt,{...c,open:u,onOpenChange:d,dir:r,modal:s,children:n})})};St.displayName=Q;var Ct=`DropdownMenuTrigger`,wt=T.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,disabled:r=!1,...i}=e,a=xt(Ct,n),o=$(n);return(0,E.jsx)(it,{asChild:!0,...o,children:(0,E.jsx)(v.button,{type:`button`,id:a.triggerId,"aria-haspopup":`menu`,"aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":a.open?`open`:`closed`,"data-disabled":r?``:void 0,disabled:r,...i,ref:w(t,a.triggerRef),onPointerDown:l(e.onPointerDown,e=>{!r&&e.button===0&&e.ctrlKey===!1&&(a.onOpenToggle(),a.open||e.preventDefault())}),onKeyDown:l(e.onKeyDown,e=>{r||([`Enter`,` `].includes(e.key)&&a.onOpenToggle(),e.key===`ArrowDown`&&a.onOpenChange(!0),[`Enter`,` `,`ArrowDown`].includes(e.key)&&e.preventDefault())})})})});wt.displayName=Ct;var Tt=`DropdownMenuPortal`,Et=e=>{let{__scopeDropdownMenu:t,...n}=e,r=$(t);return(0,E.jsx)(at,{...r,...n})};Et.displayName=Tt;var Dt=`DropdownMenuContent`,Ot=T.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=xt(Dt,n),a=$(n),o=T.useRef(!1);return(0,E.jsx)(ot,{id:i.contentId,"aria-labelledby":i.triggerId,...a,...r,ref:t,onCloseAutoFocus:l(e.onCloseAutoFocus,e=>{o.current||i.triggerRef.current?.focus(),o.current=!1,e.preventDefault()}),onInteractOutside:l(e.onInteractOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,r=t.button===2||n;(!i.modal||r)&&(o.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-dropdown-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-dropdown-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-dropdown-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-dropdown-menu-trigger-height":`var(--radix-popper-anchor-height)`}})});Ot.displayName=Dt;var kt=`DropdownMenuGroup`,At=T.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,E.jsx)(st,{...i,...r,ref:t})});At.displayName=kt;var jt=`DropdownMenuLabel`,Mt=T.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,E.jsx)(ct,{...i,...r,ref:t})});Mt.displayName=jt;var Nt=`DropdownMenuItem`,Pt=T.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,E.jsx)(lt,{...i,...r,ref:t})});Pt.displayName=Nt;var Ft=`DropdownMenuCheckboxItem`,It=T.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,E.jsx)(ut,{...i,...r,ref:t})});It.displayName=Ft;var Lt=`DropdownMenuRadioGroup`,Rt=T.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,E.jsx)(dt,{...i,...r,ref:t})});Rt.displayName=Lt;var zt=`DropdownMenuRadioItem`,Bt=T.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,E.jsx)(ft,{...i,...r,ref:t})});Bt.displayName=zt;var Vt=`DropdownMenuItemIndicator`,Ht=T.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,E.jsx)(pt,{...i,...r,ref:t})});Ht.displayName=Vt;var Ut=`DropdownMenuSeparator`,Wt=T.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,E.jsx)(mt,{...i,...r,ref:t})});Wt.displayName=Ut;var Gt=`DropdownMenuArrow`,Kt=T.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,E.jsx)(ht,{...i,...r,ref:t})});Kt.displayName=Gt;var qt=`DropdownMenuSubTrigger`,Jt=T.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,E.jsx)(gt,{...i,...r,ref:t})});Jt.displayName=qt;var Yt=`DropdownMenuSubContent`,Xt=T.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,E.jsx)(_t,{...i,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-dropdown-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-dropdown-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-dropdown-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-dropdown-menu-trigger-height":`var(--radix-popper-anchor-height)`}})});Xt.displayName=Yt;var Zt=St,Qt=wt,$t=Et,en=Ot,tn=Pt;function nn({...e}){return(0,E.jsx)(Zt,{"data-slot":`dropdown-menu`,...e})}function rn({...e}){return(0,E.jsx)(Qt,{"data-slot":`dropdown-menu-trigger`,...e})}function an({className:e,sideOffset:t=4,...n}){return(0,E.jsx)($t,{children:(0,E.jsx)(en,{"data-slot":`dropdown-menu-content`,sideOffset:t,className:h(`data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-y-auto overflow-x-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=closed]:animate-out data-[state=open]:animate-in`,e),...n})})}function on({className:e,inset:t,variant:n=`default`,...r}){return(0,E.jsx)(tn,{"data-slot":`dropdown-menu-item`,"data-inset":t,"data-variant":n,className:h(`relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[inset]:pl-8 data-[variant=destructive]:text-destructive data-[disabled]:opacity-50 data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 data-[variant=destructive]:*:[svg]:text-destructive!`,e),...r})}function sn({className:e,type:t,...n}){return(0,E.jsx)(`input`,{type:t,"data-slot":`input`,className:h(`h-9 w-full min-w-0 rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-xs outline-none transition-[color,box-shadow] selection:bg-primary selection:text-primary-foreground file:inline-flex file:h-7 file:border-0 file:bg-transparent file:font-medium file:text-foreground file:text-sm placeholder:text-muted-foreground disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm dark:bg-input/30`,`focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50`,`aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40`,e),...n})}export{rn as a,on as i,nn as n,se as o,an as r,sn as t};
1
+ import{i as e,n as t,r as n}from"./delete-confirm-dialog-CIZy_LXD.js";import{a as r,i,n as a,o,r as s,t as c}from"./es2015-DsDKdYCE.js";import{A as l,B as u,C as d,D as f,E as p,F as m,H as h,L as g,M as _,O as ee,P as v,T as y,W as b,_ as x,b as S,dt as te,mt as ne,pt as re,v as ie,w as ae,x as C,y as oe,z as w}from"./index-C_-e0lDI.js";var se=b(`ellipsis`,[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`19`,cy:`12`,r:`1`,key:`1wjl8i`}],[`circle`,{cx:`5`,cy:`12`,r:`1`,key:`1pcz8c`}]]),T=ne(re(),1),E=te(),D=[`Enter`,` `],O=[`ArrowDown`,`PageUp`,`Home`],ce=[`ArrowUp`,`PageDown`,`End`],le=[...O,...ce],ue={ltr:[...D,`ArrowRight`],rtl:[...D,`ArrowLeft`]},k={ltr:[`ArrowLeft`],rtl:[`ArrowRight`]},A=`Menu`,[j,de,fe]=o(A),[M,N]=_(A,[fe,C,e]),P=C(),pe=e(),[F,I]=M(A),[me,L]=M(A),he=e=>{let{__scopeMenu:t,open:n=!1,children:i,dir:a,onOpenChange:o,modal:s=!0}=e,c=P(t),[l,u]=T.useState(null),d=T.useRef(!1),f=y(o),p=r(a);return T.useEffect(()=>{let e=()=>{d.current=!0,document.addEventListener(`pointerdown`,t,{capture:!0,once:!0}),document.addEventListener(`pointermove`,t,{capture:!0,once:!0})},t=()=>d.current=!1;return document.addEventListener(`keydown`,e,{capture:!0}),()=>{document.removeEventListener(`keydown`,e,{capture:!0}),document.removeEventListener(`pointerdown`,t,{capture:!0}),document.removeEventListener(`pointermove`,t,{capture:!0})}},[]),(0,E.jsx)(S,{...c,children:(0,E.jsx)(F,{scope:t,open:n,onOpenChange:f,content:l,onContentChange:u,children:(0,E.jsx)(me,{scope:t,onClose:T.useCallback(()=>f(!1),[f]),isUsingKeyboardRef:d,dir:p,modal:s,children:i})})})};he.displayName=A;var ge=`MenuAnchor`,R=T.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e,i=P(n);return(0,E.jsx)(x,{...i,...r,ref:t})});R.displayName=ge;var z=`MenuPortal`,[_e,ve]=M(z,{forceMount:void 0}),ye=e=>{let{__scopeMenu:t,forceMount:n,children:r,container:i}=e,a=I(z,t);return(0,E.jsx)(_e,{scope:t,forceMount:n,children:(0,E.jsx)(f,{present:n||a.open,children:(0,E.jsx)(d,{asChild:!0,container:i,children:r})})})};ye.displayName=z;var B=`MenuContent`,[be,V]=M(B),xe=T.forwardRef((e,t)=>{let n=ve(B,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=I(B,e.__scopeMenu),o=L(B,e.__scopeMenu);return(0,E.jsx)(j.Provider,{scope:e.__scopeMenu,children:(0,E.jsx)(f,{present:r||a.open,children:(0,E.jsx)(j.Slot,{scope:e.__scopeMenu,children:o.modal?(0,E.jsx)(Se,{...i,ref:t}):(0,E.jsx)(Ce,{...i,ref:t})})})})}),Se=T.forwardRef((e,t)=>{let n=I(B,e.__scopeMenu),r=T.useRef(null),i=u(t,r);return T.useEffect(()=>{let e=r.current;if(e)return c(e)},[]),(0,E.jsx)(H,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:l(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),Ce=T.forwardRef((e,t)=>{let n=I(B,e.__scopeMenu);return(0,E.jsx)(H,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),we=g(`MenuContent.ScrollLock`),H=T.forwardRef((e,t)=>{let{__scopeMenu:r,loop:o=!1,trapFocus:c,onOpenAutoFocus:d,onCloseAutoFocus:f,disableOutsidePointerEvents:p,onEntryFocus:m,onEscapeKeyDown:h,onPointerDownOutside:g,onFocusOutside:_,onInteractOutside:ee,onDismiss:v,disableOutsideScroll:y,...b}=e,x=I(B,r),S=L(B,r),te=P(r),ne=pe(r),re=de(r),[ie,C]=T.useState(null),w=T.useRef(null),se=u(t,w,x.onContentChange),D=T.useRef(0),O=T.useRef(``),ue=T.useRef(0),k=T.useRef(null),A=T.useRef(`right`),j=T.useRef(0),fe=y?a:T.Fragment,M=y?{as:we,allowPinchZoom:!0}:void 0,N=e=>{let t=O.current+e,n=re().filter(e=>!e.disabled),r=document.activeElement,i=n.find(e=>e.ref.current===r)?.textValue,a=et(n.map(e=>e.textValue),t,i),o=n.find(e=>e.textValue===a)?.ref.current;(function e(t){O.current=t,window.clearTimeout(D.current),t!==``&&(D.current=window.setTimeout(()=>e(``),1e3))})(t),o&&setTimeout(()=>o.focus())};T.useEffect(()=>()=>window.clearTimeout(D.current),[]),s();let F=T.useCallback(e=>A.current===k.current?.side&&nt(e,k.current?.area),[]);return(0,E.jsx)(be,{scope:r,searchRef:O,onItemEnter:T.useCallback(e=>{F(e)&&e.preventDefault()},[F]),onItemLeave:T.useCallback(e=>{F(e)||(w.current?.focus(),C(null))},[F]),onTriggerLeave:T.useCallback(e=>{F(e)&&e.preventDefault()},[F]),pointerGraceTimerRef:ue,onPointerGraceIntentChange:T.useCallback(e=>{k.current=e},[]),children:(0,E.jsx)(fe,{...M,children:(0,E.jsx)(i,{asChild:!0,trapped:c,onMountAutoFocus:l(d,e=>{e.preventDefault(),w.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:f,children:(0,E.jsx)(ae,{asChild:!0,disableOutsidePointerEvents:p,onEscapeKeyDown:h,onPointerDownOutside:g,onFocusOutside:_,onInteractOutside:ee,onDismiss:v,children:(0,E.jsx)(n,{asChild:!0,...ne,dir:S.dir,orientation:`vertical`,loop:o,currentTabStopId:ie,onCurrentTabStopIdChange:C,onEntryFocus:l(m,e=>{S.isUsingKeyboardRef.current||e.preventDefault()}),preventScrollOnEntryFocus:!0,children:(0,E.jsx)(oe,{role:`menu`,"aria-orientation":`vertical`,"data-state":Ze(x.open),"data-radix-menu-content":``,dir:S.dir,...te,...b,ref:se,style:{outline:`none`,...b.style},onKeyDown:l(b.onKeyDown,e=>{let t=e.target.closest(`[data-radix-menu-content]`)===e.currentTarget,n=e.ctrlKey||e.altKey||e.metaKey,r=e.key.length===1;t&&(e.key===`Tab`&&e.preventDefault(),!n&&r&&N(e.key));let i=w.current;if(e.target!==i||!le.includes(e.key))return;e.preventDefault();let a=re().filter(e=>!e.disabled).map(e=>e.ref.current);ce.includes(e.key)&&a.reverse(),Qe(a)}),onBlur:l(e.onBlur,e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(D.current),O.current=``)}),onPointerMove:l(e.onPointerMove,Z(e=>{let t=e.target,n=j.current!==e.clientX;e.currentTarget.contains(t)&&n&&(A.current=e.clientX>j.current?`right`:`left`,j.current=e.clientX)}))})})})})})})});xe.displayName=B;var Te=`MenuGroup`,U=T.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,E.jsx)(v.div,{role:`group`,...r,ref:t})});U.displayName=Te;var Ee=`MenuLabel`,De=T.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,E.jsx)(v.div,{...r,ref:t})});De.displayName=Ee;var W=`MenuItem`,Oe=`menu.itemSelect`,G=T.forwardRef((e,t)=>{let{disabled:n=!1,onSelect:r,...i}=e,a=T.useRef(null),o=L(W,e.__scopeMenu),s=V(W,e.__scopeMenu),c=u(t,a),d=T.useRef(!1),f=()=>{let e=a.current;if(!n&&e){let t=new CustomEvent(Oe,{bubbles:!0,cancelable:!0});e.addEventListener(Oe,e=>r?.(e),{once:!0}),m(e,t),t.defaultPrevented?d.current=!1:o.onClose()}};return(0,E.jsx)(ke,{...i,ref:c,disabled:n,onClick:l(e.onClick,f),onPointerDown:t=>{e.onPointerDown?.(t),d.current=!0},onPointerUp:l(e.onPointerUp,e=>{d.current||e.currentTarget?.click()}),onKeyDown:l(e.onKeyDown,e=>{let t=s.searchRef.current!==``;n||t&&e.key===` `||D.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())})})});G.displayName=W;var ke=T.forwardRef((e,n)=>{let{__scopeMenu:r,disabled:i=!1,textValue:a,...o}=e,s=V(W,r),c=pe(r),d=T.useRef(null),f=u(n,d),[p,m]=T.useState(!1),[h,g]=T.useState(``);return T.useEffect(()=>{let e=d.current;e&&g((e.textContent??``).trim())},[o.children]),(0,E.jsx)(j.ItemSlot,{scope:r,disabled:i,textValue:a??h,children:(0,E.jsx)(t,{asChild:!0,...c,focusable:!i,children:(0,E.jsx)(v.div,{role:`menuitem`,"data-highlighted":p?``:void 0,"aria-disabled":i||void 0,"data-disabled":i?``:void 0,...o,ref:f,onPointerMove:l(e.onPointerMove,Z(e=>{i?s.onItemLeave(e):(s.onItemEnter(e),e.defaultPrevented||e.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:l(e.onPointerLeave,Z(e=>s.onItemLeave(e))),onFocus:l(e.onFocus,()=>m(!0)),onBlur:l(e.onBlur,()=>m(!1))})})})}),Ae=`MenuCheckboxItem`,je=T.forwardRef((e,t)=>{let{checked:n=!1,onCheckedChange:r,...i}=e;return(0,E.jsx)(Re,{scope:e.__scopeMenu,checked:n,children:(0,E.jsx)(G,{role:`menuitemcheckbox`,"aria-checked":Y(n)?`mixed`:n,...i,ref:t,"data-state":X(n),onSelect:l(i.onSelect,()=>r?.(Y(n)?!0:!n),{checkForDefaultPrevented:!1})})})});je.displayName=Ae;var Me=`MenuRadioGroup`,[Ne,Pe]=M(Me,{value:void 0,onValueChange:()=>{}}),Fe=T.forwardRef((e,t)=>{let{value:n,onValueChange:r,...i}=e,a=y(r);return(0,E.jsx)(Ne,{scope:e.__scopeMenu,value:n,onValueChange:a,children:(0,E.jsx)(U,{...i,ref:t})})});Fe.displayName=Me;var Ie=`MenuRadioItem`,Le=T.forwardRef((e,t)=>{let{value:n,...r}=e,i=Pe(Ie,e.__scopeMenu),a=n===i.value;return(0,E.jsx)(Re,{scope:e.__scopeMenu,checked:a,children:(0,E.jsx)(G,{role:`menuitemradio`,"aria-checked":a,...r,ref:t,"data-state":X(a),onSelect:l(r.onSelect,()=>i.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});Le.displayName=Ie;var K=`MenuItemIndicator`,[Re,ze]=M(K,{checked:!1}),Be=T.forwardRef((e,t)=>{let{__scopeMenu:n,forceMount:r,...i}=e,a=ze(K,n);return(0,E.jsx)(f,{present:r||Y(a.checked)||a.checked===!0,children:(0,E.jsx)(v.span,{...i,ref:t,"data-state":X(a.checked)})})});Be.displayName=K;var Ve=`MenuSeparator`,He=T.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,E.jsx)(v.div,{role:`separator`,"aria-orientation":`horizontal`,...r,ref:t})});He.displayName=Ve;var Ue=`MenuArrow`,We=T.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e,i=P(n);return(0,E.jsx)(ie,{...i,...r,ref:t})});We.displayName=Ue;var q=`MenuSub`,[Ge,Ke]=M(q),qe=e=>{let{__scopeMenu:t,children:n,open:r=!1,onOpenChange:i}=e,a=I(q,t),o=P(t),[s,c]=T.useState(null),[l,u]=T.useState(null),d=y(i);return T.useEffect(()=>(a.open===!1&&d(!1),()=>d(!1)),[a.open,d]),(0,E.jsx)(S,{...o,children:(0,E.jsx)(F,{scope:t,open:r,onOpenChange:d,content:l,onContentChange:u,children:(0,E.jsx)(Ge,{scope:t,contentId:p(),triggerId:p(),trigger:s,onTriggerChange:c,children:n})})})};qe.displayName=q;var J=`MenuSubTrigger`,Je=T.forwardRef((e,t)=>{let n=I(J,e.__scopeMenu),r=L(J,e.__scopeMenu),i=Ke(J,e.__scopeMenu),a=V(J,e.__scopeMenu),o=T.useRef(null),{pointerGraceTimerRef:s,onPointerGraceIntentChange:c}=a,u={__scopeMenu:e.__scopeMenu},d=T.useCallback(()=>{o.current&&window.clearTimeout(o.current),o.current=null},[]);return T.useEffect(()=>d,[d]),T.useEffect(()=>{let e=s.current;return()=>{window.clearTimeout(e),c(null)}},[s,c]),(0,E.jsx)(R,{asChild:!0,...u,children:(0,E.jsx)(ke,{id:i.triggerId,"aria-haspopup":`menu`,"aria-expanded":n.open,"aria-controls":i.contentId,"data-state":Ze(n.open),...e,ref:w(t,i.onTriggerChange),onClick:t=>{e.onClick?.(t),!(e.disabled||t.defaultPrevented)&&(t.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:l(e.onPointerMove,Z(t=>{a.onItemEnter(t),!t.defaultPrevented&&!e.disabled&&!n.open&&!o.current&&(a.onPointerGraceIntentChange(null),o.current=window.setTimeout(()=>{n.onOpenChange(!0),d()},100))})),onPointerLeave:l(e.onPointerLeave,Z(e=>{d();let t=n.content?.getBoundingClientRect();if(t){let r=n.content?.dataset.side,i=r===`right`,o=i?-5:5,c=t[i?`left`:`right`],l=t[i?`right`:`left`];a.onPointerGraceIntentChange({area:[{x:e.clientX+o,y:e.clientY},{x:c,y:t.top},{x:l,y:t.top},{x:l,y:t.bottom},{x:c,y:t.bottom}],side:r}),window.clearTimeout(s.current),s.current=window.setTimeout(()=>a.onPointerGraceIntentChange(null),300)}else{if(a.onTriggerLeave(e),e.defaultPrevented)return;a.onPointerGraceIntentChange(null)}})),onKeyDown:l(e.onKeyDown,t=>{let i=a.searchRef.current!==``;e.disabled||i&&t.key===` `||ue[r.dir].includes(t.key)&&(n.onOpenChange(!0),n.content?.focus(),t.preventDefault())})})})});Je.displayName=J;var Ye=`MenuSubContent`,Xe=T.forwardRef((e,t)=>{let n=ve(B,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=I(B,e.__scopeMenu),o=L(B,e.__scopeMenu),s=Ke(Ye,e.__scopeMenu),c=T.useRef(null),d=u(t,c);return(0,E.jsx)(j.Provider,{scope:e.__scopeMenu,children:(0,E.jsx)(f,{present:r||a.open,children:(0,E.jsx)(j.Slot,{scope:e.__scopeMenu,children:(0,E.jsx)(H,{id:s.contentId,"aria-labelledby":s.triggerId,...i,ref:d,align:`start`,side:o.dir===`rtl`?`left`:`right`,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:e=>{o.isUsingKeyboardRef.current&&c.current?.focus(),e.preventDefault()},onCloseAutoFocus:e=>e.preventDefault(),onFocusOutside:l(e.onFocusOutside,e=>{e.target!==s.trigger&&a.onOpenChange(!1)}),onEscapeKeyDown:l(e.onEscapeKeyDown,e=>{o.onClose(),e.preventDefault()}),onKeyDown:l(e.onKeyDown,e=>{let t=e.currentTarget.contains(e.target),n=k[o.dir].includes(e.key);t&&n&&(a.onOpenChange(!1),s.trigger?.focus(),e.preventDefault())})})})})})});Xe.displayName=Ye;function Ze(e){return e?`open`:`closed`}function Y(e){return e===`indeterminate`}function X(e){return Y(e)?`indeterminate`:e?`checked`:`unchecked`}function Qe(e){let t=document.activeElement;for(let n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function $e(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function et(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=$e(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}function tt(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}function nt(e,t){return t?tt({x:e.clientX,y:e.clientY},t):!1}function Z(e){return t=>t.pointerType===`mouse`?e(t):void 0}var rt=he,it=R,at=ye,ot=xe,st=U,ct=De,lt=G,ut=je,dt=Fe,ft=Le,pt=Be,mt=He,ht=We,gt=Je,_t=Xe,Q=`DropdownMenu`,[vt,yt]=_(Q,[N]),$=N(),[bt,xt]=vt(Q),St=e=>{let{__scopeDropdownMenu:t,children:n,dir:r,open:i,defaultOpen:a,onOpenChange:o,modal:s=!0}=e,c=$(t),l=T.useRef(null),[u,d]=ee({prop:i,defaultProp:a??!1,onChange:o,caller:Q});return(0,E.jsx)(bt,{scope:t,triggerId:p(),triggerRef:l,contentId:p(),open:u,onOpenChange:d,onOpenToggle:T.useCallback(()=>d(e=>!e),[d]),modal:s,children:(0,E.jsx)(rt,{...c,open:u,onOpenChange:d,dir:r,modal:s,children:n})})};St.displayName=Q;var Ct=`DropdownMenuTrigger`,wt=T.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,disabled:r=!1,...i}=e,a=xt(Ct,n),o=$(n);return(0,E.jsx)(it,{asChild:!0,...o,children:(0,E.jsx)(v.button,{type:`button`,id:a.triggerId,"aria-haspopup":`menu`,"aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":a.open?`open`:`closed`,"data-disabled":r?``:void 0,disabled:r,...i,ref:w(t,a.triggerRef),onPointerDown:l(e.onPointerDown,e=>{!r&&e.button===0&&e.ctrlKey===!1&&(a.onOpenToggle(),a.open||e.preventDefault())}),onKeyDown:l(e.onKeyDown,e=>{r||([`Enter`,` `].includes(e.key)&&a.onOpenToggle(),e.key===`ArrowDown`&&a.onOpenChange(!0),[`Enter`,` `,`ArrowDown`].includes(e.key)&&e.preventDefault())})})})});wt.displayName=Ct;var Tt=`DropdownMenuPortal`,Et=e=>{let{__scopeDropdownMenu:t,...n}=e,r=$(t);return(0,E.jsx)(at,{...r,...n})};Et.displayName=Tt;var Dt=`DropdownMenuContent`,Ot=T.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=xt(Dt,n),a=$(n),o=T.useRef(!1);return(0,E.jsx)(ot,{id:i.contentId,"aria-labelledby":i.triggerId,...a,...r,ref:t,onCloseAutoFocus:l(e.onCloseAutoFocus,e=>{o.current||i.triggerRef.current?.focus(),o.current=!1,e.preventDefault()}),onInteractOutside:l(e.onInteractOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,r=t.button===2||n;(!i.modal||r)&&(o.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-dropdown-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-dropdown-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-dropdown-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-dropdown-menu-trigger-height":`var(--radix-popper-anchor-height)`}})});Ot.displayName=Dt;var kt=`DropdownMenuGroup`,At=T.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,E.jsx)(st,{...i,...r,ref:t})});At.displayName=kt;var jt=`DropdownMenuLabel`,Mt=T.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,E.jsx)(ct,{...i,...r,ref:t})});Mt.displayName=jt;var Nt=`DropdownMenuItem`,Pt=T.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,E.jsx)(lt,{...i,...r,ref:t})});Pt.displayName=Nt;var Ft=`DropdownMenuCheckboxItem`,It=T.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,E.jsx)(ut,{...i,...r,ref:t})});It.displayName=Ft;var Lt=`DropdownMenuRadioGroup`,Rt=T.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,E.jsx)(dt,{...i,...r,ref:t})});Rt.displayName=Lt;var zt=`DropdownMenuRadioItem`,Bt=T.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,E.jsx)(ft,{...i,...r,ref:t})});Bt.displayName=zt;var Vt=`DropdownMenuItemIndicator`,Ht=T.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,E.jsx)(pt,{...i,...r,ref:t})});Ht.displayName=Vt;var Ut=`DropdownMenuSeparator`,Wt=T.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,E.jsx)(mt,{...i,...r,ref:t})});Wt.displayName=Ut;var Gt=`DropdownMenuArrow`,Kt=T.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,E.jsx)(ht,{...i,...r,ref:t})});Kt.displayName=Gt;var qt=`DropdownMenuSubTrigger`,Jt=T.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,E.jsx)(gt,{...i,...r,ref:t})});Jt.displayName=qt;var Yt=`DropdownMenuSubContent`,Xt=T.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,E.jsx)(_t,{...i,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-dropdown-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-dropdown-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-dropdown-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-dropdown-menu-trigger-height":`var(--radix-popper-anchor-height)`}})});Xt.displayName=Yt;var Zt=St,Qt=wt,$t=Et,en=Ot,tn=Pt;function nn({...e}){return(0,E.jsx)(Zt,{"data-slot":`dropdown-menu`,...e})}function rn({...e}){return(0,E.jsx)(Qt,{"data-slot":`dropdown-menu-trigger`,...e})}function an({className:e,sideOffset:t=4,...n}){return(0,E.jsx)($t,{children:(0,E.jsx)(en,{"data-slot":`dropdown-menu-content`,sideOffset:t,className:h(`data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-y-auto overflow-x-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=closed]:animate-out data-[state=open]:animate-in`,e),...n})})}function on({className:e,inset:t,variant:n=`default`,...r}){return(0,E.jsx)(tn,{"data-slot":`dropdown-menu-item`,"data-inset":t,"data-variant":n,className:h(`relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[inset]:pl-8 data-[variant=destructive]:text-destructive data-[disabled]:opacity-50 data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 data-[variant=destructive]:*:[svg]:text-destructive!`,e),...r})}function sn({className:e,type:t,...n}){return(0,E.jsx)(`input`,{type:t,"data-slot":`input`,className:h(`h-9 w-full min-w-0 rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-xs outline-none transition-[color,box-shadow] selection:bg-primary selection:text-primary-foreground file:inline-flex file:h-7 file:border-0 file:bg-transparent file:font-medium file:text-foreground file:text-sm placeholder:text-muted-foreground disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm dark:bg-input/30`,`focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50`,`aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40`,e),...n})}export{rn as a,on as i,nn as n,se as o,an as r,sn as t};
@@ -1 +1 @@
1
- import{dt as e}from"./index-DdJ7ahIt.js";var t=e();function n({helper:e,label:n,value:r}){return(0,t.jsxs)(`div`,{className:`rounded-2xl border border-[var(--border)] bg-[var(--panel)] p-4 shadow-[var(--panel-shadow)]`,children:[(0,t.jsx)(`p`,{className:`font-semibold text-[10px] text-[var(--muted-foreground)] uppercase tracking-[0.18em]`,children:n}),(0,t.jsx)(`p`,{className:`mt-2 truncate font-semibold text-lg tracking-[-0.03em]`,children:r}),e?(0,t.jsx)(`p`,{className:`mt-1.5 text-[var(--muted-foreground)] text-xs`,children:e}):null]})}export{n as t};
1
+ import{dt as e}from"./index-C_-e0lDI.js";var t=e();function n({helper:e,label:n,value:r}){return(0,t.jsxs)(`div`,{className:`rounded-2xl border border-[var(--border)] bg-[var(--panel)] p-4 shadow-[var(--panel-shadow)]`,children:[(0,t.jsx)(`p`,{className:`font-semibold text-[10px] text-[var(--muted-foreground)] uppercase tracking-[0.18em]`,children:n}),(0,t.jsx)(`p`,{className:`mt-2 truncate font-semibold text-lg tracking-[-0.03em]`,children:r}),e?(0,t.jsx)(`p`,{className:`mt-1.5 text-[var(--muted-foreground)] text-xs`,children:e}):null]})}export{n as t};
@@ -1 +1 @@
1
- import{dt as e}from"./index-DdJ7ahIt.js";var t=e();function n({actions:e,eyebrow:n,subtitle:r,title:i}){return(0,t.jsxs)(`div`,{className:`flex flex-col gap-4 border-[var(--border)] border-b pb-5 sm:flex-row sm:items-end sm:justify-between`,children:[(0,t.jsxs)(`div`,{className:`space-y-2`,children:[n?(0,t.jsx)(`p`,{className:`font-semibold text-[11px] text-[var(--muted-foreground)] uppercase tracking-[0.18em]`,children:n}):null,(0,t.jsxs)(`div`,{children:[(0,t.jsx)(`h2`,{className:`font-semibold text-2xl tracking-[-0.03em] sm:text-[2rem]`,children:i}),r?(0,t.jsx)(`p`,{className:`mt-2 max-w-[60rem] whitespace-pre-wrap break-words text-[var(--muted-foreground)] text-sm`,children:r}):null]})]}),e?(0,t.jsx)(`div`,{className:`flex flex-wrap items-center gap-2`,children:e}):null]})}export{n as t};
1
+ import{dt as e}from"./index-C_-e0lDI.js";var t=e();function n({actions:e,eyebrow:n,subtitle:r,title:i}){return(0,t.jsxs)(`div`,{className:`flex flex-col gap-4 border-[var(--border)] border-b pb-5 sm:flex-row sm:items-end sm:justify-between`,children:[(0,t.jsxs)(`div`,{className:`space-y-2`,children:[n?(0,t.jsx)(`p`,{className:`font-semibold text-[11px] text-[var(--muted-foreground)] uppercase tracking-[0.18em]`,children:n}):null,(0,t.jsxs)(`div`,{children:[(0,t.jsx)(`h2`,{className:`font-semibold text-2xl tracking-[-0.03em] sm:text-[2rem]`,children:i}),r?(0,t.jsx)(`p`,{className:`mt-2 max-w-[60rem] whitespace-pre-wrap break-words text-[var(--muted-foreground)] text-sm`,children:r}):null]})]}),e?(0,t.jsx)(`div`,{className:`flex flex-wrap items-center gap-2`,children:e}):null]})}export{n as t};
@@ -1 +1 @@
1
- import{c as e,n as t,o as n,r,s as i}from"./formatters-C12LmYaa.js";import{f as a,p as o,t as s}from"./delete-confirm-dialog-CcZaRX33.js";import{n as c,t as l}from"./data-table-DnPYMPCD.js";import{a as u,i as d,n as f,r as p,t as m}from"./download-DOwxk-cG.js";import{a as h,i as g,n as _,o as v,r as y,t as b}from"./input-CEsI7EpI.js";import{G as x,d as S,dt as C,f as w,g as T,h as E,lt as D,m as O,mt as k,o as A,p as j,pt as M,t as N}from"./index-DdJ7ahIt.js";import{t as P}from"./page-header-Dr_h1CVv.js";var F=k(M()),I=C(),L=c(),R=[{desc:!0,id:`updatedAt`}],z=(e,o)=>[L.accessor(e=>e.thread.title,{cell:e=>(0,I.jsxs)(D,{className:`block w-[16rem] max-w-[20rem] space-y-1 rounded-md outline-none transition hover:opacity-80 focus-visible:ring-2 focus-visible:ring-[var(--accent)] lg:w-auto`,params:{threadId:e.row.original.thread.id},to:`/threads/$threadId`,children:[(0,I.jsx)(`p`,{className:`truncate font-medium underline-offset-2 hover:underline`,children:e.getValue()}),(0,I.jsx)(`p`,{className:`line-clamp-2 text-[var(--muted-foreground)] text-xs`,children:e.row.original.thread.preview})]}),header:`Thread`,id:`title`}),L.accessor(e=>e.thread.updated_at_ms??e.thread.updated_at*1e3,{cell:e=>(0,I.jsx)(`span`,{className:`whitespace-nowrap text-sm`,suppressHydrationWarning:!0,children:r(e.getValue())}),header:`Updated`,id:`updatedAt`}),L.accessor(e=>e.thread.created_at_ms??e.thread.created_at*1e3,{cell:e=>(0,I.jsx)(`span`,{className:`whitespace-nowrap text-sm`,suppressHydrationWarning:!0,children:r(e.getValue())}),header:`Created`,id:`createdAt`}),L.accessor(e=>e.thread.model??`unknown`,{cell:e=>(0,I.jsx)(`span`,{className:`truncate font-mono text-sm`,children:e.getValue()}),header:`Model`,id:`model`}),L.accessor(e=>e.thread.tokens_used,{cell:e=>(0,I.jsx)(`span`,{className:`whitespace-nowrap font-mono text-sm`,children:i(e.getValue())}),header:`Tokens`,id:`tokens`}),L.accessor(e=>e.rolloutSizeBytes,{cell:e=>(0,I.jsx)(`span`,{className:`whitespace-nowrap font-mono text-sm`,children:t(e.getValue()??0)}),header:`Size`,id:`size`}),L.accessor(e=>e.stats.toolCallCount,{cell:e=>e.row.original.stats.deferred?(0,I.jsx)(`span`,{className:`text-[var(--muted-foreground)] text-sm`,children:`Deferred`}):(0,I.jsx)(`span`,{className:`font-mono text-sm`,children:n(e.getValue())}),header:`Tools`,id:`tools`}),L.accessor(e=>e.thread.archived,{cell:e=>(0,I.jsx)(`span`,{className:`text-sm`,children:e.getValue()?`Archived`:`Active`}),header:`State`,id:`state`}),L.display({cell:t=>(0,I.jsxs)(_,{children:[(0,I.jsx)(h,{asChild:!0,children:(0,I.jsx)(T,{className:`rounded-full`,size:`icon`,type:`button`,variant:`ghost`,onClick:e=>e.stopPropagation(),children:(0,I.jsx)(v,{className:`size-4`})})}),(0,I.jsxs)(y,{align:`end`,children:[(0,I.jsxs)(g,{onClick:()=>o(t.row.original),children:[(0,I.jsx)(u,{className:`mr-2 size-4`}),`Export thread`]}),(0,I.jsxs)(g,{className:`text-[var(--destructive)]`,onClick:()=>e(t.row.original),children:[(0,I.jsx)(a,{className:`mr-2 size-4`}),`Delete thread`]})]})]}),enableSorting:!1,header:``,id:`actions`})];function B({threads:e,onDeleteThread:t,onDeleteThreads:n,onExportThread:r,onExportThreads:i}){return(0,I.jsx)(l,{columns:z(t,r),data:e,emptyMessage:`No threads match the current project filter.`,enableRowSelection:!0,getRowId:e=>e.thread.id,initialSorting:R,renderToolbar:({clearSelection:e,selectedRows:t})=>{if(t.length===0)return(0,I.jsx)(`p`,{className:`text-[var(--muted-foreground)] text-sm`,children:`Select threads to export or delete them in a batch.`});let r=t.map(e=>e.thread.id);return(0,I.jsxs)(`div`,{className:`flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between`,children:[(0,I.jsxs)(`p`,{className:`text-sm`,children:[t.length,` thread`,t.length===1?``:`s`,` selected`]}),(0,I.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,I.jsxs)(T,{className:`rounded-full`,size:`sm`,type:`button`,variant:`outline`,onClick:()=>i(r),children:[(0,I.jsx)(u,{className:`mr-2 size-4`}),`Export selected threads`]}),(0,I.jsxs)(T,{className:`rounded-full border-[var(--destructive)]/20 text-[var(--destructive)]`,size:`sm`,type:`button`,variant:`outline`,onClick:()=>n(r),children:[(0,I.jsx)(a,{className:`mr-2 size-4`}),`Delete selected threads`]}),(0,I.jsxs)(T,{className:`rounded-full`,size:`sm`,type:`button`,variant:`ghost`,onClick:e,children:[(0,I.jsx)(d,{className:`mr-2 size-4`}),`Clear selection`]})]})]})}})}function V(){let t=N.useParams(),n=x(),r=e(A(t.project)).data,{settings:i}=E(),[a,c]=(0,F.useState)(``),[l,u]=(0,F.useState)(null),[d,h]=(0,F.useState)(null),g=(0,F.useDeferredValue)(a.trim().toLowerCase()),_=o({mutationFn:e=>e.threadIds.length===1?S({data:{deleteSessionFiles:e.deleteSessionFiles,threadId:e.threadIds[0]}}):w({data:e}),onSuccess:async()=>{await Promise.all([n.invalidateQueries({queryKey:[`analytics`]}),n.invalidateQueries({queryKey:[`dashboard`]}),n.invalidateQueries({queryKey:[`project-threads`,t.project]}),n.invalidateQueries({queryKey:[`projects`]})]),u(null)}}),v=o({mutationFn:async e=>{if(!d)throw Error(`No thread selected for export`);console.info(`[spiracha:export-ui] request`,{outputFormat:e.outputFormat,project:t.project,selectedThreadCount:d.threadIds.length,selectedThreadIds:d.threadIds});let n=d.threadIds.length===1?await j({data:{...e,...i,threadId:d.threadIds[0]}}):await O({data:{...e,...i,threadIds:d.threadIds}});if(console.info(`[spiracha:export-ui] response`,{downloadUrl:n.mode===`download_url`?n.downloadUrl:null,fileName:n.fileName,mode:n.mode,project:t.project,selectedThreadCount:d.threadIds.length}),n.mode===`download`){m(n.fileName,n.content,n.mimeType);return}await f(n.fileName,n.downloadUrl)},onError:e=>{console.error(`[spiracha:export-ui] failed`,{error:e instanceof Error?e.message:String(e),project:t.project,selectedThreadCount:d?.threadIds.length??0,selectedThreadIds:d?.threadIds??[]})},onSuccess:()=>{h(null)}}),y=[...r].filter(e=>g?`${e.thread.title}\n${e.thread.preview}`.toLowerCase().includes(g):!0),C=e=>{let t=new Set(e);return y.filter(e=>t.has(e.thread.id))};return(0,I.jsxs)(`div`,{className:`space-y-6`,children:[(0,I.jsx)(P,{actions:(0,I.jsx)(`div`,{className:`flex flex-col gap-2 sm:flex-row`,children:(0,I.jsx)(b,{className:`h-10 w-full rounded-full border-[var(--border)] bg-[var(--panel)] px-4 sm:w-[20rem]`,placeholder:`Search thread title or preview`,value:a,onChange:e=>{(0,F.startTransition)(()=>{c(e.target.value)})}})}),eyebrow:`Project`,subtitle:`Sort by any column, inspect tool call volume, and manage thread records for this derived project.`,title:t.project}),(0,I.jsx)(B,{threads:y,onDeleteThread:e=>u({threads:[e]}),onDeleteThreads:e=>{let t=C(e);t.length!==0&&u({threads:t})},onExportThread:e=>h({threadIds:[e.thread.id],threadLabel:e.thread.title}),onExportThreads:e=>{let t=C(e);t.length!==0&&h({threadIds:t.map(e=>e.thread.id),threadLabel:t.length===1?t[0].thread.title:`${t.length} selected threads`})}}),(0,I.jsx)(s,{confirmLabel:_.isPending?`Deleting...`:`Delete thread`,description:l?l.threads.length===1?`Delete the thread "${l.threads[0].thread.title}" from the Codex database. Leave Session files unchecked if you only want to remove the current DB row.`:`Delete ${l.threads.length} selected threads from the Codex database. Enable Delete Session files if you also want to remove their rollout JSONL files.`:``,open:l!==null,showDeleteSessionFilesOption:!0,title:`Delete thread from Codex DB?`,onConfirm:({deleteSessionFiles:e})=>{l&&_.mutate({deleteSessionFiles:e,threadIds:l.threads.map(e=>e.thread.id)})},onOpenChange:e=>{e||u(null)}}),(0,I.jsx)(p,{open:d!==null,pending:v.isPending,title:d?`Export ${d.threadLabel}`:`Export thread`,onExport:e=>v.mutate(e),onOpenChange:e=>{e||h(null)}})]})}export{V as component};
1
+ import{c as e,n as t,o as n,r,s as i}from"./formatters-CWFrMKSn.js";import{f as a,p as o,t as s}from"./delete-confirm-dialog-CIZy_LXD.js";import{n as c,t as l}from"./data-table-Bgnh7phF.js";import{a as u,i as d,n as f,r as p,t as m}from"./download-DQtfva4z.js";import{a as h,i as g,n as _,o as v,r as y,t as b}from"./input-BbgApiqZ.js";import{G as x,d as S,dt as C,f as w,g as T,h as E,lt as D,m as O,mt as k,o as A,p as j,pt as M,t as N}from"./index-C_-e0lDI.js";import{t as P}from"./page-header-ODLuGLAB.js";var F=k(M()),I=C(),L=c(),R=[{desc:!0,id:`updatedAt`}],z=(e,o)=>[L.accessor(e=>e.thread.title,{cell:e=>(0,I.jsxs)(D,{className:`block w-[16rem] max-w-[20rem] space-y-1 rounded-md outline-none transition hover:opacity-80 focus-visible:ring-2 focus-visible:ring-[var(--accent)] lg:w-auto`,params:{threadId:e.row.original.thread.id},to:`/threads/$threadId`,children:[(0,I.jsx)(`p`,{className:`truncate font-medium underline-offset-2 hover:underline`,children:e.getValue()}),(0,I.jsx)(`p`,{className:`line-clamp-2 text-[var(--muted-foreground)] text-xs`,children:e.row.original.thread.preview})]}),header:`Thread`,id:`title`}),L.accessor(e=>e.thread.updated_at_ms??e.thread.updated_at*1e3,{cell:e=>(0,I.jsx)(`span`,{className:`whitespace-nowrap text-sm`,suppressHydrationWarning:!0,children:r(e.getValue())}),header:`Updated`,id:`updatedAt`}),L.accessor(e=>e.thread.created_at_ms??e.thread.created_at*1e3,{cell:e=>(0,I.jsx)(`span`,{className:`whitespace-nowrap text-sm`,suppressHydrationWarning:!0,children:r(e.getValue())}),header:`Created`,id:`createdAt`}),L.accessor(e=>e.thread.model??`unknown`,{cell:e=>(0,I.jsx)(`span`,{className:`truncate font-mono text-sm`,children:e.getValue()}),header:`Model`,id:`model`}),L.accessor(e=>e.thread.tokens_used,{cell:e=>(0,I.jsx)(`span`,{className:`whitespace-nowrap font-mono text-sm`,children:i(e.getValue())}),header:`Tokens`,id:`tokens`}),L.accessor(e=>e.rolloutSizeBytes,{cell:e=>(0,I.jsx)(`span`,{className:`whitespace-nowrap font-mono text-sm`,children:t(e.getValue()??0)}),header:`Size`,id:`size`}),L.accessor(e=>e.stats.toolCallCount,{cell:e=>e.row.original.stats.deferred?(0,I.jsx)(`span`,{className:`text-[var(--muted-foreground)] text-sm`,children:`Deferred`}):(0,I.jsx)(`span`,{className:`font-mono text-sm`,children:n(e.getValue())}),header:`Tools`,id:`tools`}),L.accessor(e=>e.thread.archived,{cell:e=>(0,I.jsx)(`span`,{className:`text-sm`,children:e.getValue()?`Archived`:`Active`}),header:`State`,id:`state`}),L.display({cell:t=>(0,I.jsxs)(_,{children:[(0,I.jsx)(h,{asChild:!0,children:(0,I.jsx)(T,{className:`rounded-full`,size:`icon`,type:`button`,variant:`ghost`,onClick:e=>e.stopPropagation(),children:(0,I.jsx)(v,{className:`size-4`})})}),(0,I.jsxs)(y,{align:`end`,children:[(0,I.jsxs)(g,{onClick:()=>o(t.row.original),children:[(0,I.jsx)(u,{className:`mr-2 size-4`}),`Export thread`]}),(0,I.jsxs)(g,{className:`text-[var(--destructive)]`,onClick:()=>e(t.row.original),children:[(0,I.jsx)(a,{className:`mr-2 size-4`}),`Delete thread`]})]})]}),enableSorting:!1,header:``,id:`actions`})];function B({threads:e,onDeleteThread:t,onDeleteThreads:n,onExportThread:r,onExportThreads:i}){return(0,I.jsx)(l,{columns:z(t,r),data:e,emptyMessage:`No threads match the current project filter.`,enableRowSelection:!0,getRowId:e=>e.thread.id,initialSorting:R,renderToolbar:({clearSelection:e,selectedRows:t})=>{if(t.length===0)return(0,I.jsx)(`p`,{className:`text-[var(--muted-foreground)] text-sm`,children:`Select threads to export or delete them in a batch.`});let r=t.map(e=>e.thread.id);return(0,I.jsxs)(`div`,{className:`flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between`,children:[(0,I.jsxs)(`p`,{className:`text-sm`,children:[t.length,` thread`,t.length===1?``:`s`,` selected`]}),(0,I.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,I.jsxs)(T,{className:`rounded-full`,size:`sm`,type:`button`,variant:`outline`,onClick:()=>i(r),children:[(0,I.jsx)(u,{className:`mr-2 size-4`}),`Export selected threads`]}),(0,I.jsxs)(T,{className:`rounded-full border-[var(--destructive)]/20 text-[var(--destructive)]`,size:`sm`,type:`button`,variant:`outline`,onClick:()=>n(r),children:[(0,I.jsx)(a,{className:`mr-2 size-4`}),`Delete selected threads`]}),(0,I.jsxs)(T,{className:`rounded-full`,size:`sm`,type:`button`,variant:`ghost`,onClick:e,children:[(0,I.jsx)(d,{className:`mr-2 size-4`}),`Clear selection`]})]})]})}})}function V(){let t=N.useParams(),n=x(),r=e(A(t.project)).data,{settings:i}=E(),[a,c]=(0,F.useState)(``),[l,u]=(0,F.useState)(null),[d,h]=(0,F.useState)(null),g=(0,F.useDeferredValue)(a.trim().toLowerCase()),_=o({mutationFn:e=>e.threadIds.length===1?S({data:{deleteSessionFiles:e.deleteSessionFiles,threadId:e.threadIds[0]}}):w({data:e}),onSuccess:async()=>{await Promise.all([n.invalidateQueries({queryKey:[`analytics`]}),n.invalidateQueries({queryKey:[`dashboard`]}),n.invalidateQueries({queryKey:[`project-threads`,t.project]}),n.invalidateQueries({queryKey:[`projects`]})]),u(null)}}),v=o({mutationFn:async e=>{if(!d)throw Error(`No thread selected for export`);console.info(`[spiracha:export-ui] request`,{outputFormat:e.outputFormat,project:t.project,selectedThreadCount:d.threadIds.length,selectedThreadIds:d.threadIds});let n=d.threadIds.length===1?await j({data:{...e,...i,threadId:d.threadIds[0]}}):await O({data:{...e,...i,threadIds:d.threadIds}});if(console.info(`[spiracha:export-ui] response`,{downloadUrl:n.mode===`download_url`?n.downloadUrl:null,fileName:n.fileName,mode:n.mode,project:t.project,selectedThreadCount:d.threadIds.length}),n.mode===`download`){m(n.fileName,n.content,n.mimeType);return}await f(n.fileName,n.downloadUrl)},onError:e=>{console.error(`[spiracha:export-ui] failed`,{error:e instanceof Error?e.message:String(e),project:t.project,selectedThreadCount:d?.threadIds.length??0,selectedThreadIds:d?.threadIds??[]})},onSuccess:()=>{h(null)}}),y=[...r].filter(e=>g?`${e.thread.title}\n${e.thread.preview}`.toLowerCase().includes(g):!0),C=e=>{let t=new Set(e);return y.filter(e=>t.has(e.thread.id))};return(0,I.jsxs)(`div`,{className:`space-y-6`,children:[(0,I.jsx)(P,{actions:(0,I.jsx)(`div`,{className:`flex flex-col gap-2 sm:flex-row`,children:(0,I.jsx)(b,{className:`h-10 w-full rounded-full border-[var(--border)] bg-[var(--panel)] px-4 sm:w-[20rem]`,placeholder:`Search thread title or preview`,value:a,onChange:e=>{(0,F.startTransition)(()=>{c(e.target.value)})}})}),eyebrow:`Project`,subtitle:`Sort by any column, inspect tool call volume, and manage thread records for this derived project.`,title:t.project}),(0,I.jsx)(B,{threads:y,onDeleteThread:e=>u({threads:[e]}),onDeleteThreads:e=>{let t=C(e);t.length!==0&&u({threads:t})},onExportThread:e=>h({threadIds:[e.thread.id],threadLabel:e.thread.title}),onExportThreads:e=>{let t=C(e);t.length!==0&&h({threadIds:t.map(e=>e.thread.id),threadLabel:t.length===1?t[0].thread.title:`${t.length} selected threads`})}}),(0,I.jsx)(s,{confirmLabel:_.isPending?`Deleting...`:`Delete thread`,description:l?l.threads.length===1?`Delete the thread "${l.threads[0].thread.title}" from the Codex database. Leave Session files unchecked if you only want to remove the current DB row.`:`Delete ${l.threads.length} selected threads from the Codex database. Enable Delete Session files if you also want to remove their rollout JSONL files.`:``,open:l!==null,showDeleteSessionFilesOption:!0,title:`Delete thread from Codex DB?`,onConfirm:({deleteSessionFiles:e})=>{l&&_.mutate({deleteSessionFiles:e,threadIds:l.threads.map(e=>e.thread.id)})},onOpenChange:e=>{e||u(null)}}),(0,I.jsx)(p,{open:d!==null,pending:v.isPending,title:d?`Export ${d.threadLabel}`:`Export thread`,onExport:e=>v.mutate(e),onOpenChange:e=>{e||h(null)}})]})}export{V as component};
@@ -1 +1 @@
1
- import{dt as e}from"./index-DdJ7ahIt.js";var t=e();function n({error:e}){let n=e.message.includes(`unable to open database`)||e.message.includes(`database is locked`);return(0,t.jsxs)(`div`,{className:`rounded-xl border border-[var(--border)] bg-[var(--panel)] px-6 py-10 text-center`,children:[(0,t.jsx)(`p`,{className:`font-medium text-[var(--destructive)] text-sm`,children:n?`Database unavailable`:`Failed to load project`}),(0,t.jsx)(`p`,{className:`mt-2 text-[var(--muted-foreground)] text-sm`,children:n?`Codex may have an exclusive lock on the database. Reload to retry.`:e.message}),(0,t.jsx)(`button`,{className:`mt-4 text-[var(--accent)] text-sm underline-offset-2 hover:underline`,type:`button`,onClick:()=>window.location.reload(),children:`Reload`})]})}export{n as errorComponent};
1
+ import{dt as e}from"./index-C_-e0lDI.js";var t=e();function n({error:e}){let n=e.message.includes(`unable to open database`)||e.message.includes(`database is locked`);return(0,t.jsxs)(`div`,{className:`rounded-xl border border-[var(--border)] bg-[var(--panel)] px-6 py-10 text-center`,children:[(0,t.jsx)(`p`,{className:`font-medium text-[var(--destructive)] text-sm`,children:n?`Database unavailable`:`Failed to load project`}),(0,t.jsx)(`p`,{className:`mt-2 text-[var(--muted-foreground)] text-sm`,children:n?`Codex may have an exclusive lock on the database. Reload to retry.`:e.message}),(0,t.jsx)(`button`,{className:`mt-4 text-[var(--accent)] text-sm underline-offset-2 hover:underline`,type:`button`,onClick:()=>window.location.reload(),children:`Reload`})]})}export{n as errorComponent};
@@ -1 +1 @@
1
- import{c as e,i as t,o as n,r,s as i}from"./formatters-C12LmYaa.js";import{f as a,p as o,t as s}from"./delete-confirm-dialog-CcZaRX33.js";import{n as c,t as l}from"./data-table-DnPYMPCD.js";import{a as u,i as d,n as f,o as p,r as m,t as h}from"./input-CEsI7EpI.js";import{G as g,dt as _,g as v,mt as y,pt as b,s as x,u as S,ut as C}from"./index-DdJ7ahIt.js";import{t as w}from"./page-header-Dr_h1CVv.js";var T=y(b()),E=_(),D=c(),O=e=>[D.accessor(`name`,{cell:e=>(0,E.jsxs)(`div`,{className:`space-y-1`,children:[(0,E.jsx)(`p`,{className:`font-medium`,children:e.getValue()}),(0,E.jsxs)(`p`,{className:`text-[var(--muted-foreground)] text-xs`,children:[n(e.row.original.cwdPaths.length),` cwd path`,e.row.original.cwdPaths.length===1?``:`s`]})]}),header:`Project`}),D.accessor(`threadCount`,{cell:e=>(0,E.jsx)(`span`,{className:`font-mono text-sm`,children:n(e.getValue())}),header:`Threads`}),D.accessor(`totalTokens`,{cell:e=>(0,E.jsx)(`span`,{className:`font-mono text-sm`,children:i(e.getValue())}),header:`Tokens`}),D.accessor(`lastUpdatedAtMs`,{cell:e=>(0,E.jsx)(`span`,{className:`text-sm`,suppressHydrationWarning:!0,children:r(e.getValue())}),header:`Last updated`}),D.display({cell:e=>(0,E.jsx)(`span`,{className:`text-[var(--muted-foreground)] text-sm`,children:t(e.row.original.modelNames)}),header:`Models`,id:`models`}),D.accessor(`archivedThreadCount`,{cell:e=>(0,E.jsx)(`span`,{className:`text-sm`,children:n(e.getValue())}),header:`Archived`}),D.display({cell:t=>(0,E.jsxs)(f,{children:[(0,E.jsx)(u,{asChild:!0,children:(0,E.jsx)(v,{className:`rounded-full`,size:`icon`,type:`button`,variant:`ghost`,onClick:e=>e.stopPropagation(),children:(0,E.jsx)(p,{className:`size-4`})})}),(0,E.jsx)(m,{align:`end`,children:(0,E.jsxs)(d,{className:`text-[var(--destructive)]`,onClick:()=>e(t.row.original),children:[(0,E.jsx)(a,{className:`mr-2 size-4`}),`Delete project`]})})]}),header:``,id:`actions`})];function k({projects:e,onDeleteProject:t}){let n=C();return(0,E.jsx)(l,{columns:O(t),data:e,emptyMessage:`No projects match the current search.`,onRowClick:e=>n({params:{project:e.name},to:`/projects/$project`})})}function A(){let t=g(),n=e(x()).data,[r,i]=(0,T.useState)(``),[a,c]=(0,T.useState)(null),l=(0,T.useDeferredValue)(r.trim().toLowerCase()),u=o({mutationFn:e=>S({data:e}),onSuccess:async()=>{await Promise.all([t.invalidateQueries({queryKey:[`analytics`]}),t.invalidateQueries({queryKey:[`dashboard`]}),t.invalidateQueries({queryKey:[`projects`]})]),c(null)}}),d=n.filter(e=>l?e.name.toLowerCase().includes(l):!0);return(0,E.jsxs)(`div`,{className:`space-y-6`,children:[(0,E.jsx)(w,{actions:(0,E.jsx)(h,{className:`h-10 w-full rounded-full border-[var(--border)] bg-[var(--panel)] px-4 sm:w-[20rem]`,placeholder:`Search projects by name`,value:r,onChange:e=>{(0,T.startTransition)(()=>{i(e.target.value)})}}),eyebrow:`Inventory`,subtitle:`Derived projects are grouped from the final basename of each thread cwd, matching the existing CLI behavior.`,title:`Projects`}),(0,E.jsx)(k,{projects:d,onDeleteProject:c}),(0,E.jsx)(s,{confirmLabel:u.isPending?`Deleting...`:`Delete project`,description:a?`Delete ${a.threadCount} thread records for the derived project "${a.name}" from the Codex database. Enable Delete Session files to remove the rollout JSONL files too.`:``,open:a!==null,showDeleteSessionFilesOption:!0,title:`Delete project from Codex DB?`,onConfirm:({deleteSessionFiles:e})=>{a&&u.mutate({deleteSessionFiles:e,project:a.name})},onOpenChange:e=>{e||c(null)}})]})}export{A as component};
1
+ import{c as e,i as t,o as n,r,s as i}from"./formatters-CWFrMKSn.js";import{f as a,p as o,t as s}from"./delete-confirm-dialog-CIZy_LXD.js";import{n as c,t as l}from"./data-table-Bgnh7phF.js";import{a as u,i as d,n as f,o as p,r as m,t as h}from"./input-BbgApiqZ.js";import{G as g,dt as _,g as v,mt as y,pt as b,s as x,u as S,ut as C}from"./index-C_-e0lDI.js";import{t as w}from"./page-header-ODLuGLAB.js";var T=y(b()),E=_(),D=c(),O=e=>[D.accessor(`name`,{cell:e=>(0,E.jsxs)(`div`,{className:`space-y-1`,children:[(0,E.jsx)(`p`,{className:`font-medium`,children:e.getValue()}),(0,E.jsxs)(`p`,{className:`text-[var(--muted-foreground)] text-xs`,children:[n(e.row.original.cwdPaths.length),` cwd path`,e.row.original.cwdPaths.length===1?``:`s`]})]}),header:`Project`}),D.accessor(`threadCount`,{cell:e=>(0,E.jsx)(`span`,{className:`font-mono text-sm`,children:n(e.getValue())}),header:`Threads`}),D.accessor(`totalTokens`,{cell:e=>(0,E.jsx)(`span`,{className:`font-mono text-sm`,children:i(e.getValue())}),header:`Tokens`}),D.accessor(`lastUpdatedAtMs`,{cell:e=>(0,E.jsx)(`span`,{className:`text-sm`,suppressHydrationWarning:!0,children:r(e.getValue())}),header:`Last updated`}),D.display({cell:e=>(0,E.jsx)(`span`,{className:`text-[var(--muted-foreground)] text-sm`,children:t(e.row.original.modelNames)}),header:`Models`,id:`models`}),D.accessor(`archivedThreadCount`,{cell:e=>(0,E.jsx)(`span`,{className:`text-sm`,children:n(e.getValue())}),header:`Archived`}),D.display({cell:t=>(0,E.jsxs)(f,{children:[(0,E.jsx)(u,{asChild:!0,children:(0,E.jsx)(v,{className:`rounded-full`,size:`icon`,type:`button`,variant:`ghost`,onClick:e=>e.stopPropagation(),children:(0,E.jsx)(p,{className:`size-4`})})}),(0,E.jsx)(m,{align:`end`,children:(0,E.jsxs)(d,{className:`text-[var(--destructive)]`,onClick:()=>e(t.row.original),children:[(0,E.jsx)(a,{className:`mr-2 size-4`}),`Delete project`]})})]}),header:``,id:`actions`})];function k({projects:e,onDeleteProject:t}){let n=C();return(0,E.jsx)(l,{columns:O(t),data:e,emptyMessage:`No projects match the current search.`,onRowClick:e=>n({params:{project:e.name},to:`/projects/$project`})})}function A(){let t=g(),n=e(x()).data,[r,i]=(0,T.useState)(``),[a,c]=(0,T.useState)(null),l=(0,T.useDeferredValue)(r.trim().toLowerCase()),u=o({mutationFn:e=>S({data:e}),onSuccess:async()=>{await Promise.all([t.invalidateQueries({queryKey:[`analytics`]}),t.invalidateQueries({queryKey:[`dashboard`]}),t.invalidateQueries({queryKey:[`projects`]})]),c(null)}}),d=n.filter(e=>l?e.name.toLowerCase().includes(l):!0);return(0,E.jsxs)(`div`,{className:`space-y-6`,children:[(0,E.jsx)(w,{actions:(0,E.jsx)(h,{className:`h-10 w-full rounded-full border-[var(--border)] bg-[var(--panel)] px-4 sm:w-[20rem]`,placeholder:`Search projects by name`,value:r,onChange:e=>{(0,T.startTransition)(()=>{i(e.target.value)})}}),eyebrow:`Inventory`,subtitle:`Derived projects are grouped from the final basename of each thread cwd, matching the existing CLI behavior.`,title:`Projects`}),(0,E.jsx)(k,{projects:d,onDeleteProject:c}),(0,E.jsx)(s,{confirmLabel:u.isPending?`Deleting...`:`Delete project`,description:a?`Delete ${a.threadCount} thread records for the derived project "${a.name}" from the Codex database. Enable Delete Session files to remove the rollout JSONL files too.`:``,open:a!==null,showDeleteSessionFilesOption:!0,title:`Delete project from Codex DB?`,onConfirm:({deleteSessionFiles:e})=>{a&&u.mutate({deleteSessionFiles:e,project:a.name})},onOpenChange:e=>{e||c(null)}})]})}export{A as component};
@@ -1 +1 @@
1
- import{dt as e}from"./index-DdJ7ahIt.js";var t=e();function n({error:e}){let n=e.message.includes(`unable to open database`)||e.message.includes(`database is locked`);return(0,t.jsxs)(`div`,{className:`rounded-xl border border-[var(--border)] bg-[var(--panel)] px-6 py-10 text-center`,children:[(0,t.jsx)(`p`,{className:`font-medium text-[var(--destructive)] text-sm`,children:n?`Database unavailable`:`Failed to load projects`}),(0,t.jsx)(`p`,{className:`mt-2 text-[var(--muted-foreground)] text-sm`,children:n?`Codex may have an exclusive lock on the database. Reload to retry.`:e.message}),(0,t.jsx)(`button`,{className:`mt-4 text-[var(--accent)] text-sm underline-offset-2 hover:underline`,type:`button`,onClick:()=>window.location.reload(),children:`Reload`})]})}export{n as errorComponent};
1
+ import{dt as e}from"./index-C_-e0lDI.js";var t=e();function n({error:e}){let n=e.message.includes(`unable to open database`)||e.message.includes(`database is locked`);return(0,t.jsxs)(`div`,{className:`rounded-xl border border-[var(--border)] bg-[var(--panel)] px-6 py-10 text-center`,children:[(0,t.jsx)(`p`,{className:`font-medium text-[var(--destructive)] text-sm`,children:n?`Database unavailable`:`Failed to load projects`}),(0,t.jsx)(`p`,{className:`mt-2 text-[var(--muted-foreground)] text-sm`,children:n?`Codex may have an exclusive lock on the database. Reload to retry.`:e.message}),(0,t.jsx)(`button`,{className:`mt-4 text-[var(--accent)] text-sm underline-offset-2 hover:underline`,type:`button`,onClick:()=>window.location.reload(),children:`Reload`})]})}export{n as errorComponent};
@@ -1 +1 @@
1
- import{c as e,o as t,r as n,s as r}from"./formatters-C12LmYaa.js";import{a as i,dt as a,lt as o,r as s}from"./index-DdJ7ahIt.js";import{t as c}from"./metric-card-9jwBF7rG.js";import{t as l}from"./page-header-Dr_h1CVv.js";var u=a();function d({error:e}){let t=e.message.includes(`unable to open database`)||e.message.includes(`database is locked`);return(0,u.jsxs)(`div`,{className:`rounded-xl border border-[var(--border)] bg-[var(--panel)] px-6 py-10 text-center`,children:[(0,u.jsx)(`p`,{className:`font-medium text-[var(--destructive)] text-sm`,children:t?`Database unavailable`:`Failed to load dashboard`}),(0,u.jsx)(`p`,{className:`mt-2 text-[var(--muted-foreground)] text-sm`,children:t?`Codex may have an exclusive lock on the database. Reload to retry.`:e.message}),(0,u.jsx)(`button`,{className:`mt-4 text-[var(--accent)] text-sm underline-offset-2 hover:underline`,type:`button`,onClick:()=>window.location.reload(),children:`Reload`})]})}s.update({errorComponent:d});function f(){let a=e(i()).data;return(0,u.jsxs)(`div`,{className:`space-y-6`,children:[(0,u.jsx)(l,{eyebrow:`Overview`,subtitle:`A compact readout of local Codex activity, project distribution, and recent thread movement.`,title:`Dashboard`}),(0,u.jsxs)(`div`,{className:`grid gap-3 md:grid-cols-2 xl:grid-cols-4`,children:[(0,u.jsx)(c,{label:`Threads`,value:t(a.totalThreads)}),(0,u.jsx)(c,{label:`Projects`,value:t(a.totalProjects)}),(0,u.jsx)(c,{label:`Tokens`,value:r(a.totalTokens)}),(0,u.jsx)(c,{helper:`${t(a.archivedThreads)} archived`,label:`Active`,value:t(a.activeThreads)})]}),(0,u.jsxs)(`div`,{className:`grid min-w-0 gap-4 xl:grid-cols-[1.4fr_1fr]`,children:[(0,u.jsxs)(`section`,{className:`min-w-0 overflow-hidden rounded-[1.8rem] border border-[var(--border)] bg-[var(--panel)] p-5 shadow-[var(--panel-shadow)]`,children:[(0,u.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,u.jsxs)(`div`,{className:`min-w-0`,children:[(0,u.jsx)(`p`,{className:`font-semibold text-sm`,children:`Recent threads`}),(0,u.jsx)(`p`,{className:`mt-0.5 text-[var(--muted-foreground)] text-xs`,children:`Most recently updated threads across the local Codex database.`})]}),(0,u.jsx)(o,{className:`shrink-0 font-medium text-[var(--accent)] text-sm`,to:`/projects`,children:`View projects`})]}),(0,u.jsx)(`div`,{className:`mt-4 space-y-2`,children:a.recentThreads.map(e=>(0,u.jsxs)(o,{className:`block overflow-hidden rounded-xl border border-[var(--border)] bg-[var(--panel-secondary)] p-3.5 transition-colors hover:border-[var(--accent)]/30 hover:bg-[var(--accent-muted)]`,params:{threadId:e.id},to:`/threads/$threadId`,children:[(0,u.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-start justify-between gap-2`,children:[(0,u.jsxs)(`div`,{className:`min-w-0 shrink`,children:[(0,u.jsx)(`p`,{className:`truncate font-medium text-sm`,children:e.title}),(0,u.jsx)(`p`,{className:`mt-0.5 line-clamp-1 text-[var(--muted-foreground)] text-xs`,children:e.preview})]}),(0,u.jsx)(`p`,{className:`shrink-0 whitespace-nowrap font-mono text-[var(--muted-foreground)] text-xs`,suppressHydrationWarning:!0,children:n(e.updated_at_ms??e.updated_at*1e3)})]}),(0,u.jsxs)(`div`,{className:`mt-2 flex flex-wrap gap-3 text-[var(--muted-foreground)] text-xs`,children:[(0,u.jsx)(`span`,{className:`font-mono`,children:e.model??`unknown model`}),(0,u.jsx)(`span`,{children:r(e.tokens_used)}),(0,u.jsx)(`span`,{children:e.thread_source??`n/a`})]})]},e.id))})]}),(0,u.jsxs)(`div`,{className:`grid min-w-0 gap-4`,children:[(0,u.jsxs)(`section`,{className:`min-w-0 overflow-hidden rounded-[1.8rem] border border-[var(--border)] bg-[var(--panel)] p-5 shadow-[var(--panel-shadow)]`,children:[(0,u.jsx)(`p`,{className:`font-semibold text-sm`,children:`Top projects by thread count`}),(0,u.jsx)(`div`,{className:`mt-3 space-y-2`,children:a.topProjectsByThreadCount.map(e=>(0,u.jsxs)(o,{className:`flex items-center justify-between gap-3 rounded-lg border border-[var(--border)] bg-[var(--panel-secondary)] px-3.5 py-2.5 text-sm`,params:{project:e.name},to:`/projects/$project`,children:[(0,u.jsx)(`span`,{className:`truncate`,children:e.name}),(0,u.jsx)(`span`,{className:`shrink-0 font-mono text-[var(--muted-foreground)]`,children:t(e.threadCount)})]},e.name))})]}),(0,u.jsxs)(`section`,{className:`min-w-0 overflow-hidden rounded-[1.8rem] border border-[var(--border)] bg-[var(--panel)] p-5 shadow-[var(--panel-shadow)]`,children:[(0,u.jsx)(`p`,{className:`font-semibold text-sm`,children:`Top projects by tokens`}),(0,u.jsx)(`div`,{className:`mt-3 space-y-2`,children:a.topProjectsByTokens.map(e=>(0,u.jsxs)(o,{className:`flex items-center justify-between gap-3 rounded-lg border border-[var(--border)] bg-[var(--panel-secondary)] px-3.5 py-2.5 text-sm`,params:{project:e.name},to:`/projects/$project`,children:[(0,u.jsx)(`span`,{className:`truncate`,children:e.name}),(0,u.jsx)(`span`,{className:`shrink-0 font-mono text-[var(--muted-foreground)]`,children:r(e.totalTokens)})]},e.name))})]})]})]})]})}export{f as component};
1
+ import{c as e,o as t,r as n,s as r}from"./formatters-CWFrMKSn.js";import{a as i,dt as a,lt as o,r as s}from"./index-C_-e0lDI.js";import{t as c}from"./metric-card-BJX5rkHK.js";import{t as l}from"./page-header-ODLuGLAB.js";var u=a();function d({error:e}){let t=e.message.includes(`unable to open database`)||e.message.includes(`database is locked`);return(0,u.jsxs)(`div`,{className:`rounded-xl border border-[var(--border)] bg-[var(--panel)] px-6 py-10 text-center`,children:[(0,u.jsx)(`p`,{className:`font-medium text-[var(--destructive)] text-sm`,children:t?`Database unavailable`:`Failed to load dashboard`}),(0,u.jsx)(`p`,{className:`mt-2 text-[var(--muted-foreground)] text-sm`,children:t?`Codex may have an exclusive lock on the database. Reload to retry.`:e.message}),(0,u.jsx)(`button`,{className:`mt-4 text-[var(--accent)] text-sm underline-offset-2 hover:underline`,type:`button`,onClick:()=>window.location.reload(),children:`Reload`})]})}s.update({errorComponent:d});function f(){let a=e(i()).data;return(0,u.jsxs)(`div`,{className:`space-y-6`,children:[(0,u.jsx)(l,{eyebrow:`Overview`,subtitle:`A compact readout of local Codex activity, project distribution, and recent thread movement.`,title:`Dashboard`}),(0,u.jsxs)(`div`,{className:`grid gap-3 md:grid-cols-2 xl:grid-cols-4`,children:[(0,u.jsx)(c,{label:`Threads`,value:t(a.totalThreads)}),(0,u.jsx)(c,{label:`Projects`,value:t(a.totalProjects)}),(0,u.jsx)(c,{label:`Tokens`,value:r(a.totalTokens)}),(0,u.jsx)(c,{helper:`${t(a.archivedThreads)} archived`,label:`Active`,value:t(a.activeThreads)})]}),(0,u.jsxs)(`div`,{className:`grid min-w-0 gap-4 xl:grid-cols-[1.4fr_1fr]`,children:[(0,u.jsxs)(`section`,{className:`min-w-0 overflow-hidden rounded-[1.8rem] border border-[var(--border)] bg-[var(--panel)] p-5 shadow-[var(--panel-shadow)]`,children:[(0,u.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,u.jsxs)(`div`,{className:`min-w-0`,children:[(0,u.jsx)(`p`,{className:`font-semibold text-sm`,children:`Recent threads`}),(0,u.jsx)(`p`,{className:`mt-0.5 text-[var(--muted-foreground)] text-xs`,children:`Most recently updated threads across the local Codex database.`})]}),(0,u.jsx)(o,{className:`shrink-0 font-medium text-[var(--accent)] text-sm`,to:`/projects`,children:`View projects`})]}),(0,u.jsx)(`div`,{className:`mt-4 space-y-2`,children:a.recentThreads.map(e=>(0,u.jsxs)(o,{className:`block overflow-hidden rounded-xl border border-[var(--border)] bg-[var(--panel-secondary)] p-3.5 transition-colors hover:border-[var(--accent)]/30 hover:bg-[var(--accent-muted)]`,params:{threadId:e.id},to:`/threads/$threadId`,children:[(0,u.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-start justify-between gap-2`,children:[(0,u.jsxs)(`div`,{className:`min-w-0 shrink`,children:[(0,u.jsx)(`p`,{className:`truncate font-medium text-sm`,children:e.title}),(0,u.jsx)(`p`,{className:`mt-0.5 line-clamp-1 text-[var(--muted-foreground)] text-xs`,children:e.preview})]}),(0,u.jsx)(`p`,{className:`shrink-0 whitespace-nowrap font-mono text-[var(--muted-foreground)] text-xs`,suppressHydrationWarning:!0,children:n(e.updated_at_ms??e.updated_at*1e3)})]}),(0,u.jsxs)(`div`,{className:`mt-2 flex flex-wrap gap-3 text-[var(--muted-foreground)] text-xs`,children:[(0,u.jsx)(`span`,{className:`font-mono`,children:e.model??`unknown model`}),(0,u.jsx)(`span`,{children:r(e.tokens_used)}),(0,u.jsx)(`span`,{children:e.thread_source??`n/a`})]})]},e.id))})]}),(0,u.jsxs)(`div`,{className:`grid min-w-0 gap-4`,children:[(0,u.jsxs)(`section`,{className:`min-w-0 overflow-hidden rounded-[1.8rem] border border-[var(--border)] bg-[var(--panel)] p-5 shadow-[var(--panel-shadow)]`,children:[(0,u.jsx)(`p`,{className:`font-semibold text-sm`,children:`Top projects by thread count`}),(0,u.jsx)(`div`,{className:`mt-3 space-y-2`,children:a.topProjectsByThreadCount.map(e=>(0,u.jsxs)(o,{className:`flex items-center justify-between gap-3 rounded-lg border border-[var(--border)] bg-[var(--panel-secondary)] px-3.5 py-2.5 text-sm`,params:{project:e.name},to:`/projects/$project`,children:[(0,u.jsx)(`span`,{className:`truncate`,children:e.name}),(0,u.jsx)(`span`,{className:`shrink-0 font-mono text-[var(--muted-foreground)]`,children:t(e.threadCount)})]},e.name))})]}),(0,u.jsxs)(`section`,{className:`min-w-0 overflow-hidden rounded-[1.8rem] border border-[var(--border)] bg-[var(--panel)] p-5 shadow-[var(--panel-shadow)]`,children:[(0,u.jsx)(`p`,{className:`font-semibold text-sm`,children:`Top projects by tokens`}),(0,u.jsx)(`div`,{className:`mt-3 space-y-2`,children:a.topProjectsByTokens.map(e=>(0,u.jsxs)(o,{className:`flex items-center justify-between gap-3 rounded-lg border border-[var(--border)] bg-[var(--panel-secondary)] px-3.5 py-2.5 text-sm`,params:{project:e.name},to:`/projects/$project`,children:[(0,u.jsx)(`span`,{className:`truncate`,children:e.name}),(0,u.jsx)(`span`,{className:`shrink-0 font-mono text-[var(--muted-foreground)]`,children:r(e.totalTokens)})]},e.name))})]})]})]})]})}export{f as component};
@@ -1 +1 @@
1
- import{n as e,r as t}from"./checkbox-DXM4lkJq.js";import{a as n,i as r,n as i,o as a,r as o,t as s}from"./es2015-Bm0kEzx2.js";import{A as c,B as l,C as u,E as d,H as f,L as p,M as m,N as h,O as g,P as _,T as v,W as y,_ as b,b as x,dt as S,ft as C,k as w,mt as T,pt as E,v as D,w as O,x as k,y as A}from"./index-DdJ7ahIt.js";var j=y(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),ee=y(`chevron-up`,[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]),M=T(E(),1),N=T(C(),1);function P(e,[t,n]){return Math.min(n,Math.max(t,e))}var F=S(),I=[` `,`Enter`,`ArrowUp`,`ArrowDown`],L=[` `,`Enter`],R=`Select`,[z,B,V]=a(R),[H,U]=m(R,[V,k]),W=k(),[te,G]=H(R),[ne,re]=H(R),K=e=>{let{__scopeSelect:t,children:r,open:i,defaultOpen:a,onOpenChange:o,value:s,defaultValue:c,onValueChange:l,dir:u,name:f,autoComplete:p,disabled:m,required:h,form:_}=e,v=W(t),[y,b]=M.useState(null),[S,C]=M.useState(null),[w,T]=M.useState(!1),E=n(u),[D,O]=g({prop:i,defaultProp:a??!1,onChange:o,caller:R}),[k,A]=g({prop:s,defaultProp:c,onChange:l,caller:R}),j=M.useRef(null),ee=y?_||!!y.closest(`form`):!0,[N,P]=M.useState(new Set),I=Array.from(N).map(e=>e.props.value).join(`;`);return(0,F.jsx)(x,{...v,children:(0,F.jsxs)(te,{required:h,scope:t,trigger:y,onTriggerChange:b,valueNode:S,onValueNodeChange:C,valueNodeHasChildren:w,onValueNodeHasChildrenChange:T,contentId:d(),value:k,onValueChange:A,open:D,onOpenChange:O,dir:E,triggerPointerDownPosRef:j,disabled:m,children:[(0,F.jsx)(z.Provider,{scope:t,children:(0,F.jsx)(ne,{scope:e.__scopeSelect,onNativeOptionAdd:M.useCallback(e=>{P(t=>new Set(t).add(e))},[]),onNativeOptionRemove:M.useCallback(e=>{P(t=>{let n=new Set(t);return n.delete(e),n})},[]),children:r})}),ee?(0,F.jsxs)(Ge,{"aria-hidden":!0,required:h,tabIndex:-1,name:f,autoComplete:p,value:k,onChange:e=>A(e.target.value),disabled:m,form:_,children:[k===void 0?(0,F.jsx)(`option`,{value:``}):null,Array.from(N)]},I):null]})})};K.displayName=R;var q=`SelectTrigger`,J=M.forwardRef((e,t)=>{let{__scopeSelect:n,disabled:r=!1,...i}=e,a=W(n),o=G(q,n),s=o.disabled||r,u=l(t,o.onTriggerChange),d=B(n),f=M.useRef(`touch`),[p,m,h]=qe(e=>{let t=d().filter(e=>!e.disabled),n=Je(t,e,t.find(e=>e.value===o.value));n!==void 0&&o.onValueChange(n.value)}),g=e=>{s||(o.onOpenChange(!0),h()),e&&(o.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})};return(0,F.jsx)(b,{asChild:!0,...a,children:(0,F.jsx)(_.button,{type:`button`,role:`combobox`,"aria-controls":o.contentId,"aria-expanded":o.open,"aria-required":o.required,"aria-autocomplete":`none`,dir:o.dir,"data-state":o.open?`open`:`closed`,disabled:s,"data-disabled":s?``:void 0,"data-placeholder":Ke(o.value)?``:void 0,...i,ref:u,onClick:c(i.onClick,e=>{e.currentTarget.focus(),f.current!==`mouse`&&g(e)}),onPointerDown:c(i.onPointerDown,e=>{f.current=e.pointerType;let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),e.button===0&&e.ctrlKey===!1&&e.pointerType===`mouse`&&(g(e),e.preventDefault())}),onKeyDown:c(i.onKeyDown,e=>{let t=p.current!==``;!(e.ctrlKey||e.altKey||e.metaKey)&&e.key.length===1&&m(e.key),!(t&&e.key===` `)&&I.includes(e.key)&&(g(),e.preventDefault())})})})});J.displayName=q;var ie=`SelectValue`,ae=M.forwardRef((e,t)=>{let{__scopeSelect:n,className:r,style:i,children:a,placeholder:o=``,...s}=e,c=G(ie,n),{onValueNodeHasChildrenChange:u}=c,d=a!==void 0,f=l(t,c.onValueNodeChange);return w(()=>{u(d)},[u,d]),(0,F.jsx)(_.span,{...s,ref:f,style:{pointerEvents:`none`},children:Ke(c.value)?(0,F.jsx)(F.Fragment,{children:o}):a})});ae.displayName=ie;var oe=`SelectIcon`,se=M.forwardRef((e,t)=>{let{__scopeSelect:n,children:r,...i}=e;return(0,F.jsx)(_.span,{"aria-hidden":!0,...i,ref:t,children:r||`▼`})});se.displayName=oe;var ce=`SelectPortal`,le=e=>(0,F.jsx)(u,{asChild:!0,...e});le.displayName=ce;var Y=`SelectContent`,ue=M.forwardRef((e,t)=>{let n=G(Y,e.__scopeSelect),[r,i]=M.useState();if(w(()=>{i(new DocumentFragment)},[]),!n.open){let t=r;return t?N.createPortal((0,F.jsx)(de,{scope:e.__scopeSelect,children:(0,F.jsx)(z.Slot,{scope:e.__scopeSelect,children:(0,F.jsx)(`div`,{children:e.children})})}),t):null}return(0,F.jsx)(me,{...e,ref:t})});ue.displayName=Y;var X=10,[de,Z]=H(Y),fe=`SelectContentImpl`,pe=p(`SelectContent.RemoveScroll`),me=M.forwardRef((e,t)=>{let{__scopeSelect:n,position:a=`item-aligned`,onCloseAutoFocus:u,onEscapeKeyDown:d,onPointerDownOutside:f,side:p,sideOffset:m,align:h,alignOffset:g,arrowPadding:_,collisionBoundary:v,collisionPadding:y,sticky:b,hideWhenDetached:x,avoidCollisions:S,...C}=e,w=G(Y,n),[T,E]=M.useState(null),[D,k]=M.useState(null),A=l(t,e=>E(e)),[j,ee]=M.useState(null),[N,P]=M.useState(null),I=B(n),[L,R]=M.useState(!1),z=M.useRef(!1);M.useEffect(()=>{if(T)return s(T)},[T]),o();let V=M.useCallback(e=>{let[t,...n]=I().map(e=>e.ref.current),[r]=n.slice(-1),i=document.activeElement;for(let n of e)if(n===i||(n?.scrollIntoView({block:`nearest`}),n===t&&D&&(D.scrollTop=0),n===r&&D&&(D.scrollTop=D.scrollHeight),n?.focus(),document.activeElement!==i))return},[I,D]),H=M.useCallback(()=>V([j,T]),[V,j,T]);M.useEffect(()=>{L&&H()},[L,H]);let{onOpenChange:U,triggerPointerDownPosRef:W}=w;M.useEffect(()=>{if(T){let e={x:0,y:0},t=t=>{e={x:Math.abs(Math.round(t.pageX)-(W.current?.x??0)),y:Math.abs(Math.round(t.pageY)-(W.current?.y??0))}},n=n=>{e.x<=10&&e.y<=10?n.preventDefault():T.contains(n.target)||U(!1),document.removeEventListener(`pointermove`,t),W.current=null};return W.current!==null&&(document.addEventListener(`pointermove`,t),document.addEventListener(`pointerup`,n,{capture:!0,once:!0})),()=>{document.removeEventListener(`pointermove`,t),document.removeEventListener(`pointerup`,n,{capture:!0})}}},[T,U,W]),M.useEffect(()=>{let e=()=>U(!1);return window.addEventListener(`blur`,e),window.addEventListener(`resize`,e),()=>{window.removeEventListener(`blur`,e),window.removeEventListener(`resize`,e)}},[U]);let[te,ne]=qe(e=>{let t=I().filter(e=>!e.disabled),n=Je(t,e,t.find(e=>e.ref.current===document.activeElement));n&&setTimeout(()=>n.ref.current.focus())}),re=M.useCallback((e,t,n)=>{let r=!z.current&&!n;(w.value!==void 0&&w.value===t||r)&&(ee(e),r&&(z.current=!0))},[w.value]),K=M.useCallback(()=>T?.focus(),[T]),q=M.useCallback((e,t,n)=>{let r=!z.current&&!n;(w.value!==void 0&&w.value===t||r)&&P(e)},[w.value]),J=a===`popper`?ve:ge,ie=J===ve?{side:p,sideOffset:m,align:h,alignOffset:g,arrowPadding:_,collisionBoundary:v,collisionPadding:y,sticky:b,hideWhenDetached:x,avoidCollisions:S}:{};return(0,F.jsx)(de,{scope:n,content:T,viewport:D,onViewportChange:k,itemRefCallback:re,selectedItem:j,onItemLeave:K,itemTextRefCallback:q,focusSelectedItem:H,selectedItemText:N,position:a,isPositioned:L,searchRef:te,children:(0,F.jsx)(i,{as:pe,allowPinchZoom:!0,children:(0,F.jsx)(r,{asChild:!0,trapped:w.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:c(u,e=>{w.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:(0,F.jsx)(O,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:d,onPointerDownOutside:f,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>w.onOpenChange(!1),children:(0,F.jsx)(J,{role:`listbox`,id:w.contentId,"data-state":w.open?`open`:`closed`,dir:w.dir,onContextMenu:e=>e.preventDefault(),...C,...ie,onPlaced:()=>R(!0),ref:A,style:{display:`flex`,flexDirection:`column`,outline:`none`,...C.style},onKeyDown:c(C.onKeyDown,e=>{let t=e.ctrlKey||e.altKey||e.metaKey;if(e.key===`Tab`&&e.preventDefault(),!t&&e.key.length===1&&ne(e.key),[`ArrowUp`,`ArrowDown`,`Home`,`End`].includes(e.key)){let t=I().filter(e=>!e.disabled).map(e=>e.ref.current);if([`ArrowUp`,`End`].includes(e.key)&&(t=t.slice().reverse()),[`ArrowUp`,`ArrowDown`].includes(e.key)){let n=e.target,r=t.indexOf(n);t=t.slice(r+1)}setTimeout(()=>V(t)),e.preventDefault()}})})})})})})});me.displayName=fe;var he=`SelectItemAlignedPosition`,ge=M.forwardRef((e,t)=>{let{__scopeSelect:n,onPlaced:r,...i}=e,a=G(Y,n),o=Z(Y,n),[s,c]=M.useState(null),[u,d]=M.useState(null),f=l(t,e=>d(e)),p=B(n),m=M.useRef(!1),h=M.useRef(!0),{viewport:g,selectedItem:v,selectedItemText:y,focusSelectedItem:b}=o,x=M.useCallback(()=>{if(a.trigger&&a.valueNode&&s&&u&&g&&v&&y){let e=a.trigger.getBoundingClientRect(),t=u.getBoundingClientRect(),n=a.valueNode.getBoundingClientRect(),i=y.getBoundingClientRect();if(a.dir!==`rtl`){let r=i.left-t.left,a=n.left-r,o=e.left-a,c=e.width+o,l=Math.max(c,t.width),u=window.innerWidth-X,d=P(a,[X,Math.max(X,u-l)]);s.style.minWidth=c+`px`,s.style.left=d+`px`}else{let r=t.right-i.right,a=window.innerWidth-n.right-r,o=window.innerWidth-e.right-a,c=e.width+o,l=Math.max(c,t.width),u=window.innerWidth-X,d=P(a,[X,Math.max(X,u-l)]);s.style.minWidth=c+`px`,s.style.right=d+`px`}let o=p(),c=window.innerHeight-X*2,l=g.scrollHeight,d=window.getComputedStyle(u),f=parseInt(d.borderTopWidth,10),h=parseInt(d.paddingTop,10),_=parseInt(d.borderBottomWidth,10),b=parseInt(d.paddingBottom,10),x=f+h+l+b+_,S=Math.min(v.offsetHeight*5,x),C=window.getComputedStyle(g),w=parseInt(C.paddingTop,10),T=parseInt(C.paddingBottom,10),E=e.top+e.height/2-X,D=c-E,O=v.offsetHeight/2,k=v.offsetTop+O,A=f+h+k,j=x-A;if(A<=E){let e=o.length>0&&v===o[o.length-1].ref.current;s.style.bottom=`0px`;let t=u.clientHeight-g.offsetTop-g.offsetHeight,n=A+Math.max(D,O+(e?T:0)+t+_);s.style.height=n+`px`}else{let e=o.length>0&&v===o[0].ref.current;s.style.top=`0px`;let t=Math.max(E,f+g.offsetTop+(e?w:0)+O)+j;s.style.height=t+`px`,g.scrollTop=A-E+g.offsetTop}s.style.margin=`${X}px 0`,s.style.minHeight=S+`px`,s.style.maxHeight=c+`px`,r?.(),requestAnimationFrame(()=>m.current=!0)}},[p,a.trigger,a.valueNode,s,u,g,v,y,a.dir,r]);w(()=>x(),[x]);let[S,C]=M.useState();return w(()=>{u&&C(window.getComputedStyle(u).zIndex)},[u]),(0,F.jsx)(ye,{scope:n,contentWrapper:s,shouldExpandOnScrollRef:m,onScrollButtonChange:M.useCallback(e=>{e&&h.current===!0&&(x(),b?.(),h.current=!1)},[x,b]),children:(0,F.jsx)(`div`,{ref:c,style:{display:`flex`,flexDirection:`column`,position:`fixed`,zIndex:S},children:(0,F.jsx)(_.div,{...i,ref:f,style:{boxSizing:`border-box`,maxHeight:`100%`,...i.style}})})})});ge.displayName=he;var _e=`SelectPopperPosition`,ve=M.forwardRef((e,t)=>{let{__scopeSelect:n,align:r=`start`,collisionPadding:i=X,...a}=e,o=W(n);return(0,F.jsx)(A,{...o,...a,ref:t,align:r,collisionPadding:i,style:{boxSizing:`border-box`,...a.style,"--radix-select-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-select-content-available-width":`var(--radix-popper-available-width)`,"--radix-select-content-available-height":`var(--radix-popper-available-height)`,"--radix-select-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-select-trigger-height":`var(--radix-popper-anchor-height)`}})});ve.displayName=_e;var[ye,be]=H(Y,{}),xe=`SelectViewport`,Se=M.forwardRef((e,t)=>{let{__scopeSelect:n,nonce:r,...i}=e,a=Z(xe,n),o=be(xe,n),s=l(t,a.onViewportChange),u=M.useRef(0);return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`style`,{dangerouslySetInnerHTML:{__html:`[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}`},nonce:r}),(0,F.jsx)(z.Slot,{scope:n,children:(0,F.jsx)(_.div,{"data-radix-select-viewport":``,role:`presentation`,...i,ref:s,style:{position:`relative`,flex:1,overflow:`hidden auto`,...i.style},onScroll:c(i.onScroll,e=>{let t=e.currentTarget,{contentWrapper:n,shouldExpandOnScrollRef:r}=o;if(r?.current&&n){let e=Math.abs(u.current-t.scrollTop);if(e>0){let r=window.innerHeight-X*2,i=parseFloat(n.style.minHeight),a=parseFloat(n.style.height),o=Math.max(i,a);if(o<r){let i=o+e,a=Math.min(r,i),s=i-a;n.style.height=a+`px`,n.style.bottom===`0px`&&(t.scrollTop=s>0?s:0,n.style.justifyContent=`flex-end`)}}}u.current=t.scrollTop})})})]})});Se.displayName=xe;var Ce=`SelectGroup`,[we,Te]=H(Ce),Ee=M.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=d();return(0,F.jsx)(we,{scope:n,id:i,children:(0,F.jsx)(_.div,{role:`group`,"aria-labelledby":i,...r,ref:t})})});Ee.displayName=Ce;var De=`SelectLabel`,Oe=M.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=Te(De,n);return(0,F.jsx)(_.div,{id:i.id,...r,ref:t})});Oe.displayName=De;var Q=`SelectItem`,[ke,Ae]=H(Q),je=M.forwardRef((e,t)=>{let{__scopeSelect:n,value:r,disabled:i=!1,textValue:a,...o}=e,s=G(Q,n),u=Z(Q,n),f=s.value===r,[p,m]=M.useState(a??``),[h,g]=M.useState(!1),v=l(t,e=>u.itemRefCallback?.(e,r,i)),y=d(),b=M.useRef(`touch`),x=()=>{i||(s.onValueChange(r),s.onOpenChange(!1))};if(r===``)throw Error(`A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.`);return(0,F.jsx)(ke,{scope:n,value:r,disabled:i,textId:y,isSelected:f,onItemTextChange:M.useCallback(e=>{m(t=>t||(e?.textContent??``).trim())},[]),children:(0,F.jsx)(z.ItemSlot,{scope:n,value:r,disabled:i,textValue:p,children:(0,F.jsx)(_.div,{role:`option`,"aria-labelledby":y,"data-highlighted":h?``:void 0,"aria-selected":f&&h,"data-state":f?`checked`:`unchecked`,"aria-disabled":i||void 0,"data-disabled":i?``:void 0,tabIndex:i?void 0:-1,...o,ref:v,onFocus:c(o.onFocus,()=>g(!0)),onBlur:c(o.onBlur,()=>g(!1)),onClick:c(o.onClick,()=>{b.current!==`mouse`&&x()}),onPointerUp:c(o.onPointerUp,()=>{b.current===`mouse`&&x()}),onPointerDown:c(o.onPointerDown,e=>{b.current=e.pointerType}),onPointerMove:c(o.onPointerMove,e=>{b.current=e.pointerType,i?u.onItemLeave?.():b.current===`mouse`&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:c(o.onPointerLeave,e=>{e.currentTarget===document.activeElement&&u.onItemLeave?.()}),onKeyDown:c(o.onKeyDown,e=>{u.searchRef?.current!==``&&e.key===` `||(L.includes(e.key)&&x(),e.key===` `&&e.preventDefault())})})})})});je.displayName=Q;var $=`SelectItemText`,Me=M.forwardRef((e,t)=>{let{__scopeSelect:n,className:r,style:i,...a}=e,o=G($,n),s=Z($,n),c=Ae($,n),u=re($,n),[d,f]=M.useState(null),p=l(t,e=>f(e),c.onItemTextChange,e=>s.itemTextRefCallback?.(e,c.value,c.disabled)),m=d?.textContent,h=M.useMemo(()=>(0,F.jsx)(`option`,{value:c.value,disabled:c.disabled,children:m},c.value),[c.disabled,c.value,m]),{onNativeOptionAdd:g,onNativeOptionRemove:v}=u;return w(()=>(g(h),()=>v(h)),[g,v,h]),(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(_.span,{id:c.textId,...a,ref:p}),c.isSelected&&o.valueNode&&!o.valueNodeHasChildren?N.createPortal(a.children,o.valueNode):null]})});Me.displayName=$;var Ne=`SelectItemIndicator`,Pe=M.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e;return Ae(Ne,n).isSelected?(0,F.jsx)(_.span,{"aria-hidden":!0,...r,ref:t}):null});Pe.displayName=Ne;var Fe=`SelectScrollUpButton`,Ie=M.forwardRef((e,t)=>{let n=Z(Fe,e.__scopeSelect),r=be(Fe,e.__scopeSelect),[i,a]=M.useState(!1),o=l(t,r.onScrollButtonChange);return w(()=>{if(n.viewport&&n.isPositioned){let e=function(){a(t.scrollTop>0)},t=n.viewport;return e(),t.addEventListener(`scroll`,e),()=>t.removeEventListener(`scroll`,e)}},[n.viewport,n.isPositioned]),i?(0,F.jsx)(ze,{...e,ref:o,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop-=t.offsetHeight)}}):null});Ie.displayName=Fe;var Le=`SelectScrollDownButton`,Re=M.forwardRef((e,t)=>{let n=Z(Le,e.__scopeSelect),r=be(Le,e.__scopeSelect),[i,a]=M.useState(!1),o=l(t,r.onScrollButtonChange);return w(()=>{if(n.viewport&&n.isPositioned){let e=function(){let e=t.scrollHeight-t.clientHeight;a(Math.ceil(t.scrollTop)<e)},t=n.viewport;return e(),t.addEventListener(`scroll`,e),()=>t.removeEventListener(`scroll`,e)}},[n.viewport,n.isPositioned]),i?(0,F.jsx)(ze,{...e,ref:o,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop+=t.offsetHeight)}}):null});Re.displayName=Le;var ze=M.forwardRef((e,t)=>{let{__scopeSelect:n,onAutoScroll:r,...i}=e,a=Z(`SelectScrollButton`,n),o=M.useRef(null),s=B(n),l=M.useCallback(()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},[]);return M.useEffect(()=>()=>l(),[l]),w(()=>{s().find(e=>e.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:`nearest`})},[s]),(0,F.jsx)(_.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:c(i.onPointerDown,()=>{o.current===null&&(o.current=window.setInterval(r,50))}),onPointerMove:c(i.onPointerMove,()=>{a.onItemLeave?.(),o.current===null&&(o.current=window.setInterval(r,50))}),onPointerLeave:c(i.onPointerLeave,()=>{l()})})}),Be=`SelectSeparator`,Ve=M.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e;return(0,F.jsx)(_.div,{"aria-hidden":!0,...r,ref:t})});Ve.displayName=Be;var He=`SelectArrow`,Ue=M.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=W(n),a=G(He,n),o=Z(He,n);return a.open&&o.position===`popper`?(0,F.jsx)(D,{...i,...r,ref:t}):null});Ue.displayName=He;var We=`SelectBubbleInput`,Ge=M.forwardRef(({__scopeSelect:t,value:n,...r},i)=>{let a=M.useRef(null),o=l(i,a),s=e(n);return M.useEffect(()=>{let e=a.current;if(!e)return;let t=window.HTMLSelectElement.prototype,r=Object.getOwnPropertyDescriptor(t,`value`).set;if(s!==n&&r){let t=new Event(`change`,{bubbles:!0});r.call(e,n),e.dispatchEvent(t)}},[s,n]),(0,F.jsx)(_.select,{...r,style:{...h,...r.style},ref:o,defaultValue:n})});Ge.displayName=We;function Ke(e){return e===``||e===void 0}function qe(e){let t=v(e),n=M.useRef(``),r=M.useRef(0),i=M.useCallback(e=>{let i=n.current+e;t(i),(function e(t){n.current=t,window.clearTimeout(r.current),t!==``&&(r.current=window.setTimeout(()=>e(``),1e3))})(i)},[t]),a=M.useCallback(()=>{n.current=``,window.clearTimeout(r.current)},[]);return M.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,a]}function Je(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=Ye(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.textValue.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}function Ye(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Xe=K,Ze=J,Qe=ae,$e=se,et=le,tt=ue,nt=Se,rt=je,it=Me,at=Pe,ot=Ie,st=Re;function ct({...e}){return(0,F.jsx)(Xe,{"data-slot":`select`,...e})}function lt({...e}){return(0,F.jsx)(Qe,{"data-slot":`select-value`,...e})}function ut({className:e,size:t=`default`,children:n,...r}){return(0,F.jsxs)(Ze,{"data-slot":`select-trigger`,"data-size":t,className:f(`flex w-fit items-center justify-between gap-2 whitespace-nowrap rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-xs outline-none transition-[color,box-shadow] focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-[size=default]:h-9 data-[size=sm]:h-8 data-[placeholder]:text-muted-foreground *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 dark:bg-input/30 dark:aria-invalid:ring-destructive/40 dark:hover:bg-input/50 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0`,e),...r,children:[n,(0,F.jsx)($e,{asChild:!0,children:(0,F.jsx)(j,{className:`size-4 opacity-50`})})]})}function dt({className:e,children:t,position:n=`item-aligned`,align:r=`center`,...i}){return(0,F.jsx)(et,{children:(0,F.jsxs)(tt,{"data-slot":`select-content`,className:f(`data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-y-auto overflow-x-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=closed]:animate-out data-[state=open]:animate-in`,n===`popper`&&`data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=bottom]:translate-y-1 data-[side=top]:-translate-y-1`,e),position:n,align:r,...i,children:[(0,F.jsx)(pt,{}),(0,F.jsx)(nt,{className:f(`p-1`,n===`popper`&&`h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1`),children:t}),(0,F.jsx)(mt,{})]})})}function ft({className:e,children:n,...r}){return(0,F.jsxs)(rt,{"data-slot":`select-item`,className:f(`relative flex w-full cursor-default select-none items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2`,e),...r,children:[(0,F.jsx)(`span`,{"data-slot":`select-item-indicator`,className:`absolute right-2 flex size-3.5 items-center justify-center`,children:(0,F.jsx)(at,{children:(0,F.jsx)(t,{className:`size-4`})})}),(0,F.jsx)(it,{children:n})]})}function pt({className:e,...t}){return(0,F.jsx)(ot,{"data-slot":`select-scroll-up-button`,className:f(`flex cursor-default items-center justify-center py-1`,e),...t,children:(0,F.jsx)(ee,{className:`size-4`})})}function mt({className:e,...t}){return(0,F.jsx)(st,{"data-slot":`select-scroll-down-button`,className:f(`flex cursor-default items-center justify-center py-1`,e),...t,children:(0,F.jsx)(j,{className:`size-4`})})}export{lt as a,ut as i,dt as n,ft as r,ct as t};
1
+ import{n as e,r as t}from"./checkbox-DjHij7DJ.js";import{a as n,i as r,n as i,o as a,r as o,t as s}from"./es2015-DsDKdYCE.js";import{A as c,B as l,C as u,E as d,H as f,L as p,M as m,N as h,O as g,P as _,T as v,W as y,_ as b,b as x,dt as S,ft as C,k as w,mt as T,pt as E,v as D,w as O,x as k,y as A}from"./index-C_-e0lDI.js";var j=y(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),ee=y(`chevron-up`,[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]),M=T(E(),1),N=T(C(),1);function P(e,[t,n]){return Math.min(n,Math.max(t,e))}var F=S(),I=[` `,`Enter`,`ArrowUp`,`ArrowDown`],L=[` `,`Enter`],R=`Select`,[z,B,V]=a(R),[H,U]=m(R,[V,k]),W=k(),[te,G]=H(R),[ne,re]=H(R),K=e=>{let{__scopeSelect:t,children:r,open:i,defaultOpen:a,onOpenChange:o,value:s,defaultValue:c,onValueChange:l,dir:u,name:f,autoComplete:p,disabled:m,required:h,form:_}=e,v=W(t),[y,b]=M.useState(null),[S,C]=M.useState(null),[w,T]=M.useState(!1),E=n(u),[D,O]=g({prop:i,defaultProp:a??!1,onChange:o,caller:R}),[k,A]=g({prop:s,defaultProp:c,onChange:l,caller:R}),j=M.useRef(null),ee=y?_||!!y.closest(`form`):!0,[N,P]=M.useState(new Set),I=Array.from(N).map(e=>e.props.value).join(`;`);return(0,F.jsx)(x,{...v,children:(0,F.jsxs)(te,{required:h,scope:t,trigger:y,onTriggerChange:b,valueNode:S,onValueNodeChange:C,valueNodeHasChildren:w,onValueNodeHasChildrenChange:T,contentId:d(),value:k,onValueChange:A,open:D,onOpenChange:O,dir:E,triggerPointerDownPosRef:j,disabled:m,children:[(0,F.jsx)(z.Provider,{scope:t,children:(0,F.jsx)(ne,{scope:e.__scopeSelect,onNativeOptionAdd:M.useCallback(e=>{P(t=>new Set(t).add(e))},[]),onNativeOptionRemove:M.useCallback(e=>{P(t=>{let n=new Set(t);return n.delete(e),n})},[]),children:r})}),ee?(0,F.jsxs)(Ge,{"aria-hidden":!0,required:h,tabIndex:-1,name:f,autoComplete:p,value:k,onChange:e=>A(e.target.value),disabled:m,form:_,children:[k===void 0?(0,F.jsx)(`option`,{value:``}):null,Array.from(N)]},I):null]})})};K.displayName=R;var q=`SelectTrigger`,J=M.forwardRef((e,t)=>{let{__scopeSelect:n,disabled:r=!1,...i}=e,a=W(n),o=G(q,n),s=o.disabled||r,u=l(t,o.onTriggerChange),d=B(n),f=M.useRef(`touch`),[p,m,h]=qe(e=>{let t=d().filter(e=>!e.disabled),n=Je(t,e,t.find(e=>e.value===o.value));n!==void 0&&o.onValueChange(n.value)}),g=e=>{s||(o.onOpenChange(!0),h()),e&&(o.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})};return(0,F.jsx)(b,{asChild:!0,...a,children:(0,F.jsx)(_.button,{type:`button`,role:`combobox`,"aria-controls":o.contentId,"aria-expanded":o.open,"aria-required":o.required,"aria-autocomplete":`none`,dir:o.dir,"data-state":o.open?`open`:`closed`,disabled:s,"data-disabled":s?``:void 0,"data-placeholder":Ke(o.value)?``:void 0,...i,ref:u,onClick:c(i.onClick,e=>{e.currentTarget.focus(),f.current!==`mouse`&&g(e)}),onPointerDown:c(i.onPointerDown,e=>{f.current=e.pointerType;let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),e.button===0&&e.ctrlKey===!1&&e.pointerType===`mouse`&&(g(e),e.preventDefault())}),onKeyDown:c(i.onKeyDown,e=>{let t=p.current!==``;!(e.ctrlKey||e.altKey||e.metaKey)&&e.key.length===1&&m(e.key),!(t&&e.key===` `)&&I.includes(e.key)&&(g(),e.preventDefault())})})})});J.displayName=q;var ie=`SelectValue`,ae=M.forwardRef((e,t)=>{let{__scopeSelect:n,className:r,style:i,children:a,placeholder:o=``,...s}=e,c=G(ie,n),{onValueNodeHasChildrenChange:u}=c,d=a!==void 0,f=l(t,c.onValueNodeChange);return w(()=>{u(d)},[u,d]),(0,F.jsx)(_.span,{...s,ref:f,style:{pointerEvents:`none`},children:Ke(c.value)?(0,F.jsx)(F.Fragment,{children:o}):a})});ae.displayName=ie;var oe=`SelectIcon`,se=M.forwardRef((e,t)=>{let{__scopeSelect:n,children:r,...i}=e;return(0,F.jsx)(_.span,{"aria-hidden":!0,...i,ref:t,children:r||`▼`})});se.displayName=oe;var ce=`SelectPortal`,le=e=>(0,F.jsx)(u,{asChild:!0,...e});le.displayName=ce;var Y=`SelectContent`,ue=M.forwardRef((e,t)=>{let n=G(Y,e.__scopeSelect),[r,i]=M.useState();if(w(()=>{i(new DocumentFragment)},[]),!n.open){let t=r;return t?N.createPortal((0,F.jsx)(de,{scope:e.__scopeSelect,children:(0,F.jsx)(z.Slot,{scope:e.__scopeSelect,children:(0,F.jsx)(`div`,{children:e.children})})}),t):null}return(0,F.jsx)(me,{...e,ref:t})});ue.displayName=Y;var X=10,[de,Z]=H(Y),fe=`SelectContentImpl`,pe=p(`SelectContent.RemoveScroll`),me=M.forwardRef((e,t)=>{let{__scopeSelect:n,position:a=`item-aligned`,onCloseAutoFocus:u,onEscapeKeyDown:d,onPointerDownOutside:f,side:p,sideOffset:m,align:h,alignOffset:g,arrowPadding:_,collisionBoundary:v,collisionPadding:y,sticky:b,hideWhenDetached:x,avoidCollisions:S,...C}=e,w=G(Y,n),[T,E]=M.useState(null),[D,k]=M.useState(null),A=l(t,e=>E(e)),[j,ee]=M.useState(null),[N,P]=M.useState(null),I=B(n),[L,R]=M.useState(!1),z=M.useRef(!1);M.useEffect(()=>{if(T)return s(T)},[T]),o();let V=M.useCallback(e=>{let[t,...n]=I().map(e=>e.ref.current),[r]=n.slice(-1),i=document.activeElement;for(let n of e)if(n===i||(n?.scrollIntoView({block:`nearest`}),n===t&&D&&(D.scrollTop=0),n===r&&D&&(D.scrollTop=D.scrollHeight),n?.focus(),document.activeElement!==i))return},[I,D]),H=M.useCallback(()=>V([j,T]),[V,j,T]);M.useEffect(()=>{L&&H()},[L,H]);let{onOpenChange:U,triggerPointerDownPosRef:W}=w;M.useEffect(()=>{if(T){let e={x:0,y:0},t=t=>{e={x:Math.abs(Math.round(t.pageX)-(W.current?.x??0)),y:Math.abs(Math.round(t.pageY)-(W.current?.y??0))}},n=n=>{e.x<=10&&e.y<=10?n.preventDefault():T.contains(n.target)||U(!1),document.removeEventListener(`pointermove`,t),W.current=null};return W.current!==null&&(document.addEventListener(`pointermove`,t),document.addEventListener(`pointerup`,n,{capture:!0,once:!0})),()=>{document.removeEventListener(`pointermove`,t),document.removeEventListener(`pointerup`,n,{capture:!0})}}},[T,U,W]),M.useEffect(()=>{let e=()=>U(!1);return window.addEventListener(`blur`,e),window.addEventListener(`resize`,e),()=>{window.removeEventListener(`blur`,e),window.removeEventListener(`resize`,e)}},[U]);let[te,ne]=qe(e=>{let t=I().filter(e=>!e.disabled),n=Je(t,e,t.find(e=>e.ref.current===document.activeElement));n&&setTimeout(()=>n.ref.current.focus())}),re=M.useCallback((e,t,n)=>{let r=!z.current&&!n;(w.value!==void 0&&w.value===t||r)&&(ee(e),r&&(z.current=!0))},[w.value]),K=M.useCallback(()=>T?.focus(),[T]),q=M.useCallback((e,t,n)=>{let r=!z.current&&!n;(w.value!==void 0&&w.value===t||r)&&P(e)},[w.value]),J=a===`popper`?ve:ge,ie=J===ve?{side:p,sideOffset:m,align:h,alignOffset:g,arrowPadding:_,collisionBoundary:v,collisionPadding:y,sticky:b,hideWhenDetached:x,avoidCollisions:S}:{};return(0,F.jsx)(de,{scope:n,content:T,viewport:D,onViewportChange:k,itemRefCallback:re,selectedItem:j,onItemLeave:K,itemTextRefCallback:q,focusSelectedItem:H,selectedItemText:N,position:a,isPositioned:L,searchRef:te,children:(0,F.jsx)(i,{as:pe,allowPinchZoom:!0,children:(0,F.jsx)(r,{asChild:!0,trapped:w.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:c(u,e=>{w.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:(0,F.jsx)(O,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:d,onPointerDownOutside:f,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>w.onOpenChange(!1),children:(0,F.jsx)(J,{role:`listbox`,id:w.contentId,"data-state":w.open?`open`:`closed`,dir:w.dir,onContextMenu:e=>e.preventDefault(),...C,...ie,onPlaced:()=>R(!0),ref:A,style:{display:`flex`,flexDirection:`column`,outline:`none`,...C.style},onKeyDown:c(C.onKeyDown,e=>{let t=e.ctrlKey||e.altKey||e.metaKey;if(e.key===`Tab`&&e.preventDefault(),!t&&e.key.length===1&&ne(e.key),[`ArrowUp`,`ArrowDown`,`Home`,`End`].includes(e.key)){let t=I().filter(e=>!e.disabled).map(e=>e.ref.current);if([`ArrowUp`,`End`].includes(e.key)&&(t=t.slice().reverse()),[`ArrowUp`,`ArrowDown`].includes(e.key)){let n=e.target,r=t.indexOf(n);t=t.slice(r+1)}setTimeout(()=>V(t)),e.preventDefault()}})})})})})})});me.displayName=fe;var he=`SelectItemAlignedPosition`,ge=M.forwardRef((e,t)=>{let{__scopeSelect:n,onPlaced:r,...i}=e,a=G(Y,n),o=Z(Y,n),[s,c]=M.useState(null),[u,d]=M.useState(null),f=l(t,e=>d(e)),p=B(n),m=M.useRef(!1),h=M.useRef(!0),{viewport:g,selectedItem:v,selectedItemText:y,focusSelectedItem:b}=o,x=M.useCallback(()=>{if(a.trigger&&a.valueNode&&s&&u&&g&&v&&y){let e=a.trigger.getBoundingClientRect(),t=u.getBoundingClientRect(),n=a.valueNode.getBoundingClientRect(),i=y.getBoundingClientRect();if(a.dir!==`rtl`){let r=i.left-t.left,a=n.left-r,o=e.left-a,c=e.width+o,l=Math.max(c,t.width),u=window.innerWidth-X,d=P(a,[X,Math.max(X,u-l)]);s.style.minWidth=c+`px`,s.style.left=d+`px`}else{let r=t.right-i.right,a=window.innerWidth-n.right-r,o=window.innerWidth-e.right-a,c=e.width+o,l=Math.max(c,t.width),u=window.innerWidth-X,d=P(a,[X,Math.max(X,u-l)]);s.style.minWidth=c+`px`,s.style.right=d+`px`}let o=p(),c=window.innerHeight-X*2,l=g.scrollHeight,d=window.getComputedStyle(u),f=parseInt(d.borderTopWidth,10),h=parseInt(d.paddingTop,10),_=parseInt(d.borderBottomWidth,10),b=parseInt(d.paddingBottom,10),x=f+h+l+b+_,S=Math.min(v.offsetHeight*5,x),C=window.getComputedStyle(g),w=parseInt(C.paddingTop,10),T=parseInt(C.paddingBottom,10),E=e.top+e.height/2-X,D=c-E,O=v.offsetHeight/2,k=v.offsetTop+O,A=f+h+k,j=x-A;if(A<=E){let e=o.length>0&&v===o[o.length-1].ref.current;s.style.bottom=`0px`;let t=u.clientHeight-g.offsetTop-g.offsetHeight,n=A+Math.max(D,O+(e?T:0)+t+_);s.style.height=n+`px`}else{let e=o.length>0&&v===o[0].ref.current;s.style.top=`0px`;let t=Math.max(E,f+g.offsetTop+(e?w:0)+O)+j;s.style.height=t+`px`,g.scrollTop=A-E+g.offsetTop}s.style.margin=`${X}px 0`,s.style.minHeight=S+`px`,s.style.maxHeight=c+`px`,r?.(),requestAnimationFrame(()=>m.current=!0)}},[p,a.trigger,a.valueNode,s,u,g,v,y,a.dir,r]);w(()=>x(),[x]);let[S,C]=M.useState();return w(()=>{u&&C(window.getComputedStyle(u).zIndex)},[u]),(0,F.jsx)(ye,{scope:n,contentWrapper:s,shouldExpandOnScrollRef:m,onScrollButtonChange:M.useCallback(e=>{e&&h.current===!0&&(x(),b?.(),h.current=!1)},[x,b]),children:(0,F.jsx)(`div`,{ref:c,style:{display:`flex`,flexDirection:`column`,position:`fixed`,zIndex:S},children:(0,F.jsx)(_.div,{...i,ref:f,style:{boxSizing:`border-box`,maxHeight:`100%`,...i.style}})})})});ge.displayName=he;var _e=`SelectPopperPosition`,ve=M.forwardRef((e,t)=>{let{__scopeSelect:n,align:r=`start`,collisionPadding:i=X,...a}=e,o=W(n);return(0,F.jsx)(A,{...o,...a,ref:t,align:r,collisionPadding:i,style:{boxSizing:`border-box`,...a.style,"--radix-select-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-select-content-available-width":`var(--radix-popper-available-width)`,"--radix-select-content-available-height":`var(--radix-popper-available-height)`,"--radix-select-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-select-trigger-height":`var(--radix-popper-anchor-height)`}})});ve.displayName=_e;var[ye,be]=H(Y,{}),xe=`SelectViewport`,Se=M.forwardRef((e,t)=>{let{__scopeSelect:n,nonce:r,...i}=e,a=Z(xe,n),o=be(xe,n),s=l(t,a.onViewportChange),u=M.useRef(0);return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`style`,{dangerouslySetInnerHTML:{__html:`[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}`},nonce:r}),(0,F.jsx)(z.Slot,{scope:n,children:(0,F.jsx)(_.div,{"data-radix-select-viewport":``,role:`presentation`,...i,ref:s,style:{position:`relative`,flex:1,overflow:`hidden auto`,...i.style},onScroll:c(i.onScroll,e=>{let t=e.currentTarget,{contentWrapper:n,shouldExpandOnScrollRef:r}=o;if(r?.current&&n){let e=Math.abs(u.current-t.scrollTop);if(e>0){let r=window.innerHeight-X*2,i=parseFloat(n.style.minHeight),a=parseFloat(n.style.height),o=Math.max(i,a);if(o<r){let i=o+e,a=Math.min(r,i),s=i-a;n.style.height=a+`px`,n.style.bottom===`0px`&&(t.scrollTop=s>0?s:0,n.style.justifyContent=`flex-end`)}}}u.current=t.scrollTop})})})]})});Se.displayName=xe;var Ce=`SelectGroup`,[we,Te]=H(Ce),Ee=M.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=d();return(0,F.jsx)(we,{scope:n,id:i,children:(0,F.jsx)(_.div,{role:`group`,"aria-labelledby":i,...r,ref:t})})});Ee.displayName=Ce;var De=`SelectLabel`,Oe=M.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=Te(De,n);return(0,F.jsx)(_.div,{id:i.id,...r,ref:t})});Oe.displayName=De;var Q=`SelectItem`,[ke,Ae]=H(Q),je=M.forwardRef((e,t)=>{let{__scopeSelect:n,value:r,disabled:i=!1,textValue:a,...o}=e,s=G(Q,n),u=Z(Q,n),f=s.value===r,[p,m]=M.useState(a??``),[h,g]=M.useState(!1),v=l(t,e=>u.itemRefCallback?.(e,r,i)),y=d(),b=M.useRef(`touch`),x=()=>{i||(s.onValueChange(r),s.onOpenChange(!1))};if(r===``)throw Error(`A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.`);return(0,F.jsx)(ke,{scope:n,value:r,disabled:i,textId:y,isSelected:f,onItemTextChange:M.useCallback(e=>{m(t=>t||(e?.textContent??``).trim())},[]),children:(0,F.jsx)(z.ItemSlot,{scope:n,value:r,disabled:i,textValue:p,children:(0,F.jsx)(_.div,{role:`option`,"aria-labelledby":y,"data-highlighted":h?``:void 0,"aria-selected":f&&h,"data-state":f?`checked`:`unchecked`,"aria-disabled":i||void 0,"data-disabled":i?``:void 0,tabIndex:i?void 0:-1,...o,ref:v,onFocus:c(o.onFocus,()=>g(!0)),onBlur:c(o.onBlur,()=>g(!1)),onClick:c(o.onClick,()=>{b.current!==`mouse`&&x()}),onPointerUp:c(o.onPointerUp,()=>{b.current===`mouse`&&x()}),onPointerDown:c(o.onPointerDown,e=>{b.current=e.pointerType}),onPointerMove:c(o.onPointerMove,e=>{b.current=e.pointerType,i?u.onItemLeave?.():b.current===`mouse`&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:c(o.onPointerLeave,e=>{e.currentTarget===document.activeElement&&u.onItemLeave?.()}),onKeyDown:c(o.onKeyDown,e=>{u.searchRef?.current!==``&&e.key===` `||(L.includes(e.key)&&x(),e.key===` `&&e.preventDefault())})})})})});je.displayName=Q;var $=`SelectItemText`,Me=M.forwardRef((e,t)=>{let{__scopeSelect:n,className:r,style:i,...a}=e,o=G($,n),s=Z($,n),c=Ae($,n),u=re($,n),[d,f]=M.useState(null),p=l(t,e=>f(e),c.onItemTextChange,e=>s.itemTextRefCallback?.(e,c.value,c.disabled)),m=d?.textContent,h=M.useMemo(()=>(0,F.jsx)(`option`,{value:c.value,disabled:c.disabled,children:m},c.value),[c.disabled,c.value,m]),{onNativeOptionAdd:g,onNativeOptionRemove:v}=u;return w(()=>(g(h),()=>v(h)),[g,v,h]),(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(_.span,{id:c.textId,...a,ref:p}),c.isSelected&&o.valueNode&&!o.valueNodeHasChildren?N.createPortal(a.children,o.valueNode):null]})});Me.displayName=$;var Ne=`SelectItemIndicator`,Pe=M.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e;return Ae(Ne,n).isSelected?(0,F.jsx)(_.span,{"aria-hidden":!0,...r,ref:t}):null});Pe.displayName=Ne;var Fe=`SelectScrollUpButton`,Ie=M.forwardRef((e,t)=>{let n=Z(Fe,e.__scopeSelect),r=be(Fe,e.__scopeSelect),[i,a]=M.useState(!1),o=l(t,r.onScrollButtonChange);return w(()=>{if(n.viewport&&n.isPositioned){let e=function(){a(t.scrollTop>0)},t=n.viewport;return e(),t.addEventListener(`scroll`,e),()=>t.removeEventListener(`scroll`,e)}},[n.viewport,n.isPositioned]),i?(0,F.jsx)(ze,{...e,ref:o,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop-=t.offsetHeight)}}):null});Ie.displayName=Fe;var Le=`SelectScrollDownButton`,Re=M.forwardRef((e,t)=>{let n=Z(Le,e.__scopeSelect),r=be(Le,e.__scopeSelect),[i,a]=M.useState(!1),o=l(t,r.onScrollButtonChange);return w(()=>{if(n.viewport&&n.isPositioned){let e=function(){let e=t.scrollHeight-t.clientHeight;a(Math.ceil(t.scrollTop)<e)},t=n.viewport;return e(),t.addEventListener(`scroll`,e),()=>t.removeEventListener(`scroll`,e)}},[n.viewport,n.isPositioned]),i?(0,F.jsx)(ze,{...e,ref:o,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop+=t.offsetHeight)}}):null});Re.displayName=Le;var ze=M.forwardRef((e,t)=>{let{__scopeSelect:n,onAutoScroll:r,...i}=e,a=Z(`SelectScrollButton`,n),o=M.useRef(null),s=B(n),l=M.useCallback(()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},[]);return M.useEffect(()=>()=>l(),[l]),w(()=>{s().find(e=>e.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:`nearest`})},[s]),(0,F.jsx)(_.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:c(i.onPointerDown,()=>{o.current===null&&(o.current=window.setInterval(r,50))}),onPointerMove:c(i.onPointerMove,()=>{a.onItemLeave?.(),o.current===null&&(o.current=window.setInterval(r,50))}),onPointerLeave:c(i.onPointerLeave,()=>{l()})})}),Be=`SelectSeparator`,Ve=M.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e;return(0,F.jsx)(_.div,{"aria-hidden":!0,...r,ref:t})});Ve.displayName=Be;var He=`SelectArrow`,Ue=M.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=W(n),a=G(He,n),o=Z(He,n);return a.open&&o.position===`popper`?(0,F.jsx)(D,{...i,...r,ref:t}):null});Ue.displayName=He;var We=`SelectBubbleInput`,Ge=M.forwardRef(({__scopeSelect:t,value:n,...r},i)=>{let a=M.useRef(null),o=l(i,a),s=e(n);return M.useEffect(()=>{let e=a.current;if(!e)return;let t=window.HTMLSelectElement.prototype,r=Object.getOwnPropertyDescriptor(t,`value`).set;if(s!==n&&r){let t=new Event(`change`,{bubbles:!0});r.call(e,n),e.dispatchEvent(t)}},[s,n]),(0,F.jsx)(_.select,{...r,style:{...h,...r.style},ref:o,defaultValue:n})});Ge.displayName=We;function Ke(e){return e===``||e===void 0}function qe(e){let t=v(e),n=M.useRef(``),r=M.useRef(0),i=M.useCallback(e=>{let i=n.current+e;t(i),(function e(t){n.current=t,window.clearTimeout(r.current),t!==``&&(r.current=window.setTimeout(()=>e(``),1e3))})(i)},[t]),a=M.useCallback(()=>{n.current=``,window.clearTimeout(r.current)},[]);return M.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,a]}function Je(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=Ye(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.textValue.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}function Ye(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Xe=K,Ze=J,Qe=ae,$e=se,et=le,tt=ue,nt=Se,rt=je,it=Me,at=Pe,ot=Ie,st=Re;function ct({...e}){return(0,F.jsx)(Xe,{"data-slot":`select`,...e})}function lt({...e}){return(0,F.jsx)(Qe,{"data-slot":`select-value`,...e})}function ut({className:e,size:t=`default`,children:n,...r}){return(0,F.jsxs)(Ze,{"data-slot":`select-trigger`,"data-size":t,className:f(`flex w-fit items-center justify-between gap-2 whitespace-nowrap rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-xs outline-none transition-[color,box-shadow] focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-[size=default]:h-9 data-[size=sm]:h-8 data-[placeholder]:text-muted-foreground *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 dark:bg-input/30 dark:aria-invalid:ring-destructive/40 dark:hover:bg-input/50 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0`,e),...r,children:[n,(0,F.jsx)($e,{asChild:!0,children:(0,F.jsx)(j,{className:`size-4 opacity-50`})})]})}function dt({className:e,children:t,position:n=`item-aligned`,align:r=`center`,...i}){return(0,F.jsx)(et,{children:(0,F.jsxs)(tt,{"data-slot":`select-content`,className:f(`data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-y-auto overflow-x-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=closed]:animate-out data-[state=open]:animate-in`,n===`popper`&&`data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=bottom]:translate-y-1 data-[side=top]:-translate-y-1`,e),position:n,align:r,...i,children:[(0,F.jsx)(pt,{}),(0,F.jsx)(nt,{className:f(`p-1`,n===`popper`&&`h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1`),children:t}),(0,F.jsx)(mt,{})]})})}function ft({className:e,children:n,...r}){return(0,F.jsxs)(rt,{"data-slot":`select-item`,className:f(`relative flex w-full cursor-default select-none items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2`,e),...r,children:[(0,F.jsx)(`span`,{"data-slot":`select-item-indicator`,className:`absolute right-2 flex size-3.5 items-center justify-center`,children:(0,F.jsx)(at,{children:(0,F.jsx)(t,{className:`size-4`})})}),(0,F.jsx)(it,{children:n})]})}function pt({className:e,...t}){return(0,F.jsx)(ot,{"data-slot":`select-scroll-up-button`,className:f(`flex cursor-default items-center justify-center py-1`,e),...t,children:(0,F.jsx)(ee,{className:`size-4`})})}function mt({className:e,...t}){return(0,F.jsx)(st,{"data-slot":`select-scroll-down-button`,className:f(`flex cursor-default items-center justify-center py-1`,e),...t,children:(0,F.jsx)(j,{className:`size-4`})})}export{lt as a,ut as i,dt as n,ft as r,ct as t};
@@ -1 +1 @@
1
- import{t as e}from"./checkbox-DXM4lkJq.js";import{U as t,dt as n,h as r}from"./index-DdJ7ahIt.js";import{t as i}from"./page-header-Dr_h1CVv.js";var a=n();function o(){let{settings:n,updateSetting:o}=r();return(0,a.jsxs)(`div`,{className:`space-y-6`,children:[(0,a.jsx)(i,{eyebrow:`Configuration`,subtitle:`Control how paths and usernames appear in transcript messages.`,title:`Settings`}),(0,a.jsxs)(`section`,{className:`rounded-[1.6rem] border border-[var(--border)] bg-[var(--panel)] p-5 shadow-[var(--panel-shadow)]`,children:[(0,a.jsxs)(`h3`,{className:`flex items-center gap-2 font-semibold text-[var(--muted-foreground)] text-xs uppercase tracking-[0.18em]`,children:[(0,a.jsx)(t,{className:`size-3.5`}),`Privacy`]}),(0,a.jsxs)(`div`,{className:`mt-5 space-y-5`,children:[(0,a.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,a.jsx)(e,{checked:n.redactUsername,id:`redact-username`,onCheckedChange:e=>o(`redactUsername`,e===!0)}),(0,a.jsxs)(`div`,{className:`min-w-0`,children:[(0,a.jsx)(`label`,{className:`cursor-pointer font-medium text-sm leading-none`,htmlFor:`redact-username`,children:`Redact Username`}),(0,a.jsxs)(`p`,{className:`mt-1.5 text-[var(--muted-foreground)] text-xs leading-5`,children:[`Replaces`,` `,(0,a.jsx)(`code`,{className:`rounded bg-[var(--code-background)] px-1 py-0.5 font-mono text-[var(--code-foreground)]`,children:`/Users/[username]/`}),` `,`with`,` `,(0,a.jsx)(`code`,{className:`rounded bg-[var(--code-background)] px-1 py-0.5 font-mono text-[var(--code-foreground)]`,children:`~/`}),` `,`in all transcript messages.`]})]})]}),(0,a.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,a.jsx)(e,{checked:n.convertToProjectRoot,id:`convert-project-root`,onCheckedChange:e=>o(`convertToProjectRoot`,e===!0)}),(0,a.jsxs)(`div`,{className:`min-w-0`,children:[(0,a.jsx)(`label`,{className:`cursor-pointer font-medium text-sm leading-none`,htmlFor:`convert-project-root`,children:`Convert Absolute Paths to Project Root`}),(0,a.jsxs)(`p`,{className:`mt-1.5 text-[var(--muted-foreground)] text-xs leading-5`,children:[`Converts the current thread or project cwd from`,` `,(0,a.jsx)(`code`,{className:`rounded bg-[var(--code-background)] px-1 py-0.5 font-mono text-[var(--code-foreground)]`,children:`/Users/[username]/workspace/[projectname]/`}),` `,`to project-root-relative paths, so`,` `,(0,a.jsx)(`code`,{className:`rounded bg-[var(--code-background)] px-1 py-0.5 font-mono text-[var(--code-foreground)]`,children:`/Users/jane/workspace/myapp/src/index.ts`}),` `,`appear as`,` `,(0,a.jsx)(`code`,{className:`rounded bg-[var(--code-background)] px-1 py-0.5 font-mono text-[var(--code-foreground)]`,children:`src/index.ts`}),`. If Redact Username is also enabled, remaining absolute paths outside the project root are redacted afterward.`]})]})]})]})]})]})}export{o as component};
1
+ import{t as e}from"./checkbox-DjHij7DJ.js";import{U as t,dt as n,h as r}from"./index-C_-e0lDI.js";import{t as i}from"./page-header-ODLuGLAB.js";var a=n();function o(){let{settings:n,updateSetting:o}=r();return(0,a.jsxs)(`div`,{className:`space-y-6`,children:[(0,a.jsx)(i,{eyebrow:`Configuration`,subtitle:`Control how paths and usernames appear in transcript messages.`,title:`Settings`}),(0,a.jsxs)(`section`,{className:`rounded-[1.6rem] border border-[var(--border)] bg-[var(--panel)] p-5 shadow-[var(--panel-shadow)]`,children:[(0,a.jsxs)(`h3`,{className:`flex items-center gap-2 font-semibold text-[var(--muted-foreground)] text-xs uppercase tracking-[0.18em]`,children:[(0,a.jsx)(t,{className:`size-3.5`}),`Privacy`]}),(0,a.jsxs)(`div`,{className:`mt-5 space-y-5`,children:[(0,a.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,a.jsx)(e,{checked:n.redactUsername,id:`redact-username`,onCheckedChange:e=>o(`redactUsername`,e===!0)}),(0,a.jsxs)(`div`,{className:`min-w-0`,children:[(0,a.jsx)(`label`,{className:`cursor-pointer font-medium text-sm leading-none`,htmlFor:`redact-username`,children:`Redact Username`}),(0,a.jsxs)(`p`,{className:`mt-1.5 text-[var(--muted-foreground)] text-xs leading-5`,children:[`Replaces`,` `,(0,a.jsx)(`code`,{className:`rounded bg-[var(--code-background)] px-1 py-0.5 font-mono text-[var(--code-foreground)]`,children:`/Users/[username]/`}),` `,`with`,` `,(0,a.jsx)(`code`,{className:`rounded bg-[var(--code-background)] px-1 py-0.5 font-mono text-[var(--code-foreground)]`,children:`~/`}),` `,`in all transcript messages.`]})]})]}),(0,a.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,a.jsx)(e,{checked:n.convertToProjectRoot,id:`convert-project-root`,onCheckedChange:e=>o(`convertToProjectRoot`,e===!0)}),(0,a.jsxs)(`div`,{className:`min-w-0`,children:[(0,a.jsx)(`label`,{className:`cursor-pointer font-medium text-sm leading-none`,htmlFor:`convert-project-root`,children:`Convert Absolute Paths to Project Root`}),(0,a.jsxs)(`p`,{className:`mt-1.5 text-[var(--muted-foreground)] text-xs leading-5`,children:[`Converts the current thread or project cwd from`,` `,(0,a.jsx)(`code`,{className:`rounded bg-[var(--code-background)] px-1 py-0.5 font-mono text-[var(--code-foreground)]`,children:`/Users/[username]/workspace/[projectname]/`}),` `,`to project-root-relative paths, so`,` `,(0,a.jsx)(`code`,{className:`rounded bg-[var(--code-background)] px-1 py-0.5 font-mono text-[var(--code-foreground)]`,children:`/Users/jane/workspace/myapp/src/index.ts`}),` `,`appear as`,` `,(0,a.jsx)(`code`,{className:`rounded bg-[var(--code-background)] px-1 py-0.5 font-mono text-[var(--code-foreground)]`,children:`src/index.ts`}),`. If Redact Username is also enabled, remaining absolute paths outside the project root are redacted afterward.`]})]})]})]})]})]})}export{o as component};
@@ -1 +1 @@
1
- import{dt as e}from"./index-DdJ7ahIt.js";var t=e();function n({error:e}){let n=e.message.includes(`unable to open database`)||e.message.includes(`database is locked`);return(0,t.jsxs)(`div`,{className:`rounded-xl border border-[var(--border)] bg-[var(--panel)] px-6 py-10 text-center`,children:[(0,t.jsx)(`p`,{className:`font-medium text-[var(--destructive)] text-sm`,children:n?`Database unavailable`:`Failed to load thread`}),(0,t.jsx)(`p`,{className:`mt-2 text-[var(--muted-foreground)] text-sm`,children:n?`Codex may have an exclusive lock on the database. Reload to retry.`:e.message}),(0,t.jsx)(`button`,{className:`mt-4 text-[var(--accent)] text-sm underline-offset-2 hover:underline`,type:`button`,onClick:()=>window.location.reload(),children:`Reload`})]})}export{n as errorComponent};
1
+ import{dt as e}from"./index-C_-e0lDI.js";var t=e();function n({error:e}){let n=e.message.includes(`unable to open database`)||e.message.includes(`database is locked`);return(0,t.jsxs)(`div`,{className:`rounded-xl border border-[var(--border)] bg-[var(--panel)] px-6 py-10 text-center`,children:[(0,t.jsx)(`p`,{className:`font-medium text-[var(--destructive)] text-sm`,children:n?`Database unavailable`:`Failed to load thread`}),(0,t.jsx)(`p`,{className:`mt-2 text-[var(--muted-foreground)] text-sm`,children:n?`Codex may have an exclusive lock on the database. Reload to retry.`:e.message}),(0,t.jsx)(`button`,{className:`mt-4 text-[var(--accent)] text-sm underline-offset-2 hover:underline`,type:`button`,onClick:()=>window.location.reload(),children:`Reload`})]})}export{n as errorComponent};