@kky42/pievo-server 2.0.0 → 2.0.1
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/.output/nitro.json +1 -1
- package/.output/public/assets/{LoopView-d0XYkzpx.js → LoopView-XXW59HAV.js} +3 -3
- package/.output/public/assets/{Modal-D_od-AuP.js → Modal-BnCPgN_k.js} +1 -1
- package/.output/public/assets/{SignIn-CbMeIAJZ.js → SignIn-BAoOONQ9.js} +1 -1
- package/.output/public/assets/{actionUi-ChGGALzg.js → actionUi-Dxe9cHAc.js} +1 -1
- package/.output/public/assets/app-Cr02jQtI.css +2 -0
- package/.output/public/assets/index-Dg07vo1l.js +12 -0
- package/.output/public/assets/{invite._token-DJtd-XE2.js → invite._token-BAqaXvte.js} +1 -1
- package/.output/public/assets/{invite._token-Cl9Oarnq.js → invite._token-DclJQM6f.js} +1 -1
- package/.output/public/assets/{lifecycleUi-DGVOf5yS.js → lifecycleUi-B8Je9exd.js} +1 -1
- package/.output/public/assets/loops._loopId-vRXeqe7u.js +4 -0
- package/.output/public/assets/{loops._loopId_.runs._runId-DepMp3Me.js → loops._loopId_.runs._runId-Cz3Z0VE_.js} +2 -2
- package/.output/public/assets/notifyFns-BDwtMV1G.js +1 -0
- package/.output/public/assets/{routes-CTtlM_qt.js → routes-C7Pw5lGn.js} +1 -1
- package/.output/public/assets/{routes-BB4aDC1D.js → routes-DPWJg52d.js} +1 -1
- package/.output/public/assets/{t._teamId-D552b9PT.js → t._teamId-BW5yIkA-.js} +1 -1
- package/.output/public/assets/{t._teamId-gR7BVKkR.js → t._teamId-CCgajlMS.js} +1 -1
- package/.output/public/assets/ui-RFP3R3lU.js +1 -0
- package/.output/server/_ssr/{DashboardView-D3E-zevQ.mjs → DashboardView-DJlDpXxU.mjs} +13 -10
- package/.output/server/_ssr/{LoopPlaybook-DJlWGia5.mjs → LoopPlaybook-BxKPoWAp.mjs} +2 -2
- package/.output/server/_ssr/{LoopView-BtMANpb_.mjs → LoopView-B0AwFjwS.mjs} +4 -4
- package/.output/server/_ssr/{Modal-DpKZHLZK.mjs → Modal-CfWC9R49.mjs} +2 -2
- package/.output/server/_ssr/{SignIn-CjFonm71.mjs → SignIn-C1duN7oy.mjs} +3 -3
- package/.output/server/_ssr/{actionUi-CZbEixbf.mjs → actionUi-mDYOvJdB.mjs} +2 -2
- package/.output/server/_ssr/{adapters-vbuo_-wD.mjs → adapters-C10CmWK4.mjs} +3 -3
- package/.output/server/_ssr/{artifactFiles-BGod8IWQ.mjs → artifactFiles-uxLErS_7.mjs} +3 -3
- package/.output/server/_ssr/artifacts-Dnvoxi-_.mjs +2 -0
- package/.output/server/_ssr/{auth-Ca-um-e8.mjs → auth-C6uZpC6v.mjs} +9 -9
- package/.output/server/_ssr/{boot-CkFZynUz.mjs → boot-BpqTI96x.mjs} +81 -94
- package/.output/server/_ssr/{boot-C0f0HGCw.mjs → boot-C-47Ycr2.mjs} +1 -1
- package/.output/server/_ssr/{bun-sqlite-dialect-BW9W1_Ps-CG9VPNj0.mjs → bun-sqlite-dialect-BW9W1_Ps-DlRsM3s1.mjs} +2 -2
- package/.output/server/_ssr/{d1-sqlite-dialect-BLC8LXE6-DBf7xVin.mjs → d1-sqlite-dialect-BLC8LXE6-Ct-4mGlC.mjs} +2 -2
- package/.output/server/_ssr/db-DB8pQ07M.mjs +2 -0
- package/.output/server/_ssr/{dist-CwI9FwLx.mjs → dist-lkoxB9C9.mjs} +2 -2
- package/.output/server/_ssr/{factory-L3gsmDL7.mjs → factory-D73dkxmb.mjs} +2 -2
- package/.output/server/_ssr/{invite._token-DJxGLILJ.mjs → invite._token-23daBIfe.mjs} +2 -2
- package/.output/server/_ssr/{invite._token-CN2p7Gt3.mjs → invite._token-C80Kxhqw.mjs} +5 -5
- package/.output/server/_ssr/{invite._token-KLCPnHk-.mjs → invite._token-D-KuiRD1.mjs} +4 -4
- package/.output/server/_ssr/{kysely-adapter-Czkfz-W-.mjs → kysely-adapter-YDb9pnV-.mjs} +1 -1
- package/.output/server/_ssr/{lifecycleUi-BhRsBvJ7.mjs → lifecycleUi-l3nx9i3T.mjs} +3 -3
- package/.output/server/_ssr/logger-Dhuet6zm.mjs +2 -0
- package/.output/server/_ssr/{loopApi-CVf9RC6s.mjs → loopApi-BXHLHlt_.mjs} +11 -11
- package/.output/server/_ssr/{loops._loopId-gNSxIQBe.mjs → loops._loopId-BVPj6kiH.mjs} +3 -3
- package/.output/server/_ssr/{loops._loopId-CbuhuTAp.mjs → loops._loopId-DVG3dDvp.mjs} +12 -12
- package/.output/server/_ssr/{loops._loopId_.runs._runId-0MahUyHy.mjs → loops._loopId_.runs._runId-Db6cTcUT.mjs} +6 -6
- package/.output/server/_ssr/{loops._loopId_.runs._runId-BptlCXat.mjs → loops._loopId_.runs._runId-DbEF9MQu.mjs} +3 -3
- package/.output/server/_ssr/{machineFns-D5rQWyLl.mjs → machineFns-B1ZLIrOn.mjs} +3 -3
- package/.output/server/_ssr/{node-sqlite-dialect-Dr9_QokR.mjs → node-sqlite-dialect-01BHn7am.mjs} +2 -2
- package/.output/server/_ssr/{notifyFns-BobPaLWi.mjs → notifyFns-CM35mqF2.mjs} +3 -3
- package/.output/server/_ssr/{notifyFns-c7ZY2TWF.mjs → notifyFns-qZ6FYwAL.mjs} +6 -5
- package/.output/server/_ssr/{router-B8JTBtGd.mjs → router-B8W3-k_h.mjs} +29 -29
- package/.output/server/_ssr/{routes-BJCWMIzb.mjs → routes-BiAkIPos.mjs} +5 -5
- package/.output/server/_ssr/{routes-Bcs4T1ox.mjs → routes-DjaTMZqZ.mjs} +2 -2
- package/.output/server/_ssr/{routes-B-MWifFy.mjs → routes-hr1KuV9-.mjs} +5 -5
- package/.output/server/_ssr/{runDiff-C0w1D4a3.mjs → runDiff-CyN5ZR5F.mjs} +2 -2
- package/.output/server/_ssr/ssr.mjs +48 -48
- package/.output/server/_ssr/store-DUMLJS0E.mjs +2 -0
- package/.output/server/_ssr/{t._teamId-fw8RfHyI.mjs → t._teamId-B9E7Vgt3.mjs} +5 -5
- package/.output/server/_ssr/{t._teamId-FYVEIAGw.mjs → t._teamId-CxuiffZZ.mjs} +5 -5
- package/.output/server/_ssr/{t._teamId-Dy_McbRt.mjs → t._teamId-D_vi_OuG.mjs} +2 -2
- package/.output/server/_ssr/{teamFns-Dz41U7gA.mjs → teamFns-DKpLbIiB.mjs} +3 -3
- package/.output/server/_ssr/{tokens-3ZFpqsuf.mjs → tokens-DuV-D_RB.mjs} +1 -1
- package/.output/server/_ssr/{ui-Dej2qjuS.mjs → ui-WGITbP6Z.mjs} +72 -51
- package/.output/server/{_tanstack-start-manifest_v-C9p30TZH.mjs → _tanstack-start-manifest_v-ClkHkr-O.mjs} +25 -25
- package/.output/server/drizzle/0012_blocked_run_status.sql +12 -0
- package/.output/server/drizzle/0013_drop_run_outcome.sql +2 -0
- package/.output/server/drizzle/meta/_journal.json +14 -0
- package/.output/server/index.mjs +106 -106
- package/drizzle/0012_blocked_run_status.sql +12 -0
- package/drizzle/0013_drop_run_outcome.sql +2 -0
- package/drizzle/meta/_journal.json +14 -0
- package/package.json +1 -1
- package/.output/public/assets/app-vKFxjMMk.css +0 -2
- package/.output/public/assets/index-DSF-1ahT.js +0 -12
- package/.output/public/assets/loops._loopId-B-dYxc9i.js +0 -4
- package/.output/public/assets/notifyFns-b_jCi5XK.js +0 -1
- package/.output/public/assets/ui-Dp88qUWh.js +0 -1
- package/.output/server/_ssr/artifacts-CduiDAM2.mjs +0 -2
- package/.output/server/_ssr/db-Cs0gnPZZ.mjs +0 -2
- package/.output/server/_ssr/logger-Cj1GFV_8.mjs +0 -2
- package/.output/server/_ssr/store-LYphMSJ-.mjs +0 -2
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/CodeField-dOzyFQNH.js","assets/jsx-runtime-BseJUIpC.js","assets/LoopView-d0XYkzpx.js","assets/Modal-D_od-AuP.js","assets/loopApi-5s2-kCnu.js","assets/ui-Dp88qUWh.js","assets/artifactView-DekEs5ME.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{n as e,s as t,t as n}from"./jsx-runtime-BseJUIpC.js";import{S as r,_ as i,b as a,h as o,i as s,o as ee,r as c,u as l,v as u,x as d,y as te}from"./loopApi-5s2-kCnu.js";import{c as f,f as ne,p as re,t as ie}from"./preload-helper-ycaoAemE.js";import{a as ae,o as oe,r as se,s as ce}from"./notifyFns-b_jCi5XK.js";import{C as le,D as ue,E as de,M as p,N as fe,O as pe,S as m,_ as h,b as me,c as he,d as ge,g as _e,i as ve,j as ye,l as be,m as g,n as xe,o as _,p as v,r as y,s as Se,t as Ce,v as b,w as we,x as Te}from"./ui-Dp88qUWh.js";import{i as Ee,n as De,r as Oe,t as ke}from"./lifecycleUi-DGVOf5yS.js";import{c as Ae,r as x}from"./index-DSF-1ahT.js";import{a as S,i as je,n as C,o as w,t as T}from"./artifactView-DekEs5ME.js";import{t as Me}from"./SignIn-CbMeIAJZ.js";import{i as Ne,n as Pe,r as Fe,t as Ie}from"./actionUi-ChGGALzg.js";var E=t(e(),1);function Le(e){if(!e)return null;let t=e.replace(/\\/g,`/`).replace(/\/+$/,``),n=t.lastIndexOf(`/`);return n>0?t.slice(0,n):null}function Re({loopId:e,loopName:t,instruction:n}){let r=n?.trim()||`Describe the change you want to make to this loop.`;return[`I want to adjust my Pievo loop "${t}" (loop id: ${e}).`,``,`The change I want:`,r,``,`Use the installed pievo CLI/skill to apply it: run \`pievo loops\` to find the loop, then \`pievo edit ${e} ...\` to make the change, and confirm the loop now reflects it. Ask me first if anything is unclear.`].join(`
|
|
3
|
-
`)}var D=n(),O=e=>e.split(`/`).pop()||e;function ze(e){let t=e.match(/\.([a-z0-9]+)$/i);return t?t[1].toLowerCase():`file`}function Be({loopId:e,taskFile:t,taskFileContent:n,taskFileSyncedAt:r,running:i}){let[a,o]=(0,E.useState)(null),[s,c]=(0,E.useState)(null),l=(0,E.useRef)(0),u=(0,E.useCallback)(async()=>{let t=++l.current;try{let n=await ee({data:{loopId:e}});t===l.current&&o(n)}catch{t===l.current&&o(e=>e??[])}},[e]);(0,E.useEffect)(()=>{o(null),c(null),u()},[e,u]),(0,E.useEffect)(()=>{let e=setInterval(()=>void u(),i?4e3:12e3);return()=>clearInterval(e)},[i,u]);let d=(0,E.useMemo)(()=>S(t,a??[]),[t,a]),te=s&&d.some(e=>e.path===s)?s:d[0]?.path??null,f=d.find(e=>e.path===te)??null,ne=w(f);return(0,D.jsxs)(`section`,{id:`files`,className:`min-w-0`,children:[(0,D.jsxs)(`div`,{className:`mb-2.5 flex items-end justify-between gap-3 border-b border-hairline pb-1.5`,children:[(0,D.jsxs)(`h2`,{className:`text-label font-semibold text-secondary`,children:[`Files`,a?` (${d.length})`:``]}),(0,D.jsx)(`span`,{className:`text-caption font-medium text-disabled`,children:`Spec + synced artifacts`})]}),d.length===0?(0,D.jsx)(`div`,{className:`rounded-card border border-hairline bg-surface px-5 py-10 text-center text-body text-disabled shadow-card`,children:a==null?`Loading…`:`No files yet - the task file and synced artifacts appear here.`}):(0,D.jsxs)(`div`,{className:`grid h-[min(600px,68vh)] grid-cols-1 overflow-hidden rounded-card border border-hairline bg-surface shadow-card sm:grid-cols-[210px_1fr]`,children:[(0,D.jsx)(`nav`,{className:`max-h-44 overflow-y-auto border-b border-hairline sm:max-h-none sm:border-b-0 sm:border-r`,children:(0,D.jsx)(`ul`,{className:`py-1.5`,children:d.map(e=>{let t=e.path===te,n=w(e),r=!n&&e.kind===`artifact`?e.file.meta:null,i=r?.title?.trim()||``,a=i&&i!==O(e.path)?i:O(e.path),o=e.path.includes(`/`)||a!==O(e.path);return(0,D.jsx)(`li`,{children:(0,D.jsxs)(`button`,{type:`button`,onClick:()=>c(e.path),className:`flex w-full items-center gap-2 border-l-2 px-3 py-2 text-left transition-colors ${t?`border-display bg-raised`:`border-transparent hover:bg-raised/60`}`,children:[(0,D.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,D.jsx)(`span`,{className:`block truncate font-mono text-label ${t?`text-display`:`text-primary`}`,title:e.path,children:a}),o&&(0,D.jsx)(`span`,{className:`block truncate font-mono text-micro text-disabled`,title:e.path,children:e.path})]}),n?(0,D.jsx)(`span`,{className:`shrink-0 rounded-full bg-interactive-soft px-2 text-caption font-medium text-interactive`,children:`Task`}):r?.type?(0,D.jsx)(`span`,{className:`shrink-0 truncate rounded-full bg-raised px-2 text-caption font-medium text-secondary`,title:`type: ${r.type}`,children:r.type}):(0,D.jsx)(`span`,{className:`shrink-0 font-mono text-micro text-disabled`,children:ze(e.path)})]})},e.path)})})}),(0,D.jsx)(`div`,{className:`min-w-0 overflow-y-auto`,children:ne&&f?(0,D.jsx)(k,{path:f.path,content:n,syncedAt:r}):f?.kind===`artifact`?(0,D.jsx)(A,{loopId:e,file:f.file}):null})]})]})}function k({path:e,content:t,syncedAt:n}){return(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(C,{path:e,meta:n?`Task file · synced ${we(n)}`:`Task file`}),t==null?(0,D.jsx)(`div`,{className:`px-5 py-6 text-body text-disabled`,children:`(syncs from the machine on the next run)`}):(0,D.jsx)(je,{content:t})]})}function A({loopId:e,file:t}){let n=[t.size==null?``:de(t.size),`synced ${we(t.updatedAt)}`].filter(Boolean).join(` · `);return(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(C,{path:t.path,meta:n}),(0,D.jsx)(T,{loopId:e,file:t})]})}var Ve=[`claude-code`,`codex`];function j(e){return{executor:`claude`,workdir:e.workdir.trim(),model:e.model.trim(),reasoningEffort:e.reasoningEffort.trim(),allowControl:e.allowControl}}var M=(0,E.lazy)(()=>ie(()=>import(`./CodeField-dOzyFQNH.js`),__vite__mapDeps([0,1])));function N(e){let t=e?.exec;return{name:e?.name??``,cron:e?.cron??`0 */3 * * *`,scheduleMode:e?.scheduleMode??`cron`,continuousDelayMinutes:String(e?.continuousDelayMinutes??1),taskFile:e?.taskFile??``,notify:e?.notify??`auto`,channelId:e?.channelId??``,stateSchema:e?.stateSchema?JSON.stringify(e.stateSchema):``,ui:e?.ui??``,agent:e?.agent??`claude-code`,workdir:t?.workdir??``,model:t?.model??``,reasoningEffort:t?.reasoningEffort??``,allowControl:!!t?.allowControl}}var P=`mt-1 text-caption leading-snug text-disabled`,F={"claude-code":`Claude Code`,codex:`Codex`};function I({label:e,value:t,onChange:n,mono:r,ph:i,hint:a}){let o=(0,E.useId)();return(0,D.jsxs)(`div`,{className:`min-w-0`,children:[(0,D.jsx)(`label`,{htmlFor:o,className:g,children:e}),(0,D.jsx)(`input`,{id:o,type:`text`,className:r?`${v} font-mono`:v,value:t,placeholder:i,onChange:e=>n(e.target.value)}),a&&(0,D.jsx)(`div`,{className:P,children:a})]})}function L({title:e,hint:t}){return(0,D.jsxs)(`div`,{className:`mb-1 mt-7 border-b border-hairline pb-1.5`,children:[(0,D.jsx)(`h2`,{className:h,children:e}),t&&(0,D.jsx)(`div`,{className:`mt-0.5 text-caption text-disabled`,children:t})]})}function R({minHeight:e}){return(0,D.jsx)(`div`,{className:`rounded-control border border-wire bg-raised`,style:{minHeight:e}})}var He=(0,E.forwardRef)(function({initial:e,channels:t},n){let[r,i]=(0,E.useState)(()=>N(e)),a=(e,t)=>i(n=>({...n,[e]:t})),[o,s]=(0,E.useState)(null),[ee,c]=(0,E.useState)([]),l=t??ee;return(0,E.useEffect)(()=>{t||se().then(c).catch(()=>{})},[t]),(0,E.useImperativeHandle)(n,()=>({read(){let e,t=r.stateSchema.trim();if(t)try{e=JSON.parse(t)}catch{return s(`Not valid JSON - expected an array like [{"key":"mrr","label":"MRR","unit":"$"}]`),null}return{name:r.name.trim(),cron:r.cron.trim(),scheduleMode:r.scheduleMode,continuousDelayMinutes:Math.max(1,Number.parseInt(r.continuousDelayMinutes,10)||1),taskFile:r.taskFile.trim(),notify:r.notify,channelId:r.channelId||null,ui:r.ui.trim()||void 0,agent:r.agent,exec:j(r),stateSchema:e}}})),(0,D.jsxs)(`div`,{className:`grid gap-x-10 lg:grid-cols-[minmax(300px,380px)_minmax(0,1fr)]`,children:[(0,D.jsxs)(`div`,{className:`min-w-0`,children:[(0,D.jsx)(L,{title:`Basics`}),(0,D.jsx)(I,{label:`Name`,value:r.name,onChange:e=>a(`name`,e)}),(0,D.jsxs)(`div`,{className:`min-w-0`,children:[(0,D.jsx)(`label`,{className:g,children:`Schedule mode`}),(0,D.jsxs)(`select`,{"aria-label":`Schedule mode`,className:b,value:r.scheduleMode,onChange:e=>a(`scheduleMode`,e.target.value),children:[(0,D.jsx)(`option`,{value:`cron`,children:`Cron`}),(0,D.jsx)(`option`,{value:`continuous`,children:`Continuous`})]}),r.scheduleMode===`cron`?(0,D.jsxs)(`div`,{className:`${v} flex cursor-default select-none items-center justify-between gap-2 bg-raised`,title:r.cron,children:[(0,D.jsx)(`span`,{className:`truncate text-primary`,children:me(r.cron)}),(0,D.jsx)(`span`,{className:`shrink-0 font-mono text-caption text-secondary`,children:r.cron})]}):(0,D.jsx)(I,{label:`Delay after each exec (minutes)`,value:r.continuousDelayMinutes,onChange:e=>a(`continuousDelayMinutes`,e),mono:!0,hint:`At least 1 minute. Done and error continue; canceled runs do not.`}),(0,D.jsx)(`div`,{className:P,children:`Cron is retained while continuous mode is active, so switching back restores it.`})]}),(0,D.jsx)(I,{label:`Task file`,value:r.taskFile,onChange:e=>a(`taskFile`,e),mono:!0,hint:`Path of the markdown file this loop tracks/maintains on the machine (optional).`}),(0,D.jsx)(L,{title:`Notifications`}),(0,D.jsxs)(`div`,{className:`min-w-0`,children:[(0,D.jsx)(`label`,{className:g,children:`Notify`}),(0,D.jsx)(`select`,{"aria-label":`Notify`,className:b,value:r.notify,onChange:e=>a(`notify`,e.target.value),children:[`auto`,`always`,`never`].map(e=>(0,D.jsx)(`option`,{children:e},e))}),(0,D.jsx)(`div`,{className:P,children:`auto pushes only when a run found something; never silences everything.`})]}),(0,D.jsxs)(`div`,{className:`min-w-0`,children:[(0,D.jsx)(`label`,{className:g,children:`Push channel`}),(0,D.jsxs)(`select`,{"aria-label":`Push channel`,className:b,value:r.channelId,onChange:e=>a(`channelId`,e.target.value),children:[(0,D.jsx)(`option`,{value:``,children:`none (dashboard only)`}),l.map(e=>(0,D.jsx)(`option`,{value:e.id,children:e.name},e.id))]})]}),(0,D.jsx)(L,{title:`Execution`,hint:`Which coding agent on the machine runs this loop.`}),(0,D.jsxs)(`div`,{className:`min-w-0`,children:[(0,D.jsx)(`label`,{className:g,children:`Coding agent`}),(0,D.jsx)(`select`,{"aria-label":`Coding agent`,className:b,value:r.agent,onChange:e=>a(`agent`,e.target.value),children:Ve.map(e=>(0,D.jsx)(`option`,{value:e,children:F[e]??e},e))}),(0,D.jsx)(`div`,{className:P,children:`Which coding agent executes this loop on the bound machine.`})]}),(0,D.jsx)(I,{label:`Working directory`,value:r.workdir,onChange:e=>a(`workdir`,e),mono:!0,ph:`/Users/you/Workspace/project`,hint:`Project root on the machine. Empty lets the daemon use a scratch directory.`}),(0,D.jsx)(I,{label:`Model`,value:r.model,onChange:e=>a(`model`,e),ph:`default`,hint:`Optional arbitrary model id. Empty uses the coding-agent CLI default.`}),(0,D.jsx)(I,{label:`Reasoning effort`,value:r.reasoningEffort,onChange:e=>a(`reasoningEffort`,e),ph:`default`,hint:`Optional arbitrary effort value. Empty uses the coding-agent CLI default.`}),(0,D.jsxs)(`label`,{className:`mt-4 flex cursor-pointer items-center gap-2 text-body text-primary`,children:[(0,D.jsx)(`input`,{type:`checkbox`,className:`accent-[color:var(--color-display)]`,checked:r.allowControl,onChange:e=>a(`allowControl`,e.target.checked)}),`Allow self-rescheduling`]})]}),(0,D.jsxs)(`div`,{className:`min-w-0`,children:[(0,D.jsx)(L,{title:`Agent-authored content`,hint:`Metrics and dashboard - usually written by evolve passes; edit by hand here when you know exactly what you want.`}),(0,D.jsx)(`label`,{className:g,children:`Metrics schema · JSON array`}),(0,D.jsx)(E.Suspense,{fallback:(0,D.jsx)(R,{minHeight:`90px`}),children:(0,D.jsx)(M,{lang:`json`,value:r.stateSchema,onChange:e=>{a(`stateSchema`,e),s(null)},minHeight:`90px`,invalid:!!o,placeholder:`[{"key":"mrr","label":"MRR","unit":"$"},{"key":"paid"}]`})}),o?(0,D.jsx)(`div`,{className:`mt-1 text-caption leading-snug text-accent`,children:o}):(0,D.jsx)(`div`,{className:P,children:`Per-run metrics the agent reports; they feed the dashboard charts.`}),(0,D.jsx)(`label`,{className:g,children:`Dashboard template · HTML`}),(0,D.jsx)(E.Suspense,{fallback:(0,D.jsx)(R,{minHeight:`240px`}),children:(0,D.jsx)(M,{lang:`html`,value:r.ui,onChange:e=>a(`ui`,e),minHeight:`240px`,placeholder:`<h3>{{latest.mrr}}$</h3>
|
|
4
|
-
<loop-chart series="mrr:MRR:$"></loop-chart>`})}),(0,D.jsxs)(`div`,{className:P,children:[`Agent-authored HTML with `,`{{bindings}}`,` and loop-chart / loop-embed / loop-calendar / loop-kanban elements.`]})]})]})}),Ue={"claude-code":`Claude Code`,codex:`Codex`},We=[{label:`Change the schedule`,seed:`Change the schedule: `},{label:`Adjust what it does`,seed:`Change what this loop does: `},{label:`Improve the dashboard`,seed:`Improve the dashboard: `},{label:`Set a finish line`,seed:`Give this loop a goal, and finish it once the goal is met: `}],Ge=(0,E.lazy)(()=>ie(()=>import(`./LoopView-d0XYkzpx.js`).then(e=>({default:e.LoopView})),__vite__mapDeps([2,1,3,4,5,6])));function z({id:e}){let t=re(),[n,ee]=(0,E.useState)(null),[f,ie]=(0,E.useState)([]),[oe,le]=(0,E.useState)(null),[de,p]=(0,E.useState)(null),[m,h]=(0,E.useState)(!1),[ge,g]=(0,E.useState)(!1),[v,b]=(0,E.useState)(``),[x,S]=(0,E.useState)(!1),[je,C]=(0,E.useState)(!1),[w,T]=(0,E.useState)(null),Me=(0,E.useRef)(null),[O,ze]=(0,E.useState)(!1),[k,A]=(0,E.useState)(null),[Ve,j]=(0,E.useState)(!1),[M,N]=Ne(),P=(0,E.useRef)(null),F=(0,E.useRef)(!1),[I,L]=(0,E.useState)([]),R=(0,E.useCallback)(async(n=!1)=>{try{let t=await l({data:e});ee(t),F.current=t.summary.deleteRequestedAt!=null,le(null)}catch(e){F.current?t({to:`/`}):n||le(String(e))}},[e]);(0,E.useEffect)(()=>{ee(null),h(!1),g(!1),b(``),S(!1),C(!1),T(null),j(!1),L([]),R(),se().then(ie).catch(()=>{})},[e,R]);let z=!!n?.summary.running;(0,E.useEffect)(()=>{if(m)return;let e=setInterval(()=>void R(!0),z||F.current?3e3:8e3);return()=>clearInterval(e)},[m,z,R]);async function V(){await R()}async function Je(){p(null),A(`run`);try{let t=await a({data:e});if(t?.error)return p(`Run failed: ${t.error}`);N({label:t.coalesced?`Already queued`:`Queued`,hold:4e3}),await V()}finally{A(null)}}async function Ye(){p(null),A(`evolve`);try{let t=await s({data:e});if(t?.error)return p(`Evolve failed: ${t.error}`);N({label:t.coalesced?`Evolve already queued`:`Evolve queued`,hold:4e3}),await V()}finally{A(null)}}async function H(n){p(null),A(`lifecycle`);try{let a=n===`pause`?await u({data:e}):n===`start`?await d({data:e}):n===`stop`?await r({data:e}):n===`reopen`?await i({data:{id:e,patch:{enabled:!0}}}):await c({data:e});if(a.error)return p(`${n[0].toUpperCase()+n.slice(1)} failed: ${a.error}`);if(j(!1),a.deleted){F.current=!1,t({to:`/`});return}n===`delete`&&(F.current=!0),await V(),N({label:n===`start`?`Started`:n===`reopen`?`Reopened`:n===`pause`?`Paused`:n===`stop`?`Stop requested`:`Deleting`})}finally{A(null)}}async function Xe(){let t=P.current?.read();if(t){p(null),A(`save`);try{let n=await i({data:{id:e,patch:t}});if(n.error)return p(`Save failed: ${n.error}`);h(!1),await V(),N({label:`Saved`})}finally{A(null)}}}async function Ze(){let t=v.trim();if(t){p(null),A(`edit`);try{let n=await te({data:{id:e,instruction:t}});if(n.error)return p(`Couldn't queue the edit: ${n.error}`);T(n.runId??null),C(!0),g(!1),b(``),await V()}finally{A(null)}}}let U=(0,D.jsxs)(ne,{to:`/`,className:`inline-flex items-center gap-1.5 text-meta font-medium text-secondary transition-colors hover:text-display`,children:[(0,D.jsx)(`span`,{"aria-hidden":!0,children:`←`}),` Loops`]});if(oe)return(0,D.jsx)(B,{back:U,children:(0,D.jsx)(Fe,{title:`Couldn't load this loop.`,detail:oe,onRetry:()=>void R()})});if(!n)return(0,D.jsx)(B,{back:U,children:(0,D.jsx)(xe,{})});let{job:W,summary:G,runs:Qe}=n,$e=!!W.ui,et=!!k,tt=n.machine.online,K=n.machine.presence===`asleep`,nt=tt?void 0:K?`Machine asleep - requests will stay queued until it wakes`:`Machine offline - requests will stay queued until it reconnects`,q=pe(G),J=Oe(G),rt=Ee(n),it=De(n.machine.daemonProtocol),at=ue(G)&&!q,ot=n.machine.name?`“${n.machine.name}”`:`the bound machine`,Y=je&&w?Qe.find(e=>e.id===w):void 0,st=!!Y&&!Y.queued&&!Y.running,ct=()=>{C(!1),T(null)},lt=Le(W.taskFile),ut=async()=>{try{await navigator.clipboard.writeText(Re({loopId:e,loopName:G.name,instruction:v})),S(!0),setTimeout(()=>S(!1),4e3)}catch{p(`Could not copy the prompt - try again or copy it manually.`)}},dt=M&&(0,D.jsx)(`div`,{className:`mb-2.5`,children:(0,D.jsx)(Pe,{label:M.label,tone:M.tone,onUndo:M.undo})}),X=J===`deleting`,ft=!G.enabled&&!q&&!X,pt=G.enabled&&!q&&!X,Z=et||X,Q=pt||ft,mt=Q&&!!G.running&&it.supported,ht=G.running&&!it.supported?ke:G.running?void 0:`No run is currently running`,gt=(0,D.jsxs)(`div`,{className:`min-w-0`,children:[(0,D.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-2`,children:[(0,D.jsx)(`button`,{className:be,disabled:Z||!Q,onClick:()=>void Je(),title:Q?nt??(W.exec?`Spends credits`:void 0):`Unavailable for a completed or deleting loop`,"aria-label":W.exec?`Run once - spends credits`:`Run once`,children:k===`run`?`Queuing…`:`Run once`}),(0,D.jsx)(`button`,{className:_,disabled:Z||!(Q||q),title:`Dispatch or copy a prompt for an owner-requested edit`,onClick:()=>g(!0),children:`Agent edit`}),(0,D.jsx)(`button`,{className:_,disabled:Z||!Q,title:Q?nt??`Spends credits`:`Unavailable for a completed or deleting loop`,onClick:()=>void Ye(),children:k===`evolve`?`Evolving…`:`Evolve once`}),(0,D.jsx)(`button`,{className:_,disabled:Z,onClick:()=>h(!0),children:`Settings`}),(0,D.jsx)(`button`,{className:_,disabled:Z||!ft,onClick:()=>void H(`start`),children:`Start`}),(0,D.jsx)(`button`,{className:_,disabled:Z||!pt,onClick:()=>void H(`pause`),children:`Pause`}),(0,D.jsx)(`button`,{className:he,disabled:Z||!mt,title:ht,onClick:()=>void H(`stop`),children:`Stop`}),(0,D.jsx)(`button`,{className:_,disabled:Z||!q,onClick:()=>void H(`reopen`),children:`Reopen`}),(0,D.jsx)(`button`,{className:he,disabled:Z,onClick:()=>j(!0),children:X?`Deleting…`:`Delete`})]}),Ve&&!X&&(0,D.jsx)(`div`,{className:`mt-3`,children:(0,D.jsx)(Ie,{prompt:`Stop this loop and delete its server data?`,note:`This stops the loop and deletes server history and synced artifacts. Local files are not deleted. If the machine is unreachable, server data is still deleted and its local process may continue running.`,cta:`Delete`,danger:!0,busy:et,onConfirm:()=>void H(`delete`),onCancel:()=>j(!1)})}),X&&(0,D.jsx)(`div`,{className:`mt-3 rounded-md border border-wire bg-raised px-4 py-3 text-meta text-secondary`,children:`Deleting… graceful stop is waiting for execution authority to end.`}),ge&&!X&&(0,D.jsxs)(`div`,{className:`mt-4 border-t border-hairline pt-4`,onKeyDown:e=>{e.key===`Escape`&&k!==`edit`&&(e.stopPropagation(),g(!1))},children:[(0,D.jsxs)(`div`,{className:`flex flex-wrap items-baseline justify-between gap-x-4 gap-y-1`,children:[(0,D.jsx)(`span`,{className:`text-body font-medium text-display`,children:`Edit with your coding agent`}),(0,D.jsxs)(`span`,{className:`text-meta text-secondary`,children:[`One agent pass on `,ot,` · spends credits`]})]}),(0,D.jsx)(`textarea`,{ref:Me,autoFocus:!0,value:v,onChange:e=>b(e.target.value),onKeyDown:e=>{(e.metaKey||e.ctrlKey)&&e.key===`Enter`&&v.trim()&&k!==`edit`&&Ze()},rows:3,placeholder:`e.g. run at 9am on weekdays instead, and also check coffee stock`,className:`mt-3 w-full resize-y rounded-control border border-wire bg-raised p-3 font-mono text-label leading-relaxed text-primary outline-none transition-shadow placeholder:text-disabled focus:border-transparent focus:shadow-focus`}),!v.trim()&&(0,D.jsx)(`div`,{className:`mt-2 flex flex-wrap gap-1.5`,children:We.map(e=>(0,D.jsx)(`button`,{type:`button`,onClick:()=>{b(e.seed),Me.current?.focus()},className:`cursor-pointer rounded-full border border-wire bg-surface px-3 py-1 text-label font-medium text-secondary transition-colors hover:bg-raised hover:text-display`,children:e.label},e.label))}),(0,D.jsxs)(`div`,{className:`mt-3.5 flex flex-wrap items-center gap-x-2.5 gap-y-2`,children:[(0,D.jsx)(`button`,{className:Se,disabled:k===`edit`||!v.trim(),title:nt,onClick:()=>void Ze(),children:k===`edit`?`Dispatching…`:`Dispatch to your coding agent`}),(0,D.jsx)(`button`,{type:`button`,className:_,disabled:k===`edit`,onClick:()=>void ut(),children:x?`✓ Prompt copied`:`Copy prompt`}),(0,D.jsx)(`button`,{className:_,disabled:k===`edit`,onClick:()=>g(!1),children:`Cancel`}),(0,D.jsx)(`span`,{className:`hidden text-caption text-disabled sm:inline`,children:`⌘↩ dispatch · esc cancel`})]}),(0,D.jsx)(`div`,{className:`mt-2 text-caption leading-snug text-disabled`,children:x?(0,D.jsxs)(`span`,{className:`text-secondary`,children:[`✓ Copied · run your coding agent`,` `,lt?(0,D.jsxs)(D.Fragment,{children:[`in `,(0,D.jsx)(`code`,{className:`break-all font-mono text-primary`,children:lt})]}):`in the loop’s local directory on this machine`,` `,`and paste the prompt to adjust the loop yourself.`]}):(0,D.jsx)(D.Fragment,{children:`Prefer to adjust it yourself? Copy prompt drops a ready-to-paste prompt for your own coding agent - no dispatch, no credits.`})})]})]}),_t=de&&(0,D.jsx)(Ce,{message:de,onDismiss:()=>p(null),className:`mb-2.5`}),$=n.team&&!n.team.isActive?n.team:null,vt=e=>{Ae(e),t({to:`/t/$teamId`,params:{teamId:e}})},yt=$&&(0,D.jsxs)(`div`,{className:`mb-2.5 flex flex-wrap items-center gap-x-3 gap-y-1.5 rounded-control border border-hairline bg-raised px-4 py-2.5`,children:[(0,D.jsxs)(`span`,{className:`inline-flex items-center gap-2 text-meta font-medium text-secondary`,children:[(0,D.jsx)(`span`,{"aria-hidden":!0,className:`size-2 rounded-full bg-interactive`}),`Viewing a loop in `,$.name]}),(0,D.jsx)(`span`,{className:`text-meta text-secondary`,children:`- not your active team.`}),(0,D.jsx)(`button`,{type:`button`,onClick:()=>vt($.id),className:`ml-auto cursor-pointer text-meta font-medium text-interactive underline underline-offset-2 transition-colors hover:text-display`,children:`Switch to this team`})]}),bt=!tt&&(0,D.jsxs)(`div`,{className:`mb-2.5 flex flex-wrap items-center gap-x-3 gap-y-1.5 rounded-control border border-hairline bg-raised px-4 py-2.5`,children:[(0,D.jsxs)(`span`,{className:`inline-flex items-center gap-2 text-meta font-medium text-secondary`,children:[(0,D.jsx)(`span`,{"aria-hidden":!0,className:`size-2 rounded-full ${K?`bg-rubik-yellow`:`bg-disabled`}`}),`Machine `,n.machine.name?`“${n.machine.name}” `:``,K?`seems to be asleep or offline`:`offline`]}),(0,D.jsxs)(`span`,{className:`text-meta text-secondary`,children:[K?`- queued work starts automatically when it reconnects.`:`- manual run, evolve, and edit requests remain safely queued.`,n.machine.lastSeen?` Last seen ${ye(n.machine.lastSeen)}.`:``]}),(0,D.jsx)(`button`,{type:`button`,onClick:()=>ze(!0),className:`ml-auto cursor-pointer text-meta font-medium text-interactive underline underline-offset-2 transition-colors hover:text-display`,children:`Reconnect`})]});if(m)return(0,D.jsxs)(B,{back:U,children:[(0,D.jsx)(Ke,{name:G.name,onBack:()=>h(!1)}),(0,D.jsxs)(`div`,{className:`mt-5 rounded-card border border-hairline bg-surface px-6 pb-6 pt-2 shadow-card`,children:[(0,D.jsx)(He,{ref:P,initial:W,channels:f}),(0,D.jsxs)(`div`,{className:`mt-7 border-t border-hairline pt-4`,children:[_t,(0,D.jsxs)(`div`,{className:`flex flex-wrap gap-2.5`,children:[(0,D.jsx)(`button`,{className:be,disabled:k===`save`,onClick:Xe,children:k===`save`?`Saving…`:`Save`}),(0,D.jsx)(`button`,{className:_,disabled:k===`save`,onClick:()=>h(!1),children:`Cancel`})]})]})]})]});let xt=Ue[W.agent??`claude-code`]??W.agent??`Claude Code`,St=W.exec?.model?.trim()||`default`,Ct=W.exec?.reasoningEffort?.trim()||`default`,wt=Qe[0],Tt=wt?.reportIncident?wt:void 0,Et=(0,D.jsx)(`span`,{className:`text-wire`,children:`·`});return(0,D.jsxs)(B,{back:U,children:[(0,D.jsxs)(`header`,{className:`rounded-card border border-hairline bg-surface px-6 pb-5 pt-[22px] shadow-card`,children:[(0,D.jsx)(`div`,{className:`flex flex-wrap items-start justify-between gap-x-6 gap-y-4`,children:(0,D.jsxs)(`div`,{className:`min-w-0`,children:[(0,D.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,D.jsx)(`h1`,{className:`text-[28px] font-semibold leading-tight tracking-[-0.015em] text-display`,children:G.name}),J===`completed`?(0,D.jsx)(y,{tone:`success`,dot:`green`,children:`Completed`}):(0,D.jsx)(y,{tone:J===`stopping`?`running`:void 0,dot:J===`stopping`?`pulse`:void 0,children:rt}),G.queued&&J===`active`?(0,D.jsx)(y,{tone:`outline`,children:`Queued`}):null,at&&(0,D.jsx)(y,{tone:`success`,title:G.goal??void 0,children:`Goal`}),(0,D.jsx)(y,{tone:`outline`,title:`Recorded coding agent`,children:xt}),(0,D.jsx)(y,{tone:`outline`,title:`Model: ${St}`,children:(0,D.jsxs)(`span`,{className:`max-w-72 truncate`,children:[`Model: `,St]})}),(0,D.jsx)(y,{tone:`outline`,title:`Reasoning: ${Ct}`,children:(0,D.jsxs)(`span`,{className:`max-w-72 truncate`,children:[`Reasoning: `,Ct]})}),$&&(0,D.jsx)(y,{tone:`outline`,title:`This loop belongs to another of your teams`,children:$.name})]}),(0,D.jsxs)(`div`,{className:`mt-2.5 flex flex-wrap items-center gap-x-2.5 gap-y-1 text-meta text-secondary`,children:[(0,D.jsx)(`span`,{className:`text-primary`,title:W.cron,children:W.scheduleMode===`continuous`?`continuous · ${W.continuousDelayMinutes}m delay`:me(W.cron)}),Et,(0,D.jsxs)(`span`,{children:[`next `,we(G.nextRun)]}),G.nextRun&&G.enabled&&!q&&(0,D.jsxs)(`span`,{className:`text-disabled`,children:[`(`,fe(G.nextRun),`)`]}),Et,(0,D.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,title:tt?`Machine online`:K?`Machine asleep`:`Machine offline`,children:[(0,D.jsx)(`span`,{className:`size-1.5 rounded-full ${tt?`bg-rubik-green`:K?`bg-rubik-yellow`:`bg-disabled`}`}),n.machine.name||`machine`]}),Et,(0,D.jsx)(`span`,{title:`Breaking daemon/server lifecycle protocol`,children:it.label}),Et,(0,D.jsx)(`code`,{className:`font-mono text-label text-disabled`,children:G.id})]}),at&&G.goal&&(0,D.jsxs)(`div`,{className:`mt-2 text-body leading-snug text-secondary`,children:[`Working toward: `,(0,D.jsx)(`span`,{className:`text-primary`,children:G.goal})]}),J===`completed`&&(0,D.jsxs)(`div`,{className:`mt-2 text-body leading-snug text-success`,children:[`Completed`,G.completedAt?` · ${we(G.completedAt)}`:``,G.completionReason&&(0,D.jsxs)(`span`,{className:`text-secondary`,children:[` - `,G.completionReason]})]}),Tt?.reportIncident&&(0,D.jsx)(`div`,{className:`mt-2 text-body leading-snug text-secondary`,children:Tt.outcome===`error`?`Last run failed · Terminal report rejected`:`Last run telemetry warning · Terminal report rejected`})]})}),(0,D.jsxs)(`div`,{className:`mt-5 border-t border-hairline pt-4`,children:[yt,bt,_t,dt,gt]})]}),je&&(0,D.jsxs)(`section`,{className:`mt-6 rounded-card border border-hairline bg-surface px-6 py-5 shadow-card`,style:{animation:`fadeIn 0.2s ease-out`},"aria-live":`polite`,children:[(0,D.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-4 gap-y-2`,children:[!Y||Y.queued?(0,D.jsxs)(`span`,{className:`inline-flex items-center gap-2.5 text-body text-secondary`,children:[(0,D.jsx)(`span`,{"aria-hidden":!0,className:`size-1.5 shrink-0 rounded-full bg-disabled`}),(0,D.jsx)(`span`,{className:`font-medium text-primary`,children:`Edit queued`}),(0,D.jsxs)(`span`,{children:[`waiting for `,ot,` and higher-priority work…`]})]}):Y.running?(0,D.jsxs)(`span`,{className:`inline-flex min-w-0 items-center gap-2.5 text-body text-secondary`,children:[(0,D.jsx)(`span`,{"aria-hidden":!0,className:`size-1.5 shrink-0 rounded-full`,style:_e}),(0,D.jsx)(`span`,{className:`shrink-0 font-medium text-primary`,children:`Applying your edit`})]}):(0,D.jsxs)(`span`,{className:`inline-flex min-w-0 items-center gap-2 text-body`,children:[(0,D.jsx)(`span`,{"aria-hidden":!0,className:`size-2.5 shrink-0 rounded-[2px]`,style:{background:Te(Y)}}),(0,D.jsx)(`span`,{className:`font-medium`,style:{color:Te(Y)},children:Y.canceled?`Edit canceled`:Y.outcome===`error`?`Edit failed`:`Edit applied`}),Y.error&&(0,D.jsxs)(`span`,{className:`truncate text-secondary`,children:[`· `,Y.error]})]}),(0,D.jsxs)(`div`,{className:`ml-auto flex items-center gap-3.5`,children:[Y&&(0,D.jsx)(ne,{to:`/loops/$loopId/runs/$runId`,params:{loopId:e,runId:Y.id},className:`text-label font-medium text-interactive underline underline-offset-2 transition-colors hover:text-display`,children:`View run →`}),(0,D.jsx)(`button`,{type:`button`,onClick:ct,className:`inline-flex cursor-pointer items-center gap-1.5 border-none bg-transparent p-0 text-meta font-medium text-secondary transition-colors hover:text-display`,children:st?`Done`:`Hide`})]})]}),st&&Y.message&&(0,D.jsx)(`div`,{className:`mt-3.5`,children:(0,D.jsx)(ve,{children:Y.message})})]}),$e&&(0,D.jsxs)(`section`,{className:`mt-6 min-w-0 rounded-card border border-hairline bg-surface px-6 py-5 shadow-card`,children:[(0,D.jsx)(`div`,{className:`mb-3.5 border-b border-hairline pb-1.5 text-label font-semibold text-secondary`,children:`Dashboard`}),(0,D.jsx)(`div`,{className:`min-w-0 overflow-x-auto`,children:(0,D.jsx)(E.Suspense,{fallback:(0,D.jsx)(xe,{className:`py-4`}),children:(0,D.jsx)(Ge,{html:W.ui,runs:Qe,loopId:e,taskFile:W.taskFile})})})]}),(0,D.jsxs)(`div`,{className:`mt-6 grid grid-cols-1 gap-6 lg:grid-cols-[minmax(0,1fr)_minmax(300px,360px)]`,children:[(0,D.jsx)(Be,{loopId:e,taskFile:W.taskFile,taskFileContent:n.taskFileContent,taskFileSyncedAt:n.taskFileSyncedAt,running:z}),(0,D.jsx)(qe,{loopId:e,summary:G,runs:Qe,older:I,onMore:async()=>{let t=(I.length?ce(G.runs??[],I):G.runs??[])[0];if(!t)return 0;let n=await o({data:{loopId:e,beforeTs:t.ts,limit:16}});return n.length&&L(e=>ce(e,n)),n.length},onPickRun:n=>t({to:`/loops/$loopId/runs/$runId`,params:{loopId:e,runId:n.id}})})]}),(0,D.jsx)(ae,{open:O,onClose:()=>ze(!1)})]})}function Ke({name:e,onBack:t}){return(0,D.jsxs)(`div`,{children:[(0,D.jsxs)(`button`,{type:`button`,onClick:t,className:ge,children:[(0,D.jsx)(`span`,{"aria-hidden":!0,children:`←`}),` Back to loop`]}),(0,D.jsxs)(`h1`,{className:`mt-2.5 text-[24px] font-semibold leading-tight tracking-[-0.015em] text-display`,children:[`Settings · `,e]}),(0,D.jsx)(`p`,{className:`mt-1.5 max-w-[640px] text-meta leading-snug text-secondary`,children:`Loop configuration, notifications, and push channel, saved directly - no agent pass or credits. For changes in plain words, use Agent edit instead.`})]})}function B({back:e,children:t}){return(0,D.jsxs)(`main`,{className:`mx-auto max-w-[1360px] px-8 pb-24 pt-10`,children:[(0,D.jsx)(`div`,{className:`mb-5`,children:e}),t]})}function qe({loopId:e,summary:t,runs:n,older:r,onMore:i,onPickRun:a}){let o=(0,E.useMemo)(()=>r.length?ce(t.runs??[],r):t.runs??[],[t.runs,r]);return(0,D.jsxs)(`section`,{className:`min-w-0`,children:[(0,D.jsx)(`div`,{className:`mb-2.5 flex items-end justify-between gap-3 border-b border-hairline pb-1.5`,children:(0,D.jsxs)(`h2`,{className:h,children:[`Runs (`,t.runCount,`)`]})}),t.runCount===0?(0,D.jsx)(`div`,{className:`rounded-card border border-hairline bg-surface px-5 py-10 text-center text-body text-disabled`,children:`Never run`}):(0,D.jsxs)(`div`,{className:`rounded-card border border-hairline bg-surface px-5 pb-4 pt-5 shadow-card`,children:[(0,D.jsx)(oe,{job:t,runs:o,total:t.runCount,onLoadMore:i,onPickRun:a}),(0,D.jsx)(`ul`,{className:`mt-5 max-h-[clamp(280px,46vh,520px)] divide-y divide-hairline overflow-y-auto border-t border-hairline`,children:n.map(t=>(0,D.jsx)(`li`,{children:(0,D.jsxs)(ne,{to:`/loops/$loopId/runs/$runId`,params:{loopId:e,runId:t.id},className:`flex items-start gap-2.5 py-2.5 transition-colors hover:bg-raised`,children:[(0,D.jsx)(`span`,{className:`mt-1 inline-block size-2.5 shrink-0 rounded-[2px]`,style:{background:Te(t)},title:m(t),"aria-label":m(t)}),(0,D.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,D.jsxs)(`span`,{className:`flex items-baseline justify-between gap-2`,children:[(0,D.jsx)(`span`,{className:`font-mono text-label text-secondary`,children:p(t.ts)}),(0,D.jsx)(`span`,{className:`shrink-0 font-mono text-caption text-disabled`,children:le(t.durationMs)})]}),(0,D.jsx)(`span`,{className:`mt-0.5 block`,children:t.queued?(0,D.jsxs)(`span`,{className:`inline-flex items-center gap-2 text-meta text-secondary`,children:[(0,D.jsx)(`span`,{"aria-hidden":!0,className:`size-1.5 rounded-full bg-disabled`}),(0,D.jsx)(`span`,{children:`Queued`})]}):t.running?(0,D.jsxs)(`span`,{className:`inline-flex items-center gap-2 text-meta text-secondary`,children:[(0,D.jsx)(`span`,{"aria-hidden":!0,className:`size-1.5 rounded-full`,style:_e}),(0,D.jsx)(`span`,{children:`Running`})]}):t.error?(0,D.jsx)(`span`,{className:`line-clamp-2 text-meta text-secondary`,children:t.error}):(0,D.jsx)(`span`,{className:`line-clamp-2 text-meta text-primary`,children:t.message||m(t)})})]})]})},t.id))})]})]})}function V(){let{loopId:e}=x.useParams(),{auth:t}=x.useLoaderData()??{auth:{enabled:!1}},{data:n,isPending:r}=f();return t?.enabled&&!r&&!n?(0,D.jsx)(Me,{callbackURL:`/loops/${e}`}):(0,D.jsx)(z,{id:e})}export{V as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e,s as t,t as n}from"./jsx-runtime-BseJUIpC.js";import{D as r,I as i,c as a,w as o}from"./loopApi-5s2-kCnu.js";import{$ as s,A as c,At as l,B as u,Bt as d,C as f,Ct as p,D as m,Dt as h,E as g,Et as _,F as v,Ft as y,G as b,Gt as x,H as S,Ht as C,I as w,It as T,J as E,Jt as D,K as O,Kt as k,L as A,Lt as j,M,Mt as N,N as P,Nt as F,O as I,Ot as L,P as ee,Pt as R,Q as te,R as z,Rt as ne,S as re,St as ie,T as ae,Tt as oe,U as se,Ut as ce,V as le,Vt as ue,W as de,Wt as fe,X as B,Xt as pe,Y as V,Yt as me,Z as H,_ as he,_t as ge,a as _e,at as ve,b as ye,bt as be,c as xe,ct as Se,d as Ce,dt as we,et as Te,f as Ee,ft as De,g as Oe,gt as ke,h as Ae,ht as je,i as Me,it as U,j as Ne,jt as W,k as Pe,kt as Fe,l as Ie,m as Le,mt as Re,n as ze,nt as Be,o as Ve,ot as G,p as He,pt as K,q as Ue,qt as q,r as We,rt as J,s as Ge,st as Y,t as Ke,tt as qe,u as Je,ut as Ye,v as Xe,vt as Ze,w as Qe,wt as $e,x as et,xt as X,y as tt,yt as nt,z as rt,zt as it}from"./Modal-D_od-AuP.js";import{C as at,N as ot,O as st,S as ct,c as lt,h as ut,j as dt,l as ft,m as pt,o as mt,p as ht,t as gt,w as _t,x as vt,y as yt}from"./ui-Dp88qUWh.js";import{n as bt}from"./lifecycleUi-DGVOf5yS.js";var xt=t(i(),1),Z=n(),Q=t(e(),1),St=Q.createContext(void 0);function Ct(e){let t=Q.useContext(St);if(t===void 0&&!e)throw Error(k(72));return t}function wt(e,t){return t!=null&&!d(t)?0:typeof e==`function`?e():e}function Tt(e,t,n){let r=wt(e,n);return typeof r==`number`?r:r?.[t]}function Et(e){return typeof e==`function`?e():e}function Dt(e,t){return t||e===`click`||e===`mousedown`}function Ot(e){return e?.includes(`mouse`)&&e!==`mousedown`}var kt=Q.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeout:new ce,currentIdRef:{current:null},currentContextRef:{current:null}});function At(e,t){e.current=t.current}function jt(e){let{children:t,delay:n,timeoutMs:r=0}=e,i=Q.useRef(n),a=Q.useRef(n),o=Q.useRef(null),s=Q.useRef(null),c=fe();return q(()=>{if(a.current=n,!o.current){i.current=n;return}i.current={open:Tt(i.current,`open`),close:Tt(n,`close`)}},[n,o,i,a]),(0,Z.jsx)(kt.Provider,{value:Q.useMemo(()=>({hasProvider:!0,delayRef:i,initialDelayRef:a,currentIdRef:o,timeoutMs:r,currentContextRef:s,timeout:c}),[r,c]),children:t})}function Mt(e,t={open:!1}){let{open:n}=t,r=`rootStore`in e?e.rootStore:e,i=r.useState(`floatingId`),{currentIdRef:a,delayRef:o,timeoutMs:s,initialDelayRef:c,currentContextRef:l,hasProvider:u,timeout:d}=Q.useContext(kt),[f,p]=Q.useState(!1),m=Q.useRef(n),h=Q.useRef(!1);return q(()=>{m.current=n},[n]),q(()=>()=>{h.current=!0},[]),q(()=>{function e(){h.current||p(!1),l.current?.setIsInstantPhase(!1),a.current=null,l.current=null,o.current=c.current,d.clear()}if(a.current&&!n&&a.current===i){if(p(!1),s){let t=i;return d.start(s,()=>{r.select(`open`)||a.current&&a.current!==t||e()}),()=>{(m.current||a.current!==t)&&d.clear()}}e()}},[n,i,a,o,s,c,l,d,r]),q(()=>{if(!n)return;let e=l.current,t=a.current;d.clear(),l.current={onOpenChange:r.setOpen,setIsInstantPhase:p},a.current=i,o.current={open:0,close:Tt(c.current,`close`)},t!==null&&t!==i?(p(!0),e?.setIsInstantPhase(!0),e?.onOpenChange(!1,Y(we))):(p(!1),e?.setIsInstantPhase(!1))},[n,i,r,a,o,c,l,d]),q(()=>()=>{if(a.current===i){if(l.current=null,!m.current)return;a.current=null,At(o,c),d.clear()}},[l,a,o,i,c,d]),Q.useMemo(()=>({hasProvider:u,delayRef:o,isInstantPhase:f}),[u,o,f])}function Nt(e,t){let n=null,r=null,i=!1;return{contextElement:e||void 0,getBoundingClientRect(){let a=e?.getBoundingClientRect()||{width:0,height:0,x:0,y:0},o=t.axis===`x`||t.axis===`both`,s=t.axis===`y`||t.axis===`both`,c=[`mouseenter`,`mousemove`].includes(t.dataRef.current.openEvent?.type||``)&&t.pointerType!==`touch`,l=a.width,u=a.height,d=a.x,f=a.y;return n==null&&t.x&&o&&(n=a.x-t.x),r==null&&t.y&&s&&(r=a.y-t.y),d-=n||0,f-=r||0,l=0,u=0,!i||c?(l=t.axis===`y`?a.width:0,u=t.axis===`x`?a.height:0,d=o&&t.x!=null?t.x:d,f=s&&t.y!=null?t.y:f):i&&!c&&(u=t.axis===`x`?a.height:u,l=t.axis===`y`?a.width:l),i=!0,{width:l,height:u,x:d,y:f,top:f,right:d+l,bottom:f+u,left:d}}}}function Pt(e){return e!=null&&e.clientX!=null}function Ft(e,t={}){let{enabled:n=!0,axis:r=`both`}=t,i=`rootStore`in e?e.rootStore:e,a=i.useState(`open`),o=i.useState(`floatingElement`),s=i.useState(`domReferenceElement`),c=i.context.dataRef,l=Q.useRef(!1),u=Q.useRef(null),[f,p]=Q.useState(),[m,h]=Q.useState([]),g=J(e=>{i.set(`positionReference`,e)}),_=J((e,t,n)=>{l.current||c.current.openEvent&&!Pt(c.current.openEvent)||i.set(`positionReference`,Nt(n??s,{x:e,y:t,axis:r,dataRef:c,pointerType:f}))}),v=J(e=>{a?u.current||(_(e.clientX,e.clientY,e.currentTarget),h([])):_(e.clientX,e.clientY,e.currentTarget)}),y=d(f)?o:a;Q.useEffect(()=>{if(!n){g(s);return}if(!y)return;function e(){u.current?.(),u.current=null}let t=W(o);function r(t){X(o,ie(t))?e():_(t.clientX,t.clientY)}return!c.current.openEvent||Pt(c.current.openEvent)?u.current=G(t,`mousemove`,r):g(s),e},[y,n,o,c,s,i,_,g,m]),Q.useEffect(()=>()=>{i.set(`positionReference`,null)},[i]),Q.useEffect(()=>{n&&!o&&(l.current=!1)},[n,o]),Q.useEffect(()=>{!n&&a&&(l.current=!0)},[n,a]);let b=Q.useMemo(()=>{function e(e){p(e.pointerType)}return{onPointerDown:e,onPointerEnter:e,onMouseMove:v,onMouseEnter:v}},[v]);return Q.useMemo(()=>n?{reference:b,trigger:b}:{},[n,b])}function It(e,t,n){let{reference:r,floating:i}=e,a=B(t),o=le(t),s=se(o),c=V(t),l=a===`y`,d=r.x+r.width/2-i.width/2,f=r.y+r.height/2-i.height/2,p=r[s]/2-i[s]/2,m;switch(c){case`top`:m={x:d,y:r.y-i.height};break;case`bottom`:m={x:d,y:r.y+r.height};break;case`right`:m={x:r.x+r.width,y:f};break;case`left`:m={x:r.x-i.width,y:f};break;default:m={x:r.x,y:r.y}}switch(u(t)){case`start`:m[o]-=p*(n&&l?-1:1);break;case`end`:m[o]+=p*(n&&l?-1:1);break}return m}async function Lt(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:c}=e,{boundary:l=`clippingAncestors`,rootBoundary:u=`viewport`,elementContext:d=`floating`,altBoundary:f=!1,padding:p=0}=z(t,e),m=E(p),h=o[f?d===`floating`?`reference`:`floating`:d],g=s(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(h))??!0?h:h.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:l,rootBoundary:u,strategy:c})),_=d===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,v=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),y=await(i.isElement==null?void 0:i.isElement(v))&&await(i.getScale==null?void 0:i.getScale(v))||{x:1,y:1},b=s(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:_,offsetParent:v,strategy:c}):_);return{top:(g.top-b.top+m.top)/y.y,bottom:(b.bottom-g.bottom+m.bottom)/y.y,left:(g.left-b.left+m.left)/y.x,right:(b.right-g.right+m.right)/y.x}}var Rt=50,zt=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:Lt},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=It(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<Rt&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=It(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},Bt=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=z(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=V(r),_=B(o),v=V(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[Ue(o)]:de(o)),x=p!==`none`;!d&&x&&b.push(...O(o,m,p,y));let C=[o,...b],w=await s.detectOverflow(t,h),T=[],E=i.flip?.overflows||[];if(l&&T.push(w[g]),u){let e=S(r,a,y);T.push(w[e[0]],w[e[1]])}if(E=[...E,{placement:r,overflows:T}],!T.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=C[e];if(t&&(!(u===`alignment`&&_!==B(t))||E.every(e=>B(e.placement)===_?e.overflows[0]>0:!0)))return{data:{index:e,overflows:E},reset:{placement:t}};let n=E.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=E.filter(e=>{if(x){let t=B(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o;break}if(r!==n)return{reset:{placement:n}}}return{}}}};function Vt(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Ht(e){return qe.some(t=>e[t]>=0)}var Ut=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=z(e,t);switch(i){case`referenceHidden`:{let e=Vt(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:Ht(e)}}}case`escaped`:{let e=Vt(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:Ht(e)}}}default:return{}}}}},Wt=new Set([`left`,`top`]);async function Gt(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=V(n),s=u(n),c=B(n)===`y`,l=Wt.has(o)?-1:1,d=a&&c?-1:1,f=z(t,e),{mainAxis:p,crossAxis:m,alignmentAxis:h}=typeof f==`number`?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return s&&typeof h==`number`&&(m=s===`end`?h*-1:h),c?{x:m*d,y:p*l}:{x:p*l,y:m*d}}var Kt=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await Gt(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},qt=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=z(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=B(V(i)),p=b(f),m=u[p],h=u[f];if(o){let e=p===`y`?`top`:`left`,t=p===`y`?`bottom`:`right`,n=m+d[e],r=m-d[t];m=w(n,m,r)}if(s){let e=f===`y`?`top`:`left`,t=f===`y`?`bottom`:`right`,n=h+d[e],r=h-d[t];h=w(n,h,r)}let g=c.fn({...t,[p]:m,[f]:h});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[p]:o,[f]:s}}}}}},Jt=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=z(e,t),u={x:n,y:r},d=B(i),f=b(d),p=u[f],m=u[d],h=z(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=Wt.has(V(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},Yt=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){var n,r;let{placement:i,rects:a,platform:o,elements:s}=t,{apply:c=()=>{},...l}=z(e,t),d=await o.detectOverflow(t,l),f=V(i),p=u(i),m=B(i)===`y`,{width:h,height:g}=a.floating,_,v;f===`top`||f===`bottom`?(_=f,v=p===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?`start`:`end`)?`left`:`right`):(v=f,_=p===`end`?`top`:`bottom`);let y=g-d.top-d.bottom,b=h-d.left-d.right,x=te(g-d[_],y),S=te(h-d[v],b),C=!t.middlewareData.shift,w=x,T=S;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(T=b),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(w=y),C&&!p){let e=H(d.left,0),t=H(d.right,0),n=H(d.top,0),r=H(d.bottom,0);m?T=h-2*(e!==0||t!==0?e+t:H(d.left,d.right)):w=g-2*(n!==0||r!==0?n+r:H(d.top,d.bottom))}await c({...t,availableWidth:T,availableHeight:w});let E=await o.getDimensions(s.floating);return h!==E.width||g!==E.height?{reset:{rects:!0}}:{}}}};function Xt(e){let t=p(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=R(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=Te(n)!==a||Te(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function Zt(e){return F(e)?e:e.contextElement}function Qt(e){let t=Zt(e);if(!R(t))return A(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=Xt(t),o=(a?Te(n.width):n.width)/r,s=(a?Te(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var $t=A(0);function en(e){let t=W(e);return!it()||!t.visualViewport?$t:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function tn(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==W(e)?!1:t}function nn(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=Zt(e),o=A(1);t&&(r?F(r)&&(o=Qt(r)):o=Qt(e));let c=tn(a,n,r)?en(a):A(0),l=(i.left+c.x)/o.x,u=(i.top+c.y)/o.y,d=i.width/o.x,f=i.height/o.y;if(a){let e=W(a),t=r&&F(r)?W(r):r,n=e,i=_(n);for(;i&&r&&t!==n;){let e=Qt(i),t=i.getBoundingClientRect(),r=p(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;l*=e.x,u*=e.y,d*=e.x,f*=e.y,l+=a,u+=o,n=W(i),i=_(n)}}return s({width:d,height:f,x:l,y:u})}function rn(e,t){let n=L(e).scrollLeft;return t?t.left+n:nn(oe(e)).left+n}function an(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-rn(e,n),y:n.top+t.scrollTop}}function on(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=oe(r),s=t?ne(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=A(1),u=A(0),d=R(r);if((d||!d&&!a)&&((h(r)!==`body`||T(o))&&(c=L(r)),d)){let e=nn(r);l=Qt(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?an(o,c):A(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function sn(e){return Array.from(e.getClientRects())}function cn(e){let t=oe(e),n=L(e),r=e.ownerDocument.body,i=H(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=H(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),o=-n.scrollLeft+rn(e),s=-n.scrollTop;return p(r).direction===`rtl`&&(o+=H(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}var ln=25;function un(e,t){let n=W(e),r=oe(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;let e=it();(!e||e&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}let l=rn(r);if(l<=0){let e=r.ownerDocument,t=e.body,n=getComputedStyle(t),i=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,o=Math.abs(r.clientWidth-t.clientWidth-i);o<=ln&&(a-=o)}else l<=ln&&(a+=l);return{width:a,height:o,x:s,y:c}}function dn(e,t){let n=nn(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=R(e)?Qt(e):A(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function fn(e,t,n){let r;if(t===`viewport`)r=un(e,n);else if(t===`document`)r=cn(oe(e));else if(F(t))r=dn(t,n);else{let n=en(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return s(r)}function pn(e,t){let n=l(e);return n===t||!F(n)||y(n)?!1:p(n).position===`fixed`||pn(n,t)}function mn(e,t){let n=t.get(e);if(n)return n;let r=Fe(e,[],!1).filter(e=>F(e)&&h(e)!==`body`),i=null,a=p(e).position===`fixed`,o=a?l(e):e;for(;F(o)&&!y(o);){let t=p(o),n=N(o);!n&&t.position===`fixed`&&(i=null),(a?!n&&!i:!n&&t.position===`static`&&i&&(i.position===`absolute`||i.position===`fixed`)||T(o)&&!n&&pn(e,o))?r=r.filter(e=>e!==o):i=t,o=l(o)}return t.set(e,r),r}function hn(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?ne(t)?[]:mn(t,this._c):[].concat(n),r],o=fn(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=fn(t,a[e],i);s=H(n.top,s),c=te(n.right,c),l=te(n.bottom,l),u=H(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function gn(e){let{width:t,height:n}=Xt(e);return{width:t,height:n}}function _n(e,t,n){let r=R(t),i=oe(t),a=n===`fixed`,o=nn(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=A(0);function l(){c.x=rn(i)}if(r||!r&&!a)if((h(t)!==`body`||T(i))&&(s=L(t)),r){let e=nn(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else i&&l();a&&!r&&i&&l();let u=i&&!r&&!a?an(i,s):A(0);return{x:o.left+s.scrollLeft-c.x-u.x,y:o.top+s.scrollTop-c.y-u.y,width:o.width,height:o.height}}function vn(e){return p(e).position===`static`}function yn(e,t){if(!R(e)||p(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return oe(e)===n&&(n=n.ownerDocument.body),n}function bn(e,t){let n=W(e);if(ne(e))return n;if(!R(e)){let t=l(e);for(;t&&!y(t);){if(F(t)&&!vn(t))return t;t=l(t)}return n}let r=yn(e,t);for(;r&&j(r)&&vn(r);)r=yn(r,t);return r&&y(r)&&vn(r)&&!N(r)?n:r||$e(e)||n}var xn=async function(e){let t=this.getOffsetParent||bn,n=this.getDimensions,r=await n(e.floating);return{reference:_n(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Sn(e){return p(e).direction===`rtl`}var Cn={convertOffsetParentRelativeRectToViewportRelativeRect:on,getDocumentElement:oe,getClippingRect:hn,getOffsetParent:bn,getElementRects:xn,getClientRects:sn,getDimensions:gn,getScale:Qt,isElement:F,isRTL:Sn};function wn(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Tn(e,t){let n=null,r,i=oe(e);function a(){var e;clearTimeout(r),(e=n)==null||e.disconnect(),n=null}function o(s,c){s===void 0&&(s=!1),c===void 0&&(c=1),a();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(s||t(),!f||!p)return;let m=rt(d),h=rt(i.clientWidth-(u+f)),g=rt(i.clientHeight-(d+p)),_=rt(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:H(0,te(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(n!==c){if(!y)return o();n?o(!1,n):r=setTimeout(()=>{o(!1,1e-7)},1e3)}n===1&&!wn(l,e.getBoundingClientRect())&&o(),y=!1}try{n=new IntersectionObserver(b,{...v,root:i.ownerDocument})}catch{n=new IntersectionObserver(b,v)}n.observe(e)}return o(!0),a}function En(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=Zt(e),u=i||a?[...l?Fe(l):[],...t?Fe(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n,{passive:!0}),a&&e.addEventListener(`resize`,n)});let d=l&&s?Tn(l,n):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?nn(e):null;c&&g();function g(){let t=nn(e);h&&!wn(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var Dn=Kt,On=qt,kn=Bt,An=Yt,jn=Ut,Mn=Jt,Nn=(e,t,n)=>{let r=new Map,i={platform:Cn,...n},a={...i.platform,_c:r};return zt(e,t,{...i,platform:a})},Pn=typeof document<`u`?Q.useLayoutEffect:function(){};function Fn(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,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Fn(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!Fn(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function In(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Ln(e,t){let n=In(e);return Math.round(t*n)/n}function Rn(e){let t=Q.useRef(e);return Pn(()=>{t.current=e}),t}function zn(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=Q.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=Q.useState(r);Fn(f,r)||p(r);let[m,h]=Q.useState(null),[g,_]=Q.useState(null),v=Q.useCallback(e=>{e!==S.current&&(S.current=e,h(e))},[]),y=Q.useCallback(e=>{e!==C.current&&(C.current=e,_(e))},[]),b=a||m,x=o||g,S=Q.useRef(null),C=Q.useRef(null),w=Q.useRef(u),T=c!=null,E=Rn(c),D=Rn(i),O=Rn(l),k=Q.useCallback(()=>{if(!S.current||!C.current)return;let e={placement:t,strategy:n,middleware:f};D.current&&(e.platform=D.current),Nn(S.current,C.current,e).then(e=>{let t={...e,isPositioned:O.current!==!1};A.current&&!Fn(w.current,t)&&(w.current=t,xt.flushSync(()=>{d(t)}))})},[f,t,n,D,O]);Pn(()=>{l===!1&&w.current.isPositioned&&(w.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let A=Q.useRef(!1);Pn(()=>(A.current=!0,()=>{A.current=!1}),[]),Pn(()=>{if(b&&(S.current=b),x&&(C.current=x),b&&x){if(E.current)return E.current(b,x,k);k()}},[b,x,k,E,T]);let j=Q.useMemo(()=>({reference:S,floating:C,setReference:v,setFloating:y}),[v,y]),M=Q.useMemo(()=>({reference:b,floating:x}),[b,x]),N=Q.useMemo(()=>{let e={position:n,left:0,top:0};if(!M.floating)return e;let t=Ln(M.floating,u.x),r=Ln(M.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...In(M.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,M.floating,u.x,u.y]);return Q.useMemo(()=>({...u,update:k,refs:j,elements:M,floatingStyles:N}),[u,k,j,M,N])}var Bn=(e,t)=>{let n=Dn(e);return{name:n.name,fn:n.fn,options:[e,t]}},Vn=(e,t)=>{let n=On(e);return{name:n.name,fn:n.fn,options:[e,t]}},Hn=(e,t)=>({fn:Mn(e).fn,options:[e,t]}),Un=(e,t)=>{let n=kn(e);return{name:n.name,fn:n.fn,options:[e,t]}},Wn=(e,t)=>{let n=An(e);return{name:n.name,fn:n.fn,options:[e,t]}},Gn=(e,t)=>{let n=jn(e);return{name:n.name,fn:n.fn,options:[e,t]}};function Kn(e){let{open:t=!1,onOpenChange:n,elements:r={}}=e,i=P(),a=g()!=null,o=pe(()=>new re({open:t,transitionStatus:void 0,onOpenChange:n,referenceElement:r.reference??null,floatingElement:r.floating??null,triggerElements:new Ce,floatingId:i,syncOnly:!1,nested:a})).current;return q(()=>{let e={open:t,floatingId:i};r.reference!==void 0&&(e.referenceElement=r.reference,e.domReferenceElement=F(r.reference)?r.reference:null),r.floating!==void 0&&(e.floatingElement=r.floating),o.update(e)},[t,i,r.reference,r.floating,o]),o.context.onOpenChange=n,o.context.nested=a,o}function qn(e={}){let{nodeId:t,externalTree:n}=e,r=Kn(e),i=e.rootContext||r,a=i.useState(`referenceElement`),o=i.useState(`floatingElement`),s=i.useState(`domReferenceElement`),c=i.useState(`open`),l=i.useState(`floatingId`),[u,d]=Q.useState(null),[f,p]=Q.useState(void 0),[h,g]=Q.useState(void 0),_=Q.useRef(null),v=m(n),y=Q.useMemo(()=>({reference:a,floating:o,domReference:s}),[a,o,s]),b=zn({...e,elements:{...y,...u&&{reference:u}}}),x=F(f)?f:null,S=h===void 0?i.state.floatingElement:h;i.useSyncedValue(`referenceElement`,f??null),i.useSyncedValue(`domReferenceElement`,f===void 0?s:x),i.useSyncedValue(`floatingElement`,S);let C=Q.useCallback(e=>{let t=F(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),getClientRects:()=>e.getClientRects(),contextElement:e}:e;d(t),b.refs.setReference(t)},[b.refs]),w=Q.useCallback(e=>{(F(e)||e===null)&&(_.current=e,p(e)),(F(b.refs.reference.current)||b.refs.reference.current===null||e!==null&&!F(e))&&b.refs.setReference(e)},[b.refs,p]),T=Q.useCallback(e=>{g(e),b.refs.setFloating(e)},[b.refs]),E=Q.useMemo(()=>({...b.refs,setReference:w,setFloating:T,setPositionReference:C,domReference:_}),[b.refs,w,T,C]),D=Q.useMemo(()=>({...b.elements,domReference:s}),[b.elements,s]),O=Q.useMemo(()=>({...b,dataRef:i.context.dataRef,open:c,onOpenChange:i.setOpen,events:i.context.events,floatingId:l,refs:E,elements:D,nodeId:t,rootStore:i}),[b,E,D,t,i,c,l]);return q(()=>{s&&(_.current=s)},[s]),q(()=>{i.context.dataRef.current.floatingContext=O;let e=v?.nodesRef.current.find(e=>e.id===t);e&&(e.context=O)}),Q.useMemo(()=>({...b,context:O,refs:E,elements:D,rootStore:i}),[b,E,D,O,i])}var Jn=C&&ue;function Yn(e,t={}){let{enabled:n=!0,delay:r}=t,i=`rootStore`in e?e.rootStore:e,{events:a,dataRef:o}=i.context,s=Q.useRef(!1),c=Q.useRef(null),l=Q.useRef(!0),u=fe();Q.useEffect(()=>{let e=i.select(`domReferenceElement`);if(!n)return;let t=W(e);function r(){let e=i.select(`domReferenceElement`);!i.select(`open`)&&R(e)&&e===be(Be(e))&&(s.current=!0)}function a(){l.current=!0}function o(){l.current=!1}return ve(G(t,`blur`,r),Jn&&G(t,`keydown`,a,!0),Jn&&G(t,`pointerdown`,o,!0))},[i,n]),Q.useEffect(()=>{if(!n)return;function e(e){if(e.reason===`trigger-press`||e.reason===`escape-key`){let e=i.select(`domReferenceElement`);F(e)&&(c.current=e,s.current=!0)}}return a.on(`openchange`,e),()=>{a.off(`openchange`,e)}},[a,n,i]);let d=Q.useMemo(()=>{function e(){s.current=!1,c.current=null}return{onMouseLeave(){e()},onFocus(t){let n=t.currentTarget;if(s.current){if(c.current===n)return;e()}let a=ie(t.nativeEvent);if(F(a)){if(Jn&&!t.relatedTarget){if(!l.current&&!Ze(a))return}else if(!nt(a))return}let o=ge(t.relatedTarget,i.context.triggerElements),{nativeEvent:d,currentTarget:f}=t,p=typeof r==`function`?r():r;if(i.select(`open`)&&o||p===0||p===void 0){i.setOpen(!0,Y(De,d,f));return}u.start(p,()=>{s.current||i.setOpen(!0,Y(De,d,f))})},onBlur(t){e();let n=t.relatedTarget,r=t.nativeEvent,a=F(n)&&n.hasAttribute(ee(`focus-guard`))&&n.getAttribute(`data-type`)===`outside`;u.start(0,()=>{let e=i.select(`domReferenceElement`),t=be(Be(e));!n&&t===e||X(o.current.floatingContext?.refs.floating.current,t)||X(e,t)||a||ge(n??t,i.context.triggerElements)||i.setOpen(!1,Y(De,r))})}}},[o,r,i,u]);return Q.useMemo(()=>n?{reference:d,trigger:d}:{},[n,d])}var Xn=class e{constructor(){this.pointerType=void 0,this.interactedInside=!1,this.handler=void 0,this.blockMouseMove=!0,this.performedPointerEventsMutation=!1,this.pointerEventsScopeElement=null,this.pointerEventsReferenceElement=null,this.pointerEventsFloatingElement=null,this.restTimeoutPending=!1,this.openChangeTimeout=new ce,this.restTimeout=new ce,this.handleCloseOptions=void 0}static create(){return new e}dispose=()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()};disposeEffect=()=>this.dispose},Zn=new WeakMap;function Qn(e){if(!e.performedPointerEventsMutation)return;let t=e.pointerEventsScopeElement;t&&Zn.get(t)===e&&(e.pointerEventsScopeElement?.style.removeProperty(`pointer-events`),e.pointerEventsReferenceElement?.style.removeProperty(`pointer-events`),e.pointerEventsFloatingElement?.style.removeProperty(`pointer-events`),Zn.delete(t)),e.performedPointerEventsMutation=!1,e.pointerEventsScopeElement=null,e.pointerEventsReferenceElement=null,e.pointerEventsFloatingElement=null}function $n(e,t){let{scopeElement:n,referenceElement:r,floatingElement:i}=t,a=Zn.get(n);a&&a!==e&&Qn(a),Qn(e),e.performedPointerEventsMutation=!0,e.pointerEventsScopeElement=n,e.pointerEventsReferenceElement=r,e.pointerEventsFloatingElement=i,Zn.set(n,e),n.style.pointerEvents=`none`,r.style.pointerEvents=`auto`,i.style.pointerEvents=`auto`}function er(e){let t=e.context.dataRef.current,n=pe(()=>t.hoverInteractionState??Xn.create()).current;return t.hoverInteractionState||=n,x(t.hoverInteractionState.disposeEffect),t.hoverInteractionState}function tr(e,t={}){let{enabled:n=!0,closeDelay:r=0,nodeId:i}=t,a=`rootStore`in e?e.rootStore:e,o=a.useState(`open`),s=a.useState(`floatingElement`),c=a.useState(`domReferenceElement`),{dataRef:l}=a.context,u=m(),d=g(),f=er(a),p=fe(),h=J(()=>Dt(l.current.openEvent?.type,f.interactedInside)),_=J(()=>Ot(l.current.openEvent?.type)),y=J(()=>{Qn(f)});q(()=>{o||(f.pointerType=void 0,f.restTimeoutPending=!1,f.interactedInside=!1,y())},[o,f,y]),Q.useEffect(()=>y,[y]),q(()=>{if(n&&o&&f.handleCloseOptions?.blockPointerEvents&&_()&&F(c)&&s){let e=c,t=s,n=Be(s),r=u?.nodesRef.current.find(e=>e.id===d)?.context?.elements.floating;r&&(r.style.pointerEvents=``);let i=f.pointerEventsScopeElement===t?null:f.pointerEventsScopeElement,a=r===t?null:r;return $n(f,{scopeElement:f.handleCloseOptions?.getScope?.()??i??a??e.closest(`[data-rootownerid]`)??n.body,referenceElement:e,floatingElement:t}),()=>{y()}}},[n,o,c,s,f,_,u,d,y]),Q.useEffect(()=>{if(!n)return;function e(){return!!(u&&d&&v(u.nodesRef.current,d).length>0)}function t(e){let t=Tt(r,`close`,f.pointerType),n=()=>{a.setOpen(!1,Y(K,e)),u?.events.emit(`floating.closed`,e)};t?f.openChangeTimeout.start(t,n):(f.openChangeTimeout.clear(),n())}function o(e){let t=ie(e);if(!ke(t)){f.interactedInside=!1;return}f.interactedInside=t?.closest(`[aria-haspopup]`)!=null}function c(){f.openChangeTimeout.clear(),p.clear(),u?.events.off(`floating.closed`,g),y()}function m(n){if(e()&&u){u.events.on(`floating.closed`,g);return}if(ge(n.relatedTarget,a.context.triggerElements))return;let r=l.current.floatingContext?.nodeId??i,o=n.relatedTarget;if(!(u&&r&&F(o)&&v(u.nodesRef.current,r,!1).some(e=>X(e.context?.elements.floating,o)))){if(f.handler){f.handler(n);return}y(),_()&&!h()&&t(n)}}function g(t){!u||!d||e()||p.start(0,()=>{u.events.off(`floating.closed`,g),a.setOpen(!1,Y(K,t)),u.events.emit(`floating.closed`,t)})}let b=s;return ve(b&&G(b,`mouseenter`,c),b&&G(b,`mouseleave`,m),b&&G(b,`pointerdown`,o,!0),()=>{u?.events.off(`floating.closed`,g)})},[n,s,a,l,r,i,_,h,y,f,u,d,p])}var nr={current:null};function rr(e,t={}){let{enabled:n=!0,delay:r=0,handleClose:i=null,mouseOnly:a=!1,restMs:o=0,move:s=!0,triggerElementRef:c=nr,externalTree:l,isActiveTrigger:u=!0,getHandleCloseContext:f,isClosing:p,shouldOpen:h}=t,g=`rootStore`in e?e.rootStore:e,{dataRef:_,events:v}=g.context,y=m(l),b=er(g),x=Q.useRef(!1),S=U(i),C=U(r),w=U(o),T=U(n),E=U(h),D=U(p),O=J(()=>Dt(_.current.openEvent?.type,b.interactedInside)),k=J(()=>E.current?.()!==!1),A=J((e,t,n)=>{let r=g.context.triggerElements;if(r.hasElement(t))return!e||!X(e,t);if(!F(n))return!1;let i=n;return r.hasMatchingElement(e=>X(e,i))&&(!e||!X(e,i))}),j=J(()=>{b.handler&&=(Be(g.select(`domReferenceElement`)).removeEventListener(`mousemove`,b.handler),void 0)}),M=J(()=>{Qn(b)});return u&&(b.handleCloseOptions=S.current?.__options),Q.useEffect(()=>j,[j]),Q.useEffect(()=>{if(!n)return;function e(e){e.open?x.current=!1:(x.current=e.reason===K,j(),b.openChangeTimeout.clear(),b.restTimeout.clear(),b.blockMouseMove=!0,b.restTimeoutPending=!1)}return v.on(`openchange`,e),()=>{v.off(`openchange`,e)}},[n,v,b,j]),Q.useEffect(()=>{if(!n)return;function e(e,t=!0){let n=Tt(C.current,`close`,b.pointerType);n?b.openChangeTimeout.start(n,()=>{g.setOpen(!1,Y(K,e)),y?.events.emit(`floating.closed`,e)}):t&&(b.openChangeTimeout.clear(),g.setOpen(!1,Y(K,e)),y?.events.emit(`floating.closed`,e))}let t=c.current??(u?g.select(`domReferenceElement`):null);if(!F(t))return;function r(e){if(b.openChangeTimeout.clear(),b.blockMouseMove=!1,a&&!d(b.pointerType))return;let t=Et(w.current),n=Tt(C.current,`open`,b.pointerType),r=ie(e),i=e.currentTarget??null,o=g.select(`domReferenceElement`),s=i;if(F(r)&&!g.context.triggerElements.hasElement(r)){for(let e of g.context.triggerElements.elements())if(X(e,r)){s=e;break}}F(i)&&F(o)&&!g.context.triggerElements.hasElement(i)&&X(i,o)&&(s=o);let c=s==null?!1:A(o,s,r),l=g.select(`open`),u=D.current?.()??g.select(`transitionStatus`)===`ending`,f=!l&&u&&x.current,p=!c&&F(s)&&F(o)&&X(o,s)&&f,m=t>0&&!n,h=c&&(l||f)||p,_=!l||c;if(h){k()&&g.setOpen(!0,Y(K,e,s));return}m||(n?b.openChangeTimeout.start(n,()=>{_&&k()&&g.setOpen(!0,Y(K,e,s))}):_&&k()&&g.setOpen(!0,Y(K,e,s)))}function i(t){if(O()){M();return}j();let n=Be(g.select(`domReferenceElement`));b.restTimeout.clear(),b.restTimeoutPending=!1;let r=_.current.floatingContext??f?.();if(!ge(t.relatedTarget,g.context.triggerElements)){if(S.current&&r){g.select(`open`)||b.openChangeTimeout.clear();let i=c.current;b.handler=S.current({...r,tree:y,x:t.clientX,y:t.clientY,onClose(){M(),j(),T.current&&!O()&&i===g.select(`domReferenceElement`)&&e(t,!0)}}),n.addEventListener(`mousemove`,b.handler),b.handler(t);return}(b.pointerType!==`touch`||!X(g.select(`floatingElement`),t.relatedTarget))&&e(t)}}return s?ve(G(t,`mousemove`,r,{once:!0}),G(t,`mouseenter`,r),G(t,`mouseleave`,i)):ve(G(t,`mouseenter`,r),G(t,`mouseleave`,i))},[j,M,_,C,g,n,S,b,u,A,O,a,s,w,c,y,T,f,D,k]),Q.useMemo(()=>{if(!n)return;function e(e){b.pointerType=e.pointerType}return{onPointerDown:e,onPointerEnter:e,onMouseMove(e){let{nativeEvent:t}=e,n=e.currentTarget,r=g.select(`domReferenceElement`),i=g.select(`open`),o=A(r,n,e.target);if(a&&!d(b.pointerType))return;if(i&&o&&b.handleCloseOptions?.blockPointerEvents){let e=g.select(`floatingElement`);e&&$n(b,{scopeElement:b.handleCloseOptions?.getScope?.()??n.ownerDocument.body,referenceElement:n,floatingElement:e})}let s=Et(w.current);if(i&&!o||s===0||!o&&b.restTimeoutPending&&e.movementX**2+e.movementY**2<2)return;b.restTimeout.clear();function c(){if(b.restTimeoutPending=!1,O())return;let e=g.select(`open`);!b.blockMouseMove&&(!e||o)&&k()&&g.setOpen(!0,Y(K,t,n))}b.pointerType===`touch`?xt.flushSync(()=>{c()}):o&&i?c():(b.restTimeoutPending=!0,b.restTimeout.start(s,c))}}},[n,b,O,A,a,g,w,k])}var ir=.1,ar=ir*ir,$=.5;function or(e,t,n,r,i,a){return r>=t!=a>=t&&e<=(i-n)*(t-r)/(a-r)+n}function sr(e,t,n,r,i,a,o,s,c,l){let u=!1;return or(e,t,n,r,i,a)&&(u=!u),or(e,t,i,a,o,s)&&(u=!u),or(e,t,o,s,c,l)&&(u=!u),or(e,t,c,l,n,r)&&(u=!u),u}function cr(e,t,n){return e>=n.x&&e<=n.x+n.width&&t>=n.y&&t<=n.y+n.height}function lr(e,t,n,r,i,a){return e>=Math.min(n,i)&&e<=Math.max(n,i)&&t>=Math.min(r,a)&&t<=Math.max(r,a)}function ur(e={}){let{blockPointerEvents:t=!1}=e,n=new ce,r=({x:e,y:t,placement:r,elements:i,onClose:a,nodeId:o,tree:s})=>{let c=r?.split(`-`)[0],l=!1,u=null,d=null,f=typeof performance<`u`?performance.now():0;function p(e,t){let n=performance.now(),r=n-f;if(u===null||d===null||r===0)return u=e,d=t,f=n,!1;let i=e-u,a=t-d,o=i*i+a*a,s=r*r*ar;return u=e,d=t,f=n,o<s}function m(){n.clear(),a()}return function(r){n.clear();let a=i.domReference,u=i.floating;if(!a||!u||c==null||e==null||t==null)return;let{clientX:d,clientY:f}=r,h=ie(r),g=r.type===`mouseleave`,_=X(u,h),y=X(a,h);if(_&&(l=!0,!g))return;if(y&&(l=!1,!g)){l=!0;return}if(g&&F(r.relatedTarget)&&X(u,r.relatedTarget))return;function b(){return!!(s&&v(s.nodesRef.current,o).length>0)}function x(){b()||m()}if(b())return;let S=a.getBoundingClientRect(),C=u.getBoundingClientRect(),w=e>C.right-C.width/2,T=t>C.bottom-C.height/2,E=C.width>S.width,D=C.height>S.height,O=(E?S:C).left,k=(E?S:C).right,A=(D?S:C).top,j=(D?S:C).bottom;if(c===`top`&&t>=S.bottom-1||c===`bottom`&&t<=S.top+1||c===`left`&&e>=S.right-1||c===`right`&&e<=S.left+1){x();return}let M=!1;switch(c){case`top`:M=lr(d,f,O,S.top+1,k,C.bottom-1);break;case`bottom`:M=lr(d,f,O,C.top+1,k,S.bottom-1);break;case`left`:M=lr(d,f,C.right-1,j,S.left+1,A);break;case`right`:M=lr(d,f,S.right-1,j,C.left+1,A);break;default:}if(M)return;if(l&&!cr(d,f,S)){x();return}if(!g&&p(d,f)){x();return}let N=!1;switch(c){case`top`:{let n=E?$/2:$*4,r=E||w?e+n:e-n,i=E?e-n:w?e+n:e-n,a=t+$+1,o=w||E?C.bottom-$:C.top,s=w?E?C.bottom-$:C.top:C.bottom-$;N=sr(d,f,r,a,i,a,C.left,o,C.right,s);break}case`bottom`:{let n=E?$/2:$*4,r=E||w?e+n:e-n,i=E?e-n:w?e+n:e-n,a=t-$,o=w||E?C.top+$:C.bottom,s=w?E?C.top+$:C.bottom:C.top+$;N=sr(d,f,r,a,i,a,C.left,o,C.right,s);break}case`left`:{let n=D?$/2:$*4,r=D||T?t+n:t-n,i=D?t-n:T?t+n:t-n,a=e+$+1,o=T||D?C.right-$:C.left,s=T?D?C.right-$:C.left:C.right-$;N=sr(d,f,o,C.top,s,C.bottom,a,r,a,i);break}case`right`:{let n=D?$/2:$*4,r=D||T?t+n:t-n,i=D?t-n:T?t+n:t-n,a=e-$,o=T||D?C.left+$:C.right,s=T?D?C.left+$:C.right:C.left+$;N=sr(d,f,a,r,a,i,o,C.top,s,C.bottom);break}default:}N?l||n.start(40,x):x()}};return r.__options={...e,blockPointerEvents:t},r}var dr={...Je,disabled:Qe(e=>e.disabled),instantType:Qe(e=>e.instantType),isInstantPhase:Qe(e=>e.isInstantPhase),trackCursorAxis:Qe(e=>e.trackCursorAxis),disableHoverablePopup:Qe(e=>e.disableHoverablePopup),lastOpenChangeReason:Qe(e=>e.openChangeReason),closeOnClick:Qe(e=>e.closeOnClick),closeDelay:Qe(e=>e.closeDelay),hasViewport:Qe(e=>e.hasViewport)},fr=class e extends f{constructor(e,t,n=!1){let r=new Ce,i={...pr(),...e};i.floatingRootContext=Ie(r,t,n),super(i,{popupRef:Q.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:r},dr)}setOpen=(e,t)=>{He(this,e,t,{extraState:{openChangeReason:t.reason}})};cancelPendingOpen(e){this.state.floatingRootContext.dispatchOpenChange(!1,Y(Re,e))}static useStore(t,n){return Xe(t,(t,r)=>new e(n,t,r)).store}};function pr(){return{...xe(),disabled:!1,instantType:void 0,isInstantPhase:!1,trackCursorAxis:`none`,disableHoverablePopup:!1,openChangeReason:null,closeOnClick:!0,closeDelay:0,hasViewport:!1}}var mr=D(function(e){let{disabled:t=!1,defaultOpen:n=!1,open:r,disableHoverablePopup:i=!1,trackCursorAxis:a=`none`,actionsRef:o,onOpenChange:s,onOpenChangeComplete:c,handle:l,triggerId:u,defaultTriggerId:d=null,children:f}=e,p=fr.useStore(l?.store,{open:n,openProp:r,activeTriggerId:d,triggerIdProp:u});Ae(p,r,n,d),p.useControlledProp(`openProp`,r),p.useControlledProp(`triggerIdProp`,u),p.useContextCallback(`onOpenChange`,s),p.useContextCallback(`onOpenChangeComplete`,c);let m=p.useState(`open`),h=!t&&m,g=p.useState(`activeTriggerId`),_=p.useState(`mounted`),v=p.useState(`payload`);p.useSyncedValues({trackCursorAxis:a,disableHoverablePopup:i}),p.useSyncedValue(`disabled`,t),Le(p,{closeOnActiveTriggerUnmount:!0});let{forceUnmount:y,transitionStatus:b}=Oe(h,p),x=p.useState(`isInstantPhase`),S=p.useState(`instantType`),C=p.useState(`lastOpenChangeReason`),w=Q.useRef(null);q(()=>{m&&t&&p.setOpen(!1,Y(Se))},[m,t,p]),q(()=>{b===`ending`&&C===`none`||b!==`ending`&&x?(S!==`delay`&&(w.current=S),p.set(`instantType`,`delay`)):w.current!==null&&(p.set(`instantType`,w.current),w.current=null)},[b,x,C,S,p]),q(()=>{h&&(g??p.set(`payload`,void 0))},[p,g,h]);let T=Q.useCallback(()=>{p.setOpen(!1,Y(Ye))},[p]);Q.useImperativeHandle(o,()=>({unmount:y,close:T}),[y,T]);let E=h||_||!t&&a!==`none`;return(0,Z.jsxs)(St.Provider,{value:p,children:[E&&(0,Z.jsx)(hr,{store:p,disabled:t,trackCursorAxis:a}),typeof f==`function`?f({payload:v}):f]})});function hr({store:e,disabled:t,trackCursorAxis:n}){let r=e.useState(`floatingRootContext`),i=ae(r,{enabled:!t,referencePress:()=>e.select(`closeOnClick`)}),a=Ft(r,{enabled:!t&&n!==`none`,axis:n===`none`?void 0:n});return he(e,{activeTriggerProps:Q.useMemo(()=>M(a.reference,i.reference),[a.reference,i.reference]),inactiveTriggerProps:Q.useMemo(()=>M(a.trigger,i.trigger),[a.trigger,i.trigger]),popupProps:Q.useMemo(()=>M(Ee,a.floating,i.floating),[a.floating,i.floating])}),null}var gr=Q.createContext(void 0);function _r(){return Q.useContext(gr)}var vr=function(e){return e[e.popupOpen=_e.popupOpen]=`popupOpen`,e.triggerDisabled=`data-trigger-disabled`,e}({}),yr=`data-base-ui-tooltip-trigger`;function br(e){if(`composedPath`in e){let t=e.composedPath();for(let e=0;e<t.length;e+=1){let n=t[e];if(F(n))return n}}let t=e.target;return F(t)?t:null}function xr(e){let t=e;for(;t;){if(t.hasAttribute(yr))return t;let e=t.parentElement;if(e){t=e;continue}let n=t.getRootNode();t=`host`in n&&F(n.host)?n.host:null}return null}var Sr=me(function(e,t){let{render:n,className:r,style:i,handle:a,payload:o,disabled:s,delay:c,closeOnClick:l=!0,closeDelay:u,id:f,...p}=e,m=Ct(!0),h=a?.store??m;if(!h)throw Error(k(82));let g=Me(f),_=h.useState(`isTriggerActive`,g),v=h.useState(`isOpenedByTrigger`,g),y=h.useState(`floatingRootContext`),b=Q.useRef(null),x=c??600,S=u??0,{registerTrigger:C,isMountedByThisTrigger:w}=tt(g,b,h,{payload:o,closeOnClick:l,closeDelay:S}),T=_r(),{delayRef:E,isInstantPhase:D,hasProvider:O}=Mt(y,{open:v}),A=er(y);h.useSyncedValue(`isInstantPhase`,D);let j=h.useState(`disabled`),M=s??j,N=U(M),P=h.useState(`trackCursorAxis`),F=h.useState(`disableHoverablePopup`),I=Q.useRef(!1),L=fe(),ee=Q.useRef(void 0);function R(){let e=T?.delay,t=typeof E.current==`object`?E.current.open:void 0,n=x;return O&&(n=t===0?0:c??e??x),n}function te(e){let t=b.current;if(!t||!e)return!1;let n=xr(e);return n!==null&&n!==t&&X(t,n)}function z(e){let t=te(e);return I.current=t,t&&(A.openChangeTimeout.clear(),A.restTimeout.clear(),A.restTimeoutPending=!1,L.clear()),t}let ne=rr(y,{enabled:!M,mouseOnly:!0,move:!1,handleClose:!F&&P!==`both`?ur():null,restMs:R,delay(){let e=typeof E.current==`object`?E.current.close:void 0,t=S;return u==null&&O&&(t=e),{close:t}},triggerElementRef:b,isActiveTrigger:_,isClosing:()=>h.select(`transitionStatus`)===`ending`,shouldOpen(){return!I.current}}),re=Yn(y,{enabled:!M}).reference,ie=e=>{let t=I.current,n=br(e),r=z(n),i=b.current,a=i&&n&&X(i,n);if(r&&h.select(`open`)&&h.select(`lastOpenChangeReason`)===`trigger-hover`){h.setOpen(!1,Y(K,e));return}if(t&&!r&&a&&!N.current&&!h.select(`open`)&&i&&d(ee.current)){let t=()=>{!I.current&&!N.current&&!h.select(`open`)&&h.setOpen(!0,Y(K,e,i))},n=R();n===0?(L.clear(),t()):L.start(n,t)}},ae=h.useState(`triggerProps`,w);return Ne(`button`,e,{state:{open:v},ref:[t,C,b],props:[ne,re,w||P!==`none`?ae:void 0,{onMouseOver(e){ie(e.nativeEvent)},onFocus(e){te(br(e.nativeEvent))&&e.preventBaseUIHandler()},onMouseLeave(){I.current=!1,L.clear(),ee.current=void 0},onPointerEnter(e){ee.current=e.pointerType},onPointerDown(e){ee.current=e.pointerType,h.set(`closeOnClick`,l),l&&!h.select(`open`)&&h.cancelPendingOpen(e.nativeEvent)},onClick(e){l&&!h.select(`open`)&&h.cancelPendingOpen(e.nativeEvent)},id:g,[vr.triggerDisabled]:M?``:void 0,[yr]:M?void 0:``},p],stateAttributesMapping:Ge})}),Cr=Q.createContext(void 0);function wr(){let e=Q.useContext(Cr);if(e===void 0)throw Error(k(70));return e}var Tr=Q.forwardRef(function(e,t){let{children:n,container:r,className:i,render:a,style:o,...s}=e,{portalNode:c,portalSubtree:l}=I({container:r,ref:t,componentProps:e,elementProps:s});return!l&&!c?null:(0,Z.jsxs)(Q.Fragment,{children:[l,c&&xt.createPortal(n,c)]})}),Er=Q.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e;return Ct().useState(`mounted`)||n?(0,Z.jsx)(Cr.Provider,{value:n,children:(0,Z.jsx)(Tr,{ref:t,...r})}):null}),Dr=Q.createContext(void 0);function Or(){let e=Q.useContext(Dr);if(e===void 0)throw Error(k(71));return e}var kr=Q.createContext(void 0);function Ar(){return Q.useContext(kr)?.direction??`ltr`}var jr=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:d=0,offsetParent:f=`real`}=z(e,t)||{};if(l==null)return{};let p=E(d),m={x:n,y:r},h=le(i),g=se(h),_=await o.getDimensions(l),v=h===`y`,y=v?`top`:`left`,b=v?`bottom`:`right`,x=v?`clientHeight`:`clientWidth`,S=a.reference[g]+a.reference[h]-m[h]-a.floating[g],C=m[h]-a.reference[h],T=f===`real`?await o.getOffsetParent?.(l):s.floating,D=s.floating[x]||a.floating[g];(!D||!await o.isElement?.(T))&&(D=s.floating[x]||a.floating[g]);let O=S/2-C/2,k=D/2-_[g]/2-1,A=Math.min(p[y],k),j=Math.min(p[b],k),M=A,N=D-_[g]-j,P=D/2-_[g]/2+O,F=w(M,P,N),I=!c.arrow&&u(i)!=null&&P!==F&&a.reference[g]/2-(P<M?A:j)-_[g]/2<0,L=I?P<M?P-M:P-N:0;return{[h]:m[h]+L,data:{[h]:F,centerOffset:P-F-L,...I&&{alignmentOffset:L}},reset:I}}}),Mr=(e,t)=>({...jr(e),options:[e,t]}),Nr=Gn().fn,Pr={name:`hide`,async fn(e){let{width:t,height:n,x:r,y:i}=e.rects.reference,a=t===0&&n===0&&r===0&&i===0;return{data:{referenceHidden:(await Nr(e)).data?.referenceHidden||a}}}},Fr={sideX:`left`,sideY:`top`},Ir={name:`adaptiveOrigin`,async fn(e){let{x:t,y:n,rects:{floating:r},elements:{floating:i},platform:a,strategy:o,placement:s}=e,c=W(i),l=c.getComputedStyle(i);if(!(l.transitionDuration!==`0s`&&l.transitionDuration!==``))return{x:t,y:n,data:Fr};let u=await a.getOffsetParent?.(i),d={width:0,height:0};if(o===`fixed`&&c?.visualViewport)d={width:c.visualViewport.width,height:c.visualViewport.height};else if(u===c){let e=Be(i);d={width:e.documentElement.clientWidth,height:e.documentElement.clientHeight}}else await a.isElement?.(u)&&(d=await a.getDimensions(u));let f=V(s),p=t,m=n;f===`left`&&(p=d.width-(t+r.width)),f===`top`&&(m=d.height-(n+r.height));let h=f===`left`?`right`:Fr.sideX,g=f===`top`?`bottom`:Fr.sideY;return{x:p,y:m,data:{sideX:h,sideY:g}}}};function Lr(e,t,n){let r=e===`inline-start`||e===`inline-end`;return{top:`top`,right:r?n?`inline-start`:`inline-end`:`right`,bottom:`bottom`,left:r?n?`inline-end`:`inline-start`:`left`}[t]}function Rr(e,t,n){let{rects:r,placement:i}=e;return{side:Lr(t,V(i),n),align:u(i)||`center`,anchor:{width:r.reference.width,height:r.reference.height},positioner:{width:r.floating.width,height:r.floating.height}}}function zr(e){let{anchor:t,positionMethod:n=`absolute`,side:r=`bottom`,sideOffset:i=0,align:a=`center`,alignOffset:o=0,collisionBoundary:s,collisionPadding:c=5,sticky:l=!1,arrowPadding:d=5,disableAnchorTracking:f=!1,inline:p,keepMounted:m=!1,floatingRootContext:h,mounted:g,collisionAvoidance:_,shiftCrossAxis:v=!1,nodeId:y,adaptiveOrigin:b,lazyFlip:x=!1,externalTree:S}=e,[C,w]=Q.useState(null);!g&&C!==null&&w(null);let T=_.side||`flip`,E=_.align||`flip`,D=_.fallbackAxisSide||`end`,O=typeof t==`function`?t:void 0,k=J(O),A=O?k:t,j=U(t),M=U(g),N=Ar()===`rtl`,P=C||{top:`top`,right:`right`,bottom:`bottom`,left:`left`,"inline-end":N?`left`:`right`,"inline-start":N?`right`:`left`}[r],F=a===`center`?P:`${P}-${a}`,I=c,L=+(r===`bottom`),ee=+(r===`top`),R=+(r===`right`),te=+(r===`left`);typeof I==`number`?I={top:I+L,right:I+te,bottom:I+ee,left:I+R}:I&&={top:(I.top||0)+L,right:(I.right||0)+te,bottom:(I.bottom||0)+ee,left:(I.left||0)+R};let z={boundary:s===`clipping-ancestors`?`clippingAncestors`:s,padding:I},ne=Q.useRef(null),re=U(i),ie=U(o),ae=typeof i==`function`?0:i,oe=typeof o==`function`?0:o,se=[];p&&se.push(p),se.push(Bn(e=>{let t=Rr(e,r,N),n=typeof re.current==`function`?re.current(t):re.current,i=typeof ie.current==`function`?ie.current(t):ie.current;return{mainAxis:n,crossAxis:i,alignmentAxis:i}},[ae,oe,N,r]));let ce=E===`none`&&T!==`shift`,le=!ce&&(l||v||T===`shift`),ue=T===`none`?null:Un({...z,padding:{top:I.top+1,right:I.right+1,bottom:I.bottom+1,left:I.left+1},mainAxis:!v&&T===`flip`,crossAxis:E===`flip`?`alignment`:!1,fallbackAxisSideDirection:D}),de=ce?null:Vn(e=>{let t=Be(e.elements.floating).documentElement;return{...z,rootBoundary:v?{x:0,y:0,width:t.clientWidth,height:t.clientHeight}:void 0,mainAxis:E!==`none`,crossAxis:le,limiter:l||v?void 0:Hn(e=>{if(!ne.current)return{};let{width:t,height:n}=ne.current.getBoundingClientRect(),r=B(V(e.placement)),i=r===`y`?t:n,a=r===`y`?I.left+I.right:I.top+I.bottom;return{offset:i/2+a/2}})}},[z,l,v,I,E]);T===`shift`||E===`shift`||a===`center`?se.push(de,ue):se.push(ue,de),se.push(Wn({...z,apply({elements:{floating:e},availableWidth:t,availableHeight:n,rects:r}){if(!M.current)return;let i=e.style;i.setProperty(`--available-width`,`${t}px`),i.setProperty(`--available-height`,`${n}px`);let a=W(e).devicePixelRatio||1,{x:o,y:s,width:c,height:l}=r.reference,u=(Math.round((o+c)*a)-Math.round(o*a))/a,d=(Math.round((s+l)*a)-Math.round(s*a))/a;i.setProperty(`--anchor-width`,`${u}px`),i.setProperty(`--anchor-height`,`${d}px`)}}),Mr(e=>({element:ne.current||Be(e.elements.floating).createElement(`div`),padding:d,offsetParent:`floating`}),[d]),{name:`transformOrigin`,fn(e){let{elements:t,middlewareData:n,placement:a,rects:o,y:s}=e,c=V(a),l=B(c),u=ne.current,d=n.arrow?.x||0,f=n.arrow?.y||0,p=u?.clientWidth||0,m=u?.clientHeight||0,h=d+p/2,g=f+m/2,_=Math.abs(n.shift?.y||0),v=o.reference.height/2,y=typeof i==`function`?i(Rr(e,r,N)):i,b=_>y,x={top:`${h}px calc(100% + ${y}px)`,bottom:`${h}px ${-y}px`,left:`calc(100% + ${y}px) ${g}px`,right:`${-y}px ${g}px`}[c],S=`${h}px ${o.reference.y+v-s}px`;return t.floating.style.setProperty(`--transform-origin`,le&&l===`y`&&b?S:x),{}}},Pr,b),q(()=>{!g&&h&&h.update({referenceElement:null,floatingElement:null,domReferenceElement:null,positionReference:null})},[g,h]);let fe=Q.useMemo(()=>({elementResize:!f&&typeof ResizeObserver<`u`,layoutShift:!f&&typeof IntersectionObserver<`u`}),[f]),{refs:pe,elements:me,x:H,y:he,middlewareData:ge,update:_e,placement:ve,context:ye,isPositioned:be,floatingStyles:xe}=qn({rootContext:h,open:m?g:void 0,placement:F,middleware:se,strategy:n,whileElementsMounted:m?void 0:(...e)=>En(...e,fe),nodeId:y,externalTree:S}),{sideX:Se,sideY:Ce}=ge.adaptiveOrigin||Fr,we=be?n:`fixed`,Te=Q.useMemo(()=>{let e=b?{position:we,[Se]:H,[Ce]:he}:{position:we,...xe};return be||(e.opacity=0),e},[b,we,Se,H,Ce,he,xe,be]),Ee=Q.useRef(null);q(()=>{if(!g)return;let e=j.current,t=typeof e==`function`?e():e,n=(Br(t)?t.current:t)||null;n!==Ee.current&&(pe.setPositionReference(n),Ee.current=n)},[g,pe,A,j]),Q.useEffect(()=>{if(!g)return;let e=j.current;typeof e!=`function`&&Br(e)&&e.current!==Ee.current&&(pe.setPositionReference(e.current),Ee.current=e.current)},[g,pe,A,j]),Q.useEffect(()=>{if(m&&g&&me.reference&&me.floating)return En(me.reference,me.floating,_e,fe)},[m,g,me,_e,fe]);let De=V(ve),Oe=Lr(r,De,N),ke=u(ve)||`center`,Ae=!!ge.hide?.referenceHidden;q(()=>{x&&g&&be&&w(De)},[x,g,be,De]);let je=Q.useMemo(()=>({position:`absolute`,top:ge.arrow?.y,left:ge.arrow?.x}),[ge.arrow]),Me=ge.arrow?.centerOffset!==0;return Q.useMemo(()=>({positionerStyles:Te,arrowStyles:je,arrowRef:ne,arrowUncentered:Me,side:Oe,align:ke,physicalSide:De,anchorHidden:Ae,refs:pe,context:ye,isPositioned:be,update:_e}),[Te,je,ne,Me,Oe,ke,De,Ae,pe,ye,be,_e])}function Br(e){return e!=null&&`current`in e}function Vr(e){return e===`starting`?Pe:je}function Hr(e,t,{styles:n,transitionStatus:r,props:i,refs:a,hidden:o,inert:s=!1}){let c={...n};return s&&(c.pointerEvents=`none`),Ne(`div`,e,{state:t,ref:a,props:[{role:`presentation`,hidden:o,style:c},Vr(r),i],stateAttributesMapping:Ve})}var Ur=Q.forwardRef(function(e,t){let{render:n,className:r,anchor:i,positionMethod:a=`absolute`,side:o=`top`,align:s=`center`,sideOffset:l=0,alignOffset:u=0,collisionBoundary:d=`clipping-ancestors`,collisionPadding:f=5,arrowPadding:p=5,sticky:m=!1,disableAnchorTracking:h=!1,collisionAvoidance:g=c,style:_,...v}=e,y=Ct(),b=wr(),x=y.useState(`open`),S=y.useState(`mounted`),C=y.useState(`trackCursorAxis`),w=y.useState(`disableHoverablePopup`),T=y.useState(`floatingRootContext`),E=y.useState(`instantType`),D=y.useState(`transitionStatus`),O=zr({anchor:i,positionMethod:a,floatingRootContext:T,mounted:S,side:o,sideOffset:l,align:s,alignOffset:u,collisionBoundary:d,collisionPadding:f,sticky:m,arrowPadding:p,disableAnchorTracking:h,keepMounted:b,collisionAvoidance:g,adaptiveOrigin:y.useState(`hasViewport`)?Ir:void 0}),k=Hr(e,Q.useMemo(()=>({open:x,side:O.side,align:O.align,anchorHidden:O.anchorHidden,instant:C===`none`?E:`tracking-cursor`}),[x,O.side,O.align,O.anchorHidden,C,E]),{styles:O.positionerStyles,transitionStatus:D,props:v,refs:[t,y.useStateSetter(`positionerElement`)],hidden:!S,inert:!x||C===`both`||w});return(0,Z.jsx)(Dr.Provider,{value:O,children:k})}),Wr={...Ve,...et},Gr=Q.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,o=Ct(),{side:s,align:c}=Or(),l=o.useState(`open`),u=o.useState(`instantType`),d=o.useState(`transitionStatus`),f=o.useState(`popupProps`),p=o.useState(`floatingRootContext`),m=o.useState(`disabled`),h=o.useState(`closeDelay`);ye({open:l,ref:o.context.popupRef,onComplete(){l&&o.context.onOpenChangeComplete?.(!0)}}),tr(p,{enabled:!m,closeDelay:h});let g=o.useStateSetter(`popupElement`);return Ne(`div`,e,{state:{open:l,side:s,align:c,instant:u,transitionStatus:d},ref:[t,o.context.popupRef,g],props:[f,Vr(d),a],stateAttributesMapping:Wr})}),Kr=o({method:`GET`}).handler(r(`aa46310016bb8a58b273a648ffd498c87f1f450d12827e30110a3b83ba6a27d9`)),qr=o({method:`POST`}).handler(r(`ed679b4e1e05e903a5d4ba4a70d9b9d883991ab22ed59b4d2d69078941818415`)),Jr=o({method:`GET`}).handler(r(`169566e7637a22599b4eb32ee3775574e99677406922bbef7482a102036c33dd`)),Yr=o({method:`POST`}).handler(r(`27d7eba0b6a2257949392fdd56057275a5c5366484ae01faf3b5897a225ecd83`)),Xr=o({method:`POST`}).handler(r(`a6384dc7154d9930422d29396f5de64b3ac69c62ad3824bc4a22d745fc07b293`));function Zr(e,t){let n=new Set,r=[];for(let i of[...e,...t])n.has(i.id)||(n.add(i.id),r.push(i));return r.sort((e,t)=>e.ts<t.ts?-1:+(e.ts>t.ts)),r}var Qr=16,$r=`rounded-[4px]`,ei=`h-5 w-[18px] shrink-0 ${$r}`;function ti({run:e,onClick:t}){let n=e.error||e.message||``,r=e.durationMs?` · ${at(e.durationMs)}`:``;return(0,Z.jsxs)(mr,{children:[(0,Z.jsx)(Sr,{render:(0,Z.jsx)(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),t()},"aria-label":ct(e),className:`${ei} cursor-pointer transition-opacity hover:opacity-70`,style:{background:vt(e),...e.running?ut:{}}})}),(0,Z.jsx)(Er,{children:(0,Z.jsx)(Ur,{sideOffset:8,children:(0,Z.jsxs)(Gr,{className:`glass-strong pointer-events-none max-w-[340px] rounded-control px-3.5 py-2.5 text-meta leading-snug text-primary`,children:[(0,Z.jsxs)(`div`,{className:`flex items-center gap-1.5 font-medium`,children:[(0,Z.jsx)(`span`,{className:`size-2 shrink-0 rounded-[2px]`,style:{background:vt(e)}}),ct(e),(0,Z.jsxs)(`span`,{className:`ml-auto whitespace-nowrap pl-3 font-mono text-caption font-normal text-secondary`,children:[_t(e.ts),r]})]}),n&&(0,Z.jsx)(`div`,{className:`mt-1.5 max-h-[150px] overflow-hidden whitespace-pre-wrap ${e.error?`text-accent`:`text-secondary`}`,children:n})]})})})]})}function ni({count:e,onClick:t,loading:n}){return e?(0,Z.jsx)(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),t()},className:`flex h-5 w-[18px] shrink-0 items-center justify-center overflow-hidden border border-wire px-0 font-mono text-[9px] leading-none text-disabled transition-colors hover:border-display hover:text-primary ${$r} ${n?`animate-pulse`:`cursor-pointer`}`,title:`${e} more - click to reveal`,children:n?`…`:e}):null}function ri({job:e,runs:t,total:n,onLoadMore:r,onPickRun:i}){let a=t,o=e.enabled,s=st(e),c=a.length,l=Math.max(0,n-c),u=yt(),[d,f]=(0,Q.useState)(-1),[p,m]=(0,Q.useState)(!1),h=Math.max(0,c-16),g=d<0?h:Math.min(d,h),_=Math.min(g+16,c),v=a.slice(g,_),y=l+g,b=c-_,x=b===0,S=async()=>{let e=g-Qr;if(e<0&&l>0&&!p){m(!0);let e=await r().catch(()=>0);m(!1),f(Math.max(0,g+e-Qr));return}f(Math.max(0,e))},C=()=>{let e=g+Qr;f(e>=h?-1:e)},w=!!(e.running||e.queued)&&x,T=x&&o&&!s&&!!e.nextRun&&!w;return(0,Z.jsxs)(`div`,{className:`flex min-w-0 items-center gap-[3px] overflow-x-auto`,children:[(0,Z.jsx)(ni,{count:y,onClick:S,loading:p}),v.map(e=>(0,Z.jsx)(ti,{run:e,onClick:()=>i(e)},e.id)),T?(0,Z.jsxs)(`div`,{className:`ml-1 flex items-center gap-2`,children:[(0,Z.jsx)(`span`,{className:`w-12 border-t border-dashed border-wire`}),(0,Z.jsx)(`span`,{className:`size-[11px] shrink-0 rounded-full border border-wire`,title:u?`Next scheduled run · ${_t(e.nextRun)}`:void 0}),(0,Z.jsx)(`span`,{className:`text-caption text-disabled`,children:u?ot(e.nextRun):``})]}):!x&&(0,Z.jsx)(ni,{count:b,onClick:C})]})}function ii(e,t,n=Date.now()){let r=t?Date.parse(t):NaN;if(!Number.isFinite(r))return`offline`;let i=n-r;return e&&i<3e4?`online`:i<216e5?`asleep`:`offline`}function ai(e){let t=/^\s*v?(\d+)\.(\d+)\.(\d+)/.exec(e);return t?[Number(t[1]),Number(t[2]),Number(t[3])]:null}function oi(e){return/^\s*v?\d+\.\d+\.\d+-/.test(e)}function si(e,t){if(!e||!t)return!1;let n=ai(e),r=ai(t);if(!n||!r)return!1;for(let e=0;e<3;e++){let t=n[e],i=r[e];if(t<i)return!0;if(t>i)return!1}return oi(e)&&!oi(t)}function ci(e,t,n,r){let i=`${n} daemon start --server-url ${e} --connect-key ${t}`;return r?i:`npm install -g @kky42/pievo@latest && ${i}`}function li(e,t){let n=`${e} daemon restart`;return t?n:`npm install -g @kky42/pievo@latest && ${n}`}function ui(e,t,n){return ci(typeof window<`u`?window.location.origin:`http://127.0.0.1:3000`,e,t,n)}function di({text:e}){let[t,n]=(0,Q.useState)(!1);return(0,Z.jsx)(`button`,{className:mt,onClick:()=>{navigator.clipboard?.writeText(e),n(!0),setTimeout(()=>n(!1),1400)},children:t?`Copied ✓`:`Copy`})}function fi({open:e,onClose:t,teamId:n}){let[r,i]=(0,Q.useState)([]),[o,s]=(0,Q.useState)(null),[c,l]=(0,Q.useState)(null),[u,d]=(0,Q.useState)(``),[f,p]=(0,Q.useState)(!1),[m,h]=(0,Q.useState)(null),[g,_]=(0,Q.useState)(null),[v,y]=(0,Q.useState)(!1);(0,Q.useEffect)(()=>{if(!e){h(null);return}let t=!0;return _(null),y(!1),a().then(e=>{t&&_(e)}).catch(()=>{t&&y(!0)}),()=>{t=!1}},[e]);let b=(0,Q.useCallback)(async()=>{try{i(await Kr({data:n}))}catch{}},[n]),x=(0,Q.useRef)(e);x.current=e,(0,Q.useEffect)(()=>{if(!e||o)return;b();let t=setInterval(()=>x.current&&void b(),3e3);return()=>clearInterval(t)},[e,o,b]),(0,Q.useEffect)(()=>{if(!o)return;let e=!0,t=async()=>{let t=await Jr({data:o.id}).catch(()=>void 0);!e||t===void 0||(l(t),t?.online&&t.hostname&&d(e=>e||t.hostname||``))};t();let n=setInterval(t,2e3);return()=>{e=!1,clearInterval(n)}},[o]);async function S(){p(!0),h(null);try{let e=await qr({data:n});if(`error`in e){h(e.error);return}l(null),d(``),s(e)}finally{p(!1)}}async function C(){o&&await Xr({data:o.id}),s(null),l(null),await b()}async function w(){o&&u.trim()&&await Yr({data:{id:o.id,name:u.trim()}}),s(null),l(null),await b()}async function T(e){h(null);let t=await Xr({data:e});if(!t.ok){h(t.error??`Could not delete this machine.`),await b();return}await b()}let E=!!c?.online;return o?(0,Z.jsxs)(Ke,{open:e,onClose:C,children:[(0,Z.jsx)(ze,{title:E?`Computer connected`:`Connect computer`}),E?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`div`,{className:`mt-5 flex items-center gap-3 rounded-control border border-hairline bg-success-soft px-4 py-3`,children:[(0,Z.jsx)(`span`,{className:`text-xl text-success`,children:`✓`}),(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(`div`,{className:`text-[15px] font-medium text-display`,children:`Computer connected successfully!`}),(0,Z.jsxs)(`div`,{className:`text-label text-secondary`,children:[c?.hostname??`unknown`,c?.platform?` - ${c.platform} ${c.arch??``}`:``]})]})]}),(0,Z.jsxs)(`div`,{className:`mt-5`,children:[(0,Z.jsx)(`label`,{className:pt,children:`Computer name`}),(0,Z.jsx)(`input`,{className:ht,value:u,onChange:e=>d(e.target.value),placeholder:c?.hostname??`My computer`}),(0,Z.jsx)(`div`,{className:`mt-1 text-label text-secondary`,children:`A friendly name for this computer.`})]})]}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`div`,{className:`mt-5 text-body font-medium text-display`,children:`Run this command on your computer to connect:`}),g?(0,Z.jsxs)(`div`,{className:`mt-2 flex items-start gap-2`,children:[(0,Z.jsx)(`pre`,{className:`flex-1 overflow-x-auto whitespace-pre-wrap break-all rounded-control bg-display p-4 font-mono text-label leading-relaxed text-paper`,children:ui(o.token,g.pievoCli,g.customCli)}),(0,Z.jsx)(di,{text:ui(o.token,g.pievoCli,g.customCli)})]}):(0,Z.jsx)(`div`,{className:`mt-2 text-body text-secondary`,children:v?`Could not load the connection command. Close and try again.`:`Loading connection command…`}),(0,Z.jsxs)(`div`,{className:`mt-4 flex items-center gap-2.5 rounded-control border border-hairline bg-warn-soft px-4 py-3`,children:[(0,Z.jsx)(`span`,{className:`inline-block h-2.5 w-2.5 animate-pulse rounded-full bg-rubik-orange`}),(0,Z.jsx)(`span`,{className:`text-[14px] font-medium text-warn`,children:`Waiting for computer to connect…`})]})]}),(0,Z.jsxs)(`div`,{className:`mt-6 flex justify-end gap-2`,children:[(0,Z.jsx)(`button`,{className:mt,onClick:()=>void C(),children:`Cancel`}),(0,Z.jsx)(`button`,{className:ft,disabled:!E||!u.trim(),onClick:()=>void w(),children:`Done`})]})]}):(0,Z.jsxs)(Ke,{open:e,onClose:t,children:[(0,Z.jsx)(ze,{title:`Machines`,sub:`Each machine runs a pievo daemon that executes your loops via your local coding agent.`}),(0,Z.jsx)(We,{children:`Connected machines`}),m&&(0,Z.jsx)(gt,{message:m,onDismiss:()=>h(null)}),r.length===0&&(0,Z.jsx)(`div`,{className:`py-3 text-body text-secondary`,children:`No machines yet.`}),(0,Z.jsx)(`ul`,{className:`flex flex-col gap-2`,children:r.map(e=>{let t=ii(e.online,e.lastSeen),n=t===`online`?`bg-rubik-green`:t===`asleep`?`bg-rubik-yellow`:`bg-disabled`,r=t===`online`?`online`:t===`asleep`?`asleep${e.lastSeen?` · seen ${dt(e.lastSeen)}`:``}`:e.lastSeen?`offline · seen ${dt(e.lastSeen)}`:`offline`;return(0,Z.jsxs)(`li`,{className:`flex flex-col gap-2 rounded-control border border-hairline bg-surface px-4 py-3`,children:[(0,Z.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,Z.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[(0,Z.jsx)(`span`,{className:`inline-block h-2 w-2 rounded-full ${n}`,title:t}),(0,Z.jsx)(`span`,{className:`text-[15px] font-medium text-display`,children:e.name}),(0,Z.jsxs)(`span`,{className:`text-label text-secondary`,children:[r,e.platform?` · ${e.platform} ${e.arch??``}`:``,e.loopCount>0?` · ${e.loopCount} loop${e.loopCount===1?``:`s`}`:``]})]}),(0,Z.jsx)(`button`,{className:lt,disabled:e.loopCount>0,title:e.loopCount>0?`Delete its loops first`:void 0,onClick:()=>void T(e.id),children:`Delete`})]}),(0,Z.jsx)(`div`,{className:`text-label text-secondary`,children:bt(e.daemonProtocol).label}),e.daemonProtocol!==2&&(0,Z.jsx)(`div`,{className:`text-label text-accent`,children:`Daemon upgrade required to stop a running process`}),!e.online&&!e.token&&(0,Z.jsx)(`div`,{className:`text-label text-secondary`,children:`Reconnect command available from the machine owner's account.`}),!e.online&&e.token&&!g&&(0,Z.jsx)(`div`,{className:`text-label text-secondary`,children:v?`Could not load the reconnect command. Close and try again.`:`Loading reconnect command…`}),!e.online&&e.token&&g&&(0,Z.jsxs)(`details`,{children:[(0,Z.jsx)(`summary`,{className:`cursor-pointer select-none text-label font-medium text-secondary marker:content-[''] hover:text-display`,children:`Reconnect command`}),(0,Z.jsxs)(`div`,{className:`mt-2 flex items-start gap-2`,children:[(0,Z.jsx)(`pre`,{className:`flex-1 overflow-x-auto whitespace-pre-wrap break-all rounded-control bg-display p-3 font-mono text-caption leading-relaxed text-paper`,children:ui(e.token,g.pievoCli,g.customCli)}),(0,Z.jsx)(di,{text:ui(e.token,g.pievoCli,g.customCli)})]})]}),si(e.daemonVersion,e.latestDaemonVersion)&&(0,Z.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,Z.jsxs)(`div`,{className:`text-label text-secondary`,children:[`daemon v`,e.daemonVersion,` · upgrade available (v`,e.latestDaemonVersion,`)`]}),g?(0,Z.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,Z.jsx)(`pre`,{className:`flex-1 overflow-x-auto whitespace-pre-wrap break-all rounded-control bg-display p-3 font-mono text-caption leading-relaxed text-paper`,children:li(g.pievoCli,g.customCli)}),(0,Z.jsx)(di,{text:li(g.pievoCli,g.customCli)})]}):(0,Z.jsx)(`div`,{className:`text-label text-secondary`,children:v?`Could not load the upgrade command. Close and try again.`:`Loading upgrade command…`})]})]},e.id)})}),(0,Z.jsx)(`div`,{className:`mt-6`,children:(0,Z.jsx)(`button`,{className:ft,disabled:f,onClick:()=>void S(),children:f?`Preparing…`:`+ Connect computer`})})]})}var pi=o({method:`GET`}).handler(r(`ced5641f28e3e64d3b8773ea4c875b78ee305bd08caba90a2207e86ef1ab3327`)),mi=o({method:`POST`}).handler(r(`d6cb1ea6f7fdaf940fbbe91d6b0898a0d5ac2308f8bc572dc3b856824a1f4581`)),hi=o({method:`POST`}).handler(r(`9defc1b5d0f4316d61621e2c4614a70dc052ad6b7a3aa2ead00836f7d5cb5b4c`)),gi=o({method:`POST`}).handler(r(`a4e3ae06af7087a3dc291236cf6d5ad272e2f754884c1f948e75a18a4ebada93`));export{fi as a,Kr as c,gi as i,gr as l,hi as n,ri as o,pi as r,Zr as s,mi as t,jt as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e,s as t,t as n}from"./jsx-runtime-BseJUIpC.js";var r=t(e(),1),i=e=>e?new Date(e).toLocaleString():`—`,a=e=>{if(!e)return``;let t=Math.round((Date.now()-Date.parse(e))/1e3);if(t<60)return`${t}s ago`;let n=Math.round(t/60);if(n<60)return`${n}m ago`;let r=Math.round(n/60);return r<24?`${r}h ago`:`${Math.round(r/24)}d ago`},o=[`Sun`,`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`];function s(e){let t=(e||``).trim().split(/\s+/);if(t.length!==5)return e;let[n,r,i,a,s]=t,c=i===`*`&&a===`*`,l=r.match(/^\*\/(\d+)$/);if(l&&c&&s===`*`)return`every ${l[1]}h`;let u=n.match(/^\*\/(\d+)$/);if(u&&r===`*`&&c&&s===`*`)return`every ${u[1]}m`;if(r===`*`&&/^\d+$/.test(n)&&c&&s===`*`)return`hourly :${n.padStart(2,`0`)}`;if(/^\d+$/.test(n)&&/^\d+$/.test(r)&&c){let e=`${r.padStart(2,`0`)}:${n.padStart(2,`0`)}`;if(s===`*`)return`daily ${e}`;if(/^[0-6]$/.test(s))return`${o[Number(s)]} ${e}`}return e}var c=e=>{if(!e)return``;let t=Math.round((Date.parse(e)-Date.now())/1e3);if(t<=0)return`due`;let n=Math.round(t/60);if(n<60)return`in ${n}m`;let r=Math.round(n/60);return r<24?`in ${r}h`:`in ${Math.round(r/24)}d`},l=e=>{let t=new Date(e);return`${t.getMonth()+1}/${t.getDate()}`},u=e=>{if(!e)return`—`;let t=new Date(e),n=e=>String(e).padStart(2,`0`);return`${n(t.getMonth()+1)}/${n(t.getDate())} ${n(t.getHours())}:${n(t.getMinutes())}`},d=e=>Math.abs(e)>=1e3?`${Math.round(e/100)/10}k`:`${Math.round(e*100)/100}`,f=e=>e?`${Math.round(e/1e3)}s`:``;function p(e){let t=Math.abs(e);return t<1024?`${t} B`:t<1024*1024?`${(t/1024).toFixed(1)} KB`:`${(t/(1024*1024)).toFixed(1)} MB`}var m={"nothing-new":{c:`var(--color-secondary)`,label:`No update`},new:{c:`var(--color-display)`,label:`New`},resolved:{c:`var(--color-success)`,label:`Resolved`},error:{c:`var(--color-accent)`,label:`Error`},silent:{c:`var(--color-disabled)`,label:`Silent`},evolve:{c:`var(--color-interactive)`,label:`Evolved`}},h=e=>e?m[e]:void 0,g={direct:`Reported`,agent:`Reported`,exec:`Ran`},_=e=>e&&e.charAt(0).toUpperCase()+e.slice(1).replace(/-/g,` `);function v(e){return e.queued?m.silent.c:e.running?e.role===`evolve`?m.evolve.c:m.new.c:e.canceled?m.silent.c:e.outcome===`error`?m.error.c:e.outcome===`evolve`?m.evolve.c:e.outcome===`silent`?m.silent.c:(h(e.status)??m[`nothing-new`]).c}function y(e){return e.queued?`Queued`:e.running?e.cancelRequested?`Stopping…`:e.role===`evolve`?`Evolving…`:`Running…`:e.canceled&&e.error===`stopped by user`?`Canceled`:e.outcome===`skipped`?`Skipped`:e.canceled?`Canceled`:e.cancelRequested&&e.outcome===`error`?`Failed while stopping`:e.cancelRequested&&e.outcome!==`silent`&&e.outcome!==`evolve`?`Succeeded while stopping`:e.outcome===`error`?m.error.label:e.outcome===`evolve`?m.evolve.label:e.outcome===`silent`?m.silent.label:h(e.status)?.label??g[e.outcome]??_(e.outcome)}var b=e=>{let t=e.runs??[];return t.length?t[t.length-1]:null};function x(e){return e.completedAt!=null}function S(e){return e.goal!=null&&e.goal!==``}var C=n(),w=()=>()=>{},T=()=>(0,r.useSyncExternalStore)(w,()=>!0,()=>!1),E=`focus-visible:outline-none focus-visible:shadow-focus`,D=`inline-flex cursor-pointer items-center gap-1.5 rounded-control px-4 py-2 text-body font-medium transition-colors duration-150 disabled:cursor-default disabled:opacity-40 ${E}`,O=`${D} border border-wire bg-surface text-primary hover:bg-raised`,k=`${D} border border-display bg-display text-paper hover:opacity-85`,A=`${D} border border-transparent bg-rubik-red text-white hover:opacity-85`,j=`${D} border border-display bg-transparent text-display hover:bg-[color:var(--color-display)]/8`,M=`inline-flex shrink-0 cursor-pointer items-center gap-1 rounded-full border border-wire bg-surface px-3 py-1 text-label font-medium text-primary transition-colors duration-150 hover:bg-raised disabled:cursor-default disabled:opacity-40 ${E}`,N=`inline-flex shrink-0 cursor-pointer items-center gap-1.5 rounded-full border border-display bg-display px-4 py-2 text-body font-medium text-paper transition-colors duration-150 hover:opacity-85 disabled:cursor-default disabled:opacity-40 ${E}`,P=`inline-flex cursor-pointer items-center gap-1.5 border-none bg-transparent p-0 text-meta font-medium text-secondary transition-colors hover:text-display`,F=`text-label font-semibold text-secondary`,I=`mb-1.5 mt-3 block text-label font-medium text-secondary`,L=`w-full rounded-control border border-wire bg-surface px-3 py-2.5 text-sm text-primary outline-none transition-shadow focus:border-transparent focus:shadow-focus`,R=`${L} lp-select cursor-pointer`,z={animation:`runPulse 1.1s ease-in-out infinite`},B={background:`var(--color-rubik-yellow)`,...z};function V({message:e,onDismiss:t,className:n=`mb-2`}){return(0,C.jsxs)(`div`,{className:`flex items-start gap-2 text-body text-accent ${n}`,children:[(0,C.jsx)(`span`,{className:`mt-[5px] size-2 shrink-0 rounded-full bg-rubik-red`,"aria-hidden":!0}),(0,C.jsx)(`span`,{children:e}),t&&(0,C.jsx)(`button`,{type:`button`,onClick:t,className:`ml-auto shrink-0 cursor-pointer border-none bg-transparent p-0 text-label text-secondary transition-colors hover:text-display`,children:`Dismiss`})]})}function H({children:e}){return(0,C.jsx)(`pre`,{className:`max-h-[300px] overflow-auto whitespace-pre-wrap rounded-control border border-hairline bg-raised px-4 py-3.5 font-mono text-meta leading-relaxed text-secondary`,children:e})}var U={neutral:`bg-raised text-secondary`,ink:`bg-raised text-primary`,outline:`border border-hairline text-secondary`,running:`bg-running-soft text-running`,success:`bg-success-soft text-success`,accent:`bg-accent-soft text-accent`,warn:`bg-warn-soft text-warn`};function W({tone:e=`neutral`,dot:t,title:n,children:r}){return(0,C.jsxs)(`span`,{title:n,className:`inline-flex h-[22px] items-center gap-1.5 rounded-full px-2.5 text-caption font-medium ${U[e]}`,children:[t&&(0,C.jsx)(`span`,{className:`size-1.5 rounded-full`,style:t===`pulse`?B:{background:`var(--color-rubik-green)`}}),r]})}function G({className:e=``}){return(0,C.jsx)(`div`,{className:`text-body text-disabled ${e}`,children:`Loading…`})}function K({run:e,colorText:t}){return(0,C.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 font-medium`,style:t?{color:v(e)}:void 0,children:[(0,C.jsx)(`span`,{className:`size-2 rounded-full`,style:{background:v(e)}}),y(e)]})}export{l as A,f as C,S as D,p as E,u as M,c as N,x as O,y as S,d as T,F as _,K as a,s as b,A as c,P as d,M as f,B as g,z as h,H as i,a as j,b as k,k as l,I as m,G as n,O as o,L as p,W as r,j as s,V as t,N as u,R as v,i as w,v as x,T as y};
|