@tom2012/cc-web 2026.6.12-a → 2026.6.12-c
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/backend/dist/__tests__/claude-mem-store.test.d.ts +2 -0
- package/backend/dist/__tests__/claude-mem-store.test.d.ts.map +1 -0
- package/backend/dist/__tests__/claude-mem-store.test.js +202 -0
- package/backend/dist/__tests__/claude-mem-store.test.js.map +1 -0
- package/backend/dist/claude-mem-store.d.ts +66 -0
- package/backend/dist/claude-mem-store.d.ts.map +1 -0
- package/backend/dist/claude-mem-store.js +242 -0
- package/backend/dist/claude-mem-store.js.map +1 -0
- package/backend/dist/index.d.ts.map +1 -1
- package/backend/dist/index.js +5 -0
- package/backend/dist/index.js.map +1 -1
- package/backend/dist/routes/claude-mem.d.ts +10 -0
- package/backend/dist/routes/claude-mem.d.ts.map +1 -0
- package/backend/dist/routes/claude-mem.js +80 -0
- package/backend/dist/routes/claude-mem.js.map +1 -0
- package/backend/package-lock.json +344 -2
- package/backend/package.json +2 -0
- package/frontend/dist/assets/{ChatOverlay-C6RdSj9e.js → ChatOverlay-BYHxECck.js} +3 -3
- package/frontend/dist/assets/ClaudeMemPage-AeBcDyNZ.js +1 -0
- package/frontend/dist/assets/{GraphPreview-Dw1vaeAh.js → GraphPreview-CraKSWzy.js} +2 -2
- package/frontend/dist/assets/MobilePage-FMVoG0Pl.js +14 -0
- package/frontend/dist/assets/{OfficePreview-D0_TpLvk.js → OfficePreview-DQ8oitRF.js} +2 -2
- package/frontend/dist/assets/{PdfPreview-8gw66dXT.js → PdfPreview-BX-q3oXm.js} +1 -1
- package/frontend/dist/assets/{ProjectPage-3_GsDNjW.js → ProjectPage-DbVFAUzJ.js} +5 -5
- package/frontend/dist/assets/{SettingsPage-BImUEDUD.js → SettingsPage-CoyFVnCz.js} +2 -2
- package/frontend/dist/assets/{SkillHubPage-TJxZNqMT.js → SkillHubPage-CjFCt8dE.js} +1 -1
- package/frontend/dist/assets/check-circle-2-DqS6oPDV.js +7 -0
- package/frontend/dist/assets/{chevron-down-CTVvTLhb.js → chevron-down-BPnYeDMC.js} +1 -1
- package/frontend/dist/assets/file-text-CPajDnww.js +7 -0
- package/frontend/dist/assets/index-2wJikgEX.js +75 -0
- package/frontend/dist/assets/index-61v6oszV.css +1 -0
- package/frontend/dist/assets/{index-D5PscqpS.js → index-Di5Ntujm.js} +1 -1
- package/frontend/dist/assets/index-DrpeVVUe.js +7 -0
- package/frontend/dist/assets/{jszip.min-GIboMR_6.js → jszip.min-BxSvgCaf.js} +1 -1
- package/frontend/dist/assets/{search-sJdiRvSJ.js → search-1chGdDoe.js} +1 -1
- package/frontend/dist/assets/select-YkUpG7ZI.js +1 -0
- package/frontend/dist/assets/tabs-C3yC9N14.js +13 -0
- package/frontend/dist/index.html +2 -2
- package/package.json +1 -1
- package/frontend/dist/assets/MobilePage-CDeNNMvX.js +0 -14
- package/frontend/dist/assets/index-CMlFtaTa.js +0 -75
- package/frontend/dist/assets/index-Czlx_FcC.css +0 -1
- package/frontend/dist/assets/index-o8xpeYuN.js +0 -13
- package/frontend/dist/assets/select-DGBcT103.js +0 -13
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e,j as t,a3 as n,a5 as r,R as o,a8 as i,a_ as l,aa as a,bw as s,a4 as c,b5 as d,bl as u,a9 as f,a7 as p,ab as h,ad as m,ae as g,af as y,ag as v,d as w,y as x}from"./index-2wJikgEX.js";import{u as b,c as S,C as R}from"./index-DrpeVVUe.js";import{C}from"./chevron-down-BPnYeDMC.js";function j(n){const r=P(n),o=e.forwardRef((n,o)=>{const{children:i,...l}=n,a=e.Children.toArray(i),s=a.find(A);if(s){const n=s.props.children,i=a.map(t=>t===s?e.Children.count(n)>1?e.Children.only(null):e.isValidElement(n)?n.props.children:null:t);return t.jsx(r,{...l,ref:o,children:e.isValidElement(n)?e.cloneElement(n,void 0,i):null})}return t.jsx(r,{...l,ref:o,children:i})});return o.displayName=`${n}.Slot`,o}function P(t){const r=e.forwardRef((t,r)=>{const{children:o,...i}=t;if(e.isValidElement(o)){const t=function(e){var t,n;let r=null==(t=Object.getOwnPropertyDescriptor(e.props,"ref"))?void 0:t.get,o=r&&"isReactWarning"in r&&r.isReactWarning;if(o)return e.ref;if(r=null==(n=Object.getOwnPropertyDescriptor(e,"ref"))?void 0:n.get,o=r&&"isReactWarning"in r&&r.isReactWarning,o)return e.props.ref;return e.props.ref||e.ref}(o),l=function(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...e)=>{const t=i(...e);return o(...e),t}:o&&(n[r]=o):"style"===r?n[r]={...o,...i}:"className"===r&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}(i,o.props);return o.type!==e.Fragment&&(l.ref=r?n(r,t):t),e.cloneElement(o,l)}return e.Children.count(o)>1?e.Children.only(null):null});return r.displayName=`${t}.SlotClone`,r}var N=Symbol("radix.slottable");function A(t){return e.isValidElement(t)&&"function"==typeof t.type&&"__radixId"in t.type&&t.type.__radixId===N}function E(e){const n=e+"CollectionProvider",[l,a]=r(n),[s,c]=l(n,{collectionRef:{current:null},itemMap:new Map}),d=e=>{const{scope:n,children:r}=e,i=o.useRef(null),l=o.useRef(new Map).current;return t.jsx(s,{scope:n,itemMap:l,collectionRef:i,children:r})};d.displayName=n;const u=e+"CollectionSlot",f=j(u),p=o.forwardRef((e,n)=>{const{scope:r,children:o}=e,l=c(u,r),a=i(n,l.collectionRef);return t.jsx(f,{ref:a,children:o})});p.displayName=u;const h=e+"CollectionItemSlot",m="data-radix-collection-item",g=j(h),y=o.forwardRef((e,n)=>{const{scope:r,children:l,...a}=e,s=o.useRef(null),d=i(n,s),u=c(h,r);return o.useEffect(()=>(u.itemMap.set(s,{ref:s,...a}),()=>{u.itemMap.delete(s)})),t.jsx(g,{[m]:"",ref:d,children:l})});return y.displayName=h,[{Provider:d,Slot:p,ItemSlot:y},function(t){const n=c(e+"CollectionConsumer",t);return o.useCallback(()=>{const e=n.collectionRef.current;if(!e)return[];const t=Array.from(e.querySelectorAll(`[${m}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])},a]}const T=["top","right","bottom","left"],O=Math.min,D=Math.max,_=Math.round,k=Math.floor,L=e=>({x:e,y:e}),I={left:"right",right:"left",bottom:"top",top:"bottom"};function M(e,t,n){return D(e,O(t,n))}function H(e,t){return"function"==typeof e?e(t):e}function W(e){return e.split("-")[0]}function V(e){return e.split("-")[1]}function B(e){return"x"===e?"y":"x"}function F(e){return"y"===e?"height":"width"}function z(e){const t=e[0];return"t"===t||"b"===t?"y":"x"}function $(e){return B(z(e))}function K(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const q=["left","right"],Y=["right","left"],U=["top","bottom"],X=["bottom","top"];function Z(e,t,n,r){const o=V(e);let i=function(e,t,n){switch(e){case"top":case"bottom":return n?t?Y:q:t?q:Y;case"left":case"right":return t?U:X;default:return[]}}(W(e),"start"===n,r);return o&&(i=i.map(e=>e+"-"+o),t&&(i=i.concat(i.map(K)))),i}function G(e){const t=W(e);return I[t]+e.slice(t.length)}function J(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}function Q(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function ee(e,t,n){let{reference:r,floating:o}=e;const i=z(t),l=$(t),a=F(l),s=W(t),c="y"===i,d=r.x+r.width/2-o.width/2,u=r.y+r.height/2-o.height/2,f=r[a]/2-o[a]/2;let p;switch(s){case"top":p={x:d,y:r.y-o.height};break;case"bottom":p={x:d,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:u};break;case"left":p={x:r.x-o.width,y:u};break;default:p={x:r.x,y:r.y}}switch(V(t)){case"start":p[l]-=f*(n&&c?-1:1);break;case"end":p[l]+=f*(n&&c?-1:1)}return p}async function te(e,t){var n;void 0===t&&(t={});const{x:r,y:o,platform:i,rects:l,elements:a,strategy:s}=e,{boundary:c="clippingAncestors",rootBoundary:d="viewport",elementContext:u="floating",altBoundary:f=!1,padding:p=0}=H(t,e),h=J(p),m=a[f?"floating"===u?"reference":"floating":u],g=Q(await i.getClippingRect({element:null==(n=await(null==i.isElement?void 0:i.isElement(m)))||n?m:m.contextElement||await(null==i.getDocumentElement?void 0:i.getDocumentElement(a.floating)),boundary:c,rootBoundary:d,strategy:s})),y="floating"===u?{x:r,y:o,width:l.floating.width,height:l.floating.height}:l.reference,v=await(null==i.getOffsetParent?void 0:i.getOffsetParent(a.floating)),w=await(null==i.isElement?void 0:i.isElement(v))&&await(null==i.getScale?void 0:i.getScale(v))||{x:1,y:1},x=Q(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:y,offsetParent:v,strategy:s}):y);return{top:(g.top-x.top+h.top)/w.y,bottom:(x.bottom-g.bottom+h.bottom)/w.y,left:(g.left-x.left+h.left)/w.x,right:(x.right-g.right+h.right)/w.x}}function ne(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function re(e){return T.some(t=>e[t]>=0)}const oe=new Set(["left","top"]);function ie(){return"undefined"!=typeof window}function le(e){return ce(e)?(e.nodeName||"").toLowerCase():"#document"}function ae(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function se(e){var t;return null==(t=(ce(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function ce(e){return!!ie()&&(e instanceof Node||e instanceof ae(e).Node)}function de(e){return!!ie()&&(e instanceof Element||e instanceof ae(e).Element)}function ue(e){return!!ie()&&(e instanceof HTMLElement||e instanceof ae(e).HTMLElement)}function fe(e){return!(!ie()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof ae(e).ShadowRoot)}function pe(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=Re(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&"inline"!==o&&"contents"!==o}function he(e){return/^(table|td|th)$/.test(le(e))}function me(e){try{if(e.matches(":popover-open"))return!0}catch(t){}try{return e.matches(":modal")}catch(t){return!1}}const ge=/transform|translate|scale|rotate|perspective|filter/,ye=/paint|layout|strict|content/,ve=e=>!!e&&"none"!==e;let we;function xe(e){const t=de(e)?Re(e):e;return ve(t.transform)||ve(t.translate)||ve(t.scale)||ve(t.rotate)||ve(t.perspective)||!be()&&(ve(t.backdropFilter)||ve(t.filter))||ge.test(t.willChange||"")||ye.test(t.contain||"")}function be(){return null==we&&(we="undefined"!=typeof CSS&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),we}function Se(e){return/^(html|body|#document)$/.test(le(e))}function Re(e){return ae(e).getComputedStyle(e)}function Ce(e){return de(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function je(e){if("html"===le(e))return e;const t=e.assignedSlot||e.parentNode||fe(e)&&e.host||se(e);return fe(t)?t.host:t}function Pe(e){const t=je(e);return Se(t)?e.ownerDocument?e.ownerDocument.body:e.body:ue(t)&&pe(t)?t:Pe(t)}function Ne(e,t,n){var r;void 0===t&&(t=[]),void 0===n&&(n=!0);const o=Pe(e),i=o===(null==(r=e.ownerDocument)?void 0:r.body),l=ae(o);if(i){const e=Ae(l);return t.concat(l,l.visualViewport||[],pe(o)?o:[],e&&n?Ne(e):[])}return t.concat(o,Ne(o,[],n))}function Ae(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Ee(e){const t=Re(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=ue(e),i=o?e.offsetWidth:n,l=o?e.offsetHeight:r,a=_(n)!==i||_(r)!==l;return a&&(n=i,r=l),{width:n,height:r,$:a}}function Te(e){return de(e)?e:e.contextElement}function Oe(e){const t=Te(e);if(!ue(t))return L(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=Ee(t);let l=(i?_(n.width):n.width)/r,a=(i?_(n.height):n.height)/o;return l&&Number.isFinite(l)||(l=1),a&&Number.isFinite(a)||(a=1),{x:l,y:a}}const De=L(0);function _e(e){const t=ae(e);return be()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:De}function ke(e,t,n,r){void 0===t&&(t=!1),void 0===n&&(n=!1);const o=e.getBoundingClientRect(),i=Te(e);let l=L(1);t&&(r?de(r)&&(l=Oe(r)):l=Oe(e));const a=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==ae(e))&&t}(i,n,r)?_e(i):L(0);let s=(o.left+a.x)/l.x,c=(o.top+a.y)/l.y,d=o.width/l.x,u=o.height/l.y;if(i){const e=ae(i),t=r&&de(r)?ae(r):r;let n=e,o=Ae(n);for(;o&&r&&t!==n;){const e=Oe(o),t=o.getBoundingClientRect(),r=Re(o),i=t.left+(o.clientLeft+parseFloat(r.paddingLeft))*e.x,l=t.top+(o.clientTop+parseFloat(r.paddingTop))*e.y;s*=e.x,c*=e.y,d*=e.x,u*=e.y,s+=i,c+=l,n=ae(o),o=Ae(n)}}return Q({width:d,height:u,x:s,y:c})}function Le(e,t){const n=Ce(e).scrollLeft;return t?t.left+n:ke(se(e)).left+n}function Ie(e,t){const n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-Le(e,n),y:n.top+t.scrollTop}}function Me(e,t,n){let r;if("viewport"===t)r=function(e,t){const n=ae(e),r=se(e),o=n.visualViewport;let i=r.clientWidth,l=r.clientHeight,a=0,s=0;if(o){i=o.width,l=o.height;const e=be();(!e||e&&"fixed"===t)&&(a=o.offsetLeft,s=o.offsetTop)}const c=Le(r);if(c<=0){const e=r.ownerDocument,t=e.body,n=getComputedStyle(t),o="CSS1Compat"===e.compatMode&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,l=Math.abs(r.clientWidth-t.clientWidth-o);l<=25&&(i-=l)}else c<=25&&(i+=c);return{width:i,height:l,x:a,y:s}}(e,n);else if("document"===t)r=function(e){const t=se(e),n=Ce(e),r=e.ownerDocument.body,o=D(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=D(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let l=-n.scrollLeft+Le(e);const a=-n.scrollTop;return"rtl"===Re(r).direction&&(l+=D(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:l,y:a}}(se(e));else if(de(t))r=function(e,t){const n=ke(e,!0,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=ue(e)?Oe(e):L(1);return{width:e.clientWidth*i.x,height:e.clientHeight*i.y,x:o*i.x,y:r*i.y}}(t,n);else{const n=_e(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return Q(r)}function He(e,t){const n=je(e);return!(n===t||!de(n)||Se(n))&&("fixed"===Re(n).position||He(n,t))}function We(e,t,n){const r=ue(t),o=se(t),i="fixed"===n,l=ke(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const s=L(0);function c(){s.x=Le(o)}if(r||!r&&!i)if(("body"!==le(t)||pe(o))&&(a=Ce(t)),r){const e=ke(t,!0,i,t);s.x=e.x+t.clientLeft,s.y=e.y+t.clientTop}else o&&c();i&&!r&&o&&c();const d=!o||r||i?L(0):Ie(o,a);return{x:l.left+a.scrollLeft-s.x-d.x,y:l.top+a.scrollTop-s.y-d.y,width:l.width,height:l.height}}function Ve(e){return"static"===Re(e).position}function Be(e,t){if(!ue(e)||"fixed"===Re(e).position)return null;if(t)return t(e);let n=e.offsetParent;return se(e)===n&&(n=n.ownerDocument.body),n}function Fe(e,t){const n=ae(e);if(me(e))return n;if(!ue(e)){let t=je(e);for(;t&&!Se(t);){if(de(t)&&!Ve(t))return t;t=je(t)}return n}let r=Be(e,t);for(;r&&he(r)&&Ve(r);)r=Be(r,t);return r&&Se(r)&&Ve(r)&&!xe(r)?n:r||function(e){let t=je(e);for(;ue(t)&&!Se(t);){if(xe(t))return t;if(me(t))return null;t=je(t)}return null}(e)||n}const ze={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i="fixed"===o,l=se(r),a=!!t&&me(t.floating);if(r===l||a&&i)return n;let s={scrollLeft:0,scrollTop:0},c=L(1);const d=L(0),u=ue(r);if((u||!u&&!i)&&(("body"!==le(r)||pe(l))&&(s=Ce(r)),u)){const e=ke(r);c=Oe(r),d.x=e.x+r.clientLeft,d.y=e.y+r.clientTop}const f=!l||u||i?L(0):Ie(l,s);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-s.scrollLeft*c.x+d.x+f.x,y:n.y*c.y-s.scrollTop*c.y+d.y+f.y}},getDocumentElement:se,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[..."clippingAncestors"===n?me(t)?[]:function(e,t){const n=t.get(e);if(n)return n;let r=Ne(e,[],!1).filter(e=>de(e)&&"body"!==le(e)),o=null;const i="fixed"===Re(e).position;let l=i?je(e):e;for(;de(l)&&!Se(l);){const t=Re(l),n=xe(l);n||"fixed"!==t.position||(o=null),(i?!n&&!o:!n&&"static"===t.position&&o&&("absolute"===o.position||"fixed"===o.position)||pe(l)&&!n&&He(e,l))?r=r.filter(e=>e!==l):o=t,l=je(l)}return t.set(e,r),r}(t,this._c):[].concat(n),r],l=Me(t,i[0],o);let a=l.top,s=l.right,c=l.bottom,d=l.left;for(let u=1;u<i.length;u++){const e=Me(t,i[u],o);a=D(e.top,a),s=O(e.right,s),c=O(e.bottom,c),d=D(e.left,d)}return{width:s-d,height:c-a,x:d,y:a}},getOffsetParent:Fe,getElementRects:async function(e){const t=this.getOffsetParent||Fe,n=this.getDimensions,r=await n(e.floating);return{reference:We(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:n}=Ee(e);return{width:t,height:n}},getScale:Oe,isElement:de,isRTL:function(e){return"rtl"===Re(e).direction}};function $e(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Ke(e,t,n,r){void 0===r&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:l="function"==typeof ResizeObserver,layoutShift:a="function"==typeof IntersectionObserver,animationFrame:s=!1}=r,c=Te(e),d=o||i?[...c?Ne(c):[],...t?Ne(t):[]]:[];d.forEach(e=>{o&&e.addEventListener("scroll",n,{passive:!0}),i&&e.addEventListener("resize",n)});const u=c&&a?function(e,t){let n,r=null;const o=se(e);function i(){var e;clearTimeout(n),null==(e=r)||e.disconnect(),r=null}return function l(a,s){void 0===a&&(a=!1),void 0===s&&(s=1),i();const c=e.getBoundingClientRect(),{left:d,top:u,width:f,height:p}=c;if(a||t(),!f||!p)return;const h={rootMargin:-k(u)+"px "+-k(o.clientWidth-(d+f))+"px "+-k(o.clientHeight-(u+p))+"px "+-k(d)+"px",threshold:D(0,O(1,s))||1};let m=!0;function g(t){const r=t[0].intersectionRatio;if(r!==s){if(!m)return l();r?l(!1,r):n=setTimeout(()=>{l(!1,1e-7)},1e3)}1!==r||$e(c,e.getBoundingClientRect())||l(),m=!1}try{r=new IntersectionObserver(g,{...h,root:o.ownerDocument})}catch(y){r=new IntersectionObserver(g,h)}r.observe(e)}(!0),i}(c,n):null;let f,p=-1,h=null;l&&(h=new ResizeObserver(e=>{let[r]=e;r&&r.target===c&&h&&t&&(h.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var e;null==(e=h)||e.observe(t)})),n()}),c&&!s&&h.observe(c),t&&h.observe(t));let m=s?ke(e):null;return s&&function t(){const r=ke(e);m&&!$e(m,r)&&n();m=r,f=requestAnimationFrame(t)}(),n(),()=>{var e;d.forEach(e=>{o&&e.removeEventListener("scroll",n),i&&e.removeEventListener("resize",n)}),null==u||u(),null==(e=h)||e.disconnect(),h=null,s&&cancelAnimationFrame(f)}}const qe=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:l,middlewareData:a}=t,s=await async function(e,t){const{placement:n,platform:r,elements:o}=e,i=await(null==r.isRTL?void 0:r.isRTL(o.floating)),l=W(n),a=V(n),s="y"===z(n),c=oe.has(l)?-1:1,d=i&&s?-1:1,u=H(t,e);let{mainAxis:f,crossAxis:p,alignmentAxis:h}="number"==typeof u?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:u.mainAxis||0,crossAxis:u.crossAxis||0,alignmentAxis:u.alignmentAxis};return a&&"number"==typeof h&&(p="end"===a?-1*h:h),s?{x:p*d,y:f*c}:{x:f*c,y:p*d}}(t,e);return l===(null==(n=a.offset)?void 0:n.placement)&&null!=(r=a.arrow)&&r.alignmentOffset?{}:{x:o+s.x,y:i+s.y,data:{...s,placement:l}}}}},Ye=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o,platform:i}=t,{mainAxis:l=!0,crossAxis:a=!1,limiter:s={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...c}=H(e,t),d={x:n,y:r},u=await i.detectOverflow(t,c),f=z(W(o)),p=B(f);let h=d[p],m=d[f];if(l){const e="y"===p?"bottom":"right";h=M(h+u["y"===p?"top":"left"],h,h-u[e])}if(a){const e="y"===f?"bottom":"right";m=M(m+u["y"===f?"top":"left"],m,m-u[e])}const g=s.fn({...t,[p]:h,[f]:m});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[p]:l,[f]:a}}}}}},Ue=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:l,initialPlacement:a,platform:s,elements:c}=t,{mainAxis:d=!0,crossAxis:u=!0,fallbackPlacements:f,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:m=!0,...g}=H(e,t);if(null!=(n=i.arrow)&&n.alignmentOffset)return{};const y=W(o),v=z(a),w=W(a)===a,x=await(null==s.isRTL?void 0:s.isRTL(c.floating)),b=f||(w||!m?[G(a)]:function(e){const t=G(e);return[K(e),t,K(t)]}(a)),S="none"!==h;!f&&S&&b.push(...Z(a,m,h,x));const R=[a,...b],C=await s.detectOverflow(t,g),j=[];let P=(null==(r=i.flip)?void 0:r.overflows)||[];if(d&&j.push(C[y]),u){const e=function(e,t,n){void 0===n&&(n=!1);const r=V(e),o=$(e),i=F(o);let l="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[i]>t.floating[i]&&(l=G(l)),[l,G(l)]}(o,l,x);j.push(C[e[0]],C[e[1]])}if(P=[...P,{placement:o,overflows:j}],!j.every(e=>e<=0)){var N,A;const e=((null==(N=i.flip)?void 0:N.index)||0)+1,t=R[e];if(t){if(!("alignment"===u&&v!==z(t))||P.every(e=>z(e.placement)!==v||e.overflows[0]>0))return{data:{index:e,overflows:P},reset:{placement:t}}}let n=null==(A=P.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:A.placement;if(!n)switch(p){case"bestFit":{var E;const e=null==(E=P.filter(e=>{if(S){const t=z(e.placement);return t===v||"y"===t}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0])?void 0:E[0];e&&(n=e);break}case"initialPlacement":n=a}if(o!==n)return{reset:{placement:n}}}return{}}}},Xe=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:i,platform:l,elements:a}=t,{apply:s=()=>{},...c}=H(e,t),d=await l.detectOverflow(t,c),u=W(o),f=V(o),p="y"===z(o),{width:h,height:m}=i.floating;let g,y;"top"===u||"bottom"===u?(g=u,y=f===(await(null==l.isRTL?void 0:l.isRTL(a.floating))?"start":"end")?"left":"right"):(y=u,g="end"===f?"top":"bottom");const v=m-d.top-d.bottom,w=h-d.left-d.right,x=O(m-d[g],v),b=O(h-d[y],w),S=!t.middlewareData.shift;let R=x,C=b;if(null!=(n=t.middlewareData.shift)&&n.enabled.x&&(C=w),null!=(r=t.middlewareData.shift)&&r.enabled.y&&(R=v),S&&!f){const e=D(d.left,0),t=D(d.right,0),n=D(d.top,0),r=D(d.bottom,0);p?C=h-2*(0!==e||0!==t?e+t:D(d.left,d.right)):R=m-2*(0!==n||0!==r?n+r:D(d.top,d.bottom))}await s({...t,availableWidth:C,availableHeight:R});const j=await l.getDimensions(a.floating);return h!==j.width||m!==j.height?{reset:{rects:!0}}:{}}}},Ze=function(e){return void 0===e&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:o="referenceHidden",...i}=H(e,t);switch(o){case"referenceHidden":{const e=ne(await r.detectOverflow(t,{...i,elementContext:"reference"}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:re(e)}}}case"escaped":{const e=ne(await r.detectOverflow(t,{...i,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:re(e)}}}default:return{}}}}},Ge=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:l,elements:a,middlewareData:s}=t,{element:c,padding:d=0}=H(e,t)||{};if(null==c)return{};const u=J(d),f={x:n,y:r},p=$(o),h=F(p),m=await l.getDimensions(c),g="y"===p,y=g?"top":"left",v=g?"bottom":"right",w=g?"clientHeight":"clientWidth",x=i.reference[h]+i.reference[p]-f[p]-i.floating[h],b=f[p]-i.reference[p],S=await(null==l.getOffsetParent?void 0:l.getOffsetParent(c));let R=S?S[w]:0;R&&await(null==l.isElement?void 0:l.isElement(S))||(R=a.floating[w]||i.floating[h]);const C=x/2-b/2,j=R/2-m[h]/2-1,P=O(u[y],j),N=O(u[v],j),A=P,E=R-m[h]-N,T=R/2-m[h]/2+C,D=M(A,T,E),_=!s.arrow&&null!=V(o)&&T!==D&&i.reference[h]/2-(T<A?P:N)-m[h]/2<0,k=_?T<A?T-A:T-E:0;return{[p]:f[p]+k,data:{[p]:D,centerOffset:T-D-k,..._&&{alignmentOffset:k}},reset:_}}}),Je=function(e){return void 0===e&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:i,middlewareData:l}=t,{offset:a=0,mainAxis:s=!0,crossAxis:c=!0}=H(e,t),d={x:n,y:r},u=z(o),f=B(u);let p=d[f],h=d[u];const m=H(a,t),g="number"==typeof m?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(s){const e="y"===f?"height":"width",t=i.reference[f]-i.floating[e]+g.mainAxis,n=i.reference[f]+i.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(c){var y,v;const e="y"===f?"width":"height",t=oe.has(W(o)),n=i.reference[u]-i.floating[e]+(t&&(null==(y=l.offset)?void 0:y[u])||0)+(t?0:g.crossAxis),r=i.reference[u]+i.reference[e]+(t?0:(null==(v=l.offset)?void 0:v[u])||0)-(t?g.crossAxis:0);h<n?h=n:h>r&&(h=r)}return{[f]:p,[u]:h}}}},Qe=(e,t,n)=>{const r=new Map,o={platform:ze,...n},i={...o.platform,_c:r};return(async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:l}=n,a=l.detectOverflow?l:{...l,detectOverflow:te},s=await(null==l.isRTL?void 0:l.isRTL(t));let c=await l.getElementRects({reference:e,floating:t,strategy:o}),{x:d,y:u}=ee(c,r,s),f=r,p=0;const h={};for(let m=0;m<i.length;m++){const n=i[m];if(!n)continue;const{name:g,fn:y}=n,{x:v,y:w,data:x,reset:b}=await y({x:d,y:u,initialPlacement:r,placement:f,strategy:o,middlewareData:h,rects:c,platform:a,elements:{reference:e,floating:t}});d=null!=v?v:d,u=null!=w?w:u,h[g]={...h[g],...x},b&&p<50&&(p++,"object"==typeof b&&(b.placement&&(f=b.placement),b.rects&&(c=!0===b.rects?await l.getElementRects({reference:e,floating:t,strategy:o}):b.rects),({x:d,y:u}=ee(c,f,s))),m=-1)}return{x:d,y:u,placement:f,strategy:o,middlewareData:h}})(e,t,{...o,platform:i})};var et="undefined"!=typeof document?e.useLayoutEffect:function(){};function tt(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;0!==r--;)if(!tt(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;0!==r--;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;0!==r--;){const n=o[r];if(("_owner"!==n||!e.$$typeof)&&!tt(e[n],t[n]))return!1}return!0}return e!=e&&t!=t}function nt(e){if("undefined"==typeof window)return 1;return(e.ownerDocument.defaultView||window).devicePixelRatio||1}function rt(e,t){const n=nt(e);return Math.round(t*n)/n}function ot(t){const n=e.useRef(t);return et(()=>{n.current=t}),n}const it=(e,t)=>{const n=qe(e);return{name:n.name,fn:n.fn,options:[e,t]}},lt=(e,t)=>{const n=Ye(e);return{name:n.name,fn:n.fn,options:[e,t]}},at=(e,t)=>{const n=Ue(e);return{name:n.name,fn:n.fn,options:[e,t]}},st=(e,t)=>{const n=Xe(e);return{name:n.name,fn:n.fn,options:[e,t]}},ct=(e,t)=>{const n=Ze(e);return{name:n.name,fn:n.fn,options:[e,t]}},dt=(e,t)=>{const n=(e=>({name:"arrow",options:e,fn(t){const{element:n,padding:r}="function"==typeof e?e(t):e;return n&&(o=n,{}.hasOwnProperty.call(o,"current"))?null!=n.current?Ge({element:n.current,padding:r}).fn(t):{}:n?Ge({element:n,padding:r}).fn(t):{};var o}}))(e);return{name:n.name,fn:n.fn,options:[e,t]}};var ut=e.forwardRef((e,n)=>{const{children:r,width:o=10,height:i=5,...l}=e;return t.jsx(a.svg,{...l,ref:n,width:o,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:t.jsx("polygon",{points:"0,0 30,0 15,10"})})});ut.displayName="Arrow";var ft=ut;function pt(t){const[n,r]=e.useState(void 0);return s(()=>{if(t){r({width:t.offsetWidth,height:t.offsetHeight});const e=new ResizeObserver(e=>{if(!Array.isArray(e))return;if(!e.length)return;const n=e[0];let o,i;if("borderBoxSize"in n){const e=n.borderBoxSize,t=Array.isArray(e)?e[0]:e;o=t.inlineSize,i=t.blockSize}else o=t.offsetWidth,i=t.offsetHeight;r({width:o,height:i})});return e.observe(t,{box:"border-box"}),()=>e.unobserve(t)}r(void 0)},[t]),n}var ht="Popper",[mt,gt]=r(ht),[yt,vt]=mt(ht),wt=n=>{const{__scopePopper:r,children:o}=n,[i,l]=e.useState(null);return t.jsx(yt,{scope:r,anchor:i,onAnchorChange:l,children:o})};wt.displayName=ht;var xt="PopperAnchor",bt=e.forwardRef((n,r)=>{const{__scopePopper:o,virtualRef:l,...s}=n,c=vt(xt,o),d=e.useRef(null),u=i(r,d),f=e.useRef(null);return e.useEffect(()=>{const e=f.current;f.current=(null==l?void 0:l.current)||d.current,e!==f.current&&c.onAnchorChange(f.current)}),l?null:t.jsx(a.div,{...s,ref:u})});bt.displayName=xt;var St="PopperContent",[Rt,Ct]=mt(St),jt=e.forwardRef((n,r)=>{var o,d,u,f,p,h;const{__scopePopper:m,side:g="bottom",sideOffset:y=0,align:v="center",alignOffset:w=0,arrowPadding:x=0,avoidCollisions:b=!0,collisionBoundary:S=[],collisionPadding:R=0,sticky:C="partial",hideWhenDetached:j=!1,updatePositionStrategy:P="optimized",onPlaced:N,...A}=n,E=vt(St,m),[T,O]=e.useState(null),D=i(r,e=>O(e)),[_,k]=e.useState(null),L=pt(_),I=(null==L?void 0:L.width)??0,M=(null==L?void 0:L.height)??0,H=g+("center"!==v?"-"+v:""),W="number"==typeof R?R:{top:0,right:0,bottom:0,left:0,...R},V=Array.isArray(S)?S:[S],B=V.length>0,F={padding:W,boundary:V.filter(Et),altBoundary:B},{refs:z,floatingStyles:$,placement:K,isPositioned:q,middlewareData:Y}=function(t){void 0===t&&(t={});const{placement:n="bottom",strategy:r="absolute",middleware:o=[],platform:i,elements:{reference:a,floating:s}={},transform:c=!0,whileElementsMounted:d,open:u}=t,[f,p]=e.useState({x:0,y:0,strategy:r,placement:n,middlewareData:{},isPositioned:!1}),[h,m]=e.useState(o);tt(h,o)||m(o);const[g,y]=e.useState(null),[v,w]=e.useState(null),x=e.useCallback(e=>{e!==C.current&&(C.current=e,y(e))},[]),b=e.useCallback(e=>{e!==j.current&&(j.current=e,w(e))},[]),S=a||g,R=s||v,C=e.useRef(null),j=e.useRef(null),P=e.useRef(f),N=null!=d,A=ot(d),E=ot(i),T=ot(u),O=e.useCallback(()=>{if(!C.current||!j.current)return;const e={placement:n,strategy:r,middleware:h};E.current&&(e.platform=E.current),Qe(C.current,j.current,e).then(e=>{const t={...e,isPositioned:!1!==T.current};D.current&&!tt(P.current,t)&&(P.current=t,l.flushSync(()=>{p(t)}))})},[h,n,r,E,T]);et(()=>{!1===u&&P.current.isPositioned&&(P.current.isPositioned=!1,p(e=>({...e,isPositioned:!1})))},[u]);const D=e.useRef(!1);et(()=>(D.current=!0,()=>{D.current=!1}),[]),et(()=>{if(S&&(C.current=S),R&&(j.current=R),S&&R){if(A.current)return A.current(S,R,O);O()}},[S,R,O,A,N]);const _=e.useMemo(()=>({reference:C,floating:j,setReference:x,setFloating:b}),[x,b]),k=e.useMemo(()=>({reference:S,floating:R}),[S,R]),L=e.useMemo(()=>{const e={position:r,left:0,top:0};if(!k.floating)return e;const t=rt(k.floating,f.x),n=rt(k.floating,f.y);return c?{...e,transform:"translate("+t+"px, "+n+"px)",...nt(k.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:t,top:n}},[r,c,k.floating,f.x,f.y]);return e.useMemo(()=>({...f,update:O,refs:_,elements:k,floatingStyles:L}),[f,O,_,k,L])}({strategy:"fixed",placement:H,whileElementsMounted:(...e)=>Ke(...e,{animationFrame:"always"===P}),elements:{reference:E.anchor},middleware:[it({mainAxis:y+M,alignmentAxis:w}),b&<({mainAxis:!0,crossAxis:!1,limiter:"partial"===C?{fn:Je(U).fn,options:[U,X]}:void 0,...F}),b&&at({...F}),st({...F,apply:({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{const{width:o,height:i}=t.reference,l=e.floating.style;l.setProperty("--radix-popper-available-width",`${n}px`),l.setProperty("--radix-popper-available-height",`${r}px`),l.setProperty("--radix-popper-anchor-width",`${o}px`),l.setProperty("--radix-popper-anchor-height",`${i}px`)}}),_&&dt({element:_,padding:x}),Tt({arrowWidth:I,arrowHeight:M}),j&&ct({strategy:"referenceHidden",...F})]});var U,X;const[Z,G]=Ot(K),J=c(N);s(()=>{q&&(null==J||J())},[q,J]);const Q=null==(o=Y.arrow)?void 0:o.x,ee=null==(d=Y.arrow)?void 0:d.y,te=0!==(null==(u=Y.arrow)?void 0:u.centerOffset),[ne,re]=e.useState();return s(()=>{T&&re(window.getComputedStyle(T).zIndex)},[T]),t.jsx("div",{ref:z.setFloating,"data-radix-popper-content-wrapper":"",style:{...$,transform:q?$.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ne,"--radix-popper-transform-origin":[null==(f=Y.transformOrigin)?void 0:f.x,null==(p=Y.transformOrigin)?void 0:p.y].join(" "),...(null==(h=Y.hide)?void 0:h.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:n.dir,children:t.jsx(Rt,{scope:m,placedSide:Z,onArrowChange:k,arrowX:Q,arrowY:ee,shouldHideArrow:te,children:t.jsx(a.div,{"data-side":Z,"data-align":G,...A,ref:D,style:{...A.style,animation:q?void 0:"none"}})})})});jt.displayName=St;var Pt="PopperArrow",Nt={top:"bottom",right:"left",bottom:"top",left:"right"},At=e.forwardRef(function(e,n){const{__scopePopper:r,...o}=e,i=Ct(Pt,r),l=Nt[i.placedSide];return t.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[l]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:t.jsx(ft,{...o,ref:n,style:{...o.style,display:"block"}})})});function Et(e){return null!==e}At.displayName=Pt;var Tt=e=>({name:"transformOrigin",options:e,fn(t){var n,r,o;const{placement:i,rects:l,middlewareData:a}=t,s=0!==(null==(n=a.arrow)?void 0:n.centerOffset),c=s?0:e.arrowWidth,d=s?0:e.arrowHeight,[u,f]=Ot(i),p={start:"0%",center:"50%",end:"100%"}[f],h=((null==(r=a.arrow)?void 0:r.x)??0)+c/2,m=((null==(o=a.arrow)?void 0:o.y)??0)+d/2;let g="",y="";return"bottom"===u?(g=s?p:`${h}px`,y=-d+"px"):"top"===u?(g=s?p:`${h}px`,y=`${l.floating.height+d}px`):"right"===u?(g=-d+"px",y=s?p:`${m}px`):"left"===u&&(g=`${l.floating.width+d}px`,y=s?p:`${m}px`),{data:{x:g,y:y}}}});function Ot(e){const[t,n="center"]=e.split("-");return[t,n]}var Dt=wt,_t=bt,kt=jt,Lt=At;function It(n){const r=Mt(n),o=e.forwardRef((n,o)=>{const{children:i,...l}=n,a=e.Children.toArray(i),s=a.find(Wt);if(s){const n=s.props.children,i=a.map(t=>t===s?e.Children.count(n)>1?e.Children.only(null):e.isValidElement(n)?n.props.children:null:t);return t.jsx(r,{...l,ref:o,children:e.isValidElement(n)?e.cloneElement(n,void 0,i):null})}return t.jsx(r,{...l,ref:o,children:i})});return o.displayName=`${n}.Slot`,o}function Mt(t){const r=e.forwardRef((t,r)=>{const{children:o,...i}=t;if(e.isValidElement(o)){const t=function(e){var t,n;let r=null==(t=Object.getOwnPropertyDescriptor(e.props,"ref"))?void 0:t.get,o=r&&"isReactWarning"in r&&r.isReactWarning;if(o)return e.ref;if(r=null==(n=Object.getOwnPropertyDescriptor(e,"ref"))?void 0:n.get,o=r&&"isReactWarning"in r&&r.isReactWarning,o)return e.props.ref;return e.props.ref||e.ref}(o),l=function(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...e)=>{const t=i(...e);return o(...e),t}:o&&(n[r]=o):"style"===r?n[r]={...o,...i}:"className"===r&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}(i,o.props);return o.type!==e.Fragment&&(l.ref=r?n(r,t):t),e.cloneElement(o,l)}return e.Children.count(o)>1?e.Children.only(null):null});return r.displayName=`${t}.SlotClone`,r}var Ht=Symbol("radix.slottable");function Wt(t){return e.isValidElement(t)&&"function"==typeof t.type&&"__radixId"in t.type&&t.type.__radixId===Ht}function Vt(t){const n=e.useRef({value:t,previous:t});return e.useMemo(()=>(n.current.value!==t&&(n.current.previous=n.current.value,n.current.value=t),n.current.previous),[t])}var Bt=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"});e.forwardRef((e,n)=>t.jsx(a.span,{...e,ref:n,style:{...Bt,...e.style}})).displayName="VisuallyHidden";var Ft=[" ","Enter","ArrowUp","ArrowDown"],zt=[" ","Enter"],$t="Select",[Kt,qt,Yt]=E($t),[Ut]=r($t,[Yt,gt]),Xt=gt(),[Zt,Gt]=Ut($t),[Jt,Qt]=Ut($t),en=n=>{const{__scopeSelect:r,children:o,open:i,defaultOpen:l,onOpenChange:a,value:s,defaultValue:c,onValueChange:f,dir:p,name:h,autoComplete:m,disabled:g,required:y,form:v}=n,w=Xt(r),[x,S]=e.useState(null),[R,C]=e.useState(null),[j,P]=e.useState(!1),N=b(p),[A,E]=d({prop:i,defaultProp:l??!1,onChange:a,caller:$t}),[T,O]=d({prop:s,defaultProp:c,onChange:f,caller:$t}),D=e.useRef(null),_=!x||(v||!!x.closest("form")),[k,L]=e.useState(new Set),I=Array.from(k).map(e=>e.props.value).join(";");return t.jsx(Dt,{...w,children:t.jsxs(Zt,{required:y,scope:r,trigger:x,onTriggerChange:S,valueNode:R,onValueNodeChange:C,valueNodeHasChildren:j,onValueNodeHasChildrenChange:P,contentId:u(),value:T,onValueChange:O,open:A,onOpenChange:E,dir:N,triggerPointerDownPosRef:D,disabled:g,children:[t.jsx(Kt.Provider,{scope:r,children:t.jsx(Jt,{scope:n.__scopeSelect,onNativeOptionAdd:e.useCallback(e=>{L(t=>new Set(t).add(e))},[]),onNativeOptionRemove:e.useCallback(e=>{L(t=>{const n=new Set(t);return n.delete(e),n})},[]),children:o})}),_?t.jsxs(Bn,{"aria-hidden":!0,required:y,tabIndex:-1,name:h,autoComplete:m,value:T,onChange:e=>O(e.target.value),disabled:g,form:v,children:[void 0===T?t.jsx("option",{value:""}):null,Array.from(k)]},I):null]})})};en.displayName=$t;var tn="SelectTrigger",nn=e.forwardRef((n,r)=>{const{__scopeSelect:o,disabled:l=!1,...s}=n,c=Xt(o),d=Gt(tn,o),u=d.disabled||l,p=i(r,d.onTriggerChange),h=qt(o),m=e.useRef("touch"),[g,y,v]=zn(e=>{const t=h().filter(e=>!e.disabled),n=t.find(e=>e.value===d.value),r=$n(t,e,n);void 0!==r&&d.onValueChange(r.value)}),w=e=>{u||(d.onOpenChange(!0),v()),e&&(d.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})};return t.jsx(_t,{asChild:!0,...c,children:t.jsx(a.button,{type:"button",role:"combobox","aria-controls":d.contentId,"aria-expanded":d.open,"aria-required":d.required,"aria-autocomplete":"none",dir:d.dir,"data-state":d.open?"open":"closed",disabled:u,"data-disabled":u?"":void 0,"data-placeholder":Fn(d.value)?"":void 0,...s,ref:p,onClick:f(s.onClick,e=>{e.currentTarget.focus(),"mouse"!==m.current&&w(e)}),onPointerDown:f(s.onPointerDown,e=>{m.current=e.pointerType;const t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),0===e.button&&!1===e.ctrlKey&&"mouse"===e.pointerType&&(w(e),e.preventDefault())}),onKeyDown:f(s.onKeyDown,e=>{const t=""!==g.current;e.ctrlKey||e.altKey||e.metaKey||1!==e.key.length||y(e.key),t&&" "===e.key||Ft.includes(e.key)&&(w(),e.preventDefault())})})})});nn.displayName=tn;var rn="SelectValue",on=e.forwardRef((e,n)=>{const{__scopeSelect:r,className:o,style:l,children:c,placeholder:d="",...u}=e,f=Gt(rn,r),{onValueNodeHasChildrenChange:p}=f,h=void 0!==c,m=i(n,f.onValueNodeChange);return s(()=>{p(h)},[p,h]),t.jsx(a.span,{...u,ref:m,style:{pointerEvents:"none"},children:Fn(f.value)?t.jsx(t.Fragment,{children:d}):c})});on.displayName=rn;var ln=e.forwardRef((e,n)=>{const{__scopeSelect:r,children:o,...i}=e;return t.jsx(a.span,{"aria-hidden":!0,...i,ref:n,children:o||"▼"})});ln.displayName="SelectIcon";var an=e=>t.jsx(p,{asChild:!0,...e});an.displayName="SelectPortal";var sn="SelectContent",cn=e.forwardRef((n,r)=>{const o=Gt(sn,n.__scopeSelect),[i,a]=e.useState();if(s(()=>{a(new DocumentFragment)},[]),!o.open){const e=i;return e?l.createPortal(t.jsx(un,{scope:n.__scopeSelect,children:t.jsx(Kt.Slot,{scope:n.__scopeSelect,children:t.jsx("div",{children:n.children})})}),e):null}return t.jsx(hn,{...n,ref:r})});cn.displayName=sn;var dn=10,[un,fn]=Ut(sn),pn=It("SelectContent.RemoveScroll"),hn=e.forwardRef((n,r)=>{const{__scopeSelect:o,position:l="item-aligned",onCloseAutoFocus:a,onEscapeKeyDown:s,onPointerDownOutside:c,side:d,sideOffset:u,align:p,alignOffset:w,arrowPadding:x,collisionBoundary:b,collisionPadding:S,sticky:R,hideWhenDetached:C,avoidCollisions:j,...P}=n,N=Gt(sn,o),[A,E]=e.useState(null),[T,O]=e.useState(null),D=i(r,e=>E(e)),[_,k]=e.useState(null),[L,I]=e.useState(null),M=qt(o),[H,W]=e.useState(!1),V=e.useRef(!1);e.useEffect(()=>{if(A)return h(A)},[A]),m();const B=e.useCallback(e=>{const[t,...n]=M().map(e=>e.ref.current),[r]=n.slice(-1),o=document.activeElement;for(const i of e){if(i===o)return;if(null==i||i.scrollIntoView({block:"nearest"}),i===t&&T&&(T.scrollTop=0),i===r&&T&&(T.scrollTop=T.scrollHeight),null==i||i.focus(),document.activeElement!==o)return}},[M,T]),F=e.useCallback(()=>B([_,A]),[B,_,A]);e.useEffect(()=>{H&&F()},[H,F]);const{onOpenChange:z,triggerPointerDownPosRef:$}=N;e.useEffect(()=>{if(A){let e={x:0,y:0};const t=t=>{var n,r;e={x:Math.abs(Math.round(t.pageX)-((null==(n=$.current)?void 0:n.x)??0)),y:Math.abs(Math.round(t.pageY)-((null==(r=$.current)?void 0:r.y)??0))}},n=n=>{e.x<=10&&e.y<=10?n.preventDefault():A.contains(n.target)||z(!1),document.removeEventListener("pointermove",t),$.current=null};return null!==$.current&&(document.addEventListener("pointermove",t),document.addEventListener("pointerup",n,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",t),document.removeEventListener("pointerup",n,{capture:!0})}}},[A,z,$]),e.useEffect(()=>{const e=()=>z(!1);return window.addEventListener("blur",e),window.addEventListener("resize",e),()=>{window.removeEventListener("blur",e),window.removeEventListener("resize",e)}},[z]);const[K,q]=zn(e=>{const t=M().filter(e=>!e.disabled),n=t.find(e=>e.ref.current===document.activeElement),r=$n(t,e,n);r&&setTimeout(()=>r.ref.current.focus())}),Y=e.useCallback((e,t,n)=>{const r=!V.current&&!n;(void 0!==N.value&&N.value===t||r)&&(k(e),r&&(V.current=!0))},[N.value]),U=e.useCallback(()=>null==A?void 0:A.focus(),[A]),X=e.useCallback((e,t,n)=>{const r=!V.current&&!n;(void 0!==N.value&&N.value===t||r)&&I(e)},[N.value]),Z="popper"===l?gn:mn,G=Z===gn?{side:d,sideOffset:u,align:p,alignOffset:w,arrowPadding:x,collisionBoundary:b,collisionPadding:S,sticky:R,hideWhenDetached:C,avoidCollisions:j}:{};return t.jsx(un,{scope:o,content:A,viewport:T,onViewportChange:O,itemRefCallback:Y,selectedItem:_,onItemLeave:U,itemTextRefCallback:X,focusSelectedItem:F,selectedItemText:L,position:l,isPositioned:H,searchRef:K,children:t.jsx(g,{as:pn,allowPinchZoom:!0,children:t.jsx(y,{asChild:!0,trapped:N.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:f(a,e=>{var t;null==(t=N.trigger)||t.focus({preventScroll:!0}),e.preventDefault()}),children:t.jsx(v,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>N.onOpenChange(!1),children:t.jsx(Z,{role:"listbox",id:N.contentId,"data-state":N.open?"open":"closed",dir:N.dir,onContextMenu:e=>e.preventDefault(),...P,...G,onPlaced:()=>W(!0),ref:D,style:{display:"flex",flexDirection:"column",outline:"none",...P.style},onKeyDown:f(P.onKeyDown,e=>{const t=e.ctrlKey||e.altKey||e.metaKey;if("Tab"===e.key&&e.preventDefault(),t||1!==e.key.length||q(e.key),["ArrowUp","ArrowDown","Home","End"].includes(e.key)){let t=M().filter(e=>!e.disabled).map(e=>e.ref.current);if(["ArrowUp","End"].includes(e.key)&&(t=t.slice().reverse()),["ArrowUp","ArrowDown"].includes(e.key)){const n=e.target,r=t.indexOf(n);t=t.slice(r+1)}setTimeout(()=>B(t)),e.preventDefault()}})})})})})})});hn.displayName="SelectContentImpl";var mn=e.forwardRef((n,r)=>{const{__scopeSelect:o,onPlaced:l,...c}=n,d=Gt(sn,o),u=fn(sn,o),[f,p]=e.useState(null),[h,m]=e.useState(null),g=i(r,e=>m(e)),y=qt(o),v=e.useRef(!1),w=e.useRef(!0),{viewport:x,selectedItem:b,selectedItemText:R,focusSelectedItem:C}=u,j=e.useCallback(()=>{if(d.trigger&&d.valueNode&&f&&h&&x&&b&&R){const e=d.trigger.getBoundingClientRect(),t=h.getBoundingClientRect(),n=d.valueNode.getBoundingClientRect(),r=R.getBoundingClientRect();if("rtl"!==d.dir){const o=r.left-t.left,i=n.left-o,l=e.left-i,a=e.width+l,s=Math.max(a,t.width),c=window.innerWidth-dn,d=S(i,[dn,Math.max(dn,c-s)]);f.style.minWidth=a+"px",f.style.left=d+"px"}else{const o=t.right-r.right,i=window.innerWidth-n.right-o,l=window.innerWidth-e.right-i,a=e.width+l,s=Math.max(a,t.width),c=window.innerWidth-dn,d=S(i,[dn,Math.max(dn,c-s)]);f.style.minWidth=a+"px",f.style.right=d+"px"}const o=y(),i=window.innerHeight-2*dn,a=x.scrollHeight,s=window.getComputedStyle(h),c=parseInt(s.borderTopWidth,10),u=parseInt(s.paddingTop,10),p=parseInt(s.borderBottomWidth,10),m=c+u+a+parseInt(s.paddingBottom,10)+p,g=Math.min(5*b.offsetHeight,m),w=window.getComputedStyle(x),C=parseInt(w.paddingTop,10),j=parseInt(w.paddingBottom,10),P=e.top+e.height/2-dn,N=i-P,A=b.offsetHeight/2,E=c+u+(b.offsetTop+A),T=m-E;if(E<=P){const e=o.length>0&&b===o[o.length-1].ref.current;f.style.bottom="0px";const t=h.clientHeight-x.offsetTop-x.offsetHeight,n=E+Math.max(N,A+(e?j:0)+t+p);f.style.height=n+"px"}else{const e=o.length>0&&b===o[0].ref.current;f.style.top="0px";const t=Math.max(P,c+x.offsetTop+(e?C:0)+A)+T;f.style.height=t+"px",x.scrollTop=E-P+x.offsetTop}f.style.margin=`${dn}px 0`,f.style.minHeight=g+"px",f.style.maxHeight=i+"px",null==l||l(),requestAnimationFrame(()=>v.current=!0)}},[y,d.trigger,d.valueNode,f,h,x,b,R,d.dir,l]);s(()=>j(),[j]);const[P,N]=e.useState();s(()=>{h&&N(window.getComputedStyle(h).zIndex)},[h]);const A=e.useCallback(e=>{e&&!0===w.current&&(j(),null==C||C(),w.current=!1)},[j,C]);return t.jsx(yn,{scope:o,contentWrapper:f,shouldExpandOnScrollRef:v,onScrollButtonChange:A,children:t.jsx("div",{ref:p,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:P},children:t.jsx(a.div,{...c,ref:g,style:{boxSizing:"border-box",maxHeight:"100%",...c.style}})})})});mn.displayName="SelectItemAlignedPosition";var gn=e.forwardRef((e,n)=>{const{__scopeSelect:r,align:o="start",collisionPadding:i=dn,...l}=e,a=Xt(r);return t.jsx(kt,{...a,...l,ref:n,align:o,collisionPadding:i,style:{boxSizing:"border-box",...l.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});gn.displayName="SelectPopperPosition";var[yn,vn]=Ut(sn,{}),wn="SelectViewport",xn=e.forwardRef((n,r)=>{const{__scopeSelect:o,nonce:l,...s}=n,c=fn(wn,o),d=vn(wn,o),u=i(r,c.onViewportChange),p=e.useRef(0);return t.jsxs(t.Fragment,{children:[t.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:l}),t.jsx(Kt.Slot,{scope:o,children:t.jsx(a.div,{"data-radix-select-viewport":"",role:"presentation",...s,ref:u,style:{position:"relative",flex:1,overflow:"hidden auto",...s.style},onScroll:f(s.onScroll,e=>{const t=e.currentTarget,{contentWrapper:n,shouldExpandOnScrollRef:r}=d;if((null==r?void 0:r.current)&&n){const e=Math.abs(p.current-t.scrollTop);if(e>0){const r=window.innerHeight-2*dn,o=parseFloat(n.style.minHeight),i=parseFloat(n.style.height),l=Math.max(o,i);if(l<r){const o=l+e,i=Math.min(r,o),a=o-i;n.style.height=i+"px","0px"===n.style.bottom&&(t.scrollTop=a>0?a:0,n.style.justifyContent="flex-end")}}}p.current=t.scrollTop})})})]})});xn.displayName=wn;var bn="SelectGroup",[Sn,Rn]=Ut(bn);e.forwardRef((e,n)=>{const{__scopeSelect:r,...o}=e,i=u();return t.jsx(Sn,{scope:r,id:i,children:t.jsx(a.div,{role:"group","aria-labelledby":i,...o,ref:n})})}).displayName=bn;var Cn="SelectLabel",jn=e.forwardRef((e,n)=>{const{__scopeSelect:r,...o}=e,i=Rn(Cn,r);return t.jsx(a.div,{id:i.id,...o,ref:n})});jn.displayName=Cn;var Pn="SelectItem",[Nn,An]=Ut(Pn),En=e.forwardRef((n,r)=>{const{__scopeSelect:o,value:l,disabled:s=!1,textValue:c,...d}=n,p=Gt(Pn,o),h=fn(Pn,o),m=p.value===l,[g,y]=e.useState(c??""),[v,w]=e.useState(!1),x=i(r,e=>{var t;return null==(t=h.itemRefCallback)?void 0:t.call(h,e,l,s)}),b=u(),S=e.useRef("touch"),R=()=>{s||(p.onValueChange(l),p.onOpenChange(!1))};if(""===l)throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return t.jsx(Nn,{scope:o,value:l,disabled:s,textId:b,isSelected:m,onItemTextChange:e.useCallback(e=>{y(t=>t||((null==e?void 0:e.textContent)??"").trim())},[]),children:t.jsx(Kt.ItemSlot,{scope:o,value:l,disabled:s,textValue:g,children:t.jsx(a.div,{role:"option","aria-labelledby":b,"data-highlighted":v?"":void 0,"aria-selected":m&&v,"data-state":m?"checked":"unchecked","aria-disabled":s||void 0,"data-disabled":s?"":void 0,tabIndex:s?void 0:-1,...d,ref:x,onFocus:f(d.onFocus,()=>w(!0)),onBlur:f(d.onBlur,()=>w(!1)),onClick:f(d.onClick,()=>{"mouse"!==S.current&&R()}),onPointerUp:f(d.onPointerUp,()=>{"mouse"===S.current&&R()}),onPointerDown:f(d.onPointerDown,e=>{S.current=e.pointerType}),onPointerMove:f(d.onPointerMove,e=>{var t;S.current=e.pointerType,s?null==(t=h.onItemLeave)||t.call(h):"mouse"===S.current&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:f(d.onPointerLeave,e=>{var t;e.currentTarget===document.activeElement&&(null==(t=h.onItemLeave)||t.call(h))}),onKeyDown:f(d.onKeyDown,e=>{var t;""!==(null==(t=h.searchRef)?void 0:t.current)&&" "===e.key||(zt.includes(e.key)&&R()," "===e.key&&e.preventDefault())})})})})});En.displayName=Pn;var Tn="SelectItemText",On=e.forwardRef((n,r)=>{const{__scopeSelect:o,className:c,style:d,...u}=n,f=Gt(Tn,o),p=fn(Tn,o),h=An(Tn,o),m=Qt(Tn,o),[g,y]=e.useState(null),v=i(r,e=>y(e),h.onItemTextChange,e=>{var t;return null==(t=p.itemTextRefCallback)?void 0:t.call(p,e,h.value,h.disabled)}),w=null==g?void 0:g.textContent,x=e.useMemo(()=>t.jsx("option",{value:h.value,disabled:h.disabled,children:w},h.value),[h.disabled,h.value,w]),{onNativeOptionAdd:b,onNativeOptionRemove:S}=m;return s(()=>(b(x),()=>S(x)),[b,S,x]),t.jsxs(t.Fragment,{children:[t.jsx(a.span,{id:h.textId,...u,ref:v}),h.isSelected&&f.valueNode&&!f.valueNodeHasChildren?l.createPortal(u.children,f.valueNode):null]})});On.displayName=Tn;var Dn="SelectItemIndicator",_n=e.forwardRef((e,n)=>{const{__scopeSelect:r,...o}=e;return An(Dn,r).isSelected?t.jsx(a.span,{"aria-hidden":!0,...o,ref:n}):null});_n.displayName=Dn;var kn="SelectScrollUpButton",Ln=e.forwardRef((n,r)=>{const o=fn(kn,n.__scopeSelect),l=vn(kn,n.__scopeSelect),[a,c]=e.useState(!1),d=i(r,l.onScrollButtonChange);return s(()=>{if(o.viewport&&o.isPositioned){let e=function(){const e=t.scrollTop>0;c(e)};const t=o.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}},[o.viewport,o.isPositioned]),a?t.jsx(Hn,{...n,ref:d,onAutoScroll:()=>{const{viewport:e,selectedItem:t}=o;e&&t&&(e.scrollTop=e.scrollTop-t.offsetHeight)}}):null});Ln.displayName=kn;var In="SelectScrollDownButton",Mn=e.forwardRef((n,r)=>{const o=fn(In,n.__scopeSelect),l=vn(In,n.__scopeSelect),[a,c]=e.useState(!1),d=i(r,l.onScrollButtonChange);return s(()=>{if(o.viewport&&o.isPositioned){let e=function(){const e=t.scrollHeight-t.clientHeight,n=Math.ceil(t.scrollTop)<e;c(n)};const t=o.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}},[o.viewport,o.isPositioned]),a?t.jsx(Hn,{...n,ref:d,onAutoScroll:()=>{const{viewport:e,selectedItem:t}=o;e&&t&&(e.scrollTop=e.scrollTop+t.offsetHeight)}}):null});Mn.displayName=In;var Hn=e.forwardRef((n,r)=>{const{__scopeSelect:o,onAutoScroll:i,...l}=n,c=fn("SelectScrollButton",o),d=e.useRef(null),u=qt(o),p=e.useCallback(()=>{null!==d.current&&(window.clearInterval(d.current),d.current=null)},[]);return e.useEffect(()=>()=>p(),[p]),s(()=>{var e;const t=u().find(e=>e.ref.current===document.activeElement);null==(e=null==t?void 0:t.ref.current)||e.scrollIntoView({block:"nearest"})},[u]),t.jsx(a.div,{"aria-hidden":!0,...l,ref:r,style:{flexShrink:0,...l.style},onPointerDown:f(l.onPointerDown,()=>{null===d.current&&(d.current=window.setInterval(i,50))}),onPointerMove:f(l.onPointerMove,()=>{var e;null==(e=c.onItemLeave)||e.call(c),null===d.current&&(d.current=window.setInterval(i,50))}),onPointerLeave:f(l.onPointerLeave,()=>{p()})})}),Wn=e.forwardRef((e,n)=>{const{__scopeSelect:r,...o}=e;return t.jsx(a.div,{"aria-hidden":!0,...o,ref:n})});Wn.displayName="SelectSeparator";var Vn="SelectArrow";e.forwardRef((e,n)=>{const{__scopeSelect:r,...o}=e,i=Xt(r),l=Gt(Vn,r),a=fn(Vn,r);return l.open&&"popper"===a.position?t.jsx(Lt,{...i,...o,ref:n}):null}).displayName=Vn;var Bn=e.forwardRef(({__scopeSelect:n,value:r,...o},l)=>{const s=e.useRef(null),c=i(l,s),d=Vt(r);return e.useEffect(()=>{const e=s.current;if(!e)return;const t=window.HTMLSelectElement.prototype,n=Object.getOwnPropertyDescriptor(t,"value").set;if(d!==r&&n){const t=new Event("change",{bubbles:!0});n.call(e,r),e.dispatchEvent(t)}},[d,r]),t.jsx(a.select,{...o,style:{...Bt,...o.style},ref:c,defaultValue:r})});function Fn(e){return""===e||void 0===e}function zn(t){const n=c(t),r=e.useRef(""),o=e.useRef(0),i=e.useCallback(e=>{const t=r.current+e;n(t),function e(t){r.current=t,window.clearTimeout(o.current),""!==t&&(o.current=window.setTimeout(()=>e(""),1e3))}(t)},[n]),l=e.useCallback(()=>{r.current="",window.clearTimeout(o.current)},[]);return e.useEffect(()=>()=>window.clearTimeout(o.current),[]),[r,i,l]}function $n(e,t,n){const r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,o=n?e.indexOf(n):-1;let i=(l=e,a=Math.max(o,0),l.map((e,t)=>l[(a+t)%l.length]));var l,a;1===r.length&&(i=i.filter(e=>e!==n));const s=i.find(e=>e.textValue.toLowerCase().startsWith(r.toLowerCase()));return s!==n?s:void 0}Bn.displayName="SelectBubbleInput";var Kn=nn,qn=ln,Yn=an,Un=cn,Xn=xn,Zn=jn,Gn=En,Jn=On,Qn=_n,er=Ln,tr=Mn,nr=Wn;const rr=en,or=on,ir=e.forwardRef(({className:e,children:n,...r},o)=>t.jsxs(Kn,{ref:o,className:w("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...r,children:[n,t.jsx(qn,{asChild:!0,children:t.jsx(C,{className:"h-4 w-4 opacity-50"})})]}));ir.displayName=Kn.displayName;const lr=e.forwardRef(({className:e,...n},r)=>t.jsx(er,{ref:r,className:w("flex cursor-default items-center justify-center py-1",e),...n,children:t.jsx(R,{className:"h-4 w-4"})}));lr.displayName=er.displayName;const ar=e.forwardRef(({className:e,...n},r)=>t.jsx(tr,{ref:r,className:w("flex cursor-default items-center justify-center py-1",e),...n,children:t.jsx(C,{className:"h-4 w-4"})}));ar.displayName=tr.displayName;const sr=e.forwardRef(({className:e,children:n,position:r="popper",...o},i)=>t.jsx(Yn,{children:t.jsxs(Un,{ref:i,className:w("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2","popper"===r&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:r,...o,children:[t.jsx(lr,{}),t.jsx(Xn,{className:w("p-1","popper"===r&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:n}),t.jsx(ar,{})]})}));sr.displayName=Un.displayName;e.forwardRef(({className:e,...n},r)=>t.jsx(Zn,{ref:r,className:w("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...n})).displayName=Zn.displayName;const cr=e.forwardRef(({className:e,children:n,...r},o)=>t.jsxs(Gn,{ref:o,className:w("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...r,children:[t.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:t.jsx(Qn,{children:t.jsx(x,{className:"h-4 w-4"})})}),t.jsx(Jn,{children:n})]}));cr.displayName=Gn.displayName;e.forwardRef(({className:e,...n},r)=>t.jsx(nr,{ref:r,className:w("-mx-1 my-1 h-px bg-muted",e),...n})).displayName=nr.displayName;export{_t as A,kt as C,Dt as R,rr as S,E as a,Lt as b,gt as c,ir as d,or as e,sr as f,cr as g,pt as h,Vt as u};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import{c as e,r as t,j as o,bl as a,aa as n,a9 as r,a5 as i,a8 as s,b5 as l,a4 as c,a6 as u,d}from"./index-2wJikgEX.js";import{a as f}from"./select-YkUpG7ZI.js";import{u as p}from"./index-DrpeVVUe.js";
|
|
2
|
+
/**
|
|
3
|
+
* @license lucide-react v0.309.0 - ISC
|
|
4
|
+
*
|
|
5
|
+
* This source code is licensed under the ISC license.
|
|
6
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
7
|
+
*/const v=e("Save",[["path",{d:"M19 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11l5 5v11a2 2 0 0 1-2 2z",key:"1owoqh"}],["polyline",{points:"17 21 17 13 7 13 7 21",key:"1md35c"}],["polyline",{points:"7 3 7 8 15 8",key:"8nz8an"}]]),b=e("Upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]]);
|
|
8
|
+
/**
|
|
9
|
+
* @license lucide-react v0.309.0 - ISC
|
|
10
|
+
*
|
|
11
|
+
* This source code is licensed under the ISC license.
|
|
12
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
13
|
+
*/var m="rovingFocusGroup.onEntryFocus",h={bubbles:!1,cancelable:!0},y="RovingFocusGroup",[g,w,x]=f(y),[I,R]=i(y,[x]),[T,j]=I(y),F=t.forwardRef((e,t)=>o.jsx(g.Provider,{scope:e.__scopeRovingFocusGroup,children:o.jsx(g.Slot,{scope:e.__scopeRovingFocusGroup,children:o.jsx(C,{...e,ref:t})})}));F.displayName=y;var C=t.forwardRef((e,a)=>{const{__scopeRovingFocusGroup:i,orientation:u,loop:d=!1,dir:f,currentTabStopId:v,defaultCurrentTabStopId:b,onCurrentTabStopIdChange:g,onEntryFocus:x,preventScrollOnEntryFocus:I=!1,...R}=e,j=t.useRef(null),F=s(a,j),C=p(f),[S,N]=l({prop:v,defaultProp:b??null,onChange:g,caller:y}),[D,A]=t.useState(!1),_=c(x),E=w(i),M=t.useRef(!1),[z,K]=t.useState(0);return t.useEffect(()=>{const e=j.current;if(e)return e.addEventListener(m,_),()=>e.removeEventListener(m,_)},[_]),o.jsx(T,{scope:i,orientation:u,dir:C,loop:d,currentTabStopId:S,onItemFocus:t.useCallback(e=>N(e),[N]),onItemShiftTab:t.useCallback(()=>A(!0),[]),onFocusableItemAdd:t.useCallback(()=>K(e=>e+1),[]),onFocusableItemRemove:t.useCallback(()=>K(e=>e-1),[]),children:o.jsx(n.div,{tabIndex:D||0===z?-1:0,"data-orientation":u,...R,ref:F,style:{outline:"none",...e.style},onMouseDown:r(e.onMouseDown,()=>{M.current=!0}),onFocus:r(e.onFocus,e=>{const t=!M.current;if(e.target===e.currentTarget&&t&&!D){const t=new CustomEvent(m,h);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){const e=E().filter(e=>e.focusable);k([e.find(e=>e.active),e.find(e=>e.id===S),...e].filter(Boolean).map(e=>e.ref.current),I)}}M.current=!1}),onBlur:r(e.onBlur,()=>A(!1))})})}),S="RovingFocusGroupItem",N=t.forwardRef((e,i)=>{const{__scopeRovingFocusGroup:s,focusable:l=!0,active:c=!1,tabStopId:u,children:d,...f}=e,p=a(),v=u||p,b=j(S,s),m=b.currentTabStopId===v,h=w(s),{onFocusableItemAdd:y,onFocusableItemRemove:x,currentTabStopId:I}=b;return t.useEffect(()=>{if(l)return y(),()=>x()},[l,y,x]),o.jsx(g.ItemSlot,{scope:s,id:v,focusable:l,active:c,children:o.jsx(n.span,{tabIndex:m?0:-1,"data-orientation":b.orientation,...f,ref:i,onMouseDown:r(e.onMouseDown,e=>{l?b.onItemFocus(v):e.preventDefault()}),onFocus:r(e.onFocus,()=>b.onItemFocus(v)),onKeyDown:r(e.onKeyDown,e=>{if("Tab"===e.key&&e.shiftKey)return void b.onItemShiftTab();if(e.target!==e.currentTarget)return;const t=function(e,t,o){const a=function(e,t){return"rtl"!==t?e:"ArrowLeft"===e?"ArrowRight":"ArrowRight"===e?"ArrowLeft":e}(e.key,o);return"vertical"===t&&["ArrowLeft","ArrowRight"].includes(a)||"horizontal"===t&&["ArrowUp","ArrowDown"].includes(a)?void 0:D[a]}(e,b.orientation,b.dir);if(void 0!==t){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let n=h().filter(e=>e.focusable).map(e=>e.ref.current);if("last"===t)n.reverse();else if("prev"===t||"next"===t){"prev"===t&&n.reverse();const r=n.indexOf(e.currentTarget);n=b.loop?(a=r+1,(o=n).map((e,t)=>o[(a+t)%o.length])):n.slice(r+1)}setTimeout(()=>k(n))}var o,a}),children:"function"==typeof d?d({isCurrentTabStop:m,hasTabStop:null!=I}):d})})});N.displayName=S;var D={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function k(e,t=!1){const o=document.activeElement;for(const a of e){if(a===o)return;if(a.focus({preventScroll:t}),document.activeElement!==o)return}}var A=F,_=N,E="Tabs",[M]=i(E,[R]),z=R(),[K,G]=M(E),L=t.forwardRef((e,t)=>{const{__scopeTabs:r,value:i,onValueChange:s,defaultValue:c,orientation:u="horizontal",dir:d,activationMode:f="automatic",...v}=e,b=p(d),[m,h]=l({prop:i,onChange:s,defaultProp:c??"",caller:E});return o.jsx(K,{scope:r,baseId:a(),value:m,onValueChange:h,orientation:u,dir:b,activationMode:f,children:o.jsx(n.div,{dir:b,"data-orientation":u,...v,ref:t})})});L.displayName=E;var V="TabsList",P=t.forwardRef((e,t)=>{const{__scopeTabs:a,loop:r=!0,...i}=e,s=G(V,a),l=z(a);return o.jsx(A,{asChild:!0,...l,orientation:s.orientation,dir:s.dir,loop:r,children:o.jsx(n.div,{role:"tablist","aria-orientation":s.orientation,...i,ref:t})})});P.displayName=V;var U="TabsTrigger",$=t.forwardRef((e,t)=>{const{__scopeTabs:a,value:i,disabled:s=!1,...l}=e,c=G(U,a),u=z(a),d=q(c.baseId,i),f=O(c.baseId,i),p=i===c.value;return o.jsx(_,{asChild:!0,...u,focusable:!s,active:p,children:o.jsx(n.button,{type:"button",role:"tab","aria-selected":p,"aria-controls":f,"data-state":p?"active":"inactive","data-disabled":s?"":void 0,disabled:s,id:d,...l,ref:t,onMouseDown:r(e.onMouseDown,e=>{s||0!==e.button||!1!==e.ctrlKey?e.preventDefault():c.onValueChange(i)}),onKeyDown:r(e.onKeyDown,e=>{[" ","Enter"].includes(e.key)&&c.onValueChange(i)}),onFocus:r(e.onFocus,()=>{const e="manual"!==c.activationMode;p||s||!e||c.onValueChange(i)})})})});$.displayName=U;var B="TabsContent",H=t.forwardRef((e,a)=>{const{__scopeTabs:r,value:i,forceMount:s,children:l,...c}=e,d=G(B,r),f=q(d.baseId,i),p=O(d.baseId,i),v=i===d.value,b=t.useRef(v);return t.useEffect(()=>{const e=requestAnimationFrame(()=>b.current=!1);return()=>cancelAnimationFrame(e)},[]),o.jsx(u,{present:s||v,children:({present:t})=>o.jsx(n.div,{"data-state":v?"active":"inactive","data-orientation":d.orientation,role:"tabpanel","aria-labelledby":f,hidden:!t,id:p,tabIndex:0,...c,ref:a,style:{...e.style,animationDuration:b.current?"0s":void 0},children:t&&l})})});function q(e,t){return`${e}-trigger-${t}`}function O(e,t){return`${e}-content-${t}`}H.displayName=B;var J=P,Q=$,W=H;const X=L,Y=t.forwardRef(({className:e,...t},a)=>o.jsx(J,{ref:a,className:d("flex rounded-md bg-muted p-1 text-muted-foreground data-[orientation=horizontal]:h-10 data-[orientation=horizontal]:items-center data-[orientation=horizontal]:justify-center data-[orientation=horizontal]:inline-flex data-[orientation=vertical]:flex-col data-[orientation=vertical]:items-center data-[orientation=vertical]:justify-start",e),...t}));Y.displayName=J.displayName;const Z=t.forwardRef(({className:e,...t},a)=>o.jsx(Q,{ref:a,className:d("inline-flex items-center justify-center whitespace-nowrap rounded-sm text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm data-[orientation=horizontal]:px-3 data-[orientation=horizontal]:py-1.5",e),...t}));Z.displayName=Q.displayName;const ee=t.forwardRef(({className:e,...t},a)=>o.jsx(W,{ref:a,className:d("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));ee.displayName=W.displayName;export{_ as I,A as R,v as S,X as T,b as U,Y as a,Z as b,ee as c,R as d};
|
package/frontend/dist/index.html
CHANGED
|
@@ -10,8 +10,8 @@
|
|
|
10
10
|
<meta name="apple-mobile-web-app-capable" content="yes" />
|
|
11
11
|
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
|
|
12
12
|
<title>CC Web</title>
|
|
13
|
-
<script type="module" crossorigin src="/assets/index-
|
|
14
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
13
|
+
<script type="module" crossorigin src="/assets/index-2wJikgEX.js"></script>
|
|
14
|
+
<link rel="stylesheet" crossorigin href="/assets/index-61v6oszV.css">
|
|
15
15
|
</head>
|
|
16
16
|
<body>
|
|
17
17
|
<div id="root"></div>
|
package/package.json
CHANGED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/OfficePreview-D0_TpLvk.js","assets/index-CMlFtaTa.js","assets/index-Czlx_FcC.css","assets/purify.es-CgRAQgUo.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{c as e,aI as t,br as s,aK as a,r as n,bs as r,bt as l,j as o,bu as c,m as i,d,bv as u,bw as x,bx as m,by as h,bz as p,bA as f,bB as g,ak as b,aj as j,bC as v,bD as y,t as N,ai as w,aD as k,bE as C,U as S,bF as I,a as P,b as z,g as M,D as U,h as T,R as A,_ as E,l as D,X as $,p as L,aV as R,bG as _,C as F,A as H,q as O}from"./index-CMlFtaTa.js";import{A as q,g as W,i as B,T as V,j as K,k as G,G as J,M as Q,r as X,a as Y,b as Z,c as ee,e as te,h as se,o as ae,d as ne,I as re,F as le}from"./ChatOverlay-C6RdSj9e.js";import{a as oe}from"./index-o8xpeYuN.js";import{C as ce}from"./chevron-down-CTVvTLhb.js";
|
|
3
|
-
/**
|
|
4
|
-
* @license lucide-react v0.309.0 - ISC
|
|
5
|
-
*
|
|
6
|
-
* This source code is licensed under the ISC license.
|
|
7
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
8
|
-
*/const ie=e("Bookmark",[["path",{d:"m19 21-7-4-7 4V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v16z",key:"1fy3hk"}]]),de=e("FileCode",[["path",{d:"M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z",key:"1nnpy2"}],["polyline",{points:"14 2 14 8 20 8",key:"1ew0cm"}],["path",{d:"m10 13-2 2 2 2",key:"17smn8"}],["path",{d:"m14 17 2-2-2-2",key:"14mezr"}]]),ue=e("FileJson",[["path",{d:"M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z",key:"1nnpy2"}],["polyline",{points:"14 2 14 8 20 8",key:"1ew0cm"}],["path",{d:"M10 12a1 1 0 0 0-1 1v1a1 1 0 0 1-1 1 1 1 0 0 1 1 1v1a1 1 0 0 0 1 1",key:"1oajmo"}],["path",{d:"M14 18a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1 1 1 0 0 1-1-1v-1a1 1 0 0 0-1-1",key:"mpwhp6"}]]),xe=e("Menu",[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]]),me=window.matchMedia("(pointer: coarse)").matches&&window.innerWidth<768;
|
|
9
|
-
/**
|
|
10
|
-
* @license lucide-react v0.309.0 - ISC
|
|
11
|
-
*
|
|
12
|
-
* This source code is licensed under the ISC license.
|
|
13
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
14
|
-
*/function he({onSelectProject:e}){const h=t(),p=s(e=>e.clearToken),{projects:f,fetchProjects:g,hasFetched:b,loading:j}=a(),v=n.useCallback(()=>{a.getState().setProjects([]),p(),h("/login")},[p,h]),[y,N]=n.useState(new Map),[w,k]=n.useState(new Set),[C,S]=n.useState(!1);n.useEffect(()=>{g()},[g]);const I=n.useCallback(e=>{e.status&&N(t=>{const s=new Map(t);return s.set(e.projectId,e.status),s}),void 0!==e.active&&k(t=>{const s=new Set(t);return e.active?s.add(e.projectId):s.delete(e.projectId),s})},[]);r({onActivityUpdate:I});const{applyOrder:P}=l(),z=P(f.filter(e=>!e.archived));return o.jsxs("div",{className:"flex flex-col h-full",children:[o.jsxs("div",{className:"flex items-center gap-3 px-4 h-12 border-b border-border shrink-0",children:[o.jsx("span",{className:"font-semibold text-base flex-1",children:"CC Web"}),o.jsx(c,{}),o.jsx("button",{onClick:()=>{(async()=>{S(!0);try{await g()}finally{S(!1)}})()},className:"text-muted-foreground active:text-foreground",disabled:C,"aria-label":"Refresh",children:o.jsx(i,{className:d("h-4 w-4",C&&"animate-spin")})}),o.jsx("button",{onClick:()=>h("/settings"),className:"text-muted-foreground active:text-foreground","aria-label":"Settings",children:o.jsx(u,{className:"h-4 w-4"})}),o.jsx("button",{onClick:v,className:"text-muted-foreground active:text-foreground","aria-label":"Logout",children:o.jsx(x,{className:"h-4 w-4"})}),!me&&o.jsx("button",{onClick:()=>h("/"),className:"text-muted-foreground active:text-foreground","aria-label":"Desktop mode",children:o.jsx(m,{className:"h-4 w-4"})})]}),o.jsxs("div",{className:"flex-1 overflow-y-auto px-3 py-3",children:[j&&!b&&o.jsx("div",{className:"text-center text-muted-foreground text-sm py-12",children:"加载中..."}),b&&0===z.length&&o.jsx("div",{className:"text-center text-muted-foreground text-sm py-12",children:"暂无项目"}),o.jsx("div",{className:"grid grid-cols-2 gap-2",children:z.map(t=>{var s;const a="running"===(s=t,y.get(s.id)??s.status??"stopped"),n=w.has(t.id),r=o.jsxs("button",{onClick:()=>e(t.id),className:d("w-full text-left rounded-xl border bg-card p-2.5 active:bg-accent transition-colors",n?"border-transparent":"border-border"),children:[o.jsxs("div",{className:"flex items-center gap-1.5 mb-1",children:[o.jsx("span",{className:d("w-2 h-2 rounded-full shrink-0",a?"bg-green-500":"bg-zinc-400")}),o.jsx("span",{className:"font-medium text-sm truncate flex-1",children:t.name})]}),o.jsx("div",{className:"text-[10px] text-muted-foreground font-mono truncate",children:t.cliTool??"claude"})]});return o.jsx("div",{className:n?"card-active-glow rounded-xl":void 0,children:r},t.id)})})]})]})}function pe(e){if(!e.phase)return null;if("thinking"===e.phase)return"思考中";if("tool_result"===e.phase)return"处理结果";if("tool_use"===e.phase){const t=(e.detail||"").toLowerCase();return"bash"===t?"执行命令":"read"===t?"读取文件":"edit"===t||"multiedit"===t?"编辑文件":"write"===t?"写入文件":"grep"===t?"搜索内容":"glob"===t?"匹配文件":"webfetch"===t||"websearch"===t?"访问网络":"task"===t?"调度子任务":"todowrite"===t?"更新任务列表":"notebookedit"===t?"编辑 Notebook":e.detail?`调用 ${e.detail}`:"调用工具"}return null}function fe({project:e,onBack:t,onOpenPanel:s,onContextUpdate:a}){const[r,l]=n.useState(""),c=n.useRef(null),i=n.useRef(null),[u,x]=n.useState([]),m=n.useCallback(e=>{x(t=>{const s=[...t,e];return s.length>200?s.slice(-200):s})},[]),P=n.useRef(null),z=n.useCallback(e=>{var t;"stopped"===e&&(null==(t=P.current)||t.call(P,"stopped"))},[]),[M,U]=n.useState(null);n.useEffect(()=>{const t=t=>{const s=t.detail;s&&s.projectId===e.id&&("cli_prompt_detected"===s.type?U({kind:s.kind,label:s.label,detectedAt:s.detectedAt,options:s.options}):"cli_prompt_dismissed"===s.type&&U(e=>(null==e?void 0:e.kind)===s.kind?null:e))};return window.addEventListener("ccweb:cli-prompt-msg",t),()=>window.removeEventListener("ccweb:cli-prompt-msg",t)},[e.id]);const[T,A]=n.useState([]),E=n.useRef(new Set),D=n.useCallback(e=>{E.current.has(e.toolUseId)||A(t=>t.some(t=>t.toolUseId===e.toolUseId)?t:[...t,{projectId:e.projectId,toolUseId:e.toolUseId,toolName:e.toolName,toolInput:e.toolInput,sessionId:e.sessionId,createdAt:e.createdAt}])},[]),$=n.useCallback(e=>{E.current.add(e.toolUseId),A(t=>t.filter(t=>t.toolUseId!==e.toolUseId))},[]),L=n.useCallback(e=>{E.current.add(e),A(t=>t.filter(t=>t.toolUseId!==e))},[]),[R,_]=n.useState(null),F=n.useRef(0),H=n.useCallback(e=>{var t,s,a;if(!e.active)return void _(null);if("text"===(null==(t=e.semantic)?void 0:t.phase))return void _(null);const n=null==(s=e.semantic)?void 0:s.phase,r=null==(a=e.semantic)?void 0:a.detail;_(e=>e?e.phase===n&&e.detail===r?e:{...e,phase:n,detail:r}:{id:"mab"+ ++F.current,phase:n,detail:r})},[]),{sendInput:O,connected:Q}=h({projectId:e.id,enabled:!0,onChatMessage:m,onStatusChange:z,onContextUpdate:a,onApprovalRequest:D,onApprovalResolved:$,onSemanticUpdate:H});n.useEffect(()=>{let t=!1;if(U(null),Q)return p(e.id).then(e=>{!t&&e.active&&U({kind:e.active.kind,label:e.active.label,detectedAt:e.active.detectedAt,options:e.active.options})}).catch(()=>{}),()=>{t=!0}},[e.id,Q]),n.useEffect(()=>{if(!Q)return;if("claude"!==e.cliTool)return;let t=!1;return f(e.id).then(e=>{if(t)return;const s=e.pending.filter(e=>!E.current.has(e.toolUseId));A(e=>{const t=new Map;for(const a of s)t.set(a.toolUseId,a);for(const s of e)t.has(s.toolUseId)||E.current.has(s.toolUseId)||t.set(s.toolUseId,s);return[...t.values()]})}).catch(()=>{}),()=>{t=!0}},[e.id,e.cliTool,Q]);const{state:X,setState:Y,messages:Z,hasMoreHistory:ee,loadMoreHistory:te,sendMessage:se,isWaking:ae}=g({project:e,liveMessages:u,ws:{send:O,connected:Q},historyLimit:20});P.current=Y;const ne=n.useRef(Q);n.useEffect(()=>{!ne.current&&Q&&x([]),ne.current=Q},[Q]);const re=(()=>{for(let e=Z.length-1;e>=0;e--)if("assistant"===Z[e].role)return e;return-1})(),[le,de]=n.useState([]),[ue,me]=n.useState([]),[he,fe]=n.useState(null),[ge,be]=n.useState(null),je=n.useRef(!1);n.useEffect(()=>{b().then(de).catch(()=>{}),j(e.id).then(me).catch(()=>{})},[e.id]);const ve=n.useCallback(e=>{const t=i.current;if(!t)return void l(t=>t+e);const s=t.selectionStart??r.length,a=t.selectionEnd??r.length,n=r.slice(0,s)+e+r.slice(a);l(n),requestAnimationFrame(()=>{t.focus();const a=s+e.length;t.setSelectionRange(a,a),t.style.height="auto",t.style.height=Math.min(t.scrollHeight,128)+"px"})},[r]),ye=n.useCallback(e=>{fe(null),ve(e+" ")},[ve]),Ne=n.useCallback(t=>{const s=e.folderPath;let a=t;s&&(t===s||t.startsWith(s+"/")||t.startsWith(s+"\\"))&&(a=t.slice(s.length).replace(/^[/\\]+/,"")),fe(null),ve(`@${a} `)},[e.folderPath,ve]),we=n.useCallback(async()=>{if("skills"!==he){if(!je.current){je.current=!0;try{const t=await v(e.cliTool??"claude",e.id);be(t)}catch{be({builtin:[],custom:[],plugins:[],mcp:[]})}finally{je.current=!1}}fe("skills")}else fe(null)},[he,e.cliTool,e.id]),ke=n.useCallback(async()=>{const e=c.current,t=(null==e?void 0:e.scrollHeight)??0;await te(),requestAnimationFrame(()=>{e&&(e.scrollTop+=e.scrollHeight-t)})},[te]),Ce=n.useRef(0);n.useEffect(()=>{const e=c.current;if(!e)return;const t=Z.length>Ce.current,s=0===Ce.current&&Z.length>0;Ce.current=Z.length,s?e.scrollTo({top:e.scrollHeight}):t&&e.scrollTo({top:e.scrollHeight,behavior:"smooth"})},[Z,T.length]);const[Se,Ie]=n.useState(!1),Pe=n.useCallback(async()=>{const e=r.trim();if(!e||Se)return;Ie(!0);const t=await se(e);Ie(!1),"delivered"===t&&(l(""),i.current&&(i.current.style.height="auto"))},[r,Se,se]),ze=y(Pe,"shift"),Me=n.useCallback(async(t,s)=>{fe(null);try{"failed"===await se(t.command)?N.error("快捷命令未送达,请重试或检查会话"):"project"===s&&w(e.id,t.id,!0).catch(e=>{console.error("Failed to mark shortcut used:",e)})}catch(a){console.error("Shortcut send error:",a),N.error("快捷命令发送失败")}},[se,e.id]),Ue="live"===X;return o.jsxs("div",{className:"flex flex-col h-full bg-background",children:[o.jsxs("div",{className:"flex items-center gap-2 px-3 h-12 border-b border-border shrink-0",children:[o.jsx("button",{onClick:t,className:"text-muted-foreground active:text-foreground p-1",children:o.jsx(k,{className:"h-5 w-5"})}),o.jsxs("div",{className:"flex items-center gap-1.5 flex-1 min-w-0",children:[o.jsx("span",{className:"font-medium text-sm truncate",children:e.name}),o.jsx("span",{className:d("w-2 h-2 rounded-full shrink-0",Ue?"bg-green-500":ae?"bg-yellow-400 animate-pulse":"bg-zinc-400")})]}),o.jsx("button",{onClick:s,className:"text-muted-foreground active:text-foreground p-1",children:o.jsx(xe,{className:"h-5 w-5"})})]}),o.jsxs("div",{ref:c,className:"flex-1 overflow-y-auto px-3 py-3 space-y-3 min-h-0",children:[ee&&o.jsx("div",{className:"flex justify-center pb-1",children:o.jsxs("button",{onClick:()=>{ke()},className:"flex items-center gap-1 px-3 py-1.5 rounded-full text-xs text-muted-foreground border border-border active:bg-accent transition-colors",children:[o.jsx(oe,{className:"h-3 w-3"}),"加载更早消息"]})}),Z.map((e,t)=>{const s="user"===e.role;return o.jsx("div",{className:d("flex",s?"justify-end":"justify-start"),children:o.jsx("div",{className:d("max-w-[85%] rounded-xl px-3 py-2 break-words text-sm leading-relaxed",s?"bg-blue-500/15 text-foreground border border-blue-500/20 rounded-br-sm whitespace-pre-wrap":"bg-secondary text-secondary-foreground border border-border rounded-bl-sm"),children:s?e.content:o.jsx(q,{content:e.content,blocks:e.blocks,isLatest:t===re})})},e.id)}),T.map(e=>o.jsx(W,{approval:e,onResolved:L},e.toolUseId)),M&&o.jsx(B,{prompt:M,onSelect:async t=>{await C(e.id,t)}}),R&&0===T.length&&o.jsx("div",{className:"flex justify-start",children:o.jsxs("div",{className:"rounded-2xl rounded-bl-md px-3 py-1.5 bg-black/5 dark:bg-white/10 border border-black/10 dark:border-white/15 flex items-center gap-2 text-xs text-muted-foreground",children:[o.jsx(V,{}),pe(R)&&o.jsx("span",{children:pe(R)})]})},R.id),0===Z.length&&0===T.length&&!R&&"stopped"===X&&o.jsx("div",{className:"flex items-center justify-center h-full text-muted-foreground/40 text-sm",children:"暂无对话记录"}),ae&&o.jsx("div",{className:"flex items-center justify-center py-4 text-yellow-400 text-sm animate-pulse",children:"启动中..."})]}),"global"===he||"project"===he?o.jsx("div",{className:"border-t border-border max-h-48 overflow-y-auto shrink-0",children:o.jsxs("div",{className:"px-3 py-2 space-y-1",children:[("global"===he?le:ue).map(e=>o.jsxs("button",{onClick:()=>Me(e,he),disabled:ae,className:d("w-full text-left rounded-md px-2.5 py-2 text-sm active:bg-accent transition-colors border border-border/50",ae&&"opacity-50 cursor-not-allowed"),children:[o.jsx("div",{className:"font-medium text-xs",children:e.label}),o.jsx("div",{className:"text-[11px] text-muted-foreground font-mono truncate",children:e.command})]},e.id)),0===("global"===he?le:ue).length&&o.jsx("div",{className:"text-center text-muted-foreground text-xs py-3",children:"暂无快捷 Prompts"})]})}):"skills"===he&&ge?o.jsx("div",{className:"border-t border-border shrink-0",children:o.jsx(K,{data:ge,onCommand:ye})}):"files"===he&&e.folderPath?o.jsx("div",{className:"border-t border-border shrink-0",children:o.jsx(G,{projectPath:e.folderPath,onSelect:Ne})}):null,o.jsxs("div",{className:"flex items-center gap-1.5 px-3 py-1.5 border-t border-border shrink-0",children:[o.jsx("button",{onClick:()=>{we()},title:"斜杠命令",className:d("flex items-center justify-center w-7 h-7 rounded font-mono text-base transition-colors","skills"===he?"bg-accent text-foreground font-medium":"text-muted-foreground active:bg-accent"),children:"/"}),o.jsx("button",{onClick:()=>fe(e=>"files"===e?null:"files"),disabled:!e.folderPath,title:"引用文件",className:d("flex items-center justify-center w-7 h-7 rounded font-mono text-base transition-colors","files"===he?"bg-accent text-foreground font-medium":e.folderPath?"text-muted-foreground active:bg-accent":"text-muted-foreground/30 cursor-not-allowed"),children:"@"}),le.length>0&&o.jsxs("button",{onClick:()=>fe(e=>"global"===e?null:"global"),className:d("flex items-center gap-1 px-2 py-1 rounded-md text-xs transition-colors","global"===he?"bg-accent text-foreground font-medium":"text-muted-foreground active:bg-accent"),children:[o.jsx(J,{className:"h-3 w-3"}),"全局","global"===he&&o.jsx(ce,{className:"h-3 w-3"})]}),ue.length>0&&o.jsxs("button",{onClick:()=>fe(e=>"project"===e?null:"project"),className:d("flex items-center gap-1 px-2 py-1 rounded-md text-xs transition-colors","project"===he?"bg-accent text-foreground font-medium":"text-muted-foreground active:bg-accent"),children:[o.jsx(ie,{className:"h-3 w-3"}),"项目","project"===he&&o.jsx(ce,{className:"h-3 w-3"})]})]}),o.jsx("div",{className:"border-t border-border px-3 py-2 shrink-0",style:{paddingBottom:"max(0.5rem, env(safe-area-inset-bottom))"},children:o.jsxs("div",{className:"flex items-end gap-2",children:[o.jsx("textarea",{ref:i,value:r,onChange:e=>l(e.target.value),onKeyDown:ze,disabled:ae||Se,placeholder:ae?"启动中...":Se?"发送中…":"stopped"===X?"输入消息(自动启动)...":"输入消息...",rows:1,className:d("flex-1 resize-none rounded-md border border-input bg-transparent px-3 py-2 text-sm outline-none","focus:ring-1 focus:ring-ring placeholder:text-muted-foreground/50","max-h-32 overflow-y-auto",(ae||Se)&&"opacity-50 cursor-not-allowed"),style:{minHeight:"2.5rem"},onInput:e=>{const t=e.currentTarget;t.style.height="auto",t.style.height=Math.min(t.scrollHeight,128)+"px"}}),o.jsx("button",{onClick:Pe,disabled:ae||Se||!r.trim(),className:d("shrink-0 p-2 rounded-md transition-colors",r.trim()&&!Se?"text-blue-500 active:bg-blue-500/10":"text-muted-foreground/30"),children:Se?o.jsx(S,{className:"h-5 w-5 animate-spin"}):o.jsx(I,{className:"h-5 w-5"})})]})})]})}const ge=A.lazy(()=>E(()=>import("./OfficePreview-D0_TpLvk.js"),__vite__mapDeps([0,1,2,3])).then(e=>({default:e.OfficePreview}))),be=new Set(["png","jpg","jpeg","gif","webp","svg","bmp","ico","avif"]),je=new Set(["docx","xlsx","xls","pptx"]),ve={js:"javascript",jsx:"jsx",ts:"typescript",tsx:"tsx",py:"python",rb:"ruby",go:"go",rs:"rust",java:"java",kt:"kotlin",swift:"swift",c:"c",cpp:"cpp",h:"c",cs:"csharp",php:"php",sh:"bash",bash:"bash",zsh:"bash",yaml:"yaml",yml:"yaml",json:"json",toml:"toml",html:"html",htm:"html",xml:"xml",svg:"xml",css:"css",scss:"scss",less:"less",sql:"sql",graphql:"graphql",gql:"graphql",dockerfile:"docker",makefile:"makefile",r:"r",lua:"lua",dart:"dart",zig:"zig"};function ye(e){return e.split("/").pop()??e}function Ne({filePath:e,onBack:t}){const[s,a]=n.useState(null),[r,l]=n.useState(!0),[c,i]=n.useState(null),{resolved:d}=P(),u=function(e){const t=e.split("/").pop()??"",s=t.toLowerCase();if("dockerfile"===s)return"dockerfile";if("makefile"===s)return"makefile";const a=t.lastIndexOf(".");return a>=0?t.slice(a+1).toLowerCase():""}(e),x=be.has(u),m=je.has(u),h=ve[u],p="dark"===d;n.useEffect(()=>{x||m?l(!1):(l(!0),i(null),z(e).then(a).catch(e=>i(e instanceof Error?e.message:"Failed to load")).finally(()=>l(!1)))},[e,x,m]);const f=T(e),g=n.useMemo(()=>{const e=M();return e?`${f}&token=${encodeURIComponent(e)}`:f},[f]),b=n.useMemo(()=>x?`${g}&t=${Date.now()}`:"",[g,x]);return o.jsxs("div",{className:"flex flex-col h-full",children:[o.jsxs("div",{className:"flex items-center gap-2 px-3 h-12 border-b border-border shrink-0",children:[o.jsx("button",{onClick:t,className:"text-muted-foreground active:text-foreground p-1",children:o.jsx(k,{className:"h-5 w-5"})}),o.jsx("span",{className:"flex-1 text-sm font-medium truncate",children:ye(e)}),o.jsx("a",{href:g,download:!0,className:"text-muted-foreground active:text-foreground p-1",onClick:e=>e.stopPropagation(),children:o.jsx(U,{className:"h-4 w-4"})})]}),o.jsxs("div",{className:"flex-1 overflow-auto min-h-0",children:[r&&o.jsx("div",{className:"flex items-center justify-center py-12",children:o.jsx(S,{className:"h-5 w-5 animate-spin text-muted-foreground"})}),c&&o.jsx("div",{className:"text-center text-destructive text-sm py-12 px-4",children:c}),x&&o.jsx("div",{className:"flex items-center justify-center p-4 h-full",children:o.jsx("img",{src:b,alt:ye(e),className:"max-w-full max-h-full object-contain rounded",style:{touchAction:"pinch-zoom"}})}),m&&o.jsx(n.Suspense,{fallback:o.jsx("div",{className:"flex items-center justify-center py-12",children:o.jsx(S,{className:"h-5 w-5 animate-spin text-muted-foreground"})}),children:o.jsx(ge,{filePath:e,ext:u,zoom:100})}),s&&(s.binary||s.tooLarge)&&o.jsxs("div",{className:"text-center py-12 px-4 space-y-3",children:[o.jsxs("p",{className:"text-muted-foreground text-sm",children:[s.binary?"二进制文件":"文件过大",s.size>0&&` (${j=s.size,j<1024?`${j} B`:j<1048576?`${(j/1024).toFixed(1)} KB`:`${(j/1048576).toFixed(1)} MB`})`]}),o.jsxs("a",{href:g,download:!0,className:"inline-flex items-center gap-1.5 text-sm text-blue-500 active:text-blue-400",children:[o.jsx(U,{className:"h-4 w-4"}),"下载文件"]})]}),s&&!s.binary&&!s.tooLarge&&null!=s.content&&o.jsxs(o.Fragment,{children:["md"===u&&o.jsx("div",{className:"prose prose-sm dark:prose-invert max-w-none px-4 py-3",children:o.jsx(Q,{remarkPlugins:[Y,Z],rehypePlugins:[X],urlTransform:(e,t,s)=>"src"===t&&"img"===s.tagName?e:te(e),components:{img:({src:t,alt:s,...a})=>o.jsx("img",{...a,src:ee(e,t,M()),alt:s??"",loading:"lazy",style:{maxWidth:"100%",height:"auto"}})},children:s.content})}),"md"!==u&&h&&o.jsx(se,{language:h,style:p?ae:ne,customStyle:{margin:0,fontSize:"12px",borderRadius:0},showLineNumbers:!0,children:s.content}),"md"!==u&&!h&&o.jsx("pre",{className:"p-4 text-xs font-mono whitespace-pre-wrap break-words",children:s.content})]})]})]});var j}const we=new Set(["png","jpg","jpeg","gif","webp","svg","bmp","ico","avif"]),ke=new Set(["js","jsx","ts","tsx","py","rb","go","rs","java","c","cpp","h","swift","kt","cs","php","sh","bash","zsh","r","lua","dart","zig","css","scss","less","html","htm","xml","sql"]),Ce=new Set(["json","yaml","yml","toml","csv","tsv"]);function Se({entry:e}){if("dir"===e.type)return o.jsx(L,{className:"h-8 w-8 text-blue-400"});const t=function(e){const t=e.lastIndexOf(".");return t>=0?e.slice(t+1).toLowerCase():""}(e.name);return we.has(t)?o.jsx(re,{className:"h-8 w-8 text-emerald-400"}):ke.has(t)?o.jsx(de,{className:"h-8 w-8 text-orange-400"}):Ce.has(t)?o.jsx(ue,{className:"h-8 w-8 text-yellow-400"}):"md"===t?o.jsx(le,{className:"h-8 w-8 text-sky-400"}):o.jsx(R,{className:"h-8 w-8 text-muted-foreground"})}function Ie({rootPath:e,onClose:t}){const[s,a]=n.useState(e),[r,l]=n.useState([]),[c,i]=n.useState(!0),[d,u]=n.useState(null),x=n.useCallback(async e=>{i(!0);try{const t=[...(await D(e)).entries].sort((e,t)=>e.type!==t.type?"dir"===e.type?-1:1:e.name.localeCompare(t.name));l(t),a(e)}catch{l([])}finally{i(!1)}},[]);n.useEffect(()=>{x(e)},[e,x]);const m=s!==e,h=s.startsWith(e)?s.slice(e.length)||"/":s;return d?o.jsx(Ne,{filePath:d,onBack:()=>u(null)}):o.jsxs("div",{className:"flex flex-col h-full",children:[o.jsxs("div",{className:"flex items-center gap-2 px-3 h-12 border-b border-border shrink-0",children:[o.jsx("button",{onClick:t,className:"text-muted-foreground active:text-foreground p-1",children:o.jsx($,{className:"h-5 w-5"})}),o.jsxs("div",{className:"flex items-center gap-1 flex-1 min-w-0 text-sm",children:[m&&o.jsx("button",{onClick:()=>{if(s===e)return;const t=s.replace(/\/[^/]+$/,"")||"/";t.startsWith(e)&&x(t)},className:"text-muted-foreground active:text-foreground p-0.5 shrink-0",children:o.jsx(k,{className:"h-4 w-4"})}),o.jsx("span",{className:"truncate text-muted-foreground font-mono text-xs",children:h})]})]}),o.jsxs("div",{className:"flex-1 overflow-y-auto px-3 py-3",children:[c&&o.jsx("div",{className:"flex items-center justify-center py-12",children:o.jsx(S,{className:"h-5 w-5 animate-spin text-muted-foreground"})}),!c&&0===r.length&&o.jsx("div",{className:"text-center text-muted-foreground text-sm py-12",children:"空目录"}),!c&&o.jsx("div",{className:"grid grid-cols-3 gap-1",children:r.map(e=>o.jsxs("button",{onClick:()=>(e=>{"dir"===e.type?x(e.path):u(e.path)})(e),className:"flex flex-col items-center gap-1 p-2 rounded-md active:bg-accent transition-colors",children:[o.jsx(Se,{entry:e}),o.jsx("span",{className:"text-[11px] text-center leading-tight w-full line-clamp-2 break-all",children:e.name})]},e.path))})]})]})}function Pe(e){return e<50?"text-green-400":e<80?"text-yellow-400":"text-red-400"}function ze(e){return e<50?"bg-green-500":e<80?"bg-yellow-500":"bg-red-500"}function Me({projectName:e,cliTool:t,folderPath:s,contextData:a,onClose:r}){const[l,c]=n.useState(new Set(["context","usage","files"])),[u,x]=n.useState(null),[m,h]=n.useState(!1),p=e=>{c(t=>{const s=new Set(t);return s.has(e)?s.delete(e):s.add(e),s})};n.useEffect(()=>{h(!0),_(t).then(x).catch(()=>x(null)).finally(()=>h(!1))},[t]);const f=a?Math.round(a.usedPercentage):null;return o.jsxs("div",{className:"flex flex-col h-full",children:[o.jsxs("div",{className:"flex items-center gap-2 px-3 h-12 border-b border-border shrink-0",children:[o.jsx("button",{onClick:r,className:"text-muted-foreground active:text-foreground p-1",children:o.jsx($,{className:"h-5 w-5"})}),o.jsx("span",{className:"flex-1 font-medium text-sm truncate",children:e})]}),o.jsxs("div",{className:"flex-1 overflow-y-auto",children:[o.jsxs("button",{onClick:()=>p("context"),className:"w-full flex items-center gap-2 px-4 py-2.5 border-b border-border/50 active:bg-accent",children:[l.has("context")?o.jsx(ce,{className:"h-3.5 w-3.5 text-muted-foreground"}):o.jsx(F,{className:"h-3.5 w-3.5 text-muted-foreground"}),o.jsx("span",{className:"text-sm font-medium",children:"上下文"}),null!==f&&o.jsxs("span",{className:d("text-xs font-mono ml-auto",Pe(f)),children:[f,"%"]})]}),l.has("context")&&o.jsx("div",{className:"px-4 py-3 border-b border-border/50",children:null!==f&&a?o.jsxs("div",{className:"space-y-2",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("div",{className:"flex-1 h-2 bg-secondary rounded-full overflow-hidden",children:o.jsx("div",{className:d("h-full rounded-full transition-all",ze(f)),style:{width:`${Math.min(f,100)}%`}})}),o.jsxs("span",{className:d("text-xs font-mono w-10 text-right",Pe(f)),children:[f,"%"]})]}),o.jsxs("div",{className:"grid grid-cols-2 gap-x-4 gap-y-1 text-[11px] text-muted-foreground",children:[o.jsx("span",{children:"窗口大小"}),o.jsx("span",{className:"text-right font-mono",children:a.contextWindowSize>=1e6?`${(a.contextWindowSize/1e6).toFixed(1)}M`:`${Math.round(a.contextWindowSize/1e3)}K`}),o.jsx("span",{children:"输入 tokens"}),o.jsx("span",{className:"text-right font-mono",children:a.inputTokens.toLocaleString()}),o.jsx("span",{children:"输出 tokens"}),o.jsx("span",{className:"text-right font-mono",children:a.outputTokens.toLocaleString()})]})]}):o.jsx("div",{className:"text-xs text-muted-foreground/50 text-center py-2",children:"暂无数据"})}),o.jsxs("div",{className:"w-full flex items-center gap-2 px-4 py-2.5 border-b border-border/50 cursor-pointer",role:"button",tabIndex:0,onClick:()=>p("usage"),onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||p("usage")},children:[l.has("usage")?o.jsx(ce,{className:"h-3.5 w-3.5 text-muted-foreground"}):o.jsx(F,{className:"h-3.5 w-3.5 text-muted-foreground"}),o.jsx("span",{className:"text-sm font-medium",children:"用量"}),o.jsx("button",{onClick:e=>{e.stopPropagation(),(async()=>{h(!0);try{const{refreshUsage:e}=await E(async()=>{const{refreshUsage:e}=await import("./index-CMlFtaTa.js").then(e=>e.bV);return{refreshUsage:e}},__vite__mapDeps([1,2]));x(await e(t))}catch{}finally{h(!1)}})()},className:"ml-auto text-muted-foreground active:text-foreground",children:o.jsx(i,{className:d("h-3 w-3",m&&"animate-spin")})})]}),l.has("usage")&&o.jsx("div",{className:"px-4 py-3 border-b border-border/50",children:u?o.jsxs("div",{className:"space-y-2",children:[u.planName&&o.jsxs("div",{className:"text-[11px] text-muted-foreground",children:["Plan: ",o.jsx("span",{className:"font-medium text-foreground",children:u.planName})]}),o.jsx(Ue,{label:"5h",bucket:u.fiveHour}),o.jsx(Ue,{label:"7d",bucket:u.sevenDay}),u.sevenDaySonnet&&o.jsx(Ue,{label:"7d Sonnet",bucket:u.sevenDaySonnet}),u.sevenDayOpus&&o.jsx(Ue,{label:"7d Opus",bucket:u.sevenDayOpus}),!u.fiveHour&&!u.sevenDay&&o.jsx("div",{className:"text-xs text-muted-foreground/50 text-center",children:"暂无数据"})]}):o.jsx("div",{className:"text-xs text-muted-foreground/50 text-center py-2",children:m?"加载中...":"暂无数据"})}),o.jsxs("button",{onClick:()=>p("files"),className:"w-full flex items-center gap-2 px-4 py-2.5 border-b border-border/50 active:bg-accent",children:[l.has("files")?o.jsx(ce,{className:"h-3.5 w-3.5 text-muted-foreground"}):o.jsx(F,{className:"h-3.5 w-3.5 text-muted-foreground"}),o.jsx("span",{className:"text-sm font-medium",children:"文件"})]}),l.has("files")&&o.jsx("div",{className:"h-[60vh]",children:o.jsx(Ie,{rootPath:s,onClose:()=>p("files")})})]})]})}function Ue({label:e,bucket:t}){if(!t||void 0===t.utilization)return null;const s=t.utilization,a=function(e){if(!e)return"";const t=new Date(e).getTime()-Date.now();if(t<=0)return"即将重置";const s=Math.floor(t/36e5),a=Math.floor(t%36e5/6e4);return s>0?`${s}h${a}m`:`${a}m`}(t.resetAt);return o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("span",{className:"text-xs text-muted-foreground w-16",children:e}),o.jsx("div",{className:"flex-1 h-1.5 bg-secondary rounded-full overflow-hidden",children:o.jsx("div",{className:d("h-full rounded-full",ze(s)),style:{width:`${Math.min(s,100)}%`}})}),o.jsxs("span",{className:d("text-xs font-mono w-8 text-right",Pe(s)),children:[s,"%"]}),a&&o.jsx("span",{className:"text-[10px] text-muted-foreground/60",children:a})]})}function Te(){n.useEffect(()=>{const e=document.querySelector('meta[name="viewport"]');if(!e)return;const t=e.getAttribute("content")??"";return e.setAttribute("content","width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, viewport-fit=cover"),()=>{e.setAttribute("content",t)}},[]);const[e,t]=n.useState({screen:"list"}),[s,r]=n.useState(null),l=a(e=>e.projects),c=n.useCallback(e=>{t({screen:"chat",projectId:e}),r(null)},[]),i=n.useCallback(e=>{t({screen:"panel",projectId:e})},[]),d=n.useCallback(()=>{t(e=>"panel"===e.screen?{screen:"chat",projectId:e.projectId}:{screen:"list"})},[]),u="list"!==e.screen?l.find(t=>t.id===e.projectId):void 0;return o.jsxs("div",{className:"fixed inset-0 bg-background overflow-hidden",children:[o.jsxs(H,{mode:"wait",children:["list"===e.screen&&o.jsx(O.div,{className:"absolute inset-0",initial:{opacity:0},animate:{opacity:1},exit:{x:"-30%",opacity:0},transition:{duration:.2},style:{paddingTop:"env(safe-area-inset-top)"},children:o.jsx(he,{onSelectProject:c})},"list"),"chat"===e.screen&&u&&o.jsx(O.div,{className:"absolute inset-0",initial:{x:"100%"},animate:{x:0},exit:{x:"100%"},transition:{type:"tween",duration:.25},style:{paddingTop:"env(safe-area-inset-top)"},children:o.jsx(fe,{project:u,onBack:d,onOpenPanel:()=>i(e.projectId),onContextUpdate:r})},`chat-${e.projectId}`)]}),o.jsx(H,{children:"panel"===e.screen&&u&&o.jsx(O.div,{className:"absolute inset-0 z-50 bg-background",initial:{x:"100%"},animate:{x:0},exit:{x:"100%"},transition:{type:"tween",duration:.25},style:{paddingTop:"env(safe-area-inset-top)"},children:o.jsx(Me,{projectName:u.name,cliTool:u.cliTool??"claude",folderPath:u.folderPath,contextData:s,onClose:d})},"panel")})]})}export{Te as MobilePage};
|