@promptowl/contextnest-community 1.24.0 → 1.25.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/API.md +109 -6
- package/CONFIGURATION.md +7 -2
- package/README.md +1 -1
- package/STEWARDSHIP.md +24 -0
- package/dist/{chunk-2TPQTN4Y.js → chunk-2KHM5C7V.js} +37 -3
- package/dist/{chunk-XUIWAWDO.js → chunk-32SZCH36.js} +4 -4
- package/dist/{chunk-KIAAEHWL.js → chunk-7FROMOZM.js} +23 -5
- package/dist/{chunk-5EZOPA47.js → chunk-DTLMBF4W.js} +10 -8
- package/dist/{chunk-LA3VTQ22.js → chunk-JDAOA5KP.js} +43 -1
- package/dist/{chunk-I3CSD6CK.js → chunk-KPGNZLZL.js} +2 -2
- package/dist/{chunk-YVMSM7LS.js → chunk-LHWOJPFE.js} +7 -0
- package/dist/{chunk-ZTT4U4NE.js → chunk-TI7HMP64.js} +99 -12
- package/dist/{client-KEY4PYJH.js → client-D44ZHDTJ.js} +1 -1
- package/dist/{engine-S3QBQ7LH.js → engine-TER6FDBP.js} +3 -3
- package/dist/{external-edit-service-6FNFPOJJ.js → external-edit-service-CAGENHDJ.js} +4 -4
- package/dist/{grants-service-UT3EQ3R7.js → grants-service-2OTFS7EH.js} +3 -3
- package/dist/index.js +863 -355
- package/dist/{migrations.postgres-AIQ7WSU7.js → migrations.postgres-23VJJJJX.js} +12 -2
- package/dist/{review-service-HHGOTO6P.js → review-service-4G2XUFS6.js} +7 -7
- package/dist/{stewardship-service-4DHNRULG.js → stewardship-service-S22V2JKG.js} +6 -4
- package/dist/{version-service-KIOQME6U.js → version-service-X4FAG2OZ.js} +4 -4
- package/dist/web3/assets/ActivityTracePage-D2iIbEph.js +1 -0
- package/dist/web3/assets/{AgentDocsPage-CIiaBqMy.js → AgentDocsPage-Dkhgb1hk.js} +1 -1
- package/dist/web3/assets/CollaboratorManager-Bo81D--Q.js +1 -0
- package/dist/web3/assets/CollaboratorsTab-DRCitQuX.js +1 -0
- package/dist/web3/assets/DocumentEditor-DV2WHYbj.js +36 -0
- package/dist/web3/assets/{DocumentsTab-Vba-AzBv.js → DocumentsTab-BUxBCN8o.js} +2 -2
- package/dist/web3/assets/{ExternalEditsTab-BSzAQIGM.js → ExternalEditsTab-kIBimZyE.js} +1 -1
- package/dist/web3/assets/MarkdownEditor-CsVusP2d.css +1 -0
- package/dist/web3/assets/MarkdownEditor-Dfk5uIE5.js +648 -0
- package/dist/web3/assets/{NestPageHeader-CoLUV1Oz.js → NestPageHeader-yOK-OIYZ.js} +1 -1
- package/dist/web3/assets/NestView-DwIagxwJ.js +68 -0
- package/dist/web3/assets/{OverviewTab-Dxi-Hu-N.js → OverviewTab-DFOFMVyE.js} +1 -1
- package/dist/web3/assets/{PersonCombobox-CPOlNs6G.js → PersonCombobox-D350WlrJ.js} +1 -1
- package/dist/web3/assets/{ReasonDialog-DgLxfRWv.js → ReasonDialog-CN3ECAnQ.js} +1 -1
- package/dist/web3/assets/{ReviewActions-OfOdqzCn.js → ReviewActions-BXDTDPp1.js} +1 -1
- package/dist/web3/assets/{ReviewTab-CyX8yxd3.js → ReviewTab-CZewAYiz.js} +1 -1
- package/dist/web3/assets/StewardsTab-AagNWcWS.js +1 -0
- package/dist/web3/assets/{SubmitForReviewModal-Ci2DdWs0.js → SubmitForReviewModal-BOZJxwRN.js} +1 -1
- package/dist/web3/assets/{alert-dialog-DTozKlmV.js → alert-dialog-4SiLKlz8.js} +1 -1
- package/dist/web3/assets/{arrow-left-BCKt4CwQ.js → arrow-left-BAgIocLn.js} +1 -1
- package/dist/web3/assets/backlinks-Cb8Uf8mw.js +24 -0
- package/dist/web3/assets/{card-XG2dP5Xf.js → card-UDyMRcps.js} +1 -1
- package/dist/web3/assets/{chevron-left-BPwUT9DS.js → chevron-left-XR4ReJ9Z.js} +1 -1
- package/dist/web3/assets/{circle-check-DI8IBGeo.js → circle-check-CSkZUEFK.js} +1 -1
- package/dist/web3/assets/{circle-x-VKVhC88W.js → circle-x-in2o3aHU.js} +1 -1
- package/dist/web3/assets/client-attribution-BraarYaP.js +1 -0
- package/dist/web3/assets/{code-xml-CMabYZvH.js → code-xml-pPQgdctI.js} +1 -1
- package/dist/web3/assets/{corner-down-right-BGxwK6wH.js → corner-down-right-CuxZWscX.js} +1 -1
- package/dist/web3/assets/{count-skeleton-DMbdpscX.js → count-skeleton-DBWCDhRy.js} +1 -1
- package/dist/web3/assets/{earth-BEp1EKTo.js → earth-CXOcThqn.js} +1 -1
- package/dist/web3/assets/{file-exclamation-point-r8qZGIjP.js → file-exclamation-point-CSphs1VD.js} +1 -1
- package/dist/web3/assets/{folder-input-Cmtx1Jhk.js → folder-input-BAwK9tFL.js} +1 -1
- package/dist/web3/assets/{index-C1wTSjfP.js → index-A0_ymcqL.js} +1 -1
- package/dist/web3/assets/index-B5hLclEq.js +389 -0
- package/dist/web3/assets/index-DrUAtoQM.css +1 -0
- package/dist/web3/assets/page-BHD4beun.js +1 -0
- package/dist/web3/assets/{page-CPjWQNKx.js → page-BSYUXYmO.js} +1 -1
- package/dist/web3/assets/page-BYc2DIux.js +45 -0
- package/dist/web3/assets/{page-Bicf02Cz.js → page-BfibLg8e.js} +1 -1
- package/dist/web3/assets/page-CGe8MtUu.js +9 -0
- package/dist/web3/assets/{page-CQt3ZGbf.js → page-CIgPJmG6.js} +1 -1
- package/dist/web3/assets/{page-CHb0F5hV.js → page-CUjuSs5Q.js} +1 -1
- package/dist/web3/assets/{page-BYUFhYWZ.js → page-Ck31nx9b.js} +1 -1
- package/dist/web3/assets/{page-BExMvttJ.js → page-Cpdj_11Y.js} +1 -1
- package/dist/web3/assets/{page-CtaW65El.js → page-D0sN3GO6.js} +1 -1
- package/dist/web3/assets/page-DEpH91X2.js +1 -0
- package/dist/web3/assets/{page-CC0NJi8v.js → page-l8-B7CGt.js} +1 -1
- package/dist/web3/assets/{page-DGOL9l8i.js → page-mnSHmk6A.js} +1 -1
- package/dist/web3/assets/{page-title-ClvvBsIo.js → page-title-BkqlUA0j.js} +1 -1
- package/dist/web3/assets/{page-ByyVLDVo.js → page-xzYqkBUP.js} +5 -5
- package/dist/web3/assets/{play-C5YNKpAH.js → play-B8xE9j5f.js} +1 -1
- package/dist/web3/assets/{refresh-cw-BhHzSH9m.js → refresh-cw-CsCtmWwX.js} +1 -1
- package/dist/web3/assets/{scroll-area-hz-xtayP.js → scroll-area-CbcH6yrZ.js} +1 -1
- package/dist/web3/assets/{select-DBFTrUmI.js → select-DrL0mpRN.js} +2 -2
- package/dist/web3/assets/{send-0CHvmluT.js → send-CvAgOUPG.js} +1 -1
- package/dist/web3/assets/{settings-CeeF4LEb.js → settings-EY4A_DYv.js} +1 -1
- package/dist/web3/assets/{share-2-CMnOlOt-.js → share-2-vGmZUl90.js} +1 -1
- package/dist/web3/assets/{tag-DQ_6J5Gv.js → tag-Br_y1f00.js} +1 -1
- package/dist/web3/assets/{trash-2-HBi-Pslz.js → trash-2-B4hRXo-p.js} +1 -1
- package/dist/web3/assets/{triangle-alert-CDy8-7sv.js → triangle-alert-CsYGyfGZ.js} +1 -1
- package/dist/web3/assets/{user-plus-CvBNcpn4.js → user-plus-4CTYEkd3.js} +1 -1
- package/dist/web3/assets/{x-By7piikG.js → x-qxt1WrUi.js} +1 -1
- package/dist/web3/assets/zap-BcsKR0ef.js +16 -0
- package/dist/web3/index.html +2 -2
- package/package.json +2 -2
- package/dist/web3/assets/ActivityTracePage-BOZHgJ8S.js +0 -1
- package/dist/web3/assets/CollaboratorManager-By91wrIr.js +0 -1
- package/dist/web3/assets/CollaboratorsTab-D1EE64Fs.js +0 -1
- package/dist/web3/assets/DocumentEditor-DrQfrW3d.js +0 -36
- package/dist/web3/assets/MarkdownEditor-74N_naNQ.css +0 -1
- package/dist/web3/assets/MarkdownEditor-C9zqZjC5.js +0 -643
- package/dist/web3/assets/NestView-CTZ55tXD.js +0 -63
- package/dist/web3/assets/StewardsTab-DBEEfAQI.js +0 -1
- package/dist/web3/assets/backlinks-CYd4xENL.js +0 -24
- package/dist/web3/assets/index-BM-h3DwI.css +0 -1
- package/dist/web3/assets/index-EaX2yql0.js +0 -389
- package/dist/web3/assets/page-B3yvQvHy.js +0 -1
- package/dist/web3/assets/page-BUOADv2X.js +0 -1
- package/dist/web3/assets/page-BsPMDm5d.js +0 -45
- package/dist/web3/assets/page-Cj1NetQ-.js +0 -1
- package/dist/web3/assets/zap-C2T8riBp.js +0 -11
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{c as ht,r as n,j as l,
|
|
1
|
+
import{c as ht,r as n,j as l,d0 as gt,c$ as _,d6 as vt,d3 as Te,dk as St,c_ as Ie,cP as V,d8 as z,dm as Re,dG as xt,d4 as wt,dl as yt,cS as R,dn as Ct,c6 as Pe,cX as It,d7 as bt,dH as Tt,dI as Nt,dJ as Rt,dK as Pt,dp as Et,dq as _t,dr as jt,aj as Ee,s as G,C as Mt}from"./index-B5hLclEq.js";/**
|
|
2
2
|
* @license lucide-react v0.577.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
5
5
|
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
-
*/const At=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],Ot=ht("chevron-up",At);function Ne(t,[o,e]){return Math.min(e,Math.max(o,t))}function Dt(t){const o=Lt(t),e=n.forwardRef((s,r)=>{const{children:d,...i}=s,a=n.Children.toArray(d),c=a.find(kt);if(c){const u=c.props.children,v=a.map(S=>S===c?n.Children.count(u)>1?n.Children.only(null):n.isValidElement(u)?u.props.children:null:S);return l.jsx(o,{...i,ref:r,children:n.isValidElement(u)?n.cloneElement(u,void 0,v):null})}return l.jsx(o,{...i,ref:r,children:d})});return e.displayName=`${t}.Slot`,e}function Lt(t){const o=n.forwardRef((e,s)=>{const{children:r,...d}=e;if(n.isValidElement(r)){const i=Ht(r),a=Bt(d,r.props);return r.type!==n.Fragment&&(a.ref=s?gt(s,i):i),n.cloneElement(r,a)}return n.Children.count(r)>1?n.Children.only(null):null});return o.displayName=`${t}.SlotClone`,o}var Vt=Symbol("radix.slottable");function kt(t){return n.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===Vt}function Bt(t,o){const e={...o};for(const s in o){const r=t[s],d=o[s];/^on[A-Z]/.test(s)?r&&d?e[s]=(...a)=>{const c=d(...a);return r(...a),c}:r&&(e[s]=r):s==="style"?e[s]={...r,...d}:s==="className"&&(e[s]=[r,d].filter(Boolean).join(" "))}return{...t,...e}}function Ht(t){var s,r;let o=(s=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:s.get,e=o&&"isReactWarning"in o&&o.isReactWarning;return e?t.ref:(o=(r=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:r.get,e=o&&"isReactWarning"in o&&o.isReactWarning,e?t.props.ref:t.props.ref||t.ref)}var _e=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"}),Wt="VisuallyHidden",je=n.forwardRef((t,o)=>l.jsx(_.span,{...t,ref:o,style:{..._e,...t.style}}));je.displayName=Wt;var Io=je,Ft=[" ","Enter","ArrowUp","ArrowDown"],Ut=[" ","Enter"],Q="Select",[ie,de,Kt]=xt(Q),[oe]=It(Q,[Kt,Re]),ue=Re(),[$t,Y]=oe(Q),[zt,Gt]=oe(Q),Me=t=>{const{__scopeSelect:o,children:e,open:s,defaultOpen:r,onOpenChange:d,value:i,defaultValue:a,onValueChange:c,dir:u,name:v,autoComplete:S,disabled:T,required:N,form:b}=t,p=ue(o),[g,y]=n.useState(null),[f,h]=n.useState(null),[M,A]=n.useState(!1),ne=vt(u),[E,D]=Te({prop:s,defaultProp:r??!1,onChange:d,caller:Q}),[U,q]=Te({prop:i,defaultProp:a,onChange:c,caller:Q}),k=n.useRef(null),B=g?b||!!g.closest("form"):!0,[K,H]=n.useState(new Set),W=Array.from(K).map(P=>P.props.value).join(";");return l.jsx(St,{...p,children:l.jsxs($t,{required:N,scope:o,trigger:g,onTriggerChange:y,valueNode:f,onValueNodeChange:h,valueNodeHasChildren:M,onValueNodeHasChildrenChange:A,contentId:Ie(),value:U,onValueChange:q,open:E,onOpenChange:D,dir:ne,triggerPointerDownPosRef:k,disabled:T,children:[l.jsx(ie.Provider,{scope:o,children:l.jsx(zt,{scope:t.__scopeSelect,onNativeOptionAdd:n.useCallback(P=>{H(L=>new Set(L).add(P))},[]),onNativeOptionRemove:n.useCallback(P=>{H(L=>{const F=new Set(L);return F.delete(P),F})},[]),children:e})}),B?l.jsxs(ot,{"aria-hidden":!0,required:N,tabIndex:-1,name:v,autoComplete:S,value:U,onChange:P=>q(P.target.value),disabled:T,form:b,children:[U===void 0?l.jsx("option",{value:""}):null,Array.from(K)]},W):null]})})};Me.displayName=Q;var Ae="SelectTrigger",Oe=n.forwardRef((t,o)=>{const{__scopeSelect:e,disabled:s=!1,...r}=t,d=ue(e),i=Y(Ae,e),a=i.disabled||s,c=V(o,i.onTriggerChange),u=de(e),v=n.useRef("touch"),[S,T,N]=rt(p=>{const g=u().filter(h=>!h.disabled),y=g.find(h=>h.value===i.value),f=st(g,p,y);f!==void 0&&i.onValueChange(f.value)}),b=p=>{a||(i.onOpenChange(!0),N()),p&&(i.triggerPointerDownPosRef.current={x:Math.round(p.pageX),y:Math.round(p.pageY)})};return l.jsx(yt,{asChild:!0,...d,children:l.jsx(_.button,{type:"button",role:"combobox","aria-controls":i.contentId,"aria-expanded":i.open,"aria-required":i.required,"aria-autocomplete":"none",dir:i.dir,"data-state":i.open?"open":"closed",disabled:a,"data-disabled":a?"":void 0,"data-placeholder":nt(i.value)?"":void 0,...r,ref:c,onClick:R(r.onClick,p=>{p.currentTarget.focus(),v.current!=="mouse"&&b(p)}),onPointerDown:R(r.onPointerDown,p=>{v.current=p.pointerType;const g=p.target;g.hasPointerCapture(p.pointerId)&&g.releasePointerCapture(p.pointerId),p.button===0&&p.ctrlKey===!1&&p.pointerType==="mouse"&&(b(p),p.preventDefault())}),onKeyDown:R(r.onKeyDown,p=>{const g=S.current!=="";!(p.ctrlKey||p.altKey||p.metaKey)&&p.key.length===1&&T(p.key),!(g&&p.key===" ")&&Ft.includes(p.key)&&(b(),p.preventDefault())})})})});Oe.displayName=Ae;var De="SelectValue",Le=n.forwardRef((t,o)=>{const{__scopeSelect:e,className:s,style:r,children:d,placeholder:i="",...a}=t,c=Y(De,e),{onValueNodeHasChildrenChange:u}=c,v=d!==void 0,S=V(o,c.onValueNodeChange);return z(()=>{u(v)},[u,v]),l.jsx(_.span,{...a,ref:S,style:{pointerEvents:"none"},children:nt(c.value)?l.jsx(l.Fragment,{children:i}):d})});Le.displayName=De;var Yt="SelectIcon",Ve=n.forwardRef((t,o)=>{const{__scopeSelect:e,children:s,...r}=t;return l.jsx(_.span,{"aria-hidden":!0,...r,ref:o,children:s||"▼"})});Ve.displayName=Yt;var Zt="SelectPortal",ke=t=>l.jsx(Ct,{asChild:!0,...t});ke.displayName=Zt;var ee="SelectContent",Be=n.forwardRef((t,o)=>{const e=Y(ee,t.__scopeSelect),[s,r]=n.useState();if(z(()=>{r(new DocumentFragment)},[]),!e.open){const d=s;return d?Ee.createPortal(l.jsx(He,{scope:t.__scopeSelect,children:l.jsx(ie.Slot,{scope:t.__scopeSelect,children:l.jsx("div",{children:t.children})})}),d):null}return l.jsx(We,{...t,ref:o})});Be.displayName=ee;var O=10,[He,Z]=oe(ee),qt="SelectContentImpl",Xt=Dt("SelectContent.RemoveScroll"),We=n.forwardRef((t,o)=>{const{__scopeSelect:e,position:s="item-aligned",onCloseAutoFocus:r,onEscapeKeyDown:d,onPointerDownOutside:i,side:a,sideOffset:c,align:u,alignOffset:v,arrowPadding:S,collisionBoundary:T,collisionPadding:N,sticky:b,hideWhenDetached:p,avoidCollisions:g,...y}=t,f=Y(ee,e),[h,M]=n.useState(null),[A,ne]=n.useState(null),E=V(o,m=>M(m)),[D,U]=n.useState(null),[q,k]=n.useState(null),B=de(e),[K,H]=n.useState(!1),W=n.useRef(!1);n.useEffect(()=>{if(h)return Tt(h)},[h]),Nt();const P=n.useCallback(m=>{const[I,...j]=B().map(w=>w.ref.current),[C]=j.slice(-1),x=document.activeElement;for(const w of m)if(w===x||(w==null||w.scrollIntoView({block:"nearest"}),w===I&&A&&(A.scrollTop=0),w===C&&A&&(A.scrollTop=A.scrollHeight),w==null||w.focus(),document.activeElement!==x))return},[B,A]),L=n.useCallback(()=>P([D,h]),[P,D,h]);n.useEffect(()=>{K&&L()},[K,L]);const{onOpenChange:F,triggerPointerDownPosRef:$}=f;n.useEffect(()=>{if(h){let m={x:0,y:0};const I=C=>{var x,w;m={x:Math.abs(Math.round(C.pageX)-(((x=$.current)==null?void 0:x.x)??0)),y:Math.abs(Math.round(C.pageY)-(((w=$.current)==null?void 0:w.y)??0))}},j=C=>{m.x<=10&&m.y<=10?C.preventDefault():h.contains(C.target)||F(!1),document.removeEventListener("pointermove",I),$.current=null};return $.current!==null&&(document.addEventListener("pointermove",I),document.addEventListener("pointerup",j,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",I),document.removeEventListener("pointerup",j,{capture:!0})}}},[h,F,$]),n.useEffect(()=>{const m=()=>F(!1);return window.addEventListener("blur",m),window.addEventListener("resize",m),()=>{window.removeEventListener("blur",m),window.removeEventListener("resize",m)}},[F]);const[pe,ae]=rt(m=>{const I=B().filter(x=>!x.disabled),j=I.find(x=>x.ref.current===document.activeElement),C=st(I,m,j);C&&setTimeout(()=>C.ref.current.focus())}),fe=n.useCallback((m,I,j)=>{const C=!W.current&&!j;(f.value!==void 0&&f.value===I||C)&&(U(m),C&&(W.current=!0))},[f.value]),me=n.useCallback(()=>h==null?void 0:h.focus(),[h]),te=n.useCallback((m,I,j)=>{const C=!W.current&&!j;(f.value!==void 0&&f.value===I||C)&&k(m)},[f.value]),le=s==="popper"?Se:Fe,re=le===Se?{side:a,sideOffset:c,align:u,alignOffset:v,arrowPadding:S,collisionBoundary:T,collisionPadding:N,sticky:b,hideWhenDetached:p,avoidCollisions:g}:{};return l.jsx(He,{scope:e,content:h,viewport:A,onViewportChange:ne,itemRefCallback:fe,selectedItem:D,onItemLeave:me,itemTextRefCallback:te,focusSelectedItem:L,selectedItemText:q,position:s,isPositioned:K,searchRef:pe,children:l.jsx(Rt,{as:Xt,allowPinchZoom:!0,children:l.jsx(Et,{asChild:!0,trapped:f.open,onMountAutoFocus:m=>{m.preventDefault()},onUnmountAutoFocus:R(r,m=>{var I;(I=f.trigger)==null||I.focus({preventScroll:!0}),m.preventDefault()}),children:l.jsx(Pt,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:d,onPointerDownOutside:i,onFocusOutside:m=>m.preventDefault(),onDismiss:()=>f.onOpenChange(!1),children:l.jsx(le,{role:"listbox",id:f.contentId,"data-state":f.open?"open":"closed",dir:f.dir,onContextMenu:m=>m.preventDefault(),...y,...re,onPlaced:()=>H(!0),ref:E,style:{display:"flex",flexDirection:"column",outline:"none",...y.style},onKeyDown:R(y.onKeyDown,m=>{const I=m.ctrlKey||m.altKey||m.metaKey;if(m.key==="Tab"&&m.preventDefault(),!I&&m.key.length===1&&ae(m.key),["ArrowUp","ArrowDown","Home","End"].includes(m.key)){let C=B().filter(x=>!x.disabled).map(x=>x.ref.current);if(["ArrowUp","End"].includes(m.key)&&(C=C.slice().reverse()),["ArrowUp","ArrowDown"].includes(m.key)){const x=m.target,w=C.indexOf(x);C=C.slice(w+1)}setTimeout(()=>P(C)),m.preventDefault()}})})})})})})});We.displayName=qt;var Jt="SelectItemAlignedPosition",Fe=n.forwardRef((t,o)=>{const{__scopeSelect:e,onPlaced:s,...r}=t,d=Y(ee,e),i=Z(ee,e),[a,c]=n.useState(null),[u,v]=n.useState(null),S=V(o,E=>v(E)),T=de(e),N=n.useRef(!1),b=n.useRef(!0),{viewport:p,selectedItem:g,selectedItemText:y,focusSelectedItem:f}=i,h=n.useCallback(()=>{if(d.trigger&&d.valueNode&&a&&u&&p&&g&&y){const E=d.trigger.getBoundingClientRect(),D=u.getBoundingClientRect(),U=d.valueNode.getBoundingClientRect(),q=y.getBoundingClientRect();if(d.dir!=="rtl"){const x=q.left-D.left,w=U.left-x,X=E.left-w,J=E.width+X,he=Math.max(J,D.width),ge=window.innerWidth-O,ve=Ne(w,[O,Math.max(O,ge-he)]);a.style.minWidth=J+"px",a.style.left=ve+"px"}else{const x=D.right-q.right,w=window.innerWidth-U.right-x,X=window.innerWidth-E.right-w,J=E.width+X,he=Math.max(J,D.width),ge=window.innerWidth-O,ve=Ne(w,[O,Math.max(O,ge-he)]);a.style.minWidth=J+"px",a.style.right=ve+"px"}const k=T(),B=window.innerHeight-O*2,K=p.scrollHeight,H=window.getComputedStyle(u),W=parseInt(H.borderTopWidth,10),P=parseInt(H.paddingTop,10),L=parseInt(H.borderBottomWidth,10),F=parseInt(H.paddingBottom,10),$=W+P+K+F+L,pe=Math.min(g.offsetHeight*5,$),ae=window.getComputedStyle(p),fe=parseInt(ae.paddingTop,10),me=parseInt(ae.paddingBottom,10),te=E.top+E.height/2-O,le=B-te,re=g.offsetHeight/2,m=g.offsetTop+re,I=W+P+m,j=$-I;if(I<=te){const x=k.length>0&&g===k[k.length-1].ref.current;a.style.bottom="0px";const w=u.clientHeight-p.offsetTop-p.offsetHeight,X=Math.max(le,re+(x?me:0)+w+L),J=I+X;a.style.height=J+"px"}else{const x=k.length>0&&g===k[0].ref.current;a.style.top="0px";const X=Math.max(te,W+p.offsetTop+(x?fe:0)+re)+j;a.style.height=X+"px",p.scrollTop=I-te+p.offsetTop}a.style.margin=`${O}px 0`,a.style.minHeight=pe+"px",a.style.maxHeight=B+"px",s==null||s(),requestAnimationFrame(()=>N.current=!0)}},[T,d.trigger,d.valueNode,a,u,p,g,y,d.dir,s]);z(()=>h(),[h]);const[M,A]=n.useState();z(()=>{u&&A(window.getComputedStyle(u).zIndex)},[u]);const ne=n.useCallback(E=>{E&&b.current===!0&&(h(),f==null||f(),b.current=!1)},[h,f]);return l.jsx(eo,{scope:e,contentWrapper:a,shouldExpandOnScrollRef:N,onScrollButtonChange:ne,children:l.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:M},children:l.jsx(_.div,{...r,ref:S,style:{boxSizing:"border-box",maxHeight:"100%",...r.style}})})})});Fe.displayName=Jt;var Qt="SelectPopperPosition",Se=n.forwardRef((t,o)=>{const{__scopeSelect:e,align:s="start",collisionPadding:r=O,...d}=t,i=ue(e);return l.jsx(_t,{...i,...d,ref:o,align:s,collisionPadding:r,style:{boxSizing:"border-box",...d.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)"}})});Se.displayName=Qt;var[eo,be]=oe(ee,{}),xe="SelectViewport",Ue=n.forwardRef((t,o)=>{const{__scopeSelect:e,nonce:s,...r}=t,d=Z(xe,e),i=be(xe,e),a=V(o,d.onViewportChange),c=n.useRef(0);return l.jsxs(l.Fragment,{children:[l.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:s}),l.jsx(ie.Slot,{scope:e,children:l.jsx(_.div,{"data-radix-select-viewport":"",role:"presentation",...r,ref:a,style:{position:"relative",flex:1,overflow:"hidden auto",...r.style},onScroll:R(r.onScroll,u=>{const v=u.currentTarget,{contentWrapper:S,shouldExpandOnScrollRef:T}=i;if(T!=null&&T.current&&S){const N=Math.abs(c.current-v.scrollTop);if(N>0){const b=window.innerHeight-O*2,p=parseFloat(S.style.minHeight),g=parseFloat(S.style.height),y=Math.max(p,g);if(y<b){const f=y+N,h=Math.min(b,f),M=f-h;S.style.height=h+"px",S.style.bottom==="0px"&&(v.scrollTop=M>0?M:0,S.style.justifyContent="flex-end")}}}c.current=v.scrollTop})})})]})});Ue.displayName=xe;var Ke="SelectGroup",[to,oo]=oe(Ke),no=n.forwardRef((t,o)=>{const{__scopeSelect:e,...s}=t,r=Ie();return l.jsx(to,{scope:e,id:r,children:l.jsx(_.div,{role:"group","aria-labelledby":r,...s,ref:o})})});no.displayName=Ke;var $e="SelectLabel",ze=n.forwardRef((t,o)=>{const{__scopeSelect:e,...s}=t,r=oo($e,e);return l.jsx(_.div,{id:r.id,...s,ref:o})});ze.displayName=$e;var ce="SelectItem",[ro,Ge]=oe(ce),Ye=n.forwardRef((t,o)=>{const{__scopeSelect:e,value:s,disabled:r=!1,textValue:d,...i}=t,a=Y(ce,e),c=Z(ce,e),u=a.value===s,[v,S]=n.useState(d??""),[T,N]=n.useState(!1),b=V(o,f=>{var h;return(h=c.itemRefCallback)==null?void 0:h.call(c,f,s,r)}),p=Ie(),g=n.useRef("touch"),y=()=>{r||(a.onValueChange(s),a.onOpenChange(!1))};if(s==="")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 l.jsx(ro,{scope:e,value:s,disabled:r,textId:p,isSelected:u,onItemTextChange:n.useCallback(f=>{S(h=>h||((f==null?void 0:f.textContent)??"").trim())},[]),children:l.jsx(ie.ItemSlot,{scope:e,value:s,disabled:r,textValue:v,children:l.jsx(_.div,{role:"option","aria-labelledby":p,"data-highlighted":T?"":void 0,"aria-selected":u&&T,"data-state":u?"checked":"unchecked","aria-disabled":r||void 0,"data-disabled":r?"":void 0,tabIndex:r?void 0:-1,...i,ref:b,onFocus:R(i.onFocus,()=>N(!0)),onBlur:R(i.onBlur,()=>N(!1)),onClick:R(i.onClick,()=>{g.current!=="mouse"&&y()}),onPointerUp:R(i.onPointerUp,()=>{g.current==="mouse"&&y()}),onPointerDown:R(i.onPointerDown,f=>{g.current=f.pointerType}),onPointerMove:R(i.onPointerMove,f=>{var h;g.current=f.pointerType,r?(h=c.onItemLeave)==null||h.call(c):g.current==="mouse"&&f.currentTarget.focus({preventScroll:!0})}),onPointerLeave:R(i.onPointerLeave,f=>{var h;f.currentTarget===document.activeElement&&((h=c.onItemLeave)==null||h.call(c))}),onKeyDown:R(i.onKeyDown,f=>{var M;((M=c.searchRef)==null?void 0:M.current)!==""&&f.key===" "||(Ut.includes(f.key)&&y(),f.key===" "&&f.preventDefault())})})})})});Ye.displayName=ce;var se="SelectItemText",Ze=n.forwardRef((t,o)=>{const{__scopeSelect:e,className:s,style:r,...d}=t,i=Y(se,e),a=Z(se,e),c=Ge(se,e),u=Gt(se,e),[v,S]=n.useState(null),T=V(o,y=>S(y),c.onItemTextChange,y=>{var f;return(f=a.itemTextRefCallback)==null?void 0:f.call(a,y,c.value,c.disabled)}),N=v==null?void 0:v.textContent,b=n.useMemo(()=>l.jsx("option",{value:c.value,disabled:c.disabled,children:N},c.value),[c.disabled,c.value,N]),{onNativeOptionAdd:p,onNativeOptionRemove:g}=u;return z(()=>(p(b),()=>g(b)),[p,g,b]),l.jsxs(l.Fragment,{children:[l.jsx(_.span,{id:c.textId,...d,ref:T}),c.isSelected&&i.valueNode&&!i.valueNodeHasChildren?Ee.createPortal(d.children,i.valueNode):null]})});Ze.displayName=se;var qe="SelectItemIndicator",Xe=n.forwardRef((t,o)=>{const{__scopeSelect:e,...s}=t;return Ge(qe,e).isSelected?l.jsx(_.span,{"aria-hidden":!0,...s,ref:o}):null});Xe.displayName=qe;var we="SelectScrollUpButton",Je=n.forwardRef((t,o)=>{const e=Z(we,t.__scopeSelect),s=be(we,t.__scopeSelect),[r,d]=n.useState(!1),i=V(o,s.onScrollButtonChange);return z(()=>{if(e.viewport&&e.isPositioned){let a=function(){const u=c.scrollTop>0;d(u)};const c=e.viewport;return a(),c.addEventListener("scroll",a),()=>c.removeEventListener("scroll",a)}},[e.viewport,e.isPositioned]),r?l.jsx(et,{...t,ref:i,onAutoScroll:()=>{const{viewport:a,selectedItem:c}=e;a&&c&&(a.scrollTop=a.scrollTop-c.offsetHeight)}}):null});Je.displayName=we;var ye="SelectScrollDownButton",Qe=n.forwardRef((t,o)=>{const e=Z(ye,t.__scopeSelect),s=be(ye,t.__scopeSelect),[r,d]=n.useState(!1),i=V(o,s.onScrollButtonChange);return z(()=>{if(e.viewport&&e.isPositioned){let a=function(){const u=c.scrollHeight-c.clientHeight,v=Math.ceil(c.scrollTop)<u;d(v)};const c=e.viewport;return a(),c.addEventListener("scroll",a),()=>c.removeEventListener("scroll",a)}},[e.viewport,e.isPositioned]),r?l.jsx(et,{...t,ref:i,onAutoScroll:()=>{const{viewport:a,selectedItem:c}=e;a&&c&&(a.scrollTop=a.scrollTop+c.offsetHeight)}}):null});Qe.displayName=ye;var et=n.forwardRef((t,o)=>{const{__scopeSelect:e,onAutoScroll:s,...r}=t,d=Z("SelectScrollButton",e),i=n.useRef(null),a=de(e),c=n.useCallback(()=>{i.current!==null&&(window.clearInterval(i.current),i.current=null)},[]);return n.useEffect(()=>()=>c(),[c]),z(()=>{var v;const u=a().find(S=>S.ref.current===document.activeElement);(v=u==null?void 0:u.ref.current)==null||v.scrollIntoView({block:"nearest"})},[a]),l.jsx(_.div,{"aria-hidden":!0,...r,ref:o,style:{flexShrink:0,...r.style},onPointerDown:R(r.onPointerDown,()=>{i.current===null&&(i.current=window.setInterval(s,50))}),onPointerMove:R(r.onPointerMove,()=>{var u;(u=d.onItemLeave)==null||u.call(d),i.current===null&&(i.current=window.setInterval(s,50))}),onPointerLeave:R(r.onPointerLeave,()=>{c()})})}),so="SelectSeparator",tt=n.forwardRef((t,o)=>{const{__scopeSelect:e,...s}=t;return l.jsx(_.div,{"aria-hidden":!0,...s,ref:o})});tt.displayName=so;var Ce="SelectArrow",ao=n.forwardRef((t,o)=>{const{__scopeSelect:e,...s}=t,r=ue(e),d=Y(Ce,e),i=Z(Ce,e);return d.open&&i.position==="popper"?l.jsx(jt,{...r,...s,ref:o}):null});ao.displayName=Ce;var lo="SelectBubbleInput",ot=n.forwardRef(({__scopeSelect:t,value:o,...e},s)=>{const r=n.useRef(null),d=V(s,r),i=wt(o);return n.useEffect(()=>{const a=r.current;if(!a)return;const c=window.HTMLSelectElement.prototype,v=Object.getOwnPropertyDescriptor(c,"value").set;if(i!==o&&v){const S=new Event("change",{bubbles:!0});v.call(a,o),a.dispatchEvent(S)}},[i,o]),l.jsx(_.select,{...e,style:{..._e,...e.style},ref:d,defaultValue:o})});ot.displayName=lo;function nt(t){return t===""||t===void 0}function rt(t){const o=bt(t),e=n.useRef(""),s=n.useRef(0),r=n.useCallback(i=>{const a=e.current+i;o(a),(function c(u){e.current=u,window.clearTimeout(s.current),u!==""&&(s.current=window.setTimeout(()=>c(""),1e3))})(a)},[o]),d=n.useCallback(()=>{e.current="",window.clearTimeout(s.current)},[]);return n.useEffect(()=>()=>window.clearTimeout(s.current),[]),[e,r,d]}function st(t,o,e){const r=o.length>1&&Array.from(o).every(u=>u===o[0])?o[0]:o,d=e?t.indexOf(e):-1;let i=co(t,Math.max(d,0));r.length===1&&(i=i.filter(u=>u!==e));const c=i.find(u=>u.textValue.toLowerCase().startsWith(r.toLowerCase()));return c!==e?c:void 0}function co(t,o){return t.map((e,s)=>t[(o+s)%t.length])}var io=Me,at=Oe,uo=Le,po=Ve,fo=ke,lt=Be,mo=Ue,ct=ze,it=Ye,ho=Ze,go=Xe,dt=Je,ut=Qe,pt=tt;const bo=io,To=uo,vo=n.forwardRef(({className:t,children:o,...e},s)=>l.jsxs(at,{ref:s,className:G("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",t),...e,children:[o,l.jsx(po,{asChild:!0,children:l.jsx(Pe,{className:"h-4 w-4 opacity-50"})})]}));vo.displayName=at.displayName;const ft=n.forwardRef(({className:t,...o},e)=>l.jsx(dt,{ref:e,className:G("flex cursor-default items-center justify-center py-1",t),...o,children:l.jsx(Ot,{className:"h-4 w-4"})}));ft.displayName=dt.displayName;const mt=n.forwardRef(({className:t,...o},e)=>l.jsx(ut,{ref:e,className:G("flex cursor-default items-center justify-center py-1",t),...o,children:l.jsx(Pe,{className:"h-4 w-4"})}));mt.displayName=ut.displayName;const So=n.forwardRef(({className:t,children:o,position:e="popper",...s},r)=>l.jsx(fo,{children:l.jsxs(lt,{ref:r,className:G("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",e==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",t),position:e,...s,children:[l.jsx(ft,{}),l.jsx(mo,{className:G("p-1",e==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:o}),l.jsx(mt,{})]})}));So.displayName=lt.displayName;const xo=n.forwardRef(({className:t,...o},e)=>l.jsx(ct,{ref:e,className:G("py-1.5 pl-8 pr-2 text-sm font-semibold",t),...o}));xo.displayName=ct.displayName;const wo=n.forwardRef(({className:t,children:o,...e},s)=>l.jsxs(it,{ref:s,className:G("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",t),...e,children:[l.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:l.jsx(go,{children:l.jsx(Mt,{className:"h-4 w-4"})})}),l.jsx(ho,{children:o})]}));wo.displayName=it.displayName;const yo=n.forwardRef(({className:t,...o},e)=>l.jsx(pt,{ref:e,className:G("-mx-1 my-1 h-px bg-muted",t),...o}));yo.displayName=pt.displayName;export{Ot as C,Io as R,bo as S,vo as a,To as b,So as c,wo as d,Ne as e,yo as f};
|
|
6
|
+
*/const At=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],Ot=ht("chevron-up",At);function Ne(t,[o,e]){return Math.min(e,Math.max(o,t))}function Dt(t){const o=Lt(t),e=n.forwardRef((s,r)=>{const{children:d,...i}=s,a=n.Children.toArray(d),c=a.find(kt);if(c){const u=c.props.children,v=a.map(S=>S===c?n.Children.count(u)>1?n.Children.only(null):n.isValidElement(u)?u.props.children:null:S);return l.jsx(o,{...i,ref:r,children:n.isValidElement(u)?n.cloneElement(u,void 0,v):null})}return l.jsx(o,{...i,ref:r,children:d})});return e.displayName=`${t}.Slot`,e}function Lt(t){const o=n.forwardRef((e,s)=>{const{children:r,...d}=e;if(n.isValidElement(r)){const i=Ht(r),a=Bt(d,r.props);return r.type!==n.Fragment&&(a.ref=s?gt(s,i):i),n.cloneElement(r,a)}return n.Children.count(r)>1?n.Children.only(null):null});return o.displayName=`${t}.SlotClone`,o}var Vt=Symbol("radix.slottable");function kt(t){return n.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===Vt}function Bt(t,o){const e={...o};for(const s in o){const r=t[s],d=o[s];/^on[A-Z]/.test(s)?r&&d?e[s]=(...a)=>{const c=d(...a);return r(...a),c}:r&&(e[s]=r):s==="style"?e[s]={...r,...d}:s==="className"&&(e[s]=[r,d].filter(Boolean).join(" "))}return{...t,...e}}function Ht(t){var s,r;let o=(s=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:s.get,e=o&&"isReactWarning"in o&&o.isReactWarning;return e?t.ref:(o=(r=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:r.get,e=o&&"isReactWarning"in o&&o.isReactWarning,e?t.props.ref:t.props.ref||t.ref)}var _e=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"}),Wt="VisuallyHidden",je=n.forwardRef((t,o)=>l.jsx(_.span,{...t,ref:o,style:{..._e,...t.style}}));je.displayName=Wt;var Io=je,Ft=[" ","Enter","ArrowUp","ArrowDown"],Ut=[" ","Enter"],Q="Select",[ie,de,Kt]=xt(Q),[oe]=It(Q,[Kt,Re]),ue=Re(),[$t,Y]=oe(Q),[zt,Gt]=oe(Q),Me=t=>{const{__scopeSelect:o,children:e,open:s,defaultOpen:r,onOpenChange:d,value:i,defaultValue:a,onValueChange:c,dir:u,name:v,autoComplete:S,disabled:T,required:N,form:b}=t,p=ue(o),[g,y]=n.useState(null),[f,h]=n.useState(null),[M,A]=n.useState(!1),ne=vt(u),[P,D]=Te({prop:s,defaultProp:r??!1,onChange:d,caller:Q}),[U,X]=Te({prop:i,defaultProp:a,onChange:c,caller:Q}),k=n.useRef(null),B=g?b||!!g.closest("form"):!0,[K,H]=n.useState(new Set),W=Array.from(K).map(E=>E.props.value).join(";");return l.jsx(St,{...p,children:l.jsxs($t,{required:N,scope:o,trigger:g,onTriggerChange:y,valueNode:f,onValueNodeChange:h,valueNodeHasChildren:M,onValueNodeHasChildrenChange:A,contentId:Ie(),value:U,onValueChange:X,open:P,onOpenChange:D,dir:ne,triggerPointerDownPosRef:k,disabled:T,children:[l.jsx(ie.Provider,{scope:o,children:l.jsx(zt,{scope:t.__scopeSelect,onNativeOptionAdd:n.useCallback(E=>{H(L=>new Set(L).add(E))},[]),onNativeOptionRemove:n.useCallback(E=>{H(L=>{const F=new Set(L);return F.delete(E),F})},[]),children:e})}),B?l.jsxs(ot,{"aria-hidden":!0,required:N,tabIndex:-1,name:v,autoComplete:S,value:U,onChange:E=>X(E.target.value),disabled:T,form:b,children:[U===void 0?l.jsx("option",{value:""}):null,Array.from(K)]},W):null]})})};Me.displayName=Q;var Ae="SelectTrigger",Oe=n.forwardRef((t,o)=>{const{__scopeSelect:e,disabled:s=!1,...r}=t,d=ue(e),i=Y(Ae,e),a=i.disabled||s,c=V(o,i.onTriggerChange),u=de(e),v=n.useRef("touch"),[S,T,N]=rt(p=>{const g=u().filter(h=>!h.disabled),y=g.find(h=>h.value===i.value),f=st(g,p,y);f!==void 0&&i.onValueChange(f.value)}),b=p=>{a||(i.onOpenChange(!0),N()),p&&(i.triggerPointerDownPosRef.current={x:Math.round(p.pageX),y:Math.round(p.pageY)})};return l.jsx(yt,{asChild:!0,...d,children:l.jsx(_.button,{type:"button",role:"combobox","aria-controls":i.contentId,"aria-expanded":i.open,"aria-required":i.required,"aria-autocomplete":"none",dir:i.dir,"data-state":i.open?"open":"closed",disabled:a,"data-disabled":a?"":void 0,"data-placeholder":nt(i.value)?"":void 0,...r,ref:c,onClick:R(r.onClick,p=>{p.currentTarget.focus(),v.current!=="mouse"&&b(p)}),onPointerDown:R(r.onPointerDown,p=>{v.current=p.pointerType;const g=p.target;g.hasPointerCapture(p.pointerId)&&g.releasePointerCapture(p.pointerId),p.button===0&&p.ctrlKey===!1&&p.pointerType==="mouse"&&(b(p),p.preventDefault())}),onKeyDown:R(r.onKeyDown,p=>{const g=S.current!=="";!(p.ctrlKey||p.altKey||p.metaKey)&&p.key.length===1&&T(p.key),!(g&&p.key===" ")&&Ft.includes(p.key)&&(b(),p.preventDefault())})})})});Oe.displayName=Ae;var De="SelectValue",Le=n.forwardRef((t,o)=>{const{__scopeSelect:e,className:s,style:r,children:d,placeholder:i="",...a}=t,c=Y(De,e),{onValueNodeHasChildrenChange:u}=c,v=d!==void 0,S=V(o,c.onValueNodeChange);return z(()=>{u(v)},[u,v]),l.jsx(_.span,{...a,ref:S,style:{pointerEvents:"none"},children:nt(c.value)?l.jsx(l.Fragment,{children:i}):d})});Le.displayName=De;var Yt="SelectIcon",Ve=n.forwardRef((t,o)=>{const{__scopeSelect:e,children:s,...r}=t;return l.jsx(_.span,{"aria-hidden":!0,...r,ref:o,children:s||"▼"})});Ve.displayName=Yt;var qt="SelectPortal",ke=t=>l.jsx(Ct,{asChild:!0,...t});ke.displayName=qt;var ee="SelectContent",Be=n.forwardRef((t,o)=>{const e=Y(ee,t.__scopeSelect),[s,r]=n.useState();if(z(()=>{r(new DocumentFragment)},[]),!e.open){const d=s;return d?Pe.createPortal(l.jsx(He,{scope:t.__scopeSelect,children:l.jsx(ie.Slot,{scope:t.__scopeSelect,children:l.jsx("div",{children:t.children})})}),d):null}return l.jsx(We,{...t,ref:o})});Be.displayName=ee;var O=10,[He,q]=oe(ee),Xt="SelectContentImpl",Zt=Dt("SelectContent.RemoveScroll"),We=n.forwardRef((t,o)=>{const{__scopeSelect:e,position:s="item-aligned",onCloseAutoFocus:r,onEscapeKeyDown:d,onPointerDownOutside:i,side:a,sideOffset:c,align:u,alignOffset:v,arrowPadding:S,collisionBoundary:T,collisionPadding:N,sticky:b,hideWhenDetached:p,avoidCollisions:g,...y}=t,f=Y(ee,e),[h,M]=n.useState(null),[A,ne]=n.useState(null),P=V(o,m=>M(m)),[D,U]=n.useState(null),[X,k]=n.useState(null),B=de(e),[K,H]=n.useState(!1),W=n.useRef(!1);n.useEffect(()=>{if(h)return Tt(h)},[h]),Nt();const E=n.useCallback(m=>{const[I,...j]=B().map(w=>w.ref.current),[C]=j.slice(-1),x=document.activeElement;for(const w of m)if(w===x||(w==null||w.scrollIntoView({block:"nearest"}),w===I&&A&&(A.scrollTop=0),w===C&&A&&(A.scrollTop=A.scrollHeight),w==null||w.focus(),document.activeElement!==x))return},[B,A]),L=n.useCallback(()=>E([D,h]),[E,D,h]);n.useEffect(()=>{K&&L()},[K,L]);const{onOpenChange:F,triggerPointerDownPosRef:$}=f;n.useEffect(()=>{if(h){let m={x:0,y:0};const I=C=>{var x,w;m={x:Math.abs(Math.round(C.pageX)-(((x=$.current)==null?void 0:x.x)??0)),y:Math.abs(Math.round(C.pageY)-(((w=$.current)==null?void 0:w.y)??0))}},j=C=>{m.x<=10&&m.y<=10?C.preventDefault():h.contains(C.target)||F(!1),document.removeEventListener("pointermove",I),$.current=null};return $.current!==null&&(document.addEventListener("pointermove",I),document.addEventListener("pointerup",j,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",I),document.removeEventListener("pointerup",j,{capture:!0})}}},[h,F,$]),n.useEffect(()=>{const m=()=>F(!1);return window.addEventListener("blur",m),window.addEventListener("resize",m),()=>{window.removeEventListener("blur",m),window.removeEventListener("resize",m)}},[F]);const[pe,ae]=rt(m=>{const I=B().filter(x=>!x.disabled),j=I.find(x=>x.ref.current===document.activeElement),C=st(I,m,j);C&&setTimeout(()=>C.ref.current.focus())}),fe=n.useCallback((m,I,j)=>{const C=!W.current&&!j;(f.value!==void 0&&f.value===I||C)&&(U(m),C&&(W.current=!0))},[f.value]),me=n.useCallback(()=>h==null?void 0:h.focus(),[h]),te=n.useCallback((m,I,j)=>{const C=!W.current&&!j;(f.value!==void 0&&f.value===I||C)&&k(m)},[f.value]),le=s==="popper"?Se:Fe,re=le===Se?{side:a,sideOffset:c,align:u,alignOffset:v,arrowPadding:S,collisionBoundary:T,collisionPadding:N,sticky:b,hideWhenDetached:p,avoidCollisions:g}:{};return l.jsx(He,{scope:e,content:h,viewport:A,onViewportChange:ne,itemRefCallback:fe,selectedItem:D,onItemLeave:me,itemTextRefCallback:te,focusSelectedItem:L,selectedItemText:X,position:s,isPositioned:K,searchRef:pe,children:l.jsx(Rt,{as:Zt,allowPinchZoom:!0,children:l.jsx(Pt,{asChild:!0,trapped:f.open,onMountAutoFocus:m=>{m.preventDefault()},onUnmountAutoFocus:R(r,m=>{var I;(I=f.trigger)==null||I.focus({preventScroll:!0}),m.preventDefault()}),children:l.jsx(Et,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:d,onPointerDownOutside:i,onFocusOutside:m=>m.preventDefault(),onDismiss:()=>f.onOpenChange(!1),children:l.jsx(le,{role:"listbox",id:f.contentId,"data-state":f.open?"open":"closed",dir:f.dir,onContextMenu:m=>m.preventDefault(),...y,...re,onPlaced:()=>H(!0),ref:P,style:{display:"flex",flexDirection:"column",outline:"none",...y.style},onKeyDown:R(y.onKeyDown,m=>{const I=m.ctrlKey||m.altKey||m.metaKey;if(m.key==="Tab"&&m.preventDefault(),!I&&m.key.length===1&&ae(m.key),["ArrowUp","ArrowDown","Home","End"].includes(m.key)){let C=B().filter(x=>!x.disabled).map(x=>x.ref.current);if(["ArrowUp","End"].includes(m.key)&&(C=C.slice().reverse()),["ArrowUp","ArrowDown"].includes(m.key)){const x=m.target,w=C.indexOf(x);C=C.slice(w+1)}setTimeout(()=>E(C)),m.preventDefault()}})})})})})})});We.displayName=Xt;var Jt="SelectItemAlignedPosition",Fe=n.forwardRef((t,o)=>{const{__scopeSelect:e,onPlaced:s,...r}=t,d=Y(ee,e),i=q(ee,e),[a,c]=n.useState(null),[u,v]=n.useState(null),S=V(o,P=>v(P)),T=de(e),N=n.useRef(!1),b=n.useRef(!0),{viewport:p,selectedItem:g,selectedItemText:y,focusSelectedItem:f}=i,h=n.useCallback(()=>{if(d.trigger&&d.valueNode&&a&&u&&p&&g&&y){const P=d.trigger.getBoundingClientRect(),D=u.getBoundingClientRect(),U=d.valueNode.getBoundingClientRect(),X=y.getBoundingClientRect();if(d.dir!=="rtl"){const x=X.left-D.left,w=U.left-x,Z=P.left-w,J=P.width+Z,he=Math.max(J,D.width),ge=window.innerWidth-O,ve=Ne(w,[O,Math.max(O,ge-he)]);a.style.minWidth=J+"px",a.style.left=ve+"px"}else{const x=D.right-X.right,w=window.innerWidth-U.right-x,Z=window.innerWidth-P.right-w,J=P.width+Z,he=Math.max(J,D.width),ge=window.innerWidth-O,ve=Ne(w,[O,Math.max(O,ge-he)]);a.style.minWidth=J+"px",a.style.right=ve+"px"}const k=T(),B=window.innerHeight-O*2,K=p.scrollHeight,H=window.getComputedStyle(u),W=parseInt(H.borderTopWidth,10),E=parseInt(H.paddingTop,10),L=parseInt(H.borderBottomWidth,10),F=parseInt(H.paddingBottom,10),$=W+E+K+F+L,pe=Math.min(g.offsetHeight*5,$),ae=window.getComputedStyle(p),fe=parseInt(ae.paddingTop,10),me=parseInt(ae.paddingBottom,10),te=P.top+P.height/2-O,le=B-te,re=g.offsetHeight/2,m=g.offsetTop+re,I=W+E+m,j=$-I;if(I<=te){const x=k.length>0&&g===k[k.length-1].ref.current;a.style.bottom="0px";const w=u.clientHeight-p.offsetTop-p.offsetHeight,Z=Math.max(le,re+(x?me:0)+w+L),J=I+Z;a.style.height=J+"px"}else{const x=k.length>0&&g===k[0].ref.current;a.style.top="0px";const Z=Math.max(te,W+p.offsetTop+(x?fe:0)+re)+j;a.style.height=Z+"px",p.scrollTop=I-te+p.offsetTop}a.style.margin=`${O}px 0`,a.style.minHeight=pe+"px",a.style.maxHeight=B+"px",s==null||s(),requestAnimationFrame(()=>N.current=!0)}},[T,d.trigger,d.valueNode,a,u,p,g,y,d.dir,s]);z(()=>h(),[h]);const[M,A]=n.useState();z(()=>{u&&A(window.getComputedStyle(u).zIndex)},[u]);const ne=n.useCallback(P=>{P&&b.current===!0&&(h(),f==null||f(),b.current=!1)},[h,f]);return l.jsx(eo,{scope:e,contentWrapper:a,shouldExpandOnScrollRef:N,onScrollButtonChange:ne,children:l.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:M},children:l.jsx(_.div,{...r,ref:S,style:{boxSizing:"border-box",maxHeight:"100%",...r.style}})})})});Fe.displayName=Jt;var Qt="SelectPopperPosition",Se=n.forwardRef((t,o)=>{const{__scopeSelect:e,align:s="start",collisionPadding:r=O,...d}=t,i=ue(e);return l.jsx(_t,{...i,...d,ref:o,align:s,collisionPadding:r,style:{boxSizing:"border-box",...d.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)"}})});Se.displayName=Qt;var[eo,be]=oe(ee,{}),xe="SelectViewport",Ue=n.forwardRef((t,o)=>{const{__scopeSelect:e,nonce:s,...r}=t,d=q(xe,e),i=be(xe,e),a=V(o,d.onViewportChange),c=n.useRef(0);return l.jsxs(l.Fragment,{children:[l.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:s}),l.jsx(ie.Slot,{scope:e,children:l.jsx(_.div,{"data-radix-select-viewport":"",role:"presentation",...r,ref:a,style:{position:"relative",flex:1,overflow:"hidden auto",...r.style},onScroll:R(r.onScroll,u=>{const v=u.currentTarget,{contentWrapper:S,shouldExpandOnScrollRef:T}=i;if(T!=null&&T.current&&S){const N=Math.abs(c.current-v.scrollTop);if(N>0){const b=window.innerHeight-O*2,p=parseFloat(S.style.minHeight),g=parseFloat(S.style.height),y=Math.max(p,g);if(y<b){const f=y+N,h=Math.min(b,f),M=f-h;S.style.height=h+"px",S.style.bottom==="0px"&&(v.scrollTop=M>0?M:0,S.style.justifyContent="flex-end")}}}c.current=v.scrollTop})})})]})});Ue.displayName=xe;var Ke="SelectGroup",[to,oo]=oe(Ke),no=n.forwardRef((t,o)=>{const{__scopeSelect:e,...s}=t,r=Ie();return l.jsx(to,{scope:e,id:r,children:l.jsx(_.div,{role:"group","aria-labelledby":r,...s,ref:o})})});no.displayName=Ke;var $e="SelectLabel",ze=n.forwardRef((t,o)=>{const{__scopeSelect:e,...s}=t,r=oo($e,e);return l.jsx(_.div,{id:r.id,...s,ref:o})});ze.displayName=$e;var ce="SelectItem",[ro,Ge]=oe(ce),Ye=n.forwardRef((t,o)=>{const{__scopeSelect:e,value:s,disabled:r=!1,textValue:d,...i}=t,a=Y(ce,e),c=q(ce,e),u=a.value===s,[v,S]=n.useState(d??""),[T,N]=n.useState(!1),b=V(o,f=>{var h;return(h=c.itemRefCallback)==null?void 0:h.call(c,f,s,r)}),p=Ie(),g=n.useRef("touch"),y=()=>{r||(a.onValueChange(s),a.onOpenChange(!1))};if(s==="")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 l.jsx(ro,{scope:e,value:s,disabled:r,textId:p,isSelected:u,onItemTextChange:n.useCallback(f=>{S(h=>h||((f==null?void 0:f.textContent)??"").trim())},[]),children:l.jsx(ie.ItemSlot,{scope:e,value:s,disabled:r,textValue:v,children:l.jsx(_.div,{role:"option","aria-labelledby":p,"data-highlighted":T?"":void 0,"aria-selected":u&&T,"data-state":u?"checked":"unchecked","aria-disabled":r||void 0,"data-disabled":r?"":void 0,tabIndex:r?void 0:-1,...i,ref:b,onFocus:R(i.onFocus,()=>N(!0)),onBlur:R(i.onBlur,()=>N(!1)),onClick:R(i.onClick,()=>{g.current!=="mouse"&&y()}),onPointerUp:R(i.onPointerUp,()=>{g.current==="mouse"&&y()}),onPointerDown:R(i.onPointerDown,f=>{g.current=f.pointerType}),onPointerMove:R(i.onPointerMove,f=>{var h;g.current=f.pointerType,r?(h=c.onItemLeave)==null||h.call(c):g.current==="mouse"&&f.currentTarget.focus({preventScroll:!0})}),onPointerLeave:R(i.onPointerLeave,f=>{var h;f.currentTarget===document.activeElement&&((h=c.onItemLeave)==null||h.call(c))}),onKeyDown:R(i.onKeyDown,f=>{var M;((M=c.searchRef)==null?void 0:M.current)!==""&&f.key===" "||(Ut.includes(f.key)&&y(),f.key===" "&&f.preventDefault())})})})})});Ye.displayName=ce;var se="SelectItemText",qe=n.forwardRef((t,o)=>{const{__scopeSelect:e,className:s,style:r,...d}=t,i=Y(se,e),a=q(se,e),c=Ge(se,e),u=Gt(se,e),[v,S]=n.useState(null),T=V(o,y=>S(y),c.onItemTextChange,y=>{var f;return(f=a.itemTextRefCallback)==null?void 0:f.call(a,y,c.value,c.disabled)}),N=v==null?void 0:v.textContent,b=n.useMemo(()=>l.jsx("option",{value:c.value,disabled:c.disabled,children:N},c.value),[c.disabled,c.value,N]),{onNativeOptionAdd:p,onNativeOptionRemove:g}=u;return z(()=>(p(b),()=>g(b)),[p,g,b]),l.jsxs(l.Fragment,{children:[l.jsx(_.span,{id:c.textId,...d,ref:T}),c.isSelected&&i.valueNode&&!i.valueNodeHasChildren?Pe.createPortal(d.children,i.valueNode):null]})});qe.displayName=se;var Xe="SelectItemIndicator",Ze=n.forwardRef((t,o)=>{const{__scopeSelect:e,...s}=t;return Ge(Xe,e).isSelected?l.jsx(_.span,{"aria-hidden":!0,...s,ref:o}):null});Ze.displayName=Xe;var we="SelectScrollUpButton",Je=n.forwardRef((t,o)=>{const e=q(we,t.__scopeSelect),s=be(we,t.__scopeSelect),[r,d]=n.useState(!1),i=V(o,s.onScrollButtonChange);return z(()=>{if(e.viewport&&e.isPositioned){let a=function(){const u=c.scrollTop>0;d(u)};const c=e.viewport;return a(),c.addEventListener("scroll",a),()=>c.removeEventListener("scroll",a)}},[e.viewport,e.isPositioned]),r?l.jsx(et,{...t,ref:i,onAutoScroll:()=>{const{viewport:a,selectedItem:c}=e;a&&c&&(a.scrollTop=a.scrollTop-c.offsetHeight)}}):null});Je.displayName=we;var ye="SelectScrollDownButton",Qe=n.forwardRef((t,o)=>{const e=q(ye,t.__scopeSelect),s=be(ye,t.__scopeSelect),[r,d]=n.useState(!1),i=V(o,s.onScrollButtonChange);return z(()=>{if(e.viewport&&e.isPositioned){let a=function(){const u=c.scrollHeight-c.clientHeight,v=Math.ceil(c.scrollTop)<u;d(v)};const c=e.viewport;return a(),c.addEventListener("scroll",a),()=>c.removeEventListener("scroll",a)}},[e.viewport,e.isPositioned]),r?l.jsx(et,{...t,ref:i,onAutoScroll:()=>{const{viewport:a,selectedItem:c}=e;a&&c&&(a.scrollTop=a.scrollTop+c.offsetHeight)}}):null});Qe.displayName=ye;var et=n.forwardRef((t,o)=>{const{__scopeSelect:e,onAutoScroll:s,...r}=t,d=q("SelectScrollButton",e),i=n.useRef(null),a=de(e),c=n.useCallback(()=>{i.current!==null&&(window.clearInterval(i.current),i.current=null)},[]);return n.useEffect(()=>()=>c(),[c]),z(()=>{var v;const u=a().find(S=>S.ref.current===document.activeElement);(v=u==null?void 0:u.ref.current)==null||v.scrollIntoView({block:"nearest"})},[a]),l.jsx(_.div,{"aria-hidden":!0,...r,ref:o,style:{flexShrink:0,...r.style},onPointerDown:R(r.onPointerDown,()=>{i.current===null&&(i.current=window.setInterval(s,50))}),onPointerMove:R(r.onPointerMove,()=>{var u;(u=d.onItemLeave)==null||u.call(d),i.current===null&&(i.current=window.setInterval(s,50))}),onPointerLeave:R(r.onPointerLeave,()=>{c()})})}),so="SelectSeparator",tt=n.forwardRef((t,o)=>{const{__scopeSelect:e,...s}=t;return l.jsx(_.div,{"aria-hidden":!0,...s,ref:o})});tt.displayName=so;var Ce="SelectArrow",ao=n.forwardRef((t,o)=>{const{__scopeSelect:e,...s}=t,r=ue(e),d=Y(Ce,e),i=q(Ce,e);return d.open&&i.position==="popper"?l.jsx(jt,{...r,...s,ref:o}):null});ao.displayName=Ce;var lo="SelectBubbleInput",ot=n.forwardRef(({__scopeSelect:t,value:o,...e},s)=>{const r=n.useRef(null),d=V(s,r),i=wt(o);return n.useEffect(()=>{const a=r.current;if(!a)return;const c=window.HTMLSelectElement.prototype,v=Object.getOwnPropertyDescriptor(c,"value").set;if(i!==o&&v){const S=new Event("change",{bubbles:!0});v.call(a,o),a.dispatchEvent(S)}},[i,o]),l.jsx(_.select,{...e,style:{..._e,...e.style},ref:d,defaultValue:o})});ot.displayName=lo;function nt(t){return t===""||t===void 0}function rt(t){const o=bt(t),e=n.useRef(""),s=n.useRef(0),r=n.useCallback(i=>{const a=e.current+i;o(a),(function c(u){e.current=u,window.clearTimeout(s.current),u!==""&&(s.current=window.setTimeout(()=>c(""),1e3))})(a)},[o]),d=n.useCallback(()=>{e.current="",window.clearTimeout(s.current)},[]);return n.useEffect(()=>()=>window.clearTimeout(s.current),[]),[e,r,d]}function st(t,o,e){const r=o.length>1&&Array.from(o).every(u=>u===o[0])?o[0]:o,d=e?t.indexOf(e):-1;let i=co(t,Math.max(d,0));r.length===1&&(i=i.filter(u=>u!==e));const c=i.find(u=>u.textValue.toLowerCase().startsWith(r.toLowerCase()));return c!==e?c:void 0}function co(t,o){return t.map((e,s)=>t[(o+s)%t.length])}var io=Me,at=Oe,uo=Le,po=Ve,fo=ke,lt=Be,mo=Ue,ct=ze,it=Ye,ho=qe,go=Ze,dt=Je,ut=Qe,pt=tt;const bo=io,To=uo,vo=n.forwardRef(({className:t,children:o,...e},s)=>l.jsxs(at,{ref:s,className:G("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",t),...e,children:[o,l.jsx(po,{asChild:!0,children:l.jsx(Ee,{className:"h-4 w-4 opacity-50"})})]}));vo.displayName=at.displayName;const ft=n.forwardRef(({className:t,...o},e)=>l.jsx(dt,{ref:e,className:G("flex cursor-default items-center justify-center py-1",t),...o,children:l.jsx(Ot,{className:"h-4 w-4"})}));ft.displayName=dt.displayName;const mt=n.forwardRef(({className:t,...o},e)=>l.jsx(ut,{ref:e,className:G("flex cursor-default items-center justify-center py-1",t),...o,children:l.jsx(Ee,{className:"h-4 w-4"})}));mt.displayName=ut.displayName;const So=n.forwardRef(({className:t,children:o,position:e="popper",...s},r)=>l.jsx(fo,{children:l.jsxs(lt,{ref:r,className:G("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",e==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",t),position:e,...s,children:[l.jsx(ft,{}),l.jsx(mo,{className:G("p-1",e==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:o}),l.jsx(mt,{})]})}));So.displayName=lt.displayName;const xo=n.forwardRef(({className:t,...o},e)=>l.jsx(ct,{ref:e,className:G("py-1.5 pl-8 pr-2 text-sm font-semibold",t),...o}));xo.displayName=ct.displayName;const wo=n.forwardRef(({className:t,children:o,...e},s)=>l.jsxs(it,{ref:s,className:G("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",t),...e,children:[l.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:l.jsx(go,{children:l.jsx(Mt,{className:"h-4 w-4"})})}),l.jsx(ho,{children:o})]}));wo.displayName=it.displayName;const yo=n.forwardRef(({className:t,...o},e)=>l.jsx(pt,{ref:e,className:G("-mx-1 my-1 h-px bg-muted",t),...o}));yo.displayName=pt.displayName;export{Ot as C,Io as R,bo as S,vo as a,To as b,So as c,wo as d,Ne as e,yo as f};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import{c}from"./index-B5hLclEq.js";/**
|
|
2
|
+
* @license lucide-react v0.577.0 - ISC
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the ISC license.
|
|
5
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/const e=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M11 18h2",key:"12mj7e"}],["path",{d:"M12 12v6",key:"3ahymv"}],["path",{d:"M9 13v-.5a.5.5 0 0 1 .5-.5h5a.5.5 0 0 1 .5.5v.5",key:"qbrxap"}]],y=c("file-type",e);/**
|
|
7
|
+
* @license lucide-react v0.577.0 - ISC
|
|
8
|
+
*
|
|
9
|
+
* This source code is licensed under the ISC license.
|
|
10
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
11
|
+
*/const a=[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]],i=c("grip-vertical",a);/**
|
|
12
|
+
* @license lucide-react v0.577.0 - ISC
|
|
13
|
+
*
|
|
14
|
+
* This source code is licensed under the ISC license.
|
|
15
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
16
|
+
*/const r=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],o=c("zap",r);export{y as F,i as G,o as Z};
|
package/dist/web3/index.html
CHANGED
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
6
|
<title>ContextNest</title>
|
|
7
7
|
<link rel="icon" href="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><text y='.9em' font-size='90'>🪺</text></svg>" />
|
|
8
|
-
<script type="module" crossorigin src="/assets/index-
|
|
9
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
8
|
+
<script type="module" crossorigin src="/assets/index-B5hLclEq.js"></script>
|
|
9
|
+
<link rel="stylesheet" crossorigin href="/assets/index-DrUAtoQM.css">
|
|
10
10
|
</head>
|
|
11
11
|
<body class="bg-background text-foreground antialiased">
|
|
12
12
|
<div id="root"></div>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@promptowl/contextnest-community",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.25.0",
|
|
4
4
|
"description": "ContextNest Community Edition — self-hosted context governance server for AI workflows. Commercial software by Promptowl LLC.",
|
|
5
5
|
"private": false,
|
|
6
6
|
"type": "module",
|
|
@@ -71,7 +71,7 @@
|
|
|
71
71
|
"dependencies": {
|
|
72
72
|
"@hono/node-server": "^1.13.8",
|
|
73
73
|
"@modelcontextprotocol/sdk": "^1.12.1",
|
|
74
|
-
"@promptowl/contextnest-engine": "^2.
|
|
74
|
+
"@promptowl/contextnest-engine": "^2.7.0",
|
|
75
75
|
"@tanstack/react-query": "^5.101.4",
|
|
76
76
|
"bcryptjs": "^3.0.3",
|
|
77
77
|
"better-sqlite3": "^11.8.2",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as s,dB as L,dC as z,j as e,B as m,dD as D,bw as _,I as q,L as B,bx as F}from"./index-EaX2yql0.js";import{P as K}from"./page-title-ClvvBsIo.js";import{S as M,a as U,b as V,c as $,d as p}from"./select-DBFTrUmI.js";import{f as G}from"./dates-BCxbm4_q.js";import{A as Z}from"./arrow-left-BCKt4CwQ.js";import{R as H}from"./refresh-cw-BhHzSH9m.js";import{C as I}from"./chevron-left-BPwUT9DS.js";const i=25;function te({onBack:f,nestId:a}){const[g,y]=s.useState([]),[o,C]=s.useState(0),[l,h]=s.useState(0),[n,N]=s.useState(!0),[v,w]=s.useState(null),[c,k]=s.useState("all"),[d,T]=s.useState(""),[u,b]=s.useState(""),x=s.useRef(0);s.useEffect(()=>{const t=setTimeout(()=>b(d),300);return()=>clearTimeout(t)},[d]),s.useEffect(()=>{h(0)},[c,u]);const j=s.useCallback(async()=>{const t=++x.current;N(!0),w(null);try{const r={kind:c==="all"?void 0:c,user:u.trim()||void 0,limit:i,offset:l*i},S=a?await L(a,r):await z(r);if(t!==x.current)return;y(S.events),C(S.total)}catch(r){if(t!==x.current)return;w((r==null?void 0:r.message)||"Failed to load trace")}finally{t===x.current&&N(!1)}},[c,u,l,a]);s.useEffect(()=>{j()},[j]);const E=o===0?0:l*i+1,A=Math.min((l+1)*i,o),P=l>0,R=(l+1)*i<o;return e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-start gap-2",children:[f&&e.jsxs(m,{variant:"ghost",size:"sm",onClick:f,className:"mt-1",children:[e.jsx(Z,{className:"h-4 w-4 mr-1"})," Back"]}),e.jsx(K,{icon:D,title:"Activity trace",className:"mb-0 flex-1",actions:e.jsxs(e.Fragment,{children:[e.jsxs(M,{value:c,onValueChange:t=>k(t),children:[e.jsx(U,{className:"h-8 w-28",children:e.jsx(V,{})}),e.jsxs($,{children:[e.jsx(p,{value:"all",children:"All"}),e.jsx(p,{value:"api",children:"API"}),e.jsx(p,{value:"mcp",children:"MCP"})]})]}),e.jsxs("div",{className:"relative",children:[e.jsx(_,{className:"absolute left-2.5 top-1/2 -translate-y-1/2 h-3.5 w-3.5 text-muted-foreground pointer-events-none"}),e.jsx(q,{value:d,onChange:t=>T(t.target.value),onKeyDown:t=>t.key==="Enter"&&b(d),placeholder:"Filter by user…",className:"h-8 pl-8 w-48"})]}),e.jsx(m,{variant:"outline",size:"sm",onClick:j,disabled:n,children:n?e.jsx(B,{className:"h-3.5 w-3.5 animate-spin"}):e.jsx(H,{className:"h-3.5 w-3.5"})})]})})]}),v&&e.jsx("p",{className:"text-sm text-red-500",children:v}),e.jsx("div",{className:"border border-border rounded-lg overflow-x-auto",children:e.jsxs("table",{className:"w-full text-xs",children:[e.jsx("thead",{className:"bg-muted/50 text-muted-foreground",children:e.jsxs("tr",{className:"[&>th]:px-3 [&>th]:py-2 [&>th]:text-left [&>th]:font-medium",children:[e.jsx("th",{children:"Time"}),e.jsx("th",{children:"Kind"}),e.jsx("th",{children:"Call"}),!a&&e.jsx("th",{children:"Nest"}),e.jsx("th",{children:"Caller"}),e.jsx("th",{children:"Status"}),e.jsx("th",{className:"text-right",children:"ms"})]})}),e.jsxs("tbody",{children:[g.length===0&&!n&&e.jsx("tr",{children:e.jsx("td",{colSpan:a?6:7,className:"px-3 py-8 text-center text-muted-foreground",children:"No activity recorded yet."})}),g.map(t=>e.jsxs("tr",{className:"border-t border-border [&>td]:px-3 [&>td]:py-1.5",children:[e.jsx("td",{className:"whitespace-nowrap text-muted-foreground",children:G(t.ts)}),e.jsx("td",{children:e.jsx("span",{className:t.kind==="mcp"?"rounded bg-violet-50 text-violet-700 px-1.5 py-0.5":"rounded bg-blue-50 text-blue-700 px-1.5 py-0.5",children:t.kind})}),e.jsx("td",{className:"font-mono max-w-[340px] truncate",title:t.path||t.tool||"",children:t.kind==="mcp"?t.tool:`${t.method} ${t.path}`}),!a&&e.jsx("td",{className:"font-mono max-w-[120px] truncate",title:t.nest_id||"",children:t.nest_id||"—"}),e.jsx("td",{className:"max-w-[180px] truncate",title:t.caller||"",children:t.caller||"—"}),e.jsx("td",{children:t.status==null?"—":e.jsx("span",{className:t.status>=400?"text-red-600":"text-green-700",children:t.status})}),e.jsx("td",{className:"text-right text-muted-foreground",children:t.duration_ms??"—"})]},t.id))]})]})}),e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2 text-xs text-muted-foreground",children:[e.jsx("span",{children:"Rolling retention window (server setting), newest first."}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("span",{children:[E,"–",A," of ",o]}),e.jsx(m,{variant:"outline",size:"sm",className:"h-7 px-2",disabled:!P||n,onClick:()=>h(t=>Math.max(t-1,0)),children:e.jsx(I,{className:"h-3.5 w-3.5"})}),e.jsx(m,{variant:"outline",size:"sm",className:"h-7 px-2",disabled:!R||n,onClick:()=>h(t=>t+1),children:e.jsx(F,{className:"h-3.5 w-3.5"})})]})]})]})}export{te as ActivityTracePage};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as n,W as ue,j as e,af as pe,ag as ve,L as A,ac as ee,ad as ae,ae as se,ah as be,ai as ge,ak as fe,C as je,J as F,bK as ye,u as Ne,A as we,K as Se,a as Ce,U as te,B as N,e as E,i as K,N as Ae,f as le,bB as Te,dK as ke,M as Pe,dL as De,dM as Le}from"./index-EaX2yql0.js";import{S as Y,a as _,b as W,c as G,d as T}from"./select-DBFTrUmI.js";import{A as Me,a as Re,b as Fe,c as ze,d as Ue,e as Be,f as Oe,g as Ve}from"./alert-dialog-DTozKlmV.js";import{P as $e}from"./PersonCombobox-CPOlNs6G.js";import{S as Ie}from"./MarkdownEditor-C9zqZjC5.js";import{U as Ee}from"./user-plus-CvBNcpn4.js";import{S as Ke}from"./share-2-CMnOlOt-.js";import{T as ie}from"./trash-2-HBi-Pslz.js";const Q=[{value:"private",label:"Private",hint:"Only people added to the nest"},{value:"org",label:"Organization",hint:"Everyone signed in here can read"},{value:"public",label:"Public",hint:"Anyone with the URL can read"}];function Xe({nestId:d,onChanged:k,onError:r,variant:z="card"}){var S,C;const[x,m]=n.useState("private"),h=x==="public",p=x==="org",[g,P]=n.useState(!1),[f,v]=n.useState(!1),b=(C=(S=ue(d).data)==null?void 0:S.nest)==null?void 0:C.visibility;n.useEffect(()=>{b&&m(b)},[b]);const j=async(l,u)=>{const o=x;m(l),P(!0),r==null||r(null);try{const s=await ye(d,l,u);if(m(s.visibility||l),s.visibility!==l){r==null||r("Server did not accept the change. You may not have admin access to this nest.");return}k()}catch(s){m(o),r==null||r((s==null?void 0:s.message)||"Failed to change visibility")}finally{P(!1)}},y=async l=>{if(l!==x){if(l==="public"){v(!0);return}await j(l)}},w=e.jsx(Me,{open:f,onOpenChange:v,children:e.jsxs(Re,{children:[e.jsxs(Fe,{children:[e.jsx(ze,{children:"Make this nest public?"}),e.jsx(Ue,{children:"This makes the nest readable by anyone on the internet, outside your organization. Anyone with the URL will be able to read it."})]}),e.jsxs(Be,{children:[e.jsx(Oe,{children:"Cancel"}),e.jsx(Ve,{onClick:()=>{v(!1),j("public",!0)},children:"Make public"})]})]})});if(z==="compact"){if(!b)return null;const l=h?ee:p?ae:se,u=Q.find(o=>o.value===x)??Q[0];return e.jsxs(e.Fragment,{children:[e.jsxs(pe,{children:[e.jsx(ve,{asChild:!0,children:e.jsxs("button",{type:"button",disabled:g,className:"inline-flex h-8 items-center gap-1 rounded-md px-2 text-xs text-muted-foreground hover:bg-accent hover:text-accent-foreground disabled:opacity-60",title:`${u.label} — ${u.hint}. Click to change.`,"aria-label":`Nest visibility: ${u.label}`,"data-testid":"nest-visibility-compact",children:[g?e.jsx(A,{className:"h-3.5 w-3.5 animate-spin"}):e.jsx(l,{className:`h-3.5 w-3.5 ${h?"text-green-600":p?"text-blue-600":""}`}),e.jsx("span",{className:"hidden sm:inline",children:u.label}),e.jsx(be,{className:"h-3 w-3 opacity-60"})]})}),e.jsx(ge,{align:"end",className:"w-64",children:Q.map(o=>e.jsxs(fe,{onClick:()=>void y(o.value),className:"flex items-start gap-2",children:[o.value===x?e.jsx(je,{className:"mt-0.5 h-4 w-4 shrink-0"}):e.jsx("span",{className:"w-4 shrink-0"}),e.jsxs("span",{className:"flex flex-col",children:[e.jsx("span",{className:"text-sm",children:o.label}),e.jsx("span",{className:"text-xs text-muted-foreground",children:o.hint})]})]},o.value))})]}),w]})}return e.jsxs("div",{className:"rounded-lg border p-4 space-y-3",children:[e.jsxs("div",{className:"flex items-start justify-between gap-4",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsxs(F,{className:"flex items-center gap-2 text-sm font-medium",children:[h?e.jsx(ee,{className:"h-4 w-4 text-green-600"}):p?e.jsx(ae,{className:"h-4 w-4 text-blue-600"}):e.jsx(se,{className:"h-4 w-4"}),h?"Public":p?"Organization":"Private"]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:h?"Anyone on the internet with the URL can read this nest. Editing still requires being added below.":p?"Everyone signed in to this deployment can read this nest. Editing still requires being added below.":"Only people added below (and the owner) can see this nest."})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[g&&e.jsx(A,{className:"h-3.5 w-3.5 animate-spin text-muted-foreground"}),e.jsxs(Y,{value:x,onValueChange:l=>void y(l),disabled:g,children:[e.jsx(_,{className:"h-8 w-[150px]","aria-label":"Nest visibility",children:e.jsx(W,{})}),e.jsxs(G,{children:[e.jsx(T,{value:"private",children:"Private"}),e.jsx(T,{value:"org",children:"Organization"}),e.jsx(T,{value:"public",children:"Public"})]})]})]})]}),w]})}const q=[{value:"read",label:"Viewer",hint:"Read only"},{value:"write",label:"Editor",hint:"Read and edit documents"},{value:"admin",label:"Admin",hint:"Full access except deleting the nest"}],R={read:1,write:2,admin:3,owner:4};function Ze({nestId:d,nestName:k,onChanged:r,currentUserEmail:z,callerPermission:x="admin",showTeams:m=!1}){const h=(z||"").toLowerCase(),p=R[x]??R.read,g=p>=R.admin,P=q.filter(a=>R[a.value]<=p),[f,v]=n.useState([]),[H,b]=n.useState(!0),j=Ne(),[y,w]=n.useState(""),[S,C]=n.useState("read"),[l,u]=n.useState(!1),[o,s]=n.useState(null),[D,J]=n.useState("person"),[U,ne]=n.useState([]),[re,ce]=n.useState([]),[L,X]=n.useState(""),[B,M]=n.useState(!1),O=async()=>{b(!0);try{const{collaborators:a}=await j.fetchQuery(K.collaborators(d));v(a)}catch(a){s((a==null?void 0:a.message)||"Failed to load collaborators")}finally{b(!1)}},V=async()=>{try{const[a,i]=await Promise.all([j.fetchQuery(K.nestTeams(d)),j.fetchQuery(K.teamList()).catch(()=>({teams:[]}))]);ne(a.teams),ce(i.teams)}catch(a){s((a==null?void 0:a.message)||"Failed to load teams")}};n.useEffect(()=>{O(),m&&V()},[d]);const Z=async()=>{const a=y.trim();if(a){if(!Te(a)){s("Enter a valid email address.");return}u(!0),s(null);try{await ke(d,{email:a,permission:S}),w(""),C("read"),await O(),r()}catch(i){s((i==null?void 0:i.message)||"Failed to add collaborator")}finally{u(!1)}}},oe=a=>{a.preventDefault(),Z()},$=re.filter(a=>!U.some(i=>i.teamId===a.id)),de=async()=>{if(L){M(!0),s(null);try{await Ae(d,L),X(""),le.success("Team shared"),await V(),r()}catch(a){s((a==null?void 0:a.message)||"Failed to share team")}finally{M(!1)}}},me=async(a,i)=>{if(window.confirm(`Unshare "${i}" from "${k}"? Its members lose the access this share granted.`)){M(!0),s(null);try{await Pe(d,a),await V(),r()}catch(c){s((c==null?void 0:c.message)||"Failed to unshare team")}finally{M(!1)}}},he=async(a,i)=>{const t=f.find(c=>c.id===a);if(t&&(t.email||"").toLowerCase()===h){le.error("You can't change your own access level.");return}s(null),v(c=>c.map(I=>I.id===a?{...I,permission:i}:I));try{await De(d,a,i),r()}catch(c){s((c==null?void 0:c.message)||"Failed to update permission"),await O()}},xe=async a=>{if(window.confirm(`Remove ${a.email||"this collaborator"}'s access to "${k}"? They keep their account; only their access to this nest is revoked.`)){s(null);try{await Le(d,a.id),v(t=>t.filter(c=>c.id!==a.id)),r()}catch(t){s((t==null?void 0:t.message)||"Failed to remove collaborator")}}};return e.jsxs("div",{className:"space-y-4",children:[o&&e.jsxs(we,{variant:"destructive",children:[e.jsx(Se,{className:"h-4 w-4"}),e.jsx(Ce,{children:o})]}),e.jsxs("div",{className:"rounded-lg border p-4 space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx(F,{className:"flex items-center gap-2 text-sm font-medium",children:m&&D==="team"?e.jsxs(e.Fragment,{children:[e.jsx(te,{className:"h-4 w-4"}),"Add a team"]}):e.jsxs(e.Fragment,{children:[e.jsx(Ee,{className:"h-4 w-4"}),"Add a person"]})}),m&&e.jsxs("div",{className:"flex gap-1",children:[e.jsx(N,{type:"button",size:"sm",variant:D==="person"?"secondary":"ghost",className:"h-7 px-2 text-xs",onClick:()=>J("person"),children:"Person"}),e.jsx(N,{type:"button",size:"sm",variant:D==="team"?"secondary":"ghost",className:"h-7 px-2 text-xs",onClick:()=>J("team"),children:"Team"})]})]}),m&&D==="team"?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex flex-col sm:flex-row gap-2",children:[e.jsx("div",{className:"flex-1",children:e.jsx(Ie,{value:L,onChange:X,options:$.map(a=>({value:a.id,label:a.name})),disabled:$.length===0,placeholder:$.length===0?"No teams available to share":"Select a team…",searchPlaceholder:"Search teams…",emptyText:"No teams match.",testId:"collab-team-select"})}),e.jsx(N,{onClick:de,disabled:B||!L,children:B?e.jsx(A,{className:"h-4 w-4 animate-spin"}):e.jsxs(e.Fragment,{children:[e.jsx(Ke,{className:"h-4 w-4 mr-1"}),"Share"]})})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Every member gets the role you gave them on the Teams page. Manage members there."})]}):e.jsxs("form",{onSubmit:oe,className:"space-y-3",children:[e.jsxs("div",{className:"flex flex-col sm:flex-row gap-2",children:[e.jsx($e,{value:y,onChange:w,onSubmit:Z,placeholder:"teammate@example.com",disabled:l,className:"flex-1",exclude:f.map(a=>a.email||"").filter(Boolean),testId:"collab-person-input"}),e.jsxs(Y,{value:S,onValueChange:a=>C(a),children:[e.jsx(_,{className:"w-full sm:w-[130px]",children:e.jsx(W,{})}),e.jsx(G,{children:P.map(a=>e.jsx(T,{value:a.value,children:a.label},a.value))})]}),e.jsx(N,{type:"submit",disabled:l||!y.trim(),children:l?e.jsx(A,{className:"h-4 w-4 animate-spin"}):"Add"})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"If they don't have an account yet, they'll get access when they register with this email."})]})]}),m&&U.length>0&&e.jsxs("div",{className:"rounded-lg border p-4 space-y-2",children:[e.jsxs(F,{className:"text-sm font-medium flex items-center gap-2",children:[e.jsx(te,{className:"h-4 w-4"}),"Teams with access"]}),e.jsx("div",{className:"space-y-1",children:U.map(a=>e.jsxs("div",{className:"flex items-center gap-2 py-1.5",children:[e.jsx("span",{className:"flex-1 min-w-0 truncate text-sm",children:a.teamName}),e.jsxs(E,{variant:"secondary",className:"text-[11px]",children:[a.members.length," member",a.members.length===1?"":"s"]}),e.jsx(N,{variant:"ghost",size:"sm",disabled:B,onClick:()=>me(a.teamId,a.teamName),title:"Unshare team",className:"text-destructive hover:text-destructive hover:bg-destructive/10",children:e.jsx(ie,{className:"h-3.5 w-3.5"})})]},a.teamId))})]}),e.jsxs("div",{className:"rounded-lg border p-4 space-y-2",children:[e.jsx(F,{className:"text-sm font-medium",children:"People with access"}),H?e.jsx("div",{className:"flex items-center justify-center py-4",children:e.jsx(A,{className:"h-5 w-5 animate-spin text-muted-foreground"})}):f.length===0?e.jsx("p",{className:"text-xs text-muted-foreground py-2",children:"Nobody's been added yet. The owner always has full access."}):e.jsx("div",{className:"space-y-1",children:f.map(a=>{var i;return e.jsxs("div",{className:"flex items-center gap-2 py-1.5","data-testid":`collaborator-row-${a.id}`,children:[e.jsx("span",{className:"flex-1 min-w-0 truncate text-sm",children:a.email||a.user_id}),(a.stewardRoles??[]).map(t=>e.jsx(E,{variant:"outline",className:"text-[10px] px-1.5 py-0 capitalize",title:"Steward role — manage in the Stewards tab",children:t},t)),g?e.jsxs(e.Fragment,{children:[e.jsxs(Y,{value:a.permission,disabled:(a.email||"").toLowerCase()===h,onValueChange:t=>he(a.id,t),children:[e.jsx(_,{className:"w-[120px] h-8",title:(a.email||"").toLowerCase()===h?"You can't change your own access level":void 0,children:e.jsx(W,{})}),e.jsx(G,{children:q.map(t=>e.jsx(T,{value:t.value,children:t.label},t.value))})]}),(a.email||"").toLowerCase()!==h&&e.jsx(N,{variant:"ghost",size:"sm",onClick:()=>xe(a),title:"Remove access",className:"text-destructive hover:text-destructive hover:bg-destructive/10",children:e.jsx(ie,{className:"h-3.5 w-3.5"})})]}):e.jsx(E,{variant:"secondary",className:"text-[11px] capitalize",children:((i=q.find(t=>t.value===a.permission))==null?void 0:i.label)??a.permission})]},a.id)})})]})]})}export{Ze as C,Xe as N};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as s,f as c}from"./index-EaX2yql0.js";import{N as p,C as h}from"./CollaboratorManager-By91wrIr.js";import{C as x,a as f,c as u,b as j,d as b}from"./card-XG2dP5Xf.js";import"./select-DBFTrUmI.js";import"./alert-dialog-DTozKlmV.js";import"./PersonCombobox-CPOlNs6G.js";import"./MarkdownEditor-C9zqZjC5.js";import"./scroll-area-hz-xtayP.js";import"./index-C1wTSjfP.js";import"./arrow-left-BCKt4CwQ.js";import"./trash-2-HBi-Pslz.js";import"./x-By7piikG.js";import"./zap-C2T8riBp.js";import"./user-plus-CvBNcpn4.js";import"./share-2-CMnOlOt-.js";function M({nestId:r,nestName:t,canManage:a,canManageGovernance:n,stewardshipEnabled:i,currentUserEmail:l,callerPermission:d,onOpenSettings:m,onChanged:e}){return s.jsxs(x,{children:[s.jsxs(f,{className:"pb-3",children:[s.jsx(u,{className:"text-lg",children:"Collaborators"}),s.jsxs(j,{className:"space-y-1",children:[s.jsxs("span",{className:"block",children:[s.jsx("strong",{className:"font-medium text-foreground",children:"Who can access this nest"})," ","— visibility and access for people and teams. Sharing grants viewer, editor or admin access."]}),s.jsxs("span",{className:"block",children:[s.jsx("strong",{className:"font-medium text-foreground",children:"Stewardship"})," — sharing does not make anyone a steward.",i?" Stewards are assigned on the Stewards tab.":n?s.jsxs(s.Fragment,{children:[" ","Turn on Stewardship & Approval Workflow in"," ",s.jsx("button",{type:"button",onClick:m,className:"font-medium text-foreground underline underline-offset-2 hover:no-underline",children:"Nest settings"})," ","to use stewards."]}):" Stewardship & Approval Workflow is off for this nest — an owner or admin can turn it on in Nest settings."]})]})]}),s.jsxs(b,{className:"space-y-4",children:[a&&s.jsx(p,{nestId:r,onChanged:e,onError:o=>o&&c.error(o)}),s.jsx(h,{nestId:r,nestName:t,onChanged:e,currentUserEmail:l,callerPermission:d,showTeams:!0})]})]})}export{M as CollaboratorsTab};
|