@qredence/fleet 0.7.1 → 0.7.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/dist/web/client/assets/{action-swap-roll-BfVrBOVd.js → action-swap-roll-Bek47h-E.js} +1 -1
- package/dist/web/client/assets/{alert-dialog-FCppNafx.js → alert-dialog-OoasP5iO.js} +1 -1
- package/dist/web/client/assets/{artifacts-panel-C69vz-oo.js → artifacts-panel-DVY0-7X0.js} +1 -1
- package/dist/web/client/assets/{badge-DOGhnsYk.js → badge-9wr3qUp1.js} +2 -2
- package/dist/web/client/assets/{button-BJyg7l5W.js → button-Bqms7ZKX.js} +1 -1
- package/dist/web/client/assets/{card-BScRdZNS.js → card-DPCbcrMK.js} +1 -1
- package/dist/web/client/assets/{chat-command-palette-wyZjTNa8.js → chat-command-palette-CXS5eTiy.js} +1 -1
- package/dist/web/client/assets/{citations-BhyqbxcZ.js → citations-C7USoVdz.js} +1 -1
- package/dist/web/client/assets/{command-Bo31U-UD.js → command-s2yLD3tA.js} +1 -1
- package/dist/web/client/assets/{create-project-dialog-SDyXTpl-.js → create-project-dialog-C99_Lyjg.js} +1 -1
- package/dist/web/client/assets/{dialog-DLIPvl1s.js → dialog-DuCD5hRq.js} +1 -1
- package/dist/web/client/assets/{ease-DKi-MOH5.js → ease-2gsl7ABx.js} +1 -1
- package/dist/web/client/assets/{fork-picker-dialog-BDleMADF.js → fork-picker-dialog--dV6TE-9.js} +1 -1
- package/dist/web/client/assets/globals-BXtzVIWE.css +2 -0
- package/dist/web/client/assets/{index-BARp0bjW.js → index-C2EkVtv5.js} +3 -3
- package/dist/web/client/assets/{input-Ce8yLnXY.js → input-DECT4vz2.js} +1 -1
- package/dist/web/client/assets/{input-group-BZLQiZOA.js → input-group-CZlz1ygA.js} +1 -1
- package/dist/web/client/assets/{ipython-tool-CuSGRhXl.js → ipython-tool-Bs6ESZe1.js} +1 -1
- package/dist/web/client/assets/{layout-constants-Bl6XCvhY.js → layout-constants-C4hoW3YP.js} +1 -1
- package/dist/web/client/assets/{markdown-yn-nhRzB.js → markdown-B2tpfUKu.js} +2 -2
- package/dist/web/client/assets/{markdown-code-DfJbKhL9.js → markdown-code-B5YUmtLX.js} +1 -1
- package/dist/web/client/assets/{message-queue-CiptKSb6.js → message-queue-BD2sIUTH.js} +1 -1
- package/dist/web/client/assets/{model-selector-list-BHQ-Q8b9.js → model-selector-list-zPZRE3JY.js} +1 -1
- package/dist/web/client/assets/{notify-BC0a76VJ.js → notify-mVA6z9Ly.js} +1 -1
- package/dist/web/client/assets/{openui-renderer-DrfHxs1t.js → openui-renderer-ByP8yQph.js} +1 -1
- package/dist/web/client/assets/{prompt-input-IwZOepG7.js → prompt-input-Bnl0HyL6.js} +1 -1
- package/dist/web/client/assets/{prompt-suggestions-BRFWFm5y.js → prompt-suggestions-DcgETXtw.js} +1 -1
- package/dist/web/client/assets/{provider-label-DNZOLldn.js → provider-label-COVNyoZo.js} +1 -1
- package/dist/web/client/assets/{repl-panel-UQN9UFG7.js → repl-panel-BoDNpJOe.js} +1 -1
- package/dist/web/client/assets/{resources-panel-kp_UjnpX.js → resources-panel-DD6iWOF3.js} +1 -1
- package/dist/web/client/assets/{right-panel-registry-CF7GLJrk.js → right-panel-registry-CIfLdAfS.js} +2 -2
- package/dist/web/client/assets/{routes-DCP1DP1g.js → routes-DO93P3Xm.js} +5 -5
- package/dist/web/client/assets/{select-COK0Kaq2.js → select-Dp15z1lf.js} +1 -1
- package/dist/web/client/assets/{session-reasoning-panel-DrTWp8d4.js → session-reasoning-panel-WMedZp__.js} +1 -1
- package/dist/web/client/assets/session-tool-renderer-BFC3-Md4.js +170 -0
- package/dist/web/client/assets/{session-tree-panel-deGRKAhX.js → session-tree-panel-CnHOsPzz.js} +1 -1
- package/dist/web/client/assets/{settings-dialog-BU1Tw0CQ.js → settings-dialog-BN138nzK.js} +1 -1
- package/dist/web/client/assets/{skeleton-D5Y9nBfp.js → skeleton-DNAr5ULI.js} +1 -1
- package/dist/web/client/assets/{skeleton-loaders-DOKGa7CW.js → skeleton-loaders-B28mF4tJ.js} +1 -1
- package/dist/web/client/assets/{spinner-C3sPnLdu.js → spinner-CSBXk3Lo.js} +1 -1
- package/dist/web/client/assets/{subagent-chat-panel-bVnkDkgs.js → subagent-chat-panel-DYKOKRPp.js} +1 -1
- package/dist/web/client/assets/subagent-transcript-BCUhqVvi.js +1 -0
- package/dist/web/client/assets/{subagent-utils-D7sXbLsS.js → subagent-utils-CM2qX9BG.js} +2 -2
- package/dist/web/client/assets/{subagents-panel-i5-12E1U.js → subagents-panel-CTvtU0Sh.js} +1 -1
- package/dist/web/client/assets/{surface-context-DWplCCcO.js → surface-context-VvasJf_6.js} +1 -1
- package/dist/web/client/assets/{surfaces-BULKVm-B.js → surfaces-m1vs5aMP.js} +1 -1
- package/dist/web/client/assets/{switch-DQETDDJT.js → switch-eqXIzePo.js} +1 -1
- package/dist/web/client/assets/{toast-BFeqSeaR.js → toast-DRDVljMF.js} +1 -1
- package/dist/web/client/assets/{tool-result-D7HtJ_yg.js → tool-result-DWUV8hEz.js} +1 -1
- package/dist/web/client/assets/{tool-timeline-B4ci1oJg.js → tool-timeline-4k2iSEky.js} +1 -1
- package/dist/web/client/assets/{use-reduced-motion-BgG7f9xw.js → use-reduced-motion-BzGFRmoG.js} +1 -1
- package/dist/web/client/assets/utils-CFDGLzf6.js +1 -0
- package/dist/web/client/assets/{workspace-panel-Clbmrdza.js → workspace-panel-BNeGABPi.js} +1 -1
- package/dist/web/client/assets/{workspace-path-nav-eVT0rYvv.js → workspace-path-nav-umvkE4ut.js} +2 -2
- package/dist/web/client/bundle-budget.json +5 -5
- package/dist/web/server/{_tanstack-start-manifest_v-CaT-3S-N-VAOGUHEJ.js → _tanstack-start-manifest_v-DTCFS0PG-ARV2V4FW.js} +26 -26
- package/dist/web/server/{artifacts-panel-BuAqeJzj-6DYYLKUW.js → artifacts-panel-Ct2R_4wM-DAPQMI57.js} +13 -13
- package/dist/web/server/{chat-command-palette-Ca8gXVi2-P6EOQ43G.js → chat-command-palette-ETZzg35Q-TAV74IAW.js} +8 -8
- package/dist/web/server/{chunk-5AYK2KDO.js → chunk-777VIBCH.js} +176 -176
- package/dist/web/server/{chunk-7VFULIHV.js → chunk-AAPVQJAD.js} +2 -2
- package/dist/web/server/{chunk-K4KN3QBT.js → chunk-BNB7T7P6.js} +2 -2
- package/dist/web/server/{chunk-E4YWFQX5.js → chunk-FFGFTGLQ.js} +415 -383
- package/dist/web/server/{chunk-GCDOYNXR.js → chunk-FL3FOWSC.js} +30 -30
- package/dist/web/server/{chunk-ITKXE2Q5.js → chunk-GS5F6X7H.js} +497 -234
- package/dist/web/server/{chunk-B7YWDA2F.js → chunk-INRE3X52.js} +2 -2
- package/dist/web/server/{chunk-35AFSKDX.js → chunk-JOCVZVZ3.js} +5 -5
- package/dist/web/server/{chunk-J4Y2Z3XM.js → chunk-JU7PCOE7.js} +4 -4
- package/dist/web/server/{chunk-UTV66W5H.js → chunk-KVW6XTN3.js} +14 -9
- package/dist/web/server/{chunk-NB3TVOGB.js → chunk-LECHJX4M.js} +483 -481
- package/dist/web/server/{chunk-JFAUSHBI.js → chunk-M6K66QBV.js} +6 -6
- package/dist/web/server/{chunk-COWE2EJ6.js → chunk-R7KUUFDW.js} +4 -4
- package/dist/web/server/chunk-SHNODG3C.js +18343 -0
- package/dist/web/server/{chunk-PXSOI3XF.js → chunk-SQXJ5TUB.js} +2 -2
- package/dist/web/server/{chunk-B5Y7XOIJ.js → chunk-TMQ3MT3D.js} +78 -17
- package/dist/web/server/{chunk-M7BTY55G.js → chunk-UWZYLMEH.js} +2 -2
- package/dist/web/server/{chunk-YIJ7D7G5.js → chunk-VTEYQNJE.js} +7 -7
- package/dist/web/server/{chunk-ABYOWAMD.js → chunk-X76RBZ37.js} +2 -2
- package/dist/web/server/{chunk-FPPKECLB.js → chunk-XMAAYUOT.js} +14 -14
- package/dist/web/server/{create-project-dialog-DCvdysey-IZUGGDAN.js → create-project-dialog-CqBmLTlA-X6HI6AYR.js} +9 -9
- package/dist/web/server/{dist-DVCLWOYT.js → dist-3UIQ7SZN.js} +2 -2
- package/dist/web/server/{dist-4A22NBTB.js → dist-ZPEDRNZ4.js} +2 -2
- package/dist/web/server/{fork-picker-dialog-QH00XmqX-6YLU5REF.js → fork-picker-dialog-PYNd9ozc-EA7BRLRR.js} +6 -6
- package/dist/web/server/{markdown-CShfYRVO-OKGCYPQK.js → markdown-CShfYRVO-22N5LNAN.js} +2 -2
- package/dist/web/server/{markdown-code-BDV_2b2T-VZGAECQB.js → markdown-code-BDV_2b2T-KUPHX52W.js} +2 -2
- package/dist/web/server/{message-queue-BzEFQR8k-2W53EW32.js → message-queue-DmSFAI5Y-XDZHJ2Z6.js} +6 -6
- package/dist/web/server/{model-selector-list-BjoXmw92-TEKBPB3E.js → model-selector-list-C-Y3p5UM-HTSWVVHP.js} +8 -8
- package/dist/web/server/{openui-renderer-CJ7Q2zZ_-FPXKZPSO.js → openui-renderer-C4B1EJxC-QDYQF5LD.js} +10 -10
- package/dist/web/server/{prompt-suggestions-EqAaAx6L-723M64XJ.js → prompt-suggestions-EqAaAx6L-B4KCWNZX.js} +1 -1
- package/dist/web/server/{repl-panel-DOyUyuQR-IMYO4FKX.js → repl-panel-DOyUyuQR-LRBDRMHW.js} +3 -3
- package/dist/web/server/{resources-panel-yVB4xF_K-OHFHXVU4.js → resources-panel-Bo-TmRON-O47AKGEQ.js} +7 -7
- package/dist/web/server/{router-UgU5vJxm-R33FGTXY.js → router-DtS2wXhd-I2SZV7YF.js} +5 -5
- package/dist/web/server/{routes-Cbbo-jh9-ZUPH4SJD.js → routes-DuSYlASY-U7C32ONE.js} +5 -5
- package/dist/web/server/server.js +3 -3
- package/dist/web/server/{session-reasoning-panel-C50VbaQ8-4YLMVVY6.js → session-reasoning-panel-BFcZs1pZ-KNHSU5GX.js} +7 -7
- package/dist/web/server/{session-tool-renderer-QcAkYD-V-6RXRKDH6.js → session-tool-renderer-TiFeeJEc-YUZPEEZ4.js} +9 -9
- package/dist/web/server/{session-tree-panel-CL49XSTK-4ZPK6AIV.js → session-tree-panel-CjsqVYLY-DGZBGY2E.js} +6 -6
- package/dist/web/server/{settings-dialog-DG9HEZeP-TWDRDGMN.js → settings-dialog-Bj5LrAE8-6BQRLUJT.js} +10 -10
- package/dist/web/server/{start-DEejK9Uj-FODAOTAO.js → start-cCC--AXu-BBMIT6OU.js} +1 -1
- package/dist/web/server/{subagent-chat-panel-Cg2CxshI-WWGFHTIF.js → subagent-chat-panel-DAS4Ne-1-TWIUXSQC.js} +12 -12
- package/dist/web/server/{subagents-panel-aC3Eo-MR-RNIPLCZQ.js → subagents-panel-C3CdUcqw-DFTJTPHA.js} +12 -12
- package/dist/web/server/{tool-timeline-C4dgQITK-CFWANSDL.js → tool-timeline-C4dgQITK-IWCLQLWG.js} +3 -3
- package/dist/web/server/{workspace-panel-DfdFkgHU-6HIOXRBX.js → workspace-panel-DNs0Ye2U-VFB6X5PK.js} +7 -7
- package/package.json +4 -4
- package/dist/web/client/assets/globals-DZbMyHfg.css +0 -2
- package/dist/web/client/assets/session-tool-renderer-Yu4G1165.js +0 -1389
- package/dist/web/client/assets/subagent-transcript-D_L-8PQi.js +0 -1
- package/dist/web/client/assets/utils-Dpy9ZFOr.js +0 -1
- package/dist/web/server/chunk-PHHC52CO.js +0 -38412
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e,t}from"./rolldown-runtime-hePW80VL.js";import{t as n}from"./react-Cvdyeg_0.js";import{t as r}from"./react-dom-B7th3XGm.js";import{t as i}from"./jsx-runtime-NZYk81nU.js";import{t as a}from"./utils-Dpy9ZFOr.js";import{F as o,G as s,J as c,K as l,P as u,T as d,X as f,_ as p,at as m,ct as h,et as g,it as _,rt as v,st as y,t as b,tt as x,x as S,z as C}from"./createBaseUIEventDetails-DklXWq23.js";import{t as w}from"./dist-BogNzeK9.js";var T=t((e=>{var t=n();function r(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:r,a=t.useState,o=t.useEffect,s=t.useLayoutEffect,c=t.useDebugValue;function l(e,t){var n=t(),r=a({inst:{value:n,getSnapshot:t}}),i=r[0].inst,l=r[1];return s(function(){i.value=n,i.getSnapshot=t,u(i)&&l({inst:i})},[e,n,t]),o(function(){return u(i)&&l({inst:i}),e(function(){u(i)&&l({inst:i})})},[e]),c(n),n}function u(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!i(e,n)}catch{return!0}}function d(e,t){return t()}var f=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?d:l;e.useSyncExternalStore=t.useSyncExternalStore===void 0?f:t.useSyncExternalStore})),E=t(((e,t)=>{t.exports=T()})),ee=t((e=>{var t=n(),r=E();function i(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var a=typeof Object.is==`function`?Object.is:i,o=r.useSyncExternalStore,s=t.useRef,c=t.useEffect,l=t.useMemo,u=t.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var d=s(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=l(function(){function e(e){if(!o){if(o=!0,s=e,e=r(e),i!==void 0&&f.hasValue){var t=f.value;if(i(t,e))return c=t}return c=e}if(t=c,a(s,e))return t;var n=r(e);return i!==void 0&&i(t,n)?(s=e,t):(s=e,c=n)}var o=!1,s,c,l=n===void 0?null:n;return[function(){return e(t())},l===null?void 0:function(){return e(l())}]},[t,n,r,i]);var p=o(e,d[0],d[1]);return c(function(){f.hasValue=!0,f.value=p},[p]),u(p),p}})),te=t(((e,t)=>{t.exports=ee()})),ne=E(),re=e(te(),1),D=e(n(),1),O=[],k=void 0;function ie(){return k}function ae(e){O.push(e)}function A(e){let t=(t,n)=>{let r=_(se).current,i;try{k=r;for(let e of O)e.before(r);i=e(t,n);for(let e of O)e.after(r);r.didInitialize=!0}finally{k=void 0}return i};return t.displayName=e.displayName||e.name,t}function oe(e){return D.forwardRef(A(e))}function se(){return{didInitialize:!1}}var ce=x(19)?ue:de;function j(e,t,n,r,i){return ce(e,t,n,r,i)}function le(e,t,n,r,i){let a=D.useCallback(()=>t(e.getSnapshot(),n,r,i),[e,t,n,r,i]);return(0,ne.useSyncExternalStore)(e.subscribe,a,a)}ae({before(e){e.syncIndex=0,e.didInitialize||(e.syncTick=1,e.syncHooks=[],e.didChangeStore=!0,e.getSnapshot=()=>{let t=!1;for(let n=0;n<e.syncHooks.length;n+=1){let r=e.syncHooks[n],i=r.selector(r.store.state,r.a1,r.a2,r.a3);Object.is(r.value,i)||(t=!0,r.value=i)}return t&&(e.syncTick+=1),e.syncTick})},after(e){e.syncHooks.length>0&&(e.didChangeStore&&(e.didChangeStore=!1,e.subscribe=t=>{let n=new Set;for(let t of e.syncHooks)n.add(t.store);let r=[];for(let e of n)r.push(e.subscribe(t));return()=>{for(let e of r)e()}}),(0,ne.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getSnapshot))}});function ue(e,t,n,r,i){let a=ie();if(!a)return le(e,t,n,r,i);let o=a.syncIndex;a.syncIndex+=1;let s;return a.didInitialize?(s=a.syncHooks[o],(s.store!==e||s.selector!==t||!Object.is(s.a1,n)||!Object.is(s.a2,r)||!Object.is(s.a3,i))&&(s.store!==e&&(a.didChangeStore=!0),s.store=e,s.selector=t,s.a1=n,s.a2=r,s.a3=i,s.value=t(e.getSnapshot(),n,r,i))):(s={store:e,selector:t,a1:n,a2:r,a3:i,value:t(e.getSnapshot(),n,r,i)},a.syncHooks.push(s)),s.value}function de(e,t,n,r,i){return(0,re.useSyncExternalStoreWithSelector)(e.subscribe,e.getSnapshot,e.getSnapshot,e=>t(e,n,r,i))}var fe=class{static create(e){return new this(e)}constructor(e){this.state=e,this.listeners=new Set,this.updateTick=0}subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)});getSnapshot=()=>this.state;setState(e){if(this.state===e)return;this.state=e,this.updateTick+=1;let t=this.updateTick;for(let n of this.listeners){if(t!==this.updateTick)return;n(e)}}update(e){for(let t in e)if(!Object.is(this.state[t],e[t])){this.setState({...this.state,...e});return}}set(e,t){Object.is(this.state[e],t)||this.setState({...this.state,[e]:t})}notifyAll(){let e={...this.state};this.setState(e)}use(e,t,n,r){return j(this,e,t,n,r)}},pe=class extends fe{constructor(e,t={},n){super(e),this.context=t,this.selectors=n}useSyncedValue(e,t){D.useDebugValue(e);let n=this;v(()=>{n.state[e]!==t&&n.set(e,t)},[n,e,t])}useSyncedValueWithCleanup(e,t){let n=this;v(()=>(n.state[e]!==t&&n.set(e,t),()=>{n.set(e,void 0)}),[n,e,t])}useSyncedValues(e){let t=this,n=Object.values(e);v(()=>{t.update(e)},[t,...n])}useControlledProp(e,t){D.useDebugValue(e);let n=this,r=t!==void 0;v(()=>{r&&!Object.is(n.state[e],t)&&n.setState({...n.state,[e]:t})},[n,e,t,r])}select(e,t,n,r){let i=this.selectors[e];return i(this.state,t,n,r)}useState(e,t,n,r){return D.useDebugValue(e),j(this,this.selectors[e],t,n,r)}useContextCallback(e,t){D.useDebugValue(e);let n=g(t??h);this.context[e]=n}useStateSetter(e){let t=D.useRef(void 0);return t.current===void 0&&(t.current=t=>{this.set(e,t)}),t.current}observe(e,t){let n;n=typeof e==`function`?e:this.selectors[e];let r=n(this.state);return t(r,r,this),this.subscribe(e=>{let i=n(e);if(!Object.is(r,i)){let e=r;r=i,t(i,e,this)}})}},me=e(r(),1);function M(...e){return()=>{for(let t=0;t<e.length;t+=1){let n=e[t];n&&n()}}}var N=i();function P(e){return e?.ownerDocument||document}var F=0,he=class e{static create(){return new e}currentId=F;start(e,t){this.clear(),this.currentId=setTimeout(()=>{this.currentId=F,t()},e)}isStarted(){return this.currentId!==F}clear=()=>{this.currentId!==F&&(clearTimeout(this.currentId),this.currentId=F)};disposeEffect=()=>this.clear};function ge(){let e=_(he.create).current;return m(e.disposeEffect),e}function _e(){return typeof navigator>`u`?{userAgent:``,platform:``,maxTouchPoints:0}:{userAgent:navigator.userAgent,platform:navigator.platform??``,maxTouchPoints:navigator.maxTouchPoints??0}}var{userAgent:ve,platform:ye,maxTouchPoints:be}=_e(),I=ve.toLowerCase(),L=ye.toLowerCase(),R=/^i(os$|p)/.test(L)||L===`macintel`&&be>1,z=`android`,xe=L===z||I.includes(z),Se=!R&&L.startsWith(`mac`);L.startsWith(`win`),!xe&&/^(linux|chrome os)/.test(L);var Ce=Se||R,B=typeof CSS<`u`&&!!CSS.supports?.(`-webkit-backdrop-filter:none`);!B&&I.includes(`firefox`),!B&&I.includes(`chrom`);var we=Ce,Te=/jsdom|happydom/.test(I);function Ee(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function V(e,t){if(!e||!t)return!1;let n=t.getRootNode?.();if(e.contains(t))return!0;if(n&&f(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function De(e){return`composedPath`in e?e.composedPath()[0]??e.target:e.target}var Oe=`data-base-ui-focusable`,ke=`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`,Ae=`ArrowLeft`,je=`ArrowRight`,Me=`ArrowUp`,Ne=`ArrowDown`,Pe=`data-popup-open`,Fe=`data-pressed`,H=`data-trigger-disabled`;function Ie(e,t){if(!s(e))return!1;let n=e;if(t.hasElement(n))return!n.hasAttribute(H);for(let[,e]of t.entries())if(V(e,n))return!e.hasAttribute(H);return!1}function Le(e,t){if(t==null)return!1;if(`composedPath`in e)return e.composedPath().includes(t);let n=e;return n.target!=null&&t.contains(n.target)}function Re(e){return e.matches(`html,body`)}function U(e){return l(e)&&e.matches(`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`)}function ze(e){return e?.closest(`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${ke}`)!=null}function Be(e){return e?e.getAttribute(`role`)===`combobox`&&U(e):!1}function Ve(e){if(!e||Te)return!0;try{return e.matches(`:focus-visible`)}catch{return!0}}function He(e){return e?e.hasAttribute(`data-base-ui-focusable`)?e:e.querySelector(`[data-base-ui-focusable]`)||e:null}function Ue(e,t){return t<0||t>=e.length}function We(e,t){return W(e.current,{disabledIndices:t})}function Ge(e,t){return W(e.current,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function W(e,{startingIndex:t=-1,decrement:n=!1,disabledIndices:r,amount:i=1}={}){let a=t;do a+=n?-i:i;while(a>=0&&a<=e.length-1&&G(e,a,r));return a}function G(e,t,n){if(typeof n==`function`?n(t):n?.includes(t)??!1)return!0;let r=e[t];return r?!K(r)||r.matches(`:disabled`)?!0:!n&&(r.hasAttribute(`disabled`)||r.getAttribute(`aria-disabled`)===`true`):!1}function Ke(e){return e.visibility===`hidden`||e.visibility===`collapse`}function K(e,t=e?o(e):null){return!e||!e.isConnected||!t||Ke(t)?!1:typeof e.checkVisibility==`function`?e.checkVisibility():t.display!==`none`&&t.display!==`contents`}var qe=`a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]`;function Je(e){let t=e.assignedSlot;if(t)return t;if(e.parentElement)return e.parentElement;let n=e.getRootNode();return f(n)?n.host:null}function q(e){for(let t of Array.from(e.children))if(C(t)===`summary`)return t;return null}function Ye(e,t){let n=q(t);return!!n&&(e===n||V(n,e))}function J(e){let t=e?C(e):``;return e!=null&&e.matches(qe)&&(t!==`summary`||e.parentElement!=null&&C(e.parentElement)===`details`&&q(e.parentElement)===e)&&(t!==`details`||q(e)==null)&&(t!==`input`||e.type!==`hidden`)}function Xe(e){if(!J(e)||!e.isConnected||e.matches(`:disabled`))return!1;for(let t=e;t;t=Je(t)){let n=t!==e,r=C(t)===`slot`;if(t.hasAttribute(`inert`)||n&&C(t)===`details`&&!t.open&&!Ye(e,t)||t.hasAttribute(`hidden`)||!r&&!Ze(t,n))return!1}return!0}function Ze(e,t){let n=o(e);return t?n.display!==`none`:K(e,n)}function Qe(e){let t=e.tabIndex;if(t<0){let t=C(e);if(t===`details`||t===`audio`||t===`video`||l(e)&&e.isContentEditable)return 0}return t}function Y(e){if(C(e)!==`input`)return null;let t=e;return t.type===`radio`&&t.name!==``?t:null}function $e(e,t){let n=Y(e);if(!n)return!0;let r=t.find(e=>{let t=Y(e);return t?.name===n.name&&t.form===n.form&&t.checked});return r?r===n:t.find(e=>{let t=Y(e);return t?.name===n.name&&t.form===n.form})===n}function et(e){if(l(e)&&C(e)===`slot`){let t=e.assignedElements({flatten:!0});if(t.length>0)return t}return l(e)&&e.shadowRoot?Array.from(e.shadowRoot.children):Array.from(e.children)}function tt(e,t){et(e).forEach(e=>{J(e)&&t.push(e),tt(e,t)})}function nt(e,t,n){et(e).forEach(e=>{l(e)&&e.matches(t)&&n.push(e),nt(e,t,n)})}function rt(e){return Xe(e)&&Qe(e)>=0}function it(e){let t=[];return tt(e,t),t.filter(Xe)}function X(e){let t=it(e);return t.filter(e=>Qe(e)>=0&&$e(e,t))}function at(e,t){let n=X(e),r=n.length;if(r===0)return;let i=Ee(P(e)),a=n.indexOf(i);return n[a===-1?t===1?0:r-1:a+t]}function ot(e){return at(P(e).body,1)||e}function st(e){return at(P(e).body,-1)||e}function ct(e,t){if(!e)return null;let n=X(P(e).body),r=n.length;if(r===0)return null;let i=n.indexOf(e);return i===-1?null:n[(i+t+r)%r]}function lt(e){return ct(e,1)}function ut(e){return ct(e,-1)}function Z(e,t){let n=t||e.currentTarget,r=e.relatedTarget;return!r||!V(n,r)}function dt(e){X(e).forEach(e=>{e.dataset.tabindex=e.getAttribute(`tabindex`)||``,e.setAttribute(`tabindex`,`-1`)})}function ft(e){let t=[];nt(e,`[data-tabindex]`,t),t.forEach(e=>{let t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute(`tabindex`,t):e.removeAttribute(`tabindex`)})}var pt={clipPath:`inset(50%)`,overflow:`hidden`,whiteSpace:`nowrap`,border:0,padding:0,width:1,height:1,margin:-1},mt={...pt,position:`fixed`,top:0,left:0},ht={...pt,position:`absolute`},Q=D.forwardRef(function(e,t){let[n,r]=D.useState();v(()=>{we&&B&&r(`button`)},[]);let i={tabIndex:0,role:n};return(0,N.jsx)(`span`,{...e,ref:t,style:mt,"aria-hidden":!n||void 0,...i,"data-base-ui-focus-guard":``})});function gt(e){return x(19)?e:e?`true`:void 0}var _t={style:{transition:`none`}},vt=`data-base-ui-click-trigger`,yt=`data-base-ui-swipe-ignore`,bt=`data-swipe-ignore`,xt=`[${yt}]`,St=`[${bt}]`,Ct={fallbackAxisSide:`none`},wt={fallbackAxisSide:`end`},Tt={clipPath:`inset(50%)`,position:`fixed`,top:0,left:0};function $(e){return`data-base-ui-${e}`}var Et=D.createContext(null),Dt=()=>D.useContext(Et),Ot=$(`portal`);function kt(e={}){let{ref:t,container:n,componentProps:r=y,elementProps:i}=e,a=S(),o=Dt()?.portalNode,[s,l]=D.useState(null),[u,f]=D.useState(null),p=g(e=>{e!==null&&f(e)}),m=D.useRef(null);v(()=>{if(n===null){m.current&&(m.current=null,f(null),l(null));return}let e=(n&&(c(n)?n:n.current))??o??document.body;if(e==null){m.current&&(m.current=null,f(null),l(null));return}m.current!==e&&(m.current=e,f(null),l(e))},[n,o]);let h=d(`div`,r,{ref:[t,p],props:[{id:a,[Ot]:``},i]}),_=s&&h?me.createPortal(h,s):null;return{node:u,nodeId:D.isValidElement(h)?h.props.id:void 0,subtree:_}}var At=D.forwardRef(function(e,t){let{render:n,className:r,style:i,children:a,container:o,portalOwnerRole:s,...c}=e,{node:l,nodeId:d,subtree:f}=kt({container:o,ref:t,componentProps:e,elementProps:c}),p=D.useRef(null),m=D.useRef(null),h=D.useRef(null),g=D.useRef(null),[_,y]=D.useState(null),x=D.useRef(!1),S=_?.modal,C=_?.open,w=!!_&&!_.modal&&_.open&&!!l;D.useEffect(()=>{if(!l||S)return;function e(e){l&&e.relatedTarget&&Z(e)&&(e.type===`focusin`?x.current&&=(ft(l),!1):(dt(l),x.current=!0))}return M(u(l,`focusin`,e,!0),u(l,`focusout`,e,!0))},[l,S]),v(()=>{!l||C!==!0||!x.current||(ft(l),x.current=!1)},[C,l]);let T=D.useMemo(()=>({beforeOutsideRef:p,afterOutsideRef:m,beforeInsideRef:h,afterInsideRef:g,portalNode:l,setFocusManagerState:y}),[l]);return(0,N.jsxs)(D.Fragment,{children:[f,(0,N.jsxs)(Et.Provider,{value:T,children:[w&&l&&(0,N.jsx)(Q,{"data-type":`outside`,ref:p,onFocus:e=>{Z(e,l)?h.current?.focus():st(_?_.domReference:null)?.focus()}}),w&&l&&(0,N.jsx)(`span`,{role:s,"aria-owns":d,style:Tt}),l&&me.createPortal(a,l),w&&l&&(0,N.jsx)(Q,{"data-type":`outside`,ref:m,onFocus:e=>{Z(e,l)?g.current?.focus():(ot(_?_.domReference:null)?.focus(),_?.closeOnFocusOut&&_?.onOpenChange(!1,b(`focus-out`,e.nativeEvent)))}})]})]})}),jt=D.forwardRef(function(e,t){let{render:n,className:r,disabled:i=!1,focusableWhenDisabled:a=!1,nativeButton:o=!0,style:s,...c}=e,{getButtonProps:l,buttonRef:u}=p({disabled:i,focusableWhenDisabled:a,native:o});return d(`button`,e,{state:{disabled:i},ref:[t,u],props:[c,l]})}),Mt={pill:{variant:`pill`,item:`rounded-[20px]`,bg:`rounded-[20px]`,focusRing:`rounded-[22px]`,mergedBg:`rounded-2xl`,container:`rounded-3xl`,button:`rounded-[20px]`,input:`rounded-[20px]`,bgRadius:20,mergedRadius:16},rounded:{variant:`rounded`,item:`rounded-lg`,bg:`rounded-lg`,focusRing:`rounded-[10px]`,mergedBg:`rounded-lg`,container:`rounded-xl`,button:`rounded-lg`,input:`rounded-lg`,bgRadius:8,mergedRadius:8}},Nt=(0,D.createContext)(null);function Pt(){let e=(0,D.useContext)(Nt);return e?e.classes:Mt.rounded}var Ft=(0,D.createContext)(null);function It(e){let t=(0,D.useContext)(Ft);return e??t?.size??`default`}var Lt=w([`group relative isolate inline-flex items-center justify-center outline-none cursor-pointer`,`transition-colors duration-80`,`disabled:opacity-50 disabled:pointer-events-none`,`focus-visible:ring-1 focus-visible:ring-[color:var(--focus-ring,#6B97FF)]`],{variants:{variant:{default:`text-background`,primary:`text-background`,secondary:`text-foreground`,tertiary:`text-foreground`,outline:`text-foreground`,ghost:`text-muted-foreground hover:text-foreground`,destructive:`text-destructive`,link:`text-primary underline-offset-4 hover:underline`},size:{default:`h-9 px-4 text-[13px] gap-1.5 [&_svg:not([class*='size-'])]:size-4`,compact:`h-7 px-3 text-[12px] gap-1 [&_svg:not([class*='size-'])]:size-3.5`,icon:`h-9 w-9 p-0 [&_svg]:h-4 [&_svg]:w-4`,"icon-compact":`h-7 w-7 p-0 [&_svg]:h-3.5 [&_svg]:w-3.5`},iconLeft:{true:``},iconRight:{true:``}},compoundVariants:[{size:`compact`,iconLeft:!0,className:`pl-2`},{size:`default`,iconLeft:!0,className:`pl-3`},{size:`compact`,iconRight:!0,className:`pr-2`},{size:`default`,iconRight:!0,className:`pr-3`}],defaultVariants:{variant:`primary`,size:`default`}}),Rt={xs:`compact`,sm:`compact`,md:`default`,lg:`default`,"icon-xs":`icon-compact`,"icon-sm":`icon-compact`,"icon-lg":`icon`},zt={default:`[--btn-bg:var(--foreground)] group-hover:[--btn-bg:color-mix(in_oklab,var(--foreground)_90%,var(--background))] group-active:[--btn-bg:color-mix(in_oklab,var(--foreground)_80%,var(--background))] bg-[var(--btn-bg)] shadow-[0_0_0_1px_var(--btn-bg)] group-active:shadow-[0_0_0_0px_var(--btn-bg)]`,primary:`[--btn-bg:var(--foreground)] group-hover:[--btn-bg:color-mix(in_oklab,var(--foreground)_90%,var(--background))] group-active:[--btn-bg:color-mix(in_oklab,var(--foreground)_80%,var(--background))] bg-[var(--btn-bg)] shadow-[0_0_0_1px_var(--btn-bg)] group-active:shadow-[0_0_0_0px_var(--btn-bg)]`,secondary:`[--btn-bg:var(--accent)] group-hover:[--btn-bg:color-mix(in_oklab,var(--accent)_80%,var(--background))] group-active:[--btn-bg:var(--accent)] bg-[var(--btn-bg)] shadow-[0_0_0_1px_var(--btn-bg)] group-active:shadow-[0_0_0_0px_var(--btn-bg)]`,tertiary:`bg-transparent shadow-[0_0_0_1px_var(--border),inset_0_0_0_0px_var(--border)] group-hover:bg-hover group-active:bg-active group-active:shadow-[0_0_0_0px_var(--border),inset_0_0_0_1px_var(--border)]`,outline:`bg-transparent shadow-[0_0_0_1px_var(--border),inset_0_0_0_0px_var(--border)] group-hover:bg-hover group-active:bg-active group-active:shadow-[0_0_0_0px_var(--border),inset_0_0_0_1px_var(--border)]`,ghost:`bg-transparent shadow-[0_0_0_1px_transparent] group-hover:bg-hover group-hover:shadow-[0_0_0_1px_var(--hover)] group-active:bg-active group-active:shadow-[0_0_0_0px_var(--active)]`,destructive:`[--btn-bg:var(--destructive-light,#450A0A)] group-hover:[--btn-bg:color-mix(in_oklab,var(--destructive-light,#450A0A)_80%,var(--background))] group-active:[--btn-bg:var(--destructive-light,#450A0A)] bg-[var(--btn-bg)] shadow-[0_0_0_1px_var(--border)]`,link:`bg-transparent shadow-none`},Bt={default:`[--btn-bg:color-mix(in_oklab,var(--foreground)_80%,var(--background))] bg-[var(--btn-bg)] shadow-[0_0_0_1px_var(--btn-bg)] group-active:shadow-[0_0_0_0px_var(--btn-bg)]`,primary:`[--btn-bg:color-mix(in_oklab,var(--foreground)_80%,var(--background))] bg-[var(--btn-bg)] shadow-[0_0_0_1px_var(--btn-bg)] group-active:shadow-[0_0_0_0px_var(--btn-bg)]`,secondary:`[--btn-bg:var(--accent)] bg-[var(--btn-bg)] shadow-[0_0_0_1px_var(--btn-bg)] group-active:shadow-[0_0_0_0px_var(--btn-bg)]`,tertiary:`bg-active shadow-[0_0_0_1px_var(--border),inset_0_0_0_0px_var(--border)] group-active:shadow-[0_0_0_0px_var(--border),inset_0_0_0_1px_var(--border)]`,outline:`bg-active shadow-[0_0_0_1px_var(--border),inset_0_0_0_0px_var(--border)] group-active:shadow-[0_0_0_0px_var(--border),inset_0_0_0_1px_var(--border)]`,ghost:`bg-active shadow-[0_0_0_1px_var(--active)] group-active:shadow-[0_0_0_0px_var(--active)]`,destructive:`bg-active shadow-[0_0_0_1px_var(--border)]`,link:`bg-transparent shadow-none`},Vt=(0,D.forwardRef)(({className:e,variant:t,size:n,asChild:r=!1,loading:i=!1,leadingIcon:o,trailingIcon:s,active:c=!1,disabled:l,children:u,style:d,...f},p)=>{let m=r&&(0,D.isValidElement)(u)?u:null,h=m?m.props.children:u,g=It(),_=n?Rt[n]??n:g===`compact`?`compact`:`default`,v=_===`icon`||_===`icon-compact`,y=_===`compact`||_===`icon-compact`,b=y?14:16,x=y?`h-7 w-7`:`h-9 w-9`,S=Pt(),C=c?Bt[t??`primary`]:zt[t??`primary`],w=(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(`span`,{"aria-hidden":!0,className:a(`absolute inset-px rounded-[inherit] transition-[box-shadow,background-color] [transition-duration:180ms,80ms] [transition-timing-function:cubic-bezier(0.23,1,0.32,1),ease] group-active:[transition-duration:80ms,80ms]`,C)}),(0,N.jsx)(`span`,{className:`relative inline-flex items-center justify-center gap-[inherit]`,children:i?(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)(`span`,{className:`flex items-center justify-center gap-[inherit] opacity-0`,children:[o&&!v&&(0,N.jsx)(o,{size:b,strokeWidth:2}),h,s&&!v&&(0,N.jsx)(s,{size:b,strokeWidth:2})]}),(0,N.jsx)(`span`,{className:`absolute inset-0 flex items-center justify-center`,children:(0,N.jsx)(`svg`,{className:x,viewBox:`0 0 24 24`,fill:`none`,children:(0,N.jsx)(`path`,{d:`M 12 12 C 14 8.5 19 8.5 19 12 C 19 15.5 14 15.5 12 12 C 10 8.5 5 8.5 5 12 C 5 15.5 10 15.5 12 12 Z`,stroke:`currentColor`,strokeWidth:`1.125`,strokeLinecap:`round`,pathLength:`100`,style:{strokeDasharray:`15 85`,animation:`spinner-move 2s linear infinite, spinner-dash 4s ease-in-out infinite`}})})})]}):v?(0,N.jsx)(`span`,{className:`[&_svg]:stroke-[1.5] [&_svg]:transition-[stroke-width] [&_svg]:duration-80 group-hover:[&_svg]:stroke-[2]`,children:h}):(0,N.jsxs)(N.Fragment,{children:[o&&(0,N.jsx)(o,{size:b,strokeWidth:1.5,className:`transition-[stroke-width] duration-80 group-hover:stroke-[2]`}),(0,N.jsx)(`span`,{className:`inline-flex items-center gap-[inherit] [text-box:trim-both_cap_alphabetic] [&_svg]:shrink-0`,children:h}),s&&(0,N.jsx)(s,{size:b,strokeWidth:1.5,className:`transition-[stroke-width] duration-80 group-hover:stroke-[2]`})]})})]}),T=a(Lt({variant:t,size:_,iconLeft:!v&&!!o,iconRight:!v&&!!s}),S.button,e);if(m){let e=m.props,t={...f};for(let n of Object.keys(f)){if(!/^on[A-Z]/.test(n))continue;let r=f[n],i=e[n];typeof r==`function`&&typeof i==`function`&&(t[n]=e=>{i(e),e.defaultPrevented||r(e)})}return(0,D.cloneElement)(m,{...t,ref:p,"data-slot":`button`,className:a(T,e.className),style:{...d,...e.style}},w)}return(0,N.jsx)(jt,{ref:p,"data-slot":`button`,className:T,disabled:l||i,style:d,...f,children:w})});Vt.displayName=`Button`;export{he as $,G as A,Fe as B,rt as C,We as D,Ge as E,Ie as F,Oe as G,Ae as H,Be as I,De as J,Ee as K,U as L,Le as M,ze as N,K as O,Re as P,R as Q,Ve as R,Z as S,W as T,je as U,Ne as V,Me as W,B as X,Te as Y,xe as Z,it as _,Dt as a,oe as at,lt as b,vt as c,St as d,ge as et,wt as f,ht as g,mt as h,kt as i,A as it,He as j,Ue as k,_t as l,Q as m,Pt as n,M as nt,$ as o,te as ot,gt as p,V as q,At as r,pe as rt,xt as s,E as st,Vt as t,P as tt,Ct as u,ot as v,X as w,ut as x,st as y,Pe as z};
|
|
1
|
+
import{r as e,t}from"./rolldown-runtime-hePW80VL.js";import{t as n}from"./react-Cvdyeg_0.js";import{t as r}from"./react-dom-B7th3XGm.js";import{t as i}from"./jsx-runtime-NZYk81nU.js";import{t as a}from"./utils-CFDGLzf6.js";import{F as o,G as s,J as c,K as l,P as u,T as d,X as f,_ as p,at as m,ct as h,et as g,it as _,rt as v,st as y,t as b,tt as x,x as S,z as C}from"./createBaseUIEventDetails-DklXWq23.js";import{t as w}from"./dist-BogNzeK9.js";var T=t((e=>{var t=n();function r(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:r,a=t.useState,o=t.useEffect,s=t.useLayoutEffect,c=t.useDebugValue;function l(e,t){var n=t(),r=a({inst:{value:n,getSnapshot:t}}),i=r[0].inst,l=r[1];return s(function(){i.value=n,i.getSnapshot=t,u(i)&&l({inst:i})},[e,n,t]),o(function(){return u(i)&&l({inst:i}),e(function(){u(i)&&l({inst:i})})},[e]),c(n),n}function u(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!i(e,n)}catch{return!0}}function d(e,t){return t()}var f=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?d:l;e.useSyncExternalStore=t.useSyncExternalStore===void 0?f:t.useSyncExternalStore})),E=t(((e,t)=>{t.exports=T()})),ee=t((e=>{var t=n(),r=E();function i(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var a=typeof Object.is==`function`?Object.is:i,o=r.useSyncExternalStore,s=t.useRef,c=t.useEffect,l=t.useMemo,u=t.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var d=s(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=l(function(){function e(e){if(!o){if(o=!0,s=e,e=r(e),i!==void 0&&f.hasValue){var t=f.value;if(i(t,e))return c=t}return c=e}if(t=c,a(s,e))return t;var n=r(e);return i!==void 0&&i(t,n)?(s=e,t):(s=e,c=n)}var o=!1,s,c,l=n===void 0?null:n;return[function(){return e(t())},l===null?void 0:function(){return e(l())}]},[t,n,r,i]);var p=o(e,d[0],d[1]);return c(function(){f.hasValue=!0,f.value=p},[p]),u(p),p}})),te=t(((e,t)=>{t.exports=ee()})),ne=E(),re=e(te(),1),D=e(n(),1),O=[],k=void 0;function ie(){return k}function ae(e){O.push(e)}function A(e){let t=(t,n)=>{let r=_(se).current,i;try{k=r;for(let e of O)e.before(r);i=e(t,n);for(let e of O)e.after(r);r.didInitialize=!0}finally{k=void 0}return i};return t.displayName=e.displayName||e.name,t}function oe(e){return D.forwardRef(A(e))}function se(){return{didInitialize:!1}}var ce=x(19)?ue:de;function j(e,t,n,r,i){return ce(e,t,n,r,i)}function le(e,t,n,r,i){let a=D.useCallback(()=>t(e.getSnapshot(),n,r,i),[e,t,n,r,i]);return(0,ne.useSyncExternalStore)(e.subscribe,a,a)}ae({before(e){e.syncIndex=0,e.didInitialize||(e.syncTick=1,e.syncHooks=[],e.didChangeStore=!0,e.getSnapshot=()=>{let t=!1;for(let n=0;n<e.syncHooks.length;n+=1){let r=e.syncHooks[n],i=r.selector(r.store.state,r.a1,r.a2,r.a3);Object.is(r.value,i)||(t=!0,r.value=i)}return t&&(e.syncTick+=1),e.syncTick})},after(e){e.syncHooks.length>0&&(e.didChangeStore&&(e.didChangeStore=!1,e.subscribe=t=>{let n=new Set;for(let t of e.syncHooks)n.add(t.store);let r=[];for(let e of n)r.push(e.subscribe(t));return()=>{for(let e of r)e()}}),(0,ne.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getSnapshot))}});function ue(e,t,n,r,i){let a=ie();if(!a)return le(e,t,n,r,i);let o=a.syncIndex;a.syncIndex+=1;let s;return a.didInitialize?(s=a.syncHooks[o],(s.store!==e||s.selector!==t||!Object.is(s.a1,n)||!Object.is(s.a2,r)||!Object.is(s.a3,i))&&(s.store!==e&&(a.didChangeStore=!0),s.store=e,s.selector=t,s.a1=n,s.a2=r,s.a3=i,s.value=t(e.getSnapshot(),n,r,i))):(s={store:e,selector:t,a1:n,a2:r,a3:i,value:t(e.getSnapshot(),n,r,i)},a.syncHooks.push(s)),s.value}function de(e,t,n,r,i){return(0,re.useSyncExternalStoreWithSelector)(e.subscribe,e.getSnapshot,e.getSnapshot,e=>t(e,n,r,i))}var fe=class{static create(e){return new this(e)}constructor(e){this.state=e,this.listeners=new Set,this.updateTick=0}subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)});getSnapshot=()=>this.state;setState(e){if(this.state===e)return;this.state=e,this.updateTick+=1;let t=this.updateTick;for(let n of this.listeners){if(t!==this.updateTick)return;n(e)}}update(e){for(let t in e)if(!Object.is(this.state[t],e[t])){this.setState({...this.state,...e});return}}set(e,t){Object.is(this.state[e],t)||this.setState({...this.state,[e]:t})}notifyAll(){let e={...this.state};this.setState(e)}use(e,t,n,r){return j(this,e,t,n,r)}},pe=class extends fe{constructor(e,t={},n){super(e),this.context=t,this.selectors=n}useSyncedValue(e,t){D.useDebugValue(e);let n=this;v(()=>{n.state[e]!==t&&n.set(e,t)},[n,e,t])}useSyncedValueWithCleanup(e,t){let n=this;v(()=>(n.state[e]!==t&&n.set(e,t),()=>{n.set(e,void 0)}),[n,e,t])}useSyncedValues(e){let t=this,n=Object.values(e);v(()=>{t.update(e)},[t,...n])}useControlledProp(e,t){D.useDebugValue(e);let n=this,r=t!==void 0;v(()=>{r&&!Object.is(n.state[e],t)&&n.setState({...n.state,[e]:t})},[n,e,t,r])}select(e,t,n,r){let i=this.selectors[e];return i(this.state,t,n,r)}useState(e,t,n,r){return D.useDebugValue(e),j(this,this.selectors[e],t,n,r)}useContextCallback(e,t){D.useDebugValue(e);let n=g(t??h);this.context[e]=n}useStateSetter(e){let t=D.useRef(void 0);return t.current===void 0&&(t.current=t=>{this.set(e,t)}),t.current}observe(e,t){let n;n=typeof e==`function`?e:this.selectors[e];let r=n(this.state);return t(r,r,this),this.subscribe(e=>{let i=n(e);if(!Object.is(r,i)){let e=r;r=i,t(i,e,this)}})}},me=e(r(),1);function M(...e){return()=>{for(let t=0;t<e.length;t+=1){let n=e[t];n&&n()}}}var N=i();function P(e){return e?.ownerDocument||document}var F=0,he=class e{static create(){return new e}currentId=F;start(e,t){this.clear(),this.currentId=setTimeout(()=>{this.currentId=F,t()},e)}isStarted(){return this.currentId!==F}clear=()=>{this.currentId!==F&&(clearTimeout(this.currentId),this.currentId=F)};disposeEffect=()=>this.clear};function ge(){let e=_(he.create).current;return m(e.disposeEffect),e}function _e(){return typeof navigator>`u`?{userAgent:``,platform:``,maxTouchPoints:0}:{userAgent:navigator.userAgent,platform:navigator.platform??``,maxTouchPoints:navigator.maxTouchPoints??0}}var{userAgent:ve,platform:ye,maxTouchPoints:be}=_e(),I=ve.toLowerCase(),L=ye.toLowerCase(),R=/^i(os$|p)/.test(L)||L===`macintel`&&be>1,z=`android`,xe=L===z||I.includes(z),Se=!R&&L.startsWith(`mac`);L.startsWith(`win`),!xe&&/^(linux|chrome os)/.test(L);var Ce=Se||R,B=typeof CSS<`u`&&!!CSS.supports?.(`-webkit-backdrop-filter:none`);!B&&I.includes(`firefox`),!B&&I.includes(`chrom`);var we=Ce,Te=/jsdom|happydom/.test(I);function Ee(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function V(e,t){if(!e||!t)return!1;let n=t.getRootNode?.();if(e.contains(t))return!0;if(n&&f(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function De(e){return`composedPath`in e?e.composedPath()[0]??e.target:e.target}var Oe=`data-base-ui-focusable`,ke=`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`,Ae=`ArrowLeft`,je=`ArrowRight`,Me=`ArrowUp`,Ne=`ArrowDown`,Pe=`data-popup-open`,Fe=`data-pressed`,H=`data-trigger-disabled`;function Ie(e,t){if(!s(e))return!1;let n=e;if(t.hasElement(n))return!n.hasAttribute(H);for(let[,e]of t.entries())if(V(e,n))return!e.hasAttribute(H);return!1}function Le(e,t){if(t==null)return!1;if(`composedPath`in e)return e.composedPath().includes(t);let n=e;return n.target!=null&&t.contains(n.target)}function Re(e){return e.matches(`html,body`)}function U(e){return l(e)&&e.matches(`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`)}function ze(e){return e?.closest(`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${ke}`)!=null}function Be(e){return e?e.getAttribute(`role`)===`combobox`&&U(e):!1}function Ve(e){if(!e||Te)return!0;try{return e.matches(`:focus-visible`)}catch{return!0}}function He(e){return e?e.hasAttribute(`data-base-ui-focusable`)?e:e.querySelector(`[data-base-ui-focusable]`)||e:null}function Ue(e,t){return t<0||t>=e.length}function We(e,t){return W(e.current,{disabledIndices:t})}function Ge(e,t){return W(e.current,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function W(e,{startingIndex:t=-1,decrement:n=!1,disabledIndices:r,amount:i=1}={}){let a=t;do a+=n?-i:i;while(a>=0&&a<=e.length-1&&G(e,a,r));return a}function G(e,t,n){if(typeof n==`function`?n(t):n?.includes(t)??!1)return!0;let r=e[t];return r?!K(r)||r.matches(`:disabled`)?!0:!n&&(r.hasAttribute(`disabled`)||r.getAttribute(`aria-disabled`)===`true`):!1}function Ke(e){return e.visibility===`hidden`||e.visibility===`collapse`}function K(e,t=e?o(e):null){return!e||!e.isConnected||!t||Ke(t)?!1:typeof e.checkVisibility==`function`?e.checkVisibility():t.display!==`none`&&t.display!==`contents`}var qe=`a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]`;function Je(e){let t=e.assignedSlot;if(t)return t;if(e.parentElement)return e.parentElement;let n=e.getRootNode();return f(n)?n.host:null}function q(e){for(let t of Array.from(e.children))if(C(t)===`summary`)return t;return null}function Ye(e,t){let n=q(t);return!!n&&(e===n||V(n,e))}function J(e){let t=e?C(e):``;return e!=null&&e.matches(qe)&&(t!==`summary`||e.parentElement!=null&&C(e.parentElement)===`details`&&q(e.parentElement)===e)&&(t!==`details`||q(e)==null)&&(t!==`input`||e.type!==`hidden`)}function Xe(e){if(!J(e)||!e.isConnected||e.matches(`:disabled`))return!1;for(let t=e;t;t=Je(t)){let n=t!==e,r=C(t)===`slot`;if(t.hasAttribute(`inert`)||n&&C(t)===`details`&&!t.open&&!Ye(e,t)||t.hasAttribute(`hidden`)||!r&&!Ze(t,n))return!1}return!0}function Ze(e,t){let n=o(e);return t?n.display!==`none`:K(e,n)}function Qe(e){let t=e.tabIndex;if(t<0){let t=C(e);if(t===`details`||t===`audio`||t===`video`||l(e)&&e.isContentEditable)return 0}return t}function Y(e){if(C(e)!==`input`)return null;let t=e;return t.type===`radio`&&t.name!==``?t:null}function $e(e,t){let n=Y(e);if(!n)return!0;let r=t.find(e=>{let t=Y(e);return t?.name===n.name&&t.form===n.form&&t.checked});return r?r===n:t.find(e=>{let t=Y(e);return t?.name===n.name&&t.form===n.form})===n}function et(e){if(l(e)&&C(e)===`slot`){let t=e.assignedElements({flatten:!0});if(t.length>0)return t}return l(e)&&e.shadowRoot?Array.from(e.shadowRoot.children):Array.from(e.children)}function tt(e,t){et(e).forEach(e=>{J(e)&&t.push(e),tt(e,t)})}function nt(e,t,n){et(e).forEach(e=>{l(e)&&e.matches(t)&&n.push(e),nt(e,t,n)})}function rt(e){return Xe(e)&&Qe(e)>=0}function it(e){let t=[];return tt(e,t),t.filter(Xe)}function X(e){let t=it(e);return t.filter(e=>Qe(e)>=0&&$e(e,t))}function at(e,t){let n=X(e),r=n.length;if(r===0)return;let i=Ee(P(e)),a=n.indexOf(i);return n[a===-1?t===1?0:r-1:a+t]}function ot(e){return at(P(e).body,1)||e}function st(e){return at(P(e).body,-1)||e}function ct(e,t){if(!e)return null;let n=X(P(e).body),r=n.length;if(r===0)return null;let i=n.indexOf(e);return i===-1?null:n[(i+t+r)%r]}function lt(e){return ct(e,1)}function ut(e){return ct(e,-1)}function Z(e,t){let n=t||e.currentTarget,r=e.relatedTarget;return!r||!V(n,r)}function dt(e){X(e).forEach(e=>{e.dataset.tabindex=e.getAttribute(`tabindex`)||``,e.setAttribute(`tabindex`,`-1`)})}function ft(e){let t=[];nt(e,`[data-tabindex]`,t),t.forEach(e=>{let t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute(`tabindex`,t):e.removeAttribute(`tabindex`)})}var pt={clipPath:`inset(50%)`,overflow:`hidden`,whiteSpace:`nowrap`,border:0,padding:0,width:1,height:1,margin:-1},mt={...pt,position:`fixed`,top:0,left:0},ht={...pt,position:`absolute`},Q=D.forwardRef(function(e,t){let[n,r]=D.useState();v(()=>{we&&B&&r(`button`)},[]);let i={tabIndex:0,role:n};return(0,N.jsx)(`span`,{...e,ref:t,style:mt,"aria-hidden":!n||void 0,...i,"data-base-ui-focus-guard":``})});function gt(e){return x(19)?e:e?`true`:void 0}var _t={style:{transition:`none`}},vt=`data-base-ui-click-trigger`,yt=`data-base-ui-swipe-ignore`,bt=`data-swipe-ignore`,xt=`[${yt}]`,St=`[${bt}]`,Ct={fallbackAxisSide:`none`},wt={fallbackAxisSide:`end`},Tt={clipPath:`inset(50%)`,position:`fixed`,top:0,left:0};function $(e){return`data-base-ui-${e}`}var Et=D.createContext(null),Dt=()=>D.useContext(Et),Ot=$(`portal`);function kt(e={}){let{ref:t,container:n,componentProps:r=y,elementProps:i}=e,a=S(),o=Dt()?.portalNode,[s,l]=D.useState(null),[u,f]=D.useState(null),p=g(e=>{e!==null&&f(e)}),m=D.useRef(null);v(()=>{if(n===null){m.current&&(m.current=null,f(null),l(null));return}let e=(n&&(c(n)?n:n.current))??o??document.body;if(e==null){m.current&&(m.current=null,f(null),l(null));return}m.current!==e&&(m.current=e,f(null),l(e))},[n,o]);let h=d(`div`,r,{ref:[t,p],props:[{id:a,[Ot]:``},i]}),_=s&&h?me.createPortal(h,s):null;return{node:u,nodeId:D.isValidElement(h)?h.props.id:void 0,subtree:_}}var At=D.forwardRef(function(e,t){let{render:n,className:r,style:i,children:a,container:o,portalOwnerRole:s,...c}=e,{node:l,nodeId:d,subtree:f}=kt({container:o,ref:t,componentProps:e,elementProps:c}),p=D.useRef(null),m=D.useRef(null),h=D.useRef(null),g=D.useRef(null),[_,y]=D.useState(null),x=D.useRef(!1),S=_?.modal,C=_?.open,w=!!_&&!_.modal&&_.open&&!!l;D.useEffect(()=>{if(!l||S)return;function e(e){l&&e.relatedTarget&&Z(e)&&(e.type===`focusin`?x.current&&=(ft(l),!1):(dt(l),x.current=!0))}return M(u(l,`focusin`,e,!0),u(l,`focusout`,e,!0))},[l,S]),v(()=>{!l||C!==!0||!x.current||(ft(l),x.current=!1)},[C,l]);let T=D.useMemo(()=>({beforeOutsideRef:p,afterOutsideRef:m,beforeInsideRef:h,afterInsideRef:g,portalNode:l,setFocusManagerState:y}),[l]);return(0,N.jsxs)(D.Fragment,{children:[f,(0,N.jsxs)(Et.Provider,{value:T,children:[w&&l&&(0,N.jsx)(Q,{"data-type":`outside`,ref:p,onFocus:e=>{Z(e,l)?h.current?.focus():st(_?_.domReference:null)?.focus()}}),w&&l&&(0,N.jsx)(`span`,{role:s,"aria-owns":d,style:Tt}),l&&me.createPortal(a,l),w&&l&&(0,N.jsx)(Q,{"data-type":`outside`,ref:m,onFocus:e=>{Z(e,l)?g.current?.focus():(ot(_?_.domReference:null)?.focus(),_?.closeOnFocusOut&&_?.onOpenChange(!1,b(`focus-out`,e.nativeEvent)))}})]})]})}),jt=D.forwardRef(function(e,t){let{render:n,className:r,disabled:i=!1,focusableWhenDisabled:a=!1,nativeButton:o=!0,style:s,...c}=e,{getButtonProps:l,buttonRef:u}=p({disabled:i,focusableWhenDisabled:a,native:o});return d(`button`,e,{state:{disabled:i},ref:[t,u],props:[c,l]})}),Mt={pill:{variant:`pill`,item:`rounded-[20px]`,bg:`rounded-[20px]`,focusRing:`rounded-[22px]`,mergedBg:`rounded-2xl`,container:`rounded-3xl`,button:`rounded-[20px]`,input:`rounded-[20px]`,bgRadius:20,mergedRadius:16},rounded:{variant:`rounded`,item:`rounded-lg`,bg:`rounded-lg`,focusRing:`rounded-[10px]`,mergedBg:`rounded-lg`,container:`rounded-xl`,button:`rounded-lg`,input:`rounded-lg`,bgRadius:8,mergedRadius:8}},Nt=(0,D.createContext)(null);function Pt(){let e=(0,D.useContext)(Nt);return e?e.classes:Mt.rounded}var Ft=(0,D.createContext)(null);function It(e){let t=(0,D.useContext)(Ft);return e??t?.size??`default`}var Lt=w([`group relative isolate inline-flex items-center justify-center outline-none cursor-pointer`,`transition-colors duration-80`,`disabled:opacity-50 disabled:pointer-events-none`,`focus-visible:ring-1 focus-visible:ring-[color:var(--focus-ring,#6B97FF)]`],{variants:{variant:{default:`text-background`,primary:`text-background`,secondary:`text-foreground`,tertiary:`text-foreground`,outline:`text-foreground`,ghost:`text-muted-foreground hover:text-foreground`,destructive:`text-destructive`,link:`text-primary underline-offset-4 hover:underline`},size:{default:`h-9 px-4 text-[13px] gap-1.5 [&_svg:not([class*='size-'])]:size-4`,compact:`h-7 px-3 text-[12px] gap-1 [&_svg:not([class*='size-'])]:size-3.5`,icon:`h-9 w-9 p-0 [&_svg]:h-4 [&_svg]:w-4`,"icon-compact":`h-7 w-7 p-0 [&_svg]:h-3.5 [&_svg]:w-3.5`},iconLeft:{true:``},iconRight:{true:``}},compoundVariants:[{size:`compact`,iconLeft:!0,className:`pl-2`},{size:`default`,iconLeft:!0,className:`pl-3`},{size:`compact`,iconRight:!0,className:`pr-2`},{size:`default`,iconRight:!0,className:`pr-3`}],defaultVariants:{variant:`primary`,size:`default`}}),Rt={xs:`compact`,sm:`compact`,md:`default`,lg:`default`,"icon-xs":`icon-compact`,"icon-sm":`icon-compact`,"icon-lg":`icon`},zt={default:`[--btn-bg:var(--foreground)] group-hover:[--btn-bg:color-mix(in_oklab,var(--foreground)_90%,var(--background))] group-active:[--btn-bg:color-mix(in_oklab,var(--foreground)_80%,var(--background))] bg-[var(--btn-bg)] shadow-[0_0_0_1px_var(--btn-bg)] group-active:shadow-[0_0_0_0px_var(--btn-bg)]`,primary:`[--btn-bg:var(--foreground)] group-hover:[--btn-bg:color-mix(in_oklab,var(--foreground)_90%,var(--background))] group-active:[--btn-bg:color-mix(in_oklab,var(--foreground)_80%,var(--background))] bg-[var(--btn-bg)] shadow-[0_0_0_1px_var(--btn-bg)] group-active:shadow-[0_0_0_0px_var(--btn-bg)]`,secondary:`[--btn-bg:var(--accent)] group-hover:[--btn-bg:color-mix(in_oklab,var(--accent)_80%,var(--background))] group-active:[--btn-bg:var(--accent)] bg-[var(--btn-bg)] shadow-[0_0_0_1px_var(--btn-bg)] group-active:shadow-[0_0_0_0px_var(--btn-bg)]`,tertiary:`bg-transparent shadow-[0_0_0_1px_var(--border),inset_0_0_0_0px_var(--border)] group-hover:bg-hover group-active:bg-active group-active:shadow-[0_0_0_0px_var(--border),inset_0_0_0_1px_var(--border)]`,outline:`bg-transparent shadow-[0_0_0_1px_var(--border),inset_0_0_0_0px_var(--border)] group-hover:bg-hover group-active:bg-active group-active:shadow-[0_0_0_0px_var(--border),inset_0_0_0_1px_var(--border)]`,ghost:`bg-transparent shadow-[0_0_0_1px_transparent] group-hover:bg-hover group-hover:shadow-[0_0_0_1px_var(--hover)] group-active:bg-active group-active:shadow-[0_0_0_0px_var(--active)]`,destructive:`[--btn-bg:var(--destructive-light,#450A0A)] group-hover:[--btn-bg:color-mix(in_oklab,var(--destructive-light,#450A0A)_80%,var(--background))] group-active:[--btn-bg:var(--destructive-light,#450A0A)] bg-[var(--btn-bg)] shadow-[0_0_0_1px_var(--border)]`,link:`bg-transparent shadow-none`},Bt={default:`[--btn-bg:color-mix(in_oklab,var(--foreground)_80%,var(--background))] bg-[var(--btn-bg)] shadow-[0_0_0_1px_var(--btn-bg)] group-active:shadow-[0_0_0_0px_var(--btn-bg)]`,primary:`[--btn-bg:color-mix(in_oklab,var(--foreground)_80%,var(--background))] bg-[var(--btn-bg)] shadow-[0_0_0_1px_var(--btn-bg)] group-active:shadow-[0_0_0_0px_var(--btn-bg)]`,secondary:`[--btn-bg:var(--accent)] bg-[var(--btn-bg)] shadow-[0_0_0_1px_var(--btn-bg)] group-active:shadow-[0_0_0_0px_var(--btn-bg)]`,tertiary:`bg-active shadow-[0_0_0_1px_var(--border),inset_0_0_0_0px_var(--border)] group-active:shadow-[0_0_0_0px_var(--border),inset_0_0_0_1px_var(--border)]`,outline:`bg-active shadow-[0_0_0_1px_var(--border),inset_0_0_0_0px_var(--border)] group-active:shadow-[0_0_0_0px_var(--border),inset_0_0_0_1px_var(--border)]`,ghost:`bg-active shadow-[0_0_0_1px_var(--active)] group-active:shadow-[0_0_0_0px_var(--active)]`,destructive:`bg-active shadow-[0_0_0_1px_var(--border)]`,link:`bg-transparent shadow-none`},Vt=(0,D.forwardRef)(({className:e,variant:t,size:n,asChild:r=!1,loading:i=!1,leadingIcon:o,trailingIcon:s,active:c=!1,disabled:l,children:u,style:d,...f},p)=>{let m=r&&(0,D.isValidElement)(u)?u:null,h=m?m.props.children:u,g=It(),_=n?Rt[n]??n:g===`compact`?`compact`:`default`,v=_===`icon`||_===`icon-compact`,y=_===`compact`||_===`icon-compact`,b=y?14:16,x=y?`h-7 w-7`:`h-9 w-9`,S=Pt(),C=c?Bt[t??`primary`]:zt[t??`primary`],w=(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(`span`,{"aria-hidden":!0,className:a(`absolute inset-px rounded-[inherit] transition-[box-shadow,background-color] [transition-duration:180ms,80ms] [transition-timing-function:cubic-bezier(0.23,1,0.32,1),ease] group-active:[transition-duration:80ms,80ms]`,C)}),(0,N.jsx)(`span`,{className:`relative inline-flex items-center justify-center gap-[inherit]`,children:i?(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)(`span`,{className:`flex items-center justify-center gap-[inherit] opacity-0`,children:[o&&!v&&(0,N.jsx)(o,{size:b,strokeWidth:2}),h,s&&!v&&(0,N.jsx)(s,{size:b,strokeWidth:2})]}),(0,N.jsx)(`span`,{className:`absolute inset-0 flex items-center justify-center`,children:(0,N.jsx)(`svg`,{className:x,viewBox:`0 0 24 24`,fill:`none`,children:(0,N.jsx)(`path`,{d:`M 12 12 C 14 8.5 19 8.5 19 12 C 19 15.5 14 15.5 12 12 C 10 8.5 5 8.5 5 12 C 5 15.5 10 15.5 12 12 Z`,stroke:`currentColor`,strokeWidth:`1.125`,strokeLinecap:`round`,pathLength:`100`,style:{strokeDasharray:`15 85`,animation:`spinner-move 2s linear infinite, spinner-dash 4s ease-in-out infinite`}})})})]}):v?(0,N.jsx)(`span`,{className:`[&_svg]:stroke-[1.5] [&_svg]:transition-[stroke-width] [&_svg]:duration-80 group-hover:[&_svg]:stroke-[2]`,children:h}):(0,N.jsxs)(N.Fragment,{children:[o&&(0,N.jsx)(o,{size:b,strokeWidth:1.5,className:`transition-[stroke-width] duration-80 group-hover:stroke-[2]`}),(0,N.jsx)(`span`,{className:`inline-flex items-center gap-[inherit] [text-box:trim-both_cap_alphabetic] [&_svg]:shrink-0`,children:h}),s&&(0,N.jsx)(s,{size:b,strokeWidth:1.5,className:`transition-[stroke-width] duration-80 group-hover:stroke-[2]`})]})})]}),T=a(Lt({variant:t,size:_,iconLeft:!v&&!!o,iconRight:!v&&!!s}),S.button,e);if(m){let e=m.props,t={...f};for(let n of Object.keys(f)){if(!/^on[A-Z]/.test(n))continue;let r=f[n],i=e[n];typeof r==`function`&&typeof i==`function`&&(t[n]=e=>{i(e),e.defaultPrevented||r(e)})}return(0,D.cloneElement)(m,{...t,ref:p,"data-slot":`button`,className:a(T,e.className),style:{...d,...e.style}},w)}return(0,N.jsx)(jt,{ref:p,"data-slot":`button`,className:T,disabled:l||i,style:d,...f,children:w})});Vt.displayName=`Button`;export{he as $,G as A,Fe as B,rt as C,We as D,Ge as E,Ie as F,Oe as G,Ae as H,Be as I,De as J,Ee as K,U as L,Le as M,ze as N,K as O,Re as P,R as Q,Ve as R,Z as S,W as T,je as U,Ne as V,Me as W,B as X,Te as Y,xe as Z,it as _,Dt as a,oe as at,lt as b,vt as c,St as d,ge as et,wt as f,ht as g,mt as h,kt as i,A as it,He as j,Ue as k,_t as l,Q as m,Pt as n,M as nt,$ as o,te as ot,gt as p,V as q,At as r,pe as rt,xt as s,E as st,Vt as t,P as tt,Ct as u,ot as v,X as w,ut as x,st as y,Pe as z};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./jsx-runtime-NZYk81nU.js";import{t}from"./utils-
|
|
1
|
+
import{t as e}from"./jsx-runtime-NZYk81nU.js";import{t}from"./utils-CFDGLzf6.js";var n=e();function r({className:e,size:r=`default`,...i}){return(0,n.jsx)(`div`,{"data-slot":`card`,"data-size":r,className:t(`group/card flex flex-col gap-4 overflow-hidden rounded-xl bg-card py-4 text-sm text-card-foreground ring-1 ring-foreground/10 has-data-[slot=card-footer]:pb-0 has-[>img:first-child]:pt-0 data-[size=sm]:gap-3 data-[size=sm]:py-3 data-[size=sm]:has-data-[slot=card-footer]:pb-0 *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl`,e),...i})}function i({className:e,...r}){return(0,n.jsx)(`div`,{"data-slot":`card-header`,className:t(`group/card-header @container/card-header grid auto-rows-min items-start gap-1 rounded-t-xl px-4 group-data-[size=sm]/card:px-3 has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] [.border-b]:pb-4 group-data-[size=sm]/card:[.border-b]:pb-3`,e),...r})}function a({className:e,...r}){return(0,n.jsx)(`div`,{"data-slot":`card-title`,className:t(`font-heading text-base leading-snug font-medium group-data-[size=sm]/card:text-sm`,e),...r})}function o({className:e,...r}){return(0,n.jsx)(`div`,{"data-slot":`card-description`,className:t(`text-sm text-muted-foreground`,e),...r})}function s({className:e,...r}){return(0,n.jsx)(`div`,{"data-slot":`card-content`,className:t(`px-4 group-data-[size=sm]/card:px-3`,e),...r})}export{a,i,s as n,o as r,r as t};
|
package/dist/web/client/assets/{chat-command-palette-wyZjTNa8.js → chat-command-palette-CXS5eTiy.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{t}from"./react-Cvdyeg_0.js";import{t as n}from"./jsx-runtime-NZYk81nU.js";import{t as r}from"./createLucideIcon-CQY2ECfR.js";import{t as i}from"./right-panel-registry-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{t}from"./react-Cvdyeg_0.js";import{t as n}from"./jsx-runtime-NZYk81nU.js";import{t as r}from"./createLucideIcon-CQY2ECfR.js";import{t as i}from"./right-panel-registry-CIfLdAfS.js";import{i as a,n as o,r as s,t as c}from"./sun-C7zg8Oas.js";import{a as l}from"./right-panel-context-DHKWoetk.js";import{t as u}from"./square-BbTF3gLc.js";import{a as d,c as f,i as p,n as m,o as h,r as g,s as _}from"./command-s2yLD3tA.js";var v={name:`rotate-ccw-clock`,size:24,node:[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}],[`path`,{d:`M12 7v5l4 2`,key:`1fdv2h`}]],aliases:[`history`]};v.node;var y=r(v),b=e(t(),1),x=n();function S({open:e,onOpenChange:t,onNewSession:n,onStop:r,onResumeSession:v,onSetRightPanel:S,onThemeChange:C,sessions:w,isStreaming:T,themePreference:E}){let[D,O]=(0,b.useState)(``),[k,A]=(0,b.useState)(e);e!==k&&(A(e),e&&O(``));let j=e=>{e(),t(!1)};return(0,x.jsxs)(m,{open:e,onOpenChange:t,children:[(0,x.jsx)(d,{placeholder:`Type a command or search…`,value:D,onValueChange:O}),(0,x.jsxs)(_,{children:[(0,x.jsx)(g,{children:`No commands found.`}),(0,x.jsxs)(p,{heading:`Actions`,children:[(0,x.jsxs)(h,{onSelect:()=>j(n),keywords:[`new`,`session`,`chat`],children:[(0,x.jsx)(l,{className:`mr-2 size-4`}),(0,x.jsx)(`span`,{children:`New session`})]}),T&&(0,x.jsxs)(h,{onSelect:()=>j(r),keywords:[`stop`,`abort`,`cancel`],children:[(0,x.jsx)(u,{className:`mr-2 size-4`}),(0,x.jsx)(`span`,{children:`Stop generation`})]})]}),(0,x.jsx)(f,{}),(0,x.jsx)(p,{heading:`Panels`,children:i.map(e=>{let t=e.icon;return(0,x.jsxs)(h,{onSelect:()=>j(()=>S(e.id)),keywords:e.commandKeywords,children:[(0,x.jsx)(t,{}),(0,x.jsx)(`span`,{children:e.commandLabel})]},e.id)})}),w.length>0&&(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(f,{}),(0,x.jsx)(p,{heading:`Sessions`,children:w.map(e=>{let t=e.title;return(0,x.jsxs)(h,{onSelect:()=>j(()=>v(e)),keywords:[`session`,t],children:[(0,x.jsx)(y,{className:`mr-2 size-4`}),(0,x.jsx)(`span`,{className:`truncate`,children:t})]},e.sessionId)})})]}),(0,x.jsx)(f,{}),(0,x.jsxs)(p,{heading:`Theme`,children:[(0,x.jsxs)(h,{onSelect:()=>j(()=>C(`light`)),keywords:[`theme`,`light`],children:[(0,x.jsx)(c,{className:`mr-2 size-4`}),(0,x.jsx)(`span`,{children:`Light`}),E===`light`&&(0,x.jsx)(a,{className:`ml-auto size-3 opacity-50`})]}),(0,x.jsxs)(h,{onSelect:()=>j(()=>C(`dark`)),keywords:[`theme`,`dark`],children:[(0,x.jsx)(o,{className:`mr-2 size-4`}),(0,x.jsx)(`span`,{children:`Dark`}),E===`dark`&&(0,x.jsx)(a,{className:`ml-auto size-3 opacity-50`})]}),(0,x.jsxs)(h,{onSelect:()=>j(()=>C(`system`)),keywords:[`theme`,`system`],children:[(0,x.jsx)(s,{className:`mr-2 size-4`}),(0,x.jsx)(`span`,{children:`System`}),E===`system`&&(0,x.jsx)(a,{className:`ml-auto size-3 opacity-50`})]})]})]})]})}export{S as ChatCommandPalette};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{t}from"./react-Cvdyeg_0.js";import{t as n}from"./jsx-runtime-NZYk81nU.js";import{t as r}from"./utils-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{t}from"./react-Cvdyeg_0.js";import{t as n}from"./jsx-runtime-NZYk81nU.js";import{t as r}from"./utils-CFDGLzf6.js";import{c as i,d as a,o,r as s}from"./ease-2gsl7ABx.js";import{n as c,t as l}from"./use-reduced-motion-BzGFRmoG.js";import{t as u}from"./createLucideIcon-CQY2ECfR.js";import{t as d}from"./chevron-down-Bse1ggZM.js";import{t as f}from"./safe-external-url-BnEhm9A0.js";import{n as p}from"./action-swap-roll-Bek47h-E.js";import{i as m}from"./sparkles-C4VQyMox.js";var h={name:`book-open-text`,size:24,node:[[`path`,{d:`M12 5v16`,key:`1f6ucr`}],[`path`,{d:`M16 13h2`,key:`weia3s`}],[`path`,{d:`M16 9h2`,key:`1n7gjm`}],[`path`,{d:`M20.001 19A2 2 0 0022 17V5a2 2 0 00-1.999-2L16 3.002A5 5 0 0012 5a5 5 0 00-4-2H4a2 2 0 00-2 2v12a2 2 0 001.999 2H8a5 5 0 014 2 5 5 0 014-2z`,key:`1fyvmf`}],[`path`,{d:`M6 13h2`,key:`1cckiz`}],[`path`,{d:`M6 9h2`,key:`1k7j9f`}]]};h.node;var g=u(h),_={name:`earth`,size:24,node:[[`path`,{d:`M21.54 15H17a2 2 0 0 0-2 2v4.54`,key:`1djwo0`}],[`path`,{d:`M7 3.34V5a3 3 0 0 0 3 3a2 2 0 0 1 2 2c0 1.1.9 2 2 2a2 2 0 0 0 2-2c0-1.1.9-2 2-2h3.17`,key:`1tzkfa`}],[`path`,{d:`M11 21.95V18a2 2 0 0 0-2-2a2 2 0 0 1-2-2v-1a2 2 0 0 0-2-2H2.05`,key:`14pb5j`}],[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]],aliases:[`globe-2`]};_.node;var v=u(_),y={name:`list-todo`,size:24,node:[[`path`,{d:`M13 5h8`,key:`a7qcls`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 19h8`,key:`c3s6r1`}],[`path`,{d:`m3 17 2 2 4-4`,key:`1jhpwq`}],[`rect`,{x:`3`,y:`4`,width:`6`,height:`6`,rx:`1`,key:`cif1o7`}]]};y.node;var b=u(y),x={name:`log-out`,size:24,node:[[`path`,{d:`m16 17 5-5-5-5`,key:`1bji2h`}],[`path`,{d:`M21 12H9`,key:`dn1m92`}],[`path`,{d:`M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4`,key:`1uf3rs`}]]};x.node;var S=u(x),C={name:`message-circle-question-mark`,size:24,node:[[`path`,{d:`M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719`,key:`1sd12s`}],[`path`,{d:`M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3`,key:`1u773s`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]],aliases:[`message-circle-question`]};C.node;var w=u(C),T=e(t(),1);function E(){let[e,t]=(0,T.useState)(!1);return(0,T.useEffect)(()=>{if(typeof window>`u`||!window.matchMedia)return;let e=window.matchMedia(`(hover: hover) and (pointer: fine)`),n=()=>t(e.matches);return n(),e.addEventListener?.(`change`,n),()=>e.removeEventListener?.(`change`,n)},[]),e}function D(e){try{return new URL(`/favicon.ico`,e).toString()}catch{return null}}var O=n();function k(e,t){return`${e}-${t.replace(/[^a-zA-Z0-9_-]/g,`-`)}`}function A({url:e,className:t}){let n=e&&f(e)?D(e):null,[i,a]=(0,T.useState)(null);return(0,O.jsx)(`span`,{"aria-hidden":`true`,className:r(`grid size-5 shrink-0 place-items-center text-muted-foreground`,t),children:n&&i!==n?(0,O.jsx)(`img`,{src:n,alt:``,width:16,height:16,loading:`lazy`,referrerPolicy:`no-referrer`,onError:()=>a(n),className:`size-4 rounded-sm object-contain`}):(0,O.jsx)(v,{className:`size-3.5`})})}function j({citations:e,limit:t=3,className:n}){return(0,O.jsx)(`span`,{"aria-hidden":`true`,className:r(`flex -space-x-1.5`,n),children:e.slice(0,t).map(e=>(0,O.jsx)(A,{url:e.url,className:`size-6 rounded-full bg-background ring-2 ring-background`},e.id))})}function M({citation:e,index:t,idPrefix:n}){let r=e.url&&f(e.url)?e.url:void 0,i=(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(A,{url:e.url}),(0,O.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-wrap items-baseline gap-x-2 gap-y-0.5`,children:[(0,O.jsx)(`span`,{className:`truncate text-sm font-medium text-foreground/80 transition-colors group-hover/citation:text-foreground`,children:e.title}),e.domain?(0,O.jsx)(`span`,{className:`min-w-0 truncate text-xs text-muted-foreground/60`,children:e.domain}):null]}),(0,O.jsxs)(`span`,{className:`flex shrink-0 items-center gap-1.5`,children:[(0,O.jsx)(`span`,{className:`grid size-5 place-items-center rounded-md bg-foreground/[0.05] text-micro font-semibold tabular-nums text-muted-foreground`,children:t}),r?(0,O.jsx)(m,{className:`size-3.5 text-muted-foreground/40 transition-colors group-hover/citation:text-muted-foreground`}):null]})]}),a=`group/citation flex items-center gap-2 rounded-md px-1.5 py-1 outline-none focus-visible:ring-2 focus-visible:ring-ring`,o=k(n,e.id);return r?(0,O.jsx)(`a`,{id:o,href:r,target:`_blank`,rel:`noreferrer noopener`,className:a,children:i}):(0,O.jsx)(`div`,{id:o,className:a,children:i})}function N({citations:e,idPrefix:t,className:n}){let i=l()??!1,u=(0,T.useId)(),d=t??`citation-list-${u.replace(/:/g,``)}`;return(0,O.jsx)(`div`,{className:r(`grid gap-0.5`,n),children:(0,O.jsx)(c,{mode:`popLayout`,children:e.map((e,t)=>(0,O.jsx)(a.div,{layout:`position`,initial:i?{opacity:1}:{opacity:0,y:6},animate:{opacity:1,y:0},exit:i?{opacity:0}:{opacity:0,y:-3},transition:i?{duration:0}:{opacity:{duration:.18,ease:s},y:o,layout:o},children:(0,O.jsx)(M,{citation:e,index:t+1,idPrefix:d})},e.id))})})}function P({citations:e,title:t=`Sources`,open:n,defaultOpen:o=!1,onOpenChange:s,idPrefix:c,className:u}){let f=l()??!1,m=(0,T.useId)(),h=`${m}-content`,_=c??`citation-${m.replace(/:/g,``)}`,[v,y]=(0,T.useState)(o),b=n??v,x=(0,T.useCallback)(e=>{n===void 0&&y(e),s?.(e)},[s,n]);return(0,O.jsxs)(`div`,{className:r(`w-full text-sm`,u),children:[(0,O.jsxs)(`button`,{type:`button`,"aria-expanded":b,"aria-controls":h,onClick:()=>x(!b),className:`group -ml-1 flex min-h-8 items-center gap-2 rounded-lg px-1 text-left text-muted-foreground outline-none transition-colors hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring`,children:[(0,O.jsx)(g,{className:`size-4`}),(0,O.jsx)(`span`,{className:`font-medium`,children:t}),(0,O.jsx)(`span`,{className:`rounded-full bg-muted px-1.5 py-0.5 text-micro font-semibold tabular-nums`,children:e.length}),(0,O.jsx)(a.span,{"aria-hidden":`true`,animate:{rotate:b?180:0},transition:f?{duration:0}:i,className:`text-muted-foreground/60`,children:(0,O.jsx)(d,{className:`size-3.5`})})]}),(0,O.jsx)(p,{id:h,open:b,children:(0,O.jsx)(N,{citations:e,idPrefix:_,className:`mt-1`})})]})}export{w as a,g as c,E as i,j as n,S as o,P as r,b as s,N as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{t}from"./react-Cvdyeg_0.js";import{t as n}from"./jsx-runtime-NZYk81nU.js";import{t as r}from"./utils-Dpy9ZFOr.js";import{t as i}from"./check-BTwIaCtI.js";import{t as a}from"./search-Cb6fFWew.js";import{T as o,g as s,i as c,m as l,n as u,r as d,t as f}from"./dist-BJJVCio8.js";import{a as p,n as m,o as h,r as g,t as _}from"./dialog-DLIPvl1s.js";import{n as v,t as y}from"./input-group-BZLQiZOA.js";var b=1,x=.9,S=.8,C=.17,w=.1,T=.999,E=.9999,D=.99,O=/[\\\/_+.#"@\[\(\{&]/,k=/[\\\/_+.#"@\[\(\{&]/g,A=/[\s-]/,j=/[\s-]/g;function M(e,t,n,r,i,a,o){if(a===t.length)return i===e.length?b:D;var s=`${i},${a}`;if(o[s]!==void 0)return o[s];for(var c=r.charAt(a),l=n.indexOf(c,i),u=0,d,f,p,m;l>=0;)d=M(e,t,n,r,l+1,a+1,o),d>u&&(l===i?d*=b:O.test(e.charAt(l-1))?(d*=S,p=e.slice(i,l-1).match(k),p&&i>0&&(d*=T**+p.length)):A.test(e.charAt(l-1))?(d*=x,m=e.slice(i,l-1).match(j),m&&i>0&&(d*=T**+m.length)):(d*=C,i>0&&(d*=T**+(l-i))),e.charAt(l)!==t.charAt(a)&&(d*=E)),(d<w&&n.charAt(l-1)===r.charAt(a+1)||r.charAt(a+1)===r.charAt(a)&&n.charAt(l-1)!==r.charAt(a))&&(f=M(e,t,n,r,l+1,a+2,o),f*w>d&&(d=f*w)),d>u&&(u=d),l=n.indexOf(c,l+1);return o[s]=u,u}function N(e){return e.toLowerCase().replace(j,` `)}function P(e,t,n){return e=n&&n.length>0?`${e+` `+n.join(` `)}`:e,M(e,t,N(e),N(t),0,0,{})}var F=e(t(),1),I=`[cmdk-group=""]`,L=`[cmdk-group-items=""]`,ee=`[cmdk-group-heading=""]`,R=`[cmdk-item=""]`,z=`${R}:not([aria-disabled="true"])`,B=`cmdk-item-select`,V=`data-value`,te=(e,t,n)=>P(e,t,n),ne=F.createContext(void 0),H=()=>F.useContext(ne),U=F.createContext(void 0),W=()=>F.useContext(U),G=F.createContext(void 0),K=F.forwardRef((e,t)=>{let n=X(()=>({search:``,value:e.value??e.defaultValue??``,selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}})),r=X(()=>new Set),i=X(()=>new Map),a=X(()=>new Map),o=X(()=>new Set),c=fe(e),{label:u,children:d,value:f,onValueChange:p,filter:m,shouldFilter:h,loop:g,disablePointerSelection:_=!1,vimBindings:v=!0,...y}=e,b=l(),x=l(),S=l(),C=F.useRef(null),w=me();Y(()=>{if(f!==void 0){let e=f.trim();n.current.value=e,T.emit()}},[f]),Y(()=>{w(6,j)},[]);let T=F.useMemo(()=>({subscribe:e=>(o.current.add(e),()=>o.current.delete(e)),snapshot:()=>n.current,setState:(e,t,r)=>{var i,a,o;if(!Object.is(n.current[e],t)){if(n.current[e]=t,e===`search`)A(),O(),w(1,k);else if(e===`value`){if(document.activeElement.hasAttribute(`cmdk-input`)||document.activeElement.hasAttribute(`cmdk-root`)){let e=document.getElementById(S);e?e.focus():(i=document.getElementById(b))==null||i.focus()}if(w(7,()=>{n.current.selectedItemId=M()?.id,T.emit()}),r||w(5,j),c.current?.value!==void 0){let e=t??``;(o=(a=c.current).onValueChange)==null||o.call(a,e);return}}T.emit()}},emit:()=>{o.current.forEach(e=>e())}}),[]),E=F.useMemo(()=>({value:(e,t,r)=>{t!==a.current.get(e)?.value&&(a.current.set(e,{value:t,keywords:r}),n.current.filtered.items.set(e,D(t,r)),w(2,()=>{O(),T.emit()}))},item:(e,t)=>(r.current.add(e),t&&(i.current.has(t)?i.current.get(t).add(e):i.current.set(t,new Set([e]))),w(3,()=>{A(),O(),n.current.value||k(),T.emit()}),()=>{a.current.delete(e),r.current.delete(e),n.current.filtered.items.delete(e);let t=M();w(4,()=>{A(),t?.getAttribute(`id`)===e&&k(),T.emit()})}),group:e=>(i.current.has(e)||i.current.set(e,new Set),()=>{a.current.delete(e),i.current.delete(e)}),filter:()=>c.current.shouldFilter,label:u||e[`aria-label`],getDisablePointerSelection:()=>c.current.disablePointerSelection,listId:b,inputId:S,labelId:x,listInnerRef:C}),[]);function D(e,t){let r=c.current?.filter??te;return e?r(e,n.current.search,t):0}function O(){if(!n.current.search||c.current.shouldFilter===!1)return;let e=n.current.filtered.items,t=[];n.current.filtered.groups.forEach(n=>{let r=i.current.get(n),a=0;r.forEach(t=>{let n=e.get(t);a=Math.max(n,a)}),t.push([n,a])});let r=C.current;N().sort((t,n)=>{let r=t.getAttribute(`id`),i=n.getAttribute(`id`);return(e.get(i)??0)-(e.get(r)??0)}).forEach(e=>{let t=e.closest(L);t?t.appendChild(e.parentElement===t?e:e.closest(`${L} > *`)):r.appendChild(e.parentElement===r?e:e.closest(`${L} > *`))}),t.sort((e,t)=>t[1]-e[1]).forEach(e=>{let t=C.current?.querySelector(`${I}[${V}="${encodeURIComponent(e[0])}"]`);t?.parentElement.appendChild(t)})}function k(){let e=N().find(e=>e.getAttribute(`aria-disabled`)!==`true`)?.getAttribute(V);T.setState(`value`,e||void 0)}function A(){if(!n.current.search||c.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let e=0;for(let t of r.current){let r=D(a.current.get(t)?.value??``,a.current.get(t)?.keywords??[]);n.current.filtered.items.set(t,r),r>0&&e++}for(let[e,t]of i.current)for(let r of t)if(n.current.filtered.items.get(r)>0){n.current.filtered.groups.add(e);break}n.current.filtered.count=e}function j(){var e;let t=M();t&&(t.parentElement?.firstChild===t&&((e=t.closest(I)?.querySelector(ee))==null||e.scrollIntoView({block:`nearest`})),t.scrollIntoView({block:`nearest`}))}function M(){return C.current?.querySelector(`${R}[aria-selected="true"]`)}function N(){return Array.from(C.current?.querySelectorAll(z)||[])}function P(e){let t=N()[e];t&&T.setState(`value`,t.getAttribute(V))}function H(e){var t;let n=M(),r=N(),i=r.findIndex(e=>e===n),a=r[i+e];(t=c.current)!=null&&t.loop&&(a=i+e<0?r[r.length-1]:i+e===r.length?r[0]:r[i+e]),a&&T.setState(`value`,a.getAttribute(V))}function W(e){let t=M()?.closest(I),n;for(;t&&!n;)t=e>0?ue(t,I):de(t,I),n=t?.querySelector(z);n?T.setState(`value`,n.getAttribute(V)):H(e)}let G=()=>P(N().length-1),K=e=>{e.preventDefault(),e.metaKey?G():e.altKey?W(1):H(1)},q=e=>{e.preventDefault(),e.metaKey?P(0):e.altKey?W(-1):H(-1)};return F.createElement(s.div,{ref:t,tabIndex:-1,...y,"cmdk-root":``,onKeyDown:e=>{var t;(t=y.onKeyDown)==null||t.call(y,e);let n=e.nativeEvent.isComposing||e.keyCode===229;if(!(e.defaultPrevented||n))switch(e.key){case`n`:case`j`:v&&e.ctrlKey&&K(e);break;case`ArrowDown`:K(e);break;case`p`:case`k`:v&&e.ctrlKey&&q(e);break;case`ArrowUp`:q(e);break;case`Home`:e.preventDefault(),P(0);break;case`End`:e.preventDefault(),G();break;case`Enter`:{e.preventDefault();let t=M();if(t){let e=new Event(B);t.dispatchEvent(e)}}}}},F.createElement(`label`,{"cmdk-label":``,htmlFor:E.inputId,id:E.labelId,style:ge},u),Q(e,e=>F.createElement(U.Provider,{value:T},F.createElement(ne.Provider,{value:E},e))))}),q=F.forwardRef((e,t)=>{let n=l(),r=F.useRef(null),i=F.useContext(G),a=H(),c=fe(e),u=c.current?.forceMount??i?.forceMount;Y(()=>{if(!u)return a.item(n,i?.id)},[u]);let d=pe(n,r,[e.value,e.children,r],e.keywords),f=W(),p=Z(e=>e.value&&e.value===d.current),m=Z(e=>u||a.filter()===!1?!0:!e.search||e.filtered.items.get(n)>0);F.useEffect(()=>{let t=r.current;if(!(!t||e.disabled))return t.addEventListener(B,h),()=>t.removeEventListener(B,h)},[m,e.onSelect,e.disabled]);function h(){var e,t;g(),(t=(e=c.current).onSelect)==null||t.call(e,d.current)}function g(){f.setState(`value`,d.current,!0)}if(!m)return null;let{disabled:_,value:v,onSelect:y,forceMount:b,keywords:x,...S}=e;return F.createElement(s.div,{ref:o(r,t),...S,id:n,"cmdk-item":``,role:`option`,"aria-disabled":!!_,"aria-selected":!!p,"data-disabled":!!_,"data-selected":!!p,onPointerMove:_||a.getDisablePointerSelection()?void 0:g,onClick:_?void 0:h},e.children)}),re=F.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:i,...a}=e,c=l(),u=F.useRef(null),d=F.useRef(null),f=l(),p=H(),m=Z(e=>i||p.filter()===!1?!0:!e.search||e.filtered.groups.has(c));Y(()=>p.group(c),[]),pe(c,u,[e.value,e.heading,d]);let h=F.useMemo(()=>({id:c,forceMount:i}),[i]);return F.createElement(s.div,{ref:o(u,t),...a,"cmdk-group":``,role:`presentation`,hidden:!m||void 0},n&&F.createElement(`div`,{ref:d,"cmdk-group-heading":``,"aria-hidden":!0,id:f},n),Q(e,e=>F.createElement(`div`,{"cmdk-group-items":``,role:`group`,"aria-labelledby":n?f:void 0},F.createElement(G.Provider,{value:h},e))))}),ie=F.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,i=F.useRef(null),a=Z(e=>!e.search);return!n&&!a?null:F.createElement(s.div,{ref:o(i,t),...r,"cmdk-separator":``,role:`separator`})}),ae=F.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,i=e.value!=null,a=W(),o=Z(e=>e.search),c=Z(e=>e.selectedItemId),l=H();return F.useEffect(()=>{e.value!=null&&a.setState(`search`,e.value)},[e.value]),F.createElement(s.input,{ref:t,...r,"cmdk-input":``,autoComplete:`off`,autoCorrect:`off`,spellCheck:!1,"aria-autocomplete":`list`,role:`combobox`,"aria-expanded":!0,"aria-controls":l.listId,"aria-labelledby":l.labelId,"aria-activedescendant":c,id:l.inputId,type:`text`,value:i?e.value:o,onChange:e=>{i||a.setState(`search`,e.target.value),n?.(e.target.value)}})}),oe=F.forwardRef((e,t)=>{let{children:n,label:r=`Suggestions`,...i}=e,a=F.useRef(null),c=F.useRef(null),l=Z(e=>e.selectedItemId),u=H();return F.useEffect(()=>{if(c.current&&a.current){let e=c.current,t=a.current,n,r=new ResizeObserver(()=>{n=requestAnimationFrame(()=>{let n=e.offsetHeight;t.style.setProperty(`--cmdk-list-height`,n.toFixed(1)+`px`)})});return r.observe(e),()=>{cancelAnimationFrame(n),r.unobserve(e)}}},[]),F.createElement(s.div,{ref:o(a,t),...i,"cmdk-list":``,role:`listbox`,tabIndex:-1,"aria-activedescendant":l,"aria-label":r,id:u.listId},Q(e,e=>F.createElement(`div`,{ref:o(c,u.listInnerRef),"cmdk-list-sizer":``},e)))}),se=F.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:i,contentClassName:a,container:o,...s}=e;return F.createElement(f,{open:n,onOpenChange:r},F.createElement(c,{container:o},F.createElement(d,{"cmdk-overlay":``,className:i}),F.createElement(u,{"aria-label":e.label,"cmdk-dialog":``,className:a},F.createElement(K,{ref:t,...s}))))}),ce=F.forwardRef((e,t)=>Z(e=>e.filtered.count===0)?F.createElement(s.div,{ref:t,...e,"cmdk-empty":``,role:`presentation`}):null),le=F.forwardRef((e,t)=>{let{progress:n,children:r,label:i=`Loading...`,...a}=e;return F.createElement(s.div,{ref:t,...a,"cmdk-loading":``,role:`progressbar`,"aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":i},Q(e,e=>F.createElement(`div`,{"aria-hidden":!0},e)))}),J=Object.assign(K,{List:oe,Item:q,Input:ae,Group:re,Separator:ie,Dialog:se,Empty:ce,Loading:le});function ue(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function de(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function fe(e){let t=F.useRef(e);return Y(()=>{t.current=e}),t}var Y=typeof window>`u`?F.useEffect:F.useLayoutEffect;function X(e){let t=F.useRef();return t.current===void 0&&(t.current=e()),t}function Z(e){let t=W(),n=()=>e(t.snapshot());return F.useSyncExternalStore(t.subscribe,n,n)}function pe(e,t,n,r=[]){let i=F.useRef(),a=H();return Y(()=>{var o;let s=(()=>{for(let e of n){if(typeof e==`string`)return e.trim();if(typeof e==`object`&&`current`in e)return e.current?e.current.textContent?.trim():i.current}})(),c=r.map(e=>e.trim());a.value(e,s,c),(o=t.current)==null||o.setAttribute(V,s),i.current=s}),i}var me=()=>{let[e,t]=F.useState(),n=X(()=>new Map);return Y(()=>{n.current.forEach(e=>e()),n.current=new Map},[e]),(e,r)=>{n.current.set(e,r),t({})}};function he(e){let t=e.type;return typeof t==`function`?t(e.props):`render`in t?t.render(e.props):e}function Q({asChild:e,children:t},n){return e&&F.isValidElement(t)?F.cloneElement(he(t),{ref:t.ref},n(t.props.children)):n(t)}var ge={position:`absolute`,width:`1px`,height:`1px`,padding:`0`,margin:`-1px`,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,borderWidth:`0`},$=n();function _e({className:e,...t}){return(0,$.jsx)(J,{"data-slot":`command`,className:r(`flex size-full flex-col overflow-hidden !rounded-xl p-1 text-popover-foreground`,e),...t})}function ve({title:e=`Command Palette`,description:t=`Search for a command to run...`,children:n,className:i,showCloseButton:a=!1,...o}){return(0,$.jsx)(_,{...o,children:(0,$.jsxs)(m,{className:r(`top-1/3 translate-y-0 overflow-hidden !rounded-xl p-0`,i),showCloseButton:a,children:[(0,$.jsxs)(p,{className:`sr-only`,children:[(0,$.jsx)(h,{children:e}),(0,$.jsx)(g,{children:t})]}),(0,$.jsx)(_e,{children:n})]})})}function ye({className:e,...t}){return(0,$.jsx)(`div`,{"data-slot":`command-input-wrapper`,className:`p-1 pb-0`,children:(0,$.jsxs)(y,{className:`!h-8 !rounded-lg border-input/30 bg-input/30 !shadow-none *:data-[slot=input-group-addon]:!pl-2`,children:[(0,$.jsx)(J.Input,{"data-slot":`command-input`,className:r(`w-full text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50`,e),...t}),(0,$.jsx)(v,{children:(0,$.jsx)(a,{className:`size-4 shrink-0 opacity-50`})})]})})}function be({className:e,...t}){return(0,$.jsx)(J.List,{"data-slot":`command-list`,className:r(`no-scrollbar max-h-72 scroll-py-1 overflow-x-hidden overflow-y-auto outline-none`,e),...t})}function xe({className:e,...t}){return(0,$.jsx)(J.Empty,{"data-slot":`command-empty`,className:r(`py-6 text-center text-sm`,e),...t})}function Se({className:e,...t}){return(0,$.jsx)(J.Group,{"data-slot":`command-group`,className:r(`overflow-hidden p-1 text-foreground **:[[cmdk-group-heading]]:px-2 **:[[cmdk-group-heading]]:py-1.5 **:[[cmdk-group-heading]]:text-xs **:[[cmdk-group-heading]]:font-medium **:[[cmdk-group-heading]]:text-muted-foreground`,e),...t})}function Ce({className:e,...t}){return(0,$.jsx)(J.Separator,{"data-slot":`command-separator`,className:r(`-mx-1 h-px bg-border`,e),...t})}function we({className:e,children:t,...n}){return(0,$.jsxs)(J.Item,{"data-slot":`command-item`,className:r(`group/command-item relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none in-data-[slot=dialog-content]:!rounded-lg data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 data-selected:bg-muted data-selected:text-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-selected:*:[svg]:text-foreground`,e),...n,children:[t,(0,$.jsx)(i,{className:`ml-auto opacity-0 group-has-data-[slot=command-shortcut]/command-item:hidden group-data-[checked=true]/command-item:opacity-100`})]})}export{ye as a,Ce as c,Se as i,ve as n,we as o,xe as r,be as s,_e as t};
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{t}from"./react-Cvdyeg_0.js";import{t as n}from"./jsx-runtime-NZYk81nU.js";import{t as r}from"./utils-CFDGLzf6.js";import{t as i}from"./check-BTwIaCtI.js";import{t as a}from"./search-Cb6fFWew.js";import{T as o,g as s,i as c,m as l,n as u,r as d,t as f}from"./dist-BJJVCio8.js";import{a as p,n as m,o as h,r as g,t as _}from"./dialog-DuCD5hRq.js";import{n as v,t as y}from"./input-group-CZlz1ygA.js";var b=1,x=.9,S=.8,C=.17,w=.1,T=.999,E=.9999,D=.99,O=/[\\\/_+.#"@\[\(\{&]/,k=/[\\\/_+.#"@\[\(\{&]/g,A=/[\s-]/,j=/[\s-]/g;function M(e,t,n,r,i,a,o){if(a===t.length)return i===e.length?b:D;var s=`${i},${a}`;if(o[s]!==void 0)return o[s];for(var c=r.charAt(a),l=n.indexOf(c,i),u=0,d,f,p,m;l>=0;)d=M(e,t,n,r,l+1,a+1,o),d>u&&(l===i?d*=b:O.test(e.charAt(l-1))?(d*=S,p=e.slice(i,l-1).match(k),p&&i>0&&(d*=T**+p.length)):A.test(e.charAt(l-1))?(d*=x,m=e.slice(i,l-1).match(j),m&&i>0&&(d*=T**+m.length)):(d*=C,i>0&&(d*=T**+(l-i))),e.charAt(l)!==t.charAt(a)&&(d*=E)),(d<w&&n.charAt(l-1)===r.charAt(a+1)||r.charAt(a+1)===r.charAt(a)&&n.charAt(l-1)!==r.charAt(a))&&(f=M(e,t,n,r,l+1,a+2,o),f*w>d&&(d=f*w)),d>u&&(u=d),l=n.indexOf(c,l+1);return o[s]=u,u}function N(e){return e.toLowerCase().replace(j,` `)}function P(e,t,n){return e=n&&n.length>0?`${e+` `+n.join(` `)}`:e,M(e,t,N(e),N(t),0,0,{})}var F=e(t(),1),I=`[cmdk-group=""]`,L=`[cmdk-group-items=""]`,ee=`[cmdk-group-heading=""]`,R=`[cmdk-item=""]`,z=`${R}:not([aria-disabled="true"])`,B=`cmdk-item-select`,V=`data-value`,te=(e,t,n)=>P(e,t,n),ne=F.createContext(void 0),H=()=>F.useContext(ne),U=F.createContext(void 0),W=()=>F.useContext(U),G=F.createContext(void 0),K=F.forwardRef((e,t)=>{let n=X(()=>({search:``,value:e.value??e.defaultValue??``,selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}})),r=X(()=>new Set),i=X(()=>new Map),a=X(()=>new Map),o=X(()=>new Set),c=fe(e),{label:u,children:d,value:f,onValueChange:p,filter:m,shouldFilter:h,loop:g,disablePointerSelection:_=!1,vimBindings:v=!0,...y}=e,b=l(),x=l(),S=l(),C=F.useRef(null),w=me();Y(()=>{if(f!==void 0){let e=f.trim();n.current.value=e,T.emit()}},[f]),Y(()=>{w(6,j)},[]);let T=F.useMemo(()=>({subscribe:e=>(o.current.add(e),()=>o.current.delete(e)),snapshot:()=>n.current,setState:(e,t,r)=>{var i,a,o;if(!Object.is(n.current[e],t)){if(n.current[e]=t,e===`search`)A(),O(),w(1,k);else if(e===`value`){if(document.activeElement.hasAttribute(`cmdk-input`)||document.activeElement.hasAttribute(`cmdk-root`)){let e=document.getElementById(S);e?e.focus():(i=document.getElementById(b))==null||i.focus()}if(w(7,()=>{n.current.selectedItemId=M()?.id,T.emit()}),r||w(5,j),c.current?.value!==void 0){let e=t??``;(o=(a=c.current).onValueChange)==null||o.call(a,e);return}}T.emit()}},emit:()=>{o.current.forEach(e=>e())}}),[]),E=F.useMemo(()=>({value:(e,t,r)=>{t!==a.current.get(e)?.value&&(a.current.set(e,{value:t,keywords:r}),n.current.filtered.items.set(e,D(t,r)),w(2,()=>{O(),T.emit()}))},item:(e,t)=>(r.current.add(e),t&&(i.current.has(t)?i.current.get(t).add(e):i.current.set(t,new Set([e]))),w(3,()=>{A(),O(),n.current.value||k(),T.emit()}),()=>{a.current.delete(e),r.current.delete(e),n.current.filtered.items.delete(e);let t=M();w(4,()=>{A(),t?.getAttribute(`id`)===e&&k(),T.emit()})}),group:e=>(i.current.has(e)||i.current.set(e,new Set),()=>{a.current.delete(e),i.current.delete(e)}),filter:()=>c.current.shouldFilter,label:u||e[`aria-label`],getDisablePointerSelection:()=>c.current.disablePointerSelection,listId:b,inputId:S,labelId:x,listInnerRef:C}),[]);function D(e,t){let r=c.current?.filter??te;return e?r(e,n.current.search,t):0}function O(){if(!n.current.search||c.current.shouldFilter===!1)return;let e=n.current.filtered.items,t=[];n.current.filtered.groups.forEach(n=>{let r=i.current.get(n),a=0;r.forEach(t=>{let n=e.get(t);a=Math.max(n,a)}),t.push([n,a])});let r=C.current;N().sort((t,n)=>{let r=t.getAttribute(`id`),i=n.getAttribute(`id`);return(e.get(i)??0)-(e.get(r)??0)}).forEach(e=>{let t=e.closest(L);t?t.appendChild(e.parentElement===t?e:e.closest(`${L} > *`)):r.appendChild(e.parentElement===r?e:e.closest(`${L} > *`))}),t.sort((e,t)=>t[1]-e[1]).forEach(e=>{let t=C.current?.querySelector(`${I}[${V}="${encodeURIComponent(e[0])}"]`);t?.parentElement.appendChild(t)})}function k(){let e=N().find(e=>e.getAttribute(`aria-disabled`)!==`true`)?.getAttribute(V);T.setState(`value`,e||void 0)}function A(){if(!n.current.search||c.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let e=0;for(let t of r.current){let r=D(a.current.get(t)?.value??``,a.current.get(t)?.keywords??[]);n.current.filtered.items.set(t,r),r>0&&e++}for(let[e,t]of i.current)for(let r of t)if(n.current.filtered.items.get(r)>0){n.current.filtered.groups.add(e);break}n.current.filtered.count=e}function j(){var e;let t=M();t&&(t.parentElement?.firstChild===t&&((e=t.closest(I)?.querySelector(ee))==null||e.scrollIntoView({block:`nearest`})),t.scrollIntoView({block:`nearest`}))}function M(){return C.current?.querySelector(`${R}[aria-selected="true"]`)}function N(){return Array.from(C.current?.querySelectorAll(z)||[])}function P(e){let t=N()[e];t&&T.setState(`value`,t.getAttribute(V))}function H(e){var t;let n=M(),r=N(),i=r.findIndex(e=>e===n),a=r[i+e];(t=c.current)!=null&&t.loop&&(a=i+e<0?r[r.length-1]:i+e===r.length?r[0]:r[i+e]),a&&T.setState(`value`,a.getAttribute(V))}function W(e){let t=M()?.closest(I),n;for(;t&&!n;)t=e>0?ue(t,I):de(t,I),n=t?.querySelector(z);n?T.setState(`value`,n.getAttribute(V)):H(e)}let G=()=>P(N().length-1),K=e=>{e.preventDefault(),e.metaKey?G():e.altKey?W(1):H(1)},q=e=>{e.preventDefault(),e.metaKey?P(0):e.altKey?W(-1):H(-1)};return F.createElement(s.div,{ref:t,tabIndex:-1,...y,"cmdk-root":``,onKeyDown:e=>{var t;(t=y.onKeyDown)==null||t.call(y,e);let n=e.nativeEvent.isComposing||e.keyCode===229;if(!(e.defaultPrevented||n))switch(e.key){case`n`:case`j`:v&&e.ctrlKey&&K(e);break;case`ArrowDown`:K(e);break;case`p`:case`k`:v&&e.ctrlKey&&q(e);break;case`ArrowUp`:q(e);break;case`Home`:e.preventDefault(),P(0);break;case`End`:e.preventDefault(),G();break;case`Enter`:{e.preventDefault();let t=M();if(t){let e=new Event(B);t.dispatchEvent(e)}}}}},F.createElement(`label`,{"cmdk-label":``,htmlFor:E.inputId,id:E.labelId,style:ge},u),Q(e,e=>F.createElement(U.Provider,{value:T},F.createElement(ne.Provider,{value:E},e))))}),q=F.forwardRef((e,t)=>{let n=l(),r=F.useRef(null),i=F.useContext(G),a=H(),c=fe(e),u=c.current?.forceMount??i?.forceMount;Y(()=>{if(!u)return a.item(n,i?.id)},[u]);let d=pe(n,r,[e.value,e.children,r],e.keywords),f=W(),p=Z(e=>e.value&&e.value===d.current),m=Z(e=>u||a.filter()===!1?!0:!e.search||e.filtered.items.get(n)>0);F.useEffect(()=>{let t=r.current;if(!(!t||e.disabled))return t.addEventListener(B,h),()=>t.removeEventListener(B,h)},[m,e.onSelect,e.disabled]);function h(){var e,t;g(),(t=(e=c.current).onSelect)==null||t.call(e,d.current)}function g(){f.setState(`value`,d.current,!0)}if(!m)return null;let{disabled:_,value:v,onSelect:y,forceMount:b,keywords:x,...S}=e;return F.createElement(s.div,{ref:o(r,t),...S,id:n,"cmdk-item":``,role:`option`,"aria-disabled":!!_,"aria-selected":!!p,"data-disabled":!!_,"data-selected":!!p,onPointerMove:_||a.getDisablePointerSelection()?void 0:g,onClick:_?void 0:h},e.children)}),re=F.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:i,...a}=e,c=l(),u=F.useRef(null),d=F.useRef(null),f=l(),p=H(),m=Z(e=>i||p.filter()===!1?!0:!e.search||e.filtered.groups.has(c));Y(()=>p.group(c),[]),pe(c,u,[e.value,e.heading,d]);let h=F.useMemo(()=>({id:c,forceMount:i}),[i]);return F.createElement(s.div,{ref:o(u,t),...a,"cmdk-group":``,role:`presentation`,hidden:!m||void 0},n&&F.createElement(`div`,{ref:d,"cmdk-group-heading":``,"aria-hidden":!0,id:f},n),Q(e,e=>F.createElement(`div`,{"cmdk-group-items":``,role:`group`,"aria-labelledby":n?f:void 0},F.createElement(G.Provider,{value:h},e))))}),ie=F.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,i=F.useRef(null),a=Z(e=>!e.search);return!n&&!a?null:F.createElement(s.div,{ref:o(i,t),...r,"cmdk-separator":``,role:`separator`})}),ae=F.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,i=e.value!=null,a=W(),o=Z(e=>e.search),c=Z(e=>e.selectedItemId),l=H();return F.useEffect(()=>{e.value!=null&&a.setState(`search`,e.value)},[e.value]),F.createElement(s.input,{ref:t,...r,"cmdk-input":``,autoComplete:`off`,autoCorrect:`off`,spellCheck:!1,"aria-autocomplete":`list`,role:`combobox`,"aria-expanded":!0,"aria-controls":l.listId,"aria-labelledby":l.labelId,"aria-activedescendant":c,id:l.inputId,type:`text`,value:i?e.value:o,onChange:e=>{i||a.setState(`search`,e.target.value),n?.(e.target.value)}})}),oe=F.forwardRef((e,t)=>{let{children:n,label:r=`Suggestions`,...i}=e,a=F.useRef(null),c=F.useRef(null),l=Z(e=>e.selectedItemId),u=H();return F.useEffect(()=>{if(c.current&&a.current){let e=c.current,t=a.current,n,r=new ResizeObserver(()=>{n=requestAnimationFrame(()=>{let n=e.offsetHeight;t.style.setProperty(`--cmdk-list-height`,n.toFixed(1)+`px`)})});return r.observe(e),()=>{cancelAnimationFrame(n),r.unobserve(e)}}},[]),F.createElement(s.div,{ref:o(a,t),...i,"cmdk-list":``,role:`listbox`,tabIndex:-1,"aria-activedescendant":l,"aria-label":r,id:u.listId},Q(e,e=>F.createElement(`div`,{ref:o(c,u.listInnerRef),"cmdk-list-sizer":``},e)))}),se=F.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:i,contentClassName:a,container:o,...s}=e;return F.createElement(f,{open:n,onOpenChange:r},F.createElement(c,{container:o},F.createElement(d,{"cmdk-overlay":``,className:i}),F.createElement(u,{"aria-label":e.label,"cmdk-dialog":``,className:a},F.createElement(K,{ref:t,...s}))))}),ce=F.forwardRef((e,t)=>Z(e=>e.filtered.count===0)?F.createElement(s.div,{ref:t,...e,"cmdk-empty":``,role:`presentation`}):null),le=F.forwardRef((e,t)=>{let{progress:n,children:r,label:i=`Loading...`,...a}=e;return F.createElement(s.div,{ref:t,...a,"cmdk-loading":``,role:`progressbar`,"aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":i},Q(e,e=>F.createElement(`div`,{"aria-hidden":!0},e)))}),J=Object.assign(K,{List:oe,Item:q,Input:ae,Group:re,Separator:ie,Dialog:se,Empty:ce,Loading:le});function ue(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function de(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function fe(e){let t=F.useRef(e);return Y(()=>{t.current=e}),t}var Y=typeof window>`u`?F.useEffect:F.useLayoutEffect;function X(e){let t=F.useRef();return t.current===void 0&&(t.current=e()),t}function Z(e){let t=W(),n=()=>e(t.snapshot());return F.useSyncExternalStore(t.subscribe,n,n)}function pe(e,t,n,r=[]){let i=F.useRef(),a=H();return Y(()=>{var o;let s=(()=>{for(let e of n){if(typeof e==`string`)return e.trim();if(typeof e==`object`&&`current`in e)return e.current?e.current.textContent?.trim():i.current}})(),c=r.map(e=>e.trim());a.value(e,s,c),(o=t.current)==null||o.setAttribute(V,s),i.current=s}),i}var me=()=>{let[e,t]=F.useState(),n=X(()=>new Map);return Y(()=>{n.current.forEach(e=>e()),n.current=new Map},[e]),(e,r)=>{n.current.set(e,r),t({})}};function he(e){let t=e.type;return typeof t==`function`?t(e.props):`render`in t?t.render(e.props):e}function Q({asChild:e,children:t},n){return e&&F.isValidElement(t)?F.cloneElement(he(t),{ref:t.ref},n(t.props.children)):n(t)}var ge={position:`absolute`,width:`1px`,height:`1px`,padding:`0`,margin:`-1px`,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,borderWidth:`0`},$=n();function _e({className:e,...t}){return(0,$.jsx)(J,{"data-slot":`command`,className:r(`flex size-full flex-col overflow-hidden !rounded-xl p-1 text-popover-foreground`,e),...t})}function ve({title:e=`Command Palette`,description:t=`Search for a command to run...`,children:n,className:i,showCloseButton:a=!1,...o}){return(0,$.jsx)(_,{...o,children:(0,$.jsxs)(m,{className:r(`top-1/3 translate-y-0 overflow-hidden !rounded-xl p-0`,i),showCloseButton:a,children:[(0,$.jsxs)(p,{className:`sr-only`,children:[(0,$.jsx)(h,{children:e}),(0,$.jsx)(g,{children:t})]}),(0,$.jsx)(_e,{children:n})]})})}function ye({className:e,...t}){return(0,$.jsx)(`div`,{"data-slot":`command-input-wrapper`,className:`p-1 pb-0`,children:(0,$.jsxs)(y,{className:`!h-8 !rounded-lg border-input/30 bg-input/30 !shadow-none *:data-[slot=input-group-addon]:!pl-2`,children:[(0,$.jsx)(J.Input,{"data-slot":`command-input`,className:r(`w-full text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50`,e),...t}),(0,$.jsx)(v,{children:(0,$.jsx)(a,{className:`size-4 shrink-0 opacity-50`})})]})})}function be({className:e,...t}){return(0,$.jsx)(J.List,{"data-slot":`command-list`,className:r(`no-scrollbar max-h-72 scroll-py-1 overflow-x-hidden overflow-y-auto outline-none`,e),...t})}function xe({className:e,...t}){return(0,$.jsx)(J.Empty,{"data-slot":`command-empty`,className:r(`py-6 text-center text-sm`,e),...t})}function Se({className:e,...t}){return(0,$.jsx)(J.Group,{"data-slot":`command-group`,className:r(`overflow-hidden p-1 text-foreground **:[[cmdk-group-heading]]:px-2 **:[[cmdk-group-heading]]:py-1.5 **:[[cmdk-group-heading]]:text-xs **:[[cmdk-group-heading]]:font-medium **:[[cmdk-group-heading]]:text-muted-foreground`,e),...t})}function Ce({className:e,...t}){return(0,$.jsx)(J.Separator,{"data-slot":`command-separator`,className:r(`-mx-1 h-px bg-border`,e),...t})}function we({className:e,children:t,...n}){return(0,$.jsxs)(J.Item,{"data-slot":`command-item`,className:r(`group/command-item relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none in-data-[slot=dialog-content]:!rounded-lg data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 data-selected:bg-muted data-selected:text-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-selected:*:[svg]:text-foreground`,e),...n,children:[t,(0,$.jsx)(i,{className:`ml-auto opacity-0 group-has-data-[slot=command-shortcut]/command-item:hidden group-data-[checked=true]/command-item:opacity-100`})]})}export{ye as a,Ce as c,Se as i,ve as n,we as o,xe as r,be as s,_e as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{t}from"./react-Cvdyeg_0.js";import{t as n}from"./jsx-runtime-NZYk81nU.js";import{t as r}from"./button-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{t}from"./react-Cvdyeg_0.js";import{t as n}from"./jsx-runtime-NZYk81nU.js";import{t as r}from"./button-Bqms7ZKX.js";import{t as i}from"./arrow-up-DCwrqIrK.js";import{f as a}from"./chat-helpers-Bj7_hES7.js";import{b as o,f as s,l as c,y as l}from"./types-D5hZ8IyV.js";import{t as u}from"./triangle-alert-BuzmrrqI.js";import{a as d,i as f,n as p,o as m,r as h,t as g}from"./dialog-DuCD5hRq.js";import{t as _}from"./input-DECT4vz2.js";import{a as v,i as y,o as b,r as x,s as S,t as C}from"./command-s2yLD3tA.js";import{t as w}from"./spinner-CSBXk3Lo.js";var T=e(t(),1),E=n();function D({open:e,onClose:t,onBrowseDirectories:n,onCreateProject:D}){let O=(0,T.useId)(),k=(0,T.useId)(),A=(0,T.useId)(),[j,M]=(0,T.useState)(``),[N,P]=(0,T.useState)(``),[F,I]=(0,T.useState)(void 0),[L,R]=(0,T.useState)(null),[z,B]=(0,T.useState)(!1),[V,H]=(0,T.useState)(null),[U,W]=(0,T.useState)(!1),[G,K]=(0,T.useState)(null),q=(0,T.useCallback)(async e=>{if(!n)return!1;B(!0),H(null);try{let t=await n(e);return R(t),I(t.directoryToken),P(t.pathLabel),!0}catch(e){return H(c(e,`Could not browse this directory.`)),!1}finally{B(!1)}},[n]),J=(0,T.useRef)(!1);(0,T.useEffect)(()=>{e&&!J.current&&(J.current=!0,n&&q({})),e||(J.current=!1)},[e,q,n]);let Y=L?.pathLabel??N,X=!!(F||N.trim().startsWith(`/`)),Z=()=>{R(null),I(void 0),P(``),H(null)},Q=()=>{U||(Z(),M(``),K(null),t())},$=()=>{Z(),M(``),K(null),t()},ee=async()=>{let e=N.trim();if(!(!D||!e&&!F)){W(!0),K(null);try{await D({path:F?void 0:e,directoryToken:F,name:j.trim()||void 0}),$()}catch(e){K(c(e,`Could not add this project.`))}finally{W(!1)}}};return(0,E.jsx)(g,{open:e,onOpenChange:e=>{e||Q()},children:(0,E.jsxs)(p,{className:`sm:max-w-xl`,children:[(0,E.jsxs)(d,{children:[(0,E.jsx)(m,{children:`Add project`}),(0,E.jsx)(h,{children:`Choose the local directory that owns this project's sessions. Browse the server filesystem or paste an absolute path.`})]}),(0,E.jsxs)(`div`,{className:`space-y-4`,children:[(0,E.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,E.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,E.jsx)(`label`,{className:`text-sm font-medium`,htmlFor:O,children:`Project name`}),(0,E.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Optional`})]}),(0,E.jsx)(_,{id:O,value:j,onChange:e=>M(e.target.value),placeholder:`e.g. Fleet Prime`,"aria-label":`Project name`})]}),(0,E.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,E.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,E.jsx)(`label`,{className:`text-sm font-medium`,htmlFor:k,children:`Local directory`}),(0,E.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Required`})]}),(0,E.jsx)(_,{id:k,value:N,onChange:e=>{P(e.target.value),I(void 0),R(null),H(null),K(null)},placeholder:`/absolute/path/to/project`,"aria-label":`Project directory`,"aria-describedby":A,spellCheck:!1,autoCapitalize:`off`,autoCorrect:`off`,className:`h-10 font-mono text-xs`}),(0,E.jsx)(`p`,{id:A,className:`text-xs text-muted-foreground`,children:`Browse to select a directory, or paste an absolute path. The server validates the final choice before registering it.`})]}),z&&!L?(0,E.jsxs)(`div`,{className:`flex items-center gap-2 rounded-xl border border-dashed px-3 py-4 text-sm text-muted-foreground`,role:`status`,"aria-live":`polite`,children:[(0,E.jsx)(w,{className:`size-4`}),`Loading directories…`]}):null,L?(0,E.jsxs)(`div`,{className:`overflow-hidden rounded-xl border bg-muted/20`,"data-testid":`project-directory-browser`,children:[(0,E.jsxs)(`div`,{className:`flex items-start gap-3 p-3`,children:[(0,E.jsx)(`div`,{className:`grid size-9 shrink-0 place-items-center rounded-lg bg-primary/10 text-primary`,children:(0,E.jsx)(a,{className:`size-4`})}),(0,E.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,E.jsx)(`p`,{className:`text-xs font-medium uppercase tracking-[0.12em] text-muted-foreground`,children:`Selected directory`}),(0,E.jsx)(`p`,{className:`mt-1 break-all font-mono text-xs text-foreground`,title:Y,children:Y})]}),(0,E.jsx)(`span`,{className:`shrink-0 rounded-full bg-primary/10 px-2 py-1 text-caption font-medium text-primary`,children:`Selected`})]}),(0,E.jsxs)(`div`,{className:`space-y-2 border-t p-3`,children:[(0,E.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,E.jsxs)(`div`,{children:[(0,E.jsx)(`p`,{className:`text-sm font-medium`,children:`Browse child directories`}),(0,E.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Open a folder to make it the selected directory.`})]}),L.parentToken?(0,E.jsxs)(r,{type:`button`,size:`compact`,variant:`outline`,disabled:z,onClick:()=>void q({token:L.parentToken??void 0}),"aria-label":`Go up one directory`,title:`Go up one directory`,children:[(0,E.jsx)(i,{className:`size-3.5`}),`Up`]}):null]}),z?(0,E.jsxs)(`div`,{className:`flex items-center gap-2 rounded-lg border border-dashed px-3 py-4 text-sm text-muted-foreground`,role:`status`,"aria-live":`polite`,children:[(0,E.jsx)(w,{className:`size-4`}),`Loading directories…`]}):L.entries.length===0?(0,E.jsx)(`p`,{className:`rounded-lg border border-dashed px-3 py-4 text-center text-sm text-muted-foreground`,children:`No child directories here.`}):(0,E.jsxs)(C,{className:`overflow-hidden rounded-lg border bg-background`,shouldFilter:!0,children:[(0,E.jsx)(v,{"aria-label":`Search child directories`,placeholder:`Choose a child directory…`,className:`text-xs`}),(0,E.jsxs)(S,{className:`max-h-56`,"aria-label":`Child directories`,children:[(0,E.jsx)(x,{children:`No matching directories.`}),(0,E.jsx)(y,{heading:`Child directories`,children:L.entries.map(e=>(0,E.jsxs)(b,{value:`${e.name} ${e.pathLabel}`,onSelect:()=>{q({token:e.directoryToken})},className:`items-start gap-2`,children:[(0,E.jsx)(l,{className:`mt-0.5 size-4 shrink-0`}),(0,E.jsxs)(`span`,{className:`min-w-0`,children:[(0,E.jsx)(`span`,{className:`block truncate font-medium text-foreground`,children:s(e)}),(0,E.jsx)(`span`,{className:`block truncate text-caption text-muted-foreground`,title:e.pathLabel,children:e.pathLabel})]})]},e.directoryToken))})]})]})]})]}):n?(0,E.jsxs)(r,{type:`button`,variant:`outline`,disabled:z,onClick:()=>void q({}),className:`w-full justify-start`,children:[(0,E.jsx)(a,{className:`size-4`}),`Browse directories`]}):null,V?(0,E.jsxs)(`div`,{className:`flex items-start gap-2 rounded-lg border border-destructive/30 bg-destructive/5 px-3 py-2 text-sm text-destructive`,role:`alert`,children:[(0,E.jsx)(u,{className:`mt-0.5 size-4 shrink-0`}),(0,E.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,E.jsx)(`p`,{children:V}),(0,E.jsx)(r,{type:`button`,variant:`link`,size:`compact`,className:`mt-1 h-auto p-0 text-destructive`,onClick:()=>void q(L?{token:L.directoryToken}:{}),children:`Try again`})]})]}):null,G?(0,E.jsx)(`p`,{className:`text-sm text-destructive`,role:`alert`,children:G}):null]}),(0,E.jsxs)(f,{children:[(0,E.jsx)(r,{type:`button`,variant:`outline`,disabled:U,onClick:Q,children:`Cancel`}),(0,E.jsx)(r,{type:`button`,disabled:!X||U,onClick:()=>void ee(),children:U?(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(w,{className:`size-3.5`}),`Adding project…`]}):(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(o,{className:`size-3.5`}),`Add project`]})})]})]})})}export{D as SessionSidebarCreateDialog};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./jsx-runtime-NZYk81nU.js";import{it as t,t as n}from"./button-
|
|
1
|
+
import{t as e}from"./jsx-runtime-NZYk81nU.js";import{it as t,t as n}from"./button-Bqms7ZKX.js";import{t as r}from"./utils-CFDGLzf6.js";import{S as i,a,b as o,i as s,l as c,n as l,r as u,s as d,t as f,x as p}from"./surface-context-VvasJf_6.js";import{t as m}from"./x-DEU6H3M-.js";var h=t(function(e){return a(`dialog`,e)}),g=e(),_=4;function v({...e}){return(0,g.jsx)(h,{"data-slot":`dialog`,...e})}function y({...e}){return(0,g.jsx)(d,{"data-slot":`dialog-portal`,...e})}function b({className:e,...t}){return(0,g.jsx)(i,{"data-slot":`dialog-overlay`,className:r(`fixed inset-0 z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0`,e),...t})}function x({className:e,children:t,showCloseButton:i=!0,overlayClassName:a,...o}){let s=l(),d=Math.min(s+_,8);return(0,g.jsxs)(y,{children:[(0,g.jsx)(b,{className:a}),(0,g.jsxs)(c,{"data-slot":`dialog-content`,className:r(`fixed top-1/2 left-1/2 z-[51] grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-4 rounded-xl p-4 text-sm text-popover-foreground duration-100 outline-none sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,u(d),e),...o,children:[(0,g.jsx)(f,{value:d,children:t}),i&&(0,g.jsxs)(p,{"data-slot":`dialog-close`,render:(0,g.jsx)(n,{variant:`ghost`,className:`absolute top-2 right-2`,size:`icon-compact`}),children:[(0,g.jsx)(m,{}),(0,g.jsx)(`span`,{className:`sr-only`,children:`Close`})]})]})]})}function S({className:e,...t}){return(0,g.jsx)(`div`,{"data-slot":`dialog-header`,className:r(`flex flex-col gap-2`,e),...t})}function C({className:e,showCloseButton:t=!1,children:i,...a}){return(0,g.jsxs)(`div`,{"data-slot":`dialog-footer`,className:r(`-mx-4 -mb-4 flex flex-col-reverse gap-2 rounded-b-xl border-t bg-muted/50 p-4 sm:flex-row sm:justify-end`,e),...a,children:[i,t&&(0,g.jsx)(p,{render:(0,g.jsx)(n,{variant:`outline`}),children:`Close`})]})}function w({className:e,...t}){return(0,g.jsx)(s,{"data-slot":`dialog-title`,className:r(`font-heading text-base leading-none font-medium`,e),...t})}function T({className:e,...t}){return(0,g.jsx)(o,{"data-slot":`dialog-description`,className:r(`text-sm text-muted-foreground *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground`,e),...t})}export{S as a,C as i,x as n,w as o,T as r,v as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{t}from"./react-Cvdyeg_0.js";import{t as n}from"./jsx-runtime-NZYk81nU.js";import{Bt as r,C as i,D as a,N as o,P as s,S as c,Vt as l,a as u,c as d,d as f,f as p,i as m,j as ee,k as h,l as g,n as _,o as v,r as y,s as b,t as x,u as te,v as S,y as ne,zt as C}from"./is-ref-object-BD8OGh9C.js";var w=e(t(),1),T=n(),E=typeof window<`u`?w.useLayoutEffect:w.useEffect,D=(0,w.createContext)({});function O(e,t){if(S(e)){let{initial:t,animate:n}=e;return{initial:t===!1||c(t)?t:void 0,animate:c(n)?n:void 0}}return e.inherit===!1?{}:t}function k(e){let{initial:t,animate:n}=O(e,(0,w.useContext)(D));return(0,w.useMemo)(()=>({initial:t,animate:n}),[A(t),A(n)])}function A(e){return Array.isArray(e)?e.join(` `):e}var j=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function M(e,t,n){for(let r in t)!o(t[r])&&!p(r,n)&&(e[r]=t[r])}function N({transformTemplate:e},t){return(0,w.useMemo)(()=>{let n=j();return h(n,t,e),Object.assign({},n.vars,n.style)},[t])}function P(e,t){let n=e.style||{},r={};return M(r,n,e),Object.assign(r,N(e,t)),r}function F(e,t){let n={},r=P(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout=`none`,r.touchAction=e.drag===!0?`none`:`pan-${e.drag===`x`?`y`:`x`}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}var I=()=>({...j(),attrs:{}});function L(e,t,n,r){let i=(0,w.useMemo)(()=>{let n=I();return a(n,t,te(r),e.transformTemplate,e.style),{...n.attrs,style:{...n.style}}},[t]);if(e.style){let t={};M(t,e.style,e),i.style={...t,...i.style}}return i}var R=new Set(`animate.exit.variants.initial.style.values.variants.transition.transformTemplate.custom.inherit.onBeforeLayoutMeasure.onAnimationStart.onAnimationComplete.onUpdate.onDragStart.onDrag.onDragEnd.onMeasureDragConstraints.onDirectionLock.onDragTransitionEnd._dragX._dragY.onHoverStart.onHoverEnd.onViewportEnter.onViewportLeave.globalTapTarget.propagate.ignoreStrict.viewport`.split(`.`));function z(e){return e.startsWith(`while`)||e.startsWith(`drag`)&&e!==`draggable`||e.startsWith(`layout`)||e.startsWith(`onTap`)||e.startsWith(`onPan`)||e.startsWith(`onLayout`)||R.has(e)}function B(e,t){return e.startsWith(`on`)?!z(e):t?.(e)??!z(e)}function V(e,t,n,r){let i={};for(let a in e)(a!==`values`||typeof e.values!=`object`)&&(o(e[a])||(B(a,r)||n===!0&&z(a)||!t&&!z(a)||e.draggable&&a.startsWith(`onDrag`))&&(i[a]=e[a]));return i}function H(e,t,n,{latestValues:r},i,a=!1,s,c){let l=(s??y(e)?L:F)(t,r,i,e),u=V(t,typeof e==`string`,a,c),d=e===w.Fragment?{}:{...u,...l,ref:n},{children:f}=t,p=(0,w.useMemo)(()=>o(f)?f.get():f,[f]);return(0,w.createElement)(e,{...d,children:p})}function U({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,i){return{latestValues:W(n,r,i,e),renderState:t()}}function W(e,t,n,r){let a={},o=r(e,{});for(let e in o)a[e]=d(o[e]);let{initial:c,animate:l}=e,u=S(e),f=ne(e);t&&f&&!u&&e.inherit!==!1&&(c===void 0&&(c=t.initial),l===void 0&&(l=t.animate));let p=n?n.initial===!1:!1;p||=c===!1;let m=p?l:c;if(m&&typeof m!=`boolean`&&!i(m)){let t=Array.isArray(m)?m:[m];for(let n=0;n<t.length;n++){let r=s(e,t[n]);if(r){let{transitionEnd:e,transition:t,...n}=r;for(let e in n){let t=n[e];if(Array.isArray(t)){let e=p?t.length-1:0;t=t[e]}t!==null&&(a[e]=t)}for(let t in e)a[t]=e[t]}}}return a}var G=e=>(t,n)=>{let i=(0,w.useContext)(D),a=(0,w.useContext)(C),o=()=>U(e,t,i,a);return n?o():r(o)},K=G({scrapeMotionValuesFromProps:f,createRenderState:j}),q=G({scrapeMotionValuesFromProps:g,createRenderState:I}),J=Symbol.for(`motionComponentSymbol`);function re(e,t,n){let r=(0,w.useRef)(n);(0,w.useInsertionEffect)(()=>{r.current=n});let i=(0,w.useRef)(null);return(0,w.useCallback)(n=>{n&&e.onMount?.(n),t&&(n?t.mount(n):t.unmount());let a=r.current;if(typeof a==`function`){if(n){let e=a(n);typeof e==`function`&&(i.current=e)}else i.current?(i.current(),i.current=null):a(n)}else a&&(a.current=n)},[t])}function Y(e,t,n,r,i,a){let{visualElement:o}=(0,w.useContext)(D),s=(0,w.useContext)(v),c=(0,w.useContext)(C),l=(0,w.useContext)(b),u=l.reducedMotion,d=l.skipAnimations,f=(0,w.useRef)(null),p=(0,w.useRef)(!1);r||=s.renderer,!f.current&&r&&(f.current=r(e,{visualState:t,parent:o,props:n,presenceContext:c,blockInitialAnimation:c?c.initial===!1:!1,reducedMotionConfig:u,skipAnimations:d,isSVG:a}),p.current&&f.current&&(f.current.manuallyAnimateOnMount=!0));let m=f.current,h=(0,w.useContext)(_);m&&!m.projection&&i&&(m.type===`html`||m.type===`svg`)&&X(f.current,n,i,h);let g=(0,w.useRef)(!1);(0,w.useInsertionEffect)(()=>{m&&g.current&&m.update(n,c)});let y=n[ee],x=(0,w.useRef)(!!y&&typeof window<`u`&&!window.MotionHandoffIsComplete?.(y)&&window.MotionHasOptimisedAnimation?.(y));return E(()=>{p.current=!0,m&&(g.current=!0,window.MotionIsMounted=!0,m.updateFeatures(),m.scheduleRenderMicrotask(),x.current&&m.animationState&&m.animationState.animateChanges())}),(0,w.useEffect)(()=>{m&&(!x.current&&m.animationState&&m.animationState.animateChanges(),x.current&&=(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(y)}),!1),m.enteringChildren=void 0)}),m}function X(e,t,n,r){let{layoutId:i,layout:a,drag:o,dragConstraints:s,layoutScroll:c,layoutRoot:l,layoutAnchor:u,layoutCrossfade:d}=t;e.projection=new n(e.latestValues,t[`data-framer-portal-id`]?void 0:Z(e.parent)),e.projection.setOptions({layoutId:i,layout:a,alwaysMeasureLayout:!!o||s&&x(s),visualElement:e,animationType:typeof a==`string`?a:`both`,initialPromotionConfig:r,crossfade:d,layoutScroll:c,layoutRoot:l,layoutAnchor:u})}function Z(e){if(e)return e.options.allowProjection===!1?Z(e.parent):e.projection}function Q(e,{forwardMotionProps:t=!1,type:n}={},r,i){r&&m(r);let a=n?n===`svg`:y(e),o=a?q:K;function s(n,s){let c,l={...(0,w.useContext)(b),...n,layoutId:ie(n)},{isStatic:u,isValidProp:d}=l,f=k(n),p=o(n,u);if(!u&&typeof window<`u`){ae(l,r);let t=oe(l);c=t.MeasureLayout,f.visualElement=Y(e,p,l,i,t.ProjectionNode,a)}return(0,T.jsxs)(D.Provider,{value:f,children:[c&&f.visualElement?(0,T.jsx)(c,{visualElement:f.visualElement,...l}):null,H(e,n,re(p,f.visualElement,s),p,u,t,a,d)]})}s.displayName=`motion.${typeof e==`string`?e:`create(${e.displayName??e.name??``})`}`;let c=(0,w.forwardRef)(s);return c[J]=e,c}function ie({layoutId:e}){let t=(0,w.useContext)(l).id;return t&&e!==void 0?t+`-`+e:e}function ae(e,t){(0,w.useContext)(v).strict}function oe(e){let{drag:t,layout:n}=u();if(!t&&!n)return{};let r={...t,...n};return{MeasureLayout:t?.isEnabled(e)||n?.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}function se(e,t){if(typeof Proxy>`u`)return Q;let n=new Map,r=(n,r)=>Q(n,r,e,t);return new Proxy((e,t)=>r(e,t),{get:(i,a)=>a===`create`?r:(n.has(a)||n.set(a,Q(a,void 0,e,t)),n.get(a))})}var ce=se(),le=[.16,1,.3,1],ue=[.77,0,.175,1],de=[.32,.72,0,1],fe=`cubic-bezier(0.16, 1, 0.3, 1)`,pe={type:`spring`,stiffness:500,damping:30,mass:.6},$={type:`spring`,stiffness:460,damping:30,mass:.55},me={type:`spring`,stiffness:360,damping:32,mass:.6},he={stiffness:700,damping:50,mass:.5},ge={fast:{enter:{type:`spring`,duration:.08,bounce:0},exit:{duration:.06}},moderate:{enter:{type:`spring`,duration:.16,bounce:0},exit:{duration:.12}},slow:{enter:{type:`spring`,duration:.24,bounce:.12},exit:{duration:.16}}},_e={normal:`'wght' 400, 'opsz' 14`,medium:`'wght' 450, 'opsz' 15`,semibold:`'wght' 550, 'opsz' 20`,bold:`'wght' 700, 'opsz' 25`};export{he as a,$ as c,ce as d,E as f,fe as i,_e as l,ue as n,me as o,le as r,pe as s,de as t,ge as u};
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{t}from"./react-Cvdyeg_0.js";import{t as n}from"./jsx-runtime-NZYk81nU.js";import{Bt as r,C as i,D as a,N as o,P as s,S as c,Vt as l,a as u,c as d,d as f,f as p,i as m,j as ee,k as h,l as g,n as _,o as v,r as y,s as b,t as x,u as te,v as S,y as ne,zt as C}from"./is-ref-object-BD8OGh9C.js";var w=e(t(),1),T=n(),E=typeof window<`u`?w.useLayoutEffect:w.useEffect,D=(0,w.createContext)({});function O(e,t){if(S(e)){let{initial:t,animate:n}=e;return{initial:t===!1||c(t)?t:void 0,animate:c(n)?n:void 0}}return e.inherit===!1?{}:t}function k(e){let{initial:t,animate:n}=O(e,(0,w.useContext)(D));return(0,w.useMemo)(()=>({initial:t,animate:n}),[A(t),A(n)])}function A(e){return Array.isArray(e)?e.join(` `):e}var j=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function M(e,t,n){for(let r in t)!o(t[r])&&!p(r,n)&&(e[r]=t[r])}function N({transformTemplate:e},t){return(0,w.useMemo)(()=>{let n=j();return h(n,t,e),Object.assign({},n.vars,n.style)},[t])}function P(e,t){let n=e.style||{},r={};return M(r,n,e),Object.assign(r,N(e,t)),r}function F(e,t){let n={},r=P(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout=`none`,r.touchAction=e.drag===!0?`none`:`pan-${e.drag===`x`?`y`:`x`}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}var I=()=>({...j(),attrs:{}});function L(e,t,n,r){let i=(0,w.useMemo)(()=>{let n=I();return a(n,t,te(r),e.transformTemplate,e.style),{...n.attrs,style:{...n.style}}},[t]);if(e.style){let t={};M(t,e.style,e),i.style={...t,...i.style}}return i}var R=new Set(`animate.exit.variants.initial.style.values.variants.transition.transformTemplate.custom.inherit.onBeforeLayoutMeasure.onAnimationStart.onAnimationComplete.onUpdate.onDragStart.onDrag.onDragEnd.onMeasureDragConstraints.onDirectionLock.onDragTransitionEnd._dragX._dragY.onHoverStart.onHoverEnd.onViewportEnter.onViewportLeave.globalTapTarget.propagate.ignoreStrict.viewport`.split(`.`));function z(e){return e.startsWith(`while`)||e.startsWith(`drag`)&&e!==`draggable`||e.startsWith(`layout`)||e.startsWith(`onTap`)||e.startsWith(`onPan`)||e.startsWith(`onLayout`)||R.has(e)}function B(e,t){return e.startsWith(`on`)?!z(e):t?.(e)??!z(e)}function V(e,t,n,r){let i={};for(let a in e)(a!==`values`||typeof e.values!=`object`)&&(o(e[a])||(B(a,r)||n===!0&&z(a)||!t&&!z(a)||e.draggable&&a.startsWith(`onDrag`))&&(i[a]=e[a]));return i}function H(e,t,n,{latestValues:r},i,a=!1,s,c){let l=(s??y(e)?L:F)(t,r,i,e),u=V(t,typeof e==`string`,a,c),d=e===w.Fragment?{}:{...u,...l,ref:n},{children:f}=t,p=(0,w.useMemo)(()=>o(f)?f.get():f,[f]);return(0,w.createElement)(e,{...d,children:p})}function U({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,i){return{latestValues:W(n,r,i,e),renderState:t()}}function W(e,t,n,r){let a={},o=r(e,{});for(let e in o)a[e]=d(o[e]);let{initial:c,animate:l}=e,u=S(e),f=ne(e);t&&f&&!u&&e.inherit!==!1&&(c===void 0&&(c=t.initial),l===void 0&&(l=t.animate));let p=n?n.initial===!1:!1;p||=c===!1;let m=p?l:c;if(m&&typeof m!=`boolean`&&!i(m)){let t=Array.isArray(m)?m:[m];for(let n=0;n<t.length;n++){let r=s(e,t[n]);if(r){let{transitionEnd:e,transition:t,...n}=r;for(let e in n){let t=n[e];if(Array.isArray(t)){let e=p?t.length-1:0;t=t[e]}t!==null&&(a[e]=t)}for(let t in e)a[t]=e[t]}}}return a}var G=e=>(t,n)=>{let i=(0,w.useContext)(D),a=(0,w.useContext)(C),o=()=>U(e,t,i,a);return n?o():r(o)},K=G({scrapeMotionValuesFromProps:f,createRenderState:j}),q=G({scrapeMotionValuesFromProps:g,createRenderState:I}),J=Symbol.for(`motionComponentSymbol`);function re(e,t,n){let r=(0,w.useRef)(n);(0,w.useInsertionEffect)(()=>{r.current=n});let i=(0,w.useRef)(null);return(0,w.useCallback)(n=>{n&&e.onMount?.(n),t&&(n?t.mount(n):t.unmount());let a=r.current;if(typeof a==`function`){if(n){let e=a(n);typeof e==`function`&&(i.current=e)}else i.current?(i.current(),i.current=null):a(n)}else a&&(a.current=n)},[t])}function Y(e,t,n,r,i,a){let{visualElement:o}=(0,w.useContext)(D),s=(0,w.useContext)(v),c=(0,w.useContext)(C),l=(0,w.useContext)(b),u=l.reducedMotion,d=l.skipAnimations,f=(0,w.useRef)(null),p=(0,w.useRef)(!1);r||=s.renderer,!f.current&&r&&(f.current=r(e,{visualState:t,parent:o,props:n,presenceContext:c,blockInitialAnimation:c?c.initial===!1:!1,reducedMotionConfig:u,skipAnimations:d,isSVG:a}),p.current&&f.current&&(f.current.manuallyAnimateOnMount=!0));let m=f.current,h=(0,w.useContext)(_);m&&!m.projection&&i&&(m.type===`html`||m.type===`svg`)&&X(f.current,n,i,h);let g=(0,w.useRef)(!1);(0,w.useInsertionEffect)(()=>{m&&g.current&&m.update(n,c)});let y=n[ee],x=(0,w.useRef)(!!y&&typeof window<`u`&&!window.MotionHandoffIsComplete?.(y)&&window.MotionHasOptimisedAnimation?.(y));return E(()=>{!p.current||!m||(m.animationState?.animateChanges(),m.enteringChildren=void 0)},[]),E(()=>{p.current=!0,m&&(g.current=!0,window.MotionIsMounted=!0,m.updateFeatures(),m.scheduleRenderMicrotask(),x.current&&m.animationState&&m.animationState.animateChanges())}),(0,w.useEffect)(()=>{m&&(!x.current&&m.animationState&&m.animationState.animateChanges(),x.current&&=(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(y)}),!1),m.enteringChildren=void 0)}),m}function X(e,t,n,r){let{layoutId:i,layout:a,drag:o,dragConstraints:s,layoutScroll:c,layoutRoot:l,layoutAnchor:u,layoutCrossfade:d}=t;e.projection=new n(e.latestValues,t[`data-framer-portal-id`]?void 0:Z(e.parent)),e.projection.setOptions({layoutId:i,layout:a,alwaysMeasureLayout:!!o||s&&x(s),visualElement:e,animationType:typeof a==`string`?a:`both`,initialPromotionConfig:r,crossfade:d,layoutScroll:c,layoutRoot:l,layoutAnchor:u})}function Z(e){if(e)return e.options.allowProjection===!1?Z(e.parent):e.projection}function Q(e,{forwardMotionProps:t=!1,type:n}={},r,i){r&&m(r);let a=n?n===`svg`:y(e),o=a?q:K;function s(n,s){let c,l={...(0,w.useContext)(b),...n,layoutId:ie(n)},{isStatic:u,isValidProp:d}=l,f=k(n),p=o(n,u);if(!u&&typeof window<`u`){ae(l,r);let t=oe(l);c=t.MeasureLayout,f.visualElement=Y(e,p,l,i,t.ProjectionNode,a)}return(0,T.jsxs)(D.Provider,{value:f,children:[c&&f.visualElement?(0,T.jsx)(c,{visualElement:f.visualElement,...l}):null,H(e,n,re(p,f.visualElement,s),p,u,t,a,d)]})}s.displayName=`motion.${typeof e==`string`?e:`create(${e.displayName??e.name??``})`}`;let c=(0,w.forwardRef)(s);return c[J]=e,c}function ie({layoutId:e}){let t=(0,w.useContext)(l).id;return t&&e!==void 0?t+`-`+e:e}function ae(e,t){(0,w.useContext)(v).strict}function oe(e){let{drag:t,layout:n}=u();if(!t&&!n)return{};let r={...t,...n};return{MeasureLayout:t?.isEnabled(e)||n?.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}function se(e,t){if(typeof Proxy>`u`)return Q;let n=new Map,r=(n,r)=>Q(n,r,e,t);return new Proxy((e,t)=>r(e,t),{get:(i,a)=>a===`create`?r:(n.has(a)||n.set(a,Q(a,void 0,e,t)),n.get(a))})}var ce=se(),le=[.16,1,.3,1],ue=[.77,0,.175,1],de=[.32,.72,0,1],fe=`cubic-bezier(0.16, 1, 0.3, 1)`,pe={type:`spring`,stiffness:500,damping:30,mass:.6},$={type:`spring`,stiffness:460,damping:30,mass:.55},me={type:`spring`,stiffness:360,damping:32,mass:.6},he={stiffness:700,damping:50,mass:.5},ge={fast:{enter:{type:`spring`,duration:.08,bounce:0},exit:{duration:.06}},moderate:{enter:{type:`spring`,duration:.16,bounce:0},exit:{duration:.12}},slow:{enter:{type:`spring`,duration:.24,bounce:.12},exit:{duration:.16}}},_e={normal:`'wght' 400, 'opsz' 14`,medium:`'wght' 450, 'opsz' 15`,semibold:`'wght' 550, 'opsz' 20`,bold:`'wght' 700, 'opsz' 25`};export{he as a,$ as c,ce as d,E as f,fe as i,_e as l,ue as n,me as o,le as r,pe as s,de as t,ge as u};
|
package/dist/web/client/assets/{fork-picker-dialog-BDleMADF.js → fork-picker-dialog--dV6TE-9.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./jsx-runtime-NZYk81nU.js";import{a as t,n,o as r,r as i,t as a}from"./dialog-
|
|
1
|
+
import{t as e}from"./jsx-runtime-NZYk81nU.js";import{a as t,n,o as r,r as i,t as a}from"./dialog-DuCD5hRq.js";var o=e();function s({entries:e,onOpenChange:s,onPick:c}){let l=e!==null&&e.length>0;return(0,o.jsx)(a,{open:l,onOpenChange:s,children:(0,o.jsxs)(n,{className:`max-w-lg`,children:[(0,o.jsxs)(t,{children:[(0,o.jsx)(r,{children:`Fork from a message`}),(0,o.jsx)(i,{children:`Creates a new session branched before the selected user message.`})]}),(0,o.jsx)(`div`,{className:`flex max-h-[min(420px,60vh)] flex-col gap-1 overflow-y-auto`,children:(e??[]).map(e=>(0,o.jsxs)(`button`,{type:`button`,className:`flex w-full cursor-pointer flex-col gap-0.5 rounded-md p-2 text-left text-body leading-5 hover:bg-foreground/6`,onClick:()=>{c(e.id),s(!1)},children:[(0,o.jsx)(`span`,{className:`truncate font-medium`,children:e.preview}),(0,o.jsx)(`span`,{className:`truncate font-mono text-caption text-foreground/40`,children:e.id})]},e.id))})]})})}export{s as ForkPickerDialog};
|