xedoc-cli 0.1.13 → 0.1.15
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/README.md +2 -0
- package/build/client/assets/api-Bq1vju8d.js +1 -0
- package/build/client/assets/api.chats._chatId.messages-lfOVkPe8.js +0 -0
- package/build/client/assets/api.chats._chatId.queued._queueId.steer-Dob8lziy.js +0 -0
- package/build/client/assets/api.chats._chatId.server-requests._requestId.respond-CtGOWFXz.js +0 -0
- package/build/client/assets/api.workspaces.directories-_nGjLu4v.js +0 -0
- package/build/client/assets/app-layout-DcqaA3vs.js +1 -0
- package/build/client/assets/chat-DssIBrTY.js +1 -0
- package/build/client/assets/composer-controls-C-i2mGP0.js +2 -0
- package/build/client/assets/connect-BpTBAcLO.js +1 -0
- package/build/client/assets/document-title-CVCGo83t.js +1 -0
- package/build/client/assets/{entry.client-CYz-BGHO.js → entry.client-D7Yyv89q.js} +1 -1
- package/build/client/assets/folder-open-BGVSSdnS.js +1 -0
- package/build/client/assets/{ghostty-web-Bf0rFR1u.js → ghostty-web-C4aYPktj.js} +1 -1
- package/build/client/assets/header-menu-BZ8Qg4Vi.js +1 -0
- package/build/client/assets/home-bVxFnHUg.js +1 -0
- package/build/client/assets/input-DmJ6N0Sh.js +1 -0
- package/build/client/assets/label-PRFnRUMj.js +1 -0
- package/build/client/assets/manifest-62799e7e.js +1 -0
- package/build/client/assets/popover-DTbjnDSA.js +1 -0
- package/build/client/assets/{react-dom-CRV9fQsS.js → react-dom-Cmetac4J.js} +1 -1
- package/build/client/assets/root-BU4hb_em.js +1 -0
- package/build/client/assets/root-C6Tru0U5.css +2 -0
- package/build/client/assets/session-provider-Bxa1AL3n.js +1 -0
- package/build/client/assets/triangle-alert-CX-fS3B2.js +1 -0
- package/build/client/assets/usePositioner-DoPOYGgd.js +1 -0
- package/build/server/index.js +1 -1
- package/package.json +1 -2
- package/build/client/assets/app-layout-CN81j437.js +0 -1
- package/build/client/assets/app-shell-bZjdLund.js +0 -2
- package/build/client/assets/chat-B7RLVuco.js +0 -1
- package/build/client/assets/connect-CHSWDRRR.js +0 -1
- package/build/client/assets/document-title-nRpNLh53.js +0 -1
- package/build/client/assets/home-DtJ52lyi.js +0 -1
- package/build/client/assets/label-DBag4yRW.js +0 -1
- package/build/client/assets/manifest-3f1dd8c7.js +0 -1
- package/build/client/assets/root-BlJIezBz.js +0 -1
- package/build/client/assets/root-C6ZJNFQd.css +0 -2
- package/build/client/assets/session-provider-DZhkiIfn.js +0 -1
- /package/build/client/assets/{__vite-browser-external-2447137e-BK6zEOTY.js → __vite-browser-external-2447137e-BGy5hUdF.js} +0 -0
- /package/build/client/assets/{api.accounts._accountId-BixDYyx8.js → api.accounts._accountId-DbJR7wIK.js} +0 -0
- /package/build/client/assets/{api.accounts._accountId.authenticate-Cgza4mTm.js → api.accounts._accountId.authenticate-zJk1OPH-.js} +0 -0
- /package/build/client/assets/{api.accounts._accountId.authenticate.callback-jKtCcEgm.js → api.accounts._accountId.authenticate.callback-C3q2njBk.js} +0 -0
- /package/build/client/assets/{api.accounts._accountId.models-C3bayFCR.js → api.accounts._accountId.local-active-Lj56Skb8.js} +0 -0
- /package/build/client/assets/{api.accounts._accountId.personalization-Bd_x2nBr.js → api.accounts._accountId.models-BbNPhoBD.js} +0 -0
- /package/build/client/assets/{api.accounts._accountId.rate-limits-BrKCZxhm.js → api.accounts._accountId.personalization-DQAPMa-w.js} +0 -0
- /package/build/client/assets/{api.accounts._accountId.runtime-settings-6XNKTx--.js → api.accounts._accountId.rate-limits-C6Rs4m-7.js} +0 -0
- /package/build/client/assets/{api.accounts.login-callback-port-TLptuOkA.js → api.accounts._accountId.runtime-settings-DTZTQ21Z.js} +0 -0
- /package/build/client/assets/{api.chats-BUn9r-0x.js → api.accounts.import-local-active-D9cdi-v4.js} +0 -0
- /package/build/client/assets/{api.chats._chatId-BTgyeBLZ.js → api.accounts.login-callback-port-DQNbFsFb.js} +0 -0
- /package/build/client/assets/{api.chats._chatId.context-BgV2drn2.js → api.accounts.personalization-DH1AzvNF.js} +0 -0
- /package/build/client/assets/{api.chats._chatId.files-DGXv9z2x.js → api.chats-s886wBuI.js} +0 -0
- /package/build/client/assets/{api.chats._chatId.git._operation-DggKbqHL.js → api.chats._chatId-BdQ0D5mb.js} +0 -0
- /package/build/client/assets/{api.chats._chatId.interrupt-DkImed4M.js → api.chats._chatId.context-h_lwoA2q.js} +0 -0
- /package/build/client/assets/{api.chats._chatId.messages-kk2to-gt.js → api.chats._chatId.files-Cx0zOZBK.js} +0 -0
- /package/build/client/assets/{api.chats._chatId.server-requests._requestId.respond-BCMnFuvx.js → api.chats._chatId.git._operation-DogyaTuw.js} +0 -0
- /package/build/client/assets/{api.workspaces.directories-Bz0K1WZo.js → api.chats._chatId.interrupt-DFwcHue_.js} +0 -0
- /package/build/client/assets/{app-shell-DdKuH37F.css → header-menu-DdKuH37F.css} +0 -0
- /package/build/client/assets/{jsx-runtime-DhlB8LRe.js → jsx-runtime-BD6xVgfN.js} +0 -0
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ghostty-web-C4aYPktj.js","assets/jsx-runtime-BD6xVgfN.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{A as e,F as a,P as t,R as s,t as n}from"./jsx-runtime-BD6xVgfN.js";import{Ht as r,bt as i,yt as d}from"./usePositioner-DoPOYGgd.js";import{$ as l,A as o,C as c,D as u,F as m,H as h,J as x,K as p,Q as g,R as f,S as b,St as j,U as v,V as y,X as k,Y as w,Z as N,_ as z,_t as C,a as M,b as S,et as A,ft as R,gt as E,ht as P,i as D,m as L,mt as T,n as I,o as F,ot as U,pt as V,q as _,r as q,t as $,tt as H,v as K,vt as B,w as O,x as W,xt as Q,y as Y,yt as J,z as G}from"./popover-DTbjnDSA.js";import{Bt as X,G as Z,J as ee,K as ae,Rt as te,St as se,U as ne,Ut as re,Vt as ie,Wt as de,jt as le,nt as oe,tt as ce,zt as ue}from"./api-Bq1vju8d.js";import{a as me,c as he,i as xe,n as pe,o as ge,r as fe,s as be,u as je}from"./input-DmJ6N0Sh.js";var ve=de("arrow-up",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]),ye=de("cpu",[["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M17 20v2",key:"1rnc9c"}],["path",{d:"M17 2v2",key:"11trls"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M2 17h2",key:"7oei6x"}],["path",{d:"M2 7h2",key:"asdhe0"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"M20 17h2",key:"1fpfkl"}],["path",{d:"M20 7h2",key:"1o8tra"}],["path",{d:"M7 20v2",key:"4gnj0m"}],["path",{d:"M7 2v2",key:"1i4yhu"}],["rect",{x:"4",y:"4",width:"16",height:"16",rx:"2",key:"1vbyd7"}],["rect",{x:"8",y:"8",width:"8",height:"8",rx:"1",key:"z9xiuo"}]]),ke=de("gauge",[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]]),we=de("image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]),Ne=de("paperclip",[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]]),ze=de("shield-check",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]),Ce=de("shield",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]]),Me=de("square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]),Se=de("zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]),Ae=n(),Re=s(a()),Ee=Re.createContext({formRef:{current:{fields:new Map}},errors:{},clearErrors:ue,validationMode:"onSubmit",submitAttemptedRef:{current:!1}});function Pe(e,a,t,s=!0,n){const[r,i]=Re.useState(),d=Z(n?`${n}-label`:void 0),l=e??a??r;return ie(()=>{const n=e||a||!s?void 0:function(e,a){const t=function(e){if(!e)return;const a=e.parentElement;if(a&&"LABEL"===a.tagName)return a;const t=e.id;if(t){const a=e.nextElementSibling;if(a&&a.htmlFor===t)return a}const s=e.labels;return s&&s[0]}(e);if(!t)return;!t.id&&a&&(t.id=a);return t.id||void 0}(t.current,d);r!==n&&i(n)}),l}var De="xedoc.web.terminal-height",Le=null;function Te({className:e,onClosePanel:a,projectPath:t,socket:s,socketConnected:n}){const[i,d]=(0,Re.useState)(null),[l,o]=(0,Re.useState)(null),[c,u]=(0,Re.useState)(Fe),[h,x]=(0,Re.useState)(!1),[p,g]=(0,Re.useState)(null),[f,b]=(0,Re.useState)([]),j=(0,Re.useRef)(c),v=function(){const[e,a]=(0,Re.useState)(()=>_e());return(0,Re.useEffect)(()=>{const e=window.matchMedia("(max-width: 639px)"),t=()=>a(e.matches);return t(),e.addEventListener("change",t),()=>e.removeEventListener("change",t)},[]),e}(),y=(0,Re.useCallback)((e,a)=>m(s,e,a),[s]),k=(0,Re.useCallback)(e=>{b(e),d(a=>a&&e.some(e=>e.id===a)?a:e[0]?.id??null)},[]),w=(0,Re.useCallback)(async()=>{const e=await y("terminal:create",{cols:80,projectPath:p??t,rows:24});g(e.projectPath),k(e.terminals),d(e.terminal.id)},[k,t,y,p]);(0,Re.useEffect)(()=>{if(!s||!t.trim())return b([]),d(null),void g(null);let e=!1,a=null;return x(!0),o(null),y("terminal:project:join",{projectPath:t}).then(async t=>{if(!e&&(a=t.projectPath,g(t.projectPath),k(t.terminals),!t.terminals.length)){const a=await y("terminal:create",{cols:80,projectPath:t.projectPath,rows:24});e||(g(a.projectPath),k(a.terminals),d(a.terminal.id))}}).catch(a=>{e||o(qe(a))}).finally(()=>{e||x(!1)}),()=>{e=!0,a&&m(s,"terminal:project:leave",{projectPath:a}).catch(()=>{})}},[k,t,y,s]),(0,Re.useEffect)(()=>{if(!s)return;const e=e=>{const a=p??t;e.projectPath===a&&k(e.terminals)};return s.on("terminal:project",e),()=>{s.off("terminal:project",e)}},[k,t,p,s]),(0,Re.useEffect)(()=>{j.current=c;const e=window.setTimeout(()=>{Ue(c)},150);return()=>window.clearTimeout(e)},[c]),(0,Re.useEffect)(()=>{const e=()=>{u(e=>{const a=Ve(e);return j.current=a,a})};return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]);const N=(0,Re.useCallback)(async e=>{try{k((await y("terminal:close",{terminalId:e})).terminals)}catch(a){r.error(qe(a))}},[k,y]),z=(0,Re.useCallback)(e=>{b(a=>a.map(a=>a.id===e.id?e:a))},[]),C=(0,Re.useCallback)(e=>{e.currentTarget.setPointerCapture(e.pointerId);const a=e.clientY,t=c,s=e=>{const s=Ve(t+a-e.clientY);j.current=s,u(s)},n=()=>{Ue(j.current),document.removeEventListener("pointermove",s),document.removeEventListener("pointerup",n)};document.addEventListener("pointermove",s),document.addEventListener("pointerup",n)},[c]);return(0,Ae.jsxs)("section",{className:ne("grid min-h-0 grid-rows-[auto_minmax(0,1fr)] overflow-hidden rounded-xl border bg-background shadow-sm",e),style:{height:c},children:[(0,Ae.jsx)("button",{"aria-label":"Resize terminal",className:"group flex h-3 cursor-row-resize items-center justify-center border-b bg-muted/40",type:"button",onPointerDown:C,children:(0,Ae.jsx)("span",{className:"h-0.5 w-10 rounded-full bg-muted-foreground/35 group-hover:bg-muted-foreground/70"})}),(0,Ae.jsxs)("div",{className:"grid min-h-0 grid-rows-[auto_minmax(0,1fr)]",children:[(0,Ae.jsxs)("div",{className:"flex min-w-0 items-center gap-1 border-b bg-muted/25 px-2 py-1",children:[(0,Ae.jsx)("div",{"aria-label":"Terminals",className:"flex min-w-0 flex-1 items-center gap-1 overflow-x-auto",role:"tablist",children:f.map(e=>(0,Ae.jsxs)("div",{className:ne("flex h-7 min-w-24 max-w-48 shrink-0 items-center rounded-md text-[11px] sm:h-8 sm:min-w-28 sm:max-w-56 sm:text-xs",e.id===i?"bg-secondary text-secondary-foreground":"hover:bg-accent hover:text-accent-foreground","exited"===e.status&&"text-muted-foreground"),children:[(0,Ae.jsxs)("button",{"aria-selected":e.id===i,className:"flex h-full min-w-0 flex-1 items-center gap-1.5 px-2 text-left",role:"tab",title:e.title,type:"button",onClick:()=>d(e.id),children:[(0,Ae.jsx)(T,{className:"size-3.5 shrink-0"}),(0,Ae.jsx)("span",{className:"min-w-0 truncate",children:e.title||"Shell"}),(0,Ae.jsx)("span",{className:ne("ml-auto size-1.5 shrink-0 rounded-full","running"===e.status?"bg-emerald-500":"bg-muted-foreground/50")})]}),(0,Ae.jsx)("button",{"aria-label":"Close terminal",className:"mr-1 grid size-5 shrink-0 place-items-center rounded-sm hover:bg-background",title:"Close terminal",type:"button",onClick:()=>{N(e.id)},children:(0,Ae.jsx)(R,{className:"size-3"})})]},e.id))}),(0,Ae.jsx)(he,{"aria-label":"New terminal",className:"size-8 shrink-0",disabled:!n||h,size:"icon-sm",title:"New terminal",type:"button",variant:"ghost",onClick:()=>{w().catch(e=>r.error(qe(e)))},children:h?(0,Ae.jsx)(re,{className:"animate-spin"}):(0,Ae.jsx)(E,{})}),a?(0,Ae.jsx)(he,{"aria-label":"Hide terminal panel",className:"size-8 shrink-0",size:"icon-sm",title:"Hide terminal panel",type:"button",variant:"ghost",onClick:a,children:(0,Ae.jsx)(R,{})}):null]}),(0,Ae.jsx)("div",{className:"relative min-h-0 bg-zinc-950",children:l?(0,Ae.jsx)("div",{className:"grid h-full place-items-center p-4 text-sm text-red-200",children:l}):f.length?f.map(e=>(0,Ae.jsx)(Ie,{active:e.id===i,compactLayout:v,resizeSignal:c,socket:s,terminal:e,onTerminalUpdated:z},e.id)):(0,Ae.jsx)("div",{className:"grid h-full place-items-center p-4 text-sm text-zinc-400",children:h?"Starting terminal...":"No terminal"})})]})]})}function Ie({active:e,compactLayout:a,onTerminalUpdated:s,resizeSignal:n,socket:i,terminal:d}){const l=(0,Re.useRef)(null),o=(0,Re.useRef)(null),c=(0,Re.useRef)(null),u=(0,Re.useRef)(null),[h,x]=(0,Re.useState)(!1),p=(0,Re.useCallback)(()=>{null===c.current&&(c.current=window.requestAnimationFrame(()=>{c.current=null,o.current?.fit()}))},[]);return(0,Re.useEffect)(()=>(p(),()=>{null!==c.current&&(window.cancelAnimationFrame(c.current),c.current=null)}),[p,n]),(0,Re.useEffect)(()=>{e&&(p(),requestAnimationFrame(()=>{o.current?.fit(),u.current?.focus()}))},[e,p]),(0,Re.useEffect)(()=>{const n=l.current;if(!i||!n)return;let h=!1,g=!1;const f=[];x(!1),n.replaceChildren();const b=e=>{i.emit("terminal:input",{data:e,terminalId:d.id})},j=e=>{g&&e.terminalId===d.id&&u.current?.write(e.data)};return i.on("terminal:output",j),async function(){return Le??=t(()=>import("./ghostty-web-C4aYPktj.js").then(async e=>(await e.init(),e)),__vite__mapDeps([0,1])),Le}().then(async({FitAddon:t,Terminal:n})=>{if(h||!l.current)return;l.current.replaceChildren();const r=new n({cursorBlink:!0,fontFamily:'ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace',fontSize:a?11:12,scrollback:1e4,theme:{background:"#09090b",foreground:"#e4e4e7"}}),c=new t;o.current=c,u.current=r,r.loadAddon(c),r.open(l.current),c.fit(),c.observeResize(),r.attachCustomKeyEventHandler(e=>"Enter"===e.key&&(b("\r"),!0)),f.push(c),f.push(r.onData(e=>{b(e)})),f.push(r.onResize(e=>{i.emit("terminal:resize",{cols:e.cols,rows:e.rows,terminalId:d.id})})),f.push(r.onTitleChange(e=>{i.emit("terminal:title",{terminalId:d.id,title:e})}));const j=await m(i,"terminal:attach",{terminalId:d.id});h||(s(j.terminal),j.replay&&r.write(j.replay),g=!0,requestAnimationFrame(()=>{c.fit(),h||(x(!0),e&&r.focus())}),p())}).catch(e=>{h||r.error(qe(e))}),()=>{h=!0,null!==c.current&&(window.cancelAnimationFrame(c.current),c.current=null),i.off("terminal:output",j),m(i,"terminal:detach",{terminalId:d.id}).catch(()=>{});for(const e of f)e.dispose();u.current?.dispose(),n.replaceChildren(),u.current=null,o.current=null,x(!1)}},[e,a,s,p,i,d.id]),(0,Ae.jsxs)("div",{className:ne("absolute inset-0 h-full min-h-0 overflow-hidden bg-zinc-950 p-1 outline-none sm:p-2",e?"z-10 opacity-100":"z-0 opacity-0 pointer-events-none"),"aria-hidden":!e,style:{caretColor:"transparent"},children:[!h&&e?(0,Ae.jsx)("div",{className:"absolute inset-0 grid place-items-center bg-zinc-950 text-xs text-zinc-500",children:"Loading terminal..."}):null,(0,Ae.jsx)("div",{className:ne("h-full min-h-0 transition-opacity [&_canvas]:block",h?"opacity-100":"opacity-0"),ref:l})]})}function Fe(){return"undefined"==typeof window?360:Ve(Number.parseInt(window.localStorage.getItem(De)??"",10)||(_e()?300:360))}function Ue(e){"undefined"!=typeof window&&window.localStorage.setItem(De,String(e))}function Ve(e){const a="undefined"!=typeof window&&_e()?160:220,t="undefined"==typeof window?720:Math.max(a,Math.min(window.innerHeight-(_e()?96:140),760));return Math.max(a,Math.min(t,e))}function _e(){return"undefined"!=typeof window&&window.innerWidth<640}function qe(e){return e instanceof Error?e.message:"Terminal request failed."}function $e(){return e()}var He=Re.createContext(void 0);var Ke=function(e){return e.checked="data-checked",e.unchecked="data-unchecked",e.disabled="data-disabled",e.readonly="data-readonly",e.required="data-required",e.valid="data-valid",e.invalid="data-invalid",e.touched="data-touched",e.dirty="data-dirty",e.filled="data-filled",e.focused="data-focused",e}({}),Be={...be,checked:e=>e?{[Ke.checked]:""}:{[Ke.unchecked]:""}},Oe=Re.forwardRef(function(e,a){const{checked:t,className:s,defaultChecked:n,"aria-labelledby":r,form:l,id:o,inputRef:c,name:u,nativeButton:m=!1,onCheckedChange:h,readOnly:x=!1,required:p=!1,disabled:g=!1,render:f,uncheckedValue:b,value:j,style:v,...y}=e,{clearErrors:k}=Re.useContext(Ee),{state:w,setTouched:N,setDirty:z,validityData:C,setFilled:M,setFocused:S,shouldValidateOnChange:A,validationMode:R,disabled:E,name:P,validation:D}=ge(),{labelId:L}=me(),T=E||g,I=P??u,F=ce(h),V=Re.useRef(null),_=oe(V,c,D.inputRef),q=Re.useRef(null),$=Z(),H=xe({id:o,implicit:!1,controlRef:q}),K=m?void 0:H,[B,O]=fe({controlled:t,default:Boolean(n),name:"Switch",state:"checked"});pe(q,{id:$,value:B}),ie(()=>{V.current&&M(V.current.checked)},[V,M]),U(B,()=>{k(I),z(B!==C.initialValue),M(B),A()?D.commit(B):D.commit(B,!0)});const{getButtonProps:W,buttonRef:Q}=je({disabled:T,native:m}),Y=Pe(r,L,V,!m,K),J={id:m?H:$,role:"switch","aria-checked":B,"aria-readonly":x||void 0,"aria-required":p||void 0,"aria-labelledby":Y,onFocus(){T||S(!0)},onBlur(){const e=V.current;e&&!T&&(N(!0),S(!1),"onBlur"===R&&D.commit(e.checked))},onClick(e){x||T||(e.preventDefault(),V.current?.dispatchEvent(new PointerEvent("click",{bubbles:!0,shiftKey:e.shiftKey,ctrlKey:e.ctrlKey,altKey:e.altKey,metaKey:e.metaKey})))}},G=Re.useMemo(()=>ee({checked:B,disabled:T,form:l,id:K,name:I,required:p,style:I?i:d,tabIndex:-1,type:"checkbox","aria-hidden":!0,ref:_,onChange(e){if(e.nativeEvent.defaultPrevented)return;if(x)return void e.preventDefault();const a=e.currentTarget.checked,t=se(le,e.nativeEvent);F?.(a,t),t.isCanceled||O(a)},onFocus(){q.current?.focus()}},D.getInputValidationProps,void 0!==j?{value:j}:te),[B,T,l,_,K,I,F,x,p,O,D,j]),X=Re.useMemo(()=>({...w,checked:B,disabled:T,readOnly:x,required:p}),[w,B,T,x,p]),ne=ae("span",e,{state:X,ref:[a,q,Q],props:[J,D.getValidationProps,y,W],stateAttributesMapping:Be});return(0,Ae.jsxs)(He.Provider,{value:X,children:[ne,!B&&I&&void 0!==b&&(0,Ae.jsx)("input",{type:"hidden",form:l,name:I,value:b}),(0,Ae.jsx)("input",{...G,suppressHydrationWarning:!0})]})}),We=Re.forwardRef(function(e,a){const{render:t,className:s,style:n,...r}=e,{state:i}=ge(),d=function(){const e=Re.useContext(He);if(void 0===e)throw new Error(X(63));return e}();return ae("span",e,{state:{...i,...d},ref:a,stateAttributesMapping:Be,props:r})});function Qe({className:e,size:a="default",...t}){return(0,Ae.jsx)(Oe,{"data-slot":"switch","data-size":a,className:ne("peer group/switch relative inline-flex shrink-0 items-center rounded-full border border-transparent transition-all outline-none after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 data-[size=default]:h-[18.4px] data-[size=default]:w-[32px] data-[size=sm]:h-[14px] data-[size=sm]:w-[24px] dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:bg-primary data-unchecked:bg-input dark:data-unchecked:bg-input/80 data-disabled:cursor-not-allowed data-disabled:opacity-50",e),...t,children:(0,Ae.jsx)(We,{"data-slot":"switch-thumb",className:"pointer-events-none block rounded-full bg-background ring-0 transition-transform group-data-[size=default]/switch:size-4 group-data-[size=sm]/switch:size-3 group-data-[size=default]/switch:data-checked:translate-x-[calc(100%-2px)] group-data-[size=sm]/switch:data-checked:translate-x-[calc(100%-2px)] dark:data-checked:bg-primary-foreground group-data-[size=default]/switch:data-unchecked:translate-x-0 group-data-[size=sm]/switch:data-unchecked:translate-x-0 dark:data-unchecked:bg-foreground"})})}function Ye({account:e,autoRotate:a,autoRotateDisabled:t,connectedAccounts:s,disabled:n,onAutoRotateChange:r,onSelect:i,pending:d,selectedAccountId:l,selectionDisabled:o,usageSummaries:c}){const u=a?"Auto rotate":e?.displayName??"Choose account",m=a&&e?`Auto rotate: ${e.displayName}`:e?.displayName??"Choose account";return(0,Ae.jsxs)(p,{children:[(0,Ae.jsxs)(H,{render:(0,Ae.jsx)(he,{"aria-label":m,className:"max-w-44 justify-start max-sm:size-8 max-sm:justify-center max-sm:px-0",disabled:n||d,size:"sm",title:m,variant:a?"secondary":"ghost"}),children:[d?(0,Ae.jsx)(re,{className:"animate-spin"}):a?(0,Ae.jsx)(P,{}):(0,Ae.jsx)(V,{}),(0,Ae.jsx)("span",{className:"truncate max-sm:sr-only",children:u})]}),(0,Ae.jsxs)(_,{align:"start",className:"w-64",children:[r?(0,Ae.jsxs)(Ae.Fragment,{children:[(0,Ae.jsxs)(x,{className:"gap-3 py-2",disabled:t||d,onClick:e=>{e.preventDefault(),r(!a)},children:[(0,Ae.jsx)(P,{}),(0,Ae.jsx)("span",{className:"min-w-0 flex-1",children:"Auto rotate"}),(0,Ae.jsx)(Qe,{checked:!!a,className:"pointer-events-none",size:"sm",tabIndex:-1})]}),(0,Ae.jsx)(N,{})]}):null,s.map(e=>{const a=e.id===l;return(0,Ae.jsxs)(x,{disabled:d||o,onClick:()=>{a||i(e.id)},children:[(0,Ae.jsx)("span",{className:"truncate",children:e.displayName}),c[e.id]?(0,Ae.jsx)("span",{className:"ml-auto shrink-0 text-xs text-muted-foreground",children:c[e.id]}):(0,Ae.jsx)("span",{className:"ml-auto"}),a?(0,Ae.jsx)(Q,{className:"size-4 shrink-0"}):null]},e.id)})]})]})}function Je(e){return e.map(e=>"image"===e.kind?{dataUrl:e.dataUrl,kind:"image",mimeType:e.mimeType,name:e.name,size:e.size}:{kind:"file",name:e.name,path:e.path,size:e.size})}async function Ge(e){const a=Array.from(e).filter(e=>e.type.startsWith("image/"));return Promise.all(a.map(async e=>({dataUrl:await Ze(e),id:crypto.randomUUID(),kind:"image",mimeType:e.type||"image/png",name:e.name||"image",size:e.size})))}function Xe(e){const a=Array.from(e.files).filter(e=>e.type.startsWith("image/")),t=Array.from(e.items).filter(e=>"file"===e.kind&&e.type.startsWith("image/")).map(e=>e.getAsFile()).filter(e=>!!e),s=new Set;return[...a,...t].filter(e=>{const a=`${e.name}:${e.size}:${e.lastModified}`;return!s.has(a)&&(s.add(a),!0)})}function Ze(e){return new Promise((a,t)=>{const s=new FileReader;s.onerror=()=>t(s.error??new Error("Unable to read image.")),s.onload=()=>a(String(s.result??"")),s.readAsDataURL(e)})}function ea(e){const a=e.trim();return{id:crypto.randomUUID(),kind:"file",name:L(a),path:a}}function aa({attachments:e,imageInputRef:a,onAttachImages:t,onRemove:s}){return(0,Ae.jsxs)(Ae.Fragment,{children:[(0,Ae.jsx)("input",{accept:"image/*",className:"hidden",multiple:!0,ref:a,type:"file",onChange:e=>{t(e.currentTarget.files),e.currentTarget.value=""}}),e.length?(0,Ae.jsx)("div",{className:"flex min-w-0 flex-wrap gap-2",children:e.map(e=>(0,Ae.jsxs)("div",{className:"flex min-w-0 max-w-full items-center gap-2 rounded-md border bg-muted/35 px-2 py-1 text-xs",children:["image"===e.kind?(0,Ae.jsx)("img",{alt:"",className:"size-7 rounded border object-cover",src:e.dataUrl}):(0,Ae.jsx)(B,{className:"size-3.5 shrink-0 text-muted-foreground"}),(0,Ae.jsx)("span",{className:"min-w-0 max-w-48 truncate",children:"file"===e.kind?e.path:e.name}),(0,Ae.jsx)(he,{"aria-label":"Remove attachment",className:"size-5",size:"icon-xs",type:"button",variant:"ghost",onClick:()=>s(e.id),children:(0,Ae.jsx)(R,{className:"size-3"})})]},e.id))}):null]})}function ta({usage:e}){if(!e||e.tokenLimit<=0)return null;const a=f(e.usedPercent);return(0,Ae.jsxs)($,{children:[(0,Ae.jsx)(F,{render:(0,Ae.jsx)(he,{"aria-label":`Context ${Math.round(a)}% used`,className:"size-7 px-0 text-xs font-normal text-muted-foreground hover:bg-transparent aria-expanded:bg-transparent dark:hover:bg-transparent max-sm:size-8",size:"icon-sm",title:`Context ${Math.round(a)}% used`,variant:"ghost"}),children:(0,Ae.jsx)("span",{"aria-hidden":"true",className:"grid size-4 shrink-0 place-items-center rounded-full text-foreground",style:{background:`conic-gradient(var(--foreground) ${3.6*a}deg, var(--muted) 0deg)`},children:(0,Ae.jsx)("span",{className:"size-2 rounded-full bg-background"})})}),(0,Ae.jsxs)(I,{align:"end",className:"w-72",side:"top",children:[(0,Ae.jsxs)(D,{children:[(0,Ae.jsx)(M,{children:"Context window"}),(0,Ae.jsx)(q,{children:"Codex automatically compacts this context when needed."})]}),(0,Ae.jsxs)("div",{className:"grid gap-3",children:[(0,Ae.jsxs)("div",{children:[(0,Ae.jsxs)("div",{className:"mb-1 flex items-center justify-between gap-2 text-sm",children:[(0,Ae.jsxs)("span",{className:"font-medium",children:[Math.round(a),"% used"]}),(0,Ae.jsxs)("span",{className:"text-muted-foreground",children:[e.remainingPercent,"% left"]})]}),(0,Ae.jsx)("div",{className:"h-1.5 overflow-hidden rounded-full bg-muted",children:(0,Ae.jsx)("div",{className:"h-full rounded-full bg-foreground",style:{width:`${a}%`}})})]}),(0,Ae.jsxs)("div",{className:"rounded-md bg-muted/60 p-2 font-mono text-xs text-muted-foreground",children:[b(e.tokensUsed)," /"," ",b(e.tokenLimit)," tokens used"]})]})]})]})}function sa({pending:e,snapshot:a}){const t=y(a),s=h(a);return(0,Ae.jsxs)($,{children:[(0,Ae.jsxs)(F,{render:(0,Ae.jsx)(he,{className:ne("h-7 max-w-36 justify-start px-2 text-xs font-normal text-foreground hover:bg-transparent aria-expanded:bg-transparent dark:hover:bg-transparent max-sm:size-8 max-sm:justify-center max-sm:px-0","fiveHour"===s&&"border border-orange-300 bg-orange-50 text-orange-700 hover:bg-orange-50 aria-expanded:bg-orange-50 dark:border-orange-900/70 dark:bg-orange-950/35 dark:text-orange-300 dark:hover:bg-orange-950/35 dark:aria-expanded:bg-orange-950/35","weekly"===s&&"border border-red-300 bg-red-50 text-red-700 hover:bg-red-50 aria-expanded:bg-red-50 dark:border-red-900/70 dark:bg-red-950/35 dark:text-red-300 dark:hover:bg-red-950/35 dark:aria-expanded:bg-red-950/35"),size:"sm",title:t,variant:"ghost"}),children:[e?(0,Ae.jsx)(re,{className:"size-3 animate-spin"}):(0,Ae.jsx)(Se,{className:"size-3"}),(0,Ae.jsx)("span",{className:"truncate max-sm:sr-only",children:t})]}),(0,Ae.jsxs)(I,{align:"start",className:"w-80",side:"top",children:[(0,Ae.jsxs)(D,{children:[(0,Ae.jsx)(M,{children:"Usage capacity"}),(0,Ae.jsx)(q,{children:"Current Codex account limits refresh automatically."})]}),(0,Ae.jsx)(oa,{pending:e,snapshot:a})]})]})}function na({visible:e}){return e?(0,Ae.jsxs)(v,{className:"pointer-events-none absolute right-1.5 top-1.5 z-10 border-primary/25 bg-background/95 text-foreground shadow-sm backdrop-blur dark:border-primary/40",variant:"outline",children:[(0,Ae.jsx)(C,{}),(0,Ae.jsx)("span",{children:"Plan mode"})]}):null}function ra({attachmentDisabled:e,disabled:a,mode:t,modeDisabled:s,onAttachFile:n,onAttachImage:r,onSelectMode:i,pending:d}){const l="plan"===t,o=e||a;return(0,Ae.jsxs)(p,{children:[(0,Ae.jsx)(H,{render:(0,Ae.jsx)(he,{"aria-label":"Chat options",className:"shrink-0",disabled:a,size:"icon-sm",variant:l?"secondary":"ghost"}),children:d?(0,Ae.jsx)(re,{className:"animate-spin"}):(0,Ae.jsx)(E,{})}),(0,Ae.jsxs)(_,{align:"start",className:"w-56",children:[(0,Ae.jsxs)(x,{className:"gap-3 py-2",disabled:a||s||d,onClick:e=>{e.preventDefault(),i(l?"default":"plan")},children:[(0,Ae.jsx)(C,{}),(0,Ae.jsx)("span",{className:"grid min-w-0 flex-1 gap-0.5",children:(0,Ae.jsx)("span",{children:"Plan mode"})}),(0,Ae.jsx)(Qe,{checked:l,className:"pointer-events-none",size:"sm",tabIndex:-1})]}),(0,Ae.jsxs)(x,{className:"gap-3 py-2",disabled:o||!r,onClick:r,children:[(0,Ae.jsx)(we,{}),(0,Ae.jsx)("span",{children:"Attach image"})]}),(0,Ae.jsxs)(x,{className:"gap-3 py-2",disabled:o||!n,onClick:n,children:[(0,Ae.jsx)(Ne,{}),(0,Ae.jsx)("span",{children:"Attach workspace file"})]})]})]})}function ia({disabled:e,mode:a,onSelectMode:t,pending:s}){const n="fullAccess"===a;return(0,Ae.jsxs)(p,{children:[(0,Ae.jsxs)(H,{render:(0,Ae.jsx)(he,{"aria-label":u(a),className:ne("max-w-40 justify-start max-sm:size-8 max-sm:justify-center max-sm:px-0",n&&"border border-orange-300 bg-orange-50 text-orange-700 hover:bg-orange-100 aria-expanded:bg-orange-100 dark:border-orange-900/70 dark:bg-orange-950/35 dark:text-orange-300 dark:hover:bg-orange-950/45 dark:aria-expanded:bg-orange-950/45"),disabled:e||s,size:"sm",title:u(a),variant:"ghost"}),children:[s?(0,Ae.jsx)(re,{className:"animate-spin"}):n?(0,Ae.jsx)(ze,{}):(0,Ae.jsx)(Ce,{}),(0,Ae.jsx)("span",{className:"truncate max-sm:sr-only",children:u(a)})]}),(0,Ae.jsx)(_,{align:"start",className:"w-48",children:(0,Ae.jsxs)(w,{value:a,onValueChange:e=>t("fullAccess"===e?"fullAccess":"default"),children:[(0,Ae.jsx)(k,{value:"default",children:(0,Ae.jsxs)("span",{className:"grid min-w-0 gap-0.5",children:[(0,Ae.jsx)("span",{children:"Default"}),(0,Ae.jsx)("span",{className:"text-xs text-muted-foreground",children:"Codex asks as needed."})]})}),(0,Ae.jsx)(k,{className:"text-orange-700 dark:text-orange-300",value:"fullAccess",children:(0,Ae.jsxs)("span",{className:"grid min-w-0 gap-0.5",children:[(0,Ae.jsx)("span",{children:"Full access"}),(0,Ae.jsx)("span",{className:"text-xs text-muted-foreground",children:"No sandbox or approval prompts."})]})})]})})]})}function da({hasDraft:e,loading:a,onSend:t,onSteer:s,onStop:n,running:r=!1,sendDisabled:i,steerDisabled:d,stopPending:l=!1}){return r&&!e?(0,Ae.jsx)(he,{"aria-label":"Stop task",className:"size-9 rounded-full",disabled:l||!n,size:"icon",title:"Stop task",type:"button",variant:"secondary",onClick:n,children:l?(0,Ae.jsx)(re,{className:"animate-spin"}):(0,Ae.jsx)(Me,{})}):r&&e?(0,Ae.jsxs)("div",{className:"group relative flex shrink-0",children:[(0,Ae.jsx)("div",{className:"absolute right-0 bottom-full z-20 hidden min-w-48 pb-2 group-focus-within:block group-hover:block",children:(0,Ae.jsxs)("div",{className:"grid gap-1 rounded-lg border bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10",children:[(0,Ae.jsxs)("button",{className:"flex min-w-0 items-center gap-2 rounded-md px-2 py-1.5 text-left text-sm hover:bg-accent hover:text-accent-foreground disabled:pointer-events-none disabled:opacity-50",disabled:d||a||!s,type:"button",onClick:s,children:[(0,Ae.jsx)(ve,{className:"size-4 shrink-0"}),(0,Ae.jsx)("span",{className:"min-w-0",children:"Steer active task"})]}),(0,Ae.jsxs)("button",{className:"flex min-w-0 items-center gap-2 rounded-md px-2 py-1.5 text-left text-sm hover:bg-accent hover:text-accent-foreground disabled:pointer-events-none disabled:opacity-50",disabled:i||a,type:"button",onClick:t,children:[(0,Ae.jsx)(J,{className:"size-4 shrink-0"}),(0,Ae.jsx)("span",{className:"min-w-0",children:"Queue after current task"})]})]})}),(0,Ae.jsx)(he,{"aria-label":"Queue message",className:"size-9 rounded-full",disabled:i||a,size:"icon",title:"Queue message",type:"button",onClick:t,children:a?(0,Ae.jsx)(re,{className:"animate-spin"}):(0,Ae.jsx)(ve,{})})]}):(0,Ae.jsx)(he,{"aria-label":"Send message",className:"size-9 rounded-full",disabled:i||a,size:"icon",type:"button",onClick:t,children:a?(0,Ae.jsx)(re,{className:"animate-spin"}):(0,Ae.jsx)(ve,{})})}function la({activeReasoningEffort:e,disabled:a,modelOptions:t,modelValue:s,onSelectModel:n,onSelectReasoning:r,onSelectServiceTier:i,pending:d,reasoningOptions:c,reasoningValue:u,selectedModel:m,serviceTierOptions:h,serviceTierValue:x}){const f=o({effort:e,model:m,modelValue:s,serviceTier:x});return(0,Ae.jsxs)(p,{children:[(0,Ae.jsxs)(H,{render:(0,Ae.jsx)(he,{"aria-label":f,className:"max-w-64 justify-start max-sm:size-8 max-sm:justify-center max-sm:px-0",disabled:a||d,size:"sm",title:f,variant:"ghost"}),children:[d?(0,Ae.jsx)(re,{className:"animate-spin"}):(0,Ae.jsx)(ye,{}),(0,Ae.jsx)("span",{className:"truncate max-sm:sr-only",children:f})]}),(0,Ae.jsxs)(_,{align:"start",className:"w-72",children:[(0,Ae.jsxs)(g,{children:[(0,Ae.jsxs)(A,{className:"grid grid-cols-[auto_minmax(0,1fr)_minmax(0,6rem)_auto]",children:[(0,Ae.jsx)(j,{}),(0,Ae.jsx)("span",{children:"Intelligence"}),(0,Ae.jsx)("span",{className:"truncate text-right text-xs text-muted-foreground",children:z(e)})]}),(0,Ae.jsx)(l,{className:"w-52",children:(0,Ae.jsxs)(w,{value:u,onValueChange:r,children:[(0,Ae.jsx)(k,{value:"",children:"Model default"}),c.map(e=>(0,Ae.jsx)(k,{value:e,children:z(e)},e))]})})]}),(0,Ae.jsxs)(g,{children:[(0,Ae.jsxs)(A,{className:"grid grid-cols-[auto_minmax(0,1fr)_minmax(0,6rem)_auto]",children:[(0,Ae.jsx)(ye,{}),(0,Ae.jsx)("span",{children:"Model"}),(0,Ae.jsx)("span",{className:"truncate text-right text-xs text-muted-foreground",children:(m?.displayName??s)||"Default"})]}),(0,Ae.jsx)(l,{className:"w-64",children:(0,Ae.jsxs)(w,{value:s,onValueChange:n,children:[(0,Ae.jsx)(k,{value:"",children:"Default model"}),t.map(e=>(0,Ae.jsx)(k,{value:e.model,children:(0,Ae.jsx)("span",{className:"truncate",children:e.displayName})},e.id))]})})]}),(0,Ae.jsxs)(g,{children:[(0,Ae.jsxs)(A,{className:"grid grid-cols-[auto_minmax(0,1fr)_minmax(0,6rem)_auto]",disabled:!h.length,children:[(0,Ae.jsx)(ke,{}),(0,Ae.jsx)("span",{children:"Speed"}),(0,Ae.jsx)("span",{className:"truncate text-right text-xs text-muted-foreground",children:W(x)})]}),(0,Ae.jsx)(l,{className:"w-52",children:(0,Ae.jsxs)(w,{value:x,onValueChange:i,children:[(0,Ae.jsx)(k,{value:"",children:"Default speed"}),h.map(e=>(0,Ae.jsx)(k,{value:e,children:W(e)},e))]})})]})]})]})}function oa({pending:e,snapshot:a}){return a?(0,Ae.jsxs)("div",{className:"grid gap-2",children:[(0,Ae.jsxs)("div",{className:"grid gap-1 text-xs text-muted-foreground",children:[a.limitName?(0,Ae.jsx)("div",{children:a.limitName}):null,a.planType?(0,Ae.jsxs)("div",{children:["Plan: ",K(a.planType)]}):null,a.credits?(0,Ae.jsxs)("div",{children:["Credits:"," ",a.credits.unlimited?"unlimited":a.credits.balance??(a.credits.hasCredits?"available":"depleted")]}):null,a.rateLimitReachedType?(0,Ae.jsx)("div",{className:"text-destructive",children:Y(a.rateLimitReachedType)}):null]}),(0,Ae.jsx)(ca,{fallbackLabel:"5-hour limit",severity:"fiveHour",window:a.primary}),(0,Ae.jsx)(ca,{fallbackLabel:"Weekly limit",severity:"weekly",window:a.secondary})]}):(0,Ae.jsx)("div",{className:"rounded-md bg-muted/60 p-2 text-xs text-muted-foreground",children:e?"Loading limits...":"Usage limits are unavailable."})}function ca({fallbackLabel:e,severity:a,window:t}){const s=f(t?.usedPercent??0),n=Math.max(0,Math.round(100-s)),r=G(t);return(0,Ae.jsxs)("div",{className:ne("grid gap-1.5 rounded-md border p-2",r&&"fiveHour"===a&&"border-orange-300 bg-orange-50/70 text-orange-800 dark:border-orange-900/70 dark:bg-orange-950/25 dark:text-orange-200",r&&"weekly"===a&&"border-red-300 bg-red-50/70 text-red-800 dark:border-red-900/70 dark:bg-red-950/25 dark:text-red-200"),children:[(0,Ae.jsxs)("div",{className:"flex items-center justify-between gap-2 text-xs",children:[(0,Ae.jsx)("span",{className:"font-medium",children:O(t,e)}),(0,Ae.jsx)("span",{className:ne("text-muted-foreground",r&&"font-medium text-current"),children:t?`${n}% left`:"Unavailable"})]}),(0,Ae.jsx)("div",{className:"h-1.5 overflow-hidden rounded-full bg-muted",children:(0,Ae.jsx)("div",{className:ne("h-full rounded-full bg-foreground",r&&"fiveHour"===a&&"bg-orange-500",r&&"weekly"===a&&"bg-red-500"),style:{width:`${s}%`}})}),(0,Ae.jsxs)("div",{className:ne("flex flex-wrap items-center gap-x-3 gap-y-1 text-[11px] text-muted-foreground",r&&"text-current/80"),children:[t?(0,Ae.jsxs)("span",{children:[Math.round(s),"% used"]}):null,t?.windowDurationMins?(0,Ae.jsx)("span",{children:c(t.windowDurationMins)}):null,t?.resetsAt?(0,Ae.jsxs)("span",{children:["Resets ",S(t.resetsAt)]}):null]})]})}export{ia as a,aa as c,Ge as d,Xe as f,Te as h,ta as i,Je as l,$e as m,la as n,ra as o,Ye as p,da as r,sa as s,na as t,ea as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{F as e,M as s,R as r,k as a,s as t,t as n}from"./jsx-runtime-BD6xVgfN.js";import{Ut as i,Wt as o,m as d}from"./api-Bq1vju8d.js";import{n as l,t as c}from"./label-PRFnRUMj.js";import{n as m,r as u}from"./session-provider-Bxa1AL3n.js";import{c as p,t as x}from"./input-DmJ6N0Sh.js";var h=o("plug-zap",[["path",{d:"M6.3 20.3a2.4 2.4 0 0 0 3.4 0L12 18l-6-6-2.3 2.3a2.4 2.4 0 0 0 0 3.4Z",key:"goz73y"}],["path",{d:"m2 22 3-3",key:"19mgm9"}],["path",{d:"M7.5 13.5 10 11",key:"7xgeeb"}],["path",{d:"M10.5 16.5 13 14",key:"10btkg"}],["path",{d:"m18 3-4 4h6l-4 4",key:"16psg9"}]]),f=r(e(),1),g=n();function j(){const[e,s]=(0,f.useState)(""),[r,n]=(0,f.useState)(""),[o,j]=(0,f.useState)(null),[w,y]=(0,f.useState)(null),[b,N]=(0,f.useState)(!1),{loading:k,session:C,setup:S}=m(),z=a(),E=!1===o;if((0,f.useEffect)(()=>{let e=!0;return y(null),d(u(window.location.origin)).then(s=>{e&&j(s.passwordConfigured)}).catch(s=>{e&&(y(s instanceof Error?s.message:"Unable to read server auth status."),j(!0))}),()=>{e=!1}},[]),k)return(0,g.jsx)("div",{className:"flex min-h-svh items-center justify-center bg-background",children:(0,g.jsx)(i,{className:"size-5 animate-spin text-muted-foreground"})});if(C)return(0,g.jsx)(t,{replace:!0,to:"/"});if(null===o)return(0,g.jsx)("div",{className:"flex min-h-svh items-center justify-center bg-background",children:(0,g.jsx)(i,{className:"size-5 animate-spin text-muted-foreground"})});async function P(){if(y(null),E&&e!==r)y("Passwords do not match.");else{N(!0);try{await S(e),z("/",{replace:!0})}catch(s){y(s instanceof Error?s.message:"Unable to connect.")}finally{N(!1)}}}return(0,g.jsx)("main",{className:"flex min-h-svh items-center justify-center bg-muted/30 px-4 py-8",children:(0,g.jsxs)("section",{className:"w-full max-w-md rounded-xl border bg-background p-5 shadow-sm",children:[(0,g.jsxs)("div",{className:"mb-6 flex items-center gap-3",children:[(0,g.jsx)("div",{className:"flex size-10 items-center justify-center rounded-lg bg-primary/10 text-primary",children:E?(0,g.jsx)(l,{className:"size-5"}):(0,g.jsx)(h,{className:"size-5"})}),(0,g.jsxs)("div",{children:[(0,g.jsx)("h1",{className:"text-lg font-semibold tracking-normal",children:E?"Set Server Password":"Connect Server"}),(0,g.jsx)("p",{className:"text-sm text-muted-foreground",children:E?"Choose a password for this xedoc instance.":"Enter the server password for this xedoc instance."})]})]}),(0,g.jsxs)("div",{className:"grid gap-4",children:[(0,g.jsxs)("div",{className:"grid gap-2",children:[(0,g.jsx)(c,{htmlFor:"server-password",children:"Server password"}),(0,g.jsx)(x,{id:"server-password",autoComplete:E?"new-password":"current-password",placeholder:"Password",type:"password",value:e,onChange:e=>s(e.target.value),onKeyDown:s=>{"Enter"===s.key&&v(e,r,E)&&P()}})]}),E?(0,g.jsxs)("div",{className:"grid gap-2",children:[(0,g.jsx)(c,{htmlFor:"server-password-confirm",children:"Confirm password"}),(0,g.jsx)(x,{id:"server-password-confirm",autoComplete:"new-password",placeholder:"Password",type:"password",value:r,onChange:e=>n(e.target.value),onKeyDown:s=>{"Enter"===s.key&&v(e,r,E)&&P()}})]}):null,w?(0,g.jsx)("div",{className:"whitespace-pre-wrap rounded-md border border-destructive/30 bg-destructive/10 px-3 py-2 text-sm text-destructive",children:w}):null,(0,g.jsxs)(p,{disabled:!v(e,r,E)||b,onClick:()=>{P()},children:[b?(0,g.jsx)(i,{className:"animate-spin"}):E?(0,g.jsx)(l,{}):(0,g.jsx)(h,{}),E?"Set Password":"Connect"]})]})]})})}function v(e,s,r){return e.trim().length>0&&(!r||s.trim().length>0)}var w=s(function(){return(0,g.jsx)(j,{})});export{w as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{F as e,R as t,t as n}from"./jsx-runtime-BD6xVgfN.js";import{t as s}from"./react-dom-Cmetac4J.js";import{A as a,Bt as o,E as r,Et as i,Ft as l,It as d,O as u,Ot as c,Rt as p,S as f,Tt as m,U as g,_ as h,b as y,c as v,d as x,f as b,g as C,h as S,i as P,k as R,m as w,n as k,p as T,r as O,s as E,t as I,u as M,v as A,w as j,x as D,y as H,z,zt as N}from"./usePositioner-DoPOYGgd.js";import{$ as V,Bt as B,Et as L,Ft as F,G as U,Ht as $,It as K,K as W,Ot as X,Pt as _,Q as Y,St as G,Tt as J,U as Q,Vt as q,Wt as Z,dt as ee,jt as te,tt as ne}from"./api-Bq1vju8d.js";var se=t(e(),1),ae=(e,t,n,s,a,o,r,i)=>{let l=document.documentElement,d=["light","dark"];function u(t){(Array.isArray(e)?e:[e]).forEach(e=>{let n="class"===e,s=n&&o?a.map(e=>o[e]||e):a;n?(l.classList.remove(...s),l.classList.add(o&&o[t]?o[t]:t)):l.setAttribute(e,t)}),function(e){i&&d.includes(e)&&(l.style.colorScheme=e)}(t)}if(s)u(s);else try{let e=localStorage.getItem(t)||n;u(r&&"system"===e?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":e)}catch(c){}},oe=["light","dark"],re="(prefers-color-scheme: dark)",ie="undefined"==typeof window,le=se.createContext(void 0),de={setTheme:e=>{},themes:[]},ue=()=>{var e;return null!=(e=se.useContext(le))?e:de},ce=e=>se.useContext(le)?se.createElement(se.Fragment,null,e.children):se.createElement(fe,{...e}),pe=["light","dark"],fe=({forcedTheme:e,disableTransitionOnChange:t=!1,enableSystem:n=!0,enableColorScheme:s=!0,storageKey:a="theme",themes:o=pe,defaultTheme:r=(n?"system":"light"),attribute:i="data-theme",value:l,children:d,nonce:u,scriptProps:c})=>{let[p,f]=se.useState(()=>ge(a,r)),[m,g]=se.useState(()=>"system"===p?ye():p),h=l?Object.values(l):o,y=se.useCallback(e=>{let a=e;if(!a)return;"system"===e&&n&&(a=ye());let o=l?l[a]:a,d=t?he(u):null,c=document.documentElement,p=e=>{"class"===e?(c.classList.remove(...h),o&&c.classList.add(o)):e.startsWith("data-")&&(o?c.setAttribute(e,o):c.removeAttribute(e))};if(Array.isArray(i)?i.forEach(p):p(i),s){let e=oe.includes(r)?r:null,t=oe.includes(a)?a:e;c.style.colorScheme=t}d?.()},[u]),v=se.useCallback(e=>{let t="function"==typeof e?e(p):e;f(t);try{localStorage.setItem(a,t)}catch(n){}},[p]),x=se.useCallback(t=>{g(ye(t)),"system"===p&&n&&!e&&y("system")},[p,e]);se.useEffect(()=>{let e=window.matchMedia(re);return e.addListener(x),x(e),()=>e.removeListener(x)},[x]),se.useEffect(()=>{let e=e=>{e.key===a&&(e.newValue?f(e.newValue):v(r))};return window.addEventListener("storage",e),()=>window.removeEventListener("storage",e)},[v]),se.useEffect(()=>{y(null!=e?e:p)},[e,p]);let b=se.useMemo(()=>({theme:p,setTheme:v,forcedTheme:e,resolvedTheme:"system"===p?m:p,themes:n?[...o,"system"]:o,systemTheme:n?m:void 0}),[p,v,e,m,n,o]);return se.createElement(le.Provider,{value:b},se.createElement(me,{forcedTheme:e,storageKey:a,attribute:i,enableSystem:n,enableColorScheme:s,defaultTheme:r,value:l,themes:o,nonce:u,scriptProps:c}),d)},me=se.memo(({forcedTheme:e,storageKey:t,attribute:n,enableSystem:s,enableColorScheme:a,defaultTheme:o,value:r,themes:i,nonce:l,scriptProps:d})=>{let u=JSON.stringify([n,t,o,e,i,r,s,a]).slice(1,-1);return se.createElement("script",{...d,suppressHydrationWarning:!0,nonce:"undefined"==typeof window?l:"",dangerouslySetInnerHTML:{__html:`(${ae.toString()})(${u})`}})}),ge=(e,t)=>{if(ie)return;let n;try{n=localStorage.getItem(e)||void 0}catch(s){}return n||t},he=e=>{let t=document.createElement("style");return e&&t.setAttribute("nonce",e),t.appendChild(document.createTextNode("*,*::before,*::after{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}")),document.head.appendChild(t),()=>{window.getComputedStyle(document.body),setTimeout(()=>{document.head.removeChild(t)},1)}},ye=e=>(e||(e=window.matchMedia(re)),e.matches?"dark":"light"),ve=Z("circle-check",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]),xe=Z("info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]),be=n(),Ce=se.createContext(void 0);function Se(e){const t=se.useContext(Ce);if(void 0===t&&!e)throw new Error(B(72));return t}var Pe=se.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeout:new l,currentIdRef:{current:null},currentContextRef:{current:null}});function Re(e){const{children:t,delay:n,timeoutMs:s=0}=e,a=se.useRef(n),o=se.useRef(n),r=se.useRef(null),i=se.useRef(null),l=d();return(0,be.jsx)(Pe.Provider,{value:se.useMemo(()=>({hasProvider:!0,delayRef:a,initialDelayRef:o,currentIdRef:r,timeoutMs:s,currentContextRef:i,timeout:l}),[s,l]),children:t})}function we(e){return null!=e&&null!=e.clientX}function ke(e,t={}){const n="rootStore"in e?e.rootStore:e,s=n.useState("open"),a=n.useState("floatingElement"),o=n.useState("domReferenceElement"),r=n.context.dataRef,{enabled:i=!0,axis:l="both"}=t,d=se.useRef(!1),u=se.useRef(null),[p,f]=se.useState(),[g,h]=se.useState([]),y=ne((e,t,s)=>{d.current||r.current.openEvent&&!we(r.current.openEvent)||n.set("positionReference",function(e,t){let n=null,s=null,a=!1;return{contextElement:e||void 0,getBoundingClientRect(){const o=e?.getBoundingClientRect()||{width:0,height:0,x:0,y:0},r="x"===t.axis||"both"===t.axis,i="y"===t.axis||"both"===t.axis,l=["mouseenter","mousemove"].includes(t.dataRef.current.openEvent?.type||"")&&"touch"!==t.pointerType;let d=o.width,u=o.height,c=o.x,p=o.y;return null==n&&t.x&&r&&(n=o.x-t.x),null==s&&t.y&&i&&(s=o.y-t.y),c-=n||0,p-=s||0,d=0,u=0,!a||l?(d="y"===t.axis?o.width:0,u="x"===t.axis?o.height:0,c=r&&null!=t.x?t.x:c,p=i&&null!=t.y?t.y:p):a&&!l&&(u="x"===t.axis?o.height:u,d="y"===t.axis?o.width:d),a=!0,{width:d,height:u,x:c,y:p,top:p,right:c+d,bottom:p+u,left:c}}}}(s??o,{x:e,y:t,axis:l,dataRef:r,pointerType:p}))}),v=ne(e=>{s?u.current||h([]):y(e.clientX,e.clientY,e.currentTarget)}),x=c(p)?a:s,b=se.useCallback(()=>{if(!x||!i)return;const e=ee(a);if(!r.current.openEvent||we(r.current.openEvent)){const t=()=>{u.current?.(),u.current=null};return u.current=m(e,"mousemove",function(e){Y(a,V(e))?(u.current?.(),u.current=null):y(e.clientX,e.clientY)}),t}n.set("positionReference",o)},[x,i,a,r,o,n,y]);se.useEffect(()=>b(),[b,g]),se.useEffect(()=>{i&&!a&&(d.current=!1)},[i,a]),se.useEffect(()=>{!i&&s&&(d.current=!0)},[i,s]);const C=se.useMemo(()=>{function e(e){f(e.pointerType)}return{onPointerDown:e,onPointerEnter:e,onMouseMove:v,onMouseEnter:v}},[v]);return se.useMemo(()=>i?{reference:C,trigger:C}:{},[i,C])}var Te=t(s()),Oe={...A,disabled:R(e=>e.disabled),instantType:R(e=>e.instantType),isInstantPhase:R(e=>e.isInstantPhase),trackCursorAxis:R(e=>e.trackCursorAxis),disableHoverablePopup:R(e=>e.disableHoverablePopup),lastOpenChangeReason:R(e=>e.openChangeReason),closeOnClick:R(e=>e.closeOnClick),closeDelay:R(e=>e.closeDelay),hasViewport:R(e=>e.hasViewport)},Ee=class e extends u{constructor(e){super({...{...h(),disabled:!1,instantType:void 0,isInstantPhase:!1,trackCursorAxis:"none",disableHoverablePopup:!1,openChangeReason:null,closeOnClick:!0,closeDelay:0,hasViewport:!1},...e},{popupRef:se.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:new H},Oe)}setOpen=(e,t)=>{const n=t.reason,s=n===F,a=e&&"trigger-focus"===n,o=!e&&("trigger-press"===n||"escape-key"===n);if(t.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},this.context.onOpenChange?.(e,t),t.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(e,t);const r=()=>{const s={open:e,openChangeReason:n};a?s.instantType="focus":o?s.instantType="dismiss":"trigger-hover"===n&&(s.instantType=void 0);const r=t.trigger?.id??null;(r||e)&&(s.activeTriggerId=r,s.activeTriggerElement=t.trigger??null),this.update(s)};s?Te.flushSync(r):r()};static useStore(t,n){const s=$(()=>new e(n)).current,a=t??s,o=C({popupStore:a,onOpenChange:a.setOpen});return a.state.floatingRootContext=o,a}};var Ie=N(function(e){const{disabled:t=!1,defaultOpen:n=!1,open:s,disableHoverablePopup:o=!1,trackCursorAxis:r="none",actionsRef:i,onOpenChange:l,onOpenChangeComplete:d,handle:u,triggerId:c,defaultTriggerId:f=null,children:m}=e,g=Ee.useStore(u?.store,{open:n,openProp:s,activeTriggerId:f,triggerIdProp:c});p(()=>{void 0===s&&!1===g.state.open&&!0===n&&g.update({open:!0,activeTriggerId:f})}),g.useControlledProp("openProp",s),g.useControlledProp("triggerIdProp",c),g.useContextCallback("onOpenChange",l),g.useContextCallback("onOpenChangeComplete",d);const h=g.useState("open"),v=!t&&h,x=g.useState("activeTriggerId"),C=g.useState("payload");g.useSyncedValues({trackCursorAxis:r,disableHoverablePopup:o}),q(()=>{h&&t&&g.setOpen(!1,G(J))},[h,t,g]),g.useSyncedValue("disabled",t),y(g);const{forceUnmount:S,transitionStatus:P}=D(v,g),R=g.select("floatingRootContext"),w=g.useState("isInstantPhase"),k=g.useState("instantType"),T=g.useState("lastOpenChangeReason"),O=se.useRef(null);q(()=>{"ending"===P&&"none"===T||"ending"!==P&&w?("delay"!==k&&(O.current=k),g.set("instantType","delay")):null!==O.current&&(g.set("instantType",O.current),O.current=null)},[P,w,T,k,g]),q(()=>{v&&null==x&&g.set("payload",void 0)},[g,x,v]);const E=se.useCallback(()=>{g.setOpen(!1,G(X))},[g]);se.useImperativeHandle(i,()=>({unmount:S,close:E}),[S,E]);const{getReferenceProps:I,getFloatingProps:M,getTriggerProps:A}=b([a(R,{enabled:!t,referencePress:()=>g.select("closeOnClick")}),ke(R,{enabled:!t&&"none"!==r,axis:"none"===r?void 0:r})]),j=se.useMemo(()=>I(),[I]),H=se.useMemo(()=>A(),[A]),z=se.useMemo(()=>M(),[M]);return g.useSyncedValues({activeTriggerProps:j,inactiveTriggerProps:H,popupProps:z}),(0,be.jsx)(Ce.Provider,{value:g,children:"function"==typeof m?m({payload:C}):m})}),Me=se.createContext(void 0);var Ae=function(e){return e[e.popupOpen=E.popupOpen]="popupOpen",e.triggerDisabled="data-trigger-disabled",e}({}),je=o(function(e,t){const{className:n,render:s,handle:a,payload:o,disabled:r,delay:l,closeOnClick:d=!0,closeDelay:u,id:c,style:p,...m}=e,g=Se(!0),h=a?.store??g;if(!h)throw new Error(B(82));const y=U(c),v=h.useState("isTriggerActive",y),b=h.useState("isOpenedByTrigger",y),C=h.useState("floatingRootContext"),P=se.useRef(null),R=l??600,w=u??0,{registerTrigger:k,isMountedByThisTrigger:O}=f(y,P,h,{payload:o,closeOnClick:d,closeDelay:w}),E=se.useContext(Me),{delayRef:I,isInstantPhase:A,hasProvider:j}=function(e,t={open:!1}){const n="rootStore"in e?e.rootStore:e,s=n.useState("floatingId"),{open:a}=t,{currentIdRef:o,delayRef:r,timeoutMs:l,initialDelayRef:d,currentContextRef:u,hasProvider:c,timeout:p}=se.useContext(Pe),[f,m]=se.useState(!1);return q(()=>{function e(){m(!1),u.current?.setIsInstantPhase(!1),o.current=null,u.current=null,r.current=d.current}if(o.current&&!a&&o.current===s){if(m(!1),l){const t=s;return p.start(l,()=>{n.select("open")||o.current&&o.current!==t||e()}),()=>{p.clear()}}e()}},[a,s,o,r,l,d,u,p,n]),q(()=>{if(!a)return;const e=u.current,t=o.current;p.clear(),u.current={onOpenChange:n.setOpen,setIsInstantPhase:m},o.current=s,r.current={open:0,close:i(d.current,"close")},null!==t&&t!==s?(m(!0),e?.setIsInstantPhase(!0),e?.onOpenChange(!1,G(te))):(m(!1),e?.setIsInstantPhase(!1))},[a,s,n,o,r,l,d,u,p]),q(()=>()=>{u.current=null},[u]),se.useMemo(()=>({hasProvider:c,delayRef:r,isInstantPhase:f}),[c,r,f])}(C,{open:b});h.useSyncedValue("isInstantPhase",A);const D=h.useState("disabled"),H=r??D,z=h.useState("trackCursorAxis"),N=h.useState("disableHoverablePopup"),V=T(C,{enabled:!H,mouseOnly:!0,move:!1,handleClose:N||"both"===z?null:x(),restMs(){const e=E?.delay,t="object"==typeof I.current?I.current.open:void 0;let n=R;return j&&(n=0!==t?l??e??R:0),n},delay(){const e="object"==typeof I.current?I.current.close:void 0;let t=w;return null==u&&j&&(t=e),{close:t}},triggerElementRef:P,isActiveTrigger:v,isClosing:()=>"ending"===h.select("transitionStatus")}),L=S(C,{enabled:!H}).reference,F={open:b},$=h.useState("triggerProps",O);return W("button",e,{state:F,ref:[t,k,P],props:[V,L,$,{onPointerDown(){h.set("closeOnClick",d)},id:y,[Ae.triggerDisabled]:H?"":void 0},m],stateAttributesMapping:M})}),De=se.createContext(void 0);var He=se.forwardRef(function(e,t){const{children:n,container:s,className:a,render:o,style:r,...i}=e,{portalNode:l,portalSubtree:d}=z({container:s,ref:t,componentProps:e,elementProps:i});return d||l?(0,be.jsxs)(se.Fragment,{children:[d,l&&Te.createPortal(n,l)]}):null}),ze=se.forwardRef(function(e,t){const{keepMounted:n=!1,...s}=e;return Se().useState("mounted")||n?(0,be.jsx)(De.Provider,{value:n,children:(0,be.jsx)(He,{ref:t,...s})}):null}),Ne=se.createContext(void 0);function Ve(){const e=se.useContext(Ne);if(void 0===e)throw new Error(B(71));return e}var Be=se.forwardRef(function(e,t){const{render:n,className:s,anchor:a,positionMethod:o="absolute",side:r="top",align:i="center",sideOffset:l=0,alignOffset:d=0,collisionBoundary:u="clipping-ancestors",collisionPadding:c=5,arrowPadding:p=5,sticky:f=!1,disableAnchorTracking:m=!1,collisionAvoidance:h=g,style:y,...v}=e,x=Se(),b=function(){const e=se.useContext(De);if(void 0===e)throw new Error(B(70));return e}(),C=x.useState("open"),S=x.useState("mounted"),R=x.useState("trackCursorAxis"),w=x.useState("disableHoverablePopup"),k=x.useState("floatingRootContext"),T=x.useState("instantType"),E=x.useState("transitionStatus"),M=O({anchor:a,positionMethod:o,floatingRootContext:k,mounted:S,side:r,sideOffset:l,align:i,alignOffset:d,collisionBoundary:u,collisionPadding:c,sticky:f,arrowPadding:p,disableAnchorTracking:m,keepMounted:b,collisionAvoidance:h,adaptiveOrigin:x.useState("hasViewport")?P:void 0}),A=I(e,se.useMemo(()=>({open:C,side:M.side,align:M.align,anchorHidden:M.anchorHidden,instant:"none"!==R?"tracking-cursor":T}),[C,M.side,M.align,M.anchorHidden,R,T]),{styles:M.positionerStyles,transitionStatus:E,props:v,refs:[t,x.useStateSetter("positionerElement")],hidden:!S,inert:!C||"both"===R||w});return(0,be.jsx)(Ne.Provider,{value:M,children:A})}),Le={...v,...r},Fe=se.forwardRef(function(e,t){const{className:n,render:s,style:a,...o}=e,r=Se(),{side:i,align:l}=Ve(),d=r.useState("open"),u=r.useState("instantType"),c=r.useState("transitionStatus"),p=r.useState("popupProps"),f=r.useState("floatingRootContext");j({open:d,ref:r.context.popupRef,onComplete(){d&&r.context.onOpenChangeComplete?.(!0)}});const m=r.useState("disabled"),g=r.useState("closeDelay");return w(f,{enabled:!m,closeDelay:g}),W("div",e,{state:{open:d,side:i,align:l,instant:u,transitionStatus:c},ref:[t,r.context.popupRef,r.useStateSetter("popupElement")],props:[p,k(c),o],stateAttributesMapping:Le})}),Ue=se.forwardRef(function(e,t){const{className:n,render:s,style:a,...o}=e,r=Se(),i=r.useState("open"),l=r.useState("instantType"),{arrowRef:d,side:u,align:c,arrowUncentered:p,arrowStyles:f}=Ve();return W("div",e,{state:{open:i,side:u,align:c,uncentered:p,instant:l},ref:[t,d],props:[{style:f,"aria-hidden":!0},o],stateAttributesMapping:v})}),$e=function(e){const{delay:t,closeDelay:n,timeout:s=400}=e,a=se.useMemo(()=>({delay:t,closeDelay:n}),[t,n]),o=se.useMemo(()=>({open:t,close:n}),[t,n]);return(0,be.jsx)(Me.Provider,{value:a,children:(0,be.jsx)(Re,{delay:o,timeoutMs:s,children:e.children})})};function Ke({delay:e=0,...t}){return(0,be.jsx)($e,{"data-slot":"tooltip-provider",delay:e,...t})}function We({...e}){return(0,be.jsx)(Ie,{"data-slot":"tooltip",...e})}function Xe({...e}){return(0,be.jsx)(je,{"data-slot":"tooltip-trigger",...e})}function _e({className:e,side:t="top",sideOffset:n=4,align:s="center",alignOffset:a=0,children:o,...r}){return(0,be.jsx)(ze,{children:(0,be.jsx)(Be,{align:s,alignOffset:a,side:t,sideOffset:n,className:"isolate z-50",children:(0,be.jsxs)(Fe,{"data-slot":"tooltip-content",className:Q("z-50 inline-flex w-fit max-w-xs origin-(--transform-origin) items-center gap-1.5 rounded-md bg-foreground px-3 py-1.5 text-xs text-background has-data-[slot=kbd]:pr-1.5 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 **:data-[slot=kbd]:relative **:data-[slot=kbd]:isolate **:data-[slot=kbd]:z-50 **:data-[slot=kbd]:rounded-sm data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",e),...r,children:[o,(0,be.jsx)(Ue,{className:"z-50 size-2.5 translate-y-[calc(-50%-2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground data-[side=bottom]:top-1 data-[side=inline-end]:top-1/2! data-[side=inline-end]:-left-1 data-[side=inline-end]:-translate-y-1/2 data-[side=inline-start]:top-1/2! data-[side=inline-start]:-right-1 data-[side=inline-start]:-translate-y-1/2 data-[side=left]:top-1/2! data-[side=left]:-right-1 data-[side=left]:-translate-y-1/2 data-[side=right]:top-1/2! data-[side=right]:-left-1 data-[side=right]:-translate-y-1/2 data-[side=top]:-bottom-2.5"})]})})})}var Ye="xedoc";function Ge(e){const t=function(e){const t=e?.replace(/\s+/g," ").trim();return t?`${t} - ${Ye}`:Ye}(e);(0,se.useEffect)(()=>{if("undefined"!=typeof document)return document.title=t,()=>{document.title=Ye}},[t])}export{Ke as a,ve as c,_e as i,ce as l,Ge as n,Xe as o,We as r,xe as s,Ye as t,ue as u};
|