@snagset/server 0.1.51 → 0.1.52
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/package.json +1 -1
- package/static/dashboard/assets/CompositeItem-DTWd-USH.js +1 -0
- package/static/dashboard/assets/{CompositeList-BRoUQLZ7.js → CompositeList-B4njw0mu.js} +1 -1
- package/static/dashboard/assets/{ConfirmDialog-CKQ2LE2m.js → ConfirmDialog-CMhBnMda.js} +1 -1
- package/static/dashboard/assets/{CopyButton-Et1g5isE.js → CopyButton-BeKLr-HL.js} +1 -1
- package/static/dashboard/assets/{FieldItemContext-DCpv0Ox1.js → FieldItemContext-e_7kirJu.js} +1 -1
- package/static/dashboard/assets/{InstallTag-Dgm3LPul.js → InstallTag-FQEroW67.js} +1 -1
- package/static/dashboard/assets/{InstanceRows-BNvGpofx.js → InstanceRows-g_itJcJn.js} +1 -1
- package/static/dashboard/assets/{McpTokens-Dopxwnwy.js → McpTokens-Bnomst3Z.js} +1 -1
- package/static/dashboard/assets/{SaveState-DT_ZtqN6.js → SaveState-BHP4ix-R.js} +1 -1
- package/static/dashboard/assets/{_app-BRCkQPN9.js → _app-Dow8BzDi.js} +1 -1
- package/static/dashboard/assets/{_app-BSR3Hyuo.js → _app-VV0MiNwC.js} +1 -1
- package/static/dashboard/assets/{activity-C7wAfXpX.js → activity-DE2pBEeo.js} +1 -1
- package/static/dashboard/assets/{arrow-left-BnaT-Fbe.js → arrow-left-CkkevAm7.js} +1 -1
- package/static/dashboard/assets/{avatar-BH-hU7Qh.js → avatar-3CJf9_jk.js} +1 -1
- package/static/dashboard/assets/{badge-BaViqDz3.js → badge-ixRisPgI.js} +1 -1
- package/static/dashboard/assets/{card-XWz6Setp.js → card-VzmwyX4K.js} +1 -1
- package/static/dashboard/assets/{check-CsTK2ZlT.js → check-oVlGjqlI.js} +1 -1
- package/static/dashboard/assets/{chevron-down-DPOV2aTJ.js → chevron-down-3JSK4KJk.js} +1 -1
- package/static/dashboard/assets/{chevron-right-DaVBytqm.js → chevron-right-d2kzhQsc.js} +1 -1
- package/static/dashboard/assets/{copy-74WsRINA.js → copy-C9jwRSea.js} +1 -1
- package/static/dashboard/assets/{dialog-CbKDGxpa.js → dialog-CNe7vaQT.js} +1 -1
- package/static/dashboard/assets/{dropdown-menu-CJcFUaVg.js → dropdown-menu-Co_KnEvk.js} +1 -1
- package/static/dashboard/assets/{forgot-Ba8VynCy.js → forgot-C-l4CDgp.js} +1 -1
- package/static/dashboard/assets/{image-off-C79CMi04.js → image-off-zWL0q8lp.js} +1 -1
- package/static/dashboard/assets/index-DVRHlt-r.css +1 -0
- package/static/dashboard/assets/{index-Bjyhj6ZB.js → index-jVSWkcSK.js} +3 -3
- package/static/dashboard/assets/{inertValue-B5n_awh1.js → inertValue-D5-xyRX6.js} +1 -1
- package/static/dashboard/assets/{invite-BF88t7QH.js → invite-CeFOk_KD.js} +1 -1
- package/static/dashboard/assets/{label-C3zh-elW.js → label-CzNjVuJl.js} +1 -1
- package/static/dashboard/assets/{layout-grid-oG1simZW.js → layout-grid-804CjQp4.js} +1 -1
- package/static/dashboard/assets/me-HGkftAh1.js +1 -0
- package/static/dashboard/assets/{parts-DoQ2TEp-.js → parts-OimeyxOU.js} +1 -1
- package/static/dashboard/assets/{plus-cmPSXDaO.js → plus-JDUOLC5V.js} +1 -1
- package/static/dashboard/assets/{reset-BpU9fRSp.js → reset-BgjV0ibh.js} +1 -1
- package/static/dashboard/assets/{s._site-D2r1l61r.js → s._site-CqhbaILH.js} +1 -1
- package/static/dashboard/assets/{s._site.comments-DwaUmd00.js → s._site.comments-CUJ6gfP_.js} +1 -1
- package/static/dashboard/assets/{s._site.reviewers-DRScBd1i.js → s._site.reviewers-mVG7kXC6.js} +1 -1
- package/static/dashboard/assets/{s._site.settings-qspOmIrK.js → s._site.settings-BxmHhbgy.js} +1 -1
- package/static/dashboard/assets/{setup-BkYyqis5.js → setup-DXSpmOXt.js} +1 -1
- package/static/dashboard/assets/{sign-in-lrKREplo.js → sign-in-BQKwrHAZ.js} +1 -1
- package/static/dashboard/assets/{sign-up-Cz1mnlMx.js → sign-up-Bkz7pD7p.js} +1 -1
- package/static/dashboard/assets/{sites-Dw1vM12C.js → sites-CAymJiTT.js} +1 -1
- package/static/dashboard/assets/{studio-yUvPcZ3O.js → studio-BKmWJ117.js} +1 -1
- package/static/dashboard/assets/studio-CEcq06yC.js +1 -0
- package/static/dashboard/assets/studio.index-C1S6bTah.js +1 -0
- package/static/dashboard/assets/{studio.integrations-qLy4n2Db.js → studio.integrations-BHZx3da-.js} +1 -1
- package/static/dashboard/assets/{studio.members-BCByOoP6.js → studio.members-DFLy8pUA.js} +1 -1
- package/static/dashboard/assets/{studio.plan-VWSLPHcb.js → studio.plan-Bw9piNdr.js} +1 -1
- package/static/dashboard/assets/{sun-BpsiEWtf.js → sun-i-qGe4pR.js} +1 -1
- package/static/dashboard/assets/{switch-ByUmW5H2.js → switch-BCvzokd6.js} +1 -1
- package/static/dashboard/assets/{table-C5ApoOFC.js → table-CJ9qkwn1.js} +1 -1
- package/static/dashboard/assets/{useAriaLabelledBy-CvsQoCZu.js → useAriaLabelledBy-B4z1WZse.js} +1 -1
- package/static/dashboard/assets/{useBaseQuery-0a7T0HmH.js → useBaseQuery-CDoR88Fa.js} +1 -1
- package/static/dashboard/assets/{useCompositeItem-CsYzexWF.js → useCompositeItem-MHMarTaJ.js} +1 -1
- package/static/dashboard/assets/useQuery-hBVmWzEl.js +1 -0
- package/static/dashboard/assets/useRender-mrNZQnpJ.js +1 -0
- package/static/dashboard/assets/{useValueChanged-CQWizfo3.js → useValueChanged-ERXEloZc.js} +1 -1
- package/static/dashboard/assets/{users-Df1_iduv.js → users-Dhqkqlui.js} +1 -1
- package/static/dashboard/assets/{welcome-DXLh7SqO.js → welcome-LbC7b_-p.js} +1 -1
- package/static/dashboard/assets/{widget-signin-E1tpKlR7.js → widget-signin-DgOTYROi.js} +1 -1
- package/static/dashboard/assets/{you-CQElYVq9.js → you-DEoU_kOm.js} +1 -1
- package/static/dashboard/assets/{zod-CuCSHm2e.js → zod-8bzEaiHG.js} +1 -1
- package/static/dashboard/index.html +2 -2
- package/static/widget/build.json +2 -2
- package/static/widget/snag.js +1 -1
- package/static/widget/snag.runtime.js +1 -1
- package/static/dashboard/assets/CompositeItem-Dr9UcOhm.js +0 -1
- package/static/dashboard/assets/index-vKxPrBs3.css +0 -1
- package/static/dashboard/assets/me-CtDXQ1_u.js +0 -1
- package/static/dashboard/assets/studio-DXL_Yf0t.js +0 -1
- package/static/dashboard/assets/studio.index-BQaRfibu.js +0 -1
- package/static/dashboard/assets/useQuery-ClGE3W7i.js +0 -1
- package/static/dashboard/assets/useRender-tS6QvoXj.js +0 -1
package/package.json
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{E as u,ab as t,k as c}from"./index-jVSWkcSK.js";import{u as E}from"./useCompositeItem-MHMarTaJ.js";function M(e){const{render:d,className:l,style:C,state:s=u,props:o=t,refs:r=t,metadata:a,stateAttributesMapping:m,tag:p="div",...i}=e,{compositeProps:n,compositeRef:f}=E({metadata:a});return c(p,e,{state:s,ref:[f,...r],props:[n,...o,i],stateAttributesMapping:m})}export{M as C};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as c,e as L,f as g,
|
|
1
|
+
import{r as c,e as L,f as g,aa as S,j}from"./index-jVSWkcSK.js";const k=c.createContext(void 0);function F(){return c.useContext(k)?.direction??"ltr"}const y=c.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},nextIndexRef:{current:0}});function T(){return c.useContext(y)}function G(u={}){const{guess:o,label:e,metadata:s,textRef:p,index:t}=u,{register:i,unregister:a,subscribeMapChange:m,nextIndexRef:R}=T(),f=c.useRef(-1),[v,b]=c.useState(t==null&&o?()=>{if(f.current===-1){const l=R.current;R.current+=1,f.current=l}return f.current}:-1),I=t??v,h=c.useRef(null),E=c.useCallback(l=>{const C=h.current;C&&a(C),h.current=l,l&&i(l,{metadata:s??null,index:t??null,label:e,textRef:p})},[t,i,a,s,e,p]);return L(()=>{if(t==null)return m(l=>{const C=h.current?l.get(h.current)?.index:null;C!=null&&b(C)})},[t,m]),{ref:E,index:I}}function V(u){const{children:o,elementsRef:e,labelsRef:s,onMapChange:p}=u,t=g(p),[,i]=c.useState(!1),a=S(U).current,m=S(A).current,R=c.useRef(0),f=c.useRef(!0),v=c.useRef([]),b=c.useRef(null),I=g(()=>{f.current||(f.current=!0,i(n=>!n))}),h=g((n,d)=>{m.set(n,d),I()}),E=g(n=>{m.delete(n),I()}),l=g(n=>{const d=new Map;return e.current.length=0,s&&(s.current.length=0),n.forEach(r=>{d.set(r.element,{...r.registration.metadata??{},index:r.index}),e.current[r.index]=r.element,s&&(s.current[r.index]=r.registration.label!==void 0?r.registration.label:r.registration.textRef?.current?.textContent??r.element.textContent)}),R.current=e.current.length,d});function C(n){if(b.current?.disconnect(),b.current=null,typeof MutationObserver!="function"||n.length<2)return;const d=new MutationObserver(x=>{if(!z(x))return;let M=null;for(const w of n)if(w.isConnected){if(M&&D(M,w)>0){d.disconnect(),I();return}M=w}});b.current=d;const r=new Set;for(let x=1;x<n.length;x+=1){const M=_(n[x-1],n[x]);M&&r.add(M)}r.forEach(x=>d.observe(x,{childList:!0}))}const N=g(()=>{const[n,d]=W(m),r=l(n);C(d),v.current=n,f.current=!1,a.forEach(x=>x(r)),t(r)});L(()=>(f.current||l(v.current),()=>{e.current=[],s&&(s.current=[])}),[e,s,l]),L(()=>{f.current&&N()}),L(()=>()=>{b.current?.disconnect(),f.current=!0},[]);const O=g(n=>(a.add(n),()=>{a.delete(n)})),P=c.useMemo(()=>({register:h,unregister:E,subscribeMapChange:O,nextIndexRef:R}),[h,E,O,R]);return j.jsx(y.Provider,{value:P,children:o})}function A(){return new Map}function U(){return new Set}function W(u){const o=new Set,e=[],s=[];u.forEach((t,i)=>{if(!i.isConnected)return;const a=t.index,m={index:a??-1,element:i,registration:t};a===null?s.push(m):a>=0&&(o.add(a),e.push(m))});let p=0;return s.sort((t,i)=>D(t.element,i.element)),s.forEach(t=>{for(;o.has(p);)p+=1;t.index=p,e.push(t),p+=1}),o.size>0&&e.sort((t,i)=>t.index-i.index),[e,s.map(t=>t.element)]}function _(u,o){let e=u.parentElement;for(;e&&!e.contains(o);)e=e.parentElement;return e}function z(u){for(const o of u)for(let e=0;e<o.removedNodes.length;e+=1)if(o.removedNodes[e].isConnected)return!0;return!1}function D(u,o){return u.compareDocumentPosition(o)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1}export{V as C,G as a,F as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as i,j as e,B as u}from"./index-
|
|
1
|
+
import{r as i,j as e,B as u}from"./index-jVSWkcSK.js";import{C,E as v,H as b,G as D,I as y,J as N}from"./dialog-CNe7vaQT.js";import{I as T}from"./label-CzNjVuJl.js";import{C as k}from"./check-oVlGjqlI.js";import{C as E}from"./copy-C9jwRSea.js";function H({open:l,onOpenChange:o,title:x,description:n,children:g,confirmLabel:h,confirmWord:s,busy:t=!1,onConfirm:j}){const[r,c]=i.useState(""),[d,m]=i.useState(!1),f=i.useId();i.useEffect(()=>{l&&c("")},[l]);const p=!s||r.trim()===s;return e.jsx(C,{open:l,onOpenChange:a=>{!a&&t||o(a)},children:e.jsx(v,{showCloseButton:!1,children:e.jsxs("form",{className:"flex flex-col gap-4",onSubmit:a=>{a.preventDefault(),p&&!t&&j()},children:[e.jsxs(b,{children:[e.jsx(D,{children:x}),n&&e.jsx(y,{children:n})]}),g,s&&e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsxs("p",{className:"m-0 flex flex-wrap items-center gap-1 text-sm font-medium",children:["Type",e.jsxs("button",{type:"button",disabled:t,title:"Copy the name",className:"inline-flex items-center gap-1 rounded-sm bg-muted px-1.5 py-0.5 font-semibold text-foreground hover:bg-accent focus-visible:outline-2 focus-visible:outline-ring",onClick:()=>{navigator.clipboard?.writeText(s).catch(()=>{}),m(!0),setTimeout(()=>m(!1),1500),document.getElementById(f)?.focus()},children:[s,d?e.jsx(k,{className:"size-3.5 text-muted-foreground"}):e.jsx(E,{className:"size-3.5 text-muted-foreground"}),e.jsx("span",{className:"sr-only",children:d?" copied":" — copy"})]}),"to confirm"]}),e.jsx(T,{id:f,"aria-label":`Type ${s} to confirm`,value:r,autoComplete:"off",spellCheck:!1,disabled:t,onChange:a=>c(a.target.value)})]}),e.jsxs(N,{children:[e.jsx(u,{type:"button",variant:"outline",disabled:t,onClick:()=>o(!1),children:"Cancel"}),e.jsx(u,{type:"submit",variant:"destructive",loading:t,disabled:!p,children:t?"Working…":h})]})]})})})}export{H as C};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as n,j as t,B as c}from"./index-
|
|
1
|
+
import{r as n,j as t,B as c}from"./index-jVSWkcSK.js";import{C}from"./check-oVlGjqlI.js";import{C as m}from"./copy-C9jwRSea.js";function l({text:r,label:e="Copy",withText:s=!1,size:a="icon-sm",className:p}){const[o,i]=n.useState(!1);return t.jsxs(c,{type:"button",variant:"outline",size:s?"sm":a,className:p,"aria-label":o?"Copied":e,onClick:()=>{navigator.clipboard?.writeText(r).catch(()=>{}),i(!0),setTimeout(()=>i(!1),1500)},children:[o?t.jsx(C,{}):t.jsx(m,{}),s&&(o?"Copied":e)]})}export{l as C};
|
package/static/dashboard/assets/{FieldItemContext-DCpv0Ox1.js → FieldItemContext-e_7kirJu.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t}from"./index-
|
|
1
|
+
import{r as t}from"./index-jVSWkcSK.js";const e=t.createContext({disabled:!1});function r(){return t.useContext(e)}export{r as u};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as a,i as je,e as Z,f as F,k as oe,j as n,aH as Le,ac as Oe,ab as Ve,aa as ue,E as ze,b3 as He,h as re,o as Ke,B as Be,b4 as _e}from"./index-Bjyhj6ZB.js";import{k as Fe,c as Pe,C as pe,D as ge,d as $e,u as we,x as We,r as be,a as Ye,n as Ue,g as he}from"./label-C3zh-elW.js";import{C as ke,a as Je,u as qe}from"./CompositeList-BRoUQLZ7.js";import{i as Ge}from"./isElementDisabled-CwHw_lZC.js";import{a as Qe,u as Xe,t as Ze,i as et,s as ve,k as me,h as le,e as ce,H as xe,E as Re,C as tt,l as Ce,g as nt,f as at,A as ye,m as Ie,n as Te,o as Ee,M as st}from"./inertValue-B5n_awh1.js";import{u as ot}from"./useCompositeItem-CsYzexWF.js";import{C as rt}from"./check-CsTK2ZlT.js";import{C as it}from"./copy-74WsRINA.js";const Se=a.createContext(void 0);function fe(){const t=a.useContext(Se);if(t===void 0)throw new Error(je(64));return t}const ie={tabActivationDirection:t=>({"data-activation-direction":t})},lt=a.forwardRef(function(o,r){const{className:C,defaultValue:i=0,onValueChange:j,orientation:u="horizontal",render:A,value:T,style:P,...w}=o,v=o.defaultValue!==void 0,O=a.useRef([]),[D,x]=a.useState(()=>new Map),[l,R]=Fe({controlled:T,default:i,name:"Tabs",state:"value"}),y=T!==void 0,[s,E]=a.useState(()=>new Map),f=a.useRef(void 0),g=a.useCallback(p=>de(s,p),[s]),[V,L]=a.useState(()=>({previousValue:l,tabActivationDirection:"none"})),{previousValue:c,tabActivationDirection:I}=V;let e=I,d=!1;c!==l&&(e=Me(c,l,u,s),d=c!=null&&l!=null&&g(l)==null);const b=d?c:l,k=c!==b||I!==e;Z(()=>{k&&L({previousValue:b,tabActivationDirection:e})},[b,k,e]);const S=F((p,M)=>{const Y=Me(l,p,u,s);M.activationDirection=Y,j?.(p,M),!M.isCanceled&&R(p)}),H=F((p,M)=>{j?.(p,Pe(M,void 0,void 0,{activationDirection:"none"}))}),$=F((p,M)=>(x(Y=>{const G=new Map(Y);return G.set(p,M),G}),()=>{x(Y=>{if(Y.get(p)!==M)return Y;const G=new Map(Y);return G.delete(p),G})})),U=a.useCallback(p=>D.get(p),[D]),N=a.useCallback(p=>{for(const M of s.values())if(p===M.value)return M.id},[s]),h=a.useMemo(()=>({getTabElementBySelectedValue:g,getTabIdByPanelValue:N,getTabPanelIdByValue:U,onValueChange:S,orientation:u,registerMountedTabPanel:$,setTabMap:E,tabActivationDirection:e,value:l}),[g,N,U,S,u,$,E,e,l]),z=a.useMemo(()=>{for(const p of s.values())if(p.value===l)return p},[s,l]),W=a.useMemo(()=>{for(const p of s.values())if(!p.disabled)return p.value},[s]),K=a.useRef(!v),J=a.useRef(i),q=a.useRef(v),m=a.useRef(!1);Z(()=>{if(y)return;function p(X,ee){R(X),L({previousValue:X,tabActivationDirection:"none"}),H(X,ee),K.current=!1}if(s.size===0){m.current&&l!==null&&!f.current?.isConnected&&p(null,ge);return}m.current=!0,f.current=s.keys().next().value;const M=z?.disabled,Y=z==null&&l!==null;if(!M&&l===J.current&&(q.current=!1),q.current&&M&&l===J.current)return;const G=K.current;if(M||Y){const X=W??null;if(l===X){K.current=!1;return}let ee=ge;G?ee=pe:M&&(ee=$e),p(X,ee);return}G&&z!=null&&(H(l,pe),K.current=!1)},[W,y,H,z,R,s,l]);const Q=oe("div",o,{state:{orientation:u,tabActivationDirection:e},ref:r,props:w,stateAttributesMapping:ie});return n.jsx(Se.Provider,{value:h,children:n.jsx(ke,{elementsRef:O,children:Q})})});function de(t,o){for(const[r,C]of t.entries())if(o===C.value)return r;return null}function Me(t,o,r,C){if(t==null||o==null)return"none";const[i,j,u]=r==="horizontal"?["left","left","right"]:["top","up","down"],A=de(C,t),T=de(C,o);if(A==null||T==null)return A!==T&&(typeof t=="number"||typeof t=="string")&&typeof t==typeof o?o>t?u:j:"none";const P=A.getBoundingClientRect()[i],w=T.getBoundingClientRect()[i];return w<P?j:w>P?u:"none"}const Ae="data-composite-item-active",De=a.createContext(void 0);function ct(){const t=a.useContext(De);if(t===void 0)throw new Error(je(65));return t}const ut=a.forwardRef(function(o,r){const{className:C,disabled:i=!1,render:j,value:u,id:A,nativeButton:T=!0,style:P,...w}=o,{value:v,getTabPanelIdByValue:O,onValueChange:D,orientation:x,tabActivationDirection:l}=fe(),{activateOnFocus:R,registerTabResizeObserverElement:y,tabsListElement:s}=ct(),{highlightedIndex:E,onHighlightedIndexChange:f}=Le(),g=we(A),V=a.useMemo(()=>({disabled:i,id:g,value:u}),[i,g,u]),{compositeProps:L,compositeRef:c,index:I}=ot({metadata:V}),e=u===v,d=a.useRef(!1),b=a.useRef(null),k=F(m=>{b.current?.(),b.current=m?y(m):null});Z(()=>{if(d.current){d.current=!1;return}if(!(e&&I>-1&&E!==I))return;const m=s;if(m!=null){const B=We(be(m));if(B&&Ye(m,B))return}i||f(I)},[e,I,E,f,i,s]);const{getButtonProps:S,buttonRef:H}=Oe({disabled:i,native:T,focusableWhenDisabled:!0}),$=O(u),U=a.useRef(!1),N=a.useRef(!1);function h(m){D(u,Pe(Ue,m.nativeEvent,void 0,{activationDirection:"none"}))}function z(m){e||i||h(m)}function W(m){e||i||R&&(!U.current||N.current)&&h(m)}function K(m){if(e||i)return;U.current=!0,N.current=m.button===0;const B=be(m.currentTarget);function Q(){U.current=!1,N.current=!1,B.removeEventListener("pointerup",Q),B.removeEventListener("pointercancel",Q)}B.addEventListener("pointerup",Q),B.addEventListener("pointercancel",Q)}return oe("button",o,{state:{disabled:i,active:e,orientation:x,tabActivationDirection:l},ref:[r,H,c,k],props:[L,{role:"tab","aria-controls":$,"aria-selected":e,id:g,onClick:z,onFocus:W,onPointerDown:K,[Ae]:e?"":void 0,onKeyDownCapture(){d.current=!0}},w,S],stateAttributesMapping:ie})}),dt={...ie,...Ze},ft=a.forwardRef(function(o,r){const{className:C,value:i,render:j,keepMounted:u=!1,style:A,...T}=o,{value:P,getTabIdByPanelValue:w,orientation:v,tabActivationDirection:O,registerMountedTabPanel:D}=fe(),x=we(),{ref:l,index:R}=Je(),y=i===P,{mounted:s,transitionStatus:E,setMounted:f}=Qe(y),g=!s,V=w(i),L={hidden:g,orientation:v,tabActivationDirection:O,transitionStatus:E},c=a.useRef(null),I=oe("div",o,{state:L,ref:[r,l,c],props:[{"aria-labelledby":V,hidden:g,id:x,role:"tabpanel",tabIndex:y?0:-1,inert:et(!y),"data-index":R},T],stateAttributesMapping:dt});return Xe({open:y,ref:c,onComplete(){y||f(!1)}}),Z(()=>{if(!(x==null||g&&!u))return D(i,x)},[g,u,i,x,D]),u||s?I:null}),pt=[];function gt(t){const{loopFocus:o=!0,orientation:r="both",grid:C,onLoop:i,direction:j,highlightedIndex:u,onHighlightedIndexChange:A,rootRef:T,enableHomeAndEndKeys:P=!1,stopEventPropagation:w,disabledIndices:v,modifierKeys:O=pt}=t,[D,x]=a.useState(0),l=C!=null,R=a.useRef(null),y=Ve(R,T),s=a.useRef([]),E=a.useRef(!1),f=u??D,g=F((e,d=!1)=>{if((A??x)(e),d){const b=s.current[e];ve(R.current,b,j,r)}}),V=F(e=>{if(e.size===0||E.current)return;E.current=!0;const d=Array.from(e.keys()),b=d.find(S=>S?.hasAttribute(Ae))??null,k=b?e.get(b)?.index??-1:-1;if(k!==-1)g(k);else if(me(d,f,v)){const S=le(d,{disabledIndices:v});ce(d,S)||g(S)}ve(R.current,b,j,r)});Z(()=>{if(v==null||u!=null||!E.current)return;const e=s.current;if(me(e,f,v)){const d=le(e,{disabledIndices:v});ce(e,d)||g(d)}},[v,u,f,s,g]);const L=F((e,d,b)=>i?i(e,d,b,s):b),c=F(e=>{const d=e.key===xe||e.key===Re;if(!tt.has(e.key)||!P&&d||bt(e,O)||!R.current)return;const k=j==="rtl",S=k?Te:Ee,H=k?Ee:Te,$=r==="vertical"?ye:S,U=r==="vertical"?Ie:H,N=he(e.nativeEvent);if(N!=null&&Ce(N)&&!Ge(N)){const q=N.selectionStart,m=N.selectionEnd,B=N.value;if(q==null||e.shiftKey||q!==m||e.key!==U&&q<B.length||e.key!==$&&q>0)return}let h=f;const z=nt(s,v),W=at(s,v);C!=null&&(h=C({disabledIndices:v,elementsRef:s,event:e,highlightedIndex:f,loopFocus:o,maxIndex:W,minIndex:z,onLoop:L,orientation:r,rtl:k}));const K=r!=="vertical"&&e.key===S||r!=="horizontal"&&e.key===ye,J=r!=="vertical"&&e.key===H||r!=="horizontal"&&e.key===Ie;P&&(e.key===xe?h=z:e.key===Re&&(h=W)),h===f&&(K||J)&&(o&&h===W&&K?(h=z,i&&(h=i(e,f,h,s))):o&&h===z&&J?(h=W,i&&(h=i(e,f,h,s))):h=le(s.current,{startingIndex:h,decrement:J,disabledIndices:v})),h!==f&&!ce(s.current,h)&&(w&&e.stopPropagation(),(l||d||K||J)&&e.preventDefault(),g(h,!0),queueMicrotask(()=>{s.current[h]?.focus()}))});return{props:{ref:y,onFocus(e){const d=R.current,b=he(e.nativeEvent);!d||b==null||!Ce(b)||b.setSelectionRange(0,b.value.length)},onKeyDown:c},highlightedIndex:f,onHighlightedIndexChange:g,elementsRef:s,onMapChange:V,relayKeyboardEvent:c}}function bt(t,o){for(const r of st)if(!o.includes(r)&&t.getModifierState(r))return!0;return!1}function ht(t){const{render:o,className:r,style:C,refs:i=ue,props:j=ue,state:u=ze,stateAttributesMapping:A,highlightedIndex:T,onHighlightedIndexChange:P,orientation:w,grid:v,loopFocus:O,onLoop:D,enableHomeAndEndKeys:x,onMapChange:l,stopEventPropagation:R=!0,rootRef:y,disabledIndices:s,modifierKeys:E,highlightItemOnHover:f=!1,tag:g="div",...V}=t,L=qe(),{props:c,highlightedIndex:I,onHighlightedIndexChange:e,elementsRef:d,onMapChange:b,relayKeyboardEvent:k}=gt({grid:v,loopFocus:O,onLoop:D,orientation:w,highlightedIndex:T,onHighlightedIndexChange:P,rootRef:y,stopEventPropagation:R,enableHomeAndEndKeys:x,direction:L,disabledIndices:s,modifierKeys:E}),S=oe(g,t,{state:u,ref:i,props:[c,...j,V],stateAttributesMapping:A}),H=a.useMemo(()=>({highlightedIndex:I,onHighlightedIndexChange:e,highlightItemOnHover:f,relayKeyboardEvent:k}),[I,e,f,k]);return n.jsx(He.Provider,{value:H,children:n.jsx(ke,{elementsRef:d,onMapChange:$=>{l?.($),b($)},children:S})})}const vt=a.forwardRef(function(o,r){const{activateOnFocus:C=!1,className:i,loopFocus:j=!0,render:u,style:A,...T}=o,{orientation:P,setTabMap:w,tabActivationDirection:v}=fe(),[O,D]=a.useState(0),[x,l]=a.useState(null),R=a.useRef(new Set),y=a.useRef(new Set),s=a.useRef(null);Z(()=>{if(typeof ResizeObserver>"u")return;const c=new ResizeObserver(()=>{R.current.forEach(I=>{I()})});return s.current=c,x&&c.observe(x),y.current.forEach(I=>{c.observe(I)}),()=>{c.disconnect(),s.current=null}},[x]);const E=F(c=>(R.current.add(c),()=>{R.current.delete(c)})),f=F(c=>(y.current.add(c),s.current?.observe(c),()=>{y.current.delete(c),s.current?.unobserve(c)})),g={orientation:P,tabActivationDirection:v},V={"aria-orientation":P==="vertical"?"vertical":void 0,role:"tablist"},L=a.useMemo(()=>({activateOnFocus:C,registerIndicatorUpdateListener:E,registerTabResizeObserverElement:f,tabsListElement:x}),[C,E,f,x]);return n.jsx(De.Provider,{value:L,children:n.jsx(ht,{render:u,className:i,style:A,state:g,refs:[r,l],props:[V,T],stateAttributesMapping:ie,highlightedIndex:O,enableHomeAndEndKeys:!0,loopFocus:j,orientation:P,onHighlightedIndexChange:D,onMapChange:w,disabledIndices:ue})})});function mt({className:t,orientation:o="horizontal",...r}){return n.jsx(lt,{"data-slot":"tabs","data-orientation":o,className:re("group/tabs flex gap-2 data-horizontal:flex-col",t),...r})}const xt=Ke("group/tabs-list inline-flex w-fit items-center justify-center rounded-lg p-[3px] text-muted-foreground group-data-horizontal/tabs:h-8 group-data-vertical/tabs:h-fit group-data-vertical/tabs:flex-col data-[variant=line]:rounded-none",{variants:{variant:{default:"bg-muted",line:"gap-1 bg-transparent"}},defaultVariants:{variant:"default"}});function Rt({className:t,variant:o="default",...r}){return n.jsx(vt,{"data-slot":"tabs-list","data-variant":o,className:re(xt({variant:o}),t),...r})}function te({className:t,...o}){return n.jsx(ut,{"data-slot":"tabs-trigger",className:re("relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-1.5 py-0.5 text-sm font-medium whitespace-nowrap text-foreground/60 transition-all group-data-vertical/tabs:w-full group-data-vertical/tabs:justify-start hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1 focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-50 has-data-[icon=inline-end]:pr-1 has-data-[icon=inline-start]:pl-1 aria-disabled:pointer-events-none aria-disabled:opacity-50 dark:text-muted-foreground dark:hover:text-foreground group-data-[variant=default]/tabs-list:data-active:shadow-sm group-data-[variant=line]/tabs-list:data-active:shadow-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4","group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-active:bg-transparent dark:group-data-[variant=line]/tabs-list:data-active:border-transparent dark:group-data-[variant=line]/tabs-list:data-active:bg-transparent","data-active:bg-background data-active:text-foreground dark:data-active:border-input dark:data-active:bg-input/30 dark:data-active:text-foreground","after:absolute after:bg-foreground after:opacity-0 after:transition-opacity group-data-horizontal/tabs:after:inset-x-0 group-data-horizontal/tabs:after:bottom-[-5px] group-data-horizontal/tabs:after:h-0.5 group-data-vertical/tabs:after:inset-y-0 group-data-vertical/tabs:after:-right-1 group-data-vertical/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-active:after:opacity-100",t),...o})}function ne({className:t,...o}){return n.jsx(ft,{"data-slot":"tabs-content",className:re("flex-1 text-sm outline-none",t),...o})}function Ne(t){return`<script src="${location.origin}/snag.js" ${_e("site")}="${t}" defer><\/script>`}function _({code:t,label:o}){const[r,C]=a.useState(!1);return n.jsxs("div",{className:"relative rounded-md border border-border bg-background px-3 py-2.5 pr-11 font-mono text-[12.5px] leading-relaxed",children:[n.jsx("code",{className:"whitespace-pre-wrap break-all",children:t}),n.jsx(Be,{variant:"ghost",size:"icon-sm",className:"absolute right-1.5 top-1.5","aria-label":r?"Copied":o,onClick:()=>{navigator.clipboard?.writeText(t),C(!0),setTimeout(()=>C(!1),1500)},children:r?n.jsx(rt,{}):n.jsx(it,{})})]})}function wt({uid:t}){return n.jsx(_,{code:Ne(t),label:"Copy the tag"})}const se="npm install snagset";function ae({children:t}){return n.jsx("p",{className:"m-0 text-[12.5px] text-muted-foreground",children:t})}function kt({uid:t}){const o=location.origin,r=`host="${o}" site="${t}"`;return n.jsxs(mt,{defaultValue:"html",className:"gap-3",children:[n.jsxs(Rt,{className:"w-full",children:[n.jsx(te,{value:"html",children:"HTML"}),n.jsx(te,{value:"next",children:"Next.js"}),n.jsx(te,{value:"react",children:"React"}),n.jsx(te,{value:"vue",children:"Vue"}),n.jsx(te,{value:"js",children:"JS"})]}),n.jsxs(ne,{value:"html",className:"flex flex-col gap-2",children:[n.jsx(_,{code:Ne(t),label:"Copy the tag"}),n.jsxs(ae,{children:["Paste it before ",n.jsx("code",{className:"font-mono",children:"</body>"})," on every page you want reviewed. On WordPress, Webflow, Framer or Squarespace, put it in the site's footer or custom code setting."]})]}),n.jsxs(ne,{value:"next",className:"flex flex-col gap-2",children:[n.jsx(_,{code:se,label:"Copy the install command"}),n.jsx(_,{code:`// app/layout.tsx
|
|
1
|
+
import{r as a,i as je,e as Z,f as F,k as oe,j as n,aI as Le,ad as Oe,ac as Ve,ab as ue,E as ze,b4 as He,h as re,o as Ke,B as Be,b5 as _e}from"./index-jVSWkcSK.js";import{k as Fe,c as Pe,C as pe,D as ge,d as $e,u as we,x as We,r as be,a as Ye,n as Ue,g as he}from"./label-CzNjVuJl.js";import{C as ke,a as Je,u as qe}from"./CompositeList-B4njw0mu.js";import{i as Ge}from"./isElementDisabled-CwHw_lZC.js";import{a as Qe,u as Xe,t as Ze,i as et,s as ve,k as me,h as le,e as ce,H as xe,E as Re,C as tt,l as Ce,g as nt,f as at,A as ye,m as Ie,n as Te,o as Ee,M as st}from"./inertValue-D5-xyRX6.js";import{u as ot}from"./useCompositeItem-MHMarTaJ.js";import{C as rt}from"./check-oVlGjqlI.js";import{C as it}from"./copy-C9jwRSea.js";const Se=a.createContext(void 0);function fe(){const t=a.useContext(Se);if(t===void 0)throw new Error(je(64));return t}const ie={tabActivationDirection:t=>({"data-activation-direction":t})},lt=a.forwardRef(function(o,r){const{className:C,defaultValue:i=0,onValueChange:j,orientation:u="horizontal",render:A,value:T,style:P,...w}=o,v=o.defaultValue!==void 0,O=a.useRef([]),[D,x]=a.useState(()=>new Map),[l,R]=Fe({controlled:T,default:i,name:"Tabs",state:"value"}),y=T!==void 0,[s,E]=a.useState(()=>new Map),f=a.useRef(void 0),g=a.useCallback(p=>de(s,p),[s]),[V,L]=a.useState(()=>({previousValue:l,tabActivationDirection:"none"})),{previousValue:c,tabActivationDirection:I}=V;let e=I,d=!1;c!==l&&(e=Me(c,l,u,s),d=c!=null&&l!=null&&g(l)==null);const b=d?c:l,k=c!==b||I!==e;Z(()=>{k&&L({previousValue:b,tabActivationDirection:e})},[b,k,e]);const S=F((p,M)=>{const Y=Me(l,p,u,s);M.activationDirection=Y,j?.(p,M),!M.isCanceled&&R(p)}),H=F((p,M)=>{j?.(p,Pe(M,void 0,void 0,{activationDirection:"none"}))}),$=F((p,M)=>(x(Y=>{const G=new Map(Y);return G.set(p,M),G}),()=>{x(Y=>{if(Y.get(p)!==M)return Y;const G=new Map(Y);return G.delete(p),G})})),U=a.useCallback(p=>D.get(p),[D]),N=a.useCallback(p=>{for(const M of s.values())if(p===M.value)return M.id},[s]),h=a.useMemo(()=>({getTabElementBySelectedValue:g,getTabIdByPanelValue:N,getTabPanelIdByValue:U,onValueChange:S,orientation:u,registerMountedTabPanel:$,setTabMap:E,tabActivationDirection:e,value:l}),[g,N,U,S,u,$,E,e,l]),z=a.useMemo(()=>{for(const p of s.values())if(p.value===l)return p},[s,l]),W=a.useMemo(()=>{for(const p of s.values())if(!p.disabled)return p.value},[s]),K=a.useRef(!v),J=a.useRef(i),q=a.useRef(v),m=a.useRef(!1);Z(()=>{if(y)return;function p(X,ee){R(X),L({previousValue:X,tabActivationDirection:"none"}),H(X,ee),K.current=!1}if(s.size===0){m.current&&l!==null&&!f.current?.isConnected&&p(null,ge);return}m.current=!0,f.current=s.keys().next().value;const M=z?.disabled,Y=z==null&&l!==null;if(!M&&l===J.current&&(q.current=!1),q.current&&M&&l===J.current)return;const G=K.current;if(M||Y){const X=W??null;if(l===X){K.current=!1;return}let ee=ge;G?ee=pe:M&&(ee=$e),p(X,ee);return}G&&z!=null&&(H(l,pe),K.current=!1)},[W,y,H,z,R,s,l]);const Q=oe("div",o,{state:{orientation:u,tabActivationDirection:e},ref:r,props:w,stateAttributesMapping:ie});return n.jsx(Se.Provider,{value:h,children:n.jsx(ke,{elementsRef:O,children:Q})})});function de(t,o){for(const[r,C]of t.entries())if(o===C.value)return r;return null}function Me(t,o,r,C){if(t==null||o==null)return"none";const[i,j,u]=r==="horizontal"?["left","left","right"]:["top","up","down"],A=de(C,t),T=de(C,o);if(A==null||T==null)return A!==T&&(typeof t=="number"||typeof t=="string")&&typeof t==typeof o?o>t?u:j:"none";const P=A.getBoundingClientRect()[i],w=T.getBoundingClientRect()[i];return w<P?j:w>P?u:"none"}const Ae="data-composite-item-active",De=a.createContext(void 0);function ct(){const t=a.useContext(De);if(t===void 0)throw new Error(je(65));return t}const ut=a.forwardRef(function(o,r){const{className:C,disabled:i=!1,render:j,value:u,id:A,nativeButton:T=!0,style:P,...w}=o,{value:v,getTabPanelIdByValue:O,onValueChange:D,orientation:x,tabActivationDirection:l}=fe(),{activateOnFocus:R,registerTabResizeObserverElement:y,tabsListElement:s}=ct(),{highlightedIndex:E,onHighlightedIndexChange:f}=Le(),g=we(A),V=a.useMemo(()=>({disabled:i,id:g,value:u}),[i,g,u]),{compositeProps:L,compositeRef:c,index:I}=ot({metadata:V}),e=u===v,d=a.useRef(!1),b=a.useRef(null),k=F(m=>{b.current?.(),b.current=m?y(m):null});Z(()=>{if(d.current){d.current=!1;return}if(!(e&&I>-1&&E!==I))return;const m=s;if(m!=null){const B=We(be(m));if(B&&Ye(m,B))return}i||f(I)},[e,I,E,f,i,s]);const{getButtonProps:S,buttonRef:H}=Oe({disabled:i,native:T,focusableWhenDisabled:!0}),$=O(u),U=a.useRef(!1),N=a.useRef(!1);function h(m){D(u,Pe(Ue,m.nativeEvent,void 0,{activationDirection:"none"}))}function z(m){e||i||h(m)}function W(m){e||i||R&&(!U.current||N.current)&&h(m)}function K(m){if(e||i)return;U.current=!0,N.current=m.button===0;const B=be(m.currentTarget);function Q(){U.current=!1,N.current=!1,B.removeEventListener("pointerup",Q),B.removeEventListener("pointercancel",Q)}B.addEventListener("pointerup",Q),B.addEventListener("pointercancel",Q)}return oe("button",o,{state:{disabled:i,active:e,orientation:x,tabActivationDirection:l},ref:[r,H,c,k],props:[L,{role:"tab","aria-controls":$,"aria-selected":e,id:g,onClick:z,onFocus:W,onPointerDown:K,[Ae]:e?"":void 0,onKeyDownCapture(){d.current=!0}},w,S],stateAttributesMapping:ie})}),dt={...ie,...Ze},ft=a.forwardRef(function(o,r){const{className:C,value:i,render:j,keepMounted:u=!1,style:A,...T}=o,{value:P,getTabIdByPanelValue:w,orientation:v,tabActivationDirection:O,registerMountedTabPanel:D}=fe(),x=we(),{ref:l,index:R}=Je(),y=i===P,{mounted:s,transitionStatus:E,setMounted:f}=Qe(y),g=!s,V=w(i),L={hidden:g,orientation:v,tabActivationDirection:O,transitionStatus:E},c=a.useRef(null),I=oe("div",o,{state:L,ref:[r,l,c],props:[{"aria-labelledby":V,hidden:g,id:x,role:"tabpanel",tabIndex:y?0:-1,inert:et(!y),"data-index":R},T],stateAttributesMapping:dt});return Xe({open:y,ref:c,onComplete(){y||f(!1)}}),Z(()=>{if(!(x==null||g&&!u))return D(i,x)},[g,u,i,x,D]),u||s?I:null}),pt=[];function gt(t){const{loopFocus:o=!0,orientation:r="both",grid:C,onLoop:i,direction:j,highlightedIndex:u,onHighlightedIndexChange:A,rootRef:T,enableHomeAndEndKeys:P=!1,stopEventPropagation:w,disabledIndices:v,modifierKeys:O=pt}=t,[D,x]=a.useState(0),l=C!=null,R=a.useRef(null),y=Ve(R,T),s=a.useRef([]),E=a.useRef(!1),f=u??D,g=F((e,d=!1)=>{if((A??x)(e),d){const b=s.current[e];ve(R.current,b,j,r)}}),V=F(e=>{if(e.size===0||E.current)return;E.current=!0;const d=Array.from(e.keys()),b=d.find(S=>S?.hasAttribute(Ae))??null,k=b?e.get(b)?.index??-1:-1;if(k!==-1)g(k);else if(me(d,f,v)){const S=le(d,{disabledIndices:v});ce(d,S)||g(S)}ve(R.current,b,j,r)});Z(()=>{if(v==null||u!=null||!E.current)return;const e=s.current;if(me(e,f,v)){const d=le(e,{disabledIndices:v});ce(e,d)||g(d)}},[v,u,f,s,g]);const L=F((e,d,b)=>i?i(e,d,b,s):b),c=F(e=>{const d=e.key===xe||e.key===Re;if(!tt.has(e.key)||!P&&d||bt(e,O)||!R.current)return;const k=j==="rtl",S=k?Te:Ee,H=k?Ee:Te,$=r==="vertical"?ye:S,U=r==="vertical"?Ie:H,N=he(e.nativeEvent);if(N!=null&&Ce(N)&&!Ge(N)){const q=N.selectionStart,m=N.selectionEnd,B=N.value;if(q==null||e.shiftKey||q!==m||e.key!==U&&q<B.length||e.key!==$&&q>0)return}let h=f;const z=nt(s,v),W=at(s,v);C!=null&&(h=C({disabledIndices:v,elementsRef:s,event:e,highlightedIndex:f,loopFocus:o,maxIndex:W,minIndex:z,onLoop:L,orientation:r,rtl:k}));const K=r!=="vertical"&&e.key===S||r!=="horizontal"&&e.key===ye,J=r!=="vertical"&&e.key===H||r!=="horizontal"&&e.key===Ie;P&&(e.key===xe?h=z:e.key===Re&&(h=W)),h===f&&(K||J)&&(o&&h===W&&K?(h=z,i&&(h=i(e,f,h,s))):o&&h===z&&J?(h=W,i&&(h=i(e,f,h,s))):h=le(s.current,{startingIndex:h,decrement:J,disabledIndices:v})),h!==f&&!ce(s.current,h)&&(w&&e.stopPropagation(),(l||d||K||J)&&e.preventDefault(),g(h,!0),queueMicrotask(()=>{s.current[h]?.focus()}))});return{props:{ref:y,onFocus(e){const d=R.current,b=he(e.nativeEvent);!d||b==null||!Ce(b)||b.setSelectionRange(0,b.value.length)},onKeyDown:c},highlightedIndex:f,onHighlightedIndexChange:g,elementsRef:s,onMapChange:V,relayKeyboardEvent:c}}function bt(t,o){for(const r of st)if(!o.includes(r)&&t.getModifierState(r))return!0;return!1}function ht(t){const{render:o,className:r,style:C,refs:i=ue,props:j=ue,state:u=ze,stateAttributesMapping:A,highlightedIndex:T,onHighlightedIndexChange:P,orientation:w,grid:v,loopFocus:O,onLoop:D,enableHomeAndEndKeys:x,onMapChange:l,stopEventPropagation:R=!0,rootRef:y,disabledIndices:s,modifierKeys:E,highlightItemOnHover:f=!1,tag:g="div",...V}=t,L=qe(),{props:c,highlightedIndex:I,onHighlightedIndexChange:e,elementsRef:d,onMapChange:b,relayKeyboardEvent:k}=gt({grid:v,loopFocus:O,onLoop:D,orientation:w,highlightedIndex:T,onHighlightedIndexChange:P,rootRef:y,stopEventPropagation:R,enableHomeAndEndKeys:x,direction:L,disabledIndices:s,modifierKeys:E}),S=oe(g,t,{state:u,ref:i,props:[c,...j,V],stateAttributesMapping:A}),H=a.useMemo(()=>({highlightedIndex:I,onHighlightedIndexChange:e,highlightItemOnHover:f,relayKeyboardEvent:k}),[I,e,f,k]);return n.jsx(He.Provider,{value:H,children:n.jsx(ke,{elementsRef:d,onMapChange:$=>{l?.($),b($)},children:S})})}const vt=a.forwardRef(function(o,r){const{activateOnFocus:C=!1,className:i,loopFocus:j=!0,render:u,style:A,...T}=o,{orientation:P,setTabMap:w,tabActivationDirection:v}=fe(),[O,D]=a.useState(0),[x,l]=a.useState(null),R=a.useRef(new Set),y=a.useRef(new Set),s=a.useRef(null);Z(()=>{if(typeof ResizeObserver>"u")return;const c=new ResizeObserver(()=>{R.current.forEach(I=>{I()})});return s.current=c,x&&c.observe(x),y.current.forEach(I=>{c.observe(I)}),()=>{c.disconnect(),s.current=null}},[x]);const E=F(c=>(R.current.add(c),()=>{R.current.delete(c)})),f=F(c=>(y.current.add(c),s.current?.observe(c),()=>{y.current.delete(c),s.current?.unobserve(c)})),g={orientation:P,tabActivationDirection:v},V={"aria-orientation":P==="vertical"?"vertical":void 0,role:"tablist"},L=a.useMemo(()=>({activateOnFocus:C,registerIndicatorUpdateListener:E,registerTabResizeObserverElement:f,tabsListElement:x}),[C,E,f,x]);return n.jsx(De.Provider,{value:L,children:n.jsx(ht,{render:u,className:i,style:A,state:g,refs:[r,l],props:[V,T],stateAttributesMapping:ie,highlightedIndex:O,enableHomeAndEndKeys:!0,loopFocus:j,orientation:P,onHighlightedIndexChange:D,onMapChange:w,disabledIndices:ue})})});function mt({className:t,orientation:o="horizontal",...r}){return n.jsx(lt,{"data-slot":"tabs","data-orientation":o,className:re("group/tabs flex gap-2 data-horizontal:flex-col",t),...r})}const xt=Ke("group/tabs-list inline-flex w-fit items-center justify-center rounded-lg p-[3px] text-muted-foreground group-data-horizontal/tabs:h-8 group-data-vertical/tabs:h-fit group-data-vertical/tabs:flex-col data-[variant=line]:rounded-none",{variants:{variant:{default:"bg-muted",line:"gap-1 bg-transparent"}},defaultVariants:{variant:"default"}});function Rt({className:t,variant:o="default",...r}){return n.jsx(vt,{"data-slot":"tabs-list","data-variant":o,className:re(xt({variant:o}),t),...r})}function te({className:t,...o}){return n.jsx(ut,{"data-slot":"tabs-trigger",className:re("relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-1.5 py-0.5 text-sm font-medium whitespace-nowrap text-foreground/60 transition-all group-data-vertical/tabs:w-full group-data-vertical/tabs:justify-start hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1 focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-50 has-data-[icon=inline-end]:pr-1 has-data-[icon=inline-start]:pl-1 aria-disabled:pointer-events-none aria-disabled:opacity-50 dark:text-muted-foreground dark:hover:text-foreground group-data-[variant=default]/tabs-list:data-active:shadow-sm group-data-[variant=line]/tabs-list:data-active:shadow-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4","group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-active:bg-transparent dark:group-data-[variant=line]/tabs-list:data-active:border-transparent dark:group-data-[variant=line]/tabs-list:data-active:bg-transparent","data-active:bg-background data-active:text-foreground dark:data-active:border-input dark:data-active:bg-input/30 dark:data-active:text-foreground","after:absolute after:bg-foreground after:opacity-0 after:transition-opacity group-data-horizontal/tabs:after:inset-x-0 group-data-horizontal/tabs:after:bottom-[-5px] group-data-horizontal/tabs:after:h-0.5 group-data-vertical/tabs:after:inset-y-0 group-data-vertical/tabs:after:-right-1 group-data-vertical/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-active:after:opacity-100",t),...o})}function ne({className:t,...o}){return n.jsx(ft,{"data-slot":"tabs-content",className:re("flex-1 text-sm outline-none",t),...o})}function Ne(t){return`<script src="${location.origin}/snag.js" ${_e("site")}="${t}" defer><\/script>`}function _({code:t,label:o}){const[r,C]=a.useState(!1);return n.jsxs("div",{className:"relative rounded-md border border-border bg-background px-3 py-2.5 pr-11 font-mono text-[12.5px] leading-relaxed",children:[n.jsx("code",{className:"whitespace-pre-wrap break-all",children:t}),n.jsx(Be,{variant:"ghost",size:"icon-sm",className:"absolute right-1.5 top-1.5","aria-label":r?"Copied":o,onClick:()=>{navigator.clipboard?.writeText(t),C(!0),setTimeout(()=>C(!1),1500)},children:r?n.jsx(rt,{}):n.jsx(it,{})})]})}function wt({uid:t}){return n.jsx(_,{code:Ne(t),label:"Copy the tag"})}const se="npm install snagset";function ae({children:t}){return n.jsx("p",{className:"m-0 text-[12.5px] text-muted-foreground",children:t})}function kt({uid:t}){const o=location.origin,r=`host="${o}" site="${t}"`;return n.jsxs(mt,{defaultValue:"html",className:"gap-3",children:[n.jsxs(Rt,{className:"w-full",children:[n.jsx(te,{value:"html",children:"HTML"}),n.jsx(te,{value:"next",children:"Next.js"}),n.jsx(te,{value:"react",children:"React"}),n.jsx(te,{value:"vue",children:"Vue"}),n.jsx(te,{value:"js",children:"JS"})]}),n.jsxs(ne,{value:"html",className:"flex flex-col gap-2",children:[n.jsx(_,{code:Ne(t),label:"Copy the tag"}),n.jsxs(ae,{children:["Paste it before ",n.jsx("code",{className:"font-mono",children:"</body>"})," on every page you want reviewed. On WordPress, Webflow, Framer or Squarespace, put it in the site's footer or custom code setting."]})]}),n.jsxs(ne,{value:"next",className:"flex flex-col gap-2",children:[n.jsx(_,{code:se,label:"Copy the install command"}),n.jsx(_,{code:`// app/layout.tsx
|
|
2
2
|
import { Snagset } from "snagset/next";
|
|
3
3
|
|
|
4
4
|
<body>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as U,r as f,a5 as y,s as v,a6 as j,a2 as S,j as e,B as x,A as w,C as M}from"./index-
|
|
1
|
+
import{d as U,r as f,a5 as y,s as v,a6 as j,a2 as S,j as e,B as x,A as w,C as M}from"./index-jVSWkcSK.js";import{u as L}from"./useQuery-hBVmWzEl.js";import{C as B,E as I,H as K,G as R,I as E,J as P}from"./dialog-CNe7vaQT.js";import{L as k,I as C}from"./label-CzNjVuJl.js";import{C as z}from"./ConfirmDialog-CMhBnMda.js";import{a as N}from"./parts-OimeyxOU.js";import{b as A}from"./labels--UUyt9uB.js";import{u as _}from"./me-HGkftAh1.js";function ee({owner:t}){const r=L(w.instance()),l=U(),s=()=>l.invalidateQueries({queryKey:w.instance().queryKey}),[g,m]=f.useState(!1),[b,p]=f.useState(!1),[h,u]=f.useState(null),d=y({mutationFn:v.disconnectStorage,onSuccess:()=>void s(),onError:c=>j.error(S(c))}),n=y({mutationFn:v.disconnectMail,onSuccess:()=>void s(),onError:c=>j.error(S(c))}),i=y({mutationFn:v.testMail,onSuccess:c=>j.success(`Sent to ${c.to}`),onError:c=>j.error(S(c))}),a=r.data?.storage,o=r.data?.mail;return e.jsxs(e.Fragment,{children:[e.jsxs(N,{title:"Storage",description:"The bucket screenshots and files go to. Without one the widget runs in annotation mode.",children:[!r.data&&e.jsx("p",{className:"m-0 text-[13px] text-muted-foreground",children:r.isError?"Could not read it.":"Reading…"}),a&&e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx(D,{tone:a.connected?"ok":a.unreadable?"bad":"off",text:a.connected?`Connected · ${a.bucket} at ${(a.endpoint??"").replace(/^https?:\/\//,"")}${a.connectedAt?` · since ${A(a.connectedAt)}`:""}`:a.unreadable?"A bucket is stored but its keys will not decrypt — the secret key changed. Connect it again.":"Not connected — annotation mode. Comments and anchors work; screenshots are not offered."}),e.jsx(G,{}),a.source==="env"?e.jsx($,{what:"SNAGSET_STORAGE_S3_*"}):t?e.jsxs("div",{className:"flex gap-2",children:[e.jsx(x,{variant:"outline",size:"sm",onClick:()=>m(!0),children:a.connected||a.unreadable?"Replace…":"Connect a bucket…"}),(a.connected||a.unreadable)&&e.jsx(x,{variant:"ghost",size:"sm",onClick:()=>u("storage"),children:"Disconnect"})]}):null]})]}),e.jsx(N,{title:"Mail",description:"How notifications go out. Without a transport they are off, and the instance says so.",children:o&&e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx(D,{tone:o.configured?"ok":o.unreadable?"bad":"off",text:o.configured?`${o.scheme==="resend"?"Resend":`SMTP · ${o.host??""}`} · from ${o.from}${o.updatedAt?` · since ${A(o.updatedAt)}`:""}`:o.unreadable?"A transport is stored but its secret will not decrypt — the secret key changed. Connect it again.":"No transport — notifications are off."}),o.source==="env"?e.jsx($,{what:"SNAGSET_MAIL_URL"}):t?e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsx(x,{variant:"outline",size:"sm",onClick:()=>p(!0),children:o.configured||o.unreadable?"Replace…":"Connect a transport…"}),o.configured&&e.jsx(x,{variant:"outline",size:"sm",loading:i.isPending,onClick:()=>i.mutate(),children:i.isPending?"Sending…":"Send a test email"}),(o.configured||o.unreadable)&&e.jsx(x,{variant:"ghost",size:"sm",onClick:()=>u("mail"),children:"Disconnect"})]}):(o.configured&&t===!1,null)]})}),e.jsx(O,{open:g,onOpenChange:m,onDone:()=>void s()}),e.jsx(q,{open:b,onOpenChange:p,onDone:()=>void s()}),e.jsx(z,{open:h!==null,onOpenChange:c=>!c&&u(null),title:h==="storage"?"Disconnect the bucket?":"Disconnect the mail transport?",description:h==="storage"?"Screenshots stop being offered. Nothing in the bucket is deleted, and reconnecting the same bucket brings the pictures back.":"Notifications stop going out until a transport is connected again.",confirmLabel:"Disconnect",busy:d.isPending||n.isPending,onConfirm:async()=>{h==="storage"?await d.mutateAsync():await n.mutateAsync(),u(null)}})]})}function T(){const{storage:t}=_().limits;return t.limit===null?null:`${F(t.used)} of ${F(t.limit)} used across the studio's sites.`}function G(){const t=T();return t===null?null:e.jsx("p",{className:"m-0 text-[12px] text-muted-foreground",children:t})}function te(){const t=T();return t===null?null:e.jsx(N,{title:"Storage",description:"Screenshots and files, against the studio's plan.",children:e.jsx("p",{className:"m-0 text-[13px]",children:t})})}function D({tone:t,text:r}){return e.jsxs("p",{className:"m-0 flex items-center gap-2 text-[13px]",children:[e.jsx("span",{className:`size-2 shrink-0 rounded-full ${t==="ok"?"bg-ok":t==="bad"?"bg-destructive":"bg-line-strong"}`,"aria-hidden":"true"}),e.jsx("span",{children:r})]})}function $({what:t}){return e.jsxs("p",{className:"m-0 text-[12px] text-muted-foreground",children:["Set by the environment (",e.jsx("code",{className:"font-mono",children:t}),"). Change it there; the dashboard shows it and does not offer to edit it."]})}function O({open:t,onOpenChange:r,onDone:l}){const[s,g]=f.useState({endpoint:"",bucket:"",region:"",accessKeyId:"",secretAccessKey:"",publicBaseUrl:""}),[m,b]=f.useState(""),p=y({mutationFn:v.connectStorage}),h=n=>i=>g({...s,[n]:i.target.value}),u=async n=>{n.preventDefault(),b("");try{await p.mutateAsync({endpoint:s.endpoint.trim(),bucket:s.bucket.trim(),accessKeyId:s.accessKeyId.trim(),secretAccessKey:s.secretAccessKey,...s.region.trim()?{region:s.region.trim()}:{},...s.publicBaseUrl.trim()?{publicBaseUrl:s.publicBaseUrl.trim()}:{}}),g({endpoint:"",bucket:"",region:"",accessKeyId:"",secretAccessKey:"",publicBaseUrl:""}),r(!1),l(),j.success("Bucket connected — screenshots are on")}catch(i){b(i instanceof M?i.message:"Could not reach the server.")}},d=(n,i,a,o="text",c)=>e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(k,{htmlFor:`st-${n}`,children:i}),e.jsx(C,{id:`st-${n}`,type:o,placeholder:a,value:s[n],onChange:h(n),autoComplete:"off"}),c&&e.jsx("p",{className:"m-0 text-[12px] text-muted-foreground",children:c})]});return e.jsx(B,{open:t,onOpenChange:r,children:e.jsx(I,{children:e.jsxs("form",{onSubmit:n=>void u(n),className:"flex flex-col gap-4",noValidate:!0,children:[e.jsxs(K,{children:[e.jsx(R,{children:"Connect a bucket"}),e.jsx(E,{children:"Any S3-compatible bucket. It is probed — write, read, delete — before anything is saved, and the keys are stored encrypted with this instance's secret key."})]}),m&&e.jsx("p",{role:"alert",className:"m-0 rounded-md border border-destructive/40 bg-warn-soft px-3 py-2 text-[13px] text-destructive",children:m}),d("endpoint","Endpoint","https://ams3.digitaloceanspaces.com"),d("bucket","Bucket","snagset"),d("region","Region","auto","text","Leave empty for providers that do not use one."),d("accessKeyId","Access key ID",""),d("secretAccessKey","Secret access key","","password"),d("publicBaseUrl","Public base URL","","text","Optional — only if the bucket is served from a CDN address."),e.jsxs(P,{children:[e.jsx(x,{type:"button",variant:"outline",onClick:()=>r(!1),children:"Cancel"}),e.jsx(x,{type:"submit",loading:p.isPending,children:p.isPending?"Probing…":"Connect"})]})]})})})}function q({open:t,onOpenChange:r,onDone:l}){const[s,g]=f.useState(""),[m,b]=f.useState(""),[p,h]=f.useState(""),u=y({mutationFn:v.connectMail}),d=async n=>{n.preventDefault(),h("");try{await u.mutateAsync({url:s.trim(),from:m.trim()}),g(""),b(""),r(!1),l(),j.success("Transport connected — send a test email to be sure")}catch(i){h(i instanceof M?i.message:"Could not reach the server.")}};return e.jsx(B,{open:t,onOpenChange:r,children:e.jsx(I,{children:e.jsxs("form",{onSubmit:n=>void d(n),className:"flex flex-col gap-4",noValidate:!0,children:[e.jsxs(K,{children:[e.jsx(R,{children:"Connect a mail transport"}),e.jsx(E,{children:"Resend is the easy one — the provider owns SPF and DKIM. SMTP works with any provider. The URL is stored encrypted with this instance's secret key."})]}),p&&e.jsx("p",{role:"alert",className:"m-0 rounded-md border border-destructive/40 bg-warn-soft px-3 py-2 text-[13px] text-destructive",children:p}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(k,{htmlFor:"mail-url",children:"Transport"}),e.jsx(C,{id:"mail-url",type:"password",placeholder:"resend://re_… or smtp://user:pass@host:587",value:s,onChange:n=>g(n.target.value),autoComplete:"off"})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(k,{htmlFor:"mail-from",children:"From"}),e.jsx(C,{id:"mail-from",placeholder:"Snagset <review@kilnwork.studio>",value:m,onChange:n=>b(n.target.value)}),e.jsx("p",{className:"m-0 text-[12px] text-muted-foreground",children:"The address every notification is sent from. Resend needs a verified domain for it."})]}),e.jsxs(P,{children:[e.jsx(x,{type:"button",variant:"outline",onClick:()=>r(!1),children:"Cancel"}),e.jsx(x,{type:"submit",loading:u.isPending,disabled:!s.trim()||!m.trim(),children:u.isPending?"Saving…":"Connect"})]})]})})})}function F(t){const r=["B","KB","MB","GB","TB"];let l=t,s=0;for(;l>=1024&&s<r.length-1;)l/=1024,s+=1;return`${s===0?l:l.toFixed(l>=10?0:1)} ${r[s]}`}export{ee as I,te as S,F as b};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as L,r as p,a5 as R,j as e,$ as J,B as b,a6 as A,a2 as D,A as E,s as T,a8 as Q,C as G}from"./index-Bjyhj6ZB.js";import{u as H}from"./useQuery-ClGE3W7i.js";import{B as M}from"./badge-BaViqDz3.js";import{C as O,E as F,H as _,G as $,I as B,J as I}from"./dialog-CbKDGxpa.js";import{L as C,I as K}from"./label-C3zh-elW.js";import{S as z}from"./switch-ByUmW5H2.js";import{C as W}from"./ConfirmDialog-CKQ2LE2m.js";import{C as w}from"./CopyButton-Et1g5isE.js";import{a as U}from"./parts-DoQ2TEp-.js";import{b as Y}from"./labels--UUyt9uB.js";function ce({owner:n,instanceOwner:i,operator:g,sites:v,mine:h=!1}){const o=L(),a=H(E.mcpTokens()),[x,u]=p.useState(!1),[l,m]=p.useState(null),[c,f]=p.useState(null),k=R({mutationFn:t=>T.revokeMcpToken(t),onSuccess:()=>{f(null),o.invalidateQueries({queryKey:["mcp-tokens"]})},onError:t=>A.error(D(t))}),j=a.data?.data??[],N=j.filter(t=>!t.revokedAt),d=a.data?.http??null,y=R({mutationFn:t=>T.setMcpHttp(t),onSuccess:(t,s)=>{o.setQueryData(E.instance().queryKey,t),o.invalidateQueries({queryKey:["mcp-tokens"]}),A.success(s?"Remote transport on — the token dialog shows its config":"Remote transport off — the endpoint answers 404 again")},onError:t=>A.error(D(t))}),S=t=>{const s=new Set(t),r=s.has("comments:write")||s.has("threads:write");return!r&&!s.has("context:read")?"Read-only":r?`Writes: ${[s.has("comments:write")?"reply":"",s.has("threads:write")?"mark ready":""].filter(Boolean).join(", ")}`:"Read-only, with capture context"};return e.jsxs(U,{title:h?"Your agent tokens":"MCP",description:"A coding agent — Claude Code, Cursor, any MCP client — reads the same brief this dashboard copies, maps a comment to the file in its checkout, and can reply or mark a fix ready. It never resolves: whoever reported a snag decides when it is fixed. A token per agent, shown once, revocable here.",children:[a.isPending&&e.jsx(J,{rows:2}),d&&e.jsxs("div",{className:"flex items-center justify-between gap-4 rounded-md border border-border px-3 py-2.5",children:[e.jsxs("div",{children:[e.jsx(C,{htmlFor:"mcp-http-on",className:"text-[13px] font-medium",children:"Remote transport"}),e.jsxs("p",{className:"m-0 mt-0.5 text-[12px] leading-normal text-muted-foreground",children:[d.enabled?e.jsxs(e.Fragment,{children:["On. An agent anywhere talks to this studio at ",e.jsx("code",{className:"font-mono text-[11.5px]",children:d.url})," with a token as a bearer. No source mapping there; a write needs a token minted for it."]}):e.jsxs(e.Fragment,{children:["Off. Agents reach this studio only from a machine with the checkout. On, ",e.jsx("code",{className:"font-mono text-[11.5px]",children:d.url})," serves the same tools to an agent anywhere, with a token as a bearer."]}),d.source==="env"?" Set by the environment (SNAGSET_MCP_HTTP_ENABLED).":i?"":g?" Only an owner can switch it.":" Only whoever runs this server can switch it."]})]}),e.jsx(z,{id:"mcp-http-on","aria-label":"Remote transport",checked:d.enabled,disabled:!i||d.source==="env"||y.isPending,onCheckedChange:t=>y.mutate(t)})]}),a.isSuccess&&N.length===0&&e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(M,{variant:"outline",children:"No tokens"}),e.jsx("span",{className:"text-[13px] text-muted-foreground",children:h?"You have no agent tokens yet.":"No agent can read this studio yet."})]}),j.length>0&&e.jsx("ul",{className:"m-0 flex list-none flex-col gap-2 p-0","aria-label":"Agent tokens",children:j.map(t=>e.jsxs("li",{className:`flex flex-wrap items-center gap-x-3 gap-y-1 rounded-md border border-border px-3 py-2.5 text-[13px] ${t.revokedAt?"opacity-60":""}`,children:[e.jsx("span",{className:"font-medium",children:t.name}),e.jsxs("code",{className:"font-mono text-[12.5px] text-muted-foreground",children:[t.prefix,"…"]}),e.jsx(M,{variant:"outline",className:t.revokedAt?"":"border-ok text-ok",children:t.revokedAt?"Revoked":S(t.scopes)}),e.jsxs("span",{className:"text-[12px] text-muted-foreground",children:[t.site?t.site.name:"All sites"," · ",t.lastUsedAt?`last used ${Y(t.lastUsedAt)}`:"never used",t.expiresAt&&!t.revokedAt?` · expires ${new Date(t.expiresAt).toLocaleDateString()}`:"",t.createdBy?` · by ${t.createdBy}`:""]}),t.canRevoke&&e.jsx("span",{className:"ml-auto flex gap-1",children:e.jsx(b,{variant:"ghost",size:"sm",onClick:()=>f(t),children:"Revoke"})})]},t.id))}),n&&e.jsx("div",{children:e.jsx(b,{variant:"outline",size:"sm",onClick:()=>u(!0),children:"New token…"})}),e.jsx(V,{open:x,onOpenChange:u,sites:v,http:a.data?.http??null,onDone:t=>{o.invalidateQueries({queryKey:["mcp-tokens"]}),m(t)}}),e.jsx(X,{state:l,http:a.data?.http??null,onClose:()=>m(null)}),e.jsx(W,{open:c!==null,onOpenChange:t=>!t&&f(null),title:`Revoke “${c?.name??""}”?`,description:e.jsx(e.Fragment,{children:"The agent holding it loses access on its next request. Its past replies stay, under its name. This cannot be undone — mint a new token instead."}),confirmLabel:"Revoke",busy:k.isPending,onConfirm:async()=>{c&&await k.mutateAsync(c.id)}})]})}function V({open:n,onOpenChange:i,sites:g,http:v,onDone:h}){const[o,a]=p.useState(""),[x,u]=p.useState(""),[l,m]=p.useState(["threads:read","source:map"]),[c,f]=p.useState(""),[k,j]=p.useState(!1),[N,d]=p.useState(""),y=R({mutationFn:()=>T.mintMcpToken({name:o.trim(),...x?{site:x}:{},scopes:l,...c?{expiresInDays:Number(c)}:{},...k?{allowRemoteWrites:!0}:{}})}),S=(s,r)=>m(P=>r?[...new Set([...P,s])]:P.filter(q=>q!==s)),t=async s=>{s.preventDefault(),d("");try{const r=await y.mutateAsync();a(""),u(""),m(["threads:read","source:map"]),f(""),j(!1),i(!1),h(r)}catch(r){d(r instanceof G?r.message:"Could not reach the server.")}};return e.jsx(O,{open:n,onOpenChange:i,children:e.jsx(F,{children:e.jsxs("form",{onSubmit:s=>void t(s),className:"flex flex-col gap-4",noValidate:!0,children:[e.jsxs(_,{children:[e.jsx($,{children:"New agent token"}),e.jsx(B,{children:"Read-only by default, plus mapping a comment to a file in the agent's own checkout. Tick more only for an agent you want writing here — and it still cannot resolve anything."})]}),N&&e.jsx("p",{role:"alert",className:"m-0 rounded-md border border-destructive/40 bg-warn-soft px-3 py-2 text-[13px] text-destructive",children:N}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(C,{htmlFor:"mcp-name",children:"Name"}),e.jsx(K,{id:"mcp-name",placeholder:"Claude Code",value:o,onChange:s=>a(s.target.value),autoComplete:"off",maxLength:80}),e.jsx("p",{className:"m-0 text-[12px] text-muted-foreground",children:"What a client sees on the agent's replies, so name the agent, not the person."})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(C,{htmlFor:"mcp-site",children:"Site"}),e.jsxs("select",{id:"mcp-site",value:x,onChange:s=>u(s.target.value),className:"h-8 rounded-md border border-input bg-background px-2.5 text-[13px]",children:[e.jsx("option",{value:"",children:"All sites"}),g.map(s=>e.jsx("option",{value:s.uid,children:s.name},s.uid))]})]}),e.jsxs("fieldset",{className:"m-0 flex flex-col gap-2 border-0 p-0",children:[e.jsx("legend",{className:"mb-1 text-[13px] font-medium",children:"Scopes"}),Q.map(s=>e.jsxs("label",{className:"flex cursor-pointer items-start gap-2.5 text-[13px]",children:[e.jsx("input",{type:"checkbox",className:"mt-0.5",checked:l.includes(s.scope),onChange:r=>S(s.scope,r.target.checked)}),e.jsxs("span",{children:[e.jsx("span",{className:"block font-medium",children:s.label}),e.jsx("span",{className:"block text-[12px] text-muted-foreground",children:s.hint})]})]},s.scope))]}),v?.enabled&&(l.includes("comments:write")||l.includes("threads:write"))&&e.jsxs("label",{className:"flex cursor-pointer items-start gap-2.5 text-[13px]",children:[e.jsx("input",{type:"checkbox",className:"mt-0.5",checked:k,onChange:s=>j(s.target.checked)}),e.jsxs("span",{children:[e.jsx("span",{className:"block font-medium",children:"May write over the remote transport"}),e.jsx("span",{className:"block text-[12px] text-muted-foreground",children:"Off by default. Over POST /mcp the agent is not on a machine you can see; a write there is a decision."})]})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(C,{htmlFor:"mcp-expires",children:"Expires"}),e.jsxs("select",{id:"mcp-expires",value:c,onChange:s=>f(s.target.value),className:"h-8 rounded-md border border-input bg-background px-2.5 text-[13px]",children:[e.jsx("option",{value:"",children:"Never"}),e.jsx("option",{value:"30",children:"In 30 days"}),e.jsx("option",{value:"90",children:"In 90 days"}),e.jsx("option",{value:"365",children:"In a year"})]})]}),e.jsxs(I,{children:[e.jsx(b,{type:"button",variant:"outline",onClick:()=>i(!1),children:"Cancel"}),e.jsx(b,{type:"submit",loading:y.isPending,disabled:!o.trim()||l.length===0,children:y.isPending?"Minting…":"Create token"})]})]})})})}function X({state:n,http:i,onClose:g}){const v=typeof location<"u"?location.origin:"",h={SNAGSET_MCP_TOKEN:n?.secret??"",SNAGSET_MCP_HOST:v,...n?.token.site?{SNAGSET_MCP_PROJECT:n.token.site.uid}:{}},o=JSON.stringify({mcpServers:{snagset:{command:"npx",args:["-y","@snagset/mcp"],env:h}}},null,2),a=["claude mcp add snagset",...Object.entries(h).map(([m,c])=>`-e ${m}=${c}`),"--","npx -y @snagset/mcp"].join(" "),x=`Bearer ${n?.secret??""}`,u=["claude mcp add","--transport http","snagset",i?.url??"",`--header "Authorization: ${x}"`].join(" "),l=JSON.stringify({mcpServers:{snagset:{type:"http",url:i?.url??"",headers:{Authorization:x}}}},null,2);return e.jsx(O,{open:n!==null,onOpenChange:m=>!m&&g(),children:e.jsxs(F,{className:"sm:max-w-xl",children:[e.jsxs(_,{children:[e.jsxs($,{children:["Token for “",n?.token.name??"","”"]}),e.jsx(B,{children:"Shown this once — only its hash is stored. Put it in the agent's config, then start the agent from the site's checkout so it can map comments to files."})]}),n&&e.jsxs("div",{className:"flex flex-col gap-4 text-[13px]",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("code",{className:"min-w-0 flex-1 truncate rounded-md bg-muted px-2 py-1.5 font-mono text-[12px]","data-testid":"mcp-token",children:n.secret}),e.jsx(w,{text:n.secret,label:"Copy the token"})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"font-medium",children:"Claude Code"}),e.jsx(w,{text:a,label:"Copy the Claude Code command"})]}),e.jsx("pre",{className:"m-0 whitespace-pre-wrap break-all rounded-md bg-muted px-3 py-2 font-mono text-[12px]",children:a})]}),i?.enabled&&e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"font-medium",children:"Remote — an agent that is not on a machine with the checkout"}),e.jsx(w,{text:l,label:"Copy the remote config"})]}),e.jsx("pre",{className:"m-0 whitespace-pre-wrap break-all rounded-md bg-muted px-3 py-2 font-mono text-[12px]",children:u}),e.jsx("pre",{className:"m-0 overflow-x-auto rounded-md bg-muted px-3 py-2 font-mono text-[12px]",children:l}),e.jsx("p",{className:"m-0 text-[12px] text-muted-foreground",children:"No source mapping there — nothing to search. Writes need the token minted with remote writes allowed."})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"font-medium",children:"Cursor, Claude Desktop, any MCP client"}),e.jsx(w,{text:o,label:"Copy the JSON config"})]}),e.jsx("pre",{className:"m-0 overflow-x-auto rounded-md bg-muted px-3 py-2 font-mono text-[12px]",children:o}),e.jsx("p",{className:"m-0 text-[12px] text-muted-foreground",children:"Cursor reads it from .cursor/mcp.json in the project; Claude Desktop from its claude_desktop_config.json."})]})]}),e.jsx(I,{children:e.jsx(b,{type:"button",onClick:g,children:"Done"})})]})})}export{ce as M};
|
|
1
|
+
import{d as L,r as p,a5 as R,j as e,$ as J,B as b,a6 as A,a2 as D,A as E,s as T,a9 as Q,C as G}from"./index-jVSWkcSK.js";import{u as H}from"./useQuery-hBVmWzEl.js";import{B as M}from"./badge-ixRisPgI.js";import{C as O,E as F,H as _,G as $,I as B,J as I}from"./dialog-CNe7vaQT.js";import{L as C,I as K}from"./label-CzNjVuJl.js";import{S as z}from"./switch-BCvzokd6.js";import{C as W}from"./ConfirmDialog-CMhBnMda.js";import{C as w}from"./CopyButton-BeKLr-HL.js";import{a as U}from"./parts-OimeyxOU.js";import{b as Y}from"./labels--UUyt9uB.js";function ce({owner:n,instanceOwner:i,operator:g,sites:v,mine:h=!1}){const o=L(),a=H(E.mcpTokens()),[x,u]=p.useState(!1),[l,m]=p.useState(null),[c,f]=p.useState(null),k=R({mutationFn:t=>T.revokeMcpToken(t),onSuccess:()=>{f(null),o.invalidateQueries({queryKey:["mcp-tokens"]})},onError:t=>A.error(D(t))}),j=a.data?.data??[],N=j.filter(t=>!t.revokedAt),d=a.data?.http??null,y=R({mutationFn:t=>T.setMcpHttp(t),onSuccess:(t,s)=>{o.setQueryData(E.instance().queryKey,t),o.invalidateQueries({queryKey:["mcp-tokens"]}),A.success(s?"Remote transport on — the token dialog shows its config":"Remote transport off — the endpoint answers 404 again")},onError:t=>A.error(D(t))}),S=t=>{const s=new Set(t),r=s.has("comments:write")||s.has("threads:write");return!r&&!s.has("context:read")?"Read-only":r?`Writes: ${[s.has("comments:write")?"reply":"",s.has("threads:write")?"mark ready":""].filter(Boolean).join(", ")}`:"Read-only, with capture context"};return e.jsxs(U,{title:h?"Your agent tokens":"MCP",description:"A coding agent — Claude Code, Cursor, any MCP client — reads the same brief this dashboard copies, maps a comment to the file in its checkout, and can reply or mark a fix ready. It never resolves: whoever reported a snag decides when it is fixed. A token per agent, shown once, revocable here.",children:[a.isPending&&e.jsx(J,{rows:2}),d&&e.jsxs("div",{className:"flex items-center justify-between gap-4 rounded-md border border-border px-3 py-2.5",children:[e.jsxs("div",{children:[e.jsx(C,{htmlFor:"mcp-http-on",className:"text-[13px] font-medium",children:"Remote transport"}),e.jsxs("p",{className:"m-0 mt-0.5 text-[12px] leading-normal text-muted-foreground",children:[d.enabled?e.jsxs(e.Fragment,{children:["On. An agent anywhere talks to this studio at ",e.jsx("code",{className:"font-mono text-[11.5px]",children:d.url})," with a token as a bearer. No source mapping there; a write needs a token minted for it."]}):e.jsxs(e.Fragment,{children:["Off. Agents reach this studio only from a machine with the checkout. On, ",e.jsx("code",{className:"font-mono text-[11.5px]",children:d.url})," serves the same tools to an agent anywhere, with a token as a bearer."]}),d.source==="env"?" Set by the environment (SNAGSET_MCP_HTTP_ENABLED).":i?"":g?" Only an owner can switch it.":" Only whoever runs this server can switch it."]})]}),e.jsx(z,{id:"mcp-http-on","aria-label":"Remote transport",checked:d.enabled,disabled:!i||d.source==="env"||y.isPending,onCheckedChange:t=>y.mutate(t)})]}),a.isSuccess&&N.length===0&&e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(M,{variant:"outline",children:"No tokens"}),e.jsx("span",{className:"text-[13px] text-muted-foreground",children:h?"You have no agent tokens yet.":"No agent can read this studio yet."})]}),j.length>0&&e.jsx("ul",{className:"m-0 flex list-none flex-col gap-2 p-0","aria-label":"Agent tokens",children:j.map(t=>e.jsxs("li",{className:`flex flex-wrap items-center gap-x-3 gap-y-1 rounded-md border border-border px-3 py-2.5 text-[13px] ${t.revokedAt?"opacity-60":""}`,children:[e.jsx("span",{className:"font-medium",children:t.name}),e.jsxs("code",{className:"font-mono text-[12.5px] text-muted-foreground",children:[t.prefix,"…"]}),e.jsx(M,{variant:"outline",className:t.revokedAt?"":"border-ok text-ok",children:t.revokedAt?"Revoked":S(t.scopes)}),e.jsxs("span",{className:"text-[12px] text-muted-foreground",children:[t.site?t.site.name:"All sites"," · ",t.lastUsedAt?`last used ${Y(t.lastUsedAt)}`:"never used",t.expiresAt&&!t.revokedAt?` · expires ${new Date(t.expiresAt).toLocaleDateString()}`:"",t.createdBy?` · by ${t.createdBy}`:""]}),t.canRevoke&&e.jsx("span",{className:"ml-auto flex gap-1",children:e.jsx(b,{variant:"ghost",size:"sm",onClick:()=>f(t),children:"Revoke"})})]},t.id))}),n&&e.jsx("div",{children:e.jsx(b,{variant:"outline",size:"sm",onClick:()=>u(!0),children:"New token…"})}),e.jsx(V,{open:x,onOpenChange:u,sites:v,http:a.data?.http??null,onDone:t=>{o.invalidateQueries({queryKey:["mcp-tokens"]}),m(t)}}),e.jsx(X,{state:l,http:a.data?.http??null,onClose:()=>m(null)}),e.jsx(W,{open:c!==null,onOpenChange:t=>!t&&f(null),title:`Revoke “${c?.name??""}”?`,description:e.jsx(e.Fragment,{children:"The agent holding it loses access on its next request. Its past replies stay, under its name. This cannot be undone — mint a new token instead."}),confirmLabel:"Revoke",busy:k.isPending,onConfirm:async()=>{c&&await k.mutateAsync(c.id)}})]})}function V({open:n,onOpenChange:i,sites:g,http:v,onDone:h}){const[o,a]=p.useState(""),[x,u]=p.useState(""),[l,m]=p.useState(["threads:read","source:map"]),[c,f]=p.useState(""),[k,j]=p.useState(!1),[N,d]=p.useState(""),y=R({mutationFn:()=>T.mintMcpToken({name:o.trim(),...x?{site:x}:{},scopes:l,...c?{expiresInDays:Number(c)}:{},...k?{allowRemoteWrites:!0}:{}})}),S=(s,r)=>m(P=>r?[...new Set([...P,s])]:P.filter(q=>q!==s)),t=async s=>{s.preventDefault(),d("");try{const r=await y.mutateAsync();a(""),u(""),m(["threads:read","source:map"]),f(""),j(!1),i(!1),h(r)}catch(r){d(r instanceof G?r.message:"Could not reach the server.")}};return e.jsx(O,{open:n,onOpenChange:i,children:e.jsx(F,{children:e.jsxs("form",{onSubmit:s=>void t(s),className:"flex flex-col gap-4",noValidate:!0,children:[e.jsxs(_,{children:[e.jsx($,{children:"New agent token"}),e.jsx(B,{children:"Read-only by default, plus mapping a comment to a file in the agent's own checkout. Tick more only for an agent you want writing here — and it still cannot resolve anything."})]}),N&&e.jsx("p",{role:"alert",className:"m-0 rounded-md border border-destructive/40 bg-warn-soft px-3 py-2 text-[13px] text-destructive",children:N}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(C,{htmlFor:"mcp-name",children:"Name"}),e.jsx(K,{id:"mcp-name",placeholder:"Claude Code",value:o,onChange:s=>a(s.target.value),autoComplete:"off",maxLength:80}),e.jsx("p",{className:"m-0 text-[12px] text-muted-foreground",children:"What a client sees on the agent's replies, so name the agent, not the person."})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(C,{htmlFor:"mcp-site",children:"Site"}),e.jsxs("select",{id:"mcp-site",value:x,onChange:s=>u(s.target.value),className:"h-8 rounded-md border border-input bg-background px-2.5 text-[13px]",children:[e.jsx("option",{value:"",children:"All sites"}),g.map(s=>e.jsx("option",{value:s.uid,children:s.name},s.uid))]})]}),e.jsxs("fieldset",{className:"m-0 flex flex-col gap-2 border-0 p-0",children:[e.jsx("legend",{className:"mb-1 text-[13px] font-medium",children:"Scopes"}),Q.map(s=>e.jsxs("label",{className:"flex cursor-pointer items-start gap-2.5 text-[13px]",children:[e.jsx("input",{type:"checkbox",className:"mt-0.5",checked:l.includes(s.scope),onChange:r=>S(s.scope,r.target.checked)}),e.jsxs("span",{children:[e.jsx("span",{className:"block font-medium",children:s.label}),e.jsx("span",{className:"block text-[12px] text-muted-foreground",children:s.hint})]})]},s.scope))]}),v?.enabled&&(l.includes("comments:write")||l.includes("threads:write"))&&e.jsxs("label",{className:"flex cursor-pointer items-start gap-2.5 text-[13px]",children:[e.jsx("input",{type:"checkbox",className:"mt-0.5",checked:k,onChange:s=>j(s.target.checked)}),e.jsxs("span",{children:[e.jsx("span",{className:"block font-medium",children:"May write over the remote transport"}),e.jsx("span",{className:"block text-[12px] text-muted-foreground",children:"Off by default. Over POST /mcp the agent is not on a machine you can see; a write there is a decision."})]})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(C,{htmlFor:"mcp-expires",children:"Expires"}),e.jsxs("select",{id:"mcp-expires",value:c,onChange:s=>f(s.target.value),className:"h-8 rounded-md border border-input bg-background px-2.5 text-[13px]",children:[e.jsx("option",{value:"",children:"Never"}),e.jsx("option",{value:"30",children:"In 30 days"}),e.jsx("option",{value:"90",children:"In 90 days"}),e.jsx("option",{value:"365",children:"In a year"})]})]}),e.jsxs(I,{children:[e.jsx(b,{type:"button",variant:"outline",onClick:()=>i(!1),children:"Cancel"}),e.jsx(b,{type:"submit",loading:y.isPending,disabled:!o.trim()||l.length===0,children:y.isPending?"Minting…":"Create token"})]})]})})})}function X({state:n,http:i,onClose:g}){const v=typeof location<"u"?location.origin:"",h={SNAGSET_MCP_TOKEN:n?.secret??"",SNAGSET_MCP_HOST:v,...n?.token.site?{SNAGSET_MCP_PROJECT:n.token.site.uid}:{}},o=JSON.stringify({mcpServers:{snagset:{command:"npx",args:["-y","@snagset/mcp"],env:h}}},null,2),a=["claude mcp add snagset",...Object.entries(h).map(([m,c])=>`-e ${m}=${c}`),"--","npx -y @snagset/mcp"].join(" "),x=`Bearer ${n?.secret??""}`,u=["claude mcp add","--transport http","snagset",i?.url??"",`--header "Authorization: ${x}"`].join(" "),l=JSON.stringify({mcpServers:{snagset:{type:"http",url:i?.url??"",headers:{Authorization:x}}}},null,2);return e.jsx(O,{open:n!==null,onOpenChange:m=>!m&&g(),children:e.jsxs(F,{className:"sm:max-w-xl",children:[e.jsxs(_,{children:[e.jsxs($,{children:["Token for “",n?.token.name??"","”"]}),e.jsx(B,{children:"Shown this once — only its hash is stored. Put it in the agent's config, then start the agent from the site's checkout so it can map comments to files."})]}),n&&e.jsxs("div",{className:"flex flex-col gap-4 text-[13px]",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("code",{className:"min-w-0 flex-1 truncate rounded-md bg-muted px-2 py-1.5 font-mono text-[12px]","data-testid":"mcp-token",children:n.secret}),e.jsx(w,{text:n.secret,label:"Copy the token"})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"font-medium",children:"Claude Code"}),e.jsx(w,{text:a,label:"Copy the Claude Code command"})]}),e.jsx("pre",{className:"m-0 whitespace-pre-wrap break-all rounded-md bg-muted px-3 py-2 font-mono text-[12px]",children:a})]}),i?.enabled&&e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"font-medium",children:"Remote — an agent that is not on a machine with the checkout"}),e.jsx(w,{text:l,label:"Copy the remote config"})]}),e.jsx("pre",{className:"m-0 whitespace-pre-wrap break-all rounded-md bg-muted px-3 py-2 font-mono text-[12px]",children:u}),e.jsx("pre",{className:"m-0 overflow-x-auto rounded-md bg-muted px-3 py-2 font-mono text-[12px]",children:l}),e.jsx("p",{className:"m-0 text-[12px] text-muted-foreground",children:"No source mapping there — nothing to search. Writes need the token minted with remote writes allowed."})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"font-medium",children:"Cursor, Claude Desktop, any MCP client"}),e.jsx(w,{text:o,label:"Copy the JSON config"})]}),e.jsx("pre",{className:"m-0 overflow-x-auto rounded-md bg-muted px-3 py-2 font-mono text-[12px]",children:o}),e.jsx("p",{className:"m-0 text-[12px] text-muted-foreground",children:"Cursor reads it from .cursor/mcp.json in the project; Claude Desktop from its claude_desktop_config.json."})]})]}),e.jsx(I,{children:e.jsx(b,{type:"button",onClick:g,children:"Done"})})]})})}export{ce as M};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r,j as e,
|
|
1
|
+
import{r,j as e,b3 as o}from"./index-jVSWkcSK.js";function l({saving:s,savedAt:t}){const[i,a]=r.useState(!1);return r.useEffect(()=>{if(!t)return;a(!0);const n=setTimeout(()=>a(!1),1800);return()=>clearTimeout(n)},[t]),s?e.jsxs("span",{className:"inline-flex items-center gap-1.5 text-[12.5px] text-muted-foreground","aria-live":"polite",children:[e.jsx(o,{className:"size-3.5 animate-spin","aria-hidden":"true"}),"Saving"]}):e.jsx("span",{className:"text-[12.5px] text-muted-foreground","aria-live":"polite",children:i?"Saved":""})}export{l as S};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e,u as n,G as a,B as r}from"./index-
|
|
1
|
+
import{j as e,u as n,G as a,B as r}from"./index-jVSWkcSK.js";function i({error:s}){const t=n(),o=s instanceof Error?s.message:"Something went wrong.";return e.jsx(a,{children:e.jsxs("div",{className:"flex flex-col items-start gap-3",children:[e.jsx("h1",{className:"m-0 text-lg font-semibold",children:"Could not load the dashboard"}),e.jsx("p",{className:"m-0 text-muted-foreground",children:o}),e.jsx(r,{variant:"outline",size:"sm",onClick:()=>void t.invalidate(),children:"Try again"})]})})}const m=({error:s})=>e.jsx(i,{error:s});export{m as errorComponent};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{u as ft,a as xt,b as mt,c as O,d as je,r as o,e as L,f as ce,g as bt,j as e,B as Z,h as w,i as ne,m as ye,E as vt,k as Se,l as fe,n as jt,o as yt,p as ae,q as K,S as St,s as ee,t as $e,v as wt,L as _,w as Nt,M as Ct,x as kt,y as Tt,z as Pt,A as Be,O as Rt}from"./index-
|
|
1
|
+
import{u as ft,a as xt,b as mt,c as O,d as je,r as o,e as L,f as ce,g as bt,j as e,B as Z,h as w,i as ne,m as ye,E as vt,k as Se,l as fe,n as jt,o as yt,p as ae,q as K,S as St,s as ee,t as $e,v as wt,L as _,w as Nt,M as Ct,x as kt,y as Tt,z as Pt,A as Be,O as Rt}from"./index-jVSWkcSK.js";import{u as we}from"./useQuery-hBVmWzEl.js";import{T as Mt,i as Fe,a as Et,D as Ot,b as Dt,c as It,X as At,d as _t,e as zt,f as Ht,g as Lt,R as $t,p as Bt,h as Ft,j as Ut,k as qt,P as Gt,l as Vt,u as Kt,m as Yt,n as Wt,o as Xt,q as Qt,r as Jt,s as Zt,t as es,v as ts,w as ss,x as ns,y as as,z as rs,F as os,A as is,B as ls,C as Ue,E as qe,G as Ge,H as ds,I as cs,J as us}from"./dialog-CNe7vaQT.js";import{c as B,n as Ve,g as ps,a as xe,t as gs,d as hs,i as fs,u as xs,b as ue,L as ms,I as bs}from"./label-CzNjVuJl.js";import{g as me,u as vs,a as js,b as ys,s as Ss,c as ws,d as Ns,S as Ke,E as J,D as re,e as oe,f as ie,h as Ne,i as te,j as I,k as V,l as Cs,m as pe}from"./dropdown-menu-Co_KnEvk.js";import{u as ks,a as Ts,g as Ps,A as Rs,b as Ms}from"./avatar-3CJf9_jk.js";import{u as Es}from"./inertValue-D5-xyRX6.js";import{u as Ye}from"./useRender-mrNZQnpJ.js";import{S as Os,i as Ds,a as Is}from"./labels--UUyt9uB.js";import{u as le}from"./me-HGkftAh1.js";import{L as se}from"./layout-grid-804CjQp4.js";import{U as be}from"./users-Dhqkqlui.js";import{c as As}from"./update-duXzIzFS.js";import{P as We}from"./plus-JDUOLC5V.js";import{M as _s,S as zs,a as Hs}from"./sun-i-qGe4pR.js";import"./useBaseQuery-CDoR88Fa.js";import"./check-oVlGjqlI.js";import"./CompositeList-B4njw0mu.js";import"./CompositeItem-DTWd-USH.js";import"./useCompositeItem-MHMarTaJ.js";import"./useValueChanged-ERXEloZc.js";function Ls(t){const s=ft({warn:t?.router===void 0}),n=t?.router||s;return xt(n.stores.__store,mt(t,n))}/**
|
|
2
2
|
* @license lucide-react v1.39.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Y as g,Z as f,_ as p,p as v,j as e,B as m,$ as N,L as j,a0 as P}from"./index-
|
|
1
|
+
import{Y as g,Z as f,_ as p,p as v,j as e,B as m,$ as N,L as j,a0 as P}from"./index-jVSWkcSK.js";import{Q as y,u as b}from"./useBaseQuery-CDoR88Fa.js";import{P as w,S}from"./parts-OimeyxOU.js";import{b as R,c as E,S as k}from"./labels--UUyt9uB.js";import{u as F}from"./me-HGkftAh1.js";import"./card-VzmwyX4K.js";var M=class extends y{constructor(s,r){super(s,r)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(s){s._type="infinite",super.setOptions(s)}getOptimisticResult(s){return s._type="infinite",super.getOptimisticResult(s)}fetchNextPage(s){return this.fetch({...s,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(s){return this.fetch({...s,meta:{fetchMore:{direction:"backward"}}})}createResult(s,r){const{state:i}=s,l=super.createResult(s,r),{isFetching:o,isRefetching:n,isError:u,isRefetchError:d}=l,t=i.fetchMeta?.fetchMore?.direction,c=u&&t==="forward",a=o&&t==="forward",h=u&&t==="backward",x=o&&t==="backward";return{...l,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:f(r,i.data),hasPreviousPage:g(r,i.data),isFetchNextPageError:c,isFetchingNextPage:a,isFetchPreviousPageError:h,isFetchingPreviousPage:x,isRefetchError:d&&!c&&!h,isRefetching:n&&!a&&!x}}};function A(s,r){return b(s,M)}const C=[{value:"unresolved",label:"Needs attention"},...E.map(s=>({value:s,label:k[s]})),{value:"all",label:"Everything"}];function D(s,r=new Date){const i=new Date(s),l=n=>new Date(n.getFullYear(),n.getMonth(),n.getDate()).getTime(),o=Math.round((l(r)-l(i))/864e5);return o<=0?"Today":o===1?"Yesterday":o<7?i.toLocaleDateString(void 0,{weekday:"long"}):i.toLocaleDateString(void 0,{day:"numeric",month:"long"})}function I(){const s=F(),{status:r="unresolved",site:i}=p.useSearch(),l=v({from:"/activity"}),o=t=>void l({search:c=>({...c,...t}),replace:!0}),n=A(P(r,i)),u=n.data?.pages.flatMap(t=>t.data)??[],d=[];for(const t of u){const c=D(t.updatedAt),a=d[d.length-1];a?.day===c?a.rows.push(t):d.push({day:c,rows:[t]})}return e.jsxs("div",{className:"flex flex-col gap-5 p-7",children:[e.jsx(w,{title:"Activity",sub:`Every site, newest first${i?"":" — all of them"}`}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[C.map(t=>e.jsx(m,{size:"sm",variant:r===t.value?"default":"outline",onClick:()=>o({status:t.value}),children:t.label},t.value)),e.jsx("div",{className:"flex-1"}),e.jsxs("label",{className:"flex items-center gap-2 text-[13px] text-muted-foreground",children:["Site",e.jsxs("select",{"aria-label":"Site",value:i??"",onChange:t=>o({site:t.target.value||void 0}),className:"h-8 rounded-md border border-input bg-background px-2.5 text-[13px] text-foreground",children:[e.jsx("option",{value:"",children:"All sites"}),s.projects.map(t=>e.jsx("option",{value:t.uid,children:t.name},t.uid))]})]})]}),n.isPending&&e.jsx(N,{rows:4}),n.isError&&e.jsx("p",{className:"m-0 text-[13px] text-destructive",children:"Could not read the feed. Reload to try again."}),n.isSuccess&&u.length===0&&e.jsx("p",{className:"m-0 text-[13px] text-muted-foreground",children:r==="resolved"?"Nothing has been resolved yet — this is where finished comments go.":r==="unresolved"?"Nothing needs attention. Every comment on every site is resolved.":"No comments yet on any site."}),d.map(({day:t,rows:c})=>e.jsxs("section",{className:"flex flex-col gap-2",children:[e.jsx("h2",{className:"m-0 text-[12px] font-medium uppercase tracking-wide text-muted-foreground",children:t}),e.jsx("ul",{className:"m-0 flex list-none flex-col gap-1.5 p-0",children:c.map(a=>e.jsx("li",{children:e.jsxs(j,{to:"/s/$site/comments",params:{site:a.site.uid},search:{thread:a.key},className:"flex flex-col gap-1 rounded-md border border-border px-3 py-2.5 no-underline transition-colors hover:bg-muted/60",children:[e.jsxs("span",{className:"flex flex-wrap items-center gap-x-2.5 gap-y-1 text-[13px]",children:[e.jsx(S,{status:a.status}),e.jsx("span",{className:"font-medium text-foreground",children:a.site.name}),e.jsx("code",{className:"font-mono text-[12px] text-muted-foreground",children:a.route}),e.jsx("span",{className:"flex-1"}),e.jsx("span",{className:"text-[12px] text-muted-foreground",children:R(a.updatedAt)})]}),a.latest?.body&&e.jsxs("span",{className:"line-clamp-2 text-[13px] text-foreground",children:[e.jsxs("span",{className:"text-muted-foreground",children:[a.latest.author??a.createdBy.name,": "]}),a.latest.body]}),e.jsxs("span",{className:"flex flex-wrap items-center gap-x-2 text-[12px] text-muted-foreground",children:[e.jsx("span",{className:"font-mono",children:a.key}),e.jsx("span",{children:"·"}),e.jsxs("span",{children:[a.commentCount," ",a.commentCount===1?"comment":"comments"]}),a.assignee&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),e.jsx("span",{children:a.assignee})]})]})]})},a.id))})]},t)),n.hasNextPage&&e.jsx("div",{children:e.jsx(m,{variant:"outline",size:"sm",disabled:n.isFetchingNextPage,onClick:()=>void n.fetchNextPage(),children:n.isFetchingNextPage?"Reading…":"Show older"})})]})}export{I as component};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as x,E as rn,l as U,aI as we,aE as pe,aJ as xe,g as se,aK as Et,aG as Ze,aF as bt,aL as kn,aM as sn,aN as Dn,aO as St,aP as cn,aQ as it,aR as vt,aS as Ht,aT as ln,n as In,e as q,f as ie,aa as Fn,k as Ct,i as Wn,j as Pt,h as an}from"./index-Bjyhj6ZB.js";import{b as At,e as Nt,g as ht,f as Kt,h as Xe,j as Vn,k as $n}from"./inertValue-B5n_awh1.js";import{w as Mt,i as pt,a4 as _n,an as fn,a6 as un,Q as zn,ao as Bn,v as ue,K as Hn,ap as Nn,aq as fe,Y as Kn,_ as jn,ar as st,as as ct,at as dn,au as Tt,av as Yn,aw as Xn,B as qn,ax as Un,ay as Gn}from"./dialog-CbKDGxpa.js";import{t as Qn,g as mn,c as Qe,x as xt,r as et,a as Be,B as jt,m as Jn}from"./label-C3zh-elW.js";import{u as Zn}from"./useValueChanged-CQWizfo3.js";import{u as eo}from"./CompositeList-BRoUQLZ7.js";const Le=Math.min,de=Math.max,tt=Math.round,qe=Math.floor,me=e=>({x:e,y:e}),to={left:"right",right:"left",bottom:"top",top:"bottom"};function gn(e,t,n){return de(e,Le(t,n))}function ye(e,t){return typeof e=="function"?e(t):e}function J(e){return e.split("-")[0]}function Re(e){return e.split("-")[1]}function Lt(e){return e==="x"?"y":"x"}function kt(e){return e==="y"?"height":"width"}function Q(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function Dt(e){return Lt(Q(e))}function no(e,t,n){n===void 0&&(n=!1);const o=Re(e),r=Dt(e),i=kt(r);let s=r==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=nt(s)),[s,nt(s)]}function oo(e){const t=nt(e);return[Ot(e),t,Ot(t)]}function Ot(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const Yt=["left","right"],Xt=["right","left"],ro=["top","bottom"],io=["bottom","top"];function so(e,t,n){switch(e){case"top":case"bottom":return n?t?Xt:Yt:t?Yt:Xt;case"left":case"right":return t?ro:io;default:return[]}}function co(e,t,n,o){const r=Re(e);let i=so(J(e),n==="start",o);return r&&(i=i.map(s=>s+"-"+r),t&&(i=i.concat(i.map(Ot)))),i}function nt(e){const t=J(e);return to[t]+e.slice(t.length)}function lo(e){var t,n,o,r;return{top:(t=e.top)!=null?t:0,right:(n=e.right)!=null?n:0,bottom:(o=e.bottom)!=null?o:0,left:(r=e.left)!=null?r:0}}function hn(e){return typeof e!="number"?lo(e):{top:e,right:e,bottom:e,left:e}}function ot(e){const{x:t,y:n,width:o,height:r}=e;return{width:o,height:r,top:n,left:t,right:t+o,bottom:n+r,x:t,y:n}}function Rr(e,t={}){const{enabled:n=!0,event:o="click",toggle:r=!0,ignoreMouse:i=!1,stickIfOpen:s=!0,touchOpenDelay:c=0,reason:l=Qn}=t,f="rootStore"in e?e.rootStore:e,u=f.context.dataRef,a=x.useRef(void 0),g=At(),d=Mt(),m=x.useMemo(()=>{function p(y,w,E,R){const v=Qe(l,w,E);y&&R==="touch"&&c>0?d.start(c,()=>{f.setOpen(!0,v)}):f.setOpen(y,v)}function h(y,w,E){const R=u.current.openEvent,v=f.select("domReferenceElement")!==w;return y&&v||!y||!r?!0:R&&s?!E(R.type):!1}return{onPointerDown(y){a.current=pt(y.pointerType,!0)&&fn(y.nativeEvent)?"virtual":y.pointerType},onMouseDown(y){const w=a.current,E=y.nativeEvent,R=f.select("open");if(y.button!==0||o==="click"||pt(w,!0)&&i)return;const v=h(R,y.currentTarget,A=>A==="click"||A==="mousedown"),S=mn(E);if(_n(S)){p(v,E,S,w);return}const P=y.currentTarget;g.request(()=>{p(v,E,P,w)})},onClick(y){if(o==="mousedown-only")return;const w=a.current;if(o==="mousedown"&&w){a.current=void 0;return}if(pt(w,!0)&&i)return;const E=f.select("open"),R=h(E,y.currentTarget,v=>v==="click"||v==="mousedown"||v==="keydown"||v==="keyup");p(R,y.nativeEvent,y.currentTarget,w)},onKeyDown(){a.current=void 0}}},[u,o,i,l,f,s,r,g,d,c]);return x.useMemo(()=>n?{reference:m}:rn,[n,m])}function qt(e,t,n){let{reference:o,floating:r}=e;const i=Q(t),s=Dt(t),c=kt(s),l=J(t),f=i==="y",u=o.x+o.width/2-r.width/2,a=o.y+o.height/2-r.height/2,g=o[c]/2-r[c]/2;let d;switch(l){case"top":d={x:u,y:o.y-r.height};break;case"bottom":d={x:u,y:o.y+o.height};break;case"right":d={x:o.x+o.width,y:a};break;case"left":d={x:o.x-r.width,y:a};break;default:d={x:o.x,y:o.y}}const m=Re(t);return m&&(d[s]+=g*(m==="end"?1:-1)*(n&&f?-1:1)),d}async function ao(e,t){var n;t===void 0&&(t={});const{x:o,y:r,platform:i,rects:s,elements:c,strategy:l}=e,{boundary:f="clippingAncestors",rootBoundary:u="viewport",elementContext:a="floating",altBoundary:g=!1,padding:d=0}=ye(t,e),m=hn(d),h=c[g?a==="floating"?"reference":"floating":a],y=ot(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(h)))==null||n?h:h.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(c.floating)),boundary:f,rootBoundary:u,strategy:l})),w=a==="floating"?{x:o,y:r,width:s.floating.width,height:s.floating.height}:s.reference,E=await(i.getOffsetParent==null?void 0:i.getOffsetParent(c.floating)),R=await(i.isElement==null?void 0:i.isElement(E))&&await(i.getScale==null?void 0:i.getScale(E))||{x:1,y:1},v=ot(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:w,offsetParent:E,strategy:l}):w);return{top:(y.top-v.top+m.top)/R.y,bottom:(v.bottom-y.bottom+m.bottom)/R.y,left:(y.left-v.left+m.left)/R.x,right:(v.right-y.right+m.right)/R.x}}const fo=50,uo=async(e,t,n)=>{const{placement:o="bottom",strategy:r="absolute",middleware:i=[],platform:s}=n,c=s.detectOverflow?s:{...s,detectOverflow:ao},l=await(s.isRTL==null?void 0:s.isRTL(t));let f=await s.getElementRects({reference:e,floating:t,strategy:r}),{x:u,y:a}=qt(f,o,l),g=o,d=0;const m={};for(let p=0;p<i.length;p++){const h=i[p];if(!h)continue;const{name:y,fn:w}=h,{x:E,y:R,data:v,reset:S}=await w({x:u,y:a,initialPlacement:o,placement:g,strategy:r,middlewareData:m,rects:f,platform:c,elements:{reference:e,floating:t}});u=E??u,a=R??a,m[y]={...m[y],...v},S&&d<fo&&(d++,typeof S=="object"&&(S.placement&&(g=S.placement),S.rects&&(f=S.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:r}):S.rects),{x:u,y:a}=qt(f,g,l)),p=-1)}return{x:u,y:a,placement:g,strategy:r,middlewareData:m}},mo=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,o;const{placement:r,middlewareData:i,rects:s,initialPlacement:c,platform:l,elements:f}=t,{mainAxis:u=!0,crossAxis:a=!0,fallbackPlacements:g,fallbackStrategy:d="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:p=!0,...h}=ye(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const y=J(r),w=Q(c),E=J(c)===c,R=await(l.isRTL==null?void 0:l.isRTL(f.floating)),v=g||(E||!p?[nt(c)]:oo(c)),S=m!=="none";!g&&S&&v.push(...co(c,p,m,R));const P=[c,...v],A=await l.detectOverflow(t,h),k=[];let L=((o=i.flip)==null?void 0:o.overflows)||[];if(u&&k.push(A[y]),a){const T=no(r,s,R);k.push(A[T[0]],A[T[1]])}if(L=[...L,{placement:r,overflows:k}],!k.every(T=>T<=0)){var D,K;const T=(((D=i.flip)==null?void 0:D.index)||0)+1,$=P[T];if($&&(!(a==="alignment"?w!==Q($):!1)||L.every(b=>Q(b.placement)===w?b.overflows[0]>0:!0)))return{data:{index:T,overflows:L},reset:{placement:$}};let F=(K=L.filter(W=>W.overflows[0]<=0).sort((W,b)=>W.overflows[1]-b.overflows[1])[0])==null?void 0:K.placement;if(!F)switch(d){case"bestFit":{var H;const W=(H=L.filter(b=>{if(S){const _=Q(b.placement);return _===w||_==="y"}return!0}).map(b=>[b.placement,b.overflows.filter(_=>_>0).reduce((_,z)=>_+z,0)]).sort((b,_)=>b[1]-_[1])[0])==null?void 0:H[0];W&&(F=W);break}case"initialPlacement":F=c;break}if(r!==F)return{reset:{placement:F}}}return{}}}},pn=new Set(["left","top"]);async function go(e,t){const{placement:n,platform:o,elements:r}=e,i=await(o.isRTL==null?void 0:o.isRTL(r.floating)),s=J(n),c=Re(n),l=Q(n)==="y",f=pn.has(s)?-1:1,u=i&&l?-1:1,a=ye(t,e);let{mainAxis:g,crossAxis:d,alignmentAxis:m}=typeof a=="number"?{mainAxis:a,crossAxis:0,alignmentAxis:null}:{mainAxis:a.mainAxis||0,crossAxis:a.crossAxis||0,alignmentAxis:a.alignmentAxis};return c&&typeof m=="number"&&(d=c==="end"?m*-1:m),l?{x:d*u,y:g*f}:{x:g*f,y:d*u}}const ho=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,o;const{x:r,y:i,placement:s,middlewareData:c}=t,l=await go(t,e);return s===((n=c.offset)==null?void 0:n.placement)&&(o=c.arrow)!=null&&o.alignmentOffset?{}:{x:r+l.x,y:i+l.y,data:{...l,placement:s}}}}},po=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:o,placement:r,platform:i}=t,{mainAxis:s=!0,crossAxis:c=!1,limiter:l={fn:w=>{let{x:E,y:R}=w;return{x:E,y:R}}},...f}=ye(e,t),u={x:n,y:o},a=await i.detectOverflow(t,f),g=Q(r),d=Lt(g);let m=u[d],p=u[g];const h=(w,E)=>gn(E+a[w==="y"?"top":"left"],E,E-a[w==="y"?"bottom":"right"]);s&&(m=h(d,m)),c&&(p=h(g,p));const y=l.fn({...t,[d]:m,[g]:p});return{...y,data:{x:y.x-n,y:y.y-o,enabled:{[d]:s,[g]:c}}}}}},xo=function(e){return e===void 0&&(e={}),{options:e,fn(t){var n,o;const{x:r,y:i,placement:s,rects:c,middlewareData:l}=t,{offset:f=0,mainAxis:u=!0,crossAxis:a=!0}=ye(e,t),g={x:r,y:i},d=Q(s),m=Lt(d);let p=g[m],h=g[d];const y=ye(f,t),w=typeof y=="number"?{mainAxis:y,crossAxis:0}:{mainAxis:(n=y.mainAxis)!=null?n:0,crossAxis:(o=y.crossAxis)!=null?o:0};if(u){const v=m==="y"?"height":"width",S=c.reference[m]-c.floating[v]+w.mainAxis,P=c.reference[m]+c.reference[v]-w.mainAxis;p<S?p=S:p>P&&(p=P)}if(a){var E,R;const v=m==="y"?"width":"height",S=pn.has(J(s)),P=c.reference[d]-c.floating[v]+(S&&((E=l.offset)==null?void 0:E[d])||0)+(S?0:w.crossAxis),A=c.reference[d]+c.reference[v]+(S?0:((R=l.offset)==null?void 0:R[d])||0)-(S?w.crossAxis:0);h<P?h=P:h>A&&(h=A)}return{[m]:p,[d]:h}}}},yo=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:o,platform:r,elements:i}=t,{apply:s=()=>{},...c}=ye(e,t),l=await r.detectOverflow(t,c),f=J(n),u=Re(n),a=Q(n)==="y",{width:g,height:d}=o.floating;let m,p;f==="top"||f==="bottom"?(m=f,p=u===(await(r.isRTL==null?void 0:r.isRTL(i.floating))?"start":"end")?"left":"right"):(p=f,m=u==="end"?"top":"bottom");const h=d-l.top-l.bottom,y=g-l.left-l.right,w=Le(d-l[m],h),E=Le(g-l[p],y),R=t.middlewareData.shift,v=!R;let S=w,P=E;R!=null&&R.enabled.x&&(P=y),R!=null&&R.enabled.y&&(S=h),v&&!u&&(a?P=g-2*de(l.left,l.right):S=d-2*de(l.top,l.bottom)),await s({...t,availableWidth:P,availableHeight:S});const A=await r.getDimensions(i.floating);return g!==A.width||d!==A.height?{reset:{rects:!0}}:{}}}};function xn(e){const t=xe(e);let n=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const r=pe(e),i=r?e.offsetWidth:n,s=r?e.offsetHeight:o,c=tt(n)!==i||tt(o)!==s;return c&&(n=i,o=s),{width:n,height:o,$:c}}function It(e){return U(e)?e:e.contextElement}function Te(e){const t=It(e);if(!pe(t))return me(1);const n=t.getBoundingClientRect(),{width:o,height:r,$:i}=xn(t);let s=(i?tt(n.width):n.width)/o,c=(i?tt(n.height):n.height)/r;return(!s||!Number.isFinite(s))&&(s=1),(!c||!Number.isFinite(c))&&(c=1),{x:s,y:c}}const wo=me(0);function yn(e){const t=se(e);return!ln()||!t.visualViewport?wo:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Ro(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===se(e)}function Ae(e,t,n,o){t===void 0&&(t=!1),n===void 0&&(n=!1);const r=e.getBoundingClientRect(),i=It(e);let s=me(1);t&&(o?U(o)&&(s=Te(o)):s=Te(e));const c=Ro(i,n,o)?yn(i):me(0);let l=(r.left+c.x)/s.x,f=(r.top+c.y)/s.y,u=r.width/s.x,a=r.height/s.y;if(i&&o){const g=se(i),d=U(o)?se(o):o;let m=g,p=Ht(m);for(;p&&d!==m;){const h=Te(p),y=p.getBoundingClientRect(),w=xe(p),E=y.left+(p.clientLeft+parseFloat(w.paddingLeft))*h.x,R=y.top+(p.clientTop+parseFloat(w.paddingTop))*h.y;l*=h.x,f*=h.y,u*=h.x,a*=h.y,l+=E,f+=R,m=se(p),p=Ht(m)}}return ot({width:u,height:a,x:l,y:f})}function lt(e,t){const n=it(e).scrollLeft;return t?t.left+n:Ae(we(e)).left+n}function wn(e,t){const n=e.getBoundingClientRect(),o=n.left+t.scrollLeft-lt(e,n),r=n.top+t.scrollTop;return{x:o,y:r}}function bo(e){let{elements:t,rect:n,offsetParent:o,strategy:r}=e;const i=r==="fixed",s=we(o),c=t?Et(t.floating):!1;if(o===s||c&&i)return n;let l={scrollLeft:0,scrollTop:0},f=me(1);const u=me(0),a=pe(o);if((a||!i)&&((St(o)!=="body"||cn(s))&&(l=it(o)),a)){const d=Ae(o);f=Te(o),u.x=d.x+o.clientLeft,u.y=d.y+o.clientTop}const g=s&&!a&&!i?wn(s,l):me(0);return{width:n.width*f.x,height:n.height*f.y,x:n.x*f.x-l.scrollLeft*f.x+u.x+g.x,y:n.y*f.y-l.scrollTop*f.y+u.y+g.y}}function vo(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function Ao(e){const t=it(e),n=e.ownerDocument.body,o=de(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),r=de(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight);let i=-t.scrollLeft+lt(e);const s=-t.scrollTop;return xe(n).direction==="rtl"&&(i+=de(e.clientWidth,n.clientWidth)-o),{width:o,height:r,x:i,y:s}}const Oo=25;function Eo(e,t,n){n===void 0&&(n="viewport");const o=n==="layoutViewport",r=se(e),i=we(e),s=r.visualViewport;let c=i.clientWidth,l=i.clientHeight,f=0,u=0;if(s){const g=!ln()||t==="fixed";o?g||(f=-s.offsetLeft,u=-s.offsetTop):(c=s.width,l=s.height,g&&(f=s.offsetLeft,u=s.offsetTop))}if(lt(i)<=0){const g=i.ownerDocument,d=g.body,m=getComputedStyle(d),p=g.compatMode==="CSS1Compat"&&parseFloat(m.marginLeft)+parseFloat(m.marginRight)||0,h=Math.abs(i.clientWidth-d.clientWidth-p),y=getComputedStyle(i).scrollbarGutter==="stable both-edges"?h/2:h;y<=Oo&&(c-=y)}return{width:c,height:l,x:f,y:u}}function So(e,t){const n=Ae(e,!0,t==="fixed"),o=n.top+e.clientTop,r=n.left+e.clientLeft,i=Te(e),s=e.clientWidth*i.x,c=e.clientHeight*i.y,l=r*i.x,f=o*i.y;return{width:s,height:c,x:l,y:f}}function Ut(e,t,n){let o;if(t==="viewport"||t==="layoutViewport")o=Eo(e,n,t);else if(t==="document")o=Ao(we(e));else if(U(t))o=So(t,n);else{const r=yn(e);o={x:t.x-r.x,y:t.y-r.y,width:t.width,height:t.height}}return ot(o)}function Co(e,t){const n=t.get(e);if(n)return n;let o=vt(e,[],!1).filter(c=>U(c)&&St(c)!=="body"),r=null;const i=xe(e).position==="fixed";let s=i?Ze(e):e;for(;U(s)&&!bt(s);){const c=xe(s),l=sn(s),f=r?r.position:i?"fixed":"";!l&&(f==="fixed"||f==="absolute"&&c.position==="static")?o=o.filter(a=>a!==s):r=c,s=Ze(s)}return t.set(e,o),o}function Po(e){let{element:t,boundary:n,rootBoundary:o,strategy:r}=e;const s=[...n==="clippingAncestors"?Et(t)?[]:Co(t,this._c):[].concat(n),o],c=Ut(t,s[0],r);let l=c.top,f=c.right,u=c.bottom,a=c.left;for(let g=1;g<s.length;g++){const d=Ut(t,s[g],r);l=de(d.top,l),f=Le(d.right,f),u=Le(d.bottom,u),a=de(d.left,a)}return{width:f-a,height:u-l,x:a,y:l}}function Mo(e){const{width:t,height:n}=xn(e);return{width:t,height:n}}function To(e,t,n){const o=pe(t),r=we(t),i=n==="fixed",s=Ae(e,!0,i,t);let c={scrollLeft:0,scrollTop:0};const l=me(0);if((o||!i)&&((St(t)!=="body"||cn(r))&&(c=it(t)),o)){const g=Ae(t,!0,i,t);l.x=g.x+t.clientLeft,l.y=g.y+t.clientTop}!o&&r&&(l.x=lt(r));const f=r&&!o&&!i?wn(r,c):me(0),u=s.left+c.scrollLeft-l.x-f.x,a=s.top+c.scrollTop-l.y-f.y;return{x:u,y:a,width:s.width,height:s.height}}function yt(e){return xe(e).position==="static"}function Gt(e,t){if(!pe(e)||xe(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return we(e)===n&&(n=n.ownerDocument.body),n}function Rn(e,t){const n=se(e);if(Et(e))return n;if(!pe(e)){let r=Ze(e);for(;r&&!bt(r);){if(U(r)&&!yt(r))return r;r=Ze(r)}return n}let o=Gt(e,t);for(;o&&kn(o)&&yt(o);)o=Gt(o,t);return o&&bt(o)&&yt(o)&&!sn(o)?n:o||Dn(e)||n}const Lo=async function(e){const t=this.getOffsetParent||Rn,n=this.getDimensions,o=await n(e.floating);return{reference:To(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function ko(e){return xe(e).direction==="rtl"}const Do={convertOffsetParentRelativeRectToViewportRelativeRect:bo,getDocumentElement:we,getClippingRect:Po,getOffsetParent:Rn,getElementRects:Lo,getClientRects:vo,getDimensions:Mo,getScale:Te,isElement:U,isRTL:ko};function bn(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Io(e,t,n){let o=null,r;const i=we(e);function s(){var u;clearTimeout(r),(u=o)==null||u.disconnect(),o=null}function c(u,a){u===void 0&&(u=!1),a===void 0&&(a=1),s();const g=e.getBoundingClientRect(),{left:d,top:m,width:p,height:h}=g;if(u||t(),!p||!h)return;const y=qe(m),w=qe(i.clientWidth-(d+p)),E=qe(i.clientHeight-(m+h)),R=qe(d),S={rootMargin:-y+"px "+-w+"px "+-E+"px "+-R+"px",threshold:de(0,Le(1,a))||1};let P=!0;function A(k){const L=k[0].intersectionRatio;if(!bn(g,e.getBoundingClientRect()))return c();if(L!==a){if(!P)return c();L?c(!1,L):r=setTimeout(()=>{c(!1,1e-7)},1e3)}P=!1}try{o=new IntersectionObserver(A,{...S,root:i.ownerDocument})}catch{o=new IntersectionObserver(A,S)}o.observe(e)}const l=se(e),f=()=>c(n);return l.addEventListener("resize",f),c(!0),()=>{l.removeEventListener("resize",f),s()}}function Qt(e,t,n,o){o===void 0&&(o={});const{ancestorScroll:r=!0,ancestorResize:i=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:l=!1}=o,f=It(e),u=r||i?[...f?vt(f):[],...t?vt(t):[]]:[];u.forEach(y=>{r&&y.addEventListener("scroll",n),i&&y.addEventListener("resize",n)});const a=f&&c?Io(f,n,i):null;let g=-1,d=null;s&&(d=new ResizeObserver(y=>{let[w]=y;w&&w.target===f&&d&&t&&(d.unobserve(t),cancelAnimationFrame(g),g=requestAnimationFrame(()=>{var E;(E=d)==null||E.observe(t)})),n()}),f&&!l&&d.observe(f),t&&d.observe(t));let m,p=l?Ae(e):null;l&&h();function h(){const y=Ae(e);p&&!bn(p,y)&&n(),p=y,m=requestAnimationFrame(h)}return n(),()=>{var y;u.forEach(w=>{r&&w.removeEventListener("scroll",n),i&&w.removeEventListener("resize",n)}),a?.(),(y=d)==null||y.disconnect(),d=null,l&&cancelAnimationFrame(m)}}const Fo=ho,Wo=po,Vo=mo,$o=yo,_o=xo,zo=(e,t,n)=>{const o=new Map,r=n??{},i={...Do,...r.platform,_c:o};return uo(e,t,{...r,platform:i})};var Bo=typeof document<"u",Ho=function(){},Je=Bo?x.useLayoutEffect:Ho;function rt(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,o,r;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(o=n;o--!==0;)if(!rt(e[o],t[o]))return!1;return!0}if(r=Object.keys(e),n=r.length,n!==Object.keys(t).length)return!1;for(o=n;o--!==0;)if(!{}.hasOwnProperty.call(t,r[o]))return!1;for(o=n;o--!==0;){const i=r[o];if(!(i==="_owner"&&e.$$typeof)&&!rt(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function vn(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Jt(e,t){const n=vn(e);return Math.round(t*n)/n}function wt(e){const t=x.useRef(e);return Je(()=>{t.current=e}),t}function No(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:o=[],platform:r,elements:{reference:i,floating:s}={},transform:c=!0,whileElementsMounted:l,open:f}=e,[u,a]=x.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[g,d]=x.useState(o);rt(g,o)||d(o);const[m,p]=x.useState(null),[h,y]=x.useState(null),w=x.useCallback(b=>{b!==S.current&&(S.current=b,p(b))},[]),E=x.useCallback(b=>{b!==P.current&&(P.current=b,y(b))},[]),R=i||m,v=s||h,S=x.useRef(null),P=x.useRef(null),A=x.useRef(u),k=l!=null,L=wt(l),D=wt(r),K=wt(f),H=x.useCallback(()=>{if(!S.current||!P.current)return;const b={placement:t,strategy:n,middleware:g};D.current&&(b.platform=D.current),zo(S.current,P.current,b).then(_=>{const z={..._,isPositioned:K.current!==!1};T.current&&!rt(A.current,z)&&(A.current=z,In.flushSync(()=>{a(z)}))})},[g,t,n,D,K]);Je(()=>{f===!1&&A.current.isPositioned&&(A.current.isPositioned=!1,a(b=>({...b,isPositioned:!1})))},[f]);const T=x.useRef(!1);Je(()=>(T.current=!0,()=>{T.current=!1}),[]),Je(()=>{if(R&&(S.current=R),v&&(P.current=v),R&&v){if(L.current)return L.current(R,v,H);H()}},[R,v,H,L,k]);const $=x.useMemo(()=>({reference:S,floating:P,setReference:w,setFloating:E}),[w,E]),F=x.useMemo(()=>({reference:R,floating:v}),[R,v]),W=x.useMemo(()=>{const b={position:n,left:0,top:0};if(!F.floating)return b;const _=Jt(F.floating,u.x),z=Jt(F.floating,u.y);return c?{...b,transform:"translate("+_+"px, "+z+"px)",...vn(F.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:_,top:z}},[n,c,F.floating,u.x,u.y]);return x.useMemo(()=>({...u,update:H,refs:$,elements:F,floatingStyles:W}),[u,H,$,F,W])}const Ko=(e,t)=>{const n=Fo(e);return{name:n.name,fn:n.fn,options:[e,t]}},jo=(e,t)=>{const n=Wo(e);return{name:n.name,fn:n.fn,options:[e,t]}},Yo=(e,t)=>({fn:_o(e).fn,options:[e,t]}),Xo=(e,t)=>{const n=Vo(e);return{name:n.name,fn:n.fn,options:[e,t]}},qo=(e,t)=>{const n=$o(e);return{name:n.name,fn:n.fn,options:[e,t]}};function Uo(e){return Go(e,e.rootContext)}function Go(e,t){const{nodeId:n,externalTree:o}=e,r=t.useState("referenceElement"),i=t.useState("floatingElement"),s=t.useState("domReferenceElement"),c=t.useState("open"),l=t.useState("floatingId"),[f,u]=x.useState(null),[a,g]=x.useState(void 0),[d,m]=x.useState(void 0),p=x.useRef(null),h=un(o),y=x.useMemo(()=>({reference:r,floating:i,domReference:s}),[r,i,s]),w=No({...e,elements:{...y,...f&&{reference:f}}}),E=U(a)?a:null,R=d===void 0?t.state.floatingElement:d;t.useSyncedValue("referenceElement",a??null),t.useSyncedValue("domReferenceElement",a===void 0?s:E),t.useSyncedValue("floatingElement",R);const v=x.useCallback(D=>{const K=U(D)?{getBoundingClientRect:()=>D.getBoundingClientRect(),getClientRects:()=>D.getClientRects(),contextElement:D}:D;u(K),w.refs.setReference(K)},[w.refs]),S=x.useCallback(D=>{(U(D)||D===null)&&(p.current=D,g(D)),(U(w.refs.reference.current)||w.refs.reference.current===null||D!==null&&!U(D))&&w.refs.setReference(D)},[w.refs,g]),P=x.useCallback(D=>{m(D),w.refs.setFloating(D)},[w.refs]),A=x.useMemo(()=>({...w.refs,setReference:S,setFloating:P,setPositionReference:v,domReference:p}),[w.refs,S,P,v]),k=x.useMemo(()=>({...w.elements,domReference:s}),[w.elements,s]),L=x.useMemo(()=>({...w,dataRef:t.context.dataRef,open:c,onOpenChange:t.setOpen,events:t.context.events,floatingId:l,refs:A,elements:k,nodeId:n,rootStore:t}),[w,A,k,n,t,c,l]);return q(()=>{s&&(p.current=s)},[s]),q(()=>{t.context.dataRef.current.floatingContext=L;const D=h?.nodesRef.current.find(K=>K.id===n);D&&(D.context=L)}),x.useMemo(()=>({...w,context:L,refs:A,elements:k,rootStore:t}),[w,A,k,L,t])}const Qo="Escape";function Zt(e){return Kn&&e.movementX===0&&e.movementY===0}function at(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function Ue(e,t){return at(t,e===dn||e===Tt,e===st||e===ct)}function Rt(e,t,n){return at(t,e===Tt,n?e===st:e===ct)||e==="Enter"||e===" "||e===""}function Jo(e,t,n){return at(t,n?e===st:e===ct,e===Tt)}function Zo(e,t,n,o){const r=n?e===ct:e===st,i=e===dn;return t==="both"||t==="horizontal"&&o?e===Qo:at(t,r,i)}function br(e,t){const{listRef:n,activeIndex:o,onNavigate:r=()=>{},enabled:i=!0,selectedIndex:s=null,allowEscape:c=!1,loopFocus:l=!1,nested:f=!1,rtl:u=!1,virtual:a=!1,focusItemOnOpen:g="auto",focusItemOnHover:d=!0,openOnArrowKeyDown:m=!0,disabledIndices:p=void 0,orientation:h="vertical",parentOrientation:y,id:w,resetOnPointerLeave:E=!0,externalTree:R,grid:v}=t,S=v!=null,P="rootStore"in e?e.rootStore:e,A=P.useState("open"),k=P.useState("floatingElement"),L=P.useState("domReferenceElement"),D=P.context.dataRef,K=zn(k),H=Bn(L),T=ue(K),$=Hn(),F=un(R),W=x.useRef(g),b=x.useRef(s??-1),_=x.useRef(null),z=x.useRef(!0),N=ie(O=>{r(b.current===-1?null:b.current,O)}),be=x.useRef(!!k),B=x.useRef(A),Y=x.useRef(!1),Oe=x.useRef(!1),ke=x.useRef(null),ft=ue(p),Ee=ue(A),ee=ue(s),ce=ue(E),De=At(),Se=At(),Ie=ie(()=>{function O(V){a?F?.events.emit("virtualfocus",V):ke.current=Nn(V,{sync:Y.current,preventScroll:!0})}const C=n.current[b.current],j=Oe.current;C&&O(C),(Y.current?V=>V():V=>De.request(V))(()=>{const V=n.current[b.current]||C;if(!V)return;C||O(V),Ce&&(j||!z.current)&&V.scrollIntoView?.({block:"nearest",inline:"nearest"})})});q(()=>{D.current.orientation=h},[D,h]),q(()=>{i&&(A&&k?(b.current=s??-1,W.current&&s!=null&&(Oe.current=!0,N())):be.current&&(b.current=-1,N()))},[i,A,k,s,N]),q(()=>{if(i){if(!A){Y.current=!1;return}if(k)if(o==null){if(Y.current=!1,ee.current!=null)return;if(be.current&&(b.current=-1,Ie()),(!B.current||!be.current)&&W.current&&(_.current!=null||W.current===!0&&_.current==null)){let O=0;const C=()=>{n.current[0]==null?(O<2&&(O?M=>Se.request(M):queueMicrotask)(C),O+=1):(b.current=_.current==null||Rt(_.current,h,u)||f?ht(n):Kt(n),_.current=null,N())};C()}}else Nt(n.current,o)||(b.current=o,Ie(),Oe.current=!1)}},[i,A,k,o,ee,f,n,h,u,N,Ie,Se]),q(()=>{if(!i||k||!F||a||!be.current)return;const O=F.nodesRef.current,C=O.find(V=>V.id===$)?.context?.elements.floating,j=xt(et(L??C??null)),M=O.some(V=>V.context&&Be(V.context.elements.floating,j));C&&!M&&z.current&&C.focus({preventScroll:!0})},[i,k,L,F,$,a]),q(()=>{B.current=A,be.current=!!k}),q(()=>{A||(_.current=null,W.current=g)},[A,g]);const He=o!=null,te=ie(O=>{if(!Ee.current)return;const C=n.current.indexOf(O.currentTarget);C!==-1&&(b.current!==C||o!==C)&&(b.current=C,N(O))}),ve=ie(()=>y??F?.nodesRef.current.find(O=>O.id===$)?.context?.dataRef?.current.orientation),Fe=ie(()=>ht(n,ft.current)),ge=ie(O=>{if(z.current=!1,Y.current=!0,O.which===229||!Ee.current&&O.currentTarget===T.current)return;if(f&&Zo(O.key,h,u,S)){Ue(O.key,ve())||fe(O),P.setOpen(!1,Qe(jt,O.nativeEvent)),pe(L)&&(a?F?.events.emit("virtualfocus",L):L.focus());return}const C=b.current,j=ht(n,p),M=Kt(n,p);if(H||(O.key==="Home"&&(fe(O),b.current=j,N(O)),O.key==="End"&&(fe(O),b.current=M,N(O))),v!=null){const V=v(O,b.current,n,h,l,u,p,j,M);if(V!=null&&(b.current=V,N(O)),h==="both")return}if(Ue(O.key,h)){if(fe(O),A&&!a&&xt(O.currentTarget.ownerDocument)===O.currentTarget){b.current=Rt(O.key,h,u)?j:M,N(O);return}Rt(O.key,h,u)?l?C>=M?c&&C!==n.current.length?b.current=-1:(Y.current=!1,b.current=j):b.current=Xe(n.current,{startingIndex:C,disabledIndices:p}):b.current=Math.min(M,Xe(n.current,{startingIndex:C,disabledIndices:p})):l?C<=j?c&&C!==-1?b.current=n.current.length:(Y.current=!1,b.current=M):b.current=Xe(n.current,{startingIndex:C,decrement:!0,disabledIndices:p}):b.current=Math.max(j,Xe(n.current,{startingIndex:C,decrement:!0,disabledIndices:p})),Nt(n.current,b.current)&&(b.current=-1),N(O)}}),Ce=x.useMemo(()=>({onFocus(C){Y.current=!0,te(C)},onClick:({currentTarget:C})=>C.focus({preventScroll:!0}),onMouseMove(C){Zt(C)||(Y.current=!0,Oe.current=!1,d&&te(C))},onPointerLeave(C){if(!Ee.current||!z.current||C.pointerType==="touch")return;Y.current=!0;const j=C.relatedTarget;if(!(!d||n.current.includes(j))&&ce.current&&(ke.current?.(),ke.current=null,b.current=-1,N(C),!a)){const M=T.current,V=xt(et(M));M&&Be(M,V)&&M.focus({preventScroll:!0})}}}),[te,Ee,T,d,n,N,ce,a]),he=x.useMemo(()=>a&&A&&He&&{"aria-activedescendant":`${w}-${o}`},[a,A,He,w,o]),le=x.useMemo(()=>({"aria-orientation":h==="both"?void 0:h,...H?{}:he,onKeyDown(O){if(O.key==="Tab"&&O.shiftKey&&A&&!a){const C=mn(O.nativeEvent);if(C&&!Be(T.current,C))return;fe(O),P.setOpen(!1,Qe(Jn,O.nativeEvent)),pe(L)&&L.focus();return}ge(O)},onPointerMove(O){Zt(O)||(z.current=!0)}}),[he,ge,T,h,H,P,A,a,L]),ne=x.useMemo(()=>{function O(M){P.setOpen(!0,Qe(jt,M.nativeEvent,M.currentTarget))}function C(M){g==="auto"&&jn(M.nativeEvent)&&(W.current=!a)}function j(M){W.current=g,g==="auto"&&fn(M.nativeEvent)&&(W.current=!0)}return{onKeyDown(M){const V=P.select("open");z.current=!1;const Z=M.key.startsWith("Arrow"),Ve=Jo(M.key,ve(),u),$e=Ue(M.key,h),Ne=(f?Ve:$e)||M.key==="Enter"||M.key.trim()==="";if(a&&V)return ge(M);if(!(!V&&!m&&Z)){if(Ne){const Pe=Ue(M.key,ve());_.current=f&&Pe?null:M.key}if(f){Ve&&(fe(M),V?(b.current=Fe(),N(M)):O(M));return}$e&&(ee.current!=null&&(b.current=ee.current),fe(M),!V&&m?O(M):ge(M),V&&N(M))}},onFocus(M){P.select("open")&&!a&&(b.current=-1,N(M))},onPointerDown:j,onPointerEnter:j,onMouseDown:C,onClick:C}},[ge,g,Fe,f,N,P,m,h,ve,u,ee,a]),We=x.useMemo(()=>({...he,...ne}),[he,ne]);return x.useMemo(()=>i?{reference:We,floating:le,item:Ce,trigger:ne}:{},[i,We,le,ne,Ce])}function vr(e,t){const{listRef:n,elementsRef:o,activeIndex:r,onMatch:i,disabledIndices:s,onTyping:c,enabled:l=!0,resetMs:f=750,selectedIndex:u=null}=t,a="rootStore"in e?e.rootStore:e,g=a.useState("open"),d=Mt(),m=x.useRef(""),p=x.useRef(u??r??-1),h=x.useRef(null),y=ie(R=>{function v(T){return o?.current[T]}function S(T){const $=v(T);return $&&!Vn($)||$?.matches(":disabled")?!1:s==null||!$n(Fn,T,s)}function P(T,$,F=0){if(T.length===0)return-1;const W=(F%T.length+T.length)%T.length,b=$.toLowerCase();for(let _=0;_<T.length;_+=1){const z=(W+_)%T.length;if(!(!T[z]?.toLowerCase().startsWith(b)||!S(z)))return z}return-1}const A=n.current;if(m.current.length>0&&R.key===" "&&(fe(R),c?.(!0)),m.current.length>0&&m.current[0]!==" "&&P(A,m.current)===-1&&R.key!==" "&&c?.(!1),A==null||R.key.length!==1||R.ctrlKey||R.metaKey||R.altKey)return;g&&R.key!==" "&&(fe(R),c?.(!0));const k=m.current==="";k&&(p.current=u??r??-1),A.every((T,$)=>T&&S($)?T[0]?.toLowerCase()!==T[1]?.toLowerCase():!0)&&m.current===R.key&&(m.current="",p.current=h.current),m.current+=R.key,d.start(f,()=>{m.current="",p.current=h.current,c?.(!1)});const K=((k?u??r??-1:p.current)??0)+1,H=P(A,m.current,K);H!==-1?(i?.(H),h.current=H):R.key!==" "&&(m.current="",c?.(!1))}),w=ie(R=>{const v=R.relatedTarget,S=a.select("domReferenceElement"),P=a.select("floatingElement");Be(S,v)||Be(P,v)||(d.clear(),m.current="",p.current=h.current,c?.(!1))});q(()=>{!g&&u!==null||(d.clear(),h.current=null,m.current!==""&&(m.current=""))},[g,u,d]);const E=x.useMemo(()=>({onKeyDown:y,onBlur:w}),[y,w]);return x.useMemo(()=>l?{reference:E,floating:E}:{},[l,E])}function er(e){const t=x.useRef(""),n=x.useCallback(r=>{r.defaultPrevented||(t.current=r.pointerType,e(r,r.pointerType))},[e]);return{onClick:x.useCallback(r=>{if(r.detail===0){e(r,"keyboard");return}"pointerType"in r?e(r,r.pointerType):e(r,t.current),t.current=""},[e]),onPointerDown:n}}function tr(e,t){const n=ie((i,s)=>{(typeof e=="function"?e():e)||t(s||(Yn?"touch":""))}),{onClick:o,onPointerDown:r}=er(n);return x.useMemo(()=>({onClick:o,onPointerDown:r}),[o,r])}function Ar(e){const[t,n]=x.useState(null),o=tr(e,n);return Zn(e,r=>{r&&!e&&n(null)}),x.useMemo(()=>({openMethod:t,triggerProps:o}),[t,o])}const nr=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:o,placement:r,rects:i,platform:s,elements:c,middlewareData:l}=t,{element:f,padding:u=0,offsetParent:a="real"}=ye(e,t)||{};if(f==null)return{};const g=hn(u),d={x:n,y:o},m=Dt(r),p=kt(m),h=await s.getDimensions(f),y=m==="y",w=y?"top":"left",E=y?"bottom":"right",R=y?"clientHeight":"clientWidth",v=i.reference[p]+i.reference[m]-d[m]-i.floating[p],S=d[m]-i.reference[m],P=a==="real"?await s.getOffsetParent?.(f):c.floating;let A=c.floating[R]||i.floating[p];(!A||!await s.isElement?.(P))&&(A=c.floating[R]||i.floating[p]);const k=v/2-S/2,L=A/2-h[p]/2-1,D=Math.min(g[w],L),K=Math.min(g[E],L),H=D,T=A-h[p]-K,$=A/2-h[p]/2+k,F=gn(H,$,T),W=!l.arrow&&Re(r)!=null&&$!==F&&i.reference[p]/2-($<H?D:K)-h[p]/2<0,b=W?$<H?$-H:$-T:0;return{[m]:d[m]+b,data:{[m]:F,centerOffset:$-F-b,...W&&{alignmentOffset:b}},reset:W}}}),or=(e,t)=>({...nr(e),options:[e,t]}),rr={name:"hide",async fn(e){const{width:t,height:n,x:o,y:r}=e.rects.reference,i=t===0&&n===0&&o===0&&r===0,s=await e.platform.detectOverflow(e,{elementContext:"reference"});return{data:{referenceHidden:s.top-n>=0||s.right-t>=0||s.bottom-n>=0||s.left-t>=0||i}}}},ir={sideX:"left",sideY:"top"},en="--available-width",tn="--available-height";function An(e,t,n){const o=e==="inline-start"||e==="inline-end";return{top:"top",right:o?n?"inline-start":"inline-end":"right",bottom:"bottom",left:o?n?"inline-end":"inline-start":"left"}[t]}function nn(e,t,n){const{rects:o,placement:r}=e;return{side:An(t,J(r),n),align:Re(r)||"center",anchor:{width:o.reference.width,height:o.reference.height},positioner:{width:o.floating.width,height:o.floating.height}}}function Or(e){return sr(e,Uo)}function sr(e,t){const{anchor:n,positionMethod:o="absolute",side:r="bottom",sideOffset:i=0,align:s="center",alignOffset:c=0,collisionBoundary:l,collisionPadding:f=5,sticky:u=!1,arrowPadding:a=5,disableAnchorTracking:g=!1,inline:d,keepMounted:m=!1,floatingRootContext:p,mounted:h,collisionAvoidance:y,shift:w,nodeId:E,adaptiveOrigin:R,lazyFlip:v=!1,externalTree:S}=e,[P,A]=x.useState(null);!h&&P!==null&&A(null);const k=y.side||"flip",L=y.align||"flip",D=y.fallbackAxisSide||"end",K=w?.crossAxis??!1,H=w?.rootBoundary,T=typeof n=="function"?n:void 0,$=ie(T),F=T?$:n,W=ue(n),b=ue(h),z=eo()==="rtl",N=P||{top:"top",right:"right",bottom:"bottom",left:"left","inline-end":z?"left":"right","inline-start":z?"right":"left"}[r],be=s==="center"?N:`${N}-${s}`;let B=f;typeof B=="number"?B={top:B,right:B,bottom:B,left:B}:B&&(B={top:B.top||0,right:B.right||0,bottom:B.bottom||0,left:B.left||0});const Y=1,Oe=r==="bottom"?Y:0,ke=r==="top"?Y:0,ft=r==="right"?Y:0,Ee=r==="left"?Y:0,ee={boundary:l==="clipping-ancestors"?"clippingAncestors":l,padding:B},ce=x.useRef(null),De=ue(i),Se=ue(c),Ie=typeof i!="function"?i:0,He=typeof c!="function"?c:0,te=[];d&&te.push(d),te.push(Ko(I=>{const G=nn(I,r,z),oe=typeof De.current=="function"?De.current(G):De.current,X=typeof Se.current=="function"?Se.current(G):Se.current;return{mainAxis:oe,crossAxis:X,alignmentAxis:X}},[Ie,He,z,r]));const ve=L==="none"&&k!=="shift",Fe=!ve&&(u||K||k==="shift"),ge=k==="none"?null:Xo({...ee,padding:{top:B.top+Y+Oe,right:B.right+Y+Ee,bottom:B.bottom+Y+ke,left:B.left+Y+ft},mainAxis:!K&&k==="flip",crossAxis:L==="flip"?"alignment":!1,fallbackAxisSideDirection:D}),Ce=ve?null:jo({...ee,rootBoundary:H,mainAxis:L!=="none",crossAxis:Fe,limiter:u||K?void 0:Yo(I=>{if(!ce.current)return{};const{width:G,height:oe}=ce.current.getBoundingClientRect(),X=Q(J(I.placement)),ae=X==="y"?G:oe,re=X==="y"?B.left+B.right:B.top+B.bottom;return{offset:ae/2+re/2}})},[ee,u,K,H,B,L]);k==="shift"||L==="shift"||s==="center"?te.push(Ce,ge):te.push(ge,Ce),te.push(qo({...ee,apply({elements:{floating:I},availableWidth:G,availableHeight:oe,rects:X}){if(!b.current)return;const ae=I.style;ae.setProperty(en,`${G}px`),ae.setProperty(tn,`${oe}px`);const re=se(I).devicePixelRatio||1,{x:_e,y:je,width:Ye,height:ut}=X.reference,dt=(Math.round((_e+Ye)*re)-Math.round(_e*re))/re,mt=(Math.round((je+ut)*re)-Math.round(je*re))/re;ae.setProperty("--anchor-width",`${dt}px`),ae.setProperty("--anchor-height",`${mt}px`)}}),or(I=>({element:ce.current||et(I.elements.floating).createElement("div"),padding:a,offsetParent:"floating"}),[a]),{name:"transformOrigin",fn(I){const{elements:G,middlewareData:oe,placement:X,rects:ae,y:re}=I,_e=J(X),je=Q(_e),Ye=ce.current,ut=oe.arrow?.x||0,dt=oe.arrow?.y||0,mt=Ye?.clientWidth||0,Sn=Ye?.clientHeight||0,gt=ut+mt/2,Bt=dt+Sn/2,Cn=Math.abs(oe.shift?.y||0),Pn=ae.reference.height/2,ze=typeof i=="function"?i(nn(I,r,z)):i,Mn=Cn>ze,Tn={top:`${gt}px calc(100% + ${ze}px)`,bottom:`${gt}px ${-ze}px`,left:`calc(100% + ${ze}px) ${Bt}px`,right:`${-ze}px ${Bt}px`}[_e],Ln=`${gt}px ${ae.reference.y+Pn-re}px`;return G.floating.style.setProperty("--transform-origin",Fe&&je==="y"&&Mn?Ln:Tn),{}}},rr,R),q(()=>{!h&&p&&p.update({referenceElement:null,floatingElement:null,domReferenceElement:null,positionReference:null})},[h,p]);const he=x.useMemo(()=>({elementResize:!g&&typeof ResizeObserver<"u",layoutShift:!g&&typeof IntersectionObserver<"u"}),[g]),{refs:le,elements:ne,x:We,y:O,middlewareData:C,update:j,placement:M,context:V,isPositioned:Z,floatingStyles:Ve}=t({rootContext:p,open:m?h:void 0,placement:be,middleware:te,strategy:o,whileElementsMounted:m?void 0:(...I)=>Qt(...I,he),nodeId:E,externalTree:S}),{sideX:$e,sideY:Ne}=C.adaptiveOrigin||ir,Pe=Z?o:"fixed",Ft=x.useMemo(()=>{let I;return Z?R?I={position:Pe,[$e]:We,[Ne]:O}:I={...Ve,position:Pe}:I={position:Pe,top:0,left:0},I[en]="100vw",I[tn]="100vh",Z||(I.opacity=0),I},[R,Pe,$e,We,Ne,O,Ve,Z]),Ke=x.useRef(null);q(()=>{if(!h)return;const I=W.current,G=typeof I=="function"?I():I,X=(on(G)?G.current:G)||null||null;X!==Ke.current&&(le.setPositionReference(X),Ke.current=X)},[h,le,F,W]),x.useEffect(()=>{if(!h)return;const I=W.current;typeof I!="function"&&on(I)&&I.current!==Ke.current&&(le.setPositionReference(I.current),Ke.current=I.current)},[h,le,F,W]),x.useEffect(()=>{if(m&&h&&ne.reference&&ne.floating)return Qt(ne.reference,ne.floating,j,he)},[m,h,ne,j,he]);const Me=J(M),Wt=An(r,Me,z),Vt=Re(M)||"center",$t=!!C.hide?.referenceHidden;q(()=>{v&&h&&Z&&Me!==N&&A(Me)},[v,h,Z,Me,N]);const _t=x.useMemo(()=>({position:"absolute",top:C.arrow?.y,left:C.arrow?.x}),[C.arrow]),zt=C.arrow?.centerOffset!==0;return x.useMemo(()=>({positionerStyles:Ft,arrowStyles:_t,arrowRef:ce,arrowUncentered:zt,side:Wt,align:Vt,physicalSide:Me,anchorHidden:$t,refs:le,context:V,isPositioned:Z,update:j}),[Ft,_t,ce,zt,Wt,Vt,Me,$t,le,V,Z,j])}function on(e){return e!=null&&"current"in e}function cr(e){return e==="starting"?Xn:rn}function Er(e,t,{styles:n,transitionStatus:o,props:r,refs:i,hidden:s,inert:c=!1}){const l={...n};return c&&(l.pointerEvents="none"),Ct("div",e,{state:t,ref:i,props:[{role:"presentation",hidden:s,style:l},cr(o),r],stateAttributesMapping:qn})}const lr=x.createContext(void 0);function Sr(e){return x.useContext(lr)}const ar=20;function Cr(e,t,n,o){const[r,i]=x.useState(!1);q(()=>{if(!e||!t||n==null){i(!1);return}const s=et(n).documentElement.clientWidth,c=n.offsetWidth;i(s>0&&c>0&&c>=s-ar)},[e,t,n]),Un(e&&(!t||r),o)}const Ge=5;function Pr(e,t){const n=fr(t);return e.clientX>=n.left-Ge&&e.clientX<=n.right+Ge&&e.clientY>=n.top-Ge&&e.clientY<=n.bottom+Ge}function fr(e){const t=e.getBoundingClientRect(),n=se(e);if(Gn)return t;const o=n.getComputedStyle(e,"::before"),r=n.getComputedStyle(e,"::after");if(!(o.content!=="none"||r.content!=="none"))return t;const s=parseFloat(o.width)||0,c=parseFloat(o.height)||0,l=parseFloat(r.width)||0,f=parseFloat(r.height)||0,u=Math.max(t.width,s,l),a=Math.max(t.height,c,f),g=u-t.width,d=a-t.height;return{left:t.left-g/2,right:t.right+g/2,top:t.top-d/2,bottom:t.bottom+d/2}}const On=x.createContext(void 0);function ur(){const e=x.useContext(On);if(e===void 0)throw new Error(Wn(13));return e}const En={imageLoadingStatus:()=>null},dr=x.forwardRef(function(t,n){const{className:o,render:r,style:i,...s}=t,[c,l]=x.useState("idle"),f={imageLoadingStatus:c},u=x.useMemo(()=>({imageLoadingStatus:c,setImageLoadingStatus:l}),[c,l]),a=Ct("span",t,{state:f,ref:n,props:s,stateAttributesMapping:En});return Pt.jsx(On.Provider,{value:u,children:a})}),mr=x.forwardRef(function(t,n){const{className:o,render:r,delay:i=0,style:s,...c}=t,{imageLoadingStatus:l}=ur(),[f,u]=x.useState(i===0),a=Mt();return x.useEffect(()=>(i>0?a.start(i,()=>u(!0)):u(!0),a.clear),[a,i]),Ct("span",t,{state:{imageLoadingStatus:l},ref:n,props:c,stateAttributesMapping:En,enabled:l!=="loaded"&&(i===0||f)})});function Mr({className:e,size:t="default",...n}){return Pt.jsx(dr,{"data-slot":"avatar","data-size":t,className:an("group/avatar relative flex size-8 shrink-0 rounded-full select-none after:absolute after:inset-0 after:rounded-full after:border after:border-border after:mix-blend-darken data-[size=lg]:size-10 data-[size=sm]:size-6 dark:after:mix-blend-lighten",e),...n})}function Tr({className:e,...t}){return Pt.jsx(mr,{"data-slot":"avatar-fallback",className:an("flex size-full items-center justify-center rounded-full bg-muted text-sm text-muted-foreground group-data-[size=sm]/avatar:text-xs",e),...t})}export{Mr as A,Er as a,Tr as b,Ar as c,Rr as d,br as e,vr as f,cr as g,Cr as h,Pr as i,Sr as j,Do as p,ot as r,Or as u};
|
|
1
|
+
import{r as x,E as rn,l as U,aJ as we,aF as pe,aK as xe,g as se,aL as Et,aH as Ze,aG as bt,aM as kn,aN as sn,aO as Dn,aP as St,aQ as cn,aR as it,aS as vt,aT as Ht,aU as ln,n as In,e as q,f as ie,ab as Fn,k as Ct,i as Wn,j as Pt,h as an}from"./index-jVSWkcSK.js";import{b as At,e as Nt,g as ht,f as Kt,h as Xe,j as Vn,k as $n}from"./inertValue-D5-xyRX6.js";import{w as Mt,i as pt,a4 as _n,an as fn,a6 as un,Q as zn,ao as Bn,v as ue,K as Hn,ap as Nn,aq as fe,Y as Kn,_ as jn,ar as st,as as ct,at as dn,au as Tt,av as Yn,aw as Xn,B as qn,ax as Un,ay as Gn}from"./dialog-CNe7vaQT.js";import{t as Qn,g as mn,c as Qe,x as xt,r as et,a as Be,B as jt,m as Jn}from"./label-CzNjVuJl.js";import{u as Zn}from"./useValueChanged-ERXEloZc.js";import{u as eo}from"./CompositeList-B4njw0mu.js";const Le=Math.min,de=Math.max,tt=Math.round,qe=Math.floor,me=e=>({x:e,y:e}),to={left:"right",right:"left",bottom:"top",top:"bottom"};function gn(e,t,n){return de(e,Le(t,n))}function ye(e,t){return typeof e=="function"?e(t):e}function J(e){return e.split("-")[0]}function Re(e){return e.split("-")[1]}function Lt(e){return e==="x"?"y":"x"}function kt(e){return e==="y"?"height":"width"}function Q(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function Dt(e){return Lt(Q(e))}function no(e,t,n){n===void 0&&(n=!1);const o=Re(e),r=Dt(e),i=kt(r);let s=r==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=nt(s)),[s,nt(s)]}function oo(e){const t=nt(e);return[Ot(e),t,Ot(t)]}function Ot(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const Yt=["left","right"],Xt=["right","left"],ro=["top","bottom"],io=["bottom","top"];function so(e,t,n){switch(e){case"top":case"bottom":return n?t?Xt:Yt:t?Yt:Xt;case"left":case"right":return t?ro:io;default:return[]}}function co(e,t,n,o){const r=Re(e);let i=so(J(e),n==="start",o);return r&&(i=i.map(s=>s+"-"+r),t&&(i=i.concat(i.map(Ot)))),i}function nt(e){const t=J(e);return to[t]+e.slice(t.length)}function lo(e){var t,n,o,r;return{top:(t=e.top)!=null?t:0,right:(n=e.right)!=null?n:0,bottom:(o=e.bottom)!=null?o:0,left:(r=e.left)!=null?r:0}}function hn(e){return typeof e!="number"?lo(e):{top:e,right:e,bottom:e,left:e}}function ot(e){const{x:t,y:n,width:o,height:r}=e;return{width:o,height:r,top:n,left:t,right:t+o,bottom:n+r,x:t,y:n}}function Rr(e,t={}){const{enabled:n=!0,event:o="click",toggle:r=!0,ignoreMouse:i=!1,stickIfOpen:s=!0,touchOpenDelay:c=0,reason:l=Qn}=t,f="rootStore"in e?e.rootStore:e,u=f.context.dataRef,a=x.useRef(void 0),g=At(),d=Mt(),m=x.useMemo(()=>{function p(y,w,E,R){const v=Qe(l,w,E);y&&R==="touch"&&c>0?d.start(c,()=>{f.setOpen(!0,v)}):f.setOpen(y,v)}function h(y,w,E){const R=u.current.openEvent,v=f.select("domReferenceElement")!==w;return y&&v||!y||!r?!0:R&&s?!E(R.type):!1}return{onPointerDown(y){a.current=pt(y.pointerType,!0)&&fn(y.nativeEvent)?"virtual":y.pointerType},onMouseDown(y){const w=a.current,E=y.nativeEvent,R=f.select("open");if(y.button!==0||o==="click"||pt(w,!0)&&i)return;const v=h(R,y.currentTarget,A=>A==="click"||A==="mousedown"),S=mn(E);if(_n(S)){p(v,E,S,w);return}const P=y.currentTarget;g.request(()=>{p(v,E,P,w)})},onClick(y){if(o==="mousedown-only")return;const w=a.current;if(o==="mousedown"&&w){a.current=void 0;return}if(pt(w,!0)&&i)return;const E=f.select("open"),R=h(E,y.currentTarget,v=>v==="click"||v==="mousedown"||v==="keydown"||v==="keyup");p(R,y.nativeEvent,y.currentTarget,w)},onKeyDown(){a.current=void 0}}},[u,o,i,l,f,s,r,g,d,c]);return x.useMemo(()=>n?{reference:m}:rn,[n,m])}function qt(e,t,n){let{reference:o,floating:r}=e;const i=Q(t),s=Dt(t),c=kt(s),l=J(t),f=i==="y",u=o.x+o.width/2-r.width/2,a=o.y+o.height/2-r.height/2,g=o[c]/2-r[c]/2;let d;switch(l){case"top":d={x:u,y:o.y-r.height};break;case"bottom":d={x:u,y:o.y+o.height};break;case"right":d={x:o.x+o.width,y:a};break;case"left":d={x:o.x-r.width,y:a};break;default:d={x:o.x,y:o.y}}const m=Re(t);return m&&(d[s]+=g*(m==="end"?1:-1)*(n&&f?-1:1)),d}async function ao(e,t){var n;t===void 0&&(t={});const{x:o,y:r,platform:i,rects:s,elements:c,strategy:l}=e,{boundary:f="clippingAncestors",rootBoundary:u="viewport",elementContext:a="floating",altBoundary:g=!1,padding:d=0}=ye(t,e),m=hn(d),h=c[g?a==="floating"?"reference":"floating":a],y=ot(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(h)))==null||n?h:h.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(c.floating)),boundary:f,rootBoundary:u,strategy:l})),w=a==="floating"?{x:o,y:r,width:s.floating.width,height:s.floating.height}:s.reference,E=await(i.getOffsetParent==null?void 0:i.getOffsetParent(c.floating)),R=await(i.isElement==null?void 0:i.isElement(E))&&await(i.getScale==null?void 0:i.getScale(E))||{x:1,y:1},v=ot(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:w,offsetParent:E,strategy:l}):w);return{top:(y.top-v.top+m.top)/R.y,bottom:(v.bottom-y.bottom+m.bottom)/R.y,left:(y.left-v.left+m.left)/R.x,right:(v.right-y.right+m.right)/R.x}}const fo=50,uo=async(e,t,n)=>{const{placement:o="bottom",strategy:r="absolute",middleware:i=[],platform:s}=n,c=s.detectOverflow?s:{...s,detectOverflow:ao},l=await(s.isRTL==null?void 0:s.isRTL(t));let f=await s.getElementRects({reference:e,floating:t,strategy:r}),{x:u,y:a}=qt(f,o,l),g=o,d=0;const m={};for(let p=0;p<i.length;p++){const h=i[p];if(!h)continue;const{name:y,fn:w}=h,{x:E,y:R,data:v,reset:S}=await w({x:u,y:a,initialPlacement:o,placement:g,strategy:r,middlewareData:m,rects:f,platform:c,elements:{reference:e,floating:t}});u=E??u,a=R??a,m[y]={...m[y],...v},S&&d<fo&&(d++,typeof S=="object"&&(S.placement&&(g=S.placement),S.rects&&(f=S.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:r}):S.rects),{x:u,y:a}=qt(f,g,l)),p=-1)}return{x:u,y:a,placement:g,strategy:r,middlewareData:m}},mo=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,o;const{placement:r,middlewareData:i,rects:s,initialPlacement:c,platform:l,elements:f}=t,{mainAxis:u=!0,crossAxis:a=!0,fallbackPlacements:g,fallbackStrategy:d="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:p=!0,...h}=ye(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const y=J(r),w=Q(c),E=J(c)===c,R=await(l.isRTL==null?void 0:l.isRTL(f.floating)),v=g||(E||!p?[nt(c)]:oo(c)),S=m!=="none";!g&&S&&v.push(...co(c,p,m,R));const P=[c,...v],A=await l.detectOverflow(t,h),k=[];let L=((o=i.flip)==null?void 0:o.overflows)||[];if(u&&k.push(A[y]),a){const T=no(r,s,R);k.push(A[T[0]],A[T[1]])}if(L=[...L,{placement:r,overflows:k}],!k.every(T=>T<=0)){var D,K;const T=(((D=i.flip)==null?void 0:D.index)||0)+1,$=P[T];if($&&(!(a==="alignment"?w!==Q($):!1)||L.every(b=>Q(b.placement)===w?b.overflows[0]>0:!0)))return{data:{index:T,overflows:L},reset:{placement:$}};let F=(K=L.filter(W=>W.overflows[0]<=0).sort((W,b)=>W.overflows[1]-b.overflows[1])[0])==null?void 0:K.placement;if(!F)switch(d){case"bestFit":{var H;const W=(H=L.filter(b=>{if(S){const _=Q(b.placement);return _===w||_==="y"}return!0}).map(b=>[b.placement,b.overflows.filter(_=>_>0).reduce((_,z)=>_+z,0)]).sort((b,_)=>b[1]-_[1])[0])==null?void 0:H[0];W&&(F=W);break}case"initialPlacement":F=c;break}if(r!==F)return{reset:{placement:F}}}return{}}}},pn=new Set(["left","top"]);async function go(e,t){const{placement:n,platform:o,elements:r}=e,i=await(o.isRTL==null?void 0:o.isRTL(r.floating)),s=J(n),c=Re(n),l=Q(n)==="y",f=pn.has(s)?-1:1,u=i&&l?-1:1,a=ye(t,e);let{mainAxis:g,crossAxis:d,alignmentAxis:m}=typeof a=="number"?{mainAxis:a,crossAxis:0,alignmentAxis:null}:{mainAxis:a.mainAxis||0,crossAxis:a.crossAxis||0,alignmentAxis:a.alignmentAxis};return c&&typeof m=="number"&&(d=c==="end"?m*-1:m),l?{x:d*u,y:g*f}:{x:g*f,y:d*u}}const ho=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,o;const{x:r,y:i,placement:s,middlewareData:c}=t,l=await go(t,e);return s===((n=c.offset)==null?void 0:n.placement)&&(o=c.arrow)!=null&&o.alignmentOffset?{}:{x:r+l.x,y:i+l.y,data:{...l,placement:s}}}}},po=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:o,placement:r,platform:i}=t,{mainAxis:s=!0,crossAxis:c=!1,limiter:l={fn:w=>{let{x:E,y:R}=w;return{x:E,y:R}}},...f}=ye(e,t),u={x:n,y:o},a=await i.detectOverflow(t,f),g=Q(r),d=Lt(g);let m=u[d],p=u[g];const h=(w,E)=>gn(E+a[w==="y"?"top":"left"],E,E-a[w==="y"?"bottom":"right"]);s&&(m=h(d,m)),c&&(p=h(g,p));const y=l.fn({...t,[d]:m,[g]:p});return{...y,data:{x:y.x-n,y:y.y-o,enabled:{[d]:s,[g]:c}}}}}},xo=function(e){return e===void 0&&(e={}),{options:e,fn(t){var n,o;const{x:r,y:i,placement:s,rects:c,middlewareData:l}=t,{offset:f=0,mainAxis:u=!0,crossAxis:a=!0}=ye(e,t),g={x:r,y:i},d=Q(s),m=Lt(d);let p=g[m],h=g[d];const y=ye(f,t),w=typeof y=="number"?{mainAxis:y,crossAxis:0}:{mainAxis:(n=y.mainAxis)!=null?n:0,crossAxis:(o=y.crossAxis)!=null?o:0};if(u){const v=m==="y"?"height":"width",S=c.reference[m]-c.floating[v]+w.mainAxis,P=c.reference[m]+c.reference[v]-w.mainAxis;p<S?p=S:p>P&&(p=P)}if(a){var E,R;const v=m==="y"?"width":"height",S=pn.has(J(s)),P=c.reference[d]-c.floating[v]+(S&&((E=l.offset)==null?void 0:E[d])||0)+(S?0:w.crossAxis),A=c.reference[d]+c.reference[v]+(S?0:((R=l.offset)==null?void 0:R[d])||0)-(S?w.crossAxis:0);h<P?h=P:h>A&&(h=A)}return{[m]:p,[d]:h}}}},yo=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:o,platform:r,elements:i}=t,{apply:s=()=>{},...c}=ye(e,t),l=await r.detectOverflow(t,c),f=J(n),u=Re(n),a=Q(n)==="y",{width:g,height:d}=o.floating;let m,p;f==="top"||f==="bottom"?(m=f,p=u===(await(r.isRTL==null?void 0:r.isRTL(i.floating))?"start":"end")?"left":"right"):(p=f,m=u==="end"?"top":"bottom");const h=d-l.top-l.bottom,y=g-l.left-l.right,w=Le(d-l[m],h),E=Le(g-l[p],y),R=t.middlewareData.shift,v=!R;let S=w,P=E;R!=null&&R.enabled.x&&(P=y),R!=null&&R.enabled.y&&(S=h),v&&!u&&(a?P=g-2*de(l.left,l.right):S=d-2*de(l.top,l.bottom)),await s({...t,availableWidth:P,availableHeight:S});const A=await r.getDimensions(i.floating);return g!==A.width||d!==A.height?{reset:{rects:!0}}:{}}}};function xn(e){const t=xe(e);let n=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const r=pe(e),i=r?e.offsetWidth:n,s=r?e.offsetHeight:o,c=tt(n)!==i||tt(o)!==s;return c&&(n=i,o=s),{width:n,height:o,$:c}}function It(e){return U(e)?e:e.contextElement}function Te(e){const t=It(e);if(!pe(t))return me(1);const n=t.getBoundingClientRect(),{width:o,height:r,$:i}=xn(t);let s=(i?tt(n.width):n.width)/o,c=(i?tt(n.height):n.height)/r;return(!s||!Number.isFinite(s))&&(s=1),(!c||!Number.isFinite(c))&&(c=1),{x:s,y:c}}const wo=me(0);function yn(e){const t=se(e);return!ln()||!t.visualViewport?wo:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Ro(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===se(e)}function Ae(e,t,n,o){t===void 0&&(t=!1),n===void 0&&(n=!1);const r=e.getBoundingClientRect(),i=It(e);let s=me(1);t&&(o?U(o)&&(s=Te(o)):s=Te(e));const c=Ro(i,n,o)?yn(i):me(0);let l=(r.left+c.x)/s.x,f=(r.top+c.y)/s.y,u=r.width/s.x,a=r.height/s.y;if(i&&o){const g=se(i),d=U(o)?se(o):o;let m=g,p=Ht(m);for(;p&&d!==m;){const h=Te(p),y=p.getBoundingClientRect(),w=xe(p),E=y.left+(p.clientLeft+parseFloat(w.paddingLeft))*h.x,R=y.top+(p.clientTop+parseFloat(w.paddingTop))*h.y;l*=h.x,f*=h.y,u*=h.x,a*=h.y,l+=E,f+=R,m=se(p),p=Ht(m)}}return ot({width:u,height:a,x:l,y:f})}function lt(e,t){const n=it(e).scrollLeft;return t?t.left+n:Ae(we(e)).left+n}function wn(e,t){const n=e.getBoundingClientRect(),o=n.left+t.scrollLeft-lt(e,n),r=n.top+t.scrollTop;return{x:o,y:r}}function bo(e){let{elements:t,rect:n,offsetParent:o,strategy:r}=e;const i=r==="fixed",s=we(o),c=t?Et(t.floating):!1;if(o===s||c&&i)return n;let l={scrollLeft:0,scrollTop:0},f=me(1);const u=me(0),a=pe(o);if((a||!i)&&((St(o)!=="body"||cn(s))&&(l=it(o)),a)){const d=Ae(o);f=Te(o),u.x=d.x+o.clientLeft,u.y=d.y+o.clientTop}const g=s&&!a&&!i?wn(s,l):me(0);return{width:n.width*f.x,height:n.height*f.y,x:n.x*f.x-l.scrollLeft*f.x+u.x+g.x,y:n.y*f.y-l.scrollTop*f.y+u.y+g.y}}function vo(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function Ao(e){const t=it(e),n=e.ownerDocument.body,o=de(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),r=de(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight);let i=-t.scrollLeft+lt(e);const s=-t.scrollTop;return xe(n).direction==="rtl"&&(i+=de(e.clientWidth,n.clientWidth)-o),{width:o,height:r,x:i,y:s}}const Oo=25;function Eo(e,t,n){n===void 0&&(n="viewport");const o=n==="layoutViewport",r=se(e),i=we(e),s=r.visualViewport;let c=i.clientWidth,l=i.clientHeight,f=0,u=0;if(s){const g=!ln()||t==="fixed";o?g||(f=-s.offsetLeft,u=-s.offsetTop):(c=s.width,l=s.height,g&&(f=s.offsetLeft,u=s.offsetTop))}if(lt(i)<=0){const g=i.ownerDocument,d=g.body,m=getComputedStyle(d),p=g.compatMode==="CSS1Compat"&&parseFloat(m.marginLeft)+parseFloat(m.marginRight)||0,h=Math.abs(i.clientWidth-d.clientWidth-p),y=getComputedStyle(i).scrollbarGutter==="stable both-edges"?h/2:h;y<=Oo&&(c-=y)}return{width:c,height:l,x:f,y:u}}function So(e,t){const n=Ae(e,!0,t==="fixed"),o=n.top+e.clientTop,r=n.left+e.clientLeft,i=Te(e),s=e.clientWidth*i.x,c=e.clientHeight*i.y,l=r*i.x,f=o*i.y;return{width:s,height:c,x:l,y:f}}function Ut(e,t,n){let o;if(t==="viewport"||t==="layoutViewport")o=Eo(e,n,t);else if(t==="document")o=Ao(we(e));else if(U(t))o=So(t,n);else{const r=yn(e);o={x:t.x-r.x,y:t.y-r.y,width:t.width,height:t.height}}return ot(o)}function Co(e,t){const n=t.get(e);if(n)return n;let o=vt(e,[],!1).filter(c=>U(c)&&St(c)!=="body"),r=null;const i=xe(e).position==="fixed";let s=i?Ze(e):e;for(;U(s)&&!bt(s);){const c=xe(s),l=sn(s),f=r?r.position:i?"fixed":"";!l&&(f==="fixed"||f==="absolute"&&c.position==="static")?o=o.filter(a=>a!==s):r=c,s=Ze(s)}return t.set(e,o),o}function Po(e){let{element:t,boundary:n,rootBoundary:o,strategy:r}=e;const s=[...n==="clippingAncestors"?Et(t)?[]:Co(t,this._c):[].concat(n),o],c=Ut(t,s[0],r);let l=c.top,f=c.right,u=c.bottom,a=c.left;for(let g=1;g<s.length;g++){const d=Ut(t,s[g],r);l=de(d.top,l),f=Le(d.right,f),u=Le(d.bottom,u),a=de(d.left,a)}return{width:f-a,height:u-l,x:a,y:l}}function Mo(e){const{width:t,height:n}=xn(e);return{width:t,height:n}}function To(e,t,n){const o=pe(t),r=we(t),i=n==="fixed",s=Ae(e,!0,i,t);let c={scrollLeft:0,scrollTop:0};const l=me(0);if((o||!i)&&((St(t)!=="body"||cn(r))&&(c=it(t)),o)){const g=Ae(t,!0,i,t);l.x=g.x+t.clientLeft,l.y=g.y+t.clientTop}!o&&r&&(l.x=lt(r));const f=r&&!o&&!i?wn(r,c):me(0),u=s.left+c.scrollLeft-l.x-f.x,a=s.top+c.scrollTop-l.y-f.y;return{x:u,y:a,width:s.width,height:s.height}}function yt(e){return xe(e).position==="static"}function Gt(e,t){if(!pe(e)||xe(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return we(e)===n&&(n=n.ownerDocument.body),n}function Rn(e,t){const n=se(e);if(Et(e))return n;if(!pe(e)){let r=Ze(e);for(;r&&!bt(r);){if(U(r)&&!yt(r))return r;r=Ze(r)}return n}let o=Gt(e,t);for(;o&&kn(o)&&yt(o);)o=Gt(o,t);return o&&bt(o)&&yt(o)&&!sn(o)?n:o||Dn(e)||n}const Lo=async function(e){const t=this.getOffsetParent||Rn,n=this.getDimensions,o=await n(e.floating);return{reference:To(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function ko(e){return xe(e).direction==="rtl"}const Do={convertOffsetParentRelativeRectToViewportRelativeRect:bo,getDocumentElement:we,getClippingRect:Po,getOffsetParent:Rn,getElementRects:Lo,getClientRects:vo,getDimensions:Mo,getScale:Te,isElement:U,isRTL:ko};function bn(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Io(e,t,n){let o=null,r;const i=we(e);function s(){var u;clearTimeout(r),(u=o)==null||u.disconnect(),o=null}function c(u,a){u===void 0&&(u=!1),a===void 0&&(a=1),s();const g=e.getBoundingClientRect(),{left:d,top:m,width:p,height:h}=g;if(u||t(),!p||!h)return;const y=qe(m),w=qe(i.clientWidth-(d+p)),E=qe(i.clientHeight-(m+h)),R=qe(d),S={rootMargin:-y+"px "+-w+"px "+-E+"px "+-R+"px",threshold:de(0,Le(1,a))||1};let P=!0;function A(k){const L=k[0].intersectionRatio;if(!bn(g,e.getBoundingClientRect()))return c();if(L!==a){if(!P)return c();L?c(!1,L):r=setTimeout(()=>{c(!1,1e-7)},1e3)}P=!1}try{o=new IntersectionObserver(A,{...S,root:i.ownerDocument})}catch{o=new IntersectionObserver(A,S)}o.observe(e)}const l=se(e),f=()=>c(n);return l.addEventListener("resize",f),c(!0),()=>{l.removeEventListener("resize",f),s()}}function Qt(e,t,n,o){o===void 0&&(o={});const{ancestorScroll:r=!0,ancestorResize:i=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:l=!1}=o,f=It(e),u=r||i?[...f?vt(f):[],...t?vt(t):[]]:[];u.forEach(y=>{r&&y.addEventListener("scroll",n),i&&y.addEventListener("resize",n)});const a=f&&c?Io(f,n,i):null;let g=-1,d=null;s&&(d=new ResizeObserver(y=>{let[w]=y;w&&w.target===f&&d&&t&&(d.unobserve(t),cancelAnimationFrame(g),g=requestAnimationFrame(()=>{var E;(E=d)==null||E.observe(t)})),n()}),f&&!l&&d.observe(f),t&&d.observe(t));let m,p=l?Ae(e):null;l&&h();function h(){const y=Ae(e);p&&!bn(p,y)&&n(),p=y,m=requestAnimationFrame(h)}return n(),()=>{var y;u.forEach(w=>{r&&w.removeEventListener("scroll",n),i&&w.removeEventListener("resize",n)}),a?.(),(y=d)==null||y.disconnect(),d=null,l&&cancelAnimationFrame(m)}}const Fo=ho,Wo=po,Vo=mo,$o=yo,_o=xo,zo=(e,t,n)=>{const o=new Map,r=n??{},i={...Do,...r.platform,_c:o};return uo(e,t,{...r,platform:i})};var Bo=typeof document<"u",Ho=function(){},Je=Bo?x.useLayoutEffect:Ho;function rt(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,o,r;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(o=n;o--!==0;)if(!rt(e[o],t[o]))return!1;return!0}if(r=Object.keys(e),n=r.length,n!==Object.keys(t).length)return!1;for(o=n;o--!==0;)if(!{}.hasOwnProperty.call(t,r[o]))return!1;for(o=n;o--!==0;){const i=r[o];if(!(i==="_owner"&&e.$$typeof)&&!rt(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function vn(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Jt(e,t){const n=vn(e);return Math.round(t*n)/n}function wt(e){const t=x.useRef(e);return Je(()=>{t.current=e}),t}function No(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:o=[],platform:r,elements:{reference:i,floating:s}={},transform:c=!0,whileElementsMounted:l,open:f}=e,[u,a]=x.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[g,d]=x.useState(o);rt(g,o)||d(o);const[m,p]=x.useState(null),[h,y]=x.useState(null),w=x.useCallback(b=>{b!==S.current&&(S.current=b,p(b))},[]),E=x.useCallback(b=>{b!==P.current&&(P.current=b,y(b))},[]),R=i||m,v=s||h,S=x.useRef(null),P=x.useRef(null),A=x.useRef(u),k=l!=null,L=wt(l),D=wt(r),K=wt(f),H=x.useCallback(()=>{if(!S.current||!P.current)return;const b={placement:t,strategy:n,middleware:g};D.current&&(b.platform=D.current),zo(S.current,P.current,b).then(_=>{const z={..._,isPositioned:K.current!==!1};T.current&&!rt(A.current,z)&&(A.current=z,In.flushSync(()=>{a(z)}))})},[g,t,n,D,K]);Je(()=>{f===!1&&A.current.isPositioned&&(A.current.isPositioned=!1,a(b=>({...b,isPositioned:!1})))},[f]);const T=x.useRef(!1);Je(()=>(T.current=!0,()=>{T.current=!1}),[]),Je(()=>{if(R&&(S.current=R),v&&(P.current=v),R&&v){if(L.current)return L.current(R,v,H);H()}},[R,v,H,L,k]);const $=x.useMemo(()=>({reference:S,floating:P,setReference:w,setFloating:E}),[w,E]),F=x.useMemo(()=>({reference:R,floating:v}),[R,v]),W=x.useMemo(()=>{const b={position:n,left:0,top:0};if(!F.floating)return b;const _=Jt(F.floating,u.x),z=Jt(F.floating,u.y);return c?{...b,transform:"translate("+_+"px, "+z+"px)",...vn(F.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:_,top:z}},[n,c,F.floating,u.x,u.y]);return x.useMemo(()=>({...u,update:H,refs:$,elements:F,floatingStyles:W}),[u,H,$,F,W])}const Ko=(e,t)=>{const n=Fo(e);return{name:n.name,fn:n.fn,options:[e,t]}},jo=(e,t)=>{const n=Wo(e);return{name:n.name,fn:n.fn,options:[e,t]}},Yo=(e,t)=>({fn:_o(e).fn,options:[e,t]}),Xo=(e,t)=>{const n=Vo(e);return{name:n.name,fn:n.fn,options:[e,t]}},qo=(e,t)=>{const n=$o(e);return{name:n.name,fn:n.fn,options:[e,t]}};function Uo(e){return Go(e,e.rootContext)}function Go(e,t){const{nodeId:n,externalTree:o}=e,r=t.useState("referenceElement"),i=t.useState("floatingElement"),s=t.useState("domReferenceElement"),c=t.useState("open"),l=t.useState("floatingId"),[f,u]=x.useState(null),[a,g]=x.useState(void 0),[d,m]=x.useState(void 0),p=x.useRef(null),h=un(o),y=x.useMemo(()=>({reference:r,floating:i,domReference:s}),[r,i,s]),w=No({...e,elements:{...y,...f&&{reference:f}}}),E=U(a)?a:null,R=d===void 0?t.state.floatingElement:d;t.useSyncedValue("referenceElement",a??null),t.useSyncedValue("domReferenceElement",a===void 0?s:E),t.useSyncedValue("floatingElement",R);const v=x.useCallback(D=>{const K=U(D)?{getBoundingClientRect:()=>D.getBoundingClientRect(),getClientRects:()=>D.getClientRects(),contextElement:D}:D;u(K),w.refs.setReference(K)},[w.refs]),S=x.useCallback(D=>{(U(D)||D===null)&&(p.current=D,g(D)),(U(w.refs.reference.current)||w.refs.reference.current===null||D!==null&&!U(D))&&w.refs.setReference(D)},[w.refs,g]),P=x.useCallback(D=>{m(D),w.refs.setFloating(D)},[w.refs]),A=x.useMemo(()=>({...w.refs,setReference:S,setFloating:P,setPositionReference:v,domReference:p}),[w.refs,S,P,v]),k=x.useMemo(()=>({...w.elements,domReference:s}),[w.elements,s]),L=x.useMemo(()=>({...w,dataRef:t.context.dataRef,open:c,onOpenChange:t.setOpen,events:t.context.events,floatingId:l,refs:A,elements:k,nodeId:n,rootStore:t}),[w,A,k,n,t,c,l]);return q(()=>{s&&(p.current=s)},[s]),q(()=>{t.context.dataRef.current.floatingContext=L;const D=h?.nodesRef.current.find(K=>K.id===n);D&&(D.context=L)}),x.useMemo(()=>({...w,context:L,refs:A,elements:k,rootStore:t}),[w,A,k,L,t])}const Qo="Escape";function Zt(e){return Kn&&e.movementX===0&&e.movementY===0}function at(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function Ue(e,t){return at(t,e===dn||e===Tt,e===st||e===ct)}function Rt(e,t,n){return at(t,e===Tt,n?e===st:e===ct)||e==="Enter"||e===" "||e===""}function Jo(e,t,n){return at(t,n?e===st:e===ct,e===Tt)}function Zo(e,t,n,o){const r=n?e===ct:e===st,i=e===dn;return t==="both"||t==="horizontal"&&o?e===Qo:at(t,r,i)}function br(e,t){const{listRef:n,activeIndex:o,onNavigate:r=()=>{},enabled:i=!0,selectedIndex:s=null,allowEscape:c=!1,loopFocus:l=!1,nested:f=!1,rtl:u=!1,virtual:a=!1,focusItemOnOpen:g="auto",focusItemOnHover:d=!0,openOnArrowKeyDown:m=!0,disabledIndices:p=void 0,orientation:h="vertical",parentOrientation:y,id:w,resetOnPointerLeave:E=!0,externalTree:R,grid:v}=t,S=v!=null,P="rootStore"in e?e.rootStore:e,A=P.useState("open"),k=P.useState("floatingElement"),L=P.useState("domReferenceElement"),D=P.context.dataRef,K=zn(k),H=Bn(L),T=ue(K),$=Hn(),F=un(R),W=x.useRef(g),b=x.useRef(s??-1),_=x.useRef(null),z=x.useRef(!0),N=ie(O=>{r(b.current===-1?null:b.current,O)}),be=x.useRef(!!k),B=x.useRef(A),Y=x.useRef(!1),Oe=x.useRef(!1),ke=x.useRef(null),ft=ue(p),Ee=ue(A),ee=ue(s),ce=ue(E),De=At(),Se=At(),Ie=ie(()=>{function O(V){a?F?.events.emit("virtualfocus",V):ke.current=Nn(V,{sync:Y.current,preventScroll:!0})}const C=n.current[b.current],j=Oe.current;C&&O(C),(Y.current?V=>V():V=>De.request(V))(()=>{const V=n.current[b.current]||C;if(!V)return;C||O(V),Ce&&(j||!z.current)&&V.scrollIntoView?.({block:"nearest",inline:"nearest"})})});q(()=>{D.current.orientation=h},[D,h]),q(()=>{i&&(A&&k?(b.current=s??-1,W.current&&s!=null&&(Oe.current=!0,N())):be.current&&(b.current=-1,N()))},[i,A,k,s,N]),q(()=>{if(i){if(!A){Y.current=!1;return}if(k)if(o==null){if(Y.current=!1,ee.current!=null)return;if(be.current&&(b.current=-1,Ie()),(!B.current||!be.current)&&W.current&&(_.current!=null||W.current===!0&&_.current==null)){let O=0;const C=()=>{n.current[0]==null?(O<2&&(O?M=>Se.request(M):queueMicrotask)(C),O+=1):(b.current=_.current==null||Rt(_.current,h,u)||f?ht(n):Kt(n),_.current=null,N())};C()}}else Nt(n.current,o)||(b.current=o,Ie(),Oe.current=!1)}},[i,A,k,o,ee,f,n,h,u,N,Ie,Se]),q(()=>{if(!i||k||!F||a||!be.current)return;const O=F.nodesRef.current,C=O.find(V=>V.id===$)?.context?.elements.floating,j=xt(et(L??C??null)),M=O.some(V=>V.context&&Be(V.context.elements.floating,j));C&&!M&&z.current&&C.focus({preventScroll:!0})},[i,k,L,F,$,a]),q(()=>{B.current=A,be.current=!!k}),q(()=>{A||(_.current=null,W.current=g)},[A,g]);const He=o!=null,te=ie(O=>{if(!Ee.current)return;const C=n.current.indexOf(O.currentTarget);C!==-1&&(b.current!==C||o!==C)&&(b.current=C,N(O))}),ve=ie(()=>y??F?.nodesRef.current.find(O=>O.id===$)?.context?.dataRef?.current.orientation),Fe=ie(()=>ht(n,ft.current)),ge=ie(O=>{if(z.current=!1,Y.current=!0,O.which===229||!Ee.current&&O.currentTarget===T.current)return;if(f&&Zo(O.key,h,u,S)){Ue(O.key,ve())||fe(O),P.setOpen(!1,Qe(jt,O.nativeEvent)),pe(L)&&(a?F?.events.emit("virtualfocus",L):L.focus());return}const C=b.current,j=ht(n,p),M=Kt(n,p);if(H||(O.key==="Home"&&(fe(O),b.current=j,N(O)),O.key==="End"&&(fe(O),b.current=M,N(O))),v!=null){const V=v(O,b.current,n,h,l,u,p,j,M);if(V!=null&&(b.current=V,N(O)),h==="both")return}if(Ue(O.key,h)){if(fe(O),A&&!a&&xt(O.currentTarget.ownerDocument)===O.currentTarget){b.current=Rt(O.key,h,u)?j:M,N(O);return}Rt(O.key,h,u)?l?C>=M?c&&C!==n.current.length?b.current=-1:(Y.current=!1,b.current=j):b.current=Xe(n.current,{startingIndex:C,disabledIndices:p}):b.current=Math.min(M,Xe(n.current,{startingIndex:C,disabledIndices:p})):l?C<=j?c&&C!==-1?b.current=n.current.length:(Y.current=!1,b.current=M):b.current=Xe(n.current,{startingIndex:C,decrement:!0,disabledIndices:p}):b.current=Math.max(j,Xe(n.current,{startingIndex:C,decrement:!0,disabledIndices:p})),Nt(n.current,b.current)&&(b.current=-1),N(O)}}),Ce=x.useMemo(()=>({onFocus(C){Y.current=!0,te(C)},onClick:({currentTarget:C})=>C.focus({preventScroll:!0}),onMouseMove(C){Zt(C)||(Y.current=!0,Oe.current=!1,d&&te(C))},onPointerLeave(C){if(!Ee.current||!z.current||C.pointerType==="touch")return;Y.current=!0;const j=C.relatedTarget;if(!(!d||n.current.includes(j))&&ce.current&&(ke.current?.(),ke.current=null,b.current=-1,N(C),!a)){const M=T.current,V=xt(et(M));M&&Be(M,V)&&M.focus({preventScroll:!0})}}}),[te,Ee,T,d,n,N,ce,a]),he=x.useMemo(()=>a&&A&&He&&{"aria-activedescendant":`${w}-${o}`},[a,A,He,w,o]),le=x.useMemo(()=>({"aria-orientation":h==="both"?void 0:h,...H?{}:he,onKeyDown(O){if(O.key==="Tab"&&O.shiftKey&&A&&!a){const C=mn(O.nativeEvent);if(C&&!Be(T.current,C))return;fe(O),P.setOpen(!1,Qe(Jn,O.nativeEvent)),pe(L)&&L.focus();return}ge(O)},onPointerMove(O){Zt(O)||(z.current=!0)}}),[he,ge,T,h,H,P,A,a,L]),ne=x.useMemo(()=>{function O(M){P.setOpen(!0,Qe(jt,M.nativeEvent,M.currentTarget))}function C(M){g==="auto"&&jn(M.nativeEvent)&&(W.current=!a)}function j(M){W.current=g,g==="auto"&&fn(M.nativeEvent)&&(W.current=!0)}return{onKeyDown(M){const V=P.select("open");z.current=!1;const Z=M.key.startsWith("Arrow"),Ve=Jo(M.key,ve(),u),$e=Ue(M.key,h),Ne=(f?Ve:$e)||M.key==="Enter"||M.key.trim()==="";if(a&&V)return ge(M);if(!(!V&&!m&&Z)){if(Ne){const Pe=Ue(M.key,ve());_.current=f&&Pe?null:M.key}if(f){Ve&&(fe(M),V?(b.current=Fe(),N(M)):O(M));return}$e&&(ee.current!=null&&(b.current=ee.current),fe(M),!V&&m?O(M):ge(M),V&&N(M))}},onFocus(M){P.select("open")&&!a&&(b.current=-1,N(M))},onPointerDown:j,onPointerEnter:j,onMouseDown:C,onClick:C}},[ge,g,Fe,f,N,P,m,h,ve,u,ee,a]),We=x.useMemo(()=>({...he,...ne}),[he,ne]);return x.useMemo(()=>i?{reference:We,floating:le,item:Ce,trigger:ne}:{},[i,We,le,ne,Ce])}function vr(e,t){const{listRef:n,elementsRef:o,activeIndex:r,onMatch:i,disabledIndices:s,onTyping:c,enabled:l=!0,resetMs:f=750,selectedIndex:u=null}=t,a="rootStore"in e?e.rootStore:e,g=a.useState("open"),d=Mt(),m=x.useRef(""),p=x.useRef(u??r??-1),h=x.useRef(null),y=ie(R=>{function v(T){return o?.current[T]}function S(T){const $=v(T);return $&&!Vn($)||$?.matches(":disabled")?!1:s==null||!$n(Fn,T,s)}function P(T,$,F=0){if(T.length===0)return-1;const W=(F%T.length+T.length)%T.length,b=$.toLowerCase();for(let _=0;_<T.length;_+=1){const z=(W+_)%T.length;if(!(!T[z]?.toLowerCase().startsWith(b)||!S(z)))return z}return-1}const A=n.current;if(m.current.length>0&&R.key===" "&&(fe(R),c?.(!0)),m.current.length>0&&m.current[0]!==" "&&P(A,m.current)===-1&&R.key!==" "&&c?.(!1),A==null||R.key.length!==1||R.ctrlKey||R.metaKey||R.altKey)return;g&&R.key!==" "&&(fe(R),c?.(!0));const k=m.current==="";k&&(p.current=u??r??-1),A.every((T,$)=>T&&S($)?T[0]?.toLowerCase()!==T[1]?.toLowerCase():!0)&&m.current===R.key&&(m.current="",p.current=h.current),m.current+=R.key,d.start(f,()=>{m.current="",p.current=h.current,c?.(!1)});const K=((k?u??r??-1:p.current)??0)+1,H=P(A,m.current,K);H!==-1?(i?.(H),h.current=H):R.key!==" "&&(m.current="",c?.(!1))}),w=ie(R=>{const v=R.relatedTarget,S=a.select("domReferenceElement"),P=a.select("floatingElement");Be(S,v)||Be(P,v)||(d.clear(),m.current="",p.current=h.current,c?.(!1))});q(()=>{!g&&u!==null||(d.clear(),h.current=null,m.current!==""&&(m.current=""))},[g,u,d]);const E=x.useMemo(()=>({onKeyDown:y,onBlur:w}),[y,w]);return x.useMemo(()=>l?{reference:E,floating:E}:{},[l,E])}function er(e){const t=x.useRef(""),n=x.useCallback(r=>{r.defaultPrevented||(t.current=r.pointerType,e(r,r.pointerType))},[e]);return{onClick:x.useCallback(r=>{if(r.detail===0){e(r,"keyboard");return}"pointerType"in r?e(r,r.pointerType):e(r,t.current),t.current=""},[e]),onPointerDown:n}}function tr(e,t){const n=ie((i,s)=>{(typeof e=="function"?e():e)||t(s||(Yn?"touch":""))}),{onClick:o,onPointerDown:r}=er(n);return x.useMemo(()=>({onClick:o,onPointerDown:r}),[o,r])}function Ar(e){const[t,n]=x.useState(null),o=tr(e,n);return Zn(e,r=>{r&&!e&&n(null)}),x.useMemo(()=>({openMethod:t,triggerProps:o}),[t,o])}const nr=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:o,placement:r,rects:i,platform:s,elements:c,middlewareData:l}=t,{element:f,padding:u=0,offsetParent:a="real"}=ye(e,t)||{};if(f==null)return{};const g=hn(u),d={x:n,y:o},m=Dt(r),p=kt(m),h=await s.getDimensions(f),y=m==="y",w=y?"top":"left",E=y?"bottom":"right",R=y?"clientHeight":"clientWidth",v=i.reference[p]+i.reference[m]-d[m]-i.floating[p],S=d[m]-i.reference[m],P=a==="real"?await s.getOffsetParent?.(f):c.floating;let A=c.floating[R]||i.floating[p];(!A||!await s.isElement?.(P))&&(A=c.floating[R]||i.floating[p]);const k=v/2-S/2,L=A/2-h[p]/2-1,D=Math.min(g[w],L),K=Math.min(g[E],L),H=D,T=A-h[p]-K,$=A/2-h[p]/2+k,F=gn(H,$,T),W=!l.arrow&&Re(r)!=null&&$!==F&&i.reference[p]/2-($<H?D:K)-h[p]/2<0,b=W?$<H?$-H:$-T:0;return{[m]:d[m]+b,data:{[m]:F,centerOffset:$-F-b,...W&&{alignmentOffset:b}},reset:W}}}),or=(e,t)=>({...nr(e),options:[e,t]}),rr={name:"hide",async fn(e){const{width:t,height:n,x:o,y:r}=e.rects.reference,i=t===0&&n===0&&o===0&&r===0,s=await e.platform.detectOverflow(e,{elementContext:"reference"});return{data:{referenceHidden:s.top-n>=0||s.right-t>=0||s.bottom-n>=0||s.left-t>=0||i}}}},ir={sideX:"left",sideY:"top"},en="--available-width",tn="--available-height";function An(e,t,n){const o=e==="inline-start"||e==="inline-end";return{top:"top",right:o?n?"inline-start":"inline-end":"right",bottom:"bottom",left:o?n?"inline-end":"inline-start":"left"}[t]}function nn(e,t,n){const{rects:o,placement:r}=e;return{side:An(t,J(r),n),align:Re(r)||"center",anchor:{width:o.reference.width,height:o.reference.height},positioner:{width:o.floating.width,height:o.floating.height}}}function Or(e){return sr(e,Uo)}function sr(e,t){const{anchor:n,positionMethod:o="absolute",side:r="bottom",sideOffset:i=0,align:s="center",alignOffset:c=0,collisionBoundary:l,collisionPadding:f=5,sticky:u=!1,arrowPadding:a=5,disableAnchorTracking:g=!1,inline:d,keepMounted:m=!1,floatingRootContext:p,mounted:h,collisionAvoidance:y,shift:w,nodeId:E,adaptiveOrigin:R,lazyFlip:v=!1,externalTree:S}=e,[P,A]=x.useState(null);!h&&P!==null&&A(null);const k=y.side||"flip",L=y.align||"flip",D=y.fallbackAxisSide||"end",K=w?.crossAxis??!1,H=w?.rootBoundary,T=typeof n=="function"?n:void 0,$=ie(T),F=T?$:n,W=ue(n),b=ue(h),z=eo()==="rtl",N=P||{top:"top",right:"right",bottom:"bottom",left:"left","inline-end":z?"left":"right","inline-start":z?"right":"left"}[r],be=s==="center"?N:`${N}-${s}`;let B=f;typeof B=="number"?B={top:B,right:B,bottom:B,left:B}:B&&(B={top:B.top||0,right:B.right||0,bottom:B.bottom||0,left:B.left||0});const Y=1,Oe=r==="bottom"?Y:0,ke=r==="top"?Y:0,ft=r==="right"?Y:0,Ee=r==="left"?Y:0,ee={boundary:l==="clipping-ancestors"?"clippingAncestors":l,padding:B},ce=x.useRef(null),De=ue(i),Se=ue(c),Ie=typeof i!="function"?i:0,He=typeof c!="function"?c:0,te=[];d&&te.push(d),te.push(Ko(I=>{const G=nn(I,r,z),oe=typeof De.current=="function"?De.current(G):De.current,X=typeof Se.current=="function"?Se.current(G):Se.current;return{mainAxis:oe,crossAxis:X,alignmentAxis:X}},[Ie,He,z,r]));const ve=L==="none"&&k!=="shift",Fe=!ve&&(u||K||k==="shift"),ge=k==="none"?null:Xo({...ee,padding:{top:B.top+Y+Oe,right:B.right+Y+Ee,bottom:B.bottom+Y+ke,left:B.left+Y+ft},mainAxis:!K&&k==="flip",crossAxis:L==="flip"?"alignment":!1,fallbackAxisSideDirection:D}),Ce=ve?null:jo({...ee,rootBoundary:H,mainAxis:L!=="none",crossAxis:Fe,limiter:u||K?void 0:Yo(I=>{if(!ce.current)return{};const{width:G,height:oe}=ce.current.getBoundingClientRect(),X=Q(J(I.placement)),ae=X==="y"?G:oe,re=X==="y"?B.left+B.right:B.top+B.bottom;return{offset:ae/2+re/2}})},[ee,u,K,H,B,L]);k==="shift"||L==="shift"||s==="center"?te.push(Ce,ge):te.push(ge,Ce),te.push(qo({...ee,apply({elements:{floating:I},availableWidth:G,availableHeight:oe,rects:X}){if(!b.current)return;const ae=I.style;ae.setProperty(en,`${G}px`),ae.setProperty(tn,`${oe}px`);const re=se(I).devicePixelRatio||1,{x:_e,y:je,width:Ye,height:ut}=X.reference,dt=(Math.round((_e+Ye)*re)-Math.round(_e*re))/re,mt=(Math.round((je+ut)*re)-Math.round(je*re))/re;ae.setProperty("--anchor-width",`${dt}px`),ae.setProperty("--anchor-height",`${mt}px`)}}),or(I=>({element:ce.current||et(I.elements.floating).createElement("div"),padding:a,offsetParent:"floating"}),[a]),{name:"transformOrigin",fn(I){const{elements:G,middlewareData:oe,placement:X,rects:ae,y:re}=I,_e=J(X),je=Q(_e),Ye=ce.current,ut=oe.arrow?.x||0,dt=oe.arrow?.y||0,mt=Ye?.clientWidth||0,Sn=Ye?.clientHeight||0,gt=ut+mt/2,Bt=dt+Sn/2,Cn=Math.abs(oe.shift?.y||0),Pn=ae.reference.height/2,ze=typeof i=="function"?i(nn(I,r,z)):i,Mn=Cn>ze,Tn={top:`${gt}px calc(100% + ${ze}px)`,bottom:`${gt}px ${-ze}px`,left:`calc(100% + ${ze}px) ${Bt}px`,right:`${-ze}px ${Bt}px`}[_e],Ln=`${gt}px ${ae.reference.y+Pn-re}px`;return G.floating.style.setProperty("--transform-origin",Fe&&je==="y"&&Mn?Ln:Tn),{}}},rr,R),q(()=>{!h&&p&&p.update({referenceElement:null,floatingElement:null,domReferenceElement:null,positionReference:null})},[h,p]);const he=x.useMemo(()=>({elementResize:!g&&typeof ResizeObserver<"u",layoutShift:!g&&typeof IntersectionObserver<"u"}),[g]),{refs:le,elements:ne,x:We,y:O,middlewareData:C,update:j,placement:M,context:V,isPositioned:Z,floatingStyles:Ve}=t({rootContext:p,open:m?h:void 0,placement:be,middleware:te,strategy:o,whileElementsMounted:m?void 0:(...I)=>Qt(...I,he),nodeId:E,externalTree:S}),{sideX:$e,sideY:Ne}=C.adaptiveOrigin||ir,Pe=Z?o:"fixed",Ft=x.useMemo(()=>{let I;return Z?R?I={position:Pe,[$e]:We,[Ne]:O}:I={...Ve,position:Pe}:I={position:Pe,top:0,left:0},I[en]="100vw",I[tn]="100vh",Z||(I.opacity=0),I},[R,Pe,$e,We,Ne,O,Ve,Z]),Ke=x.useRef(null);q(()=>{if(!h)return;const I=W.current,G=typeof I=="function"?I():I,X=(on(G)?G.current:G)||null||null;X!==Ke.current&&(le.setPositionReference(X),Ke.current=X)},[h,le,F,W]),x.useEffect(()=>{if(!h)return;const I=W.current;typeof I!="function"&&on(I)&&I.current!==Ke.current&&(le.setPositionReference(I.current),Ke.current=I.current)},[h,le,F,W]),x.useEffect(()=>{if(m&&h&&ne.reference&&ne.floating)return Qt(ne.reference,ne.floating,j,he)},[m,h,ne,j,he]);const Me=J(M),Wt=An(r,Me,z),Vt=Re(M)||"center",$t=!!C.hide?.referenceHidden;q(()=>{v&&h&&Z&&Me!==N&&A(Me)},[v,h,Z,Me,N]);const _t=x.useMemo(()=>({position:"absolute",top:C.arrow?.y,left:C.arrow?.x}),[C.arrow]),zt=C.arrow?.centerOffset!==0;return x.useMemo(()=>({positionerStyles:Ft,arrowStyles:_t,arrowRef:ce,arrowUncentered:zt,side:Wt,align:Vt,physicalSide:Me,anchorHidden:$t,refs:le,context:V,isPositioned:Z,update:j}),[Ft,_t,ce,zt,Wt,Vt,Me,$t,le,V,Z,j])}function on(e){return e!=null&&"current"in e}function cr(e){return e==="starting"?Xn:rn}function Er(e,t,{styles:n,transitionStatus:o,props:r,refs:i,hidden:s,inert:c=!1}){const l={...n};return c&&(l.pointerEvents="none"),Ct("div",e,{state:t,ref:i,props:[{role:"presentation",hidden:s,style:l},cr(o),r],stateAttributesMapping:qn})}const lr=x.createContext(void 0);function Sr(e){return x.useContext(lr)}const ar=20;function Cr(e,t,n,o){const[r,i]=x.useState(!1);q(()=>{if(!e||!t||n==null){i(!1);return}const s=et(n).documentElement.clientWidth,c=n.offsetWidth;i(s>0&&c>0&&c>=s-ar)},[e,t,n]),Un(e&&(!t||r),o)}const Ge=5;function Pr(e,t){const n=fr(t);return e.clientX>=n.left-Ge&&e.clientX<=n.right+Ge&&e.clientY>=n.top-Ge&&e.clientY<=n.bottom+Ge}function fr(e){const t=e.getBoundingClientRect(),n=se(e);if(Gn)return t;const o=n.getComputedStyle(e,"::before"),r=n.getComputedStyle(e,"::after");if(!(o.content!=="none"||r.content!=="none"))return t;const s=parseFloat(o.width)||0,c=parseFloat(o.height)||0,l=parseFloat(r.width)||0,f=parseFloat(r.height)||0,u=Math.max(t.width,s,l),a=Math.max(t.height,c,f),g=u-t.width,d=a-t.height;return{left:t.left-g/2,right:t.right+g/2,top:t.top-d/2,bottom:t.bottom+d/2}}const On=x.createContext(void 0);function ur(){const e=x.useContext(On);if(e===void 0)throw new Error(Wn(13));return e}const En={imageLoadingStatus:()=>null},dr=x.forwardRef(function(t,n){const{className:o,render:r,style:i,...s}=t,[c,l]=x.useState("idle"),f={imageLoadingStatus:c},u=x.useMemo(()=>({imageLoadingStatus:c,setImageLoadingStatus:l}),[c,l]),a=Ct("span",t,{state:f,ref:n,props:s,stateAttributesMapping:En});return Pt.jsx(On.Provider,{value:u,children:a})}),mr=x.forwardRef(function(t,n){const{className:o,render:r,delay:i=0,style:s,...c}=t,{imageLoadingStatus:l}=ur(),[f,u]=x.useState(i===0),a=Mt();return x.useEffect(()=>(i>0?a.start(i,()=>u(!0)):u(!0),a.clear),[a,i]),Ct("span",t,{state:{imageLoadingStatus:l},ref:n,props:c,stateAttributesMapping:En,enabled:l!=="loaded"&&(i===0||f)})});function Mr({className:e,size:t="default",...n}){return Pt.jsx(dr,{"data-slot":"avatar","data-size":t,className:an("group/avatar relative flex size-8 shrink-0 rounded-full select-none after:absolute after:inset-0 after:rounded-full after:border after:border-border after:mix-blend-darken data-[size=lg]:size-10 data-[size=sm]:size-6 dark:after:mix-blend-lighten",e),...n})}function Tr({className:e,...t}){return Pt.jsx(mr,{"data-slot":"avatar-fallback",className:an("flex size-full items-center justify-center rounded-full bg-muted text-sm text-muted-foreground group-data-[size=sm]/avatar:text-xs",e),...t})}export{Mr as A,Er as a,Tr as b,Ar as c,Rr as d,br as e,vr as f,cr as g,Cr as h,Pr as i,Sr as j,Do as p,ot as r,Or as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{m as a,h as n,o}from"./index-
|
|
1
|
+
import{m as a,h as n,o}from"./index-jVSWkcSK.js";import{u as d}from"./useRender-mrNZQnpJ.js";const s=o("group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!",{variants:{variant:{default:"bg-primary text-primary-foreground [a]:hover:bg-primary/80",secondary:"bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80",destructive:"bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20",outline:"border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground",ghost:"hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50",link:"text-primary underline-offset-4 hover:underline"}},defaultVariants:{variant:"default"}});function v({className:r,variant:e="default",render:t,...i}){return d({defaultTagName:"span",props:a({className:n(s({variant:e}),r)},i),render:t,state:{slot:"badge",variant:e}})}export{v as B};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as s,h as t}from"./index-
|
|
1
|
+
import{j as s,h as t}from"./index-jVSWkcSK.js";function c({className:a,size:d="default",...r}){return s.jsx("div",{"data-slot":"card","data-size":d,className:t("group/card flex flex-col gap-(--card-spacing) overflow-hidden rounded-xl bg-card py-(--card-spacing) text-sm text-card-foreground ring-1 ring-foreground/10 [--card-spacing:--spacing(4)] has-data-[slot=card-footer]:pb-0 has-[>img:first-child]:pt-0 data-[size=sm]:[--card-spacing:--spacing(3)] data-[size=sm]:has-data-[slot=card-footer]:pb-0 *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl",a),...r})}export{c as C};
|